Commit bf0db8b82a0f2e1abcb073fe0b72e6b4ba7c5fe0

Authored by Stefan Roese
1 parent 00a457b22e

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>

Showing 3 changed files with 29 additions and 5 deletions Side-by-side Diff

arch/arm/mach-mvebu/cpu.c
... ... @@ -50,7 +50,7 @@
50 50 {
51 51 u16 devid = (readl(MVEBU_REG_PCIE_DEVID) >> 16) & 0xffff;
52 52  
53   - if (devid == SOC_MV78460_ID)
  53 + if ((devid == SOC_MV78260_ID) || (devid == SOC_MV78460_ID))
54 54 return MVEBU_SOC_AXP;
55 55  
56 56 if (devid == SOC_88F6810_ID || devid == SOC_88F6820_ID ||
... ... @@ -69,6 +69,9 @@
69 69 puts("SoC: ");
70 70  
71 71 switch (devid) {
  72 + case SOC_MV78260_ID:
  73 + puts("MV78260-");
  74 + break;
72 75 case SOC_MV78460_ID:
73 76 puts("MV78460-");
74 77 break;
arch/arm/mach-mvebu/include/mach/soc.h
... ... @@ -11,6 +11,7 @@
11 11 #ifndef _MVEBU_SOC_H
12 12 #define _MVEBU_SOC_H
13 13  
  14 +#define SOC_MV78260_ID 0x7826
14 15 #define SOC_MV78460_ID 0x7846
15 16 #define SOC_88F6810_ID 0x6810
16 17 #define SOC_88F6820_ID 0x6820
arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
... ... @@ -190,8 +190,15 @@
190 190  
191 191 u16 ctrl_model_get(void)
192 192 {
193   - /* Right now only MV78460 supported */
  193 + /*
  194 + * SoC version can't be autodetected. So we need to rely on a define
  195 + * from the config system here.
  196 + */
  197 +#ifdef CONFIG_MV78260
  198 + return MV_78260_DEV_ID;
  199 +#else
194 200 return MV_78460_DEV_ID;
  201 +#endif
195 202 }
196 203  
197 204 u32 get_line_cfg(u32 line_num, MV_BIN_SERDES_CFG *info)
... ... @@ -202,6 +209,18 @@
202 209 return (info->line8_15 >> ((line_num - 8) << 2)) & 0xF;
203 210 }
204 211  
  212 +static int serdes_max_lines_get(void)
  213 +{
  214 + switch (ctrl_model_get()) {
  215 + case MV_78260_DEV_ID:
  216 + return 12;
  217 + case MV_78460_DEV_ID:
  218 + return 16;
  219 + }
  220 +
  221 + return 0;
  222 +}
  223 +
205 224 int serdes_phy_config(void)
206 225 {
207 226 int status = MV_OK;
208 227  
... ... @@ -226,10 +245,9 @@
226 245 u32 pex_if_num;
227 246  
228 247 /*
229   - * TODO:
230   - * Right now we only support the MV78460 with 16 serdes lines
  248 + * Get max. serdes lines count
231 249 */
232   - max_serdes_lines = 16;
  250 + max_serdes_lines = serdes_max_lines_get();
233 251 if (max_serdes_lines == 0)
234 252 return MV_OK;
235 253  
... ... @@ -253,6 +271,8 @@
253 271 if ((u8) MV_ERROR == (u8) satr11)
254 272 return MV_ERROR;
255 273 break;
  274 + default:
  275 + satr11 = 0;
256 276 }
257 277  
258 278 board_modules_scan();