Go to the documentation of this file.
31 #ifndef _RZA1_ETH_DRIVER_H
32 #define _RZA1_ETH_DRIVER_H
38 #ifndef RZA1_ETH_TX_BUFFER_COUNT
39 #define RZA1_ETH_TX_BUFFER_COUNT 8
40 #elif (RZA1_ETH_TX_BUFFER_COUNT < 1)
41 #error RZA1_ETH_TX_BUFFER_COUNT parameter is not valid
45 #ifndef RZA1_ETH_TX_BUFFER_SIZE
46 #define RZA1_ETH_TX_BUFFER_SIZE 1536
47 #elif (RZA1_ETH_TX_BUFFER_SIZE != 1536)
48 #error RZA1_ETH_TX_BUFFER_SIZE parameter is not valid
52 #ifndef RZA1_ETH_RX_BUFFER_COUNT
53 #define RZA1_ETH_RX_BUFFER_COUNT 8
54 #elif (RZA1_ETH_RX_BUFFER_COUNT < 1)
55 #error RZA1_ETH_RX_BUFFER_COUNT parameter is not valid
59 #ifndef RZA1_ETH_RX_BUFFER_SIZE
60 #define RZA1_ETH_RX_BUFFER_SIZE 1536
61 #elif (RZA1_ETH_RX_BUFFER_SIZE != 1536)
62 #error RZA1_ETH_RX_BUFFER_SIZE parameter is not valid
66 #ifndef RZA1_ETH_IRQ_PRIORITY
67 #define RZA1_ETH_IRQ_PRIORITY 25
68 #elif (RZA1_ETH_IRQ_PRIORITY < 0)
69 #error RZA1_ETH_IRQ_PRIORITY parameter is not valid
73 #ifndef RZA1_ETH_RAM_SECTION
74 #define RZA1_ETH_RAM_SECTION ".BSS_DMAC_SAMPLE_INTERNAL_RAM"
78 #define ETHER_ARSTR_ARST 0x00000001
81 #define ETHER_ECMR0_TRCCM 0x04000000
82 #define ETHER_ECMR0_RCSC 0x00800000
83 #define ETHER_ECMR0_DPAD 0x00200000
84 #define ETHER_ECMR0_RZPF 0x00100000
85 #define ETHER_ECMR0_ZPF 0x00080000
86 #define ETHER_ECMR0_PFR 0x00040000
87 #define ETHER_ECMR0_RXF 0x00020000
88 #define ETHER_ECMR0_TXF 0x00010000
89 #define ETHER_ECMR0_MCT 0x00002000
90 #define ETHER_ECMR0_RE 0x00000040
91 #define ETHER_ECMR0_TE 0x00000020
92 #define ETHER_ECMR0_DM 0x00000002
93 #define ETHER_ECMR0_PRM 0x00000001
96 #define ETHER_PIR0_MDI 0x00000008
97 #define ETHER_PIR0_MDO 0x00000004
98 #define ETHER_PIR0_MMD 0x00000002
99 #define ETHER_PIR0_MDC 0x00000001
102 #define ETHER_TSU_ADSBSY_ADSBSY 0x00000001
105 #define ETHER_EDSR0_ENT 0x00000002
106 #define ETHER_EDSR0_ENR 0x00000001
109 #define ETHER_EDMR0_DE 0x00000040
110 #define ETHER_EDMR0_DL 0x00000030
111 #define ETHER_EDMR0_DL_16 0x00000000
112 #define ETHER_EDMR0_DL_32 0x00000010
113 #define ETHER_EDMR0_DL_64 0x00000020
114 #define ETHER_EDMR0_SWRT 0x00000002
115 #define ETHER_EDMR0_SWRR 0x00000001
118 #define ETHER_EDTRR0_TR 0x00000003
121 #define ETHER_EDRRR0_RR 0x00000001
124 #define ETHER_EESR0_TWB 0xC0000000
125 #define ETHER_EESR0_TC1 0x20000000
126 #define ETHER_EESR0_TUC 0x10000000
127 #define ETHER_EESR0_ROC 0x08000000
128 #define ETHER_EESR0_TABT 0x04000000
129 #define ETHER_EESR0_RABT 0x02000000
130 #define ETHER_EESR0_RFCOF 0x01000000
131 #define ETHER_EESR0_ECI 0x00400000
132 #define ETHER_EESR0_TC0 0x00200000
133 #define ETHER_EESR0_TDE 0x00100000
134 #define ETHER_EESR0_TFUF 0x00080000
135 #define ETHER_EESR0_FR 0x00040000
136 #define ETHER_EESR0_RDE 0x00020000
137 #define ETHER_EESR0_RFOF 0x00010000
138 #define ETHER_EESR0_RMAF 0x00000080
139 #define ETHER_EESR0_RRF 0x00000010
140 #define ETHER_EESR0_RTLF 0x00000008
141 #define ETHER_EESR0_RTSF 0x00000004
142 #define ETHER_EESR0_PRE 0x00000002
143 #define ETHER_EESR0_CERF 0x00000001
146 #define ETHER_EESIPR0_TWBIP 0xC0000000
147 #define ETHER_EESIPR0_TC1IP 0x20000000
148 #define ETHER_EESIPR0_TUCIP 0x10000000
149 #define ETHER_EESIPR0_ROCIP 0x08000000
150 #define ETHER_EESIPR0_TABTIP 0x04000000
151 #define ETHER_EESIPR0_RABTIP 0x02000000
152 #define ETHER_EESIPR0_RFCOFIP 0x01000000
153 #define ETHER_EESIPR0_ECIIP 0x00400000
154 #define ETHER_EESIPR0_TC0IP 0x00200000
155 #define ETHER_EESIPR0_TDEIP 0x00100000
156 #define ETHER_EESIPR0_TFUFIP 0x00080000
157 #define ETHER_EESIPR0_FRIP 0x00040000
158 #define ETHER_EESIPR0_RDEIP 0x00020000
159 #define ETHER_EESIPR0_RFOFIP 0x00010000
160 #define ETHER_EESIPR0_RMAFIP 0x00000080
161 #define ETHER_EESIPR0_RRFIP 0x00000010
162 #define ETHER_EESIPR0_RTLFIP 0x00000008
163 #define ETHER_EESIPR0_RTSFIP 0x00000004
164 #define ETHER_EESIPR0_PREIP 0x00000002
165 #define ETHER_EESIPR0_CERFIP 0x00000001
168 #define ETHER_TDFFR_TDLF 0x00000001
171 #define ETHER_RDFFR0_RDLF 0x00000001
174 #define ETHER_FDR0_TFD 0x00000700
175 #define ETHER_FDR0_TFD_2048 0x00000700
176 #define ETHER_FDR0_RFD 0x0000001F
177 #define ETHER_FDR0_RFD_2048 0x00000007
180 #define ETHER_RMCR0_RNC 0x00000001
183 #define ETHER_FCFTR0_RFF 0x001F0000
184 #define ETHER_FCFTR0_RFF_8 0x00070000
185 #define ETHER_FCFTR0_RFD 0x000000FF
186 #define ETHER_FCFTR0_RFD_2048 0x00000007
189 #define ETHER_TD0_TACT 0x80000000
190 #define ETHER_TD0_TDLE 0x40000000
191 #define ETHER_TD0_TFP_SOF 0x20000000
192 #define ETHER_TD0_TFP_EOF 0x10000000
193 #define ETHER_TD0_TFE 0x08000000
194 #define ETHER_TD0_TWBI 0x04000000
195 #define ETHER_TD0_TFS_MASK 0x00000300
196 #define ETHER_TD0_TFS_TUC 0x00000200
197 #define ETHER_TD0_TFS_TABT 0x00000100
198 #define ETHER_TD1_TDL 0xFFFF0000
199 #define ETHER_TD2_TBA 0xFFFFFFFF
202 #define ETHER_RD0_RACT 0x80000000
203 #define ETHER_RD0_RDLE 0x40000000
204 #define ETHER_RD0_RFP_SOF 0x20000000
205 #define ETHER_RD0_RFP_EOF 0x10000000
206 #define ETHER_RD0_RFE 0x08000000
207 #define ETHER_RD0_RCSE 0x04000000
208 #define ETHER_RD0_RFS_MASK 0x02DF0000
209 #define ETHER_RD0_RFS_RFOF 0x02000000
210 #define ETHER_RD0_RFS_RMAF 0x00800000
211 #define ETHER_RD0_RFS_RUAF 0x00400000
212 #define ETHER_RD0_RFS_RRF 0x00100000
213 #define ETHER_RD0_RFS_RTLF 0x00080000
214 #define ETHER_RD0_RFS_RTSF 0x00040000
215 #define ETHER_RD0_RFS_PRE 0x00020000
216 #define ETHER_RD0_RFS_CERF 0x00010000
217 #define ETHER_RD0_RCS 0x0000FFFF
218 #define ETHER_RD1_RBL 0xFFFF0000
219 #define ETHER_RD1_RDL 0x0000FFFF
220 #define ETHER_RD2_RBA 0xFFFFFFFF
void rza1EthDisableIrq(NetInterface *interface)
Disable interrupts.
void rza1EthWriteSmi(uint32_t data, uint_t length)
SMI write operation.
uint16_t rza1EthReadPhyReg(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr)
Read PHY register.
Structure describing a buffer that spans multiple chunks.
uint32_t rza1EthReadSmi(uint_t length)
SMI read operation.
error_t rza1EthInit(NetInterface *interface)
RZ/A1 Ethernet MAC initialization.
const NicDriver rza1EthDriver
RZ/A1 Ethernet MAC driver.
void rza1EthEnableIrq(NetInterface *interface)
Enable interrupts.
error_t rza1EthReceivePacket(NetInterface *interface)
Receive a packet.
void rza1EthInitDmaDesc(NetInterface *interface)
Initialize DMA descriptor lists.
void rza1EthTick(NetInterface *interface)
RZ/A1 Ethernet MAC timer handler.
void rza1EthEventHandler(NetInterface *interface)
RZ/A1 Ethernet MAC event handler.
Network interface controller abstraction layer.
error_t rza1EthUpdateMacConfig(NetInterface *interface)
Adjust MAC configuration parameters for proper operation.
void rza1EthIrqHandler(uint32_t intSense)
RZ/A1 Ethernet MAC interrupt service routine.
error_t rza1EthUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
void rza1EthInitGpio(NetInterface *interface)
GPIO configuration.
void rza1EthWritePhyReg(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr, uint16_t data)
Write PHY register.
error_t rza1EthSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.