XINU
Functions | Variables
ethinit.c File Reference
#include <xinu.h>
Include dependency graph for ethinit.c:

Go to the source code of this file.

Functions

int32 eth_phy_read (volatile struct eth_a_mdio *mdio, byte regadr, byte phyadr, uint32 *value)
 
int32 eth_phy_reset (volatile struct eth_a_mdio *mdio, byte phyadr)
 
int32 eth_phy_write (volatile struct eth_a_mdio *mdio, byte regadr, byte phyadr, uint32 value)
 
int32 ethinit (struct dentry *devptr)
 

Variables

struct eth_a_csreg eth_a_regs
 
struct ethcblk ethertab [1]
 

Function Documentation

◆ eth_phy_read()

int32 eth_phy_read ( volatile struct eth_a_mdio mdio,
byte  regadr,
byte  phyadr,
uint32 value 
)

Definition at line 13 of file ethinit.c.

References ETH_AM335X_MDIOUA_ACK, ETH_AM335X_MDIOUA_DM, ETH_AM335X_MDIOUA_GO, OK, SYSERR, and eth_a_mdio::useraccess0.

Referenced by eth_phy_reset(), and ethinit().

19 {
20 
21  /* Ethernet PHY has only 32 registers */
22 
23  if(regadr > 31) {
24  return SYSERR;
25  }
26 
27  /* Only 32 possible PHY addresses */
28 
29  if(phyadr > 31) {
30  return SYSERR;
31  }
32 
33  /* Wait for the previous access to complete */
34 
35  while( (mdio->useraccess0 & ETH_AM335X_MDIOUA_GO) != 0 );
36 
37  /* Start the access */
38 
39  mdio->useraccess0 = (ETH_AM335X_MDIOUA_GO) |
40  (regadr << 21) |
41  (phyadr << 16);
42 
43  /* Wait until the access is complete */
44 
45  while( (mdio->useraccess0 & ETH_AM335X_MDIOUA_GO) != 0 );
46 
47  /* Check if the access was successful */
48 
49  if( (mdio->useraccess0 & ETH_AM335X_MDIOUA_ACK) == 0 ) {
50  return SYSERR;
51  }
52 
53  /* Copy the value read */
54 
55  (*value) = mdio->useraccess0 & ETH_AM335X_MDIOUA_DM;
56 
57  return OK;
58 }
#define ETH_AM335X_MDIOUA_ACK
Management Data Input/Output(MDIO) 読み込み確認応答(Ack)
Definition: am335x_eth.h:289
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
#define ETH_AM335X_MDIOUA_DM
Management Data Input/Output(MDIO)データマスク
Definition: am335x_eth.h:291
#define OK
処理が成功した場合
Definition: kernel.h:77
#define ETH_AM335X_MDIOUA_GO
実行するManagement Data Input/Output(MDIO)のアクセス
Definition: am335x_eth.h:285
Here is the caller graph for this function:

◆ eth_phy_reset()

int32 eth_phy_reset ( volatile struct eth_a_mdio mdio,
byte  phyadr 
)

Definition at line 107 of file ethinit.c.

References DELAY, ETH_AM335X_INIT_DELAY, ETH_PHY_CTLREG, ETH_PHY_CTLREG_RESET, eth_phy_read(), ETH_PHY_STATREG, ETH_PHY_STATREG_LINK, eth_phy_write(), OK, and SYSERR.

Referenced by ethinit().

