If the TXABRT bit from ESTAT is ever set (because of a single failed
transmission), the driver will continue showing an error on every
subsequent packet sent, although it is correctly sent:
<err> eth_enc28j60: TX failed!
The enc28j60 datasheet says under
"12.1.3 TRANSMIT ERROR INTERRUPT FLAG (TXERIF)":
"After determining the problem and solution, the
host controller should clear the LATECOL (if set) and
TXABRT bits so that future aborts can be detected
accurately."
Therefore, clear the TXABRT and LATECOL bits in case of transmission error.
Signed-off-by: Xavier Ruppen <xruppen@gmail.com>
In release V3.3 new STM32Cube HAL ethernet API was added to STM32 ethernet
driver for STM32F4, STM32F7 and STM32H7 series. At the same time, the
legacy API was deprecated for these series.
I'm now fully removing the legacy API support for these series.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
For the choice ETH_STM32_HAL_API_VERSION, both options
ETH_STM32_HAL_API_V2 and ETH_STM32_HAL_API_V1 had the same
prompt "Use new HAL driver". This commit fixes the prompt for the
legacy driver.
Signed-off-by: Charlie Gilliland <charliegilly1@gmail.com>
Add support for similar adin1100 phy, boath are 10Base-T1L,
only difference is that adin1100 connects through r/mii.
Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
Use PHY apis to access the PHY, to avoid any kind of collisions
with other tasks using the PHY apis.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
* Rename w5500_hw_reset to w5500_soft_reset.
This function performs a software reset, the GPIO reset is
hardware reset.
* Set thread name "eth_w5500".
* Simplify random MAC address code.
Remove unnecessary function pointer and wrapper function.
* Remove SPI read variable length array.
The VLA causes unnecessary stack usage and its max size changes
depending on CONFIG_NET_BUF_DATA_SIZE.
Split the SPI read into two transactions, a skip of the first 3
dummy bytes, then a read of the data directly into to given buffer.
* Remove unused variables config_func and full_duplex.
Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
The commit "drivers: ethernet: dsa_ksz8xxx: use
NET_DEVICE_DT_DEFINE_INSTANCE"
(SHA1: f78a081066) replaced
NET_DEVICE_INIT_INSTANCE() with NET_DEVICE_DT_DEFINE_INSTANCE() to
facilitate the removal of deprecated (from Zephyr's 3.2 release)
DT_LABEL() macro.
Unfortunately, the per LAN port initialization is necessary for correct
operation of the DSA driver - otherwise following errors were visible
when LLDP DSA sample (samples/net/dsa/src) was run on ip_k66f board:
<wrn> net_if: iface 0x20001440 is down
<inf> net_dsa_lldp_sample: LLDP pkt recv -> lan1
<inf> net_dsa_lldp_sample: CHASSIS ID: 38:05:43:69:XX:ZZ
<inf> net_dsa_lldp_sample: PORT ID: 38:05:43:69:XX:ZZ
<inf> net_dsa_lldp_sample: TTL: 120s
<inf> net_dsa_lldp_sample: SYSTEM NAME: mtt
<err> net_dsa_lldp_sample: Failed to send, errno 115
The fix is to use again NET_DEVICE_INIT_INSTANCE() with "lan"X name
assigned (to avoid too long names when recommended DT_PROP() is
used instead of DT_LABEL()).
Fixes: f78a081066
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Make DSA dependent on ETH_DSA_SUPPORT which is selected by driver
kconfigs, rather than having a list of dependencies.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Deprecate ETH_MCUX, by:
- Marking it as DEPRECATED in Kconfig, obviously.
- Unmarking the new driver as experimental.
- Putting the new and old drivers in the same folder.
- Reworking the menu appearance of the driver selection.
Note that technically now it is possible to choose the wrong
driver than what is enabled in DT, this is intentional, but
the correct one will obviously be enabled by default.
- Convert all sample overlays to the new Kconfigs. This was
part of the motivation for the shared overlays, as it was
causing twister/CI logs to look ugly and misleading due
to Kconfig warnings.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
I have tested the DSA support with ETH_NXP_ENET driver and it
works, so marking it as supported by adding it to the dependency
list for the DSA feature.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The MAC address macros are ridiculous in this driver.
Rewrite to be simpler and use eth.h common function.
Also, clarify the mac address generation on the DT overlays.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Convert from multiple threads for each instance to use
one workqueue for all instances. The benefit is to save
memory and use a kernel function that already exists
for a use case like this.
Also introduce the ETH_NXP_ENET_RX_THREAD_PRIORITY kconfig,
which makes the thread priority of the workqueue configurable.
Finally, remove the code enabling the RxBufferInterrupt, since
the meaning of it isn't used currently in this driver.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add functionality for when NET_POWER_MANAGEMENT (ie PM_DEVICE)
is enabled. This function code originally comes from the
old eth_mcux driver which was only tested on kinetis family SOCs,
so that family kconfig is a dependency for this feature for now.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Some comments in this driver are just redundant - the code
spells out exactly what the comment says. And some comment
blocks are just unnecessary to have. Finally, remove the TODO
comment because this is flagged by static analysis and there
are already tracking issues for the zero copy enhancement.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Added changes required for nxp_enet ethernet driver to work
with multiple PHYs and fixed few problems:
- The cfg_link API resets PHY before configuring link. It was moved
here so the ethernet driver does not have to reset it - not all
PHYs need reset before configuring link and moving the reset code
here makes possible to have the reset done in a PHY specific way
(for example to reset by toggling GPIO pin). It also avoids ethernet
driver touching PHY registers without locking.
- When reset GPIO is not defined, reset is performed by setting reset
bit in control register.
- The cfg_link API does not return error when autonegotiation fails.
This fixes situation when the link is down at system start - ethernet
driver then skipped setting link-change callback and link was never
to be detected again.
- Added reset of excessive bits 16-31 when reading register values.
As only 16 bits are read from PHY, but the API is supposed to read
into uint32_t, the remaining bits contained previous data after
a successful read.
- Fixed missing mutex unlock when querying link state and link was down.
- Added missing initializer to link state variables. This could result
in link state change detection while link was still down, because
the speed/duplex settings could be random and old and new state
could be wrongly detected as different.
- Not logging link speed/duplex status when link is not up.
Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
Apparently there was a typo in the last commit.
Looks like it was refactored without trying to build.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The VLAN packets are prepared in Ethernet L2 so no need to have
special handling in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Virtual LAN logic is now done in Ethernet L2 so no need to manipulate
VLAN packets in the driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Remove ethernet-fixed-link binding as it is redundant with the
phy bindings. Clearly, ethernet does not work without the L1
layer, which is a phy device, or an integrated mac/phy device,
and all of these things should be described properly in DT.
The schema did not even come with a compatible, meaning nodelabels
were hardcoded into the drivers, which is unacceptable.
- Remove the binding file for ethernet-fixed-link.yaml.
- Remove fixed link functionality from the nxp s32 gmac driver.
Since this functionality is already covered by the phy support,
it is redundant.
- Remove fixed link include from the s32 gmac binding.
- Remove fixed link include from the nuvoton numaker binding.
As far as I can tell the corresonding driver does not even
use it anyways, and I did not find any board with this device
that describes a "fixed link".
- Move the definition into the nxp,kinetis-ethernet binding
as the eth_mcux driver, which is already being deprecated,
does use this, contain the debt to the legacy driver.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Multicast rule as 01:00:00:00:00:00 is actually shadowing
broadcast rule, enabling broadcast packets to be received/forwarded
even if broadcast rule/filter is not set.
Set the multicast filter with an appropriate mask.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Byte value written to the device's
ERXFCON: ETHERNET RECEIVE FILTER CONTROL REGISTER
Sets the devices receive packet filter, optional. If not set
in device tree previous hard coded value`0xA3` is used.
Uni, multi and broadcast packets with valid CRC are accepted.
Signed-off-by: Dean Sellers <dsellers@evos.com.au>
The number of interrupts received by the driver maybe less than
the number of data packets received by Ethernet,
so the driver should read the packets number
from the register REG_MACNP value.
Signed-off-by: Wafer Xie <wafer@jaguarmicro.com>
Rework the driver to use HW MAC address filtering as an ethernet
capability.
Use a counter table for CRC indexes added/removed.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>