linux-mips
[Top] [All Lists]

RFC: [MIPS] BCM1480/BCM1480HT remove io_offset

To: Ralf Baechle <ralf@linux-mips.org>
Subject: RFC: [MIPS] BCM1480/BCM1480HT remove io_offset
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
Date: Wed, 24 Feb 2010 13:38:41 -0700
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>, linux-mips@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: KMail/1.9.10
BCM1480 and BCM1480HT currently offset the Linux ioport space from the
PCI ioport addresses, e.g., for BCM1480, device I/O resources from the CPU
perspective are in the range [io 0x2c000000-0x2dffffff] (these would appear
in /proc/ioports) and are converted by the PCI controller to the PCI range
[io 0x0-0x1fffff].
    
It should be simpler to remove this io_offset and adjust the controller's
io_map_base correspondingly.  For BCM1480, this would change this:
    
    [CPU io 0x2c000000-0x2dffffff] -> [PCI io 0x0-0x1ffffff]
    bcm1480_controller.io_offset = 0x2c000000
    bcm1480_controller.io_map_base = 0 (physical)
    mips_io_port_base = 0 (physical)
    
to this:
    
    [CPU io 0x0-0x1ffffff] -> [PCI io 0x0-0x1ffffff]
    bcm1480_controller.io_offset = 0
    bcm1480_controller.io_map_base = 0x2c000000 (physical)
    mips_io_port_base = 0x2c000000 (physical)
    
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
index 6f5e24c..74585cb 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 = {
 
 static struct resource bcm1480_io_resource = {
        .name   = "BCM1480 PCI I/O",
-       .start  = A_BCM1480_PHYS_PCI_IO_MATCH_BYTES,
-       .end    = A_BCM1480_PHYS_PCI_IO_MATCH_BYTES + 0x1ffffffUL,
+       .start  = 0,
+       .end    = 0x1ffffffUL,
        .flags  = IORESOURCE_IO,
 };
 
@@ -194,7 +194,6 @@ struct pci_controller bcm1480_controller = {
        .pci_ops        = &bcm1480_pci_ops,
        .mem_resource   = &bcm1480_mem_resource,
        .io_resource    = &bcm1480_io_resource,
-       .io_offset      = A_BCM1480_PHYS_PCI_IO_MATCH_BYTES,
 };
 
 
@@ -251,7 +250,6 @@ static int __init bcm1480_pcibios_init(void)
 
        bcm1480_controller.io_map_base = (unsigned long)
                ioremap(A_BCM1480_PHYS_PCI_IO_MATCH_BYTES, 65536);
-       bcm1480_controller.io_map_base -= bcm1480_controller.io_offset;
        set_io_port_base(bcm1480_controller.io_map_base);
 
        register_pci_controller(&bcm1480_controller);
diff --git a/arch/mips/pci/pci-bcm1480ht.c b/arch/mips/pci/pci-bcm1480ht.c
index 50cc6e9..0fd0222 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 = {
 
 static struct resource bcm1480ht_io_resource = {
        .name   = "BCM1480 HT I/O",
-       .start  = A_BCM1480_PHYS_HT_IO_MATCH_BYTES,
-       .end    = A_BCM1480_PHYS_HT_IO_MATCH_BYTES + 0x01ffffffUL,
+       .start  = 0,
+       .end    = 0x01ffffffUL,
        .flags  = IORESOURCE_IO,
 };
 
@@ -191,7 +191,6 @@ struct pci_controller bcm1480ht_controller = {
        .io_resource    = &bcm1480ht_io_resource,
        .index          = 1,
        .get_busno      = bcm1480ht_pcibios_get_busno,
-       .io_offset      = A_BCM1480_PHYS_HT_IO_MATCH_BYTES,
 };
 
 static int __init bcm1480ht_pcibios_init(void)
@@ -206,7 +205,6 @@ static int __init bcm1480ht_pcibios_init(void)
                        4 * 1024 * 1024);
        bcm1480ht_controller.io_map_base = (unsigned long)
                ioremap(A_BCM1480_PHYS_HT_IO_MATCH_BYTES, 65536);
-       bcm1480ht_controller.io_map_base -= bcm1480ht_controller.io_offset;
 
        register_pci_controller(&bcm1480ht_controller);
 

<Prev in Thread] Current Thread [Next in Thread>