From 7940a93eb9778d275d5c2adcc8ee04e2f52d7b57 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:42 +0100 Subject: 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 Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') 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); -- cgit v1.2.3 From 4de8644504a69285fa9e28da072ab1ec298543f5 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:43 +0100 Subject: net: phy: adin: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 1eccfacec68..dbc0da7e084 100644 --- a/include/phy.h +++ b/include/phy.h @@ -317,7 +317,6 @@ int gen10g_discover_mmds(struct phy_device *phydev); int phy_b53_init(void); int phy_mv88e61xx_init(void); -int phy_adin_init(void); int phy_aquantia_init(void); int phy_atheros_init(void); int phy_broadcom_init(void); -- cgit v1.2.3 From a5fbc10560699722b3a64a02ad0ce5cdae5d473f Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:44 +0100 Subject: net: phy: aquantia: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index dbc0da7e084..a0060cd19ea 100644 --- a/include/phy.h +++ b/include/phy.h @@ -317,7 +317,6 @@ int gen10g_discover_mmds(struct phy_device *phydev); int phy_b53_init(void); int phy_mv88e61xx_init(void); -int phy_aquantia_init(void); int phy_atheros_init(void); int phy_broadcom_init(void); int phy_cortina_init(void); -- cgit v1.2.3 From fba31ab92c16f1757395b424b774e17c8c47aa97 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:45 +0100 Subject: net: phy: atheros: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index a0060cd19ea..a1be1fbe1a1 100644 --- a/include/phy.h +++ b/include/phy.h @@ -317,7 +317,6 @@ int gen10g_discover_mmds(struct phy_device *phydev); int phy_b53_init(void); int phy_mv88e61xx_init(void); -int phy_atheros_init(void); int phy_broadcom_init(void); int phy_cortina_init(void); int phy_cortina_access_init(void); -- cgit v1.2.3 From 761e4060fecb2f5320df0b8f6babca836bb32de1 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:46 +0100 Subject: net: phy: b53: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index a1be1fbe1a1..88c9013f1f8 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_b53_init(void); int phy_mv88e61xx_init(void); int phy_broadcom_init(void); int phy_cortina_init(void); -- cgit v1.2.3 From c00f3f826f631f21006b5a6c4dcaf969ad6265e3 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:47 +0100 Subject: net: phy: broadcom: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 88c9013f1f8..cecfbe6968f 100644 --- a/include/phy.h +++ b/include/phy.h @@ -316,7 +316,6 @@ int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); int phy_mv88e61xx_init(void); -int phy_broadcom_init(void); int phy_cortina_init(void); int phy_cortina_access_init(void); int phy_davicom_init(void); -- cgit v1.2.3 From 227650f0e75ae550350270b953ff828c9c51aa8e Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:48 +0100 Subject: net: phy: ca_phy: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index cecfbe6968f..50a53982810 100644 --- a/include/phy.h +++ b/include/phy.h @@ -317,7 +317,6 @@ int gen10g_discover_mmds(struct phy_device *phydev); int phy_mv88e61xx_init(void); int phy_cortina_init(void); -int phy_cortina_access_init(void); int phy_davicom_init(void); int phy_et1011c_init(void); int phy_lxt_init(void); -- cgit v1.2.3 From 579f359269266b99115b68679a6f5acbcfbc1e7d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:49 +0100 Subject: net: phy: cortina: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 50a53982810..797139bf681 100644 --- a/include/phy.h +++ b/include/phy.h @@ -316,7 +316,6 @@ int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); int phy_mv88e61xx_init(void); -int phy_cortina_init(void); int phy_davicom_init(void); int phy_et1011c_init(void); int phy_lxt_init(void); -- cgit v1.2.3 From 7e9ce5adf6ff14cc051fd9fe11107cd6ce0ba0ef Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:50 +0100 Subject: net: phy: davicom: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 797139bf681..51c2ddb7e4e 100644 --- a/include/phy.h +++ b/include/phy.h @@ -316,7 +316,6 @@ int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); int phy_mv88e61xx_init(void); -int phy_davicom_init(void); int phy_et1011c_init(void); int phy_lxt_init(void); int phy_marvell_init(void); -- cgit v1.2.3 From abdbfad25c3712b5d0e8ccc514f85eed8aba7b20 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:51 +0100 Subject: net: phy: mv88e61xx: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 51c2ddb7e4e..9e5a9196cbd 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_mv88e61xx_init(void); int phy_et1011c_init(void); int phy_lxt_init(void); int phy_marvell_init(void); -- cgit v1.2.3 From b20c53a93f9e6078bd65f1a8b4fd3e07d4ad26c6 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:52 +0100 Subject: net: phy: et1011c: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 9e5a9196cbd..3bc4a0de724 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_et1011c_init(void); int phy_lxt_init(void); int phy_marvell_init(void); int phy_micrel_ksz8xxx_init(void); -- cgit v1.2.3 From f10c8938156ad5efa7da796ce76d6d9b5cd31606 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:53 +0100 Subject: net: phy: lxt: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 3bc4a0de724..a309056ce77 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_lxt_init(void); int phy_marvell_init(void); int phy_micrel_ksz8xxx_init(void); int phy_micrel_ksz90x1_init(void); -- cgit v1.2.3 From 9010be953e35d193c3948b221327d07eed9b6ae5 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:54 +0100 Subject: net: phy: marvell: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index a309056ce77..77e46ebac83 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_marvell_init(void); int phy_micrel_ksz8xxx_init(void); int phy_micrel_ksz90x1_init(void); int phy_meson_gxl_init(void); -- cgit v1.2.3 From f282e32d0a4ccd8dbd5e71a8c70ffa57a274b266 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:55 +0100 Subject: net: phy: ksz8xxx: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 77e46ebac83..27d9742c6c4 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_micrel_ksz8xxx_init(void); int phy_micrel_ksz90x1_init(void); int phy_meson_gxl_init(void); int phy_natsemi_init(void); -- cgit v1.2.3 From 6b5eea7508e91659997f07139e3108a6bb1b422e Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:56 +0100 Subject: net: phy: ksz90x1: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 27d9742c6c4..570524a21f5 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_micrel_ksz90x1_init(void); int phy_meson_gxl_init(void); int phy_natsemi_init(void); int phy_nxp_c45_tja11xx_init(void); -- cgit v1.2.3 From 3b96dc7513c4c309fc74165d4de562e4bcd73467 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:57 +0100 Subject: net: phy: meson-gxl: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 570524a21f5..f69f379fc2b 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_meson_gxl_init(void); int phy_natsemi_init(void); int phy_nxp_c45_tja11xx_init(void); int phy_nxp_tja11xx_init(void); -- cgit v1.2.3 From 390e3fcd4ecc7f669d26662c988d86ed6ea9a593 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:58 +0100 Subject: net: phy: natsemi: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index f69f379fc2b..647d23595d1 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_natsemi_init(void); int phy_nxp_c45_tja11xx_init(void); int phy_nxp_tja11xx_init(void); int phy_realtek_init(void); -- cgit v1.2.3 From d1296d44de5d5c4c6c41a64310dcdb4bd80d6a2a Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:02:59 +0100 Subject: net: phy: nxp-c45-tja11xx: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 647d23595d1..aa65ae16f68 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_nxp_c45_tja11xx_init(void); int phy_nxp_tja11xx_init(void); int phy_realtek_init(void); int phy_smsc_init(void); -- cgit v1.2.3 From 1965f2aa65fb6cc98775dec4ac5498eabcd885d3 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:00 +0100 Subject: net: phy: nxp-tja11xx: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index aa65ae16f68..bc42a522ea6 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_nxp_tja11xx_init(void); int phy_realtek_init(void); int phy_smsc_init(void); int phy_teranetics_init(void); -- cgit v1.2.3 From f2e0be396e4100df9327d8bdc25a71585375c4c5 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:01 +0100 Subject: net: phy: realtek: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index bc42a522ea6..24a880ed2fb 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_realtek_init(void); int phy_smsc_init(void); int phy_teranetics_init(void); int phy_ti_init(void); -- cgit v1.2.3 From 2ea350c466d0d0ab5a6ad18d7a859649556ae98b Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:02 +0100 Subject: net: phy: smsc: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 24a880ed2fb..4326ef223e0 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_smsc_init(void); int phy_teranetics_init(void); int phy_ti_init(void); int phy_vitesse_init(void); -- cgit v1.2.3 From 787a67f4710576e18c8df6131a881453f3737abb Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:03 +0100 Subject: net: phy: teranetics: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 4326ef223e0..2c6e167f26e 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_teranetics_init(void); int phy_ti_init(void); int phy_vitesse_init(void); int phy_xilinx_init(void); -- cgit v1.2.3 From 5b777fe527ac67790e41ee9e355241118761aa4b Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:04 +0100 Subject: net: phy: ti: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" This particular PHY driver is slightly more spread out across additional source files. Since the phy_register() calls are no longer necessary, all the registration calls across those source files is dropped. Furthermore, the Makefile can now be updated to only compile generic TI PHY support if matching Kconfig symbol is enabled and the ifdeffery in the generic TI PHY driver can be dropped. Signed-off-by: Marek Vasut Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 2c6e167f26e..e6508a132d0 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_ti_init(void); int phy_vitesse_init(void); int phy_xilinx_init(void); int phy_xway_init(void); -- cgit v1.2.3 From fb5cf1bb42b8b61d3ce1e9d9e34c33456ed945b3 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:05 +0100 Subject: net: phy: vitesse: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index e6508a132d0..74f3ada2491 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_vitesse_init(void); int phy_xilinx_init(void); int phy_xway_init(void); int phy_mscc_init(void); -- cgit v1.2.3 From 6620b9204dd2fe9c15a637792ecd5d3d5e0f0e95 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:06 +0100 Subject: net: phy: xilinx: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 74f3ada2491..e128ddf0037 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_xilinx_init(void); int phy_xway_init(void); int phy_mscc_init(void); int phy_fixed_init(void); -- cgit v1.2.3 From 330d64f5a0d748707fe40139fa981aebeb2308a3 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:07 +0100 Subject: net: phy: intel-xway: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index e128ddf0037..fc8300d5d97 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_xway_init(void); int phy_mscc_init(void); int phy_fixed_init(void); int phy_ncsi_init(void); -- cgit v1.2.3 From 5c359aa712d2b91e23df15a2b11cc72aa3682b30 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:08 +0100 Subject: net: phy: mscc: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index fc8300d5d97..e4a3e10c48b 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_mscc_init(void); int phy_fixed_init(void); int phy_ncsi_init(void); int phy_xilinx_gmii2rgmii_init(void); -- cgit v1.2.3 From 7f4e6c2ae129a3315390cc2ee76badade98e2e62 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:09 +0100 Subject: net: phy: fixed: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index e4a3e10c48b..9cabfeedec8 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_fixed_init(void); int phy_ncsi_init(void); int phy_xilinx_gmii2rgmii_init(void); -- cgit v1.2.3 From 81a8728c834cfb004205b42eebafd86a70098509 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:10 +0100 Subject: net: phy: ncsi: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 9cabfeedec8..001c998db47 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_ncsi_init(void); int phy_xilinx_gmii2rgmii_init(void); /** -- cgit v1.2.3 From 53ef8d79f254c97dc7592ff8d10d5ba724195fe6 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:11 +0100 Subject: net: phy: xilinx-gmii2rgmii: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 001c998db47..df2586f89ea 100644 --- a/include/phy.h +++ b/include/phy.h @@ -315,8 +315,6 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); -int phy_xilinx_gmii2rgmii_init(void); - /** * U_BOOT_PHY_DRIVER() - Declare a new U-Boot driver * @__name: name of the driver -- cgit v1.2.3 From 20bd8e4fcbb537be0f564bbc90e3a571aeeabf8d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:13 +0100 Subject: net: phy: gen10g: Convert to U_BOOT_PHY_DRIVER() Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call. Converted using sed "s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {" Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index df2586f89ea..5f4967cb150 100644 --- a/include/phy.h +++ b/include/phy.h @@ -173,10 +173,6 @@ struct fixed_link { int asym_pause; }; -#ifdef CONFIG_PHYLIB_10G -extern struct phy_driver gen10g_driver; -#endif - /** * phy_init() - Initializes the PHY drivers * This function registers all available PHY drivers -- cgit v1.2.3 From 8728d4c032571a8569af14d09d18bf444c30e446 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:14 +0100 Subject: net: phy: Drop static phy_drivers list The static phy_drivers list is superseded by linker list of struct phy_drivers now that all drivers have been converted to the later. Drop the phy_drivers list as well as list_head from struct phy_driver. Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 5f4967cb150..5e8ae5e29aa 100644 --- a/include/phy.h +++ b/include/phy.h @@ -125,8 +125,6 @@ struct phy_driver { int (*write_mmd)(struct phy_device *phydev, int devad, int reg, u16 val); - struct list_head list; - /* driver private data */ ulong data; }; -- cgit v1.2.3 From 7da03bbc5711b394674f2ed40a2a3c9c4cb46154 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:15 +0100 Subject: net: phy: Drop unused phy_register() This function is no longer used, drop it. Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- include/phy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 5e8ae5e29aa..4a9de461152 100644 --- a/include/phy.h +++ b/include/phy.h @@ -293,7 +293,6 @@ int phy_clear_bits_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val int phy_startup(struct phy_device *phydev); int phy_config(struct phy_device *phydev); int phy_shutdown(struct phy_device *phydev); -int phy_register(struct phy_driver *drv); int phy_set_supported(struct phy_device *phydev, u32 max_speed); int phy_modify(struct phy_device *phydev, int devad, int regnum, u16 mask, u16 set); -- cgit v1.2.3 From 166ea497505b0612be9f714b403be8461e23c242 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Tue, 21 Mar 2023 18:25:53 +0100 Subject: net: mvpp2: Replace PHY_INTERFACE_MODE_SFI with 5GBASER/10GBASER/XAUI Replace PHY_INTERFACE_MODE_SFI with PHY_INTERFACE_MODE_5GBASER, PHY_INTERFACE_MODE_10GBASER and PHY_INTERFACE_MODE_XAUI to match Linux PHY interface modes. Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried --- include/phy_interface.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/phy_interface.h b/include/phy_interface.h index fed3357b9a2..52af7e612b6 100644 --- a/include/phy_interface.h +++ b/include/phy_interface.h @@ -31,6 +31,7 @@ typedef enum { PHY_INTERFACE_MODE_XGMII, PHY_INTERFACE_MODE_XAUI, PHY_INTERFACE_MODE_RXAUI, + PHY_INTERFACE_MODE_5GBASER, PHY_INTERFACE_MODE_SFI, PHY_INTERFACE_MODE_INTERNAL, PHY_INTERFACE_MODE_25G_AUI, @@ -62,6 +63,7 @@ static const char * const phy_interface_strings[] = { [PHY_INTERFACE_MODE_XGMII] = "xgmii", [PHY_INTERFACE_MODE_XAUI] = "xaui", [PHY_INTERFACE_MODE_RXAUI] = "rxaui", + [PHY_INTERFACE_MODE_5GBASER] = "5gbase-r", [PHY_INTERFACE_MODE_SFI] = "sfi", [PHY_INTERFACE_MODE_INTERNAL] = "internal", [PHY_INTERFACE_MODE_25G_AUI] = "25g-aui", -- cgit v1.2.3 From 75d28899e3e93b8fed241744c6687f9606310f72 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Tue, 21 Mar 2023 18:25:54 +0100 Subject: net: phy: Synchronize PHY interface modes with Linux Synchronize PHY interface modes with Linux next 6.2.y commit: 0194b64578e90 ("net: phy: improve phy_read_poll_timeout") Retain LX2160A/LX2162A PHY modes as those are not yet supported by the Linux kernel, but isolate those with ifdeffery. Isolate NCSI which are also not supported by Linux kernel. Note that the ifdeffery cannot be avoided with IS_ENABLED() here due to compilation of the entire conditional, which would fail in case NCSI symbols are not available. Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried --- include/phy_interface.h | 68 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/phy_interface.h b/include/phy_interface.h index 52af7e612b6..31be3228c7c 100644 --- a/include/phy_interface.h +++ b/include/phy_interface.h @@ -14,65 +14,95 @@ typedef enum { PHY_INTERFACE_MODE_NA, /* don't touch */ + PHY_INTERFACE_MODE_INTERNAL, PHY_INTERFACE_MODE_MII, PHY_INTERFACE_MODE_GMII, PHY_INTERFACE_MODE_SGMII, - PHY_INTERFACE_MODE_SGMII_2500, - PHY_INTERFACE_MODE_QSGMII, PHY_INTERFACE_MODE_TBI, + PHY_INTERFACE_MODE_REVMII, PHY_INTERFACE_MODE_RMII, + PHY_INTERFACE_MODE_REVRMII, PHY_INTERFACE_MODE_RGMII, PHY_INTERFACE_MODE_RGMII_ID, PHY_INTERFACE_MODE_RGMII_RXID, PHY_INTERFACE_MODE_RGMII_TXID, PHY_INTERFACE_MODE_RTBI, + PHY_INTERFACE_MODE_SMII, + PHY_INTERFACE_MODE_XGMII, + PHY_INTERFACE_MODE_XLGMII, + PHY_INTERFACE_MODE_MOCA, + PHY_INTERFACE_MODE_QSGMII, + PHY_INTERFACE_MODE_TRGMII, + PHY_INTERFACE_MODE_100BASEX, PHY_INTERFACE_MODE_1000BASEX, PHY_INTERFACE_MODE_2500BASEX, - PHY_INTERFACE_MODE_XGMII, - PHY_INTERFACE_MODE_XAUI, - PHY_INTERFACE_MODE_RXAUI, PHY_INTERFACE_MODE_5GBASER, - PHY_INTERFACE_MODE_SFI, - PHY_INTERFACE_MODE_INTERNAL, + PHY_INTERFACE_MODE_RXAUI, + PHY_INTERFACE_MODE_XAUI, + /* 10GBASE-R, XFI, SFI - single lane 10G Serdes */ + PHY_INTERFACE_MODE_10GBASER, + PHY_INTERFACE_MODE_25GBASER, + PHY_INTERFACE_MODE_USXGMII, + /* 10GBASE-KR - with Clause 73 AN */ + PHY_INTERFACE_MODE_10GKR, + PHY_INTERFACE_MODE_QUSGMII, + PHY_INTERFACE_MODE_1000BASEKX, +#if defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LX2162A) + /* LX2160A SERDES modes */ PHY_INTERFACE_MODE_25G_AUI, PHY_INTERFACE_MODE_XLAUI, PHY_INTERFACE_MODE_CAUI2, PHY_INTERFACE_MODE_CAUI4, +#endif +#if defined(CONFIG_PHY_NCSI) PHY_INTERFACE_MODE_NCSI, - PHY_INTERFACE_MODE_10GBASER, - PHY_INTERFACE_MODE_USXGMII, +#endif PHY_INTERFACE_MODE_MAX, } phy_interface_t; static const char * const phy_interface_strings[] = { - [PHY_INTERFACE_MODE_NA] = "", + [PHY_INTERFACE_MODE_NA] = "", + [PHY_INTERFACE_MODE_INTERNAL] = "internal", [PHY_INTERFACE_MODE_MII] = "mii", [PHY_INTERFACE_MODE_GMII] = "gmii", [PHY_INTERFACE_MODE_SGMII] = "sgmii", - [PHY_INTERFACE_MODE_SGMII_2500] = "sgmii-2500", - [PHY_INTERFACE_MODE_QSGMII] = "qsgmii", [PHY_INTERFACE_MODE_TBI] = "tbi", + [PHY_INTERFACE_MODE_REVMII] = "rev-mii", [PHY_INTERFACE_MODE_RMII] = "rmii", + [PHY_INTERFACE_MODE_REVRMII] = "rev-rmii", [PHY_INTERFACE_MODE_RGMII] = "rgmii", [PHY_INTERFACE_MODE_RGMII_ID] = "rgmii-id", [PHY_INTERFACE_MODE_RGMII_RXID] = "rgmii-rxid", [PHY_INTERFACE_MODE_RGMII_TXID] = "rgmii-txid", [PHY_INTERFACE_MODE_RTBI] = "rtbi", + [PHY_INTERFACE_MODE_SMII] = "smii", + [PHY_INTERFACE_MODE_XGMII] = "xgmii", + [PHY_INTERFACE_MODE_XLGMII] = "xlgmii", + [PHY_INTERFACE_MODE_MOCA] = "moca", + [PHY_INTERFACE_MODE_QSGMII] = "qsgmii", + [PHY_INTERFACE_MODE_TRGMII] = "trgmii", [PHY_INTERFACE_MODE_1000BASEX] = "1000base-x", + [PHY_INTERFACE_MODE_1000BASEKX] = "1000base-kx", [PHY_INTERFACE_MODE_2500BASEX] = "2500base-x", - [PHY_INTERFACE_MODE_XGMII] = "xgmii", - [PHY_INTERFACE_MODE_XAUI] = "xaui", - [PHY_INTERFACE_MODE_RXAUI] = "rxaui", [PHY_INTERFACE_MODE_5GBASER] = "5gbase-r", - [PHY_INTERFACE_MODE_SFI] = "sfi", - [PHY_INTERFACE_MODE_INTERNAL] = "internal", + [PHY_INTERFACE_MODE_RXAUI] = "rxaui", + [PHY_INTERFACE_MODE_XAUI] = "xaui", + [PHY_INTERFACE_MODE_10GBASER] = "10gbase-r", + [PHY_INTERFACE_MODE_25GBASER] = "25gbase-r", + [PHY_INTERFACE_MODE_USXGMII] = "usxgmii", + [PHY_INTERFACE_MODE_10GKR] = "10gbase-kr", + [PHY_INTERFACE_MODE_100BASEX] = "100base-x", + [PHY_INTERFACE_MODE_QUSGMII] = "qusgmii", +#if defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LX2162A) + /* LX2160A SERDES modes */ [PHY_INTERFACE_MODE_25G_AUI] = "25g-aui", [PHY_INTERFACE_MODE_XLAUI] = "xlaui4", [PHY_INTERFACE_MODE_CAUI2] = "caui2", [PHY_INTERFACE_MODE_CAUI4] = "caui4", +#endif +#if defined(CONFIG_PHY_NCSI) [PHY_INTERFACE_MODE_NCSI] = "NC-SI", - [PHY_INTERFACE_MODE_10GBASER] = "10gbase-r", - [PHY_INTERFACE_MODE_USXGMII] = "usxgmii", +#endif }; /* Backplane modes: -- cgit v1.2.3 From bf3dabb7de7979cbca8680e688911f36056204b1 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:08:06 +0100 Subject: net: phy: marvell: Import and use marvell_phy.h from Linux Import marvell_phy.h from Linux 5.14.y as of commit a5de4be0aaaa6 ("net: phy: marvell10g: fix differentiation of 88X3310 from 88X3340") and use it in marvell PHY driver instead of current ad-hoc macros. Two of the PHY IDs are unknown to Linux, 88E1149S and 88E1680, for those two, only sync the length of the hexadecimal number to 8 digits. No functional change. Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried --- include/marvell_phy.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 include/marvell_phy.h (limited to 'include') diff --git a/include/marvell_phy.h b/include/marvell_phy.h new file mode 100644 index 00000000000..0f06c2287b5 --- /dev/null +++ b/include/marvell_phy.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _MARVELL_PHY_H +#define _MARVELL_PHY_H + +/* Mask used for ID comparisons */ +#define MARVELL_PHY_ID_MASK 0xfffffff0 + +/* Known PHY IDs */ +#define MARVELL_PHY_ID_88E1101 0x01410c60 +#define MARVELL_PHY_ID_88E1112 0x01410c90 +#define MARVELL_PHY_ID_88E1111 0x01410cc0 +#define MARVELL_PHY_ID_88E1118 0x01410e10 +#define MARVELL_PHY_ID_88E1121R 0x01410cb0 +#define MARVELL_PHY_ID_88E1145 0x01410cd0 +#define MARVELL_PHY_ID_88E1149R 0x01410e50 +#define MARVELL_PHY_ID_88E1240 0x01410e30 +#define MARVELL_PHY_ID_88E1318S 0x01410e90 +#define MARVELL_PHY_ID_88E1340S 0x01410dc0 +#define MARVELL_PHY_ID_88E1116R 0x01410e40 +#define MARVELL_PHY_ID_88E1510 0x01410dd0 +#define MARVELL_PHY_ID_88E1540 0x01410eb0 +#define MARVELL_PHY_ID_88E1545 0x01410ea0 +#define MARVELL_PHY_ID_88E1548P 0x01410ec0 +#define MARVELL_PHY_ID_88E3016 0x01410e60 +#define MARVELL_PHY_ID_88X3310 0x002b09a0 +#define MARVELL_PHY_ID_88E2110 0x002b09b0 +#define MARVELL_PHY_ID_88X2222 0x01410f10 + +/* Marvel 88E1111 in Finisar SFP module with modified PHY ID */ +#define MARVELL_PHY_ID_88E1111_FINISAR 0x01ff0cc0 + +/* These Ethernet switch families contain embedded PHYs, but they do + * not have a model ID. So the switch driver traps reads to the ID2 + * register and returns the switch family ID + */ +#define MARVELL_PHY_ID_88E6341_FAMILY 0x01410f41 +#define MARVELL_PHY_ID_88E6390_FAMILY 0x01410f90 +#define MARVELL_PHY_ID_88E6393_FAMILY 0x002b0b9b + +#define MARVELL_PHY_FAMILY_ID(id) ((id) >> 4) + +/* struct phy_device dev_flags definitions */ +#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 +#define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002 +#define MARVELL_PHY_LED0_LINK_LED1_ACTIVE 0x00000004 + +#endif /* _MARVELL_PHY_H */ -- cgit v1.2.3 From 87b7502824416d606d976f635a9a4eef4923ffee Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:08:07 +0100 Subject: net: phy: Add phy_modify_mmd() and phy_modify_mmd_changed() from Linux Add phy_modify_mmd()/phy_modify_mmd_changed() from Linux 5.1.y as of commit b8554d4f7288f ("net: phy: add register modifying helpers returning 1 on change") This is used by the upcoming Marvell 10G PHY driver. Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried --- include/phy.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 4a9de461152..34675b2c9c0 100644 --- a/include/phy.h +++ b/include/phy.h @@ -289,6 +289,10 @@ int phy_read_mmd(struct phy_device *phydev, int devad, int regnum); int phy_write_mmd(struct phy_device *phydev, int devad, int regnum, u16 val); int phy_set_bits_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val); int phy_clear_bits_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val); +int phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum, + u16 mask, u16 set); +int phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum, + u16 mask, u16 set); int phy_startup(struct phy_device *phydev); int phy_config(struct phy_device *phydev); -- cgit v1.2.3 From 1f614d524617f6f6e2383e3e490729d9fe929235 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:08:08 +0100 Subject: net: phy: Add phy_read_mmd_poll_timeout() from Linux Add phy_read_mmd_poll_timeout() from Linux 5.7.y as of commit bd971ff0b7392 ("net: phy: introduce phy_read_mmd_poll_timeout macro") This is used by the upcoming Marvell 10G PHY driver. Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried --- include/phy.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'include') diff --git a/include/phy.h b/include/phy.h index 34675b2c9c0..a837fed7235 100644 --- a/include/phy.h +++ b/include/phy.h @@ -282,6 +282,37 @@ static inline ofnode phy_get_ofnode(struct phy_device *phydev) return dev_ofnode(phydev->dev); } +/** + * phy_read_mmd_poll_timeout - Periodically poll a PHY register until a + * condition is met or a timeout occurs + * + * @phydev: The phy_device struct + * @devaddr: The MMD to read from + * @regnum: The register on the MMD to read + * @val: Variable to read the register into + * @cond: Break condition (usually involving @val) + * @sleep_us: Maximum time to sleep between reads in us (0 + * tight-loops). Should be less than ~20ms since usleep_range + * is used (see Documentation/timers/timers-howto.rst). + * @timeout_us: Timeout in us, 0 means never timeout + * @sleep_before_read: if it is true, sleep @sleep_us before read. + * Returns 0 on success and -ETIMEDOUT upon a timeout. In either + * case, the last read value at @args is stored in @val. Must not + * be called from atomic context if sleep_us or timeout_us are used. + */ +#define phy_read_mmd_poll_timeout(phydev, devaddr, regnum, val, cond, \ + sleep_us, timeout_us, sleep_before_read) \ +({ \ + int __ret = read_poll_timeout(phy_read_mmd, val, (cond) || val < 0, \ + sleep_us, timeout_us, \ + phydev, devaddr, regnum); \ + if (val < 0) \ + __ret = val; \ + if (__ret) \ + dev_err(phydev->dev, "%s failed: %d\n", __func__, __ret); \ + __ret; \ +}) + int phy_read(struct phy_device *phydev, int devad, int regnum); int phy_write(struct phy_device *phydev, int devad, int regnum, u16 val); void phy_mmd_start_indirect(struct phy_device *phydev, int devad, int regnum); -- cgit v1.2.3 From 9e53d5f5803e0c8a7a26aea4f8aaf6e959b515eb Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:08:09 +0100 Subject: net: phy: Add MDIO PCS 2.5G and 5G speed macros from Linux Add MDIO PCS 2.5G and 5G speed macros from Linux 5.1.y as of commit 7fd8afa8933a0 ("net: phy: Add generic support for 2.5GBaseT and 5GBaseT") This is used by the upcoming Marvell 10G PHY driver. Signed-off-by: Marek Vasut Reviewed-by: Ramon Fried --- include/linux/mdio.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include') diff --git a/include/linux/mdio.h b/include/linux/mdio.h index 6e821d906fb..b7c845155e4 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h @@ -44,6 +44,7 @@ #define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */ #define MDIO_AN_LPA 19 /* AN LP abilities (base page) */ #define MDIO_PCS_EEE_ABLE 20 /* EEE Capability register */ +#define MDIO_PMA_NG_EXTABLE 21 /* 2.5G/5G PMA/PMD extended ability */ #define MDIO_PCS_EEE_WK_ERR 22 /* EEE wake error counter */ #define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */ #define MDIO_AN_EEE_ADV 60 /* EEE advertisement */ @@ -91,6 +92,10 @@ #define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00) /* 10PASS-TS/2BASE-TL */ #define MDIO_CTRL1_SPEED10P2B (MDIO_CTRL1_SPEEDSELEXT | 0x04) +/* 2.5 Gb/s */ +#define MDIO_CTRL1_SPEED2_5G (MDIO_CTRL1_SPEEDSELEXT | 0x18) +/* 5 Gb/s */ +#define MDIO_CTRL1_SPEED5G (MDIO_CTRL1_SPEEDSELEXT | 0x1c) /* Status register 1. */ #define MDIO_STAT1_LPOWERABLE 0x0002 /* Low-power ability */ @@ -111,6 +116,8 @@ #define MDIO_PMA_SPEED_100 0x0020 /* 100M capable */ #define MDIO_PMA_SPEED_10 0x0040 /* 10M capable */ #define MDIO_PCS_SPEED_10P2B 0x0002 /* 10PASS-TS/2BASE-TL capable */ +#define MDIO_PCS_SPEED_2_5G 0x0040 /* 2.5G capable */ +#define MDIO_PCS_SPEED_5G 0x0080 /* 5G capable */ /* Device present registers. */ #define MDIO_DEVS_PRESENT(devad) (1 << (devad)) @@ -150,6 +157,8 @@ #define MDIO_PMA_CTRL2_1000BKX 0x000d /* 1000BASE-KX type */ #define MDIO_PMA_CTRL2_100BTX 0x000e /* 100BASE-TX type */ #define MDIO_PMA_CTRL2_10BT 0x000f /* 10BASE-T type */ +#define MDIO_PMA_CTRL2_2_5GBT 0x0030 /* 2.5GBaseT type */ +#define MDIO_PMA_CTRL2_5GBT 0x0031 /* 5GBaseT type */ #define MDIO_PCS_CTRL2_TYPE 0x0003 /* PCS type selection */ #define MDIO_PCS_CTRL2_10GBR 0x0000 /* 10GBASE-R type */ #define MDIO_PCS_CTRL2_10GBX 0x0001 /* 10GBASE-X type */ @@ -203,6 +212,7 @@ #define MDIO_PMA_EXTABLE_1000BKX 0x0040 /* 1000BASE-KX ability */ #define MDIO_PMA_EXTABLE_100BTX 0x0080 /* 100BASE-TX ability */ #define MDIO_PMA_EXTABLE_10BT 0x0100 /* 10BASE-T ability */ +#define MDIO_PMA_EXTABLE_NBT 0x4000 /* 2.5/5GBASE-T ability */ /* PHY XGXS lane state register. */ #define MDIO_PHYXS_LNSTAT_SYNC0 0x0001 @@ -239,9 +249,13 @@ #define MDIO_PCS_10GBRT_STAT2_BER 0x3f00 /* AN 10GBASE-T control register. */ +#define MDIO_AN_10GBT_CTRL_ADV2_5G 0x0080 /* Advertise 2.5GBASE-T */ +#define MDIO_AN_10GBT_CTRL_ADV5G 0x0100 /* Advertise 5GBASE-T */ #define MDIO_AN_10GBT_CTRL_ADV10G 0x1000 /* Advertise 10GBASE-T */ /* AN 10GBASE-T status register. */ +#define MDIO_AN_10GBT_STAT_LP2_5G 0x0020 /* LP is 2.5GBT capable */ +#define MDIO_AN_10GBT_STAT_LP5G 0x0040 /* LP is 5GBT capable */ #define MDIO_AN_10GBT_STAT_LPTRR 0x0200 /* LP training reset req. */ #define MDIO_AN_10GBT_STAT_LPLTABLE 0x0400 /* LP loop timing ability */ #define MDIO_AN_10GBT_STAT_LP10G 0x0800 /* LP is 10GBT capable */ @@ -270,6 +284,10 @@ #define MDIO_EEE_10GKX4 0x0020 /* 10G KX4 EEE cap */ #define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */ +/* 2.5G/5G Extended abilities register. */ +#define MDIO_PMA_NG_EXTABLE_2_5GBT 0x0001 /* 2.5GBASET ability */ +#define MDIO_PMA_NG_EXTABLE_5GBT 0x0002 /* 5GBASET ability */ + /* LASI RX_ALARM control/status registers. */ #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ #define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */ -- cgit v1.2.3 From ab9b8129897cb557eb224445427f776749339ac2 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:09:40 +0100 Subject: phy: Add empty generic_phy_configure() implementation for PHY disabled case In case PHY is not enabled, the generic_phy_configure() implementation is missing. Add an empty one so that the list of empty functions is complete. Fixes: f8da8a82c57 ("generic-phy: add configure op") Signed-off-by: Marek Vasut Reviewed-by: Patrice Chotard --- include/generic-phy.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/generic-phy.h b/include/generic-phy.h index f8eddeff67a..fa5f6fa3636 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -389,6 +389,11 @@ static inline int generic_phy_power_off(struct phy *phy) return 0; } +static inline int generic_phy_configure(struct phy *phy, void *params) +{ + return 0; +} + static inline int generic_phy_get_by_index(struct udevice *user, int index, struct phy *phy) { -- cgit v1.2.3 From 12a8efbcdd6240e0f0a1e99b744eaed9ba6fba22 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:09:41 +0100 Subject: phy: Fix kerneldoc alignment Insert missing space in front of asterisk to avoid checkpatch warning. Replace 'beeing' with 'being' as well, to fix another checkpatch warning. Signed-off-by: Marek Vasut Reviewed-by: Patrice Chotard --- include/generic-phy.h | 108 +++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) (limited to 'include') diff --git a/include/generic-phy.h b/include/generic-phy.h index fa5f6fa3636..8dca21b1283 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -69,72 +69,72 @@ struct phy_ops { int (*init)(struct phy *phy); /** - * exit - de-initialize the PHY device - * - * Hardware de-intialization should be done here. Every step done in - * init() should be undone here. - * This could be used to suspend the phy to reduce power consumption or - * to put the phy in a known condition before booting the OS (though it - * is NOT called automatically before booting the OS) - * If power_off() is not implemented, it must power down the phy. - * - * @phy: PHY port to be de-initialized - * Return: 0 if OK, or a negative error code - */ + * exit - de-initialize the PHY device + * + * Hardware de-intialization should be done here. Every step done in + * init() should be undone here. + * This could be used to suspend the phy to reduce power consumption or + * to put the phy in a known condition before booting the OS (though it + * is NOT called automatically before booting the OS) + * If power_off() is not implemented, it must power down the phy. + * + * @phy: PHY port to be de-initialized + * Return: 0 if OK, or a negative error code + */ int (*exit)(struct phy *phy); /** - * reset - resets a PHY device without shutting down - * - * @phy: PHY port to be reset - * - * During runtime, the PHY may need to be reset in order to - * re-establish connection etc without being shut down or exit. - * - * Return: 0 if OK, or a negative error code - */ + * reset - resets a PHY device without shutting down + * + * @phy: PHY port to be reset + * + * During runtime, the PHY may need to be reset in order to + * re-establish connection etc without being shut down or exit. + * + * Return: 0 if OK, or a negative error code + */ int (*reset)(struct phy *phy); /** - * power_on - power on a PHY device - * - * @phy: PHY port to be powered on - * - * During runtime, the PHY may need to be powered on or off several - * times. This function is used to power on the PHY. It relies on the - * setup done in init(). If init() is not implemented, it must take care - * of setting up the context (PLLs, ...) - * - * Return: 0 if OK, or a negative error code - */ + * power_on - power on a PHY device + * + * @phy: PHY port to be powered on + * + * During runtime, the PHY may need to be powered on or off several + * times. This function is used to power on the PHY. It relies on the + * setup done in init(). If init() is not implemented, it must take care + * of setting up the context (PLLs, ...) + * + * Return: 0 if OK, or a negative error code + */ int (*power_on)(struct phy *phy); /** - * power_off - power off a PHY device - * - * @phy: PHY port to be powered off - * - * During runtime, the PHY may need to be powered on or off several - * times. This function is used to power off the PHY. Except if - * init()/deinit() are not implemented, it must not de-initialize - * everything. - * - * Return: 0 if OK, or a negative error code - */ + * power_off - power off a PHY device + * + * @phy: PHY port to be powered off + * + * During runtime, the PHY may need to be powered on or off several + * times. This function is used to power off the PHY. Except if + * init()/deinit() are not implemented, it must not de-initialize + * everything. + * + * Return: 0 if OK, or a negative error code + */ int (*power_off)(struct phy *phy); /** - * configure - configure a PHY device - * - * @phy: PHY port to be configured - * @params: PHY Parameters, underlying data is specific to the PHY function - * - * During runtime, the PHY may need to be configured for it's main function. - * This function configures the PHY for it's main function following - * power_on/off() after beeing initialized. - * - * Return: 0 if OK, or a negative error code - */ + * configure - configure a PHY device + * + * @phy: PHY port to be configured + * @params: PHY Parameters, underlying data is specific to the PHY function + * + * During runtime, the PHY may need to be configured for it's main function. + * This function configures the PHY for it's main function following + * power_on/off() after being initialized. + * + * Return: 0 if OK, or a negative error code + */ int (*configure)(struct phy *phy, void *params); }; -- cgit v1.2.3 From b0177a24d48e4ce13bfd7fce0d9c17dc0996f9a5 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:09:42 +0100 Subject: phy: Add .set_mode and .set_speed callbacks Add two new callbacks matching the Linux ones. The .set_mode is used to set PHY mode and submode, where mode is either USB, Ethernet, and so on, while submode is e.g. for Ethernet case RGMII, RMII, and so on. The .set_speed is used to configure link speed into the PHY. Unlike the existing configure callback, which is used to pass arbitrary custom information to the PHY, these two callbacks are used to pass standardized set of information to the PHY. Signed-off-by: Marek Vasut Reviewed-by: Patrice Chotard --- include/generic-phy.h | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) (limited to 'include') diff --git a/include/generic-phy.h b/include/generic-phy.h index 8dca21b1283..bee4de8a0ba 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -11,6 +11,29 @@ struct ofnode_phandle_args; +enum phy_mode { + PHY_MODE_INVALID, + PHY_MODE_USB_HOST, + PHY_MODE_USB_HOST_LS, + PHY_MODE_USB_HOST_FS, + PHY_MODE_USB_HOST_HS, + PHY_MODE_USB_HOST_SS, + PHY_MODE_USB_DEVICE, + PHY_MODE_USB_DEVICE_LS, + PHY_MODE_USB_DEVICE_FS, + PHY_MODE_USB_DEVICE_HS, + PHY_MODE_USB_DEVICE_SS, + PHY_MODE_USB_OTG, + PHY_MODE_UFS_HS_A, + PHY_MODE_UFS_HS_B, + PHY_MODE_PCIE, + PHY_MODE_ETHERNET, + PHY_MODE_MIPI_DPHY, + PHY_MODE_SATA, + PHY_MODE_LVDS, + PHY_MODE_DP +}; + /** * struct phy - A handle to (allowing control of) a single phy port. * @@ -136,6 +159,32 @@ struct phy_ops { * Return: 0 if OK, or a negative error code */ int (*configure)(struct phy *phy, void *params); + + /** + * set_mode - set PHY device mode + * + * @phy: PHY port to be configured + * @mode: PHY mode + * @submode: PHY submode + * + * Configure PHY mode (e.g. USB, Ethernet, ...) and submode + * (e.g. for Ethernet this can be RGMII). + * + * Return: 0 if OK, or a negative error code + */ + int (*set_mode)(struct phy *phy, enum phy_mode mode, int submode); + + /** + * set_speed - set PHY device speed + * + * @phy: PHY port to be configured + * @speed: PHY speed + * + * Configure PHY speed (e.g. for Ethernet, this could be 10 or 100 ...). + * + * Return: 0 if OK, or a negative error code + */ + int (*set_speed)(struct phy *phy, int speed); }; /** @@ -206,6 +255,24 @@ int generic_phy_power_off(struct phy *phy); */ int generic_phy_configure(struct phy *phy, void *params); +/** + * generic_phy_set_mode() - set PHY device mode + * + * @phy: PHY port to be configured + * @mode: PHY mode + * @submode: PHY submode + * Return: 0 if OK, or a negative error code + */ +int generic_phy_set_mode(struct phy *phy, enum phy_mode mode, int submode); + +/** + * generic_phy_set_speed() - set PHY device speed + * + * @phy: PHY port to be configured + * @speed: PHY speed + * Return: 0 if OK, or a negative error code + */ +int generic_phy_set_speed(struct phy *phy, int speed); /** * generic_phy_get_by_index() - Get a PHY device by integer index. @@ -394,6 +461,16 @@ static inline int generic_phy_configure(struct phy *phy, void *params) return 0; } +static inline int generic_phy_set_mode(struct phy *phy, enum phy_mode mode, int submode) +{ + return 0; +} + +static inline int generic_phy_set_speed(struct phy *phy, int speed) +{ + return 0; +} + static inline int generic_phy_get_by_index(struct udevice *user, int index, struct phy *phy) { -- cgit v1.2.3