]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
arm: mvebu: Add support for MV78260
authorStefan Roese <sr@denx.de>
Wed, 9 Dec 2015 10:00:51 +0000 (11:00 +0100)
committerStefan Roese <sr@denx.de>
Thu, 14 Jan 2016 13:08:59 +0000 (14:08 +0100)
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>
arch/arm/mach-mvebu/cpu.c
arch/arm/mach-mvebu/include/mach/soc.h
arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c

index 570966a4465accecd1cf6116b3a0cde2a0ef0bd2..1095f695f9b7e531fd04099d006ec949e723617b 100644 (file)
@@ -50,7 +50,7 @@ int mvebu_soc_family(void)
 {
        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 ||
@@ -69,6 +69,9 @@ int print_cpuinfo(void)
        puts("SoC:   ");
 
        switch (devid) {
+       case SOC_MV78260_ID:
+               puts("MV78260-");
+               break;
        case SOC_MV78460_ID:
                puts("MV78460-");
                break;
index b78da25b5cf35ab6ff4b39a1d25bb3d645832bad..5d4ad30afbaa0325d5cf1581d417c914a9fcd71d 100644 (file)
@@ -11,6 +11,7 @@
 #ifndef _MVEBU_SOC_H
 #define _MVEBU_SOC_H
 
+#define SOC_MV78260_ID         0x7826
 #define SOC_MV78460_ID         0x7846
 #define SOC_88F6810_ID         0x6810
 #define SOC_88F6820_ID         0x6820
index 702273aee128b28a0832c003112a639c80ee9424..976297119f56d9c07fb0889cb0516443e4cd7115 100644 (file)
@@ -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();