Re: [RFC PATCH] m68k: GENERIC_IOMAP support (take #2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 20 May 2007, Geert Uytterhoeven wrote:

On Sun, 25 Feb 2007, Kars de Jong wrote:
On vr, 2006-11-03 at 00:06 +0100, Kars de Jong wrote:
On do, 2006-11-02 at 22:34 +0100, Geert Uytterhoeven wrote:
OK, here's the patch, without the m68k generic iomap changes.

Ah, the missing io{read,write}*() stuff :-)

And here is the proposed patch to add iomap support. I think we need to
rethink our I/O support when we want to support all our I/O buses
properly, but that has been discussed before. I will commit my Amiga
PCMCIA support soon, I promise!

Here's the updated version of this patch. It should now work with Amiga
and Q40 defconfig.

I don't think the CONFIG_ATARI_ROM_ISA definitions are complete yet, the
32-bit variants are missing.

I think we've been cooking this patch sufficiently long now. Time to
add a Signed-off-by and commit it, together with the 53c700 fixes?

I've just fixed the CONFIG_ATARI_ROM_ISA stuff to add the 32 bit variants
and it does compile with 2.6.21-2 (Debian) now. Patch attached.

Note that both 16 and 32 bit accesses will return 8 bit results only, due
to the way the address and data bus are wired on the ROM ISA adapter. I
hope this is the correct behavior.

	Michael
--- include/asm/io.h.org	2007-05-18 18:24:41.000000000 +0200
+++ include/asm/io.h	2007-05-18 21:57:22.000000000 +0200
@@ -245,9 +245,16 @@
 #if defined(CONFIG_ATARI_ROM_ISA)
 #define isa_rom_inb(port)      rom_in_8(isa_itb(port))
 #define isa_rom_inw(port)      (ISA_SEX ? rom_in_be16(isa_itw(port)) : rom_in_le16(isa_itw(port)))
+#define isa_rom_inl(port)      (ISA_SEX ? rom_in_be32(isa_itw(port)) : rom_in_le32(isa_itw(port)))
 
 #define isa_rom_outb(val,port) rom_out_8(isa_itb(port),(val))
 #define isa_rom_outw(val,port) (ISA_SEX ? rom_out_be16(isa_itw(port),(val)) : rom_out_le16(isa_itw(port),(val)))
+#define isa_rom_outl(val,port) (ISA_SEX ? rom_out_be32(isa_itw(port),(val)) : rom_out_le32(isa_itw(port),(val)))
+
+#define isa_rom_readb(p)       rom_in_8(isa_mtb((unsigned long)(p)))
+#define isa_rom_readw(p)       \
+	(ISA_SEX ? rom_in_be16(isa_mtw((unsigned long)(p)))	\
+		 : rom_in_le16(isa_mtw((unsigned long)(p))))
 
 #define isa_rom_writeb(val,p)  rom_out_8(isa_mtb((unsigned long)(p)),(val))
 #define isa_rom_writew(val,p)  \
@@ -315,12 +322,20 @@
        (ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) :    \
                   raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
 
+#define isa_rom_insl(port, buf, nr)     \
+       (ISA_SEX ? raw_rom_insl(isa_itw(port), (u32 *)(buf), (nr)) :    \
+                  raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
+
 #define isa_rom_outsb(port, buf, nr) raw_rom_outsb(isa_itb(port), (u8 *)(buf), (nr))
 
 #define isa_rom_outsw(port, buf, nr)    \
        (ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) :  \
                   raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
 
+#define isa_rom_outsl(port, buf, nr)    \
+       (ISA_SEX ? raw_rom_outsl(isa_itw(port), (u32 *)(buf), (nr)) :  \
+                  raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
+
 #endif
 
 #endif  /* CONFIG_ISA */
@@ -421,8 +436,16 @@
 
 #define insb    isa_rom_insb
 #define insw    isa_rom_insw
+#define insl    isa_rom_insl
 #define outsb   isa_rom_outsb
 #define outsw   isa_rom_outsw
+#define outsl   isa_rom_outsl
+
+#define readb   isa_readb
+#define readw   isa_readw
+#define writeb  isa_writeb
+#define writew  isa_writew
+
 #endif
 
 #if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && !defined(CONFIG_ATARI_ROM_ISA)
--- include/asm/raw_io.h.org	2007-05-18 18:24:41.000000000 +0200
+++ include/asm/raw_io.h	2007-05-19 08:58:33.000000000 +0200
@@ -436,6 +436,24 @@
 	for (i = 0; i < nr; i++)
 		rom_out_le16(port, *buf++);
 }
+
+static inline void raw_rom_insl(volatile u16 __iomem *port, u32 *buf,
+				   unsigned int nr)
+{
+	unsigned int i;
+
+	for (i = 0; i < nr; i++)
+		*buf++ = rom_in_be32(port);
+}
+
+static inline void raw_rom_outsl(volatile u16 __iomem *port, const u32 *buf,
+				   unsigned int nr)
+{
+	unsigned int i;
+
+	for (i = 0; i < nr; i++)
+		rom_out_be32(port, *buf++);
+}
 #endif /* CONFIG_ATARI_ROM_ISA */
 
 #endif /* __KERNEL__ */

[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux