Skip to contentSkip to conversation

Add support for IBM Genesis3

PATCH Superseded Patrick Rudolph 2 participants 9 messages Apr 26, 2022 – May 11, 2022

Subsystems (3)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for IBM Genesis3

v2:
- Fix whitespace and compatible in DTS
- Remove board stub
- Improve commit message
- Rewrite FIRMWARE_2ND_BOOT support
- Update defconfig

Patrick Rudolph (4):
arm/dts: Add Genesis3 board
arm/mach-aspeed: Add support for CONFIG_DRAM_UART_TO_UART1 arm/mach-aspeed: Allow to disable WDT2
configs: Add IBM Genesis3 defconfig

 arch/arm/dts/Makefile                   |  1 +
 arch/arm/dts/ibm-genesis3.dts           | 83 +++++++++++++++++++++++++
 arch/arm/mach-aspeed/ast2500/Kconfig    | 16 +++++
 arch/arm/mach-aspeed/ast2500/platform.S |  6 +-
 configs/ibm_genesis3_defconfig          | 73 ++++++++++++++++++++++
 5 files changed, 175 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/ibm-genesis3.dts
 create mode 100644 configs/ibm_genesis3_defconfig
Signature · 1 line
2.35.1
#1 lore raw

PATCH v2 1/4 arm/dts: Add Genesis3 board

Add devicetree source file. It uses the evb-ast2500 board files.

---
 arch/arm/dts/Makefile         |  1 +
 arch/arm/dts/ibm-genesis3.dts | 83 +++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)
 create mode 100644 arch/arm/dts/ibm-genesis3.dts
arch/arm/dts/Makefile +1 -0
index a79f885f54..fae23e6bc1 100755
@@ -677,6 +677,7 @@ dtb-$(CONFIG_ARCH_BCM6858) += \
 dtb-$(CONFIG_ARCH_ASPEED) += \
 	ast2400-evb.dtb \
 	ast2500-evb.dtb \
+	ibm-genesis3.dtb \
 	ast2600a0-evb.dtb \
 	ast2600a1-evb.dtb \
 	ast2600-bletchley.dtb \
arch/arm/dts/ibm-genesis3.dts new file +83 -0

83 lines not on this page · raw message

Signature · 1 line
2.35.1
maintainer
#2 lore raw

Re: [PATCH u-boot v2019.04-aspeed-openbmc v2 1/4] arm/dts: Add Genesis3 board

Quoted 15 lines · Patrick Rudolph

Add devicetree source file. It uses the evb-ast2500 board files.

---
 arch/arm/dts/Makefile         |  1 +
 arch/arm/dts/ibm-genesis3.dts | 83 +++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)
 create mode 100644 arch/arm/dts/ibm-genesis3.dts
arch/arm/dts/Makefile +0 -0
index a79f885f54..fae23e6bc1 100755

arch/arm/dts/Makefile dtb-$(CONFIG_ARCH_BCM6858) += \ · line 680

Quoted 4 lines
arch/arm/dts/Makefile +1 -0
@@ -677,6 +677,7 @@ dtb-$(CONFIG_ARCH_BCM6858) += \
 dtb-$(CONFIG_ARCH_ASPEED) += \
        ast2400-evb.dtb \
        ast2500-evb.dtb \
+       ibm-genesis3.dtb \

The rest of the boards are named ast2x00-<machinename>.

Your dts would be ast2500-genesis3.dtb

Going back to the v1, I see that both Zev and I made the same comment. If you have a reason to not do this, please say so.

arch/arm/dts/ibm-genesis3.dts line 1

Quoted 10 lines
arch/arm/dts/Makefile +0 -0
        ast2600a0-evb.dtb \
        ast2600a1-evb.dtb \
        ast2600-bletchley.dtb \
arch/arm/dts/ibm-genesis3.dts new file +1 -0
new file mode 100644
index 0000000000..c808fd27c4
@@ -0,0 +1,83 @@
+/dts-v1/;

Add a copyright statement.

