Skip to contentSkip to conversation

powerpc: mpc85xx: fixes and updates for socrates board

PATCH In review Heiko Schocher 2 participants 28 messages Jan 24, 2023 – Feb 7, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover powerpc: mpc85xx: fixes and updates for socrates board

Patchseries is based on 53c47c59e6: ("Merge tag 'dm-pull-18jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm")

It brings back socrates board working with current mainline, and adds also some small updates:

- newer U-Boot needs more space in Flash, so set new textbase. adapt default environment
- remove Flash on CS1 as not used anymore
- support MTDPARTS
- add boot retry feature
- add support for i2c eeprom
- add autbootdelay string
- enable protected environement
- enable signed fit images boot
see thread:
https://lists.denx.de/pipermail/u-boot/2023-January/504249.html

commit bcc85b96b5ff: ("cmd: source: Support specifying config name")

fixes this problem for me!

patch 0002-powerpc-mpc85xx-socrates-rework-socrates-build-proce.patch is a combination of patches from Pali
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

which is a base for patch 0003-powerpc-mpc85xx-drop-socrates-specific-image-creatio.patch which drops socrates board specific image creation and uses standard mpc85xx way by enabling MPC85XX_HAVE_RESET_VECTOR, drop CONFIG_OF_BOARD and use common u-boot.dtsi, so no specials anymore for this board.

azure build:
https://dev.azure.com/hs0298/hs/_build/results?buildId=99&view=results

Heiko Schocher (12):
powerpc/mpc85xx: fixes and updates for socrates board powerpc/mpc85xx: socrates: rework build process powerpc/mpc85xx: drop socrates specific image creation
powerpc: dts: updates socrates board powerpc/mpc85xx: socrates: add MTD partitioning support powerpc/mpc85xx: socrates: add initrd_high default environment
variable
powerpc/mpc85xx: socrates: drop second flash bank powerpc/mpc85xx: socrates: Add boot retry feature powerpc/mpc85xx: socrates: add support for i2c eeprom at 0x51 powerpc/mpc85xx: socrates: add autoboot delay string powerpc/mpc85xx: socrates: enable protected Environment powerpc/mpc85xx: socrates: enable signed fitImages

 Makefile                              | 11 +++--
 arch/powerpc/dts/socrates-u-boot.dtsi | 23 ++++++-----
 arch/powerpc/dts/socrates.dts         | 59 +++++++++++++++------------
 arch/powerpc/dts/u-boot.dtsi          |  2 +-
 board/socrates/socrates.c             | 32 +++++++--------
 configs/socrates_defconfig            | 50 +++++++++++++++--------
 include/configs/socrates.h            | 25 ++++++++----
 7 files changed, 118 insertions(+), 84 deletions(-)
Signature · 1 line
2.37.3
#1 lore raw

PATCH 1/12 powerpc/mpc85xx: fixes and updates for socrates board

current mainline does not work on socrates board. To get it back up working, there are some updates needed in socrates_defconfig.

Fixes 94633c36f9eb ("net: Make DM_ETH be selected by NETDEVICE")
Fixes 2f8a6db5d83b ("Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig")

---

 configs/socrates_defconfig | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)
configs/socrates_defconfig +11 -12
index 46be662037..ade1c79c03 100644
@@ -1,10 +1,11 @@
 CONFIG_PPC=y
 CONFIG_SYS_IMMR=0xE0000000
-CONFIG_TEXT_BASE=0xfff80000
+CONFIG_TEXT_BASE=0xfff60000
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_SECT_SIZE=0x20000
 CONFIG_DEFAULT_DEVICE_TREE="socrates"
-CONFIG_ENV_ADDR=0xFFF40000
+CONFIG_SYS_CLK_FREQ=66666666
+CONFIG_ENV_ADDR=0xFFF20000
 # CONFIG_SYS_PCI_64BIT is not set
 CONFIG_MPC85xx=y
 CONFIG_SYS_INIT_RAM_LOCK=y
@@ -12,11 +13,11 @@ CONFIG_SYS_INIT_RAM_LOCK=y
 CONFIG_TARGET_SOCRATES=y
 CONFIG_L2_CACHE=y
 CONFIG_ENABLE_36BIT_PHYS=y
-CONFIG_SYS_MONITOR_LEN=393216
+CONFIG_SYS_MONITOR_LEN=786432
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
-CONFIG_SYS_MONITOR_BASE=0xFFF80000
+CONFIG_SYS_MONITOR_BASE=0xFFF60000
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run boot_nor"
@@ -53,11 +54,12 @@ CONFIG_CMD_SNTP=y
 CONFIG_CMD_EXT2=y
 # CONFIG_CMD_IRQ is not set
 CONFIG_OF_CONTROL=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
