summaryrefslogtreecommitdiff
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* net: dsa: realtek: fix Kconfig selectsAhmad Fatoum2023-05-091-2/+1
| | | | | | | | | | Unlike Linux, barebox has no CONFIG_FIXED_PHY or CONFIG_IRQ_DOMAIN. The former is implied by CONFIG_PHYLIB and the latter is unneeded, so revise the Kconfig option accordingly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230503100609.1522959-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2023-04-196-12/+12
|\
| * usb: move include files to place where Linux has themSascha Hauer2023-03-206-12/+12
| | | | | | | | | | | | | | | | | | For easier patch merging and comparison with Linux move the usb gadget files to where Linux has them. For now do a plain git mv include/usb include/linux/usb, eventhough there might be some files which are purely barebox specific. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2023-04-194-23/+32
|\ \
| * | net: designware: eqos: pass physical device to DMA APIAhmad Fatoum2023-04-171-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ethernet interface device is just a child of the physical device with no DT node assigned. As such, it lacks all DMA settings that may be set in the DT. Fix this by using the hardware device instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414145259.3644816-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: rtl8169: pass physical device for DMA APIAhmad Fatoum2023-04-171-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It shouldn't matter for now, but DMA API should always be called for the physical device, i.e. the struct device underlying the struct pci_device. This the Ethernet device interface parent, so use that instead. Cc: Denis Orlov <denorl2009@gmail.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414145259.3644816-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: dsa: sja1105: fall back to default speed configuration if no link was ↵Oleksij Rempel2023-03-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | detected Rather than generating an error, revert to the default link configuration. Some configuration is performed during the port pre-enable sequence. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20230316134209.4068801-3-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: dsa: sja1105: move port enable to adjust link code.Oleksij Rempel2023-03-211-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Execute port enable code dynamically based on link detection status. This enables proper MAC configuration during link detection events. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20230316134209.4068801-2-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: dsa: add adjust_link supportOleksij Rempel2023-03-211-2/+2
| |/ | | | | | | | | | | | | | | | | | | The required functionality is essential for cable hot plugging or asynchronous link detection. In its current state, DSA will only operate if the cable was connected prior to booting. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20230316134209.4068801-1-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: dsa: realtek: include needed headers directlyAhmad Fatoum2023-04-116-0/+8
| | | | | | | | | | | | | | | | | | | | Building the driver for RISC-V instead of ARM, shows that the headers of some symbols depended on were included indirectly before. Fix this to enable RISC-V build. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230411071436.1630752-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: macb: Adjust zynq compatibles to upstream device treesSascha Hauer2023-03-211-2/+2
|/ | | | | | | | Linux v6.3-rc1 renamed the zynq macb compatibles from cdns,zynq-gem to xlnx,zynq-gem and cdns,zynqmp-gem to xlnx,zynqmp-gem. Adjust the compatibles in the driver accordingly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc' into nextSascha Hauer2023-03-161-2/+5
|\
| * net: dsa: abort registration when master is unresolvableAhmad Fatoum2023-03-161-2/+5
| | | | | | | | | | | | | | | | | | | | ds->edev_master is used in a lot places and if we can't populate, because the Ethernet device wasn't found, we should abort instead of crashing later on. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230315143522.1512531-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/arm' into nextSascha Hauer2023-03-164-6/+6
|\ \
| * | ARM: at91: Move mach header files to include/mach/at91Sascha Hauer2023-03-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently arch specific headers can be included with longer possible as there won't be a single mach anymore. Move all at91 specific header files to include/mach/at91/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: ep93xx: Move mach header files to include/mach/ep93xxSascha Hauer2023-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently arch specific headers can be included with longer possible as there won't be a single mach anymore. Move all ep93xx specific header files to include/mach/ep93xx/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: omap: Move mach header files to include/mach/omapSascha Hauer2023-03-062-2/+2
| |/ | | | | | | | | | | | | | | | | | | Currently arch specific headers can be included with longer possible as there won't be a single mach anymore. Move all omap specific header files to include/mach/omap/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Let NET_USB select PHYLIBUwe Kleine-König2023-03-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | drivers/net/usb/usbnet.c which is compiled with NET_USB=y uses phy_device_connect() which is only available with PHYLIB=y. So select PHYLIB from NET_USB and in turn remove the same select from some options that depend on PHYLIB. Fixes: 2263e27814f1 ("net: introduce phylib") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.barebox.org/20230314144909.2809581-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: dsa: realtek: mdio: fix out-of-bounds memory writeAhmad Fatoum2023-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The SMI Realtek driver takes care of chip_data_sz as expected, but the MDIO driver doesn't, leading to memory corruption. Fix this. This issue is also present in the original Linux driver and will be fixed there as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230307101446.2077676-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: dsa: realtek: rtl8365mb: add missing new line to log printAhmad Fatoum2023-03-091-1/+1
|/ | | | | | | | Line should normally not show up, but when it does, have it look nice. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230307101446.2077676-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: make DRIVER_NET_DESIGNWARE_IMX8 select MFD_SYSCONBastian Krause2023-02-231-0/+1
| | | | | | | | | | | | | | | The driver includes mfd/syscon.h and uses syscon_regmap_lookup_by_phandle(): eqos-imx8 30bf0000.ethernet@30bf0000.of: probe failed: Function not implemented Select MFD_SYSCON to fix this. Fixes: b6fb740819 ("net: eqos: add i.MX8MP support") Signed-off-by: Bastian Krause <bst@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230222122320.1494205-1-bst@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Rename remaining struct device_d -> deviceSascha Hauer2023-02-231-4/+4
| | | | | | | struct device_d was renamed to struct device. Rename the remaining occurences of device_d. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2023-02-236-10/+13
|\
| * net: e1000: properly map dma allocationsAntony Pavlov2023-02-132-4/+6
| | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230210143924.915149-2-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: rtl8139: fix ifdown/ifup issuesDenis Orlov2023-02-081-1/+7
| | | | | | | | | | | | | | | | | | | | This moves PCI bus-mastering enable from 'init' to 'open', allowing to bring an interface up after bringing it down. Also add corresponding dma_free_coherent() calls into 'close', getting rid of memory leaks. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230208081307.3190117-2-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: rtl8139: remove dependence on MIPSDenis Orlov2023-02-082-3/+0
| | | | | | | | | | | | | | | | This driver seems to work fine on ARM64 Virtual Machine in QEMU. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230208081307.3190117-1-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: phy: remove duplicate definition of PHY_AN_TIMEOUTAhmad Fatoum2023-01-311-2/+0
| | | | | | | | | | | | | | | | Same macro is already defined in <linux/phy.h>. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230130113405.2796838-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: ks8851_mll: drop platform_device usageMarco Felsch2023-01-311-2/+0
| | | | | | | | | | | | | | | | | | The pdev member is unused neither do have barebox support for 'struct platform_device' so remove the usage. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230130234501.1122060-1-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mips'Sascha Hauer2023-02-231-2/+0
|\ \
| * | MIPS: dma: simplify source structureDenis Orlov2023-02-141-2/+0
| |/ | | | | | | | | | | | | | | | | There is no reason to keep code from 'dma-mapping.h' in a separate file, so merge it into 'dma.h'. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230210144745.915720-5-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2023-02-233-0/+203
|\ \ | |/ |/|
| * net: eqos: add i.MX8MP supportLucas Stach2023-01-273-0/+203
| | | | | | | | | | | | | | | | | | | | This adds the platform glue for the Designware EQOS ethernet interface as implemented on the i.MX8MP SoC. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230111182157.1702865-3-l.stach@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: dsa: ksz8873: fix mismatched return valueAhmad Fatoum2023-01-251-1/+1
| | | | | | | | | | | | | | | | | | Both read and write operations for the regmap are supposed to return an int, not a ssize_t and build warns about this. Fix it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230125075354.1760273-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: dsa: realtek: support enabling only one of the driversAhmad Fatoum2023-01-251-5/+11
|/ | | | | | | | | | | We have drivers for both rtl8365mb and rtl8366rb and each uses a different tagger. realtek-dsa didn't know that and caused a reference to an unavailable symbol when one of them was disabled. Add IS_ENABLED() guards to fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230125075354.1760273-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dsa: add Realtek (rtl8365mb/rtl8366rb) switch supportAhmad Fatoum2023-01-2313-0/+3724
| | | | | | | | | This imports the Linux v6.1 state of the driver into barebox. This has been tested with the RTL8365MB in (bitbanged) SMI mode. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230116134501.2006391-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dsa: always call port_pre_enable before port_enableAhmad Fatoum2023-01-231-0/+10
| | | | | | | | | | | The barebox DSA support differentiates between a port_pre_enable, that's called before connecting the PHY to drive a clock if nedeed and the actual port_enable. For user ports, port_enable of the CPU port is called, but not port_pre_enable. Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230116134501.2006391-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dsa: populate struct dsa_port::index/dev membersAhmad Fatoum2023-01-231-4/+1
| | | | | | | | | | Unlike with regular user ports, the CPU port doesn't have a dev or index member assigned, which leads to subtle breakage porting Linux drivers. Use the new dsa_port_alloc() helper to fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230116134501.2006391-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dsa: factor out dsa_port_alloc helperAhmad Fatoum2023-01-231-6/+15
| | | | | | | | | | We'll reuse this helper in a follow-up commit for allocating the CPU port's struct dsa_port, so prepare for this by creating a helper function. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230116134501.2006391-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dsa: rename dsa_ops to dsa_switch_opsAhmad Fatoum2023-01-234-8/+8
| | | | | | | | | Linux calls the ops dsa_switch_ops and we have some members, which are the same in both, so adopt the Linux naming. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230116134501.2006391-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc-struct-rename'Sascha Hauer2023-01-203-134/+214
|\
| * net: ksz9477: add I2C supportAhmad Fatoum2023-01-123-3/+19
| | | | | | | | | | | | | | | | | | With regmap formatting support now in place, adding I2C support is quite trivial, so let's do it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230111132956.1153359-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dsa: ksz9477: refactor to prepare i2c supportAhmad Fatoum2023-01-122-9/+12
| | | | | | | | | | | | | | | | | | | | | | With the move to regmap, it's straight-forward to add i2c support. Prepare for this by making it possible to turn off the SPI parts. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230111132956.1153359-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dsa: ksz9477: create regmap cdev for switch registersAhmad Fatoum2023-01-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Now that we use regmap for the KSZ9477 driver, we can make the register map available for introspection as a device file. As the KSZ driver has a separate regmap for each of the three access sizes, we add a new regmap_multi_register_cdev abstraction that multiplexes device file access to the regmap with the best matching alignment. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230111132956.1153359-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dsa: ksz9477: switch to regmap_init_spiAhmad Fatoum2023-01-123-124/+180
| | | | | | | | | | | | | | | | | | | | | | Linux uses three regmaps for the KSZ9477 DSA driver, one for each of the three access sizes supported by the chip. While this increases overhead a bit, it'll allow us in future to extend the driver seamlessly for i2c support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230111132956.1153359-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2023-01-204-6/+27
|\ \
| * | net: e1000: don't use nanosecond constants in readl_poll_timeoutAhmad Fatoum2023-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The MSECOND/USECOND constants are in nanoseconds, while readl_poll_timeout accepts microseconds. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230110172720.35331-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: bcmgenet: fix warning when building for 32-bitAhmad Fatoum2023-01-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver readily works in 32-bit mode as it takes care there to write zero to the DMA_DESC_ADDRESS_HI field of descriptors. In the receive path, a 32-bit integer is shifted by 32 though leading to a (harmless) warning. Adjust the type to silence it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230110180126.73739-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: designware: eqos: implement set_promisc callbackAhmad Fatoum2023-01-101-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A STM32MP1 platform using a KSZ switch with barebox' DSA framework now throws a warning: WARNING: ksz9477-spi ksz9563@00: Failed to set promisc mode. Using different eth addresses may not work. error 95 DSA worked correctly though and the switch ports had their own MAC addresses different from the CPU's mac address. Frame ingress and egress indeed occurs with the switch port's MAC address. Nevertheless, it's a good idea to set the promiscuous bit, so do this now, if only to silence the warning. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230110153719.4037355-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: dsa: ksz9477: match microchip,ksz8563 compatibleAhmad Fatoum2023-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested on an i.MX8MN board communicating with the switch over I2C. The IC says KSZ9563RNXI, but is detected as KSZ9893: ksz9477-i2c ksz85630: Found KSZ9893 ksz9477-i2c ksz85630: chip id: 0x00989360 This is the same in Linux, but switch works though. I2C support will follow separately. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230110133817.3939707-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: dsa: ksz9477: fix confusing message detecting KSZ9893 compatibleAhmad Fatoum2023-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have a KSZ8563RNXI-TR, which while it works, barebox reports as "Found KSZ9893", which is a bit confusing. For non-KSZ9893, barebox reports "Found KSZ9477 or compatible", so do likewise for KSZ9893. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230110133817.3939707-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>