Skip to contentSkip to conversation

sh: pci io port base address code

PATCH In review Magnus Damm 1 participant 1 message Feb 19, 2008 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 8/9 sh: pci io port base address code

Adds a __get_pci_io_base() function which is used to match a port range against struct pci_channel. This allows us to detect if a port range is assigned to pci or happens to be legacy port io. While at it, remove unused cpu-specific cruft.

---

 arch/sh/drivers/pci/ops-rts7751r2d.c |    1 
 arch/sh/kernel/io.c                  |    5 +++
 include/asm-sh/pci.h                 |   47 ++++++++++++++--------------------
 3 files changed, 25 insertions(+), 28 deletions(-)
arch/sh/drivers/pci/ops-rts7751r2d.c +0 -1
@@ -68,7 +68,6 @@ static struct sh4_pci_address_map sh7751
 
 int __init pcibios_init_platform(void)
 {
-	__set_io_port_base(SH7751_PCI_IO_BASE);
 	return sh7751_pcic_init(&board_pci_channels[0], &sh7751_pci_map);
 }
 
arch/sh/kernel/io.c +5 -0
@@ -12,6 +12,7 @@
  * for more details.
  */
 #include <linux/module.h>
+#include <linux/pci.h>
 #include <asm/machvec.h>
 #include <asm/io.h>
 
@@ -69,6 +70,10 @@ void __iomem *ioport_map(unsigned long p
 	if (ret)
 		return ret;
 
+	ret = __get_pci_io_base(port, nr);
+	if (ret)
+		return ret;
+
 	return __ioport_map(port, nr);
 }
 EXPORT_SYMBOL(ioport_map);
include/asm-sh/pci.h +20 -27

64 lines not on this page · raw message