Skip to contentSkip to conversation

ARM: dts: aspeed: Add dts for ASUS Kommando IPMI card

PATCH Superseded Anirudh Srinivasan 3 participants 6 messages Mar 28 – May 26 Arm (32-bit)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: dts: aspeed: Add dts for ASUS Kommando IPMI card

Add dts for Asus Kommando IPMI card, an ast2600 based pcie bmc card.

This version of the DTS doesn't support networking due to u-boot inserting mac delays (when it isn't really needed) and needing to misconfigure the phy-mode in linux due to it. See discussion here [1] for more details.

Networking can be enabled in this manner currently.

aliases {
        eth0 = &mac2;
};
&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>;
       };
};
&scu {
       mac2-clk-delay = <0 0
                         0 0
                         0 0>;
};

Once u-boot is updated to not insert these clk delays, the scu node from above can be dropped and networking should work in rgmii-id mode as expected

[1] https://lore.kernel.org/linux-aspeed/[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]

---
 arch/arm/dts/Makefile                            |  1 +
 arch/arm/dts/ast2600-asus-kommando-ipmi-card.dts | 71 ++++++++++++++++++++++++
 2 files changed, 72 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 +71 -0

71 lines not on this page · raw message

---
base-commit: d40130c7056b84dc5213f3ff6764d0e45bb84035
change-id: 20260228-asus-kommando-9de4d6b779a8

Best regards,

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

Hi Anirudh,

Sorry for the delay :(

Quoted 32 lines · Anirudh Srinivasan

Add dts for Asus Kommando IPMI card, an ast2600 based pcie bmc card.

This version of the DTS doesn't support networking due to u-boot inserting mac delays (when it isn't really needed) and needing to misconfigure the phy-mode in linux due to it. See discussion here [1] for more details.

Networking can be enabled in this manner currently.

aliases {
        eth0 = &mac2;
};

&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>;
       };
};

Quoted 5 lines

&scu {
       mac2-clk-delay = <0 0
                         0 0
                         0 0>;
};

So something I didn't appreciate in our previous discussion was that this was a property on the SCU node (I should have looked then). Checking the implementation, it seems to me like this is the same as not specifying the property. That corroborates Ender's efforts here:

https://lore.kernel.org/all/[email protected]/

I think we just drop the property and add in the mac nodes, and remove this note from the commit message?

Possibly some confusion comes from the EVB DTS specifying the property, and everyone just copied it, then wondered why it was all broken.

Andrew

#2 lore raw

Hi Andrew,

Quoted 49 lines · Andrew Jeffery

Hi Anirudh,

Sorry for the delay :(

Quoted 32 lines · Anirudh Srinivasan

Add dts for Asus Kommando IPMI card, an ast2600 based pcie bmc card.

This version of the DTS doesn't support networking due to u-boot inserting mac delays (when it isn't really needed) and needing to misconfigure the phy-mode in linux due to it. See discussion here [1] for more details.

Networking can be enabled in this manner currently.

aliases {
        eth0 = &mac2;
};
&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>;
       };
};
Quoted 5 lines
&scu {
       mac2-clk-delay = <0 0
                         0 0
                         0 0>;
};

So something I didn't appreciate in our previous discussion was that this was a property on the SCU node (I should have looked then). Checking the implementation, it seems to me like this is the same as not specifying the property. That corroborates Ender's efforts here:

Quoted 7 lines

https://lore.kernel.org/all/[email protected]/

I think we just drop the property and add in the mac nodes, and remove this note from the commit message?

Possibly some confusion comes from the EVB DTS specifying the property, and everyone just copied it, then wondered why it was all broken.

I think that the u-boot implementation [1] uses a default value for the clk delay if it doesn't find a clk-delay node in the DT. My testing also seemed to suggest this, i.e if I dropped the clk-delay node node, networking wasn't working. We need a zero clk delay, and the default isn't zero.

Am I correct? I can try testing again when I get some time later on in the week.

I looked through Ender's efforts and it seems surprising that it works for their board. Maybe the board design is different in some manner there?

Quoted 2 lines

Andrew

[1] https://github.com/openbmc/u-boot/blob/17ae8f018476af91f9c80da8e9ec9ef218e0b6de/drivers/clk/aspeed/clk_ast2600.c#L980

Signature · 2 lines
Regards
Anirudh Srinivasan
#3 lore raw
Quoted 61 lines · Anirudh Srinivasan

Hi Andrew,

Quoted 49 lines · Andrew Jeffery

Hi Anirudh,

Sorry for the delay :(

Quoted 32 lines · Anirudh Srinivasan

Add dts for Asus Kommando IPMI card, an ast2600 based pcie bmc card.

This version of the DTS doesn't support networking due to u-boot inserting mac delays (when it isn't really needed) and needing to misconfigure the phy-mode in linux due to it. See discussion here [1] for more details.

