diff options
Diffstat (limited to 'arch/powerpc/kernel')
| -rw-r--r-- | arch/powerpc/kernel/pci_64.c | 37 | ||||
| -rw-r--r-- | arch/powerpc/kernel/prom.c | 47 |
2 files changed, 44 insertions, 40 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 6d05a1f377b5..b0409e19b1c1 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
| @@ -1098,35 +1098,24 @@ static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys, | |||
| 1098 | unsigned long *start_virt, unsigned long *size) | 1098 | unsigned long *start_virt, unsigned long *size) |
| 1099 | { | 1099 | { |
| 1100 | struct pci_controller *hose = pci_bus_to_host(bus); | 1100 | struct pci_controller *hose = pci_bus_to_host(bus); |
| 1101 | struct pci_bus_region region; | ||
| 1102 | struct resource *res; | 1101 | struct resource *res; |
| 1103 | 1102 | ||
| 1104 | if (bus->self) { | 1103 | if (bus->self) |
| 1105 | res = bus->resource[0]; | 1104 | res = bus->resource[0]; |
| 1106 | pcibios_resource_to_bus(bus->self, ®ion, res); | 1105 | else |
| 1107 | *start_phys = hose->io_base_phys + region.start; | ||
| 1108 | *start_virt = (unsigned long) hose->io_base_virt + | ||
| 1109 | region.start; | ||
| 1110 | if (region.end > region.start) | ||
| 1111 | *size = region.end - region.start + 1; | ||
| 1112 | else { | ||
| 1113 | printk("%s(): unexpected region 0x%lx->0x%lx\n", | ||
| 1114 | __FUNCTION__, region.start, region.end); | ||
| 1115 | return 1; | ||
| 1116 | } | ||
| 1117 | |||
| 1118 | } else { | ||
| 1119 | /* Root Bus */ | 1106 | /* Root Bus */ |
| 1120 | res = &hose->io_resource; | 1107 | res = &hose->io_resource; |
| 1121 | *start_phys = hose->io_base_phys + res->start; | 1108 | |
| 1122 | *start_virt = (unsigned long) hose->io_base_virt + res->start; | 1109 | *start_virt = pci_io_base + res->start; |
| 1123 | if (res->end > res->start) | 1110 | *start_phys = *start_virt + hose->io_base_phys |
| 1124 | *size = res->end - res->start + 1; | 1111 | - (unsigned long) hose->io_base_virt; |
| 1125 | else { | 1112 | |
| 1126 | printk("%s(): unexpected region 0x%lx->0x%lx\n", | 1113 | if (res->end > res->start) |
| 1127 | __FUNCTION__, res->start, res->end); | 1114 | *size = res->end - res->start + 1; |
| 1128 | return 1; | 1115 | else { |
| 1129 | } | 1116 | printk("%s(): unexpected region 0x%lx->0x%lx\n", |
| 1117 | __FUNCTION__, res->start, res->end); | ||
| 1118 | return 1; | ||
| 1130 | } | 1119 | } |
| 1131 | 1120 | ||
| 1132 | return 0; | 1121 | return 0; |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index caef555f2dc0..c065b5550368 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
| @@ -716,11 +716,40 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
| 716 | return 0; | 716 | return 0; |
| 717 | } | 717 | } |
| 718 | 718 | ||
| 719 | #ifdef CONFIG_BLK_DEV_INITRD | ||
| 720 | static void __init early_init_dt_check_for_initrd(unsigned long node) | ||
| 721 | { | ||
| 722 | unsigned long l; | ||
| 723 | u32 *prop; | ||
| 724 | |||
| 725 | DBG("Looking for initrd properties... "); | ||
| 726 | |||
| 727 | prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l); | ||
| 728 | if (prop) { | ||
| 729 | initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4)); | ||
| 730 | |||
| 731 | prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l); | ||
| 732 | if (prop) { | ||
| 733 | initrd_end = (unsigned long) | ||
| 734 | __va(of_read_ulong(prop, l/4)); | ||
| 735 | initrd_below_start_ok = 1; | ||
| 736 | } else { | ||
| 737 | initrd_start = 0; | ||
| 738 | } | ||
| 739 | } | ||
| 740 | |||
| 741 | DBG("initrd_start=0x%lx initrd_end=0x%lx\n", initrd_start, initrd_end); | ||
| 742 | } | ||
| 743 | #else | ||
| 744 | static inline void early_init_dt_check_for_initrd(unsigned long node) | ||
| 745 | { | ||
| 746 | } | ||
| 747 | #endif /* CONFIG_BLK_DEV_INITRD */ | ||
| 748 | |||
| 719 | static int __init early_init_dt_scan_chosen(unsigned long node, | 749 | static int __init early_init_dt_scan_chosen(unsigned long node, |
| 720 | const char *uname, int depth, void *data) | 750 | const char *uname, int depth, void *data) |
| 721 | { | 751 | { |
| 722 | unsigned long *lprop; | 752 | unsigned long *lprop; |
| 723 | u32 *prop; | ||
| 724 | unsigned long l; | 753 | unsigned long l; |
| 725 | char *p; | 754 | char *p; |
| 726 | 755 | ||
| @@ -762,21 +791,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
| 762 | crashk_res.end = crashk_res.start + *lprop - 1; | 791 | crashk_res.end = crashk_res.start + *lprop - 1; |
| 763 | #endif | 792 | #endif |
| 764 | 793 | ||
| 765 | #ifdef CONFIG_BLK_DEV_INITRD | 794 | early_init_dt_check_for_initrd(node); |
| 766 | DBG("Looking for initrd properties... "); | ||
| 767 | prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l); | ||
| 768 | if (prop) { | ||
| 769 | initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4)); | ||
| 770 | prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l); | ||
| 771 | if (prop) { | ||
| 772 | initrd_end = (unsigned long)__va(of_read_ulong(prop, l/4)); | ||
| 773 | initrd_below_start_ok = 1; | ||
| 774 | } else { | ||
| 775 | initrd_start = 0; | ||
| 776 | } | ||
| 777 | } | ||
| 778 | DBG("initrd_start=0x%lx initrd_end=0x%lx\n", initrd_start, initrd_end); | ||
| 779 | #endif /* CONFIG_BLK_DEV_INITRD */ | ||
| 780 | 795 | ||
| 781 | /* Retreive command line */ | 796 | /* Retreive command line */ |
| 782 | p = of_get_flat_dt_prop(node, "bootargs", &l); | 797 | p = of_get_flat_dt_prop(node, "bootargs", &l); |
