xref: /openbmc/linux/arch/sh/include/mach-common/mach/secureedge5410.h (revision 597473720f4dc69749542bfcfed4a927a43d935e)
1*6a0abce4SKuninori Morimoto /* SPDX-License-Identifier: GPL-2.0
2*6a0abce4SKuninori Morimoto  *
3f6eec8d6SPaul Mundt  * include/asm-sh/snapgear.h
4f6eec8d6SPaul Mundt  *
5f6eec8d6SPaul Mundt  * Modified version of io_se.h for the snapgear-specific functions.
6f6eec8d6SPaul Mundt  *
7f6eec8d6SPaul Mundt  * IO functions for a SnapGear
8f6eec8d6SPaul Mundt  */
9f6eec8d6SPaul Mundt 
10f6eec8d6SPaul Mundt #ifndef _ASM_SH_IO_SNAPGEAR_H
11f6eec8d6SPaul Mundt #define _ASM_SH_IO_SNAPGEAR_H
12f6eec8d6SPaul Mundt 
13f6eec8d6SPaul Mundt #define __IO_PREFIX	snapgear
14f6eec8d6SPaul Mundt #include <asm/io_generic.h>
15f6eec8d6SPaul Mundt 
16f6eec8d6SPaul Mundt /*
17f6eec8d6SPaul Mundt  * We need to remember what was written to the ioport as some bits
18f6eec8d6SPaul Mundt  * are shared with other functions and you cannot read back what was
19f6eec8d6SPaul Mundt  * written :-|
20f6eec8d6SPaul Mundt  *
21f6eec8d6SPaul Mundt  * Bit        Read                   Write
22f6eec8d6SPaul Mundt  * -----------------------------------------------
23f6eec8d6SPaul Mundt  * D0         DCD on ttySC1          power
24f6eec8d6SPaul Mundt  * D1         Reset Switch           heatbeat
25f6eec8d6SPaul Mundt  * D2         ttySC0 CTS (7100)      LAN
26f6eec8d6SPaul Mundt  * D3         -                      WAN
27f6eec8d6SPaul Mundt  * D4         ttySC0 DCD (7100)      CONSOLE
28f6eec8d6SPaul Mundt  * D5         -                      ONLINE
29f6eec8d6SPaul Mundt  * D6         -                      VPN
30f6eec8d6SPaul Mundt  * D7         -                      DTR on ttySC1
31f6eec8d6SPaul Mundt  * D8         -                      ttySC0 RTS (7100)
32f6eec8d6SPaul Mundt  * D9         -                      ttySC0 DTR (7100)
33f6eec8d6SPaul Mundt  * D10        -                      RTC SCLK
34f6eec8d6SPaul Mundt  * D11        RTC DATA               RTC DATA
35f6eec8d6SPaul Mundt  * D12        -                      RTS RESET
36f6eec8d6SPaul Mundt  */
37f6eec8d6SPaul Mundt 
38f6eec8d6SPaul Mundt #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
39f6eec8d6SPaul Mundt extern unsigned short secureedge5410_ioport;
40f6eec8d6SPaul Mundt 
41f6eec8d6SPaul Mundt #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
42f6eec8d6SPaul Mundt 	 (secureedge5410_ioport = \
43f6eec8d6SPaul Mundt 			((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
44f6eec8d6SPaul Mundt #define SECUREEDGE_READ_IOPORT() \
45f6eec8d6SPaul Mundt 	 ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
46f6eec8d6SPaul Mundt 
47f6eec8d6SPaul Mundt #endif /* _ASM_SH_IO_SNAPGEAR_H */
48