-CONFIG_ENV_ADDR_REDUND=0xFFF20000
+CONFIG_ENV_ADDR_REDUND=0xFFF00000
 CONFIG_USE_ETHPRIME=y
-CONFIG_ETHPRIME="TSEC0"
+CONFIG_ETHPRIME="eTSEC0"
 CONFIG_SPD_EEPROM=y
 CONFIG_CHIP_SELECTS_PER_CTRL=2
 CONFIG_SYS_BR0_PRELIM_BOOL=y
@@ -84,15 +86,12 @@ CONFIG_SYS_FLASH_QUIET_TEST=y
 CONFIG_SYS_MAX_FLASH_SECT=256
 CONFIG_SYS_MAX_FLASH_BANKS=2
 CONFIG_MTD_RAW_NAND=y
-CONFIG_PHY_ATHEROS=y
-CONFIG_PHY_BROADCOM=y
-CONFIG_PHY_DAVICOM=y
 CONFIG_PHY_LXT=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_NATSEMI=y
-CONFIG_PHY_REALTEK=y
-CONFIG_PHY_SMSC=y
-CONFIG_PHY_VITESSE=y
+CONFIG_DM_MDIO=y
+CONFIG_PHY_GIGE=y
+CONFIG_RGMII=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
 CONFIG_PCI_MPC85XX=y
Signature · 1 line
2.37.3
#2 lore raw

Re: [PATCH v1 01/12] powerpc/mpc85xx: fixes and updates for socrates board

Quoted 7 lines · Heiko Schocher

current mainline does not work on socrates board. To get it back up working, there are some updates needed in socrates_defconfig.

Fixes 94633c36f9eb ("net: Make DM_ETH be selected by NETDEVICE")
Fixes 2f8a6db5d83b ("Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig")

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#3 lore raw

PATCH 2/12 powerpc/mpc85xx: socrates: rework build process

In reply to Heiko Schocher

U-Boot build process for socrates board produces final U-Boot binary in file u-boot-socrates.bin (by binman) And as a bonus it produces two unusable broken binaries u-boot-dtb.bin and u-boot.bin (by Makefile).

Clean this up, so final U-Boot binary is in u-boot-dtb.bin

---

 Makefile                              | 11 +++++++----
 arch/powerpc/dts/socrates-u-boot.dtsi |  4 ++--
 arch/powerpc/dts/u-boot.dtsi          |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)
Makefile +7 -4
index eb354c045c..3472b59920 100644
@@ -1190,19 +1190,22 @@ endif
 u-boot.bin: u-boot-fit-dtb.bin FORCE
 	$(call if_changed,copy)
 
+ifneq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR)$(CONFIG_OF_SEPARATE),yy)
 u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
 	$(call if_changed,cat)
+endif
 
 else ifeq ($(CONFIG_OF_SEPARATE).$(CONFIG_OF_OMIT_DTB),y.)
+
+ifneq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR)$(CONFIG_OF_SEPARATE),yy)
 u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
 	$(call if_changed,cat)
+endif
 
-ifneq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR)$(CONFIG_OF_SEPARATE),yy)
 u-boot.bin: u-boot-dtb.bin FORCE
 	$(call if_changed,copy)
-endif
 
-else ifneq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR)$(CONFIG_OF_SEPARATE),yy)
+else
 u-boot.bin: u-boot-nodtb.bin FORCE
 	$(call if_changed,copy)
 endif
@@ -1580,7 +1583,7 @@ u-boot-with-nand-spl.sfp: u-boot-spl-padx4.sfp u-boot.img FORCE
 endif
 
 ifeq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR)$(CONFIG_OF_SEPARATE),yy)
-u-boot.bin: u-boot-nodtb.bin u-boot.dtb u-boot-br.bin FORCE
+u-boot-dtb.bin: u-boot-nodtb.bin u-boot.dtb u-boot-br.bin FORCE
 	$(call if_changed,binman)
 
 OBJCOPYFLAGS_u-boot-br.bin := -O binary -j .bootpg -j .resetvec
