Lines Matching full:ocelot
10 #include <soc/mscc/ocelot.h>
891 static int vsc9959_gcb_soft_rst_status(struct ocelot *ocelot) in vsc9959_gcb_soft_rst_status() argument
895 ocelot_field_read(ocelot, GCB_SOFT_RST_SWC_RST, &val); in vsc9959_gcb_soft_rst_status()
900 static int vsc9959_sys_ram_init_status(struct ocelot *ocelot) in vsc9959_sys_ram_init_status() argument
902 return ocelot_read(ocelot, SYS_RAM_INIT); in vsc9959_sys_ram_init_status()
908 static int vsc9959_reset(struct ocelot *ocelot) in vsc9959_reset() argument
913 ocelot_field_write(ocelot, GCB_SOFT_RST_SWC_RST, 1); in vsc9959_reset()
915 err = readx_poll_timeout(vsc9959_gcb_soft_rst_status, ocelot, val, !val, in vsc9959_reset()
918 dev_err(ocelot->dev, "timeout: switch core reset\n"); in vsc9959_reset()
923 ocelot_write(ocelot, SYS_RAM_INIT_RAM_INIT, SYS_RAM_INIT); in vsc9959_reset()
924 err = readx_poll_timeout(vsc9959_sys_ram_init_status, ocelot, val, !val, in vsc9959_reset()
928 dev_err(ocelot->dev, "timeout: switch sram init\n"); in vsc9959_reset()
933 ocelot_field_write(ocelot, SYS_RESET_CFG_CORE_ENA, 1); in vsc9959_reset()
938 static void vsc9959_phylink_validate(struct ocelot *ocelot, int port, in vsc9959_phylink_validate() argument
942 struct ocelot_port *ocelot_port = ocelot->ports[port]; in vsc9959_phylink_validate()
975 static int vsc9959_prevalidate_phy_mode(struct ocelot *ocelot, int port, in vsc9959_prevalidate_phy_mode() argument
1017 static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) in vsc9959_mdio_bus_alloc() argument
1019 struct felix *felix = ocelot_to_felix(ocelot); in vsc9959_mdio_bus_alloc()
1021 struct device *dev = ocelot->dev; in vsc9959_mdio_bus_alloc()
1081 struct ocelot_port *ocelot_port = ocelot->ports[port]; in vsc9959_mdio_bus_alloc()
1109 static void vsc9959_mdio_bus_free(struct ocelot *ocelot) in vsc9959_mdio_bus_free() argument
1111 struct felix *felix = ocelot_to_felix(ocelot); in vsc9959_mdio_bus_free()
1114 for (port = 0; port < ocelot->num_phys_ports; port++) { in vsc9959_mdio_bus_free()
1127 static void vsc9959_sched_speed_set(struct ocelot *ocelot, int port, in vsc9959_sched_speed_set() argument
1150 ocelot_rmw_rix(ocelot, in vsc9959_sched_speed_set()
1156 static void vsc9959_new_base_time(struct ocelot *ocelot, ktime_t base_time, in vsc9959_new_base_time() argument
1164 ocelot_ptp_gettime64(&ocelot->ptp_info, &ts); in vsc9959_new_base_time()
1178 static u32 vsc9959_tas_read_cfg_status(struct ocelot *ocelot) in vsc9959_tas_read_cfg_status() argument
1180 return ocelot_read(ocelot, QSYS_TAS_PARAM_CFG_CTRL); in vsc9959_tas_read_cfg_status()
1183 static void vsc9959_tas_gcl_set(struct ocelot *ocelot, const u32 gcl_ix, in vsc9959_tas_gcl_set() argument
1186 ocelot_write(ocelot, in vsc9959_tas_gcl_set()
1190 ocelot_write(ocelot, entry->interval, QSYS_GCL_CFG_REG_2); in vsc9959_tas_gcl_set()
1193 static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port, in vsc9959_qos_port_tas_set() argument
1201 ocelot_rmw_rix(ocelot, in vsc9959_qos_port_tas_set()
1217 ocelot_rmw(ocelot, QSYS_TAS_PARAM_CFG_CTRL_PORT_NUM(port) | in vsc9959_qos_port_tas_set()
1226 val = ocelot_read(ocelot, QSYS_PARAM_STATUS_REG_8); in vsc9959_qos_port_tas_set()
1230 ocelot_rmw_rix(ocelot, in vsc9959_qos_port_tas_set()
1239 vsc9959_new_base_time(ocelot, taprio->base_time, in vsc9959_qos_port_tas_set()
1241 ocelot_write(ocelot, base_ts.tv_nsec, QSYS_PARAM_CFG_REG_1); in vsc9959_qos_port_tas_set()
1242 ocelot_write(ocelot, lower_32_bits(base_ts.tv_sec), QSYS_PARAM_CFG_REG_2); in vsc9959_qos_port_tas_set()
1244 ocelot_write(ocelot, in vsc9959_qos_port_tas_set()
1248 ocelot_write(ocelot, taprio->cycle_time, QSYS_PARAM_CFG_REG_4); in vsc9959_qos_port_tas_set()
1249 ocelot_write(ocelot, taprio->cycle_time_extension, QSYS_PARAM_CFG_REG_5); in vsc9959_qos_port_tas_set()
1252 vsc9959_tas_gcl_set(ocelot, i, &taprio->entries[i]); in vsc9959_qos_port_tas_set()
1254 ocelot_rmw(ocelot, QSYS_TAS_PARAM_CFG_CTRL_CONFIG_CHANGE, in vsc9959_qos_port_tas_set()
1258 ret = readx_poll_timeout(vsc9959_tas_read_cfg_status, ocelot, val, in vsc9959_qos_port_tas_set()
1268 struct ocelot *ocelot = ds->priv; in vsc9959_qos_port_cbs_set() local
1276 ocelot_write_gix(ocelot, QSYS_CIR_CFG_CIR_RATE(0) | in vsc9959_qos_port_cbs_set()
1280 ocelot_rmw_gix(ocelot, 0, QSYS_SE_CFG_SE_AVB_ENA, in vsc9959_qos_port_cbs_set()
1294 ocelot_write_gix(ocelot, in vsc9959_qos_port_cbs_set()
1300 ocelot_rmw_gix(ocelot, in vsc9959_qos_port_cbs_set()
1315 struct ocelot *ocelot = ds->priv; in vsc9959_port_setup_tc() local
1319 return vsc9959_qos_port_tas_set(ocelot, port, type_data); in vsc9959_port_setup_tc()
1327 static void vsc9959_xmit_template_populate(struct ocelot *ocelot, int port) in vsc9959_xmit_template_populate() argument
1329 struct ocelot_port *ocelot_port = ocelot->ports[port]; in vsc9959_xmit_template_populate()
1338 src = ocelot->num_phys_ports; in vsc9959_xmit_template_populate()
1380 struct ocelot *ocelot = (struct ocelot *)data; in felix_irq_handler() local
1390 ocelot_get_txtstamp(ocelot); in felix_irq_handler()
1399 struct ocelot *ocelot; in felix_pci_probe() local
1433 ocelot = &felix->ocelot; in felix_pci_probe()
1434 ocelot->dev = &pdev->dev; in felix_pci_probe()
1435 ocelot->num_flooding_pgids = FELIX_NUM_TC; in felix_pci_probe()
1446 "felix-intb", ocelot); in felix_pci_probe()
1452 ocelot->ptp = 1; in felix_pci_probe()
1465 ds->priv = ocelot; in felix_pci_probe()