The function rtl93xx_setup() is called by both RTL930x and RTL931x. But
only the RTL930x specific function to print port matrix was called.
Unfortuntaly, RTL931x needs a different function to access the correct
registers to retrieve the port matrix information.
It is therefore necessary differentiate in rtl93xx_setup between the
SoC families before calling the appropriate function.
Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19572
Signed-off-by: Robert Marko <robimarko@gmail.com>
}
priv->r->traffic_set(priv->cpu_port, BIT_ULL(priv->cpu_port));
- rtl930x_print_matrix();
+ if (priv->family_id == RTL9300_FAMILY_ID)
+ rtl930x_print_matrix();
+ else if (priv->family_id == RTL9310_FAMILY_ID)
+ rtl931x_print_matrix();
/* TODO: Initialize statistics */
rtldsa_init_counters(priv);
int rtl931x_sds_cmu_band_get(int sds, phy_interface_t mode);
int rtl931x_sds_cmu_band_set(int sds, bool enable, u32 band, phy_interface_t mode);
extern void rtl931x_sds_init(u32 sds, phy_interface_t mode);
+void rtl931x_print_matrix(void);
int rtl83xx_lag_add(struct dsa_switch *ds, int group, int port, struct netdev_lag_upper_info *info);
int rtl83xx_lag_del(struct dsa_switch *ds, int group, int port);
void rtl931x_print_matrix(void)
{
- volatile u64 *ptr = RTL838X_SW_BASE + RTL839X_PORT_ISO_CTRL(0);
+ struct table_reg *r = rtl_table_get(RTL9310_TBL_2, 1);
- for (int i = 0; i < 52; i += 4)
- pr_debug("> %16llx %16llx %16llx %16llx\n",
- ptr[i + 0], ptr[i + 1], ptr[i + 2], ptr[i + 3]);
- pr_debug("CPU_PORT> %16llx\n", ptr[52]);
+ for (int i = 0; i < 64; i++) {
+ rtl_table_read(r, i);
+ pr_info("> %08x %08x\n", sw_r32(rtl_table_data(r, 0)),
+ sw_r32(rtl_table_data(r, 1)));
+ }
+ rtl_table_release(r);
}
void rtl931x_set_receive_management_action(int port, rma_ctrl_t type, action_type_t action)