Driver for the Gaisler GRETH Ethernet MAC with EDCL support.
More...
Driver for the Gaisler GRETH Ethernet MAC with EDCL support.
Overview
GRETH is a DMA-based Ethernet MAC from Frontgrade Gaisler, commonly found in GRLIB-based FPGA designs (LEON, NOEL-V). This driver implements the RIOT netdev interface for Ethernet.
Hardware operation
The controller uses two rings of buffer descriptors in RAM — one for TX, one for RX. Each descriptor is 8 bytes: a 32-bit control word and a 32-bit buffer address. The CPU prepares descriptors with EN=1 (owned by DMA). The DMA engine processes them and clears EN=0 when done, then raises IRQ 5.
|
| file | greth.h |
| | Interface definitions for the GRETH Ethernet driver.
|
| |
| file | greth_params.h |
| | Default configuration for the GRETH Ethernet driver.
|
| |
| file | greth_regs.h |
| | Register definitions for the Gaisler GRETH Ethernet MAC.
|
| |
◆ CONFIG_GRETH_RX_DESC_NUM
| #define CONFIG_GRETH_RX_DESC_NUM (8U) |
Number of RX descriptors (and pre-allocated RX buffers)
Must be a power of 2. More descriptors = better throughput at cost of RAM.
Definition at line 55 of file greth.h.
◆ CONFIG_GRETH_TX_DESC_NUM
| #define CONFIG_GRETH_TX_DESC_NUM (4U) |
Number of TX descriptors.
Must be a power of 2.
Definition at line 64 of file greth.h.
◆ GRETH_ANEG_TIMEOUT
| #define GRETH_ANEG_TIMEOUT (100000U) |
PHY auto-negotiate timeout in poll iterations.
Definition at line 80 of file greth.h.
◆ GRETH_BUF_SIZE
| #define GRETH_BUF_SIZE (1536U) |
RX/TX buffer size — rounded up to 32-byte boundary.
Definition at line 75 of file greth.h.
◆ GRETH_MAX_FRAME_LEN
| #define GRETH_MAX_FRAME_LEN (1518U) |
Maximum Ethernet frame size (excluding FCS added by MAC)
Definition at line 70 of file greth.h.
◆ greth_setup()
Set up the GRETH device descriptor.
Must be called before the netdev init callback. Wires the netdev driver pointer and stores the board parameters. Does not touch hardware.
- Parameters
-
| [out] | dev | Driver state to initialise |
| [in] | params | Board-level configuration (address, IRQ, MAC) |
| [in] | index | Instance index for netdev_register |