aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/phy
AgeCommit message (Collapse)AuthorFilesLines
8 daysdrivers: net: Remove duplicate newlinesMarek Vasut6-8/+0
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-06-13net: phy: Replace PHY_ANEG_TIMEOUT with Kconfig symbolMarek Vasut2-3/+3
Switch PHY_ANEG_TIMEOUT to CONFIG_PHY_ANEG_TIMEOUT Kconfig symbol. This removes one more configuration headers option finalizes its Kconfig symbol conversion. No functional change expected. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-06-13net: phy: Turn default auto-negotiation timeout into Kconfig symbolMarek Vasut1-0/+6
Let users configure default auto-negotiation timeout via Kconfig instead of specifying it in board configuration headers. This is the first step toward converting this to Kconfig fully, so far the legacy PHY_ANEG_TIMEOUT in configuration headers takes precedence. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"WIP/20May2024-nextTom Rini35-35/+0
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini35-0/+35
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07net: Remove <common.h> and add needed includesTom Rini35-35/+0
Remove <common.h> from this driver directory and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-03-26net: phy: Factor out PHY GPIO reset codeMarek Vasut2-32/+60
Pull the PHY GPIO reset code into separate function, since this is and will be reused multiple times. Set up default reset assert and deassert timing to generous 20ms and 1ms for maximum compatibility in case those DT properties are missing. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-03-26net: phy: ncsi: reslove the unaligned access issueJacky Chou1-5/+5
From the ethernet header is not on aligned, because the length of the ethernet header is 14 bytes. Therefore, unaligned access must be done here. Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
2024-03-26net: phy: ncsi: Correct the endian of the checksumJacky Chou1-1/+1
There is no need to perform the endian twice here. Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
2024-03-26net: phy: the NC-SI phy device do not require mdio busJacky Chou1-1/+2
As with fixed-link phy device, the NC-SI phy devive does not require an mdio bus. So, a condition is added to check the NC-SI phy id to avoid accessing the bus pointer that is NULL. Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
2024-03-26net: phy: Fix signed shift overflowEugeniu Rosca1-2/+2
Booting R-Car Gen3 arm64 U-Boot with CONFIG_UBSAN=y resulted in: ===================================================================== UBSAN: Undefined behaviour in drivers/net/phy/phy.c:728:19 left shift of 1 by 31 places cannot be represented in type 'int' ===================================================================== Fix it by appending the UL suffix to the numeric literal. While at it, convert the type of "addr" variable from signed to unsigned, to protect against shifting the numeric literal by a negative value (which would lead to yet another undefined behavior). Fixes: 1adb406b0141 ("phy: add phy_find_by_mask/phy_connect_dev") Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> * Using U-suffix for integer is sufficient. * ffs() of non-zero value cannot be 0. But addr being unsigned is * preferable. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-03-26net: phy: broadcom: Configure LEDs on BCM54210EMarek Vasut1-1/+16
Configure LEDs on BCM54210E so they would blink on activity and indicate link speed. Without this the LEDs are always on if cable is plugged in. Signed-off-by: Marek Vasut <marex@denx.de>
2024-03-26net: phy: ncsi: fixed not nullify the pointers after freeJacky Chou1-1/+4
The issue occurs the UAF (use-after-free) to cause double free when do the realloc function for the pointers during the reinitialization NC-SI process, and it will cause the memory management occurs error. So, nullify these pointers after free. Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
2024-03-09net: phy: Use PHY MDIO address from DT if availableWIP/09Mar2024Marek Vasut1-0/+3
In case the PHY is fully described in DT, use PHY MDIO address from DT directly instead of always using auto-detection. This also fixes the behavior of 'mdio list' in such DT setup, which now prints the PHY connected to the MAC correctly. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2024-02-08net: phy: nxp-c45-tja11xx: add tja1120 supportRadu Pirea (NXP OSS)1-0/+14
Add TJA1120 driver structure and report 1G speed. Signed-off-by: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>
2024-02-08net: phy: nxp-c45-tja11xx: rename nxp_c45_tja11xx structureRadu Pirea (NXP OSS)1-1/+1
Rename nxp_c45_tja11xx structure to nxp_c45_tja1103. The driver will support more PHYs and nxp_c45_tja11xx is too generic. Signed-off-by: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>
2024-02-08net: phy: nxp-c45-tja11xx: read PHY the speed from hardwareRadu Pirea (NXP OSS)1-1/+21
Read PHY speed from hardware instead of assuming 100Mbps by default. The TJA1103 works only at 100Mbps, but the driver will support more PHYs. Signed-off-by: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>
2024-02-08net: phy: nxp-c45-tja11xx: use local definion of featuresRadu Pirea (NXP OSS)1-1/+4
Use a local definition for the PHY features. PHY_100BT1_FEATURES are not defined using the 100BaseT1 bit, so keep this workaround in the driver. Signed-off-by: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>
2024-01-31net: phy: motorcomm: configure pad drive strength registerLukasz Tekieli1-0/+130
This ports the pad drive strength register configuration which can be already found in the Linux driver for this PHY. Signed-off-by: Lukasz Tekieli <tekieli.lukasz@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-12-13net: phy: realtek: Add support for RTL8211F(D)(I)-VD-CGSébastien Szymanski1-0/+14
Add support for the RTL8211F(D)(I)-VD-CG PHY present on the i.MX93 EVK board. Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
2023-11-10tree-wide: Replace http:// link with https:// link for ti.comNishanth Menon1-1/+1
Replace instances of http://www.ti.com with https://www.ti.com Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-05net: phy: TI DP83869 fix invalid clock delay configurationFrank de Brabander1-21/+32
Setting the clock delay from the device tree settings rx-internal-delay-ps and tx-internal-delay-ps was broken: - The expected value in the device tree is suppose to be a delay in picoseconds, but the driver only allowed an array index. - Driver converted this array index to the actual delay in picoseconds and tried to apply this in the device register. This however is not a valid register value. The actual logic here was reversed, it converted an register representation of the delay to the device tree delay in picoseconds. Only when the internal delays were NOT configured in the device tree and they default value of 7 (=2000ps) was used, a valid value was loaded in the register. Signed-off-by: Frank de Brabander <debrabander@gmail.com>
2023-10-10net: phy: xilinx_phy: Get rid of using property xlnx, phy-typeVenkatesh Yadav Abbarapu1-5/+0
As the xlnx,phy-type device tree property is deprecated and phy-mode is being used, so removing the code references of xlnx,phy-type. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20231010030436.11854-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-09-24common: Drop linux/printk.h from common headerSimon Glass2-0/+2
This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-21net: phy: xilinx-gmii2rgmii: Removed hardcoded phy address 0 for bridgeTejas Bhumkar1-1/+4
Current code expects bridge phy address at 0 which is not correct expectation because bridge phy address is configurable. That's why update the code to read reg property to figure it out where bridge is and use it in phy creation code. Signed-off-by: Tejas Bhumkar <tejas.arvind.bhumkar@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/20230915045043.4167628-1-tejas.arvind.bhumkar@amd.com
2023-09-14net: phy: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut1-31/+0
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14net: miiphybb: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut1-18/+2
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-13net: phy: broadcom: add support for BCM54210EMarek Vasut1-1/+100
It's Broadcom PHY simply described as single-port RGMII 10/100/1000BASE-T PHY. It requires disabling delay skew and GTXCLK bits. BCM54210E support ported from Linux kernel commit 0fc9ae1076697 ("net: phy: broadcom: add support for BCM54210E") AUX/SHD/bcm54xx_config_clock_delay update ported from Linux 6.5-rc4 commit 28e219aea0b9e ("net: phy: broadcom: drop brcm_phy_setbits() and use phy_set_bits() instead") Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Rafał Miłecki <rafal@milecki.pl>
2023-09-13net: phy: motorcomm: Add support for YT8511 PHYNicolas Frattaroli2-1/+89
The YT8511 ethernet PHYs can be found on e.g. the SOQuartz or the Quartz64. Add rudimentary support for them. Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
2023-07-27phy: adin: add readext and writeext support for mdio cmdNate Drude1-0/+14
The adin phy has extended registers that can be accessed using adin_ext_read and adin_ext_write. These registers can be read directly using the mdio command using readext and writext. For example: => mdio rx ethernet@428a0000 0xff23 Reading from bus ethernet@428a0000 PHY at address 0: 65315 - 0xe01 Signed-off-by: Nate Drude <nate.d@variscite.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-07-12net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phyYanhong Wang3-0/+444
Add a driver for the motorcomm yt8531 gigabit ethernet phy. We have verified the driver on StarFive VisionFive2 board. Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-06-10net: phy: Bind ETH_PHY uclass driver to each new PHYMarek Vasut1-0/+17
In case a new PHY is created and DM_ETH_PHY is enabled, bind a generic PHY driver from ETH_PHY uclass to the PHY to have a matching DM representation of that PHY. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-06-10net: phy: Unpublish phy_connect_dev()Marek Vasut1-2/+2
The phy_connect_dev() is legacy API, now that there are no users, make it internal to phy.c and unpublish it from headers. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-05-05net: phy: Request rgmii-id phy reset gpio as outputStefan Herbrechtsmeier1-1/+1
Request the reset gpio of the rgmii-id phy as output to be consistent with the eth-phy-uclass driver. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Michal Simek <michal.simek@amd.com>
2023-05-05net: phy: dp83867: Explicitly check against sgmiiNishanth Menon1-1/+1
dp83867 driver only supports sgmii and not all the newer protocols. Drop the usage of the generic phy_interface_is_sgmii function and just matchup to the specific mode supported. Reported-by: Tom Rini <trini@konsulko.com> Suggested-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Suggested-by: Marek Behún <kabel@kernel.org> Link: https://lore.kernel.org/all/b82ac325-4818-8e72-054b-640268dbf806@mailbox.org/ Signed-off-by: Nishanth Menon <nm@ti.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-05-05phy: realtek: don't duplicate genphy_startupRasmus Villemoes1-13/+2
rtl8211e_startup() is an exact copy of genphy_startup(). Use that instead of duplicating it. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2023-05-05phy: broadcom: don't duplicate genphy_startupRasmus Villemoes1-13/+1
Functionally, bcm_cygnus_startup() is an exact copy of genphy_startup(). Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2023-05-05net: phy: gmii2rgmii: Support external rgmii-id phyStefan Herbrechtsmeier1-1/+8
Read the phy mode of the external phy from the device tree if available and check that it is a RGMII variant. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2023-04-07net: phy: marvell10g: Adapt Marvell 10G PHY driver from LinuxMarek Vasut3-0/+611
Pull Marvell 10G PHY driver from Linux 6.1.y as of commit d6d29292640d3 ("net: phy: marvell10g: select host interface configuration") and heavily adapt to match U-Boot PHY framework. Support for hwmon is removed as is much other functionality which could not be tested, this results in much simpler driver which can only bring the PHY up and set MAC type. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-04-07net: phy: Add phy_modify_mmd() and phy_modify_mmd_changed() from LinuxMarek Vasut1-0/+54
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 <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-04-07net: phy: marvell: Import and use marvell_phy.h from LinuxMarek Vasut1-22/+23
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 <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-04-07net: phy: Synchronize PHY interface modes with LinuxMarek Vasut1-0/+4
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 <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-04-07net: phy: Only call phy_init() on systems needing manual relocationMarek Vasut1-2/+2
The phy_init() is now used only to perform manual relocation of PHY driver callbacks. Wrap it in ifdeffery and only call it on systems which still require manual relocation, i.e. m68k . Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Acked-by: Michal Simek <michal.simek@amd.com> Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
2023-04-07net: phy: Re-inline phy_drv_reloc()Marek Vasut1-24/+18
Wrap phy_drv_reloc() back into phy_init() to reduce ifdeffery, since phy_drv_reloc() is now called only from one call site. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Acked-by: Michal Simek <michal.simek@amd.com> Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
2023-04-07net: phy: Drop unused phy_register()Marek Vasut1-8/+0
This function is no longer used, drop it. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Acked-by: Michal Simek <michal.simek@amd.com> Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
2023-04-07net: phy: Drop static phy_drivers listMarek Vasut1-24/+2
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 <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Acked-by: Michal Simek <michal.simek@amd.com> Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
2023-04-07net: phy: gen10g: Convert to U_BOOT_PHY_DRIVER()Marek Vasut2-2/+2
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 <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Acked-by: Michal Simek <michal.simek@amd.com> Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
2023-04-07net: phy: genphy: Convert to U_BOOT_PHY_DRIVER()Marek Vasut1-9/+2
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 <marek.vasut+renesas@mailbox.org> Acked-by: Michal Simek <michal.simek@amd.com> Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
2023-04-07net: phy: xilinx-gmii2rgmii: Convert to U_BOOT_PHY_DRIVER()Marek Vasut2-11/+1
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 <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Acked-by: Michal Simek <michal.simek@amd.com> Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
2023-04-07net: phy: ncsi: Convert to U_BOOT_PHY_DRIVER()Marek Vasut2-10/+1
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 <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Acked-by: Michal Simek <michal.simek@amd.com> Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)