aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/chrp/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/chrp/setup.c')
-rw-r--r--arch/powerpc/platforms/chrp/setup.c48
1 files changed, 35 insertions, 13 deletions
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 9c08ff322290..488dbd9b51ae 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;
@@ -214,8 +226,7 @@ static void __init pegasos_set_l2cr(void)
214 /* Enable L2 cache if needed */ 226 /* Enable L2 cache if needed */
215 np = find_type_devices("cpu"); 227 np = find_type_devices("cpu");
216 if (np != NULL) { 228 if (np != NULL) {
217 unsigned int *l2cr = (unsigned int *) 229 const unsigned int *l2cr = get_property(np, "l2cr", NULL);
218 get_property (np, "l2cr", NULL);
219 if (l2cr == NULL) { 230 if (l2cr == NULL) {
220 printk ("Pegasos l2cr : no cpu l2cr property found\n"); 231 printk ("Pegasos l2cr : no cpu l2cr property found\n");
221 return; 232 return;
@@ -229,10 +240,18 @@ static void __init pegasos_set_l2cr(void)
229 } 240 }
230} 241}
231 242
243static void briq_restart(char *cmd)
244{
245 local_irq_disable();
246 if (briq_SPOR)
247 out_be32(briq_SPOR, 0);
248 for(;;);
249}
250
232void __init chrp_setup_arch(void) 251void __init chrp_setup_arch(void)
233{ 252{
234 struct device_node *root = find_path_device ("/"); 253 struct device_node *root = find_path_device ("/");
235 char *machine = NULL; 254 const char *machine = NULL;
236 255
237 /* init to some ~sane value until calibrate_delay() runs */ 256 /* init to some ~sane value until calibrate_delay() runs */
238 loops_per_jiffy = 50000000/HZ; 257 loops_per_jiffy = 50000000/HZ;
@@ -245,11 +264,16 @@ void __init chrp_setup_arch(void)
245 _chrp_type = _CHRP_IBM; 264 _chrp_type = _CHRP_IBM;
246 } else if (machine && strncmp(machine, "MOT", 3) == 0) { 265 } else if (machine && strncmp(machine, "MOT", 3) == 0) {
247 _chrp_type = _CHRP_Motorola; 266 _chrp_type = _CHRP_Motorola;
267 } else if (machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0) {
268 _chrp_type = _CHRP_briq;
269 /* Map the SPOR register on briq and change the restart hook */
270 briq_SPOR = (unsigned int *)ioremap(0xff0000e8, 4);
271 ppc_md.restart = briq_restart;
248 } else { 272 } else {
249 /* Let's assume it is an IBM chrp if all else fails */ 273 /* Let's assume it is an IBM chrp if all else fails */
250 _chrp_type = _CHRP_IBM; 274 _chrp_type = _CHRP_IBM;
251 } 275 }
252 printk("chrp type = %x\n", _chrp_type); 276 printk("chrp type = %x [%s]\n", _chrp_type, chrp_names[_chrp_type]);
253 277
254 rtas_initialize(); 278 rtas_initialize();
255 if (rtas_token("display-character") >= 0) 279 if (rtas_token("display-character") >= 0)
@@ -328,7 +352,7 @@ static void __init chrp_find_openpic(void)
328 struct device_node *np, *root; 352 struct device_node *np, *root;
329 int len, i, j; 353 int len, i, j;
330 int isu_size, idu_size; 354 int isu_size, idu_size;
331 unsigned int *iranges, *opprop = NULL; 355 const unsigned int *iranges, *opprop = NULL;
332 int oplen = 0; 356 int oplen = 0;
333 unsigned long opaddr; 357 unsigned long opaddr;
334 int na = 1; 358 int na = 1;
@@ -338,8 +362,7 @@ static void __init chrp_find_openpic(void)
338 return; 362 return;
339 root = of_find_node_by_path("/"); 363 root = of_find_node_by_path("/");
340 if (root) { 364 if (root) {
341 opprop = (unsigned int *) get_property 365 opprop = get_property(root, "platform-open-pic", &oplen);
342 (root, "platform-open-pic", &oplen);
343 na = prom_n_addr_cells(root); 366 na = prom_n_addr_cells(root);
344 } 367 }
345 if (opprop && oplen >= na * sizeof(unsigned int)) { 368 if (opprop && oplen >= na * sizeof(unsigned int)) {
@@ -356,7 +379,7 @@ static void __init chrp_find_openpic(void)
356 379
357 printk(KERN_INFO "OpenPIC at %lx\n", opaddr); 380 printk(KERN_INFO "OpenPIC at %lx\n", opaddr);
358 381
359 iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len); 382 iranges = get_property(np, "interrupt-ranges", &len);
360 if (iranges == NULL) 383 if (iranges == NULL)
361 len = 0; /* non-distributed mpic */ 384 len = 0; /* non-distributed mpic */
362 else 385 else
@@ -442,8 +465,8 @@ static void __init chrp_find_8259(void)
442 * from anyway 465 * from anyway
443 */ 466 */
444 for (np = find_devices("pci"); np != NULL; np = np->next) { 467 for (np = find_devices("pci"); np != NULL; np = np->next) {
445 unsigned int *addrp = (unsigned int *) 468 const unsigned int *addrp = get_property(np,
446 get_property(np, "8259-interrupt-acknowledge", NULL); 469 "8259-interrupt-acknowledge", NULL);
447 470
448 if (addrp == NULL) 471 if (addrp == NULL)
449 continue; 472 continue;
@@ -502,7 +525,7 @@ void __init
502chrp_init2(void) 525chrp_init2(void)
503{ 526{
504 struct device_node *device; 527 struct device_node *device;
505 unsigned int *p = NULL; 528 const unsigned int *p = NULL;
506 529
507#ifdef CONFIG_NVRAM 530#ifdef CONFIG_NVRAM
508 chrp_nvram_init(); 531 chrp_nvram_init();
@@ -520,8 +543,7 @@ chrp_init2(void)
520 */ 543 */
521 device = find_devices("rtas"); 544 device = find_devices("rtas");
522 if (device) 545 if (device)
523 p = (unsigned int *) get_property 546 p = get_property(device, "rtas-event-scan-rate", NULL);
524 (device, "rtas-event-scan-rate", NULL);
525 if (p && *p) { 547 if (p && *p) {
526 /* 548 /*
527 * Arrange to call chrp_event_scan at least *p times 549 * Arrange to call chrp_event_scan at least *p times