Commit | Line | Data |
---|---|---|
d1e6dc91 LD |
1 | /* |
2 | * Code borrowed from powerpc/kernel/pci-common.c | |
3 | * | |
4 | * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM | |
5 | * Copyright (C) 2014 ARM Ltd. | |
6 | * | |
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. | |
10 | * | |
11 | */ | |
12 | ||
a9cb97fe | 13 | #include <linux/acpi.h> |
d1e6dc91 LD |
14 | #include <linux/init.h> |
15 | #include <linux/io.h> | |
16 | #include <linux/kernel.h> | |
17 | #include <linux/mm.h> | |
18 | #include <linux/of_pci.h> | |
19 | #include <linux/of_platform.h> | |
20 | #include <linux/slab.h> | |
21 | ||
d1e6dc91 LD |
22 | /* |
23 | * Called after each bus is probed, but before its children are examined | |
24 | */ | |
25 | void pcibios_fixup_bus(struct pci_bus *bus) | |
26 | { | |
27 | /* nothing to do, expected to be removed in the future */ | |
28 | } | |
29 | ||
30 | /* | |
31 | * We don't have to worry about legacy ISA devices, so nothing to do here | |
32 | */ | |
33 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | |
34 | resource_size_t size, resource_size_t align) | |
35 | { | |
36 | return res->start; | |
37 | } | |
38 | ||
72407514 LP |
39 | /** |
40 | * pcibios_enable_device - Enable I/O and memory. | |
41 | * @dev: PCI device to be enabled | |
42 | * @mask: bitmask of BARs to enable | |
43 | */ | |
44 | int pcibios_enable_device(struct pci_dev *dev, int mask) | |
45 | { | |
46 | if (pci_has_flag(PCI_PROBE_ONLY)) | |
47 | return 0; | |
48 | ||
49 | return pci_enable_resources(dev, mask); | |
50 | } | |
51 | ||
d1e6dc91 LD |
52 | /* |
53 | * Try to assign the IRQ number from DT when adding a new device | |
54 | */ | |
55 | int pcibios_add_device(struct pci_dev *dev) | |
56 | { | |
57 | dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); | |
58 | ||
59 | return 0; | |
60 | } | |
a9cb97fe HG |
61 | |
62 | /* | |
63 | * raw_pci_read/write - Platform-specific PCI config space access. | |
64 | */ | |
65 | int raw_pci_read(unsigned int domain, unsigned int bus, | |
66 | unsigned int devfn, int reg, int len, u32 *val) | |
67 | { | |
68 | return -ENXIO; | |
69 | } | |
70 | ||
71 | int raw_pci_write(unsigned int domain, unsigned int bus, | |
72 | unsigned int devfn, int reg, int len, u32 val) | |
73 | { | |
74 | return -ENXIO; | |
75 | } | |
76 | ||
77 | #ifdef CONFIG_ACPI | |
78 | /* Root bridge scanning */ | |
79 | struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) | |
80 | { | |
81 | /* TODO: Should be revisited when implementing PCI on ACPI */ | |
82 | return NULL; | |
83 | } | |
84 | #endif |