board: ti: am335x: Conditional MDIO PAD configuration instead of static for AM335_ICE
PATCH v2 1/1 board: ti: am335x: Conditional MDIO PAD configuration instead of static for AM335_ICE
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.
---
Changes from v1 to v2 :
*) Adressed Markus Schneider-Pargmann's comments on this patch.
board/ti/am335x/board.c | 11 +++++++++++ board/ti/am335x/mux.c | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-)
board/ti/am335x/board.c +11 -0
@@ -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 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,10 @@ int board_init(void)hang (); } +/* Set the Mux Mode to MDIO_DATA, MDIO_CLK */ +if (!eth0_is_mii) +configure_module_pin_mux (rmii1_mdio_pin_mux); + prueth_is_mii = eth0_is_mii;/* disable rising edge IRQs */
board/ti/am335x/mux.c +0 -2
@@ -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 */
Signature · 1 line
2.43.0
Quoted 7 lines · Parvathi Pudi
This patch removes the static MDIO pinmux configuration from rmii1_pin_mux[] and instead configures the MDIO pins conditionally during
board_init(). Previously, theMDIO_CLKandMDIO_DATApins were always configured for CPSW inmux.c, which could lead to unnecessary pin ownership and conflicts in scenarios where CPSW is not used.
Quoted 6 lines
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.
Signed-off-by Parvathi Pudi <[email protected]>
Looks good to me, one nitpick inline:
Quoted 34 lines
---
Changes from v1 to v2 :
*) Adressed Markus Schneider-Pargmann's comments on this patch.board/ti/am335x/board.c | 11 +++++++++++ board/ti/am335x/mux.c | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-)board/ti/am335x/board.c +7
-0@@ -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 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. */
board/ti/am335x/board.c int board_init(void) · line 789
Quoted 4 lines
board/ti/am335x/board.c +1
-0@@ -779,6 +786,10 @@ int board_init(void)hang (); } +/* Set the Mux Mode to MDIO_DATA, MDIO_CLK */
I think it is ovious by the names. Can you please remove the comment?
Best
Markus
Quoted 19 lines
board/ti/am335x/board.c +3
-0+if (!eth0_is_mii) +configure_module_pin_mux (rmii1_mdio_pin_mux); + prueth_is_mii = eth0_is_mii;/* disable rising edge IRQs */ board/ti/am335x/mux.c +0
-2@@ -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 */
Markus Schneider-Pargmann
Reviewed-byQuoted 8 lines · Markus Schneider-Pargmann
Quoted 7 lines · Parvathi Pudi
This patch removes the static MDIO pinmux configuration from rmii1_pin_mux[] and instead configures the MDIO pins conditionally during
board_init(). Previously, theMDIO_CLKandMDIO_DATApins were always configured for CPSW inmux.c, which could lead to unnecessary pin ownership and conflicts in scenarios where CPSW is not used.
Quoted 8 lines
Quoted 6 lines
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.
Signed-off-by Parvathi Pudi <[email protected]>Reviewed-by Markus Schneider-Pargmann <[email protected]>
Oops, that was supposed to be
Quoted 66 lines
Looks good to me, one nitpick inline:
Quoted 34 lines
---
Changes from v1 to v2 :
*) Adressed Markus Schneider-Pargmann's comments on this patch.board/ti/am335x/board.c | 11 +++++++++++ board/ti/am335x/mux.c | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-)board/ti/am335x/board.c +7
-0@@ -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 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. */ board/ti/am335x/board.c int board_init(void) · line 789
Quoted 4 lines
board/ti/am335x/board.c +1
-0@@ -779,6 +786,10 @@ int board_init(void)hang (); } +/* Set the Mux Mode to MDIO_DATA, MDIO_CLK */ I think it is ovious by the names. Can you please remove the comment?
Best
MarkusQuoted 19 lines
board/ti/am335x/board.c +3
-0+if (!eth0_is_mii) +configure_module_pin_mux (rmii1_mdio_pin_mux); + prueth_is_mii = eth0_is_mii;/* disable rising edge IRQs */ board/ti/am335x/mux.c +0
-2@@ -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 */
Hi Markus,
Quoted 8 lines · Parvathi Pudi
Quoted 7 lines
This patch removes the static MDIO pinmux configuration from rmii1_pin_mux[] and instead configures the MDIO pins conditionally during
board_init(). Previously, theMDIO_CLKandMDIO_DATApins were always configured for CPSW inmux.c, which could lead to unnecessary pin ownership and conflicts in scenarios where CPSW is not used.
Quoted 9 lines
Quoted 6 lines
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.
Signed-off-by Parvathi Pudi <[email protected]>Reviewed-by Markus Schneider-Pargmann <[email protected]>
Thanks for the review.
Quoted 40 lines
Looks good to me, one nitpick inline:
Quoted 38 lines
---
Changes from v1 to v2 :
*) Adressed Markus Schneider-Pargmann's comments on this patch.board/ti/am335x/board.c | 11 +++++++++++ board/ti/am335x/mux.c | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-)board/ti/am335x/board.c +7
-0@@ -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 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. */
board/ti/am335x/board.c +0
-0@@ -779,6 +786,10 @@ int board_init(void)hang (); }
Quoted 4 lines
board/ti/am335x/board.c int board_init(void) · line 789
Quoted 1 line
board/ti/am335x/board.c +1
-0+/* Set the Mux Mode to MDIO_DATA, MDIO_CLK */ I think it is ovious by the names. Can you please remove the comment?
Sure, we will address this and post the next version shortly.
Thanks and Regards,
Parvathi.