25 Commits

Author SHA1 Message Date
Christian Mauderer
f5e9bae508 if_ffec: Allow PHY that is connected to other FFEC
The i.MX6UL (and some others from the i.MX family) have shared MDIO
lines for multiple FFECs. This patch allows to use the MDIO interface
from another Ethernet controller.

Note that you have to make sure that the FFECs are initialized in the
right order. Normally that can be done via FDT.
2022-06-07 09:07:15 +02:00
Christian Mauderer
91afe3a020 if_ffec: Reduce buffer size
Typical embedded systems don't have that much memory. Reduce the buffer
size to something more sensible for the usual type of application.
2022-06-07 09:07:08 +02:00
Christian Mauderer
182aac377d if_ffec: Fix cache handling on tx
With the previous fix, it could happen that the end of the packet hasn't
been flushed. For example assume the following addresses:

ds_addr: 0x81c804A
ds_len: 0x57

In that case the data ends at 0x81c80a1. But due to the rounding the
area from 0x81c8040 to 0x81c80a0 would have been flushed.

This fix now first calculates the start and end address, aligns these
addresses and then recalculates the len that has to be flushed.

Update #4180
2020-11-20 08:56:40 +01:00
Christian Mauderer
4a05b2e41c if_ffec: Align send buffers to cache if necessary. 2020-07-29 11:19:24 +02:00
Sebastian Huber
b3169c2a6a Update to FreeBSD head 2018-10-23
Git mirror commit 59f44d20be3f99d181ca742e636d45fc39ec982b.

This commit updates OpenSSL to version 1.1.1.  This required an update
of racoon which uses some internal stuff from OpenSSL and seems to be
mostly unmaintained, e.g. there is update in the FreeBSD ports to cope
with OpenSSL 1.1.1.

Update #3472.
2018-10-25 08:38:45 +02:00
Sebastian Huber
bcdce02d9b Update to FreeBSD head 2018-06-01
Git mirror commit fb63610a69b0eb7f69a201ba05c4c1a7a2739cf9.

Update #3472.
2018-09-21 10:29:41 +02:00
Sebastian Huber
bb80d9df8b Update to FreeBSD head 2017-12-01
Git mirror commit e724f51f811a4b2bd29447f8b85ab5c2f9b88266.

Update #3472.
2018-09-21 10:29:38 +02:00
Sebastian Huber
c37f9fba70 Update to FreeBSD head 2017-08-01
Git mirror commit f5002f5e5f78cae9f0269d812dc0aedb0339312c.

Update #3472.
2018-09-21 10:29:37 +02:00
Sebastian Huber
de261e0404 Update to FreeBSD head 2017-06-01
Git mirror commit dfb26efac4ce9101dda240e94d9ab53f80a9e131.

Update #3472.
2018-09-21 10:29:36 +02:00
Sebastian Huber
936b597a57 ffec: Fix comment
Update #3090.
2017-10-26 08:44:27 +02:00
Sebastian Huber
a8a9cf1847 ffec: Add checksum offload
Update #3090.
2017-10-25 14:30:04 +02:00
Sebastian Huber
0323c286e3 ffec: Add interrupt coalescing support
Code is an adapted from the TSEC (if_tsec) network interface driver.

Update #3090.
2017-10-25 14:30:01 +02:00
Sebastian Huber
fd5ee57372 ffec: Increase buffer descriptor count to 512
Update #3090.
2017-10-25 14:29:58 +02:00
Sebastian Huber
0cb40755cc ffec: Defragment transmit mbuf only if necessary
Use structure similar to TSEC (if_tsec) driver.

The use of bus_dmamap_sync() differs these network interface drivers.
This should not be the case.

Update #3090.
2017-10-25 14:29:55 +02:00
Sebastian Huber
798d308be8 ffec: Fix NULL pointer access
Update #3090.
2017-10-25 14:29:51 +02:00
Sebastian Huber
b8fdbe2fa9 ffec: Use RACC[SHIFT16]
This avoids the move of entire receive frames to meet the alignment
requirements of the IP header and so on.

Add FECFLAG_RACC feature flag for this similar to the Linux driver.

Update #3090.
2017-10-25 14:29:37 +02:00
Sebastian Huber
a70edfc49a ffec: Add wmb() to descriptor updates 2017-09-27 11:02:07 +02:00
Sebastian Huber
7f7a3397fc ffec: Support up to three interrupt requests 2017-09-27 11:02:07 +02:00
Sebastian Huber
e2e4bf4999 ffec: Avoid AXI bus issues due to a MAC reset 2017-09-27 11:02:06 +02:00
Sebastian Huber
ba0b05902b ffec: Add FECFLAG_AVB variant flag
This flag is analogous to the Linux driver FEC_QUIRK_HAS_AVB.  It
indicates an FEC with support for Audio Video Bridging (AVB).  This
indicator is used for various other parts in the Linux driver
(drivers/net/ethernet/freescale/fec_main.c).

Use it to customize the receive/transmit buffer alignment.  The receive
buffer alignment increased to 64-bytes on the i.MX 6SoloX and i.MX
7Dual.  There are no hard alignment restrictions for transmit buffers on
these chips.

Fix the ffec_softc::fectype type to provide enough storage for the
feature flags.
2017-09-27 11:02:06 +02:00
Sebastian Huber
1378632ad8 ffec: Increase descriptor ring alignment
For optimal performance a 64-byte alignment is recommended.
2017-09-27 11:02:06 +02:00
Sebastian Huber
9c3473572f ffec: Use explicit cache synchronization 2017-09-27 11:02:06 +02:00
Sebastian Huber
91a7527699 ffec: Support more rgmii variants 2017-09-27 11:02:06 +02:00
Sebastian Huber
95b102f733 ffec: Port to RTEMS 2017-09-27 11:02:06 +02:00
Sebastian Huber
807b5bb2c3 ffec: Import from FreeBSD 2017-09-27 11:02:06 +02:00