[U-Boot] [u-boot-release] [Patch V4 1/2] armv8: ls1088ardb: Add SD boot support for ls1088

Ashish Kumar ashish.kumar at nxp.com
Tue Oct 31 10:04:09 UTC 2017


Please see inline, fixing all comments in next version.

Regards
Ashish

-----Original Message-----
From: York Sun 
Sent: Monday, October 30, 2017 8:25 PM
To: Ashish Kumar <ashish.kumar at nxp.com>; u-boot at lists.denx.de
Cc: Raghav Dogra <raghav.dogra at nxp.com>; Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>
Subject: Re: [u-boot-release] [Patch V4 1/2] armv8: ls1088ardb: Add SD boot support for ls1088

On 10/30/2017 03:31 AM, Ashish Kumar wrote:
> Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>
> Signed-off-by: Ashish Kumar <Ashish.Kumar at nxp.com>
> Signed-off-by: Raghav Dogra <raghav.dogra at nxp.com>
> ---
> 
> v4:
> Add Documentation for SD boot
> Rebase to top
> 
>  arch/arm/Kconfig                                   |  1 +
>  arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 | 43 ++++++++++++++++++++++
>  board/freescale/ls1088a/MAINTAINERS                |  1 +
>  board/freescale/ls1088a/ddr.c                      |  5 ++-
>  configs/ls1088ardb_sdcard_qspi_defconfig           | 33 +++++++++++++++++
>  include/configs/ls1088a_common.h                   | 35 ++++++++++++++++++
>  include/configs/ls1088ardb.h                       | 31 +++++++++++++++-
>  7 files changed, 146 insertions(+), 3 deletions(-)  create mode 
> 100644 configs/ls1088ardb_sdcard_qspi_defconfig
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 
> 83b7aa5..5707111 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -938,6 +938,7 @@ config TARGET_LS1088ARDB
>  	select ARMV8_MULTIENTRY
>  	select ARCH_MISC_INIT
>  	select BOARD_LATE_INIT
> +	select SUPPORT_SPL
>  	help
>  	  Support for NXP LS1088ARDB platform.
>  	  The LS1088A Reference design board (RDB) is a high-performance 
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 
> b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3
> index 7867c37..5f10415 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3
> @@ -201,6 +201,49 @@ nand write <u-boot image in memory> 80000 <size 
> of u-boot image>  Notice the difference from QDS is SRC, SRC_ADDR and 
> the offset of u-boot image  to match board NAND device with 4KB/page, block size 512KB.
>  
> +Booting from SD/eMMC
> +-------------------
> +Booting from SD/eMMC requires two images, RCW and u-boot-with-spl.bin.
> +The difference between SD boot RCW image and QSPI-NOR boot image is 
> +the PBI command sequence. Below is one example for PBI commands for 
> +RDB and QDS which uses SD device with sector size 512.
> +
> +1) Block Copy: SRC=0x0040, SRC_ADDR=0x00100000, DEST_ADDR=0x1800a000,
> +BLOCK_SIZE=0x00016000
> +
> +This command copies u-boot image from SD device into OCRAM. The 
> +values need to adjust accordingly for SD/eMMC
> +
> +SRC		should match the cfg_rcw_src, the reset config pins. It depends
> +		on the device will be SD(0x0040) or eMMC(0x0041).

Please fix this sentence.
Will fix in next version

> +SRC_ADDR	is the offset of u-boot-with-spl.bin image in SD device. In
> +		the example above, 1MB. This is same as QSPI-NOR.

This field is always in byte, isn't it? Does it always use 512KB block size?
It is offset of u-boot start address at 1MB

> +DEST_ADDR	is fixed at 0x1800a000, matching bootloc set above.

It is not "fixed", but rather "matching" the setting below.
Will fix in next version

> +BLOCK_SIZE	is the size to be copied by PBI.
> +
> +2) CCSR 4-byte write to 0x01e00404, data=0x00000000
> +3) CCSR 4-byte write to 0x01e00400, data=0x1800a000 The above two 
> +commands set bootloc register to 0x00000000_1800a000 where the u-boot 
> +code will be running in OCRAM.
> +
> +
> +RCW image should be written at 8th sector of device(SD/eMMC). Example 
> +of using u-boot command

I think the term here is "block", not "sector".
Will fix in next version

> +
> +mc erase 0x8 0x10

You are missing a "m" here.
Will fix in next version

> +mmc write <rcw image in memory> 0x8 <size of rcw in sector count 
> +typical value= 10>
> +
> +To form the SD-Boot image, build u-boot with SD config, for example, 
> +ls1088ardb_sdcard_qspi_defconfig. The image needed is u-boot-with-spl.bin.
> +The u-boot image should be written to match SRC_ADDR, in above 
> +example  offset 0x100000 in other work it means sector location 0x800

s/sector/block
Will fix in next version

<snip>

>  
> +#ifdef CONFIG_SPL
> +#define CONFIG_SPL_BSS_START_ADDR      0x80100000
> +#define CONFIG_SPL_BSS_MAX_SIZE                0x00100000
> +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT #define 
> +CONFIG_SPL_ENV_SUPPORT #define CONFIG_SPL_FRAMEWORK #define 
> +CONFIG_SPL_I2C_SUPPORT #define CONFIG_SPL_LDSCRIPT 
> +"arch/arm/cpu/armv8/u-boot-spl.lds"
> +#define CONFIG_SPL_LIBCOMMON_SUPPORT
> +#define CONFIG_SPL_LIBGENERIC_SUPPORT
> +#define CONFIG_SPL_MAX_SIZE            0x16000
> +#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
> +#define CONFIG_SPL_SERIAL_SUPPORT
> +#define CONFIG_SPL_STACK               (CONFIG_SYS_FSL_OCRAM_BASE + 0x9ff0)
> +#define CONFIG_SPL_TARGET              "u-boot-with-spl.bin"
> +#define CONFIG_SPL_TEXT_BASE           0x1800a000
> +#ifdef CONFIG_SD_BOOT
> +#define CONFIG_SPL_MMC_SUPPORT
> +#endif
> +
> +#define CONFIG_SYS_SPL_MALLOC_SIZE     0x00100000
> +#define CONFIG_SYS_SPL_MALLOC_START    0x80200000
> +#define CONFIG_SYS_MONITOR_LEN         (512 * 1024)
> +#endif
>  #define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
>  
>  #endif /* __LS1088_COMMON_H */

Please double check. I am sure some of the config options are in Kconfig.
Will fix in next version

York


More information about the U-Boot mailing list