Skip to content

Commit

Permalink
drivers: phy: add adin2111
Browse files Browse the repository at this point in the history
Adds PHY driver. Works via MDIO API and
exposed ADIN2111 MDIO Clause 45
functions.

Link status detection is triggered by
ADIN2111 driver within offloaded IRQ
handler.

Supports:
  - LED0, LED1 enable/disable
  - Fatal HW error detection
  - AN 2.4V tx mode enable/disable

The initialization order is important.
PHY 2 must be initialized after PHY1.
Therefore, it shall be defined after the 1st one
in the devicetree.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
  • Loading branch information
GeorgeCGV committed May 15, 2023
1 parent dc2112f commit bee76c1
Show file tree
Hide file tree
Showing 6 changed files with 578 additions and 2 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
/drivers/ethernet/*smsc91x* @sgrrzhf
/drivers/ethernet/*adin2111* @GeorgeCGV
/drivers/ethernet/phy/ @rlubos @tbursztyka @arvinf
/drivers/ethernet/phy/*adin2111* @GeorgeCGV
/drivers/mdio/ @rlubos @tbursztyka @arvinf
/drivers/mdio/*adin2111* @GeorgeCGV
/drivers/flash/ @nashif @de-nordic
Expand Down
3 changes: 2 additions & 1 deletion drivers/ethernet/phy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library_sources_ifdef(CONFIG_PHY_GENERIC_MII phy_mii.c)
zephyr_library_sources_ifdef(CONFIG_PHY_GENERIC_MII phy_mii.c)
zephyr_library_sources_ifdef(CONFIG_PHY_ADIN2111 phy_adin2111.c)
11 changes: 10 additions & 1 deletion drivers/ethernet/phy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,21 @@ config PHY_INIT_PRIORITY

config PHY_GENERIC_MII
bool "Generic MII PHY Driver"
default y
default y if !ETH_ADIN2111
depends on MDIO
help
This is a generic MII PHY interface that communicates with the
PHY using the MDIO bus.

config PHY_ADIN2111
bool "ADIN2111 PHY driver"
default y
depends on DT_HAS_ADI_ADIN2111_PHY_ENABLED
depends on ETH_ADIN2111
depends on MDIO_ADIN2111
help
Enable ADIN2111 PHY driver.

config PHY_AUTONEG_TIMEOUT_MS
int "Auto-negotiation timeout value in milliseconds"
default 4000
Expand Down
Loading

0 comments on commit bee76c1

Please sign in to comment.