public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: fix pci io access for r2d boards
@ 2008-02-14  5:04 Magnus Damm
  2008-02-14  5:05 ` Magnus Damm
  0 siblings, 1 reply; 2+ messages in thread
From: Magnus Damm @ 2008-02-14  5:04 UTC (permalink / raw)
  To: linux-sh

This patch is a fix to make sure readsN/writesN are used over insN/outsN for
ioreadN_rep/iowriteN_rep.

The current state of the sh io code is that mmio operations like readN/writeN
and ioreadN/iowriteN are unaffected by the value of generic_io_base. This is
different fom port based io like inN/outN which gets adjusted using the value
in generic_io_base.

Without this patch ioreadN_rep/iowriteN_rep get their addresses adjusted.
The address for mmio access is adjusted using generic_io_base. This is wrong.
The ata core code currently crashes if generic_io_base is set.

This patch changes ioreadN_rep/iowriteN_rep to follow the same rules as the
rest of the mmio operations, ie don't adjust using generic_io_base.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Katsuya MATSUBARA <matsu@igel.co.jp>
---

 include/asm-sh/io.h |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- 0001/include/asm-sh/io.h
+++ work/include/asm-sh/io.h	2008-02-14 12:58:07.000000000 +0900
@@ -182,13 +182,13 @@ __BUILD_MEMORY_STRING(w, u16)
 #define iowrite32(v,a)		writel((v),(a))
 #define iowrite32be(v,a)	__raw_writel(cpu_to_be32((v)),(a))
 
-#define ioread8_rep(a,d,c)	insb((a),(d),(c))
-#define ioread16_rep(a,d,c)	insw((a),(d),(c))
-#define ioread32_rep(a,d,c)	insl((a),(d),(c))
-
-#define iowrite8_rep(a,s,c)	outsb((a),(s),(c))
-#define iowrite16_rep(a,s,c)	outsw((a),(s),(c))
-#define iowrite32_rep(a,s,c)	outsl((a),(s),(c))
+#define ioread8_rep(a, d, c)	readsb((a), (d), (c))
+#define ioread16_rep(a, d, c)	readsw((a), (d), (c))
+#define ioread32_rep(a, d, c)	readsl((a), (d), (c))
+
+#define iowrite8_rep(a, s, c)	writesb((a), (s), (c))
+#define iowrite16_rep(a, s, c)	writesw((a), (s), (c))
+#define iowrite32_rep(a, s, c)	writesl((a), (s), (c))
 
 #define mmiowb()	wmb()	/* synco on SH-4A, otherwise a nop */
 

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

* [PATCH] sh: fix pci io access for r2d boards
  2008-02-14  5:04 [PATCH] sh: fix pci io access for r2d boards Magnus Damm
@ 2008-02-14  5:05 ` Magnus Damm
  0 siblings, 0 replies; 2+ messages in thread
From: Magnus Damm @ 2008-02-14  5:05 UTC (permalink / raw)
  To: linux-sh

Use generic_io_base to point out the pci io window, and make sure the
highest port address used is SH7751_PCI_IO_SIZE - 1.

This patch fixes pci io port access for the r2d boards - CONFIG_8139TOO_PIO
now works as expected. So does the alsa driver for CMI8738.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Katsuya MATSUBARA <matsu@igel.co.jp>
---

 (This is the correct patch, sorry about that)

 arch/sh/drivers/pci/ops-rts7751r2d.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- 0001/arch/sh/drivers/pci/ops-rts7751r2d.c
+++ work/arch/sh/drivers/pci/ops-rts7751r2d.c	2008-02-14 13:00:01.000000000 +0900
@@ -33,7 +33,7 @@ int __init pcibios_map_platform_irq(stru
 static struct resource sh7751_io_resource = {
 	.name	= "SH7751_IO",
 	.start	= 0x4000,
-	.end	= 0x4000 + SH7751_PCI_IO_SIZE - 1,
+	.end	= SH7751_PCI_IO_SIZE - 1,
 	.flags	= IORESOURCE_IO
 };
 
@@ -68,6 +68,7 @@ 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(&sh7751_pci_map);
 }
 

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-14  5:04 [PATCH] sh: fix pci io access for r2d boards Magnus Damm
2008-02-14  5:05 ` Magnus Damm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox