const char *mac;
device_for_each_child_node(&bgx->pdev->dev, fwn) {
+ struct phy_device *pd;
struct device_node *phy_np;
struct device_node *node = to_of_node(fwn);
- /* If it is not an OF node we cannot handle it yet, so
- * exit the loop.
+ /* Should always be an OF node. But if it is not, we
+ * cannot handle it, so exit the loop.
*/
if (!node)
break;
- phy_np = of_parse_phandle(node, "phy-handle", 0);
- if (!phy_np)
- continue;
-
- bgx->lmac[lmac].phydev = of_phy_find_device(phy_np);
-
mac = of_get_mac_address(node);
if (mac)
ether_addr_copy(bgx->lmac[lmac].mac, mac);
SET_NETDEV_DEV(&bgx->lmac[lmac].netdev, &bgx->pdev->dev);
bgx->lmac[lmac].lmacid = lmac;
+
+ phy_np = of_parse_phandle(node, "phy-handle", 0);
+ /* If there is no phy or defective firmware presents
+ * this cortina phy, for which there is no driver
+ * support, ignore it.
+ */
+ if (phy_np &&
+ !of_device_is_compatible(phy_np, "cortina,cs4223-slice")) {
+ /* Wait until the phy drivers are available */
+ pd = of_phy_find_device(phy_np);
+ if (!pd)
+ return -EPROBE_DEFER;
+ bgx->lmac[lmac].phydev = pd;
+ }
+
lmac++;
if (lmac == MAX_LMAC_PER_BGX) {
of_node_put(node);
struct bgx *bgx = NULL;
u8 lmac;
- /* Load octeon mdio driver */
- octeon_mdiobus_force_mod_depencency();
-
bgx = devm_kzalloc(dev, sizeof(*bgx), GFP_KERNEL);
if (!bgx)
return -ENOMEM;