Quoted 71 lines
arch/arm/dts/ibm-genesis3.dts new file +71 -0
+
+#include "ast2500-u-boot.dtsi"
+
+/ {
+       model = "IBM Genesis3";
+       compatible = "ibm,genesis3-bmc", "aspeed,ast2500";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x20000000>;
+       };
+
+       chosen {
+               stdout-path = &uart5;
+       };
+
+       aliases {
+               spi0 = &fmc;
+               ethernet0 = &mac0;
+               ethernet1 = &mac1;
+       };
+};
+
+&uart5 {
+       u-boot,dm-pre-reloc;
+       status = "okay";
+};
+
+&sdrammc {
+       clock-frequency = <400000000>;
+};
+
+&wdt1 {
+       u-boot,dm-pre-reloc;
+       status = "okay";
+};
+
+&wdt2 {
+       u-boot,dm-pre-reloc;
+       status = "okay";
+};
+
+&wdt3 {
+       u-boot,dm-pre-reloc;
+       status = "okay";
+};
+
+&mac0 {
+       status = "okay";
+       phy-mode = "rgmii";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_mac1link_default &pinctrl_mdio1_default>;
+};
+
+&mac1 {
+       status = "okay";
+       phy-mode = "rgmii";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_mac2link_default &pinctrl_mdio2_default>;
+};
+
+&fmc {
+       status = "okay";
+       timing-calibration-disabled;
+       flash@0 {
+               compatible = "spi-flash", "spansion,s25fl256l";
+               status = "okay";
+               spi-max-frequency = <50000000>;
+               spi-tx-bus-width = <2>;
+               spi-rx-bus-width = <2>;

arch/arm/dts/ibm-genesis3.dts line 82

Quoted 10 lines
arch/arm/dts/ibm-genesis3.dts new file +10 -0
+       };
+
+       flash@1 {
+               compatible = "spi-flash", "spansion,s25fl256l";
+               status = "okay";
+               spi-max-frequency = <50000000>;
+               spi-tx-bus-width = <2>;
+               spi-rx-bus-width = <2>;
+       };
+};

This is an exact copy of the ast2500-evb up until this point.

Consider following Zev's example for the board he's adding, by including the dts and overriding/disabling things as required.

Quoted 4 lines
arch/arm/dts/ibm-genesis3.dts new file +1 -1
+
--

2.35.1

#3 lore raw

PATCH v2 2/4 arm/mach-aspeed: Add support for CONFIG_DRAM_UART_TO_UART1

In reply to Patrick Rudolph

Update the Kconfig and allow a board to use CONFIG_DRAM_UART_TO_UART1. The platform code already uses this Kconfig symbol, but it always evaluated to false.
This is required on IBM/Genesis3 as it uses RDX1/TDX1 as debug uart.

---
 arch/arm/mach-aspeed/ast2500/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-aspeed/ast2500/Kconfig +6 -0
index 4f992f442d..e7ff00cdba 100644
@@ -17,6 +17,12 @@ config TARGET_EVB_AST2500
 	  20 pin JTAG, pinouts for 14 I2Cs, 3 SPIs and eSPI, 8 PWMs.
 endchoice
 
+config DRAM_UART_TO_UART1
+	bool
+	prompt "Route debug UART to UART1"
+	help
+	  Route debug UART to TXD1/RXD1 pins.
+
 source "board/aspeed/evb_ast2500/Kconfig"
 
 endif
Signature · 1 line
2.35.1
maintainer Reviewed-by on v2 2/4
#4 lore raw

Re: [PATCH u-boot v2019.04-aspeed-openbmc v2 2/4] arm/mach-aspeed: Add support for CONFIG_DRAM_UART_TO_UART1

Quoted 7 lines · Patrick Rudolph

Update the Kconfig and allow a board to use CONFIG_DRAM_UART_TO_UART1. The platform code already uses this Kconfig symbol, but it always evaluated to false.
This is required on IBM/Genesis3 as it uses RDX1/TDX1 as debug uart.

Quoted 24 lines
---
 arch/arm/mach-aspeed/ast2500/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-aspeed/ast2500/Kconfig +6 -1