arch/powerpc/dts/socrates-u-boot.dtsi +2 -2
index 14a7c245dc..f6af611b51 100644
@@ -5,11 +5,11 @@
  */
 / {
 	binman {
-		filename = "u-boot-socrates.bin";
+		filename = "u-boot-dtb.bin";
 		pad-byte = <0xff>;
 		// Place dtb one sector before u-boot-nodtb.bin
 		blob {
-			filename = "dts/dt.dtb";
+			filename = "u-boot.dtb";
 		};
 		u-boot-nodtb {
 			filename = "u-boot-nodtb.bin";
arch/powerpc/dts/u-boot.dtsi +1 -1
index 6b7375cff2..c39ab6f0ca 100644
@@ -9,7 +9,7 @@
 
 / {
 	binman {
-		filename = "u-boot.bin";
+		filename = "u-boot-dtb.bin";
 		skip-at-start = <CONFIG_TEXT_BASE>;
 		sort-by-offset;
 		pad-byte = <0xff>;
Signature · 1 line
2.37.3
#4 lore raw

Re: [PATCH v1 02/12] powerpc/mpc85xx: socrates: rework build process

Quoted 8 lines · Heiko Schocher

U-Boot build process for socrates board produces final U-Boot binary in file u-boot-socrates.bin (by binman) And as a bonus it produces two unusable broken binaries u-boot-dtb.bin and u-boot.bin (by Makefile).

Clean this up, so final U-Boot binary is in u-boot-dtb.bin

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#5 lore raw

PATCH 3/12 powerpc/mpc85xx: drop socrates specific image creation

In reply to Heiko Schocher

convert socrates board to use MPC85XX_HAVE_RESET_VECTOR and disable CONFIG_OF_BOARD and use common u-boot.dtsi for creating u-boot-dtb.bin.

---

 arch/powerpc/dts/socrates-u-boot.dtsi | 17 ++++-------------
 board/socrates/socrates.c             | 17 -----------------
 configs/socrates_defconfig            |  6 +++---
 3 files changed, 7 insertions(+), 33 deletions(-)
arch/powerpc/dts/socrates-u-boot.dtsi +4 -13
index f6af611b51..67c12f672c 100644
@@ -3,20 +3,9 @@
  * Copyright (C) 2019
  * Heiko Schocher, DENX Software Engineering, [email protected]
  */
-/ {
-	binman {
-		filename = "u-boot-dtb.bin";
-		pad-byte = <0xff>;
-		// Place dtb one sector before u-boot-nodtb.bin
-		blob {
-			filename = "u-boot.dtb";
-		};
-		u-boot-nodtb {
-			filename = "u-boot-nodtb.bin";
-			offset = <0x20000>;
-		};
-	};
+#include <config.h>
 
+/ {
 	chosen {
 		stdout-path = &serial0;
 	};
@@ -38,3 +27,5 @@
 	u-boot,dm-pre-reloc;
 	clock-frequency = <333333330>;
 };
+
+#include "u-boot.dtsi"
board/socrates/socrates.c +0 -17
index 9c4dd186fc..1d63c81a9c 100644
@@ -217,23 +217,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
 
-#if defined(CONFIG_OF_SEPARATE)
-void *board_fdt_blob_setup(int *err)
-{
-	void *fw_dtb;
-
-	*err = 0;
-	fw_dtb = (void *)(CONFIG_TEXT_BASE - CONFIG_ENV_SECT_SIZE);
-	if (fdt_magic(fw_dtb) != FDT_MAGIC) {
-		printf("DTB is not passed via %x\n", (u32)fw_dtb);
-		*err = -ENXIO;
-		return NULL;
-	}
-
-	return fw_dtb;
-}
-#endif
-
 int get_serial_clock(void)
 {
 	return 333333330;
configs/socrates_defconfig +3 -3
index ade1c79c03..03e84c3e7e 100644
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_IMMR=0xE0000000
-CONFIG_TEXT_BASE=0xfff60000
+CONFIG_TEXT_BASE=0xFFF40000
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_SECT_SIZE=0x20000
 CONFIG_DEFAULT_DEVICE_TREE="socrates"
@@ -11,13 +11,14 @@ CONFIG_MPC85xx=y
 CONFIG_SYS_INIT_RAM_LOCK=y
 # CONFIG_CMD_ERRATA is not set
 CONFIG_TARGET_SOCRATES=y
+CONFIG_MPC85XX_HAVE_RESET_VECTOR=y
 CONFIG_L2_CACHE=y
 CONFIG_ENABLE_36BIT_PHYS=y
 CONFIG_SYS_MONITOR_LEN=786432
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
-CONFIG_SYS_MONITOR_BASE=0xFFF60000
+CONFIG_SYS_MONITOR_BASE=0xFFF40000
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run boot_nor"
@@ -54,7 +55,6 @@ CONFIG_CMD_SNTP=y
 CONFIG_CMD_EXT2=y
 # CONFIG_CMD_IRQ is not set
 CONFIG_OF_CONTROL=y
-CONFIG_OF_BOARD=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_ENV_ADDR_REDUND=0xFFF00000
Signature · 1 line
2.37.3
#6 lore raw

Re: [PATCH v1 03/12] powerpc/mpc85xx: drop socrates specific image creation

Quoted 5 lines · Heiko Schocher

convert socrates board to use MPC85XX_HAVE_RESET_VECTOR and disable CONFIG_OF_BOARD and use common u-boot.dtsi for creating u-boot-dtb.bin.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#7 lore raw

PATCH 4/12 powerpc: dts: updates socrates board

In reply to Heiko Schocher

include common e500v2_power_isa.dtsi and rearrange some nodes.

---

 arch/powerpc/dts/socrates.dts | 59 +++++++++++++++++++----------------
 1 file changed, 32 insertions(+), 27 deletions(-)
arch/powerpc/dts/socrates.dts +32 -27
index 452cf58b5e..ea75eb6af3 100644
@@ -9,6 +9,8 @@
 
 /dts-v1/;
 
+/include/ "e500v2_power_isa.dtsi"
+
 / {
 	model = "abb,socrates";
 	compatible = "abb,socrates";
@@ -142,26 +144,29 @@
 			phy-handle = <&phy0>;
 			tbi-handle = <&tbi0>;
 			phy-connection-type = "rgmii-id";
+		};
 
-			mdio@520 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				compatible = "fsl,gianfar-mdio";
-				reg = <0x520 0x20>;
-
-				phy0: ethernet-phy@0 {
-					interrupt-parent = <&mpic>;
-					interrupts = <0 1>;
-					reg = <0>;
-				};
-				phy1: ethernet-phy@1 {
-					interrupt-parent = <&mpic>;
-					interrupts = <0 1>;
-					reg = <1>;
-				};
-				tbi0: tbi-phy@11 {
-					reg = <0x11>;
-				};
+		mdio@24520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-mdio";
+			reg = <0x24520 0x20>;
+
+			phy0: ethernet-phy@0 {
+				compatible = "ethernet-phy-ieee802.3-c22";
+				interrupt-parent = <&mpic>;
+				interrupts = <0 1>;
+				reg = <0>;
+			};
+
+			phy1: ethernet-phy@1 {
+				compatible = "ethernet-phy-ieee802.3-c22";
+				interrupt-parent = <&mpic>;
+				interrupts = <0 1>;
+				reg = <1>;
+			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
 			};
 		};
 
@@ -180,16 +185,16 @@
 			phy-handle = <&phy1>;
 			tbi-handle = <&tbi1>;
 			phy-connection-type = "rgmii-id";
+		};
 
-			mdio@520 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				compatible = "fsl,gianfar-tbi";
-				reg = <0x520 0x20>;
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
 
-				tbi1: tbi-phy@11 {
-					reg = <0x11>;
-				};
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
 			};
 		};
 
Signature · 1 line
2.37.3
#8 lore raw

Re: [PATCH v1 04/12] powerpc: dts: updates socrates board

Quoted 4 lines · Heiko Schocher

include common e500v2_power_isa.dtsi and rearrange some nodes.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#9 lore raw

PATCH 5/12 powerpc/mpc85xx: socrates: add MTD partitioning support

In reply to Heiko Schocher

setup MTD partitioning through mtdparts variable
and set it to:

mtdparts=fe0000000.nor:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot)

and pass this to linux per kernel commandline.

---

 configs/socrates_defconfig |  5 +++++
 include/configs/socrates.h | 17 +++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)
configs/socrates_defconfig +5 -0
index 03e84c3e7e..17c12aed7d 100644
@@ -53,6 +53,9 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_SNTP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
+CONFIG_CMD_MTDPARTS=y
+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_IS_IN_FLASH=y
@@ -78,9 +81,11 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_FSL=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_FLASH_SHOW_PROGRESS=0
+CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_SYS_FLASH_QUIET_TEST=y
 CONFIG_SYS_MAX_FLASH_SECT=256
include/configs/socrates.h +11 -6
index 2b35be83ec..67ff370e05 100644
@@ -110,6 +110,10 @@
  */
 #define CFG_SYS_BOOTMAPSZ	(8 << 20)	/* Initial Memory map for Linux	*/
 
+#define SOCRATES_ENV_MTD \
+	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
+	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+	"addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"
 
 #define	CFG_EXTRA_ENV_SETTINGS					\
 	"netdev=eth0\0"							\
@@ -118,7 +122,7 @@
 	"bootfile=/home/tftp/syscon3/uImage\0"				\
 	"fdt_file=/home/tftp/syscon3/socrates.dtb\0"			\
 	"initrd_file=/home/tftp/syscon3/uinitrd.gz\0"			\
-	"uboot_addr=FFF60000\0"						\
+	"uboot_addr=FFF40000\0"						\
 	"kernel_addr=FE000000\0"					\
 	"fdt_addr=FE1E0000\0"						\
 	"ramdisk_addr=FE200000\0"					\
@@ -134,16 +138,16 @@
 	"addip=setenv bootargs $bootargs "				\
 		"ip=$ipaddr:$serverip:$gatewayip:$netmask"		\
 		":$hostname:$netdev:off panic=1\0"			\
-	"boot_nor=run ramargs addcons;"					\
+	"boot_nor=run ramargs addcons addmtd;"				\
 		"bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"	\
 	"net_nfs=tftp ${kernel_addr_r} ${bootfile}; "			\
 		"tftp ${fdt_addr_r} ${fdt_file}; "			\
-		"run nfsargs addip addcons;"				\
+		"run nfsargs addip addcons addmtd;"			\
 		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"		\
 	"update_uboot=tftp 100000 ${uboot_file};"			\
-		"protect off fff60000 ffffffff;"			\
-		"era fff60000 ffffffff;"				\
-		"cp.b 100000 fff60000 ${filesize};"			\
+		"protect off ${uboot_addr} ffffffff;"			\
+		"era ${uboot_addr}  ffffffff;"				\
+		"cp.b 100000 ${uboot_addr}  ${filesize};"		\
 		"setenv filesize;saveenv\0"				\
 	"update_kernel=tftp 100000 ${bootfile};"			\
 		"era fe000000 fe1dffff;"				\
@@ -164,6 +168,7 @@
 	"boot_usb=run load_usb usbargs addcons;"			\
 		"bootm ${kernel_addr_r} - ${fdt_addr};"			\
 		"bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"	\
+	SOCRATES_ENV_MTD \
 	""
 
 /* pass open firmware flat tree */
Signature · 1 line
2.37.3
#10 lore raw

Re: [PATCH v1 05/12] powerpc/mpc85xx: socrates: add MTD partitioning support

Quoted 8 lines · Heiko Schocher

setup MTD partitioning through mtdparts variable
and set it to:

mtdparts=fe0000000.nor:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot)

