diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-10 03:19:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-11 02:07:59 -0400 |
commit | 22fecbae4446ad470b9237ee9b79f80f343b3838 (patch) | |
tree | 91f10500f68cf757804966c2e90100bf1556bd53 /arch/sparc64/kernel | |
parent | d3ae4b5bc7186a53731d35187ad4ba3bca147cf6 (diff) |
sparc64: Record OF device instead of device node pointer in pci_pbm_info.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r-- | arch/sparc64/kernel/pci.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_common.c | 8 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_fire.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_impl.h | 3 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_msi.c | 18 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_psycho.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_sabre.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_schizo.c | 12 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_sun4v.c | 6 |
9 files changed, 30 insertions, 29 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 3070f6faecca..c6e81dea2cf3 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -676,7 +676,7 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus) | |||
676 | struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, | 676 | struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, |
677 | struct device *parent) | 677 | struct device *parent) |
678 | { | 678 | { |
679 | struct device_node *node = pbm->prom_node; | 679 | struct device_node *node = pbm->op->node; |
680 | struct pci_bus *bus; | 680 | struct pci_bus *bus; |
681 | 681 | ||
682 | printk("PCI: Scanning PBM %s\n", node->full_name); | 682 | printk("PCI: Scanning PBM %s\n", node->full_name); |
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c index 09a5ec200c61..23b88082d0b2 100644 --- a/arch/sparc64/kernel/pci_common.c +++ b/arch/sparc64/kernel/pci_common.c | |||
@@ -314,12 +314,12 @@ struct pci_ops sun4v_pci_ops = { | |||
314 | 314 | ||
315 | void pci_get_pbm_props(struct pci_pbm_info *pbm) | 315 | void pci_get_pbm_props(struct pci_pbm_info *pbm) |
316 | { | 316 | { |
317 | const u32 *val = of_get_property(pbm->prom_node, "bus-range", NULL); | 317 | const u32 *val = of_get_property(pbm->op->node, "bus-range", NULL); |
318 | 318 | ||
319 | pbm->pci_first_busno = val[0]; | 319 | pbm->pci_first_busno = val[0]; |
320 | pbm->pci_last_busno = val[1]; | 320 | pbm->pci_last_busno = val[1]; |
321 | 321 | ||
322 | val = of_get_property(pbm->prom_node, "ino-bitmap", NULL); | 322 | val = of_get_property(pbm->op->node, "ino-bitmap", NULL); |
323 | if (val) { | 323 | if (val) { |
324 | pbm->ino_bitmap = (((u64)val[1] << 32UL) | | 324 | pbm->ino_bitmap = (((u64)val[1] << 32UL) | |
325 | ((u64)val[0] << 0UL)); | 325 | ((u64)val[0] << 0UL)); |
@@ -365,7 +365,7 @@ static void pci_register_legacy_regions(struct resource *io_res, | |||
365 | 365 | ||
366 | static void pci_register_iommu_region(struct pci_pbm_info *pbm) | 366 | static void pci_register_iommu_region(struct pci_pbm_info *pbm) |
367 | { | 367 | { |
368 | const u32 *vdma = of_get_property(pbm->prom_node, "virtual-dma", NULL); | 368 | const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); |
369 | 369 | ||
370 | if (vdma) { | 370 | if (vdma) { |
371 | struct resource *rp = kmalloc(sizeof(*rp), GFP_KERNEL); | 371 | struct resource *rp = kmalloc(sizeof(*rp), GFP_KERNEL); |
@@ -389,7 +389,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) | |||
389 | int num_pbm_ranges; | 389 | int num_pbm_ranges; |
390 | 390 | ||
391 | saw_mem = saw_io = 0; | 391 | saw_mem = saw_io = 0; |
392 | pbm_ranges = of_get_property(pbm->prom_node, "ranges", &i); | 392 | pbm_ranges = of_get_property(pbm->op->node, "ranges", &i); |
393 | if (!pbm_ranges) { | 393 | if (!pbm_ranges) { |
394 | prom_printf("PCI: Fatal error, missing PBM ranges property " | 394 | prom_printf("PCI: Fatal error, missing PBM ranges property " |
395 | " for %s\n", | 395 | " for %s\n", |
diff --git a/arch/sparc64/kernel/pci_fire.c b/arch/sparc64/kernel/pci_fire.c index b538bfb0a47a..7e1a9b6717b5 100644 --- a/arch/sparc64/kernel/pci_fire.c +++ b/arch/sparc64/kernel/pci_fire.c | |||
@@ -446,7 +446,7 @@ static int __init pci_fire_pbm_init(struct pci_pbm_info *pbm, | |||
446 | pbm->index = pci_num_pbms++; | 446 | pbm->index = pci_num_pbms++; |
447 | 447 | ||
448 | pbm->portid = portid; | 448 | pbm->portid = portid; |
449 | pbm->prom_node = dp; | 449 | pbm->op = op; |
450 | pbm->name = dp->full_name; | 450 | pbm->name = dp->full_name; |
451 | 451 | ||
452 | regs = of_get_property(dp, "reg", NULL); | 452 | regs = of_get_property(dp, "reg", NULL); |
diff --git a/arch/sparc64/kernel/pci_impl.h b/arch/sparc64/kernel/pci_impl.h index 4937ce903a88..b300f39e9e8d 100644 --- a/arch/sparc64/kernel/pci_impl.h +++ b/arch/sparc64/kernel/pci_impl.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/spinlock.h> | 10 | #include <linux/spinlock.h> |
11 | #include <linux/pci.h> | 11 | #include <linux/pci.h> |
12 | #include <linux/msi.h> | 12 | #include <linux/msi.h> |
13 | #include <linux/of_device.h> | ||
13 | #include <asm/io.h> | 14 | #include <asm/io.h> |
14 | #include <asm/prom.h> | 15 | #include <asm/prom.h> |
15 | #include <asm/iommu.h> | 16 | #include <asm/iommu.h> |
@@ -90,7 +91,7 @@ struct pci_pbm_info { | |||
90 | char *name; | 91 | char *name; |
91 | 92 | ||
92 | /* OBP specific information. */ | 93 | /* OBP specific information. */ |
93 | struct device_node *prom_node; | 94 | struct of_device *op; |
94 | u64 ino_bitmap; | 95 | u64 ino_bitmap; |
95 | 96 | ||
96 | /* PBM I/O and Memory space resources. */ | 97 | /* PBM I/O and Memory space resources. */ |
diff --git a/arch/sparc64/kernel/pci_msi.c b/arch/sparc64/kernel/pci_msi.c index 60c71e350212..2e680f34f727 100644 --- a/arch/sparc64/kernel/pci_msi.c +++ b/arch/sparc64/kernel/pci_msi.c | |||
@@ -323,7 +323,7 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, | |||
323 | const u32 *val; | 323 | const u32 *val; |
324 | int len; | 324 | int len; |
325 | 325 | ||
326 | val = of_get_property(pbm->prom_node, "#msi-eqs", &len); | 326 | val = of_get_property(pbm->op->node, "#msi-eqs", &len); |
327 | if (!val || len != 4) | 327 | if (!val || len != 4) |
328 | goto no_msi; | 328 | goto no_msi; |
329 | pbm->msiq_num = *val; | 329 | pbm->msiq_num = *val; |
@@ -346,16 +346,16 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, | |||
346 | u32 msi64_len; | 346 | u32 msi64_len; |
347 | } *arng; | 347 | } *arng; |
348 | 348 | ||
349 | val = of_get_property(pbm->prom_node, "msi-eq-size", &len); | 349 | val = of_get_property(pbm->op->node, "msi-eq-size", &len); |
350 | if (!val || len != 4) | 350 | if (!val || len != 4) |
351 | goto no_msi; | 351 | goto no_msi; |
352 | 352 | ||
353 | pbm->msiq_ent_count = *val; | 353 | pbm->msiq_ent_count = *val; |
354 | 354 | ||
355 | mqp = of_get_property(pbm->prom_node, | 355 | mqp = of_get_property(pbm->op->node, |
356 | "msi-eq-to-devino", &len); | 356 | "msi-eq-to-devino", &len); |
357 | if (!mqp) | 357 | if (!mqp) |
358 | mqp = of_get_property(pbm->prom_node, | 358 | mqp = of_get_property(pbm->op->node, |
359 | "msi-eq-devino", &len); | 359 | "msi-eq-devino", &len); |
360 | if (!mqp || len != sizeof(struct msiq_prop)) | 360 | if (!mqp || len != sizeof(struct msiq_prop)) |
361 | goto no_msi; | 361 | goto no_msi; |
@@ -363,27 +363,27 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, | |||
363 | pbm->msiq_first = mqp->first_msiq; | 363 | pbm->msiq_first = mqp->first_msiq; |
364 | pbm->msiq_first_devino = mqp->first_devino; | 364 | pbm->msiq_first_devino = mqp->first_devino; |
365 | 365 | ||
366 | val = of_get_property(pbm->prom_node, "#msi", &len); | 366 | val = of_get_property(pbm->op->node, "#msi", &len); |
367 | if (!val || len != 4) | 367 | if (!val || len != 4) |
368 | goto no_msi; | 368 | goto no_msi; |
369 | pbm->msi_num = *val; | 369 | pbm->msi_num = *val; |
370 | 370 | ||
371 | mrng = of_get_property(pbm->prom_node, "msi-ranges", &len); | 371 | mrng = of_get_property(pbm->op->node, "msi-ranges", &len); |
372 | if (!mrng || len != sizeof(struct msi_range_prop)) | 372 | if (!mrng || len != sizeof(struct msi_range_prop)) |
373 | goto no_msi; | 373 | goto no_msi; |
374 | pbm->msi_first = mrng->first_msi; | 374 | pbm->msi_first = mrng->first_msi; |
375 | 375 | ||
376 | val = of_get_property(pbm->prom_node, "msi-data-mask", &len); | 376 | val = of_get_property(pbm->op->node, "msi-data-mask", &len); |
377 | if (!val || len != 4) | 377 | if (!val || len != 4) |
378 | goto no_msi; | 378 | goto no_msi; |
379 | pbm->msi_data_mask = *val; | 379 | pbm->msi_data_mask = *val; |
380 | 380 | ||
381 | val = of_get_property(pbm->prom_node, "msix-data-width", &len); | 381 | val = of_get_property(pbm->op->node, "msix-data-width", &len); |
382 | if (!val || len != 4) | 382 | if (!val || len != 4) |
383 | goto no_msi; | 383 | goto no_msi; |
384 | pbm->msix_data_width = *val; | 384 | pbm->msix_data_width = *val; |
385 | 385 | ||
386 | arng = of_get_property(pbm->prom_node, "msi-address-ranges", | 386 | arng = of_get_property(pbm->op->node, "msi-address-ranges", |
387 | &len); | 387 | &len); |
388 | if (!arng || len != sizeof(struct addr_range_prop)) | 388 | if (!arng || len != sizeof(struct addr_range_prop)) |
389 | goto no_msi; | 389 | goto no_msi; |
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c index 70a7af092be2..4562b3e0b544 100644 --- a/arch/sparc64/kernel/pci_psycho.c +++ b/arch/sparc64/kernel/pci_psycho.c | |||
@@ -690,7 +690,7 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) | |||
690 | #define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */ | 690 | #define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */ |
691 | static void psycho_register_error_handlers(struct pci_pbm_info *pbm) | 691 | static void psycho_register_error_handlers(struct pci_pbm_info *pbm) |
692 | { | 692 | { |
693 | struct of_device *op = of_find_device_by_node(pbm->prom_node); | 693 | struct of_device *op = of_find_device_by_node(pbm->op->node); |
694 | unsigned long base = pbm->controller_regs; | 694 | unsigned long base = pbm->controller_regs; |
695 | u64 tmp; | 695 | u64 tmp; |
696 | int err; | 696 | int err; |
@@ -967,7 +967,7 @@ static void __init psycho_pbm_init(struct pci_pbm_info *pbm, | |||
967 | pbm->chip_version = of_getintprop_default(dp, "version#", 0); | 967 | pbm->chip_version = of_getintprop_default(dp, "version#", 0); |
968 | pbm->chip_revision = of_getintprop_default(dp, "module-revision#", 0); | 968 | pbm->chip_revision = of_getintprop_default(dp, "module-revision#", 0); |
969 | 969 | ||
970 | pbm->prom_node = dp; | 970 | pbm->op = op; |
971 | pbm->name = dp->full_name; | 971 | pbm->name = dp->full_name; |
972 | 972 | ||
973 | printk(KERN_INFO "%s: PSYCHO PCI Bus Module ver[%x:%x]\n", | 973 | printk(KERN_INFO "%s: PSYCHO PCI Bus Module ver[%x:%x]\n", |
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c index 8f779b58d65a..196049bb14b2 100644 --- a/arch/sparc64/kernel/pci_sabre.c +++ b/arch/sparc64/kernel/pci_sabre.c | |||
@@ -543,7 +543,7 @@ static irqreturn_t sabre_pcierr_intr(int irq, void *dev_id) | |||
543 | 543 | ||
544 | static void sabre_register_error_handlers(struct pci_pbm_info *pbm) | 544 | static void sabre_register_error_handlers(struct pci_pbm_info *pbm) |
545 | { | 545 | { |
546 | struct device_node *dp = pbm->prom_node; | 546 | struct device_node *dp = pbm->op->node; |
547 | struct of_device *op; | 547 | struct of_device *op; |
548 | unsigned long base = pbm->controller_regs; | 548 | unsigned long base = pbm->controller_regs; |
549 | u64 tmp; | 549 | u64 tmp; |
@@ -750,7 +750,7 @@ static void __init sabre_pbm_init(struct pci_pbm_info *pbm, | |||
750 | pbm->index = pci_num_pbms++; | 750 | pbm->index = pci_num_pbms++; |
751 | 751 | ||
752 | pbm->chip_type = PBM_CHIP_TYPE_SABRE; | 752 | pbm->chip_type = PBM_CHIP_TYPE_SABRE; |
753 | pbm->prom_node = dp; | 753 | pbm->op = op; |
754 | pci_get_pbm_props(pbm); | 754 | pci_get_pbm_props(pbm); |
755 | 755 | ||
756 | pci_determine_mem_io_space(pbm); | 756 | pci_determine_mem_io_space(pbm); |
diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c index 67e3640bc69a..c30856541bb4 100644 --- a/arch/sparc64/kernel/pci_schizo.c +++ b/arch/sparc64/kernel/pci_schizo.c | |||
@@ -862,7 +862,7 @@ static int pbm_routes_this_ino(struct pci_pbm_info *pbm, u32 ino) | |||
862 | */ | 862 | */ |
863 | static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) | 863 | static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) |
864 | { | 864 | { |
865 | struct of_device *op = of_find_device_by_node(pbm->prom_node); | 865 | struct of_device *op = of_find_device_by_node(pbm->op->node); |
866 | u64 tmp, err_mask, err_no_mask; | 866 | u64 tmp, err_mask, err_no_mask; |
867 | int err; | 867 | int err; |
868 | 868 | ||
@@ -958,7 +958,7 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) | |||
958 | 958 | ||
959 | static void schizo_register_error_handlers(struct pci_pbm_info *pbm) | 959 | static void schizo_register_error_handlers(struct pci_pbm_info *pbm) |
960 | { | 960 | { |
961 | struct of_device *op = of_find_device_by_node(pbm->prom_node); | 961 | struct of_device *op = of_find_device_by_node(pbm->op->node); |
962 | u64 tmp, err_mask, err_no_mask; | 962 | u64 tmp, err_mask, err_no_mask; |
963 | int err; | 963 | int err; |
964 | 964 | ||
@@ -1088,7 +1088,7 @@ static void __devinit schizo_scan_bus(struct pci_pbm_info *pbm, | |||
1088 | { | 1088 | { |
1089 | pbm_config_busmastering(pbm); | 1089 | pbm_config_busmastering(pbm); |
1090 | pbm->is_66mhz_capable = | 1090 | pbm->is_66mhz_capable = |
1091 | (of_find_property(pbm->prom_node, "66mhz-capable", NULL) | 1091 | (of_find_property(pbm->op->node, "66mhz-capable", NULL) |
1092 | != NULL); | 1092 | != NULL); |
1093 | 1093 | ||
1094 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); | 1094 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); |
@@ -1158,7 +1158,7 @@ static int schizo_pbm_iommu_init(struct pci_pbm_info *pbm) | |||
1158 | u32 dma_mask; | 1158 | u32 dma_mask; |
1159 | u64 control; | 1159 | u64 control; |
1160 | 1160 | ||
1161 | vdma = of_get_property(pbm->prom_node, "virtual-dma", NULL); | 1161 | vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); |
1162 | if (!vdma) | 1162 | if (!vdma) |
1163 | vdma = vdma_default; | 1163 | vdma = vdma_default; |
1164 | 1164 | ||
@@ -1288,7 +1288,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm) | |||
1288 | pbm->chip_version >= 0x2) | 1288 | pbm->chip_version >= 0x2) |
1289 | tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT; | 1289 | tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT; |
1290 | 1290 | ||
1291 | if (!of_find_property(pbm->prom_node, "no-bus-parking", NULL)) | 1291 | if (!of_find_property(pbm->op->node, "no-bus-parking", NULL)) |
1292 | tmp |= SCHIZO_PCICTRL_PARK; | 1292 | tmp |= SCHIZO_PCICTRL_PARK; |
1293 | else | 1293 | else |
1294 | tmp &= ~SCHIZO_PCICTRL_PARK; | 1294 | tmp &= ~SCHIZO_PCICTRL_PARK; |
@@ -1377,7 +1377,7 @@ static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, | |||
1377 | pbm->index = pci_num_pbms++; | 1377 | pbm->index = pci_num_pbms++; |
1378 | 1378 | ||
1379 | pbm->portid = portid; | 1379 | pbm->portid = portid; |
1380 | pbm->prom_node = dp; | 1380 | pbm->op = op; |
1381 | 1381 | ||
1382 | pbm->chip_type = chip_type; | 1382 | pbm->chip_type = chip_type; |
1383 | pbm->chip_version = of_getintprop_default(dp, "version#", 0); | 1383 | pbm->chip_version = of_getintprop_default(dp, "version#", 0); |
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 233b22b8b576..97a77bcd2555 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c | |||
@@ -550,7 +550,7 @@ static void __init pci_sun4v_scan_bus(struct pci_pbm_info *pbm, | |||
550 | struct property *prop; | 550 | struct property *prop; |
551 | struct device_node *dp; | 551 | struct device_node *dp; |
552 | 552 | ||
553 | dp = pbm->prom_node; | 553 | dp = pbm->op->node; |
554 | prop = of_find_property(dp, "66mhz-capable", NULL); | 554 | prop = of_find_property(dp, "66mhz-capable", NULL); |
555 | pbm->is_66mhz_capable = (prop != NULL); | 555 | pbm->is_66mhz_capable = (prop != NULL); |
556 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); | 556 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); |
@@ -594,7 +594,7 @@ static int __init pci_sun4v_iommu_init(struct pci_pbm_info *pbm) | |||
594 | u32 dma_mask, dma_offset; | 594 | u32 dma_mask, dma_offset; |
595 | const u32 *vdma; | 595 | const u32 *vdma; |
596 | 596 | ||
597 | vdma = of_get_property(pbm->prom_node, "virtual-dma", NULL); | 597 | vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); |
598 | if (!vdma) | 598 | if (!vdma) |
599 | vdma = vdma_default; | 599 | vdma = vdma_default; |
600 | 600 | ||
@@ -901,7 +901,7 @@ static int __init pci_sun4v_pbm_init(struct pci_pbm_info *pbm, | |||
901 | 901 | ||
902 | pbm->index = pci_num_pbms++; | 902 | pbm->index = pci_num_pbms++; |
903 | 903 | ||
904 | pbm->prom_node = dp; | 904 | pbm->op = op; |
905 | 905 | ||
906 | pbm->devhandle = devhandle; | 906 | pbm->devhandle = devhandle; |
907 | 907 | ||