Skip to contentSkip to conversation

armv8: ls1088ardb: Add SD boot support for ls1088

PATCH Superseded Ashish Kumar 2 participants 4 messages Oct 30, 2017 – Oct 31, 2017 Arm (32-bit)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 armv8: ls1088ardb: Add SD boot support for ls1088

---

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
arch/arm/Kconfig +1 -0
index 83b7aa5..5707111 100644
@@ -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
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +43 -0

49 lines not on this page · raw message

board/freescale/ls1088a/MAINTAINERS +1 -0
index e1e6d4b..68f23d6 100644
@@ -5,6 +5,7 @@ S:	Maintained
 F:	board/freescale/ls1088a/
 F:	include/configs/ls1088ardb.h
 F:	configs/ls1088ardb_qspi_defconfig
+F:	configs/ls1088ardb_sdcard_qspi_defconfig
 
 LS1088AQDS BOARD
 M:	Prabhakar Kushwaha <[email protected]>
board/freescale/ls1088a/ddr.c +4 -1
index 0ecfd65..e24bfd5 100644
@@ -96,7 +96,10 @@ int fsl_initdram(void)
 {
 	puts("Initializing DDR....using SPD\n");
 
+#if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD)
+	gd->ram_size = fsl_ddr_sdram_size();
+#else
 	gd->ram_size = fsl_ddr_sdram();
-
+#endif
 	return 0;
 }
configs/ls1088ardb_sdcard_qspi_defconfig new file +33 -0
new file mode 100644
index 0000000..c226bc1
@@ -0,0 +1,33 @@
+CONFIG_ARM=y
+CONFIG_TARGET_LS1088ARDB=y
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1088a-rdb"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_SYS_EXTRA_OPTIONS="SD_BOOT_QSPI"
+CONFIG_SD_BOOT=y
+CONFIG_SPL=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_PING=y
+CONFIG_OF_CONTROL=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_SPI_FLASH=y
+CONFIG_NETDEVICES=y
+CONFIG_E1000=y
+CONFIG_SYS_NS16550=y
+CONFIG_FSL_DSPI=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x8b0
+CONFIG_FSL_LS_PPA=y
+CONFIG_SPL_BUILD=y
+CONFIG_PARTITIONS=y
+# CONFIG_DISPLAY_BOARDINFO is not set
include/configs/ls1088a_common.h +35 -0
index fa058f7..ec883c3 100644
@@ -20,18 +20,24 @@
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_FSL_OCRAM_BASE + 0xfff0)
 
 /* Link Definitions */
+#ifdef CONFIG_SPL
+#define CONFIG_SYS_TEXT_BASE		0x80400000
+#else
 #ifdef CONFIG_QSPI_BOOT
 #define CONFIG_SYS_TEXT_BASE            0x20100000
 #else
 #define CONFIG_SYS_TEXT_BASE		0x30100000
 #endif
+#endif
 
 #define CONFIG_SUPPORT_RAW_INITRD
 
 
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
+#if !defined(CONFIG_SD_BOOT)
 #define CONFIG_FSL_DDR_INTERACTIVE	/* Interactive debugging */
+#endif
 
 #define CONFIG_VERY_BIG_RAM
 #define CONFIG_SYS_DDR_SDRAM_BASE	0x80000000UL
@@ -187,6 +193,11 @@ unsigned long long get_qixis_addr(void);
 				" fsl_mc apply dpl 0x80200000 &&" \
 				" sf read $kernel_load $kernel_start" \
 				" $kernel_size && bootm $kernel_load"
+#elif defined(CONFIG_SD_BOOT)
+#define CONFIG_BOOTCOMMAND	"mmcinfo;mmc read 0x80200000 0x6800 0x800;"\
+				" fsl_mc apply dpl 0x80200000 &&" \
+				" mmc read $kernel_load $kernel_start" \
+				" $kernel_size && bootm $kernel_load"
 #else /* NOR BOOT*/
 #define CONFIG_BOOTCOMMAND	"fsl_mc apply dpl 0x580d00000 &&" \
 				" cp.b $kernel_start $kernel_load" \
@@ -206,6 +217,30 @@ unsigned long long get_qixis_addr(void);
 
 #define CONFIG_PANIC_HANG	/* do not reset board on panic */
 
+#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 */
include/configs/ls1088ardb.h +29 -2
index 8fdc576..3234b79 100644
@@ -15,6 +15,11 @@
 #define CONFIG_ENV_SIZE			0x2000          /* 8KB */
 #define CONFIG_ENV_OFFSET		0x300000        /* 3MB */
 #define CONFIG_ENV_SECT_SIZE		0x40000
+#elif defined(CONFIG_SD_BOOT)
+#define CONFIG_ENV_OFFSET		(3 * 1024 * 1024)
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		0
+#define CONFIG_ENV_SIZE			0x2000
 #else
 #define CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_ENV_ADDR			(CONFIG_SYS_FLASH_BASE + 0x300000)
@@ -22,9 +27,10 @@
 #define CONFIG_ENV_SIZE			0x20000
 #endif
 
