aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/snapgear/io.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-sh/snapgear/io.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-sh/snapgear/io.h')
-rw-r--r--include/asm-sh/snapgear/io.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/include/asm-sh/snapgear/io.h b/include/asm-sh/snapgear/io.h
new file mode 100644
index 000000000000..bfa97ac06280
--- /dev/null
+++ b/include/asm-sh/snapgear/io.h
@@ -0,0 +1,92 @@
1/*
2 * include/asm-sh/snapgear/io.h
3 *
4 * Modified version of io_se.h for the snapgear-specific functions.
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 * IO functions for a SnapGear
10 */
11
12#ifndef _ASM_SH_IO_SNAPGEAR_H
13#define _ASM_SH_IO_SNAPGEAR_H
14
15#if defined(CONFIG_CPU_SH4)
16/*
17 * The external interrupt lines, these take up ints 0 - 15 inclusive
18 * depending on the priority for the interrupt. In fact the priority
19 * is the interrupt :-)
20 */
21
22#define IRL0_IRQ 2
23#define IRL0_IPR_ADDR INTC_IPRD
24#define IRL0_IPR_POS 3
25#define IRL0_PRIORITY 13
26
27#define IRL1_IRQ 5
28#define IRL1_IPR_ADDR INTC_IPRD
29#define IRL1_IPR_POS 2
30#define IRL1_PRIORITY 10
31
32#define IRL2_IRQ 8
33#define IRL2_IPR_ADDR INTC_IPRD
34#define IRL2_IPR_POS 1
35#define IRL2_PRIORITY 7
36
37#define IRL3_IRQ 11
38#define IRL3_IPR_ADDR INTC_IPRD
39#define IRL3_IPR_POS 0
40#define IRL3_PRIORITY 4
41#endif
42
43extern unsigned char snapgear_inb(unsigned long port);
44extern unsigned short snapgear_inw(unsigned long port);
45extern unsigned int snapgear_inl(unsigned long port);
46
47extern void snapgear_outb(unsigned char value, unsigned long port);
48extern void snapgear_outw(unsigned short value, unsigned long port);
49extern void snapgear_outl(unsigned int value, unsigned long port);
50
51extern unsigned char snapgear_inb_p(unsigned long port);
52extern void snapgear_outb_p(unsigned char value, unsigned long port);
53
54extern void snapgear_insl(unsigned long port, void *addr, unsigned long count);
55extern void snapgear_outsl(unsigned long port, const void *addr, unsigned long count);
56
57extern unsigned long snapgear_isa_port2addr(unsigned long offset);
58
59#ifdef CONFIG_SH_SECUREEDGE5410
60/*
61 * We need to remember what was written to the ioport as some bits
62 * are shared with other functions and you cannot read back what was
63 * written :-|
64 *
65 * Bit Read Write
66 * -----------------------------------------------
67 * D0 DCD on ttySC1 power
68 * D1 Reset Switch heatbeat
69 * D2 ttySC0 CTS (7100) LAN
70 * D3 - WAN
71 * D4 ttySC0 DCD (7100) CONSOLE
72 * D5 - ONLINE
73 * D6 - VPN
74 * D7 - DTR on ttySC1
75 * D8 - ttySC0 RTS (7100)
76 * D9 - ttySC0 DTR (7100)
77 * D10 - RTC SCLK
78 * D11 RTC DATA RTC DATA
79 * D12 - RTS RESET
80 */
81
82 #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
83 extern unsigned short secureedge5410_ioport;
84
85 #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
86 (secureedge5410_ioport = \
87 ((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
88 #define SECUREEDGE_READ_IOPORT() \
89 ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
90#endif
91
92#endif /* _ASM_SH_IO_SNAPGEAR_H */