111 {
112  uint32 phyreg; /* Variable to hold ETH PHY register value */
113  int32 retries;/* Number of retries */
114  int32 retval; /* Return value of functions called here */
115 
116  /* Read the PHY Control Register */
117 
118  retval = eth_phy_read(mdio, ETH_PHY_CTLREG, phyadr, &phyreg);
119  if(retval == SYSERR) {
120  return SYSERR;
121  }
122 
123  /* Set the Reset bit and write the register */
124 
125  phyreg |= ETH_PHY_CTLREG_RESET;
126  eth_phy_write(mdio, ETH_PHY_CTLREG, phyadr, phyreg);
127 
128  /* Check if Reset operation is complete */
129 
130  for(retries = 0; retries < 10; retries++) {
131  if(eth_phy_read(mdio, ETH_PHY_CTLREG, phyadr, &phyreg) == SYSERR) {
132  return SYSERR;
133  }
134  if((phyreg & ETH_PHY_CTLREG_RESET) == 0) {
135  break;
136  }
137  else {
138  retries++;
140  continue;
141  }
142  }
143  if(retries >= 3) {
144  return SYSERR;
145  }
146 
147  /* Check if the Link is established */
148 
149  for(retries = 0; retries < 10; retries++) {
150  if(eth_phy_read(mdio, ETH_PHY_STATREG, phyadr, &phyreg) == SYSERR) {
151  return SYSERR;
152  }
153  if(phyreg & ETH_PHY_STATREG_LINK) {
154  break;
155  }
156  else {
157  retries++;
159  continue;
160  }
161  }
162  if(retries >= 3) {
163  return SYSERR;
164  }
165 
166  return OK;
167 }
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
#define ETH_PHY_STATREG_LINK
Definition: ether.h:66
#define ETH_PHY_STATREG
Definition: ether.h:57
#define DELAY(n)
マイクロ秒単位で処理を遅らせる。
Definition: delay.h:11
#define OK
処理が成功した場合
Definition: kernel.h:77
#define ETH_PHY_CTLREG_RESET
Definition: ether.h:59
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
int32 eth_phy_write(volatile struct eth_a_mdio *mdio, byte regadr, byte phyadr, uint32 value)
Definition: ethinit.c:64
unsigned int uint32
符号なし32ビット整数(unsigned int)
Definition: kernel.h:15
int32 eth_phy_read(volatile struct eth_a_mdio *mdio, byte regadr, byte phyadr, uint32 *value)
Definition: ethinit.c:13
#define ETH_PHY_CTLREG
Definition: ether.h:56
#define ETH_AM335X_INIT_DELAY
初期化時のディレイ
Definition: am335x_eth.h:400
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eth_phy_write()

int32 eth_phy_write ( volatile struct eth_a_mdio mdio,
byte  regadr,
byte  phyadr,
uint32  value 
)

Definition at line 64 of file ethinit.c.

References ETH_AM335X_MDIOUA_GO, ETH_AM335X_MDIOUA_WR, OK, SYSERR, and eth_a_mdio::useraccess0.

Referenced by eth_phy_reset().

70 {
71 
72  /* There are only 32 PHY registers */
73 
74  if(regadr > 31) {
75  return SYSERR;
76  }
77 
78  /* There are only 32 possible PHY addresses */
79 
80  if(phyadr > 31) {
81  return SYSERR;
82  }
83 
84  /* Wait for the previous access to complete */
85 
86  while( (mdio->useraccess0 & ETH_AM335X_MDIOUA_GO) != 0);
87 
88  /* Start the access */
89 
90  mdio->useraccess0 = ETH_AM335X_MDIOUA_GO |
92  (regadr << 21) |
93  (phyadr << 16) |
94  (value & 0xffff);
95 
96  /* Wait for the access to complete */
97 
98  while( (mdio->useraccess0 & ETH_AM335X_MDIOUA_GO) != 0);
99 
100  return OK;
101 }
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
#define OK
処理が成功した場合
Definition: kernel.h:77
#define ETH_AM335X_MDIOUA_WR
Management Data Input/Output(MDIO) 書き込みアクセス
Definition: am335x_eth.h:287
#define ETH_AM335X_MDIOUA_GO
実行するManagement Data Input/Output(MDIO)のアクセス
Definition: am335x_eth.h:285
Here is the caller graph for this function:

◆ ethinit()

int32 ethinit ( struct dentry devptr)

Definition at line 173 of file ethinit.c.

