Use different read and write buffer sizes. Due to interaction between common transfer...
[kugel-rb.git] / firmware / export / tcc77x.h
blob5346e585aae02a4c0a661cb094841208f7913fa8
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 Dave Chapman
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef __TCC77X_H__
22 #define __TCC77X_H__
24 /* General-purpose IO */
26 #define GPIOA (*(volatile unsigned long *)0x80000300)
27 #define GPIOB (*(volatile unsigned long *)0x80000310)
28 #define GPIOC (*(volatile unsigned long *)0x80000320)
29 #define GPIOD (*(volatile unsigned long *)0x80000330)
30 #define GPIOE (*(volatile unsigned long *)0x80000340)
32 #define GPIOA_DIR (*(volatile unsigned long *)0x80000304)
33 #define GPIOB_DIR (*(volatile unsigned long *)0x80000314)
34 #define GPIOC_DIR (*(volatile unsigned long *)0x80000324)
35 #define GPIOD_DIR (*(volatile unsigned long *)0x80000334)
36 #define GPIOE_DIR (*(volatile unsigned long *)0x80000344)
38 #define GPIOA_FUNC (*(volatile unsigned long *)0x80000308)
39 #define GPIOB_FUNC (*(volatile unsigned long *)0x80000318)
40 #define GPIOC_FUNC (*(volatile unsigned long *)0x80000328)
41 #define GPIOD_FUNC (*(volatile unsigned long *)0x80000338)
42 #define GPIOE_FUNC (*(volatile unsigned long *)0x80000348)
44 #define BMI (*(volatile unsigned long *)0x80000364)
46 /* Clock Generator */
48 #define CLKCTRL (*(volatile unsigned long *)0x80000400)
49 #define PLL0CFG (*(volatile unsigned long *)0x80000404)
50 #define CLKDIVC (*(volatile unsigned long *)0x8000040c)
51 #define MODECTR (*(volatile unsigned long *)0x80000410)
52 #define BCLKCTR (*(volatile unsigned long *)0x80000414)
53 #define SWRESET (*(volatile unsigned long *)0x80000418)
54 #define PCLKCFG0 (*(volatile unsigned long *)0x8000041c)
55 #define PCLKCFG1 (*(volatile unsigned long *)0x80000420)
56 #define PCLKCFG2 (*(volatile unsigned long *)0x80000424)
57 #define PCLKCFG3 (*(volatile unsigned long *)0x80000428)
58 #define PCLKCFG4 (*(volatile unsigned long *)0x8000042c)
59 #define PCLKCFG5 (*(volatile unsigned long *)0x80000430)
60 #define PCLKCFG6 (*(volatile unsigned long *)0x80000434)
62 #define PCLK_DAI PCLKCFG6
64 /* Device bits for SWRESET & BCLKCTR */
66 #define DEV_DAI (1<<0)
67 #define DEV_USBD (1<<4)
68 #define DEV_ECC (1<<9)
69 #define DEV_NAND (1<<16)
71 /* ADC */
73 #define ADCCON (*(volatile unsigned long *)0x80000a00)
74 #define ADCDATA (*(volatile unsigned long *)0x80000a04)
75 #define ADCCONA (*(volatile unsigned long *)0x80000a80)
76 #define ADCSTATUS (*(volatile unsigned long *)0x80000a84)
77 #define ADCCFG (*(volatile unsigned long *)0x80000a88)
80 /* Memory Controller */
81 #define SDCFG (*(volatile unsigned long *)0xf0000000)
82 #define SDFSM (*(volatile unsigned long *)0xf0000004)
83 #define MCFG (*(volatile unsigned long *)0xf0000008)
84 #define TST (*(volatile unsigned long *)0xf000000c)
85 #define CSCFG0 (*(volatile unsigned long *)0xf0000010)
86 #define CSCFG1 (*(volatile unsigned long *)0xf0000014)
87 #define CSCFG2 (*(volatile unsigned long *)0xf0000018)
88 #define CSCFG3 (*(volatile unsigned long *)0xf000001c)
89 #define CLKCFG (*(volatile unsigned long *)0xf0000020)
90 #define SDCMD (*(volatile unsigned long *)0xf0000024)
93 /* IRQ Controller */
94 #define EXT0_IRQ_MASK (1<<0)
95 #define EXT1_IRQ_MASK (1<<1)
96 #define EXT2_IRQ_MASK (1<<2)
97 #define EXT3_IRQ_MASK (1<<3)
98 #define I2SR_IRQ_MASK (1<<4)
99 #define I2ST_IRQ_MASK (1<<5)
100 #define TIMER0_IRQ_MASK (1<<6)
101 #define USBD_IRQ_MASK (1<<8) /* USB 2.0 device */
102 #define USBH_IRQ_MASK (1<<10) /* USB 1.1 host */
103 #define ADC_IRQ_MASK (1<<16)
104 #define USB_DMA_IRQ_MASK (1<<26) /* USB DMA */
105 #define ECC_IRQ_MASK (1<<27)
107 #define DAI_RX_IRQ_MASK I2SR_IRQ_MASK
108 #define DAI_TX_IRQ_MASK I2ST_IRQ_MASK
110 #define USB_DMA_IRQ_MASK (1<<26) /* USB DMA */
112 #define IEN (*(volatile unsigned long *)0x80000100)
113 #define CREQ (*(volatile unsigned long *)0x80000104)
114 #define IREQ (*(volatile unsigned long *)0x80000108)
115 #define IRQSEL (*(volatile unsigned long *)0x8000010c)
116 #define ICFG (*(volatile unsigned long *)0x80000110)
117 #define MREQ (*(volatile unsigned long *)0x80000114)
118 #define TSTREQ (*(volatile unsigned long *)0x80000118)
119 #define IRQ (*(volatile unsigned long *)0x80000120)
120 #define FIQ (*(volatile unsigned long *)0x80000124)
121 #define MIRQ (*(volatile unsigned long *)0x80000128)
122 #define MFIQ (*(volatile unsigned long *)0x8000012c)
123 #define TMODE (*(volatile unsigned long *)0x80000130)
124 #define SYNC (*(volatile unsigned long *)0x80000134)
125 #define WKUP (*(volatile unsigned long *)0x80000138)
127 /* Timer Controller */
129 #define TCFG0 (*(volatile unsigned long *)0x80000200)
130 #define TCNT0 (*(volatile unsigned long *)0x80000204)
131 #define TREF0 (*(volatile unsigned long *)0x80000208)
132 #define TMREF0 (*(volatile unsigned long *)0x8000020c)
133 #define TCFG1 (*(volatile unsigned long *)0x80000210)
134 #define TCNT1 (*(volatile unsigned long *)0x80000214)
135 #define TREF1 (*(volatile unsigned long *)0x80000218)
136 #define TMREF1 (*(volatile unsigned long *)0x8000021c)
137 #define TCFG2 (*(volatile unsigned long *)0x80000220)
138 #define TCNT2 (*(volatile unsigned long *)0x80000224)
139 #define TREF2 (*(volatile unsigned long *)0x80000228)
140 #define TMREF2 (*(volatile unsigned long *)0x8000022c)
141 #define TCFG3 (*(volatile unsigned long *)0x80000230)
142 #define TCNT3 (*(volatile unsigned long *)0x80000234)
143 #define TREF3 (*(volatile unsigned long *)0x80000238)
144 #define TMREF3 (*(volatile unsigned long *)0x8000023c)
145 #define TCFG4 (*(volatile unsigned long *)0x80000240)
146 #define TCNT4 (*(volatile unsigned long *)0x80000244)
147 #define TREF4 (*(volatile unsigned long *)0x80000248)
148 #define TCFG5 (*(volatile unsigned long *)0x80000250)
149 #define TCNT5 (*(volatile unsigned long *)0x80000254)
150 #define TREF5 (*(volatile unsigned long *)0x80000258)
151 #define TIREQ (*(volatile unsigned long *)0x80000260)
152 #define TWDCFG (*(volatile unsigned long *)0x80000270)
153 #define TWDCLR (*(volatile unsigned long *)0x80000274)
154 #define TC32EN (*(volatile unsigned long *)0x80000280)
155 #define TC32LDV (*(volatile unsigned long *)0x80000284)
156 #define TC32CMP0 (*(volatile unsigned long *)0x80000288)
157 #define TC32CMP1 (*(volatile unsigned long *)0x8000028c)
158 #define TC32PCNT (*(volatile unsigned long *)0x80000290)
159 #define TC32MCNT (*(volatile unsigned long *)0x80000294)
160 #define TC32IRQ (*(volatile unsigned long *)0x80000298)
162 /* TIREQ flags */
163 #define TF0 (1<<8) /* Timer 0 reference value reached */
164 #define TF1 (1<<9) /* Timer 1 reference value reached */
165 #define TI0 (1<<0) /* Timer 0 IRQ flag */
166 #define TI1 (1<<1) /* Timer 1 IRQ flag */
168 /* NAND Flash Controller */
170 #define NFC_CMD (*(volatile unsigned long *)0x90000000)
171 #define NFC_SADDR (*(volatile unsigned long *)0x9000000C)
172 #define NFC_SDATA (*(volatile unsigned long *)0x90000040)
173 #define NFC_WDATA (*(volatile unsigned long *)0x90000010)
174 #define NFC_CTRL (*(volatile unsigned long *)0x90000050)
175 #define NFC_16BIT (1<<26)
176 #define NFC_CS0 (1<<23)
177 #define NFC_CS1 (1<<22)
178 #define NFC_READY (1<<20)
179 #define NFC_IREQ (*(volatile unsigned long *)0x90000060)
180 #define NFC_RST (*(volatile unsigned long *)0x90000064)
183 /* ECC controller */
185 #define ECC_CTRL (*(volatile unsigned long *)0x80000900)
186 #define ECC_DMA_REQ (1<<28)
187 #define ECC_ENC (1<<27) /* MLC ECC3/4 */
188 #define ECC_FLG (1<<26)
189 #define ECC_IEN (1<<25)
190 #define ECC_MANUAL (1<<22)
191 #define ECC_WCNT (1<<12) /* [21:12] */
192 #define ECC_HOLD (1<<7)
193 #define ECC_M4EN (1<<6)
194 #define ECC_ZERO (1<<5)
195 #define ECC_M3EN (1<<4)
196 #define ECC_CNT_MASK (7<<1)
197 #define ECC_CNT (1<<1)
198 #define ECC_SLC (1<<0)
200 #define ECC_BASE (*(volatile unsigned long *)0x80000904)
201 #define ECC_MASK (*(volatile unsigned long *)0x80000908)
202 #define ECC_CLR (*(volatile unsigned long *)0x8000090c)
203 #define SLC_ECC0 (*(volatile unsigned long *)0x80000910)
204 #define SLC_ECC1 (*(volatile unsigned long *)0x80000914)
205 #define SLC_ECC2 (*(volatile unsigned long *)0x80000918)
206 #define SLC_ECC3 (*(volatile unsigned long *)0x8000091c)
207 #define SLC_ECC4 (*(volatile unsigned long *)0x80000920)
208 #define SLC_ECC5 (*(volatile unsigned long *)0x80000924)
209 #define SLC_ECC6 (*(volatile unsigned long *)0x80000928)
210 #define SLC_ECC7 (*(volatile unsigned long *)0x8000092c)
211 #define MLC_ECC0W (*(volatile unsigned long *)0x80000930)
212 #define MLC_ECC1W (*(volatile unsigned long *)0x80000934)
213 #define MLC_ECC2W (*(volatile unsigned long *)0x80000938)
214 #define MLC_ECC0R (*(volatile unsigned long *)0x80000940)
215 #define MLC_ECC1R (*(volatile unsigned long *)0x80000944)
216 #define MLC_ECC2R (*(volatile unsigned long *)0x80000948)
217 #define ECC_CORR_START (*(volatile unsigned long *)0x8000094c)
218 #define ECC_ERRADDR1 (*(volatile unsigned long *)0x80000950)
219 #define ECC_ERRADDR2 (*(volatile unsigned long *)0x80000954)
220 #define ECC_ERRADDR3 (*(volatile unsigned long *)0x80000958)
221 #define ECC_ERRADDR4 (*(volatile unsigned long *)0x8000095c)
222 #define ECC_ERRDATA1 (*(volatile unsigned long *)0x80000960)
223 #define ECC_ERRDATA2 (*(volatile unsigned long *)0x80000964)
224 #define ECC_ERRDATA3 (*(volatile unsigned long *)0x80000968)
225 #define ECC_ERRDATA4 (*(volatile unsigned long *)0x8000096c)
226 #define ECC_ERR_NUM (*(volatile unsigned long *)0x80000970)
228 #define ECC_ERRDATA(x) (*(volatile unsigned long *)(0x80000960 + (x) * 4))
229 #define ECC_ERRADDR(x) (*(volatile unsigned long *)(0x80000950 + (x) * 4))
231 /* Digital Audio Interface */
232 #define DADI_L0 (*(volatile unsigned long *)0x80000000)
233 #define DADI_R0 (*(volatile unsigned long *)0x80000004)
234 #define DADI_L1 (*(volatile unsigned long *)0x80000008)
235 #define DADI_R1 (*(volatile unsigned long *)0x8000000C)
236 #define DADI_L2 (*(volatile unsigned long *)0x80000010)
237 #define DADI_R2 (*(volatile unsigned long *)0x80000014)
238 #define DADI_L3 (*(volatile unsigned long *)0x80000018)
239 #define DADI_R3 (*(volatile unsigned long *)0x8000001c)
241 #define DADO_L0 (*(volatile unsigned long *)0x80000020)
242 #define DADO_R0 (*(volatile unsigned long *)0x80000024)
243 #define DADO_L1 (*(volatile unsigned long *)0x80000028)
244 #define DADO_R1 (*(volatile unsigned long *)0x8000002C)
245 #define DADO_L2 (*(volatile unsigned long *)0x80000030)
246 #define DADO_R2 (*(volatile unsigned long *)0x80000034)
247 #define DADO_L3 (*(volatile unsigned long *)0x80000038)
248 #define DADO_R3 (*(volatile unsigned long *)0x8000003c)
250 #define DAMR (*(volatile unsigned long *)0x80000040)
251 #define DAVC (*(volatile unsigned long *)0x80000044)
253 #define DADI_L(x) (*(volatile unsigned long *)(0x80000000 + (x) * 8))
254 #define DADI_R(x) (*(volatile unsigned long *)(0x80000004 + (x) * 8))
255 #define DADO_L(x) (*(volatile unsigned long *)(0x80000020 + (x) * 8))
256 #define DADO_R(x) (*(volatile unsigned long *)(0x80000024 + (x) * 8))
258 /* USB 2.0 device system MMR base address */
259 #define USB_BASE 0x90000b00
261 #define USB_NUM_ENDPOINTS 3
262 #define USB_DEVBSS_ATTR IBSS_ATTR
264 #endif