Lines Matching refs:fep
79 static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op) in fcc_cr_cmd() argument
81 const struct fs_platform_info *fpi = fep->fpi; in fcc_cr_cmd()
86 static int do_pd_setup(struct fs_enet_private *fep) in do_pd_setup() argument
88 struct platform_device *ofdev = to_platform_device(fep->dev); in do_pd_setup()
89 struct fs_platform_info *fpi = fep->fpi; in do_pd_setup()
92 fep->interrupt = irq_of_parse_and_map(ofdev->dev.of_node, 0); in do_pd_setup()
93 if (!fep->interrupt) in do_pd_setup()
96 fep->fcc.fccp = of_iomap(ofdev->dev.of_node, 0); in do_pd_setup()
97 if (!fep->fcc.fccp) in do_pd_setup()
100 fep->fcc.ep = of_iomap(ofdev->dev.of_node, 1); in do_pd_setup()
101 if (!fep->fcc.ep) in do_pd_setup()
104 fep->fcc.fcccp = of_iomap(ofdev->dev.of_node, 2); in do_pd_setup()
105 if (!fep->fcc.fcccp) in do_pd_setup()
108 fep->fcc.mem = (void __iomem *)cpm2_immr; in do_pd_setup()
118 iounmap(fep->fcc.fcccp); in do_pd_setup()
120 iounmap(fep->fcc.ep); in do_pd_setup()
122 iounmap(fep->fcc.fccp); in do_pd_setup()
133 struct fs_enet_private *fep = netdev_priv(dev); in setup_data() local
135 if (do_pd_setup(fep) != 0) in setup_data()
138 fep->ev_napi = FCC_NAPI_EVENT_MSK; in setup_data()
139 fep->ev = FCC_EVENT; in setup_data()
140 fep->ev_err = FCC_ERR_EVENT_MSK; in setup_data()
147 struct fs_enet_private *fep = netdev_priv(dev); in allocate_bd() local
148 const struct fs_platform_info *fpi = fep->fpi; in allocate_bd()
150 fep->ring_base = (void __iomem __force *)dma_alloc_coherent(fep->dev, in allocate_bd()
152 sizeof(cbd_t), &fep->ring_mem_addr, in allocate_bd()
154 if (fep->ring_base == NULL) in allocate_bd()
162 struct fs_enet_private *fep = netdev_priv(dev); in free_bd() local
163 const struct fs_platform_info *fpi = fep->fpi; in free_bd()
165 if (fep->ring_base) in free_bd()
166 dma_free_coherent(fep->dev, in free_bd()
168 (void __force *)fep->ring_base, fep->ring_mem_addr); in free_bd()
178 struct fs_enet_private *fep = netdev_priv(dev); in set_promiscuous_mode() local
179 fcc_t __iomem *fccp = fep->fcc.fccp; in set_promiscuous_mode()
186 struct fs_enet_private *fep = netdev_priv(dev); in set_multicast_start() local
187 fcc_enet_t __iomem *ep = fep->fcc.ep; in set_multicast_start()
195 struct fs_enet_private *fep = netdev_priv(dev); in set_multicast_one() local
196 fcc_enet_t __iomem *ep = fep->fcc.ep; in set_multicast_one()
206 fcc_cr_cmd(fep, CPM_CR_SET_GADDR); in set_multicast_one()
211 struct fs_enet_private *fep = netdev_priv(dev); in set_multicast_finish() local
212 fcc_t __iomem *fccp = fep->fcc.fccp; in set_multicast_finish()
213 fcc_enet_t __iomem *ep = fep->fcc.ep; in set_multicast_finish()
227 fep->fcc.gaddrh = R32(ep, fen_gaddrh); in set_multicast_finish()
228 fep->fcc.gaddrl = R32(ep, fen_gaddrl); in set_multicast_finish()
246 struct fs_enet_private *fep = netdev_priv(dev); in restart() local
247 const struct fs_platform_info *fpi = fep->fpi; in restart()
248 fcc_t __iomem *fccp = fep->fcc.fccp; in restart()
249 fcc_c_t __iomem *fcccp = fep->fcc.fcccp; in restart()
250 fcc_enet_t __iomem *ep = fep->fcc.ep; in restart()
263 rx_bd_base_phys = fep->ring_mem_addr; in restart()
290 memset_io(fep->fcc.mem + fpi->dpram_offset + 64, 0x88, 32); in restart()
313 W32(ep, fen_gaddrh, fep->fcc.gaddrh); in restart()
314 W32(ep, fen_gaddrl, fep->fcc.gaddrh); in restart()
375 fcc_cr_cmd(fep, CPM_CR_INIT_TRX); in restart()
408 struct fs_enet_private *fep = netdev_priv(dev); in stop() local
409 fcc_t __iomem *fccp = fep->fcc.fccp; in stop()
425 struct fs_enet_private *fep = netdev_priv(dev); in napi_clear_event_fs() local
426 fcc_t __iomem *fccp = fep->fcc.fccp; in napi_clear_event_fs()
433 struct fs_enet_private *fep = netdev_priv(dev); in napi_enable_fs() local
434 fcc_t __iomem *fccp = fep->fcc.fccp; in napi_enable_fs()
441 struct fs_enet_private *fep = netdev_priv(dev); in napi_disable_fs() local
442 fcc_t __iomem *fccp = fep->fcc.fccp; in napi_disable_fs()
454 struct fs_enet_private *fep = netdev_priv(dev); in tx_kickstart() local
455 fcc_t __iomem *fccp = fep->fcc.fccp; in tx_kickstart()
462 struct fs_enet_private *fep = netdev_priv(dev); in get_int_events() local
463 fcc_t __iomem *fccp = fep->fcc.fccp; in get_int_events()
470 struct fs_enet_private *fep = netdev_priv(dev); in clear_int_events() local
471 fcc_t __iomem *fccp = fep->fcc.fccp; in clear_int_events()
478 struct fs_enet_private *fep = netdev_priv(dev); in ev_error() local
480 dev_warn(fep->dev, "FS_ENET ERROR(s) 0x%x\n", int_events); in ev_error()
485 struct fs_enet_private *fep = netdev_priv(dev); in get_regs() local
490 memcpy_fromio(p, fep->fcc.fccp, sizeof(fcc_t)); in get_regs()
493 memcpy_fromio(p, fep->fcc.ep, sizeof(fcc_enet_t)); in get_regs()
496 memcpy_fromio(p, fep->fcc.fcccp, 1); in get_regs()
518 struct fs_enet_private *fep = netdev_priv(dev); in tx_restart() local
519 fcc_t __iomem *fccp = fep->fcc.fccp; in tx_restart()
520 const struct fs_platform_info *fpi = fep->fpi; in tx_restart()
521 fcc_enet_t __iomem *ep = fep->fcc.ep; in tx_restart()
527 last_tx_bd = fep->tx_bd_base + (fpi->tx_ring - 1); in tx_restart()
531 ((R32(ep, fen_genfcc.fcc_tbptr) - fep->ring_mem_addr) + in tx_restart()
532 fep->ring_base); in tx_restart()
534 prev_bd = (recheck_bd == fep->tx_bd_base) ? last_tx_bd : recheck_bd - 1; in tx_restart()
543 prev_bd = (prev_bd == fep->tx_bd_base) ? last_tx_bd : prev_bd - 1; in tx_restart()
551 (uint) (((void *)recheck_bd - fep->ring_base) + in tx_restart()
552 fep->ring_mem_addr)); in tx_restart()
553 fep->dirty_tx = recheck_bd; in tx_restart()
559 fcc_cr_cmd(fep, CPM_CR_RESTART_TX); in tx_restart()