From a120be7d4c67b1ef2cf7bca581fa6603f231e5e4 Mon Sep 17 00:00:00 2001 From: duhuanpeng Date: Sun, 27 Sep 2020 17:32:57 +0800 Subject: asm/debug_ll_ns16550.h: add divisor parameter add a parameter for the assembly version for passing divisor, and set the default value to DEBUG_LL_UART_ADDR when no parameter is given. Now it is possible to recalculate divisor in runtime to keep the baudrate unchanged. when pll settings changed outside of barebox. e.g. jtag. Signed-off-by: duhuanpeng Signed-off-by: Sascha Hauer --- arch/mips/include/asm/debug_ll_ns16550.h | 4 ++-- arch/riscv/include/asm/debug_ll_ns16550.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/mips/include/asm/debug_ll_ns16550.h b/arch/mips/include/asm/debug_ll_ns16550.h index df58c4cf0d..703bfaee77 100644 --- a/arch/mips/include/asm/debug_ll_ns16550.h +++ b/arch/mips/include/asm/debug_ll_ns16550.h @@ -58,14 +58,14 @@ static inline void PUTC_LL(char ch) * Macros for use in assembly language code */ -.macro debug_ll_ns16550_init +.macro debug_ll_ns16550_init divisor=DEBUG_LL_UART_DIVISOR #ifdef CONFIG_DEBUG_LL la t0, DEBUG_LL_UART_ADDR li t1, UART_LCR_DLAB /* DLAB on */ sb t1, UART_LCR(t0) /* Write it out */ - li t1, DEBUG_LL_UART_DIVISOR + li t1, \divisor sb t1, UART_DLL(t0) /* write low order byte */ srl t1, t1, 8 sb t1, UART_DLM(t0) /* write high order byte */ diff --git a/arch/riscv/include/asm/debug_ll_ns16550.h b/arch/riscv/include/asm/debug_ll_ns16550.h index e891cbda25..f1c2ccbd0a 100644 --- a/arch/riscv/include/asm/debug_ll_ns16550.h +++ b/arch/riscv/include/asm/debug_ll_ns16550.h @@ -88,14 +88,14 @@ static inline void debug_ll_ns16550_init(void) * Macros for use in assembly language code */ -.macro debug_ll_ns16550_init +.macro debug_ll_ns16550_init divisor=DEBUG_LL_UART_DIVISOR #ifdef CONFIG_DEBUG_LL li t0, DEBUG_LL_UART_ADDR li t1, UART_LCR_DLAB /* DLAB on */ UART_REG_S t1, UART_LCR(t0) /* Write it out */ - li t1, DEBUG_LL_UART_DIVISOR + li t1, \divisor UART_REG_S t1, UART_DLL(t0) /* write low order byte */ srl t1, t1, 8 UART_REG_S t1, UART_DLM(t0) /* write high order byte */ -- cgit v1.2.3 From ec233330b0c382e79003d50f206c469344fe5960 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 28 Sep 2020 12:08:09 +0200 Subject: ARM: at91: support sama5 low level clock setup with oscillator AT91Bootstrap has a CONFIG_MCK_BYPASS option with following help text: "Use external 8 to 24 Mhz clock signal as source of main clock instead of an external crystal oscillator. This option disables the internal driving on the XOUT pin. The external source has to provide a stable clock on the XIN pin. If this option is disabled, the SoC expects a crystal oscillator that needs driving on both XIN and XOUT lines." When the low level clock setup was ported over from AT91Bootstrap, this config option was dropped. It wasn't necessary for the xplained boards that have a crystal, but for ones with an oscillator, it's required. Add the bit flag back. Suggested-by: Michael Grzeschik Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/mach-at91/at91_pmc_ll.c | 2 ++ arch/arm/mach-at91/include/mach/at91_pmc_ll.h | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'arch') diff --git a/arch/arm/mach-at91/at91_pmc_ll.c b/arch/arm/mach-at91/at91_pmc_ll.c index 9205322db9..e561f20755 100644 --- a/arch/arm/mach-at91/at91_pmc_ll.c +++ b/arch/arm/mach-at91/at91_pmc_ll.c @@ -88,6 +88,8 @@ void at91_pmc_init(void __iomem *pmc_base, unsigned int flags) tmp &= ~AT91_PMC_OSCBYPASS; tmp &= ~AT91_PMC_KEY_MASK; tmp |= AT91_PMC_KEY; + if (flags & AT91_PMC_LL_FLAG_MCK_BYPASS) + tmp |= AT91_PMC_OSCBYPASS; at91_pmc_write(AT91_CKGR_MOR, tmp); tmp = at91_pmc_read(AT91_CKGR_MOR); diff --git a/arch/arm/mach-at91/include/mach/at91_pmc_ll.h b/arch/arm/mach-at91/include/mach/at91_pmc_ll.h index 6ec3ae0852..85896a01d5 100644 --- a/arch/arm/mach-at91/include/mach/at91_pmc_ll.h +++ b/arch/arm/mach-at91/include/mach/at91_pmc_ll.h @@ -16,6 +16,7 @@ #define AT91_PMC_LL_FLAG_H32MXDIV (1 << 3) #define AT91_PMC_LL_FLAG_PMC_UTMI (1 << 4) #define AT91_PMC_LL_FLAG_GCSR (1 << 5) +#define AT91_PMC_LL_FLAG_MCK_BYPASS (1 << 6) #define AT91_PMC_LL_AT91RM9200 (0) #define AT91_PMC_LL_AT91SAM9260 (0) @@ -30,6 +31,10 @@ #define AT91_PMC_LL_SAMA5D2 (AT91_PMC_LL_FLAG_SAM9X5_PMC | \ AT91_PMC_LL_FLAG_MEASURE_XTAL | \ AT91_PMC_LL_FLAG_PMC_UTMI) +/* This assumes a crystal on both XIN and XOUT. If your board + * instead has an extenal oscillator on XIN only, + * AT91_PMC_LL_FLAG_MCK_BYPASS needs to be OR`ed in as well + */ #define AT91_PMC_LL_SAMA5D3 (AT91_PMC_LL_FLAG_SAM9X5_PMC | \ AT91_PMC_LL_FLAG_DISABLE_RC | \ AT91_PMC_LL_FLAG_PMC_UTMI) -- cgit v1.2.3 From c6347aed39e3305198d919b15fe8887154b4ebbf Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Fri, 25 Sep 2020 16:43:14 -0700 Subject: ARM: am335x: Enable TSC/ADC clock Now that there is a Barebox driver for the ADC, enable the clock to the TSC/ADC block. This machine doesn't use common clock framework clocks in Barebox, and instead enables any clock that might get used. Enalbing the clock could be made conditional based on enabling the driver, but none of the other clocks do this. Signed-off-by: Trent Piepho Signed-off-by: Sascha Hauer --- arch/arm/mach-omap/am33xx_clock.c | 4 ++++ arch/arm/mach-omap/include/mach/am33xx-clock.h | 1 + 2 files changed, 5 insertions(+) (limited to 'arch') diff --git a/arch/arm/mach-omap/am33xx_clock.c b/arch/arm/mach-omap/am33xx_clock.c index 0a49038270..8fa2c70aa2 100644 --- a/arch/arm/mach-omap/am33xx_clock.c +++ b/arch/arm/mach-omap/am33xx_clock.c @@ -165,6 +165,10 @@ void am33xx_enable_per_clocks(void) __raw_writel(PRCM_MOD_EN, CM_PER_USB0_CLKCTRL); while ((__raw_readl(CM_PER_USB0_CLKCTRL) & 0x30000) != 0x0); + /* TSC & ADC */ + __raw_writel(PRCM_MOD_EN, CM_WKUP_ADC_TSC_CLKCTRL); + while (__raw_readl(CM_WKUP_ADC_TSC_CLKCTRL) != PRCM_MOD_EN); + clkdcoldo = __raw_readl(CM_CLKDCOLDO_DPLL_PER); clkdcoldo = clkdcoldo | 0x100; __raw_writel(clkdcoldo, CM_CLKDCOLDO_DPLL_PER); diff --git a/arch/arm/mach-omap/include/mach/am33xx-clock.h b/arch/arm/mach-omap/include/mach/am33xx-clock.h index 284d5f8cf6..e71ecbcd24 100644 --- a/arch/arm/mach-omap/include/mach/am33xx-clock.h +++ b/arch/arm/mach-omap/include/mach/am33xx-clock.h @@ -138,6 +138,7 @@ #define CM_PER_I2C1_CLKCTRL (CM_PER + 0x48) /* I2C1 */ #define CM_PER_I2C2_CLKCTRL (CM_PER + 0x44) /* I2C2 */ #define CM_WKUP_GPIO0_CLKCTRL (CM_WKUP + 0x8) /* GPIO0 */ +#define CM_WKUP_ADC_TSC_CLKCTRL (CM_WKUP + 0xbc)/* TSCADC */ #define CM_PER_MMC0_CLKCTRL (CM_PER + 0x3C) #define CM_PER_MMC1_CLKCTRL (CM_PER + 0xF4) -- cgit v1.2.3 From 8974923296b8938741c8b1161771547b8d11ce56 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Fri, 25 Sep 2020 16:43:15 -0700 Subject: ARM: beaglebone: Enable ADC On the BeagleBone Black, enable the dts node for the TSC/ADC. Add a simple configuration that maps all eight channels in order. AIN[0:6] are exposed on connector P9, while AIN7 measures the 3.3V rail divided by 2. Signed-off-by: Trent Piepho Signed-off-by: Sascha Hauer --- arch/arm/dts/am335x-boneblack.dts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch') diff --git a/arch/arm/dts/am335x-boneblack.dts b/arch/arm/dts/am335x-boneblack.dts index 80d710b924..c06a532e48 100644 --- a/arch/arm/dts/am335x-boneblack.dts +++ b/arch/arm/dts/am335x-boneblack.dts @@ -85,3 +85,13 @@ status = "okay"; }; }; + +&tscadc { + status = "okay"; + adc { + /* Ch 0-6 are on connector P9. Ch 7 measures the 3.3V rail + * divided by 2 (e.g., it should read 1650). + */ + ti,adc-channels = <0>, <1>, <2>, <3>, <4>, <5>, <6>, <7>; + }; +}; -- cgit v1.2.3 From f88471a0de2687342ed33d9e36799e18d5912727 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 29 Sep 2020 12:58:21 +0200 Subject: at91: wdt: don't include directly is not meant for direct inclusion. It provides defaults for each arch's to fall back to. Use instead. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/mach-at91/include/mach/at91_wdt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mach-at91/include/mach/at91_wdt.h b/arch/arm/mach-at91/include/mach/at91_wdt.h index d295d35d1b..04924742a5 100644 --- a/arch/arm/mach-at91/include/mach/at91_wdt.h +++ b/arch/arm/mach-at91/include/mach/at91_wdt.h @@ -41,7 +41,7 @@ * Copyright (c) 2006, Atmel Corporation */ -#include +#include static inline void at91_wdt_disable(void __iomem *wdt_base) { -- cgit v1.2.3 From 2558532a3e993627fb35d087e50e8600053c6244 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 29 Sep 2020 12:58:23 +0200 Subject: sandbox: add dummy memory-mapped I/O port region Super I/O devices on x86 have their base usually located at one of two I/O ports. They are probed by writing a "passcode" to the I/O port and then a value is read back. When COMPILE_TESTing these drivers and running them on sandbox, this fails with a segfault because all I/O port access lead to zero page dereference on that architecture. Even without running barebox, static analyzers correctly flag these accesses as invoking undefined behavior. Adding a dummy I/O region solves both issues. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/sandbox/board/devices.c | 3 +++ arch/sandbox/include/asm/io.h | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/sandbox/board/devices.c b/arch/sandbox/board/devices.c index 72e62552a3..1fd1913ae6 100644 --- a/arch/sandbox/board/devices.c +++ b/arch/sandbox/board/devices.c @@ -9,6 +9,9 @@ #include #include #include +#include + +unsigned char __pci_iobase[IO_SPACE_LIMIT]; static LIST_HEAD(sandbox_device_list); diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h index 6a0e77aead..9f9cd3a42a 100644 --- a/arch/sandbox/include/asm/io.h +++ b/arch/sandbox/include/asm/io.h @@ -1,7 +1,11 @@ #ifndef __ASM_SANDBOX_IO_H #define __ASM_SANDBOX_IO_H -#define IO_SPACE_LIMIT 0 +#define IO_SPACE_LIMIT 0xffff +/* pacify static analyzers */ +#define PCI_IOBASE ((void __iomem *)__pci_iobase) + +extern unsigned char __pci_iobase[IO_SPACE_LIMIT]; #include #include -- cgit v1.2.3 From 09bc528b763c7fe48aa2855f1229cff901b7f9d2 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Wed, 30 Sep 2020 14:53:02 +0200 Subject: ARM: stm32mp: init: set up CPU and bootsource at core init level ARM device tree is unflattened at core init level and banner with model extracted from device tree is printed at console init level. The only init level between is postcore, so board code seeking to modify the device tree machine model should run then. On the STM32MP1, we query SoC type at postcore initcall, so we can't have the board code fixing up the compatible on postcore as well. Resolve this by moving stm32mp_init to core_initcall. This is allowed as the code has no dependency that requires it to run postcore. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/mach-stm32mp/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mach-stm32mp/init.c b/arch/arm/mach-stm32mp/init.c index 7f687fa4f2..9f6312f52a 100644 --- a/arch/arm/mach-stm32mp/init.c +++ b/arch/arm/mach-stm32mp/init.c @@ -366,4 +366,4 @@ static int stm32mp_init(void) return 0; } -postcore_initcall(stm32mp_init); +core_initcall(stm32mp_init); -- cgit v1.2.3 From 0387f4f9172126b40a82d2cf640b6bdf968efa01 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 1 Oct 2020 11:48:20 +0200 Subject: ARM: stm32mp: revision: make CPU type accessible to PBL There is nothing holding holding us back from reading SoC type in the PBL. Migrate the necessary definitions to the header to allow for this. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/mach-stm32mp/include/mach/revision.h | 51 ++++++++++++++++++++++++++ arch/arm/mach-stm32mp/init.c | 53 +-------------------------- 2 files changed, 53 insertions(+), 51 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-stm32mp/include/mach/revision.h b/arch/arm/mach-stm32mp/include/mach/revision.h index 2eb4d44b33..2ef8ef30c3 100644 --- a/arch/arm/mach-stm32mp/include/mach/revision.h +++ b/arch/arm/mach-stm32mp/include/mach/revision.h @@ -6,6 +6,9 @@ #ifndef __MACH_CPUTYPE_H__ #define __MACH_CPUTYPE_H__ +#include +#include +#include /* ID = Device Version (bit31:16) + Device Part Number (RPN) (bit7:0) * 157X: 2x Cortex-A7, Cortex-M4, CAN FD, GPU, DSI @@ -45,4 +48,52 @@ int stm32mp_package(void); #define cpu_is_stm32mp151c() (stm32mp_cputype() == CPU_STM32MP151Cxx) #define cpu_is_stm32mp151a() (stm32mp_cputype() == CPU_STM32MP151Axx) +/* DBGMCU register */ +#define DBGMCU_APB4FZ1 (STM32_DBGMCU_BASE + 0x2C) +#define DBGMCU_IDC (STM32_DBGMCU_BASE + 0x00) +#define DBGMCU_IDC_DEV_ID_MASK GENMASK(11, 0) +#define DBGMCU_IDC_DEV_ID_SHIFT 0 +#define DBGMCU_IDC_REV_ID_MASK GENMASK(31, 16) +#define DBGMCU_IDC_REV_ID_SHIFT 16 + +#define RCC_DBGCFGR (STM32_RCC_BASE + 0x080C) +#define RCC_DBGCFGR_DBGCKEN BIT(8) + +/* BSEC OTP index */ +#define BSEC_OTP_RPN 1 +#define BSEC_OTP_PKG 16 + +/* Device Part Number (RPN) = OTP_DATA1 lower 8 bits */ +#define RPN_SHIFT 0 +#define RPN_MASK GENMASK(7, 0) + +static inline u32 stm32mp_read_idc(void) +{ + setbits_le32(RCC_DBGCFGR, RCC_DBGCFGR_DBGCKEN); + return readl(IOMEM(DBGMCU_IDC)); +} + +/* Get Device Part Number (RPN) from OTP */ +static inline int __stm32mp_get_cpu_rpn(u32 *rpn) +{ + int ret = bsec_read_field(BSEC_OTP_RPN, rpn); + if (ret) + return ret; + + *rpn = (*rpn >> RPN_SHIFT) & RPN_MASK; + return 0; +} + +static inline int __stm32mp_get_cpu_type(u32 *type) +{ + u32 id; + int ret = __stm32mp_get_cpu_rpn(type); + if (ret) + return ret; + + id = (stm32mp_read_idc() & DBGMCU_IDC_DEV_ID_MASK) >> DBGMCU_IDC_DEV_ID_SHIFT; + *type |= id << 16; + return 0; +} + #endif /* __MACH_CPUTYPE_H__ */ diff --git a/arch/arm/mach-stm32mp/init.c b/arch/arm/mach-stm32mp/init.c index 9f6312f52a..e77e99f8fa 100644 --- a/arch/arm/mach-stm32mp/init.c +++ b/arch/arm/mach-stm32mp/init.c @@ -15,26 +15,6 @@ #include #include -/* DBGMCU register */ -#define DBGMCU_IDC (STM32_DBGMCU_BASE + 0x00) -#define DBGMCU_APB4FZ1 (STM32_DBGMCU_BASE + 0x2C) -#define DBGMCU_APB4FZ1_IWDG2 BIT(2) -#define DBGMCU_IDC_DEV_ID_MASK GENMASK(11, 0) -#define DBGMCU_IDC_DEV_ID_SHIFT 0 -#define DBGMCU_IDC_REV_ID_MASK GENMASK(31, 16) -#define DBGMCU_IDC_REV_ID_SHIFT 16 - -#define RCC_DBGCFGR (STM32_RCC_BASE + 0x080C) -#define RCC_DBGCFGR_DBGCKEN BIT(8) - -/* BSEC OTP index */ -#define BSEC_OTP_RPN 1 -#define BSEC_OTP_PKG 16 - -/* Device Part Number (RPN) = OTP_DATA1 lower 8 bits */ -#define RPN_SHIFT 0 -#define RPN_MASK GENMASK(7, 0) - /* Package = bit 27:29 of OTP16 * - 100: LBGA448 (FFI) => AA = LFBGA 18x18mm 448 balls p. 0.8mm * - 011: LBGA354 (LCI) => AB = LFBGA 16x16mm 359 balls p. 0.8mm @@ -152,38 +132,9 @@ int stm32mp_package(void) return __stm32mp_package; } -static inline u32 read_idc(void) -{ - setbits_le32(RCC_DBGCFGR, RCC_DBGCFGR_DBGCKEN); - return readl(IOMEM(DBGMCU_IDC)); -} - -/* Get Device Part Number (RPN) from OTP */ -static int get_cpu_rpn(u32 *rpn) -{ - int ret = bsec_read_field(BSEC_OTP_RPN, rpn); - if (ret) - return ret; - - *rpn = (*rpn >> RPN_SHIFT) & RPN_MASK; - return 0; -} - static u32 get_cpu_revision(void) { - return (read_idc() & DBGMCU_IDC_REV_ID_MASK) >> DBGMCU_IDC_REV_ID_SHIFT; -} - -static int get_cpu_type(u32 *type) -{ - u32 id; - int ret = get_cpu_rpn(type); - if (ret) - return ret; - - id = (read_idc() & DBGMCU_IDC_DEV_ID_MASK) >> DBGMCU_IDC_DEV_ID_SHIFT; - *type |= id << 16; - return 0; + return (stm32mp_read_idc() & DBGMCU_IDC_REV_ID_MASK) >> DBGMCU_IDC_REV_ID_SHIFT; } static int get_cpu_package(u32 *pkg) @@ -250,7 +201,7 @@ static int setup_cpu_type(void) u32 pkg; int ret; - get_cpu_type(&__stm32mp_cputype); + __stm32mp_get_cpu_type(&__stm32mp_cputype); switch (__stm32mp_cputype) { case CPU_STM32MP157Fxx: cputypestr = "157F"; -- cgit v1.2.3 From 28a656e96e95367e23b07091fb12a82396009743 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 1 Oct 2020 11:48:21 +0200 Subject: ARM: stm32mp: dk2: have barebox image support DK1 as well The STM32MP157C-DK2 and STM32MP157A-DK1 are basically the same board except the DK2 has a MIPI-DSI display attached and the SoC has a crypto block. We can thus use the SoC type to differentiate between them and just include both device trees at tolerable 12K size increase. Cc: Holger Assmann Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/boards/stm32mp157c-dk2/lowlevel.c | 12 ++++++++++-- arch/arm/dts/Makefile | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/arm/boards/stm32mp157c-dk2/lowlevel.c b/arch/arm/boards/stm32mp157c-dk2/lowlevel.c index 7261d7a8bc..d79bfa4f4d 100644 --- a/arch/arm/boards/stm32mp157c-dk2/lowlevel.c +++ b/arch/arm/boards/stm32mp157c-dk2/lowlevel.c @@ -2,8 +2,10 @@ #include #include #include +#include extern char __dtb_z_stm32mp157c_dk2_start[]; +extern char __dtb_z_stm32mp157a_dk1_start[]; static void setup_uart(void) { @@ -14,13 +16,19 @@ static void setup_uart(void) ENTRY_FUNCTION(start_stm32mp157c_dk2, r0, r1, r2) { void *fdt; + u32 cputype; + int err; stm32mp_cpu_lowlevel_init(); if (IS_ENABLED(CONFIG_DEBUG_LL)) setup_uart(); - fdt = __dtb_z_stm32mp157c_dk2_start + get_runtime_offset(); + err = __stm32mp_get_cpu_type(&cputype); + if (!err && cputype == CPU_STM32MP157Axx) + fdt = __dtb_z_stm32mp157a_dk1_start; + else + fdt = __dtb_z_stm32mp157c_dk2_start; - stm32mp1_barebox_entry(fdt); + stm32mp1_barebox_entry(fdt + get_runtime_offset()); } diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index af061bd292..fe5b6e4398 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -110,7 +110,7 @@ lwl-$(CONFIG_MACH_SOLIDRUN_MICROSOM) += imx6dl-hummingboard.dtb.o imx6q-hummingb imx6dl-hummingboard2.dtb.o imx6q-hummingboard2.dtb.o \ imx6q-h100.dtb.o lwl-$(CONFIG_MACH_SEEED_ODYSSEY) += stm32mp157c-odyssey.dtb.o -lwl-$(CONFIG_MACH_STM32MP157C_DK2) += stm32mp157c-dk2.dtb.o +lwl-$(CONFIG_MACH_STM32MP157C_DK2) += stm32mp157c-dk2.dtb.o stm32mp157a-dk1.dtb.o lwl-$(CONFIG_MACH_LXA_MC1) += stm32mp157c-lxa-mc1.dtb.o lwl-$(CONFIG_MACH_SCB9328) += imx1-scb9328.dtb.o lwl-$(CONFIG_MACH_TECHNEXION_WANDBOARD) += imx6q-wandboard.dtb.o imx6dl-wandboard.dtb.o -- cgit v1.2.3 From 1f8946cd0b64eb9f0645be173053ee6d148ffe18 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Fri, 2 Oct 2020 11:29:55 +0200 Subject: commands: boot_order: note that it's OMAP specific in help text Kconfig and online documentation don't indicate that it's OMAP specific. Fix this. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/mach-omap/boot_order.c | 4 ++-- commands/Kconfig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-omap/boot_order.c b/arch/arm/mach-omap/boot_order.c index db22513bde..4b74fdba66 100644 --- a/arch/arm/mach-omap/boot_order.c +++ b/arch/arm/mach-omap/boot_order.c @@ -70,13 +70,13 @@ static int cmd_boot_order(int argc, char *argv[]) } BAREBOX_CMD_HELP_START(boot_order) -BAREBOX_CMD_HELP_TEXT("Set warm boot order of up to four devices. Each device can be one of:") +BAREBOX_CMD_HELP_TEXT("Set OMAP warm boot order of up to four devices. Each device can be one of:") BAREBOX_CMD_HELP_TEXT("xip xipwait nand onenand mmc1 mmc2_1 mmc2_2 uart usb_1 usb_ulpi usb_2") BAREBOX_CMD_HELP_END BAREBOX_CMD_START(boot_order) .cmd = cmd_boot_order, - BAREBOX_CMD_DESC("set warm boot order") + BAREBOX_CMD_DESC("set OMAP warm boot order") BAREBOX_CMD_OPTS("DEVICE...") BAREBOX_CMD_GROUP(CMD_GRP_BOOT) BAREBOX_CMD_HELP(cmd_boot_order_help) diff --git a/commands/Kconfig b/commands/Kconfig index 9114d3cb31..df18715f20 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -285,9 +285,9 @@ config CMD_AT91_BOOT_TEST config CMD_BOOT_ORDER tristate depends on ARCH_OMAP4 - prompt "boot_order" + prompt "OMAP boot_order" help - Set warm boot order (the next boot device on a warm reset). + Set OMAP warm boot order (the next boot device on a warm reset). Usage: boot_order DEVICE... -- cgit v1.2.3 From 2fb1c3da0636addb7b1fb9d016b861ff4fd9da8b Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 5 Oct 2020 10:06:43 +0200 Subject: bootm: propagate register_image_handler return value While register_image_handler can't currently fail, it still returns an error code. Propagate that error code along instead of having a blanket return 0. This makes the code a little more compact. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/mach-stm32mp/stm32image.c | 4 +--- arch/arm/mach-zynq/bootm-zynqimg.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-stm32mp/stm32image.c b/arch/arm/mach-stm32mp/stm32image.c index 84975c5c3b..207df6894d 100644 --- a/arch/arm/mach-stm32mp/stm32image.c +++ b/arch/arm/mach-stm32mp/stm32image.c @@ -43,8 +43,6 @@ static struct image_handler image_handler_stm32_image_v1_handler = { static int stm32mp_register_stm32image_image_handler(void) { - register_image_handler(&image_handler_stm32_image_v1_handler); - - return 0; + return register_image_handler(&image_handler_stm32_image_v1_handler); } late_initcall(stm32mp_register_stm32image_image_handler); diff --git a/arch/arm/mach-zynq/bootm-zynqimg.c b/arch/arm/mach-zynq/bootm-zynqimg.c index e903ab6679..77ed6880e4 100644 --- a/arch/arm/mach-zynq/bootm-zynqimg.c +++ b/arch/arm/mach-zynq/bootm-zynqimg.c @@ -42,8 +42,6 @@ static struct image_handler zynq_image_handler = { static int zynq_register_image_handler(void) { - register_image_handler(&zynq_image_handler); - - return 0; + return register_image_handler(&zynq_image_handler); } late_initcall(zynq_register_image_handler); -- cgit v1.2.3 From a03af1e0b38bca202325f57b19f9a95cbbb7c4c5 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 5 Oct 2020 10:10:56 +0200 Subject: ARM: stm32mp: migrate board initcalls to board drivers Board drivers are now the way to go. Migrate the STM32 boards to use it, to encourage future copy-pasting in following suit. As the board now supports both DK2 and DK1, rename the prefix to dkx_. dk1 specifics follow in a separate commit. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/boards/lxa-mc1/board.c | 17 +++++++++++++---- arch/arm/boards/seeed-odyssey/board.c | 18 +++++++++++++----- arch/arm/boards/stm32mp157c-dk2/board.c | 18 +++++++++++++----- 3 files changed, 39 insertions(+), 14 deletions(-) (limited to 'arch') diff --git a/arch/arm/boards/lxa-mc1/board.c b/arch/arm/boards/lxa-mc1/board.c index 7f1f3ccd7e..9126973dcb 100644 --- a/arch/arm/boards/lxa-mc1/board.c +++ b/arch/arm/boards/lxa-mc1/board.c @@ -28,11 +28,9 @@ static int of_fixup_regulator_supply_disable(struct device_node *root, void *pat return 0; } -static int mc1_device_init(void) +static int mc1_probe(struct device_d *dev) { int flags; - if (!of_machine_is_compatible("lxa,stm32mp157c-mc1")) - return 0; flags = bootsource_get_instance() == 0 ? BBU_HANDLER_FLAG_DEFAULT : 0; stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", flags); @@ -55,4 +53,15 @@ static int mc1_device_init(void) */ return of_register_fixup(of_fixup_regulator_supply_disable, "/regulator_3v3"); } -device_initcall(mc1_device_init); + +static const struct of_device_id mc1_of_match[] = { + { .compatible = "lxa,stm32mp157c-mc1" }, + { /* sentinel */ }, +}; + +static struct driver_d mc1_board_driver = { + .name = "board-lxa-mc1", + .probe = mc1_probe, + .of_compatible = mc1_of_match, +}; +device_platform_driver(mc1_board_driver); diff --git a/arch/arm/boards/seeed-odyssey/board.c b/arch/arm/boards/seeed-odyssey/board.c index e3fe536873..8c011898a3 100644 --- a/arch/arm/boards/seeed-odyssey/board.c +++ b/arch/arm/boards/seeed-odyssey/board.c @@ -7,14 +7,11 @@ #include #include -static int odyssey_device_init(void) +static int odyssey_som_probe(struct device_d *dev) { int flags; int instance = bootsource_get_instance(); - if (!of_machine_is_compatible("seeed,stm32mp157c-odyssey-som")) - return 0; - flags = instance == 0 ? BBU_HANDLER_FLAG_DEFAULT : 0; stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", flags); @@ -29,4 +26,15 @@ static int odyssey_device_init(void) return 0; } -device_initcall(odyssey_device_init); + +static const struct of_device_id odyssey_som_of_match[] = { + { .compatible = "seeed,stm32mp157c-odyssey-som" }, + { /* sentinel */ }, +}; + +static struct driver_d odyssey_som_driver = { + .name = "odyssey-som", + .probe = odyssey_som_probe, + .of_compatible = odyssey_som_of_match, +}; +device_platform_driver(odyssey_som_driver); diff --git a/arch/arm/boards/stm32mp157c-dk2/board.c b/arch/arm/boards/stm32mp157c-dk2/board.c index 4636603121..a547209cdf 100644 --- a/arch/arm/boards/stm32mp157c-dk2/board.c +++ b/arch/arm/boards/stm32mp157c-dk2/board.c @@ -3,11 +3,8 @@ #include #include -static int dk2_postcore_init(void) +static int dkx_probe(struct device_d *dev) { - if (!of_machine_is_compatible("st,stm32mp157c-dk2")) - return 0; - stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", BBU_HANDLER_FLAG_DEFAULT); @@ -15,4 +12,15 @@ static int dk2_postcore_init(void) return 0; } -postcore_initcall(dk2_postcore_init); + +static const struct of_device_id dkx_of_match[] = { + { .compatible = "st,stm32mp157c-dk2" }, + { /* sentinel */ }, +}; + +static struct driver_d dkx_board_driver = { + .name = "board-stm32mp15xx-dkx", + .probe = dkx_probe, + .of_compatible = dkx_of_match, +}; +postcore_platform_driver(dkx_board_driver); -- cgit v1.2.3 From 751a9120dabc8c23a0a2230a0122eaadb1d942a1 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 5 Oct 2020 10:10:57 +0200 Subject: ARM: stm32mp: dk2: rename to dkx to make dk1 support clearer As we now support both the stm32mp157a-dk1 and stm32mp157c-dk2 with the same barebox image, we should call the board stm32mp15xx-dkx instead. That's also how the upstream DTSI is named. Suggested-by: Holger Assmann Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- Documentation/boards/stm32mp.rst | 2 +- arch/arm/boards/Makefile | 2 +- arch/arm/boards/stm32mp157c-dk2/Makefile | 2 -- arch/arm/boards/stm32mp157c-dk2/board.c | 26 ----------------------- arch/arm/boards/stm32mp157c-dk2/lowlevel.c | 34 ------------------------------ arch/arm/boards/stm32mp15xx-dkx/Makefile | 2 ++ arch/arm/boards/stm32mp15xx-dkx/board.c | 32 ++++++++++++++++++++++++++++ arch/arm/boards/stm32mp15xx-dkx/lowlevel.c | 34 ++++++++++++++++++++++++++++++ arch/arm/configs/stm32mp_defconfig | 2 +- arch/arm/dts/Makefile | 2 +- arch/arm/dts/stm32mp157a-dk1.dts | 2 +- arch/arm/dts/stm32mp157a-dk1.dtsi | 30 -------------------------- arch/arm/dts/stm32mp157c-dk2.dts | 2 +- arch/arm/dts/stm32mp15xx-dkx.dtsi | 30 ++++++++++++++++++++++++++ arch/arm/mach-stm32mp/Kconfig | 7 ++++-- images/Makefile.stm32mp | 8 +++---- 16 files changed, 113 insertions(+), 104 deletions(-) delete mode 100644 arch/arm/boards/stm32mp157c-dk2/Makefile delete mode 100644 arch/arm/boards/stm32mp157c-dk2/board.c delete mode 100644 arch/arm/boards/stm32mp157c-dk2/lowlevel.c create mode 100644 arch/arm/boards/stm32mp15xx-dkx/Makefile create mode 100644 arch/arm/boards/stm32mp15xx-dkx/board.c create mode 100644 arch/arm/boards/stm32mp15xx-dkx/lowlevel.c delete mode 100644 arch/arm/dts/stm32mp157a-dk1.dtsi create mode 100644 arch/arm/dts/stm32mp15xx-dkx.dtsi (limited to 'arch') diff --git a/Documentation/boards/stm32mp.rst b/Documentation/boards/stm32mp.rst index b235c39927..a06578602d 100644 --- a/Documentation/boards/stm32mp.rst +++ b/Documentation/boards/stm32mp.rst @@ -29,7 +29,7 @@ The resulting images will be placed under ``images/``: :: - barebox-stm32mp157c-dk2.img + barebox-stm32mp15xx-dkx.img # both DK1 and DK2 barebox-stm32mp157c-lxa-mc1.img barebox-stm32mp157c-seeed-odyssey.img diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile index 986ea7a983..9183da684b 100644 --- a/arch/arm/boards/Makefile +++ b/arch/arm/boards/Makefile @@ -132,7 +132,7 @@ obj-$(CONFIG_MACH_SOCFPGA_TERASIC_DE0_NANO_SOC) += terasic-de0-nano-soc/ obj-$(CONFIG_MACH_SOCFPGA_TERASIC_SOCKIT) += terasic-sockit/ obj-$(CONFIG_MACH_SOLIDRUN_CUBOX) += solidrun-cubox/ obj-$(CONFIG_MACH_SOLIDRUN_MICROSOM) += solidrun-microsom/ -obj-$(CONFIG_MACH_STM32MP157C_DK2) += stm32mp157c-dk2/ +obj-$(CONFIG_MACH_STM32MP15XX_DKX) += stm32mp15xx-dkx/ obj-$(CONFIG_MACH_LXA_MC1) += lxa-mc1/ obj-$(CONFIG_MACH_TECHNEXION_PICO_HOBBIT) += technexion-pico-hobbit/ obj-$(CONFIG_MACH_TECHNEXION_WANDBOARD) += technexion-wandboard/ diff --git a/arch/arm/boards/stm32mp157c-dk2/Makefile b/arch/arm/boards/stm32mp157c-dk2/Makefile deleted file mode 100644 index 092c31d6b2..0000000000 --- a/arch/arm/boards/stm32mp157c-dk2/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -lwl-y += lowlevel.o -obj-y += board.o diff --git a/arch/arm/boards/stm32mp157c-dk2/board.c b/arch/arm/boards/stm32mp157c-dk2/board.c deleted file mode 100644 index a547209cdf..0000000000 --- a/arch/arm/boards/stm32mp157c-dk2/board.c +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -#include -#include -#include - -static int dkx_probe(struct device_d *dev) -{ - stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", - BBU_HANDLER_FLAG_DEFAULT); - - barebox_set_model("STM32MP157C-DK2"); - - return 0; -} - -static const struct of_device_id dkx_of_match[] = { - { .compatible = "st,stm32mp157c-dk2" }, - { /* sentinel */ }, -}; - -static struct driver_d dkx_board_driver = { - .name = "board-stm32mp15xx-dkx", - .probe = dkx_probe, - .of_compatible = dkx_of_match, -}; -postcore_platform_driver(dkx_board_driver); diff --git a/arch/arm/boards/stm32mp157c-dk2/lowlevel.c b/arch/arm/boards/stm32mp157c-dk2/lowlevel.c deleted file mode 100644 index d79bfa4f4d..0000000000 --- a/arch/arm/boards/stm32mp157c-dk2/lowlevel.c +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -#include -#include -#include -#include - -extern char __dtb_z_stm32mp157c_dk2_start[]; -extern char __dtb_z_stm32mp157a_dk1_start[]; - -static void setup_uart(void) -{ - /* first stage has set up the UART, so nothing to do here */ - putc_ll('>'); -} - -ENTRY_FUNCTION(start_stm32mp157c_dk2, r0, r1, r2) -{ - void *fdt; - u32 cputype; - int err; - - stm32mp_cpu_lowlevel_init(); - - if (IS_ENABLED(CONFIG_DEBUG_LL)) - setup_uart(); - - err = __stm32mp_get_cpu_type(&cputype); - if (!err && cputype == CPU_STM32MP157Axx) - fdt = __dtb_z_stm32mp157a_dk1_start; - else - fdt = __dtb_z_stm32mp157c_dk2_start; - - stm32mp1_barebox_entry(fdt + get_runtime_offset()); -} diff --git a/arch/arm/boards/stm32mp15xx-dkx/Makefile b/arch/arm/boards/stm32mp15xx-dkx/Makefile new file mode 100644 index 0000000000..092c31d6b2 --- /dev/null +++ b/arch/arm/boards/stm32mp15xx-dkx/Makefile @@ -0,0 +1,2 @@ +lwl-y += lowlevel.o +obj-y += board.o diff --git a/arch/arm/boards/stm32mp15xx-dkx/board.c b/arch/arm/boards/stm32mp15xx-dkx/board.c new file mode 100644 index 0000000000..1ddfee698d --- /dev/null +++ b/arch/arm/boards/stm32mp15xx-dkx/board.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0+ +#include +#include +#include + +static int dkx_probe(struct device_d *dev) +{ + const void *model; + + stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", + BBU_HANDLER_FLAG_DEFAULT); + + if (dev_get_drvdata(dev, &model) == 0) + barebox_set_model(model); + + barebox_set_hostname("stm32mp15xx-dkx"); + + return 0; +} + +static const struct of_device_id dkx_of_match[] = { + { .compatible = "st,stm32mp157a-dk1", .data = "STM32MP157A-DK1" }, + { .compatible = "st,stm32mp157c-dk2", .data = "STM32MP157C-DK2" }, + { /* sentinel */ }, +}; + +static struct driver_d dkx_board_driver = { + .name = "board-stm32mp15xx-dkx", + .probe = dkx_probe, + .of_compatible = dkx_of_match, +}; +postcore_platform_driver(dkx_board_driver); diff --git a/arch/arm/boards/stm32mp15xx-dkx/lowlevel.c b/arch/arm/boards/stm32mp15xx-dkx/lowlevel.c new file mode 100644 index 0000000000..65f4bbb4da --- /dev/null +++ b/arch/arm/boards/stm32mp15xx-dkx/lowlevel.c @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0+ +#include +#include +#include +#include + +extern char __dtb_z_stm32mp157c_dk2_start[]; +extern char __dtb_z_stm32mp157a_dk1_start[]; + +static void setup_uart(void) +{ + /* first stage has set up the UART, so nothing to do here */ + putc_ll('>'); +} + +ENTRY_FUNCTION(start_stm32mp15xx_dkx, r0, r1, r2) +{ + void *fdt; + u32 cputype; + int err; + + stm32mp_cpu_lowlevel_init(); + + if (IS_ENABLED(CONFIG_DEBUG_LL)) + setup_uart(); + + err = __stm32mp_get_cpu_type(&cputype); + if (!err && cputype == CPU_STM32MP157Axx) + fdt = __dtb_z_stm32mp157a_dk1_start; + else + fdt = __dtb_z_stm32mp157c_dk2_start; + + stm32mp1_barebox_entry(fdt + get_runtime_offset()); +} diff --git a/arch/arm/configs/stm32mp_defconfig b/arch/arm/configs/stm32mp_defconfig index 92bdf5b040..870d47739b 100644 --- a/arch/arm/configs/stm32mp_defconfig +++ b/arch/arm/configs/stm32mp_defconfig @@ -1,5 +1,5 @@ CONFIG_ARCH_STM32MP=y -CONFIG_MACH_STM32MP157C_DK2=y +CONFIG_MACH_STM32MP15XX_DKX=y CONFIG_MACH_LXA_MC1=y CONFIG_MACH_SEEED_ODYSSEY=y CONFIG_THUMB2_BAREBOX=y diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index fe5b6e4398..0792954985 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -110,7 +110,7 @@ lwl-$(CONFIG_MACH_SOLIDRUN_MICROSOM) += imx6dl-hummingboard.dtb.o imx6q-hummingb imx6dl-hummingboard2.dtb.o imx6q-hummingboard2.dtb.o \ imx6q-h100.dtb.o lwl-$(CONFIG_MACH_SEEED_ODYSSEY) += stm32mp157c-odyssey.dtb.o -lwl-$(CONFIG_MACH_STM32MP157C_DK2) += stm32mp157c-dk2.dtb.o stm32mp157a-dk1.dtb.o +lwl-$(CONFIG_MACH_STM32MP15XX_DKX) += stm32mp157c-dk2.dtb.o stm32mp157a-dk1.dtb.o lwl-$(CONFIG_MACH_LXA_MC1) += stm32mp157c-lxa-mc1.dtb.o lwl-$(CONFIG_MACH_SCB9328) += imx1-scb9328.dtb.o lwl-$(CONFIG_MACH_TECHNEXION_WANDBOARD) += imx6q-wandboard.dtb.o imx6dl-wandboard.dtb.o diff --git a/arch/arm/dts/stm32mp157a-dk1.dts b/arch/arm/dts/stm32mp157a-dk1.dts index f2cafae66b..7a907cc314 100644 --- a/arch/arm/dts/stm32mp157a-dk1.dts +++ b/arch/arm/dts/stm32mp157a-dk1.dts @@ -5,4 +5,4 @@ */ #include -#include "stm32mp157a-dk1.dtsi" +#include "stm32mp15xx-dkx.dtsi" diff --git a/arch/arm/dts/stm32mp157a-dk1.dtsi b/arch/arm/dts/stm32mp157a-dk1.dtsi deleted file mode 100644 index 173e64e04c..0000000000 --- a/arch/arm/dts/stm32mp157a-dk1.dtsi +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) -/* - * Copyright (C) STMicroelectronics 2018 - All Rights Reserved - * Author: Alexandre Torgue . - */ - -#include "stm32mp151.dtsi" -#include - -/ { - chosen { - environment { - compatible = "barebox,environment"; - device-path = &sdmmc1, "partname:barebox-environment"; - }; - }; -}; - -&{/led} { - led-red { - label = "error"; - gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - default-state = "off"; - status = "okay"; - }; -}; - -&{/led/led-blue} { - default-state = "on"; -}; diff --git a/arch/arm/dts/stm32mp157c-dk2.dts b/arch/arm/dts/stm32mp157c-dk2.dts index 6e73162ea4..98525abd71 100644 --- a/arch/arm/dts/stm32mp157c-dk2.dts +++ b/arch/arm/dts/stm32mp157c-dk2.dts @@ -5,4 +5,4 @@ */ #include -#include "stm32mp157a-dk1.dtsi" +#include "stm32mp15xx-dkx.dtsi" diff --git a/arch/arm/dts/stm32mp15xx-dkx.dtsi b/arch/arm/dts/stm32mp15xx-dkx.dtsi new file mode 100644 index 0000000000..173e64e04c --- /dev/null +++ b/arch/arm/dts/stm32mp15xx-dkx.dtsi @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright (C) STMicroelectronics 2018 - All Rights Reserved + * Author: Alexandre Torgue . + */ + +#include "stm32mp151.dtsi" +#include + +/ { + chosen { + environment { + compatible = "barebox,environment"; + device-path = &sdmmc1, "partname:barebox-environment"; + }; + }; +}; + +&{/led} { + led-red { + label = "error"; + gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; + default-state = "off"; + status = "okay"; + }; +}; + +&{/led/led-blue} { + default-state = "on"; +}; diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig index f064a38088..b8ccbaab67 100644 --- a/arch/arm/mach-stm32mp/Kconfig +++ b/arch/arm/mach-stm32mp/Kconfig @@ -8,9 +8,12 @@ config ARCH_STM32MP157 select ARM_PSCI_CLIENT bool -config MACH_STM32MP157C_DK2 +config MACH_STM32MP15XX_DKX select ARCH_STM32MP157 - bool "STM32MP157C-DK2 board" + bool "STM32MP157 DK1 and DK2 boards" + help + builds a single barebox-stm32mp15xx-dkx.img that can be deployed + as SSBL on both the stm32mp157a-dk1 and stm32mp157c-dk2 config MACH_LXA_MC1 select ARCH_STM32MP157 diff --git a/images/Makefile.stm32mp b/images/Makefile.stm32mp index 1330a7ef3d..eafe84a721 100644 --- a/images/Makefile.stm32mp +++ b/images/Makefile.stm32mp @@ -13,10 +13,10 @@ STM32MP1_OPTS = -a 0xc0100000 -e 0xc0100000 -v1 # -------------------------------------- -pblb-$(CONFIG_MACH_STM32MP157C_DK2) += start_stm32mp157c_dk2 -FILE_barebox-stm32mp157c-dk2.img = start_stm32mp157c_dk2.pblb.stm32 -OPTS_start_stm32mp157c_dk2.pblb.stm32 = $(STM32MP1_OPTS) -image-$(CONFIG_MACH_STM32MP157C_DK2) += barebox-stm32mp157c-dk2.img +pblb-$(CONFIG_MACH_STM32MP15XX_DKX) += start_stm32mp15xx_dkx +FILE_barebox-stm32mp15xx-dkx.img = start_stm32mp15xx_dkx.pblb.stm32 +OPTS_start_stm32mp15xx_dkx.pblb.stm32 = $(STM32MP1_OPTS) +image-$(CONFIG_MACH_STM32MP15XX_DKX) += barebox-stm32mp15xx-dkx.img pblb-$(CONFIG_MACH_LXA_MC1) += start_stm32mp157c_lxa_mc1 FILE_barebox-stm32mp157c-lxa-mc1.img = start_stm32mp157c_lxa_mc1.pblb.stm32 -- cgit v1.2.3 From f3f91f06e2ad37b4af4de6c67a4396aa40857f0b Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 5 Oct 2020 10:10:58 +0200 Subject: ARM: stm32mp: defconfig: enable more useful options Improve coverage by enabling more common code. Users will tweak the defconfig and cut it down anyway. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/configs/stm32mp_defconfig | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/configs/stm32mp_defconfig b/arch/arm/configs/stm32mp_defconfig index 870d47739b..e9f89e69d9 100644 --- a/arch/arm/configs/stm32mp_defconfig +++ b/arch/arm/configs/stm32mp_defconfig @@ -12,7 +12,6 @@ CONFIG_MALLOC_TLSF=y CONFIG_KALLSYMS=y CONFIG_RELOCATABLE=y CONFIG_HUSH_FANCY_PROMPT=y -CONFIG_CMDLINE_EDITING=y CONFIG_AUTO_COMPLETE=y CONFIG_MENU=y CONFIG_BOOTM_SHOW_TYPE=y @@ -24,10 +23,14 @@ CONFIG_BLSPEC=y CONFIG_CONSOLE_ACTIVATE_NONE=y CONFIG_CONSOLE_ALLOW_COLOR=y CONFIG_PBL_CONSOLE=y +CONFIG_CONSOLE_RATP=y +CONFIG_RATP_CMD_I2C=y +CONFIG_RATP_CMD_GPIO=y CONFIG_PARTITION_DISK_EFI=y # CONFIG_PARTITION_DISK_EFI_GPT_NO_FORCE is not set # CONFIG_PARTITION_DISK_EFI_GPT_COMPARE is not set CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_REBOOT_MODE=y CONFIG_RESET_SOURCE=y CONFIG_CMD_DMESG=y CONFIG_LONGHELP=y @@ -83,10 +86,12 @@ CONFIG_CMD_BAREBOX_UPDATE=y CONFIG_CMD_OF_DIFF=y CONFIG_CMD_OF_NODE=y CONFIG_CMD_OF_PROPERTY=y +CONFIG_CMD_OF_OVERLAY=y CONFIG_CMD_OFTREE=y CONFIG_CMD_TIME=y CONFIG_NET=y CONFIG_NET_NETCONSOLE=y +CONFIG_NET_FASTBOOT=y CONFIG_OFDEVICE=y CONFIG_OF_BAREBOX_DRIVERS=y CONFIG_DRIVER_SERIAL_STM32=y @@ -111,6 +116,7 @@ CONFIG_LED=y CONFIG_LED_GPIO=y CONFIG_LED_PWM=y CONFIG_LED_GPIO_OF=y +CONFIG_LED_TRIGGERS=y CONFIG_EEPROM_AT24=y CONFIG_KEYBOARD_GPIO=y CONFIG_INPUT_SPECIALKEYS=y @@ -132,11 +138,17 @@ CONFIG_STM32_REMOTEPROC=y CONFIG_RESET_STM32=y CONFIG_GENERIC_PHY=y CONFIG_PHY_STM32_USBPHYC=y +CONFIG_SYSCON_REBOOT_MODE=y CONFIG_FS_EXT4=y CONFIG_FS_TFTP=y CONFIG_FS_NFS=y CONFIG_FS_FAT=y CONFIG_FS_FAT_WRITE=y CONFIG_FS_FAT_LFN=y +CONFIG_FS_PSTORE=y +CONFIG_FS_PSTORE_CONSOLE=y +CONFIG_FS_PSTORE_RAMOOPS=y +CONFIG_FS_SQUASHFS=y +CONFIG_FS_RATP=y CONFIG_ZLIB=y CONFIG_CRC8=y -- cgit v1.2.3