aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mips-boards/generic
diff options
context:
space:
mode:
authorChris Dearman <chris@mips.com>2007-04-27 10:58:41 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-06-14 13:25:14 -0400
commitb72c05262298cc2ac92edb657f5ea3a97ad5ea3d (patch)
tree41819862465a5cd6b89eb7b8bff3a79a5817064f /arch/mips/mips-boards/generic
parenteedab661a51966c454e38c17266a531aa58b4a98 (diff)
[MIPS] Malta: Fix for SOCitSC based Maltas
And an attempt to tidy up the core/controller differences. Signed-off-by: Chris Dearman <chris@mips.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mips-boards/generic')
-rw-r--r--arch/mips/mips-boards/generic/init.c62
-rw-r--r--arch/mips/mips-boards/generic/pci.c20
2 files changed, 51 insertions, 31 deletions
diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c
index 88e9c2a7a2f9..4eabc1eadd23 100644
--- a/arch/mips/mips-boards/generic/init.c
+++ b/arch/mips/mips-boards/generic/init.c
@@ -57,7 +57,8 @@ int *_prom_argv, *_prom_envp;
57 57
58int init_debug = 0; 58int init_debug = 0;
59 59
60unsigned int mips_revision_corid; 60int mips_revision_corid;
61int mips_revision_sconid;
61 62
62/* Bonito64 system controller register base. */ 63/* Bonito64 system controller register base. */
63unsigned long _pcictrl_bonito; 64unsigned long _pcictrl_bonito;
@@ -275,13 +276,38 @@ void __init prom_init(void)
275 else 276 else
276 mips_revision_corid = MIPS_REVISION_CORID_CORE_EMUL_MSC; 277 mips_revision_corid = MIPS_REVISION_CORID_CORE_EMUL_MSC;
277 } 278 }
278 switch(mips_revision_corid) { 279
280 mips_revision_sconid = MIPS_REVISION_SCONID;
281 if (mips_revision_sconid == MIPS_REVISION_SCON_OTHER) {
282 switch (mips_revision_corid) {
283 case MIPS_REVISION_CORID_QED_RM5261:
284 case MIPS_REVISION_CORID_CORE_LV:
285 case MIPS_REVISION_CORID_CORE_FPGA:
286 case MIPS_REVISION_CORID_CORE_FPGAR2:
287 mips_revision_sconid = MIPS_REVISION_SCON_GT64120;
288 break;
289 case MIPS_REVISION_CORID_CORE_EMUL_BON:
290 case MIPS_REVISION_CORID_BONITO64:
291 case MIPS_REVISION_CORID_CORE_20K:
292 mips_revision_sconid = MIPS_REVISION_SCON_BONITO;
293 break;
294 case MIPS_REVISION_CORID_CORE_MSC:
295 case MIPS_REVISION_CORID_CORE_FPGA2:
296 case MIPS_REVISION_CORID_CORE_FPGA3:
297 case MIPS_REVISION_CORID_CORE_24K:
298 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
299 mips_revision_sconid = MIPS_REVISION_SCON_SOCIT;
300 break;
301 default:
302 mips_display_message("CC Error");
303 while (1); /* We die here... */
304 }
305 }
306
307 switch (mips_revision_sconid) {
279 u32 start, map, mask, data; 308 u32 start, map, mask, data;
280 309
281 case MIPS_REVISION_CORID_QED_RM5261: 310 case MIPS_REVISION_SCON_GT64120:
282 case MIPS_REVISION_CORID_CORE_LV:
283 case MIPS_REVISION_CORID_CORE_FPGA:
284 case MIPS_REVISION_CORID_CORE_FPGAR2:
285 /* 311 /*
286 * Setup the North bridge to do Master byte-lane swapping 312 * Setup the North bridge to do Master byte-lane swapping
287 * when running in bigendian. 313 * when running in bigendian.
@@ -305,9 +331,7 @@ void __init prom_init(void)
305 set_io_port_base(MALTA_GT_PORT_BASE); 331 set_io_port_base(MALTA_GT_PORT_BASE);
306 break; 332 break;
307 333
308 case MIPS_REVISION_CORID_CORE_EMUL_BON: 334 case MIPS_REVISION_SCON_BONITO:
309 case MIPS_REVISION_CORID_BONITO64:
310 case MIPS_REVISION_CORID_CORE_20K:
311 _pcictrl_bonito_pcicfg = (unsigned long)ioremap(BONITO_PCICFG_BASE, BONITO_PCICFG_SIZE); 335 _pcictrl_bonito_pcicfg = (unsigned long)ioremap(BONITO_PCICFG_BASE, BONITO_PCICFG_SIZE);
312 336
313 /* 337 /*
@@ -334,13 +358,10 @@ void __init prom_init(void)
334 set_io_port_base(MALTA_BONITO_PORT_BASE); 358 set_io_port_base(MALTA_BONITO_PORT_BASE);
335 break; 359 break;
336 360
337 case MIPS_REVISION_CORID_CORE_MSC: 361 case MIPS_REVISION_SCON_SOCIT:
338 case MIPS_REVISION_CORID_CORE_FPGA2: 362 case MIPS_REVISION_SCON_ROCIT:
339 case MIPS_REVISION_CORID_CORE_FPGA3:
340 case MIPS_REVISION_CORID_CORE_24K:
341 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
342 _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000); 363 _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000);
343 364 mips_pci_controller:
344 mb(); 365 mb();
345 MSC_READ(MSC01_PCI_CFG, data); 366 MSC_READ(MSC01_PCI_CFG, data);
346 MSC_WRITE(MSC01_PCI_CFG, data & ~MSC01_PCI_CFG_EN_BIT); 367 MSC_WRITE(MSC01_PCI_CFG, data & ~MSC01_PCI_CFG_EN_BIT);
@@ -374,10 +395,15 @@ void __init prom_init(void)
374 set_io_port_base(MALTA_MSC_PORT_BASE); 395 set_io_port_base(MALTA_MSC_PORT_BASE);
375 break; 396 break;
376 397
398 case MIPS_REVISION_SCON_SOCITSC:
399 case MIPS_REVISION_SCON_SOCITSCP:
400 _pcictrl_msc = (unsigned long)ioremap(MIPS_SOCITSC_PCI_REG_BASE, 0x2000);
401 goto mips_pci_controller;
402
377 default: 403 default:
378 /* Unknown Core card */ 404 /* Unknown system controller */
379 mips_display_message("CC Error"); 405 mips_display_message("SC Error");
380 while(1); /* We die here... */ 406 while (1); /* We die here... */
381 } 407 }
382#endif 408#endif
383 board_nmi_handler_setup = mips_nmi_setup; 409 board_nmi_handler_setup = mips_nmi_setup;
diff --git a/arch/mips/mips-boards/generic/pci.c b/arch/mips/mips-boards/generic/pci.c
index f98d60f78658..c9852206890a 100644
--- a/arch/mips/mips-boards/generic/pci.c
+++ b/arch/mips/mips-boards/generic/pci.c
@@ -92,11 +92,8 @@ void __init mips_pcibios_init(void)
92 struct pci_controller *controller; 92 struct pci_controller *controller;
93 resource_size_t start, end, map, start1, end1, map1, map2, map3, mask; 93 resource_size_t start, end, map, start1, end1, map1, map2, map3, mask;
94 94
95 switch (mips_revision_corid) { 95 switch (mips_revision_sconid) {
96 case MIPS_REVISION_CORID_QED_RM5261: 96 case MIPS_REVISION_SCON_GT64120:
97 case MIPS_REVISION_CORID_CORE_LV:
98 case MIPS_REVISION_CORID_CORE_FPGA:
99 case MIPS_REVISION_CORID_CORE_FPGAR2:
100 /* 97 /*
101 * Due to a bug in the Galileo system controller, we need 98 * Due to a bug in the Galileo system controller, we need
102 * to setup the PCI BAR for the Galileo internal registers. 99 * to setup the PCI BAR for the Galileo internal registers.
@@ -161,9 +158,7 @@ void __init mips_pcibios_init(void)
161 controller = &gt64120_controller; 158 controller = &gt64120_controller;
162 break; 159 break;
163 160
164 case MIPS_REVISION_CORID_BONITO64: 161 case MIPS_REVISION_SCON_BONITO:
165 case MIPS_REVISION_CORID_CORE_20K:
166 case MIPS_REVISION_CORID_CORE_EMUL_BON:
167 /* Set up resource ranges from the controller's registers. */ 162 /* Set up resource ranges from the controller's registers. */
168 map = BONITO_PCIMAP; 163 map = BONITO_PCIMAP;
169 map1 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO0) >> 164 map1 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO0) >>
@@ -195,11 +190,10 @@ void __init mips_pcibios_init(void)
195 controller = &bonito64_controller; 190 controller = &bonito64_controller;
196 break; 191 break;
197 192
198 case MIPS_REVISION_CORID_CORE_MSC: 193 case MIPS_REVISION_SCON_SOCIT:
199 case MIPS_REVISION_CORID_CORE_FPGA2: 194 case MIPS_REVISION_SCON_ROCIT:
200 case MIPS_REVISION_CORID_CORE_FPGA3: 195 case MIPS_REVISION_SCON_SOCITSC:
201 case MIPS_REVISION_CORID_CORE_24K: 196 case MIPS_REVISION_SCON_SOCITSCP:
202 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
203 /* Set up resource ranges from the controller's registers. */ 197 /* Set up resource ranges from the controller's registers. */
204 MSC_READ(MSC01_PCI_SC2PMBASL, start); 198 MSC_READ(MSC01_PCI_SC2PMBASL, start);
205 MSC_READ(MSC01_PCI_SC2PMMSKL, mask); 199 MSC_READ(MSC01_PCI_SC2PMMSKL, mask);