References eth_a_csreg::ale, eth_a_rx_desc::buffer, eth_a_tx_desc::buffer, eth_a_rx_desc::buflen, eth_a_tx_desc::buflen, eth_a_rx_desc::bufoff, eth_a_tx_desc::bufoff, eth_a_wr::c0_rx_en, eth_a_wr::c0_tx_en, eth_a_csreg::cpdma, ethcblk::csr, eth_a_ale::ctrl, eth_a_mdio::ctrl, ethcblk::devAddress, dentry::dvintr, dentry::dvminor, eth_a_regs, ETH_AM335X_ALE_ADDR, ETH_AM335X_ALECTL_BY, ETH_AM335X_ALECTL_EN, ETH_AM335X_ALEPCTL_FWD, ETH_AM335X_CPDMA_ADDR, ETH_AM335X_MDIO_ADDR, ETH_AM335X_MDIOCTL_EN, ETH_AM335X_RDS_OWN, ETH_AM335X_RX_RING_SIZE, ETH_AM335X_RXINT, ETH_AM335X_SL1_ADDR, ETH_AM335X_SLCTL_EN, ETH_AM335X_SLCTL_FD, ETH_AM335X_SS_ADDR, ETH_AM335X_STATERAM_ADDR, ETH_AM335X_TDS_DIR, ETH_AM335X_TDS_EOP, ETH_AM335X_TDS_P1, ETH_AM335X_TDS_SOP, ETH_AM335X_TX_RING_SIZE, ETH_AM335X_TXINT, ETH_AM335X_WR_ADDR, ETH_BUF_SIZE, ETH_PHY_1000M, ETH_PHY_100M, ETH_PHY_10M, ETH_PHY_CTLREG, ETH_PHY_CTLREG_FD, ETH_PHY_CTLREG_SM, eth_phy_read(), eth_phy_reset(), ethertab, getmem(), ethcblk::isem, kprintf(), eth_a_sl::macctrl, eth_a_csreg::mdio, memset(), netpacket::net_ethdst, eth_a_rx_desc::next, eth_a_tx_desc::next, NULL, NULLCH, OK, ethcblk::osem, eth_a_ale::portctl, eth_a_cpdma::reset, eth_a_sl::reset, eth_a_ss::reset, eth_a_wr::reset, eth_a_cpdma::rx_ctrl, eth_a_stateram::rx_hdp, eth_a_cpdma::rx_intmask_set, ethcblk::rxBufs, ethcblk::rxHead, ethcblk::rxRing, ethcblk::rxRingSize, ethcblk::rxTail, semcreate(), set_evec(), eth_a_csreg::sl, eth_a_csreg::ss, eth_a_rx_desc::stat, eth_a_tx_desc::stat, eth_a_csreg::stateram, SYSERR, eth_a_cpdma::tx_ctrl, eth_a_stateram::tx_hdp, eth_a_cpdma::tx_intmask_set, ethcblk::txBufs, ethcblk::txHead, ethcblk::txRing, ethcblk::txRingSize, ethcblk::txTail, and eth_a_csreg::wr.

