|
@@ -25,6 +25,12 @@ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info)
|
|
{
|
|
{
|
|
LIST_HEAD(resources);
|
|
LIST_HEAD(resources);
|
|
struct pci_bus *root_bus;
|
|
struct pci_bus *root_bus;
|
|
|
|
+ struct pci_host_bridge *bridge;
|
|
|
|
+ int ret;
|
|
|
|
+
|
|
|
|
+ bridge = pci_alloc_host_bridge(0);
|
|
|
|
+ if (!bridge)
|
|
|
|
+ return;
|
|
|
|
|
|
pci_add_resource_offset(&resources, &info->io_space,
|
|
pci_add_resource_offset(&resources, &info->io_space,
|
|
info->io_space.start - 0x1000);
|
|
info->io_space.start - 0x1000);
|
|
@@ -32,15 +38,21 @@ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info)
|
|
info->busn.flags = IORESOURCE_BUS;
|
|
info->busn.flags = IORESOURCE_BUS;
|
|
pci_add_resource(&resources, &info->busn);
|
|
pci_add_resource(&resources, &info->busn);
|
|
|
|
|
|
- root_bus = pci_scan_root_bus(&ofdev->dev, 0, info->ops, info,
|
|
|
|
- &resources);
|
|
|
|
- if (!root_bus) {
|
|
|
|
- pci_free_resource_list(&resources);
|
|
|
|
|
|
+ list_splice_init(&resources, &bridge->windows);
|
|
|
|
+ bridge->dev.parent = &ofdev->dev;
|
|
|
|
+ bridge->sysdata = info;
|
|
|
|
+ bridge->busnr = 0;
|
|
|
|
+ bridge->ops = info->ops;
|
|
|
|
+ bridge->swizzle_irq = pci_common_swizzle;
|
|
|
|
+ bridge->map_irq = info->map_irq;
|
|
|
|
+
|
|
|
|
+ ret = pci_scan_root_bus_bridge(bridge);
|
|
|
|
+ if (ret) {
|
|
|
|
+ pci_free_host_bridge(bridge);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- /* Setup IRQs of all devices using custom routines */
|
|
|
|
- pci_fixup_irqs(pci_common_swizzle, info->map_irq);
|
|
|
|
|
|
+ root_bus = bridge->bus;
|
|
|
|
|
|
/* Assign devices with resources */
|
|
/* Assign devices with resources */
|
|
pci_assign_unassigned_resources();
|
|
pci_assign_unassigned_resources();
|