index 4f992f442d..e7ff00cdba 100644
@@ -17,6 +17,12 @@ config TARGET_EVB_AST2500
          20 pin JTAG, pinouts for 14 I2Cs, 3 SPIs and eSPI, 8 PWMs.
 endchoice
 
+config DRAM_UART_TO_UART1
+       bool
+       prompt "Route debug UART to UART1"
+       help
+         Route debug UART to TXD1/RXD1 pins.
+
 source "board/aspeed/evb_ast2500/Kconfig"
 
 endif
--

2.35.1

#5 lore raw

PATCH v2 3/4 arm/mach-aspeed: Allow to disable WDT2

In reply to Patrick Rudolph

The IBM Genesis3 supports booting from second flash using WDT2, but there's no working code to poke the WDT2 and it takes too long for the kernel to load to poke the watchdog.

As it's an evaluation platform disable this feature for now. Unselecting this Kconfig disables the WDT2 in early platform code and prevents 2nd firmware from being launched during normal boot.

---
 arch/arm/mach-aspeed/ast2500/Kconfig    | 10 ++++++++++
 arch/arm/mach-aspeed/ast2500/platform.S |  6 ++----
 2 files changed, 12 insertions(+), 4 deletions(-)
arch/arm/mach-aspeed/ast2500/Kconfig +10 -0
index e7ff00cdba..1882d6186e 100644
@@ -23,6 +23,16 @@ config DRAM_UART_TO_UART1
 	help
 	  Route debug UART to TXD1/RXD1 pins.
 
+config FIRMWARE_2ND_BOOT
+	bool
+	default y
+	prompt "Keep WDT2 running to support the firmware 2nd boot"
+	help
+	  Saying yes here let the WDT2 running (if configured by
+	  hw straps) and allows the platform to boot from 2nd
+	  SPI flash if WDT2 isn't poked withing 22 seconds.
+	  Saying no disables the WDT2 in early platform initialisation.
+
 source "board/aspeed/evb_ast2500/Kconfig"
 
 endif
arch/arm/mach-aspeed/ast2500/platform.S +2 -4
index aef55c4a0a..a3961bc4f8 100644
@@ -95,7 +95,7 @@
  *    CONFIG_DDR3_8GSTACK         // DDR3 8Gbit Stack die
  *    CONFIG_DDR4_4GX8            // DDR4 4Gbit X8 dual part
  * 5. Firmware 2nd boot flash
- *    CONFIG_FIRMWARE_2ND_BOOT (Removed)
+ *    CONFIG_FIRMWARE_2ND_BOOT
  * 6. Enable DRAM extended temperature range mode
  *    CONFIG_DRAM_EXT_TEMP
  * 7. Select WDT_Full mode for power up initial reset
@@ -642,13 +642,11 @@ bypass_USB_init:
 /******************************************************************************
  Disable WDT2 for 2nd boot function
  ******************************************************************************/
-/*
-#ifndef CONFIG_FIRMWARE_2ND_BOOT
+#if !defined(CONFIG_FIRMWARE_2ND_BOOT)
     ldr   r0, =0x1e78502c
     mov   r1, #0
     str   r1, [r0]
 #endif
-*/
 /******************************************************************************
  Disable WDT3 for SPI Address mode (3 or 4 bytes) detection function
  ******************************************************************************/
Signature · 1 line
2.35.1
maintainer
#6 lore raw

Re: [PATCH u-boot v2019.04-aspeed-openbmc v2 3/4] arm/mach-aspeed: Allow to disable WDT2

Quoted 8 lines · Patrick Rudolph

The IBM Genesis3 supports booting from second flash using WDT2, but there's no working code to poke the WDT2 and it takes too long for the kernel to load to poke the watchdog.

As it's an evaluation platform disable this feature for now. Unselecting this Kconfig disables the WDT2 in early platform code and prevents 2nd firmware from being launched during normal boot.

There's a lot of negatives here. We're disabling code that disables the watchdog that is enabled/disabled by the strapping.

Your patch is un-commenting the code that disables the watchdog.

It's then adding a Kconfig symbol to enable this code, but the Kconfig is inverted: it defaults to true and disables the code.

