aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-mvebu/serdes/axp
diff options
context:
space:
mode:
authorStefan Roese2015-12-09 11:00:51 +0100
committerStefan Roese2016-01-14 14:08:59 +0100
commitbf0db8b82a0f2e1abcb073fe0b72e6b4ba7c5fe0 (patch)
tree85d0af28b5050433f28552fe5890f7f459d5d012 /arch/arm/mach-mvebu/serdes/axp
parent00a457b22e193d866bc14cc6a4f26c93d18479ce (diff)
arm: mvebu: Add support for MV78260
This patch adds support for the dual core Armada XP variant, the MV78260. It has some minor differences to the 4-core MV78460, e.g. only 12 serdes lanes. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'arch/arm/mach-mvebu/serdes/axp')
-rw-r--r--arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c b/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
index 702273aee12..976297119f5 100644
--- a/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
+++ b/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
@@ -190,8 +190,15 @@ __weak MV_BIN_SERDES_CFG *board_serdes_cfg_get(u8 pex_mode)
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)
@@ -202,6 +209,18 @@ 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;
@@ -226,10 +245,9 @@ int serdes_phy_config(void)
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;
@@ -253,6 +271,8 @@ int serdes_phy_config(void)
if ((u8) MV_ERROR == (u8) satr11)
return MV_ERROR;
break;
+ default:
+ satr11 = 0;
}
board_modules_scan();