diff mbox series

[1/4] configs: pcm051: Support distro bootcmds

Message ID 20180602172228.10664-1-matwey.kornilov@gmail.com
State Accepted
Commit e7168819f44c2857322c8c89e82ba383eedbe1cd
Headers show
Series [1/4] configs: pcm051: Support distro bootcmds | expand

Commit Message

Matwey V. Kornilov June 2, 2018, 5:22 p.m. UTC
Add support for distro bootcmds.

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
---
 include/configs/pcm051.h | 49 ++++++++++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 20 deletions(-)

Comments

Tom Rini June 13, 2018, 3:42 p.m. UTC | #1
On Sat, Jun 02, 2018 at 08:22:25PM +0300, Matwey V. Kornilov wrote:

> Add support for distro bootcmds.

> 

> Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>


Applied to u-boot/master, thanks!

-- 
Tom
diff mbox series

Patch

diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h
index a59e88171f..c1a5c6fe32 100644
--- a/include/configs/pcm051.h
+++ b/include/configs/pcm051.h
@@ -25,6 +25,34 @@ 
 #define CONFIG_MACH_TYPE		MACH_TYPE_PCM051
 
 /* set to negative value for no autoboot */
+#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
+	"bootcmd_" #devtypel #instance "=" \
+	"setenv mmcdev " #instance"; "\
+	"setenv bootpart " #instance":2 ; "\
+	"run mmcboot\0"
+
+#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
+	#devtypel #instance " "
+
+#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
+	"bootcmd_" #devtypel "=" \
+	"run nandboot\0"
+
+#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
+	#devtypel #instance " "
+
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(LEGACY_MMC, legacy_mmc, 0) \
+	func(MMC, mmc, 1) \
+	func(LEGACY_MMC, legacy_mmc, 1) \
+	func(NAND, nand, 0)
+
+#define CONFIG_BOOTCOMMAND \
+	"run distro_bootcmd"
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x80007fc0\0" \
 	"fdtaddr=0x80000000\0" \
@@ -62,26 +90,7 @@ 
 	"ramboot=echo Booting from ramdisk ...; " \
 		"run ramargs; " \
 		"bootm ${loadaddr}\0" \
-
-#define CONFIG_BOOTCOMMAND \
-	"mmc dev ${mmcdev}; if mmc rescan; then " \
-		"echo SD/MMC found on device ${mmcdev};" \
-		"if run loadbootscript; then " \
-			"run bootscript;" \
-		"else " \
-			"if run loadbootenv; then " \
-				"echo Loaded environment from ${bootenv};" \
-				"run importbootenv;" \
-			"fi;" \
-			"if test -n $uenvcmd; then " \
-				"echo Running uenvcmd ...;" \
-				"run uenvcmd;" \
-			"fi;" \
-			"if run loaduimage; then " \
-				"run mmcboot;" \
-			"fi;" \
-		"fi ;" \
-	"fi;" \
+	BOOTENV
 
 /* Clock Defines */
 #define V_OSCK				25000000  /* Clock output from T2 */