-#if defined(CONFIG_QSPI_BOOT)
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 #define CONFIG_QIXIS_I2C_ACCESS
 #define SYS_NO_FLASH
+#undef CONFIG_CMD_IMLS
 #endif
 
 #define CONFIG_SYS_CLK_FREQ		100000000
@@ -232,7 +238,7 @@
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	5
 
 /* QSPI device */
-#if defined(CONFIG_QSPI_BOOT)
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 #define CONFIG_FSL_QSPI
 #define FSL_QSPI_FLASH_SIZE		(1 << 26)
 #define FSL_QSPI_FLASH_NUM		2
@@ -243,7 +249,11 @@
 #define CONFIG_SYS_MEMTEST_START	0x80000000
 #define CONFIG_SYS_MEMTEST_END		0x9fffffff
 
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
+#else
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
+#endif
 
 #define CONFIG_FSL_MEMAC
 
@@ -265,6 +275,23 @@
 	"sf read 0x80100000 0xE00000 0x100000;" \
 	"fsl_mc start mc 0x80000000 0x80100000\0"	\
 	"mcmemsize=0x70000000 \0"
+#elif defined(CONFIG_SD_BOOT)
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS		\
+	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
+	"loadaddr=0x90100000\0"			\
+	"kernel_addr=0x800\0"			\
+	"ramdisk_addr=0x800000\0"		\
+	"ramdisk_size=0x2000000\0"		\
+	"fdt_high=0xa0000000\0"			\
+	"initrd_high=0xffffffffffffffff\0"	\
+	"kernel_start=0x8000\0"			\
+	"kernel_load=0xa0000000\0"		\
+	"kernel_size=0x14000\0"			\
+	"mcinitcmd=mmcinfo;mmc read 0x80000000 0x5000 0x800;"	\
+	"mmc read 0x80100000 0x7000 0x800;"	\
+	"fsl_mc start mc 0x80000000 0x80100000\0"	\
+	"mcmemsize=0x70000000 \0"
 
 #endif
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH v4 2/2 armv8: ls1088aqds: Add SD boot support for ls1088qds

---

v2: rebase to top

 arch/arm/Kconfig                         |  1 +
 board/freescale/ls1088a/MAINTAINERS      |  1 +
 configs/ls1088aqds_sdcard_qspi_defconfig | 33 ++++++++++++++++++++++++++++++++
 include/configs/ls1088aqds.h             | 33 +++++++++++++++++++++++++++++---
 4 files changed, 65 insertions(+), 3 deletions(-)
 create mode 100644 configs/ls1088aqds_sdcard_qspi_defconfig
arch/arm/Kconfig +1 -0
index 5707111..25514ed 100644
@@ -824,6 +824,7 @@ config TARGET_LS1088AQDS
 	select ARMV8_MULTIENTRY
 	select ARCH_MISC_INIT
 	select BOARD_LATE_INIT
+	select SUPPORT_SPL
 	help
 	  Support for NXP LS1088AQDS platform
 	  The LS1088A Development System (QDS) is a high-performance
board/freescale/ls1088a/MAINTAINERS +1 -0
index 68f23d6..b3d5c38 100644
@@ -14,3 +14,4 @@ S:	Maintained
 F:	board/freescale/ls1088a/
 F:	include/configs/ls1088aqds.h
 F:	configs/ls1088aqds_qspi_defconfig
+F:	configs/ls1088aqds_sdcard_qspi_defconfig
configs/ls1088aqds_sdcard_qspi_defconfig new file +33 -0
new file mode 100644
index 0000000..95d8627
@@ -0,0 +1,33 @@
+CONFIG_ARM=y
+CONFIG_TARGET_LS1088AQDS=y
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1088a-qds"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_SYS_EXTRA_OPTIONS="SD_BOOT_QSPI"
+CONFIG_SD_BOOT=y
+CONFIG_SPL=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_PING=y
+CONFIG_OF_CONTROL=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_SPI_FLASH=y
+CONFIG_NETDEVICES=y
+CONFIG_E1000=y
+CONFIG_SYS_NS16550=y
+CONFIG_FSL_DSPI=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x8b0
+CONFIG_FSL_LS_PPA=y
+CONFIG_SPL_BUILD=y
+CONFIG_PARTITIONS=y
+# CONFIG_DISPLAY_BOARDINFO is not set
include/configs/ls1088aqds.h +30 -3
index 31efb82..de23d3a 100644
@@ -23,6 +23,11 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_ENV_SIZE			0x2000          /* 8KB */
 #define CONFIG_ENV_OFFSET		0x300000        /* 3MB */
 #define CONFIG_ENV_SECT_SIZE		0x40000
+#elif defined(CONFIG_SD_BOOT)
+#define CONFIG_ENV_OFFSET		(3 * 1024 * 1024)
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		0
+#define CONFIG_ENV_SIZE			0x2000
 #else
 #define CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_ENV_ADDR			(CONFIG_SYS_FLASH_BASE + 0x300000)
@@ -30,10 +35,11 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_ENV_SIZE			0x20000
 #endif
 
