]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
board: ti: am335x: Conditional MDIO PAD configuration instead of static for AM335_ICE
authorParvathi Pudi <parvathi@couthit.com>
Thu, 7 May 2026 06:23:49 +0000 (11:53 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 14 May 2026 21:41:07 +0000 (15:41 -0600)
This patch removes the static MDIO pinmux configuration from
rmii1_pin_mux[] and instead configures the MDIO pins conditionally
during board_init(). Previously, the MDIO_CLK and MDIO_DATA pins
were always configured for CPSW in mux.c, which could lead to
unnecessary pin ownership and conflicts in scenarios where CPSW
is not used.

With this change, the MDIO pins are configured only when required,
ensuring that CPSW Ethernet functionality in U-Boot remains unaffected.
This approach keeps Ethernet boot behavior intact and provides cleaner
separation between CPSW and other Ethernet use cases.

Reviewed-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com>
Signed-off-by: Parvathi Pudi <parvathi@couthit.com>
board/ti/am335x/board.c
board/ti/am335x/mux.c

index b5f69a45a7cb94dd7f0f38ab2b83874888667fe9..4a2d7655d2a9394232d6b59bb898ea31308a6dd4 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mem.h>
+#include <asm/arch/mux.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/emif.h>
@@ -72,6 +73,12 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 #define GPIO0_IRQSTATUSRAW     (AM33XX_GPIO0_BASE + 0x024)
 #define GPIO1_IRQSTATUSRAW     (AM33XX_GPIO1_BASE + 0x024)
 
+static __maybe_unused struct module_pin_mux rmii1_mdio_pin_mux[] = {
+       {OFFSET(mdio_clk), MODE(0) | PULLUP_EN},        /* MDIO_CLK */
+       {OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN}, /* MDIO_DATA */
+       {-1},
+};
+
 /*
  * Read header information from EEPROM into global structure.
  */
@@ -779,6 +786,9 @@ int board_init(void)
                        hang();
                }
 
+               if (!eth0_is_mii)
+                       configure_module_pin_mux(rmii1_mdio_pin_mux);
+
                prueth_is_mii = eth0_is_mii;
 
                /* disable rising edge IRQs */
index d2d87c304f66ce446fdcfa531572ad6f0b39ef3c..36d849d21198d8a6b7a4069d07a76af540ed323e 100644 (file)
@@ -190,8 +190,6 @@ static struct module_pin_mux mii1_pin_mux[] = {
 };
 
 static struct module_pin_mux rmii1_pin_mux[] = {
-       {OFFSET(mdio_clk), MODE(0) | PULLUP_EN},        /* MDIO_CLK */
-       {OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN}, /* MDIO_DATA */
        {OFFSET(mii1_crs), MODE(1) | RXACTIVE},         /* MII1_CRS */
        {OFFSET(mii1_rxerr), MODE(1) | RXACTIVE},       /* MII1_RXERR */
        {OFFSET(mii1_txen), MODE(1)},                   /* MII1_TXEN */