diff options
Diffstat (limited to 'arch/ppc64')
-rw-r--r-- | arch/ppc64/Makefile | 9 | ||||
-rw-r--r-- | arch/ppc64/configs/g5_defconfig | 6 | ||||
-rw-r--r-- | arch/ppc64/configs/iSeries_defconfig | 6 | ||||
-rw-r--r-- | arch/ppc64/configs/maple_defconfig | 6 | ||||
-rw-r--r-- | arch/ppc64/configs/pSeries_defconfig | 6 | ||||
-rw-r--r-- | arch/ppc64/defconfig | 6 | ||||
-rw-r--r-- | arch/ppc64/kernel/head.S | 16 | ||||
-rw-r--r-- | arch/ppc64/kernel/iSeries_vio.c | 21 | ||||
-rw-r--r-- | arch/ppc64/kernel/lparcfg.c | 1 | ||||
-rw-r--r-- | arch/ppc64/kernel/of_device.c | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/pSeries_vio.c | 19 | ||||
-rw-r--r-- | arch/ppc64/kernel/prom_init.c | 5 | ||||
-rw-r--r-- | arch/ppc64/kernel/vio.c | 73 | ||||
-rw-r--r-- | arch/ppc64/mm/hash_low.S | 4 | ||||
-rw-r--r-- | arch/ppc64/oprofile/common.c | 1 |
15 files changed, 102 insertions, 79 deletions
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile index 731b84758331..6350cce82efb 100644 --- a/arch/ppc64/Makefile +++ b/arch/ppc64/Makefile | |||
@@ -55,6 +55,8 @@ LDFLAGS := -m elf64ppc | |||
55 | LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD) | 55 | LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD) |
56 | CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \ | 56 | CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \ |
57 | -mcall-aixdesc | 57 | -mcall-aixdesc |
58 | # Temporary hack until we have migrated to asm-powerpc | ||
59 | CPPFLAGS += -Iinclude3 | ||
58 | 60 | ||
59 | GCC_VERSION := $(call cc-version) | 61 | GCC_VERSION := $(call cc-version) |
60 | GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi ;) | 62 | GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi ;) |
@@ -112,6 +114,7 @@ all: $(KBUILD_IMAGE) | |||
112 | 114 | ||
113 | archclean: | 115 | archclean: |
114 | $(Q)$(MAKE) $(clean)=$(boot) | 116 | $(Q)$(MAKE) $(clean)=$(boot) |
117 | $(Q)rm -rf include3 | ||
115 | 118 | ||
116 | prepare: include/asm-ppc64/offsets.h | 119 | prepare: include/asm-ppc64/offsets.h |
117 | 120 | ||
@@ -121,6 +124,12 @@ arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \ | |||
121 | include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s | 124 | include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s |
122 | $(call filechk,gen-asm-offsets) | 125 | $(call filechk,gen-asm-offsets) |
123 | 126 | ||
127 | # Temporary hack until we have migrated to asm-powerpc | ||
128 | include/asm: include3/asm | ||
129 | include3/asm: | ||
130 | $(Q)if [ ! -d include3 ]; then mkdir -p include3; fi; | ||
131 | $(Q)ln -fsn $(srctree)/include/asm-powerpc include3/asm | ||
132 | |||
124 | define archhelp | 133 | define archhelp |
125 | echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' | 134 | echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' |
126 | echo ' zImage.initrd- Compressed kernel image with initrd attached,' | 135 | echo ' zImage.initrd- Compressed kernel image with initrd attached,' |
diff --git a/arch/ppc64/configs/g5_defconfig b/arch/ppc64/configs/g5_defconfig index ab567741e80e..fc83d9330282 100644 --- a/arch/ppc64/configs/g5_defconfig +++ b/arch/ppc64/configs/g5_defconfig | |||
@@ -103,10 +103,10 @@ CONFIG_PREEMPT_NONE=y | |||
103 | # CONFIG_PREEMPT_VOLUNTARY is not set | 103 | # CONFIG_PREEMPT_VOLUNTARY is not set |
104 | # CONFIG_PREEMPT is not set | 104 | # CONFIG_PREEMPT is not set |
105 | # CONFIG_PREEMPT_BKL is not set | 105 | # CONFIG_PREEMPT_BKL is not set |
106 | CONFIG_HZ_100=y | 106 | # CONFIG_HZ_100 is not set |
107 | # CONFIG_HZ_250 is not set | 107 | CONFIG_HZ_250=y |
108 | # CONFIG_HZ_1000 is not set | 108 | # CONFIG_HZ_1000 is not set |
109 | CONFIG_HZ=100 | 109 | CONFIG_HZ=250 |
110 | CONFIG_GENERIC_HARDIRQS=y | 110 | CONFIG_GENERIC_HARDIRQS=y |
111 | CONFIG_SECCOMP=y | 111 | CONFIG_SECCOMP=y |
112 | CONFIG_ISA_DMA_API=y | 112 | CONFIG_ISA_DMA_API=y |
diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig index 219c6677abcc..013d4e0e4003 100644 --- a/arch/ppc64/configs/iSeries_defconfig +++ b/arch/ppc64/configs/iSeries_defconfig | |||
@@ -94,10 +94,10 @@ CONFIG_PREEMPT_NONE=y | |||
94 | # CONFIG_PREEMPT_VOLUNTARY is not set | 94 | # CONFIG_PREEMPT_VOLUNTARY is not set |
95 | # CONFIG_PREEMPT is not set | 95 | # CONFIG_PREEMPT is not set |
96 | # CONFIG_PREEMPT_BKL is not set | 96 | # CONFIG_PREEMPT_BKL is not set |
97 | CONFIG_HZ_100=y | 97 | # CONFIG_HZ_100 is not set |
98 | # CONFIG_HZ_250 is not set | 98 | CONFIG_HZ_250=y |
99 | # CONFIG_HZ_1000 is not set | 99 | # CONFIG_HZ_1000 is not set |
100 | CONFIG_HZ=100 | 100 | CONFIG_HZ=250 |
101 | CONFIG_GENERIC_HARDIRQS=y | 101 | CONFIG_GENERIC_HARDIRQS=y |
102 | CONFIG_LPARCFG=y | 102 | CONFIG_LPARCFG=y |
103 | CONFIG_SECCOMP=y | 103 | CONFIG_SECCOMP=y |
diff --git a/arch/ppc64/configs/maple_defconfig b/arch/ppc64/configs/maple_defconfig index 2033fe663dbe..dd42892cd873 100644 --- a/arch/ppc64/configs/maple_defconfig +++ b/arch/ppc64/configs/maple_defconfig | |||
@@ -103,10 +103,10 @@ CONFIG_PREEMPT_NONE=y | |||
103 | # CONFIG_PREEMPT_VOLUNTARY is not set | 103 | # CONFIG_PREEMPT_VOLUNTARY is not set |
104 | # CONFIG_PREEMPT is not set | 104 | # CONFIG_PREEMPT is not set |
105 | # CONFIG_PREEMPT_BKL is not set | 105 | # CONFIG_PREEMPT_BKL is not set |
106 | CONFIG_HZ_100=y | 106 | # CONFIG_HZ_100 is not set |
107 | # CONFIG_HZ_250 is not set | 107 | CONFIG_HZ_250=y |
108 | # CONFIG_HZ_1000 is not set | 108 | # CONFIG_HZ_1000 is not set |
109 | CONFIG_HZ=100 | 109 | CONFIG_HZ=250 |
110 | CONFIG_GENERIC_HARDIRQS=y | 110 | CONFIG_GENERIC_HARDIRQS=y |
111 | CONFIG_SECCOMP=y | 111 | CONFIG_SECCOMP=y |
112 | CONFIG_ISA_DMA_API=y | 112 | CONFIG_ISA_DMA_API=y |
diff --git a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig index 297fd5229487..29f7b80b0efc 100644 --- a/arch/ppc64/configs/pSeries_defconfig +++ b/arch/ppc64/configs/pSeries_defconfig | |||
@@ -112,10 +112,10 @@ CONFIG_PREEMPT_NONE=y | |||
112 | # CONFIG_PREEMPT_VOLUNTARY is not set | 112 | # CONFIG_PREEMPT_VOLUNTARY is not set |
113 | # CONFIG_PREEMPT is not set | 113 | # CONFIG_PREEMPT is not set |
114 | # CONFIG_PREEMPT_BKL is not set | 114 | # CONFIG_PREEMPT_BKL is not set |
115 | CONFIG_HZ_100=y | 115 | # CONFIG_HZ_100 is not set |
116 | # CONFIG_HZ_250 is not set | 116 | CONFIG_HZ_250=y |
117 | # CONFIG_HZ_1000 is not set | 117 | # CONFIG_HZ_1000 is not set |
118 | CONFIG_HZ=100 | 118 | CONFIG_HZ=250 |
119 | CONFIG_EEH=y | 119 | CONFIG_EEH=y |
120 | CONFIG_GENERIC_HARDIRQS=y | 120 | CONFIG_GENERIC_HARDIRQS=y |
121 | CONFIG_PPC_RTAS=y | 121 | CONFIG_PPC_RTAS=y |
diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig index c361e7727b7a..7cb4750bb7a9 100644 --- a/arch/ppc64/defconfig +++ b/arch/ppc64/defconfig | |||
@@ -114,10 +114,10 @@ CONFIG_PREEMPT_NONE=y | |||
114 | # CONFIG_PREEMPT_VOLUNTARY is not set | 114 | # CONFIG_PREEMPT_VOLUNTARY is not set |
115 | # CONFIG_PREEMPT is not set | 115 | # CONFIG_PREEMPT is not set |
116 | # CONFIG_PREEMPT_BKL is not set | 116 | # CONFIG_PREEMPT_BKL is not set |
117 | CONFIG_HZ_100=y | 117 | # CONFIG_HZ_100 is not set |
118 | # CONFIG_HZ_250 is not set | 118 | CONFIG_HZ_250=y |
119 | # CONFIG_HZ_1000 is not set | 119 | # CONFIG_HZ_1000 is not set |
120 | CONFIG_HZ=100 | 120 | CONFIG_HZ=250 |
121 | CONFIG_EEH=y | 121 | CONFIG_EEH=y |
122 | CONFIG_GENERIC_HARDIRQS=y | 122 | CONFIG_GENERIC_HARDIRQS=y |
123 | CONFIG_PPC_RTAS=y | 123 | CONFIG_PPC_RTAS=y |
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S index cccec4902646..036959775623 100644 --- a/arch/ppc64/kernel/head.S +++ b/arch/ppc64/kernel/head.S | |||
@@ -1269,7 +1269,21 @@ initial_stab: | |||
1269 | .= 0x7000 | 1269 | .= 0x7000 |
1270 | .globl fwnmi_data_area | 1270 | .globl fwnmi_data_area |
1271 | fwnmi_data_area: | 1271 | fwnmi_data_area: |
1272 | .space PAGE_SIZE | 1272 | |
1273 | /* iSeries does not use the FWNMI stuff, so it is safe to put | ||
1274 | * this here, even if we later allow kernels that will boot on | ||
1275 | * both pSeries and iSeries */ | ||
1276 | #ifdef CONFIG_PPC_ISERIES | ||
1277 | . = LPARMAP_PHYS | ||
1278 | #include "lparmap.s" | ||
1279 | /* | ||
1280 | * This ".text" is here for old compilers that generate a trailing | ||
1281 | * .note section when compiling .c files to .s | ||
1282 | */ | ||
1283 | .text | ||
1284 | #endif /* CONFIG_PPC_ISERIES */ | ||
1285 | |||
1286 | . = 0x8000 | ||
1273 | 1287 | ||
1274 | /* | 1288 | /* |
1275 | * On pSeries, secondary processors spin in the following code. | 1289 | * On pSeries, secondary processors spin in the following code. |
diff --git a/arch/ppc64/kernel/iSeries_vio.c b/arch/ppc64/kernel/iSeries_vio.c index b4268cc4ba48..6b754b0c8344 100644 --- a/arch/ppc64/kernel/iSeries_vio.c +++ b/arch/ppc64/kernel/iSeries_vio.c | |||
@@ -68,7 +68,7 @@ static void __init iommu_vio_init(void) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | /** | 70 | /** |
71 | * vio_register_device: - Register a new vio device. | 71 | * vio_register_device_iseries: - Register a new iSeries vio device. |
72 | * @voidev: The device to register. | 72 | * @voidev: The device to register. |
73 | */ | 73 | */ |
74 | static struct vio_dev *__init vio_register_device_iseries(char *type, | 74 | static struct vio_dev *__init vio_register_device_iseries(char *type, |
@@ -76,7 +76,7 @@ static struct vio_dev *__init vio_register_device_iseries(char *type, | |||
76 | { | 76 | { |
77 | struct vio_dev *viodev; | 77 | struct vio_dev *viodev; |
78 | 78 | ||
79 | /* allocate a vio_dev for this node */ | 79 | /* allocate a vio_dev for this device */ |
80 | viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL); | 80 | viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL); |
81 | if (!viodev) | 81 | if (!viodev) |
82 | return NULL; | 82 | return NULL; |
@@ -84,8 +84,15 @@ static struct vio_dev *__init vio_register_device_iseries(char *type, | |||
84 | 84 | ||
85 | snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s%d", type, unit_num); | 85 | snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s%d", type, unit_num); |
86 | 86 | ||
87 | return vio_register_device_common(viodev, viodev->dev.bus_id, type, | 87 | viodev->name = viodev->dev.bus_id; |
88 | unit_num, &vio_iommu_table); | 88 | viodev->type = type; |
89 | viodev->unit_address = unit_num; | ||
90 | viodev->iommu_table = &vio_iommu_table; | ||
91 | if (vio_register_device(viodev) == NULL) { | ||
92 | kfree(viodev); | ||
93 | return NULL; | ||
94 | } | ||
95 | return viodev; | ||
89 | } | 96 | } |
90 | 97 | ||
91 | void __init probe_bus_iseries(void) | 98 | void __init probe_bus_iseries(void) |
@@ -124,6 +131,10 @@ static int vio_match_device_iseries(const struct vio_device_id *id, | |||
124 | return strncmp(dev->type, id->type, strlen(id->type)) == 0; | 131 | return strncmp(dev->type, id->type, strlen(id->type)) == 0; |
125 | } | 132 | } |
126 | 133 | ||
134 | static struct vio_bus_ops vio_bus_ops_iseries = { | ||
135 | .match = vio_match_device_iseries, | ||
136 | }; | ||
137 | |||
127 | /** | 138 | /** |
128 | * vio_bus_init_iseries: - Initialize the iSeries virtual IO bus | 139 | * vio_bus_init_iseries: - Initialize the iSeries virtual IO bus |
129 | */ | 140 | */ |
@@ -131,7 +142,7 @@ static int __init vio_bus_init_iseries(void) | |||
131 | { | 142 | { |
132 | int err; | 143 | int err; |
133 | 144 | ||
134 | err = vio_bus_init(vio_match_device_iseries, NULL, NULL); | 145 | err = vio_bus_init(&vio_bus_ops_iseries); |
135 | if (err == 0) { | 146 | if (err == 0) { |
136 | iommu_vio_init(); | 147 | iommu_vio_init(); |
137 | vio_bus_device.iommu_table = &vio_iommu_table; | 148 | vio_bus_device.iommu_table = &vio_iommu_table; |
diff --git a/arch/ppc64/kernel/lparcfg.c b/arch/ppc64/kernel/lparcfg.c index 9d034ff062b1..edad361a8db0 100644 --- a/arch/ppc64/kernel/lparcfg.c +++ b/arch/ppc64/kernel/lparcfg.c | |||
@@ -273,6 +273,7 @@ static void parse_system_parameter_string(struct seq_file *m) | |||
273 | if (!workbuffer) { | 273 | if (!workbuffer) { |
274 | printk(KERN_ERR "%s %s kmalloc failure at line %d \n", | 274 | printk(KERN_ERR "%s %s kmalloc failure at line %d \n", |
275 | __FILE__, __FUNCTION__, __LINE__); | 275 | __FILE__, __FUNCTION__, __LINE__); |
276 | kfree(local_buffer); | ||
276 | return; | 277 | return; |
277 | } | 278 | } |
278 | #ifdef LPARCFG_DEBUG | 279 | #ifdef LPARCFG_DEBUG |
diff --git a/arch/ppc64/kernel/of_device.c b/arch/ppc64/kernel/of_device.c index b80e81984ba8..da580812ddfe 100644 --- a/arch/ppc64/kernel/of_device.c +++ b/arch/ppc64/kernel/of_device.c | |||
@@ -236,7 +236,6 @@ void of_device_unregister(struct of_device *ofdev) | |||
236 | struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id) | 236 | struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id) |
237 | { | 237 | { |
238 | struct of_device *dev; | 238 | struct of_device *dev; |
239 | u32 *reg; | ||
240 | 239 | ||
241 | dev = kmalloc(sizeof(*dev), GFP_KERNEL); | 240 | dev = kmalloc(sizeof(*dev), GFP_KERNEL); |
242 | if (!dev) | 241 | if (!dev) |
@@ -250,7 +249,6 @@ struct of_device* of_platform_device_create(struct device_node *np, const char * | |||
250 | dev->dev.bus = &of_platform_bus_type; | 249 | dev->dev.bus = &of_platform_bus_type; |
251 | dev->dev.release = of_release_dev; | 250 | dev->dev.release = of_release_dev; |
252 | 251 | ||
253 | reg = (u32 *)get_property(np, "reg", NULL); | ||
254 | strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE); | 252 | strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE); |
255 | 253 | ||
256 | if (of_device_register(dev) != 0) { | 254 | if (of_device_register(dev) != 0) { |
diff --git a/arch/ppc64/kernel/pSeries_vio.c b/arch/ppc64/kernel/pSeries_vio.c index 338f9e1bdc09..e0ae06f58f86 100644 --- a/arch/ppc64/kernel/pSeries_vio.c +++ b/arch/ppc64/kernel/pSeries_vio.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/kobject.h> | 19 | #include <linux/kobject.h> |
20 | #include <asm/iommu.h> | 20 | #include <asm/iommu.h> |
21 | #include <asm/dma.h> | 21 | #include <asm/dma.h> |
22 | #include <asm/prom.h> | ||
22 | #include <asm/vio.h> | 23 | #include <asm/vio.h> |
23 | #include <asm/hvcall.h> | 24 | #include <asm/hvcall.h> |
24 | 25 | ||
@@ -75,6 +76,12 @@ static void vio_unregister_device_pseries(struct vio_dev *viodev) | |||
75 | device_remove_file(&viodev->dev, &dev_attr_devspec); | 76 | device_remove_file(&viodev->dev, &dev_attr_devspec); |
76 | } | 77 | } |
77 | 78 | ||
79 | static struct vio_bus_ops vio_bus_ops_pseries = { | ||
80 | .match = vio_match_device_pseries, | ||
81 | .unregister_device = vio_unregister_device_pseries, | ||
82 | .release_device = vio_release_device_pseries, | ||
83 | }; | ||
84 | |||
78 | /** | 85 | /** |
79 | * vio_bus_init_pseries: - Initialize the pSeries virtual IO bus | 86 | * vio_bus_init_pseries: - Initialize the pSeries virtual IO bus |
80 | */ | 87 | */ |
@@ -82,9 +89,7 @@ static int __init vio_bus_init_pseries(void) | |||
82 | { | 89 | { |
83 | int err; | 90 | int err; |
84 | 91 | ||
85 | err = vio_bus_init(vio_match_device_pseries, | 92 | err = vio_bus_init(&vio_bus_ops_pseries); |
86 | vio_unregister_device_pseries, | ||
87 | vio_release_device_pseries); | ||
88 | if (err == 0) | 93 | if (err == 0) |
89 | probe_bus_pseries(); | 94 | probe_bus_pseries(); |
90 | return err; | 95 | return err; |
@@ -181,11 +186,13 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node) | |||
181 | } | 186 | } |
182 | 187 | ||
183 | snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address); | 188 | snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address); |
189 | viodev->name = of_node->name; | ||
190 | viodev->type = of_node->type; | ||
191 | viodev->unit_address = *unit_address; | ||
192 | viodev->iommu_table = vio_build_iommu_table(viodev); | ||
184 | 193 | ||
185 | /* register with generic device framework */ | 194 | /* register with generic device framework */ |
186 | if (vio_register_device_common(viodev, of_node->name, of_node->type, | 195 | if (vio_register_device(viodev) == NULL) { |
187 | *unit_address, vio_build_iommu_table(viodev)) | ||
188 | == NULL) { | ||
189 | /* XXX free TCE table */ | 196 | /* XXX free TCE table */ |
190 | kfree(viodev); | 197 | kfree(viodev); |
191 | return NULL; | 198 | return NULL; |
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c index adcf972711fc..122283a1d39a 100644 --- a/arch/ppc64/kernel/prom_init.c +++ b/arch/ppc64/kernel/prom_init.c | |||
@@ -892,7 +892,10 @@ static void __init prom_init_mem(void) | |||
892 | if ( RELOC(of_platform) == PLATFORM_PSERIES_LPAR ) | 892 | if ( RELOC(of_platform) == PLATFORM_PSERIES_LPAR ) |
893 | RELOC(alloc_top) = RELOC(rmo_top); | 893 | RELOC(alloc_top) = RELOC(rmo_top); |
894 | else | 894 | else |
895 | RELOC(alloc_top) = RELOC(rmo_top) = min(0x40000000ul, RELOC(ram_top)); | 895 | /* Some RS64 machines have buggy firmware where claims up at 1GB |
896 | * fails. Cap at 768MB as a workaround. Still plenty of room. | ||
897 | */ | ||
898 | RELOC(alloc_top) = RELOC(rmo_top) = min(0x30000000ul, RELOC(ram_top)); | ||
896 | 899 | ||
897 | prom_printf("memory layout at init:\n"); | 900 | prom_printf("memory layout at init:\n"); |
898 | prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit)); | 901 | prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit)); |
diff --git a/arch/ppc64/kernel/vio.c b/arch/ppc64/kernel/vio.c index 3b790bafcaad..c90e1dd875ce 100644 --- a/arch/ppc64/kernel/vio.c +++ b/arch/ppc64/kernel/vio.c | |||
@@ -32,14 +32,13 @@ struct vio_dev vio_bus_device = { /* fake "parent" device */ | |||
32 | .dev.bus = &vio_bus_type, | 32 | .dev.bus = &vio_bus_type, |
33 | }; | 33 | }; |
34 | 34 | ||
35 | static int (*is_match)(const struct vio_device_id *id, | 35 | static struct vio_bus_ops vio_bus_ops; |
36 | const struct vio_dev *dev); | ||
37 | static void (*unregister_device_callback)(struct vio_dev *dev); | ||
38 | static void (*release_device_callback)(struct device *dev); | ||
39 | 36 | ||
40 | /* convert from struct device to struct vio_dev and pass to driver. | 37 | /* |
38 | * Convert from struct device to struct vio_dev and pass to driver. | ||
41 | * dev->driver has already been set by generic code because vio_bus_match | 39 | * dev->driver has already been set by generic code because vio_bus_match |
42 | * succeeded. */ | 40 | * succeeded. |
41 | */ | ||
43 | static int vio_bus_probe(struct device *dev) | 42 | static int vio_bus_probe(struct device *dev) |
44 | { | 43 | { |
45 | struct vio_dev *viodev = to_vio_dev(dev); | 44 | struct vio_dev *viodev = to_vio_dev(dev); |
@@ -51,9 +50,8 @@ static int vio_bus_probe(struct device *dev) | |||
51 | return error; | 50 | return error; |
52 | 51 | ||
53 | id = vio_match_device(viodrv->id_table, viodev); | 52 | id = vio_match_device(viodrv->id_table, viodev); |
54 | if (id) { | 53 | if (id) |
55 | error = viodrv->probe(viodev, id); | 54 | error = viodrv->probe(viodev, id); |
56 | } | ||
57 | 55 | ||
58 | return error; | 56 | return error; |
59 | } | 57 | } |
@@ -64,9 +62,8 @@ static int vio_bus_remove(struct device *dev) | |||
64 | struct vio_dev *viodev = to_vio_dev(dev); | 62 | struct vio_dev *viodev = to_vio_dev(dev); |
65 | struct vio_driver *viodrv = to_vio_driver(dev->driver); | 63 | struct vio_driver *viodrv = to_vio_driver(dev->driver); |
66 | 64 | ||
67 | if (viodrv->remove) { | 65 | if (viodrv->remove) |
68 | return viodrv->remove(viodev); | 66 | return viodrv->remove(viodev); |
69 | } | ||
70 | 67 | ||
71 | /* driver can't remove */ | 68 | /* driver can't remove */ |
72 | return 1; | 69 | return 1; |
@@ -102,19 +99,20 @@ void vio_unregister_driver(struct vio_driver *viodrv) | |||
102 | EXPORT_SYMBOL(vio_unregister_driver); | 99 | EXPORT_SYMBOL(vio_unregister_driver); |
103 | 100 | ||
104 | /** | 101 | /** |
105 | * vio_match_device: - Tell if a VIO device has a matching VIO device id structure. | 102 | * vio_match_device: - Tell if a VIO device has a matching |
106 | * @ids: array of VIO device id structures to search in | 103 | * VIO device id structure. |
107 | * @dev: the VIO device structure to match against | 104 | * @ids: array of VIO device id structures to search in |
105 | * @dev: the VIO device structure to match against | ||
108 | * | 106 | * |
109 | * Used by a driver to check whether a VIO device present in the | 107 | * Used by a driver to check whether a VIO device present in the |
110 | * system is in its list of supported devices. Returns the matching | 108 | * system is in its list of supported devices. Returns the matching |
111 | * vio_device_id structure or NULL if there is no match. | 109 | * vio_device_id structure or NULL if there is no match. |
112 | */ | 110 | */ |
113 | static const struct vio_device_id * vio_match_device(const struct vio_device_id *ids, | 111 | static const struct vio_device_id *vio_match_device( |
114 | const struct vio_dev *dev) | 112 | const struct vio_device_id *ids, const struct vio_dev *dev) |
115 | { | 113 | { |
116 | while (ids->type) { | 114 | while (ids->type[0] != '\0') { |
117 | if (is_match(ids, dev)) | 115 | if (vio_bus_ops.match(ids, dev)) |
118 | return ids; | 116 | return ids; |
119 | ids++; | 117 | ids++; |
120 | } | 118 | } |
@@ -124,16 +122,11 @@ static const struct vio_device_id * vio_match_device(const struct vio_device_id | |||
124 | /** | 122 | /** |
125 | * vio_bus_init: - Initialize the virtual IO bus | 123 | * vio_bus_init: - Initialize the virtual IO bus |
126 | */ | 124 | */ |
127 | int __init vio_bus_init(int (*match_func)(const struct vio_device_id *id, | 125 | int __init vio_bus_init(struct vio_bus_ops *ops) |
128 | const struct vio_dev *dev), | ||
129 | void (*unregister_dev)(struct vio_dev *), | ||
130 | void (*release_dev)(struct device *)) | ||
131 | { | 126 | { |
132 | int err; | 127 | int err; |
133 | 128 | ||
134 | is_match = match_func; | 129 | vio_bus_ops = *ops; |
135 | unregister_device_callback = unregister_dev; | ||
136 | release_device_callback = release_dev; | ||
137 | 130 | ||
138 | err = bus_register(&vio_bus_type); | 131 | err = bus_register(&vio_bus_type); |
139 | if (err) { | 132 | if (err) { |
@@ -141,7 +134,8 @@ int __init vio_bus_init(int (*match_func)(const struct vio_device_id *id, | |||
141 | return err; | 134 | return err; |
142 | } | 135 | } |
143 | 136 | ||
144 | /* the fake parent of all vio devices, just to give us | 137 | /* |
138 | * The fake parent of all vio devices, just to give us | ||
145 | * a nice directory | 139 | * a nice directory |
146 | */ | 140 | */ |
147 | err = device_register(&vio_bus_device.dev); | 141 | err = device_register(&vio_bus_device.dev); |
@@ -157,25 +151,20 @@ int __init vio_bus_init(int (*match_func)(const struct vio_device_id *id, | |||
157 | /* vio_dev refcount hit 0 */ | 151 | /* vio_dev refcount hit 0 */ |
158 | static void __devinit vio_dev_release(struct device *dev) | 152 | static void __devinit vio_dev_release(struct device *dev) |
159 | { | 153 | { |
160 | if (release_device_callback) | 154 | if (vio_bus_ops.release_device) |
161 | release_device_callback(dev); | 155 | vio_bus_ops.release_device(dev); |
162 | kfree(to_vio_dev(dev)); | 156 | kfree(to_vio_dev(dev)); |
163 | } | 157 | } |
164 | 158 | ||
165 | static ssize_t viodev_show_name(struct device *dev, struct device_attribute *attr, char *buf) | 159 | static ssize_t viodev_show_name(struct device *dev, |
160 | struct device_attribute *attr, char *buf) | ||
166 | { | 161 | { |
167 | return sprintf(buf, "%s\n", to_vio_dev(dev)->name); | 162 | return sprintf(buf, "%s\n", to_vio_dev(dev)->name); |
168 | } | 163 | } |
169 | DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL); | 164 | DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL); |
170 | 165 | ||
171 | struct vio_dev * __devinit vio_register_device_common( | 166 | struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev) |
172 | struct vio_dev *viodev, char *name, char *type, | ||
173 | uint32_t unit_address, struct iommu_table *iommu_table) | ||
174 | { | 167 | { |
175 | viodev->name = name; | ||
176 | viodev->type = type; | ||
177 | viodev->unit_address = unit_address; | ||
178 | viodev->iommu_table = iommu_table; | ||
179 | /* init generic 'struct device' fields: */ | 168 | /* init generic 'struct device' fields: */ |
180 | viodev->dev.parent = &vio_bus_device.dev; | 169 | viodev->dev.parent = &vio_bus_device.dev; |
181 | viodev->dev.bus = &vio_bus_type; | 170 | viodev->dev.bus = &vio_bus_type; |
@@ -194,8 +183,8 @@ struct vio_dev * __devinit vio_register_device_common( | |||
194 | 183 | ||
195 | void __devinit vio_unregister_device(struct vio_dev *viodev) | 184 | void __devinit vio_unregister_device(struct vio_dev *viodev) |
196 | { | 185 | { |
197 | if (unregister_device_callback) | 186 | if (vio_bus_ops.unregister_device) |
198 | unregister_device_callback(viodev); | 187 | vio_bus_ops.unregister_device(viodev); |
199 | device_remove_file(&viodev->dev, &dev_attr_name); | 188 | device_remove_file(&viodev->dev, &dev_attr_name); |
200 | device_unregister(&viodev->dev); | 189 | device_unregister(&viodev->dev); |
201 | } | 190 | } |
@@ -262,16 +251,8 @@ static int vio_bus_match(struct device *dev, struct device_driver *drv) | |||
262 | const struct vio_dev *vio_dev = to_vio_dev(dev); | 251 | const struct vio_dev *vio_dev = to_vio_dev(dev); |
263 | struct vio_driver *vio_drv = to_vio_driver(drv); | 252 | struct vio_driver *vio_drv = to_vio_driver(drv); |
264 | const struct vio_device_id *ids = vio_drv->id_table; | 253 | const struct vio_device_id *ids = vio_drv->id_table; |
265 | const struct vio_device_id *found_id; | ||
266 | |||
267 | if (!ids) | ||
268 | return 0; | ||
269 | 254 | ||
270 | found_id = vio_match_device(ids, vio_dev); | 255 | return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL); |
271 | if (found_id) | ||
272 | return 1; | ||
273 | |||
274 | return 0; | ||
275 | } | 256 | } |
276 | 257 | ||
277 | struct bus_type vio_bus_type = { | 258 | struct bus_type vio_bus_type = { |
diff --git a/arch/ppc64/mm/hash_low.S b/arch/ppc64/mm/hash_low.S index fbff24827ae7..35eb49e1b890 100644 --- a/arch/ppc64/mm/hash_low.S +++ b/arch/ppc64/mm/hash_low.S | |||
@@ -129,12 +129,10 @@ _GLOBAL(__hash_page) | |||
129 | * code rather than call a C function...) | 129 | * code rather than call a C function...) |
130 | */ | 130 | */ |
131 | BEGIN_FTR_SECTION | 131 | BEGIN_FTR_SECTION |
132 | BEGIN_FTR_SECTION | ||
133 | mr r4,r30 | 132 | mr r4,r30 |
134 | mr r5,r7 | 133 | mr r5,r7 |
135 | bl .hash_page_do_lazy_icache | 134 | bl .hash_page_do_lazy_icache |
136 | END_FTR_SECTION_IFSET(CPU_FTR_NOEXECUTE) | 135 | END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE) |
137 | END_FTR_SECTION_IFCLR(CPU_FTR_COHERENT_ICACHE) | ||
138 | 136 | ||
139 | /* At this point, r3 contains new PP bits, save them in | 137 | /* At this point, r3 contains new PP bits, save them in |
140 | * place of "access" in the param area (sic) | 138 | * place of "access" in the param area (sic) |
diff --git a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c index b28bfda23d94..4acd1a424933 100644 --- a/arch/ppc64/oprofile/common.c +++ b/arch/ppc64/oprofile/common.c | |||
@@ -153,6 +153,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
153 | 153 | ||
154 | case PV_970: | 154 | case PV_970: |
155 | case PV_970FX: | 155 | case PV_970FX: |
156 | case PV_970MP: | ||
156 | model = &op_model_power4; | 157 | model = &op_model_power4; |
157 | model->num_counters = 8; | 158 | model->num_counters = 8; |
158 | ops->cpu_type = "ppc64/970"; | 159 | ops->cpu_type = "ppc64/970"; |