]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
karo: tx48: explicitly call tx48_phy_init()
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 9 Jan 2015 10:49:50 +0000 (11:49 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 9 Jan 2015 12:08:01 +0000 (13:08 +0100)
The .phy_init callback in the cpsw_platform_data which hooks the
tx48_phy_init() function is not being used by the cpsw driver.
Call the function explicitly to make sure the ethernet phy is properly
initialized.
Also make sure the RESET_OUT pin of the TX48 module is activated
as early as possible.

board/karo/tx48/tx48.c

index 9e59ebf1d22071e922b0814b99c2cf339ac446c9..753ce3a26595e896fba85c895b3e2525692ed8f2 100644 (file)
@@ -328,6 +328,7 @@ static u32 prm_rstst __attribute__((section(".data")));
 static const struct pin_mux tx48_pads[] = {
        { OFFSET(i2c0_sda), MODE(7) | RXACTIVE | PULLUDEN | PULLUP_EN, },
        { OFFSET(i2c0_scl), MODE(7) | RXACTIVE | PULLUDEN | PULLUP_EN, },
+       { OFFSET(emu1), MODE(7), }, /* ETH PHY Reset */
 };
 
 static const struct pin_mux tx48_i2c_pads[] = {
@@ -338,6 +339,7 @@ static const struct pin_mux tx48_i2c_pads[] = {
 static const struct gpio tx48_gpios[] = {
        { AM33XX_GPIO_NR(3, 5), GPIOF_INPUT, "I2C1_SDA", },
        { AM33XX_GPIO_NR(3, 6), GPIOF_INPUT, "I2C1_SCL", },
+       { AM33XX_GPIO_NR(3, 8), GPIOF_OUTPUT_INIT_LOW, "ETH_PHY_RESET", },
 };
 
 static const struct pin_mux stk5_pads[] = {
@@ -994,7 +996,7 @@ exit:
 }
 
 #ifdef CONFIG_DRIVER_TI_CPSW
-static void tx48_phy_init(char *name, int addr)
+static void tx48_phy_init(void)
 {
        debug("%s: Resetting ethernet PHY\n", __func__);
 
@@ -1043,7 +1045,6 @@ static struct cpsw_platform_data cpsw_data = {
        .hw_stats_reg_ofs       = 0x900,
        .mac_control            = (1 << 5) /* MIIEN */,
        .control                = cpsw_control,
-       .phy_init               = tx48_phy_init,
        .gigabit_en             = 0,
        .host_port_num          = 0,
        .version                = CPSW_CTRL_VERSION_2,
@@ -1053,6 +1054,7 @@ int board_eth_init(bd_t *bis)
 {
        __raw_writel(RMII_MODE_ENABLE, MAC_MII_SEL);
        __raw_writel(0x5D, GMII_SEL);
+       tx48_phy_init();
        return cpsw_register(&cpsw_data);
 }
 #endif /* CONFIG_DRIVER_TI_CPSW */