As per our documentation, we have to reuse bindings from Linux, there
they use "snps,dwmac-mdio", so let's use the same one here in zephyr.
Signed-off-by: Fin Maaß <info@finmaass.de>
include/zephyr/drivers/ethernet/nxp_imx_netc.h only holds definitions
shared between the NXP i.MX NETC Ethernet and DSA drivers, which both
live under drivers/ethernet. Move the header to the NETC driver
directory so that it is no longer part of the public include tree.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Attach the hardware capture of received PTP frames to the packet
and request a transmit timestamp when the network stack asks for
one, so PTP can measure the time frames crossed the wire.
The receive capture is latched from the last descriptor before it
is returned to the DMA, and the transmit capture is read back from
the first descriptor once the DMA releases it.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Expose the IEEE 1588 clock provided by the Ethernet MAC as a PTP
clock device, so applications can read, set, offset and rate
adjust it through the PTP clock API.
The reference frequency is queried from the clock control driver
instead of being assumed, and only PTP frames are timestamped.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Receive interrupts can arrive before the ENET_QOS DMA has completed the
regular and context descriptor writebacks used for PTP RX timestamps.
Add a short bounded wait for the context descriptor ownership handoff
and timestamp status bits before extracting the timestamp.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
Prevent infinite loops when hardware becomes unresponsive
by adding a timeout in TX context allocation.
Signals interface is down and returns -ETIMEDOUT on timeout.
Co-authored-by: Alessandro Nuzzi <alesnu96@gmail.com>
Signed-off-by: Julien Racki <julien.racki-ext@st.com>
make the part that is needed for the esp32 to
change the offsets for the mac and base registers
more generic and use the devicetree for it.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
the hal based stm32 ethernet driver has no support
for PTP on the stm32f1, f2 and f4, so use the dwc_mac
driver when PTP support is needed.
Signed-off-by: Fin Maaß <info@finmaass.de>
the hal based esp32 ethernet driver has no support
for PTP, so use the dwc_mac driver when PTP
support is needed.
Signed-off-by: Fin Maaß <info@finmaass.de>
Use store-and-forward mode instead of cut-through mode to
allow for offloading of checksum calculation to the hardware.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Cores with multiple queues need to have queue 0 setup explicitly,
otherwise no queue will be available for RX/TX. As only a single
queue is used in this driver, setup queue 0 and assign the whole
fifo to it.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Header file include/zephyr/sys_clock.h is deprecated and will be removed
someday. Update the whole file tree to include zephyr/sys/clock.h
straight instead of zephyr/sys_clock.h.
This change was made running the sed shell command below:
$ sed -i 's/zephyr\/sys_clock\.h/zephyr\/sys\/clock\.h/' \
`grep -rsl "zephyr/sys_clock\.h" drivers/`
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
This commit add Zerocopy operation for Renesas RA Ethernet driver
This also add buffer allocation into nocache region when CPU cache
is used to prevent incoherrency
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
Signed-off-by: Nhat Ta <nhat-minh.ta.yn@bp.renesas.com>
This commit seperates pinctrl blocks for mdio node and ethernet node,
also add clock source for ethernet node.
Signed-off-by: Nhat Ta <nhat-minh.ta.yn@bp.renesas.com>
Add Ethernet driver for the Broadcom GENET MAC controller
found on the BCM2711 SoC, targeting the rpi_4b board.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
Add MDIO driver for the Broadcom GENET MDIO controller,
used to access the PHY attached to the BCM2711 GENET MAC.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
Enable Automatic pad/CRC stripping (APCS) for
packets that have a ethertype/lenght <= 1500.
The other option (CSTF) only strips the
FCS for a ethertype greater than 0x0600 (1536).
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
rx and tx errors can happen durring normal
operation, but are not fatal, so we only
log them with debug level to not confuse
the users
Signed-off-by: Fin Maaß <info@finmaass.de>
add support for the esp32 in the generic
dwc_mac driver.
esp32 specific code is based
the init of the original esp32 eth driver in zephyr.
The esp32 uses HW version 3.70.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
on some socs, the dma and mac registers are
in a different order, add the possibility to change that.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Update "CONFIG_SOC_SAMA7G54" to "CONFIG_SOC_SERIES_SAMA7G5" in "#ifdef"
for more flexible use of the drivers.
Signed-off-by: Tony Han <tony.han@microchip.com>
Instead of manually defining a variable for the compatible's name, use
the one that gets autogenerated upon build.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
(dma_error & A) || (dma_error & B) || ... is equivalent to
dma_error & (A | B | ...). Collapse the rx/tx ETH_DMASR_* error tests
into single masked checks.
Signed-off-by: Flavio Ceolin <flavio@hubble.com>
use net_pkt_frag_unref instead of net_buf_unref,
so the allocation tracking information is correct
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The TX path flushed a fixed CONFIG_NET_BUF_DATA_SIZE per fragment
though the DMA reads only frag->len. Flush only frag->len bytes.
Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
net_pkt_get_len() was called for every fragment, walking the chain
each time. Compute the frame length once before the descriptor loop.
Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>