Lines Matching refs:info

40 static void init_eth_info(struct fec_info_s *info)  in init_eth_info()  argument
45 if (info->index == 0) in init_eth_info()
48 info->rxbd = (cbd_t *)DBUF_LENGTH; in init_eth_info()
51 info->rxbd = (cbd_t *)((u32)info->rxbd + tmp); in init_eth_info()
52 tmp = (u32)info->rxbd; in init_eth_info()
53 info->txbd = in init_eth_info()
54 (cbd_t *)((u32)info->txbd + tmp + in init_eth_info()
56 tmp = (u32)info->txbd; in init_eth_info()
57 info->txbuf = in init_eth_info()
58 (char *)((u32)info->txbuf + tmp + in init_eth_info()
60 tmp = (u32)info->txbuf; in init_eth_info()
62 info->rxbd = in init_eth_info()
65 info->txbd = in init_eth_info()
68 info->txbuf = in init_eth_info()
73 printf("rxbd %x txbd %x\n", (int)info->rxbd, (int)info->txbd); in init_eth_info()
75 info->phy_name = (char *)memalign(CONFIG_SYS_CACHELINE_SIZE, 32); in init_eth_info()
78 static void fec_reset(struct fec_info_s *info) in fec_reset() argument
80 volatile fec_t *fecp = (fec_t *)(info->iobase); in fec_reset()
129 struct fec_info_s *info = dev_get_priv(dev); in dbg_fec_regs() local
130 volatile fec_t *fecp = (fec_t *)(info->iobase); in dbg_fec_regs()
279 struct fec_info_s *info = dev_get_priv(dev); in mcffec_init() local
280 volatile fec_t *fecp = (fec_t *) (info->iobase); in mcffec_init()
284 fecpin_setclear(info, 1); in mcffec_init()
285 fec_reset(info); in mcffec_init()
292 set_fec_duplex_speed(fecp, info->dup_spd); in mcffec_init()
306 if (info->index == 0) in mcffec_init()
334 info->rx_idx = 0; in mcffec_init()
335 info->tx_idx = 0; in mcffec_init()
343 info->rxbd[i].cbd_sc = BD_ENET_RX_EMPTY; in mcffec_init()
344 info->rxbd[i].cbd_datlen = 0; /* Reset */ in mcffec_init()
345 info->rxbd[i].cbd_bufaddr = (uint) net_rx_packets[i]; in mcffec_init()
347 info->rxbd[PKTBUFSRX - 1].cbd_sc |= BD_ENET_RX_WRAP; in mcffec_init()
355 info->txbd[i].cbd_sc = BD_ENET_TX_LAST | BD_ENET_TX_TC; in mcffec_init()
356 info->txbd[i].cbd_datlen = 0; /* Reset */ in mcffec_init()
357 info->txbd[i].cbd_bufaddr = (uint) (&info->txbuf[0]); in mcffec_init()
359 info->txbd[TX_BUF_CNT - 1].cbd_sc |= BD_ENET_TX_WRAP; in mcffec_init()
362 fecp->erdsr = (unsigned int)(&info->rxbd[0]); in mcffec_init()
363 fecp->etdsr = (unsigned int)(&info->txbd[0]); in mcffec_init()
378 struct fec_info_s *info = dev_get_priv(dev); in mcffec_send() local
379 volatile fec_t *fecp = (fec_t *)info->iobase; in mcffec_send()
383 miiphy_read(dev->name, info->phy_addr, MII_BMSR, &phy_status); in mcffec_send()
389 while ((info->txbd[info->tx_idx].cbd_sc & BD_ENET_TX_READY) && in mcffec_send()
390 (j < info->to_loop)) { in mcffec_send()
394 if (j >= info->to_loop) in mcffec_send()
397 info->txbd[info->tx_idx].cbd_bufaddr = (uint)packet; in mcffec_send()
398 info->txbd[info->tx_idx].cbd_datlen = length; in mcffec_send()
399 info->txbd[info->tx_idx].cbd_sc |= BD_ENET_TX_RDY_LST; in mcffec_send()
420 while ((info->txbd[info->tx_idx].cbd_sc & BD_ENET_TX_READY) && in mcffec_send()
421 (j < info->to_loop)) { in mcffec_send()
425 if (j >= info->to_loop) in mcffec_send()
431 info->txbd[info->tx_idx].cbd_sc, in mcffec_send()
432 (info->txbd[info->tx_idx].cbd_sc & 0x003C) >> 2); in mcffec_send()
436 rc = (info->txbd[info->tx_idx].cbd_sc & BD_ENET_TX_STATS); in mcffec_send()
437 info->tx_idx = (info->tx_idx + 1) % TX_BUF_CNT; in mcffec_send()
444 struct fec_info_s *info = dev_get_priv(dev); in mcffec_recv() local
445 volatile fec_t *fecp = (fec_t *)info->iobase; in mcffec_recv()
453 if (info->rxbd[info->rx_idx].cbd_sc & BD_ENET_RX_EMPTY) in mcffec_recv()
456 length = info->rxbd[info->rx_idx].cbd_datlen; in mcffec_recv()
458 if (info->rxbd[info->rx_idx].cbd_sc & 0x003f) { in mcffec_recv()
461 info->rxbd[info->rx_idx].cbd_sc); in mcffec_recv()
468 *packetp = net_rx_packets[info->rx_idx]; in mcffec_recv()
474 info->rxbd[info->rx_idx].cbd_datlen = 0; in mcffec_recv()
477 if (info->rx_idx == LAST_PKTBUFSRX) { in mcffec_recv()
478 info->rxbd[PKTBUFSRX - 1].cbd_sc = BD_ENET_RX_W_E; in mcffec_recv()
479 info->rx_idx = 0; in mcffec_recv()
481 info->rxbd[info->rx_idx].cbd_sc = BD_ENET_RX_EMPTY; in mcffec_recv()
482 info->rx_idx++; in mcffec_recv()
496 struct fec_info_s *info = dev_get_priv(dev); in mcffec_halt() local
498 fec_reset(info); in mcffec_halt()
499 fecpin_setclear(info, 0); in mcffec_halt()
501 info->rx_idx = 0; in mcffec_halt()
502 info->tx_idx = 0; in mcffec_halt()
504 memset(info->rxbd, 0, PKTBUFSRX * sizeof(cbd_t)); in mcffec_halt()
505 memset(info->txbd, 0, TX_BUF_CNT * sizeof(cbd_t)); in mcffec_halt()
506 memset(info->txbuf, 0, DBUF_LENGTH); in mcffec_halt()
523 struct fec_info_s *info = dev_get_priv(dev); in mcffec_probe() local
528 info->index = dev_seq(dev); in mcffec_probe()
529 info->iobase = pdata->iobase; in mcffec_probe()
530 info->phy_addr = -1; in mcffec_probe()
537 if (fec_idx == info->index) { in mcffec_probe()
538 fec_iobase = info->iobase; in mcffec_probe()
546 info->miibase = fec_iobase; in mcffec_probe()
551 info->phy_addr = fdt32_to_cpu(*val); in mcffec_probe()
555 info->to_loop = fdt32_to_cpu(*val); in mcffec_probe()
557 init_eth_info(info); in mcffec_probe()
560 info->bus = mdio_alloc(); in mcffec_probe()
561 if (!info->bus) in mcffec_probe()
563 strcpy(info->bus->name, dev->name); in mcffec_probe()
564 info->bus->read = mcffec_miiphy_read; in mcffec_probe()
565 info->bus->write = mcffec_miiphy_write; in mcffec_probe()
567 retval = mdio_register(info->bus); in mcffec_probe()