arm: mvebu: Move Armada XP/38x Kconfig to mach specific Kconfig file
Subsystems (5)
PATCH 1/3 arm: mvebu: Move Armada XP/38x Kconfig to mach specific Kconfig file
Introduce a mach-mvebu/Kconfig for all Armada based SoC's.
--- arch/arm/Kconfig | 16 ++++------------ arch/arm/mach-mvebu/Kconfig | 21 +++++++++++++++++++++ board/Marvell/db-88f6820-gp/Kconfig | 3 --- board/Marvell/db-mv784mp-gp/Kconfig | 3 --- board/maxbcm/Kconfig | 3 --- configs/db-88f6820-gp_defconfig | 3 ++- configs/db-mv784mp-gp_defconfig | 1 + configs/maxbcm_defconfig | 1 + 8 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 arch/arm/mach-mvebu/Kconfig
arch/arm/Kconfig +4 -12
@@ -103,18 +103,8 @@ config KIRKWOOD bool "Marvell Kirkwood" select CPU_ARM926EJS -config TARGET_DB_88F6820_GP - bool "Support DB-88F6820-GP" - select CPU_V7 - select SUPPORT_SPL - -config TARGET_DB_MV784MP_GP - bool "Support db-mv784mp-gp" - select CPU_V7 - select SUPPORT_SPL - -config TARGET_MAXBCM - bool "Support maxbcm" +config ARCH_MVEBU + bool "Marvell MVEBU family (Armada XP/38x)" select CPU_V7 select SUPPORT_SPL
@@ -845,6 +835,8 @@ source "arch/arm/mach-keystone/Kconfig" source "arch/arm/mach-kirkwood/Kconfig" +source "arch/arm/mach-mvebu/Kconfig" + source "arch/arm/cpu/armv7/mx6/Kconfig" source "arch/arm/cpu/armv7/mx5/Kconfig"
arch/arm/mach-mvebu/Kconfig new file +21 -0
@@ -0,0 +1,21 @@ +if ARCH_MVEBU + +choice + prompt "Marvell MVEBU (Armada XP/38x) board select" + optional + +config TARGET_DB_88F6820_GP + bool "Support DB-88F6820-GP" + +config TARGET_DB_MV784MP_GP + bool "Support db-mv784mp-gp" + +config TARGET_MAXBCM + bool "Support maxbcm" + +endchoice + +config SYS_SOC + default "mvebu" + +endif
board/Marvell/db-88f6820-gp/Kconfig +0 -3
@@ -6,9 +6,6 @@ config SYS_BOARD config SYS_VENDOR default "Marvell" -config SYS_SOC - default "mvebu" - config SYS_CONFIG_NAME default "db-88f6820-gp"
board/Marvell/db-mv784mp-gp/Kconfig +0 -3
@@ -6,9 +6,6 @@ config SYS_BOARD config SYS_VENDOR default "Marvell" -config SYS_SOC - default "mvebu" - config SYS_CONFIG_NAME default "db-mv784mp-gp"
board/maxbcm/Kconfig +0 -3
@@ -3,9 +3,6 @@ if TARGET_MAXBCM config SYS_BOARD default "maxbcm" -config SYS_SOC - default "mvebu" - config SYS_CONFIG_NAME default "maxbcm"
configs/db-88f6820-gp_defconfig +2 -1
@@ -1,6 +1,7 @@ -CONFIG_SPL=y CONFIG_ARM=y +CONFIG_ARCH_MVEBU=y CONFIG_TARGET_DB_88F6820_GP=y +CONFIG_SPL=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set
configs/db-mv784mp-gp_defconfig +1 -0
@@ -1,4 +1,5 @@ CONFIG_ARM=y +CONFIG_ARCH_MVEBU=y CONFIG_TARGET_DB_MV784MP_GP=y CONFIG_SPL=y # CONFIG_CMD_IMLS is not set
configs/maxbcm_defconfig +1 -0
@@ -1,4 +1,5 @@ CONFIG_ARM=y +CONFIG_ARCH_MVEBU=y CONFIG_TARGET_MAXBCM=y CONFIG_SPL=y # CONFIG_CMD_IMLS is not set
Signature · 1 line
2.5.0
PATCH 2/3 arm: mvebu: Add option to use UART xmodem protocol via kwboot
This patch enables the use of the kwboot tool, to boot mainline U-Boot on the Marvell Armada XP/38x SoC's. This is done by returning to the SoC's BootROM after SPL has initialized the SDRAM. We need to make sure to not reconfigure the internal register space and MBARs. Otherwise the BootROM will not be able to continue after SPL jumps back to it.
To use this feature, please don't forget to change the BOOT_FROM line in your board specfic kwbimage.cfg file this way:
BOOT_FROM uart
Tested on these Marvell eval boards:
DB-MV784MP-GP - Armada XP
DB-88F6820-GP - Armada 38x
--- Makefile | 12 +++++++++++- arch/arm/mach-mvebu/Kconfig | 10 ++++++++++ arch/arm/mach-mvebu/include/mach/cpu.h | 2 ++ arch/arm/mach-mvebu/include/mach/soc.h | 2 +- arch/arm/mach-mvebu/lowlevel_spl.S | 16 ++++++++++++++++ arch/arm/mach-mvebu/spl.c | 25 +++++++++++++++++++++++++ 6 files changed, 65 insertions(+), 2 deletions(-)
Makefile +11 -1
@@ -901,7 +901,7 @@ MKIMAGEFLAGS_u-boot.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \ -T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) MKIMAGEFLAGS_u-boot-spl.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \ - -T kwbimage -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) + -T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \ -R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
@@ -909,8 +909,18 @@ MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \ u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE $(call if_changed,mkimage) +# If the kwboot xmodem protocol is used, to boot U-Boot on the MVEBU +# SoC's, the SPL U-Boot returns to the BootROM after it completes +# the SDRAM setup. The BootROM expects no U-Boot header in the main +# U-Boot image. So we need to combine SPL and u-boot.bin instead of +# u-boot.img in this case. +ifdef CONFIG_MVEBU_BOOTROM_UARTBOOT +u-boot-spl.kwb: u-boot.bin spl/u-boot-spl.bin FORCE + $(call if_changed,mkimage) +else u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE $(call if_changed,mkimage) +endif MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
arch/arm/mach-mvebu/Kconfig +10 -0
@@ -18,4 +18,14 @@ endchoice config SYS_SOC default "mvebu" +config MVEBU_BOOTROM_UARTBOOT + bool "Use kwboot to boot via BootROM xmodem protocol" + help + This option provides support for booting via the Marvell + xmodem protocol, used by the kwboot tool. + + Please don't forget to configure the boot device in + the board specific kwbimage.cfg file this way: + BOOT_FROM uart + endif
arch/arm/mach-mvebu/include/mach/cpu.h +2 -0
@@ -119,6 +119,8 @@ int mvebu_mbus_probe(struct mbus_win windows[], int count);int mvebu_soc_family (void );u32 mvebu_get_nand_clock (void ); +void return_to_bootrom (void ); +int mv_sdh_init (unsigned long regbase,u32 max_clk,u32 min_clk,u32 quirks);/*
arch/arm/mach-mvebu/include/mach/soc.h +1 -1
@@ -33,7 +33,7 @@/* SOC specific definations */ #define INTREG_BASE 0xd0000000#define INTREG_BASE_ADDR_REG (INTREG_BASE + 0x20080) -#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SYS_MVEBU_DDR_A38X ) +#if defined(CONFIG_SPL_BUILD )/* * On A38x switching the regs base address without running from * SDRAM doesn't seem to work. So let the SPL still use the
arch/arm/mach-mvebu/lowlevel_spl.S +16 -0
@@ -5,10 +5,26 @@ #include <config.h> #include <linux/linkage.h> +#ifdef CONFIG_MVEBU_BOOTROM_UARTBOOT ENTRY(save_boot_params) + stmfd sp!, {r0 - r12, lr} /* @ save registers on stack */ + ldr r12, =CONFIG_SPL_BOOTROM_SAVE + str sp, [r12] b save_boot_params_ret ENDPROC(save_boot_params) +ENTRY(return_to_bootrom) + ldr r12, =CONFIG_SPL_BOOTROM_SAVE + ldr sp, [r12] + mov r0, #0x0 /* @ return value: 0x0 NO_ERR */ + ldmfd sp!, {r0 - r12, pc} /* @ restore regs and return */ +ENDPROC(return_to_bootrom) +#else +ENTRY(save_boot_params) + b save_boot_params_ret +ENDPROC(save_boot_params) +#endif + /* * cache_inv - invalidate Cache line * r0 - dest
arch/arm/mach-mvebu/spl.c +25 -0
@@ -34,8 +34,18 @@ void board_init_f(ulong dummy)/* Set global data pointer */ gd = &gdata; +#ifndef CONFIG_MVEBU_BOOTROM_UARTBOOT +/* +* Only call arch_cpu_init() when not returning to the +* Marvell BootROM, which is done when booting via +* the xmodem protocol (kwboot tool). Otherwise the +* internal register will get remapped and the BootROM +* can't continue to run correctly. +*/ +/* Linux expects the internal registers to be at 0xf1000000 */ arch_cpu_init (); +#endif /* * Pin muxing needs to be done before UART output, since
@@ -54,5 +64,20 @@ void board_init_f(ulong dummy)/* Setup DDR */ ddr3_init (); +#ifdef CONFIG_MVEBU_BOOTROM_UARTBOOT +/* +* Return to the BootROM to continue the Marvell xmodem +* UART boot protocol. As initiated by the kwboot tool. +* +* This can only be done by the BootROM and not by the +* U-Boot SPL infrastructure, since the beginning of the +* image is already read and interpreted by the BootROM. +* SPL has no chance to receive this information. So we +* need to return to the BootROM to enable this xmodem +* UART download. +*/ +return_to_bootrom (); +#endif +board_init_r (NULL ,0 ); }
Signature · 1 line
2.5.0
PATCH 2/3 arm: mvebu: Add option to use UART xmodem protocol via kwboot
Quoted 9 lines · Stefan Roese
This patch enables the use of the kwboot tool, to boot mainline U-Boot on the Marvell Armada XP/38x SoC's. This is done by returning to the SoC's BootROM after SPL has initialized the SDRAM. We need to make sure to not reconfigure the internal register space and MBARs. Otherwise the BootROM will not be able to continue after SPL jumps back to it.
To use this feature, please don't forget to change the
BOOT_FROMline in your board specfic kwbimage.cfg file this way:
Quoted 7 lines
BOOT_FROMuartTested on these Marvell eval boards:
DB-MV784MP-GP - Armada XP
DB-88F6820-GP - Armada 38xSigned-off-by Stefan Roese <[email protected]>
PATCH 3/3 arm: mvebu: Only set CONFIG_SKIP_LOWLEVEL_INIT for SPL
In reply to Stefan RoeseWhen running on the AXP I sometimes noticed a strange behavior. As some characters are not echoed on the U-Boot prompt. Not disabling the lowlevel_init code, especially calling cpu_init_cp15() in the main U-Boot seems to solve this issue.
--- arch/arm/mach-mvebu/cpu.c | 31 +++++++++++++++++++------------ include/configs/db-88f6820-gp.h | 2 ++ include/configs/db-mv784mp-gp.h | 2 ++ include/configs/maxbcm.h | 2 ++ 4 files changed, 25 insertions(+), 12 deletions(-)
arch/arm/mach-mvebu/cpu.c +19 -12
@@ -27,6 +27,14 @@ static struct mbus_win windows[] = { CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_BOOTROM }, }; +void lowlevel_init (void ) +{ +/* +* Dummy implementation, we only need LOWLEVEL_INIT +* on Armada to configure CP15 in start.S / cpu_init_cp15() +*/ +} +void reset_cpu (unsigned long ignored) { struct mvebu_system_registers *reg =
@@ -214,7 +222,10 @@ static void setup_usb_phys(void)int arch_cpu_init (void ) { -#if !defined(CONFIG_SPL_BUILD ) && defined(CONFIG_ARMADA_38X ) +#if !defined(CONFIG_SPL_BUILD ) +struct pl310_regs *const pl310 = + (struct pl310_regs *)CONFIG_SYS_PL310_BASE ; +/* * Only with disabled MMU its possible to switch the base * register address on Armada 38x. Without this the SDRAM
@@ -234,18 +245,14 @@ int arch_cpu_init(void)* configured the internal register base to the value used * in the macros / defines in the U-Boot header (soc.h). */ -if (mvebu_soc_family () ==MVEBU_SOC_A38X ) { -struct pl310_regs *const pl310 = - (struct pl310_regs *)CONFIG_SYS_PL310_BASE ; -/* -* To fully release / unlock this area from cache, we need -* to flush all caches and disable the L2 cache. -*/ -icache_disable (); -dcache_disable (); -clrbits_le32 (&pl310->pl310_ctrl,L2X0_CTRL_EN ); - } +/* +* To fully release / unlock this area from cache, we need +* to flush all caches and disable the L2 cache. +*/ +icache_disable (); +dcache_disable (); +clrbits_le32 (&pl310->pl310_ctrl,L2X0_CTRL_EN );#endif /*
include/configs/db-88f6820-gp.h +2 -0
@@ -16,7 +16,9 @@#define CONFIG_SYS_L2_PL310 +#ifdef CONFIG_SPL_BUILD #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ +#endif #define CONFIG_SYS_GENERIC_BOARD #define CONFIG_DISPLAY_BOARDINFO_LATE
include/configs/db-mv784mp-gp.h +2 -0
@@ -13,7 +13,9 @@#define CONFIG_ARMADA_XP /* SOC Family Name */ #define CONFIG_DB_784MP_GP /* Board target name for DDR training */ +#ifdef CONFIG_SPL_BUILD #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ +#endif #define CONFIG_SYS_GENERIC_BOARD #define CONFIG_DISPLAY_BOARDINFO_LATE
include/configs/maxbcm.h +2 -0
@@ -11,7 +11,9 @@* High Level Configuration Options (easy to change) */ #define CONFIG_ARMADA_XP /* SOC Family Name */ +#ifdef CONFIG_SPL_BUILD #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ +#endif #define CONFIG_SYS_GENERIC_BOARD #define CONFIG_DISPLAY_BOARDINFO_LATE
Signature · 1 line
2.5.0