Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Uwe Kleine-König | 5886269 | 2007-05-09 07:51:49 +0200 | [diff] [blame] | 2 | * include/asm-sh/snapgear.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Magnus Damm | d59645d | 2007-08-03 14:23:35 +0900 | [diff] [blame] | 22 | #define IRL0_IRQ 2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | #define IRL0_PRIORITY 13 |
| 24 | |
Magnus Damm | d59645d | 2007-08-03 14:23:35 +0900 | [diff] [blame] | 25 | #define IRL1_IRQ 5 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #define IRL1_PRIORITY 10 |
| 27 | |
Magnus Damm | d59645d | 2007-08-03 14:23:35 +0900 | [diff] [blame] | 28 | #define IRL2_IRQ 8 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | #define IRL2_PRIORITY 7 |
| 30 | |
Magnus Damm | d59645d | 2007-08-03 14:23:35 +0900 | [diff] [blame] | 31 | #define IRL3_IRQ 11 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #define IRL3_PRIORITY 4 |
| 33 | #endif |
| 34 | |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 35 | #define __IO_PREFIX snapgear |
| 36 | #include <asm/io_generic.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
| 38 | #ifdef CONFIG_SH_SECUREEDGE5410 |
| 39 | /* |
| 40 | * We need to remember what was written to the ioport as some bits |
| 41 | * are shared with other functions and you cannot read back what was |
| 42 | * written :-| |
| 43 | * |
| 44 | * Bit Read Write |
| 45 | * ----------------------------------------------- |
| 46 | * D0 DCD on ttySC1 power |
| 47 | * D1 Reset Switch heatbeat |
| 48 | * D2 ttySC0 CTS (7100) LAN |
| 49 | * D3 - WAN |
| 50 | * D4 ttySC0 DCD (7100) CONSOLE |
| 51 | * D5 - ONLINE |
| 52 | * D6 - VPN |
| 53 | * D7 - DTR on ttySC1 |
| 54 | * D8 - ttySC0 RTS (7100) |
| 55 | * D9 - ttySC0 DTR (7100) |
| 56 | * D10 - RTC SCLK |
| 57 | * D11 RTC DATA RTC DATA |
| 58 | * D12 - RTS RESET |
| 59 | */ |
| 60 | |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 61 | #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000) |
| 62 | extern unsigned short secureedge5410_ioport; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 64 | #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \ |
| 65 | (secureedge5410_ioport = \ |
| 66 | ((secureedge5410_ioport & ~(mask)) | ((val) & (mask))))) |
| 67 | #define SECUREEDGE_READ_IOPORT() \ |
| 68 | ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | #endif |
| 70 | |
| 71 | #endif /* _ASM_SH_IO_SNAPGEAR_H */ |