2 * include/asm-sh/snapgear/io.h
4 * Modified version of io_se.h for the snapgear-specific functions.
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
9 * IO functions for a SnapGear
12 #ifndef _ASM_SH_IO_SNAPGEAR_H
13 #define _ASM_SH_IO_SNAPGEAR_H
15 #if defined(CONFIG_CPU_SH4)
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 :-)
23 #define IRL0_IPR_ADDR INTC_IPRD
24 #define IRL0_IPR_POS 3
25 #define IRL0_PRIORITY 13
28 #define IRL1_IPR_ADDR INTC_IPRD
29 #define IRL1_IPR_POS 2
30 #define IRL1_PRIORITY 10
33 #define IRL2_IPR_ADDR INTC_IPRD
34 #define IRL2_IPR_POS 1
35 #define IRL2_PRIORITY 7
38 #define IRL3_IPR_ADDR INTC_IPRD
39 #define IRL3_IPR_POS 0
40 #define IRL3_PRIORITY 4
43 extern unsigned char snapgear_inb(unsigned long port
);
44 extern unsigned short snapgear_inw(unsigned long port
);
45 extern unsigned int snapgear_inl(unsigned long port
);
47 extern void snapgear_outb(unsigned char value
, unsigned long port
);
48 extern void snapgear_outw(unsigned short value
, unsigned long port
);
49 extern void snapgear_outl(unsigned int value
, unsigned long port
);
51 extern unsigned char snapgear_inb_p(unsigned long port
);
52 extern void snapgear_outb_p(unsigned char value
, unsigned long port
);
54 extern void snapgear_insl(unsigned long port
, void *addr
, unsigned long count
);
55 extern void snapgear_outsl(unsigned long port
, const void *addr
, unsigned long count
);
57 extern unsigned long snapgear_isa_port2addr(unsigned long offset
);
59 #ifdef CONFIG_SH_SECUREEDGE5410
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
66 * -----------------------------------------------
67 * D0 DCD on ttySC1 power
68 * D1 Reset Switch heatbeat
69 * D2 ttySC0 CTS (7100) LAN
71 * D4 ttySC0 DCD (7100) CONSOLE
75 * D8 - ttySC0 RTS (7100)
76 * D9 - ttySC0 DTR (7100)
78 * D11 RTC DATA RTC DATA
82 #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
83 extern unsigned short secureedge5410_ioport
;
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))
92 #endif /* _ASM_SH_IO_SNAPGEAR_H */