ARM: keystone2: Build images by default
cover ARM: keystone2: Build images by default
Currently we need to build each image(u-boot.uart, u-boot-nand.gph, u-boot-spi.gph) separately for all keystone2 platforms.
This series does the following:
- Move SP to end of u-boot section so that u-boot.bin can be used as build target for uart boot.
- Renames u-boot-nand.gph to MLO so that the same image can be used for NAND and SD boots.
- Includes these images in config.mk so that these images are built automatically upon calling make.
Now the updated build targets are as below:
Uart: u-boot.bin
SPI: u-boot-spi.gph
NAND: MLO
SD: MLO
Testing:
k2hk-evm:
---------
Uart boot: http://pastebin.ubuntu.com/12106278/
SPI boot: http://pastebin.ubuntu.com/12106315/
NAND boot: http://pastebin.ubuntu.com/12106368/
Lokesh Vutla (4):
ARM: keystone2: configs: Move SP to end of u-boot section
ARM: keystone2: Rename u-boot-nand.gph to MLO
ARM: keystone2: Build MLO by default
ARM: keystone2: Update README
Nishanth Menon (1):
ARM: keystone2: move the custom build rules out to keystone specific
makefile
Makefile | 16 ---------------- arch/arm/mach-keystone/config.mk | 28 ++++++++++++++++++++++++++++ board/ti/ks2_evm/README | 32 ++++++++++++++++++-------------- include/configs/ti_armv7_keystone2.h | 4 ++-- 4 files changed, 48 insertions(+), 32 deletions(-) create mode 100644 arch/arm/mach-keystone/config.mk
Signature · 1 line
2.1.4
PATCH 1/5 ARM: keystone2: configs: Move SP to end of u-boot section
Currently u-boot stack is defined at the beginning of MSMC RAM. This is a problem for uart boot mode as ROM downloads directly to starting of MSMC RAM.
Fixing it by moving stack to the end of u-boot section and shifting SYS_TEXT_BASE to the start of MSMC RAM.
Updated division of MSMC RAM is shown below:
----------------------------------------- | | | | | U-Boot text |U-Boot | SPL text | | download | Stack | Download + | | | | SPL_BSS + | | | | SPL_STACK | ----------------------------------------- [1] [2] [3] [4]
[1] SYS_TEXT_BASE (Start of MSMC RAM)
[2] SPL_TEXT_BASE - GBL_DATA_SIZE
[3] SPL_TEXT_BASE
[4] END of SPL
[1] + [2] is at least 1M on all platforms, so no chance of overlap.
--- include/configs/ti_armv7_keystone2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/configs/ti_armv7_keystone2.h +2 -2
@@ -20,7 +20,7 @@/* SoC Configuration */ #define CONFIG_ARCH_CPU_INIT #define CONFIG_SYS_ARCH_TIMER -#define CONFIG_SYS_TEXT_BASE 0x0c001000 +#define CONFIG_SYS_TEXT_BASE 0x0c000000#define CONFIG_SPL_TARGET "u-boot-spi.gph"#define CONFIG_SYS_DCACHE_OFF
@@ -29,7 +29,7 @@#define CONFIG_SYS_LPAE_SDRAM_BASE 0x800000000#define CONFIG_MAX_RAM_BANK_SIZE (2 << 30)/* 2GB */ #define CONFIG_STACKSIZE (512 << 10)/* 512 KiB */ -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE - \ +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE - \ GENERATED_GBL_DATA_SIZE)/* SPL SPI Loader Configuration */
Signature · 1 line
2.1.4
PATCH 1/5 ARM: keystone2: configs: Move SP to end of u-boot section
Quoted 42 lines · Lokesh Vutla
Currently u-boot stack is defined at the beginning of MSMC RAM. This is a problem for uart boot mode as ROM downloads directly to starting of MSMC RAM.
Fixing it by moving stack to the end of u-boot section and shiftingSYS_TEXT_BASEto the start of MSMC RAM.
Updated division of MSMC RAM is shown below:
-----------------------------------------
| | | |
| U-Boot text |U-Boot | SPL text |
| download | Stack | Download + |
| | |SPL_BSS+ |
| | |SPL_STACK|
-----------------------------------------
[1] [2] [3] [4][1]
SYS_TEXT_BASE(Start of MSMC RAM)
[2]SPL_TEXT_BASE-GBL_DATA_SIZE
[3]SPL_TEXT_BASE
[4] END of SPL[1] + [2] is at least 1M on all platforms, so no chance of overlap.
Reviewed-by Nishanth Menon <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>--- include/configs/ti_armv7_keystone2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/configs/ti_armv7_keystone2.h +1
-1@@ -20,7 +20,7 @@/* SoC Configuration */ #define CONFIG_ARCH_CPU_INIT #define CONFIG_SYS_ARCH_TIMER -#define CONFIG_SYS_TEXT_BASE 0x0c001000 +#define CONFIG_SYS_TEXT_BASE 0x0c000000#define CONFIG_SPL_TARGET "u-boot-spi.gph"#define CONFIG_SYS_DCACHE_OFF
include/configs/ti_armv7_keystone2.h line 35
Quoted 8 lines
include/configs/ti_armv7_keystone2.h +1
-1@@ -29,7 +29,7 @@#define CONFIG_SYS_LPAE_SDRAM_BASE 0x800000000#define CONFIG_MAX_RAM_BANK_SIZE (2 << 30)/* 2GB */ #define CONFIG_STACKSIZE (512 << 10)/* 512 KiB */ -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE - \ +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE - \ GENERATED_GBL_DATA_SIZE)/* SPL SPI Loader Configuration */
This change is great. Now that this patch is done, I might like to see the documentation of uart download added in as well - the sequence is not really straight forward without documentation to follow
Regards,
Nishanth Menon
PATCH 1/5 ARM: keystone2: configs: Move SP to end of u-boot section
Hi Nishanth,
Quoted 50 lines · menon.nishanth at gmail.com
Quoted 49 lines · Lokesh Vutla
Currently u-boot stack is defined at the beginning of MSMC RAM. This is a problem for uart boot mode as ROM downloads directly to starting of MSMC RAM.
Fixing it by moving stack to the end of u-boot section and shiftingSYS_TEXT_BASEto the start of MSMC RAM.
Updated division of MSMC RAM is shown below:
-----------------------------------------
| | | |
| U-Boot text |U-Boot | SPL text |
| download | Stack | Download + |
| | |SPL_BSS+ |
| | |SPL_STACK|
-----------------------------------------
[1] [2] [3] [4][1]
SYS_TEXT_BASE(Start of MSMC RAM)
[2]SPL_TEXT_BASE-GBL_DATA_SIZE
[3]SPL_TEXT_BASE
[4] END of SPL[1] + [2] is at least 1M on all platforms, so no chance of overlap.
Reviewed-by Nishanth Menon <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>--- include/configs/ti_armv7_keystone2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/configs/ti_armv7_keystone2.h +2
-2@@ -20,7 +20,7 @@/* SoC Configuration */ #define CONFIG_ARCH_CPU_INIT #define CONFIG_SYS_ARCH_TIMER -#define CONFIG_SYS_TEXT_BASE 0x0c001000 +#define CONFIG_SYS_TEXT_BASE 0x0c000000#define CONFIG_SPL_TARGET "u-boot-spi.gph"#define CONFIG_SYS_DCACHE_OFF @@ -29,7 +29,7 @@#define CONFIG_SYS_LPAE_SDRAM_BASE 0x800000000#define CONFIG_MAX_RAM_BANK_SIZE (2 << 30)/* 2GB */ #define CONFIG_STACKSIZE (512 << 10)/* 512 KiB */ -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE - \ +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE - \ GENERATED_GBL_DATA_SIZE)
Quoted 5 lines
include/configs/ti_armv7_keystone2.h line 35
Quoted 1 line
include/configs/ti_armv7_keystone2.h +0
-0/* SPL SPI Loader Configuration */ This change is great. Now that this patch is done, I might like to see the documentation of uart download added in as well - the sequence is not really straight forward without documentation to follow
Patch 5/5 does the update in the README.
Thanks and regards,
Lokesh
Quoted 4 lines
Regards,
Nishanth Menon
PATCH 1/5 ARM: keystone2: configs: Move SP to end of u-boot section
Quoted 1 line · Lokesh Vutla
Hi Nishanth,
[..]
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
/* SPL SPI Loader Configuration */
This change is great. Now that this patch is done, I might like to see the documentation of uart download added in as well - the sequence is not really straight forward without documentation to follow
Patch 5/5 does the update in the README.
Sorry about that. looks like my mail filters were a little hinky today and patches 4 and 5 seemed to have slipped my folder :(.... Anyways, Thanks for taking care of the same.
Regards,
Nishanth Menon
PATCH 1/5 ARM: keystone2: configs: Move SP to end of u-boot section
In reply to Lokesh VutlaQuoted 20 lines · Lokesh Vutla
Currently u-boot stack is defined at the beginning of MSMC RAM. This is a problem for uart boot mode as ROM downloads directly to starting of MSMC RAM.
Fixing it by moving stack to the end of u-boot section and shiftingSYS_TEXT_BASEto the start of MSMC RAM.
Updated division of MSMC RAM is shown below:----------------------------------------- | | | | | U-Boot text |U-Boot | SPL text | | download | Stack | Download + | | | | SPL_BSS + | | | | SPL_STACK | ----------------------------------------- [1] [2] [3] [4][1]
SYS_TEXT_BASE(Start of MSMC RAM)
[2]SPL_TEXT_BASE-GBL_DATA_SIZE
[3]SPL_TEXT_BASE
[4] END of SPL
Quoted 4 lines
[1] + [2] is at least 1M on all platforms, so no chance of overlap.
Reviewed-by Nishanth Menon <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/b9c2d030/attachment.sig>
PATCH 2/5 ARM: keystone2: move the custom build rules out to keystone specific makefile
In reply to Lokesh VutlaFrom: Nishanth Menon <[email protected]>
Keystone has build rules introduced by commit ef509b9063fb7 ("k2hk: add support for k2hk SOC and EVM") and commit 0e7f2dbac6ead ("keystone: add support for NAND gpheader image").
These are not reused by other platforms for the build, hence there is no clear benefit is maintaining them in the generic makefile as a build target. move these to the keystone specific make option
Original idea of using config.mk by Lokesh Vutla <[email protected]>
--- Makefile | 16 ---------------- arch/arm/mach-keystone/config.mk | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 arch/arm/mach-keystone/config.mk
Makefile +0 -16
@@ -1004,22 +1004,6 @@ OBJCOPYFLAGS_u-boot.spr = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE $(call if_changed,pad_cat) -MKIMAGEFLAGS_u-boot-spl.gph = -A $(ARCH) -T gpimage -C none \ - -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n SPL -spl/u-boot-spl.gph: spl/u-boot-spl.bin FORCE - $(call if_changed,mkimage) - -OBJCOPYFLAGS_u-boot-spi.gph = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \ - --gap-fill=0 -u-boot-spi.gph: spl/u-boot-spl.gph u-boot.img FORCE - $(call if_changed,pad_cat) - -MKIMAGEFLAGS_u-boot-nand.gph = -A $(ARCH) -T gpimage -C none \ - -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -n U-Boot -u-boot-nand.gph: u-boot.bin FORCE - $(call if_changed,mkimage) - @dd if=/dev/zero bs=8 count=1 2>/dev/null >> $@ - ifneq ($(CONFIG_ARCH_SOCFPGA),) quiet_cmd_socboot = SOCBOOT $@ cmd_socboot = cat spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp \
arch/arm/mach-keystone/config.mk new file +22 -0
@@ -0,0 +1,22 @@ +# Copyright 2015 Texas Instruments Incorporated, <www.ti.com> +# +# Lokesh Vutla <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +MKIMAGEFLAGS_u-boot-spl.gph = -A $(ARCH) -T gpimage -C none \ + -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n SPL +spl/u-boot-spl.gph: spl/u-boot-spl.bin FORCE + $(call if_changed,mkimage) + +OBJCOPYFLAGS_u-boot-spi.gph = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \ + --gap-fill=0 +u-boot-spi.gph: spl/u-boot-spl.gph u-boot.img FORCE + $(call if_changed,pad_cat) + +MKIMAGEFLAGS_u-boot-nand.gph = -A $(ARCH) -T gpimage -C none \ + -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -n U-Boot +u-boot-nand.gph: u-boot.bin FORCE + $(call if_changed,mkimage) + @dd if=/dev/zero bs=8 count=1 2>/dev/null >> $@
Signature · 1 line
2.1.4
PATCH 2/5 ARM: keystone2: move the custom build rules out to keystone specific makefile
Quoted 6 lines · Lokesh Vutla
From: Nishanth Menon <[email protected]>
Keystone has build rules introduced by commit
ef509b9063fb7("k2hk: add support for k2hk SOC and EVM") and commit0e7f2dbac6ead("keystone: add support for NAND gpheader image").
Quoted 8 lines
These are not reused by other platforms for the build, hence there is no clear benefit is maintaining them in the generic makefile as a build target. move these to the keystone specific make option
Original idea of using config.mk by Lokesh Vutla <[email protected]>
Signed-off-by Nishanth Menon <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/38888978/attachment.sig>
PATCH 3/5 ARM: keystone2: Rename u-boot-nand.gph to MLO
In reply to Lokesh VutlaNAND boot mode, ROM expects an image with a gp header in the beginning and an 8bytes filled with zeros at the end. The same is true for SD boot on K2G platforms but the file name should be MLO.
Renaming u-boot-nand.gph to MLO, so that same image can be used for NAND and SD boots. And also not including all the u-boot only images under CONFIG_SPL_BUILD.
--- arch/arm/mach-keystone/config.mk | 6 ++++-- board/ti/ks2_evm/README | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-)
arch/arm/mach-keystone/config.mk +4 -2
@@ -15,8 +15,10 @@ OBJCOPYFLAGS_u-boot-spi.gph = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) u-boot-spi.gph: spl/u-boot-spl.gph u-boot.img FORCE $(call if_changed,pad_cat) -MKIMAGEFLAGS_u-boot-nand.gph = -A $(ARCH) -T gpimage -C none \ +ifndef CONFIG_SPL_BUILD +MKIMAGEFLAGS_MLO = -A $(ARCH) -T gpimage -C none \ -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -n U-Boot -u-boot-nand.gph: u-boot.bin FORCE +MLO: u-boot.bin FORCE $(call if_changed,mkimage) @dd if=/dev/zero bs=8 count=1 2>/dev/null >> $@ +endif
board/ti/ks2_evm/README +5 -5
@@ -61,7 +61,7 @@ Supported image formats: - u-boot.bin: for loading and running u-boot.bin through Texas instruments code composure studio (CCS) - u-boot-spi.gph: gpimage for programming SPI NOR flash for SPI NOR boot - - u-boot-nand.gph: gpimage for programming AEMIF NAND flash for NAND boot + - MLO: gpimage for programming AEMIF NAND flash for NAND boot Build instructions: ===================
@@ -76,9 +76,9 @@ To build u-boot-spi.gph >make k2hk_evm_defconfig >make u-boot-spi.gph -To build u-boot-nand.gph +To build MLO >make k2hk_evm_defconfig - >make u-boot-nand.gph + >make MLO Load and Run U-Boot on keystone EVMs using CCS =========================================
@@ -157,12 +157,12 @@ instructions: 1. Start CCS and run U-boot as described above. 2. Suspend Target. Select Run -> Suspend from top level menu CortexA15_1 (Free Running)" -3. Load u-boot-nand.gph binary from build folder on to DDR address 0x87000000 +3. Load MLO binary from build folder on to DDR address 0x87000000 through CCS as described in step 2 of "Load and Run U-Boot on K2HK EVM using CCS", but using address 0x87000000. 4. Free Run the target as described earlier (step 4) to get u-boot prompt 5. At the U-Boot console type following to setup u-boot environment variables. - setenv filesize <size in hex of u-boot-nand.gph rounded to hex 0x10000> + setenv filesize <size in hex of MLO rounded to hex 0x10000> run burn_uboot_nand Once u-boot prompt is available, Power OFF the EVM. Set the SW1 dip switch to "ARM NAND Boot mode" as per instruction at
Signature · 1 line
2.1.4
PATCH 3/5 ARM: keystone2: Rename u-boot-nand.gph to MLO
Quoted 11 lines · Lokesh Vutla
NAND boot mode, ROM expects an image with a gp header in the beginning and an 8bytes filled with zeros at the end. The same is true for SD boot on K2G platforms but the file name should be MLO.
Renaming u-boot-nand.gph to MLO, so that same image can be used for NAND and SD boots. And also not including all the u-boot only images under
CONFIG_SPL_BUILD.Reported-by Nishanth Menon <[email protected]>Reviewed-by Nishanth Menon <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/7709479f/attachment.sig>
PATCH 4/5 ARM: keystone2: Build MLO by default
In reply to Lokesh VutlaMLO(NAND/MMC boot image), is used for all the ks2 platforms. Enabling it in config.mk so that these images will be automatically built upon calling make. u-boot-spi.gph is already the build target, so not including here.
--- arch/arm/mach-keystone/config.mk | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/mach-keystone/config.mk +4 -0
@@ -5,6 +5,10 @@ # SPDX-License-Identifier: GPL-2.0+ # +ifndef CONFIG_SPL_BUILD +ALL-y += MLO +endif + MKIMAGEFLAGS_u-boot-spl.gph = -A $(ARCH) -T gpimage -C none \ -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n SPL spl/u-boot-spl.gph: spl/u-boot-spl.bin FORCE
Signature · 1 line
2.1.4
PATCH 4/5 ARM: keystone2: Build MLO by default
Quoted 8 lines · Lokesh Vutla
MLO(NAND/MMC boot image), is used for all the ks2 platforms. Enabling it in config.mk so that these images will be automatically built upon calling make. u-boot-spi.gph is already the build target, so not including here.
Reported-by Nishanth Menon <[email protected]>Reviewed-by Nishanth Menon <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/016730af/attachment.sig>
PATCH 5/5 ARM: keystone2: Update README
In reply to Lokesh VutlaUpdate README to include uart boot mode support and makefile changes.
--- board/ti/ks2_evm/README | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
board/ti/ks2_evm/README +15 -11
@@ -56,10 +56,11 @@ configs/k2l_evm_defconfig Supported boot modes: - SPI NOR boot - AEMIF NAND boot + - UART boot Supported image formats: - u-boot.bin: for loading and running u-boot.bin through Texas instruments - code composure studio (CCS) + code composure studio (CCS) and for UART boot. - u-boot-spi.gph: gpimage for programming SPI NOR flash for SPI NOR boot - MLO: gpimage for programming AEMIF NAND flash for NAND boot
@@ -68,17 +69,9 @@ Build instructions: Examples for k2hk, for k2e and k2l just replace k2hk prefix accordingly. Don't forget to add ARCH=arm and CROSS_COMPILE. -To build u-boot.bin +To build u-boot.bin, u-boot-spi.gph, MLO: >make k2hk_evm_defconfig - >make u-boot.bin - -To build u-boot-spi.gph - >make k2hk_evm_defconfig - >make u-boot-spi.gph - -To build MLO - >make k2hk_evm_defconfig - >make MLO + >make Load and Run U-Boot on keystone EVMs using CCS =========================================
@@ -168,3 +161,14 @@ instructions: to "ARM NAND Boot mode" as per instruction at http://processors.wiki.ti.com/index.php/*_Hardware_Setup. 6. Power ON the EVM. The EVM now boots with u-boot image on the NAND flash. + +Load and Run U-Boot on keystone EVMs using UART download +======================================================== + +Open BMC and regular UART terminals. + +1. On the regular UART port start xmodem transfer of the u-boot.bin +2. Using BMC terminal set the ARM-UART bootmode and reboot the EVM + BMC> bootmode #4 + MBC> reboot +3. When xmodem is complete you should see the u-boot starts on the UART port
Signature · 1 line
2.1.4
PATCH 5/5 ARM: keystone2: Update README
Quoted 4 lines · Lokesh Vutla
Update README to include uart boot mode support and makefile changes.
Signed-off-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/c5bb10fd/attachment.sig>