]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: am335x: DXR2: Reset SMSC LAN9303 switch via GPIO upon bootup
authorStefan Roese <sr@denx.de>
Tue, 25 Feb 2014 10:07:22 +0000 (11:07 +0100)
committerTom Rini <trini@ti.com>
Tue, 4 Mar 2014 14:42:07 +0000 (09:42 -0500)
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 <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Roger Meier <r.meier@siemens.com>
Cc: Lukas Stockmann <lukas.stockmann@siemens.com>
Cc: Tom Rini <trini@ti.com>
board/siemens/dxr2/board.c
board/siemens/dxr2/mux.c
include/configs/dxr2.h

index 9b8f538312ebb2a97fda8c85d85ffebc168154e5..217237900e36bd47baa46a400fed8862f168176f 100644 (file)
@@ -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);
 
index 5c22999bb8a620e782796042e0c49e143374315e..f2314b5d3e533cf521f09a2d540aab19a7a39cc5 100644 (file)
@@ -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},
 };
 
index e95d74c04c74c8376416c1c5b062e306c1bef3dc..75f7812e7d6e8aa20c0f6a8d17edd900822fc874 100644 (file)
@@ -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