Skip to contentSkip to conversation

Fix default value of mac clk delays and add DTS for Asus Kommando

PATCH In review Anirudh Srinivasan 5 participants 11 messages May 26 – Jun 2

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

v3 cover Fix default value of mac clk delays and add DTS for Asus Kommando

This series adds a DT for Asus Kommando, a pcie ipmi card based on AST2600. Previous versions of this series didn't have networking support because networking wasn't working in rgmii-id mode properly. Following the discussion in v2, v3 of this series aims to fix the underlying issue in the clk driver in u-boot that adds in mac clk delays even when none are requested.

First patch in the series updates the clk driver to use a default value of 0 for the ethernet mac clk delays. This patch also updates 3 existing DTs that use an rgmii based mode, but do not specify a value for the clk delays in their DT. These DTs are updated to use the old default value that we changed to 0. Second patch in the series adds a DT for Asus Kommando.

To: [email protected]
To: [email protected]
Cc: [email protected]
Cc: Ender Hsieh <[email protected]>
Cc: Marc Olberding <[email protected]>
Cc: Chia-Wei Wang <[email protected]>

---
Changes in v3:
- Add additional patch to set default clk-delays in aspeed clk driver to
0 + patch existing DTs that rely on the existing default
- Re-add ethernet node to DT
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Drop ethernet node from DT
- Add info to commit message on why this was dropped (references to
linux kernel discussion about aspeed MAC driver fixes) and how to re-enable it
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Anirudh Srinivasan (2):
clk: ast2600: set default clk-delay for all ethernet macs to 0
ARM: dts: aspeed: Add dts for ASUS Kommando IPMI card

 arch/arm/dts/Makefile                            |  1 +
 arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts | 92 ++++++++++++++++++++++++
 arch/arm/dts/ast2600-fpga.dts                    |  6 ++
 arch/arm/dts/ast2600-msx4-bmc-nvidia.dts         |  6 ++
 arch/arm/dts/ast2600-slt.dts                     | 15 ++++
 drivers/clk/aspeed/clk_ast2600.c                 | 45 +++++-------
 6 files changed, 138 insertions(+), 27 deletions(-)

---
base-commit: 17ae8f018476af91f9c80da8e9ec9ef218e0b6de
change-id: 20260228-asus-kommando-9de4d6b779a8

Best regards,

Signature · 1 line
Anirudh Srinivasan <[email protected]>
#1 lore raw

PATCH v3 1/2 clk: ast2600: set default clk-delay for all ethernet macs to 0

u-boot currently setups non zero values for the ethernet mac clk delays. This is not always needed (depending on the board design), and prevents us from using rgmii-id as the phy mode in u-boot and linux. u-boot already has the funationality to read and use values for the clk delays from the DT, so based on the discussion here [1], update the default values for these clk delays to be zero instead.

Also update the DTs for 3 existing boards to add scu nodes with the existing default value for the clk delay. ast2600-fpga and msx4-bmc use mac0 for networking, so that particular clk-delay value was added. ast2600-slt uses all 4 macs, so all 4 clk-delay values were added.

Newly added boards that require no clk delays can use rgmii-id mode directly, and boards that actually require a clk delay can set it via the scu DT node.

[1] https://lore.kernel.org/openbmc/a7d364d72bbfa4ed3d41e9f7282f8e87a783cf48.camel@codeconstruct.com.au/

---
The fpga and slt DTs don't seem to have the DT nodes sorted in any order, so I added the scu nodes at the end of those files.

Setting a non-zero clk delay for the msx4 BMC device with rgmii-id as the phy mode feels wrong. But that's the current state of the tree (DT + default value of clk delay), so I've kept it as is.

Ender, Marc, would it be possible for someone from nvidia to test this on the mx4 platform?

Should we test this on the aspeed fpga and slt platforms too? Would someone from aspeed be able to do this?