176 {
177  struct ethcblk *ethptr; /* Ethernet control blk pointer */
178  struct eth_a_tx_desc *tdescptr;/* Tx descriptor pointer */
179  struct eth_a_rx_desc *rdescptr;/* Rx descriptor pointer */
180  struct netpacket *pktptr; /* Packet pointer */
181  struct eth_a_csreg *csrptr; /* Ethernet CSR pointer */
182  uint32 phyreg; /* Variable to store PHY reg val*/
183  int32 retval; /* Return value */
184  int32 i; /* Index variable */
185 
186  /* Get the Ethernet control block address */
187  /* from the device table entry */
188 
189  ethptr = &ethertab[devptr->dvminor];
190 
191  /* Store the address of CSRs in the Ethernet control block */
192 
193  csrptr = &eth_a_regs;
194  ethptr->csr = csrptr;
195 
196  /* Initialize the addresses of all the submodules */
197 
198  csrptr->ale = (struct eth_a_ale *)ETH_AM335X_ALE_ADDR;
199  csrptr->cpdma = (struct eth_a_cpdma *)ETH_AM335X_CPDMA_ADDR;
200  csrptr->sl = (struct eth_a_sl *)ETH_AM335X_SL1_ADDR;
201  csrptr->stateram = (struct eth_a_stateram *)
203  csrptr->ss = (struct eth_a_ss *)ETH_AM335X_SS_ADDR;
204  csrptr->wr = (struct eth_a_wr *)ETH_AM335X_WR_ADDR;
205  csrptr->mdio = (struct eth_a_mdio *)ETH_AM335X_MDIO_ADDR;
206 
207  /* Reset all the submodules */
208 
209  csrptr->cpdma->reset = 1;
210  while(csrptr->cpdma->reset == 1);
211 
212  csrptr->sl->reset = 1;
213  while(csrptr->sl->reset == 1);
214 
215  csrptr->wr->reset = 1;
216  while(csrptr->wr->reset == 1) ;
217 
218  csrptr->ss->reset = 1;
219  while(csrptr->ss->reset == 1) ;
220 
221  /* Enable MDIO */
222 
223  csrptr->mdio->ctrl |= ETH_AM335X_MDIOCTL_EN;
224 
225  /* Reset the PHY */
226 
227  retval = eth_phy_reset(csrptr->mdio, 0);
228  if(retval == SYSERR) {
229  kprintf("Cannot reset Ethernet PHY\n");
230  return SYSERR;
231  }
232 
233  retval = eth_phy_read(csrptr->mdio, ETH_PHY_CTLREG, 0, &phyreg);
234  if(retval == SYSERR) {
235  return SYSERR;
236  }
237 
238  if( (phyreg & ETH_PHY_CTLREG_SM) == ETH_PHY_10M ) {
239  kprintf("Ethernet Link is Up. Speed is 10Mbps\n");
240  }
241  else if( (phyreg & ETH_PHY_CTLREG_SM) == ETH_PHY_100M ) {
242  kprintf("Ethernet Link is Up. Speed is 100Mbps\n");
243  }
244  else if( (phyreg & ETH_PHY_CTLREG_SM) == ETH_PHY_1000M ) {
245  kprintf("Ethernet Link is Up. Speed is 1000Mbps\n");
246  }
247  else {
248  return SYSERR;
249  }
250 
251  if(phyreg & ETH_PHY_CTLREG_FD) {
252  kprintf("Link is Full Duplex\n");
253  csrptr->sl->macctrl |= ETH_AM335X_SLCTL_FD;
254  }
255  else {
256  kprintf("Link is Half Duplex\n");
257  }
258 
259  /* Read the device MAC address */
260  for(i = 0; i < 2; i++) {
261  ethptr->devAddress[4+i] = *((byte *)(0x44e10630+i));
262  }
263  for(i = 0; i < 4; i++) {
264  ethptr->devAddress[i] = *((byte *)(0x44e10634+i));
265  }
266 
267  kprintf("MAC Address is: ");
268  for(i = 0; i < 5; i++) {
269  kprintf("%02X:", ethptr->devAddress[i]);
270  }
271  kprintf("%02X\n", ethptr->devAddress[5]);
272 
273  /* Initialize the rx ring size field */
275 
276  /* Allocate memory for the rx ring */
277  ethptr->rxRing = (void*)getmem(sizeof(struct eth_a_rx_desc)*
278  ethptr->rxRingSize);
279  if((int32)ethptr->rxRing == SYSERR) {
280  return SYSERR;
281  }
282 
283  /* Zero out the rx ring */
284  memset((char*)ethptr->rxRing, NULLCH,
285  sizeof(struct eth_a_rx_desc)*ethptr->rxRingSize);
286 
287  /* Allocate memory for rx buffers */
288  ethptr->rxBufs = (void*)getmem(ETH_BUF_SIZE *
289  ethptr->rxRingSize);
290  if((int32)ethptr->rxBufs == SYSERR) {
291  return SYSERR;
292  }
293 
294  /* Zero out the rx buffers */
295  memset((char *)ethptr->rxBufs, NULLCH, ETH_BUF_SIZE *
296  ethptr->rxRingSize);
297 
298  /* Initialize the rx ring */
299 
300  rdescptr = (struct eth_a_rx_desc *)ethptr->rxRing;
301  pktptr = (struct netpacket *)ethptr->rxBufs;
302 
303  for(i = 0; i < ethptr->rxRingSize; i++) {
304  rdescptr->next = rdescptr + 1;
305  rdescptr->buffer = (uint32)pktptr->net_ethdst;
306  rdescptr->buflen = ETH_BUF_SIZE;
307  rdescptr->bufoff = 0;
308  rdescptr->stat = ETH_AM335X_RDS_OWN;
309  rdescptr++;
310  pktptr++;
311  }
312  (--rdescptr)->next = NULL;
313 
314  ethptr->rxHead = 0;
315  ethptr->rxTail = 0;
316  ethptr->isem = semcreate(0);
317  if((int32)ethptr->isem == SYSERR) {
318  return SYSERR;
319  }
320 
321  /* initialize the tx ring size */
323 
324  /* Allocate memory for tx ring */
325  ethptr->txRing = (void*)getmem(sizeof(struct eth_a_tx_desc)*
326  ethptr->txRingSize);
327  if((int32)ethptr->txRing == SYSERR) {
328  return SYSERR;
329  }
330 
331  /* Zero out the tx ring */
332  memset((char*)ethptr->txRing, NULLCH,
333  sizeof(struct eth_a_tx_desc)*ethptr->txRingSize);
334 
335  /* Allocate memory for tx buffers */
336  ethptr->txBufs = (void*)getmem(ETH_BUF_SIZE *
337  ethptr->txRingSize);
338  if((int32)ethptr->txBufs == SYSERR) {
339  return SYSERR;
340  }
341 
342  /* Zero out the tx buffers */
343  memset((char*)ethptr->txBufs, NULLCH, ETH_BUF_SIZE *
344  ethptr->txRingSize);
345 
346  /* Initialize the tx ring */
347 
348  tdescptr = (struct eth_a_tx_desc *)ethptr->txRing;
349  pktptr = (struct netpacket *)ethptr->txBufs;
350 
351  for(i = 0; i < ethptr->txRingSize; i++) {
352  tdescptr->next = NULL;
353  tdescptr->buffer = (uint32)pktptr->net_ethdst;
354  tdescptr->buflen = ETH_BUF_SIZE;
355  tdescptr->bufoff = 0;
356  tdescptr->stat = (ETH_AM335X_TDS_SOP |
360  tdescptr++;
361  pktptr++;
362  }
363 
364  ethptr->txHead = 0;
365  ethptr->txTail = 0;
366  ethptr->osem = semcreate(ethptr->txRingSize);
367  if((int32)ethptr->osem == SYSERR) {
368  return SYSERR;
369  }
370 
371  /* Enable the ALE and put it into bypass mode */
372  csrptr->ale->ctrl = (ETH_AM335X_ALECTL_EN |
374 
375  /* Put the ports 0, 1 in forwarding state */
376  csrptr->ale->portctl[0] = ETH_AM335X_ALEPCTL_FWD;
377  csrptr->ale->portctl[1] = ETH_AM335X_ALEPCTL_FWD;
378 
379  /* Start the rx and tx processes in DMA */
380  csrptr->cpdma->tx_ctrl = 1;
381  csrptr->cpdma->rx_ctrl = 1;
382 
383  /* Initialize the head desc pointers for tx and rx */
384  csrptr->stateram->tx_hdp[0] = 0;
385  csrptr->stateram->rx_hdp[0] = (uint32)ethptr->rxRing;
386 
387  /* Enable Rx and Tx in MAC */
388  csrptr->sl->macctrl |= ETH_AM335X_SLCTL_EN;
389 
390  /* Set interrupt vectors */
393 
394  /* Enable the CPDMA interrupts */
395  csrptr->cpdma->tx_intmask_set = 0x1;
396  csrptr->cpdma->rx_intmask_set = 0x1;
397 
398  /* Route the interrupts to core 0 */
399  csrptr->wr->c0_tx_en = 0x1;
400  csrptr->wr->c0_rx_en = 0x1;
401 
402  return OK;
403 }
syscall kprintf(char *fmt,...)
ポーリングI/Oを使用して、フォーマットされた文字列をコンソールに出力する。
Definition: kprintf.c:98
#define NULL
連結リスト用のNULLポインタ
Definition: kernel.h:68
#define ETH_AM335X_SS_ADDR
SSの開始アドレス
Definition: am335x_eth.h:392
Address Lookup Engine(ALE)レジスタ用の構造体
Definition: am335x_eth.h:10
Cryptographic Processor RAM DMA(CPDMA、暗号化DMA)レジスタ用の構造体
Definition: am335x_eth.h:53
#define ETH_AM335X_ALECTL_EN
Address Lookup Engine(ALE)を有効化する
Definition: am335x_eth.h:43
uint16 buflen
DMAバッファの長さ
Definition: am335x_eth.h:357
unsigned char byte
符号なし8ビット値(unsigned char)
Definition: kernel.h:7
#define ETH_PHY_10M
Definition: ether.h:61
void * rxRing
Definition: ether.h:82
uint16 stat
DMA状態
Definition: am335x_eth.h:363
uint32 txTail
Definition: ether.h:92
uint32 c0_rx_en
サブシステム コア0 RX(受信)割り込み許可レジスタ
Definition: am335x_eth.h:225
uint32 txHead
Definition: ether.h:91
#define ETH_AM335X_TDS_SOP
TX(送信)パケットの開始
Definition: am335x_eth.h:367
uint32 tx_intmask_set
TX(送信)割り込みマスクセットレジスタ
Definition: am335x_eth.h:88
sid32 semcreate(int32)
未使用セマフォを割り当て、そのセマフォへのインデックス(セマフォID)を返す。
Definition: semcreate.c:22
#define ETH_AM335X_MDIO_ADDR
Management Data Input/Output(MDIO)の開始アドレス
Definition: am335x_eth.h:390
volatile struct eth_a_mdio * mdio
MDIOレジスタ
Definition: am335x_eth.h:312
#define ETH_AM335X_SLCTL_EN
受信/送信の有効化
Definition: am335x_eth.h:170
uint32 rx_hdp[8]
RX(受信) チャネル0〜7 先頭ディスクリプタへのポインタ
Definition: am335x_eth.h:128
#define ETH_AM335X_ALEPCTL_FWD
Address Lookup Engine(ALE)制御をポートフォワード状態とする
Definition: am335x_eth.h:47
#define ETH_AM335X_RDS_OWN
DMAが所持するディスクリプタ
Definition: am335x_eth.h:340
uint32 ctrl
ALE制御レジスタ
Definition: am335x_eth.h:17
int32 dvminor
Definition: conf.h:8
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
#define ETH_AM335X_ALE_ADDR
Address Lookup Engine(ALE)の開始アドレス
Definition: am335x_eth.h:382
uint32 reset
SLソフトリセットレジスタ
Definition: am335x_eth.h:148
Ethernet subsystemレジスタ構造体
Definition: am335x_eth.h:297
DMA TX(送信)ディスクリプタ
Definition: am335x_eth.h:350
byte net_ethdst[ETH_ADDR_LEN]
Definition: net.h:17
Definition: ether.h:68
uint32 rxHead
Definition: ether.h:84
volatile struct eth_a_sl * sl
CPSW_SLレジスタ
Definition: am335x_eth.h:306
#define ETH_PHY_1000M
Definition: ether.h:63
uint32 reset
WRソフトリセットレジスタ
Definition: am335x_eth.h:217
volatile struct eth_a_ss * ss
CPSW_SSレジスタ
Definition: am335x_eth.h:308
uint32 rx_ctrl
RX(受信) 制御レジスタ
Definition: am335x_eth.h:66
#define ETH_BUF_SIZE
Definition: ether.h:34
#define ETH_AM335X_MDIOCTL_EN
Management Data Input/Output(MDIO)制御を有効化
Definition: am335x_eth.h:283
struct eth_a_tx_desc * next
次のDMA TX(受信)ディスクリプタ
Definition: am335x_eth.h:353
#define ETH_AM335X_WR_ADDR
WRの開始アドレス
Definition: am335x_eth.h:394
volatile struct eth_a_cpdma * cpdma
CPSW_CPDMAレジスタ
Definition: am335x_eth.h:302
#define OK
処理が成功した場合
Definition: kernel.h:77
byte devAddress[ETH_ADDR_LEN]
Definition: ether.h:96
DMA RX(受信)ディスクリプタ
Definition: am335x_eth.h:319
#define ETH_AM335X_STATERAM_ADDR
STATERAMの開始アドレス
Definition: am335x_eth.h:386
void * txBufs
Definition: ether.h:90
#define ETH_AM335X_CPDMA_ADDR
Cryptographic Processor RAM DMA(CPDMA、暗号化DMA)の開始アドレス
Definition: am335x_eth.h:384
uint32 reset
SSソフトリセットレジスタ
Definition: am335x_eth.h:185
struct ethcblk ethertab[1]
Definition: ethinit.c:7
uint16 bufoff
DMAバッファのオフセット
Definition: am335x_eth.h:328
Management Data Input/Output(MDIO)レジスタ用の構造体
Definition: am335x_eth.h:246
struct eth_a_rx_desc * next
次のDMA RX(受信)ディスクリプタ
Definition: am335x_eth.h:322
uint32 tx_hdp[8]
TX(送信) チャネル0〜7 先頭ディスクリプタへのポインタ
Definition: am335x_eth.h:126
int32 set_evec(uint32, uint32)
Definition: evec.c:37
uint16 stat
DMA状態
Definition: am335x_eth.h:332
uint32 reset
CPDMAソフトリセットレジスタ
Definition: am335x_eth.h:70
CPSW_SLレジスタ用の構造体
Definition: am335x_eth.h:139
volatile struct eth_a_stateram * stateram
CPSW_STATERANレジスタ
Definition: am335x_eth.h:304
uint16 buflen
DMAバッファの長さ
Definition: am335x_eth.h:326
#define ETH_AM335X_TDS_DIR
不明
Definition: am335x_eth.h:375
CPDMA_STATERAMレジスタ用の構造体
Definition: am335x_eth.h:123
CPSW_SSレジスタ用の構造体
Definition: am335x_eth.h:178
CPSW_WRレジスタ用の構造体
Definition: am335x_eth.h:212
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
#define ETH_AM335X_TDS_P1
不明
Definition: am335x_eth.h:377
void * txRing
Definition: ether.h:89
int32 eth_phy_reset(volatile struct eth_a_mdio *mdio, byte phyadr)
Definition: ethinit.c:107
uint32 c0_tx_en
サブシステム コア0 TX(送信)割り込み許可レジスタ
Definition: am335x_eth.h:227
#define ETH_AM335X_TDS_EOP
TX(送信)パケットの終了
Definition: am335x_eth.h:369
uint32 ctrl
MDIO制御レジスタ
Definition: am335x_eth.h:251
void * memset(void *, const int, int32)
指定のByteブロックに対して、同じ値をNバイト分書き込む。
Definition: memset.c:13
volatile struct eth_a_wr * wr
CPSW_WRレジスタ
Definition: am335x_eth.h:310
#define ETH_AM335X_ALECTL_BY
Address Lookup Engine(ALE)制御をBypassモードとする
Definition: am335x_eth.h:45
uint32 buffer
DMAバッファ
Definition: am335x_eth.h:324
uint32 tx_ctrl
TX(送信) 制御レジスタ
Definition: am335x_eth.h:58
uint16 bufoff
DMAバッファのオフセット
Definition: am335x_eth.h:359
Definition: net.h:16
struct eth_a_csreg eth_a_regs
Definition: ethinit.c:5
void * rxBufs
Definition: ether.h:83
#define ETH_AM335X_RX_RING_SIZE
RX(受信)リングバッファサイズ
Definition: am335x_eth.h:344
#define ETH_AM335X_TX_RING_SIZE
TX(送信)リングバッファサイズ
Definition: am335x_eth.h:379
#define ETH_AM335X_RXINT
RX(受信)の割り込みベクタ
Definition: am335x_eth.h:396
#define ETH_PHY_CTLREG_SM
Definition: ether.h:60
uint32 macctrl
DMAC制御レジスタ
Definition: am335x_eth.h:144
#define ETH_PHY_100M
Definition: ether.h:62
uint32 rx_intmask_set
RX(受信)割り込みマスクセットレジスタ
Definition: am335x_eth.h:102
unsigned int uint32
符号なし32ビット整数(unsigned int)
Definition: kernel.h:15
int32 eth_phy_read(volatile struct eth_a_mdio *mdio, byte regadr, byte phyadr, uint32 *value)
Definition: ethinit.c:13
void * csr
Definition: ether.h:76
uint32 rxRingSize
Definition: ether.h:86
uint32 txRingSize
Definition: ether.h:93
sid32 isem
Definition: ether.h:102
#define ETH_AM335X_TXINT
TX(送信)の割り込みベクタ
Definition: am335x_eth.h:398
#define ETH_PHY_CTLREG
Definition: ether.h:56
uint32 buffer
DMAバッファ
Definition: am335x_eth.h:355
#define NULLCH
NULL文字(NULL終端)
Definition: kernel.h:70
volatile struct eth_a_ale * ale
CPSW_ALEレジスタ
Definition: am335x_eth.h:300
#define ETH_PHY_CTLREG_FD
Definition: ether.h:64
uint32 rxTail
Definition: ether.h:85
#define ETH_AM335X_SLCTL_FD
全二重通信
Definition: am335x_eth.h:166
void(* dvintr)(void)
Definition: conf.h:20
#define ETH_AM335X_SL1_ADDR
SL1の開始アドレス
Definition: am335x_eth.h:388
uint32 portctl[6]
ALEポート0〜5制御レジスタ
Definition: am335x_eth.h:39
sid32 osem
Definition: ether.h:103
char * getmem(uint32)
ヒープ領域を割り当て、最下位のワードアドレスを返す。
Definition: getmem.c:25
Here is the call graph for this function:

Variable Documentation

◆ eth_a_regs

struct eth_a_csreg eth_a_regs

Definition at line 5 of file ethinit.c.

Referenced by ethinit().

◆ ethertab

struct ethcblk ethertab[1]

Definition at line 7 of file ethinit.c.

Referenced by ethcontrol(), ethhandler(), ethinit(), ethread(), and ethwrite().