and pass this to linux per kernel commandline.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#11 lore raw

PATCH 6/12 powerpc/mpc85xx: socrates: add initrd_high default environment variable

In reply to Heiko Schocher

we need to set initrd_high to get fitimage booting.

Without, U-Boot drops when booting fitimage:

ERROR: Failed to allocate 0x59a0b6 bytes below 0x800000. ramdisk - allocation error
bootm - boot application image from memory

---

 include/configs/socrates.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/socrates.h +1 -0
index 67ff370e05..ed1003158b 100644
@@ -118,6 +118,7 @@
 #define	CFG_EXTRA_ENV_SETTINGS					\
 	"netdev=eth0\0"							\
 	"consdev=ttyS0\0"						\
+	"initrd_high=0x03000000\0"					\
 	"uboot_file=/home/tftp/syscon3/u-boot.bin\0"			\
 	"bootfile=/home/tftp/syscon3/uImage\0"				\
 	"fdt_file=/home/tftp/syscon3/socrates.dtb\0"			\
Signature · 1 line
2.37.3
#12 lore raw

Re: [PATCH v1 06/12] powerpc/mpc85xx: socrates: add initrd_high default environment variable

Quoted 9 lines · Heiko Schocher

we need to set initrd_high to get fitimage booting.

Without, U-Boot drops when booting fitimage:

