blob: 3554e3a74e99703e06adb84c7b1b3ed618fac2f3 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Uwe Kleine-König58862692007-05-09 07:51:49 +02002 * include/asm-sh/snapgear.h
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#define IRL0_IPR_POS 3
24#define IRL0_PRIORITY 13
25
26#define IRL1_IRQ 5
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#define IRL1_IPR_POS 2
28#define IRL1_PRIORITY 10
29
30#define IRL2_IRQ 8
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#define IRL2_IPR_POS 1
32#define IRL2_PRIORITY 7
33
34#define IRL3_IRQ 11
Linus Torvalds1da177e2005-04-16 15:20:36 -070035#define IRL3_IPR_POS 0
36#define IRL3_PRIORITY 4
37#endif
38
Paul Mundt373e68b2006-09-27 15:41:24 +090039#define __IO_PREFIX snapgear
40#include <asm/io_generic.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42#ifdef CONFIG_SH_SECUREEDGE5410
43/*
44 * We need to remember what was written to the ioport as some bits
45 * are shared with other functions and you cannot read back what was
46 * written :-|
47 *
48 * Bit Read Write
49 * -----------------------------------------------
50 * D0 DCD on ttySC1 power
51 * D1 Reset Switch heatbeat
52 * D2 ttySC0 CTS (7100) LAN
53 * D3 - WAN
54 * D4 ttySC0 DCD (7100) CONSOLE
55 * D5 - ONLINE
56 * D6 - VPN
57 * D7 - DTR on ttySC1
58 * D8 - ttySC0 RTS (7100)
59 * D9 - ttySC0 DTR (7100)
60 * D10 - RTC SCLK
61 * D11 RTC DATA RTC DATA
62 * D12 - RTS RESET
63 */
64
Paul Mundt373e68b2006-09-27 15:41:24 +090065#define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
66extern unsigned short secureedge5410_ioport;
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Paul Mundt373e68b2006-09-27 15:41:24 +090068#define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
69 (secureedge5410_ioport = \
70 ((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
71#define SECUREEDGE_READ_IOPORT() \
72 ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
Linus Torvalds1da177e2005-04-16 15:20:36 -070073#endif
74
75#endif /* _ASM_SH_IO_SNAPGEAR_H */