---
 arch/arm/dts/ast2600-fpga.dts            |  6 +++++
 arch/arm/dts/ast2600-msx4-bmc-nvidia.dts |  6 +++++
 arch/arm/dts/ast2600-slt.dts             | 15 +++++++++++
 drivers/clk/aspeed/clk_ast2600.c         | 45 +++++++++++++-------------------
 4 files changed, 45 insertions(+), 27 deletions(-)
arch/arm/dts/ast2600-fpga.dts +6 -0
index 68ff64169ccd3f4c595aa043844db91a2bb3b18e..4c34bef32dca184a203e3e5c209da0a4b31af499 100644
@@ -110,3 +110,9 @@
         status = "okay";
 
 };
+
+&scu {
+	mac0-clk-delay = <0x10 0x0a
+			0x10 0x10
+			0x10 0x10>;
+};
arch/arm/dts/ast2600-msx4-bmc-nvidia.dts +6 -0
index 9df5e74c98f4b6ccc74f93dd96fd4d6bb1b787ad..addd13fb05b1b7656f3e933a19a5dde0bb11eb0f 100644
@@ -82,6 +82,12 @@
 	};
 };
 
+&scu {
+	mac0-clk-delay = <0x10 0x0a
+			0x10 0x10
+			0x10 0x10>;
+};
+
 &sdrammc {
 	clock-frequency = <400000000>;
 	aspeed,ecc-enabled;
arch/arm/dts/ast2600-slt.dts +15 -0
index 332620dc1aece1f5ab7d4c130bc8fe31e324d56e..9e86dc271eaa42a86f4c6c4ee805bd975c9e2a11 100644
@@ -280,3 +280,18 @@
 &ehci1 {
 	status = "okay";
 };
+
+&scu {
+	mac0-clk-delay = <0x10 0x0a
+			0x10 0x10
+			0x10 0x10>;
+	mac1-clk-delay = <0x10 0x0a
+			0x10 0x10
+			0x10 0x10>;
+	mac2-clk-delay = <0x08 0x04
+			0x08 0x04
+			0x08 0x04>;
+	mac3-clk-delay = <0x08 0x04
+			0x08 0x04
+			0x08 0x04>;
+};
drivers/clk/aspeed/clk_ast2600.c +18 -27

57 lines not on this page · raw message

Signature · 1 line
2.52.0
maintainer
#2 lore raw

Re: [PATCH u-boot v3 1/2] clk: ast2600: set default clk-delay for all ethernet macs to 0

Quoted 23 lines · Anirudh Srinivasan

u-boot currently setups non zero values for the ethernet mac clk delays. This is not always needed (depending on the board design), and prevents us from using rgmii-id as the phy mode in u-boot and linux. u-boot already has the funationality to read and use values for the clk delays from the DT, so based on the discussion here [1], update the default values for these clk delays to be zero instead.

Also update the DTs for 3 existing boards to add scu nodes with the existing default value for the clk delay. ast2600-fpga and msx4-bmc use mac0 for networking, so that particular clk-delay value was added. ast2600-slt uses all 4 macs, so all 4 clk-delay values were added.

Newly added boards that require no clk delays can use rgmii-id mode directly, and boards that actually require a clk delay can set it via the scu DT node.

[1] https://lore.kernel.org/openbmc/a7d364d72bbfa4ed3d41e9f7282f8e87a783cf48.camel@codeconstruct.com.au/

---
The fpga and slt DTs don't seem to have the DT nodes sorted in any order, so I added the scu nodes at the end of those files.

Quoted 6 lines

Setting a non-zero clk delay for the msx4 BMC device with rgmii-id as the phy mode feels wrong. But that's the current state of the tree (DT + default value of clk delay), so I've kept it as is.

Ender, Marc, would it be possible for someone from nvidia to test this on the mx4 platform?

Ender, Marc: Have you had an opportunity to test this?

Quoted 3 lines

Should we test this on the aspeed fpga and slt platforms too? Would someone from aspeed be able to do this?

Aspeed people: same query here.

Andrew

#3 lore raw

PATCH v3 1/2 clk: ast2600: set default clk-delay for all ethernet macs to 0

Hi Sirs,

Quoted 6 lines
Quoted 3 lines

Should we test this on the aspeed fpga and slt platforms too? Would someone from aspeed be able to do this?

Aspeed people: same query here.

It seems no problem on ast2600-fpga.dts and ast2600-slt.dts with this patch.

Thanks,
Jacky

Tested-by on v3 1/2
#4 lore raw

Re: [FILL IN v3 EXACT SUBJECT — e.g. "[PATCH v3 0/N] ARM: dts: aspeed: …"]

Quoted 1 line

Ender, Marc: Have you had an opportunity to test this?

Yes — flashed an image with v3 applied onto our msx4 board (AST2600 + Realtek RTL8211F PHY). It seems no problem on the msx4 platform with this patch.

Thanks,
Ender

#5 lore raw

PATCH v3 2/2 ARM: dts: aspeed: Add dts for ASUS Kommando IPMI card

In reply to Anirudh Srinivasan

Add dts for Asus Kommando IPMI card, an ast2600 based pcie bmc card. This DT has networking working in rgmii-id mode.

---
 arch/arm/dts/Makefile                            |  1 +
 arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts | 92 ++++++++++++++++++++++++
 2 files changed, 93 insertions(+)
arch/arm/dts/Makefile +1 -0
index 5141c3dc3aa025e2f5c9b2bb98216ee5c72cdf70..fa6837be747da4fbe102ac27e60ee3d81e230cb7 100755
@@ -682,6 +682,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
 	ast2500-genesis3.dtb \
 	ast2500-romulus.dtb \
 	ast2600-ampere.dtb \
+	ast2600-asus-kommando-ipmi-card.dtb \
 	ast2600-bletchley.dtb \
 	ast2600-dcscm.dtb \
 	ast2600-evb-ecc.dtb \
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +92 -0

92 lines not on this page · raw message

Signature · 1 line
2.52.0
#6 lore raw

Re: [PATCH u-boot v3 2/2] ARM: dts: aspeed: Add dts for ASUS Kommando IPMI card

Quoted 62 lines · Anirudh Srinivasan

Add dts for Asus Kommando IPMI card, an ast2600 based pcie bmc card. This DT has networking working in rgmii-id mode.

---
  arch/arm/dts/Makefile                            |  1 +
  arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts | 92 ++++++++++++++++++++++++
  2 files changed, 93 insertions(+)
arch/arm/dts/Makefile +1 -0
index 5141c3dc3aa025e2f5c9b2bb98216ee5c72cdf70..fa6837be747da4fbe102ac27e60ee3d81e230cb7 100755
@@ -682,6 +682,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
  	ast2500-genesis3.dtb \
  	ast2500-romulus.dtb \
  	ast2600-ampere.dtb \
+	ast2600-asus-kommando-ipmi-card.dtb \
  	ast2600-bletchley.dtb \
  	ast2600-dcscm.dtb \
  	ast2600-evb-ecc.dtb \
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +35 -0
new file mode 100644
index 0000000000000000000000000000000000000000..bad3b011bae63c058fecd4790e3243bb0df4b770
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0+
+/dts-v1/;
+
+#include "ast2600-u-boot.dtsi"
+
+/ {
+	model = "ASUS Kommando IPMI Card";
+	compatible = "asus,kommando-ipmi-card", "aspeed,ast2600";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x40000000>;
+	};
+
+	chosen {
+		stdout-path = &uart5;
+	};
+
+	aliases {
+		spi0 = &fmc;
+		eth0 = &mac2;
+	};
+
+	cpus {
+		cpu@0 {
+			clock-frequency = <800000000>;
+		};
+		cpu@1 {
+			clock-frequency = <800000000>;
+		};
+	};
+};
+
+&fmc {
+	status = "okay";

arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts line 45

Quoted 10 lines
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +10 -0
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_fmcquad_default>;
+
+	flash@0 {
+		status = "okay";
+		spi-max-frequency = <50000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+	};

Out of curiosity: which revision of the Kommando IPMI card do you have?
Asking because I have two R1.04s and both fail after a power cycle, but only if the SPI was probed by U-Boot before.

I'm still debugging the issue on my side, but based on what I saw with my logic analyser it appears that the FMC is in a wrong addressing mode. When it reads U-Boot, it's misaligned by 1-byte. Blipping the /RESET line makes the card work again.

Tan

Quoted 48 lines
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +47 -0
+};
+
+&hace {
+	status = "okay";
+	u-boot,dm-pre-reloc;
+};
+
+&mac2 {
+	status = "okay";
+	phy-mode = "rgmii-id";
+	phy-handle = <&ethphy2>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_rgmii3_default>;
+};
+
+&mdio {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_mdio3_default>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	ethphy2: ethernet-phy@2 {
+		reg = <0>;
+	};
+};
+
+&sdrammc {
+	clock-frequency = <400000000>;
+};
+
+&uart5 {
+	status = "okay";
+	u-boot,dm-pre-reloc;
+};
+
+&wdt1 {
+	status = "okay";
+};
+
+&wdt2 {
+	status = "okay";
+};
+
+&wdt3 {
+	status = "okay";
+};
#7 lore raw

