1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef __ASM_SH_SMC37C93X_H
13#define __ASM_SH_SMC37C93X_H
14
15#define FDC_PRIMARY_BASE 0x3f0
16#define IDE1_PRIMARY_BASE 0x1f0
17#define IDE1_SECONDARY_BASE 0x170
18#define PARPORT_PRIMARY_BASE 0x378
19#define COM1_PRIMARY_BASE 0x2f8
20#define COM2_PRIMARY_BASE 0x3f8
21#define RTC_PRIMARY_BASE 0x070
22#define KBC_PRIMARY_BASE 0x060
23#define AUXIO_PRIMARY_BASE 0x000
24
25#define LDN_FDC 0
26#define LDN_IDE1 1
27#define LDN_IDE2 2
28#define LDN_PARPORT 3
29#define LDN_COM1 4
30#define LDN_COM2 5
31#define LDN_RTC 6
32#define LDN_KBC 7
33#define LDN_AUXIO 8
34
35#define CONFIG_PORT 0x3f0
36#define INDEX_PORT CONFIG_PORT
37#define DATA_PORT 0x3f1
38#define CONFIG_ENTER 0x55
39#define CONFIG_EXIT 0xaa
40
41#define CURRENT_LDN_INDEX 0x07
42#define POWER_CONTROL_INDEX 0x22
43#define ACTIVATE_INDEX 0x30
44#define IO_BASE_HI_INDEX 0x60
45#define IO_BASE_LO_INDEX 0x61
46#define IRQ_SELECT_INDEX 0x70
47#define DMA_SELECT_INDEX 0x74
48
49#define GPIO46_INDEX 0xc6
50#define GPIO47_INDEX 0xc7
51
52#define UART_RBR 0x0
53#define UART_THR 0x0
54#define UART_IER 0x2
55#define UART_IIR 0x4
56#define UART_FCR 0x4
57#define UART_LCR 0x6
58#define UART_MCR 0x8
59#define UART_LSR 0xa
60#define UART_MSR 0xc
61#define UART_SCR 0xe
62#define UART_DLL 0x0
63#define UART_DLM 0x2
64
65#ifndef __ASSEMBLY__
66typedef struct uart_reg {
67 volatile __u16 rbr;
68 volatile __u16 ier;
69 volatile __u16 iir;
70 volatile __u16 lcr;
71 volatile __u16 mcr;
72 volatile __u16 lsr;
73 volatile __u16 msr;
74 volatile __u16 scr;
75} uart_reg;
76#endif
77
78#define thr rbr
79#define tcr iir
80
81#define dll rbr
82#define dlm ier
83#define fcr iir
84
85#define IER_ERDAI 0x0100
86#define IER_ETHREI 0x0200
87#define IER_ELSI 0x0400
88#define IER_EMSI 0x0800
89
90#define IIR_IP 0x0100
91#define IIR_IIB0 0x0200
92#define IIR_IIB1 0x0400
93#define IIR_IIB2 0x0800
94#define IIR_FIFO 0xc000
95
96#define FCR_FEN 0x0100
97#define FCR_RFRES 0x0200
98#define FCR_TFRES 0x0400
99#define FCR_DMA 0x0800
100#define FCR_RTL 0x4000
101#define FCR_RTM 0x8000
102
103#define LCR_WLS0 0x0100
104#define LCR_WLS1 0x0200
105#define LCR_STB 0x0400
106#define LCR_PEN 0x0800
107#define LCR_EPS 0x1000
108#define LCR_SP 0x2000
109#define LCR_SB 0x4000
110#define LCR_DLAB 0x8000
111
112#define MCR_DTR 0x0100
113#define MCR_RTS 0x0200
114#define MCR_OUT1 0x0400
115#define MCR_IRQEN 0x0800
116#define MCR_LOOP 0x1000
117
118#define LSR_DR 0x0100
119#define LSR_OE 0x0200
120#define LSR_PE 0x0400
121#define LSR_FE 0x0800
122#define LSR_BI 0x1000
123#define LSR_THRE 0x2000
124#define LSR_TEMT 0x4000
125#define LSR_FIFOE 0x8000
126
127#define MSR_DCTS 0x0100
128#define MSR_DDSR 0x0200
129#define MSR_TERI 0x0400
130#define MSR_DDCD 0x0800
131#define MSR_CTS 0x1000
132#define MSR_DSR 0x2000
133#define MSR_RI 0x4000
134#define MSR_DCD 0x8000
135
136#define UART_CLK (1843200)
137#define UART_BAUD(x) (UART_CLK / (16 * (x)))
138
139#define RTC_SECONDS 0
140#define RTC_SECONDS_ALARM 1
141#define RTC_MINUTES 2
142#define RTC_MINUTES_ALARM 3
143#define RTC_HOURS 4
144#define RTC_HOURS_ALARM 5
145#define RTC_DAY_OF_WEEK 6
146#define RTC_DAY_OF_MONTH 7
147#define RTC_MONTH 8
148#define RTC_YEAR 9
149#define RTC_FREQ_SELECT 10
150#define RTC_UIP 0x80
151#define RTC_DIV_CTL 0x70
152
153#define RTC_OSC_ENABLE 0x20
154#define RTC_OSC_DISABLE 0x00
155#define RTC_CONTROL 11
156#define RTC_SET 0x80
157#define RTC_PIE 0x40
158#define RTC_AIE 0x20
159#define RTC_UIE 0x10
160#define RTC_SQWE 0x08
161#define RTC_DM_BINARY 0x04
162#define RTC_24H 0x02
163#define RTC_DST_EN 0x01
164
165#endif
166