Blob Blame History Raw
From da76356b5c9df13e3e948fc1409b0a0921e8d158 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Fri, 6 Mar 2015 10:45:22 +0000
Subject: [PATCH 08/11] port utilite to distro generic boot commands

---
 include/configs/cm_fx6.h | 109 ++++++++++++-----------------------------------
 1 file changed, 27 insertions(+), 82 deletions(-)

diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 4207504..58dd5e1 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -12,7 +12,6 @@
 #define __CONFIG_CM_FX6_H
 
 #include <asm/arch/imx-regs.h>
-#include <config_distro_defaults.h>
 #include "mx6_common.h"
 
 /* Machine config */
@@ -95,97 +94,43 @@
 #define CONFIG_ENV_SIZE			(8 * 1024)
 #define CONFIG_ENV_OFFSET		(768 * 1024)
 
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+#include <config_distro_bootcmd.h>
+
+#ifdef CONFIG_AHCI
+#define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
+#else
+#define BOOT_TARGET_DEVICES_SCSI(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 2) \
+	BOOT_TARGET_DEVICES_SCSI(func) \
+	func(PXE, pxe, na) \
+	func(DHCP, dhcp, na)
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"stdin=serial,usbkbd\0" \
 	"stdout=serial,vga\0" \
 	"stderr=serial,vga\0" \
 	"panel=HDMI\0" \
-	"autoload=no\0" \
-	"kernel=uImage-cm-fx6\0" \
-	"script=boot.scr\0" \
 	"dtb=cm-fx6.dtb\0" \
-	"bootm_low=18000000\0" \
 	"loadaddr=0x10800000\0" \
 	"fdtaddr=0x11000000\0" \
+        "fdt_addr_r=0x18000000\0" \
+        "pxefile_addr_r=0x17f00000\0" \
+        "scriptaddr=0x17e00000\0" \
+        "kernel_addr_r=0x11000000\0" \
+        "ramdisk_addr_r=0x18100000\0" \
+        "bootm_size=0x20000000\0" \
 	"console=ttymxc3,115200\0" \
 	"ethprime=FEC0\0" \
-	"video_hdmi=mxcfb0:dev=hdmi,1920x1080M-32@50,if=RGB32\0" \
-	"video_dvi=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32\0" \
-	"doboot=bootm ${loadaddr}\0" \
-	"doloadfdt=false\0" \
-	"setboottypez=setenv kernel zImage-cm-fx6;" \
-		"setenv doboot bootz ${loadaddr} - ${fdtaddr};" \
-		"setenv doloadfdt true;\0" \
-	"setboottypem=setenv kernel uImage-cm-fx6;" \
-		"setenv doboot bootm ${loadaddr};" \
-		"setenv doloadfdt false;\0"\
-	"mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
-	"sataroot=/dev/sda2 rw rootwait\0" \
-	"nandroot=/dev/mtdblock4 rw\0" \
-	"nandrootfstype=ubifs\0" \
-	"mmcargs=setenv bootargs console=${console} root=${mmcroot} " \
-		"${video}\0" \
-	"sataargs=setenv bootargs console=${console} root=${sataroot} " \
-		"${video}\0" \
-	"nandargs=setenv bootargs console=${console} " \
-		"root=${nandroot} " \
-		"rootfstype=${nandrootfstype} " \
-		"${video}\0" \
-	"nandboot=if run nandloadkernel; then " \
-			"run nandloadfdt;" \
-			"run setboottypem;" \
-			"run storagebootcmd;" \
-			"run setboottypez;" \
-			"run storagebootcmd;" \
-		"fi;\0" \
-	"run_eboot=echo Starting EBOOT ...; "\
-		"mmc dev 2 && " \
-		"mmc rescan && mmc read 10042000 a 400 && go 10042000\0" \
-	"loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0"\
-	"loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0"\
-	"loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${dtb};\0" \
-	"bootscript=echo Running bootscript from ${storagetype} ...;" \
-		   "source ${loadaddr};\0" \
-	"nandloadkernel=nand read ${loadaddr} 0 780000;\0" \
-	"nandloadfdt=nand read ${fdtaddr} 780000 80000;\0" \
-	"setupmmcboot=setenv storagetype mmc; setenv storagedev 2;\0" \
-	"setupsataboot=setenv storagetype sata; setenv storagedev 0;\0" \
-	"setupnandboot=setenv storagetype nand;\0" \
-	"setupusbboot=setenv storagetype usb; setenv storagedev 0;\0" \
-	"storagebootcmd=echo Booting from ${storagetype} ...;" \
-			"run ${storagetype}args; run doboot;\0" \
-	"trybootk=if run loadkernel; then " \
-		"if ${doloadfdt}; then " \
-			"run loadfdt;" \
-		"fi;" \
-		"run storagebootcmd;" \
-		"fi;\0" \
-	"trybootsmz=if run loadscript; then " \
-			"run bootscript;" \
-		"fi;" \
-		"run setboottypem;" \
-		"run trybootk;" \
-		"run setboottypez;" \
-		"run trybootk;\0"
-
-#define CONFIG_BOOTCOMMAND \
-	"run setupmmcboot;" \
-	"mmc dev ${storagedev};" \
-	"if mmc rescan; then " \
-		"run trybootsmz;" \
-	"fi;" \
-	"run setupusbboot;" \
-	"if usb start; then "\
-		"if run loadscript; then " \
-			"run bootscript;" \
-		"fi;" \
-	"fi;" \
-	"run setupsataboot;" \
-	"if sata init; then " \
-		"run trybootsmz;" \
-	"fi;" \
-	"run setupnandboot;" \
-	"run nandboot;"
+	BOOTENV
+
+#else /* ifndef CONFIG_SPL_BUILD */
+#define CONFIG_EXTRA_ENV_SETTINGS
+#endif
 
 #define CONFIG_PREBOOT		"usb start"
 
-- 
2.3.1