Lines Matching defs:ocelot
8 #include <soc/mscc/ocelot.h>
862 static int vsc9953_gcb_soft_rst_status(struct ocelot *ocelot)
866 ocelot_field_read(ocelot, GCB_SOFT_RST_SWC_RST, &val);
871 static int vsc9953_sys_ram_init_status(struct ocelot *ocelot)
875 ocelot_field_read(ocelot, SYS_RESET_CFG_MEM_INIT, &val);
880 static int vsc9953_gcb_miim_pending_status(struct ocelot *ocelot)
884 ocelot_field_read(ocelot, GCB_MIIM_MII_STATUS_PENDING, &val);
889 static int vsc9953_gcb_miim_busy_status(struct ocelot *ocelot)
893 ocelot_field_read(ocelot, GCB_MIIM_MII_STATUS_BUSY, &val);
901 struct ocelot *ocelot = bus->priv;
905 err = readx_poll_timeout(vsc9953_gcb_miim_pending_status, ocelot,
908 dev_err(ocelot->dev, "MDIO write: pending timeout\n");
917 ocelot_write(ocelot, cmd, GCB_MIIM_MII_CMD);
925 struct ocelot *ocelot = bus->priv;
929 err = readx_poll_timeout(vsc9953_gcb_miim_pending_status, ocelot,
932 dev_err(ocelot->dev, "MDIO read: pending timeout\n");
940 ocelot_write(ocelot, cmd, GCB_MIIM_MII_CMD);
943 err = readx_poll_timeout(vsc9953_gcb_miim_busy_status, ocelot,
946 dev_err(ocelot->dev, "MDIO read: busy timeout\n");
950 val = ocelot_read(ocelot, GCB_MIIM_MII_DATA);
961 static int vsc9953_reset(struct ocelot *ocelot)
966 ocelot_field_write(ocelot, GCB_SOFT_RST_SWC_RST, 1);
968 err = readx_poll_timeout(vsc9953_gcb_soft_rst_status, ocelot, val, !val,
971 dev_err(ocelot->dev, "timeout: switch core reset\n");
976 ocelot_field_write(ocelot, SYS_RESET_CFG_MEM_ENA, 1);
977 ocelot_field_write(ocelot, SYS_RESET_CFG_MEM_INIT, 1);
979 err = readx_poll_timeout(vsc9953_sys_ram_init_status, ocelot, val, !val,
983 dev_err(ocelot->dev, "timeout: switch sram init\n");
988 ocelot_field_write(ocelot, SYS_RESET_CFG_CORE_ENA, 1);
993 static void vsc9953_phylink_validate(struct ocelot *ocelot, int port,
997 struct ocelot_port *ocelot_port = ocelot->ports[port];
1027 static int vsc9953_prevalidate_phy_mode(struct ocelot *ocelot, int port,
1067 static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot)
1069 struct felix *felix = ocelot_to_felix(ocelot);
1070 struct device *dev = ocelot->dev;
1091 bus->priv = ocelot;
1104 struct ocelot_port *ocelot_port = ocelot->ports[port];
1133 static void vsc9953_mdio_bus_free(struct ocelot *ocelot)
1135 struct felix *felix = ocelot_to_felix(ocelot);
1138 for (port = 0; port < ocelot->num_phys_ports; port++) {
1150 static void vsc9953_xmit_template_populate(struct ocelot *ocelot, int port)
1152 struct ocelot_port *ocelot_port = ocelot->ports[port];
1161 src = ocelot->num_phys_ports;
1197 struct ocelot *ocelot;
1211 ocelot = &felix->ocelot;
1212 ocelot->dev = &pdev->dev;
1213 ocelot->num_flooding_pgids = 1;
1234 ds->priv = ocelot;