{
u16 devid = (readl(MVEBU_REG_PCIE_DEVID) >> 16) & 0xffff;
- if (devid == SOC_MV78460_ID)
+ if ((devid == SOC_MV78260_ID) || (devid == SOC_MV78460_ID))
return MVEBU_SOC_AXP;
if (devid == SOC_88F6810_ID || devid == SOC_88F6820_ID ||
puts("SoC: ");
switch (devid) {
+ case SOC_MV78260_ID:
+ puts("MV78260-");
+ break;
case SOC_MV78460_ID:
puts("MV78460-");
break;
u16 ctrl_model_get(void)
{
- /* Right now only MV78460 supported */
+ /*
+ * SoC version can't be autodetected. So we need to rely on a define
+ * from the config system here.
+ */
+#ifdef CONFIG_MV78260
+ return MV_78260_DEV_ID;
+#else
return MV_78460_DEV_ID;
+#endif
}
u32 get_line_cfg(u32 line_num, MV_BIN_SERDES_CFG *info)
return (info->line8_15 >> ((line_num - 8) << 2)) & 0xF;
}
+static int serdes_max_lines_get(void)
+{
+ switch (ctrl_model_get()) {
+ case MV_78260_DEV_ID:
+ return 12;
+ case MV_78460_DEV_ID:
+ return 16;
+ }
+
+ return 0;
+}
+
int serdes_phy_config(void)
{
int status = MV_OK;
u32 pex_if_num;
/*
- * TODO:
- * Right now we only support the MV78460 with 16 serdes lines
+ * Get max. serdes lines count
*/
- max_serdes_lines = 16;
+ max_serdes_lines = serdes_max_lines_get();
if (max_serdes_lines == 0)
return MV_OK;
if ((u8) MV_ERROR == (u8) satr11)
return MV_ERROR;
break;
+ default:
+ satr11 = 0;
}
board_modules_scan();