Re: [PATCH u-boot v3 2/2] ARM: dts: aspeed: Add dts for ASUS Kommando IPMI card

Hi Tan,

Quoted 10 lines · Tan Siewert
Quoted 10 lines
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +9 -0
+
+&fmc {
+     status = "okay";
+
+     pinctrl-names = "default";
+     pinctrl-0 = <&pinctrl_fmcquad_default>;
+
+     flash@0 {
+             status = "okay";
Quoted 8 lines

arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts line 45

Quoted 4 lines
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +4 -0
+             spi-max-frequency = <50000000>;
+             spi-tx-bus-width = <4>;
+             spi-rx-bus-width = <4>;
+     };

Out of curiosity: which revision of the Kommando IPMI card do you have? Asking because I have two R1.04s and both fail after a power cycle, but only if the SPI was probed by U-Boot before.

My card also says R1.04 on it. My flash chip is a Winbound 25Q512JVFQ.

Are you observing this after a graceful reboot from inside an OS, or when you unplug/replug the USB power cable? If you're doing the latter, I've observed that the card doesn't come back up properly when the UART ground is connected, even with the stock fw. I need to unplug power, unplug the UART ground cable and then replug both back in. I see some garbage output on the UART at boot if I don't do this.

Quoted 9 lines

I'm still debugging the issue on my side, but based on what I saw with my logic analyser it appears that the FMC is in a wrong addressing mode. When it reads U-Boot, it's misaligned by 1-byte.
Blipping the /RESET line makes the card work again.

Tan

Quoted 1 line

+};

