diff options
author | Marek Vasut | 2023-03-19 18:02:42 +0100 |
---|---|---|
committer | Marek Vasut | 2023-04-07 14:18:48 +0200 |
commit | 7940a93eb9778d275d5c2adcc8ee04e2f52d7b57 (patch) | |
tree | 035c36d0c0990b29786613812b8e82002e69ffac /include/phy.h | |
parent | 9d5a38c2143e32d36908cbd5ef53a688e89edcb5 (diff) |
net: phy: Iterate over both registered PHYs and struct phy_driver linker list
Introduce U_BOOT_PHY_DRIVER() macro which is used to add struct phy_driver
into a new linker list section containing all compiled in struct phy_driver
drivers. This is so far empty until PHY drivers are converted over to this
macro.
Iterate over both drivers registered using soon to be legacy phy_register()
as well as drivers in the new linker list when looking up a suitable PHY
driver. This way, PHY drivers can be converted over to the new macro one
driver at a time.
The relocation of callbacks for linker list based drivers now happens in
phy_init() call as the drivers are available at that point in time, and
phy_register() is not called for those drivers.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
Diffstat (limited to 'include/phy.h')
-rw-r--r-- | include/phy.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/phy.h b/include/phy.h index 87aa86c2e78..1eccfacec68 100644 --- a/include/phy.h +++ b/include/phy.h @@ -345,6 +345,13 @@ int phy_fixed_init(void); 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); |