Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b5751e2e00cb88b34ac1ebfa9ec4496db4dee098
Commit:     b5751e2e00cb88b34ac1ebfa9ec4496db4dee098
Parent:     f38c5a696a1e775c70d8764b1b9c1a4e267448d3
Author:     Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Fri Nov 2 14:17:19 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Fri Nov 2 14:17:19 2007 +0900

    sh: Fix up r7780rp highlander CF access size.
    
    R7780RP can't do byte-sized accesses to CF, so needs to do word
    sized access with low-byte masking. This same problem exists
    on older versions of the R2D, with the same workaround having
    been implemented in 43f4b8c7578b928892b6f01d374346ae14e5eb70
    there. Follow that change for the highlander boards.
    
    This does not impact R7780MP or SH7785 based Highlander modules.
    
    If you're unfortunate enough to be stuck with an R7780RP, this
    patch is for you!
    
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh/boards/renesas/r7780rp/setup.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/sh/boards/renesas/r7780rp/setup.c 
b/arch/sh/boards/renesas/r7780rp/setup.c
index 2a9ac6b..0fdc0bc 100644
--- a/arch/sh/boards/renesas/r7780rp/setup.c
+++ b/arch/sh/boards/renesas/r7780rp/setup.c
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/pata_platform.h>
+#include <linux/types.h>
 #include <net/ax88796.h>
 #include <asm/machvec.h>
 #include <asm/r7780rp.h>
@@ -223,6 +224,34 @@ static void r7780rp_power_off(void)
                ctrl_outw(0x0001, PA_POFF);
 }
 
+static inline unsigned char is_ide_ioaddr(unsigned long addr)
+{
+       return ((cf_ide_resources[0].start <= addr &&
+                addr <= cf_ide_resources[0].end) ||
+               (cf_ide_resources[1].start <= addr &&
+                addr <= cf_ide_resources[1].end));
+}
+
+void highlander_writeb(u8 b, void __iomem *addr)
+{
+       unsigned long tmp = (unsigned long __force)addr;
+
+       if (is_ide_ioaddr(tmp))
+               ctrl_outw((u16)b, tmp);
+       else
+               ctrl_outb(b, tmp);
+}
+
+u8 highlander_readb(void __iomem *addr)
+{
+       unsigned long tmp = (unsigned long __force)addr;
+
+       if (is_ide_ioaddr(tmp))
+               return ctrl_inw(tmp) & 0xff;
+       else
+               return ctrl_inb(tmp);
+}
+
 /*
  * Initialize the board
  */
@@ -307,4 +336,6 @@ static struct sh_machine_vector mv_highlander __initmv = {
        .mv_setup               = highlander_setup,
        .mv_init_irq            = highlander_init_irq,
        .mv_irq_demux           = highlander_irq_demux,
+       .mv_readb               = highlander_readb,
+       .mv_writeb              = highlander_writeb,
 };
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to