Native EtherCAT device driver for the Raspberry Pi 5 on-RP1 gigabit MAC
(Cadence GEM, "macb"), ported from the genet recipe. Lets the IgH kernel
master poll-drive the NIC directly instead of via the generic driver.
Derived from the in-tree macb driver at Linux 6.18.33
(drivers/net/ethernet/cadence: macb_main.c, macb.h, macb_ptp.c); the
-orig files are verbatim, the -ethercat files add the ecdev hooks
(ecdev_offer/open/close/withdraw, ec_poll, gem_rx -> ecdev_receive,
a persistent TX skb ring, IRQ/NAPI/PTP gated by get_ecdev()).
macb-specific points vs the genet recipe:
- ecdev_offer() before macb_init() (macb requests its IRQs there).
- phylink (not MDIO adjust_link); phylink_start/stop wrapped in rtnl_lock
in EtherCAT mode (ecdev_open runs without the RTNL lock).
- MAC PHC / PTP init gated off in EtherCAT mode.
- macb_pad_and_fcs(): the master reuses one persistent TX skb and rewrites
skb->len each cycle without resetting the tail, so re-sync the tail and
append the software FCS in place; a plain skb_put() walked the tail past
the buffer end -> skb_over_panic().
Tested on a Raspberry Pi 5 (BCM2712, 6.18.33-rt) against an A6-EC servo
drive: binds the RP1 GEM, reaches OP, 0 lost frames at up to 4 kHz.
Build: ./configure --enable-macb [--with-macb-kernel=6.18]
Known limitations: RX allocates an skb per frame in the poll path (a future
revision can reuse the buffer in place); only the GEM RX path carries the
hook (RP1 is GEM); PM suspend/resume is not specially handled.
Commit 89aec171d9d1ab168e43fcf9754b82e4c0aef9b9 (part of linux kernel
6.19.0-rc1) introduced an arbitrarily sized sockaddr struct to be used
instead of the classical one.
Closes#200