Go to the documentation of this file.
31 #ifndef _RZA2_ETH2_DRIVER_H
32 #define _RZA2_ETH2_DRIVER_H
38 #ifndef RZA2_ETH2_TX_BUFFER_COUNT
39 #define RZA2_ETH2_TX_BUFFER_COUNT 8
40 #elif (RZA2_ETH2_TX_BUFFER_COUNT < 1)
41 #error RZA2_ETH2_TX_BUFFER_COUNT parameter is not valid
45 #ifndef RZA2_ETH2_TX_BUFFER_SIZE
46 #define RZA2_ETH2_TX_BUFFER_SIZE 1536
47 #elif (RZA2_ETH2_TX_BUFFER_SIZE != 1536)
48 #error RZA2_ETH2_TX_BUFFER_SIZE parameter is not valid
52 #ifndef RZA2_ETH2_RX_BUFFER_COUNT
53 #define RZA2_ETH2_RX_BUFFER_COUNT 8
54 #elif (RZA2_ETH2_RX_BUFFER_COUNT < 1)
55 #error RZA2_ETH2_RX_BUFFER_COUNT parameter is not valid
59 #ifndef RZA2_ETH2_RX_BUFFER_SIZE
60 #define RZA2_ETH2_RX_BUFFER_SIZE 1536
61 #elif (RZA2_ETH2_RX_BUFFER_SIZE != 1536)
62 #error RZA2_ETH2_RX_BUFFER_SIZE parameter is not valid
66 #ifndef RZA2_ETH2_IRQ_PRIORITY
67 #define RZA2_ETH2_IRQ_PRIORITY 25
68 #elif (RZA2_ETH2_IRQ_PRIORITY < 0)
69 #error RZA2_ETH2_IRQ_PRIORITY parameter is not valid
73 #ifndef RZA2_ETH2_RAM_SECTION
74 #define RZA2_ETH2_RAM_SECTION ".BSS_DMAC_SAMPLE_INTERNAL_RAM"
78 #ifndef RZA2_ETH2_GET_PHYSICAL_ADDR
79 #define RZA2_ETH2_GET_PHYSICAL_ADDR(addr) ((uint32_t) (addr) - 0x02000000U)
83 #define EDMAC_EDMR_DL_16 0x00000000
84 #define EDMAC_EDMR_DL_32 0x00000010
85 #define EDMAC_EDMR_DL_64 0x00000020
88 #define EDMAC_FDR_TFD_2048 0x00000700
89 #define EDMAC_FDR_RFD_4096 0x0000000F
92 #define EDMAC_TD0_TACT 0x80000000
93 #define EDMAC_TD0_TDLE 0x40000000
94 #define EDMAC_TD0_TFP_SOF 0x20000000
95 #define EDMAC_TD0_TFP_EOF 0x10000000
96 #define EDMAC_TD0_TFE 0x08000000
97 #define EDMAC_TD0_TWBI 0x04000000
98 #define EDMAC_TD0_TFS_MASK 0x0000010F
99 #define EDMAC_TD0_TFS_TABT 0x00000100
100 #define EDMAC_TD0_TFS_CND 0x00000008
101 #define EDMAC_TD0_TFS_DLC 0x00000004
102 #define EDMAC_TD0_TFS_CD 0x00000002
103 #define EDMAC_TD0_TFS_TRO 0x00000001
104 #define EDMAC_TD1_TBL 0xFFFF0000
105 #define EDMAC_TD2_TBA 0xFFFFFFFF
108 #define EDMAC_RD0_RACT 0x80000000
109 #define EDMAC_RD0_RDLE 0x40000000
110 #define EDMAC_RD0_RFP_SOF 0x20000000
111 #define EDMAC_RD0_RFP_EOF 0x10000000
112 #define EDMAC_RD0_RFE 0x08000000
113 #define EDMAC_RD0_RFS_MASK 0x0000039F
114 #define EDMAC_RD0_RFS_RFOF 0x00000200
115 #define EDMAC_RD0_RFS_RABT 0x00000100
116 #define EDMAC_RD0_RFS_RMAF 0x00000080
117 #define EDMAC_RD0_RFS_RRF 0x00000010
118 #define EDMAC_RD0_RFS_RTLF 0x00000008
119 #define EDMAC_RD0_RFS_RTSF 0x00000004
120 #define EDMAC_RD0_RFS_PRE 0x00000002
121 #define EDMAC_RD0_RFS_CERF 0x00000001
122 #define EDMAC_RD1_RBL 0xFFFF0000
123 #define EDMAC_RD1_RFL 0x0000FFFF
124 #define EDMAC_RD2_RBA 0xFFFFFFFF
void rza2Eth2WritePhyReg(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr, uint16_t data)
Write PHY register.
void rza2Eth2InitDmaDesc(NetInterface *interface)
Initialize DMA descriptor lists.
uint16_t rza2Eth2ReadPhyReg(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr)
Read PHY register.
Structure describing a buffer that spans multiple chunks.
void rza2Eth2EnableIrq(NetInterface *interface)
Enable interrupts.
error_t rza2Eth2UpdateMacConfig(NetInterface *interface)
Adjust MAC configuration parameters for proper operation.
uint32_t rza2Eth2ReadSmi(uint_t length)
SMI read operation.
void rza2Eth2EventHandler(NetInterface *interface)
RZ/A2 Ethernet MAC event handler.
void rza2Eth2InitGpio(NetInterface *interface)
GPIO configuration.
error_t rza2Eth2SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
void rza2Eth2Tick(NetInterface *interface)
RZ/A2 Ethernet MAC timer handler.
void rza2Eth2WriteSmi(uint32_t data, uint_t length)
SMI write operation.
error_t rza2Eth2Init(NetInterface *interface)
RZ/A2 Ethernet MAC initialization.
void rza2Eth2DisableIrq(NetInterface *interface)
Disable interrupts.
Network interface controller abstraction layer.
error_t rza2Eth2ReceivePacket(NetInterface *interface)
Receive a packet.
error_t rza2Eth2UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
const NicDriver rza2Eth2Driver
RZ/A2 Ethernet MAC driver (ETHERC1 instance)
void rza2Eth2IrqHandler(uint32_t intSense)
RZ/A2 Ethernet MAC interrupt service routine.