Networking can be enabled in this manner currently.

aliases {
        eth0 = &mac2;
};

&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>;
       };
};

Quoted 5 lines

&scu {
       mac2-clk-delay = <0 0
                         0 0
                         0 0>;
};

So something I didn't appreciate in our previous discussion was that this was a property on the SCU node (I should have looked then). Checking the implementation, it seems to me like this is the same as not specifying the property. That corroborates Ender's efforts here:

Quoted 7 lines

https://lore.kernel.org/all/[email protected]/

I think we just drop the property and add in the mac nodes, and remove this note from the commit message?

Possibly some confusion comes from the EVB DTS specifying the property, and everyone just copied it, then wondered why it was all broken.

Quoted 7 lines

I think that the u-boot implementation [1] uses a default value for the clk delay if it doesn't find a clk-delay node in the DT. My testing also seemed to suggest this, i.e if I dropped the clk-delay node node, networking wasn't working. We need a zero clk delay, and the default isn't zero.

Am I correct? I can try testing again when I get some time later on in the week.

Heh, so I did look, but must've glazed over the defaults set at the top there. I checked the default register value in the datasheet which claims it is zero, but clearly that was not enough.

So I think what I was hoping to avoid was adding to the devicetrees properties that are not defined in bindings, but that ship has sailed for the u-boot fork. I'll drop that line of thought for now.

Looking at the upstream kernel devicetrees, only aspeed-ast2600-evb.dts specifies phy-mode = "rgmii-rxid"; (thanks to Andrew Lunn's review efforts). All MAC nodes set phy-mode where they don't otherwise specify use-ncsi (which is RMII and not RGMII, and so we can ignore them for the purpose of this problem).

Inspecting the output of the following in openbmc/u-boot openbmc/v2019.04-aspeed-openbmc:

git grep -A 10 -e '^[&]mac.' -e 'mac.-clk-delay' arch/arm/dts/ast2600*

the boards below enable MACs for RGMII but do not set the mac.-clk- delay properties in the SCU node:

- ast2600-fpga.dts
- ast2600-msx4-bmc-nvidia.dts
- ast2600-slt.dts

As such, they rely on the default values you pointed out in the driver.

Perhaps we could add the mac.-clk-delay properties with the default values currently used by the driver to the SCU devicetree node for those boards. From there, we can rework clk_ast2600 so that the default value is no delay from the SCU, and we rely on the devicetrees to specify what delay, if any, is required, where necessary.

From there, no new u-boot ast2600 devicetrees should require the mac.- clk-delay properties, and on the MAC nodes we can set phy-mode = "rgmii-id"; as appropriate.

I've added Marc to the thread for the MSX4 side of things.

Quoted 4 lines

I looked through Ender's efforts and it seems surprising that it works for their board. Maybe the board design is different in some manner there?

Yes, that is surprising. I've added Ender to this thread.

Andrew

#4 lore raw

Hi Andrew,

Quoted 6 lines · Andrew Jeffery

Perhaps we could add the mac.-clk-delay properties with the default values currently used by the driver to the SCU devicetree node for those boards. From there, we can rework clk_ast2600 so that the default value is no delay from the SCU, and we rely on the devicetrees to specify what delay, if any, is required, where necessary.

I've sent a v3 that tries to do this. Let's see if this solution works for everyone.

Quoted 5 lines

From there, no new u-boot ast2600 devicetrees should require the mac.- clk-delay properties, and on the MAC nodes we can set phy-mode = "rgmii-id"; as appropriate.

Quoted 8 lines

I've added Marc to the thread for the MSX4 side of things.

Quoted 4 lines

I looked through Ender's efforts and it seems surprising that it works for their board. Maybe the board design is different in some manner there?

Yes, that is surprising. I've added Ender to this thread.

Hopefully we can test this on the nvidia board too.

Quoted 2 lines

Andrew

Signature · 2 lines
Regards
Anirudh Srinivasan
#5 lore raw
Quoted 2 lines

I think that the u-boot implementation [1] uses a default value for the clk delay if it doesn't find a clk-delay node in the DT.

You're correct — I verified this earlier in QEMU testing: when I dropped the &scu mac0-clk-delay block in my MSX4 patch, U-Boot still writes hardcoded defaults to the SCU register.

Quoted 3 lines

I looked through Ender's efforts and it seems surprising that it works for their board. Maybe the board design is different in some manner there?

Yes — likely a PCB layout / PHY tolerance coincidence rather than by design. The hardcoded defaults combined with PHY internal delay happen to land within 1Gbps tolerance on the MSX4 board.

Happy to test your v3 on alon8, to verify the explicit defaults restore the same behaviour.

Thanks,
Ender