Skip to content

Commit 4255532

Browse files
committed
Merge tag 'pci-v3.16-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into next
Pull PCI changes from Bjorn Helgaas: "Enumeration - Notify driver before and after device reset (Keith Busch) - Use reset notification in NVMe (Keith Busch) NUMA - Warn if we have to guess host bridge node information (Myron Stowe) - Work around AMD Fam15h BIOSes that fail to provide _PXM (Suravee Suthikulpanit) - Clean up and mark early_root_info_init() as deprecated (Suravee Suthikulpanit) Driver binding - Add "driver_override" for force specific binding (Alex Williamson) - Fail "new_id" addition for devices we already know about (Bandan Das) Resource management - Support BAR sizes up to 8GB (Nikhil Rao, Alan Cox) - Don't move IORESOURCE_PCI_FIXED resources (Bjorn Helgaas) - Mark SBx00 HPET BAR as IORESOURCE_PCI_FIXED (Bjorn Helgaas) - Fail safely if we can't handle BARs larger than 4GB (Bjorn Helgaas) - Reject BAR above 4GB if dma_addr_t is too small (Bjorn Helgaas) - Don't convert BAR address to resource if dma_addr_t is too small (Bjorn Helgaas) - Don't set BAR to zero if dma_addr_t is too small (Bjorn Helgaas) - Don't print anything while decoding is disabled (Bjorn Helgaas) - Don't add disabled subtractive decode bus resources (Bjorn Helgaas) - Add resource allocation comments (Bjorn Helgaas) - Restrict 64-bit prefetchable bridge windows to 64-bit resources (Yinghai Lu) - Assign i82875p_edac PCI resources before adding device (Yinghai Lu) PCI device hotplug - Remove unnecessary "dev->bus" test (Bjorn Helgaas) - Use PCI_EXP_SLTCAP_PSN define (Bjorn Helgaas) - Fix rphahp endianess issues (Laurent Dufour) - Acknowledge spurious "cmd completed" event (Rajat Jain) - Allow hotplug service drivers to operate in polling mode (Rajat Jain) - Fix cpqphp possible NULL dereference (Rickard Strandqvist) MSI - Replace pci_enable_msi_block() by pci_enable_msi_exact() (Alexander Gordeev) - Replace pci_enable_msix() by pci_enable_msix_exact() (Alexander Gordeev) - Simplify populate_msi_sysfs() (Jan Beulich) Virtualization - Add Intel Patsburg (X79) root port ACS quirk (Alex Williamson) - Mark RTL8110SC INTx masking as broken (Alex Williamson) Generic host bridge driver - Add generic PCI host controller driver (Will Deacon) Freescale i.MX6 - Use new clock names (Lucas Stach) - Drop old IRQ mapping (Lucas Stach) - Remove optional (and unused) IRQs (Lucas Stach) - Add support for MSI (Lucas Stach) - Fix imx6_add_pcie_port() section mismatch warning (Sachin Kamat) Renesas R-Car - Add gen2 device tree support (Ben Dooks) - Use new OF interrupt mapping when possible (Lucas Stach) - Add PCIe driver (Phil Edworthy) - Add PCIe MSI support (Phil Edworthy) - Add PCIe device tree bindings (Phil Edworthy) Samsung Exynos - Remove unnecessary OOM messages (Jingoo Han) - Fix add_pcie_port() section mismatch warning (Sachin Kamat) Synopsys DesignWare - Make MSI ISR shared IRQ aware (Lucas Stach) Miscellaneous - Check for broken config space aliasing (Alex Williamson) - Update email address (Ben Hutchings) - Fix Broadcom CNB20LE unintended sign extension (Bjorn Helgaas) - Fix incorrect vgaarb conditional in WARN_ON() (Bjorn Helgaas) - Remove unnecessary __ref annotations (Bjorn Helgaas) - Add arch/x86/kernel/quirks.c to MAINTAINERS PCI file patterns (Bjorn Helgaas) - Fix use of uninitialized MPS value (Bjorn Helgaas) - Tidy x86/gart messages (Bjorn Helgaas) - Fix return value from pci_user_{read,write}_config_*() (Gavin Shan) - Turn pcibios_penalize_isa_irq() into a weak function (Hanjun Guo) - Remove unused serial device IDs (Jean Delvare) - Use designated initialization in PCI_VDEVICE (Mark Rustad) - Fix powerpc NULL dereference in pci_root_buses traversal (Mike Qiu) - Configure MPS on ARM (Murali Karicheri) - Remove unnecessary includes of <linux/init.h> (Paul Gortmaker) - Move Open Firmware devspec attribute to PCI common code (Sebastian Ott) - Use pdev->dev.groups for attribute creation on s390 (Sebastian Ott) - Remove pcibios_add_platform_entries() (Sebastian Ott) - Add new ID for Intel GPU "spurious interrupt" quirk (Thomas Jarosch) - Rename pci_is_bridge() to pci_has_subordinate() (Yijing Wang) - Add and use new pci_is_bridge() interface (Yijing Wang) - Make pci_bus_add_device() void (Yijing Wang) DMA API - Clarify physical/bus address distinction in docs (Bjorn Helgaas) - Fix typos in docs (Emilio López) - Update dma_pool_create ()and dma_pool_alloc() descriptions (Gioh Kim) - Change dma_declare_coherent_memory() CPU address to phys_addr_t (Bjorn Helgaas) - Pass GAPSPCI_DMA_BASE CPU & bus address to dma_declare_coherent_memory() (Bjorn Helgaas)" * tag 'pci-v3.16-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (92 commits) MAINTAINERS: Add generic PCI host controller driver PCI: generic: Add generic PCI host controller driver PCI: imx6: Add support for MSI PCI: designware: Make MSI ISR shared IRQ aware PCI: imx6: Remove optional (and unused) IRQs PCI: imx6: Drop old IRQ mapping PCI: imx6: Use new clock names i82875p_edac: Assign PCI resources before adding device ARM/PCI: Call pcie_bus_configure_settings() to set MPS PCI: imx6: Fix imx6_add_pcie_port() section mismatch warning PCI: Make pci_bus_add_device() void PCI: exynos: Fix add_pcie_port() section mismatch warning PCI: Introduce new device binding path using pci_dev.driver_override PCI: rcar: Add gen2 device tree support PCI: cpqphp: Fix possible null pointer dereference PCI: rcar: Add R-Car PCIe device tree bindings PCI: rcar: Add MSI support for PCIe PCI: rcar: Add Renesas R-Car PCIe driver PCI: Fix return value from pci_user_{read,write}_config_*() PCI: exynos: Remove unnecessary OOM messages ...
2 parents 681a289 + 617b415 commit 4255532

