Skip to contentSkip to conversation

powerpc/mpc85xx: use board env file for socrates board

PATCH In review Heiko Schocher 2 participants 3 messages Jan 27, 2023 – Feb 9, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 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

Changes in v2:
add changes requested from Tom:
remove baudrate, bootcmd, bootdelay, mtdids and mtdpart setting in env file remove CONFIG_ENV_SOURCE_FILE

 board/socrates/socrates.env | 46 +++++++++++++++++++++++++++
 configs/socrates_defconfig  |  2 +-
 include/configs/socrates.h  | 62 -------------------------------------
 3 files changed, 47 insertions(+), 63 deletions(-)
 create mode 100644 board/socrates/socrates.env
board/socrates/socrates.env new file +46 -0
new file mode 100644
index 0000000000..82e7ff8386
@@ -0,0 +1,46 @@
+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}
+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;
+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
+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 +1 -1
index e03c971b5e..312fda9ad0 100644
@@ -31,7 +31,7 @@ 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_SYS_CONSOLE_IS_IN_ENV=y
include/configs/socrates.h +0 -62

68 lines not on this page · raw message

Signature · 1 line
2.37.3
#2 lore raw
In reply to Heiko Schocher
Quoted 11 lines · Heiko Schocher

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.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom