]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: freescale: powerpc: add support for all RGMII modes
authorMadalin Bucur <madalin.bucur@oss.nxp.com>
Wed, 4 Nov 2020 13:09:17 +0000 (15:09 +0200)
committerPriyanka Jain <priyanka.jain@nxp.com>
Thu, 10 Dec 2020 08:26:39 +0000 (13:56 +0530)
Make sure all RGMII internal delay modes are covered.

Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
board/freescale/corenet_ds/eth_hydra.c
board/freescale/corenet_ds/eth_p4080.c
board/freescale/corenet_ds/eth_superhydra.c
board/freescale/p2041rdb/eth.c
board/freescale/t102xrdb/eth_t102xrdb.c
board/freescale/t104xrdb/eth.c
board/freescale/t208xqds/eth_t208xqds.c
board/freescale/t208xrdb/eth_t208xrdb.c

index 8112c12568d2b349bd92ac0c7126cd1d4c5a703f..6500c2fcf679cf580bcbb7778d0b04f29ee13b8b 100644 (file)
@@ -350,6 +350,9 @@ void fdt_fixup_board_enet(void *fdt)
                        }
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        fdt_status_okay_by_alias(fdt, "emi1_rgmii");
                        break;
                default:
@@ -449,6 +452,9 @@ int board_eth_init(struct bd_info *bis)
                                miiphy_get_dev_by_name("HYDRA_SGMII_MDIO"));
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        /*
                         * If DTSEC4 is RGMII, then it's routed via via EC1 to
                         * the first on-board RGMII port.  If DTSEC5 is RGMII,
index 650013bb6fc34dce9ef641176969cf4e8814b686..df5a69bcba31cce25cbc008f43c0380d59286569 100644 (file)
@@ -367,6 +367,9 @@ int board_eth_init(struct bd_info *bis)
                        };
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        fm_info_set_phy_address(i, 0);
                        mdio_mux[i] = EMI1_RGMII;
                        fm_info_set_mdio(i,
@@ -434,6 +437,9 @@ int board_eth_init(struct bd_info *bis)
                        };
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        fm_info_set_phy_address(i, 0);
                        mdio_mux[i] = EMI1_RGMII;
                        fm_info_set_mdio(i,
index 35daa1e80f3a081b8c53e0bd0d8e8ef3b905ea27..de7b692f3febcd3f01bc89643b4ded348b1a7d5f 100644 (file)
@@ -317,6 +317,9 @@ void fdt_fixup_board_enet(void *fdt)
                        }
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        fdt_status_okay_by_alias(fdt, "hydra_rg");
                        debug("Enabled MDIO node hydra_rg\n");
                        break;
@@ -353,6 +356,9 @@ void fdt_fixup_board_enet(void *fdt)
                        }
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        fdt_status_okay_by_alias(fdt, "hydra_rg");
                        debug("Enabled MDIO node hydra_rg\n");
                        break;
@@ -557,6 +563,9 @@ int board_eth_init(struct bd_info *bis)
                        miiphy_get_dev_by_name("SUPER_HYDRA_FM1_SGMII_MDIO"));
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        /*
                         * FM1 DTSEC5 is routed via EC1 to the first on-board
                         * RGMII port. FM2 DTSEC5 is routed via EC2 to the
@@ -704,6 +713,9 @@ int board_eth_init(struct bd_info *bis)
 
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        /*
                         * FM1 DTSEC5 is routed via EC1 to the first on-board
                         * RGMII port. FM2 DTSEC5 is routed via EC2 to the
index 396981605d21c7ea72566c32d3e7d08532e54b26..23fd619ceed325f14ace19fa1a34cc829907ac80 100644 (file)
@@ -81,17 +81,21 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
 {
        phy_interface_t intf = fm_info_get_enet_if(port);
        char phy[16];
+       int lane;
+       u8 slot;
 
+       switch (intf) {
        /* The RGMII PHY is identified by the MAC connected to it */
