s3c2410reg.h revision 1.2 1 1.2 bsh /* $NetBSD: s3c2410reg.h,v 1.2 2003/08/04 10:24:15 bsh Exp $ */
2 1.1 bsh
3 1.1 bsh /*
4 1.1 bsh * Copyright (c) 2003 Genetec corporation. All rights reserved.
5 1.1 bsh * Written by Hiroyuki Bessho for Genetec corporation.
6 1.1 bsh *
7 1.1 bsh * Redistribution and use in source and binary forms, with or without
8 1.1 bsh * modification, are permitted provided that the following conditions
9 1.1 bsh * are met:
10 1.1 bsh * 1. Redistributions of source code must retain the above copyright
11 1.1 bsh * notice, this list of conditions and the following disclaimer.
12 1.1 bsh * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 bsh * notice, this list of conditions and the following disclaimer in the
14 1.1 bsh * documentation and/or other materials provided with the distribution.
15 1.1 bsh * 3. The name of Genetec corporation may not be used to endorse
16 1.1 bsh * or promote products derived from this software without specific prior
17 1.1 bsh * written permission.
18 1.1 bsh *
19 1.1 bsh * THIS SOFTWARE IS PROVIDED BY GENETEC CORP. ``AS IS'' AND
20 1.1 bsh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1 bsh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1 bsh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORP.
23 1.1 bsh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1 bsh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1 bsh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1 bsh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1 bsh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1 bsh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 bsh * POSSIBILITY OF SUCH DAMAGE.
30 1.1 bsh */
31 1.1 bsh
32 1.1 bsh
33 1.1 bsh /*
34 1.1 bsh * Samsung S3C2410X processor is ARM920T based integrated CPU
35 1.1 bsh *
36 1.1 bsh * Reference:
37 1.1 bsh * S3C2410X User's Manual
38 1.1 bsh */
39 1.1 bsh #ifndef _ARM_S3C2XX0_S3C2410REG_H_
40 1.1 bsh #define _ARM_S3C2XX0_S3C2410REG_H_
41 1.1 bsh
42 1.1 bsh /* common definitions for S3C2800, S3C2400 and S3C2410 */
43 1.1 bsh #include <arm/s3c2xx0/s3c2xx0reg.h>
44 1.1 bsh /* common definitions for S3C2400 and S3C2410 */
45 1.1 bsh #include <arm/s3c2xx0/s3c24x0reg.h>
46 1.1 bsh
47 1.1 bsh /*
48 1.1 bsh * Memory Map
49 1.1 bsh */
50 1.1 bsh #define S3C2410_BANK_SIZE 0x08000000
51 1.1 bsh #define S3C2410_BANK_START(n) (S3C2410_BANK_SIZE*(n))
52 1.1 bsh #define S3C2410_SDRAM_START S3C2410_BANK_START(6)
53 1.1 bsh
54 1.1 bsh /*
55 1.1 bsh * Physical address of integrated peripherals
56 1.1 bsh */
57 1.1 bsh #define S3C2410_MEMCTL_BASE 0x48000000 /* memory controller */
58 1.1 bsh #define S3C2410_MEMCTL_SIZE 0x34
59 1.1 bsh #define S3C2410_USBHC_BASE 0x49000000 /* USB Host controller */
60 1.1 bsh #define S3C2410_USBHC_SIZE 0x5c
61 1.1 bsh #define S3C2410_INTCTL_BASE 0x4a000000 /* Interrupt controller */
62 1.1 bsh #define S3C2410_INTCTL_SIZE 0x20
63 1.1 bsh #define S3C2410_DMAC_BASE 0x4b000000
64 1.1 bsh #define S3C2410_DMAC_SIZE 0xe4
65 1.1 bsh #define S3C2410_CLKMAN_BASE 0x4c000000 /* clock & power management */
66 1.1 bsh #define S3C2410_CLKMAN_SIZE 0x18
67 1.1 bsh #define S3C2410_LCDC_BASE 0x4d000000 /* LCD controller */
68 1.1 bsh #define S3C2410_LCDC_SIZE 0x64
69 1.1 bsh #define S3C2410_NANDFC_BASE 0x4e000000 /* NAND Flash controller */
70 1.1 bsh #define S3C2410_NANDFC_SIZE 0x18
71 1.1 bsh #define S3C2410_UART0_BASE 0x50000000
72 1.1 bsh #define S3C2410_UART_BASE(n) (S3C2410_UART0_BASE+0x4000*(n))
73 1.1 bsh #define S3C2410_UART_SIZE 0x2c
74 1.1 bsh #define S3C2410_TIMER_BASE 0x51000000
75 1.1 bsh #define S3C2410_TIMER_SIZE 0x44
76 1.1 bsh #define S3C2410_USBDC_BASE 0x5200140
77 1.1 bsh #define S3C2410_USBDC_SIZE 0x130
78 1.1 bsh #define S3C2410_WDT_BASE 0x53000000
79 1.1 bsh #define S3C2410_WDT_SIZE 0x0c
80 1.1 bsh #define S3C2410_IIC_BASE 0x54000000
81 1.1 bsh #define S3C2410_IIC_SIZE 0x0c
82 1.1 bsh #define S3C2410_IIS_BASE 0x55000000
83 1.1 bsh #define S3C2410_IIS_SIZE 0x14
84 1.1 bsh #define S3C2410_GPIO_BASE 0x56000000
85 1.1 bsh #define S3C2410_GPIO_SIZE 0xb4
86 1.1 bsh #define S3C2410_ADC_BASE 0x58000000
87 1.1 bsh #define S3C2410_ADC_SIZE 0x14
88 1.1 bsh #define S3C2410_SPI0_BASE 0x59000000
89 1.1 bsh #define S3C2410_SPI1_BASE 0x59000020
90 1.1 bsh #define S3C2410_SPI1_SIZE 0x18
91 1.1 bsh #define S3C2410_SDI_BASE 0x5a000000 /* SD Interface */
92 1.1 bsh #define S3C2410_SDI_SIZE 0x44
93 1.1 bsh
94 1.1 bsh /* interrupt control (additional defs for 2410) */
95 1.1 bsh #define ICU_LEN (32+11)
96 1.1 bsh
97 1.1 bsh #define INTCTL_SUBSRCPND 0x18 /* sub source pending (2410 only) */
98 1.1 bsh #define INTCTL_INTSUBMSK 0x1c /* sub mask (2410 only) */
99 1.1 bsh
100 1.1 bsh /* 2410 has more than 32 interrupt sources. These are sub-sources
101 1.1 bsh * that are OR-ed into main interrupt sources, and controlled via
102 1.1 bsh * SUBSRCPND and SUBSRCMSK registers */
103 1.1 bsh
104 1.1 bsh #define S3C2410_SUBIRQ_MIN 32
105 1.1 bsh #define S3C2410_SUBIRQ_MAX (32+10)
106 1.1 bsh
107 1.1 bsh /* cascaded to INT_ADCTC */
108 1.1 bsh #define S3C2410_INT_ADC (S3C2410_SUBIRQ_MIN+10) /* AD converter */
109 1.1 bsh #define S3C2410_INT_TC (S3C2410_SUBIRQ_MIN+9) /* Touch screen */
110 1.1 bsh /* cascaded to INT_UART2 */
111 1.1 bsh #define S3C2410_INT_ERR2 (S3C2410_SUBIRQ_MIN+8) /* UART2 Error interrupt */
112 1.1 bsh #define S3C2410_INT_TXD2 (S3C2410_SUBIRQ_MIN+7) /* UART2 Tx interrupt */
113 1.1 bsh #define S3C2410_INT_RXD2 (S3C2410_SUBIRQ_MIN+6) /* UART2 Rx interrupt */
114 1.1 bsh /* cascaded to INT_UART1 */
115 1.2 bsh #define S3C2410_INT_ERR1 (S3C2410_SUBIRQ_MIN+5) /* UART1 Error interrupt */
116 1.2 bsh #define S3C2410_INT_TXD1 (S3C2410_SUBIRQ_MIN+4) /* UART1 Tx interrupt */
117 1.2 bsh #define S3C2410_INT_RXD1 (S3C2410_SUBIRQ_MIN+3) /* UART1 Rx interrupt */
118 1.1 bsh /* cascaded to INT_UART0 */
119 1.2 bsh #define S3C2410_INT_ERR0 (S3C2410_SUBIRQ_MIN+2) /* UART0 Error interrupt */
120 1.2 bsh #define S3C2410_INT_TXD0 (S3C2410_SUBIRQ_MIN+1) /* UART0 Tx interrupt */
121 1.2 bsh #define S3C2410_INT_RXD0 (S3C2410_SUBIRQ_MIN+0) /* UART0 Rx interrupt */
122 1.1 bsh
123 1.1 bsh
124 1.1 bsh /* Clock control: CLKCON register */
125 1.1 bsh #define CLKCON_SPI (1<<18)
126 1.1 bsh #define CLKCON_IIS (1<<17)
127 1.1 bsh #define CLKCON_IIC (1<<16)
128 1.1 bsh #define CLKCON_ADC (1<<15)
129 1.1 bsh #define CLKCON_RTC (1<<14)
130 1.1 bsh #define CLKCON_GPIO (1<<13)
131 1.1 bsh #define CLKCON_UART2 (1<<12)
132 1.1 bsh #define CLKCON_UART1 (1<<11)
133 1.1 bsh #define CLKCON_UART0 (1<<10) /* PCLK to UART0 */
134 1.1 bsh #define CLKCON_SDI (1<<9)
135 1.1 bsh #define CLKCON_TIMER (1<<8) /* PCLK to TIMER */
136 1.1 bsh #define CLKCON_USBD (1<<7) /* PCLK to USB device controller */
137 1.1 bsh #define CLKCON_USBH (1<<6) /* PCLK to USB host controller */
138 1.1 bsh #define CLKCON_LCDC (1<<5) /* PCLK to LCD controller */
139 1.1 bsh #define CLKCON_NANDFC (1<<4) /* PCLK to NAND Flash controller */
140 1.1 bsh #define CLKCON_IDLE (1<<2) /* 1=transition to IDLE mode */
141 1.1 bsh #define CLKCON_STOP (1<<0) /* 1=transition to STOP mode */
142 1.1 bsh
143 1.1 bsh /* NAND Flash controller */
144 1.1 bsh #define NANDFC_NFCONF 0x00 /* Configuration */
145 1.1 bsh #define NANDFC_NFCMD 0x04 /* command */
146 1.1 bsh #define NANDFC_NFADDR 0x08 /* address */
147 1.1 bsh #define NANDFC_NFDATA 0x0c /* data */
148 1.1 bsh #define NANDFC_NFSTAT 0x10 /* operation status */
149 1.1 bsh #define NANDFC_NFECC 0x14 /* ecc */
150 1.1 bsh
151 1.1 bsh /* GPIO */
152 1.1 bsh #define GPIO_PACON 0x00 /* port A configuration */
153 1.1 bsh #define PCON_INPUT 0 /* Input port */
154 1.1 bsh #define PCON_OUTPUT 1 /* Output port */
155 1.1 bsh #define PCON_ALTFUN 2 /* Alternate function */
156 1.1 bsh #define GPIO_PADAT 0x04 /* port A data */
157 1.1 bsh #define GPIO_PBCON 0x10
158 1.1 bsh #define GPIO_PBDAT 0x14
159 1.1 bsh #define GPIO_PBUP 0x18
160 1.1 bsh #define GPIO_PCCON 0x20
161 1.1 bsh #define GPIO_PCDAT 0x24
162 1.1 bsh #define GPIO_PCUP 0x28
163 1.1 bsh #define GPIO_PDCON 0x30
164 1.1 bsh #define GPIO_PDDAT 0x34
165 1.1 bsh #define GPIO_PDUP 0x38
166 1.1 bsh #define GPIO_PECON 0x40
167 1.1 bsh #define GPIO_PEDAT 0x44
168 1.1 bsh #define GPIO_PEUP 0x48
169 1.1 bsh #define GPIO_PFCON 0x50
170 1.1 bsh #define GPIO_PFDAT 0x54
171 1.1 bsh #define GPIO_PFUP 0x58
172 1.1 bsh #define GPIO_PGCON 0x60
173 1.1 bsh #define GPIO_PGDAT 0x64
174 1.1 bsh #define GPIO_PGUP 0x68
175 1.1 bsh #define GPIO_PHCON 0x70
176 1.1 bsh #define GPIO_PHDAT 0x74
177 1.1 bsh #define GPIO_PHUP 0x78
178 1.1 bsh #define GPIO_MISCCR 0x80 /* miscellaneous control */
179 1.1 bsh #define GPIO_DCLKCON 0x84 /* DCLK 0/1 */
180 1.1 bsh #define GPIO_EXTINT(n) (0x88+4*(n)) /* external int control 0/1/2 */
181 1.1 bsh #define GPIO_EINTFLT(n) (0x94+4*(n)) /* external int filter control 0..3 */
182 1.1 bsh #define GPIO_EINTMASK 0xa4
183 1.1 bsh #define GPIO_EINTPEND 0xa8
184 1.1 bsh #define GPIO_GSTATUS0 0xac /* external pin status */
185 1.1 bsh #define GPIO_GSTATUS1 0xb0 /* external pin status */
186 1.1 bsh
187 1.1 bsh #define EXTINTR_LOW 0x00
188 1.1 bsh #define EXTINTR_HIGH 0x01
189 1.1 bsh #define EXTINTR_FALLING 0x02
190 1.1 bsh #define EXTINTR_RISING 0x04
191 1.1 bsh #define EXTINTR_BOTH 0x06
192 1.1 bsh
193 1.1 bsh /* SD interface */
194 1.1 bsh /* XXX */
195 1.1 bsh
196 1.1 bsh #endif /* _ARM_S3C2XX0_S3C2410REG_H_ */
197