diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/86xx/pci.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/86xx/pci.c b/arch/powerpc/platforms/86xx/pci.c index 0db51e8ab5d4..3825e1ac5312 100644 --- a/arch/powerpc/platforms/86xx/pci.c +++ b/arch/powerpc/platforms/86xx/pci.c | |||
@@ -122,7 +122,6 @@ static void __init | |||
122 | mpc86xx_setup_pcie(struct pci_controller *hose, u32 pcie_offset, u32 pcie_size) | 122 | mpc86xx_setup_pcie(struct pci_controller *hose, u32 pcie_offset, u32 pcie_size) |
123 | { | 123 | { |
124 | u16 cmd; | 124 | u16 cmd; |
125 | unsigned int temps; | ||
126 | 125 | ||
127 | DBG("PCIE host controller register offset 0x%08x, size 0x%08x.\n", | 126 | DBG("PCIE host controller register offset 0x%08x, size 0x%08x.\n", |
128 | pcie_offset, pcie_size); | 127 | pcie_offset, pcie_size); |
@@ -135,6 +134,9 @@ mpc86xx_setup_pcie(struct pci_controller *hose, u32 pcie_offset, u32 pcie_size) | |||
135 | early_write_config_byte(hose, 0, 0, PCI_LATENCY_TIMER, 0x80); | 134 | early_write_config_byte(hose, 0, 0, PCI_LATENCY_TIMER, 0x80); |
136 | } | 135 | } |
137 | 136 | ||
137 | #define PCIE_LTSSM 0x404 /* PCIe Link Training and Status */ | ||
138 | #define PCIE_LTSSM_L0 0x16 /* L0 state */ | ||
139 | |||
138 | int __init mpc86xx_add_bridge(struct device_node *dev) | 140 | int __init mpc86xx_add_bridge(struct device_node *dev) |
139 | { | 141 | { |
140 | int len; | 142 | int len; |
@@ -143,6 +145,7 @@ int __init mpc86xx_add_bridge(struct device_node *dev) | |||
143 | const int *bus_range; | 145 | const int *bus_range; |
144 | int has_address = 0; | 146 | int has_address = 0; |
145 | int primary = 0; | 147 | int primary = 0; |
148 | u16 val; | ||
146 | 149 | ||
147 | DBG("Adding PCIE host bridge %s\n", dev->full_name); | 150 | DBG("Adding PCIE host bridge %s\n", dev->full_name); |
148 | 151 | ||
@@ -159,12 +162,18 @@ int __init mpc86xx_add_bridge(struct device_node *dev) | |||
159 | if (!hose) | 162 | if (!hose) |
160 | return -ENOMEM; | 163 | return -ENOMEM; |
161 | hose->arch_data = dev; | 164 | hose->arch_data = dev; |
165 | hose->indirect_type = PPC_INDIRECT_TYPE_EXT_REG; | ||
162 | 166 | ||
163 | hose->first_busno = bus_range ? bus_range[0] : 0x0; | 167 | hose->first_busno = bus_range ? bus_range[0] : 0x0; |
164 | hose->last_busno = bus_range ? bus_range[1] : 0xff; | 168 | hose->last_busno = bus_range ? bus_range[1] : 0xff; |
165 | 169 | ||
166 | setup_indirect_pci(hose, rsrc.start, rsrc.start + 0x4); | 170 | setup_indirect_pci(hose, rsrc.start, rsrc.start + 0x4); |
167 | 171 | ||
172 | /* Probe the hose link training status */ | ||
173 | early_read_config_word(hose, 0, 0, PCIE_LTSSM, &val); | ||
174 | if (val < PCIE_LTSSM_L0) | ||
175 | return -ENXIO; | ||
176 | |||
168 | /* Setup the PCIE host controller. */ | 177 | /* Setup the PCIE host controller. */ |
169 | mpc86xx_setup_pcie(hose, rsrc.start, rsrc.end - rsrc.start + 1); | 178 | mpc86xx_setup_pcie(hose, rsrc.start, rsrc.end - rsrc.start + 1); |
170 | 179 | ||