I think we could make it simpler: make the Kconfig like a normal kconfig that defaults to n. This is what you did in v1. Re-reading that email both Zev and I asked for an explanation to justify why there was the double negative. I think explaining what is going on as we suggested is a better outcome than your v2.

As I said in that mail, the u-boot tree would be better off adding code to pat the watchdog. This would solve your problem, and the problem that others have had.

Quoted 59 lines
---
 arch/arm/mach-aspeed/ast2500/Kconfig    | 10 ++++++++++
 arch/arm/mach-aspeed/ast2500/platform.S |  6 ++----
 2 files changed, 12 insertions(+), 4 deletions(-)
arch/arm/mach-aspeed/ast2500/Kconfig +10 -0
index e7ff00cdba..1882d6186e 100644
@@ -23,6 +23,16 @@ config DRAM_UART_TO_UART1
        help
          Route debug UART to TXD1/RXD1 pins.
 
+config FIRMWARE_2ND_BOOT
+       bool
+       default y
+       prompt "Keep WDT2 running to support the firmware 2nd boot"
+       help
+         Saying yes here let the WDT2 running (if configured by
+         hw straps) and allows the platform to boot from 2nd
+         SPI flash if WDT2 isn't poked withing 22 seconds.
+         Saying no disables the WDT2 in early platform initialisation.
+
 source "board/aspeed/evb_ast2500/Kconfig"
 
 endif
arch/arm/mach-aspeed/ast2500/platform.S +2 -5
index aef55c4a0a..a3961bc4f8 100644
@@ -95,7 +95,7 @@
  *    CONFIG_DDR3_8GSTACK         // DDR3 8Gbit Stack die
  *    CONFIG_DDR4_4GX8            // DDR4 4Gbit X8 dual part
  * 5. Firmware 2nd boot flash
- *    CONFIG_FIRMWARE_2ND_BOOT (Removed)
+ *    CONFIG_FIRMWARE_2ND_BOOT
  * 6. Enable DRAM extended temperature range mode
  *    CONFIG_DRAM_EXT_TEMP
  * 7. Select WDT_Full mode for power up initial reset
@@ -642,13 +642,11 @@ bypass_USB_init:
 /******************************************************************************
  Disable WDT2 for 2nd boot function
  ******************************************************************************/
-/*
-#ifndef CONFIG_FIRMWARE_2ND_BOOT
+#if !defined(CONFIG_FIRMWARE_2ND_BOOT)
     ldr   r0, =0x1e78502c
     mov   r1, #0
     str   r1, [r0]
 #endif
-*/
 /******************************************************************************
  Disable WDT3 for SPI Address mode (3 or 4 bytes) detection function
  ******************************************************************************/
--

2.35.1

#7 lore raw

PATCH v2 4/4 configs: Add IBM Genesis3 defconfig

In reply to Patrick Rudolph
---
 configs/ibm_genesis3_defconfig | 73 ++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 configs/ibm_genesis3_defconfig
