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_props *vcap;
27 const struct ptp_clock_info *ptp_caps;
28 int (*mdio_bus_alloc)(struct ocelot *ocelot);
29 void (*mdio_bus_free)(struct ocelot *ocelot);
30 void (*phylink_validate)(struct ocelot *ocelot, int port,
31 unsigned long *supported,
32 struct phylink_link_state *state);
33 int (*prevalidate_phy_mode)(struct ocelot *ocelot, int port,
34 phy_interface_t phy_mode);
35 int (*port_setup_tc)(struct dsa_switch *ds, int port,
36 enum tc_setup_type type, void *type_data);
37 void (*port_sched_speed_set)(struct ocelot *ocelot, int port,
39 void (*xmit_template_populate)(struct ocelot *ocelot, int port);
42 extern const struct dsa_switch_ops felix_switch_ops;
44 /* DSA glue / front-end for struct ocelot */
46 struct dsa_switch *ds;
47 const struct felix_info *info;
49 struct mii_bus *imdio;
50 struct lynx_pcs **pcs;
51 resource_size_t switch_base;
52 resource_size_t imdio_base;
55 struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port);
56 int felix_netdev_to_port(struct net_device *dev);