ERROR: Failed to allocate 0x59a0b6 bytes below 0x800000. ramdisk - allocation error
bootm - boot application image from memory

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#13 lore raw

PATCH 7/12 powerpc/mpc85xx: socrates: drop second flash bank

In reply to Heiko Schocher

drop second flash bank, as not used anymore.

---

 configs/socrates_defconfig | 4 ----
 include/configs/socrates.h | 5 ++---
 2 files changed, 2 insertions(+), 7 deletions(-)
configs/socrates_defconfig +0 -4
index 17c12aed7d..770f37a0be 100644
@@ -68,9 +68,6 @@ CONFIG_CHIP_SELECTS_PER_CTRL=2
 CONFIG_SYS_BR0_PRELIM_BOOL=y
 CONFIG_SYS_BR0_PRELIM=0xFE001001
 CONFIG_SYS_OR0_PRELIM=0xFE000030
-CONFIG_SYS_BR1_PRELIM_BOOL=y
-CONFIG_SYS_BR1_PRELIM=0xFC001001
-CONFIG_SYS_OR1_PRELIM=0xFE000030
 CONFIG_SYS_BR2_PRELIM_BOOL=y
 CONFIG_SYS_BR2_PRELIM=0xC80018A1
 CONFIG_SYS_OR2_PRELIM=0xFC000000
