diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2022-08-08 21:46:03 +0930 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-10-21 16:04:39 -0400 |
commit | 09bd3d0b0a954f250bac61fee7e3c6d037914569 (patch) | |
tree | 4f85b9e67aa28ad4505b3cd0a6191a1dcc29281d /drivers/net/phy | |
parent | 7723828c97bc107d2fba976fc50403ac8747f1bc (diff) | |
download | u-boot-09bd3d0b0a954f250bac61fee7e3c6d037914569.zip u-boot-09bd3d0b0a954f250bac61fee7e3c6d037914569.tar.gz u-boot-09bd3d0b0a954f250bac61fee7e3c6d037914569.tar.bz2 |
net: NC-SI setup and handling
Add the handling of NC-SI ethernet frames, and add a check at the start
of net_loop() to configure NC-SI before starting other network commands.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/ncsi.c | 1 | ||||
-rw-r--r-- | drivers/net/phy/phy.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/phy/ncsi.c b/drivers/net/phy/ncsi.c index bf1e832..bb7eceb 100644 --- a/drivers/net/phy/ncsi.c +++ b/drivers/net/phy/ncsi.c @@ -9,6 +9,7 @@ #include <log.h> #include <malloc.h> #include <phy.h> +#include <net.h> #include <net/ncsi.h> #include <net/ncsi-pkt.h> #include <asm/unaligned.h> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 0350afd..9087663 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1026,7 +1026,7 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr, #endif #ifdef CONFIG_PHY_NCSI - if (!phydev) + if (!phydev && interface == PHY_INTERFACE_MODE_NCSI) phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false); #endif @@ -1275,3 +1275,10 @@ int phy_clear_bits_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val return 0; } + +bool phy_interface_is_ncsi(void) +{ + struct eth_pdata *pdata = dev_get_plat(eth_get_dev()); + + return pdata->phy_interface == PHY_INTERFACE_MODE_NCSI; +} |