1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright 2019 NXP Semiconductors
7 #define ocelot_to_felix(o) container_of((o), struct felix, ocelot)
10 /* Platform-specific information */
12 const struct resource *target_io_res;
13 const struct resource *port_io_res;
14 const struct resource *imdio_res;
15 const struct reg_field *regfields;
16 const u32 *const *map;
17 const struct ocelot_ops *ops;
20 const struct ocelot_stat_layout *stats_layout;
21 unsigned int num_stats;
24 struct vcap_field *vcap_is2_keys;
25 struct vcap_field *vcap_is2_actions;
26 const struct vcap_props *vcap;
29 int (*mdio_bus_alloc)(struct ocelot *ocelot);
30 void (*mdio_bus_free)(struct ocelot *ocelot);
31 void (*pcs_config)(struct ocelot *ocelot, int port,
32 unsigned int link_an_mode,
33 const struct phylink_link_state *state);
34 void (*pcs_link_up)(struct ocelot *ocelot, int port,
35 unsigned int link_an_mode,
36 phy_interface_t interface,
37 int speed, int duplex);
38 void (*pcs_link_state)(struct ocelot *ocelot, int port,
39 struct phylink_link_state *state);
40 void (*phylink_validate)(struct ocelot *ocelot, int port,
41 unsigned long *supported,
42 struct phylink_link_state *state);
43 int (*prevalidate_phy_mode)(struct ocelot *ocelot, int port,
44 phy_interface_t phy_mode);
45 int (*port_setup_tc)(struct dsa_switch *ds, int port,
46 enum tc_setup_type type, void *type_data);
47 void (*port_sched_speed_set)(struct ocelot *ocelot, int port,
49 void (*xmit_template_populate)(struct ocelot *ocelot, int port);
52 extern const struct dsa_switch_ops felix_switch_ops;
53 extern struct pci_driver felix_vsc9959_pci_driver;
54 extern struct platform_driver seville_vsc9953_driver;
56 /* DSA glue / front-end for struct ocelot */
58 struct dsa_switch *ds;
59 const struct felix_info *info;
61 struct mii_bus *imdio;
62 struct phy_device **pcs;
63 resource_size_t switch_base;
64 resource_size_t imdio_base;
67 void vsc9959_pcs_link_state(struct ocelot *ocelot, int port,
68 struct phylink_link_state *state);
69 void vsc9959_pcs_config(struct ocelot *ocelot, int port,
70 unsigned int link_an_mode,
71 const struct phylink_link_state *state);
72 void vsc9959_pcs_link_up(struct ocelot *ocelot, int port,
73 unsigned int link_an_mode,
74 phy_interface_t interface,
75 int speed, int duplex);
76 void vsc9959_mdio_bus_free(struct ocelot *ocelot);