-#if defined(CONFIG_QSPI_BOOT)
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 #define CONFIG_QIXIS_I2C_ACCESS
 #define SYS_NO_FLASH
 
+#undef CONFIG_CMD_IMLS
 #define CONFIG_SYS_CLK_FREQ		100000000
 #define CONFIG_DDR_CLK_FREQ		100000000
 #else
@@ -190,7 +196,7 @@ unsigned long get_board_ddr_clk(void);
 					| CSPR_V)
 
 #define CONFIG_SYS_FPGA_AMASK		IFC_AMASK(64*1024)
-#if defined(CONFIG_QSPI_BOOT)
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 #define CONFIG_SYS_FPGA_CSOR		CSOR_GPCM_ADM_SHIFT(0)
 #else
 #define CONFIG_SYS_FPGA_CSOR		CSOR_GPCM_ADM_SHIFT(12)
@@ -293,7 +299,7 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	5
 
 /* QSPI device */
-#if defined(CONFIG_QSPI_BOOT)
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 #define CONFIG_FSL_QSPI
 #define FSL_QSPI_FLASH_SIZE		(1 << 26)
 #define FSL_QSPI_FLASH_NUM		2
@@ -315,7 +321,11 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_MEMTEST_START	0x80000000
 #define CONFIG_SYS_MEMTEST_END		0x9fffffff
 
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
+#else
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
+#endif
 
 #define CONFIG_FSL_MEMAC
 
@@ -343,6 +353,23 @@ unsigned long get_board_ddr_clk(void);
 	"sf read 0x80100000 0xE00000 0x100000;" \
 	"fsl_mc start mc 0x80000000 0x80100000\0"	\
 	"mcmemsize=0x70000000 \0"
+#elif defined(CONFIG_SD_BOOT)
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS               \
+	"hwconfig=fsl_ddr:bank_intlv=auto\0"    \
+	"loadaddr=0x90100000\0"                 \
+	"kernel_addr=0x800\0"                \
+	"ramdisk_addr=0x800000\0"               \
+	"ramdisk_size=0x2000000\0"              \
+	"fdt_high=0xa0000000\0"                 \
+	"initrd_high=0xffffffffffffffff\0"      \
+	"kernel_start=0x8000\0"              \
+	"kernel_load=0xa0000000\0"              \
+	"kernel_size=0x14000\0"               \
+	"mcinitcmd=mmcinfo;mmc read 0x80000000 0x5000 0x800;"  \
+	"mmc read 0x80100000 0x7000 0x800;" \
+	"fsl_mc start mc 0x80000000 0x80100000\0"       \
+	"mcmemsize=0x70000000 \0"
 #else	/* NOR BOOT */
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS		\
Signature · 1 line
2.7.4
#2 lore raw

PATCH v4 1/2 armv8: ls1088ardb: Add SD boot support for ls1088

In reply to Ashish Kumar
Quoted 44 lines · Ashish Kumar

---

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
arch/arm/Kconfig +1 -0
index 83b7aa5..5707111 100644
@@ -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
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +5 -0
index 7867c37..5f10415 100644
@@ -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

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image> · line 218

Quoted 10 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +10 -0
+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.

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image> · line 220

Quoted 2 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +2 -0
+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?

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image> · line 221

Quoted 1 line
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +1 -0
+DEST_ADDR	is fixed at 0x1800a000, matching bootloc set above.

It is not "fixed", but rather "matching" the setting below.

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image> · line 231

Quoted 10 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +10 -0
+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".

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image> · line 233

Quoted 2 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +2 -0
+
+mc erase 0x8 0x10

You are missing a "m" here.

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image> · line 239

Quoted 6 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +6 -0
+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

<snip>

Quoted 18 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +17 -0
+#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

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image>

Quoted 10 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +7 -0
+#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.

York

#3 lore raw

PATCH v4 1/2 armv8: ls1088ardb: Add SD boot support for ls1088

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 <[email protected]>; u-boot at lists.denx.de
Cc: Raghav Dogra <[email protected]>; Prabhakar Kushwaha <[email protected]>
Subject: Re: [u-boot-release] [Patch V4 1/2] armv8: ls1088ardb: Add SD boot support for ls1088

Quoted 45 lines · Ashish Kumar

---

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

arch/arm/Kconfig index renamed from arch/arm/Kconfig +0 -0

83b7aa5..5707111 100644

arch/arm/Kconfig +1 -0
@@ -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 
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +0 -0
index 7867c37..5f10415 100644
@@ -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.

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +5 -0
+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 

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image> · line 218

Quoted 10 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +10 -0
+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

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image> · line 220

Quoted 2 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +2 -0
+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

Quoted 1 line

+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

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 nand write <u-boot image in memory> 80000 <size of u-boot image>

Quoted 10 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +10 -0
+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

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3

Quoted 2 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +2 -0
+
+mc erase 0x8 0x10

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

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3

Quoted 7 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +7 -0
+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>

Quoted 17 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +16 -0
+#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

arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3

Quoted 10 lines
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch3 +7 -0
+#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