2 * Code borrowed from powerpc/kernel/pci-common.c
4 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM
5 * Copyright (C) 2014 ARM Ltd.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
13 #include <linux/init.h>
15 #include <linux/kernel.h>
17 #include <linux/of_pci.h>
18 #include <linux/of_platform.h>
19 #include <linux/slab.h>
21 #include <asm/pci-bridge.h>
24 * Called after each bus is probed, but before its children are examined
26 void pcibios_fixup_bus(struct pci_bus *bus)
28 /* nothing to do, expected to be removed in the future */
32 * We don't have to worry about legacy ISA devices, so nothing to do here
34 resource_size_t pcibios_align_resource(void *data, const struct resource *res,
35 resource_size_t size, resource_size_t align)
41 * Try to assign the IRQ number from DT when adding a new device
43 int pcibios_add_device(struct pci_dev *dev)
45 dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
51 #ifdef CONFIG_PCI_DOMAINS_GENERIC
52 static bool dt_domain_found = false;
54 void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent)
56 int domain = of_get_pci_domain_nr(parent->of_node);
59 dt_domain_found = true;
60 } else if (dt_domain_found == true) {
61 dev_err(parent, "Node %s is missing \"linux,pci-domain\" property in DT\n",
62 parent->of_node->full_name);
65 domain = pci_get_new_domain_nr();
68 bus->domain_nr = domain;