diff options
author | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2008-03-16 13:14:16 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-04-01 10:46:33 -0400 |
commit | cf7b7e0b3718418b38e1c20f5236534402e5a6c0 (patch) | |
tree | 3575724fe1d9ce07b4767f3ae6efb8b519909601 /arch | |
parent | 447cdf2628b59aa513a42785450b348dced26d8a (diff) |
[MIPS] BCM1480: Fix PCI/HT IO access
- removed check for enable HT-PCI bridges, because some CFE version
init only the needed one and scanning works even with disabled HT
links
- implemented I/O access behind HT PCI busses
- fixed pci_map for IO resource behind PCI bridge
Tested with E100 and Tulip driver.
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/pci/pci-bcm1480.c | 6 | ||||
-rw-r--r-- | arch/mips/pci/pci-bcm1480ht.c | 21 |
2 files changed, 11 insertions, 16 deletions
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c index ab68c4318a30..87e2c8f54e2d 100644 --- a/arch/mips/pci/pci-bcm1480.c +++ b/arch/mips/pci/pci-bcm1480.c | |||
@@ -185,8 +185,8 @@ static struct resource bcm1480_mem_resource = { | |||
185 | 185 | ||
186 | static struct resource bcm1480_io_resource = { | 186 | static struct resource bcm1480_io_resource = { |
187 | .name = "BCM1480 PCI I/O", | 187 | .name = "BCM1480 PCI I/O", |
188 | .start = 0x2c000000UL, | 188 | .start = A_BCM1480_PHYS_PCI_IO_MATCH_BYTES, |
189 | .end = 0x2dffffffUL, | 189 | .end = A_BCM1480_PHYS_PCI_IO_MATCH_BYTES + 0x1ffffffUL, |
190 | .flags = IORESOURCE_IO, | 190 | .flags = IORESOURCE_IO, |
191 | }; | 191 | }; |
192 | 192 | ||
@@ -194,6 +194,7 @@ struct pci_controller bcm1480_controller = { | |||
194 | .pci_ops = &bcm1480_pci_ops, | 194 | .pci_ops = &bcm1480_pci_ops, |
195 | .mem_resource = &bcm1480_mem_resource, | 195 | .mem_resource = &bcm1480_mem_resource, |
196 | .io_resource = &bcm1480_io_resource, | 196 | .io_resource = &bcm1480_io_resource, |
197 | .io_offset = A_BCM1480_PHYS_PCI_IO_MATCH_BYTES, | ||
197 | }; | 198 | }; |
198 | 199 | ||
199 | 200 | ||
@@ -251,6 +252,7 @@ static int __init bcm1480_pcibios_init(void) | |||
251 | 252 | ||
252 | bcm1480_controller.io_map_base = (unsigned long) | 253 | bcm1480_controller.io_map_base = (unsigned long) |
253 | ioremap(A_BCM1480_PHYS_PCI_IO_MATCH_BYTES, 65536); | 254 | ioremap(A_BCM1480_PHYS_PCI_IO_MATCH_BYTES, 65536); |
255 | bcm1480_controller.io_map_base -= bcm1480_controller.io_offset; | ||
254 | set_io_port_base(bcm1480_controller.io_map_base); | 256 | set_io_port_base(bcm1480_controller.io_map_base); |
255 | isa_slot_offset = (unsigned long) | 257 | isa_slot_offset = (unsigned long) |
256 | ioremap(A_BCM1480_PHYS_PCI_MEM_MATCH_BYTES, 1024*1024); | 258 | ioremap(A_BCM1480_PHYS_PCI_MEM_MATCH_BYTES, 1024*1024); |
diff --git a/arch/mips/pci/pci-bcm1480ht.c b/arch/mips/pci/pci-bcm1480ht.c index 005e7fecab08..f54f45412b0b 100644 --- a/arch/mips/pci/pci-bcm1480ht.c +++ b/arch/mips/pci/pci-bcm1480ht.c | |||
@@ -180,8 +180,8 @@ static struct resource bcm1480ht_mem_resource = { | |||
180 | 180 | ||
181 | static struct resource bcm1480ht_io_resource = { | 181 | static struct resource bcm1480ht_io_resource = { |
182 | .name = "BCM1480 HT I/O", | 182 | .name = "BCM1480 HT I/O", |
183 | .start = 0x00000000UL, | 183 | .start = A_BCM1480_PHYS_HT_IO_MATCH_BYTES, |
184 | .end = 0x01ffffffUL, | 184 | .end = A_BCM1480_PHYS_HT_IO_MATCH_BYTES + 0x01ffffffUL, |
185 | .flags = IORESOURCE_IO, | 185 | .flags = IORESOURCE_IO, |
186 | }; | 186 | }; |
187 | 187 | ||
@@ -191,29 +191,22 @@ struct pci_controller bcm1480ht_controller = { | |||
191 | .io_resource = &bcm1480ht_io_resource, | 191 | .io_resource = &bcm1480ht_io_resource, |
192 | .index = 1, | 192 | .index = 1, |
193 | .get_busno = bcm1480ht_pcibios_get_busno, | 193 | .get_busno = bcm1480ht_pcibios_get_busno, |
194 | .io_offset = A_BCM1480_PHYS_HT_IO_MATCH_BYTES, | ||
194 | }; | 195 | }; |
195 | 196 | ||
196 | static int __init bcm1480ht_pcibios_init(void) | 197 | static int __init bcm1480ht_pcibios_init(void) |
197 | { | 198 | { |
198 | uint32_t cmdreg; | ||
199 | |||
200 | ht_cfg_space = ioremap(A_BCM1480_PHYS_HT_CFG_MATCH_BITS, 16*1024*1024); | 199 | ht_cfg_space = ioremap(A_BCM1480_PHYS_HT_CFG_MATCH_BITS, 16*1024*1024); |
201 | 200 | ||
202 | /* | 201 | /* CFE doesn't always init all HT paths, so we always scan */ |
203 | * See if the PCI bus has been configured by the firmware. | ||
204 | */ | ||
205 | cmdreg = READCFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0), | ||
206 | PCI_COMMAND)); | ||
207 | if (!(cmdreg & PCI_COMMAND_MASTER)) { | ||
208 | printk("HT: Skipping HT probe. Bus is not initialized.\n"); | ||
209 | iounmap(ht_cfg_space); | ||
210 | return 1; /* XXX */ | ||
211 | } | ||
212 | bcm1480ht_bus_status |= PCI_BUS_ENABLED; | 202 | bcm1480ht_bus_status |= PCI_BUS_ENABLED; |
213 | 203 | ||
214 | ht_eoi_space = (unsigned long) | 204 | ht_eoi_space = (unsigned long) |
215 | ioremap(A_BCM1480_PHYS_HT_SPECIAL_MATCH_BYTES, | 205 | ioremap(A_BCM1480_PHYS_HT_SPECIAL_MATCH_BYTES, |
216 | 4 * 1024 * 1024); | 206 | 4 * 1024 * 1024); |
207 | bcm1480ht_controller.io_map_base = (unsigned long) | ||
208 | ioremap(A_BCM1480_PHYS_HT_IO_MATCH_BYTES, 65536); | ||
209 | bcm1480ht_controller.io_map_base -= bcm1480ht_controller.io_offset; | ||
217 | 210 | ||
218 | register_pci_controller(&bcm1480ht_controller); | 211 | register_pci_controller(&bcm1480ht_controller); |
219 | 212 | ||