diff options
author | Jason Jin <Jason.jin@freescale.com> | 2011-10-28 04:08:00 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2011-11-24 03:01:40 -0500 |
commit | 05737c7c5bca9a4f3e0f8bb9476445971b64fafd (patch) | |
tree | 0bfcae85adb9cac4cba6cf8578d0128941f23668 /arch/powerpc/kernel/pci-common.c | |
parent | 54986964c13c72f0a6cf58855ee376a12e21d2d7 (diff) |
powerpc/fsl-pci: Don't hide resource for pci/e when configured as Agent/EP
Current pci/pcie init code will hide the pci/pcie host resource.
But did not judge it is host/RC or agent/EP. If configured as
agent/EP, we should avoid hiding its resource in the host side.
In PCI system, the Programing Interface can be used to judge the
host/agent status:
Programing Interface = 0: host
Programing Interface = 1: Agent
In PCIE system, both the Programing Interface and Header type can
be used to judge the RC/EP status.
Header Type = 0: EP
Header Type = 1: RC
Signed-off-by: Jason Jin <Jason.jin@freescale.com>
Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/pci-common.c')
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 458ed3bee663..069aa75e7161 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -1747,10 +1747,13 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose) | |||
1747 | static void fixup_hide_host_resource_fsl(struct pci_dev *dev) | 1747 | static void fixup_hide_host_resource_fsl(struct pci_dev *dev) |
1748 | { | 1748 | { |
1749 | int i, class = dev->class >> 8; | 1749 | int i, class = dev->class >> 8; |
1750 | /* When configured as agent, programing interface = 1 */ | ||
1751 | int prog_if = dev->class & 0xf; | ||
1750 | 1752 | ||
1751 | if ((class == PCI_CLASS_PROCESSOR_POWERPC || | 1753 | if ((class == PCI_CLASS_PROCESSOR_POWERPC || |
1752 | class == PCI_CLASS_BRIDGE_OTHER) && | 1754 | class == PCI_CLASS_BRIDGE_OTHER) && |
1753 | (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) && | 1755 | (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) && |
1756 | (prog_if == 0) && | ||
1754 | (dev->bus->parent == NULL)) { | 1757 | (dev->bus->parent == NULL)) { |
1755 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | 1758 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { |
1756 | dev->resource[i].start = 0; | 1759 | dev->resource[i].start = 0; |