@@ -89,7 +86,6 @@ CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_SYS_FLASH_QUIET_TEST=y
 CONFIG_SYS_MAX_FLASH_SECT=256
-CONFIG_SYS_MAX_FLASH_BANKS=2
 CONFIG_MTD_RAW_NAND=y
 CONFIG_PHY_LXT=y
 CONFIG_PHY_MARVELL=y
include/configs/socrates.h +2 -3
index ed1003158b..e2afba96cd 100644
@@ -66,10 +66,9 @@
  * Flash on the LocalBus
  */
 #define CFG_SYS_FLASH0		0xFE000000
-#define CFG_SYS_FLASH1		0xFC000000
-#define CFG_SYS_FLASH_BANKS_LIST	{ CFG_SYS_FLASH1, CFG_SYS_FLASH0 }
+#define CFG_SYS_FLASH_BANKS_LIST	{ CFG_SYS_FLASH0 }
 
-#define CFG_SYS_LBC_FLASH_BASE	CFG_SYS_FLASH1	/* Localbus flash start	*/
+#define CFG_SYS_LBC_FLASH_BASE	CFG_SYS_FLASH0	/* Localbus flash start	*/
 #define CFG_SYS_FLASH_BASE		CFG_SYS_LBC_FLASH_BASE /* start of FLASH	*/
 
 #define CFG_SYS_LBC_LCRR		0x00030004    /* LB clock ratio reg	*/
Signature · 1 line
2.37.3
#14 lore raw

Re: [PATCH v1 07/12] powerpc/mpc85xx: socrates: drop second flash bank

Quoted 3 lines · Heiko Schocher

drop second flash bank, as not used anymore.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#15 lore raw

PATCH 8/12 powerpc/mpc85xx: socrates: Add boot retry feature

In reply to Heiko Schocher

add boot retry feature and reboot after 120 seconds.

---

 configs/socrates_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/socrates_defconfig +3 -0
index 770f37a0be..c4a3fd30d8 100644
@@ -20,6 +20,9 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_MONITOR_BASE=0xFFF40000
 CONFIG_BOOTDELAY=1
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=120
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run boot_nor"
 CONFIG_USE_PREBOOT=y
Signature · 1 line
2.37.3
#16 lore raw

Re: [PATCH v1 08/12] powerpc/mpc85xx: socrates: Add boot retry feature

Quoted 3 lines · Heiko Schocher

add boot retry feature and reboot after 120 seconds.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#17 lore raw

PATCH 9/12 powerpc/mpc85xx: socrates: add support for i2c eeprom at 0x51

In reply to Heiko Schocher

add support for i2c eeprom on address 0x51.

---

 arch/powerpc/dts/socrates-u-boot.dtsi | 10 ++++++++++
 configs/socrates_defconfig            |  4 ++++
 2 files changed, 14 insertions(+)
arch/powerpc/dts/socrates-u-boot.dtsi +10 -0
index 67c12f672c..88df031732 100644
@@ -6,6 +6,10 @@
 #include <config.h>
 
 / {
+	aliases {
+		eeprom0 = &i2c_eeprom0;
+	};
+
 	chosen {
 		stdout-path = &serial0;
 	};
@@ -13,6 +17,12 @@
 	soc8544@e0000000 {
 		i2c@3000 {
 			u-boot,dm-pre-reloc;
+
+			i2c_eeprom0: eeprom@51{
+				compatible = "atmel,24c64";
+				reg = <0x51>;
+				pagesize = <32>;
+			};
 		};
 	};
 };
configs/socrates_defconfig +4 -0
index c4a3fd30d8..816e59872e 100644
@@ -39,6 +39,8 @@ CONFIG_CMD_REGINFO=y
 # CONFIG_BOOTM_VXWORKS is not set
 CONFIG_SYS_BOOTM_LEN=0x800000
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_EEPROM=y
+CONFIG_SYS_EEPROM_PAGE_WRITE_BITS=4
 CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_LOADS_ECHO=y
@@ -79,6 +81,8 @@ CONFIG_SYS_BR3_PRELIM=0xC0001881
 CONFIG_SYS_OR3_PRELIM=0xFFF00000
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_FSL=y
+CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
Signature · 1 line
2.37.3
#18 lore raw

Re: [PATCH v1 09/12] powerpc/mpc85xx: socrates: add support for i2c eeprom at 0x51

Quoted 3 lines · Heiko Schocher

add support for i2c eeprom on address 0x51.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#19 lore raw

PATCH 10/12 powerpc/mpc85xx: socrates: add autoboot delay string

In reply to Heiko Schocher

add autoboot delay string for socrates board.
use sha256 for abort autoboot, use "ao" to abort.

---

 configs/socrates_defconfig | 5 +++++
 1 file changed, 5 insertions(+)
