diff options
author | Paul Mackerras <paulus@samba.org> | 2007-08-28 01:56:11 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-08-28 01:56:11 -0400 |
commit | 35438c4327df18dbf5e7f597b69299119f4a14de (patch) | |
tree | a4589d731015db93f2eba8f84ffb1f48a8084020 /arch/powerpc/sysdev | |
parent | 2f6c9d961081dc7b109eb19166244bcb2a5dfc28 (diff) | |
parent | b07d68b5ca4d55a16fab223d63d5fb36f89ff42f (diff) |
Merge branch 'linux-2.6' into for-2.6.24
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/axonram.c | 46 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 2 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 1 | ||||
-rw-r--r-- | arch/powerpc/sysdev/rtc_cmos_setup.c | 17 |
4 files changed, 27 insertions, 39 deletions
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c index 2326d5dc5752..ab037a3a40db 100644 --- a/arch/powerpc/sysdev/axonram.c +++ b/arch/powerpc/sysdev/axonram.c | |||
@@ -59,8 +59,7 @@ | |||
59 | struct axon_ram_bank { | 59 | struct axon_ram_bank { |
60 | struct of_device *device; | 60 | struct of_device *device; |
61 | struct gendisk *disk; | 61 | struct gendisk *disk; |
62 | unsigned int irq_correctable; | 62 | unsigned int irq_id; |
63 | unsigned int irq_uncorrectable; | ||
64 | unsigned long ph_addr; | 63 | unsigned long ph_addr; |
65 | unsigned long io_addr; | 64 | unsigned long io_addr; |
66 | unsigned long size; | 65 | unsigned long size; |
@@ -93,16 +92,9 @@ axon_ram_irq_handler(int irq, void *dev) | |||
93 | 92 | ||
94 | BUG_ON(!bank); | 93 | BUG_ON(!bank); |
95 | 94 | ||
96 | if (irq == bank->irq_correctable) { | 95 | dev_err(&device->dev, "Correctable memory error occured\n"); |
97 | dev_err(&device->dev, "Correctable memory error occured\n"); | 96 | bank->ecc_counter++; |
98 | bank->ecc_counter++; | 97 | return IRQ_HANDLED; |
99 | return IRQ_HANDLED; | ||
100 | } else if (irq == bank->irq_uncorrectable) { | ||
101 | dev_err(&device->dev, "Uncorrectable memory error occured\n"); | ||
102 | panic("Critical ECC error on %s", device->node->full_name); | ||
103 | } | ||
104 | |||
105 | return IRQ_NONE; | ||
106 | } | 98 | } |
107 | 99 | ||
108 | /** | 100 | /** |
@@ -259,28 +251,18 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id) | |||
259 | blk_queue_hardsect_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE); | 251 | blk_queue_hardsect_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE); |
260 | add_disk(bank->disk); | 252 | add_disk(bank->disk); |
261 | 253 | ||
262 | bank->irq_correctable = irq_of_parse_and_map(device->node, 0); | 254 | bank->irq_id = irq_of_parse_and_map(device->node, 0); |
263 | bank->irq_uncorrectable = irq_of_parse_and_map(device->node, 1); | 255 | if (bank->irq_id == NO_IRQ) { |
264 | if ((bank->irq_correctable <= 0) || (bank->irq_uncorrectable <= 0)) { | ||
265 | dev_err(&device->dev, "Cannot access ECC interrupt ID\n"); | 256 | dev_err(&device->dev, "Cannot access ECC interrupt ID\n"); |
266 | rc = -EFAULT; | 257 | rc = -EFAULT; |
267 | goto failed; | 258 | goto failed; |
268 | } | 259 | } |
269 | 260 | ||
270 | rc = request_irq(bank->irq_correctable, axon_ram_irq_handler, | 261 | rc = request_irq(bank->irq_id, axon_ram_irq_handler, |
271 | AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); | ||
272 | if (rc != 0) { | ||
273 | dev_err(&device->dev, "Cannot register ECC interrupt handler\n"); | ||
274 | bank->irq_correctable = bank->irq_uncorrectable = 0; | ||
275 | rc = -EFAULT; | ||
276 | goto failed; | ||
277 | } | ||
278 | |||
279 | rc = request_irq(bank->irq_uncorrectable, axon_ram_irq_handler, | ||
280 | AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); | 262 | AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); |
281 | if (rc != 0) { | 263 | if (rc != 0) { |
282 | dev_err(&device->dev, "Cannot register ECC interrupt handler\n"); | 264 | dev_err(&device->dev, "Cannot register ECC interrupt handler\n"); |
283 | bank->irq_uncorrectable = 0; | 265 | bank->irq_id = NO_IRQ; |
284 | rc = -EFAULT; | 266 | rc = -EFAULT; |
285 | goto failed; | 267 | goto failed; |
286 | } | 268 | } |
@@ -296,13 +278,9 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id) | |||
296 | 278 | ||
297 | failed: | 279 | failed: |
298 | if (bank != NULL) { | 280 | if (bank != NULL) { |
299 | if (bank->irq_uncorrectable > 0) | 281 | if (bank->irq_id != NO_IRQ) |
300 | free_irq(bank->irq_uncorrectable, device); | 282 | free_irq(bank->irq_id, device); |
301 | if (bank->irq_correctable > 0) | ||
302 | free_irq(bank->irq_correctable, device); | ||
303 | if (bank->disk != NULL) { | 283 | if (bank->disk != NULL) { |
304 | if (bank->disk->queue != NULL) | ||
305 | blk_cleanup_queue(bank->disk->queue); | ||
306 | if (bank->disk->major > 0) | 284 | if (bank->disk->major > 0) |
307 | unregister_blkdev(bank->disk->major, | 285 | unregister_blkdev(bank->disk->major, |
308 | bank->disk->disk_name); | 286 | bank->disk->disk_name); |
@@ -329,9 +307,7 @@ axon_ram_remove(struct of_device *device) | |||
329 | BUG_ON(!bank || !bank->disk); | 307 | BUG_ON(!bank || !bank->disk); |
330 | 308 | ||
331 | device_remove_file(&device->dev, &dev_attr_ecc); | 309 | device_remove_file(&device->dev, &dev_attr_ecc); |
332 | free_irq(bank->irq_uncorrectable, device); | 310 | free_irq(bank->irq_id, device); |
333 | free_irq(bank->irq_correctable, device); | ||
334 | blk_cleanup_queue(bank->disk->queue); | ||
335 | unregister_blkdev(bank->disk->major, bank->disk->disk_name); | 311 | unregister_blkdev(bank->disk->major, bank->disk->disk_name); |
336 | del_gendisk(bank->disk); | 312 | del_gendisk(bank->disk); |
337 | iounmap((void __iomem *) bank->io_addr); | 313 | iounmap((void __iomem *) bank->io_addr); |
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 9fb0ce5c7176..114c90f8f560 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -251,6 +251,8 @@ DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_transpare | |||
251 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_transparent); | 251 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_transparent); |
252 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_transparent); | 252 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_transparent); |
253 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567, quirk_fsl_pcie_transparent); | 253 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567, quirk_fsl_pcie_transparent); |
254 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533E, quirk_fsl_pcie_transparent); | ||
255 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533, quirk_fsl_pcie_transparent); | ||
254 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_transparent); | 256 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_transparent); |
255 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_transparent); | 257 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_transparent); |
256 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_transparent); | 258 | DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_transparent); |
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 565f57d777fe..f3abce11bead 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/device.h> | 23 | #include <linux/device.h> |
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/of_platform.h> | ||
25 | #include <linux/phy.h> | 26 | #include <linux/phy.h> |
26 | #include <linux/fsl_devices.h> | 27 | #include <linux/fsl_devices.h> |
27 | #include <linux/fs_enet_pd.h> | 28 | #include <linux/fs_enet_pd.h> |
diff --git a/arch/powerpc/sysdev/rtc_cmos_setup.c b/arch/powerpc/sysdev/rtc_cmos_setup.c index e276048b8c5f..0c9ac7ee08fb 100644 --- a/arch/powerpc/sysdev/rtc_cmos_setup.c +++ b/arch/powerpc/sysdev/rtc_cmos_setup.c | |||
@@ -20,14 +20,16 @@ static int __init add_rtc(void) | |||
20 | { | 20 | { |
21 | struct device_node *np; | 21 | struct device_node *np; |
22 | struct platform_device *pd; | 22 | struct platform_device *pd; |
23 | struct resource res; | 23 | struct resource res[2]; |
24 | int ret; | 24 | int ret; |
25 | 25 | ||
26 | memset(&res, 0, sizeof(res)); | ||
27 | |||
26 | np = of_find_compatible_node(NULL, NULL, "pnpPNP,b00"); | 28 | np = of_find_compatible_node(NULL, NULL, "pnpPNP,b00"); |
27 | if (!np) | 29 | if (!np) |
28 | return -ENODEV; | 30 | return -ENODEV; |
29 | 31 | ||
30 | ret = of_address_to_resource(np, 0, &res); | 32 | ret = of_address_to_resource(np, 0, &res[0]); |
31 | of_node_put(np); | 33 | of_node_put(np); |
32 | if (ret) | 34 | if (ret) |
33 | return ret; | 35 | return ret; |
@@ -36,11 +38,18 @@ static int __init add_rtc(void) | |||
36 | * RTC_PORT(x) is hardcoded in asm/mc146818rtc.h. Verify that the | 38 | * RTC_PORT(x) is hardcoded in asm/mc146818rtc.h. Verify that the |
37 | * address provided by the device node matches. | 39 | * address provided by the device node matches. |
38 | */ | 40 | */ |
39 | if (res.start != RTC_PORT(0)) | 41 | if (res[0].start != RTC_PORT(0)) |
40 | return -EINVAL; | 42 | return -EINVAL; |
41 | 43 | ||
44 | /* Use a fixed interrupt value of 8 since on PPC if we are using this | ||
45 | * its off an i8259 which we ensure has interrupt numbers 0..15. */ | ||
46 | res[1].start = 8; | ||
47 | res[1].end = 8; | ||
48 | res[1].flags = IORESOURCE_IRQ; | ||
49 | |||
42 | pd = platform_device_register_simple("rtc_cmos", -1, | 50 | pd = platform_device_register_simple("rtc_cmos", -1, |
43 | &res, 1); | 51 | &res[0], 2); |
52 | |||
44 | if (IS_ERR(pd)) | 53 | if (IS_ERR(pd)) |
45 | return PTR_ERR(pd); | 54 | return PTR_ERR(pd); |
46 | 55 | ||