aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-07-04 00:16:28 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-07 06:19:15 -0400
commit26c5032eaa64090b2a01973b0c6ea9e7f6a80fa7 (patch)
tree61cde3e5c0c5c7fe3e0cf89be2f2d5d1b9d35379 /arch/powerpc/platforms
parentf704b8d1f080ee71b7a9a88bcf585e7dd4272f4b (diff)
[POWERPC] Add briq support to CHRP
The support for Briq machines has been floating around as patches for ages. This cleans it up and adds it once for all. Some of this is based on initial code provided by Karsten Jeppesen <karsten@jeppesens.com> and mostly rewritten from scratch by me. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/chrp/pci.c42
-rw-r--r--arch/powerpc/platforms/chrp/setup.c27
2 files changed, 64 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 6802cdc3168a..6d7ac649b45e 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -257,7 +257,7 @@ chrp_find_bridges(void)
257 else 257 else
258 printk(KERN_INFO "PCI buses %d..%d", 258 printk(KERN_INFO "PCI buses %d..%d",
259 bus_range[0], bus_range[1]); 259 bus_range[0], bus_range[1]);
260 printk(" controlled by %s", dev->type); 260 printk(" controlled by %s", dev->full_name);
261 if (!is_longtrail) 261 if (!is_longtrail)
262 printk(" at %llx", (unsigned long long)r.start); 262 printk(" at %llx", (unsigned long long)r.start);
263 printk("\n"); 263 printk("\n");
@@ -289,6 +289,19 @@ chrp_find_bridges(void)
289 setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc); 289 setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc);
290 } else if (is_pegasos == 2) { 290 } else if (is_pegasos == 2) {
291 setup_peg2(hose, dev); 291 setup_peg2(hose, dev);
292 } else if (!strncmp(model, "IBM,CPC710", 10)) {
293 setup_indirect_pci(hose,
294 r.start + 0x000f8000,
295 r.start + 0x000f8010);
296 if (index == 0) {
297 dma = get_property(dev, "system-dma-base",&len);
298 if (dma && len >= sizeof(*dma)) {
299 dma = (unsigned int *)
300 (((unsigned long)dma) +
301 len - sizeof(*dma));
302 pci_dram_offset = *dma;
303 }
304 }
292 } else { 305 } else {
293 printk("No methods for %s (model %s), using RTAS\n", 306 printk("No methods for %s (model %s), using RTAS\n",
294 dev->full_name, model); 307 dev->full_name, model);
@@ -306,8 +319,29 @@ chrp_find_bridges(void)
306 printk("pci_dram_offset = %lx\n", pci_dram_offset); 319 printk("pci_dram_offset = %lx\n", pci_dram_offset);
307 } 320 }
308 } 321 }
322}
323
324/* SL82C105 IDE Control/Status Register */
325#define SL82C105_IDECSR 0x40
326
327/* Fixup for Winbond ATA quirk, required for briq */
328void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105)
329{
330 u8 progif;
309 331
310 /* Do not fixup interrupts from OF tree on pegasos */ 332 /* If non-briq machines need that fixup too, please speak up */
311 if (is_pegasos) 333 if (!machine_is(chrp) || _chrp_type != _CHRP_briq)
312 ppc_md.pcibios_fixup = NULL; 334 return;
335
336 if ((sl82c105->class & 5) != 5) {
337 printk("W83C553: Switching SL82C105 IDE to PCI native mode\n");
338 /* Enable SL82C105 PCI native IDE mode */
339 pci_read_config_byte(sl82c105, PCI_CLASS_PROG, &progif);
340 pci_write_config_byte(sl82c105, PCI_CLASS_PROG, progif | 0x05);
341 sl82c105->class |= 0x05;
342 /* Disable SL82C105 second port */
343 pci_write_config_word(sl82c105, SL82C105_IDECSR, 0x0003);
344 }
313} 345}
346DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
347 chrp_pci_fixup_winbond_ata);
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 9c08ff322290..be39742db809 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -74,6 +74,9 @@ extern irqreturn_t xmon_irq(int, void *, struct pt_regs *);
74 74
75extern unsigned long loops_per_jiffy; 75extern unsigned long loops_per_jiffy;
76 76
77/* To be replaced by RTAS when available */
78static unsigned int *briq_SPOR;
79
77#ifdef CONFIG_SMP 80#ifdef CONFIG_SMP
78extern struct smp_ops_t chrp_smp_ops; 81extern struct smp_ops_t chrp_smp_ops;
79#endif 82#endif
@@ -92,6 +95,15 @@ static const char *gg2_cachemodes[4] = {
92 "Disabled", "Write-Through", "Copy-Back", "Transparent Mode" 95 "Disabled", "Write-Through", "Copy-Back", "Transparent Mode"
93}; 96};
94 97
98static const char *chrp_names[] = {
99 "Unknown",
100 "","","",
101 "Motorola",
102 "IBM or Longtrail",
103 "Genesi Pegasos",
104 "Total Impact Briq"
105};
106
95void chrp_show_cpuinfo(struct seq_file *m) 107void chrp_show_cpuinfo(struct seq_file *m)
96{ 108{
97 int i, sdramen; 109 int i, sdramen;
@@ -229,6 +241,14 @@ static void __init pegasos_set_l2cr(void)
229 } 241 }
230} 242}
231 243
244static void briq_restart(char *cmd)
245{
246 local_irq_disable();
247 if (briq_SPOR)
248 out_be32(briq_SPOR, 0);
249 for(;;);
250}
251
232void __init chrp_setup_arch(void) 252void __init chrp_setup_arch(void)
233{ 253{
234 struct device_node *root = find_path_device ("/"); 254 struct device_node *root = find_path_device ("/");
@@ -245,11 +265,16 @@ void __init chrp_setup_arch(void)
245 _chrp_type = _CHRP_IBM; 265 _chrp_type = _CHRP_IBM;
246 } else if (machine && strncmp(machine, "MOT", 3) == 0) { 266 } else if (machine && strncmp(machine, "MOT", 3) == 0) {
247 _chrp_type = _CHRP_Motorola; 267 _chrp_type = _CHRP_Motorola;
268 } else if (machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0) {
269 _chrp_type = _CHRP_briq;
270 /* Map the SPOR register on briq and change the restart hook */
271 briq_SPOR = (unsigned int *)ioremap(0xff0000e8, 4);
272 ppc_md.restart = briq_restart;
248 } else { 273 } else {
249 /* Let's assume it is an IBM chrp if all else fails */ 274 /* Let's assume it is an IBM chrp if all else fails */
250 _chrp_type = _CHRP_IBM; 275 _chrp_type = _CHRP_IBM;
251 } 276 }
252 printk("chrp type = %x\n", _chrp_type); 277 printk("chrp type = %x [%s]\n", _chrp_type, chrp_names[_chrp_type]);
253 278
254 rtas_initialize(); 279 rtas_initialize();
255 if (rtas_token("display-character") >= 0) 280 if (rtas_token("display-character") >= 0)