Skip to contentSkip to conversation

board: atmel: sama7g5ek: avoid rewriting of configured CONFIG_BOOTCOMMAND

PATCH In review Eugen Hristev 1 participant 2 messages Aug 19, 2021 – Sep 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: atmel: sama7g5ek: avoid rewriting of configured CONFIG_BOOTCOMMAND

Rewrite the CONFIG_BOOTCOMMAND only if it's not previously configured from defconfig file.
This allows the user to select from defconfig/menuconfig the desired boot command.
Adjust the current board defconfigs to reflect the default booting command for the specific ENV configuration.

---
 configs/sama7g5ek_mmc1_defconfig | 2 ++
 configs/sama7g5ek_mmc_defconfig  | 2 ++
 include/configs/sama7g5ek.h      | 6 +++++-
 3 files changed, 9 insertions(+), 1 deletion(-)
configs/sama7g5ek_mmc1_defconfig +2 -0
index e076e07e11..a78adf0dd8 100644
@@ -18,6 +18,8 @@ CONFIG_FIT=y
 CONFIG_SD_BOOT=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/mmcblk1p2 rw rootwait"
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="fatload mmc 1:1 0x61000000 at91-sama7g5ek.dtb; fatload mmc 1:1 0x62000000 zImage; bootz 0x62000000 - 0x61000000"
 CONFIG_MISC_INIT_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
configs/sama7g5ek_mmc_defconfig +2 -0
index 96549c23f8..de845178e6 100644
@@ -18,6 +18,8 @@ CONFIG_FIT=y
 CONFIG_SD_BOOT=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait"
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="fatload mmc 0:1 0x61000000 at91-sama7g5ek.dtb; fatload mmc 0:1 0x62000000 zImage; bootz 0x62000000 - 0x61000000"
 CONFIG_MISC_INIT_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
include/configs/sama7g5ek.h +5 -1
index 96db82e9d4..07e14ff507 100644
@@ -26,7 +26,7 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x62000000 /* load address */
 
-#undef CONFIG_BOOTCOMMAND
+#ifndef CONFIG_BOOTCOMMAND
 #ifdef CONFIG_SD_BOOT
 /* u-boot env in sd/mmc card */
 
@@ -34,6 +34,10 @@
 #define CONFIG_BOOTCOMMAND	"fatload mmc " CONFIG_ENV_FAT_DEVICE_AND_PART " 0x61000000 at91-sama7g5ek.dtb; " \
 				"fatload mmc " CONFIG_ENV_FAT_DEVICE_AND_PART " 0x62000000 zImage; " \
 				"bootz 0x62000000 - 0x61000000"
+#else
+#define CONFIG_BOOTCOMMAND	"Place your bootcommand here"
+#endif
+
 #endif
 
 /* Size of malloc() pool */
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · Eugen Hristev

Rewrite the CONFIG_BOOTCOMMAND only if it's not previously configured from defconfig file.
This allows the user to select from defconfig/menuconfig the desired boot command.
Adjust the current board defconfigs to reflect the default booting command for the specific ENV configuration.

---

Applied to u-boot-atmel/next