Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: RC32434: Define io_map_base for PCI controller

The code is rather based on trial-and-error than knowledge. Verified Via
Rhine functionality in PIO as well as MMIO mode.

[Looks sane -- Ralf]

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Tested-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Phil Sutter and committed by
Ralf Baechle
fb91e2cb 5379a5fd

+11
+11
arch/mips/pci/pci-rc32434.c
··· 205 205 206 206 static int __init rc32434_pci_init(void) 207 207 { 208 + void __iomem *io_map_base; 209 + 208 210 pr_info("PCI: Initializing PCI\n"); 209 211 210 212 ioport_resource.start = rc32434_res_pci_io1.start; 211 213 ioport_resource.end = rc32434_res_pci_io1.end; 212 214 213 215 rc32434_pcibridge_init(); 216 + 217 + io_map_base = ioremap(rc32434_res_pci_io1.start, 218 + rc32434_res_pci_io1.end - rc32434_res_pci_io1.start + 1); 219 + 220 + if (!io_map_base) 221 + return -ENOMEM; 222 + 223 + rc32434_controller.io_map_base = 224 + (unsigned long)io_map_base - rc32434_res_pci_io1.start; 214 225 215 226 register_pci_controller(&rc32434_controller); 216 227 rc32434_sync();