configs/socrates_defconfig +5 -0
index 816e59872e..8640dc990a 100644
@@ -20,6 +20,11 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_MONITOR_BASE=0xFFF40000
 CONFIG_BOOTDELAY=1
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_PROMPT="Enter password to abort autoboot in %d seconds!\n"
+CONFIG_AUTOBOOT_ENCRYPTION=y
+CONFIG_AUTOBOOT_STOP_STR_ENABLE=y
+CONFIG_AUTOBOOT_STOP_STR_SHA256="2dd411308b37266d33c9246821adc5aa4002f0091f5e2aece1953789930ad924"
 CONFIG_BOOT_RETRY=y
 CONFIG_BOOT_RETRY_TIME=120
 CONFIG_RESET_TO_RETRY=y
Signature · 1 line
2.37.3
#20 lore raw

Re: [PATCH v1 10/12] powerpc/mpc85xx: socrates: add autoboot delay string

Quoted 4 lines · Heiko Schocher

add autoboot delay string for socrates board.
use sha256 for abort autoboot, use "ao" to abort.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#21 lore raw

PATCH 11/12 powerpc/mpc85xx: socrates: enable protected Environment

In reply to Heiko Schocher

enable protected Environment on socrates board.

---

 board/socrates/socrates.c  | 17 +++++++++++++++++
 configs/socrates_defconfig |  4 ++++
 include/configs/socrates.h |  2 ++
 3 files changed, 23 insertions(+)
board/socrates/socrates.c +17 -0
index 1d63c81a9c..02e6afb099 100644
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <clock_legacy.h>
 #include <env.h>
+#include <env_internal.h>
 #include <init.h>
 #include <pci.h>
 #include <uuid.h>
@@ -221,3 +222,19 @@ int get_serial_clock(void)
 {
 	return 333333330;
 }
+
+enum env_location env_get_location(enum env_operation op, int prio)
+{
+	if (op == ENVOP_SAVE || op == ENVOP_ERASE)
+		return ENVL_FLASH;
+
+	switch (prio) {
+	case 0:
+		return ENVL_NOWHERE;
+	case 1:
+		return ENVL_FLASH;
+	default:
+		return ENVL_UNKNOWN;
+	}
+	return ENVL_UNKNOWN;
+}
configs/socrates_defconfig +4 -0
index 8640dc990a..d4c08f1941 100644
@@ -68,9 +68,13 @@ 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_IS_NOWHERE=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_ENV_ADDR_REDUND=0xFFF00000
+CONFIG_ENV_APPEND=y
+CONFIG_ENV_WRITEABLE_LIST=y
+CONFIG_ENV_ACCESS_IGNORE_FORCE=y
 CONFIG_USE_ETHPRIME=y
 CONFIG_ETHPRIME="eTSEC0"
 CONFIG_SPD_EEPROM=y
include/configs/socrates.h +2 -0
index e2afba96cd..305914de85 100644
@@ -171,6 +171,8 @@
 	SOCRATES_ENV_MTD \
 	""
 
+#define CFG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,eth1addr:mw,system1_addr:xw,serial#:sw,ethact:sw,ethprime:sw"
+
 /* pass open firmware flat tree */
 
 #endif	/* __CONFIG_H */
Signature · 1 line
2.37.3
#22 lore raw

Re: [PATCH v1 11/12] powerpc/mpc85xx: socrates: enable protected Environment

Quoted 3 lines · Heiko Schocher

enable protected Environment on socrates board.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#23 lore raw

PATCH 12/12 powerpc/mpc85xx: socrates: enable signed fitImages

In reply to Heiko Schocher

allow only to boot signed fitimages (and signed u-boot scripts).

---

 configs/socrates_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/socrates_defconfig +2 -0
index d4c08f1941..e03c971b5e 100644
@@ -16,7 +16,9 @@ CONFIG_L2_CACHE=y
 CONFIG_ENABLE_36BIT_PHYS=y
 CONFIG_SYS_MONITOR_LEN=786432
 CONFIG_FIT=y
+CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_MONITOR_BASE=0xFFF40000
 CONFIG_BOOTDELAY=1
Signature · 1 line
2.37.3
#24 lore raw

Re: [PATCH v1 12/12] powerpc/mpc85xx: socrates: enable signed fitImages

Quoted 4 lines · Heiko Schocher

allow only to boot signed fitimages (and signed u-boot scripts).

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#25 lore raw
In reply to Heiko Schocher
Quoted 26 lines · Heiko Schocher

Patchseries is based on 53c47c59e6: ("Merge tag 'dm-pull-18jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm")

It brings back socrates board working with current mainline, and adds also some small updates:

