Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-02-12 23:46:06 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-02-12 23:46:06 -0800
commitf4dd156ebe818aa46bfc8e2b8a32bc5a0162bc92 (patch)
tree684717ccca33ea0505187d8ff8e0bf0e19086605
parent55dcf0466024b7a0ff8431749de117dd4e05e93f (diff)
[PATCH] sh: hd64461 updates
From: Paul Mundt <lethal@linux-sh.org> This updates a number of the hd64461 cchip definitions (needed by hitfb), and also adds some additional I/O routines.
-rw-r--r--arch/sh/cchips/hd6446x/hd64461/io.c43
-rw-r--r--include/asm-sh/hd64461/hd64461.h53
-rw-r--r--include/asm-sh/hd64461/io.h9
3 files changed, 102 insertions, 3 deletions
diff --git a/arch/sh/cchips/hd6446x/hd64461/io.c b/arch/sh/cchips/hd6446x/hd64461/io.c
index 470de9823c77..49b3bfbb13f5 100644
--- a/arch/sh/cchips/hd6446x/hd64461/io.c
+++ b/arch/sh/cchips/hd6446x/hd64461/io.c
@@ -1,5 +1,5 @@
/*
- * $Id: io.c,v 1.4 2003/08/03 03:05:10 lethal Exp $
+ * $Id: io.c,v 1.5 2004/02/01 19:46:04 lethal Exp $
* Copyright (C) 2000 YAEGASHI Takeshi
* Typical I/O routines for HD64461 system.
*/
@@ -99,3 +99,44 @@ void hd64461_outl(unsigned int b, unsigned long port)
*(volatile unsigned long*)PORT2ADDR(port) = b;
}
+void hd64461_insb(unsigned long port, void *buffer, unsigned long count)
+{
+ volatile unsigned char* addr=(volatile unsigned char*)PORT2ADDR(port);
+ unsigned char *buf=buffer;
+ while(count--) *buf++=*addr;
+}
+
+void hd64461_insw(unsigned long port, void *buffer, unsigned long count)
+{
+ volatile unsigned short* addr=(volatile unsigned short*)PORT2ADDR(port);
+ unsigned short *buf=buffer;
+ while(count--) *buf++=*addr;
+}
+
+void hd64461_insl(unsigned long port, void *buffer, unsigned long count)
+{
+ volatile unsigned long* addr=(volatile unsigned long*)PORT2ADDR(port);
+ unsigned long *buf=buffer;
+ while(count--) *buf++=*addr;
+}
+
+void hd64461_outsb(unsigned long port, const void *buffer, unsigned long count)
+{
+ volatile unsigned char* addr=(volatile unsigned char*)PORT2ADDR(port);
+ const unsigned char *buf=buffer;
+ while(count--) *addr=*buf++;
+}
+
+void hd64461_outsw(unsigned long port, const void *buffer, unsigned long count)
+{
+ volatile unsigned short* addr=(volatile unsigned short*)PORT2ADDR(port);
+ const unsigned short *buf=buffer;
+ while(count--) *addr=*buf++;
+}
+
+void hd64461_outsl(unsigned long port, const void *buffer, unsigned long count)
+{
+ volatile unsigned long* addr=(volatile unsigned long*)PORT2ADDR(port);
+ const unsigned long *buf=buffer;
+ while(count--) *addr=*buf++;
+}
diff --git a/include/asm-sh/hd64461/hd64461.h b/include/asm-sh/hd64461/hd64461.h
index 4badb6e0c58b..306541673860 100644
--- a/include/asm-sh/hd64461/hd64461.h
+++ b/include/asm-sh/hd64461/hd64461.h
@@ -1,20 +1,40 @@
#ifndef __ASM_SH_HD64461
#define __ASM_SH_HD64461
/*
- * $Id: hd64461.h,v 1.3 2003/05/04 19:30:14 lethal Exp $
+ * $Id: hd64461.h,v 1.4 2004/02/01 19:46:04 lethal Exp $
* Copyright (C) 2000 YAEGASHI Takeshi
* Hitachi HD64461 companion chip support
*/
#include <linux/config.h>
#define HD64461_STBCR 0x10000
+#define HD64461_STBCR_CKIO_STBY 0x2000
+#define HD64461_STBCR_SAFECKE_IST 0x1000
+#define HD64461_STBCR_SLCKE_IST 0x0800
+#define HD64461_STBCR_SAFECKE_OST 0x0400
+#define HD64461_STBCR_SLCKE_OST 0x0200
+#define HD64461_STBCR_SMIAST 0x0100
+#define HD64461_STBCR_SLCDST 0x0080
+#define HD64461_STBCR_SPC0ST 0x0040
+#define HD64461_STBCR_SPC1ST 0x0020
+#define HD64461_STBCR_SAFEST 0x0010
+#define HD64461_STBCR_STM0ST 0x0008
+#define HD64461_STBCR_STM1ST 0x0004
+#define HD64461_STBCR_SIRST 0x0002
+#define HD64461_STBCR_SURTSD 0x0001
+
#define HD64461_SYSCR 0x10002
#define HD64461_SCPUCR 0x10004
#define HD64461_LCDCBAR 0x11000
#define HD64461_LCDCLOR 0x11002
-#define HD64461_LCDCCRR 0x11004
+#define HD64461_LCDCCR 0x11004
+#define HD64461_LCDCCR_MOFF 0x80
+
#define HD64461_LDR1 0x11010
+#define HD64461_LDR1_DON 0x01
+#define HD64461_LDR1_DINV 0x80
+
#define HD64461_LDR2 0x11012
#define HD64461_LDHNCR 0x11014
#define HD64461_LDHNSR 0x11016
@@ -28,6 +48,35 @@
#define HD64461_CPTRAR 0x11034
#define HD64461_CPTRDR 0x11036
+#define HD64461_GRDOR 0x11040
+#define HD64461_GRSCR 0x11042
+#define HD64461_GRCFGR 0x11044
+#define HD64461_GRCFGR_ACCSTATUS 0x10
+#define HD64461_GRCFGR_ACCRESET 0x08
+#define HD64461_GRCFGR_ACCSTART_BITBLT 0x06
+#define HD64461_GRCFGR_ACCSTART_LINE 0x04
+#define HD64461_GRCFGR_COLORDEPTH16 0x01
+
+#define HD64461_LNSARH 0x11046
+#define HD64461_LNSARL 0x11048
+#define HD64461_LNAXLR 0x1104a
+#define HD64461_LNDGR 0x1104c
+#define HD64461_LNAXR 0x1104e
+#define HD64461_LNERTR 0x11050
+#define HD64461_LNMDR 0x11052
+#define HD64461_BBTSSARH 0x11054
+#define HD64461_BBTSSARL 0x11056
+#define HD64461_BBTDSARH 0x11058
+#define HD64461_BBTDSARL 0x1105a
+#define HD64461_BBTDWR 0x1105c
+#define HD64461_BBTDHR 0x1105e
+#define HD64461_BBTPARH 0x11060
+#define HD64461_BBTPARL 0x11062
+#define HD64461_BBTMARH 0x11064
+#define HD64461_BBTMARL 0x11066
+#define HD64461_BBTROPR 0x11068
+#define HD64461_BBTMDR 0x1106a
+
#define HD64461_PCC0ISR 0x12000
#define HD64461_PCC0GCR 0x12002
#define HD64461_PCC0CSCR 0x12004
diff --git a/include/asm-sh/hd64461/io.h b/include/asm-sh/hd64461/io.h
index 03753b6d458a..a4c22eb98689 100644
--- a/include/asm-sh/hd64461/io.h
+++ b/include/asm-sh/hd64461/io.h
@@ -23,6 +23,15 @@ extern void hd64461_outl(unsigned int value, unsigned long port);
extern unsigned char hd64461_inb_p(unsigned long port);
extern void hd64461_outb_p(unsigned char value, unsigned long port);
+extern void hd64461_insb(unsigned long port, const void *buffer, unsigned long count);
+extern void hd64461_insw(unsigned long port, const void *buffer, unsigned long count);
+extern void hd64461_insl(unsigned long port, const void *buffer, unsigned long count);
+
+extern void hd64461_outsb(unsigned long port, const void *buffer, unsigned long count);
+extern void hd64461_outsw(unsigned long port, const void *buffer, unsigned long count);
+extern void hd64461_outsl(unsigned long port, const void *buffer, unsigned long count);
+
+
extern int hd64461_irq_demux(int irq);
#endif /* _ASM_SH_IO_HD64461_H */