aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)AuthorFilesLines
2022-04-13net: dm9000: Make RxLen and RxStatus lowercaseMarek Vasut1-22/+22
Rename variables to lowercase to be consistent with coding style. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Replace DM9000_DBG() with debug()Marek Vasut1-25/+23
Use standard debug() macro to print debug messages instead of reinventing driver-specific macro again. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13net: dm9000: Make accessor names lowercaseMarek Vasut1-107/+107
Make accessor names lowercase to be consistent with coding style. No functional change. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com>
2022-04-13driver: net: ti: keystone_net: Change priv member typeMarek Behún1-3/+3
Change type of private struct member mdio_base from void * to phys_addr_t. This allows us to drop 2 casts. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-13driver: net: ti: keystone_net: Convert to ofnode functionsMarek Behún1-65/+48
Convert fdt parsing functions to ofnode parsing functions. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-13driver: net: ti: keystone_net: Deduplicate codeMarek Behún1-41/+34
Deduplicate common code in ks2_eth_bind_slaves(). Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-12net: phy: nxp-tja11xx: Add NXP TJA11xx PHY driverMichael Trimarchi4-0/+286
Add driver for the NXP TJA1100 and TJA1101 PHYs. These PHYs are special BroadRReach 100BaseT1 PHYs used in automotive. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-12net: phy: Add phy_modify() accessorAriel D'Alessandro1-0/+20
Add read-modify-write unlocked accessor for accessing a PHY register. Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-12phy: nxp-c45-tja11xx: Rename functions to be c45 tja11xx specificAriel D'Alessandro2-4/+4
This driver supports NXP C45 TJA11XX PHYs, but there're also other NXP TJA11XX PHYs. Let's rename functions in this driver to be c45 variant specific, so further drivers can be introduced adding support for NXP TJA11XX PHYs. Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
2022-04-12ARM: dts: net: dwc_eth_qos: Fix i.MX8MP compatible stringMarek Vasut1-1/+1
The correct compatible string for i.MX8MP variant of DWC EQoS MAC is "nxp,imx8mp-dwmac-eqos", use it. Drop the two current users of the current wrong compatible string to avoid breaking them. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@denx.de> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Reviewed-by: Fabio Estevam <festevam@denx.de> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10phy: adin: add driver for Analog Devices ADIN1300 PHYNate Drude4-0/+237
The current implementation configures RGMII using device tree phy-mode property and then calls genphy_config adin_config_rgmii_mode is derived from: https://github.com/varigit/linux-imx/blob/lf-5.10.y_var04/drivers/net/phy/adin.c#L218-L262 Signed-off-by: Nate Drude <nate.d@variscite.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10net: eth-phy: prevent undesired de-assertion of phy-reset on requestTim Harvey1-1/+1
When gpio_request_by_name allocates a gpio output it by default will de-assert the gpio which for phy-reset will take the PHY out of reset. As this occurs before eth_phy_reset is called to assert the reset line it can cause undesired affects if reset timings are not properly met. Configure the gpio with GPIOD_IS_OUT_ACTIVE so that reset is kept active (reset asserted) to avoid this. Cc: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10net: fec: prevent undesired de-assertion of phy-reset on requestTim Harvey1-1/+1
When gpio_request_by_name allocates a gpio output it by default will de-assert the gpio which for phy-reset will take the PHY out of reset. As this occurs before fec_gpio_reset is called to assert the reset line it can cause undesired affects if reset timings are not properly met. Configure the gpio with GPIOD_IS_OUT_ACTIVE so that reset is kept active (reset asserted) to avoid this. Cc: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Tested-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10net: phy: don't require PHY interface mode during PHY creationMarek Behún10-71/+55
Currently we require PHY interface mode to be known when finding/creating the PHY - the functions * phy_connect_phy_id() * phy_device_create() * create_phy_by_mask() * search_for_existing_phy() * get_phy_device_by_mask() * phy_find_by_mask() all require the interface parameter, but the only thing done with it is that it is assigned to phydev->interface. This makes it impossible to find a PHY device without overwriting the set mode. Since the interface mode is not used during .probe() and should be used at first in .config(), drop the interface parameter from these functions. Make the default value of phydev->interface (in phy_device_create()) to be PHY_INTERFACE_MODE_NA. Move the interface parameter to phy_connect_dev(), where it should be. Change all occurrences treewide. In occurrences where we don't call phy_connect_dev() for some reason (they only configure the PHY without connecting it to an ethernet controller), set phydev->interface = value from phy_find_by_mask call. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2022-04-10bcmgenet, sun8i_emac: Don't connect PHY two timesMarek Behún2-4/+0
The bcmgenet and sun8i_emac drivers call phy_connect(), which finds / creates the PHY and also connects it to the eth device via phy_connect_dev(), then set some phydev members (bcmgenet only), and then call phy_connect_dev() explicitly again. Drop the second phy_connect_dev(), since it is unnecesary. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10net: phy: use ->is_c45 instead of is_10g_interface()Marek Behún1-4/+4
Use phydev->is_c45 instead of is_10g_interface(phydev->interface) to determine whether clause 45 protocol should be used. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10net: phy: xilinx: Check interface type in ->config(), not ->probe()Marek Behún1-5/+5
We want to be able to have phydev->interface uninitialized during ->probe(). We should assume that phydev->interface is initialized only before ->config(). Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10treewide: Rename PHY_INTERFACE_MODE_NONE to PHY_INTERFACE_MODE_NAMarek Behún51-88/+88
Rename constant PHY_INTERFACE_MODE_NONE to PHY_INTERFACE_MODE_NA to make it compatible with Linux' naming. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2022-04-10treewide: Rename PHY_INTERFACE_MODE_COUNT to PHY_INTERFACE_MODE_MAXMarek Behún1-1/+1
Rename constant PHY_INTERFACE_MODE_COUNT to PHY_INTERFACE_MODE_MAX to make it compatible with Linux' naming. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2022-04-10net: introduce helpers to get PHY interface mode from a device/ofnodeMarek Behún32-339/+97
Add helpers ofnode_read_phy_mode() and dev_read_phy_mode() to parse the "phy-mode" / "phy-connection-type" property. Add corresponding UT test. Use them treewide. This allows us to inline the phy_get_interface_by_name() into ofnode_read_phy_mode(), since the former is not used anymore. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-04-10net: phy: fix parsing wrong propertyMarek Behún1-1/+1
The "phy-interface-type" property should be "phy-connection-type". Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2022-04-10treewide: use dm_mdio_read/write/reset() wrappersMarek Behún1-4/+2
Use the new dm_mdio_read/write/reset() wrappers treewide, instead of always getting and dereferencing MDIO operations structure pointer. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2022-04-10net: phy: dp83867: Fix a never true comparisonHaolin Li1-2/+5
The type of the return value of phy_read() and phy_read_mmd() is int. Change the variable to not be unsigned so that we not get into an unsigned compared against 0. Signed-off-by: Haolin Li <li.haolin@qq.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10net: phy: atheros: avoid error in ar803x_of_init() when PHY has no OF nodeVladimir Oltean1-1/+1
A DM_ETH driver may use phy_connect() towards a PHY address on an MDIO bus which is not specified in the device tree, as evidenced by: pfe_eth_probe -> pfe_phy_configure -> phy_connect When this happens, the PHY will have an invalid OF node. When ar803x_config() runs, it silently fails at ar803x_of_init(), and therefore, fails to run the rest of the initialization. This makes MII_BMCR contain what it had after BMCR_RESET (0x8000) has been written into it by phy_reset(). Since BMCR_RESET is volatile and self-clearing, the MII_BMCR ends up having a value of 0x0. The further configuration of this register, which is supposed to be handled by genphy_config_aneg() lower in ar803x_config(), never gets a chance to run due to this early error from ar803x_of_init(). As a result of having MII_BMCR as 0, the following symptom appears: => setenv ethact pfe_eth0 => setenv ipaddr 10.0.0.1 => ping 10.0.0.2 pfe_eth0 Waiting for PHY auto negotiation to complete......... TIMEOUT ! Could not initialize PHY pfe_eth0 Manually writing 0x1140 into register 0 of the PHY makes the connection work, but it is rather desirable that the port works without any manual intervention. Fixes: fe6293a80959 ("phy: atheros: add device tree bindings and config") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-10net: phy: dp83867: avoid error in dp83867_of_init() when PHY has no OF nodeVladimir Oltean1-1/+1
A DM_ETH driver may use phy_connect() towards a PHY address on an MDIO bus which is not specified in the device tree, as evidenced by: pfe_eth_probe -> pfe_phy_configure -> phy_connect When this happens, the PHY will have an invalid OF node. The dp83867_config() method has extra initialization steps which are bypassed when the PHY lacks an OF node, which is undesirable because it will lead to broken networking. Allow the rest of the code to run. Fixes: 085445ca4104 ("net: phy: ti: Allow the driver to be more configurable") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-04-08arm: Remove unused ep93xx codeTom Rini3-781/+0
There are no platforms for this architecture anymore, remove unused code. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-08net: Remove uli526x driverTom Rini2-997/+0
This driver is not enabled by any board and not converted to DM_ETH. Remove. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-08net: Remove ns8382x driverTom Rini2-855/+0
This driver is not enabled by any board and not converted to DM_ETH. Remove. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-08net: Remove natsemi driverTom Rini2-884/+0
This driver is not enabled by any board and not converted to DM_ETH. Remove. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-08net: Remove lan91c96 driverTom Rini3-1416/+0
This driver is not enabled by any board and not converted to DM_ETH. Remove. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-08net: Remove ftmac110 driverTom Rini3-667/+0
This driver is not enabled by any board and not converted to DM_ETH. Remove. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-08net: Remove dnet driverTom Rini3-562/+0
This driver is not enabled by any board and not converted to DM_ETH. Remove. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-08net: Remove cs8900 driverTom Rini3-569/+0
This driver is not enabled by any board and not converted to DM_ETH. Remove. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-08net: Remove ax88180 driverTom Rini3-1152/+0
This driver is not enabled by any board and not converted to DM_ETH. Remove. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-08net: Remove armada100_fec driverTom Rini3-948/+0
This driver is not enabled by any board and not converted to DM_ETH. Remove. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-05Merge tag 'xilinx-for-v2022.07-rc1-v2' of ↵WIP/05Apr2022Tom Rini3-35/+102
https://source.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2022.07-rc1 v2 xilinx: - Allow booting bigger kernels till 100MB zynqmp: - DT updates (reset IDs) - Remove unneeded low level uart initialization from psu_init* - Enable PWM features - Add support for 1EG device serial_zynq: - Change fifo behavior in DEBUG mode zynq_sdhci: - Fix BASECLK setting calculation clk_zynqmp: - Add support for showing video clock gpio: - Update slg driver to handle DT flags net: - Update ethernet_id code to support also DM_ETH_PHY - Add support for DM_ETH_PHY in gem driver - Enable dynamic mode for SGMII config in gem driver pwm: - Add driver for cadence PWM versal: - Add support for reserved memory firmware: - Handle PD enabling for SPL - Add support for IOUSLCR SGMII configurations include: - Sync phy.h with Linux - Update xilinx power domain dt binding headers
2022-04-05net: zynq_gem: Add SGMII dynamic config supportT Karthik Reddy1-0/+46
Add support for SGMII dynamic configuration which will takes care of configuring SGMII in the GEM secure (GEM_CLK_CTRL) configuration register. Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/a8915186e44015959978d080a31de652f544cd4a.1648631275.git.michal.simek@xilinx.com
2022-04-05net: zynq_gem: Move ethernet info print statementT Karthik Reddy1-4/+4
As we are not reading the PHY address in case of CONFIG_ETH_PHY in plat function, phy address always prints as -1. So move the ethernet info print statement to probe function, to display proper phy address. Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/f6efc6719d767b1bebe65987c22c6d52329f4225.1648631275.git.michal.simek@xilinx.com
2022-04-05net: phy: Avoid phy gpio reset sequence if DM_ETH_PHY is enabledT Karthik Reddy1-19/+26
If DM_ETH_PHY config is enabled PHY gpio reset is taken care by the eth-phy-uclass driver, so use the PHY gpio reset functionality from ethernet_id file when this config is disabled to reset the PHY. Use debug() print instead of dev_err() to avoid warning incase if phy-id compatible string is not present. Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/4d0fd3f9f886c1d943776025e5efb5438b0eb389.1648631275.git.michal.simek@xilinx.com
2022-04-05net: zynq_gem: Use shared MDIO bus support for zynqmpMichal Simek1-9/+23
CONFIG_ETH_PHY enables support to utilize generic ethernet phy framework. Though if ethernet PHY node is in other ethernet node, it will use shared MDIO to access the PHY of other ethernet. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Link: https://lore.kernel.org/r/337b1a38ba36cde1951739af62fb3d2736d97f53.1648631275.git.michal.simek@xilinx.com
2022-04-05net: phy: Fix rgmii-id phy reset timeout issueT Karthik Reddy2-3/+3
While creating a phy device using phy_device_create(), we need to provide a valid phyaddr instead of 0 causing phy address being registered as 0 with mdio bus and shows mdio phy list as below ZynqMP> mdio list eth0: 0 - TI DP83867 <--> ethernet@ff0b0000 eth1: 0 - TI DP83867 <--> ethernet@ff0c0000 Also PHY soft reset is being requested on 0 instead of valid address causing "PHY reset timed out" error. So add phyaddr argument to phy_connect_phy_id() and to its prototype to create phy device with valid phyaddress. Fixes: a744a284e354 ("net: phy: Add support for ethernet-phy-id with gpio reset") Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Link: https://lore.kernel.org/r/fe35fddb9faa5af577ffdfabaec6879c935a30f8.1648562755.git.michal.simek@xilinx.com
2022-04-05Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiTom Rini2-96/+1
A big part is the DM pinctrl driver, which allows us to get rid of quite some custom pinmux code and make the whole port much more robust. Many thanks to Samuel for that nice contribution! There are some more or less cosmetic warnings about missing clocks right now, I will send the trivial fixes for that later. Another big chunk is the mkimage upgrade, which adds RISC-V and TOC0 (secure images) support. Both features are unused at the moment, but I have an always-secure board that will use that once the DT lands in the kernel. On top of those big things we have some smaller fixes, improving the I2C DM support, fixing some H6/H616 early clock setup and improving the eMMC boot partition support. The gitlab CI completed successfully, including the build test for all 161 sunxi boards. I also boot tested on a A64, A20, H3, H6, and F1C100 board. USB, SD card, eMMC, and Ethernet all work there (where applicable).
2022-04-04net: sun8i_emac: Remove non-DM pin setupSamuel Holland1-90/+0
This is now handled automatically by the pinctrl driver. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-04-04net: sunxi_emac: Remove non-DM pin setupSamuel Holland1-6/+1
This is now handled automatically by the pinctrl driver. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-04-01Convert CONFIG_BITBANGMII_MULTI to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_BITBANGMII_MULTI Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-30net: bcm63xx: Don't check clk_freeSean Anderson2-10/+2
This function always succeeds, so don't check its return value. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220115222504.617013-4-seanga2@gmail.com
2022-03-25Convert CONFIG_MII_INIT to KconfigTom Rini1-3/+1
This converts the following to Kconfig: CONFIG_MII_INIT Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-25Convert CONFIG_PHY_RESET_DELAY to KconfigTom Rini2-1/+9
This converts the following to Kconfig: CONFIG_PHY_RESET_DELAY Cc: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-25Convert CONFIG_LPC32XX_ETH to KconfigTom Rini1-0/+5
This converts the following to Kconfig: CONFIG_LPC32XX_ETH Cc: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-25Convert CONFIG_RMII to KconfigTom Rini1-0/+5
This converts the following to Kconfig: CONFIG_RMII Cc: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>