diff options
Diffstat (limited to 'arch/sparc64/kernel/pci.c')
| -rw-r--r-- | arch/sparc64/kernel/pci.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 9a549547cb2b..af2c7ff01eeb 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
| @@ -190,6 +190,7 @@ extern void schizo_init(struct device_node *, const char *); | |||
| 190 | extern void schizo_plus_init(struct device_node *, const char *); | 190 | extern void schizo_plus_init(struct device_node *, const char *); |
| 191 | extern void tomatillo_init(struct device_node *, const char *); | 191 | extern void tomatillo_init(struct device_node *, const char *); |
| 192 | extern void sun4v_pci_init(struct device_node *, const char *); | 192 | extern void sun4v_pci_init(struct device_node *, const char *); |
| 193 | extern void fire_pci_init(struct device_node *, const char *); | ||
| 193 | 194 | ||
| 194 | static struct { | 195 | static struct { |
| 195 | char *model_name; | 196 | char *model_name; |
| @@ -207,6 +208,7 @@ static struct { | |||
| 207 | { "SUNW,tomatillo", tomatillo_init }, | 208 | { "SUNW,tomatillo", tomatillo_init }, |
| 208 | { "pci108e,a801", tomatillo_init }, | 209 | { "pci108e,a801", tomatillo_init }, |
| 209 | { "SUNW,sun4v-pci", sun4v_pci_init }, | 210 | { "SUNW,sun4v-pci", sun4v_pci_init }, |
| 211 | { "pciex108e,80f0", fire_pci_init }, | ||
| 210 | }; | 212 | }; |
| 211 | #define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \ | 213 | #define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \ |
| 212 | sizeof(pci_controller_table[0])) | 214 | sizeof(pci_controller_table[0])) |
| @@ -436,6 +438,13 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
| 436 | printk(" class: 0x%x device name: %s\n", | 438 | printk(" class: 0x%x device name: %s\n", |
| 437 | dev->class, pci_name(dev)); | 439 | dev->class, pci_name(dev)); |
| 438 | 440 | ||
| 441 | /* I have seen IDE devices which will not respond to | ||
| 442 | * the bmdma simplex check reads if bus mastering is | ||
| 443 | * disabled. | ||
| 444 | */ | ||
| 445 | if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) | ||
| 446 | pci_set_master(dev); | ||
| 447 | |||
| 439 | dev->current_state = 4; /* unknown power state */ | 448 | dev->current_state = 4; /* unknown power state */ |
| 440 | dev->error_state = pci_channel_io_normal; | 449 | dev->error_state = pci_channel_io_normal; |
| 441 | 450 | ||
| @@ -468,7 +477,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
| 468 | return dev; | 477 | return dev; |
| 469 | } | 478 | } |
| 470 | 479 | ||
| 471 | static void __init apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p) | 480 | static void __devinit apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p) |
| 472 | { | 481 | { |
| 473 | u32 idx, first, last; | 482 | u32 idx, first, last; |
| 474 | 483 | ||
| @@ -497,9 +506,9 @@ static void __init pci_resource_adjust(struct resource *res, | |||
| 497 | /* Cook up fake bus resources for SUNW,simba PCI bridges which lack | 506 | /* Cook up fake bus resources for SUNW,simba PCI bridges which lack |
| 498 | * a proper 'ranges' property. | 507 | * a proper 'ranges' property. |
| 499 | */ | 508 | */ |
| 500 | static void __init apb_fake_ranges(struct pci_dev *dev, | 509 | static void __devinit apb_fake_ranges(struct pci_dev *dev, |
| 501 | struct pci_bus *bus, | 510 | struct pci_bus *bus, |
| 502 | struct pci_pbm_info *pbm) | 511 | struct pci_pbm_info *pbm) |
| 503 | { | 512 | { |
| 504 | struct resource *res; | 513 | struct resource *res; |
| 505 | u32 first, last; | 514 | u32 first, last; |
| @@ -522,15 +531,15 @@ static void __init apb_fake_ranges(struct pci_dev *dev, | |||
| 522 | pci_resource_adjust(res, &pbm->mem_space); | 531 | pci_resource_adjust(res, &pbm->mem_space); |
| 523 | } | 532 | } |
| 524 | 533 | ||
| 525 | static void __init pci_of_scan_bus(struct pci_pbm_info *pbm, | 534 | static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, |
| 526 | struct device_node *node, | 535 | struct device_node *node, |
| 527 | struct pci_bus *bus); | 536 | struct pci_bus *bus); |
| 528 | 537 | ||
| 529 | #define GET_64BIT(prop, i) ((((u64) (prop)[(i)]) << 32) | (prop)[(i)+1]) | 538 | #define GET_64BIT(prop, i) ((((u64) (prop)[(i)]) << 32) | (prop)[(i)+1]) |
| 530 | 539 | ||
| 531 | void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm, | 540 | static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm, |
| 532 | struct device_node *node, | 541 | struct device_node *node, |
| 533 | struct pci_dev *dev) | 542 | struct pci_dev *dev) |
| 534 | { | 543 | { |
| 535 | struct pci_bus *bus; | 544 | struct pci_bus *bus; |
| 536 | const u32 *busrange, *ranges; | 545 | const u32 *busrange, *ranges; |
| @@ -629,9 +638,9 @@ simba_cont: | |||
| 629 | pci_of_scan_bus(pbm, node, bus); | 638 | pci_of_scan_bus(pbm, node, bus); |
| 630 | } | 639 | } |
| 631 | 640 | ||
| 632 | static void __init pci_of_scan_bus(struct pci_pbm_info *pbm, | 641 | static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, |
| 633 | struct device_node *node, | 642 | struct device_node *node, |
| 634 | struct pci_bus *bus) | 643 | struct pci_bus *bus) |
| 635 | { | 644 | { |
| 636 | struct device_node *child; | 645 | struct device_node *child; |
| 637 | const u32 *reg; | 646 | const u32 *reg; |
| @@ -733,7 +742,7 @@ int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev, | |||
| 733 | return PCIBIOS_SUCCESSFUL; | 742 | return PCIBIOS_SUCCESSFUL; |
| 734 | } | 743 | } |
| 735 | 744 | ||
| 736 | struct pci_bus * __init pci_scan_one_pbm(struct pci_pbm_info *pbm) | 745 | struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm) |
| 737 | { | 746 | { |
| 738 | struct pci_controller_info *p = pbm->parent; | 747 | struct pci_controller_info *p = pbm->parent; |
| 739 | struct device_node *node = pbm->prom_node; | 748 | struct device_node *node = pbm->prom_node; |