-       if (intf == PHY_INTERFACE_MODE_RGMII) {
+       case PHY_INTERFACE_MODE_RGMII:
+       case PHY_INTERFACE_MODE_RGMII_TXID:
+       case PHY_INTERFACE_MODE_RGMII_RXID:
+       case PHY_INTERFACE_MODE_RGMII_ID:
                sprintf(phy, "phy_rgmii_%u", port == FM1_DTSEC5 ? 0 : 1);
                fdt_set_phy_handle(fdt, compat, addr, phy);
-       }
-
+               break;
        /* The SGMII PHY is identified by the MAC connected to it */
-       if (intf == PHY_INTERFACE_MODE_SGMII) {
-               int lane = serdes_get_first_lane(SGMII_FM1_DTSEC1 + port);
-               u8 slot;
+       case PHY_INTERFACE_MODE_SGMII:
+               lane = serdes_get_first_lane(SGMII_FM1_DTSEC1 + port);
                if (lane < 0)
                        return;
                slot = lane_to_slot[lane];
@@ -106,16 +110,18 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
                                        + (port - FM1_DTSEC1));
                        fdt_set_phy_handle(fdt, compat, addr, phy);
                }
-       }
-
-       if (intf == PHY_INTERFACE_MODE_XGMII) {
+               break;
+       case PHY_INTERFACE_MODE_XGMII:
                /* XAUI */
-               int lane = serdes_get_first_lane(XAUI_FM1);
+               lane = serdes_get_first_lane(XAUI_FM1);
                if (lane >= 0) {
                        /* The XAUI PHY is identified by the slot */
                        sprintf(phy, "phy_xgmii_%u", lane_to_slot[lane]);
                        fdt_set_phy_handle(fdt, compat, addr, phy);
                }
+               break;
+       default:
+               break;
        }
 }
 #endif /* #ifdef CONFIG_FMAN_ENET */
@@ -169,6 +175,9 @@ int board_eth_init(struct bd_info *bis)
                                fm_info_set_phy_address(i, riser_phy_addr[i]);
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        /* Only DTSEC4 and DTSEC5 can be routed to RGMII */
                        fm_info_set_phy_address(i, i == FM1_DTSEC5 ?
                                        CONFIG_SYS_FM1_DTSEC5_PHY_ADDR :
index b64590f9d796d1dbb81ce3713806e49dba6691d5..56e6109288f72fa3681f209f379cb4fe6dfa36f0 100644 (file)
@@ -89,6 +89,9 @@ int board_eth_init(struct bd_info *bis)
                interface = fm_info_get_enet_if(i);
                switch (interface) {
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        dev = miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME);
                        fm_info_set_mdio(i, dev);
                        break;
index 8e2f035874049ba2d9af501b8f942486e846686a..b034f11d68aaae85177903c8e41430b4c86d0a63 100644 (file)
@@ -77,6 +77,9 @@ int board_eth_init(struct bd_info *bis)
                        break;
 #endif
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        if (FM1_DTSEC4 == i)
                                phy_addr = CONFIG_SYS_RGMII1_PHY_ADDR;
                        if (FM1_DTSEC5 == i)
index 5044b5695b66bb9358727e51d20a399111419227..aaa3490aaa2ab63ffce3dcd3f84d0e094d979ed6 100644 (file)
@@ -765,6 +765,9 @@ int board_eth_init(struct bd_info *bis)
                        }
                        break;
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        if (i == FM1_DTSEC3)
                                mdio_mux[i] = EMI1_RGMII1;
                        else if (i == FM1_DTSEC4 || FM1_DTSEC10)
index c16538850cd013d48cd91b45259c7837665da511..e77f3f7146f7b96848a1527bce20b72fee2baea3 100644 (file)
@@ -76,6 +76,9 @@ int board_eth_init(struct bd_info *bis)
                interface = fm_info_get_enet_if(i);
                switch (interface) {
                case PHY_INTERFACE_MODE_RGMII:
+               case PHY_INTERFACE_MODE_RGMII_TXID:
+               case PHY_INTERFACE_MODE_RGMII_RXID:
+               case PHY_INTERFACE_MODE_RGMII_ID:
                        dev = miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME);
                        fm_info_set_mdio(i, dev);
                        break;