diff options
author | Paul Mackerras <paulus@samba.org> | 2006-02-28 00:35:24 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-28 00:35:24 -0500 |
commit | 6749c5507388f3fc3719f57a54b540ee83f6661a (patch) | |
tree | c069f990f86b020a14b50759d0c75475eedde186 /arch/powerpc | |
parent | 2cf82c0256b198ae28c465f2c4d7c12c836ea5ea (diff) | |
parent | 56ec6462af9cba56a04439154e5768672d6f390f (diff) |
Merge ../powerpc-merge
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/Kconfig | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom.c | 54 | ||||
-rw-r--r-- | arch/powerpc/kernel/vdso64/gettimeofday.S | 4 | ||||
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 14 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_driver.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/pci_dlpar.c | 36 |
7 files changed, 77 insertions, 37 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index d112aed2999b..fec07a12c6cd 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -989,7 +989,7 @@ source "arch/powerpc/oprofile/Kconfig" | |||
989 | 989 | ||
990 | config KPROBES | 990 | config KPROBES |
991 | bool "Kprobes (EXPERIMENTAL)" | 991 | bool "Kprobes (EXPERIMENTAL)" |
992 | depends on PPC64 | 992 | depends on PPC64 && EXPERIMENTAL && MODULES |
993 | help | 993 | help |
994 | Kprobes allows you to trap at almost any kernel address and | 994 | Kprobes allows you to trap at almost any kernel address and |
995 | execute a callback function. register_kprobe() establishes | 995 | execute a callback function. register_kprobe() establishes |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 82d117c60d7f..d63cd562d9d5 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -816,8 +816,6 @@ void __init unflatten_device_tree(void) | |||
816 | { | 816 | { |
817 | unsigned long start, mem, size; | 817 | unsigned long start, mem, size; |
818 | struct device_node **allnextp = &allnodes; | 818 | struct device_node **allnextp = &allnodes; |
819 | char *p = NULL; | ||
820 | int l = 0; | ||
821 | 819 | ||
822 | DBG(" -> unflatten_device_tree()\n"); | 820 | DBG(" -> unflatten_device_tree()\n"); |
823 | 821 | ||
@@ -853,19 +851,6 @@ void __init unflatten_device_tree(void) | |||
853 | if (of_chosen == NULL) | 851 | if (of_chosen == NULL) |
854 | of_chosen = of_find_node_by_path("/chosen@0"); | 852 | of_chosen = of_find_node_by_path("/chosen@0"); |
855 | 853 | ||
856 | /* Retreive command line */ | ||
857 | if (of_chosen != NULL) { | ||
858 | p = (char *)get_property(of_chosen, "bootargs", &l); | ||
859 | if (p != NULL && l > 0) | ||
860 | strlcpy(cmd_line, p, min(l, COMMAND_LINE_SIZE)); | ||
861 | } | ||
862 | #ifdef CONFIG_CMDLINE | ||
863 | if (l == 0 || (l == 1 && (*p) == 0)) | ||
864 | strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); | ||
865 | #endif /* CONFIG_CMDLINE */ | ||
866 | |||
867 | DBG("Command line is: %s\n", cmd_line); | ||
868 | |||
869 | DBG(" <- unflatten_device_tree()\n"); | 854 | DBG(" <- unflatten_device_tree()\n"); |
870 | } | 855 | } |
871 | 856 | ||
@@ -936,6 +921,8 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
936 | { | 921 | { |
937 | u32 *prop; | 922 | u32 *prop; |
938 | unsigned long *lprop; | 923 | unsigned long *lprop; |
924 | unsigned long l; | ||
925 | char *p; | ||
939 | 926 | ||
940 | DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname); | 927 | DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname); |
941 | 928 | ||
@@ -1000,6 +987,41 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
1000 | crashk_res.end = crashk_res.start + *lprop - 1; | 987 | crashk_res.end = crashk_res.start + *lprop - 1; |
1001 | #endif | 988 | #endif |
1002 | 989 | ||
990 | /* Retreive command line */ | ||
991 | p = of_get_flat_dt_prop(node, "bootargs", &l); | ||
992 | if (p != NULL && l > 0) | ||
993 | strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE)); | ||
994 | |||
995 | #ifdef CONFIG_CMDLINE | ||
996 | if (l == 0 || (l == 1 && (*p) == 0)) | ||
997 | strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); | ||
998 | #endif /* CONFIG_CMDLINE */ | ||
999 | |||
1000 | DBG("Command line is: %s\n", cmd_line); | ||
1001 | |||
1002 | if (strstr(cmd_line, "mem=")) { | ||
1003 | char *p, *q; | ||
1004 | unsigned long maxmem = 0; | ||
1005 | |||
1006 | for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) { | ||
1007 | q = p + 4; | ||
1008 | if (p > cmd_line && p[-1] != ' ') | ||
1009 | continue; | ||
1010 | maxmem = simple_strtoul(q, &q, 0); | ||
1011 | if (*q == 'k' || *q == 'K') { | ||
1012 | maxmem <<= 10; | ||
1013 | ++q; | ||
1014 | } else if (*q == 'm' || *q == 'M') { | ||
1015 | maxmem <<= 20; | ||
1016 | ++q; | ||
1017 | } else if (*q == 'g' || *q == 'G') { | ||
1018 | maxmem <<= 30; | ||
1019 | ++q; | ||
1020 | } | ||
1021 | } | ||
1022 | memory_limit = maxmem; | ||
1023 | } | ||
1024 | |||
1003 | /* break now */ | 1025 | /* break now */ |
1004 | return 1; | 1026 | return 1; |
1005 | } | 1027 | } |
@@ -1120,7 +1142,7 @@ static void __init early_reserve_mem(void) | |||
1120 | size_32 = *(reserve_map_32++); | 1142 | size_32 = *(reserve_map_32++); |
1121 | if (size_32 == 0) | 1143 | if (size_32 == 0) |
1122 | break; | 1144 | break; |
1123 | DBG("reserving: %lx -> %lx\n", base_32, size_32); | 1145 | DBG("reserving: %x -> %x\n", base_32, size_32); |
1124 | lmb_reserve(base_32, size_32); | 1146 | lmb_reserve(base_32, size_32); |
1125 | } | 1147 | } |
1126 | return; | 1148 | return; |
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S index ccaeda5136d1..4ee871f1cadb 100644 --- a/arch/powerpc/kernel/vdso64/gettimeofday.S +++ b/arch/powerpc/kernel/vdso64/gettimeofday.S | |||
@@ -225,9 +225,9 @@ V_FUNCTION_BEGIN(__do_get_xsec) | |||
225 | .cfi_startproc | 225 | .cfi_startproc |
226 | /* check for update count & load values */ | 226 | /* check for update count & load values */ |
227 | 1: ld r8,CFG_TB_UPDATE_COUNT(r3) | 227 | 1: ld r8,CFG_TB_UPDATE_COUNT(r3) |
228 | andi. r0,r4,1 /* pending update ? loop */ | 228 | andi. r0,r8,1 /* pending update ? loop */ |
229 | bne- 1b | 229 | bne- 1b |
230 | xor r0,r4,r4 /* create dependency */ | 230 | xor r0,r8,r8 /* create dependency */ |
231 | add r3,r3,r0 | 231 | add r3,r3,r0 |
232 | 232 | ||
233 | /* Get TB & offset it */ | 233 | /* Get TB & offset it */ |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index ae2c919cbecd..7d9ce9a48219 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -169,7 +169,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
169 | #ifdef CONFIG_PPC_ISERIES | 169 | #ifdef CONFIG_PPC_ISERIES |
170 | if (_machine == PLATFORM_ISERIES_LPAR) | 170 | if (_machine == PLATFORM_ISERIES_LPAR) |
171 | ret = iSeries_hpte_insert(hpteg, va, | 171 | ret = iSeries_hpte_insert(hpteg, va, |
172 | virt_to_abs(paddr), | 172 | __pa(vaddr), |
173 | tmp_mode, | 173 | tmp_mode, |
174 | HPTE_V_BOLTED, | 174 | HPTE_V_BOLTED, |
175 | psize); | 175 | psize); |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 83578313ee7e..2ab9dcdfb415 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -893,6 +893,20 @@ void eeh_add_device_tree_early(struct device_node *dn) | |||
893 | } | 893 | } |
894 | EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); | 894 | EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); |
895 | 895 | ||
896 | void eeh_add_device_tree_late(struct pci_bus *bus) | ||
897 | { | ||
898 | struct pci_dev *dev; | ||
899 | |||
900 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
901 | eeh_add_device_late(dev); | ||
902 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | ||
903 | struct pci_bus *subbus = dev->subordinate; | ||
904 | if (subbus) | ||
905 | eeh_add_device_tree_late(subbus); | ||
906 | } | ||
907 | } | ||
908 | } | ||
909 | |||
896 | /** | 910 | /** |
897 | * eeh_add_device_late - perform EEH initialization for the indicated pci device | 911 | * eeh_add_device_late - perform EEH initialization for the indicated pci device |
898 | * @dev: pci device for which to set up EEH | 912 | * @dev: pci device for which to set up EEH |
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index e3cbba49fd6e..b811d5ff92fe 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | static inline const char * pcid_name (struct pci_dev *pdev) | 38 | static inline const char * pcid_name (struct pci_dev *pdev) |
39 | { | 39 | { |
40 | if (pdev->dev.driver) | 40 | if (pdev && pdev->dev.driver) |
41 | return pdev->dev.driver->name; | 41 | return pdev->dev.driver->name; |
42 | return ""; | 42 | return ""; |
43 | } | 43 | } |
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c index bdaa8aabdaa6..f3bad900bbcf 100644 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c | |||
@@ -106,6 +106,8 @@ pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus) | |||
106 | } | 106 | } |
107 | } | 107 | } |
108 | } | 108 | } |
109 | |||
110 | eeh_add_device_tree_late(bus); | ||
109 | } | 111 | } |
110 | EXPORT_SYMBOL_GPL(pcibios_fixup_new_pci_devices); | 112 | EXPORT_SYMBOL_GPL(pcibios_fixup_new_pci_devices); |
111 | 113 | ||
@@ -114,7 +116,6 @@ pcibios_pci_config_bridge(struct pci_dev *dev) | |||
114 | { | 116 | { |
115 | u8 sec_busno; | 117 | u8 sec_busno; |
116 | struct pci_bus *child_bus; | 118 | struct pci_bus *child_bus; |
117 | struct pci_dev *child_dev; | ||
118 | 119 | ||
119 | /* Get busno of downstream bus */ | 120 | /* Get busno of downstream bus */ |
120 | pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno); | 121 | pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno); |
@@ -129,10 +130,6 @@ pcibios_pci_config_bridge(struct pci_dev *dev) | |||
129 | 130 | ||
130 | pci_scan_child_bus(child_bus); | 131 | pci_scan_child_bus(child_bus); |
131 | 132 | ||
132 | list_for_each_entry(child_dev, &child_bus->devices, bus_list) { | ||
133 | eeh_add_device_late(child_dev); | ||
134 | } | ||
135 | |||
136 | /* Fixup new pci devices without touching bus struct */ | 133 | /* Fixup new pci devices without touching bus struct */ |
137 | pcibios_fixup_new_pci_devices(child_bus, 0); | 134 | pcibios_fixup_new_pci_devices(child_bus, 0); |
138 | 135 | ||
@@ -160,18 +157,25 @@ pcibios_add_pci_devices(struct pci_bus * bus) | |||
160 | 157 | ||
161 | eeh_add_device_tree_early(dn); | 158 | eeh_add_device_tree_early(dn); |
162 | 159 | ||
163 | /* pci_scan_slot should find all children */ | 160 | if (_machine == PLATFORM_PSERIES_LPAR) { |
164 | slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); | 161 | /* use ofdt-based probe */ |
165 | num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); | 162 | of_scan_bus(dn, bus); |
166 | if (num) { | 163 | if (!list_empty(&bus->devices)) { |
167 | pcibios_fixup_new_pci_devices(bus, 1); | 164 | pcibios_fixup_new_pci_devices(bus, 0); |
168 | pci_bus_add_devices(bus); | 165 | pci_bus_add_devices(bus); |
169 | } | 166 | } |
167 | } else { | ||
168 | /* use legacy probe */ | ||
169 | slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); | ||
170 | num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); | ||
171 | if (num) { | ||
172 | pcibios_fixup_new_pci_devices(bus, 1); | ||
173 | pci_bus_add_devices(bus); | ||
174 | } | ||
170 | 175 | ||
171 | list_for_each_entry(dev, &bus->devices, bus_list) { | 176 | list_for_each_entry(dev, &bus->devices, bus_list) |
172 | eeh_add_device_late (dev); | 177 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) |
173 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) | 178 | pcibios_pci_config_bridge(dev); |
174 | pcibios_pci_config_bridge(dev); | ||
175 | } | 179 | } |
176 | } | 180 | } |
177 | EXPORT_SYMBOL_GPL(pcibios_add_pci_devices); | 181 | EXPORT_SYMBOL_GPL(pcibios_add_pci_devices); |