Signature · 2 lines
Regards
Anirudh Srinivasan
#8 lore raw

Re: [PATCH u-boot v3 2/2] ARM: dts: aspeed: Add dts for ASUS Kommando IPMI card

Quoted 22 lines · Anirudh Srinivasan

Hi Tan,

Quoted 10 lines · Tan Siewert
Quoted 10 lines
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +9 -0
+
+&fmc {
+     status = "okay";
+
+     pinctrl-names = "default";
+     pinctrl-0 = <&pinctrl_fmcquad_default>;
+
+     flash@0 {
+             status = "okay";
Quoted 8 lines

arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts line 45

Quoted 4 lines
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +4 -0
+             spi-max-frequency = <50000000>;
+             spi-tx-bus-width = <4>;
+             spi-rx-bus-width = <4>;
+     };

Out of curiosity: which revision of the Kommando IPMI card do you have? Asking because I have two R1.04s and both fail after a power cycle, but only if the SPI was probed by U-Boot before.

Quoted 8 lines

My card also says R1.04 on it. My flash chip is a Winbound 25Q512JVFQ.

Are you observing this after a graceful reboot from inside an OS, or when you unplug/replug the USB power cable? If you're doing the latter, I've observed that the card doesn't come back up properly when the UART ground is connected, even with the stock fw. I need to unplug power, unplug the UART ground cable and then replug both back in. I see some garbage output on the UART at boot if I don't do this.

I only observe this on re-plugging the USB power cable. Disconnecting UART and all other peripherals that have any ground pins makes the issue happen less times, but I am still able to trigger it if the power is falling at a bad timing (e.g. on init before systemd is starting.)

The R1.01 cards for example don't seem to have this issue at all, as I was told by a colleague.

Tan

#9 lore raw

Re: [PATCH u-boot v3 2/2] ARM: dts: aspeed: Add dts for ASUS Kommando IPMI card

Quoted 33 lines · Tan Siewert
Quoted 22 lines · Anirudh Srinivasan

Hi Tan,

Quoted 10 lines · Tan Siewert
Quoted 10 lines
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +9 -0
+
+&fmc {
+     status = "okay";
+
+     pinctrl-names = "default";
+     pinctrl-0 = <&pinctrl_fmcquad_default>;
+
+     flash@0 {
+             status = "okay";
Quoted 8 lines

arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts line 45

Quoted 4 lines
arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts new file +4 -0
+             spi-max-frequency = <50000000>;
+             spi-tx-bus-width = <4>;
+             spi-rx-bus-width = <4>;
+     };

Out of curiosity: which revision of the Kommando IPMI card do you have? Asking because I have two R1.04s and both fail after a power cycle, but only if the SPI was probed by U-Boot before.

Quoted 8 lines

My card also says R1.04 on it. My flash chip is a Winbound 25Q512JVFQ.

Are you observing this after a graceful reboot from inside an OS, or when you unplug/replug the USB power cable? If you're doing the latter, I've observed that the card doesn't come back up properly when the UART ground is connected, even with the stock fw. I need to unplug power, unplug the UART ground cable and then replug both back in. I see some garbage output on the UART at boot if I don't do this.

Quoted 4 lines

I only observe this on re-plugging the USB power cable. Disconnecting UART and all other peripherals that have any ground pins makes the issue happen less times, but I am still able to trigger it if the power is falling at a bad timing (e.g. on init before systemd is starting.)

Given that this happens with the stock fw too, this seems to be a quirk of the board design. It's likely missing a bleed resistor somewhere. It doesn't affect the day to day functionality of the card, only developmental flows where one is constantly reflashing/hard rebooting the card.

Quoted 4 lines

The R1.01 cards for example don't seem to have this issue at all, as I was told by a colleague.

Tan

Signature · 2 lines
Regards
Anirudh Srinivasan
maintainer
#10 lore raw
In reply to Anirudh Srinivasan
Quoted 14 lines · Anirudh Srinivasan

This series adds a DT for Asus Kommando, a pcie ipmi card based on AST2600. Previous versions of this series didn't have networking support because networking wasn't working in rgmii-id mode properly. Following the discussion in v2, v3 of this series aims to fix the underlying issue in the clk driver in u-boot that adds in mac clk delays even when none are requested.

First patch in the series updates the clk driver to use a default value of 0 for the ethernet mac clk delays. This patch also updates 3 existing DTs that use an rgmii based mode, but do not specify a value for the clk delays in their DT. These DTs are updated to use the old default value that we changed to 0. Second patch in the series adds a DT for Asus Kommando.

Quoted 8 lines

To: [email protected]
To: [email protected]
Cc: [email protected]
Cc: Ender Hsieh <[email protected]>
Cc: Marc Olberding <[email protected]>
Cc: Chia-Wei Wang <[email protected]>

Applied to openbmc/u-boot.

Thanks for the fixes!

Andrew