diff options
Diffstat (limited to 'arch/sh/drivers/pci/pci.c')
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c99ee286b69f..5976a2c8a3e3 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -39,8 +39,12 @@ static void pcibios_scanbus(struct pci_channel *hose) | |||
39 | LIST_HEAD(resources); | 39 | LIST_HEAD(resources); |
40 | struct resource *res; | 40 | struct resource *res; |
41 | resource_size_t offset; | 41 | resource_size_t offset; |
42 | int i; | 42 | int i, ret; |
43 | struct pci_bus *bus; | 43 | struct pci_host_bridge *bridge; |
44 | |||
45 | bridge = pci_alloc_host_bridge(0); | ||
46 | if (!bridge) | ||
47 | return; | ||
44 | 48 | ||
45 | for (i = 0; i < hose->nr_resources; i++) { | 49 | for (i = 0; i < hose->nr_resources; i++) { |
46 | res = hose->resources + i; | 50 | res = hose->resources + i; |
@@ -52,19 +56,26 @@ static void pcibios_scanbus(struct pci_channel *hose) | |||
52 | pci_add_resource_offset(&resources, res, offset); | 56 | pci_add_resource_offset(&resources, res, offset); |
53 | } | 57 | } |
54 | 58 | ||
55 | bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose, | 59 | list_splice_init(&resources, &bridge->windows); |
56 | &resources); | 60 | bridge->dev.parent = NULL; |
57 | hose->bus = bus; | 61 | bridge->sysdata = hose; |
62 | bridge->busnr = next_busno; | ||
63 | bridge->ops = hose->pci_ops; | ||
64 | bridge->swizzle_irq = pci_common_swizzle; | ||
65 | bridge->map_irq = pcibios_map_platform_irq; | ||
66 | |||
67 | ret = pci_scan_root_bus_bridge(bridge); | ||
68 | if (ret) { | ||
69 | pci_free_host_bridge(bridge); | ||
70 | return; | ||
71 | } | ||
72 | |||
73 | hose->bus = bridge->bus; | ||
58 | 74 | ||
59 | need_domain_info = need_domain_info || hose->index; | 75 | need_domain_info = need_domain_info || hose->index; |
60 | hose->need_domain_info = need_domain_info; | 76 | hose->need_domain_info = need_domain_info; |
61 | 77 | ||
62 | if (!bus) { | 78 | next_busno = hose->bus->busn_res.end + 1; |
63 | pci_free_resource_list(&resources); | ||
64 | return; | ||
65 | } | ||
66 | |||
67 | next_busno = bus->busn_res.end + 1; | ||
68 | /* Don't allow 8-bit bus number overflow inside the hose - | 79 | /* Don't allow 8-bit bus number overflow inside the hose - |
69 | reserve some space for bridges. */ | 80 | reserve some space for bridges. */ |
70 | if (next_busno > 224) { | 81 | if (next_busno > 224) { |
@@ -72,9 +83,9 @@ static void pcibios_scanbus(struct pci_channel *hose) | |||
72 | need_domain_info = 1; | 83 | need_domain_info = 1; |
73 | } | 84 | } |
74 | 85 | ||
75 | pci_bus_size_bridges(bus); | 86 | pci_bus_size_bridges(hose->bus); |
76 | pci_bus_assign_resources(bus); | 87 | pci_bus_assign_resources(hose->bus); |
77 | pci_bus_add_devices(bus); | 88 | pci_bus_add_devices(hose->bus); |
78 | } | 89 | } |
79 | 90 | ||
80 | /* | 91 | /* |
@@ -144,8 +155,6 @@ static int __init pcibios_init(void) | |||
144 | for (hose = hose_head; hose; hose = hose->next) | 155 | for (hose = hose_head; hose; hose = hose->next) |
145 | pcibios_scanbus(hose); | 156 | pcibios_scanbus(hose); |
146 | 157 | ||
147 | pci_fixup_irqs(pci_common_swizzle, pcibios_map_platform_irq); | ||
148 | |||
149 | dma_debug_add_bus(&pci_bus_type); | 158 | dma_debug_add_bus(&pci_bus_type); |
150 | 159 | ||
151 | pci_initialized = 1; | 160 | pci_initialized = 1; |
@@ -155,14 +164,6 @@ static int __init pcibios_init(void) | |||
155 | subsys_initcall(pcibios_init); | 164 | subsys_initcall(pcibios_init); |
156 | 165 | ||
157 | /* | 166 | /* |
158 | * Called after each bus is probed, but before its children | ||
159 | * are examined. | ||
160 | */ | ||
161 | void pcibios_fixup_bus(struct pci_bus *bus) | ||
162 | { | ||
163 | } | ||
164 | |||
165 | /* | ||
166 | * We need to avoid collisions with `mirrored' VGA ports | 167 | * We need to avoid collisions with `mirrored' VGA ports |
167 | * and other strange ISA hardware, so we always want the | 168 | * and other strange ISA hardware, so we always want the |
168 | * addresses to be allocated in the 0x000-0x0ff region | 169 | * addresses to be allocated in the 0x000-0x0ff region |