Lines Matching refs:sc_bst

131 	bus_space_tag_t		 sc_bst;  member
222 bus_space_write_4(sc->sc_bst, sc->sc_bsh_txdescs, o, n); in cpsw_set_txdesc_next()
229 bus_space_write_4(sc->sc_bst, sc->sc_bsh_rxdescs, o, n); in cpsw_set_rxdesc_next()
237 bus_space_read_region_4(sc->sc_bst, sc->sc_bsh_txdescs, o, in cpsw_get_txdesc()
246 bus_space_write_region_4(sc->sc_bst, sc->sc_bsh_txdescs, o, in cpsw_set_txdesc()
255 bus_space_read_region_4(sc->sc_bst, sc->sc_bsh_rxdescs, o, in cpsw_get_rxdesc()
264 bus_space_write_region_4(sc->sc_bst, sc->sc_bsh_rxdescs, o, in cpsw_set_rxdesc()
292 bus_space_write_4(sc->sc_bst, sc->sc_bsh, MDIOCONTROL, in cpsw_mdio_init()
296 alive = bus_space_read_4(sc->sc_bst, sc->sc_bsh, MDIOALIVE) & 3; in cpsw_mdio_init()
307 link = bus_space_read_4(sc->sc_bst, sc->sc_bsh, MDIOLINK) & 3; in cpsw_mdio_init()
317 bus_space_write_4(sc->sc_bst, sc->sc_bsh, MDIOUSERPHYSEL0, in cpsw_mdio_init()
377 sc->sc_bst = faa->fa_iot; in cpsw_attach()
380 error = bus_space_map(sc->sc_bst, faa->fa_reg[0].addr, in cpsw_attach()
387 error = bus_space_subregion(sc->sc_bst, sc->sc_bsh, in cpsw_attach()
394 descs = bus_space_vaddr(sc->sc_bst, sc->sc_bsh_txdescs); in cpsw_attach()
397 error = bus_space_subregion(sc->sc_bst, sc->sc_bsh, in cpsw_attach()
404 descs = bus_space_vaddr(sc->sc_bst, sc->sc_bsh_rxdescs); in cpsw_attach()
436 idver = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_SS_IDVER); in cpsw_attach()
623 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_HDP(0), in cpsw_start()
689 if ((bus_space_read_4(sc->sc_bst, sc->sc_bsh, reg) & (1U << 31)) == 0) in cpsw_mii_wait()
705 bus_space_write_4(sc->sc_bst, sc->sc_bsh, MDIOUSERACCESS0, (1U << 31) | in cpsw_mii_readreg()
711 v = bus_space_read_4(sc->sc_bst, sc->sc_bsh, MDIOUSERACCESS0); in cpsw_mii_readreg()
729 bus_space_write_4(sc->sc_bst, sc->sc_bsh, MDIOUSERACCESS0, (1U << 31) | (1 << 30) | in cpsw_mii_writereg()
735 v = bus_space_read_4(sc->sc_bst, sc->sc_bsh, MDIOUSERACCESS0); in cpsw_mii_writereg()
818 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_SOFT_RESET, 1); in cpsw_init()
819 while(bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_SOFT_RESET) & 1); in cpsw_init()
822 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_SS_SOFT_RESET, 1); in cpsw_init()
823 while(bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_SS_SOFT_RESET) & 1); in cpsw_init()
826 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_ALE_CONTROL, (3 << 30) | 0x10); in cpsw_init()
831 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_SL_SOFT_RESET(i), 1); in cpsw_init()
832 while(bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_SL_SOFT_RESET(i)) & 1); in cpsw_init()
834 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_SL_RX_PRI_MAP(i), 0x76543210); in cpsw_init()
835 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_PORT_P_TX_PRI_MAP(i+1), 0x33221100); in cpsw_init()
836 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_SL_RX_MAXLEN(i), 0x5f2); in cpsw_init()
838 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_PORT_P_SA_HI(i+1), in cpsw_init()
841 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_PORT_P_SA_LO(i+1), in cpsw_init()
846 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_SL_MACCONTROL(i), in cpsw_init()
851 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_ALE_PORTCTL(i+1), 3); in cpsw_init()
855 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_PORT_P0_CPDMA_TX_PRI_MAP, 0x76543210); in cpsw_init()
856 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_PORT_P0_CPDMA_RX_CH_MAP, 0); in cpsw_init()
859 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_ALE_PORTCTL(0), 3); in cpsw_init()
861 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_SS_PTYPE, 0); in cpsw_init()
862 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_SS_STAT_PORT_EN, 7); in cpsw_init()
864 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_SOFT_RESET, 1); in cpsw_init()
865 while(bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_SOFT_RESET) & 1); in cpsw_init()
868 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_HDP(i), 0); in cpsw_init()
869 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_HDP(i), 0); in cpsw_init()
870 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_CP(i), 0); in cpsw_init()
871 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_CP(i), 0); in cpsw_init()
874 bus_space_set_region_4(sc->sc_bst, sc->sc_bsh_txdescs, 0, 0, in cpsw_init()
880 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_FREEBUFFER(0), 0); in cpsw_init()
882 bus_space_set_region_4(sc->sc_bst, sc->sc_bsh_rxdescs, 0, 0, in cpsw_init()
893 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_BUFFER_OFFSET, ETHER_ALIGN); in cpsw_init()
896 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_INTMASK_CLEAR, 0xFFFFFFFF); in cpsw_init()
897 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_INTMASK_CLEAR, 0xFFFFFFFF); in cpsw_init()
900 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_CONTROL, 1); in cpsw_init()
901 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_CONTROL, 1); in cpsw_init()
905 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_C_RX_IMAX(0), 2); in cpsw_init()
906 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_C_TX_IMAX(0), 2); in cpsw_init()
907 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_INT_CONTROL, 3 << 16 | CPSW_VBUSP_CLK_MHZ/4); in cpsw_init()
910 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_C_TX_EN(0), 1); in cpsw_init()
911 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_C_RX_EN(0), 1); in cpsw_init()
912 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_C_MISC_EN(0), 0x1F); in cpsw_init()
915 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_DMA_INTMASK_SET, 2); in cpsw_init()
918 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_INTMASK_SET, 1); in cpsw_init()
919 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_INTMASK_SET, 1); in cpsw_init()
922 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_CPDMA_EOI_VECTOR, CPSW_INTROFF_RXTH); in cpsw_init()
923 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_CPDMA_EOI_VECTOR, CPSW_INTROFF_RX); in cpsw_init()
924 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_CPDMA_EOI_VECTOR, CPSW_INTROFF_TX); in cpsw_init()
925 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_CPDMA_EOI_VECTOR, CPSW_INTROFF_MISC); in cpsw_init()
932 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_HDP(0), cpsw_rxdesc_paddr(sc, 0)); in cpsw_init()
965 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_INTMASK_CLEAR, 1); in cpsw_stop()
966 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_INTMASK_CLEAR, 1); in cpsw_stop()
967 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_C_TX_EN(0), 0x0); in cpsw_stop()
968 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_C_RX_EN(0), 0x0); in cpsw_stop()
969 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_C_MISC_EN(0), 0x1F); in cpsw_stop()
971 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_TEARDOWN, 0); in cpsw_stop()
972 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_TEARDOWN, 0); in cpsw_stop()
985 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_SOFT_RESET, 1); in cpsw_stop()
986 while(bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_SOFT_RESET) & 1); in cpsw_stop()
989 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_SS_SOFT_RESET, 1); in cpsw_stop()
990 while(bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_SS_SOFT_RESET) & 1); in cpsw_stop()
993 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_SL_SOFT_RESET(i), 1); in cpsw_stop()
994 while(bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_SL_SOFT_RESET(i)) & 1); in cpsw_stop()
998 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_SOFT_RESET, 1); in cpsw_stop()
999 while(bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_SOFT_RESET) & 1); in cpsw_stop()
1033 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_CPDMA_EOI_VECTOR, CPSW_INTROFF_RXTH); in cpsw_rxthintr()
1109 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_CP(0), in cpsw_rxintr()
1114 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_HDP(0), in cpsw_rxintr()
1120 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_CPDMA_EOI_VECTOR, in cpsw_rxintr()
1155 tx0_cp = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_CP(0)); in cpsw_txintr()
1158 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_CP(0), 0xfffffffc); in cpsw_txintr()
1159 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_HDP(0), 0); in cpsw_txintr()
1165 tx0_cp = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_CP(0)); in cpsw_txintr()
1208 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_CP(0), in cpsw_txintr()
1218 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_CPDMA_EOI_VECTOR, CPSW_INTROFF_TX); in cpsw_txintr()
1221 if (bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_HDP(0)) == 0) { in cpsw_txintr()
1223 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_HDP(0), in cpsw_txintr()
1245 miscstat = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_WR_C_MISC_STAT(0)); in cpsw_miscintr()
1250 dmastat = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_DMA_INTSTAT_MASKED); in cpsw_miscintr()
1255 stat = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_DMASTATUS); in cpsw_miscintr()
1257 stat = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_HDP(0)); in cpsw_miscintr()
1259 stat = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_TX_CP(0)); in cpsw_miscintr()
1261 stat = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_HDP(0)); in cpsw_miscintr()
1263 stat = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_RX_CP(0)); in cpsw_miscintr()
1268 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_DMA_INTMASK_CLEAR, dmastat); in cpsw_miscintr()
1269 dmastat = bus_space_read_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_DMA_INTSTAT_MASKED); in cpsw_miscintr()
1273 bus_space_write_4(sc->sc_bst, sc->sc_bsh, CPSW_CPDMA_CPDMA_EOI_VECTOR, CPSW_INTROFF_MISC); in cpsw_miscintr()