arm: am335x: DXR2: Reset SMSC LAN9303 switch via GPIO upon bootup
PATCH 1/1 arm: am335x: DXR2: Reset SMSC LAN9303 switch via GPIO upon bootup
Since the switch may be re-configured for VLAN usage in Linux (or any other OS), lets reset the switch to its default register values upon power-up. Otherwise network might not be available in U-Boot.
Signed-off-by Stefan Roese <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Roger Meier <[email protected]>
Cc Lukas Stockmann <[email protected]>
Cc Tom Rini <[email protected]>
--- board/siemens/dxr2/board.c | 7 +++++++ board/siemens/dxr2/mux.c | 2 ++ include/configs/dxr2.h | 1 + 3 files changed, 10 insertions(+)
board/siemens/dxr2/board.c +7 -0
@@ -232,6 +232,13 @@ int board_eth_init(bd_t *bis)factoryset_setenv (); +/* Reset SMSC LAN9303 switch for default configuration */ +gpio_request (GPIO_LAN9303_NRST ,"nRST" ); +gpio_direction_output (GPIO_LAN9303_NRST ,0 ); +/* assert active low reset for 200us */ +udelay (200 ); +gpio_set_value (GPIO_LAN9303_NRST ,1 ); +/* Set rgmii mode and enable rmii clock to be sourced from chip */ writel ((RMII_MODE_ENABLE |RMII_CHIPCKL_ENABLE ), &cdev->miisel);
board/siemens/dxr2/mux.c +2 -0
@@ -221,6 +221,8 @@ static struct module_pin_mux gpios_pin_mux[] = { {OFFSET(ain0), MODE(7) | RXACTIVE | PULLUDDIS}, {OFFSET(vrefp), MODE(7) | RXACTIVE | PULLUDDIS}, {OFFSET(vrefn), MODE(7) | RXACTIVE | PULLUDDIS}, +/* nRST for SMSC LAN9303 switch - GPIO2_24 */ + {OFFSET(lcd_pclk), MODE(7) }, /* LAN9303 nRST */ {-1}, };
include/configs/dxr2.h +1 -0
@@ -26,6 +26,7 @@#define BOARD_DFU_BUTTON_GPIO 27#define BOARD_DFU_BUTTON_LED 64 +#define GPIO_LAN9303_NRST 88/* GPIO2_24 = gpio88 */ #undef CONFIG_DOS_PARTITION#undef CONFIG_CMD_FAT
Signature · 1 line
1.8.5.5
Quoted 9 lines · Stefan Roese
Since the switch may be re-configured for VLAN usage in Linux (or any other OS), lets reset the switch to its default register values upon power-up. Otherwise network might not be available in U-Boot.
Signed-off-by Stefan Roese <[email protected]>Cc Heiko Schocher <[email protected]>Cc Roger Meier <[email protected]>Cc Lukas Stockmann <[email protected]>Cc Tom Rini <[email protected]>
Applied to u-boot-ti/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140304/02d14a07/attachment.pgp>