From: Andre Przywara Date: Thu, 15 Apr 2021 23:53:17 +0000 (+0100) Subject: net: sun8i-emac: Fix pinmux setup for Allwinner H5 X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=4e26bc63a01da2ceaf64d8d84e08c8b948b78fed;p=u-boot.git net: sun8i-emac: Fix pinmux setup for Allwinner H5 Commit eb5a2b671075 ("net: sun8i-emac: Determine pinmux based on SoC, not EMAC type") switched the pinmux setup over to look at CONFIG_MACH_SUN* symbols, to find the appropriate mux value. Unfortunately this patch missed to check for the H5, which is pin-compatible to the H3, but uses a different Kconfig symbol (because it has ARMv8 vs. ARMv7 cores). Replace the pure SUN8I_H3 symbol with the joint SUNXI_H3_H5 one, which is there to cover the peripherals common to both SoCs. Also explicitly list each supported SoC, and have an error message in the fallback case, to avoid those problems in the future. This fixes Ethernet support on all H5 boards. Signed-off-by: Andre Przywara Tested-by: Samuel Holland # Orange Pi PC2 Reviewed-by: Ramon Fried --- diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index a6cdda81a7..5a1b38bf80 100644 --- a/drivers/net/sun8i_emac.c +++ b/drivers/net/sun8i_emac.c @@ -554,7 +554,7 @@ static int parse_phy_pins(struct udevice *dev) * The GPIO pinmux value is an integration choice, so depends on the * SoC, not the EMAC variant. */ - if (IS_ENABLED(CONFIG_MACH_SUN8I_H3)) + if (IS_ENABLED(CONFIG_MACH_SUNXI_H3_H5)) iomux = SUN8I_IOMUX_H3; else if (IS_ENABLED(CONFIG_MACH_SUN8I_R40)) iomux = SUN8I_IOMUX_R40; @@ -562,8 +562,12 @@ static int parse_phy_pins(struct udevice *dev) iomux = SUN8I_IOMUX_H6; else if (IS_ENABLED(CONFIG_MACH_SUN50I_H616)) iomux = SUN8I_IOMUX_H616; - else + else if (IS_ENABLED(CONFIG_MACH_SUN8I_A83T)) + iomux = SUN8I_IOMUX; + else if (IS_ENABLED(CONFIG_MACH_SUN50I)) iomux = SUN8I_IOMUX; + else + BUILD_BUG_ON_MSG(1, "missing pinmux value for Ethernet pins"); for (i = 0; ; i++) { int pin;