[U-Boot] [RFC 1/2] armv8, fsl-layerscape: Add SD boot support for LS1088A

Ashish Kumar Ashish.Kumar at nxp.com
Fri Apr 28 06:40:35 UTC 2017


Add SD boot support for LS1088ARDB

Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>
Signed-off-by: Raghav Dogra <raghav.dogra at nxp.com>
Signed-off-by: Ashish Kumar <Ashish.Kumar at nxp.com>
---
 arch/arm/Kconfig                         |  3 +++
 configs/ls1088ardb_sdcard_qspi_defconfig | 31 ++++++++++++++++++++++++++
 include/configs/ls1088a_common.h         | 38 ++++++++++++++++++++++++++++++--
 include/configs/ls1088ardb.h             | 27 ++++++++++++++++++++++-
 4 files changed, 96 insertions(+), 3 deletions(-)
 create mode 100644 configs/ls1088ardb_sdcard_qspi_defconfig

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a5a5927..7091f9b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -970,6 +970,9 @@ config TARGET_LS1088ARDB
 	select ARCH_LS1088A
 	select ARM64
 	select ARMV8_MULTIENTRY
+	select BOARD_LATE_INIT
+	select SUPPORT_SPL
+	select ARCH_MISC_INIT
 	help
 	  Support for NXP LS1088ARDB platform.
 	  The LS1088AA Reference design board (RDB) is a high-performance
diff --git a/configs/ls1088ardb_sdcard_qspi_defconfig b/configs/ls1088ardb_sdcard_qspi_defconfig
new file mode 100644
index 0000000..6d610ab
--- /dev/null
+++ b/configs/ls1088ardb_sdcard_qspi_defconfig
@@ -0,0 +1,31 @@
+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, SD_BOOT_QSPI"
+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_SPL_BUILD=y
+CONFIG_PARTITIONS=y
diff --git a/include/configs/ls1088a_common.h b/include/configs/ls1088a_common.h
index 35e806e..80f73d6 100644
--- a/include/configs/ls1088a_common.h
+++ b/include/configs/ls1088a_common.h
@@ -19,22 +19,27 @@
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_FSL_OCRAM_BASE + 0xfff0)
 
 /* We need architecture specific misc initializations */
-#define CONFIG_ARCH_MISC_INIT
 
 
 /* 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_SPI_FLASH_BAR
 #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
@@ -42,7 +47,7 @@
 #define CONFIG_SYS_SDRAM_BASE		CONFIG_SYS_DDR_SDRAM_BASE
 #define CONFIG_SYS_DDR_BLOCK2_BASE	0x8080000000ULL
 #define CONFIG_SYS_FSL_DDR_MAIN_NUM_CTRLS	1
-#define CONFIG_BOARD_LATE_INIT
+
 /*
  * SMP Definitinos
  */
@@ -184,6 +189,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 0x3800 0x800;"\
+                               " fsl_mc apply dpl 0x80200000 &&" \
+                               " mmc read $kernel_load $kernel_start" \
+                               " $kernel_size && bootm $kernel_load"
 #else
 #define CONFIG_BOOTCOMMAND	"fsl_mc apply dpl 0x580700000 &&" \
 				" cp.b $kernel_start $kernel_load" \
@@ -203,6 +213,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 */
diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h
index b842802..78808bc 100644
--- a/include/configs/ls1088ardb.h
+++ b/include/configs/ls1088ardb.h
@@ -9,7 +9,7 @@
 
 #include "ls1088a_common.h"
 
-#ifdef CONFIG_QSPI_BOOT
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 #define CONFIG_DISPLAY_BOARDINFO_LATE
 #else
 #define CONFIG_DISPLAY_BOARDINFO
@@ -279,6 +279,12 @@
 #define CONFIG_CMD_MEMTEST
 #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
 
 /* Initial environment variables */
@@ -299,6 +305,25 @@
 	"sf read 0x80100000 0x800000 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=0x8800\0"              \
+        "kernel_load=0xa0000000\0"              \
+        "kernel_size=0x14000\0"               \
+        "mcinitcmd=mmcinfo;mmc read 0x80000000 0x1800 0x800;"  \
+        "mmc read 0x80100000 0x4000 0x800;" \
+        "fsl_mc start mc 0x80000000 0x80100000\0"       \
+        "mcmemsize=0x70000000 \0"
+
+
 #else 	/* NOR_BOOT */
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS		\
-- 
2.7.4



More information about the U-Boot mailing list