- newer U-Boot needs more space in Flash, so set new textbase. adapt default environment
- remove Flash on CS1 as not used anymore
- support MTDPARTS
- add boot retry feature
- add support for i2c eeprom
- add autbootdelay string
- enable protected environement
- enable signed fit images boot
see thread:
https://lists.denx.de/pipermail/u-boot/2023-January/504249.html

commit bcc85b96b5ff: ("cmd: source: Support specifying config name")

fixes this problem for me!

patch 0002-powerpc-mpc85xx-socrates-rework-socrates-build-proce.patch is a combination of patches from Pali
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 7 lines

which is a base for patch 0003-powerpc-mpc85xx-drop-socrates-specific-image-creatio.patch which drops socrates board specific image creation and uses standard mpc85xx way by enabling MPC85XX_HAVE_RESET_VECTOR, drop CONFIG_OF_BOARD and use common u-boot.dtsi, so no specials anymore for this board.

azure build:
https://dev.azure.com/hs0298/hs/_build/results?buildId=99&view=results

I'm glad you were able to get the board updated and working again. Can you please add moving this over to plain text based environments (such as the keymile family are using now, for example) as part of this?

Signature · 1 line
Tom
#26 lore raw

Hello Tom,

Quoted 33 lines · Tom Rini
Quoted 31 lines · Heiko Schocher

Patchseries is based on 53c47c59e6: ("Merge tag 'dm-pull-18jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm")

It brings back socrates board working with current mainline, and adds also some small updates:

- newer U-Boot needs more space in Flash, so set new textbase. adapt default environment
- remove Flash on CS1 as not used anymore
- support MTDPARTS
- add boot retry feature
- add support for i2c eeprom
- add autbootdelay string
- enable protected environement
- enable signed fit images boot
see thread:
https://lists.denx.de/pipermail/u-boot/2023-January/504249.html

commit bcc85b96b5ff: ("cmd: source: Support specifying config name")

fixes this problem for me!

patch 0002-powerpc-mpc85xx-socrates-rework-socrates-build-proce.patch is a combination of patches from Pali
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

which is a base for patch 0003-powerpc-mpc85xx-drop-socrates-specific-image-creatio.patch which drops socrates board specific image creation and uses standard mpc85xx way by enabling MPC85XX_HAVE_RESET_VECTOR, drop CONFIG_OF_BOARD and use common u-boot.dtsi, so no specials anymore for this board.

Quoted 4 lines
Quoted 2 lines

azure build:
https://dev.azure.com/hs0298/hs/_build/results?buildId=99&view=results

I'm glad you were able to get the board updated and working again. Can

Me too!

Quoted 2 lines

you please add moving this over to plain text based environments (such as the keymile family are using now, for example) as part of this?

I can try ... if there are comments for a v2 I integrate it into v2, if v1 is fine, I send a follow up patch (if this is okay for you?).

Thanks!

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]
#27 lore raw
Quoted 41 lines · Heiko Schocher

Hello Tom,

Quoted 33 lines · Tom Rini
Quoted 31 lines · Heiko Schocher

Patchseries is based on 53c47c59e6: ("Merge tag 'dm-pull-18jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm")

It brings back socrates board working with current mainline, and adds also some small updates:

- newer U-Boot needs more space in Flash, so set new textbase. adapt default environment
- remove Flash on CS1 as not used anymore
- support MTDPARTS
- add boot retry feature
- add support for i2c eeprom
- add autbootdelay string
- enable protected environement
- enable signed fit images boot
see thread:
https://lists.denx.de/pipermail/u-boot/2023-January/504249.html

commit bcc85b96b5ff: ("cmd: source: Support specifying config name")

fixes this problem for me!

patch 0002-powerpc-mpc85xx-socrates-rework-socrates-build-proce.patch is a combination of patches from Pali
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

which is a base for patch 0003-powerpc-mpc85xx-drop-socrates-specific-image-creatio.patch which drops socrates board specific image creation and uses standard mpc85xx way by enabling MPC85XX_HAVE_RESET_VECTOR, drop CONFIG_OF_BOARD and use common u-boot.dtsi, so no specials anymore for this board.

Quoted 4 lines
Quoted 2 lines

azure build:
https://dev.azure.com/hs0298/hs/_build/results?buildId=99&view=results

I'm glad you were able to get the board updated and working again. Can

Quoted 7 lines

Me too!

Quoted 2 lines

you please add moving this over to plain text based environments (such as the keymile family are using now, for example) as part of this?

I can try ... if there are comments for a v2 I integrate it into v2, if v1 is fine, I send a follow up patch (if this is okay for you?).

Follow-up is fine.

Signature · 1 line
Tom