Skip to contentSkip to conversation

Switch odroid to use distro_bootcmd.

PATCH Superseded Vagrant Cascadian 2 participants 6 messages Mar 31, 2017 – Apr 3, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Switch odroid to use distro_bootcmd.

Using distro_bootcmd standardizes board behavior across many platforms. This is particularly useful for distributions supporting multiple boards without requiring custom configuration for each board.

There are a few changes needed to support distro_bootcmd, such as fixing the default value for the console setting, increasing the environment size, and allowing distro bootcmd to set the default bootdelay.

These patches have been used in Debian's u-boot packaging since May of 2016.

Vagrant Cascadian (4):
Fix default console on odroid to only specify the device, as
"console=" is redundant with the boot environment.
Increase the default environment size on odroid, as
config_distro_bootcmd requires a more space for the environment.
Switch odroid to use config_distro_bootcmd.
Inherit default value for bootdelay from distro_bootcmd on odroid.

 include/configs/odroid.h | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/4 Fix default console on odroid to only specify the device, as "console=" is redundant with the boot environment.

---

 include/configs/odroid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/odroid.h +1 -1
index 6cc7dd16a2..0fbda7dd76 100644
@@ -45,7 +45,7 @@
 
 #define CONFIG_BOOTARGS			"Please use defined boot"
 #define CONFIG_BOOTCOMMAND		"run autoboot"
-#define CONFIG_DEFAULT_CONSOLE		"console=ttySAC1,115200n8\0"
+#define CONFIG_DEFAULT_CONSOLE		"ttySAC1,115200n8\0"
 
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR \
 					- GENERATED_GBL_DATA_SIZE)
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/4 Increase the default environment size on odroid, as config_distro_bootcmd requires a more space for the environment.

In reply to Vagrant Cascadian

---

 include/configs/odroid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/odroid.h +1 -1
index 0fbda7dd76..abae044b66 100644
@@ -54,7 +54,7 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV		CONFIG_MMC_DEFAULT_DEV
-#define CONFIG_ENV_SIZE			4096
+#define CONFIG_ENV_SIZE			8192
 #define CONFIG_ENV_OFFSET		(SZ_1K * 1280) /* 1.25 MiB offset */
 #define CONFIG_ENV_OVERWRITE
 
Signature · 1 line
2.11.0
#3 lore raw

PATCH 3/4 Switch odroid to use config_distro_bootcmd.

In reply to Vagrant Cascadian

Using distro_bootcmd standardizes board behavior across many platforms. This is particularly useful for distributions supporting multiple boards without requiring custom configuration for each board.

---

 include/configs/odroid.h | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
include/configs/odroid.h +17 -3
index abae044b66..fa9edd0cbc 100644
@@ -43,8 +43,6 @@
 
 /* Console configuration */
 
-#define CONFIG_BOOTARGS			"Please use defined boot"
-#define CONFIG_BOOTCOMMAND		"run autoboot"
 #define CONFIG_DEFAULT_CONSOLE		"ttySAC1,115200n8\0"
 
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR \
@@ -87,6 +85,20 @@
 	"bl2 raw 0x1f 0x1d;" \
 	"tzsw raw 0x83f 0x138\0"
 
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 1) \
+	func(MMC, mmc, 0)
+
+#include <config_distro_bootcmd.h>
+
+#define MEM_LAYOUT_ENV_SETTINGS \
+	"bootm_size=0x10000000\0" \
+	"kernel_addr_r=0x42000000\0" \
+	"fdt_addr_r=0x43000000\0" \
+	"ramdisk_addr_r=0x43300000\0" \
+	"scriptaddr=0x50000000\0" \
+	"pxefile_addr_r=0x51000000\0"
+
 /*
  * Bootable media layout:
  * dev:    SD   eMMC(part boot)
@@ -173,7 +185,9 @@
 	"initrdname=uInitrd\0" \
 	"initrdaddr=42000000\0" \
 	"scriptaddr=0x42000000\0" \
-	"fdtaddr=40800000\0"
+	"fdtaddr=40800000\0" \
+	MEM_LAYOUT_ENV_SETTINGS \
+	BOOTENV
 
 /* I2C */
 #define CONFIG_SYS_I2C_S3C24X0
Signature · 1 line
2.11.0
#4 lore raw

PATCH 4/4 Inherit default value for bootdelay from distro_bootcmd on odroid.

In reply to Vagrant Cascadian

The default value with distro_bootcmd is 2 seconds, which is reasonably fast, and provides a consistent experience across platforms supporting distro_bootcmd.

The current bootdelay value of 0 seconds is a bit challenging to interrupt when desired.

---

 include/configs/odroid.h | 1 -
 1 file changed, 1 deletion(-)
include/configs/odroid.h +0 -1
index fa9edd0cbc..8317f62548 100644
@@ -177,7 +177,6 @@
 	"mmcbootpart=1\0" \
 	"mmcrootdev=0\0" \
 	"mmcrootpart=2\0" \
-	"bootdelay=0\0" \
 	"dfu_alt_system="CONFIG_DFU_ALT \
 	"dfu_alt_info=Please reset the board\0" \
 	"consoleon=set console console=ttySAC1,115200n8; save; reset\0" \
Signature · 1 line
2.11.0
#5 lore raw

cover Switch odroid to use distro_bootcmd.

In reply to Vagrant Cascadian

Hi Vagrant,

Quoted 5 lines

Using distro_bootcmd standardizes board behavior across many platforms. This is particularly useful for distributions supporting multiple boards without requiring custom configuration for each board.

Quoted 7 lines

There are a few changes needed to support distro_bootcmd, such as fixing the default value for the console setting, increasing the environment size, and allowing distro bootcmd to set the default bootdelay.

These patches have been used in Debian's u-boot packaging since May of 2016.

Quoted 10 lines

Vagrant Cascadian (4):
Fix default console on odroid to only specify the device, as
"console=" is redundant with the boot environment.
Increase the default environment size on odroid, as
config_distro_bootcmd requires a more space for the environment.
Switch odroid to use config_distro_bootcmd.
Inherit default value for bootdelay from distro_bootcmd on odroid.

Quoted 3 lines
 include/configs/odroid.h | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de