powerpc/mpc85xx: use board env file for socrates board
PATCH 1/1 powerpc/mpc85xx: use board env file for socrates board
as Tom suggested get rid of CFG_EXTRA_ENV_SETTINGS and enable CONFIG_ENV_SOURCE_FILE and use text file
board/socrates/socrates.env
which contains the default environment. While at it, cleanup the default Environment.
---
This patch is a follow up as requested from Tom to socrates series posted here:
https://lists.denx.de/pipermail/u-boot/2023-January/506030.html
board/socrates/socrates.env | 51 ++++++++++++++++++++++++++++++ configs/socrates_defconfig | 5 +-- include/configs/socrates.h | 62 ------------------------------------- 3 files changed, 54 insertions(+), 64 deletions(-) create mode 100644 board/socrates/socrates.env
board/socrates/socrates.env new file +51 -0
@@ -0,0 +1,51 @@ +addcons=setenv bootargs $bootargs console=$consdev,$baudrate +addip=setenv bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off panic=1 +addmtd=setenv bootargs ${bootargs} ${mtdparts} +baudrate=CONFIG_BAUDRATE +boot_nor=run ramargs addcons addmtd; + if test -n ${RescueSystemJumper} ;then + run rescueargs; + else + if imi ${system1_addr};then + bootm ${system1_addr}; + else + setenv RescueSystemJumper 1;run rescueargs; + fi; + fi; + if imi ${system2_addr}; then + bootm ${system2_addr}; + fi; +boot_usb=usb start; + ext2load usb 0 ${usb_boot_script_r} ${usb_boot_script}; + if imi ${usb_boot_script_r};then + source ${usb_boot_script_r}#conf; + fi; +bootcmd=CONFIG_BOOTCOMMAND +bootdelay=CONFIG_BOOTDELAY +clean_data=era FFA00000 FFFEFFFF +clean_uboot_env=protect off FFF00000 FFF3FFFF;era FFF00000 FFF3FFFF +consdev=ttyS0 +ethprime=eTSEC0 +initrd_high=0x03000000 +loadaddr=0x02000000 +loads_echo=1 +mtdids=CONFIG_MTDIDS_DEFAULT +mtdparts=CONFIG_MTDPARTS_DEFAULT +netdev=eth0 +nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath +preboot=echo;echo Welcome on the Socrates Board;echo +ramargs=setenv bootargs root=/dev/ram rw +rescueargs=setenv bootargs $bootargs RescueSystemJumper=$RescueSystemJumper +rootpath=/opt/poky/3.1.17 +system1_addr=FE000000 +system1_file=system1.itb +system2_addr=FED00000 +system2_file=system2.itb +uboot_addr=FFF40000 +uboot_file=u-boot.bin +update_system1=tftp 110000 ${system1_file};era ${system1_addr} FECFFFFF;cp.b 110000 ${system1_addr} ${filesize};setenv filesize +update_system2=tftp 110000 ${system2_file};era ${system2_addr} FF9FFFFF;cp.b 110000 ${system2_addr} ${filesize};setenv filesize +update_uboot=tftp 110000 ${uboot_file};protect off ${uboot_addr} FFFFFFFF;era ${uboot_addr} FFFFFFFF;cp.b 110000 ${uboot_addr} ${filesize};setenv filesize +usb_boot_script=/boot/socrates_boot.autoscr +usb_boot_script_r=100000 +verify=1
configs/socrates_defconfig +3 -2
@@ -31,9 +31,9 @@ CONFIG_BOOT_RETRY=y CONFIG_BOOT_RETRY_TIME=120 CONFIG_RESET_TO_RETRY=y CONFIG_USE_BOOTCOMMAND=y -CONFIG_BOOTCOMMAND="run boot_nor" +CONFIG_BOOTCOMMAND="run boot_usb;run boot_nor" CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="echo;echo Welcome on the ABB Socrates Board;echo" +CONFIG_PREBOOT="echo;echo Welcome on the Socrates Board;echo" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_HWCONFIG is not set
@@ -70,6 +70,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" CONFIG_MTDPARTS_DEFAULT="mtdparts=fe000000.nor_flash:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot);socrates_nand:256M(ubi-data1),-(ubi-data2)" # CONFIG_CMD_IRQ is not set CONFIG_OF_CONTROL=y +CONFIG_ENV_SOURCE_FILE="socrates" CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
include/configs/socrates.h +0 -62
68 lines not on this page · raw message
Signature · 1 line
2.37.3
Quoted 10 lines · Heiko Schocher
as Tom suggested get rid of
CFG_EXTRA_ENV_SETTINGSand enableCONFIG_ENV_SOURCE_FILEand use text fileboard/socrates/socrates.env
which contains the default environment. While at it, cleanup the default Environment.
Signed-off-by Heiko Schocher <[email protected]>Suggested-by Tom Rini <[email protected]>
[snip]
Quoted 1 line
+baudrate=CONFIG_BAUDRATE
[snip]
Quoted 2 lines
board/socrates/socrates.env new file +2
-0+bootcmd=CONFIG_BOOTCOMMAND +bootdelay=CONFIG_BOOTDELAY
[snip]
board/socrates/socrates.env line 33
Quoted 2 lines
board/socrates/socrates.env new file +2
-0+mtdids=CONFIG_MTDIDS_DEFAULT +mtdparts=CONFIG_MTDPARTS_DEFAULT
These aren't needed as they're in env_default.h
configs/socrates_defconfig CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" · line 76
Quoted 8 lines
configs/socrates_defconfig +1
-0@@ -70,6 +70,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" CONFIG_MTDPARTS_DEFAULT="mtdparts=fe000000.nor_flash:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot);socrates_nand:256M(ubi-data1),-(ubi-data2)" # CONFIG_CMD_IRQ is not set CONFIG_OF_CONTROL=y +CONFIG_ENV_SOURCE_FILE="socrates" CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
And that shouldn't be needed as it's the default name I believe.
Signature · 1 line
Tom
Hello Tom,
Quoted 14 lines · Tom Rini
Quoted 10 lines · Heiko Schocher
as Tom suggested get rid of
CFG_EXTRA_ENV_SETTINGSand enableCONFIG_ENV_SOURCE_FILEand use text fileboard/socrates/socrates.env
which contains the default environment. While at it, cleanup the default Environment.
Signed-off-by Heiko Schocher <[email protected]>Suggested-by Tom Rini <[email protected]>[snip]
Quoted 1 line
+baudrate=CONFIG_BAUDRATE
Quoted 8 lines
[snip]
Quoted 2 lines
board/socrates/socrates.env new file +2
-0+bootcmd=CONFIG_BOOTCOMMAND +bootdelay=CONFIG_BOOTDELAY[snip]
board/socrates/socrates.env line 33
Quoted 2 lines
board/socrates/socrates.env new file +2
-0+mtdids=CONFIG_MTDIDS_DEFAULT +mtdparts=CONFIG_MTDPARTS_DEFAULTThese aren't needed as they're in
env_default.h
Correct! I had tries with CONFIG_USE_DEFAULT_ENV_FILE, and whit it, the default settings in include/env_default.h are not active ... I rework the patch, thanks!
Quoted 10 lines
configs/socrates_defconfig CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" · line 76
Quoted 8 lines
configs/socrates_defconfig +1
-0@@ -70,6 +70,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" CONFIG_MTDPARTS_DEFAULT="mtdparts=fe000000.nor_flash:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot);socrates_nand:256M(ubi-data1),-(ubi-data2)" # CONFIG_CMD_IRQ is not set CONFIG_OF_CONTROL=y +CONFIG_ENV_SOURCE_FILE="socrates" CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=yAnd that shouldn't be needed as it's the default name I believe.
Yep, I drop it.
Thanks for the review.
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]
Hi Heiko,
Quoted 16 lines · Heiko Schocher
as Tom suggested get rid of
CFG_EXTRA_ENV_SETTINGSand enableCONFIG_ENV_SOURCE_FILEand use text fileboard/socrates/socrates.env
which contains the default environment. While at it, cleanup the default Environment.
Signed-off-by Heiko Schocher <[email protected]>Suggested-by Tom Rini <[email protected]>---
This patch is a follow up as requested from Tom to socrates series posted here:
Quoted 8 lines
https://lists.denx.de/pipermail/u-boot/2023-January/506030.html
board/socrates/socrates.env | 51 ++++++++++++++++++++++++++++++ configs/socrates_defconfig | 5 +-- include/configs/socrates.h | 62 ------------------------------------- 3 files changed, 54 insertions(+), 64 deletions(-) create mode 100644 board/socrates/socrates.env
nti below
[..]
Quoted 17 lines
configs/socrates_defconfig +2
-2@@ -31,9 +31,9 @@ CONFIG_BOOT_RETRY=y CONFIG_BOOT_RETRY_TIME=120 CONFIG_RESET_TO_RETRY=y CONFIG_USE_BOOTCOMMAND=y -CONFIG_BOOTCOMMAND="run boot_nor" +CONFIG_BOOTCOMMAND="run boot_usb;run boot_nor" CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="echo;echo Welcome on the ABB Socrates Board;echo" +CONFIG_PREBOOT="echo;echo Welcome on the Socrates Board;echo" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_HWCONFIG is not set
configs/socrates_defconfig CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" · line 73
Quoted 4 lines
configs/socrates_defconfig +1
-0@@ -70,6 +70,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" CONFIG_MTDPARTS_DEFAULT="mtdparts=fe000000.nor_flash:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot);socrates_nand:256M(ubi-data1),-(ubi-data2)" # CONFIG_CMD_IRQ is not set CONFIG_OF_CONTROL=y +CONFIG_ENV_SOURCE_FILE="socrates"
This should be the default anyway, so I believe you can drop this.
configs/socrates_defconfig CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" · line 76
Quoted 3 lines
configs/socrates_defconfig +0
-0CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
Regards,
Simon
Hello Simon,
Quoted 49 lines · Simon Glass
Hi Heiko,
Quoted 16 lines · Heiko Schocher
as Tom suggested get rid of
CFG_EXTRA_ENV_SETTINGSand enableCONFIG_ENV_SOURCE_FILEand use text fileboard/socrates/socrates.env
which contains the default environment. While at it, cleanup the default Environment.
Signed-off-by Heiko Schocher <[email protected]>Suggested-by Tom Rini <[email protected]>---
This patch is a follow up as requested from Tom to socrates series posted here:Quoted 8 lines
https://lists.denx.de/pipermail/u-boot/2023-January/506030.html
board/socrates/socrates.env | 51 ++++++++++++++++++++++++++++++ configs/socrates_defconfig | 5 +-- include/configs/socrates.h | 62 ------------------------------------- 3 files changed, 54 insertions(+), 64 deletions(-) create mode 100644 board/socrates/socrates.envReviewed-by Simon Glass <[email protected]>nti below
[..]
Quoted 15 lines
configs/socrates_defconfig +2
-2@@ -31,9 +31,9 @@ CONFIG_BOOT_RETRY=y CONFIG_BOOT_RETRY_TIME=120 CONFIG_RESET_TO_RETRY=y CONFIG_USE_BOOTCOMMAND=y -CONFIG_BOOTCOMMAND="run boot_nor" +CONFIG_BOOTCOMMAND="run boot_usb;run boot_nor" CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="echo;echo Welcome on the ABB Socrates Board;echo" +CONFIG_PREBOOT="echo;echo Welcome on the Socrates Board;echo" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_BOARD_EARLY_INIT_R=y
Quoted 8 lines
configs/socrates_defconfig CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" · line 73
Quoted 6 lines
configs/socrates_defconfig +1
-0# CONFIG_HWCONFIG is not set@@ -70,6 +70,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" CONFIG_MTDPARTS_DEFAULT="mtdparts=fe000000.nor_flash:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot);socrates_nand:256M(ubi-data1),-(ubi-data2)" # CONFIG_CMD_IRQ is not set CONFIG_OF_CONTROL=y +CONFIG_ENV_SOURCE_FILE="socrates"This should be the default anyway, so I believe you can drop this.
Yes, already sent a v2! See:
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Thanks for the review!
bye,
Heiko
Quoted 8 lines
configs/socrates_defconfig CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" · line 76
Quoted 4 lines
configs/socrates_defconfig +0
-0CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=yRegards,
Simon
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]