patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / ppc / platforms / pmac_setup.c
1 /*
2  *  arch/ppc/platforms/setup.c
3  *
4  *  PowerPC version
5  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6  *
7  *  Adapted for Power Macintosh by Paul Mackerras
8  *    Copyright (C) 1996 Paul Mackerras (paulus@cs.anu.edu.au)
9  *
10  *  Derived from "arch/alpha/kernel/setup.c"
11  *    Copyright (C) 1995 Linus Torvalds
12  *
13  *  Maintained by Benjamin Herrenschmidt (benh@kernel.crashing.org)
14  *
15  *  This program is free software; you can redistribute it and/or
16  *  modify it under the terms of the GNU General Public License
17  *  as published by the Free Software Foundation; either version
18  *  2 of the License, or (at your option) any later version.
19  *
20  */
21
22 /*
23  * bootup setup stuff..
24  */
25
26 #include <linux/config.h>
27 #include <linux/init.h>
28 #include <linux/errno.h>
29 #include <linux/sched.h>
30 #include <linux/kernel.h>
31 #include <linux/mm.h>
32 #include <linux/stddef.h>
33 #include <linux/unistd.h>
34 #include <linux/ptrace.h>
35 #include <linux/slab.h>
36 #include <linux/user.h>
37 #include <linux/a.out.h>
38 #include <linux/tty.h>
39 #include <linux/string.h>
40 #include <linux/delay.h>
41 #include <linux/ioport.h>
42 #include <linux/major.h>
43 #include <linux/initrd.h>
44 #include <linux/vt_kern.h>
45 #include <linux/console.h>
46 #include <linux/ide.h>
47 #include <linux/pci.h>
48 #include <linux/adb.h>
49 #include <linux/cuda.h>
50 #include <linux/pmu.h>
51 #include <linux/irq.h>
52 #include <linux/seq_file.h>
53 #include <linux/root_dev.h>
54
55 #include <asm/reg.h>
56 #include <asm/sections.h>
57 #include <asm/prom.h>
58 #include <asm/system.h>
59 #include <asm/pgtable.h>
60 #include <asm/bitops.h>
61 #include <asm/io.h>
62 #include <asm/pci-bridge.h>
63 #include <asm/ohare.h>
64 #include <asm/mediabay.h>
65 #include <asm/machdep.h>
66 #include <asm/dma.h>
67 #include <asm/bootx.h>
68 #include <asm/cputable.h>
69 #include <asm/btext.h>
70 #include <asm/pmac_feature.h>
71 #include <asm/time.h>
72 #include <asm/of_device.h>
73 #include "pmac_pic.h"
74 #include "mem_pieces.h"
75
76 #undef SHOW_GATWICK_IRQS
77
78 extern long pmac_time_init(void);
79 extern unsigned long pmac_get_rtc_time(void);
80 extern int pmac_set_rtc_time(unsigned long nowtime);
81 extern void pmac_read_rtc_time(void);
82 extern void pmac_calibrate_decr(void);
83 extern void pmac_pcibios_fixup(void);
84 extern void pmac_find_bridges(void);
85 extern unsigned long pmac_ide_get_base(int index);
86 extern void pmac_ide_init_hwif_ports(hw_regs_t *hw,
87         unsigned long data_port, unsigned long ctrl_port, int *irq);
88
89 extern void pmac_nvram_update(void);
90 extern unsigned char pmac_nvram_read_byte(int addr);
91 extern void pmac_nvram_write_byte(int addr, unsigned char val);
92 extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial);
93 extern void pmac_pcibios_after_init(void);
94 extern int of_show_percpuinfo(struct seq_file *m, int i);
95
96 struct device_node *memory_node;
97
98 unsigned char drive_info;
99
100 int ppc_override_l2cr = 0;
101 int ppc_override_l2cr_value;
102 int has_l2cache = 0;
103
104 static int current_root_goodness = -1;
105
106 extern char saved_command_line[];
107
108 extern int pmac_newworld;
109
110 #define DEFAULT_ROOT_DEVICE Root_SDA1   /* sda1 - slightly silly choice */
111
112 extern void zs_kgdb_hook(int tty_num);
113 static void ohare_init(void);
114 #ifdef CONFIG_BOOTX_TEXT
115 void pmac_progress(char *s, unsigned short hex);
116 #endif
117
118 sys_ctrler_t sys_ctrler = SYS_CTRLER_UNKNOWN;
119
120 #ifdef CONFIG_SMP
121 extern struct smp_ops_t psurge_smp_ops;
122 extern struct smp_ops_t core99_smp_ops;
123 #endif /* CONFIG_SMP */
124
125 int __pmac
126 pmac_show_cpuinfo(struct seq_file *m)
127 {
128         struct device_node *np;
129         char *pp;
130         int plen;
131         int mbmodel = pmac_call_feature(PMAC_FTR_GET_MB_INFO,
132                 NULL, PMAC_MB_INFO_MODEL, 0);
133         unsigned int mbflags = (unsigned int)pmac_call_feature(PMAC_FTR_GET_MB_INFO,
134                 NULL, PMAC_MB_INFO_FLAGS, 0);
135         char* mbname;
136
137         if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME, (int)&mbname) != 0)
138                 mbname = "Unknown";
139
140         /* find motherboard type */
141         seq_printf(m, "machine\t\t: ");
142         np = find_devices("device-tree");
143         if (np != NULL) {
144                 pp = (char *) get_property(np, "model", NULL);
145                 if (pp != NULL)
146                         seq_printf(m, "%s\n", pp);
147                 else
148                         seq_printf(m, "PowerMac\n");
149                 pp = (char *) get_property(np, "compatible", &plen);
150                 if (pp != NULL) {
151                         seq_printf(m, "motherboard\t:");
152                         while (plen > 0) {
153                                 int l = strlen(pp) + 1;
154                                 seq_printf(m, " %s", pp);
155                                 plen -= l;
156                                 pp += l;
157                         }
158                         seq_printf(m, "\n");
159                 }
160         } else
161                 seq_printf(m, "PowerMac\n");
162
163         /* print parsed model */
164         seq_printf(m, "detected as\t: %d (%s)\n", mbmodel, mbname);
165         seq_printf(m, "pmac flags\t: %08x\n", mbflags);
166
167         /* find l2 cache info */
168         np = find_devices("l2-cache");
169         if (np == 0)
170                 np = find_type_devices("cache");
171         if (np != 0) {
172                 unsigned int *ic = (unsigned int *)
173                         get_property(np, "i-cache-size", NULL);
174                 unsigned int *dc = (unsigned int *)
175                         get_property(np, "d-cache-size", NULL);
176                 seq_printf(m, "L2 cache\t:");
177                 has_l2cache = 1;
178                 if (get_property(np, "cache-unified", NULL) != 0 && dc) {
179                         seq_printf(m, " %dK unified", *dc / 1024);
180                 } else {
181                         if (ic)
182                                 seq_printf(m, " %dK instruction", *ic / 1024);
183                         if (dc)
184                                 seq_printf(m, "%s %dK data",
185                                            (ic? " +": ""), *dc / 1024);
186                 }
187                 pp = get_property(np, "ram-type", NULL);
188                 if (pp)
189                         seq_printf(m, " %s", pp);
190                 seq_printf(m, "\n");
191         }
192
193         /* find ram info */
194         np = find_devices("memory");
195         if (np != 0) {
196                 int n;
197                 struct reg_property *reg = (struct reg_property *)
198                         get_property(np, "reg", &n);
199
200                 if (reg != 0) {
201                         unsigned long total = 0;
202
203                         for (n /= sizeof(struct reg_property); n > 0; --n)
204                                 total += (reg++)->size;
205                         seq_printf(m, "memory\t\t: %luMB\n", total >> 20);
206                 }
207         }
208
209         /* Checks "l2cr-value" property in the registry */
210         np = find_devices("cpus");
211         if (np == 0)
212                 np = find_type_devices("cpu");
213         if (np != 0) {
214                 unsigned int *l2cr = (unsigned int *)
215                         get_property(np, "l2cr-value", NULL);
216                 if (l2cr != 0) {
217                         seq_printf(m, "l2cr override\t: 0x%x\n", *l2cr);
218                 }
219         }
220
221         /* Indicate newworld/oldworld */
222         seq_printf(m, "pmac-generation\t: %s\n",
223                    pmac_newworld ? "NewWorld" : "OldWorld");
224
225
226         return 0;
227 }
228
229 int __openfirmware
230 pmac_show_percpuinfo(struct seq_file *m, int i)
231 {
232 #ifdef CONFIG_CPU_FREQ_PMAC
233         extern unsigned int pmac_get_one_cpufreq(int i);
234         unsigned int freq = pmac_get_one_cpufreq(i);
235         if (freq != 0) {
236                 seq_printf(m, "clock\t\t: %dMHz\n", freq/1000);
237                 return 0;
238         }
239 #endif /* CONFIG_CPU_FREQ_PMAC */
240         return of_show_percpuinfo(m, i);
241 }
242
243 static volatile u32 *sysctrl_regs;
244
245 void __init
246 pmac_setup_arch(void)
247 {
248         struct device_node *cpu;
249         int *fp;
250         unsigned long pvr;
251
252         pvr = PVR_VER(mfspr(PVR));
253
254         /* Set loops_per_jiffy to a half-way reasonable value,
255            for use until calibrate_delay gets called. */
256         cpu = find_type_devices("cpu");
257         if (cpu != 0) {
258                 fp = (int *) get_property(cpu, "clock-frequency", NULL);
259                 if (fp != 0) {
260                         if (pvr == 4 || pvr >= 8)
261                                 /* 604, G3, G4 etc. */
262                                 loops_per_jiffy = *fp / HZ;
263                         else
264                                 /* 601, 603, etc. */
265                                 loops_per_jiffy = *fp / (2*HZ);
266                 } else
267                         loops_per_jiffy = 50000000 / HZ;
268         }
269
270         /* this area has the CPU identification register
271            and some registers used by smp boards */
272         sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000);
273         ohare_init();
274
275         /* Lookup PCI hosts */
276         pmac_find_bridges();
277
278         /* Checks "l2cr-value" property in the registry */
279         if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR) {
280                 struct device_node *np = find_devices("cpus");
281                 if (np == 0)
282                         np = find_type_devices("cpu");
283                 if (np != 0) {
284                         unsigned int *l2cr = (unsigned int *)
285                                 get_property(np, "l2cr-value", NULL);
286                         if (l2cr != 0) {
287                                 ppc_override_l2cr = 1;
288                                 ppc_override_l2cr_value = *l2cr;
289                                 _set_L2CR(0);
290                                 _set_L2CR(ppc_override_l2cr_value);
291                         }
292                 }
293         }
294
295         if (ppc_override_l2cr)
296                 printk(KERN_INFO "L2CR overriden (0x%x), backside cache is %s\n",
297                         ppc_override_l2cr_value, (ppc_override_l2cr_value & 0x80000000)
298                                 ? "enabled" : "disabled");
299
300 #ifdef CONFIG_KGDB
301         zs_kgdb_hook(0);
302 #endif
303
304 #ifdef CONFIG_ADB_CUDA
305         find_via_cuda();
306 #else
307         if (find_devices("via-cuda")) {
308                 printk("WARNING ! Your machine is Cuda based but your kernel\n");
309                 printk("          wasn't compiled with CONFIG_ADB_CUDA option !\n");
310         }
311 #endif
312 #ifdef CONFIG_ADB_PMU
313         find_via_pmu();
314 #else
315         if (find_devices("via-pmu")) {
316                 printk("WARNING ! Your machine is PMU based but your kernel\n");
317                 printk("          wasn't compiled with CONFIG_ADB_PMU option !\n");
318         }
319 #endif
320 #ifdef CONFIG_NVRAM
321         pmac_nvram_init();
322 #endif
323 #ifdef CONFIG_DUMMY_CONSOLE
324         conswitchp = &dummy_con;
325 #endif
326 #ifdef CONFIG_BLK_DEV_INITRD
327         if (initrd_start)
328                 ROOT_DEV = Root_RAM0;
329         else
330 #endif
331                 ROOT_DEV = DEFAULT_ROOT_DEVICE;
332
333 #ifdef CONFIG_SMP
334         /* Check for Core99 */
335         if (find_devices("uni-n") || find_devices("u3"))
336                 ppc_md.smp_ops = &core99_smp_ops;
337         else
338                 ppc_md.smp_ops = &psurge_smp_ops;
339 #endif /* CONFIG_SMP */
340
341         pci_create_OF_bus_map();
342 }
343
344 static void __init ohare_init(void)
345 {
346         /*
347          * Turn on the L2 cache.
348          * We assume that we have a PSX memory controller iff
349          * we have an ohare I/O controller.
350          */
351         if (find_devices("ohare") != NULL) {
352                 if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) {
353                         if (sysctrl_regs[4] & 0x10)
354                                 sysctrl_regs[4] |= 0x04000020;
355                         else
356                                 sysctrl_regs[4] |= 0x04000000;
357                         if(has_l2cache)
358                                 printk(KERN_INFO "Level 2 cache enabled\n");
359                 }
360         }
361 }
362
363 extern char *bootpath;
364 extern char *bootdevice;
365 void *boot_host;
366 int boot_target;
367 int boot_part;
368 extern dev_t boot_dev;
369
370 #ifdef CONFIG_SCSI
371 void __init
372 note_scsi_host(struct device_node *node, void *host)
373 {
374         int l;
375         char *p;
376
377         l = strlen(node->full_name);
378         if (bootpath != NULL && bootdevice != NULL
379             && strncmp(node->full_name, bootdevice, l) == 0
380             && (bootdevice[l] == '/' || bootdevice[l] == 0)) {
381                 boot_host = host;
382                 /*
383                  * There's a bug in OF 1.0.5.  (Why am I not surprised.)
384                  * If you pass a path like scsi/sd@1:0 to canon, it returns
385                  * something like /bandit@F2000000/gc@10/53c94@10000/sd@0,0
386                  * That is, the scsi target number doesn't get preserved.
387                  * So we pick the target number out of bootpath and use that.
388                  */
389                 p = strstr(bootpath, "/sd@");
390                 if (p != NULL) {
391                         p += 4;
392                         boot_target = simple_strtoul(p, NULL, 10);
393                         p = strchr(p, ':');
394                         if (p != NULL)
395                                 boot_part = simple_strtoul(p + 1, NULL, 10);
396                 }
397         }
398 }
399 #endif
400
401 #if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
402 static dev_t __init
403 find_ide_boot(void)
404 {
405         char *p;
406         int n;
407         dev_t __init pmac_find_ide_boot(char *bootdevice, int n);
408
409         if (bootdevice == NULL)
410                 return 0;
411         p = strrchr(bootdevice, '/');
412         if (p == NULL)
413                 return 0;
414         n = p - bootdevice;
415
416         return pmac_find_ide_boot(bootdevice, n);
417 }
418 #endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */
419
420 void __init
421 find_boot_device(void)
422 {
423 #if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
424         boot_dev = find_ide_boot();
425 #endif
426 }
427
428 static int initializing = 1;
429
430 static int pmac_late_init(void)
431 {
432         initializing = 0;
433         return 0;
434 }
435
436 late_initcall(pmac_late_init);
437
438 /* can't be __init - can be called whenever a disk is first accessed */
439 void __pmac
440 note_bootable_part(dev_t dev, int part, int goodness)
441 {
442         static int found_boot = 0;
443         char *p;
444
445         if (!initializing)
446                 return;
447         if ((goodness <= current_root_goodness) &&
448             ROOT_DEV != DEFAULT_ROOT_DEVICE)
449                 return;
450         p = strstr(saved_command_line, "root=");
451         if (p != NULL && (p == saved_command_line || p[-1] == ' '))
452                 return;
453
454         if (!found_boot) {
455                 find_boot_device();
456                 found_boot = 1;
457         }
458         if (!boot_dev || dev == boot_dev) {
459                 ROOT_DEV = dev + part;
460                 boot_dev = 0;
461                 current_root_goodness = goodness;
462         }
463 }
464
465 void __pmac
466 pmac_restart(char *cmd)
467 {
468 #ifdef CONFIG_ADB_CUDA
469         struct adb_request req;
470 #endif /* CONFIG_ADB_CUDA */
471
472         switch (sys_ctrler) {
473 #ifdef CONFIG_ADB_CUDA
474         case SYS_CTRLER_CUDA:
475                 cuda_request(&req, NULL, 2, CUDA_PACKET,
476                              CUDA_RESET_SYSTEM);
477                 for (;;)
478                         cuda_poll();
479                 break;
480 #endif /* CONFIG_ADB_CUDA */
481 #ifdef CONFIG_ADB_PMU
482         case SYS_CTRLER_PMU:
483                 pmu_restart();
484                 break;
485 #endif /* CONFIG_ADB_PMU */
486         default: ;
487         }
488 }
489
490 void __pmac
491 pmac_power_off(void)
492 {
493 #ifdef CONFIG_ADB_CUDA
494         struct adb_request req;
495 #endif /* CONFIG_ADB_CUDA */
496
497         switch (sys_ctrler) {
498 #ifdef CONFIG_ADB_CUDA
499         case SYS_CTRLER_CUDA:
500                 cuda_request(&req, NULL, 2, CUDA_PACKET,
501                              CUDA_POWERDOWN);
502                 for (;;)
503                         cuda_poll();
504                 break;
505 #endif /* CONFIG_ADB_CUDA */
506 #ifdef CONFIG_ADB_PMU
507         case SYS_CTRLER_PMU:
508                 pmu_shutdown();
509                 break;
510 #endif /* CONFIG_ADB_PMU */
511         default: ;
512         }
513 }
514
515 void __pmac
516 pmac_halt(void)
517 {
518    pmac_power_off();
519 }
520
521 /*
522  * Read in a property describing some pieces of memory.
523  */
524
525 static int __init
526 get_mem_prop(char *name, struct mem_pieces *mp)
527 {
528         struct reg_property *rp;
529         int i, s;
530         unsigned int *ip;
531         int nac = prom_n_addr_cells(memory_node);
532         int nsc = prom_n_size_cells(memory_node);
533
534         ip = (unsigned int *) get_property(memory_node, name, &s);
535         if (ip == NULL) {
536                 printk(KERN_ERR "error: couldn't get %s property on /memory\n",
537                        name);
538                 return 0;
539         }
540         s /= (nsc + nac) * 4;
541         rp = mp->regions;
542         for (i = 0; i < s; ++i, ip += nac+nsc) {
543                 if (nac >= 2 && ip[nac-2] != 0)
544                         continue;
545                 rp->address = ip[nac-1];
546                 if (nsc >= 2 && ip[nac+nsc-2] != 0)
547                         rp->size = ~0U;
548                 else
549                         rp->size = ip[nac+nsc-1];
550                 ++rp;
551         }
552         mp->n_regions = rp - mp->regions;
553
554         /* Make sure the pieces are sorted. */
555         mem_pieces_sort(mp);
556         mem_pieces_coalesce(mp);
557         return 1;
558 }
559
560 /*
561  * On systems with Open Firmware, collect information about
562  * physical RAM and which pieces are already in use.
563  * At this point, we have (at least) the first 8MB mapped with a BAT.
564  * Our text, data, bss use something over 1MB, starting at 0.
565  * Open Firmware may be using 1MB at the 4MB point.
566  */
567 unsigned long __init
568 pmac_find_end_of_memory(void)
569 {
570         unsigned long a, total;
571         struct mem_pieces phys_mem;
572
573         /*
574          * Find out where physical memory is, and check that it
575          * starts at 0 and is contiguous.  It seems that RAM is
576          * always physically contiguous on Power Macintoshes.
577          *
578          * Supporting discontiguous physical memory isn't hard,
579          * it just makes the virtual <-> physical mapping functions
580          * more complicated (or else you end up wasting space
581          * in mem_map).
582          */
583         memory_node = find_devices("memory");
584         if (memory_node == NULL || !get_mem_prop("reg", &phys_mem)
585             || phys_mem.n_regions == 0)
586                 panic("No RAM??");
587         a = phys_mem.regions[0].address;
588         if (a != 0)
589                 panic("RAM doesn't start at physical address 0");
590         total = phys_mem.regions[0].size;
591
592         if (phys_mem.n_regions > 1) {
593                 printk("RAM starting at 0x%x is not contiguous\n",
594                        phys_mem.regions[1].address);
595                 printk("Using RAM from 0 to 0x%lx\n", total-1);
596         }
597
598         return total;
599 }
600
601 void __init
602 pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
603           unsigned long r6, unsigned long r7)
604 {
605         /* isa_io_base gets set in pmac_find_bridges */
606         isa_mem_base = PMAC_ISA_MEM_BASE;
607         pci_dram_offset = PMAC_PCI_DRAM_OFFSET;
608         ISA_DMA_THRESHOLD = ~0L;
609         DMA_MODE_READ = 1;
610         DMA_MODE_WRITE = 2;
611
612         ppc_md.setup_arch     = pmac_setup_arch;
613         ppc_md.show_cpuinfo   = pmac_show_cpuinfo;
614         ppc_md.show_percpuinfo = pmac_show_percpuinfo;
615         ppc_md.irq_canonicalize = NULL;
616         ppc_md.init_IRQ       = pmac_pic_init;
617         ppc_md.get_irq        = pmac_get_irq; /* Changed later on ... */
618
619         ppc_md.pcibios_fixup  = pmac_pcibios_fixup;
620         ppc_md.pcibios_enable_device_hook = pmac_pci_enable_device_hook;
621         ppc_md.pcibios_after_init = pmac_pcibios_after_init;
622
623         ppc_md.restart        = pmac_restart;
624         ppc_md.power_off      = pmac_power_off;
625         ppc_md.halt           = pmac_halt;
626
627         ppc_md.time_init      = pmac_time_init;
628         ppc_md.set_rtc_time   = pmac_set_rtc_time;
629         ppc_md.get_rtc_time   = pmac_get_rtc_time;
630         ppc_md.calibrate_decr = pmac_calibrate_decr;
631
632         ppc_md.find_end_of_memory = pmac_find_end_of_memory;
633
634         ppc_md.feature_call   = pmac_do_feature_call;
635
636 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
637 #ifdef CONFIG_BLK_DEV_IDE_PMAC
638         ppc_ide_md.ide_init_hwif        = pmac_ide_init_hwif_ports;
639         ppc_ide_md.default_io_base      = pmac_ide_get_base;
640 #endif /* CONFIG_BLK_DEV_IDE_PMAC */
641 #endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
642
643 #ifdef CONFIG_BOOTX_TEXT
644         ppc_md.progress = pmac_progress;
645 #endif /* CONFIG_BOOTX_TEXT */
646
647         if (ppc_md.progress) ppc_md.progress("pmac_init(): exit", 0);
648
649 }
650
651 #ifdef CONFIG_BOOTX_TEXT
652 void __init
653 pmac_progress(char *s, unsigned short hex)
654 {
655         if (boot_text_mapped) {
656                 btext_drawstring(s);
657                 btext_drawchar('\n');
658         }
659 }
660 #endif /* CONFIG_BOOTX_TEXT */
661
662 static int __init
663 pmac_declare_of_platform_devices(void)
664 {
665         struct device_node *np;
666
667         np = find_devices("uni-n");
668         if (np) {
669                 for (np = np->child; np != NULL; np = np->sibling)
670                         if (strncmp(np->name, "i2c", 3) == 0) {
671                                 of_platform_device_create(np, "uni-n-i2c");
672                                 break;
673                         }
674         }
675         np = find_devices("u3");
676         if (np) {
677                 for (np = np->child; np != NULL; np = np->sibling)
678                         if (strncmp(np->name, "i2c", 3) == 0) {
679                                 of_platform_device_create(np, "u3-i2c");
680                                 break;
681                         }
682         }
683
684         np = find_devices("valkyrie");
685         if (np)
686                 of_platform_device_create(np, "valkyrie");
687         np = find_devices("platinum");
688         if (np)
689                 of_platform_device_create(np, "platinum");
690
691         return 0;
692 }
693
694 device_initcall(pmac_declare_of_platform_devices);