};
switch0: switch@1b000000 {
- compatible = "realtek,rtl83xx-switch";
+ compatible = "realtek,rtl8380-switch", "realtek,otto-switch";
interrupt-parent = <&intc>;
interrupts = <20 2>;
switch0: switch@1b000000 {
status = "okay";
- compatible = "realtek,rtl83xx-switch";
+ compatible = "realtek,rtl8392-switch", "realtek,otto-switch";
interrupt-parent = <&intc>;
interrupts = <20 2>;
};
switch0: switch@1b000000 {
- compatible = "realtek,rtl83xx-switch";
+ compatible = "realtek,rtl9301-switch", "realtek,otto-switch";
status = "okay";
interrupt-parent = <&intc>;
};
switch0: switch@1b000000 {
- compatible = "realtek,rtl83xx-switch";
+ compatible = "realtek,rtl9311-switch", "realtek,otto-switch";
status = "okay";
interrupt-parent = <&gic>;
if (ret)
return ret;
- dn = of_find_compatible_node(NULL, NULL, "realtek,rtl83xx-switch");
+ dn = of_find_compatible_node(NULL, NULL, "realtek,otto-switch");
if (!dn) {
dev_err(priv->dev, "No RTL switch node in DTS\n");
return -ENODEV;
if (err)
return err;
+ priv->r = device_get_match_data(&pdev->dev);
priv->family_id = soc_info.family;
priv->id = soc_info.id;
switch (soc_info.family) {
priv->port_mask = 0x1f;
priv->port_width = 1;
priv->irq_mask = 0x0FFFFFFF;
- priv->r = &rtl838x_reg;
priv->ds->num_ports = RTL838X_CPU_PORT + 1;
priv->fib_entries = 8192;
priv->ds->num_lag_ids = 8;
priv->port_mask = 0x3f;
priv->port_width = 2;
priv->irq_mask = 0xFFFFFFFFFFFFFULL;
- priv->r = &rtl839x_reg;
priv->ds->num_ports = RTL839X_CPU_PORT + 1;
priv->fib_entries = 16384;
priv->ds->num_lag_ids = 16;
priv->port_mask = 0x1f;
priv->port_width = 1;
priv->irq_mask = 0x0FFFFFFF;
- priv->r = &rtl930x_reg;
priv->ds->num_ports = RTL930X_CPU_PORT + 1;
priv->fib_entries = 16384;
priv->ds->num_lag_ids = 16;
priv->port_mask = 0x3f;
priv->port_width = 2;
priv->irq_mask = GENMASK_ULL(priv->cpu_port - 1, 0);
- priv->r = &rtl931x_reg;
priv->ds->num_ports = RTL931X_CPU_PORT + 1;
priv->fib_entries = 16384;
priv->ds->num_lag_ids = 16;
}
static const struct of_device_id rtl83xx_switch_of_ids[] = {
- { .compatible = "realtek,rtl83xx-switch"},
+ {
+ .compatible = "realtek,rtl8380-switch",
+ .data = &rtldsa_838x_cfg,
+ },
+ {
+ .compatible = "realtek,rtl8392-switch",
+ .data = &rtldsa_839x_cfg,
+ },
+ {
+ .compatible = "realtek,rtl9301-switch",
+ .data = &rtldsa_930x_cfg,
+ },
+ {
+ .compatible = "realtek,rtl9311-switch",
+ .data = &rtldsa_931x_cfg,
+ },
{ /* sentinel */ }
};
}
}
-const struct rtl838x_reg rtl838x_reg = {
+const struct rtldsa_config rtldsa_838x_cfg = {
.mask_port_reg_be = rtl838x_mask_port_reg,
.set_port_reg_be = rtl838x_set_port_reg,
.get_port_reg_be = rtl838x_get_port_reg,
u32 val;
};
-struct rtl838x_reg {
+struct rtldsa_config {
void (*mask_port_reg_be)(u64 clear, u64 set, int reg);
void (*set_port_reg_be)(u64 set, int reg);
u64 (*get_port_reg_be)(int reg);
int link_state_irq;
int mirror_group_ports[4];
struct mii_bus *parent_bus;
- const struct rtl838x_reg *r;
+ const struct rtldsa_config *r;
u8 cpu_port;
u8 port_mask;
u8 port_width;
}
}
-const struct rtl838x_reg rtl839x_reg = {
+const struct rtldsa_config rtldsa_839x_cfg = {
.mask_port_reg_be = rtl839x_mask_port_reg_be,
.set_port_reg_be = rtl839x_set_port_reg_be,
.get_port_reg_be = rtl839x_get_port_reg_be,
extern const struct dsa_switch_ops rtldsa_83xx_switch_ops;
extern const struct dsa_switch_ops rtldsa_93xx_switch_ops;
-extern const struct rtl838x_reg rtl838x_reg;
-extern const struct rtl838x_reg rtl839x_reg;
-extern const struct rtl838x_reg rtl930x_reg;
-extern const struct rtl838x_reg rtl931x_reg;
+extern const struct rtldsa_config rtldsa_838x_cfg;
+extern const struct rtldsa_config rtldsa_839x_cfg;
+extern const struct rtldsa_config rtldsa_930x_cfg;
+extern const struct rtldsa_config rtldsa_931x_cfg;
/* TODO actually from arch/mips/rtl838x/prom.c */
extern struct rtl83xx_soc_info soc_info;
rtldsa_930x_qos_set_scheduling_queue_weights(priv);
}
-const struct rtl838x_reg rtl930x_reg = {
+const struct rtldsa_config rtldsa_930x_cfg = {
.mask_port_reg_be = rtl838x_mask_port_reg,
.set_port_reg_be = rtl838x_set_port_reg,
.get_port_reg_be = rtl838x_get_port_reg,
sw_w32(phy_ablty_sel[3], RTLDSA_931X_SMI_PHY_ABLTY_GET_SEL + 0xc);
}
-const struct rtl838x_reg rtl931x_reg = {
+const struct rtldsa_config rtldsa_931x_cfg = {
.mask_port_reg_be = rtl839x_mask_port_reg_be,
.set_port_reg_be = rtl839x_set_port_reg_be,
.get_port_reg_be = rtl839x_get_port_reg_be,