All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: [MIPS] BCM1480/BCM1480HT remove io_offset
@ 2010-02-24 20:38 Bjorn Helgaas
  2010-02-24 22:10 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2010-02-24 20:38 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Thomas Bogendoerfer, linux-mips

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);
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-25 14:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24 20:38 RFC: [MIPS] BCM1480/BCM1480HT remove io_offset Bjorn Helgaas
2010-02-24 22:10 ` Thomas Bogendoerfer
2010-02-24 23:30   ` Bjorn Helgaas
2010-02-25  3:45     ` Bjorn Helgaas
2010-02-25 14:05       ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.