int phy_init(void)
{
#ifdef CONFIG_NEEDS_MANUAL_RELOC
+ const int ll_n_ents = ll_entry_count(struct phy_driver, phy_driver);
+ struct phy_driver *drv, *ll_entry;
+
/*
* The pointers inside phy_drivers also needs to be updated incase of
* manual reloc, without which these points to some invalid
head->next = (void *)head->next + gd->reloc_off;
head->prev = (void *)head->prev + gd->reloc_off;
+
+ /* Perform manual relocation on linker list based PHY drivers */
+ ll_entry = ll_entry_start(struct phy_driver, phy_driver);
+ for (drv = ll_entry; drv != ll_entry + ll_n_ents; drv++)
+ phy_drv_reloc(drv);
#endif
#ifdef CONFIG_B53_SWITCH
static struct phy_driver *get_phy_driver(struct phy_device *phydev)
{
+ const int ll_n_ents = ll_entry_count(struct phy_driver, phy_driver);
+ struct phy_driver *ll_entry;
struct list_head *entry;
int phy_id = phydev->phy_id;
struct phy_driver *drv = NULL;
return drv;
}
+ ll_entry = ll_entry_start(struct phy_driver, phy_driver);
+ for (drv = ll_entry; drv != ll_entry + ll_n_ents; drv++)
+ if ((drv->uid & drv->mask) == (phy_id & drv->mask))
+ return drv;
+
/* If we made it here, there's no driver for this PHY */
return generic_for_phy(phydev);
}
int phy_ncsi_init(void);
int phy_xilinx_gmii2rgmii_init(void);
+/**
+ * U_BOOT_PHY_DRIVER() - Declare a new U-Boot driver
+ * @__name: name of the driver
+ */
+#define U_BOOT_PHY_DRIVER(__name) \
+ ll_entry_declare(struct phy_driver, __name, phy_driver)
+
int board_phy_config(struct phy_device *phydev);
int get_phy_id(struct mii_dev *bus, int addr, int devad, u32 *phy_id);