diff options
Diffstat (limited to 'arch/powerpc/platforms/powermac')
-rw-r--r-- | arch/powerpc/platforms/powermac/Kconfig | 20 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/backlight.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/cpufreq_32.c | 24 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/cpufreq_64.c | 16 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/feature.c | 101 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/low_i2c.c | 15 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pci.c | 41 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pfunc_base.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pfunc_core.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pic.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 61 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/smp.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/time.c | 38 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/udbg_scc.c | 6 |
14 files changed, 186 insertions, 171 deletions
diff --git a/arch/powerpc/platforms/powermac/Kconfig b/arch/powerpc/platforms/powermac/Kconfig new file mode 100644 index 000000000000..5b7afe50039a --- /dev/null +++ b/arch/powerpc/platforms/powermac/Kconfig | |||
@@ -0,0 +1,20 @@ | |||
1 | config PPC_PMAC | ||
2 | bool "Apple PowerMac based machines" | ||
3 | depends on PPC_MULTIPLATFORM | ||
4 | select MPIC | ||
5 | select PPC_INDIRECT_PCI if PPC32 | ||
6 | select PPC_MPC106 if PPC32 | ||
7 | select PPC_NATIVE | ||
8 | default y | ||
9 | |||
10 | config PPC_PMAC64 | ||
11 | bool | ||
12 | depends on PPC_PMAC && POWER4 | ||
13 | select MPIC | ||
14 | select U3_DART | ||
15 | select MPIC_U3_HT_IRQS | ||
16 | select GENERIC_TBSYNC | ||
17 | select PPC_970_NAP | ||
18 | default y | ||
19 | |||
20 | |||
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c index de7440e62cc4..d679964ae2ab 100644 --- a/arch/powerpc/platforms/powermac/backlight.c +++ b/arch/powerpc/platforms/powermac/backlight.c | |||
@@ -56,13 +56,16 @@ struct backlight_device *pmac_backlight; | |||
56 | 56 | ||
57 | int pmac_has_backlight_type(const char *type) | 57 | int pmac_has_backlight_type(const char *type) |
58 | { | 58 | { |
59 | struct device_node* bk_node = find_devices("backlight"); | 59 | struct device_node* bk_node = of_find_node_by_name(NULL, "backlight"); |
60 | 60 | ||
61 | if (bk_node) { | 61 | if (bk_node) { |
62 | const char *prop = get_property(bk_node, | 62 | const char *prop = of_get_property(bk_node, |
63 | "backlight-control", NULL); | 63 | "backlight-control", NULL); |
64 | if (prop && strncmp(prop, type, strlen(type)) == 0) | 64 | if (prop && strncmp(prop, type, strlen(type)) == 0) { |
65 | of_node_put(bk_node); | ||
65 | return 1; | 66 | return 1; |
67 | } | ||
68 | of_node_put(bk_node); | ||
66 | } | 69 | } |
67 | 70 | ||
68 | return 0; | 71 | return 0; |
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c index c2b6b4134f68..8943a9456bb7 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c | |||
@@ -421,7 +421,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
421 | 421 | ||
422 | static u32 read_gpio(struct device_node *np) | 422 | static u32 read_gpio(struct device_node *np) |
423 | { | 423 | { |
424 | const u32 *reg = get_property(np, "reg", NULL); | 424 | const u32 *reg = of_get_property(np, "reg", NULL); |
425 | u32 offset; | 425 | u32 offset; |
426 | 426 | ||
427 | if (reg == NULL) | 427 | if (reg == NULL) |
@@ -521,13 +521,14 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
521 | int lenp, rc; | 521 | int lenp, rc; |
522 | const u32 *freqs, *ratio; | 522 | const u32 *freqs, *ratio; |
523 | 523 | ||
524 | freqs = get_property(cpunode, "bus-frequencies", &lenp); | 524 | freqs = of_get_property(cpunode, "bus-frequencies", &lenp); |
525 | lenp /= sizeof(u32); | 525 | lenp /= sizeof(u32); |
526 | if (freqs == NULL || lenp != 2) { | 526 | if (freqs == NULL || lenp != 2) { |
527 | printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n"); | 527 | printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n"); |
528 | return 1; | 528 | return 1; |
529 | } | 529 | } |
530 | ratio = get_property(cpunode, "processor-to-bus-ratio*2", NULL); | 530 | ratio = of_get_property(cpunode, "processor-to-bus-ratio*2", |
531 | NULL); | ||
531 | if (ratio == NULL) { | 532 | if (ratio == NULL) { |
532 | printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); | 533 | printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); |
533 | return 1; | 534 | return 1; |
@@ -562,7 +563,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
562 | /* If we use the PMU, look for the min & max frequencies in the | 563 | /* If we use the PMU, look for the min & max frequencies in the |
563 | * device-tree | 564 | * device-tree |
564 | */ | 565 | */ |
565 | value = get_property(cpunode, "min-clock-frequency", NULL); | 566 | value = of_get_property(cpunode, "min-clock-frequency", NULL); |
566 | if (!value) | 567 | if (!value) |
567 | return 1; | 568 | return 1; |
568 | low_freq = (*value) / 1000; | 569 | low_freq = (*value) / 1000; |
@@ -571,7 +572,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
571 | if (low_freq < 100000) | 572 | if (low_freq < 100000) |
572 | low_freq *= 10; | 573 | low_freq *= 10; |
573 | 574 | ||
574 | value = get_property(cpunode, "max-clock-frequency", NULL); | 575 | value = of_get_property(cpunode, "max-clock-frequency", NULL); |
575 | if (!value) | 576 | if (!value) |
576 | return 1; | 577 | return 1; |
577 | hi_freq = (*value) / 1000; | 578 | hi_freq = (*value) / 1000; |
@@ -585,7 +586,7 @@ static int pmac_cpufreq_init_7447A(struct device_node *cpunode) | |||
585 | { | 586 | { |
586 | struct device_node *volt_gpio_np; | 587 | struct device_node *volt_gpio_np; |
587 | 588 | ||
588 | if (get_property(cpunode, "dynamic-power-step", NULL) == NULL) | 589 | if (of_get_property(cpunode, "dynamic-power-step", NULL) == NULL) |
589 | return 1; | 590 | return 1; |
590 | 591 | ||
591 | volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select"); | 592 | volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select"); |
@@ -614,11 +615,11 @@ static int pmac_cpufreq_init_750FX(struct device_node *cpunode) | |||
614 | u32 pvr; | 615 | u32 pvr; |
615 | const u32 *value; | 616 | const u32 *value; |
616 | 617 | ||
617 | if (get_property(cpunode, "dynamic-power-step", NULL) == NULL) | 618 | if (of_get_property(cpunode, "dynamic-power-step", NULL) == NULL) |
618 | return 1; | 619 | return 1; |
619 | 620 | ||
620 | hi_freq = cur_freq; | 621 | hi_freq = cur_freq; |
621 | value = get_property(cpunode, "reduced-clock-frequency", NULL); | 622 | value = of_get_property(cpunode, "reduced-clock-frequency", NULL); |
622 | if (!value) | 623 | if (!value) |
623 | return 1; | 624 | return 1; |
624 | low_freq = (*value) / 1000; | 625 | low_freq = (*value) / 1000; |
@@ -657,19 +658,19 @@ static int __init pmac_cpufreq_setup(void) | |||
657 | return 0; | 658 | return 0; |
658 | 659 | ||
659 | /* Assume only one CPU */ | 660 | /* Assume only one CPU */ |
660 | cpunode = find_type_devices("cpu"); | 661 | cpunode = of_find_node_by_type(NULL, "cpu"); |
661 | if (!cpunode) | 662 | if (!cpunode) |
662 | goto out; | 663 | goto out; |
663 | 664 | ||
664 | /* Get current cpu clock freq */ | 665 | /* Get current cpu clock freq */ |
665 | value = get_property(cpunode, "clock-frequency", NULL); | 666 | value = of_get_property(cpunode, "clock-frequency", NULL); |
666 | if (!value) | 667 | if (!value) |
667 | goto out; | 668 | goto out; |
668 | cur_freq = (*value) / 1000; | 669 | cur_freq = (*value) / 1000; |
669 | 670 | ||
670 | /* Check for 7447A based MacRISC3 */ | 671 | /* Check for 7447A based MacRISC3 */ |
671 | if (machine_is_compatible("MacRISC3") && | 672 | if (machine_is_compatible("MacRISC3") && |
672 | get_property(cpunode, "dynamic-power-step", NULL) && | 673 | of_get_property(cpunode, "dynamic-power-step", NULL) && |
673 | PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { | 674 | PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { |
674 | pmac_cpufreq_init_7447A(cpunode); | 675 | pmac_cpufreq_init_7447A(cpunode); |
675 | /* Check for other MacRISC3 machines */ | 676 | /* Check for other MacRISC3 machines */ |
@@ -707,6 +708,7 @@ static int __init pmac_cpufreq_setup(void) | |||
707 | else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000) | 708 | else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000) |
708 | pmac_cpufreq_init_750FX(cpunode); | 709 | pmac_cpufreq_init_750FX(cpunode); |
709 | out: | 710 | out: |
711 | of_node_put(cpunode); | ||
710 | if (set_speed_proc == NULL) | 712 | if (set_speed_proc == NULL) |
711 | return -ENODEV; | 713 | return -ENODEV; |
712 | 714 | ||
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c index 9d22361a26d6..567d5523b690 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_64.c +++ b/arch/powerpc/platforms/powermac/cpufreq_64.c | |||
@@ -410,7 +410,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
410 | /* Get first CPU node */ | 410 | /* Get first CPU node */ |
411 | for (cpunode = NULL; | 411 | for (cpunode = NULL; |
412 | (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { | 412 | (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { |
413 | const u32 *reg = get_property(cpunode, "reg", NULL); | 413 | const u32 *reg = of_get_property(cpunode, "reg", NULL); |
414 | if (reg == NULL || (*reg) != 0) | 414 | if (reg == NULL || (*reg) != 0) |
415 | continue; | 415 | continue; |
416 | if (!strcmp(cpunode->type, "cpu")) | 416 | if (!strcmp(cpunode->type, "cpu")) |
@@ -422,7 +422,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
422 | } | 422 | } |
423 | 423 | ||
424 | /* Check 970FX for now */ | 424 | /* Check 970FX for now */ |
425 | valp = get_property(cpunode, "cpu-version", NULL); | 425 | valp = of_get_property(cpunode, "cpu-version", NULL); |
426 | if (!valp) { | 426 | if (!valp) { |
427 | DBG("No cpu-version property !\n"); | 427 | DBG("No cpu-version property !\n"); |
428 | goto bail_noprops; | 428 | goto bail_noprops; |
@@ -434,7 +434,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
434 | } | 434 | } |
435 | 435 | ||
436 | /* Look for the powertune data in the device-tree */ | 436 | /* Look for the powertune data in the device-tree */ |
437 | g5_pmode_data = get_property(cpunode, "power-mode-data",&psize); | 437 | g5_pmode_data = of_get_property(cpunode, "power-mode-data",&psize); |
438 | if (!g5_pmode_data) { | 438 | if (!g5_pmode_data) { |
439 | DBG("No power-mode-data !\n"); | 439 | DBG("No power-mode-data !\n"); |
440 | goto bail_noprops; | 440 | goto bail_noprops; |
@@ -493,7 +493,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
493 | * half freq in this version. So far, I haven't yet seen a machine | 493 | * half freq in this version. So far, I haven't yet seen a machine |
494 | * supporting anything else. | 494 | * supporting anything else. |
495 | */ | 495 | */ |
496 | valp = get_property(cpunode, "clock-frequency", NULL); | 496 | valp = of_get_property(cpunode, "clock-frequency", NULL); |
497 | if (!valp) | 497 | if (!valp) |
498 | return -ENODEV; | 498 | return -ENODEV; |
499 | max_freq = (*valp)/1000; | 499 | max_freq = (*valp)/1000; |
@@ -563,7 +563,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | |||
563 | /* Lookup the cpuid eeprom node */ | 563 | /* Lookup the cpuid eeprom node */ |
564 | cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0"); | 564 | cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0"); |
565 | if (cpuid != NULL) | 565 | if (cpuid != NULL) |
566 | eeprom = get_property(cpuid, "cpuid", NULL); | 566 | eeprom = of_get_property(cpuid, "cpuid", NULL); |
567 | if (eeprom == NULL) { | 567 | if (eeprom == NULL) { |
568 | printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); | 568 | printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); |
569 | rc = -ENODEV; | 569 | rc = -ENODEV; |
@@ -573,13 +573,13 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | |||
573 | /* Lookup the i2c hwclock */ | 573 | /* Lookup the i2c hwclock */ |
574 | for (hwclock = NULL; | 574 | for (hwclock = NULL; |
575 | (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ | 575 | (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ |
576 | const char *loc = get_property(hwclock, | 576 | const char *loc = of_get_property(hwclock, |
577 | "hwctrl-location", NULL); | 577 | "hwctrl-location", NULL); |
578 | if (loc == NULL) | 578 | if (loc == NULL) |
579 | continue; | 579 | continue; |
580 | if (strcmp(loc, "CPU CLOCK")) | 580 | if (strcmp(loc, "CPU CLOCK")) |
581 | continue; | 581 | continue; |
582 | if (!get_property(hwclock, "platform-get-frequency", NULL)) | 582 | if (!of_get_property(hwclock, "platform-get-frequency", NULL)) |
583 | continue; | 583 | continue; |
584 | break; | 584 | break; |
585 | } | 585 | } |
@@ -638,7 +638,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | |||
638 | */ | 638 | */ |
639 | 639 | ||
640 | /* Get max frequency from device-tree */ | 640 | /* Get max frequency from device-tree */ |
641 | valp = get_property(cpunode, "clock-frequency", NULL); | 641 | valp = of_get_property(cpunode, "clock-frequency", NULL); |
642 | if (!valp) { | 642 | if (!valp) { |
643 | printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); | 643 | printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); |
644 | rc = -ENODEV; | 644 | rc = -ENODEV; |
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index 24cc50c1774a..52cfdd86c928 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -1044,6 +1044,7 @@ core99_reset_cpu(struct device_node *node, long param, long value) | |||
1044 | unsigned long flags; | 1044 | unsigned long flags; |
1045 | struct macio_chip *macio; | 1045 | struct macio_chip *macio; |
1046 | struct device_node *np; | 1046 | struct device_node *np; |
1047 | struct device_node *cpus; | ||
1047 | const int dflt_reset_lines[] = { KL_GPIO_RESET_CPU0, | 1048 | const int dflt_reset_lines[] = { KL_GPIO_RESET_CPU0, |
1048 | KL_GPIO_RESET_CPU1, | 1049 | KL_GPIO_RESET_CPU1, |
1049 | KL_GPIO_RESET_CPU2, | 1050 | KL_GPIO_RESET_CPU2, |
@@ -1053,12 +1054,12 @@ core99_reset_cpu(struct device_node *node, long param, long value) | |||
1053 | if (macio->type != macio_keylargo) | 1054 | if (macio->type != macio_keylargo) |
1054 | return -ENODEV; | 1055 | return -ENODEV; |
1055 | 1056 | ||
1056 | np = find_path_device("/cpus"); | 1057 | cpus = of_find_node_by_path("/cpus"); |
1057 | if (np == NULL) | 1058 | if (cpus == NULL) |
1058 | return -ENODEV; | 1059 | return -ENODEV; |
1059 | for (np = np->child; np != NULL; np = np->sibling) { | 1060 | for (np = cpus->child; np != NULL; np = np->sibling) { |
1060 | const u32 *num = get_property(np, "reg", NULL); | 1061 | const u32 *num = of_get_property(np, "reg", NULL); |
1061 | const u32 *rst = get_property(np, "soft-reset", NULL); | 1062 | const u32 *rst = of_get_property(np, "soft-reset", NULL); |
1062 | if (num == NULL || rst == NULL) | 1063 | if (num == NULL || rst == NULL) |
1063 | continue; | 1064 | continue; |
1064 | if (param == *num) { | 1065 | if (param == *num) { |
@@ -1066,6 +1067,7 @@ core99_reset_cpu(struct device_node *node, long param, long value) | |||
1066 | break; | 1067 | break; |
1067 | } | 1068 | } |
1068 | } | 1069 | } |
1070 | of_node_put(cpus); | ||
1069 | if (np == NULL || reset_io == 0) | 1071 | if (np == NULL || reset_io == 0) |
1070 | reset_io = dflt_reset_lines[param]; | 1072 | reset_io = dflt_reset_lines[param]; |
1071 | 1073 | ||
@@ -1095,7 +1097,7 @@ core99_usb_enable(struct device_node *node, long param, long value) | |||
1095 | macio->type != macio_intrepid) | 1097 | macio->type != macio_intrepid) |
1096 | return -ENODEV; | 1098 | return -ENODEV; |
1097 | 1099 | ||
1098 | prop = get_property(node, "AAPL,clock-id", NULL); | 1100 | prop = of_get_property(node, "AAPL,clock-id", NULL); |
1099 | if (!prop) | 1101 | if (!prop) |
1100 | return -ENODEV; | 1102 | return -ENODEV; |
1101 | if (strncmp(prop, "usb0u048", 8) == 0) | 1103 | if (strncmp(prop, "usb0u048", 8) == 0) |
@@ -1497,17 +1499,18 @@ static long g5_reset_cpu(struct device_node *node, long param, long value) | |||
1497 | unsigned long flags; | 1499 | unsigned long flags; |
1498 | struct macio_chip *macio; | 1500 | struct macio_chip *macio; |
1499 | struct device_node *np; | 1501 | struct device_node *np; |
1502 | struct device_node *cpus; | ||
1500 | 1503 | ||
1501 | macio = &macio_chips[0]; | 1504 | macio = &macio_chips[0]; |
1502 | if (macio->type != macio_keylargo2 && macio->type != macio_shasta) | 1505 | if (macio->type != macio_keylargo2 && macio->type != macio_shasta) |
1503 | return -ENODEV; | 1506 | return -ENODEV; |
1504 | 1507 | ||
1505 | np = find_path_device("/cpus"); | 1508 | cpus = of_find_node_by_path("/cpus"); |
1506 | if (np == NULL) | 1509 | if (cpus == NULL) |
1507 | return -ENODEV; | 1510 | return -ENODEV; |
1508 | for (np = np->child; np != NULL; np = np->sibling) { | 1511 | for (np = cpus->child; np != NULL; np = np->sibling) { |
1509 | const u32 *num = get_property(np, "reg", NULL); | 1512 | const u32 *num = of_get_property(np, "reg", NULL); |
1510 | const u32 *rst = get_property(np, "soft-reset", NULL); | 1513 | const u32 *rst = of_get_property(np, "soft-reset", NULL); |
1511 | if (num == NULL || rst == NULL) | 1514 | if (num == NULL || rst == NULL) |
1512 | continue; | 1515 | continue; |
1513 | if (param == *num) { | 1516 | if (param == *num) { |
@@ -1515,6 +1518,7 @@ static long g5_reset_cpu(struct device_node *node, long param, long value) | |||
1515 | break; | 1518 | break; |
1516 | } | 1519 | } |
1517 | } | 1520 | } |
1521 | of_node_put(cpus); | ||
1518 | if (np == NULL || reset_io == 0) | 1522 | if (np == NULL || reset_io == 0) |
1519 | return -ENODEV; | 1523 | return -ENODEV; |
1520 | 1524 | ||
@@ -2404,14 +2408,15 @@ static int __init probe_motherboard(void) | |||
2404 | struct macio_chip *macio = &macio_chips[0]; | 2408 | struct macio_chip *macio = &macio_chips[0]; |
2405 | const char *model = NULL; | 2409 | const char *model = NULL; |
2406 | struct device_node *dt; | 2410 | struct device_node *dt; |
2411 | int ret = 0; | ||
2407 | 2412 | ||
2408 | /* Lookup known motherboard type in device-tree. First try an | 2413 | /* Lookup known motherboard type in device-tree. First try an |
2409 | * exact match on the "model" property, then try a "compatible" | 2414 | * exact match on the "model" property, then try a "compatible" |
2410 | * match is none is found. | 2415 | * match is none is found. |
2411 | */ | 2416 | */ |
2412 | dt = find_devices("device-tree"); | 2417 | dt = of_find_node_by_name(NULL, "device-tree"); |
2413 | if (dt != NULL) | 2418 | if (dt != NULL) |
2414 | model = get_property(dt, "model", NULL); | 2419 | model = of_get_property(dt, "model", NULL); |
2415 | for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { | 2420 | for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { |
2416 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { | 2421 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { |
2417 | pmac_mb = pmac_mb_defs[i]; | 2422 | pmac_mb = pmac_mb_defs[i]; |
@@ -2474,15 +2479,18 @@ static int __init probe_motherboard(void) | |||
2474 | break; | 2479 | break; |
2475 | #endif /* CONFIG_POWER4 */ | 2480 | #endif /* CONFIG_POWER4 */ |
2476 | default: | 2481 | default: |
2477 | return -ENODEV; | 2482 | ret = -ENODEV; |
2483 | goto done; | ||
2478 | } | 2484 | } |
2479 | found: | 2485 | found: |
2480 | #ifndef CONFIG_POWER4 | 2486 | #ifndef CONFIG_POWER4 |
2481 | /* Fixup Hooper vs. Comet */ | 2487 | /* Fixup Hooper vs. Comet */ |
2482 | if (pmac_mb.model_id == PMAC_TYPE_HOOPER) { | 2488 | if (pmac_mb.model_id == PMAC_TYPE_HOOPER) { |
2483 | u32 __iomem * mach_id_ptr = ioremap(0xf3000034, 4); | 2489 | u32 __iomem * mach_id_ptr = ioremap(0xf3000034, 4); |
2484 | if (!mach_id_ptr) | 2490 | if (!mach_id_ptr) { |
2485 | return -ENODEV; | 2491 | ret = -ENODEV; |
2492 | goto done; | ||
2493 | } | ||
2486 | /* Here, I used to disable the media-bay on comet. It | 2494 | /* Here, I used to disable the media-bay on comet. It |
2487 | * appears this is wrong, the floppy connector is actually | 2495 | * appears this is wrong, the floppy connector is actually |
2488 | * a kind of media-bay and works with the current driver. | 2496 | * a kind of media-bay and works with the current driver. |
@@ -2499,18 +2507,26 @@ found: | |||
2499 | * that all Apple OF revs did it properly, I do it the paranoid way. | 2507 | * that all Apple OF revs did it properly, I do it the paranoid way. |
2500 | */ | 2508 | */ |
2501 | while (uninorth_base && uninorth_rev > 3) { | 2509 | while (uninorth_base && uninorth_rev > 3) { |
2502 | struct device_node *np = find_path_device("/cpus"); | 2510 | struct device_node *cpus = of_find_node_by_path("/cpus"); |
2503 | if (!np || !np->child) { | 2511 | struct device_node *np; |
2512 | |||
2513 | if (!cpus || !cpus->child) { | ||
2504 | printk(KERN_WARNING "Can't find CPU(s) in device tree !\n"); | 2514 | printk(KERN_WARNING "Can't find CPU(s) in device tree !\n"); |
2515 | of_node_put(cpus); | ||
2505 | break; | 2516 | break; |
2506 | } | 2517 | } |
2507 | np = np->child; | 2518 | np = cpus->child; |
2508 | /* Nap mode not supported on SMP */ | 2519 | /* Nap mode not supported on SMP */ |
2509 | if (np->sibling) | 2520 | if (np->sibling) { |
2521 | of_node_put(cpus); | ||
2510 | break; | 2522 | break; |
2523 | } | ||
2511 | /* Nap mode not supported if flush-on-lock property is present */ | 2524 | /* Nap mode not supported if flush-on-lock property is present */ |
2512 | if (get_property(np, "flush-on-lock", NULL)) | 2525 | if (of_get_property(np, "flush-on-lock", NULL)) { |
2526 | of_node_put(cpus); | ||
2513 | break; | 2527 | break; |
2528 | } | ||
2529 | of_node_put(cpus); | ||
2514 | powersave_nap = 1; | 2530 | powersave_nap = 1; |
2515 | printk(KERN_DEBUG "Processor NAP mode on idle enabled.\n"); | 2531 | printk(KERN_DEBUG "Processor NAP mode on idle enabled.\n"); |
2516 | break; | 2532 | break; |
@@ -2532,7 +2548,9 @@ found: | |||
2532 | 2548 | ||
2533 | 2549 | ||
2534 | printk(KERN_INFO "PowerMac motherboard: %s\n", pmac_mb.model_name); | 2550 | printk(KERN_INFO "PowerMac motherboard: %s\n", pmac_mb.model_name); |
2535 | return 0; | 2551 | done: |
2552 | of_node_put(dt); | ||
2553 | return ret; | ||
2536 | } | 2554 | } |
2537 | 2555 | ||
2538 | /* Initialize the Core99 UniNorth host bridge and memory controller | 2556 | /* Initialize the Core99 UniNorth host bridge and memory controller |
@@ -2558,7 +2576,7 @@ static void __init probe_uninorth(void) | |||
2558 | if (uninorth_node == NULL) | 2576 | if (uninorth_node == NULL) |
2559 | return; | 2577 | return; |
2560 | 2578 | ||
2561 | addrp = get_property(uninorth_node, "reg", NULL); | 2579 | addrp = of_get_property(uninorth_node, "reg", NULL); |
2562 | if (addrp == NULL) | 2580 | if (addrp == NULL) |
2563 | return; | 2581 | return; |
2564 | address = of_translate_address(uninorth_node, addrp); | 2582 | address = of_translate_address(uninorth_node, addrp); |
@@ -2642,7 +2660,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ | |||
2642 | return; | 2660 | return; |
2643 | } | 2661 | } |
2644 | if (type == macio_keylargo || type == macio_keylargo2) { | 2662 | if (type == macio_keylargo || type == macio_keylargo2) { |
2645 | const u32 *did = get_property(node, "device-id", NULL); | 2663 | const u32 *did = of_get_property(node, "device-id", NULL); |
2646 | if (*did == 0x00000025) | 2664 | if (*did == 0x00000025) |
2647 | type = macio_pangea; | 2665 | type = macio_pangea; |
2648 | if (*did == 0x0000003e) | 2666 | if (*did == 0x0000003e) |
@@ -2655,7 +2673,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ | |||
2655 | macio_chips[i].base = base; | 2673 | macio_chips[i].base = base; |
2656 | macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON; | 2674 | macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON; |
2657 | macio_chips[i].name = macio_names[type]; | 2675 | macio_chips[i].name = macio_names[type]; |
2658 | revp = get_property(node, "revision-id", NULL); | 2676 | revp = of_get_property(node, "revision-id", NULL); |
2659 | if (revp) | 2677 | if (revp) |
2660 | macio_chips[i].rev = *revp; | 2678 | macio_chips[i].rev = *revp; |
2661 | printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", | 2679 | printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", |
@@ -2706,8 +2724,8 @@ initial_serial_shutdown(struct device_node *np) | |||
2706 | int port_type = PMAC_SCC_ASYNC; | 2724 | int port_type = PMAC_SCC_ASYNC; |
2707 | int modem = 0; | 2725 | int modem = 0; |
2708 | 2726 | ||
2709 | slots = get_property(np, "slot-names", &len); | 2727 | slots = of_get_property(np, "slot-names", &len); |
2710 | conn = get_property(np, "AAPL,connector", &len); | 2728 | conn = of_get_property(np, "AAPL,connector", &len); |
2711 | if (conn && (strcmp(conn, "infrared") == 0)) | 2729 | if (conn && (strcmp(conn, "infrared") == 0)) |
2712 | port_type = PMAC_SCC_IRDA; | 2730 | port_type = PMAC_SCC_IRDA; |
2713 | else if (device_is_compatible(np, "cobalt")) | 2731 | else if (device_is_compatible(np, "cobalt")) |
@@ -2735,12 +2753,14 @@ set_initial_features(void) | |||
2735 | * differenciate them all and since that hack was there for a long | 2753 | * differenciate them all and since that hack was there for a long |
2736 | * time, I'll keep it around | 2754 | * time, I'll keep it around |
2737 | */ | 2755 | */ |
2738 | if (macio_chips[0].type == macio_ohare && !find_devices("via-pmu")) { | 2756 | if (macio_chips[0].type == macio_ohare) { |
2739 | struct macio_chip *macio = &macio_chips[0]; | 2757 | struct macio_chip *macio = &macio_chips[0]; |
2740 | MACIO_OUT32(OHARE_FCR, STARMAX_FEATURES); | 2758 | np = of_find_node_by_name(NULL, "via-pmu"); |
2741 | } else if (macio_chips[0].type == macio_ohare) { | 2759 | if (np) |
2742 | struct macio_chip *macio = &macio_chips[0]; | 2760 | MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE); |
2743 | MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE); | 2761 | else |
2762 | MACIO_OUT32(OHARE_FCR, STARMAX_FEATURES); | ||
2763 | of_node_put(np); | ||
2744 | } else if (macio_chips[1].type == macio_ohare) { | 2764 | } else if (macio_chips[1].type == macio_ohare) { |
2745 | struct macio_chip *macio = &macio_chips[1]; | 2765 | struct macio_chip *macio = &macio_chips[1]; |
2746 | MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE); | 2766 | MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE); |
@@ -2833,14 +2853,13 @@ set_initial_features(void) | |||
2833 | } | 2853 | } |
2834 | 2854 | ||
2835 | /* Switch airport off */ | 2855 | /* Switch airport off */ |
2836 | np = find_devices("radio"); | 2856 | for_each_node_by_name(np, "radio") { |
2837 | while(np) { | ||
2838 | if (np && np->parent == macio_chips[0].of_node) { | 2857 | if (np && np->parent == macio_chips[0].of_node) { |
2839 | macio_chips[0].flags |= MACIO_FLAG_AIRPORT_ON; | 2858 | macio_chips[0].flags |= MACIO_FLAG_AIRPORT_ON; |
2840 | core99_airport_enable(np, 0, 0); | 2859 | core99_airport_enable(np, 0, 0); |
2841 | } | 2860 | } |
2842 | np = np->next; | ||
2843 | } | 2861 | } |
2862 | of_node_put(np); | ||
2844 | } | 2863 | } |
2845 | 2864 | ||
2846 | /* On all machines that support sound PM, switch sound off */ | 2865 | /* On all machines that support sound PM, switch sound off */ |
@@ -2860,16 +2879,12 @@ set_initial_features(void) | |||
2860 | #endif /* CONFIG_POWER4 */ | 2879 | #endif /* CONFIG_POWER4 */ |
2861 | 2880 | ||
2862 | /* On all machines, switch modem & serial ports off */ | 2881 | /* On all machines, switch modem & serial ports off */ |
2863 | np = find_devices("ch-a"); | 2882 | for_each_node_by_name(np, "ch-a") |
2864 | while(np) { | ||
2865 | initial_serial_shutdown(np); | 2883 | initial_serial_shutdown(np); |
2866 | np = np->next; | 2884 | of_node_put(np); |
2867 | } | 2885 | for_each_node_by_name(np, "ch-b") |
2868 | np = find_devices("ch-b"); | ||
2869 | while(np) { | ||
2870 | initial_serial_shutdown(np); | 2886 | initial_serial_shutdown(np); |
2871 | np = np->next; | 2887 | of_node_put(np); |
2872 | } | ||
2873 | } | 2888 | } |
2874 | 2889 | ||
2875 | void __init | 2890 | void __init |
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index bfc4829162f1..5430e146b3e9 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c | |||
@@ -491,7 +491,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) | |||
491 | * on all i2c keywest nodes so far ... we would have to fallback | 491 | * on all i2c keywest nodes so far ... we would have to fallback |
492 | * to macio parsing if that wasn't the case | 492 | * to macio parsing if that wasn't the case |
493 | */ | 493 | */ |
494 | addrp = get_property(np, "AAPL,address", NULL); | 494 | addrp = of_get_property(np, "AAPL,address", NULL); |
495 | if (addrp == NULL) { | 495 | if (addrp == NULL) { |
496 | printk(KERN_ERR "low_i2c: Can't find address for %s\n", | 496 | printk(KERN_ERR "low_i2c: Can't find address for %s\n", |
497 | np->full_name); | 497 | np->full_name); |
@@ -505,13 +505,13 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) | |||
505 | host->timeout_timer.function = kw_i2c_timeout; | 505 | host->timeout_timer.function = kw_i2c_timeout; |
506 | host->timeout_timer.data = (unsigned long)host; | 506 | host->timeout_timer.data = (unsigned long)host; |
507 | 507 | ||
508 | psteps = get_property(np, "AAPL,address-step", NULL); | 508 | psteps = of_get_property(np, "AAPL,address-step", NULL); |
509 | steps = psteps ? (*psteps) : 0x10; | 509 | steps = psteps ? (*psteps) : 0x10; |
510 | for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) | 510 | for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) |
511 | steps >>= 1; | 511 | steps >>= 1; |
512 | /* Select interface rate */ | 512 | /* Select interface rate */ |
513 | host->speed = KW_I2C_MODE_25KHZ; | 513 | host->speed = KW_I2C_MODE_25KHZ; |
514 | prate = get_property(np, "AAPL,i2c-rate", NULL); | 514 | prate = of_get_property(np, "AAPL,i2c-rate", NULL); |
515 | if (prate) switch(*prate) { | 515 | if (prate) switch(*prate) { |
516 | case 100: | 516 | case 100: |
517 | host->speed = KW_I2C_MODE_100KHZ; | 517 | host->speed = KW_I2C_MODE_100KHZ; |
@@ -619,7 +619,7 @@ static void __init kw_i2c_probe(void) | |||
619 | } else { | 619 | } else { |
620 | for (child = NULL; | 620 | for (child = NULL; |
621 | (child = of_get_next_child(np, child)) != NULL;) { | 621 | (child = of_get_next_child(np, child)) != NULL;) { |
622 | const u32 *reg = get_property(child, | 622 | const u32 *reg = of_get_property(child, |
623 | "reg", NULL); | 623 | "reg", NULL); |
624 | if (reg == NULL) | 624 | if (reg == NULL) |
625 | continue; | 625 | continue; |
@@ -905,7 +905,7 @@ static void __init smu_i2c_probe(void) | |||
905 | if (strcmp(busnode->type, "i2c") && | 905 | if (strcmp(busnode->type, "i2c") && |
906 | strcmp(busnode->type, "i2c-bus")) | 906 | strcmp(busnode->type, "i2c-bus")) |
907 | continue; | 907 | continue; |
908 | reg = get_property(busnode, "reg", NULL); | 908 | reg = of_get_property(busnode, "reg", NULL); |
909 | if (reg == NULL) | 909 | if (reg == NULL) |
910 | continue; | 910 | continue; |
911 | 911 | ||
@@ -950,7 +950,8 @@ struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node) | |||
950 | if (p == bus->busnode) { | 950 | if (p == bus->busnode) { |
951 | if (prev && bus->flags & pmac_i2c_multibus) { | 951 | if (prev && bus->flags & pmac_i2c_multibus) { |
952 | const u32 *reg; | 952 | const u32 *reg; |
953 | reg = get_property(prev, "reg", NULL); | 953 | reg = of_get_property(prev, "reg", |
954 | NULL); | ||
954 | if (!reg) | 955 | if (!reg) |
955 | continue; | 956 | continue; |
956 | if (((*reg) >> 8) != bus->channel) | 957 | if (((*reg) >> 8) != bus->channel) |
@@ -971,7 +972,7 @@ EXPORT_SYMBOL_GPL(pmac_i2c_find_bus); | |||
971 | 972 | ||
972 | u8 pmac_i2c_get_dev_addr(struct device_node *device) | 973 | u8 pmac_i2c_get_dev_addr(struct device_node *device) |
973 | { | 974 | { |
974 | const u32 *reg = get_property(device, "reg", NULL); | 975 | const u32 *reg = of_get_property(device, "reg", NULL); |
975 | 976 | ||
976 | if (reg == NULL) | 977 | if (reg == NULL) |
977 | return 0; | 978 | return 0; |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index 6fbac308ded6..22c4ae4c6934 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -70,11 +70,11 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher | |||
70 | int len; | 70 | int len; |
71 | 71 | ||
72 | /* For PCI<->PCI bridges or CardBus bridges, we go down */ | 72 | /* For PCI<->PCI bridges or CardBus bridges, we go down */ |
73 | class_code = get_property(node, "class-code", NULL); | 73 | class_code = of_get_property(node, "class-code", NULL); |
74 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && | 74 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && |
75 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) | 75 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) |
76 | continue; | 76 | continue; |
77 | bus_range = get_property(node, "bus-range", &len); | 77 | bus_range = of_get_property(node, "bus-range", &len); |
78 | if (bus_range != NULL && len > 2 * sizeof(int)) { | 78 | if (bus_range != NULL && len > 2 * sizeof(int)) { |
79 | if (bus_range[1] > higher) | 79 | if (bus_range[1] > higher) |
80 | higher = bus_range[1]; | 80 | higher = bus_range[1]; |
@@ -100,7 +100,7 @@ static void __init fixup_bus_range(struct device_node *bridge) | |||
100 | if (prop == NULL || prop->length < 2 * sizeof(int)) | 100 | if (prop == NULL || prop->length < 2 * sizeof(int)) |
101 | return; | 101 | return; |
102 | 102 | ||
103 | bus_range = (int *)prop->value; | 103 | bus_range = prop->value; |
104 | bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]); | 104 | bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]); |
105 | } | 105 | } |
106 | 106 | ||
@@ -246,8 +246,8 @@ static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset) | |||
246 | if (np == NULL) | 246 | if (np == NULL) |
247 | return PCIBIOS_DEVICE_NOT_FOUND; | 247 | return PCIBIOS_DEVICE_NOT_FOUND; |
248 | 248 | ||
249 | vendor = get_property(np, "vendor-id", NULL); | 249 | vendor = of_get_property(np, "vendor-id", NULL); |
250 | device = get_property(np, "device-id", NULL); | 250 | device = of_get_property(np, "device-id", NULL); |
251 | if (vendor == NULL || device == NULL) | 251 | if (vendor == NULL || device == NULL) |
252 | return PCIBIOS_DEVICE_NOT_FOUND; | 252 | return PCIBIOS_DEVICE_NOT_FOUND; |
253 | 253 | ||
@@ -622,13 +622,14 @@ static void __init init_p2pbridge(void) | |||
622 | 622 | ||
623 | /* XXX it would be better here to identify the specific | 623 | /* XXX it would be better here to identify the specific |
624 | PCI-PCI bridge chip we have. */ | 624 | PCI-PCI bridge chip we have. */ |
625 | if ((p2pbridge = find_devices("pci-bridge")) == 0 | 625 | p2pbridge = of_find_node_by_name(NULL, "pci-bridge"); |
626 | if (p2pbridge == NULL | ||
626 | || p2pbridge->parent == NULL | 627 | || p2pbridge->parent == NULL |
627 | || strcmp(p2pbridge->parent->name, "pci") != 0) | 628 | || strcmp(p2pbridge->parent->name, "pci") != 0) |
628 | return; | 629 | goto done; |
629 | if (pci_device_from_OF_node(p2pbridge, &bus, &devfn) < 0) { | 630 | if (pci_device_from_OF_node(p2pbridge, &bus, &devfn) < 0) { |
630 | DBG("Can't find PCI infos for PCI<->PCI bridge\n"); | 631 | DBG("Can't find PCI infos for PCI<->PCI bridge\n"); |
631 | return; | 632 | goto done; |
632 | } | 633 | } |
633 | /* Warning: At this point, we have not yet renumbered all busses. | 634 | /* Warning: At this point, we have not yet renumbered all busses. |
634 | * So we must use OF walking to find out hose | 635 | * So we must use OF walking to find out hose |
@@ -636,16 +637,18 @@ static void __init init_p2pbridge(void) | |||
636 | hose = pci_find_hose_for_OF_device(p2pbridge); | 637 | hose = pci_find_hose_for_OF_device(p2pbridge); |
637 | if (!hose) { | 638 | if (!hose) { |
638 | DBG("Can't find hose for PCI<->PCI bridge\n"); | 639 | DBG("Can't find hose for PCI<->PCI bridge\n"); |
639 | return; | 640 | goto done; |
640 | } | 641 | } |
641 | if (early_read_config_word(hose, bus, devfn, | 642 | if (early_read_config_word(hose, bus, devfn, |
642 | PCI_BRIDGE_CONTROL, &val) < 0) { | 643 | PCI_BRIDGE_CONTROL, &val) < 0) { |
643 | printk(KERN_ERR "init_p2pbridge: couldn't read bridge" | 644 | printk(KERN_ERR "init_p2pbridge: couldn't read bridge" |
644 | " control\n"); | 645 | " control\n"); |
645 | return; | 646 | goto done; |
646 | } | 647 | } |
647 | val &= ~PCI_BRIDGE_CTL_MASTER_ABORT; | 648 | val &= ~PCI_BRIDGE_CTL_MASTER_ABORT; |
648 | early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val); | 649 | early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val); |
650 | done: | ||
651 | of_node_put(p2pbridge); | ||
649 | } | 652 | } |
650 | 653 | ||
651 | static void __init init_second_ohare(void) | 654 | static void __init init_second_ohare(void) |
@@ -691,17 +694,17 @@ static void __init fixup_nec_usb2(void) | |||
691 | const u32 *prop; | 694 | const u32 *prop; |
692 | u8 bus, devfn; | 695 | u8 bus, devfn; |
693 | 696 | ||
694 | prop = get_property(nec, "vendor-id", NULL); | 697 | prop = of_get_property(nec, "vendor-id", NULL); |
695 | if (prop == NULL) | 698 | if (prop == NULL) |
696 | continue; | 699 | continue; |
697 | if (0x1033 != *prop) | 700 | if (0x1033 != *prop) |
698 | continue; | 701 | continue; |
699 | prop = get_property(nec, "device-id", NULL); | 702 | prop = of_get_property(nec, "device-id", NULL); |
700 | if (prop == NULL) | 703 | if (prop == NULL) |
701 | continue; | 704 | continue; |
702 | if (0x0035 != *prop) | 705 | if (0x0035 != *prop) |
703 | continue; | 706 | continue; |
704 | prop = get_property(nec, "reg", NULL); | 707 | prop = of_get_property(nec, "reg", NULL); |
705 | if (prop == NULL) | 708 | if (prop == NULL) |
706 | continue; | 709 | continue; |
707 | devfn = (prop[0] >> 8) & 0xff; | 710 | devfn = (prop[0] >> 8) & 0xff; |
@@ -909,7 +912,7 @@ static int __init add_bridge(struct device_node *dev) | |||
909 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); | 912 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); |
910 | 913 | ||
911 | /* Get bus range if any */ | 914 | /* Get bus range if any */ |
912 | bus_range = get_property(dev, "bus-range", &len); | 915 | bus_range = of_get_property(dev, "bus-range", &len); |
913 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 916 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
914 | printk(KERN_WARNING "Can't get bus-range for %s, assume" | 917 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
915 | " bus 0\n", dev->full_name); | 918 | " bus 0\n", dev->full_name); |
@@ -1199,8 +1202,7 @@ void __init pmac_pcibios_after_init(void) | |||
1199 | } | 1202 | } |
1200 | #endif /* CONFIG_BLK_DEV_IDE */ | 1203 | #endif /* CONFIG_BLK_DEV_IDE */ |
1201 | 1204 | ||
1202 | nd = find_devices("firewire"); | 1205 | for_each_node_by_name(nd, "firewire") { |
1203 | while (nd) { | ||
1204 | if (nd->parent && (device_is_compatible(nd, "pci106b,18") || | 1206 | if (nd->parent && (device_is_compatible(nd, "pci106b,18") || |
1205 | device_is_compatible(nd, "pci106b,30") || | 1207 | device_is_compatible(nd, "pci106b,30") || |
1206 | device_is_compatible(nd, "pci11c1,5811")) | 1208 | device_is_compatible(nd, "pci11c1,5811")) |
@@ -1208,15 +1210,14 @@ void __init pmac_pcibios_after_init(void) | |||
1208 | pmac_call_feature(PMAC_FTR_1394_ENABLE, nd, 0, 0); | 1210 | pmac_call_feature(PMAC_FTR_1394_ENABLE, nd, 0, 0); |
1209 | pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0); | 1211 | pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0); |
1210 | } | 1212 | } |
1211 | nd = nd->next; | ||
1212 | } | 1213 | } |
1213 | nd = find_devices("ethernet"); | 1214 | of_node_put(nd); |
1214 | while (nd) { | 1215 | for_each_node_by_name(nd, "ethernet") { |
1215 | if (nd->parent && device_is_compatible(nd, "gmac") | 1216 | if (nd->parent && device_is_compatible(nd, "gmac") |
1216 | && device_is_compatible(nd->parent, "uni-north")) | 1217 | && device_is_compatible(nd->parent, "uni-north")) |
1217 | pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0); | 1218 | pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0); |
1218 | nd = nd->next; | ||
1219 | } | 1219 | } |
1220 | of_node_put(nd); | ||
1220 | } | 1221 | } |
1221 | 1222 | ||
1222 | #ifdef CONFIG_PPC32 | 1223 | #ifdef CONFIG_PPC32 |
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c index 5c6c15c5f9a3..45d54b9ad9e0 100644 --- a/arch/powerpc/platforms/powermac/pfunc_base.c +++ b/arch/powerpc/platforms/powermac/pfunc_base.c | |||
@@ -114,7 +114,7 @@ static void macio_gpio_init_one(struct macio_chip *macio) | |||
114 | * we just create them all | 114 | * we just create them all |
115 | */ | 115 | */ |
116 | for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) { | 116 | for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) { |
117 | const u32 *reg = get_property(gp, "reg", NULL); | 117 | const u32 *reg = of_get_property(gp, "reg", NULL); |
118 | unsigned long offset; | 118 | unsigned long offset; |
119 | if (reg == NULL) | 119 | if (reg == NULL) |
120 | continue; | 120 | continue; |
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index 7651f278615a..85434231ae14 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c | |||
@@ -692,8 +692,7 @@ static int pmf_add_functions(struct pmf_device *dev, void *driverdata) | |||
692 | name = pp->name + plen; | 692 | name = pp->name + plen; |
693 | if (strlen(name) && pp->length >= 12) | 693 | if (strlen(name) && pp->length >= 12) |
694 | count += pmf_add_function_prop(dev, driverdata, name, | 694 | count += pmf_add_function_prop(dev, driverdata, name, |
695 | (u32 *)pp->value, | 695 | pp->value, pp->length); |
696 | pp->length); | ||
697 | } | 696 | } |
698 | return count; | 697 | return count; |
699 | } | 698 | } |
@@ -821,7 +820,7 @@ struct pmf_function *__pmf_find_function(struct device_node *target, | |||
821 | * one, then we fallback to a direct call attempt | 820 | * one, then we fallback to a direct call attempt |
822 | */ | 821 | */ |
823 | snprintf(fname, 63, "platform-%s", name); | 822 | snprintf(fname, 63, "platform-%s", name); |
824 | prop = get_property(target, fname, NULL); | 823 | prop = of_get_property(target, fname, NULL); |
825 | if (prop == NULL) | 824 | if (prop == NULL) |
826 | goto find_it; | 825 | goto find_it; |
827 | ph = *prop; | 826 | ph = *prop; |
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 5e5c0e4add91..ae5097ac0378 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -482,14 +482,14 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, | |||
482 | pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); | 482 | pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); |
483 | 483 | ||
484 | flags |= MPIC_WANTS_RESET; | 484 | flags |= MPIC_WANTS_RESET; |
485 | if (get_property(np, "big-endian", NULL)) | 485 | if (of_get_property(np, "big-endian", NULL)) |
486 | flags |= MPIC_BIG_ENDIAN; | 486 | flags |= MPIC_BIG_ENDIAN; |
487 | 487 | ||
488 | /* Primary Big Endian means HT interrupts. This is quite dodgy | 488 | /* Primary Big Endian means HT interrupts. This is quite dodgy |
489 | * but works until I find a better way | 489 | * but works until I find a better way |
490 | */ | 490 | */ |
491 | if (master && (flags & MPIC_BIG_ENDIAN)) | 491 | if (master && (flags & MPIC_BIG_ENDIAN)) |
492 | flags |= MPIC_BROKEN_U3; | 492 | flags |= MPIC_U3_HT_IRQS; |
493 | 493 | ||
494 | mpic = mpic_alloc(np, r.start, flags, 0, 0, name); | 494 | mpic = mpic_alloc(np, r.start, flags, 0, 0, name); |
495 | if (mpic == NULL) | 495 | if (mpic == NULL) |
@@ -510,7 +510,7 @@ static int __init pmac_pic_probe_mpic(void) | |||
510 | for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) | 510 | for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) |
511 | != NULL;) { | 511 | != NULL;) { |
512 | if (master == NULL && | 512 | if (master == NULL && |
513 | get_property(np, "interrupts", NULL) == NULL) | 513 | of_get_property(np, "interrupts", NULL) == NULL) |
514 | master = of_node_get(np); | 514 | master = of_node_get(np); |
515 | else if (slave == NULL) | 515 | else if (slave == NULL) |
516 | slave = of_node_get(np); | 516 | slave = of_node_get(np); |
@@ -575,7 +575,7 @@ void __init pmac_pic_init(void) | |||
575 | #ifdef CONFIG_PPC32 | 575 | #ifdef CONFIG_PPC32 |
576 | if (!pmac_newworld) | 576 | if (!pmac_newworld) |
577 | flags |= OF_IMAP_OLDWORLD_MAC; | 577 | flags |= OF_IMAP_OLDWORLD_MAC; |
578 | if (get_property(of_chosen, "linux,bootx", NULL) != NULL) | 578 | if (of_get_property(of_chosen, "linux,bootx", NULL) != NULL) |
579 | flags |= OF_IMAP_NO_PHANDLE; | 579 | flags |= OF_IMAP_NO_PHANDLE; |
580 | #endif /* CONFIG_PPC_32 */ | 580 | #endif /* CONFIG_PPC_32 */ |
581 | 581 | ||
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 651fa424ea06..b820cabac697 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <linux/initrd.h> | 42 | #include <linux/initrd.h> |
43 | #include <linux/vt_kern.h> | 43 | #include <linux/vt_kern.h> |
44 | #include <linux/console.h> | 44 | #include <linux/console.h> |
45 | #include <linux/ide.h> | ||
46 | #include <linux/pci.h> | 45 | #include <linux/pci.h> |
47 | #include <linux/adb.h> | 46 | #include <linux/adb.h> |
48 | #include <linux/cuda.h> | 47 | #include <linux/cuda.h> |
@@ -135,12 +134,12 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
135 | seq_printf(m, "machine\t\t: "); | 134 | seq_printf(m, "machine\t\t: "); |
136 | np = of_find_node_by_path("/"); | 135 | np = of_find_node_by_path("/"); |
137 | if (np != NULL) { | 136 | if (np != NULL) { |
138 | pp = get_property(np, "model", NULL); | 137 | pp = of_get_property(np, "model", NULL); |
139 | if (pp != NULL) | 138 | if (pp != NULL) |
140 | seq_printf(m, "%s\n", pp); | 139 | seq_printf(m, "%s\n", pp); |
141 | else | 140 | else |
142 | seq_printf(m, "PowerMac\n"); | 141 | seq_printf(m, "PowerMac\n"); |
143 | pp = get_property(np, "compatible", &plen); | 142 | pp = of_get_property(np, "compatible", &plen); |
144 | if (pp != NULL) { | 143 | if (pp != NULL) { |
145 | seq_printf(m, "motherboard\t:"); | 144 | seq_printf(m, "motherboard\t:"); |
146 | while (plen > 0) { | 145 | while (plen > 0) { |
@@ -164,11 +163,13 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
164 | if (np == NULL) | 163 | if (np == NULL) |
165 | np = of_find_node_by_type(NULL, "cache"); | 164 | np = of_find_node_by_type(NULL, "cache"); |
166 | if (np != NULL) { | 165 | if (np != NULL) { |
167 | const unsigned int *ic = get_property(np, "i-cache-size", NULL); | 166 | const unsigned int *ic = |
168 | const unsigned int *dc = get_property(np, "d-cache-size", NULL); | 167 | of_get_property(np, "i-cache-size", NULL); |
168 | const unsigned int *dc = | ||
169 | of_get_property(np, "d-cache-size", NULL); | ||
169 | seq_printf(m, "L2 cache\t:"); | 170 | seq_printf(m, "L2 cache\t:"); |
170 | has_l2cache = 1; | 171 | has_l2cache = 1; |
171 | if (get_property(np, "cache-unified", NULL) != 0 && dc) { | 172 | if (of_get_property(np, "cache-unified", NULL) != 0 && dc) { |
172 | seq_printf(m, " %dK unified", *dc / 1024); | 173 | seq_printf(m, " %dK unified", *dc / 1024); |
173 | } else { | 174 | } else { |
174 | if (ic) | 175 | if (ic) |
@@ -177,7 +178,7 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
177 | seq_printf(m, "%s %dK data", | 178 | seq_printf(m, "%s %dK data", |
178 | (ic? " +": ""), *dc / 1024); | 179 | (ic? " +": ""), *dc / 1024); |
179 | } | 180 | } |
180 | pp = get_property(np, "ram-type", NULL); | 181 | pp = of_get_property(np, "ram-type", NULL); |
181 | if (pp) | 182 | if (pp) |
182 | seq_printf(m, " %s", pp); | 183 | seq_printf(m, " %s", pp); |
183 | seq_printf(m, "\n"); | 184 | seq_printf(m, "\n"); |
@@ -192,8 +193,11 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
192 | #ifndef CONFIG_ADB_CUDA | 193 | #ifndef CONFIG_ADB_CUDA |
193 | int find_via_cuda(void) | 194 | int find_via_cuda(void) |
194 | { | 195 | { |
195 | if (!find_devices("via-cuda")) | 196 | struct device_node *dn = of_find_node_by_name(NULL, "via-cuda"); |
197 | |||
198 | if (!dn) | ||
196 | return 0; | 199 | return 0; |
200 | of_node_put(dn); | ||
197 | printk("WARNING ! Your machine is CUDA-based but your kernel\n"); | 201 | printk("WARNING ! Your machine is CUDA-based but your kernel\n"); |
198 | printk(" wasn't compiled with CONFIG_ADB_CUDA option !\n"); | 202 | printk(" wasn't compiled with CONFIG_ADB_CUDA option !\n"); |
199 | return 0; | 203 | return 0; |
@@ -203,8 +207,11 @@ int find_via_cuda(void) | |||
203 | #ifndef CONFIG_ADB_PMU | 207 | #ifndef CONFIG_ADB_PMU |
204 | int find_via_pmu(void) | 208 | int find_via_pmu(void) |
205 | { | 209 | { |
206 | if (!find_devices("via-pmu")) | 210 | struct device_node *dn = of_find_node_by_name(NULL, "via-pmu"); |
211 | |||
212 | if (!dn) | ||
207 | return 0; | 213 | return 0; |
214 | of_node_put(dn); | ||
208 | printk("WARNING ! Your machine is PMU-based but your kernel\n"); | 215 | printk("WARNING ! Your machine is PMU-based but your kernel\n"); |
209 | printk(" wasn't compiled with CONFIG_ADB_PMU option !\n"); | 216 | printk(" wasn't compiled with CONFIG_ADB_PMU option !\n"); |
210 | return 0; | 217 | return 0; |
@@ -224,6 +231,8 @@ static volatile u32 *sysctrl_regs; | |||
224 | 231 | ||
225 | static void __init ohare_init(void) | 232 | static void __init ohare_init(void) |
226 | { | 233 | { |
234 | struct device_node *dn; | ||
235 | |||
227 | /* this area has the CPU identification register | 236 | /* this area has the CPU identification register |
228 | and some registers used by smp boards */ | 237 | and some registers used by smp boards */ |
229 | sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000); | 238 | sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000); |
@@ -233,7 +242,9 @@ static void __init ohare_init(void) | |||
233 | * We assume that we have a PSX memory controller iff | 242 | * We assume that we have a PSX memory controller iff |
234 | * we have an ohare I/O controller. | 243 | * we have an ohare I/O controller. |
235 | */ | 244 | */ |
236 | if (find_devices("ohare") != NULL) { | 245 | dn = of_find_node_by_name(NULL, "ohare"); |
246 | if (dn) { | ||
247 | of_node_put(dn); | ||
237 | if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) { | 248 | if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) { |
238 | if (sysctrl_regs[4] & 0x10) | 249 | if (sysctrl_regs[4] & 0x10) |
239 | sysctrl_regs[4] |= 0x04000020; | 250 | sysctrl_regs[4] |= 0x04000020; |
@@ -249,18 +260,19 @@ static void __init l2cr_init(void) | |||
249 | { | 260 | { |
250 | /* Checks "l2cr-value" property in the registry */ | 261 | /* Checks "l2cr-value" property in the registry */ |
251 | if (cpu_has_feature(CPU_FTR_L2CR)) { | 262 | if (cpu_has_feature(CPU_FTR_L2CR)) { |
252 | struct device_node *np = find_devices("cpus"); | 263 | struct device_node *np = of_find_node_by_name(NULL, "cpus"); |
253 | if (np == 0) | 264 | if (np == 0) |
254 | np = find_type_devices("cpu"); | 265 | np = of_find_node_by_type(NULL, "cpu"); |
255 | if (np != 0) { | 266 | if (np != 0) { |
256 | const unsigned int *l2cr = | 267 | const unsigned int *l2cr = |
257 | get_property(np, "l2cr-value", NULL); | 268 | of_get_property(np, "l2cr-value", NULL); |
258 | if (l2cr != 0) { | 269 | if (l2cr != 0) { |
259 | ppc_override_l2cr = 1; | 270 | ppc_override_l2cr = 1; |
260 | ppc_override_l2cr_value = *l2cr; | 271 | ppc_override_l2cr_value = *l2cr; |
261 | _set_L2CR(0); | 272 | _set_L2CR(0); |
262 | _set_L2CR(ppc_override_l2cr_value); | 273 | _set_L2CR(ppc_override_l2cr_value); |
263 | } | 274 | } |
275 | of_node_put(np); | ||
264 | } | 276 | } |
265 | } | 277 | } |
266 | 278 | ||
@@ -286,7 +298,7 @@ static void __init pmac_setup_arch(void) | |||
286 | loops_per_jiffy = 50000000 / HZ; | 298 | loops_per_jiffy = 50000000 / HZ; |
287 | cpu = of_find_node_by_type(NULL, "cpu"); | 299 | cpu = of_find_node_by_type(NULL, "cpu"); |
288 | if (cpu != NULL) { | 300 | if (cpu != NULL) { |
289 | fp = get_property(cpu, "clock-frequency", NULL); | 301 | fp = of_get_property(cpu, "clock-frequency", NULL); |
290 | if (fp != NULL) { | 302 | if (fp != NULL) { |
291 | if (pvr >= 0x30 && pvr < 0x80) | 303 | if (pvr >= 0x30 && pvr < 0x80) |
292 | /* PPC970 etc. */ | 304 | /* PPC970 etc. */ |
@@ -303,7 +315,7 @@ static void __init pmac_setup_arch(void) | |||
303 | 315 | ||
304 | /* See if newworld or oldworld */ | 316 | /* See if newworld or oldworld */ |
305 | for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; ) | 317 | for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; ) |
306 | if (get_property(ic, "interrupt-controller", NULL)) | 318 | if (of_get_property(ic, "interrupt-controller", NULL)) |
307 | break; | 319 | break; |
308 | if (ic) { | 320 | if (ic) { |
309 | pmac_newworld = 1; | 321 | pmac_newworld = 1; |
@@ -341,8 +353,15 @@ static void __init pmac_setup_arch(void) | |||
341 | 353 | ||
342 | #ifdef CONFIG_SMP | 354 | #ifdef CONFIG_SMP |
343 | /* Check for Core99 */ | 355 | /* Check for Core99 */ |
344 | if (find_devices("uni-n") || find_devices("u3") || find_devices("u4")) | 356 | ic = of_find_node_by_name(NULL, "uni-n"); |
357 | if (!ic) | ||
358 | ic = of_find_node_by_name(NULL, "u3"); | ||
359 | if (!ic) | ||
360 | ic = of_find_node_by_name(NULL, "u4"); | ||
361 | if (ic) { | ||
362 | of_node_put(ic); | ||
345 | smp_ops = &core99_smp_ops; | 363 | smp_ops = &core99_smp_ops; |
364 | } | ||
346 | #ifdef CONFIG_PPC32 | 365 | #ifdef CONFIG_PPC32 |
347 | else | 366 | else |
348 | smp_ops = &psurge_smp_ops; | 367 | smp_ops = &psurge_smp_ops; |
@@ -616,15 +635,6 @@ static void __init pmac_init_early(void) | |||
616 | #endif | 635 | #endif |
617 | } | 636 | } |
618 | 637 | ||
619 | /* | ||
620 | * pmac has no legacy IO, anything calling this function has to | ||
621 | * fail or bad things will happen | ||
622 | */ | ||
623 | static int pmac_check_legacy_ioport(unsigned int baseport) | ||
624 | { | ||
625 | return -ENODEV; | ||
626 | } | ||
627 | |||
628 | static int __init pmac_declare_of_platform_devices(void) | 638 | static int __init pmac_declare_of_platform_devices(void) |
629 | { | 639 | { |
630 | struct device_node *np; | 640 | struct device_node *np; |
@@ -736,7 +746,6 @@ define_machine(powermac) { | |||
736 | .get_rtc_time = pmac_get_rtc_time, | 746 | .get_rtc_time = pmac_get_rtc_time, |
737 | .calibrate_decr = pmac_calibrate_decr, | 747 | .calibrate_decr = pmac_calibrate_decr, |
738 | .feature_call = pmac_do_feature_call, | 748 | .feature_call = pmac_do_feature_call, |
739 | .check_legacy_ioport = pmac_check_legacy_ioport, | ||
740 | .progress = udbg_progress, | 749 | .progress = udbg_progress, |
741 | #ifdef CONFIG_PPC64 | 750 | #ifdef CONFIG_PPC64 |
742 | .pci_probe_mode = pmac_pci_probe_mode, | 751 | .pci_probe_mode = pmac_pci_probe_mode, |
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index d73fb73802bb..6f32c4eca6e5 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
@@ -264,6 +264,7 @@ static void __init psurge_quad_init(void) | |||
264 | static int __init smp_psurge_probe(void) | 264 | static int __init smp_psurge_probe(void) |
265 | { | 265 | { |
266 | int i, ncpus; | 266 | int i, ncpus; |
267 | struct device_node *dn; | ||
267 | 268 | ||
268 | /* We don't do SMP on the PPC601 -- paulus */ | 269 | /* We don't do SMP on the PPC601 -- paulus */ |
269 | if (PVR_VER(mfspr(SPRN_PVR)) == 1) | 270 | if (PVR_VER(mfspr(SPRN_PVR)) == 1) |
@@ -279,8 +280,10 @@ static int __init smp_psurge_probe(void) | |||
279 | * in the hammerhead memory controller in the case of the | 280 | * in the hammerhead memory controller in the case of the |
280 | * dual-cpu powersurge board. -- paulus. | 281 | * dual-cpu powersurge board. -- paulus. |
281 | */ | 282 | */ |
282 | if (find_devices("hammerhead") == NULL) | 283 | dn = of_find_node_by_name(NULL, "hammerhead"); |
284 | if (dn == NULL) | ||
283 | return 1; | 285 | return 1; |
286 | of_node_put(dn); | ||
284 | 287 | ||
285 | hhead_base = ioremap(HAMMERHEAD_BASE, 0x800); | 288 | hhead_base = ioremap(HAMMERHEAD_BASE, 0x800); |
286 | quad_base = ioremap(PSURGE_QUAD_REG_ADDR, 1024); | 289 | quad_base = ioremap(PSURGE_QUAD_REG_ADDR, 1024); |
@@ -567,7 +570,7 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus) | |||
567 | pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); | 570 | pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); |
568 | if (pmac_tb_clock_chip_host == NULL) | 571 | if (pmac_tb_clock_chip_host == NULL) |
569 | continue; | 572 | continue; |
570 | reg = get_property(cc, "reg", NULL); | 573 | reg = of_get_property(cc, "reg", NULL); |
571 | if (reg == NULL) | 574 | if (reg == NULL) |
572 | continue; | 575 | continue; |
573 | switch (*reg) { | 576 | switch (*reg) { |
@@ -695,7 +698,7 @@ static void __init smp_core99_setup(int ncpus) | |||
695 | struct device_node *cpus = | 698 | struct device_node *cpus = |
696 | of_find_node_by_path("/cpus"); | 699 | of_find_node_by_path("/cpus"); |
697 | if (cpus && | 700 | if (cpus && |
698 | get_property(cpus, "platform-cpu-timebase", NULL)) { | 701 | of_get_property(cpus, "platform-cpu-timebase", NULL)) { |
699 | pmac_tb_freeze = smp_core99_pfunc_tb_freeze; | 702 | pmac_tb_freeze = smp_core99_pfunc_tb_freeze; |
700 | printk(KERN_INFO "Processor timebase sync using" | 703 | printk(KERN_INFO "Processor timebase sync using" |
701 | " platform function\n"); | 704 | " platform function\n"); |
@@ -712,7 +715,7 @@ static void __init smp_core99_setup(int ncpus) | |||
712 | core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */ | 715 | core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */ |
713 | cpu = of_find_node_by_type(NULL, "cpu"); | 716 | cpu = of_find_node_by_type(NULL, "cpu"); |
714 | if (cpu != NULL) { | 717 | if (cpu != NULL) { |
715 | tbprop = get_property(cpu, "timebase-enable", NULL); | 718 | tbprop = of_get_property(cpu, "timebase-enable", NULL); |
716 | if (tbprop) | 719 | if (tbprop) |
717 | core99_tb_gpio = *tbprop; | 720 | core99_tb_gpio = *tbprop; |
718 | of_node_put(cpu); | 721 | of_node_put(cpu); |
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c index a4173906e945..bf9da56942e8 100644 --- a/arch/powerpc/platforms/powermac/time.c +++ b/arch/powerpc/platforms/powermac/time.c | |||
@@ -297,49 +297,11 @@ int __init via_calibrate_decr(void) | |||
297 | } | 297 | } |
298 | #endif | 298 | #endif |
299 | 299 | ||
300 | #ifdef CONFIG_PM | ||
301 | /* | ||
302 | * Reset the time after a sleep. | ||
303 | */ | ||
304 | static int | ||
305 | time_sleep_notify(struct pmu_sleep_notifier *self, int when) | ||
306 | { | ||
307 | static unsigned long time_diff; | ||
308 | unsigned long flags; | ||
309 | unsigned long seq; | ||
310 | struct timespec tv; | ||
311 | |||
312 | switch (when) { | ||
313 | case PBOOK_SLEEP_NOW: | ||
314 | do { | ||
315 | seq = read_seqbegin_irqsave(&xtime_lock, flags); | ||
316 | time_diff = xtime.tv_sec - pmac_get_boot_time(); | ||
317 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); | ||
318 | break; | ||
319 | case PBOOK_WAKE: | ||
320 | tv.tv_sec = pmac_get_boot_time() + time_diff; | ||
321 | tv.tv_nsec = 0; | ||
322 | do_settimeofday(&tv); | ||
323 | break; | ||
324 | } | ||
325 | return PBOOK_SLEEP_OK; | ||
326 | } | ||
327 | |||
328 | static struct pmu_sleep_notifier time_sleep_notifier = { | ||
329 | time_sleep_notify, SLEEP_LEVEL_MISC, | ||
330 | }; | ||
331 | #endif /* CONFIG_PM */ | ||
332 | |||
333 | /* | 300 | /* |
334 | * Query the OF and get the decr frequency. | 301 | * Query the OF and get the decr frequency. |
335 | */ | 302 | */ |
336 | void __init pmac_calibrate_decr(void) | 303 | void __init pmac_calibrate_decr(void) |
337 | { | 304 | { |
338 | #if defined(CONFIG_PM) && defined(CONFIG_ADB_PMU) | ||
339 | /* XXX why here? */ | ||
340 | pmu_register_sleep_notifier(&time_sleep_notifier); | ||
341 | #endif | ||
342 | |||
343 | generic_calibrate_decr(); | 305 | generic_calibrate_decr(); |
344 | 306 | ||
345 | #ifdef CONFIG_PPC32 | 307 | #ifdef CONFIG_PPC32 |
diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c index 379db05b0082..47de4d3fc167 100644 --- a/arch/powerpc/platforms/powermac/udbg_scc.c +++ b/arch/powerpc/platforms/powermac/udbg_scc.c | |||
@@ -81,7 +81,7 @@ void udbg_scc_init(int force_scc) | |||
81 | macio = of_get_parent(escc); | 81 | macio = of_get_parent(escc); |
82 | if (macio == NULL) | 82 | if (macio == NULL) |
83 | goto bail; | 83 | goto bail; |
84 | path = get_property(of_chosen, "linux,stdout-path", NULL); | 84 | path = of_get_property(of_chosen, "linux,stdout-path", NULL); |
85 | if (path != NULL) | 85 | if (path != NULL) |
86 | stdout = of_find_node_by_path(path); | 86 | stdout = of_find_node_by_path(path); |
87 | for (ch = NULL; (ch = of_get_next_child(escc, ch)) != NULL;) { | 87 | for (ch = NULL; (ch = of_get_next_child(escc, ch)) != NULL;) { |
@@ -96,13 +96,13 @@ void udbg_scc_init(int force_scc) | |||
96 | ch = ch_def ? ch_def : ch_a; | 96 | ch = ch_def ? ch_def : ch_a; |
97 | 97 | ||
98 | /* Get address within mac-io ASIC */ | 98 | /* Get address within mac-io ASIC */ |
99 | reg = get_property(escc, "reg", NULL); | 99 | reg = of_get_property(escc, "reg", NULL); |
100 | if (reg == NULL) | 100 | if (reg == NULL) |
101 | goto bail; | 101 | goto bail; |
102 | addr = reg[0]; | 102 | addr = reg[0]; |
103 | 103 | ||
104 | /* Get address of mac-io PCI itself */ | 104 | /* Get address of mac-io PCI itself */ |
105 | reg = get_property(macio, "assigned-addresses", NULL); | 105 | reg = of_get_property(macio, "assigned-addresses", NULL); |
106 | if (reg == NULL) | 106 | if (reg == NULL) |
107 | goto bail; | 107 | goto bail; |
108 | addr += reg[2]; | 108 | addr += reg[2]; |