aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/powermac/setup.c')
-rw-r--r--arch/powerpc/platforms/powermac/setup.c86
1 files changed, 46 insertions, 40 deletions
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 1955462f4082..4d15e396655c 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -86,11 +86,10 @@ int ppc_override_l2cr = 0;
86int ppc_override_l2cr_value; 86int ppc_override_l2cr_value;
87int has_l2cache = 0; 87int has_l2cache = 0;
88 88
89int pmac_newworld = 1; 89int pmac_newworld;
90 90
91static int current_root_goodness = -1; 91static int current_root_goodness = -1;
92 92
93extern int pmac_newworld;
94extern struct machdep_calls pmac_md; 93extern struct machdep_calls pmac_md;
95 94
96#define DEFAULT_ROOT_DEVICE Root_SDA1 /* sda1 - slightly silly choice */ 95#define DEFAULT_ROOT_DEVICE Root_SDA1 /* sda1 - slightly silly choice */
@@ -308,9 +307,10 @@ static void __init pmac_setup_arch(void)
308 for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; ) 307 for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; )
309 if (get_property(ic, "interrupt-controller", NULL)) 308 if (get_property(ic, "interrupt-controller", NULL))
310 break; 309 break;
311 pmac_newworld = (ic != NULL); 310 if (ic) {
312 if (ic) 311 pmac_newworld = 1;
313 of_node_put(ic); 312 of_node_put(ic);
313 }
314 314
315 /* Lookup PCI hosts */ 315 /* Lookup PCI hosts */
316 pmac_pci_init(); 316 pmac_pci_init();
@@ -350,6 +350,13 @@ static void __init pmac_setup_arch(void)
350 smp_ops = &psurge_smp_ops; 350 smp_ops = &psurge_smp_ops;
351#endif 351#endif
352#endif /* CONFIG_SMP */ 352#endif /* CONFIG_SMP */
353
354#ifdef CONFIG_ADB
355 if (strstr(cmd_line, "adb_sync")) {
356 extern int __adb_probe_sync;
357 __adb_probe_sync = 1;
358 }
359#endif /* CONFIG_ADB */
353} 360}
354 361
355char *bootpath; 362char *bootpath;
@@ -576,30 +583,6 @@ pmac_halt(void)
576 pmac_power_off(); 583 pmac_power_off();
577} 584}
578 585
579#ifdef CONFIG_PPC32
580void __init pmac_init(void)
581{
582 /* isa_io_base gets set in pmac_pci_init */
583 isa_mem_base = PMAC_ISA_MEM_BASE;
584 pci_dram_offset = PMAC_PCI_DRAM_OFFSET;
585 ISA_DMA_THRESHOLD = ~0L;
586 DMA_MODE_READ = 1;
587 DMA_MODE_WRITE = 2;
588
589 ppc_md = pmac_md;
590
591#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
592#ifdef CONFIG_BLK_DEV_IDE_PMAC
593 ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports;
594 ppc_ide_md.default_io_base = pmac_ide_get_base;
595#endif /* CONFIG_BLK_DEV_IDE_PMAC */
596#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
597
598 if (ppc_md.progress) ppc_md.progress("pmac_init(): exit", 0);
599
600}
601#endif
602
603/* 586/*
604 * Early initialization. 587 * Early initialization.
605 */ 588 */
@@ -621,10 +604,6 @@ static void __init pmac_init_early(void)
621 /* Probe motherboard chipset */ 604 /* Probe motherboard chipset */
622 pmac_feature_init(); 605 pmac_feature_init();
623 606
624 /* We can NAP */
625 powersave_nap = 1;
626 printk(KERN_INFO "Using native/NAP idle loop\n");
627
628 /* Initialize debug stuff */ 607 /* Initialize debug stuff */
629 udbg_scc_init(!!strstr(cmd_line, "sccdbg")); 608 udbg_scc_init(!!strstr(cmd_line, "sccdbg"));
630 udbg_adb_init(!!strstr(cmd_line, "btextdbg")); 609 udbg_adb_init(!!strstr(cmd_line, "btextdbg"));
@@ -650,6 +629,12 @@ static int __init pmac_declare_of_platform_devices(void)
650{ 629{
651 struct device_node *np; 630 struct device_node *np;
652 631
632 if (machine_is(chrp))
633 return -1;
634
635 if (!machine_is(powermac))
636 return 0;
637
653 np = of_find_node_by_name(NULL, "valkyrie"); 638 np = of_find_node_by_name(NULL, "valkyrie");
654 if (np) 639 if (np)
655 of_platform_device_create(np, "valkyrie", NULL); 640 of_platform_device_create(np, "valkyrie", NULL);
@@ -670,12 +655,15 @@ device_initcall(pmac_declare_of_platform_devices);
670/* 655/*
671 * Called very early, MMU is off, device-tree isn't unflattened 656 * Called very early, MMU is off, device-tree isn't unflattened
672 */ 657 */
673static int __init pmac_probe(int platform) 658static int __init pmac_probe(void)
674{ 659{
675#ifdef CONFIG_PPC64 660 unsigned long root = of_get_flat_dt_root();
676 if (platform != PLATFORM_POWERMAC) 661
662 if (!of_flat_dt_is_compatible(root, "Power Macintosh") &&
663 !of_flat_dt_is_compatible(root, "MacRISC"))
677 return 0; 664 return 0;
678 665
666#ifdef CONFIG_PPC64
679 /* 667 /*
680 * On U3, the DART (iommu) must be allocated now since it 668 * On U3, the DART (iommu) must be allocated now since it
681 * has an impact on htab_initialize (due to the large page it 669 * has an impact on htab_initialize (due to the large page it
@@ -685,6 +673,23 @@ static int __init pmac_probe(int platform)
685 alloc_dart_table(); 673 alloc_dart_table();
686#endif 674#endif
687 675
676#ifdef CONFIG_PPC32
677 /* isa_io_base gets set in pmac_pci_init */
678 isa_mem_base = PMAC_ISA_MEM_BASE;
679 pci_dram_offset = PMAC_PCI_DRAM_OFFSET;
680 ISA_DMA_THRESHOLD = ~0L;
681 DMA_MODE_READ = 1;
682 DMA_MODE_WRITE = 2;
683
684#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
685#ifdef CONFIG_BLK_DEV_IDE_PMAC
686 ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports;
687 ppc_ide_md.default_io_base = pmac_ide_get_base;
688#endif /* CONFIG_BLK_DEV_IDE_PMAC */
689#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
690
691#endif /* CONFIG_PPC32 */
692
688#ifdef CONFIG_PMAC_SMU 693#ifdef CONFIG_PMAC_SMU
689 /* 694 /*
690 * SMU based G5s need some memory below 2Gb, at least the current 695 * SMU based G5s need some memory below 2Gb, at least the current
@@ -713,10 +718,8 @@ static int pmac_pci_probe_mode(struct pci_bus *bus)
713} 718}
714#endif 719#endif
715 720
716struct machdep_calls __initdata pmac_md = { 721define_machine(powermac) {
717#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) 722 .name = "PowerMac",
718 .cpu_die = generic_mach_cpu_die,
719#endif
720 .probe = pmac_probe, 723 .probe = pmac_probe,
721 .setup_arch = pmac_setup_arch, 724 .setup_arch = pmac_setup_arch,
722 .init_early = pmac_init_early, 725 .init_early = pmac_init_early,
@@ -737,7 +740,7 @@ struct machdep_calls __initdata pmac_md = {
737 .progress = udbg_progress, 740 .progress = udbg_progress,
738#ifdef CONFIG_PPC64 741#ifdef CONFIG_PPC64
739 .pci_probe_mode = pmac_pci_probe_mode, 742 .pci_probe_mode = pmac_pci_probe_mode,
740 .idle_loop = native_idle, 743 .power_save = power4_idle,
741 .enable_pmcs = power4_enable_pmcs, 744 .enable_pmcs = power4_enable_pmcs,
742#ifdef CONFIG_KEXEC 745#ifdef CONFIG_KEXEC
743 .machine_kexec = default_machine_kexec, 746 .machine_kexec = default_machine_kexec,
@@ -750,4 +753,7 @@ struct machdep_calls __initdata pmac_md = {
750 .pcibios_after_init = pmac_pcibios_after_init, 753 .pcibios_after_init = pmac_pcibios_after_init,
751 .phys_mem_access_prot = pci_phys_mem_access_prot, 754 .phys_mem_access_prot = pci_phys_mem_access_prot,
752#endif 755#endif
756#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64)
757 .cpu_die = generic_mach_cpu_die,
758#endif
753}; 759};