diff options
author | Chris Dearman <chris@mips.com> | 2007-04-27 10:58:41 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-06-14 13:25:14 -0400 |
commit | b72c05262298cc2ac92edb657f5ea3a97ad5ea3d (patch) | |
tree | 41819862465a5cd6b89eb7b8bff3a79a5817064f | |
parent | eedab661a51966c454e38c17266a531aa58b4a98 (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>
-rw-r--r-- | arch/mips/mips-boards/generic/init.c | 62 | ||||
-rw-r--r-- | arch/mips/mips-boards/generic/pci.c | 20 | ||||
-rw-r--r-- | arch/mips/mips-boards/malta/malta_int.c | 42 | ||||
-rw-r--r-- | arch/mips/mips-boards/malta/malta_setup.c | 4 | ||||
-rw-r--r-- | include/asm-mips/mips-boards/generic.h | 22 | ||||
-rw-r--r-- | include/asm-mips/mips-boards/msc01_pci.h | 1 |
6 files changed, 87 insertions, 64 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 | ||
58 | int init_debug = 0; | 58 | int init_debug = 0; |
59 | 59 | ||
60 | unsigned int mips_revision_corid; | 60 | int mips_revision_corid; |
61 | int mips_revision_sconid; | ||
61 | 62 | ||
62 | /* Bonito64 system controller register base. */ | 63 | /* Bonito64 system controller register base. */ |
63 | unsigned long _pcictrl_bonito; | 64 | unsigned 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 = >64120_controller; | 158 | controller = >64120_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); |
diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c index 1cd830e3d933..1668cc21d5b5 100644 --- a/arch/mips/mips-boards/malta/malta_int.c +++ b/arch/mips/mips-boards/malta/malta_int.c | |||
@@ -53,25 +53,19 @@ static inline int mips_pcibios_iack(void) | |||
53 | * Determine highest priority pending interrupt by performing | 53 | * Determine highest priority pending interrupt by performing |
54 | * a PCI Interrupt Acknowledge cycle. | 54 | * a PCI Interrupt Acknowledge cycle. |
55 | */ | 55 | */ |
56 | switch(mips_revision_corid) { | 56 | switch (mips_revision_sconid) { |
57 | case MIPS_REVISION_CORID_CORE_MSC: | 57 | case MIPS_REVISION_SCON_SOCIT: |
58 | case MIPS_REVISION_CORID_CORE_FPGA2: | 58 | case MIPS_REVISION_SCON_ROCIT: |
59 | case MIPS_REVISION_CORID_CORE_FPGA3: | 59 | case MIPS_REVISION_SCON_SOCITSC: |
60 | case MIPS_REVISION_CORID_CORE_24K: | 60 | case MIPS_REVISION_SCON_SOCITSCP: |
61 | case MIPS_REVISION_CORID_CORE_EMUL_MSC: | ||
62 | MSC_READ(MSC01_PCI_IACK, irq); | 61 | MSC_READ(MSC01_PCI_IACK, irq); |
63 | irq &= 0xff; | 62 | irq &= 0xff; |
64 | break; | 63 | break; |
65 | case MIPS_REVISION_CORID_QED_RM5261: | 64 | case MIPS_REVISION_SCON_GT64120: |
66 | case MIPS_REVISION_CORID_CORE_LV: | ||
67 | case MIPS_REVISION_CORID_CORE_FPGA: | ||
68 | case MIPS_REVISION_CORID_CORE_FPGAR2: | ||
69 | irq = GT_READ(GT_PCI0_IACK_OFS); | 65 | irq = GT_READ(GT_PCI0_IACK_OFS); |
70 | irq &= 0xff; | 66 | irq &= 0xff; |
71 | break; | 67 | break; |
72 | case MIPS_REVISION_CORID_BONITO64: | 68 | case MIPS_REVISION_SCON_BONITO: |
73 | case MIPS_REVISION_CORID_CORE_20K: | ||
74 | case MIPS_REVISION_CORID_CORE_EMUL_BON: | ||
75 | /* The following will generate a PCI IACK cycle on the | 69 | /* The following will generate a PCI IACK cycle on the |
76 | * Bonito controller. It's a little bit kludgy, but it | 70 | * Bonito controller. It's a little bit kludgy, but it |
77 | * was the easiest way to implement it in hardware at | 71 | * was the easiest way to implement it in hardware at |
@@ -89,7 +83,7 @@ static inline int mips_pcibios_iack(void) | |||
89 | BONITO_PCIMAP_CFG = 0; | 83 | BONITO_PCIMAP_CFG = 0; |
90 | break; | 84 | break; |
91 | default: | 85 | default: |
92 | printk("Unknown Core card, don't know the system controller.\n"); | 86 | printk("Unknown system controller.\n"); |
93 | return -1; | 87 | return -1; |
94 | } | 88 | } |
95 | return irq; | 89 | return irq; |
@@ -144,27 +138,21 @@ static void corehi_irqdispatch(void) | |||
144 | Do it for the others too. | 138 | Do it for the others too. |
145 | */ | 139 | */ |
146 | 140 | ||
147 | switch(mips_revision_corid) { | 141 | switch (mips_revision_sconid) { |
148 | case MIPS_REVISION_CORID_CORE_MSC: | 142 | case MIPS_REVISION_SCON_SOCIT: |
149 | case MIPS_REVISION_CORID_CORE_FPGA2: | 143 | case MIPS_REVISION_SCON_ROCIT: |
150 | case MIPS_REVISION_CORID_CORE_FPGA3: | 144 | case MIPS_REVISION_SCON_SOCITSC: |
151 | case MIPS_REVISION_CORID_CORE_24K: | 145 | case MIPS_REVISION_SCON_SOCITSCP: |
152 | case MIPS_REVISION_CORID_CORE_EMUL_MSC: | ||
153 | ll_msc_irq(); | 146 | ll_msc_irq(); |
154 | break; | 147 | break; |
155 | case MIPS_REVISION_CORID_QED_RM5261: | 148 | case MIPS_REVISION_SCON_GT64120: |
156 | case MIPS_REVISION_CORID_CORE_LV: | ||
157 | case MIPS_REVISION_CORID_CORE_FPGA: | ||
158 | case MIPS_REVISION_CORID_CORE_FPGAR2: | ||
159 | intrcause = GT_READ(GT_INTRCAUSE_OFS); | 149 | intrcause = GT_READ(GT_INTRCAUSE_OFS); |
160 | datalo = GT_READ(GT_CPUERR_ADDRLO_OFS); | 150 | datalo = GT_READ(GT_CPUERR_ADDRLO_OFS); |
161 | datahi = GT_READ(GT_CPUERR_ADDRHI_OFS); | 151 | datahi = GT_READ(GT_CPUERR_ADDRHI_OFS); |
162 | printk("GT_INTRCAUSE = %08x\n", intrcause); | 152 | printk("GT_INTRCAUSE = %08x\n", intrcause); |
163 | printk("GT_CPUERR_ADDR = %02x%08x\n", datahi, datalo); | 153 | printk("GT_CPUERR_ADDR = %02x%08x\n", datahi, datalo); |
164 | break; | 154 | break; |
165 | case MIPS_REVISION_CORID_BONITO64: | 155 | case MIPS_REVISION_SCON_BONITO: |
166 | case MIPS_REVISION_CORID_CORE_20K: | ||
167 | case MIPS_REVISION_CORID_CORE_EMUL_BON: | ||
168 | pcibadaddr = BONITO_PCIBADADDR; | 156 | pcibadaddr = BONITO_PCIBADADDR; |
169 | pcimstat = BONITO_PCIMSTAT; | 157 | pcimstat = BONITO_PCIMSTAT; |
170 | intisr = BONITO_INTISR; | 158 | intisr = BONITO_INTISR; |
diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c index c14b7bf89950..8f1b78dfd89f 100644 --- a/arch/mips/mips-boards/malta/malta_setup.c +++ b/arch/mips/mips-boards/malta/malta_setup.c | |||
@@ -103,9 +103,7 @@ void __init plat_mem_setup(void) | |||
103 | kgdb_config (); | 103 | kgdb_config (); |
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | if ((mips_revision_corid == MIPS_REVISION_CORID_BONITO64) || | 106 | if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO) { |
107 | (mips_revision_corid == MIPS_REVISION_CORID_CORE_20K) || | ||
108 | (mips_revision_corid == MIPS_REVISION_CORID_CORE_EMUL_BON)) { | ||
109 | char *argptr; | 107 | char *argptr; |
110 | 108 | ||
111 | argptr = prom_getcmdline(); | 109 | argptr = prom_getcmdline(); |
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h index b98f1658cfd0..c8ebcc3e1267 100644 --- a/include/asm-mips/mips-boards/generic.h +++ b/include/asm-mips/mips-boards/generic.h | |||
@@ -73,12 +73,28 @@ | |||
73 | * CoreEMUL with Bonito System Controller is treated like a Core20K | 73 | * CoreEMUL with Bonito System Controller is treated like a Core20K |
74 | * CoreEMUL with SOC-it 101 System Controller is treated like a CoreMSC | 74 | * CoreEMUL with SOC-it 101 System Controller is treated like a CoreMSC |
75 | */ | 75 | */ |
76 | #define MIPS_REVISION_CORID_CORE_EMUL_BON 0x63 | 76 | #define MIPS_REVISION_CORID_CORE_EMUL_BON -1 |
77 | #define MIPS_REVISION_CORID_CORE_EMUL_MSC 0x65 | 77 | #define MIPS_REVISION_CORID_CORE_EMUL_MSC -2 |
78 | 78 | ||
79 | #define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f) | 79 | #define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f) |
80 | 80 | ||
81 | extern unsigned int mips_revision_corid; | 81 | extern int mips_revision_corid; |
82 | |||
83 | #define MIPS_REVISION_SCON_OTHER 0 | ||
84 | #define MIPS_REVISION_SCON_SOCITSC 1 | ||
85 | #define MIPS_REVISION_SCON_SOCITSCP 2 | ||
86 | |||
87 | /* Artificial SCON defines for MIPS_REVISION_SCON_OTHER */ | ||
88 | #define MIPS_REVISION_SCON_UNKNOWN -1 | ||
89 | #define MIPS_REVISION_SCON_GT64120 -2 | ||
90 | #define MIPS_REVISION_SCON_BONITO -3 | ||
91 | #define MIPS_REVISION_SCON_BRTL -4 | ||
92 | #define MIPS_REVISION_SCON_SOCIT -5 | ||
93 | #define MIPS_REVISION_SCON_ROCIT -6 | ||
94 | |||
95 | #define MIPS_REVISION_SCONID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 24) & 0xff) | ||
96 | |||
97 | extern int mips_revision_sconid; | ||
82 | 98 | ||
83 | #ifdef CONFIG_PCI | 99 | #ifdef CONFIG_PCI |
84 | extern void mips_pcibios_init(void); | 100 | extern void mips_pcibios_init(void); |
diff --git a/include/asm-mips/mips-boards/msc01_pci.h b/include/asm-mips/mips-boards/msc01_pci.h index 8eaefb837b9d..e036b7dd6deb 100644 --- a/include/asm-mips/mips-boards/msc01_pci.h +++ b/include/asm-mips/mips-boards/msc01_pci.h | |||
@@ -208,6 +208,7 @@ | |||
208 | * latter, they should be moved elsewhere. | 208 | * latter, they should be moved elsewhere. |
209 | */ | 209 | */ |
210 | #define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 | 210 | #define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 |
211 | #define MIPS_SOCITSC_PCI_REG_BASE 0x1ff10000 | ||
211 | 212 | ||
212 | extern unsigned long _pcictrl_msc; | 213 | extern unsigned long _pcictrl_msc; |
213 | 214 | ||