98 files changed

Lines changed: 2710 additions & 824 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/ABI/testing/sysfs-bus-pci‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,24 @@ Description:
250250
valid. For example, writing a 2 to this file when sriov_numvfs
251251
is not 0 and not 2 already will return an error. Writing a 10
252252
when the value of sriov_totalvfs is 8 will return an error.
253+
254+
What: /sys/bus/pci/devices/.../driver_override
255+
Date: April 2014
256+
Contact: Alex Williamson <alex.williamson@redhat.com>
257+
Description:
258+
This file allows the driver for a device to be specified which
259+
will override standard static and dynamic ID matching. When
260+
specified, only a driver with a name matching the value written
261+
to driver_override will have an opportunity to bind to the
262+
device. The override is specified by writing a string to the
263+
driver_override file (echo pci-stub > driver_override) and
264+
may be cleared with an empty string (echo > driver_override).
265+
This returns the device to standard matching rules binding.
266+
Writing to driver_override does not automatically unbind the
267+
device from its current driver or make any attempt to
268+
automatically load the specified driver. If no driver with a
269+
matching name is currently loaded in the kernel, the device
270+
will not bind to any driver. This also allows devices to
271+
opt-out of driver binding using a driver_override name such as
272+
"none". Only a single driver may be specified in the override,
273+
there is no support for parsing delimiters.

‎Documentation/DMA-API-HOWTO.txt‎

Lines changed: 132 additions & 78 deletions
Large diffs are not rendered by default.

‎Documentation/DMA-API.txt‎

