[U-Boot] [PATCH 2/2] lsxl: rework boot scripts

Michael Walle michael at walle.cc
Wed Mar 12 19:42:54 CET 2014


Move addresses for kernel, ramdisk and fdt blob to own variables. Add dtb
blob loading to all existing boot scripts, dtb filenames were taken from
vanilla kernel. Introduce new boot script bootcmd_legacy, which only loads
a kernel and a ramdisk. Make this the default boot script. This should also
restore the behaviour of the original bootloader.

Cc: Prafulla Wadaskar <prafulla at marvell.com>
Signed-off-by: Michael Walle <michael at walle.cc>
---
 include/configs/lsxl.h |   43 +++++++++++++++++++++++++++++++++----------
 1 file changed, 33 insertions(+), 10 deletions(-)

diff --git a/include/configs/lsxl.h b/include/configs/lsxl.h
index cc7a6ab..8f4f382 100644
--- a/include/configs/lsxl.h
+++ b/include/configs/lsxl.h
@@ -108,20 +108,43 @@
 #define CONFIG_LOADADDR		0x00800000
 #define CONFIG_BOOTCOMMAND	"run bootcmd_${bootsource}"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 root=/dev/sda2"
+
+#if defined(CONFIG_LSXHL)
+#define CONFIG_FDTFILE "kirkwood-lsxhl.dtb"
+#elif defined(CONFIG_LSCHLV2)
+#define CONFIG_FDTFILE "kirkwood-lschlv2.dtb"
+#else
+#error "Unsupported board"
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS					\
-	"bootsource=hdd\0"						\
+	"bootsource=legacy\0"						\
 	"hdpart=0:1\0"							\
-	"bootcmd_net=bootp 0x00100000 uImage "				\
-		"&& tftpboot 0x00800000 uInitrd "			\
-		"&& bootm 0x00100000 0x00800000\0"			\
+	"kernel_addr=0x00100000\0"					\
+	"ramdisk_addr=0x00800000\0"					\
+	"fdt_addr=0x007f0000\0"						\
+	"bootcmd_legacy=ide reset "					\
+		"&& ext2load ide ${hdpart} ${kernel_addr} "		\
+			"/uImage.buffalo "				\
+		"&& ext2load ide ${hdpart} ${ramdisk_addr} "		\
+			"/initrd.buffalo "				\
+		"&& bootm ${kernel_addr} ${ramdisk_addr}\0"		\
+	"bootcmd_net=bootp ${kernel_addr} uImage "			\
+		"&& tftpboot ${ramdisk_addr} uInitrd "			\
+		"&& tftpboot ${fdt_addr} " CONFIG_FDTFILE " "		\
+		"&& bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"	\
 	"bootcmd_hdd=ide reset "					\
-		"&& ext2load ide ${hdpart} 0x00100000 /uImage "		\
-		"&& ext2load ide ${hdpart} 0x00800000 /uInitrd "	\
-		"&& bootm 0x00100000 0x00800000\0"			\
+		"&& ext2load ide ${hdpart} ${kernel_addr} /uImage "	\
+		"&& ext2load ide ${hdpart} ${ramdisk_addr} /uInitrd "	\
+		"&& ext2load ide ${hdpart} ${fdt_addr} "		\
+			"/" CONFIG_FDTFILE " "				\
+		"&& bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"	\
 	"bootcmd_usb=usb start "					\
-		"&& fatload usb 0:1 0x00100000 /uImage "		\
-		"&& fatload usb 0:1 0x00800000 /uInitrd "		\
-		"&& bootm 0x00100000 0x00800000\0"			\
+		"&& fatload usb 0:1 ${kernel_addr} /uImage "		\
+		"&& fatload usb 0:1 ${ramdisk_addr} /uInitrd "		\
+		"&& fatload usb 0:1 ${fdt_addr} "			\
+			"/" CONFIG_FDTFILE " "				\
+		"&& bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"	\
 	"bootcmd_rescue=run config_nc_dhcp; run nc\0"			\
 	"eraseenv=sf probe 0 "						\
 		"&& sf erase " __stringify(CONFIG_ENV_OFFSET)		\
-- 
1.7.10.4



More information about the U-Boot mailing list