]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: mxs: configure and register the second FEC device on TX28/STK5-V4
authorLothar Waßmann <LW@KARO-electronics.de>
Mon, 21 Mar 2011 16:48:05 +0000 (17:48 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Wed, 23 Mar 2011 14:08:14 +0000 (15:08 +0100)
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mxs/module-tx28.c
arch/arm/mach-mxs/module-tx28.h

index fa0b154da67b16a077d4c5fadc7436d5cba7ac82..0fcff47009cf13ff53db9757e58c9dc0cbf5b927 100644 (file)
@@ -45,7 +45,7 @@ static const iomux_cfg_t tx28_fec_gpio_pads[] __initconst = {
 };
 
 #define FEC_MODE (MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3)
-static const iomux_cfg_t tx28_fec_pads[] __initconst = {
+static const iomux_cfg_t tx28_fec0_pads[] __initconst = {
        MX28_PAD_ENET0_MDC__ENET0_MDC | FEC_MODE,
        MX28_PAD_ENET0_MDIO__ENET0_MDIO | FEC_MODE,
        MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | FEC_MODE,
@@ -57,7 +57,20 @@ static const iomux_cfg_t tx28_fec_pads[] __initconst = {
        MX28_PAD_ENET_CLK__CLKCTRL_ENET | FEC_MODE,
 };
 
-static const struct fec_platform_data tx28_fec_data __initconst = {
+static const iomux_cfg_t tx28_fec1_pads[] __initconst = {
+       MX28_PAD_ENET0_RXD2__ENET1_RXD0,
+       MX28_PAD_ENET0_RXD3__ENET1_RXD1,
+       MX28_PAD_ENET0_TXD2__ENET1_TXD0,
+       MX28_PAD_ENET0_TXD3__ENET1_TXD1,
+       MX28_PAD_ENET0_COL__ENET1_TX_EN,
+       MX28_PAD_ENET0_CRS__ENET1_RX_EN,
+};
+
+static struct fec_platform_data tx28_fec0_data = {
+       .phy = PHY_INTERFACE_MODE_RMII,
+};
+
+static struct fec_platform_data tx28_fec1_data = {
        .phy = PHY_INTERFACE_MODE_RMII,
 };
 
@@ -108,15 +121,15 @@ int __init tx28_add_fec0(void)
        pr_debug("%s: Deasserting FEC PHY RESET\n", __func__);
        gpio_set_value(TX28_FEC_PHY_RESET, 1);
 
-       ret = mxs_iomux_setup_multiple_pads(tx28_fec_pads,
-                       ARRAY_SIZE(tx28_fec_pads));
+       ret = mxs_iomux_setup_multiple_pads(tx28_fec0_pads,
+                       ARRAY_SIZE(tx28_fec0_pads));
        if (ret) {
                pr_debug("%s: mxs_iomux_setup_multiple_pads() failed with rc: %d\n",
                                __func__, ret);
                goto free_gpios;
        }
-       pr_debug("%s: Registering FEC device\n", __func__);
-       mx28_add_fec(0, &tx28_fec_data);
+       pr_debug("%s: Registering FEC0 device\n", __func__);
+       mx28_add_fec(0, &tx28_fec0_data);
        return 0;
 
 free_gpios:
@@ -129,3 +142,19 @@ free_gpios:
 
        return ret;
 }
+
+int __init tx28_add_fec1(void)
+{
+       int ret;
+
+       ret = mxs_iomux_setup_multiple_pads(tx28_fec1_pads,
+                       ARRAY_SIZE(tx28_fec1_pads));
+       if (ret) {
+               pr_debug("%s: mxs_iomux_setup_multiple_pads() failed with rc: %d\n",
+                               __func__, ret);
+               return ret;
+       }
+       pr_debug("%s: Registering FEC1 device\n", __func__);
+       mx28_add_fec(1, &tx28_fec1_data);
+       return 0;
+}
index df9e1b6e81bfc292cb0ceab19b9a3ab061fb6a08..8ed425457d30d9eca60525bb5bf4d79df0400629 100644 (file)
@@ -7,3 +7,4 @@
  * Free Software Foundation.
  */
 int __init tx28_add_fec0(void);
+int __init tx28_add_fec1(void);