Lines changed: 77 additions & 73 deletions
Large diffs are not rendered by default.

‎Documentation/DMA-ISA-LPC.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To do ISA style DMA you need to include two headers:
1616
#include <asm/dma.h>
1717

1818
The first is the generic DMA API used to convert virtual addresses to
19-
physical addresses (see Documentation/DMA-API.txt for details).
19+
bus addresses (see Documentation/DMA-API.txt for details).
2020

2121
The second contains the routines specific to ISA DMA transfers. Since
2222
this is not present on all platforms make sure you construct your
@@ -50,7 +50,7 @@ early as possible and not release it until the driver is unloaded.)
5050
Part III - Address translation
5151
------------------------------
5252

53-
To translate the virtual address to a physical use the normal DMA
53+
To translate the virtual address to a bus address, use the normal DMA
5454
API. Do _not_ use isa_virt_to_phys() even though it does the same
5555
thing. The reason for this is that the function isa_virt_to_phys()
5656
will require a Kconfig dependency to ISA, not just ISA_DMA_API which
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
* Generic PCI host controller
2+
3+
Firmware-initialised PCI host controllers and PCI emulations, such as the
4+
virtio-pci implementations found in kvmtool and other para-virtualised
5+
systems, do not require driver support for complexities such as regulator
6+
and clock management. In fact, the controller may not even require the
7+
configuration of a control interface by the operating system, instead
8+
presenting a set of fixed windows describing a subset of IO, Memory and
9+
Configuration Spaces.
10+
11+
Such a controller can be described purely in terms of the standardized device
12+
tree bindings communicated in pci.txt:
13+
14+
15+
Properties of the host controller node:
16+
17+
- compatible : Must be "pci-host-cam-generic" or "pci-host-ecam-generic"
18+
depending on the layout of configuration space (CAM vs
19+
ECAM respectively).
20+
21+
- device_type : Must be "pci".
22+
23+
- ranges : As described in IEEE Std 1275-1994, but must provide
24+
at least a definition of non-prefetchable memory. One
25+
or both of prefetchable Memory and IO Space may also
26+
be provided.
27+
28+
- bus-range : Optional property (also described in IEEE Std 1275-1994)
29+
to indicate the range of bus numbers for this controller.
30+
If absent, defaults to <0 255> (i.e. all buses).
31+
32+
- #address-cells : Must be 3.
33+
34+
- #size-cells : Must be 2.
35+
36+
- reg : The Configuration Space base address and size, as accessed
37+
from the parent bus.
38+
39+
40+
Properties of the /chosen node:
41+
42+
- linux,pci-probe-only
43+
: Optional property which takes a single-cell argument.
44+
If '0', then Linux will assign devices in its usual manner,
45+
otherwise it will not try to assign devices and instead use
46+
them as they are configured already.
47+
48+
Configuration Space is assumed to be memory-mapped (as opposed to being
49+
accessed via an ioport) and laid out with a direct correspondence to the
50+
geography of a PCI bus address by concatenating the various components to
51+
form an offset.
52+
53+
For CAM, this 24-bit offset is:
54+
55+
cfg_offset(bus, device, function, register) =
56+
bus << 16 | device << 11 | function << 8 | register
57+
58+
Whilst ECAM extends this by 4 bits to accomodate 4k of function space:
59+
60+
cfg_offset(bus, device, function, register) =
61+
bus << 20 | device << 15 | function << 12 | register
62+
63+
Interrupt mapping is exactly as described in `Open Firmware Recommended
64+
Practice: Interrupt Mapping' and requires the following properties:
65+
66+
- #interrupt-cells : Must be 1
67+
68+
- interrupt-map : <see aforementioned specification>
69+
70+
- interrupt-map-mask : <see aforementioned specification>
71+
72+
73+
Example:
74+
75+
pci {
76+
compatible = "pci-host-cam-generic"
77+
device_type = "pci";
78+
#address-cells = <3>;
79+
#size-cells = <2>;
80+
bus-range = <0x0 0x1>;
81+
82+
// CPU_PHYSICAL(2) SIZE(2)
83+
reg = <0x0 0x40000000 0x0 0x1000000>;
84+
85+
// BUS_ADDRESS(3) CPU_PHYSICAL(2) SIZE(2)
86+
ranges = <0x01000000 0x0 0x01000000 0x0 0x01000000 0x0 0x00010000>,
87+
<0x02000000 0x0 0x41000000 0x0 0x41000000 0x0 0x3f000000>;
88+
89+
90+
#interrupt-cells = <0x1>;
91+
92+
// PCI_DEVICE(3) INT#(1) CONTROLLER(PHANDLE) CONTROLLER_DATA(3)
93+
interrupt-map = < 0x0 0x0 0x0 0x1 &gic 0x0 0x4 0x1
94+
0x800 0x0 0x0 0x1 &gic 0x0 0x5 0x1
95+
0x1000 0x0 0x0 0x1 &gic 0x0 0x6 0x1
96+
0x1800 0x0 0x0 0x1 &gic 0x0 0x7 0x1>;
97+
98+
// PCI_DEVICE(3) INT#(1)
99+
interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
100+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Renesas AHB to PCI bridge
2+
-------------------------
3+
4+
This is the bridge used internally to connect the USB controllers to the
5+
AHB. There is one bridge instance per USB port connected to the internal
6+
OHCI and EHCI controllers.
7+
8+
Required properties:
9+
- compatible: "renesas,pci-r8a7790" for the R8A7790 SoC;
10+
"renesas,pci-r8a7791" for the R8A7791 SoC.
11+
- reg: A list of physical regions to access the device: the first is
12+
the operational registers for the OHCI/EHCI controllers and the
13+
second is for the bridge configuration and control registers.
14+
- interrupts: interrupt for the device.
15+
- clocks: The reference to the device clock.
16+
- bus-range: The PCI bus number range; as this is a single bus, the range
17+
should be specified as the same value twice.
18+
- #address-cells: must be 3.
19+
- #size-cells: must be 2.
20+
- #interrupt-cells: must be 1.
21+
- interrupt-map: standard property used to define the mapping of the PCI
22+
interrupts to the GIC interrupts.
23+
- interrupt-map-mask: standard property that helps to define the interrupt
24+
mapping.
25+
26+
Example SoC configuration:
27+
28+
pci0: pci@ee090000 {
29+
compatible = "renesas,pci-r8a7790";
30+
clocks = <&mstp7_clks R8A7790_CLK_EHCI>;
31+
reg = <0x0 0xee090000 0x0 0xc00>,
32+
<0x0 0xee080000 0x0 0x1100>;
33+
interrupts = <0 108 IRQ_TYPE_LEVEL_HIGH>;
34+
status = "disabled";
35+
36+
bus-range = <0 0>;
37+
#address-cells = <3>;
38+
#size-cells = <2>;
39+
#interrupt-cells = <1>;
40+
interrupt-map-mask = <0xff00 0 0 0x7>;
41+
interrupt-map = <0x0000 0 0 1 &gic 0 108 IRQ_TYPE_LEVEL_HIGH
42+
0x0800 0 0 1 &gic 0 108 IRQ_TYPE_LEVEL_HIGH
43+
0x1000 0 0 2 &gic 0 108 IRQ_TYPE_LEVEL_HIGH>;
44+
45+
pci@0,1 {
46+
reg = <0x800 0 0 0 0>;
47+
device_type = "pci";
48+
phys = <&usbphy 0 0>;
49+
phy-names = "usb";
50+
};
51+
52+
pci@0,2 {
53+
reg = <0x1000 0 0 0 0>;
54+
device_type = "pci";
55+
phys = <&usbphy 0 0>;
56+
phy-names = "usb";
57+
};
58+
};
59+
60+
Example board setup:
61+
62+
&pci0 {
63+
status = "okay";
64+
pinctrl-0 = <&usb0_pins>;
65+
pinctrl-names = "default";
66+
};
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
* Renesas RCar PCIe interface
2+
3+
Required properties:
4+
- compatible: should contain one of the following
5+
"renesas,pcie-r8a7779", "renesas,pcie-r8a7790", "renesas,pcie-r8a7791"
6+
- reg: base address and length of the pcie controller registers.
7+
- #address-cells: set to <3>
8+
- #size-cells: set to <2>
9+
- bus-range: PCI bus numbers covered
10+
- device_type: set to "pci"
11+
- ranges: ranges for the PCI memory and I/O regions.
12+
- dma-ranges: ranges for the inbound memory regions.
13+
- interrupts: two interrupt sources for MSI interrupts, followed by interrupt
14+
source for hardware related interrupts (e.g. link speed change).
15+
- #interrupt-cells: set to <1>
16+
- interrupt-map-mask and interrupt-map: standard PCI properties
17+
to define the mapping of the PCIe interface to interrupt
18+
numbers.
19+
- clocks: from common clock binding: clock specifiers for the PCIe controller
20+
and PCIe bus clocks.
21+
- clock-names: from common clock binding: should be "pcie" and "pcie_bus".
22+
23+
Example:
24+
25+
SoC specific DT Entry:
26+
27+
pcie: pcie@fe000000 {
28+
compatible = "renesas,pcie-r8a7791";
29+
reg = <0 0xfe000000 0 0x80000>;
30+
#address-cells = <3>;
31+
#size-cells = <2>;
32+
bus-range = <0x00 0xff>;
33+
device_type = "pci";
34+
ranges = <0x01000000 0 0x00000000 0 0xfe100000 0 0x00100000
35+
0x02000000 0 0xfe200000 0 0xfe200000 0 0x00200000
36+
0x02000000 0 0x30000000 0 0x30000000 0 0x08000000
37+
0x42000000 0 0x38000000 0 0x38000000 0 0x08000000>;
38+
dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x40000000
39+
0x42000000 2 0x00000000 2 0x00000000 0 0x40000000>;
40+
interrupts = <0 116 4>, <0 117 4>, <0 118 4>;
41+
#interrupt-cells = <1>;
42+
interrupt-map-mask = <0 0 0 0>;
43+
interrupt-map = <0 0 0 0 &gic 0 116 4>;
44+
clocks = <&mstp3_clks R8A7791_CLK_PCIE>, <&pcie_bus_clk>;
45+
clock-names = "pcie", "pcie_bus";
46+
status = "disabled";
47+
};

‎MAINTAINERS‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6710,6 +6710,7 @@ F: Documentation/PCI/
67106710
F: drivers/pci/
67116711
F: include/linux/pci*
67126712
F: arch/x86/pci/
6713+
F: arch/x86/kernel/quirks.c
67136714

67146715
PCI DRIVER FOR IMX6
67156716
M: Richard Zhu <r65037@freescale.com>
@@ -6757,6 +6758,14 @@ L: linux-pci@vger.kernel.org
67576758
S: Maintained
67586759
F: drivers/pci/host/*designware*
67596760

6761+
PCI DRIVER FOR GENERIC OF HOSTS
6762+
M: Will Deacon <will.deacon@arm.com>
6763+
L: linux-pci@vger.kernel.org
6764+
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
6765+
S: Maintained
6766+
F: Documentation/devicetree/bindings/pci/host-generic-pci.txt
6767+
F: drivers/pci/host/pci-host-generic.c
6768+
67606769
PCMCIA SUBSYSTEM
67616770
P: Linux PCMCIA Team
67626771
L: linux-pcmcia@lists.infradead.org

‎arch/alpha/include/asm/pci.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ struct pci_controller {
5959

6060
extern void pcibios_set_master(struct pci_dev *dev);
6161

62-
extern inline void pcibios_penalize_isa_irq(int irq, int active)
63-
{
64-
/* We don't do dynamic PCI IRQ allocation */
65-
}
66-
6762
/* IOMMU controls. */
6863

6964
/* The PCI address space does not equal the physical memory address space.

‎arch/arm/include/asm/pci.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
3131
}
3232
#endif /* CONFIG_PCI_DOMAINS */
3333

34-
static inline void pcibios_penalize_isa_irq(int irq, int active)
35-
{
36-
/* We don't do dynamic PCI IRQ allocation */
37-
}
38-
3934
/*
4035
* The PCI address space does equal the physical memory address space.
4136
* The networking and block device layers use this boolean for bounce

0 commit comments

Comments
 (0)