configs/ibm_genesis3_defconfig new file +73 -0
new file mode 100644
index 0000000000..76a3673991
@@ -0,0 +1,73 @@
+CONFIG_SPI_BOOT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LOG=y
+CONFIG_BOOTCOMMAND="bootm 20080000"
+CONFIG_BOOTARGS="console=ttyS4,115200n8 root=/dev/ram rw earlycon"
+# CONFIG_SYS_I2C_ASPEED is not set
+CONFIG_ASPEED_AHBC=y
+CONFIG_ARM=y
+CONFIG_ARCH_ASPEED=y
+CONFIG_SYS_TEXT_BASE=0x0
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x60000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_FIT=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_PRE_CONSOLE_BUFFER=y
+CONFIG_PRE_CON_BUF_ADDR=0x1e720000
+CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
+CONFIG_HUSH_PARSER=y
+# CONFIG_AUTO_COMPLETE is not set
+CONFIG_SYS_PROMPT="ast# "
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_XIMG is not set
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_CMD_CLK=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_DEFAULT_DEVICE_TREE="ibm-genesis3"
+CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_USE_ENV_SPI_BUS=y
+CONFIG_ENV_SPI_BUS=0
+CONFIG_USE_ENV_SPI_CS=y
+CONFIG_ENV_SPI_CS=0
+CONFIG_USE_ENV_SPI_MAX_HZ=y
+CONFIG_ENV_SPI_MAX_HZ=50000000
+CONFIG_SF_DEFAULT_SPEED=50000000
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_REGMAP=y
+CONFIG_CLK=y
+CONFIG_DM_GPIO=y
+CONFIG_ASPEED_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_MISC=y
+CONFIG_DM_MMC=y
+# CONFIG_MMC is not set
+# CONFIG_CMD_MMC is not set
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_SDHCI_ASPEED is not set
+# CONFIG_MMC_HW_PARTITIONING is not set
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_DM_ETH=y
+CONFIG_FTGMAC100=y
+# CONFIG_PHY is not set
+CONFIG_PINCTRL=y
+CONFIG_DM_SERIAL=y
+CONFIG_SYS_NS16550=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_TIMER=y
+CONFIG_WDT=y
+# CONFIG_EFI_LOADER is not set
+CONFIG_DRAM_UART_TO_UART1=y
+# CONFIG_FIRMWARE_2ND_BOOT is not set
Signature · 1 line
2.35.1
maintainer
#8 lore raw

Re: [PATCH u-boot v2019.04-aspeed-openbmc v2 4/4] configs: Add IBM Genesis3 defconfig

Quoted 1 line · Patrick Rudolph

This would be where you put some words to justify the configuration you have added for the board, instead of using an existing one.

Quoted 88 lines
---
 configs/ibm_genesis3_defconfig | 73 ++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 configs/ibm_genesis3_defconfig
configs/ibm_genesis3_defconfig new file +73 -1
new file mode 100644
index 0000000000..76a3673991
@@ -0,0 +1,73 @@
+CONFIG_SPI_BOOT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LOG=y
+CONFIG_BOOTCOMMAND="bootm 20080000"
+CONFIG_BOOTARGS="console=ttyS4,115200n8 root=/dev/ram rw earlycon"
+# CONFIG_SYS_I2C_ASPEED is not set
+CONFIG_ASPEED_AHBC=y
+CONFIG_ARM=y
+CONFIG_ARCH_ASPEED=y
+CONFIG_SYS_TEXT_BASE=0x0
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x60000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_FIT=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_PRE_CONSOLE_BUFFER=y
+CONFIG_PRE_CON_BUF_ADDR=0x1e720000
+CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
+CONFIG_HUSH_PARSER=y
+# CONFIG_AUTO_COMPLETE is not set
+CONFIG_SYS_PROMPT="ast# "
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_XIMG is not set
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_CMD_CLK=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_DEFAULT_DEVICE_TREE="ibm-genesis3"
+CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_USE_ENV_SPI_BUS=y
+CONFIG_ENV_SPI_BUS=0
+CONFIG_USE_ENV_SPI_CS=y
+CONFIG_ENV_SPI_CS=0
+CONFIG_USE_ENV_SPI_MAX_HZ=y
+CONFIG_ENV_SPI_MAX_HZ=50000000
+CONFIG_SF_DEFAULT_SPEED=50000000
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_REGMAP=y
+CONFIG_CLK=y
+CONFIG_DM_GPIO=y
+CONFIG_ASPEED_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_MISC=y
+CONFIG_DM_MMC=y
+# CONFIG_MMC is not set
+# CONFIG_CMD_MMC is not set
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_SDHCI_ASPEED is not set
+# CONFIG_MMC_HW_PARTITIONING is not set
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_DM_ETH=y
+CONFIG_FTGMAC100=y
+# CONFIG_PHY is not set
+CONFIG_PINCTRL=y
+CONFIG_DM_SERIAL=y
+CONFIG_SYS_NS16550=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_TIMER=y
+CONFIG_WDT=y
+# CONFIG_EFI_LOADER is not set
+CONFIG_DRAM_UART_TO_UART1=y
+# CONFIG_FIRMWARE_2ND_BOOT is not set
--

2.35.1