1 diff --git a/Makefile b/Makefile
2 index e557d0d..3eac691 100644
5 @@ -141,7 +141,7 @@ ifeq ($(ARCH),ppc)
6 CROSS_COMPILE = ppc_8xx-
9 -CROSS_COMPILE = arm-linux-
10 +CROSS_COMPILE = arm-none-linux-gnueabi-
13 CROSS_COMPILE = i386-linux-
14 @@ -253,7 +253,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
15 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
18 -PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
19 +PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc -lgcc_eh
21 # The "tools" are needed early, so put this first
22 # Don't include stuff already done in $(LIBS)
23 @@ -2569,6 +2569,12 @@ SMN42_config : unconfig
24 @$(MKCONFIG) $(@:_config=) arm arm720t SMN42 siemens lpc2292
26 #########################################################################
27 +## ARM CORTEX Systems
28 +#########################################################################
29 +omap3530beagle_config : unconfig
30 + @./mkconfig $(@:_config=) arm omap3 omap3530beagle
32 +#########################################################################
34 #########################################################################
36 diff --git a/board/omap3530beagle/Makefile b/board/omap3530beagle/Makefile
38 index 0000000..7065345
40 +++ b/board/omap3530beagle/Makefile
43 +# (C) Copyright 2000, 2001, 2002
44 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
46 +# See file CREDITS for list of people who contributed to this
49 +# This program is free software; you can redistribute it and/or
50 +# modify it under the terms of the GNU General Public License as
51 +# published by the Free Software Foundation; either version 2 of
52 +# the License, or (at your option) any later version.
54 +# This program is distributed in the hope that it will be useful,
55 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
56 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57 +# GNU General Public License for more details.
59 +# You should have received a copy of the GNU General Public License
60 +# along with this program; if not, write to the Free Software
61 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
65 +include $(TOPDIR)/config.mk
69 +OBJS := omap3530beagle.o mem.o clock.o syslib.o sys_info.o nand.o
70 +SOBJS := lowlevel_init.o
72 +$(LIB): $(OBJS) $(SOBJS)
76 + rm -f $(SOBJS) $(OBJS)
79 + rm -f $(LIB) core *.bak .depend
81 +#########################################################################
83 +.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
84 + $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
88 +#########################################################################
89 diff --git a/board/omap3530beagle/clock.c b/board/omap3530beagle/clock.c
91 index 0000000..1f4b4f3
93 +++ b/board/omap3530beagle/clock.c
96 + * (C) Copyright 2008
97 + * Texas Instruments, <www.ti.com>
100 + * Sunil Kumar <sunilsaini05@gmail.com>
101 + * Shashi Ranjan <shashiranjanmca05@gmail.com>
103 + * Derived from Beagle Board and OMAP3 SDP code by
104 + * Richard Woodruff <r-woodruff2@ti.com>
105 + * Syed Mohammed Khasim <khasim@ti.com>
107 + * This program is free software; you can redistribute it and/or
108 + * modify it under the terms of the GNU General Public License as
109 + * published by the Free Software Foundation; either version 2 of
110 + * the License, or (at your option) any later version.
112 + * This program is distributed in the hope that it will be useful,
113 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
114 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
115 + * GNU General Public License for more details.
117 + * You should have received a copy of the GNU General Public License
118 + * along with this program; if not, write to the Free Software
119 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
120 + * MA 02111-1307 USA
125 +#include <asm/arch/bits.h>
126 +#include <asm/arch/clocks.h>
127 +#include <asm/arch/clocks_omap3.h>
128 +#include <asm/arch/mem.h>
129 +#include <asm/arch/sys_proto.h>
130 +#include <environment.h>
131 +#include <command.h>
133 +/******************************************************************************
134 + * get_sys_clk_speed() - determine reference oscillator speed
135 + * based on known 32kHz clock and gptimer.
136 + *****************************************************************************/
137 +u32 get_osc_clk_speed(void)
139 + u32 start, cstart, cend, cdiff, val;
141 + val = __raw_readl(PRM_CLKSRC_CTRL);
143 + /* If SYS_CLK is being divided by 2, remove for now */
144 + val = (val & (~BIT7)) | BIT6;
145 + __raw_writel(val, PRM_CLKSRC_CTRL);
147 + /* enable timer2 */
148 + val = __raw_readl(CM_CLKSEL_WKUP) | BIT0;
149 + __raw_writel(val, CM_CLKSEL_WKUP); /* select sys_clk for GPT1 */
151 + /* Enable I and F Clocks for GPT1 */
152 + val = __raw_readl(CM_ICLKEN_WKUP) | BIT0 | BIT2;
153 + __raw_writel(val, CM_ICLKEN_WKUP);
154 + val = __raw_readl(CM_FCLKEN_WKUP) | BIT0;
155 + __raw_writel(val, CM_FCLKEN_WKUP);
157 + __raw_writel(0, OMAP34XX_GPT1 + TLDR); /* start counting at 0 */
158 + __raw_writel(GPT_EN, OMAP34XX_GPT1 + TCLR); /* enable clock */
160 + /* enable 32kHz source, determine sys_clk via gauging */
161 + start = 20 + __raw_readl(S32K_CR); /* start time in 20 cycles */
162 + while (__raw_readl(S32K_CR) < start) ; /* dead loop till start time */
163 + /* get start sys_clk count */
164 + cstart = __raw_readl(OMAP34XX_GPT1 + TCRR);
165 + /* wait for 40 cycles */
166 + while (__raw_readl(S32K_CR) < (start + 20)) ;
167 + cend = __raw_readl(OMAP34XX_GPT1 + TCRR); /* get end sys_clk count */
168 + cdiff = cend - cstart; /* get elapsed ticks */
170 + /* based on number of ticks assign speed */
173 + else if (cdiff > 15200)
175 + else if (cdiff > 13000)
177 + else if (cdiff > 9000)
179 + else if (cdiff > 7600)
185 +/******************************************************************************
186 + * get_sys_clkin_sel() - returns the sys_clkin_sel field value based on
187 + * input oscillator clock frequency.
188 + *****************************************************************************/
189 +void get_sys_clkin_sel(u32 osc_clk, u32 *sys_clkin_sel)
191 + if (osc_clk == S38_4M)
192 + *sys_clkin_sel = 4;
193 + else if (osc_clk == S26M)
194 + *sys_clkin_sel = 3;
195 + else if (osc_clk == S19_2M)
196 + *sys_clkin_sel = 2;
197 + else if (osc_clk == S13M)
198 + *sys_clkin_sel = 1;
199 + else if (osc_clk == S12M)
200 + *sys_clkin_sel = 0;
203 +/******************************************************************************
204 + * prcm_init() - inits clocks for PRCM as defined in clocks.h
205 + * called from SRAM, or Flash (using temp SRAM stack).
206 + *****************************************************************************/
207 +void prcm_init(void)
209 + void (*f_lock_pll) (u32, u32, u32, u32);
210 + int xip_safe, p0, p1, p2, p3;
211 + u32 osc_clk = 0, sys_clkin_sel;
212 + u32 clk_index, sil_index;
213 + dpll_param *dpll_param_p;
215 + f_lock_pll = (void *) ((u32) &_end_vect - (u32) &_start +
218 + xip_safe = running_in_sram();
220 + /* Gauge the input clock speed and find out the sys_clkin_sel
221 + * value corresponding to the input clock.
223 + osc_clk = get_osc_clk_speed();
224 + get_sys_clkin_sel(osc_clk, &sys_clkin_sel);
226 + sr32(PRM_CLKSEL, 0, 3, sys_clkin_sel); /* set input crystal speed */
228 + /* If the input clock is greater than 19.2M always divide/2 */
229 + if (sys_clkin_sel > 2) {
230 + sr32(PRM_CLKSRC_CTRL, 6, 2, 2); /* input clock divider */
231 + clk_index = sys_clkin_sel / 2;
233 + sr32(PRM_CLKSRC_CTRL, 6, 2, 1); /* input clock divider */
234 + clk_index = sys_clkin_sel;
237 + /* The DPLL tables are defined according to sysclk value and
238 + * silicon revision. The clk_index value will be used to get
239 + * the values for that input sysclk from the DPLL param table
240 + * and sil_index will get the values for that SysClk for the
241 + * appropriate silicon rev.
243 + sil_index = get_cpu_rev() - 1;
244 + /* Unlock MPU DPLL (slows things down, and needed later) */
245 + sr32(CM_CLKEN_PLL_MPU, 0, 3, PLL_LOW_POWER_BYPASS);
246 + wait_on_value(BIT0, 0, CM_IDLEST_PLL_MPU, LDELAY);
248 + /* Getting the base address of Core DPLL param table */
249 + dpll_param_p = (dpll_param *) get_core_dpll_param();
250 + /* Moving it to the right sysclk and ES rev base */
251 + dpll_param_p = dpll_param_p + 3 * clk_index + sil_index;
254 + /* sr32(CM_CLKSEL2_EMU) set override to work when asleep */
255 + sr32(CM_CLKEN_PLL, 0, 3, PLL_FAST_RELOCK_BYPASS);
256 + wait_on_value(BIT0, 0, CM_IDLEST_CKGEN, LDELAY);
257 + /* For OMAP3 ES1.0 Errata 1.50, default value directly doesnt
258 + work. write another value and then default value. */
259 + sr32(CM_CLKSEL1_EMU, 16, 5, CORE_M3X2 + 1); /* m3x2 */
260 + sr32(CM_CLKSEL1_EMU, 16, 5, CORE_M3X2); /* m3x2 */
261 + sr32(CM_CLKSEL1_PLL, 27, 2, dpll_param_p->m2); /* Set M2 */
262 + sr32(CM_CLKSEL1_PLL, 16, 11, dpll_param_p->m); /* Set M */
263 + sr32(CM_CLKSEL1_PLL, 8, 7, dpll_param_p->n); /* Set N */
264 + sr32(CM_CLKSEL1_PLL, 6, 1, 0); /* 96M Src */
265 + sr32(CM_CLKSEL_CORE, 8, 4, CORE_SSI_DIV); /* ssi */
266 + sr32(CM_CLKSEL_CORE, 4, 2, CORE_FUSB_DIV); /* fsusb */
267 + sr32(CM_CLKSEL_CORE, 2, 2, CORE_L4_DIV); /* l4 */
268 + sr32(CM_CLKSEL_CORE, 0, 2, CORE_L3_DIV); /* l3 */
269 + sr32(CM_CLKSEL_GFX, 0, 3, GFX_DIV); /* gfx */
270 + sr32(CM_CLKSEL_WKUP, 1, 2, WKUP_RSM); /* reset mgr */
271 + sr32(CM_CLKEN_PLL, 4, 4, dpll_param_p->fsel); /* FREQSEL */
272 + sr32(CM_CLKEN_PLL, 0, 3, PLL_LOCK); /* lock mode */
273 + wait_on_value(BIT0, 1, CM_IDLEST_CKGEN, LDELAY);
274 + } else if (running_in_flash()) {
275 + /* if running from flash, jump to small relocated code
277 + p0 = __raw_readl(CM_CLKEN_PLL);
278 + sr32((u32) &p0, 0, 3, PLL_FAST_RELOCK_BYPASS);
279 + sr32((u32) &p0, 4, 4, dpll_param_p->fsel); /* FREQSEL */
281 + p1 = __raw_readl(CM_CLKSEL1_PLL);
282 + sr32((u32) &p1, 27, 2, dpll_param_p->m2); /* Set M2 */
283 + sr32((u32) &p1, 16, 11, dpll_param_p->m); /* Set M */
284 + sr32((u32) &p1, 8, 7, dpll_param_p->n); /* Set N */
285 + sr32((u32) &p1, 6, 1, 0); /* set source for 96M */
286 + p2 = __raw_readl(CM_CLKSEL_CORE);
287 + sr32((u32) &p2, 8, 4, CORE_SSI_DIV); /* ssi */
288 + sr32((u32) &p2, 4, 2, CORE_FUSB_DIV); /* fsusb */
289 + sr32((u32) &p2, 2, 2, CORE_L4_DIV); /* l4 */
290 + sr32((u32) &p2, 0, 2, CORE_L3_DIV); /* l3 */
292 + p3 = CM_IDLEST_CKGEN;
294 + (*f_lock_pll) (p0, p1, p2, p3);
298 + sr32(CM_CLKEN_PLL, 16, 3, PLL_STOP);
299 + wait_on_value(BIT1, 0, CM_IDLEST_CKGEN, LDELAY);
301 + /* Getting the base address to PER DPLL param table */
303 + dpll_param_p = (dpll_param *) get_per_dpll_param();
304 + /* Moving it to the right sysclk base */
305 + dpll_param_p = dpll_param_p + clk_index;
306 + /* Errata 1.50 Workaround for OMAP3 ES1.0 only */
307 + /* If using default divisors, write default divisor + 1
308 + and then the actual divisor value */
309 + /* Need to change it to silicon and revision check */
311 + sr32(CM_CLKSEL1_EMU, 24, 5, PER_M6X2 + 1); /* set M6 */
312 + sr32(CM_CLKSEL1_EMU, 24, 5, PER_M6X2); /* set M6 */
313 + sr32(CM_CLKSEL_CAM, 0, 5, PER_M5X2 + 1); /* set M5 */
314 + sr32(CM_CLKSEL_CAM, 0, 5, PER_M5X2); /* set M5 */
315 + sr32(CM_CLKSEL_DSS, 0, 5, PER_M4X2 + 1); /* set M4 */
316 + sr32(CM_CLKSEL_DSS, 0, 5, PER_M4X2); /* set M4 */
317 + sr32(CM_CLKSEL_DSS, 8, 5, PER_M3X2 + 1); /* set M3 */
318 + sr32(CM_CLKSEL_DSS, 8, 5, PER_M3X2); /* set M3 */
319 + sr32(CM_CLKSEL3_PLL, 0, 5, dpll_param_p->m2 + 1); /* set M2 */
320 + sr32(CM_CLKSEL3_PLL, 0, 5, dpll_param_p->m2); /* set M2 */
322 + sr32(CM_CLKSEL1_EMU, 24, 5, PER_M6X2); /* set M6 */
323 + sr32(CM_CLKSEL_CAM, 0, 5, PER_M5X2); /* set M5 */
324 + sr32(CM_CLKSEL_DSS, 0, 5, PER_M4X2); /* set M4 */
325 + sr32(CM_CLKSEL_DSS, 8, 5, PER_M3X2); /* set M3 */
326 + sr32(CM_CLKSEL3_PLL, 0, 5, dpll_param_p->m2); /* set M2 */
328 + sr32(CM_CLKSEL2_PLL, 8, 11, dpll_param_p->m); /* set m */
329 + sr32(CM_CLKSEL2_PLL, 0, 7, dpll_param_p->n); /* set n */
330 + sr32(CM_CLKEN_PLL, 20, 4, dpll_param_p->fsel); /* FREQSEL */
331 + sr32(CM_CLKEN_PLL, 16, 3, PLL_LOCK); /* lock mode */
332 + wait_on_value(BIT1, 2, CM_IDLEST_CKGEN, LDELAY);
334 + /* Getting the base address to MPU DPLL param table */
335 + dpll_param_p = (dpll_param *) get_mpu_dpll_param();
336 + /* Moving it to the right sysclk and ES rev base */
337 + dpll_param_p = dpll_param_p + 3 * clk_index + sil_index;
338 + /* MPU DPLL (unlocked already) */
339 + sr32(CM_CLKSEL2_PLL_MPU, 0, 5, dpll_param_p->m2); /* Set M2 */
340 + sr32(CM_CLKSEL1_PLL_MPU, 8, 11, dpll_param_p->m); /* Set M */
341 + sr32(CM_CLKSEL1_PLL_MPU, 0, 7, dpll_param_p->n); /* Set N */
342 + sr32(CM_CLKEN_PLL_MPU, 4, 4, dpll_param_p->fsel); /* FREQSEL */
343 + sr32(CM_CLKEN_PLL_MPU, 0, 3, PLL_LOCK); /* lock mode */
344 + wait_on_value(BIT0, 1, CM_IDLEST_PLL_MPU, LDELAY);
346 + /* Getting the base address to IVA DPLL param table */
347 + dpll_param_p = (dpll_param *) get_iva_dpll_param();
348 + /* Moving it to the right sysclk and ES rev base */
349 + dpll_param_p = dpll_param_p + 3 * clk_index + sil_index;
350 + /* IVA DPLL (set to 12*20=240MHz) */
351 + sr32(CM_CLKEN_PLL_IVA2, 0, 3, PLL_STOP);
352 + wait_on_value(BIT0, 0, CM_IDLEST_PLL_IVA2, LDELAY);
353 + sr32(CM_CLKSEL2_PLL_IVA2, 0, 5, dpll_param_p->m2); /* set M2 */
354 + sr32(CM_CLKSEL1_PLL_IVA2, 8, 11, dpll_param_p->m); /* set M */
355 + sr32(CM_CLKSEL1_PLL_IVA2, 0, 7, dpll_param_p->n); /* set N */
356 + sr32(CM_CLKEN_PLL_IVA2, 4, 4, dpll_param_p->fsel); /* FREQSEL */
357 + sr32(CM_CLKEN_PLL_IVA2, 0, 3, PLL_LOCK); /* lock mode */
358 + wait_on_value(BIT0, 1, CM_IDLEST_PLL_IVA2, LDELAY);
360 + /* Set up GPTimers to sys_clk source only */
361 + sr32(CM_CLKSEL_PER, 0, 8, 0xff);
362 + sr32(CM_CLKSEL_WKUP, 0, 1, 1);
367 +/******************************************************************************
368 + * peripheral_enable() - Enable the clks & power for perifs (GPT2, UART1,...)
369 + *****************************************************************************/
370 +void per_clocks_enable(void)
372 + /* Enable GP2 timer. */
373 + sr32(CM_CLKSEL_PER, 0, 1, 0x1); /* GPT2 = sys clk */
374 + sr32(CM_ICLKEN_PER, 3, 1, 0x1); /* ICKen GPT2 */
375 + sr32(CM_FCLKEN_PER, 3, 1, 0x1); /* FCKen GPT2 */
378 + /* Enable UART1 clocks */
379 + sr32(CM_FCLKEN1_CORE, 13, 1, 0x1);
380 + sr32(CM_ICLKEN1_CORE, 13, 1, 0x1);
382 + /* UART 3 Clocks */
383 + sr32(CM_FCLKEN_PER, 11, 1, 0x1);
384 + sr32(CM_ICLKEN_PER, 11, 1, 0x1);
386 +#ifdef CONFIG_DRIVER_OMAP34XX_I2C
387 + /* Turn on all 3 I2C clocks */
388 + sr32(CM_FCLKEN1_CORE, 15, 3, 0x7);
389 + sr32(CM_ICLKEN1_CORE, 15, 3, 0x7); /* I2C1,2,3 = on */
391 + /* Enable the ICLK for 32K Sync Timer as its used in udelay */
392 + sr32(CM_ICLKEN_WKUP, 2, 1, 0x1);
394 + sr32(CM_FCLKEN_IVA2, 0, 32, FCK_IVA2_ON);
395 + sr32(CM_FCLKEN1_CORE, 0, 32, FCK_CORE1_ON);
396 + sr32(CM_ICLKEN1_CORE, 0, 32, ICK_CORE1_ON);
397 + sr32(CM_ICLKEN2_CORE, 0, 32, ICK_CORE2_ON);
398 + sr32(CM_FCLKEN_WKUP, 0, 32, FCK_WKUP_ON);
399 + sr32(CM_ICLKEN_WKUP, 0, 32, ICK_WKUP_ON);
400 + sr32(CM_FCLKEN_DSS, 0, 32, FCK_DSS_ON);
401 + sr32(CM_ICLKEN_DSS, 0, 32, ICK_DSS_ON);
402 + sr32(CM_FCLKEN_CAM, 0, 32, FCK_CAM_ON);
403 + sr32(CM_ICLKEN_CAM, 0, 32, ICK_CAM_ON);
404 + sr32(CM_FCLKEN_PER, 0, 32, FCK_PER_ON);
405 + sr32(CM_ICLKEN_PER, 0, 32, ICK_PER_ON);
409 diff --git a/board/omap3530beagle/config.mk b/board/omap3530beagle/config.mk
411 index 0000000..9639c43
413 +++ b/board/omap3530beagle/config.mk
416 +# (C) Copyright 2006
417 +# Texas Instruments, <www.ti.com>
419 +# Begale Board uses OMAP3 (ARM-CortexA8) cpu
420 +# see http://www.ti.com/ for more information on Texas Instruments
425 +# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
426 +# (mem base + reserved)
428 +# For use with external or internal boots.
429 +TEXT_BASE = 0x80e80000
432 diff --git a/board/omap3530beagle/lowlevel_init.S b/board/omap3530beagle/lowlevel_init.S
434 index 0000000..1f9a0e9
436 +++ b/board/omap3530beagle/lowlevel_init.S
439 + * Board specific setup info
441 + * (C) Copyright 2008
442 + * Texas Instruments, <www.ti.com>
445 + * Richard Woodruff <r-woodruff2@ti.com>
446 + * Syed Mohammed Khasim <khasim@ti.com>
448 + * See file CREDITS for list of people who contributed to this
451 + * This program is free software; you can redistribute it and/or
452 + * modify it under the terms of the GNU General Public License as
453 + * published by the Free Software Foundation; either version 2 of
454 + * the License, or (at your option) any later version.
456 + * This program is distributed in the hope that it will be useful,
457 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
458 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
459 + * GNU General Public License for more details.
461 + * You should have received a copy of the GNU General Public License
462 + * along with this program; if not, write to the Free Software
463 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
464 + * MA 02111-1307 USA
468 +#include <version.h>
469 +#include <asm/arch/mem.h>
470 +#include <asm/arch/clocks_omap3.h>
473 + .word TEXT_BASE /* sdram load addr from config.mk */
475 +#if !defined(CFG_NAND_BOOT) && !defined(CFG_NAND_BOOT)
476 +/**************************************************************************
477 + * cpy_clk_code: relocates clock code into SRAM where its safer to execute
478 + * R1 = SRAM destination address.
479 + *************************************************************************/
480 +.global cpy_clk_code
482 + /* Copy DPLL code into SRAM */
483 + adr r0, go_to_speed /* get addr of clock setting code */
484 + mov r2, #384 /* r2 size to copy (div by 32 bytes) */
485 + mov r1, r1 /* r1 <- dest address (passed in) */
486 + add r2, r2, r0 /* r2 <- source end address */
488 + ldmia r0!, {r3-r10} /* copy from source address [r0] */
489 + stmia r1!, {r3-r10} /* copy to target address [r1] */
490 + cmp r0, r2 /* until source end address [r2] */
492 + mov pc, lr /* back to caller */
494 +/* ***************************************************************************
495 + * go_to_speed: -Moves to bypass, -Commits clock dividers, -puts dpll at speed
496 + * -executed from SRAM.
497 + * R0 = CM_CLKEN_PLL-bypass value
498 + * R1 = CM_CLKSEL1_PLL-m, n, and divider values
499 + * R2 = CM_CLKSEL_CORE-divider values
500 + * R3 = CM_IDLEST_CKGEN - addr dpll lock wait
502 + * Note: If core unlocks/relocks and SDRAM is running fast already it gets
503 + * confused. A reset of the controller gets it back. Taking away its
504 + * L3 when its not in self refresh seems bad for it. Normally, this
505 + * code runs from flash before SDR is init so that should be ok.
506 + ****************************************************************************/
511 + /* move into fast relock bypass */
512 + ldr r4, pll_ctl_add
515 + ldr r5, [r3] /* get status */
516 + and r5, r5, #0x1 /* isolate core status */
517 + cmp r5, #0x1 /* still locked? */
518 + beq wait1 /* if lock, loop */
520 + /* set new dpll dividers _after_ in bypass */
521 + ldr r5, pll_div_add1
522 + str r1, [r5] /* set m, n, m2 */
523 + ldr r5, pll_div_add2
524 + str r2, [r5] /* set l3/l4/.. dividers*/
525 + ldr r5, pll_div_add3 /* wkup */
526 + ldr r2, pll_div_val3 /* rsm val */
528 + ldr r5, pll_div_add4 /* gfx */
529 + ldr r2, pll_div_val4
531 + ldr r5, pll_div_add5 /* emu */
532 + ldr r2, pll_div_val5
535 + /* now prepare GPMC (flash) for new dpll speed */
536 + /* flash needs to be stable when we jump back to it */
537 + ldr r5, flash_cfg3_addr
538 + ldr r2, flash_cfg3_val
540 + ldr r5, flash_cfg4_addr
541 + ldr r2, flash_cfg4_val
543 + ldr r5, flash_cfg5_addr
544 + ldr r2, flash_cfg5_val
546 + ldr r5, flash_cfg1_addr
548 + orr r2, r2, #0x3 /* up gpmc divider */
551 + /* lock DPLL3 and wait a bit */
552 + orr r0, r0, #0x7 /* set up for lock mode */
553 + str r0, [r4] /* lock */
554 + nop /* ARM slow at this point working at sys_clk */
559 + ldr r5, [r3] /* get status */
560 + and r5, r5, #0x1 /* isolate core status */
561 + cmp r5, #0x1 /* still locked? */
562 + bne wait2 /* if lock, loop */
568 + mov pc, lr /* back to caller, locked */
570 +_go_to_speed: .word go_to_speed
572 +/* these constants need to be close for PIC code */
573 +/* The Nor has to be in the Flash Base CS0 for this condition to happen */
575 + .word (GPMC_CONFIG_CS0 + GPMC_CONFIG1)
577 + .word (GPMC_CONFIG_CS0 + GPMC_CONFIG3)
579 + .word STNOR_GPMC_CONFIG3
581 + .word (GPMC_CONFIG_CS0 + GPMC_CONFIG4)
583 + .word STNOR_GPMC_CONFIG4
585 + .word STNOR_GPMC_CONFIG5
587 + .word (GPMC_CONFIG_CS0 + GPMC_CONFIG5)
591 + .word CM_CLKSEL1_PLL
593 + .word CM_CLKSEL_CORE
595 + .word CM_CLKSEL_WKUP
597 + .word (WKUP_RSM << 1)
599 + .word CM_CLKSEL_GFX
601 + .word (GFX_DIV << 0)
603 + .word CM_CLKSEL1_EMU
605 + .word CLSEL1_EMU_VAL
609 +.globl lowlevel_init
612 + str ip, [sp] /* stash old link register */
613 + mov ip, lr /* save link reg across call */
614 + bl s_init /* go setup pll,mux,memory */
615 + ldr ip, [sp] /* restore save ip */
616 + mov lr, ip /* restore link reg */
618 + /* back to arch calling code */
621 + /* the literal pools origin */
625 + .word CONTROL_STATUS
627 + .word LOW_LEVEL_SRAM_STACK
629 +/* DPLL(1-4) PARAM TABLES */
630 +/* Each of the tables has M, N, FREQSEL, M2 values defined for nominal
631 + * OPP (1.2V). The fields are defined according to dpll_param struct(clock.c).
632 + * The values are defined for all possible sysclk and for ES1 and ES2.
638 +.word 0x0FE,0x07,0x05,0x01
640 +.word 0x0FA,0x05,0x07,0x01
642 +.word 0x085,0x05,0x07,0x01
646 +.word 0x17D,0x0C,0x03,0x01
648 +.word 0x1F4,0x0C,0x03,0x01
650 +.word 0x10A,0x0C,0x03,0x01
654 +.word 0x179,0x12,0x04,0x01
656 +.word 0x271,0x17,0x03,0x01
658 +.word 0x14C,0x17,0x03,0x01
662 +.word 0x17D,0x19,0x03,0x01
664 +.word 0x0FA,0x0C,0x07,0x01
666 +.word 0x085,0x0C,0x07,0x01
670 +.word 0x1FA,0x32,0x03,0x01
672 +.word 0x271,0x2F,0x03,0x01
674 +.word 0x14C,0x2F,0x03,0x01
677 +.globl get_mpu_dpll_param
679 + adr r0, mpu_dpll_param
685 +.word 0x07D,0x05,0x07,0x01
687 +.word 0x0B4,0x05,0x07,0x01
689 +.word 0x085,0x05,0x07,0x01
693 +.word 0x0FA,0x0C,0x03,0x01
695 +.word 0x168,0x0C,0x03,0x01
697 +.word 0x10A,0x0C,0x03,0x01
701 +.word 0x082,0x09,0x07,0x01
703 +.word 0x0E1,0x0B,0x06,0x01
705 +.word 0x14C,0x17,0x03,0x01
709 +.word 0x07D,0x0C,0x07,0x01
711 +.word 0x0B4,0x0C,0x07,0x01
713 +.word 0x085,0x0C,0x07,0x01
717 +.word 0x13F,0x30,0x03,0x01
719 +.word 0x0E1,0x17,0x06,0x01
721 +.word 0x14C,0x2F,0x03,0x01
724 +.globl get_iva_dpll_param
726 + adr r0, iva_dpll_param
729 +/* Core DPLL targets for L3 at 166 & L133 */
733 +.word M_12_ES1,M_12_ES1,FSL_12_ES1,M2_12_ES1
735 +.word M_12,N_12,FSEL_12,M2_12
737 +.word M_12,N_12,FSEL_12,M2_12
741 +.word M_13_ES1,N_13_ES1,FSL_13_ES1,M2_13_ES1
743 +.word M_13,N_13,FSEL_13,M2_13
745 +.word M_13,N_13,FSEL_13,M2_13
749 +.word M_19p2_ES1,N_19p2_ES1,FSL_19p2_ES1,M2_19p2_ES1
751 +.word M_19p2,N_19p2,FSEL_19p2,M2_19p2
753 +.word M_19p2,N_19p2,FSEL_19p2,M2_19p2
757 +.word M_26_ES1,N_26_ES1,FSL_26_ES1,M2_26_ES1
759 +.word M_26,N_26,FSEL_26,M2_26
761 +.word M_26,N_26,FSEL_26,M2_26
765 +.word M_38p4_ES1,N_38p4_ES1,FSL_38p4_ES1,M2_38p4_ES1
767 +.word M_38p4,N_38p4,FSEL_38p4,M2_38p4
769 +.word M_38p4,N_38p4,FSEL_38p4,M2_38p4
771 +.globl get_core_dpll_param
772 +get_core_dpll_param:
773 + adr r0, core_dpll_param
776 +/* PER DPLL values are same for both ES1 and ES2 */
779 +.word 0xD8,0x05,0x07,0x09
782 +.word 0x1B0,0x0C,0x03,0x09
785 +.word 0xE1,0x09,0x07,0x09
788 +.word 0xD8,0x0C,0x07,0x09
791 +.word 0xE1,0x13,0x07,0x09
793 +.globl get_per_dpll_param
795 + adr r0, per_dpll_param
798 diff --git a/board/omap3530beagle/mem.c b/board/omap3530beagle/mem.c
800 index 0000000..fb803be
802 +++ b/board/omap3530beagle/mem.c
805 + * (C) Copyright 2008
806 + * Texas Instruments, <www.ti.com>
808 + * Initial Code from:
809 + * Richard Woodruff <r-woodruff2@ti.com>
810 + * Syed Mohammed Khasim <khasim@ti.com>
812 + * This program is free software; you can redistribute it and/or
813 + * modify it under the terms of the GNU General Public License as
814 + * published by the Free Software Foundation; either version 2 of
815 + * the License, or (at your option) any later version.
817 + * This program is distributed in the hope that it will be useful,
818 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
819 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
820 + * GNU General Public License for more details.
822 + * You should have received a copy of the GNU General Public License
823 + * along with this program; if not, write to the Free Software
824 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
825 + * MA 02111-1307 USA
830 +#include <asm/arch/bits.h>
831 +#include <asm/arch/mem.h>
832 +#include <asm/arch/sys_proto.h>
833 +#include <command.h>
835 +/* Only One NAND allowed on board at a time.
836 + * The GPMC CS Base for the same
838 +unsigned int nand_cs_base;
839 +unsigned int boot_flash_base;
840 +unsigned int boot_flash_off;
841 +unsigned int boot_flash_sec;
842 +unsigned int boot_flash_type;
843 +volatile unsigned int boot_flash_env_addr;
845 +/* help common/env_flash.c */
846 +#ifdef ENV_IS_VARIABLE
848 +uchar(*boot_env_get_char_spec) (int index);
849 +int (*boot_env_init) (void);
850 +int (*boot_saveenv) (void);
851 +void (*boot_env_relocate_spec) (void);
854 +uchar env_get_char_spec(int index);
857 +void env_relocate_spec(void);
858 +extern char *env_name_spec;
862 +#endif /* ENV_IS_VARIABLE */
864 +static u32 gpmc_m_nand[GPMC_MAX_REG] = {
865 + M_NAND_GPMC_CONFIG1,
866 + M_NAND_GPMC_CONFIG2,
867 + M_NAND_GPMC_CONFIG3,
868 + M_NAND_GPMC_CONFIG4,
869 + M_NAND_GPMC_CONFIG5,
870 + M_NAND_GPMC_CONFIG6, 0
873 +/**************************************************************************
874 + * make_cs1_contiguous() - for es2 and above remap cs1 behind cs0 to allow
875 + * command line mem=xyz use all memory with out discontinuous support
876 + * compiled in. Could do it at the ATAG, but there really is two banks...
877 + * Called as part of 2nd phase DDR init.
878 + **************************************************************************/
879 +void make_cs1_contiguous(void)
881 + u32 size, a_add_low, a_add_high;
883 + size = get_sdr_cs_size(SDRC_CS0_OSET);
884 + size /= SZ_32M; /* find size to offset CS1 */
885 + a_add_high = (size & 3) << 8; /* set up low field */
886 + a_add_low = (size & 0x3C) >> 2; /* set up high field */
887 + __raw_writel((a_add_high | a_add_low), SDRC_CS_CFG);
891 +/********************************************************
892 + * mem_ok() - test used to see if timings are correct
893 + * for a part. Helps in guessing which part
894 + * we are currently using.
895 + *******************************************************/
898 + u32 val1, val2, addr;
899 + u32 pattern = 0x12345678;
901 + addr = OMAP34XX_SDRC_CS0;
903 + __raw_writel(0x0, addr + 0x400); /* clear pos A */
904 + __raw_writel(pattern, addr); /* pattern to pos B */
905 + __raw_writel(0x0, addr + 4); /* remove pattern off the bus */
906 + val1 = __raw_readl(addr + 0x400); /* get pos A value */
907 + val2 = __raw_readl(addr); /* get val2 */
909 + if ((val1 != 0) || (val2 != pattern)) /* see if pos A value changed */
915 +/********************************************************
916 + * sdrc_init() - init the sdrc chip selects CS0 and CS1
917 + * - early init routines, called from flash or
919 + *******************************************************/
920 +void sdrc_init(void)
922 + /* only init up first bank here */
923 + do_sdrc_init(SDRC_CS0_OSET, EARLY_INIT);
926 +/*************************************************************************
927 + * do_sdrc_init(): initialize the SDRAM for use.
928 + * -code sets up SDRAM basic SDRC timings for CS0
929 + * -optimal settings can be placed here, or redone after i2c
930 + * inspection of board info
932 + * - code called ones in C-Stack only context for CS0 and a possible 2nd
933 + * time depending on memory configuration from stack+global context
934 + **************************************************************************/
936 +void do_sdrc_init(u32 offset, u32 early)
939 + /* reset sdrc controller */
940 + __raw_writel(SOFTRESET, SDRC_SYSCONFIG);
941 + wait_on_value(BIT0, BIT0, SDRC_STATUS, 12000000);
942 + __raw_writel(0, SDRC_SYSCONFIG);
944 + /* setup sdrc to ball mux */
945 + __raw_writel(SDP_SDRC_SHARING, SDRC_SHARING);
947 + /* SDRC_MCFG0 register */
948 + (*(unsigned int *) 0x6D000080) = 0x02584099; /* from Micron */
950 + /* SDRC_RFR_CTRL0 register */
951 + (*(unsigned int *) 0x6D0000a4) = 0x54601; /* for 166M */
953 + /* SDRC_ACTIM_CTRLA0 register */
954 + (*(unsigned int *) 0x6D00009c) = 0xa29db4c6; /* for 166M */
956 + /* SDRC_ACTIM_CTRLB0 register */
957 + (*(unsigned int *) 0x6D0000a0) = 0x12214; /* for 166M */
959 + /* Disble Power Down of CKE cuz of 1 CKE on combo part */
960 + (*(unsigned int *) 0x6D000070) = 0x00000081;
962 + /* SDRC_Manual command register */
963 + (*(unsigned int *) 0x6D0000a8) = 0x00000000; /* NOP command */
964 + (*(unsigned int *) 0x6D0000a8) = 0x00000001; /* Precharge command */
965 + (*(unsigned int *) 0x6D0000a8) = 0x00000002; /* Auto-refresh command */
966 + (*(unsigned int *) 0x6D0000a8) = 0x00000002; /* Auto-refresh command */
968 + /* SDRC MR0 register */
969 + (*(int *) 0x6D000084) = 0x00000032; /* Burst length = 4 */
970 + /* CAS latency = 3, Write Burst = Read Burst Serial Mode */
972 + /* SDRC DLLA control register */
973 + (*(unsigned int *) 0x6D000060) = 0x0000A;
977 +void enable_gpmc_config(u32 *gpmc_config, u32 gpmc_base, u32 base, u32 size)
979 + __raw_writel(0, GPMC_CONFIG7 + gpmc_base);
981 + /* Delay for settling */
982 + __raw_writel(gpmc_config[0], GPMC_CONFIG1 + gpmc_base);
983 + __raw_writel(gpmc_config[1], GPMC_CONFIG2 + gpmc_base);
984 + __raw_writel(gpmc_config[2], GPMC_CONFIG3 + gpmc_base);
985 + __raw_writel(gpmc_config[3], GPMC_CONFIG4 + gpmc_base);
986 + __raw_writel(gpmc_config[4], GPMC_CONFIG5 + gpmc_base);
987 + __raw_writel(gpmc_config[5], GPMC_CONFIG6 + gpmc_base);
988 + /* Enable the config */
989 + __raw_writel((((size & 0xF) << 8) | ((base >> 24) & 0x3F) |
990 + (1 << 6)), GPMC_CONFIG7 + gpmc_base);
994 +/*****************************************************
995 + * gpmc_init(): init gpmc bus
996 + * Init GPMC for x16, MuxMode (SDRAM in x32).
997 + * This code can only be executed from SRAM or SDRAM.
998 + *****************************************************/
999 +void gpmc_init(void)
1001 + /* putting a blanket check on GPMC based on ZeBu for now */
1002 + u32 mux = 0, mwidth;
1003 + u32 *gpmc_config = NULL;
1004 + u32 gpmc_base = 0;
1007 + u32 f_off = CFG_MONITOR_LEN;
1012 + mwidth = get_gpmc0_width();
1014 + /* global settings */
1015 + __raw_writel(0x0, GPMC_IRQENABLE); /* isr's sources masked */
1016 + __raw_writel(0, GPMC_TIMEOUT_CONTROL); /* timeout disable */
1018 + config = __raw_readl(GPMC_CONFIG);
1019 + config &= (~0xf00);
1020 + __raw_writel(config, GPMC_CONFIG);
1022 + /* Disable the GPMC0 config set by ROM code
1023 + * It conflicts with our MPDB (both at 0x08000000)
1025 + __raw_writel(0, GPMC_CONFIG7 + GPMC_CONFIG_CS0);
1029 + gpmc_config = gpmc_m_nand;
1030 + gpmc_base = GPMC_CONFIG_CS0 + (0 * GPMC_CONFIG_WIDTH);
1031 + base = PISMO1_NAND_BASE;
1032 + size = PISMO1_NAND_SIZE;
1033 + enable_gpmc_config(gpmc_config, gpmc_base, base, size);
1035 + f_off = SMNAND_ENV_OFFSET;
1038 + nand_cs_base = gpmc_base;
1041 + boot_flash_base = base;
1042 + boot_flash_off = f_off;
1043 + boot_flash_sec = f_sec;
1044 + boot_flash_env_addr = f_off;
1046 +#ifdef ENV_IS_VARIABLE
1047 + boot_env_get_char_spec = env_get_char_spec;
1048 + boot_env_init = env_init;
1049 + boot_saveenv = saveenv;
1050 + boot_env_relocate_spec = env_relocate_spec;
1054 diff --git a/board/omap3530beagle/nand.c b/board/omap3530beagle/nand.c
1055 new file mode 100644
1056 index 0000000..2f94684
1058 +++ b/board/omap3530beagle/nand.c
1061 + * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
1062 + * Rohit Choraria <rohitkc@ti.com>
1064 + * See file CREDITS for list of people who contributed to this
1067 + * This program is free software; you can redistribute it and/or
1068 + * modify it under the terms of the GNU General Public License as
1069 + * published by the Free Software Foundation; either version 2 of
1070 + * the License, or (at your option) any later version.
1072 + * This program is distributed in the hope that it will be useful,
1073 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1074 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1075 + * GNU General Public License for more details.
1077 + * You should have received a copy of the GNU General Public License
1078 + * along with this program; if not, write to the Free Software
1079 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1080 + * MA 02111-1307 USA
1083 +#include <common.h>
1084 +#include <asm/io.h>
1085 +#include <asm/arch/mem.h>
1086 +#include <linux/mtd/nand_ecc.h>
1088 +#if defined(CONFIG_CMD_NAND)
1093 +volatile unsigned long gpmc_cs_base_add;
1095 +#define GPMC_BUF_EMPTY 0
1096 +#define GPMC_BUF_FULL 1
1098 +#define ECC_P1_128_E(val) ((val) & 0x000000FF) /* Bit 0 to 7 */
1099 +#define ECC_P512_2048_E(val) (((val) & 0x00000F00)>>8) /* Bit 8 to 11 */
1100 +#define ECC_P1_128_O(val) (((val) & 0x00FF0000)>>16) /* Bit 16 to Bit 23 */
1101 +#define ECC_P512_2048_O(val) (((val) & 0x0F000000)>>24) /* Bit 24 to Bit 27 */
1104 + * omap_nand_hwcontrol - Set the address pointers corretly for the
1105 + * following address/data/command operation
1106 + * @mtd: MTD device structure
1107 + * @ctrl: Says whether Address or Command or Data is following.
1109 +static void omap_nand_hwcontrol(struct mtd_info *mtd, int ctrl)
1111 + register struct nand_chip *this = mtd->priv;
1113 + /* Point the IO_ADDR to DATA and ADDRESS registers instead
1114 + of chip address */
1116 + case NAND_CTL_SETCLE:
1117 + this->IO_ADDR_W = (void *) gpmc_cs_base_add + GPMC_NAND_CMD;
1118 + this->IO_ADDR_R = (void *) gpmc_cs_base_add + GPMC_NAND_DAT;
1120 + case NAND_CTL_SETALE:
1121 + this->IO_ADDR_W = (void *) gpmc_cs_base_add + GPMC_NAND_ADR;
1122 + this->IO_ADDR_R = (void *) gpmc_cs_base_add + GPMC_NAND_DAT;
1124 + case NAND_CTL_CLRCLE:
1125 + this->IO_ADDR_W = (void *) gpmc_cs_base_add + GPMC_NAND_DAT;
1126 + this->IO_ADDR_R = (void *) gpmc_cs_base_add + GPMC_NAND_DAT;
1128 + case NAND_CTL_CLRALE:
1129 + this->IO_ADDR_W = (void *) gpmc_cs_base_add + GPMC_NAND_DAT;
1130 + this->IO_ADDR_R = (void *) gpmc_cs_base_add + GPMC_NAND_DAT;
1136 + * omap_nand_wait - called primarily after a program/erase operation
1137 + * so that we access NAND again only after the device
1139 + * @mtd: MTD device structure
1140 + * @chip: nand_chip structure
1141 + * @state: State from which wait function is being called i.e write/erase.
1143 +static int omap_nand_wait(struct mtd_info *mtd, struct nand_chip *chip,
1146 + register struct nand_chip *this = mtd->priv;
1149 + this->IO_ADDR_W = (void *) gpmc_cs_base_add + GPMC_NAND_CMD;
1150 + this->IO_ADDR_R = (void *) gpmc_cs_base_add + GPMC_NAND_DAT;
1151 + /* Send the status command and loop until the device is free */
1152 + while (!(status & 0x40)) {
1153 + __raw_writeb(NAND_CMD_STATUS & 0xFF, this->IO_ADDR_W);
1154 + status = __raw_readb(this->IO_ADDR_R);
1159 +#ifdef CFG_NAND_WIDTH_16
1161 + * omap_nand_write_buf16 - [DEFAULT] write buffer to chip
1162 + * @mtd: MTD device structure
1163 + * @buf: data buffer
1164 + * @len: number of bytes to write
1166 + * Default write function for 16bit buswith
1168 +static void omap_nand_write_buf(struct mtd_info *mtd, const u_char *buf,
1172 + struct nand_chip *this = mtd->priv;
1173 + u16 *p = (u16 *) buf;
1176 + for (i = 0; i < len; i++) {
1177 + writew(p[i], this->IO_ADDR_W);
1178 + while (GPMC_BUF_EMPTY == (readl(GPMC_STATUS) & GPMC_BUF_FULL)) ;
1183 + * nand_read_buf16 - [DEFAULT] read chip data into buffer
1184 + * @mtd: MTD device structure
1185 + * @buf: buffer to store date
1186 + * @len: number of bytes to read
1188 + * Default read function for 16bit buswith
1190 +static void omap_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
1193 + struct nand_chip *this = mtd->priv;
1194 + u16 *p = (u16 *) buf;
1197 + for (i = 0; i < len; i++)
1198 + p[i] = readw(this->IO_ADDR_R);
1203 + * omap_nand_write_buf - write buffer to NAND controller
1204 + * @mtd: MTD device structure
1205 + * @buf: data buffer
1206 + * @len: number of bytes to write
1209 +static void omap_nand_write_buf(struct mtd_info *mtd, const uint8_t *buf,
1214 + struct nand_chip *chip = mtd->priv;
1216 + for (i = 0; i < len; i++) {
1217 + writeb(buf[i], chip->IO_ADDR_W);
1218 + for (j = 0; j < 10; j++) ;
1224 + * omap_nand_read_buf - read data from NAND controller into buffer
1225 + * @mtd: MTD device structure
1226 + * @buf: buffer to store date
1227 + * @len: number of bytes to read
1230 +static void omap_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
1234 + struct nand_chip *chip = mtd->priv;
1236 + for (i = 0; i < len; i++) {
1237 + buf[i] = readb(chip->IO_ADDR_R);
1238 + while (GPMC_BUF_EMPTY == (readl(GPMC_STATUS) & GPMC_BUF_FULL));
1241 +#endif /* CFG_NAND_WIDTH_16 */
1244 + * omap_hwecc_init - Initialize the Hardware ECC for NAND flash in
1246 + * @mtd: MTD device structure
1249 +static void omap_hwecc_init(struct nand_chip *chip)
1251 + unsigned long val = 0x0;
1253 + /* Init ECC Control Register */
1254 + /* Clear all ECC | Enable Reg1 */
1255 + val = ((0x00000001 << 8) | 0x00000001);
1256 + __raw_writel(val, GPMC_BASE + GPMC_ECC_CONTROL);
1257 + __raw_writel(0x3fcff000, GPMC_BASE + GPMC_ECC_SIZE_CONFIG);
1261 + * omap_correct_data - Compares the ecc read from nand spare area with
1262 + * ECC registers values
1263 + * and corrects one bit error if it has occured
1264 + * @mtd: MTD device structure
1266 + * @read_ecc: ecc read from nand flash
1267 + * @calc_ecc: ecc read from ECC registers
1269 +static int omap_correct_data(struct mtd_info *mtd, u_char *dat,
1270 + u_char *read_ecc, u_char *calc_ecc)
1276 + * omap_calculate_ecc - Generate non-inverted ECC bytes.
1278 + * Using noninverted ECC can be considered ugly since writing a blank
1279 + * page ie. padding will clear the ECC bytes. This is no problem as
1280 + * long nobody is trying to write data on the seemingly unused page.
1281 + * Reading an erased page will produce an ECC mismatch between
1282 + * generated and read ECC bytes that has to be dealt with separately.
1283 + * @mtd: MTD structure
1285 + * @ecc_code: ecc_code buffer
1287 +static int omap_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
1290 + unsigned long val = 0x0;
1291 + unsigned long reg;
1293 + /* Start Reading from HW ECC1_Result = 0x200 */
1294 + reg = (unsigned long) (GPMC_BASE + GPMC_ECC1_RESULT);
1295 + val = __raw_readl(reg);
1297 + *ecc_code++ = ECC_P1_128_E(val);
1298 + *ecc_code++ = ECC_P1_128_O(val);
1299 + *ecc_code++ = ECC_P512_2048_E(val) | ECC_P512_2048_O(val) << 4;
1305 + * omap_enable_ecc - This function enables the hardware ecc functionality
1306 + * @mtd: MTD device structure
1307 + * @mode: Read/Write mode
1309 +static void omap_enable_hwecc(struct mtd_info *mtd, int mode)
1311 + struct nand_chip *chip = mtd->priv;
1312 + unsigned int val = __raw_readl(GPMC_BASE + GPMC_ECC_CONFIG);
1313 + unsigned int dev_width = (chip->options & NAND_BUSWIDTH_16) >> 1;
1316 + case NAND_ECC_READ:
1317 + __raw_writel(0x101, GPMC_BASE + GPMC_ECC_CONTROL);
1318 + /* ECC col width | CS | ECC Enable */
1319 + val = (dev_width << 7) | (cs << 1) | (0x1);
1321 + case NAND_ECC_READSYN:
1322 + __raw_writel(0x100, GPMC_BASE + GPMC_ECC_CONTROL);
1323 + /* ECC col width | CS | ECC Enable */
1324 + val = (dev_width << 7) | (cs << 1) | (0x1);
1326 + case NAND_ECC_WRITE:
1327 + __raw_writel(0x101, GPMC_BASE + GPMC_ECC_CONTROL);
1328 + /* ECC col width | CS | ECC Enable */
1329 + val = (dev_width << 7) | (cs << 1) | (0x1);
1332 + printf("Error: Unrecognized Mode[%d]!\n", mode);
1336 + __raw_writel(val, GPMC_BASE + GPMC_ECC_CONFIG);
1339 +static struct nand_oobinfo hw_nand_oob_64 = {
1340 + .useecc = MTD_NANDECC_AUTOPLACE,
1346 + .oobfree = { {20, 50} } /* don't care */
1349 +static struct nand_oobinfo sw_nand_oob_64 = {
1350 + .useecc = MTD_NANDECC_AUTOPLACE,
1353 + 40, 41, 42, 43, 44, 45, 46, 47,
1354 + 48, 49, 50, 51, 52, 53, 54, 55,
1355 + 56, 57, 58, 59, 60, 61, 62, 63},
1356 + .oobfree = { {2, 38} }
1359 +void omap_nand_switch_ecc(struct mtd_info *mtd, int hardware)
1361 + struct nand_chip *nand = mtd->priv;
1364 + nand->eccmode = NAND_ECC_SOFT;
1365 + nand->autooob = &sw_nand_oob_64;
1366 + nand->eccsize = 256; /* set default eccsize */
1367 + nand->eccbytes = 3;
1368 + nand->eccsteps = 8;
1369 + nand->enable_hwecc = 0;
1370 + nand->calculate_ecc = nand_calculate_ecc;
1371 + nand->correct_data = nand_correct_data;
1373 + nand->eccmode = NAND_ECC_HW3_512;
1374 + nand->autooob = &hw_nand_oob_64;
1375 + nand->eccsize = 512;
1376 + nand->eccbytes = 3;
1377 + nand->eccsteps = 4;
1378 + nand->enable_hwecc = omap_enable_hwecc;
1379 + nand->correct_data = omap_correct_data;
1380 + nand->calculate_ecc = omap_calculate_ecc;
1382 + omap_hwecc_init(nand);
1385 + mtd->eccsize = nand->eccsize;
1386 + nand->oobdirty = 1;
1388 + if (nand->options & NAND_BUSWIDTH_16) {
1389 + mtd->oobavail = mtd->oobsize - (nand->autooob->eccbytes + 2);
1390 + if (nand->autooob->eccbytes & 0x01)
1393 + mtd->oobavail = mtd->oobsize - (nand->autooob->eccbytes + 1);
1397 + * Board-specific NAND initialization. The following members of the
1398 + * argument are board-specific (per include/linux/mtd/nand_new.h):
1399 + * - IO_ADDR_R?: address to read the 8 I/O lines of the flash device
1400 + * - IO_ADDR_W?: address to write the 8 I/O lines of the flash device
1401 + * - hwcontrol: hardwarespecific function for accesing control-lines
1402 + * - dev_ready: hardwarespecific function for accesing device ready/busy line
1403 + * - enable_hwecc?: function to enable (reset) hardware ecc generator. Must
1404 + * only be provided if a hardware ECC is available
1405 + * - eccmode: mode of ecc, see defines
1406 + * - chip_delay: chip dependent delay for transfering data from array to
1408 + * - options: various chip options. They can partly be set to inform
1409 + * nand_scan about special functionality. See the defines for further
1411 + * Members with a "?" were not set in the merged testing-NAND branch,
1412 + * so they are not set here either.
1414 +int board_nand_init(struct nand_chip *nand)
1416 + int gpmc_config = 0;
1418 + while (cs <= GPMC_MAX_CS) {
1419 + /* Each GPMC set for a single CS is at offset 0x30 */
1420 + /* already remapped for us */
1421 + gpmc_cs_base_add = (GPMC_CONFIG_CS0 + (cs * 0x30));
1422 + /* xloader/Uboot would have written the NAND type for us
1423 + * NOTE: This is a temporary measure and cannot handle ONENAND.
1424 + * The proper way of doing this is to pass the setup of
1425 + * u-boot up to kernel using kernel params - something on
1426 + * the lines of machineID
1428 + /* Check if NAND type is set */
1429 + if ((__raw_readl(gpmc_cs_base_add + GPMC_CONFIG1) & 0xC00) ==
1436 + if (cs > GPMC_MAX_CS) {
1437 + printf("NAND: Unable to find NAND settings in " \
1438 + "GPMC Configuration - quitting\n");
1441 + gpmc_config = __raw_readl(GPMC_CONFIG);
1442 + /* Disable Write protect */
1443 + gpmc_config |= 0x10;
1444 + __raw_writel(gpmc_config, GPMC_CONFIG);
1446 + nand->IO_ADDR_R = (int *) gpmc_cs_base_add + GPMC_NAND_DAT;
1447 + nand->IO_ADDR_W = (int *) gpmc_cs_base_add + GPMC_NAND_CMD;
1449 + nand->hwcontrol = omap_nand_hwcontrol;
1450 + nand->options = NAND_NO_PADDING | NAND_CACHEPRG | NAND_NO_AUTOINCR |
1451 + NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR;
1452 + nand->read_buf = omap_nand_read_buf;
1453 + nand->write_buf = omap_nand_write_buf;
1454 + nand->eccmode = NAND_ECC_SOFT;
1455 + /* if RDY/BSY line is connected to OMAP then use the omap ready
1456 + * function and the generic nand_wait function which reads the
1457 + * status register after monitoring the RDY/BSY line. Otherwise
1458 + * use a standard chip delay which is slightly more than tR
1459 + * (AC Timing) of the NAND device and read the status register
1460 + * until you get a failure or success
1462 + nand->waitfunc = omap_nand_wait;
1463 + nand->chip_delay = 50;
1467 +#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
1468 diff --git a/board/omap3530beagle/omap3530beagle.c b/board/omap3530beagle/omap3530beagle.c
1469 new file mode 100644
1470 index 0000000..7d9a566
1472 +++ b/board/omap3530beagle/omap3530beagle.c
1475 + * (C) Copyright 2004-2008
1476 + * Texas Instruments, <www.ti.com>
1479 + * Sunil Kumar <sunilsaini05@gmail.com>
1480 + * Shashi Ranjan <shashiranjanmca05@gmail.com>
1482 + * Derived from Beagle Board and 3430 SDP code by
1483 + * Richard Woodruff <r-woodruff2@ti.com>
1484 + * Syed Mohammed Khasim <khasim@ti.com>
1487 + * See file CREDITS for list of people who contributed to this
1490 + * This program is free software; you can redistribute it and/or
1491 + * modify it under the terms of the GNU General Public License as
1492 + * published by the Free Software Foundation; either version 2 of
1493 + * the License, or (at your option) any later version.
1495 + * This program is distributed in the hope that it will be useful,
1496 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1497 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1498 + * GNU General Public License for more details.
1500 + * You should have received a copy of the GNU General Public License
1501 + * along with this program; if not, write to the Free Software
1502 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1503 + * MA 02111-1307 USA
1505 +#include <common.h>
1506 +#include <asm/io.h>
1507 +#include <asm/arch/bits.h>
1508 +#include <asm/arch/mux.h>
1509 +#include <asm/arch/sys_proto.h>
1510 +#include <asm/arch/mem.h>
1512 +#include <asm/mach-types.h>
1514 +#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
1515 +#include <linux/mtd/nand_legacy.h>
1516 +extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
1519 +#define NOT_EARLY 0
1521 +/* Permission values for registers -Full fledged permissions to all */
1522 +#define UNLOCK_1 0xFFFFFFFF
1523 +#define UNLOCK_2 0x00000000
1524 +#define UNLOCK_3 0x0000FFFF
1526 +/******************************************************************************
1528 + * Description: spinning delay to use before udelay works
1529 + *****************************************************************************/
1530 +static inline void delay(unsigned long loops)
1532 + __asm__ volatile ("1:\n" "subs %0, %1, #1\n"
1533 + "bne 1b":"=r" (loops):"0"(loops));
1536 +/******************************************************************************
1537 + * Routine: board_init
1538 + * Description: Early hardware init.
1539 + *****************************************************************************/
1540 +int board_init(void)
1542 + DECLARE_GLOBAL_DATA_PTR;
1544 + gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
1545 + /* board id for Linux */
1546 + gd->bd->bi_arch_number = MACH_TYPE_OMAP3_BEAGLE;
1547 + /* boot param addr */
1548 + gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
1553 +/******************************************************************************
1554 + * Routine: secure_unlock
1555 + * Description: Setup security registers for access
1556 + * (GP Device only)
1557 + *****************************************************************************/
1558 +void secure_unlock_mem(void)
1560 + /* Protection Module Register Target APE (PM_RT) */
1561 + __raw_writel(UNLOCK_1, RT_REQ_INFO_PERMISSION_1);
1562 + __raw_writel(UNLOCK_1, RT_READ_PERMISSION_0);
1563 + __raw_writel(UNLOCK_1, RT_WRITE_PERMISSION_0);
1564 + __raw_writel(UNLOCK_2, RT_ADDR_MATCH_1);
1566 + __raw_writel(UNLOCK_3, GPMC_REQ_INFO_PERMISSION_0);
1567 + __raw_writel(UNLOCK_3, GPMC_READ_PERMISSION_0);
1568 + __raw_writel(UNLOCK_3, GPMC_WRITE_PERMISSION_0);
1570 + __raw_writel(UNLOCK_3, OCM_REQ_INFO_PERMISSION_0);
1571 + __raw_writel(UNLOCK_3, OCM_READ_PERMISSION_0);
1572 + __raw_writel(UNLOCK_3, OCM_WRITE_PERMISSION_0);
1573 + __raw_writel(UNLOCK_2, OCM_ADDR_MATCH_2);
1576 + __raw_writel(UNLOCK_3, IVA2_REQ_INFO_PERMISSION_0);
1577 + __raw_writel(UNLOCK_3, IVA2_READ_PERMISSION_0);
1578 + __raw_writel(UNLOCK_3, IVA2_WRITE_PERMISSION_0);
1580 + __raw_writel(UNLOCK_1, SMS_RG_ATT0); /* SDRC region 0 public */
1583 +/******************************************************************************
1584 + * Routine: secureworld_exit()
1585 + * Description: If chip is EMU and boot type is external
1586 + * configure secure registers and exit secure world
1588 + *****************************************************************************/
1589 +void secureworld_exit()
1593 + /* configrue non-secure access control register */
1594 + __asm__ __volatile__("mrc p15, 0, %0, c1, c1, 2":"=r"(i));
1595 + /* enabling co-processor CP10 and CP11 accesses in NS world */
1596 + __asm__ __volatile__("orr %0, %0, #0xC00":"=r"(i));
1597 + /* allow allocation of locked TLBs and L2 lines in NS world */
1598 + /* allow use of PLE registers in NS world also */
1599 + __asm__ __volatile__("orr %0, %0, #0x70000":"=r"(i));
1600 + __asm__ __volatile__("mcr p15, 0, %0, c1, c1, 2":"=r"(i));
1602 + /* Enable ASA in ACR register */
1603 + __asm__ __volatile__("mrc p15, 0, %0, c1, c0, 1":"=r"(i));
1604 + __asm__ __volatile__("orr %0, %0, #0x10":"=r"(i));
1605 + __asm__ __volatile__("mcr p15, 0, %0, c1, c0, 1":"=r"(i));
1607 + /* Exiting secure world */
1608 + __asm__ __volatile__("mrc p15, 0, %0, c1, c1, 0":"=r"(i));
1609 + __asm__ __volatile__("orr %0, %0, #0x31":"=r"(i));
1610 + __asm__ __volatile__("mcr p15, 0, %0, c1, c1, 0":"=r"(i));
1613 +/******************************************************************************
1614 + * Routine: setup_auxcr()
1615 + * Description: Write to AuxCR desired value using SMI.
1617 + *****************************************************************************/
1621 + volatile unsigned int j;
1622 + /* Save r0, r12 and restore them after usage */
1623 + __asm__ __volatile__("mov %0, r12":"=r"(j));
1624 + __asm__ __volatile__("mov %0, r0":"=r"(i));
1626 + /* GP Device ROM code API usage here */
1627 + /* r12 = AUXCR Write function and r0 value */
1628 + __asm__ __volatile__("mov r12, #0x3");
1629 + __asm__ __volatile__("mrc p15, 0, r0, c1, c0, 1");
1630 + /* Enabling ASA */
1631 + __asm__ __volatile__("orr r0, r0, #0x10");
1632 + /* SMI instruction to call ROM Code API */
1633 + __asm__ __volatile__(".word 0xE1600070");
1634 + __asm__ __volatile__("mov r0, %0":"=r"(i));
1635 + __asm__ __volatile__("mov r12, %0":"=r"(j));
1638 +/******************************************************************************
1639 + * Routine: try_unlock_sram()
1640 + * Description: If chip is GP/EMU(special) type, unlock the SRAM for
1642 + *****************************************************************************/
1643 +void try_unlock_memory()
1646 + int in_sdram = running_in_sdram();
1648 + /* if GP device unlock device SRAM for general use */
1649 + /* secure code breaks for Secure/Emulation device - HS/E/T */
1650 + mode = get_device_type();
1651 + if (mode == GP_DEVICE)
1652 + secure_unlock_mem();
1654 + /* If device is EMU and boot is XIP external booting
1655 + * Unlock firewalls and disable L2 and put chip
1656 + * out of secure world
1658 + /* Assuming memories are unlocked by the demon who put us in SDRAM */
1659 + if ((mode <= EMU_DEVICE) && (get_boot_type() == 0x1F)
1661 + secure_unlock_mem();
1662 + secureworld_exit();
1668 +/******************************************************************************
1670 + * Description: Does early system init of muxing and clocks.
1671 + * - Called path is with SRAM stack.
1672 + *****************************************************************************/
1675 + int in_sdram = running_in_sdram();
1679 + try_unlock_memory();
1681 + /* Right now flushing at low MPU speed.
1682 + Need to move after clock init */
1683 + v7_flush_dcache_all(get_device_type());
1684 +#ifndef CONFIG_ICACHE_OFF
1688 +#ifdef CONFIG_L2_OFF
1689 + l2cache_disable();
1693 + /* Writing to AuxCR in U-boot using SMI for GP DEV */
1694 + /* Currently SMI in Kernel on ES2 devices seems to have an isse
1695 + * Once that is resolved, we can postpone this config to kernel
1697 + if (get_device_type() == GP_DEVICE)
1700 + set_muxconf_regs();
1705 + per_clocks_enable();
1711 +/******************************************************************************
1712 + * Routine: misc_init_r
1713 + * Description: Init ethernet (done here so udelay works)
1714 + *****************************************************************************/
1715 +int misc_init_r(void)
1718 + unsigned char byte;
1720 +#ifdef CONFIG_DRIVER_OMAP34XX_I2C
1721 + i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
1724 + i2c_write(0x4B, 0x7A, 1, &byte, 1);
1726 + i2c_write(0x4B, 0x7D, 1, &byte, 1);
1728 + i2c_write(0x4B, 0x8E, 1, &byte, 1);
1730 + i2c_write(0x4B, 0x91, 1, &byte, 1);
1732 + i2c_write(0x4B, 0x96, 1, &byte, 1);
1734 + i2c_write(0x4B, 0x99, 1, &byte, 1);
1736 + i2c_write(0x4A, 0xEE, 1, &byte, 1);
1738 + *((uint *) 0x49058034) = 0xFFFFFAF9;
1739 + *((uint *) 0x49056034) = 0x0F9F0FFF;
1740 + *((uint *) 0x49058094) = 0x00000506;
1741 + *((uint *) 0x49056094) = 0xF060F000;
1747 +/******************************************************************************
1748 + * Routine: wait_for_command_complete
1749 + * Description: Wait for posting to finish on watchdog
1750 + *****************************************************************************/
1751 +void wait_for_command_complete(unsigned int wd_base)
1755 + pending = __raw_readl(wd_base + WWPS);
1756 + } while (pending);
1759 +/******************************************************************************
1760 + * Routine: watchdog_init
1761 + * Description: Shut down watch dogs
1762 + *****************************************************************************/
1763 +void watchdog_init(void)
1765 + /* There are 3 watch dogs WD1=Secure, WD2=MPU, WD3=IVA. WD1 is
1766 + * either taken care of by ROM (HS/EMU) or not accessible (GP).
1767 + * We need to take care of WD2-MPU or take a PRCM reset. WD3
1768 + * should not be running and does not generate a PRCM reset.
1771 + sr32(CM_FCLKEN_WKUP, 5, 1, 1);
1772 + sr32(CM_ICLKEN_WKUP, 5, 1, 1);
1773 + wait_on_value(BIT5, 0x20, CM_IDLEST_WKUP, 5); /* some issue here */
1775 + __raw_writel(WD_UNLOCK1, WD2_BASE + WSPR);
1776 + wait_for_command_complete(WD2_BASE);
1777 + __raw_writel(WD_UNLOCK2, WD2_BASE + WSPR);
1780 +/******************************************************************************
1781 + * Routine: dram_init
1782 + * Description: sets uboots idea of sdram size
1783 + *****************************************************************************/
1784 +int dram_init(void)
1786 + DECLARE_GLOBAL_DATA_PTR;
1787 + unsigned int size0 = 0, size1 = 0;
1790 + btype = get_board_type();
1791 + mtype = get_mem_type();
1793 + display_board_info(btype);
1795 + /* If a second bank of DDR is attached to CS1 this is
1796 + * where it can be started. Early init code will init
1799 + if ((mtype == DDR_COMBO) || (mtype == DDR_STACKED))
1800 + do_sdrc_init(SDRC_CS1_OSET, NOT_EARLY);
1802 + size0 = get_sdr_cs_size(SDRC_CS0_OSET);
1803 + size1 = get_sdr_cs_size(SDRC_CS1_OSET);
1805 + gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
1806 + gd->bd->bi_dram[0].size = size0;
1807 + gd->bd->bi_dram[1].start = PHYS_SDRAM_1 + size0;
1808 + gd->bd->bi_dram[1].size = size1;
1813 +/******************************************************************************
1814 + * Routine: set_muxconf_regs
1815 + * Description: Setting up the configuration Mux registers specific to the
1816 + * hardware. Many pins need to be moved from protect to primary
1818 + *****************************************************************************/
1819 +void set_muxconf_regs(void)
1821 + MUX_DEFAULT_ES2();
1824 +#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
1825 +/******************************************************************************
1826 + * Routine: nand+_init
1827 + * Description: Set up nand for nand and jffs2 commands
1828 + *****************************************************************************/
1829 +void nand_init(void)
1831 + extern flash_info_t flash_info[];
1833 + nand_probe(CFG_NAND_ADDR);
1834 + if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN)
1835 + print_size(nand_dev_desc[0].totlen, "\n");
1837 +#ifdef CFG_JFFS2_MEM_NAND
1838 + flash_info[CFG_JFFS2_FIRST_BANK].flash_id = nand_dev_desc[0].id;
1839 + /* only read kernel single meg partition */
1840 + flash_info[CFG_JFFS2_FIRST_BANK].size = 1024 * 1024 * 2;
1841 + /* 1024 blocks in 16meg chip (use less for raw/copied partition) */
1842 + flash_info[CFG_JFFS2_FIRST_BANK].sector_count = 1024;
1843 + /* ?, ram for now, open question, copy to RAM or adapt for NAND */
1844 + flash_info[CFG_JFFS2_FIRST_BANK].start[0] = 0x80200000;
1849 +/******************************************************************************
1850 + * Dummy function to handle errors for EABI incompatibility
1851 + *****************************************************************************/
1856 +/******************************************************************************
1857 + * Dummy function to handle errors for EABI incompatibility
1858 + *****************************************************************************/
1862 diff --git a/board/omap3530beagle/sys_info.c b/board/omap3530beagle/sys_info.c
1863 new file mode 100644
1864 index 0000000..a275557
1866 +++ b/board/omap3530beagle/sys_info.c
1869 + * (C) Copyright 2008
1870 + * Texas Instruments, <www.ti.com>
1872 + * Derived from Beagle Board and 3430 SDP code by
1873 + * Richard Woodruff <r-woodruff2@ti.com>
1874 + * Syed Mohammed Khasim <khasim@ti.com>
1876 + * This program is free software; you can redistribute it and/or
1877 + * modify it under the terms of the GNU General Public License as
1878 + * published by the Free Software Foundation; either version 2 of
1879 + * the License, or (at your option) any later version.
1881 + * This program is distributed in the hope that it will be useful,
1882 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1883 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
1884 + * GNU General Public License for more details.
1886 + * You should have received a copy of the GNU General Public License
1887 + * along with this program; if not, write to the Free Software
1888 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1889 + * MA 02111-1307 USA
1892 +#include <common.h>
1893 +#include <asm/io.h>
1894 +#include <asm/arch/bits.h>
1895 +#include <asm/arch/mem.h> /* get mem tables */
1896 +#include <asm/arch/sys_proto.h>
1899 +/**************************************************************************
1900 + * get_gpmc0_type()
1901 + ***************************************************************************/
1902 +u32 get_gpmc0_type(void)
1904 + /* Default NAND */
1908 +/****************************************************
1909 + * get_cpu_type() - low level get cpu type
1910 + * - no C globals yet.
1911 + ****************************************************/
1912 +u32 get_cpu_type(void)
1914 + /* fixme, need to get register defines for OMAP3 */
1915 + return (CPU_3430);
1918 +/******************************************
1919 + * get_cpu_rev(void) - extract version info
1920 + ******************************************/
1921 +u32 get_cpu_rev(void)
1924 + /* On ES1.0 the IDCODE register is not exposed on L4
1925 + * so using CPU ID to differentiate
1926 + * between ES2.0 and ES1.0.
1928 + __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r"(cpuid));
1929 + if ((cpuid & 0xf) == 0x0)
1930 + return CPU_3430_ES1;
1932 + return CPU_3430_ES2;
1936 +/****************************************************
1937 + * is_mem_sdr() - return 1 if mem type in use is SDR
1938 + ****************************************************/
1939 +u32 is_mem_sdr(void)
1941 + volatile u32 *burst = (volatile u32 *) (SDRC_MR_0 + SDRC_CS0_OSET);
1942 + if (*burst == SDP_SDRC_MR_0_SDR)
1947 +/***********************************************************
1948 + * get_mem_type() - identify type of mDDR part used.
1949 + ***********************************************************/
1950 +u32 get_mem_type(void)
1952 + /* Current SDP3430 uses 2x16 MDDR Infenion parts */
1953 + return (DDR_DISCRETE);
1956 +/***********************************************************************
1957 + * get_cs0_size() - get size of chip select 0/1
1958 + ************************************************************************/
1959 +u32 get_sdr_cs_size(u32 offset)
1963 + /* get ram size field */
1964 + size = __raw_readl(SDRC_MCFG_0 + offset) >> 8;
1965 + size &= 0x3FF; /* remove unwanted bits */
1966 + size *= SZ_2M; /* find size in MB */
1970 +/***********************************************************************
1971 + * get_board_type() - get board type based on current production stats.
1972 + * - NOTE-1-: 2 I2C EEPROMs will someday be populated with proper info.
1973 + * when they are available we can get info from there. This should
1974 + * be correct of all known boards up until today.
1975 + * - NOTE-2- EEPROMs are populated but they are updated very slowly. To
1976 + * avoid waiting on them we will use ES version of the chip to get info.
1977 + * A later version of the FPGA migth solve their speed issue.
1978 + ************************************************************************/
1979 +u32 get_board_type(void)
1981 + if (get_cpu_rev() == CPU_3430_ES2)
1982 + return SDP_3430_V2;
1984 + return SDP_3430_V1;
1987 +/******************************************************************
1988 + * get_sysboot_value() - get init word settings
1989 + ******************************************************************/
1990 +inline u32 get_sysboot_value(void)
1992 + return (0x0000003F & __raw_readl(CONTROL_STATUS));
1995 +/***************************************************************************
1996 + * get_gpmc0_base() - Return current address hardware will be
1997 + * fetching from. The below effectively gives what is correct, its a bit
1998 + * mis-leading compared to the TRM. For the most general case the mask
1999 + * needs to be also taken into account this does work in practice.
2000 + * - for u-boot we currently map:
2001 + * -- 0 to nothing,
2005 + ****************************************************************************/
2006 +u32 get_gpmc0_base(void)
2010 + b = __raw_readl(GPMC_CONFIG_CS0 + GPMC_CONFIG7);
2011 + b &= 0x1F; /* keep base [5:0] */
2012 + b = b << 24; /* ret 0x0b000000 */
2016 +/*******************************************************************
2017 + * get_gpmc0_width() - See if bus is in x8 or x16 (mainly for nand)
2018 + *******************************************************************/
2019 +u32 get_gpmc0_width(void)
2021 + return (WIDTH_16BIT);
2024 +/*************************************************************************
2025 + * get_board_rev() - setup to pass kernel board revision information
2026 + * returns:(bit[0-3] sub version, higher bit[7-4] is higher version)
2027 + *************************************************************************/
2028 +u32 get_board_rev(void)
2033 +/*********************************************************************
2034 + * display_board_info() - print banner with board info.
2035 + *********************************************************************/
2036 +void display_board_info(u32 btype)
2038 + char *bootmode[] = {
2048 + u32 brev = get_board_rev();
2049 + char cpu_3430s[] = "3530";
2050 + char db_ver[] = "0.0"; /* board type */
2051 + char mem_sdr[] = "mSDR"; /* memory type */
2052 + char mem_ddr[] = "LPDDR";
2053 + char t_tst[] = "TST"; /* security level */
2054 + char t_emu[] = "EMU";
2055 + char t_hs[] = "HS";
2056 + char t_gp[] = "GP";
2058 +#ifdef CONFIG_LED_INFO
2059 + char led_string[CONFIG_LED_LEN] = { 0 };
2061 + char p_l3[] = "165";
2062 + char p_cpu[] = "2";
2064 + char *cpu_s, *db_s, *mem_s, *sec_s;
2065 + u32 cpu, rev, sec;
2067 + rev = get_cpu_rev();
2068 + cpu = get_cpu_type();
2069 + sec = get_device_type();
2076 + cpu_s = cpu_3430s;
2079 + db_s[0] += (brev >> 4) & 0xF;
2080 + db_s[2] += brev & 0xF;
2099 + printf("OMAP%s-%s rev %d, CPU-OPP%s L3-%sMHz\n", cpu_s, sec_s, rev,
2101 + printf("OMAP3 Beagle Board + %s/%s\n",
2102 + mem_s, bootmode[get_gpmc0_type()]);
2106 +/********************************************************
2107 + * get_base(); get upper addr of current execution
2108 + *******************************************************/
2113 + __asm__ __volatile__("mov %0, pc \n":"=r"(val)::"memory");
2114 + val &= 0xF0000000;
2119 +/********************************************************
2120 + * running_in_flash() - tell if currently running in
2122 + *******************************************************/
2123 +u32 running_in_flash(void)
2125 + if (get_base() < 4)
2126 + return (1); /* in flash */
2128 + return (0); /* running in SRAM or SDRAM */
2131 +/********************************************************
2132 + * running_in_sram() - tell if currently running in
2134 + *******************************************************/
2135 +u32 running_in_sram(void)
2137 + if (get_base() == 4)
2138 + return (1); /* in SRAM */
2140 + return (0); /* running in FLASH or SDRAM */
2143 +/********************************************************
2144 + * running_in_sdram() - tell if currently running in
2146 + *******************************************************/
2147 +u32 running_in_sdram(void)
2149 + if (get_base() > 4)
2150 + return (1); /* in sdram */
2152 + return (0); /* running in SRAM or FLASH */
2155 +/***************************************************************
2156 + * get_boot_type() - Is this an XIP type device or a stream one
2157 + * bits 4-0 specify type. Bit 5 sys mem/perif
2158 + ***************************************************************/
2159 +u32 get_boot_type(void)
2163 + v = get_sysboot_value() & (BIT4 | BIT3 | BIT2 | BIT1 | BIT0);
2167 +/*************************************************************
2168 + * get_device_type(): tell if GP/HS/EMU/TST
2169 + *************************************************************/
2170 +u32 get_device_type(void)
2174 + mode = __raw_readl(CONTROL_STATUS) & (DEVICE_MASK);
2175 + return (mode >>= 8);
2177 diff --git a/board/omap3530beagle/syslib.c b/board/omap3530beagle/syslib.c
2178 new file mode 100644
2179 index 0000000..002c6e8
2181 +++ b/board/omap3530beagle/syslib.c
2184 + * (C) Copyright 2008
2185 + * Texas Instruments, <www.ti.com>
2187 + * Richard Woodruff <r-woodruff2@ti.com>
2188 + * Syed Mohammed Khasim <khasim@ti.com>
2190 + * This program is free software; you can redistribute it and/or
2191 + * modify it under the terms of the GNU General Public License as
2192 + * published by the Free Software Foundation; either version 2 of
2193 + * the License, or (at your option) any later version.
2195 + * This program is distributed in the hope that it will be useful,
2196 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2197 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2198 + * GNU General Public License for more details.
2200 + * You should have received a copy of the GNU General Public License
2201 + * along with this program; if not, write to the Free Software
2202 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2203 + * MA 02111-1307 USA
2206 +#include <common.h>
2207 +#include <asm/io.h>
2208 +#include <asm/arch/bits.h>
2209 +#include <asm/arch/mem.h>
2210 +#include <asm/arch/clocks.h>
2211 +#include <asm/arch/sys_proto.h>
2213 +/************************************************************
2214 + * sdelay() - simple spin loop. Will be constant time as
2215 + * its generally used in bypass conditions only. This
2216 + * is necessary until timers are accessible.
2218 + * not inline to increase chances its in cache when called
2219 + *************************************************************/
2220 +void sdelay(unsigned long loops)
2222 + __asm__ volatile ("1:\n" "subs %0, %1, #1\n"
2223 + "bne 1b":"=r" (loops):"0"(loops));
2226 +/*****************************************************************
2227 + * sr32 - clear & set a value in a bit range for a 32 bit address
2228 + *****************************************************************/
2229 +void sr32(u32 addr, u32 start_bit, u32 num_bits, u32 value)
2232 + msk = 1 << num_bits;
2234 + tmp = __raw_readl(addr) & ~(msk << start_bit);
2235 + tmp |= value << start_bit;
2236 + __raw_writel(tmp, addr);
2239 +/*********************************************************************
2240 + * wait_on_value() - common routine to allow waiting for changes in
2242 + *********************************************************************/
2243 +u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
2248 + val = __raw_readl(read_addr) & read_bit_mask;
2249 + if (val == match_value)
2255 diff --git a/board/omap3530beagle/u-boot.lds b/board/omap3530beagle/u-boot.lds
2256 new file mode 100644
2257 index 0000000..72f15f6
2259 +++ b/board/omap3530beagle/u-boot.lds
2262 + * January 2004 - Changed to support H4 device
2263 + * Copyright (c) 2004 Texas Instruments
2265 + * (C) Copyright 2002
2266 + * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
2268 + * See file CREDITS for list of people who contributed to this
2271 + * This program is free software; you can redistribute it and/or
2272 + * modify it under the terms of the GNU General Public License as
2273 + * published by the Free Software Foundation; either version 2 of
2274 + * the License, or (at your option) any later version.
2276 + * This program is distributed in the hope that it will be useful,
2277 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2278 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2279 + * GNU General Public License for more details.
2281 + * You should have received a copy of the GNU General Public License
2282 + * along with this program; if not, write to the Free Software
2283 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2284 + * MA 02111-1307 USA
2287 +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
2297 + cpu/omap3/start.o (.text)
2302 + .rodata : { *(.rodata) }
2304 + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
2305 + __exidx_start = .;
2306 + .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
2310 + .data : { *(.data) }
2313 + .got : { *(.got) }
2315 + __u_boot_cmd_start = .;
2316 + .u_boot_cmd : { *(.u_boot_cmd) }
2317 + __u_boot_cmd_end = .;
2321 + .bss : { *(.bss) }
2324 diff --git a/common/cmd_nand.c b/common/cmd_nand.c
2325 index 9e38bf7..0ae362c 100644
2326 --- a/common/cmd_nand.c
2327 +++ b/common/cmd_nand.c
2328 @@ -37,6 +37,12 @@ int find_dev_and_part(const char *id, struct mtd_device **dev,
2329 u8 *part_num, struct part_info **part);
2332 +#if defined(CONFIG_OMAP) && (defined(CONFIG_OMAP3_BEAGLE))
2333 +extern void omap_nand_switch_ecc(nand_info_t *nand, int hardware);
2335 +#define omap_nand_switch_ecc(x, y) do {} while(0)
2338 static int nand_dump_oob(nand_info_t *nand, ulong off)
2341 @@ -222,7 +228,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
2342 strncmp(cmd, "dump", 4) != 0 &&
2343 strncmp(cmd, "read", 4) != 0 && strncmp(cmd, "write", 5) != 0 &&
2344 strcmp(cmd, "scrub") != 0 && strcmp(cmd, "markbad") != 0 &&
2345 - strcmp(cmd, "biterr") != 0 &&
2346 + strcmp(cmd, "biterr") != 0 && strncmp(cmd, "ecc", 3) != 0 &&
2347 strcmp(cmd, "lock") != 0 && strcmp(cmd, "unlock") != 0 )
2350 @@ -307,6 +313,19 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
2354 + if (strncmp(cmd, "ecc", 3) == 0) {
2357 + if (strncmp(argv[2], "hw", 2) == 0)
2358 + omap_nand_switch_ecc(nand, 1);
2359 + else if (strncmp(argv[2], "sw", 2) == 0)
2360 + omap_nand_switch_ecc(nand, 0);
2368 if (strncmp(cmd, "read", 4) == 0 || strncmp(cmd, "write", 5) == 0) {
2370 @@ -472,6 +491,7 @@ U_BOOT_CMD(nand, 5, 1, do_nand,
2371 "nand scrub - really clean NAND erasing bad blocks (UNSAFE)\n"
2372 "nand markbad off - mark bad block at offset (UNSAFE)\n"
2373 "nand biterr off - make a bit error at offset (UNSAFE)\n"
2374 + "nand ecc [hw/sw] - switch the ecc calculation algorithm \n"
2375 "nand lock [tight] [status] - bring nand to lock state or display locked pages\n"
2376 "nand unlock [offset] [size] - unlock section\n");
2378 diff --git a/cpu/omap3/Makefile b/cpu/omap3/Makefile
2379 new file mode 100644
2380 index 0000000..097447a
2382 +++ b/cpu/omap3/Makefile
2385 +# (C) Copyright 2000-2003
2386 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
2388 +# See file CREDITS for list of people who contributed to this
2391 +# This program is free software; you can redistribute it and/or
2392 +# modify it under the terms of the GNU General Public License as
2393 +# published by the Free Software Foundation; either version 2 of
2394 +# the License, or (at your option) any later version.
2396 +# This program is distributed in the hope that it will be useful,
2397 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2398 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2399 +# GNU General Public License for more details.
2401 +# You should have received a copy of the GNU General Public License
2402 +# along with this program; if not, write to the Free Software
2403 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2404 +# MA 02111-1307 USA
2407 +include $(TOPDIR)/config.mk
2412 +OBJS = interrupts.o cpu.o mmc.o
2414 +all: .depend $(START) $(LIB)
2417 + $(AR) crv $@ $(OBJS)
2419 +#########################################################################
2421 +.depend: Makefile $(START:.o=.S) $(OBJS:.o=.c)
2422 + $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
2426 +#########################################################################
2427 diff --git a/cpu/omap3/config.mk b/cpu/omap3/config.mk
2428 new file mode 100644
2429 index 0000000..7551677
2431 +++ b/cpu/omap3/config.mk
2434 +# (C) Copyright 2002
2435 +# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
2437 +# See file CREDITS for list of people who contributed to this
2440 +# This program is free software; you can redistribute it and/or
2441 +# modify it under the terms of the GNU General Public License as
2442 +# published by the Free Software Foundation; either version 2 of
2443 +# the License, or (at your option) any later version.
2445 +# This program is distributed in the hope that it will be useful,
2446 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2447 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2448 +# GNU General Public License for more details.
2450 +# You should have received a copy of the GNU General Public License
2451 +# along with this program; if not, write to the Free Software
2452 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2453 +# MA 02111-1307 USA
2455 +PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
2458 +PLATFORM_CPPFLAGS += -march=armv7a
2459 +# =========================================================================
2461 +# Supply options according to compiler version
2463 +# =========================================================================
2464 +#PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
2465 +PLATFORM_CPPFLAGS +=$(call cc-option)
2466 +PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
2467 diff --git a/cpu/omap3/cpu.c b/cpu/omap3/cpu.c
2468 new file mode 100644
2469 index 0000000..59e6a58
2471 +++ b/cpu/omap3/cpu.c
2474 + * (C) Copyright 2008 Texas Insturments
2476 + * (C) Copyright 2002
2477 + * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
2478 + * Marius Groeger <mgroeger@sysgo.de>
2480 + * (C) Copyright 2002
2481 + * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
2483 + * See file CREDITS for list of people who contributed to this
2486 + * This program is free software; you can redistribute it and/or
2487 + * modify it under the terms of the GNU General Public License as
2488 + * published by the Free Software Foundation; either version 2 of
2489 + * the License, or (at your option) any later version.
2491 + * This program is distributed in the hope that it will be useful,
2492 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2493 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2494 + * GNU General Public License for more details.
2496 + * You should have received a copy of the GNU General Public License
2497 + * along with this program; if not, write to the Free Software
2498 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2499 + * MA 02111-1307 USA
2503 + * CPU specific code
2506 +#include <common.h>
2507 +#include <command.h>
2508 +#include <asm/arch/sys_proto.h>
2510 +#ifdef CONFIG_USE_IRQ
2511 +DECLARE_GLOBAL_DATA_PTR;
2514 +#ifndef CONFIG_L2_OFF
2515 +void l2cache_disable(void);
2518 +/* read co-processor 15, register #1 (control register) */
2519 +static unsigned long read_p15_c1(void)
2521 + unsigned long value;
2523 + __asm__ __volatile__("mrc p15, 0, %0, c1, c0, 0\
2524 + @ read control reg\n":"=r"(value)
2529 +/* write to co-processor 15, register #1 (control register) */
2530 +static void write_p15_c1(unsigned long value)
2532 + __asm__ __volatile__("mcr p15, 0, %0, c1, c0, 0\
2533 + @ write it back\n"::"r"(value)
2539 +static void cp_delay(void)
2543 + /* Many OMAP regs need at least 2 nops */
2544 + for (i = 0; i < 100; i++) ;
2547 +/* See also ARM Ref. Man. */
2548 +#define C1_MMU (1<<0) /* mmu off/on */
2549 +#define C1_ALIGN (1<<1) /* alignment faults off/on */
2550 +#define C1_DC (1<<2) /* dcache off/on */
2551 +#define C1_WB (1<<3) /* merging write buffer on/off */
2552 +#define C1_BIG_ENDIAN (1<<7) /* big endian off/on */
2553 +#define C1_SYS_PROT (1<<8) /* system protection */
2554 +#define C1_ROM_PROT (1<<9) /* ROM protection */
2555 +#define C1_IC (1<<12) /* icache off/on */
2556 +#define C1_HIGH_VECTORS (1<<13) /* location of vectors: low/high addresses */
2557 +#define RESERVED_1 (0xf << 3) /* must be 111b for R/W */
2562 + * setup up stacks if necessary
2564 +#ifdef CONFIG_USE_IRQ
2566 + _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
2567 + FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
2572 +int cleanup_before_linux(void)
2577 + * this function is called just before we call linux
2578 + * it prepares the processor for linux
2580 + * we turn off caches etc ...
2582 + disable_interrupts();
2584 + /* turn off I/D-cache */
2585 + asm("mrc p15, 0, %0, c1, c0, 0":"=r"(i));
2586 + i &= ~(C1_DC | C1_IC);
2587 + asm("mcr p15, 0, %0, c1, c0, 0": :"r"(i));
2589 + /* invalidate I-cache */
2590 + arm_cache_flush();
2591 +#ifndef CONFIG_L2_OFF
2592 + /* turn off L2 cache */
2593 + l2cache_disable();
2594 + /* invalidate L2 cache also */
2595 + v7_flush_dcache_all(get_device_type());
2598 + /* mem barrier to sync up things */
2599 + asm("mcr p15, 0, %0, c7, c10, 4": :"r"(i));
2601 +#ifndef CONFIG_L2_OFF
2608 +int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
2610 + disable_interrupts();
2617 +void icache_enable(void)
2621 + reg = read_p15_c1(); /* get control reg. */
2623 + write_p15_c1(reg | C1_IC);
2626 +void icache_disable(void)
2630 + reg = read_p15_c1();
2632 + write_p15_c1(reg & ~C1_IC);
2635 +void l2cache_enable()
2638 + volatile unsigned int j;
2640 + /* ES2 onwards we can disable/enable L2 ourselves */
2641 + if (get_cpu_rev() == CPU_3430_ES2) {
2642 + __asm__ __volatile__("mrc p15, 0, %0, c1, c0, 1":"=r"(i));
2643 + __asm__ __volatile__("orr %0, %0, #0x2":"=r"(i));
2644 + __asm__ __volatile__("mcr p15, 0, %0, c1, c0, 1":"=r"(i));
2646 + /* Save r0, r12 and restore them after usage */
2647 + __asm__ __volatile__("mov %0, r12":"=r"(j));
2648 + __asm__ __volatile__("mov %0, r0":"=r"(i));
2650 + /* GP Device ROM code API usage here */
2651 + /* r12 = AUXCR Write function and r0 value */
2652 + __asm__ __volatile__("mov r12, #0x3");
2653 + __asm__ __volatile__("mrc p15, 0, r0, c1, c0, 1");
2654 + __asm__ __volatile__("orr r0, r0, #0x2");
2655 + /* SMI instruction to call ROM Code API */
2656 + __asm__ __volatile__(".word 0xE1600070");
2657 + __asm__ __volatile__("mov r0, %0":"=r"(i));
2658 + __asm__ __volatile__("mov r12, %0":"=r"(j));
2663 +void l2cache_disable()
2666 + volatile unsigned int j;
2668 + /* ES2 onwards we can disable/enable L2 ourselves */
2669 + if (get_cpu_rev() == CPU_3430_ES2) {
2670 + __asm__ __volatile__("mrc p15, 0, %0, c1, c0, 1":"=r"(i));
2671 + __asm__ __volatile__("bic %0, %0, #0x2":"=r"(i));
2672 + __asm__ __volatile__("mcr p15, 0, %0, c1, c0, 1":"=r"(i));
2674 + /* Save r0, r12 and restore them after usage */
2675 + __asm__ __volatile__("mov %0, r12":"=r"(j));
2676 + __asm__ __volatile__("mov %0, r0":"=r"(i));
2678 + /* GP Device ROM code API usage here */
2679 + /* r12 = AUXCR Write function and r0 value */
2680 + __asm__ __volatile__("mov r12, #0x3");
2681 + __asm__ __volatile__("mrc p15, 0, r0, c1, c0, 1");
2682 + __asm__ __volatile__("bic r0, r0, #0x2");
2683 + /* SMI instruction to call ROM Code API */
2684 + __asm__ __volatile__(".word 0xE1600070");
2685 + __asm__ __volatile__("mov r0, %0":"=r"(i));
2686 + __asm__ __volatile__("mov r12, %0":"=r"(j));
2690 +int icache_status(void)
2692 + return (read_p15_c1() & C1_IC) != 0;
2694 diff --git a/cpu/omap3/interrupts.c b/cpu/omap3/interrupts.c
2695 new file mode 100644
2696 index 0000000..818b833
2698 +++ b/cpu/omap3/interrupts.c
2701 + * (C) Copyright 2008
2702 + * Texas Instruments
2704 + * Richard Woodruff <r-woodruff2@ti.com>
2705 + * Syed Moahmmed Khasim <khasim@ti.com>
2707 + * (C) Copyright 2002
2708 + * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
2709 + * Marius Groeger <mgroeger@sysgo.de>
2710 + * Alex Zuepke <azu@sysgo.de>
2712 + * (C) Copyright 2002
2713 + * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
2715 + * See file CREDITS for list of people who contributed to this
2718 + * This program is free software; you can redistribute it and/or
2719 + * modify it under the terms of the GNU General Public License as
2720 + * published by the Free Software Foundation; either version 2 of
2721 + * the License, or (at your option) any later version.
2723 + * This program is distributed in the hope that it will be useful,
2724 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2725 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2726 + * GNU General Public License for more details.
2728 + * You should have received a copy of the GNU General Public License
2729 + * along with this program; if not, write to the Free Software
2730 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2731 + * MA 02111-1307 USA
2734 +#include <common.h>
2735 +#include <asm/arch/bits.h>
2737 +#include <asm/proc-armv/ptrace.h>
2739 +#define TIMER_LOAD_VAL 0
2741 +/* macro to read the 32 bit timer */
2742 +#define READ_TIMER (*(volatile ulong *)(CFG_TIMERBASE+TCRR))
2744 +#ifdef CONFIG_USE_IRQ
2745 +/* enable IRQ interrupts */
2746 +void enable_interrupts(void)
2748 + unsigned long temp;
2749 + __asm__ __volatile__("mrs %0, cpsr\n"
2750 + "bic %0, %0, #0x80\n" "msr cpsr_c, %0":"=r"(temp)
2755 + * disable IRQ/FIQ interrupts
2756 + * returns true if interrupts had been enabled before we disabled them
2758 +int disable_interrupts(void)
2760 + unsigned long old, temp;
2761 + __asm__ __volatile__("mrs %0, cpsr\n"
2762 + "orr %1, %0, #0xc0\n"
2763 + "msr cpsr_c, %1":"=r"(old), "=r"(temp)
2765 + return (old & 0x80) == 0;
2768 +void enable_interrupts(void)
2772 +int disable_interrupts(void)
2778 +void bad_mode(void)
2780 + panic("Resetting CPU ...\n");
2784 +void show_regs(struct pt_regs *regs)
2786 + unsigned long flags;
2787 + const char *processor_modes[] = {
2788 + "USER_26", "FIQ_26", "IRQ_26", "SVC_26",
2789 + "UK4_26", "UK5_26", "UK6_26", "UK7_26",
2790 + "UK8_26", "UK9_26", "UK10_26", "UK11_26",
2791 + "UK12_26", "UK13_26", "UK14_26", "UK15_26",
2792 + "USER_32", "FIQ_32", "IRQ_32", "SVC_32",
2793 + "UK4_32", "UK5_32", "UK6_32", "ABT_32",
2794 + "UK8_32", "UK9_32", "UK10_32", "UND_32",
2795 + "UK12_32", "UK13_32", "UK14_32", "SYS_32",
2798 + flags = condition_codes(regs);
2800 + printf("pc : [<%08lx>] lr : [<%08lx>]\n"
2801 + "sp : %08lx ip : %08lx fp : %08lx\n",
2802 + instruction_pointer(regs),
2803 + regs->ARM_lr, regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
2804 + printf("r10: %08lx r9 : %08lx r8 : %08lx\n",
2805 + regs->ARM_r10, regs->ARM_r9, regs->ARM_r8);
2806 + printf("r7 : %08lx r6 : %08lx r5 : %08lx r4 : %08lx\n",
2807 + regs->ARM_r7, regs->ARM_r6, regs->ARM_r5, regs->ARM_r4);
2808 + printf("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n",
2809 + regs->ARM_r3, regs->ARM_r2, regs->ARM_r1, regs->ARM_r0);
2810 + printf("Flags: %c%c%c%c",
2811 + flags & CC_N_BIT ? 'N' : 'n',
2812 + flags & CC_Z_BIT ? 'Z' : 'z',
2813 + flags & CC_C_BIT ? 'C' : 'c', flags & CC_V_BIT ? 'V' : 'v');
2814 + printf(" IRQs %s FIQs %s Mode %s%s\n",
2815 + interrupts_enabled(regs) ? "on" : "off",
2816 + fast_interrupts_enabled(regs) ? "on" : "off",
2817 + processor_modes[processor_mode(regs)],
2818 + thumb_mode(regs) ? " (T)" : "");
2821 +void do_undefined_instruction(struct pt_regs *pt_regs)
2823 + printf("undefined instruction\n");
2824 + show_regs(pt_regs);
2828 +void do_software_interrupt(struct pt_regs *pt_regs)
2830 + printf("software interrupt\n");
2831 + show_regs(pt_regs);
2835 +void do_prefetch_abort(struct pt_regs *pt_regs)
2837 + printf("prefetch abort\n");
2838 + show_regs(pt_regs);
2842 +void do_data_abort(struct pt_regs *pt_regs)
2844 + printf("data abort\n");
2845 + show_regs(pt_regs);
2849 +void do_not_used(struct pt_regs *pt_regs)
2851 + printf("not used\n");
2852 + show_regs(pt_regs);
2856 +void do_fiq(struct pt_regs *pt_regs)
2858 + printf("fast interrupt request\n");
2859 + show_regs(pt_regs);
2863 +void do_irq(struct pt_regs *pt_regs)
2865 + printf("interrupt request\n");
2866 + show_regs(pt_regs);
2871 +static ulong timestamp;
2872 +static ulong lastinc;
2874 +/* nothing really to do with interrupts, just starts up a counter. */
2875 +int interrupt_init(void)
2879 + /* Start the counter ticking up */
2880 + /* reload value on overflow */
2881 + *((int32_t *) (CFG_TIMERBASE + TLDR)) = TIMER_LOAD_VAL;
2882 + /* mask to enable timer */
2883 + val = (CFG_PVT << 2) | BIT5 | BIT1 | BIT0;
2884 + *((int32_t *) (CFG_TIMERBASE + TCLR)) = val; /* start timer */
2886 + reset_timer_masked(); /* init the timestamp and lastinc value */
2892 + * timer without interrupts
2894 +void reset_timer(void)
2896 + reset_timer_masked();
2899 +ulong get_timer(ulong base)
2901 + return get_timer_masked() - base;
2904 +void set_timer(ulong t)
2909 +/* delay x useconds AND perserve advance timstamp value */
2910 +void udelay(unsigned long usec)
2914 + /* if "big" number, spread normalization to seconds */
2915 + if (usec >= 1000) {
2916 + /* if "big" number, spread normalization to seconds */
2917 + tmo = usec / 1000;
2918 + /* find number of "ticks" to wait to achieve target */
2920 + tmo /= 1000; /* finish normalize. */
2921 + } else {/* else small number, don't kill it prior to HZ multiply */
2922 + tmo = usec * CFG_HZ;
2923 + tmo /= (1000 * 1000);
2926 + tmp = get_timer(0); /* get current timestamp */
2927 + /* if setting this forward will roll time stamp */
2928 + if ((tmo + tmp + 1) < tmp)
2929 + /* reset "advancing" timestamp to 0, set lastinc value */
2930 + reset_timer_masked();
2932 + tmo += tmp; /* else, set advancing stamp wake up time */
2933 + while (get_timer_masked() < tmo) /* loop till event */
2937 +void reset_timer_masked(void)
2940 + lastinc = READ_TIMER; /* capture current incrementer value time */
2941 + timestamp = 0; /* start "advancing" time stamp from 0 */
2944 +ulong get_timer_masked(void)
2946 + ulong now = READ_TIMER; /* current tick value */
2948 + if (now >= lastinc) /* normal mode (non roll) */
2949 + /* move stamp fordward with absoulte diff ticks */
2950 + timestamp += (now - lastinc);
2951 + else /* we have rollover of incrementer */
2952 + timestamp += (0xFFFFFFFF - lastinc) + now;
2957 +/* waits specified delay value and resets timestamp */
2958 +void udelay_masked(unsigned long usec)
2964 + /* if "big" number, spread normalization to seconds */
2965 + if (usec >= 1000) {
2966 + /* start to normalize for usec to ticks per sec */
2967 + tmo = usec / 1000;
2968 + /* find number of "ticks" to wait to achieve target */
2970 + tmo /= 1000; /* finish normalize. */
2971 + } else { /* else small number, */
2972 + /* don't kill it prior to HZ multiply */
2973 + tmo = usec * CFG_HZ;
2974 + tmo /= (1000 * 1000);
2976 + endtime = get_timer_masked() + tmo;
2979 + ulong now = get_timer_masked();
2980 + diff = endtime - now;
2981 + } while (diff >= 0);
2985 + * This function is derived from PowerPC code (read timebase as long long).
2986 + * On ARM it just returns the timer value.
2988 +unsigned long long get_ticks(void)
2990 + return get_timer(0);
2994 + * This function is derived from PowerPC code (timebase clock frequency).
2995 + * On ARM it returns the number of timer ticks per second.
2997 +ulong get_tbclk(void)
3004 diff --git a/cpu/omap3/mmc.c b/cpu/omap3/mmc.c
3005 new file mode 100644
3006 index 0000000..741360b
3008 +++ b/cpu/omap3/mmc.c
3011 + * (C) Copyright 2008
3012 + * Texas Instruments, <www.ti.com>
3013 + * Syed Mohammed Khasim <khasim@ti.com>
3015 + * See file CREDITS for list of people who contributed to this
3018 + * This program is free software; you can redistribute it and/or
3019 + * modify it under the terms of the GNU General Public License as
3020 + * published by the Free Software Foundation's version 2 of
3023 + * This program is distributed in the hope that it will be useful,
3024 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3025 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3026 + * GNU General Public License for more details.
3028 + * You should have received a copy of the GNU General Public License
3029 + * along with this program; if not, write to the Free Software
3030 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3031 + * MA 02111-1307 USA
3034 +#include <config.h>
3035 +#include <common.h>
3041 +const unsigned short mmc_transspeed_val[15][4] = {
3042 + {CLKD(10, 1), CLKD(10, 10), CLKD(10, 100), CLKD(10, 1000)},
3043 + {CLKD(12, 1), CLKD(12, 10), CLKD(12, 100), CLKD(12, 1000)},
3044 + {CLKD(13, 1), CLKD(13, 10), CLKD(13, 100), CLKD(13, 1000)},
3045 + {CLKD(15, 1), CLKD(15, 10), CLKD(15, 100), CLKD(15, 1000)},
3046 + {CLKD(20, 1), CLKD(20, 10), CLKD(20, 100), CLKD(20, 1000)},
3047 + {CLKD(26, 1), CLKD(26, 10), CLKD(26, 100), CLKD(26, 1000)},
3048 + {CLKD(30, 1), CLKD(30, 10), CLKD(30, 100), CLKD(30, 1000)},
3049 + {CLKD(35, 1), CLKD(35, 10), CLKD(35, 100), CLKD(35, 1000)},
3050 + {CLKD(40, 1), CLKD(40, 10), CLKD(40, 100), CLKD(40, 1000)},
3051 + {CLKD(45, 1), CLKD(45, 10), CLKD(45, 100), CLKD(45, 1000)},
3052 + {CLKD(52, 1), CLKD(52, 10), CLKD(52, 100), CLKD(52, 1000)},
3053 + {CLKD(55, 1), CLKD(55, 10), CLKD(55, 100), CLKD(55, 1000)},
3054 + {CLKD(60, 1), CLKD(60, 10), CLKD(60, 100), CLKD(60, 1000)},
3055 + {CLKD(70, 1), CLKD(70, 10), CLKD(70, 100), CLKD(70, 1000)},
3056 + {CLKD(80, 1), CLKD(80, 10), CLKD(80, 100), CLKD(80, 1000)}
3059 +mmc_card_data cur_card_data;
3060 +static block_dev_desc_t mmc_blk_dev;
3062 +block_dev_desc_t *mmc_get_dev(int dev)
3064 + return ((block_dev_desc_t *) &mmc_blk_dev);
3067 +void twl4030_mmc_config(void)
3069 + unsigned char data;
3072 + i2c_write(0x4B, 0x82, 1, &data, 1);
3074 + i2c_write(0x4B, 0x85, 1, &data, 1);
3077 +unsigned char mmc_board_init(void)
3079 + unsigned int value = 0;
3081 + twl4030_mmc_config();
3083 + value = CONTROL_PBIAS_LITE;
3084 + CONTROL_PBIAS_LITE = value | (1 << 2) | (1 << 1) | (1 << 9);
3086 + value = CONTROL_DEV_CONF0;
3087 + CONTROL_DEV_CONF0 = value | (1 << 24);
3092 +void mmc_init_stream(void)
3094 + volatile unsigned int mmc_stat;
3096 + OMAP_HSMMC_CON |= INIT_INITSTREAM;
3098 + OMAP_HSMMC_CMD = MMC_CMD0;
3100 + mmc_stat = OMAP_HSMMC_STAT;
3101 + } while (!(mmc_stat & CC_MASK));
3103 + OMAP_HSMMC_STAT = CC_MASK;
3105 + OMAP_HSMMC_CMD = MMC_CMD0;
3107 + mmc_stat = OMAP_HSMMC_STAT;
3108 + } while (!(mmc_stat & CC_MASK));
3110 + OMAP_HSMMC_STAT = OMAP_HSMMC_STAT;
3111 + OMAP_HSMMC_CON &= ~INIT_INITSTREAM;
3114 +unsigned char mmc_clock_config(unsigned int iclk, unsigned short clk_div)
3118 + mmc_reg_out(OMAP_HSMMC_SYSCTL, (ICE_MASK | DTO_MASK | CEN_MASK),
3119 + (ICE_STOP | DTO_15THDTO | CEN_DISABLE));
3123 + val = MMC_INIT_SEQ_CLK / 2;
3126 + val = MMC_400kHz_CLK;
3134 + mmc_reg_out(OMAP_HSMMC_SYSCTL,
3135 + ICE_MASK | CLKD_MASK, (val << CLKD_OFFSET) | ICE_OSCILLATE);
3137 + while ((OMAP_HSMMC_SYSCTL & ICS_MASK) == ICS_NOTREADY) {
3140 + OMAP_HSMMC_SYSCTL |= CEN_ENABLE;
3144 +unsigned char mmc_init_setup(void)
3146 + unsigned int reg_val;
3150 + OMAP_HSMMC_SYSCONFIG |= MMC_SOFTRESET;
3151 + while ((OMAP_HSMMC_SYSSTATUS & RESETDONE) == 0) ;
3153 + OMAP_HSMMC_SYSCTL |= SOFTRESETALL;
3154 + while ((OMAP_HSMMC_SYSCTL & SOFTRESETALL) != 0x0) ;
3156 + OMAP_HSMMC_HCTL = DTW_1_BITMODE | SDBP_PWROFF | SDVS_3V0;
3157 + OMAP_HSMMC_CAPA |= VS30_3V0SUP | VS18_1V8SUP;
3159 + reg_val = OMAP_HSMMC_CON & RESERVED_MASK;
3161 + OMAP_HSMMC_CON = CTPL_MMC_SD | reg_val | WPP_ACTIVEHIGH |
3162 + CDP_ACTIVEHIGH | MIT_CTO | DW8_1_4BITMODE | MODE_FUNC |
3163 + STR_BLOCK | HR_NOHOSTRESP | INIT_NOINIT | NOOPENDRAIN;
3165 + mmc_clock_config(CLK_INITSEQ, 0);
3166 + OMAP_HSMMC_HCTL |= SDBP_PWRON;
3168 + OMAP_HSMMC_IE = 0x307f0033;
3170 + mmc_init_stream();
3174 +unsigned char mmc_send_cmd(unsigned int cmd, unsigned int arg,
3175 + unsigned int *response)
3177 + volatile unsigned int mmc_stat;
3179 + while ((OMAP_HSMMC_PSTATE & DATI_MASK) == DATI_CMDDIS) {
3182 + OMAP_HSMMC_BLK = BLEN_512BYTESLEN | NBLK_STPCNT;
3183 + OMAP_HSMMC_STAT = 0xFFFFFFFF;
3184 + OMAP_HSMMC_ARG = arg;
3185 + OMAP_HSMMC_CMD = cmd | CMD_TYPE_NORMAL | CICE_NOCHECK |
3186 + CCCE_NOCHECK | MSBS_SGLEBLK | ACEN_DISABLE | BCE_DISABLE |
3191 + mmc_stat = OMAP_HSMMC_STAT;
3192 + } while (mmc_stat == 0);
3194 + if ((mmc_stat & ERRI_MASK) != 0)
3195 + return (unsigned char) mmc_stat;
3197 + if (mmc_stat & CC_MASK) {
3198 + OMAP_HSMMC_STAT = CC_MASK;
3199 + response[0] = OMAP_HSMMC_RSP10;
3200 + if ((cmd & RSP_TYPE_MASK) == RSP_TYPE_LGHT136) {
3201 + response[1] = OMAP_HSMMC_RSP32;
3202 + response[2] = OMAP_HSMMC_RSP54;
3203 + response[3] = OMAP_HSMMC_RSP76;
3211 +unsigned char mmc_read_data(unsigned int *output_buf)
3213 + volatile unsigned int mmc_stat;
3214 + unsigned int read_count = 0;
3217 + * Start Polled Read
3221 + mmc_stat = OMAP_HSMMC_STAT;
3222 + } while (mmc_stat == 0);
3224 + if ((mmc_stat & ERRI_MASK) != 0)
3225 + return (unsigned char) mmc_stat;
3227 + if (mmc_stat & BRR_MASK) {
3230 + OMAP_HSMMC_STAT |= BRR_MASK;
3231 + for (k = 0; k < MMCSD_SECTOR_SIZE / 4; k++) {
3232 + *output_buf = OMAP_HSMMC_DATA;
3238 + if (mmc_stat & BWR_MASK)
3239 + OMAP_HSMMC_STAT |= BWR_MASK;
3241 + if (mmc_stat & TC_MASK) {
3242 + OMAP_HSMMC_STAT |= TC_MASK;
3249 +unsigned char mmc_detect_card(mmc_card_data *mmc_card_cur)
3251 + unsigned char err;
3252 + unsigned int argument = 0;
3253 + unsigned int ocr_value, ocr_recvd, ret_cmd41, hcs_val;
3254 + unsigned int resp[4];
3255 + unsigned short retry_cnt = 2000;
3257 + /* Set to Initialization Clock */
3258 + err = mmc_clock_config(CLK_400KHZ, 0);
3262 + mmc_card_cur->RCA = MMC_RELATIVE_CARD_ADDRESS;
3263 + argument = 0x00000000;
3265 + ocr_value = (0x1FF << 15);
3266 + err = mmc_send_cmd(MMC_CMD0, argument, resp);
3270 + argument = SD_CMD8_CHECK_PATTERN | SD_CMD8_2_7_3_6_V_RANGE;
3271 + err = mmc_send_cmd(MMC_SDCMD8, argument, resp);
3272 + hcs_val = (err == 1) ?
3273 + MMC_OCR_REG_HOST_CAPACITY_SUPPORT_SECTOR :
3274 + MMC_OCR_REG_HOST_CAPACITY_SUPPORT_BYTE;
3276 + argument = 0x0000 << 16;
3277 + err = mmc_send_cmd(MMC_CMD55, argument, resp);
3279 + mmc_card_cur->card_type = SD_CARD;
3280 + ocr_value |= hcs_val;
3281 + ret_cmd41 = MMC_ACMD41;
3283 + mmc_card_cur->card_type = MMC_CARD;
3284 + ocr_value |= MMC_OCR_REG_ACCESS_MODE_SECTOR;
3285 + ret_cmd41 = MMC_CMD1;
3286 + OMAP_HSMMC_CON &= ~OD;
3287 + OMAP_HSMMC_CON |= OPENDRAIN;
3290 + argument = ocr_value;
3291 + err = mmc_send_cmd(ret_cmd41, argument, resp);
3295 + ocr_recvd = ((mmc_resp_r3 *) resp)->ocr;
3297 + while (!(ocr_recvd & (0x1 << 31)) && (retry_cnt > 0)) {
3299 + if (mmc_card_cur->card_type == SD_CARD) {
3300 + argument = 0x0000 << 16;
3301 + err = mmc_send_cmd(MMC_CMD55, argument, resp);
3304 + argument = ocr_value;
3305 + err = mmc_send_cmd(ret_cmd41, argument, resp);
3308 + ocr_recvd = ((mmc_resp_r3 *) resp)->ocr;
3311 + if (!(ocr_recvd & (0x1 << 31)))
3314 + if (mmc_card_cur->card_type == MMC_CARD) {
3315 + if ((ocr_recvd & MMC_OCR_REG_ACCESS_MODE_MASK) ==
3316 + MMC_OCR_REG_ACCESS_MODE_SECTOR) {
3317 + mmc_card_cur->mode = SECTOR_MODE;
3319 + mmc_card_cur->mode = BYTE_MODE;
3322 + ocr_recvd &= ~MMC_OCR_REG_ACCESS_MODE_MASK;
3324 + if ((ocr_recvd & MMC_OCR_REG_HOST_CAPACITY_SUPPORT_MASK)
3325 + == MMC_OCR_REG_HOST_CAPACITY_SUPPORT_SECTOR) {
3326 + mmc_card_cur->mode = SECTOR_MODE;
3328 + mmc_card_cur->mode = BYTE_MODE;
3330 + ocr_recvd &= ~MMC_OCR_REG_HOST_CAPACITY_SUPPORT_MASK;
3333 + ocr_recvd &= ~(0x1 << 31);
3334 + if (!(ocr_recvd & ocr_value))
3337 + err = mmc_send_cmd(MMC_CMD2, argument, resp);
3341 + if (mmc_card_cur->card_type == MMC_CARD) {
3342 + argument = mmc_card_cur->RCA << 16;
3343 + err = mmc_send_cmd(MMC_CMD3, argument, resp);
3347 + argument = 0x00000000;
3348 + err = mmc_send_cmd(MMC_SDCMD3, argument, resp);
3352 + mmc_card_cur->RCA = ((mmc_resp_r6 *) resp)->newpublishedrca;
3355 + OMAP_HSMMC_CON &= ~OD;
3356 + OMAP_HSMMC_CON |= NOOPENDRAIN;
3360 +unsigned char mmc_read_cardsize(mmc_card_data *mmc_dev_data,
3361 + mmc_csd_reg_t *cur_csd)
3363 + mmc_extended_csd_reg_t ext_csd;
3364 + unsigned int size, count, blk_len, blk_no, card_size, argument;
3365 + unsigned char err;
3366 + unsigned int resp[4];
3368 + if (mmc_dev_data->mode == SECTOR_MODE) {
3369 + if (mmc_dev_data->card_type == SD_CARD) {
3371 + (((mmc_sd2_csd_reg_t *) cur_csd)->
3372 + c_size_lsb & MMC_SD2_CSD_C_SIZE_LSB_MASK) |
3373 + ((((mmc_sd2_csd_reg_t *) cur_csd)->
3374 + c_size_msb & MMC_SD2_CSD_C_SIZE_MSB_MASK)
3375 + << MMC_SD2_CSD_C_SIZE_MSB_OFFSET);
3376 + mmc_dev_data->size = card_size * 1024;
3377 + if (mmc_dev_data->size == 0)
3380 + argument = 0x00000000;
3381 + err = mmc_send_cmd(MMC_CMD8, argument, resp);
3384 + err = mmc_read_data((unsigned int *) &ext_csd);
3387 + mmc_dev_data->size = ext_csd.sectorcount;
3389 + if (mmc_dev_data->size == 0)
3390 + mmc_dev_data->size = 8388608;
3393 + if (cur_csd->c_size_mult >= 8)
3396 + if (cur_csd->read_bl_len >= 12)
3399 + /* Compute size */
3400 + count = 1 << (cur_csd->c_size_mult + 2);
3401 + card_size = (cur_csd->c_size_lsb & MMC_CSD_C_SIZE_LSB_MASK) |
3402 + ((cur_csd->c_size_msb & MMC_CSD_C_SIZE_MSB_MASK)
3403 + << MMC_CSD_C_SIZE_MSB_OFFSET);
3404 + blk_no = (card_size + 1) * count;
3405 + blk_len = 1 << cur_csd->read_bl_len;
3406 + size = blk_no * blk_len;
3407 + mmc_dev_data->size = size / MMCSD_SECTOR_SIZE;
3408 + if (mmc_dev_data->size == 0)
3414 +unsigned char omap_mmc_read_sect(unsigned int start_sec, unsigned int num_bytes,
3415 + mmc_card_data *mmc_c,
3416 + unsigned long *output_buf)
3418 + unsigned char err;
3419 + unsigned int argument;
3420 + unsigned int resp[4];
3421 + unsigned int num_sec_val =
3422 + (num_bytes + (MMCSD_SECTOR_SIZE - 1)) / MMCSD_SECTOR_SIZE;
3423 + unsigned int sec_inc_val;
3425 + if (num_sec_val == 0)
3428 + if (mmc_c->mode == SECTOR_MODE) {
3429 + argument = start_sec;
3432 + argument = start_sec * MMCSD_SECTOR_SIZE;
3433 + sec_inc_val = MMCSD_SECTOR_SIZE;
3436 + while (num_sec_val) {
3437 + err = mmc_send_cmd(MMC_CMD17, argument, resp);
3441 + err = mmc_read_data((unsigned int *) output_buf);
3445 + output_buf += (MMCSD_SECTOR_SIZE / 4);
3446 + argument += sec_inc_val;
3452 +unsigned char configure_mmc(mmc_card_data *mmc_card_cur)
3454 + unsigned char ret_val;
3455 + unsigned int argument;
3456 + unsigned int resp[4];
3457 + unsigned int trans_clk, trans_fact, trans_unit, retries = 2;
3458 + mmc_csd_reg_t Card_CSD;
3459 + unsigned char trans_speed;
3461 + ret_val = mmc_init_setup();
3467 + ret_val = mmc_detect_card(mmc_card_cur);
3469 + } while ((retries > 0) && (ret_val != 1));
3471 + argument = mmc_card_cur->RCA << 16;
3472 + ret_val = mmc_send_cmd(MMC_CMD9, argument, resp);
3476 + ((unsigned int *) &Card_CSD)[3] = resp[3];
3477 + ((unsigned int *) &Card_CSD)[2] = resp[2];
3478 + ((unsigned int *) &Card_CSD)[1] = resp[1];
3479 + ((unsigned int *) &Card_CSD)[0] = resp[0];
3481 + if (mmc_card_cur->card_type == MMC_CARD)
3482 + mmc_card_cur->version = Card_CSD.spec_vers;
3484 + trans_speed = Card_CSD.tran_speed;
3486 + ret_val = mmc_send_cmd(MMC_CMD4, MMC_DSR_DEFAULT << 16, resp);
3490 + trans_unit = trans_speed & MMC_CSD_TRAN_SPEED_UNIT_MASK;
3491 + trans_fact = trans_speed & MMC_CSD_TRAN_SPEED_FACTOR_MASK;
3493 + if (trans_unit > MMC_CSD_TRAN_SPEED_UNIT_100MHZ)
3496 + if ((trans_fact < MMC_CSD_TRAN_SPEED_FACTOR_1_0) ||
3497 + (trans_fact > MMC_CSD_TRAN_SPEED_FACTOR_8_0))
3503 + trans_clk = mmc_transspeed_val[trans_fact - 1][trans_unit] * 2;
3504 + ret_val = mmc_clock_config(CLK_MISC, trans_clk);
3509 + argument = mmc_card_cur->RCA << 16;
3510 + ret_val = mmc_send_cmd(MMC_CMD7_SELECT, argument, resp);
3514 + /* Configure the block length to 512 bytes */
3515 + argument = MMCSD_SECTOR_SIZE;
3516 + ret_val = mmc_send_cmd(MMC_CMD16, argument, resp);
3520 + /* get the card size in sectors */
3521 + ret_val = mmc_read_cardsize(mmc_card_cur, &Card_CSD);
3527 +unsigned long mmc_bread(int dev_num, unsigned long blknr, lbaint_t blkcnt,
3530 + omap_mmc_read_sect(blknr, (blkcnt * MMCSD_SECTOR_SIZE), &cur_card_data,
3531 + (unsigned long *) dst);
3535 +int mmc_init(int verbose)
3537 + configure_mmc(&cur_card_data);
3539 + mmc_blk_dev.if_type = IF_TYPE_MMC;
3540 + mmc_blk_dev.part_type = PART_TYPE_DOS;
3541 + mmc_blk_dev.dev = 0;
3542 + mmc_blk_dev.lun = 0;
3543 + mmc_blk_dev.type = 0;
3545 + /* FIXME fill in the correct size (is set to 32MByte) */
3546 + mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
3547 + mmc_blk_dev.lba = 0x10000;
3548 + mmc_blk_dev.removable = 0;
3549 + mmc_blk_dev.block_read = mmc_bread;
3551 + fat_register_device(&mmc_blk_dev, 1);
3555 +int mmc_read(ulong src, uchar *dst, int size)
3560 +int mmc_write(uchar *src, ulong dst, int size)
3565 +int mmc2info(ulong addr)
3569 diff --git a/cpu/omap3/start.S b/cpu/omap3/start.S
3570 new file mode 100644
3571 index 0000000..98706ad
3573 +++ b/cpu/omap3/start.S
3576 + * armboot - Startup Code for OMAP3530/ARM Cortex CPU-core
3578 + * Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com>
3580 + * Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
3581 + * Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
3582 + * Copyright (c) 2002 Gary Jennejohn <gj@denx.de>
3583 + * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
3584 + * Copyright (c) 2003 Kshitij <kshitij@ti.com>
3585 + * Copyright (c) 2006-2008 Syed Mohammed Khasim <x0khasim@ti.com>
3587 + * See file CREDITS for list of people who contributed to this
3590 + * This program is free software; you can redistribute it and/or
3591 + * modify it under the terms of the GNU General Public License as
3592 + * published by the Free Software Foundation; either version 2 of
3593 + * the License, or (at your option) any later version.
3595 + * This program is distributed in the hope that it will be useful,
3596 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3597 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3598 + * GNU General Public License for more details.
3600 + * You should have received a copy of the GNU General Public License
3601 + * along with this program; if not, write to the Free Software
3602 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3603 + * MA 02111-1307 USA
3606 +#include <config.h>
3607 +#include <version.h>
3611 + ldr pc, _undefined_instruction
3612 + ldr pc, _software_interrupt
3613 + ldr pc, _prefetch_abort
3614 + ldr pc, _data_abort
3619 +_undefined_instruction: .word undefined_instruction
3620 +_software_interrupt: .word software_interrupt
3621 +_prefetch_abort: .word prefetch_abort
3622 +_data_abort: .word data_abort
3623 +_not_used: .word not_used
3626 +_pad: .word 0x12345678 /* now 16*4=64 */
3630 + .balignl 16,0xdeadbeef
3631 +/*************************************************************************
3633 + * Startup Code (reset vector)
3635 + * do important init only if we don't start from memory!
3636 + * setup Memory and board specific bits prior to relocation.
3637 + * relocate armboot to ram
3640 + *************************************************************************/
3645 +.globl _armboot_start
3650 + * These are defined in the board-specific linker script.
3660 +#ifdef CONFIG_USE_IRQ
3661 +/* IRQ stack memory (calculated at run-time) */
3662 +.globl IRQ_STACK_START
3666 +/* IRQ stack memory (calculated at run-time) */
3667 +.globl FIQ_STACK_START
3673 + * the actual reset code
3678 + * set the cpu to SVC32 mode
3685 +#if (CONFIG_OMAP34XX)
3686 + /* Copy vectors to mask ROM indirect addr */
3687 + adr r0, _start @ r0 <- current position of code
3688 + add r0, r0, #4 @ skip reset vector
3689 + mov r2, #64 @ r2 <- size to copy
3690 + add r2, r0, r2 @ r2 <- source end address
3691 + mov r1, #SRAM_OFFSET0 @ build vect addr
3692 + mov r3, #SRAM_OFFSET1
3694 + mov r3, #SRAM_OFFSET2
3697 + ldmia r0!, {r3-r10} @ copy from source address [r0]
3698 + stmia r1!, {r3-r10} @ copy to target address [r1]
3699 + cmp r0, r2 @ until source end address [r2]
3700 + bne next @ loop until equal */
3701 +#if !defined(CFG_NAND_BOOT) && !defined(CFG_ONENAND_BOOT)
3702 + /* No need to copy/exec the clock code - DPLL adjust already done
3703 + * in NAND/oneNAND Boot.
3705 + bl cpy_clk_code @ put dpll adjust code behind vectors
3706 +#endif /* NAND Boot */
3708 + /* the mask ROM code should have PLL and others stable */
3709 +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
3713 +#ifndef CONFIG_SKIP_RELOCATE_UBOOT
3714 +relocate: @ relocate U-Boot to RAM
3715 + adr r0, _start @ r0 <- current position of code
3716 + ldr r1, _TEXT_BASE @ test if we run from flash or RAM
3717 + cmp r0, r1 @ don't reloc during debug
3720 + ldr r2, _armboot_start
3721 + ldr r3, _bss_start
3722 + sub r2, r3, r2 @ r2 <- size of armboot
3723 + add r2, r0, r2 @ r2 <- source end address
3725 +copy_loop: @ copy 32 bytes at a time
3726 + ldmia r0!, {r3-r10} @ copy from source address [r0]
3727 + stmia r1!, {r3-r10} @ copy to target address [r1]
3728 + cmp r0, r2 @ until source end addreee [r2]
3730 +#endif /* CONFIG_SKIP_RELOCATE_UBOOT */
3732 + /* Set up the stack */
3734 + ldr r0, _TEXT_BASE @ upper 128 KiB: relocated uboot
3735 + sub r0, r0, #CFG_MALLOC_LEN @ malloc area
3736 + sub r0, r0, #CFG_GBL_DATA_SIZE @ bdinfo
3737 +#ifdef CONFIG_USE_IRQ
3738 + sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
3740 + sub sp, r0, #12 @ leave 3 words for abort-stack
3741 + and sp, sp, #~7 @ 8 byte alinged for (ldr/str)d
3743 + /* Clear BSS (if any). Is below tx (watch load addr - need space) */
3745 + ldr r0, _bss_start @ find start of bss segment
3746 + ldr r1, _bss_end @ stop here
3747 + mov r2, #0x00000000 @ clear value
3749 + str r2, [r0] @ clear BSS location
3750 + cmp r0, r1 @ are we at the end yet
3751 + add r0, r0, #4 @ increment clear index pointer
3752 + bne clbss_l @ keep clearing till at end
3754 + ldr pc, _start_armboot @ jump to C code
3756 +_start_armboot: .word start_armboot
3759 +/*************************************************************************
3761 + * CPU_init_critical registers
3763 + * setup important registers
3764 + * setup memory timing
3766 + *************************************************************************/
3769 + * Invalidate L1 I/D
3771 + mov r0, #0 @ set up for MCR
3772 + mcr p15, 0, r0, c8, c7, 0 @ invalidate TLBs
3773 + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache
3776 + * disable MMU stuff and caches
3778 + mrc p15, 0, r0, c1, c0, 0
3779 + bic r0, r0, #0x00002000 @ clear bits 13 (--V-)
3780 + bic r0, r0, #0x00000007 @ clear bits 2:0 (-CAM)
3781 + orr r0, r0, #0x00000002 @ set bit 1 (--A-) Align
3782 + orr r0, r0, #0x00000800 @ set bit 12 (Z---) BTB
3783 + mcr p15, 0, r0, c1, c0, 0
3786 + * Jump to board specific initialization...
3787 + * The Mask ROM will have already initialized
3788 + * basic memory. Go here to bump up clock rate and handle
3789 + * wake up conditions.
3791 + mov ip, lr @ persevere link reg across call
3792 + bl lowlevel_init @ go setup pll,mux,memory
3793 + mov lr, ip @ restore link
3794 + mov pc, lr @ back to my caller
3796 + *************************************************************************
3798 + * Interrupt handling
3800 + *************************************************************************
3805 +#define S_FRAME_SIZE 72
3807 +#define S_OLD_R0 68
3827 +#define MODE_SVC 0x13
3831 + * use bad_save_user_regs for abort/prefetch/undef/swi ...
3832 + * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling
3835 + .macro bad_save_user_regs
3836 + sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current
3838 + stmia sp, {r0 - r12} @ Save user registers (now in
3839 + @ svc mode) r0-r12
3841 + ldr r2, _armboot_start
3842 + sub r2, r2, #(CFG_MALLOC_LEN)
3843 + sub r2, r2, #(CFG_GBL_DATA_SIZE+8) @ set base 2 words into abort
3845 + ldmia r2, {r2 - r3} @ get values for "aborted" pc
3846 + @ and cpsr (into parm regs)
3847 + add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack
3851 + stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr
3852 + mov r0, sp @ save current stack into r0
3853 + @ (param register)
3856 + .macro irq_save_user_regs
3857 + sub sp, sp, #S_FRAME_SIZE
3858 + stmia sp, {r0 - r12} @ Calling r0-r12
3859 + add r8, sp, #S_PC @ !! R8 NEEDS to be saved !!
3860 + @ a reserved stack spot would
3862 + stmdb r8, {sp, lr}^ @ Calling SP, LR
3863 + str lr, [r8, #0] @ Save calling PC
3865 + str r6, [r8, #4] @ Save CPSR
3866 + str r0, [r8, #8] @ Save OLD_R0
3870 + .macro irq_restore_user_regs
3871 + ldmia sp, {r0 - lr}^ @ Calling r0 - lr
3873 + ldr lr, [sp, #S_PC] @ Get PC
3874 + add sp, sp, #S_FRAME_SIZE
3875 + subs pc, lr, #4 @ return & move spsr_svc into
3879 + .macro get_bad_stack
3880 + ldr r13, _armboot_start @ setup our mode stack (enter
3882 + sub r13, r13, #(CFG_MALLOC_LEN) @ move past malloc pool
3883 + sub r13, r13, #(CFG_GBL_DATA_SIZE+8) @ move to reserved a couple
3884 + @ spots for abort stack
3886 + str lr, [r13] @ save caller lr in position 0
3888 + mrs lr, spsr @ get the spsr
3889 + str lr, [r13, #4] @ save spsr in position 1 of
3892 + mov r13, #MODE_SVC @ prepare SVC-Mode
3894 + msr spsr, r13 @ switch modes, make sure
3895 + @ moves will execute
3896 + mov lr, pc @ capture return pc
3897 + movs pc, lr @ jump to next instruction &
3901 + .macro get_bad_stack_swi
3902 + sub r13, r13, #4 @ space on current stack for
3904 + str r0, [r13] @ save R0's value.
3905 + ldr r0, _armboot_start @ get data regions start
3906 + sub r0, r0, #(CFG_MALLOC_LEN) @ move past malloc pool
3907 + sub r0, r0, #(CFG_GBL_DATA_SIZE+8) @ move past gbl and a couple
3908 + @ spots for abort stack
3909 + str lr, [r0] @ save caller lr in position 0
3911 + mrs r0, spsr @ get the spsr
3912 + str lr, [r0, #4] @ save spsr in position 1 of
3914 + ldr r0, [r13] @ restore r0
3915 + add r13, r13, #4 @ pop stack entry
3918 + .macro get_irq_stack @ setup IRQ stack
3919 + ldr sp, IRQ_STACK_START
3922 + .macro get_fiq_stack @ setup FIQ stack
3923 + ldr sp, FIQ_STACK_START
3927 + * exception handlers
3930 +undefined_instruction:
3932 + bad_save_user_regs
3933 + bl do_undefined_instruction
3936 +software_interrupt:
3938 + bad_save_user_regs
3939 + bl do_software_interrupt
3944 + bad_save_user_regs
3945 + bl do_prefetch_abort
3950 + bad_save_user_regs
3956 + bad_save_user_regs
3959 +#ifdef CONFIG_USE_IRQ
3964 + irq_save_user_regs
3966 + irq_restore_user_regs
3971 + /* someone ought to write a more effiction fiq_save_user_regs */
3972 + irq_save_user_regs
3974 + irq_restore_user_regs
3981 + bad_save_user_regs
3987 + bad_save_user_regs
3992 +.global arm_cache_flush
3994 + mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache
3995 + mov pc, lr @ back to caller
3998 + * v7_flush_dcache_all()
4000 + * Flush the whole D-cache.
4002 + * Corrupted registers: r0-r5, r7, r9-r11
4004 + * - mm - mm_struct describing address space
4007 +.global v7_flush_dcache_all
4008 +v7_flush_dcache_all:
4009 + stmfd r13!, {r0-r5, r7, r9-r12,r14}
4011 + mov r7, r0 @ take a backup of device type
4012 + cmp r0, #0x3 @ check if the device type is
4014 + moveq r12, #0x1 @ set up to invalide L2
4015 +smi: .word 0x01600070 @ Call SMI monitor (smieq)
4016 + cmp r7, #0x3 @ compare again in case its
4018 + beq finished_inval @ if GP device, inval done
4021 + mrc p15, 1, r0, c0, c0, 1 @ read clidr
4022 + ands r3, r0, #0x7000000 @ extract loc from clidr
4023 + mov r3, r3, lsr #23 @ left align loc bit field
4024 + beq finished_inval @ if loc is 0, then no need to
4026 + mov r10, #0 @ start clean at cache level 0
4028 + add r2, r10, r10, lsr #1 @ work out 3x current cache
4030 + mov r1, r0, lsr r2 @ extract cache type bits from
4032 + and r1, r1, #7 @ mask of the bits for current
4034 + cmp r1, #2 @ see what cache we have at
4036 + blt skip_inval @ skip if no cache, or just
4038 + mcr p15, 2, r10, c0, c0, 0 @ select current cache level
4040 + isb @ isb to sych the new
4042 + mrc p15, 1, r1, c0, c0, 0 @ read the new csidr
4043 + and r2, r1, #7 @ extract the length of the
4045 + add r2, r2, #4 @ add 4 (line length offset)
4047 + ands r4, r4, r1, lsr #3 @ find maximum number on the
4049 + clz r5, r4 @ find bit position of way
4052 + ands r7, r7, r1, lsr #13 @ extract max number of the
4055 + mov r9, r4 @ create working copy of max
4058 + orr r11, r10, r9, lsl r5 @ factor way and cache number
4060 + orr r11, r11, r7, lsl r2 @ factor index number into r11
4061 + mcr p15, 0, r11, c7, c6, 2 @ invalidate by set/way
4062 + subs r9, r9, #1 @ decrement the way
4064 + subs r7, r7, #1 @ decrement the index
4067 + add r10, r10, #2 @ increment cache number
4071 + mov r10, #0 @ swith back to cache level 0
4072 + mcr p15, 2, r10, c0, c0, 0 @ select current cache level
4076 + ldmfd r13!, {r0-r5, r7, r9-r12,pc}
4082 + ldr r1, rstctl @ get addr for global reset
4084 + mov r3, #0x2 @ full reset pll + mpu
4085 + str r3, [r1] @ force reset
4092 diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
4093 index 7dab786..7782e9d 100644
4094 --- a/drivers/i2c/omap24xx_i2c.c
4095 +++ b/drivers/i2c/omap24xx_i2c.c
4100 -#ifdef CONFIG_DRIVER_OMAP24XX_I2C
4101 +#if defined(CONFIG_DRIVER_OMAP24XX_I2C) || defined(CONFIG_DRIVER_OMAP34XX_I2C)
4103 #include <asm/arch/i2c.h>
4106 +#define inb(a) __raw_readb(a)
4107 +#define outb(a,v) __raw_writeb(a,v)
4108 #define inw(a) __raw_readw(a)
4109 #define outw(a,v) __raw_writew(a,v)
4111 @@ -114,7 +116,11 @@ static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
4113 status = wait_for_pin ();
4114 if (status & I2C_STAT_RRDY) {
4115 - *value = inw (I2C_DATA);
4116 +#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
4117 + *value = inb(I2C_DATA);
4119 + *value = inw(I2C_DATA);
4124 @@ -155,8 +161,23 @@ static int i2c_write_byte (u8 devaddr, u8 regoffset, u8 value)
4125 status = wait_for_pin ();
4127 if (status & I2C_STAT_XRDY) {
4128 - /* send out two bytes */
4129 - outw ((value << 8) + regoffset, I2C_DATA);
4130 +#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
4131 + /* send out 1 byte */
4132 + outb(regoffset, I2C_DATA);
4133 + outw(I2C_STAT_XRDY, I2C_STAT);
4134 + status = wait_for_pin();
4135 + if ((status & I2C_STAT_XRDY)) {
4136 + /* send out next 1 byte */
4137 + outb(value, I2C_DATA);
4138 + outw(I2C_STAT_XRDY, I2C_STAT);
4143 + /* send out two bytes */
4144 + outw ((value << 8) + regoffset, I2C_DATA);
4147 /* must have enough delay to allow BB bit to go low */
4149 if (inw (I2C_STAT) & I2C_STAT_NACK) {
4150 @@ -193,7 +214,11 @@ static void flush_fifo(void)
4152 stat = inw(I2C_STAT);
4153 if(stat == I2C_STAT_RRDY){
4155 +#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
4160 outw(I2C_STAT_RRDY,I2C_STAT);
4163 diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
4164 index d1423c1..a75c606 100644
4165 --- a/fs/jffs2/jffs2_1pass.c
4166 +++ b/fs/jffs2/jffs2_1pass.c
4167 @@ -304,7 +304,9 @@ static inline void *get_node_mem_nor(u32 off)
4169 static inline void *get_fl_mem(u32 off, u32 size, void *ext_buf)
4171 +#if (defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)) || defined(ONFIG_CMD_FLASH)
4172 struct mtdids *id = current_part->dev->id;
4175 #if defined(CONFIG_CMD_FLASH)
4176 if (id->type == MTD_DEV_TYPE_NOR)
4177 @@ -322,7 +324,9 @@ static inline void *get_fl_mem(u32 off, u32 size, void *ext_buf)
4179 static inline void *get_node_mem(u32 off)
4181 - struct mtdids *id = current_part->dev->id;
4182 +#if (defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)) || defined(ONFIG_CMD_FLASH)
4183 + struct mtdids *id = current_part->dev->id;
4186 #if defined(CONFIG_CMD_FLASH)
4187 if (id->type == MTD_DEV_TYPE_NOR)
4188 diff --git a/include/asm-arm/arch-omap3/bits.h b/include/asm-arm/arch-omap3/bits.h
4189 new file mode 100644
4190 index 0000000..8522335
4192 +++ b/include/asm-arm/arch-omap3/bits.h
4195 + * Copyright (c) 2004 Texas Instruments
4197 + * This package is free software; you can redistribute it and/or
4198 + * modify it under the terms of the license found in the file
4199 + * named COPYING that should have accompanied this file.
4201 + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
4202 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
4203 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
4208 +#define BIT0 (1<<0)
4209 +#define BIT1 (1<<1)
4210 +#define BIT2 (1<<2)
4211 +#define BIT3 (1<<3)
4212 +#define BIT4 (1<<4)
4213 +#define BIT5 (1<<5)
4214 +#define BIT6 (1<<6)
4215 +#define BIT7 (1<<7)
4216 +#define BIT8 (1<<8)
4217 +#define BIT9 (1<<9)
4218 +#define BIT10 (1<<10)
4219 +#define BIT11 (1<<11)
4220 +#define BIT12 (1<<12)
4221 +#define BIT13 (1<<13)
4222 +#define BIT14 (1<<14)
4223 +#define BIT15 (1<<15)
4224 +#define BIT16 (1<<16)
4225 +#define BIT17 (1<<17)
4226 +#define BIT18 (1<<18)
4227 +#define BIT19 (1<<19)
4228 +#define BIT20 (1<<20)
4229 +#define BIT21 (1<<21)
4230 +#define BIT22 (1<<22)
4231 +#define BIT23 (1<<23)
4232 +#define BIT24 (1<<24)
4233 +#define BIT25 (1<<25)
4234 +#define BIT26 (1<<26)
4235 +#define BIT27 (1<<27)
4236 +#define BIT28 (1<<28)
4237 +#define BIT29 (1<<29)
4238 +#define BIT30 (1<<30)
4239 +#define BIT31 (1<<31)
4242 diff --git a/include/asm-arm/arch-omap3/clocks.h b/include/asm-arm/arch-omap3/clocks.h
4243 new file mode 100644
4244 index 0000000..7cdd58c
4246 +++ b/include/asm-arm/arch-omap3/clocks.h
4249 + * (C) Copyright 2006-2008
4250 + * Texas Instruments, <www.ti.com>
4251 + * Richard Woodruff <r-woodruff2@ti.com>
4253 + * This program is free software; you can redistribute it and/or
4254 + * modify it under the terms of the GNU General Public License as
4255 + * published by the Free Software Foundation; either version 2 of
4256 + * the License, or (at your option) any later version.
4258 + * This program is distributed in the hope that it will be useful,
4259 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4260 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
4261 + * GNU General Public License for more details.
4263 + * You should have received a copy of the GNU General Public License
4264 + * along with this program; if not, write to the Free Software
4265 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4266 + * MA 02111-1307 USA
4271 +#define LDELAY 12000000
4273 +#define S12M 12000000
4274 +#define S13M 13000000
4275 +#define S19_2M 19200000
4276 +#define S24M 24000000
4277 +#define S26M 26000000
4278 +#define S38_4M 38400000
4280 +#define FCK_IVA2_ON 0x00000001
4281 +#define FCK_CORE1_ON 0x03fffe29
4282 +#define ICK_CORE1_ON 0x3ffffffb
4283 +#define ICK_CORE2_ON 0x0000001f
4284 +#define FCK_WKUP_ON 0x000000e9
4285 +#define ICK_WKUP_ON 0x0000003f
4286 +#define FCK_DSS_ON 0x00000005
4287 +#define ICK_DSS_ON 0x00000001
4288 +#define FCK_CAM_ON 0x00000001
4289 +#define ICK_CAM_ON 0x00000001
4290 +#define FCK_PER_ON 0x0003ffff
4291 +#define ICK_PER_ON 0x0003ffff
4293 +/* Used to index into DPLL parameter tables */
4297 + unsigned int fsel;
4301 +/* Following functions are exported from lowlevel_init.S */
4302 +extern dpll_param *get_mpu_dpll_param(void);
4303 +extern dpll_param *get_iva_dpll_param(void);
4304 +extern dpll_param *get_core_dpll_param(void);
4305 +extern dpll_param *get_per_dpll_param(void);
4307 +extern void *_end_vect, *_start;
4310 diff --git a/include/asm-arm/arch-omap3/clocks_omap3.h b/include/asm-arm/arch-omap3/clocks_omap3.h
4311 new file mode 100644
4312 index 0000000..fdb0c4c
4314 +++ b/include/asm-arm/arch-omap3/clocks_omap3.h
4317 + * (C) Copyright 2006-2008
4318 + * Texas Instruments, <www.ti.com>
4319 + * Richard Woodruff <r-woodruff2@ti.com>
4321 + * This program is free software; you can redistribute it and/or
4322 + * modify it under the terms of the GNU General Public License as
4323 + * published by the Free Software Foundation; either version 2 of
4324 + * the License, or (at your option) any later version.
4326 + * This program is distributed in the hope that it will be useful,
4327 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4328 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
4329 + * GNU General Public License for more details.
4331 + * You should have received a copy of the GNU General Public License
4332 + * along with this program; if not, write to the Free Software
4333 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4334 + * MA 02111-1307 USA
4336 +#ifndef _CLOCKS_OMAP3_H_
4337 +#define _CLOCKS_OMAP3_H_
4339 +#define PLL_STOP 1 /* PER & IVA */
4340 +#define PLL_LOW_POWER_BYPASS 5 /* MPU, IVA & CORE */
4341 +#define PLL_FAST_RELOCK_BYPASS 6 /* CORE */
4342 +#define PLL_LOCK 7 /* MPU, IVA, CORE & PER */
4344 +/* The following configurations are OPP and SysClk value independant
4345 + * and hence are defined here. All the other DPLL related values are
4346 + * tabulated in lowlevel_init.S.
4350 +# define CORE_M3X2 2 /* 332MHz : CM_CLKSEL1_EMU */
4351 +# define CORE_SSI_DIV 3 /* 221MHz : CM_CLKSEL_CORE */
4352 +# define CORE_FUSB_DIV 2 /* 41.5MHz: */
4353 +# define CORE_L4_DIV 2 /* 83MHz : L4 */
4354 +# define CORE_L3_DIV 2 /* 166MHz : L3 {DDR} */
4355 +# define GFX_DIV 2 /* 83MHz : CM_CLKSEL_GFX */
4356 +# define WKUP_RSM 2 /* 41.5MHz: CM_CLKSEL_WKUP */
4359 +# define PER_M6X2 3 /* 288MHz: CM_CLKSEL1_EMU */
4360 +# define PER_M5X2 4 /* 216MHz: CM_CLKSEL_CAM */
4361 +# define PER_M4X2 2 /* 432MHz : CM_CLKSEL_DSS-dss1 */
4362 +# define PER_M3X2 16 /* 54MHz : CM_CLKSEL_DSS-tv */
4364 +# define CLSEL1_EMU_VAL ((CORE_M3X2 << 16) | (PER_M6X2 << 24) | (0x0a50))
4368 +# define FSEL_12 0x07
4369 +# define M2_12 0x01 /* M3 of 2 */
4371 +# define M_12_ES1 0x19F
4372 +# define N_12_ES1 0x0E
4373 +# define FSL_12_ES1 0x03
4374 +# define M2_12_ES1 0x1 /* M3 of 2 */
4376 +# define M_13 0x14C
4378 +# define FSEL_13 0x03
4379 +# define M2_13 0x01 /* M3 of 2 */
4381 +# define M_13_ES1 0x1B2
4382 +# define N_13_ES1 0x10
4383 +# define FSL_13_ES1 0x03
4384 +# define M2_13_ES1 0x01 /* M3 of 2 */
4386 +# define M_19p2 0x19F
4387 +# define N_19p2 0x17
4388 +# define FSEL_19p2 0x03
4389 +# define M2_19p2 0x01 /* M3 of 2 */
4391 +# define M_19p2_ES1 0x19F
4392 +# define N_19p2_ES1 0x17
4393 +# define FSL_19p2_ES1 0x03
4394 +# define M2_19p2_ES1 0x01 /* M3 of 2 */
4398 +# define FSEL_26 0x07
4399 +# define M2_26 0x01 /* M3 of 2 */
4401 +# define M_26_ES1 0x1B2
4402 +# define N_26_ES1 0x21
4403 +# define FSL_26_ES1 0x03
4404 +# define M2_26_ES1 0x01 /* M3 of 2 */
4406 +# define M_38p4 0x19F
4407 +# define N_38p4 0x2F
4408 +# define FSEL_38p4 0x03
4409 +# define M2_38p4 0x01 /* M3 of 2 */
4411 +# define M_38p4_ES1 0x19F
4412 +# define N_38p4_ES1 0x2F
4413 +# define FSL_38p4_ES1 0x03
4414 +# define M2_38p4_ES1 0x01 /* M3 of 2 */
4416 +#endif /* endif _CLOCKS_OMAP3_H_ */
4417 diff --git a/include/asm-arm/arch-omap3/cpu.h b/include/asm-arm/arch-omap3/cpu.h
4418 new file mode 100644
4419 index 0000000..d47defb
4421 +++ b/include/asm-arm/arch-omap3/cpu.h
4424 + * (C) Copyright 2006-2008
4425 + * Texas Instruments, <www.ti.com>
4427 + * See file CREDITS for list of people who contributed to this
4430 + * This program is free software; you can redistribute it and/or
4431 + * modify it under the terms of the GNU General Public License as
4432 + * published by the Free Software Foundation; either version 2 of
4433 + * the License, or (at your option) any later version.
4435 + * This program is distributed in the hope that it will be useful,
4436 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4437 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4438 + * GNU General Public License for more details.
4440 + * You should have received a copy of the GNU General Public License
4441 + * along with this program; if not, write to the Free Software
4442 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4443 + * MA 02111-1307 USA
4450 +/* Register offsets of common modules */
4452 +#define CONTROL_STATUS (OMAP34XX_CTRL_BASE + 0x2F0)
4453 +#define OMAP34XX_MCR (OMAP34XX_CTRL_BASE + 0x8C)
4454 +#define CONTROL_SCALABLE_OMAP_STATUS (OMAP34XX_CTRL_BASE + 0x44C)
4455 +#define CONTROL_SCALABLE_OMAP_OCP (OMAP34XX_CTRL_BASE + 0x534)
4457 +/* Tap Information */
4458 +#define TAP_IDCODE_REG (OMAP34XX_TAP_BASE+0x204)
4459 +#define PRODUCTION_ID (OMAP34XX_TAP_BASE+0x208)
4462 +#define DEVICE_MASK (BIT8|BIT9|BIT10)
4463 +#define TST_DEVICE 0x0
4464 +#define EMU_DEVICE 0x1
4465 +#define HS_DEVICE 0x2
4466 +#define GP_DEVICE 0x3
4468 +/* GPMC CS3/cs4/cs6 not avaliable */
4469 +#define GPMC_BASE (OMAP34XX_GPMC_BASE)
4470 +#define GPMC_SYSCONFIG (OMAP34XX_GPMC_BASE+0x10)
4471 +#define GPMC_IRQSTATUS (OMAP34XX_GPMC_BASE+0x18)
4472 +#define GPMC_IRQENABLE (OMAP34XX_GPMC_BASE+0x1C)
4473 +#define GPMC_TIMEOUT_CONTROL (OMAP34XX_GPMC_BASE+0x40)
4474 +#define GPMC_CONFIG (OMAP34XX_GPMC_BASE+0x50)
4475 +#define GPMC_STATUS (OMAP34XX_GPMC_BASE+0x54)
4477 +#define GPMC_CONFIG_CS0 (OMAP34XX_GPMC_BASE+0x60)
4478 +#define GPMC_CONFIG_WIDTH (0x30)
4480 +#define GPMC_CONFIG1 (0x00)
4481 +#define GPMC_CONFIG2 (0x04)
4482 +#define GPMC_CONFIG3 (0x08)
4483 +#define GPMC_CONFIG4 (0x0C)
4484 +#define GPMC_CONFIG5 (0x10)
4485 +#define GPMC_CONFIG6 (0x14)
4486 +#define GPMC_CONFIG7 (0x18)
4487 +#define GPMC_NAND_CMD (0x1C)
4488 +#define GPMC_NAND_ADR (0x20)
4489 +#define GPMC_NAND_DAT (0x24)
4491 +#define GPMC_ECC_CONFIG (0x1F4)
4492 +#define GPMC_ECC_CONTROL (0x1F8)
4493 +#define GPMC_ECC_SIZE_CONFIG (0x1FC)
4494 +#define GPMC_ECC1_RESULT (0x200)
4495 +#define GPMC_ECC2_RESULT (0x204)
4496 +#define GPMC_ECC3_RESULT (0x208)
4497 +#define GPMC_ECC4_RESULT (0x20C)
4498 +#define GPMC_ECC5_RESULT (0x210)
4499 +#define GPMC_ECC6_RESULT (0x214)
4500 +#define GPMC_ECC7_RESULT (0x218)
4501 +#define GPMC_ECC8_RESULT (0x21C)
4502 +#define GPMC_ECC9_RESULT (0x220)
4505 +# define FLASH_BASE 0x10000000 /* NOR flash, */
4506 + /* aligned to 256 Meg */
4507 +# define FLASH_BASE_SDPV1 0x04000000 /* NOR flash, */
4508 + /* aligned to 64 Meg */
4509 +# define FLASH_BASE_SDPV2 0x10000000 /* NOR flash, */
4510 + /* aligned to 256 Meg */
4511 +# define DEBUG_BASE 0x08000000 /* debug board */
4512 +# define NAND_BASE 0x30000000 /* NAND addr */
4513 + /* (actual size small port) */
4514 +# define PISMO2_BASE 0x18000000 /* PISMO2 CS1/2 */
4515 +# define ONENAND_MAP 0x20000000 /* OneNand addr */
4516 + /* (actual size small port) */
4519 +#define SMS_SYSCONFIG (OMAP34XX_SMS_BASE+0x10)
4520 +#define SMS_RG_ATT0 (OMAP34XX_SMS_BASE+0x48)
4521 +#define SMS_CLASS_ARB0 (OMAP34XX_SMS_BASE+0xD0)
4522 +#define BURSTCOMPLETE_GROUP7 BIT31
4525 +#define SDRC_SYSCONFIG (OMAP34XX_SDRC_BASE+0x10)
4526 +#define SDRC_STATUS (OMAP34XX_SDRC_BASE+0x14)
4527 +#define SDRC_CS_CFG (OMAP34XX_SDRC_BASE+0x40)
4528 +#define SDRC_SHARING (OMAP34XX_SDRC_BASE+0x44)
4529 +#define SDRC_DLLA_CTRL (OMAP34XX_SDRC_BASE+0x60)
4530 +#define SDRC_DLLA_STATUS (OMAP34XX_SDRC_BASE+0x64)
4531 +#define SDRC_DLLB_CTRL (OMAP34XX_SDRC_BASE+0x68)
4532 +#define SDRC_DLLB_STATUS (OMAP34XX_SDRC_BASE+0x6C)
4533 +#define DLLPHASE BIT1
4534 +#define LOADDLL BIT2
4535 +#define DLL_DELAY_MASK 0xFF00
4536 +#define DLL_NO_FILTER_MASK (BIT8|BIT9)
4538 +#define SDRC_POWER (OMAP34XX_SDRC_BASE+0x70)
4539 +#define WAKEUPPROC BIT26
4541 +#define SDRC_MCFG_0 (OMAP34XX_SDRC_BASE+0x80)
4542 +#define SDRC_MR_0 (OMAP34XX_SDRC_BASE+0x84)
4543 +#define SDRC_ACTIM_CTRLA_0 (OMAP34XX_SDRC_BASE+0x9C)
4544 +#define SDRC_ACTIM_CTRLB_0 (OMAP34XX_SDRC_BASE+0xA0)
4545 +#define SDRC_ACTIM_CTRLA_1 (OMAP34XX_SDRC_BASE+0xC4)
4546 +#define SDRC_ACTIM_CTRLB_1 (OMAP34XX_SDRC_BASE+0xC8)
4547 +#define SDRC_RFR_CTRL (OMAP34XX_SDRC_BASE+0xA4)
4548 +#define SDRC_RFR_CTRL (OMAP34XX_SDRC_BASE+0xA4)
4549 +#define SDRC_MANUAL_0 (OMAP34XX_SDRC_BASE+0xA8)
4550 +#define OMAP34XX_SDRC_CS0 0x80000000
4551 +#define OMAP34XX_SDRC_CS1 0xA0000000
4552 +#define CMD_NOP 0x0
4553 +#define CMD_PRECHARGE 0x1
4554 +#define CMD_AUTOREFRESH 0x2
4555 +#define CMD_ENTR_PWRDOWN 0x3
4556 +#define CMD_EXIT_PWRDOWN 0x4
4557 +#define CMD_ENTR_SRFRSH 0x5
4558 +#define CMD_CKE_HIGH 0x6
4559 +#define CMD_CKE_LOW 0x7
4560 +#define SOFTRESET BIT1
4561 +#define SMART_IDLE (0x2 << 3)
4562 +#define REF_ON_IDLE (0x1 << 6)
4564 +/* timer regs offsets (32 bit regs) */
4565 +#define TIDR 0x0 /* r */
4566 +#define TIOCP_CFG 0x10 /* rw */
4567 +#define TISTAT 0x14 /* r */
4568 +#define TISR 0x18 /* rw */
4569 +#define TIER 0x1C /* rw */
4570 +#define TWER 0x20 /* rw */
4571 +#define TCLR 0x24 /* rw */
4572 +#define TCRR 0x28 /* rw */
4573 +#define TLDR 0x2C /* rw */
4574 +#define TTGR 0x30 /* rw */
4575 +#define TWPS 0x34 /* r */
4576 +#define TMAR 0x38 /* rw */
4577 +#define TCAR1 0x3c /* r */
4578 +#define TSICR 0x40 /* rw */
4579 +#define TCAR2 0x44 /* r */
4580 + /* enable sys_clk NO-prescale /1 */
4581 +#define GPT_EN ((0<<2)|BIT1|BIT0)
4584 +#define WWPS 0x34 /* r */
4585 +#define WSPR 0x48 /* rw */
4586 +#define WD_UNLOCK1 0xAAAA
4587 +#define WD_UNLOCK2 0x5555
4590 +#define CM_FCLKEN_IVA2 0x48004000
4591 +#define CM_CLKEN_PLL_IVA2 0x48004004
4592 +#define CM_IDLEST_PLL_IVA2 0x48004024
4593 +#define CM_CLKSEL1_PLL_IVA2 0x48004040
4594 +#define CM_CLKSEL2_PLL_IVA2 0x48004044
4595 +#define CM_CLKEN_PLL_MPU 0x48004904
4596 +#define CM_IDLEST_PLL_MPU 0x48004924
4597 +#define CM_CLKSEL1_PLL_MPU 0x48004940
4598 +#define CM_CLKSEL2_PLL_MPU 0x48004944
4599 +#define CM_FCLKEN1_CORE 0x48004a00
4600 +#define CM_ICLKEN1_CORE 0x48004a10
4601 +#define CM_ICLKEN2_CORE 0x48004a14
4602 +#define CM_CLKSEL_CORE 0x48004a40
4603 +#define CM_FCLKEN_GFX 0x48004b00
4604 +#define CM_ICLKEN_GFX 0x48004b10
4605 +#define CM_CLKSEL_GFX 0x48004b40
4606 +#define CM_FCLKEN_WKUP 0x48004c00
4607 +#define CM_ICLKEN_WKUP 0x48004c10
4608 +#define CM_CLKSEL_WKUP 0x48004c40
4609 +#define CM_IDLEST_WKUP 0x48004c20
4610 +#define CM_CLKEN_PLL 0x48004d00
4611 +#define CM_IDLEST_CKGEN 0x48004d20
4612 +#define CM_CLKSEL1_PLL 0x48004d40
4613 +#define CM_CLKSEL2_PLL 0x48004d44
4614 +#define CM_CLKSEL3_PLL 0x48004d48
4615 +#define CM_FCLKEN_DSS 0x48004e00
4616 +#define CM_ICLKEN_DSS 0x48004e10
4617 +#define CM_CLKSEL_DSS 0x48004e40
4618 +#define CM_FCLKEN_CAM 0x48004f00
4619 +#define CM_ICLKEN_CAM 0x48004f10
4620 +#define CM_CLKSEL_CAM 0x48004F40
4621 +#define CM_FCLKEN_PER 0x48005000
4622 +#define CM_ICLKEN_PER 0x48005010
4623 +#define CM_CLKSEL_PER 0x48005040
4624 +#define CM_CLKSEL1_EMU 0x48005140
4626 +#define PRM_CLKSEL 0x48306d40
4627 +#define PRM_RSTCTRL 0x48307250
4628 +#define PRM_CLKSRC_CTRL 0x48307270
4631 +#define PM_RT_APE_BASE_ADDR_ARM (SMX_APE_BASE + 0x10000)
4632 +#define PM_GPMC_BASE_ADDR_ARM (SMX_APE_BASE + 0x12400)
4633 +#define PM_OCM_RAM_BASE_ADDR_ARM (SMX_APE_BASE + 0x12800)
4634 +#define PM_OCM_ROM_BASE_ADDR_ARM (SMX_APE_BASE + 0x12C00)
4635 +#define PM_IVA2_BASE_ADDR_ARM (SMX_APE_BASE + 0x14000)
4637 +#define RT_REQ_INFO_PERMISSION_1 (PM_RT_APE_BASE_ADDR_ARM + 0x68)
4638 +#define RT_READ_PERMISSION_0 (PM_RT_APE_BASE_ADDR_ARM + 0x50)
4639 +#define RT_WRITE_PERMISSION_0 (PM_RT_APE_BASE_ADDR_ARM + 0x58)
4640 +#define RT_ADDR_MATCH_1 (PM_RT_APE_BASE_ADDR_ARM + 0x60)
4642 +#define GPMC_REQ_INFO_PERMISSION_0 (PM_GPMC_BASE_ADDR_ARM + 0x48)
4643 +#define GPMC_READ_PERMISSION_0 (PM_GPMC_BASE_ADDR_ARM + 0x50)
4644 +#define GPMC_WRITE_PERMISSION_0 (PM_GPMC_BASE_ADDR_ARM + 0x58)
4646 +#define OCM_REQ_INFO_PERMISSION_0 (PM_OCM_RAM_BASE_ADDR_ARM + 0x48)
4647 +#define OCM_READ_PERMISSION_0 (PM_OCM_RAM_BASE_ADDR_ARM + 0x50)
4648 +#define OCM_WRITE_PERMISSION_0 (PM_OCM_RAM_BASE_ADDR_ARM + 0x58)
4649 +#define OCM_ADDR_MATCH_2 (PM_OCM_RAM_BASE_ADDR_ARM + 0x80)
4651 +#define IVA2_REQ_INFO_PERMISSION_0 (PM_IVA2_BASE_ADDR_ARM + 0x48)
4652 +#define IVA2_READ_PERMISSION_0 (PM_IVA2_BASE_ADDR_ARM + 0x50)
4653 +#define IVA2_WRITE_PERMISSION_0 (PM_IVA2_BASE_ADDR_ARM + 0x58)
4655 +#define IVA2_REQ_INFO_PERMISSION_1 (PM_IVA2_BASE_ADDR_ARM + 0x68)
4656 +#define IVA2_READ_PERMISSION_1 (PM_IVA2_BASE_ADDR_ARM + 0x70)
4657 +#define IVA2_WRITE_PERMISSION_1 (PM_IVA2_BASE_ADDR_ARM + 0x78)
4659 +#define IVA2_REQ_INFO_PERMISSION_2 (PM_IVA2_BASE_ADDR_ARM + 0x88)
4660 +#define IVA2_READ_PERMISSION_2 (PM_IVA2_BASE_ADDR_ARM + 0x90)
4661 +#define IVA2_WRITE_PERMISSION_2 (PM_IVA2_BASE_ADDR_ARM + 0x98)
4663 +#define IVA2_REQ_INFO_PERMISSION_3 (PM_IVA2_BASE_ADDR_ARM + 0xA8)
4664 +#define IVA2_READ_PERMISSION_3 (PM_IVA2_BASE_ADDR_ARM + 0xB0)
4665 +#define IVA2_WRITE_PERMISSION_3 (PM_IVA2_BASE_ADDR_ARM + 0xB8)
4668 +#define I2C_BASE1 (OMAP34XX_CORE_L4_IO_BASE + 0x70000)
4669 +#define I2C_BASE2 (OMAP34XX_CORE_L4_IO_BASE + 0x72000)
4670 +#define I2C_BASE3 (OMAP34XX_CORE_L4_IO_BASE + 0x60000)
4672 +#endif /* _CPU_H */
4673 diff --git a/include/asm-arm/arch-omap3/i2c.h b/include/asm-arm/arch-omap3/i2c.h
4674 new file mode 100644
4675 index 0000000..5fb0979
4677 +++ b/include/asm-arm/arch-omap3/i2c.h
4680 + * (C) Copyright 2004-2008
4681 + * Texas Instruments, <www.ti.com>
4683 + * See file CREDITS for list of people who contributed to this
4686 + * This program is free software; you can redistribute it and/or
4687 + * modify it under the terms of the GNU General Public License as
4688 + * published by the Free Software Foundation; either version 2 of
4689 + * the License, or (at your option) any later version.
4691 + * This program is distributed in the hope that it will be useful,
4692 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4693 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4694 + * GNU General Public License for more details.
4696 + * You should have received a copy of the GNU General Public License
4697 + * along with this program; if not, write to the Free Software
4698 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4699 + * MA 02111-1307 USA
4704 +#define I2C_DEFAULT_BASE I2C_BASE1
4706 +#define I2C_REV (I2C_DEFAULT_BASE + 0x00)
4707 +#define I2C_IE (I2C_DEFAULT_BASE + 0x04)
4708 +#define I2C_STAT (I2C_DEFAULT_BASE + 0x08)
4709 +#define I2C_IV (I2C_DEFAULT_BASE + 0x0c)
4710 +#define I2C_BUF (I2C_DEFAULT_BASE + 0x14)
4711 +#define I2C_CNT (I2C_DEFAULT_BASE + 0x18)
4712 +#define I2C_DATA (I2C_DEFAULT_BASE + 0x1c)
4713 +#define I2C_SYSC (I2C_DEFAULT_BASE + 0x20)
4714 +#define I2C_CON (I2C_DEFAULT_BASE + 0x24)
4715 +#define I2C_OA (I2C_DEFAULT_BASE + 0x28)
4716 +#define I2C_SA (I2C_DEFAULT_BASE + 0x2c)
4717 +#define I2C_PSC (I2C_DEFAULT_BASE + 0x30)
4718 +#define I2C_SCLL (I2C_DEFAULT_BASE + 0x34)
4719 +#define I2C_SCLH (I2C_DEFAULT_BASE + 0x38)
4720 +#define I2C_SYSTEST (I2C_DEFAULT_BASE + 0x3c)
4724 +/* I2C Interrupt Enable Register (I2C_IE): */
4725 +#define I2C_IE_GC_IE (1 << 5)
4726 +#define I2C_IE_XRDY_IE (1 << 4) /* Transmit data ready interrupt enable */
4727 +#define I2C_IE_RRDY_IE (1 << 3) /* Receive data ready interrupt enable */
4728 +#define I2C_IE_ARDY_IE (1 << 2) /* Register access ready interrupt enable */
4729 +#define I2C_IE_NACK_IE (1 << 1) /* No acknowledgment interrupt enable */
4730 +#define I2C_IE_AL_IE (1 << 0) /* Arbitration lost interrupt enable */
4732 +/* I2C Status Register (I2C_STAT): */
4734 +#define I2C_STAT_SBD (1 << 15) /* Single byte data */
4735 +#define I2C_STAT_BB (1 << 12) /* Bus busy */
4736 +#define I2C_STAT_ROVR (1 << 11) /* Receive overrun */
4737 +#define I2C_STAT_XUDF (1 << 10) /* Transmit underflow */
4738 +#define I2C_STAT_AAS (1 << 9) /* Address as slave */
4739 +#define I2C_STAT_GC (1 << 5)
4740 +#define I2C_STAT_XRDY (1 << 4) /* Transmit data ready */
4741 +#define I2C_STAT_RRDY (1 << 3) /* Receive data ready */
4742 +#define I2C_STAT_ARDY (1 << 2) /* Register access ready */
4743 +#define I2C_STAT_NACK (1 << 1) /* No acknowledgment interrupt enable */
4744 +#define I2C_STAT_AL (1 << 0) /* Arbitration lost interrupt enable */
4746 +/* I2C Interrupt Code Register (I2C_INTCODE): */
4748 +#define I2C_INTCODE_MASK 7
4749 +#define I2C_INTCODE_NONE 0
4750 +#define I2C_INTCODE_AL 1 /* Arbitration lost */
4751 +#define I2C_INTCODE_NAK 2 /* No acknowledgement/general call */
4752 +#define I2C_INTCODE_ARDY 3 /* Register access ready */
4753 +#define I2C_INTCODE_RRDY 4 /* Rcv data ready */
4754 +#define I2C_INTCODE_XRDY 5 /* Xmit data ready */
4756 +/* I2C Buffer Configuration Register (I2C_BUF): */
4758 +#define I2C_BUF_RDMA_EN (1 << 15) /* Receive DMA channel enable */
4759 +#define I2C_BUF_XDMA_EN (1 << 7) /* Transmit DMA channel enable */
4761 +/* I2C Configuration Register (I2C_CON): */
4763 +#define I2C_CON_EN (1 << 15) /* I2C module enable */
4764 +#define I2C_CON_BE (1 << 14) /* Big endian mode */
4765 +#define I2C_CON_STB (1 << 11) /* Start byte mode (master mode only) */
4766 +#define I2C_CON_MST (1 << 10) /* Master/slave mode */
4767 +#define I2C_CON_TRX (1 << 9) /* Transmitter/receiver mode /*
4768 + /* (master mode only) */
4769 +#define I2C_CON_XA (1 << 8) /* Expand address */
4770 +#define I2C_CON_STP (1 << 1) /* Stop condition (master mode only) */
4771 +#define I2C_CON_STT (1 << 0) /* Start condition (master mode only) */
4773 +/* I2C System Test Register (I2C_SYSTEST): */
4775 +#define I2C_SYSTEST_ST_EN (1 << 15) /* System test enable */
4776 +#define I2C_SYSTEST_FREE (1 << 14) /* Free running mode, on brkpoint) */
4777 +#define I2C_SYSTEST_TMODE_MASK (3 << 12) /* Test mode select */
4778 +#define I2C_SYSTEST_TMODE_SHIFT (12) /* Test mode select */
4779 +#define I2C_SYSTEST_SCL_I (1 << 3) /* SCL line sense input value */
4780 +#define I2C_SYSTEST_SCL_O (1 << 2) /* SCL line drive output value */
4781 +#define I2C_SYSTEST_SDA_I (1 << 1) /* SDA line sense input value */
4782 +#define I2C_SYSTEST_SDA_O (1 << 0) /* SDA line drive output value */
4784 +#define I2C_SCLL_SCLL (0)
4785 +#define I2C_SCLL_SCLL_M (0xFF)
4786 +#define I2C_SCLL_HSSCLL (8)
4787 +#define I2C_SCLH_HSSCLL_M (0xFF)
4788 +#define I2C_SCLH_SCLH (0)
4789 +#define I2C_SCLH_SCLH_M (0xFF)
4790 +#define I2C_SCLH_HSSCLH (8)
4791 +#define I2C_SCLH_HSSCLH_M (0xFF)
4793 +#define OMAP_I2C_STANDARD 100
4794 +#define OMAP_I2C_FAST_MODE 400
4795 +#define OMAP_I2C_HIGH_SPEED 3400
4797 +#define SYSTEM_CLOCK_12 12000
4798 +#define SYSTEM_CLOCK_13 13000
4799 +#define SYSTEM_CLOCK_192 19200
4800 +#define SYSTEM_CLOCK_96 96000
4802 +#define I2C_IP_CLK SYSTEM_CLOCK_96
4803 +#define I2C_PSC_MAX (0x0f)
4804 +#define I2C_PSC_MIN (0x00)
4806 +#endif /* _I2C_H_ */
4807 diff --git a/include/asm-arm/arch-omap3/mem.h b/include/asm-arm/arch-omap3/mem.h
4808 new file mode 100644
4809 index 0000000..2c5cc51
4811 +++ b/include/asm-arm/arch-omap3/mem.h
4814 + * (C) Copyright 2006-2008
4815 + * Texas Instruments, <www.ti.com>
4816 + * Richard Woodruff <r-woodruff2@ti.com>
4818 + * See file CREDITS for list of people who contributed to this
4821 + * This program is free software; you can redistribute it and/or
4822 + * modify it under the terms of the GNU General Public License as
4823 + * published by the Free Software Foundation; either version 2 of
4824 + * the License, or (at your option) any later version.
4826 + * This program is distributed in the hope that it will be useful,
4827 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4828 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4829 + * GNU General Public License for more details.
4831 + * You should have received a copy of the GNU General Public License
4832 + * along with this program; if not, write to the Free Software
4833 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4834 + * MA 02111-1307 USA
4840 +#define SDRC_CS0_OSET 0x0
4841 +#define SDRC_CS1_OSET 0x30 /* mirror CS1 regs appear offset 0x30 from CS0 */
4843 +#ifndef __ASSEMBLY__
4852 +#endif /* __ASSEMBLY__ */
4854 +#define EARLY_INIT 1
4856 +/* Slower full frequency range default timings for x32 operation*/
4857 +#define SDP_SDRC_SHARING 0x00000100
4858 +#define SDP_SDRC_MR_0_SDR 0x00000031
4860 +/* optimized timings good for current shipping parts */
4861 +#define SDP_3430_SDRC_RFR_CTRL_165MHz 0x0004e201 /* 7.8us/6ns - 50=0x4e2 */
4863 +#define DLL_OFFSET 0
4864 +#define DLL_WRITEDDRCLKX2DIS 1
4865 +#define DLL_ENADLL 1
4866 +#define DLL_LOCKDLL 0
4867 +#define DLL_DLLPHASE_72 0
4868 +#define DLL_DLLPHASE_90 1
4870 +/* rkw - need to find of 90/72 degree recommendation for speed like before */
4871 +#define SDP_SDRC_DLLAB_CTRL ((DLL_ENADLL << 3) | \
4872 + (DLL_LOCKDLL << 2) | (DLL_DLLPHASE_90 << 1))
4874 +/* Infineon part of 3430SDP (165MHz optimized) 6.06ns
4876 + * TDAL = Twr/Tck + Trp/tck = 15/6 + 18/6 = 2.5 + 3 = 5.5 -> 6
4877 + * TDPL (Twr) = 15/6 = 2.5 -> 3
4883 + * TRFC = 72/6 = 12
4886 + * XSR = 120/6 = 20
4895 +#define TRFC_165 12
4896 +#define V_ACTIMA_165 ((TRFC_165 << 27) | (TRC_165 << 22) | (TRAS_165 << 18) \
4897 + | (TRP_165 << 15) | (TRCD_165 << 12) | (TRRD_165 << 9) | \
4898 + (TDPL_165 << 6) | (TDAL_165))
4904 +#define V_ACTIMB_165 (((TCKE_165 << 12) | (XSR_165 << 0)) | \
4905 + (TXP_165 << 8) | (TWTR_165 << 16))
4907 +# define SDP_SDRC_ACTIM_CTRLA_0 V_ACTIMA_165
4908 +# define SDP_SDRC_ACTIM_CTRLB_0 V_ACTIMB_165
4909 +# define SDP_SDRC_RFR_CTRL SDP_3430_SDRC_RFR_CTRL_165MHz
4913 + * Definitions is as per the following format
4914 + * # define <PART>_GPMC_CONFIG<x> <value>
4916 + * PART is the part name e.g. STNOR - Intel Strata Flash
4917 + * x is GPMC config registers from 1 to 6 (there will be 6 macros)
4918 + * Value is corresponding value
4920 + * For every valid PRCM configuration there should be only one definition of
4921 + * the same. if values are independent of the board, this definition will be
4922 + * present in this file if values are dependent on the board, then this should
4923 + * go into corresponding mem-boardName.h file
4925 + * Currently valid part Names are (PART):
4926 + * STNOR - Intel Strata Flash
4927 + * SMNAND - Samsung NAND
4928 + * MPDB - H4 MPDB board
4929 + * SBNOR - Sibley NOR
4930 + * MNAND - Micron Large page x16 NAND
4931 + * ONNAND - Samsung One NAND
4933 + * include/configs/file.h contains the defn - for all CS we are interested
4934 + * #define OMAP34XX_GPMC_CSx PART
4935 + * #define OMAP34XX_GPMC_CSx_SIZE Size
4936 + * #define OMAP34XX_GPMC_CSx_MAP Map
4939 + * PART - Part Name as defined above
4940 + * SIZE - how big is the mapping to be
4941 + * GPMC_SIZE_128M - 0x8
4942 + * GPMC_SIZE_64M - 0xC
4943 + * GPMC_SIZE_32M - 0xE
4944 + * GPMC_SIZE_16M - 0xF
4945 + * MAP - Map this CS to which address(GPMC address space)- Absolute address
4946 + * >>24 before being used.
4948 +#define GPMC_SIZE_128M 0x8
4949 +#define GPMC_SIZE_64M 0xC
4950 +#define GPMC_SIZE_32M 0xE
4951 +#define GPMC_SIZE_16M 0xF
4953 +# define SMNAND_GPMC_CONFIG1 0x00000800
4954 +# define SMNAND_GPMC_CONFIG2 0x00141400
4955 +# define SMNAND_GPMC_CONFIG3 0x00141400
4956 +# define SMNAND_GPMC_CONFIG4 0x0F010F01
4957 +# define SMNAND_GPMC_CONFIG5 0x010C1414
4958 +# define SMNAND_GPMC_CONFIG6 0x1F0F0A80
4959 +# define SMNAND_GPMC_CONFIG7 0x00000C44
4961 +# define M_NAND_GPMC_CONFIG1 0x00001800
4962 +# define M_NAND_GPMC_CONFIG2 0x00141400
4963 +# define M_NAND_GPMC_CONFIG3 0x00141400
4964 +# define M_NAND_GPMC_CONFIG4 0x0F010F01
4965 +# define M_NAND_GPMC_CONFIG5 0x010C1414
4966 +# define M_NAND_GPMC_CONFIG6 0x1f0f0A80
4967 +# define M_NAND_GPMC_CONFIG7 0x00000C44
4969 +# define STNOR_GPMC_CONFIG1 0x3
4970 +# define STNOR_GPMC_CONFIG2 0x00151501
4971 +# define STNOR_GPMC_CONFIG3 0x00060602
4972 +# define STNOR_GPMC_CONFIG4 0x11091109
4973 +# define STNOR_GPMC_CONFIG5 0x01141F1F
4974 +# define STNOR_GPMC_CONFIG6 0x000004c4
4976 +# define SIBNOR_GPMC_CONFIG1 0x1200
4977 +# define SIBNOR_GPMC_CONFIG2 0x001f1f00
4978 +# define SIBNOR_GPMC_CONFIG3 0x00080802
4979 +# define SIBNOR_GPMC_CONFIG4 0x1C091C09
4980 +# define SIBNOR_GPMC_CONFIG5 0x01131F1F
4981 +# define SIBNOR_GPMC_CONFIG6 0x1F0F03C2
4983 +# define SDPV2_MPDB_GPMC_CONFIG1 0x00611200
4984 +# define SDPV2_MPDB_GPMC_CONFIG2 0x001F1F01
4985 +# define SDPV2_MPDB_GPMC_CONFIG3 0x00080803
4986 +# define SDPV2_MPDB_GPMC_CONFIG4 0x1D091D09
4987 +# define SDPV2_MPDB_GPMC_CONFIG5 0x041D1F1F
4988 +# define SDPV2_MPDB_GPMC_CONFIG6 0x1D0904C4
4990 +# define MPDB_GPMC_CONFIG1 0x00011000
4991 +# define MPDB_GPMC_CONFIG2 0x001f1f01
4992 +# define MPDB_GPMC_CONFIG3 0x00080803
4993 +# define MPDB_GPMC_CONFIG4 0x1c0b1c0a
4994 +# define MPDB_GPMC_CONFIG5 0x041f1F1F
4995 +# define MPDB_GPMC_CONFIG6 0x1F0F04C4
4997 +# define P2_GPMC_CONFIG1 0x0
4998 +# define P2_GPMC_CONFIG2 0x0
4999 +# define P2_GPMC_CONFIG3 0x0
5000 +# define P2_GPMC_CONFIG4 0x0
5001 +# define P2_GPMC_CONFIG5 0x0
5002 +# define P2_GPMC_CONFIG6 0x0
5004 +# define ONENAND_GPMC_CONFIG1 0x00001200
5005 +# define ONENAND_GPMC_CONFIG2 0x000F0F01
5006 +# define ONENAND_GPMC_CONFIG3 0x00030301
5007 +# define ONENAND_GPMC_CONFIG4 0x0F040F04
5008 +# define ONENAND_GPMC_CONFIG5 0x010F1010
5009 +# define ONENAND_GPMC_CONFIG6 0x1F060000
5011 +/* max number of GPMC Chip Selects */
5012 +#define GPMC_MAX_CS 8
5013 +/* max number of GPMC regs */
5014 +#define GPMC_MAX_REG 7
5016 +#define PISMO1_NOR 1
5017 +#define PISMO1_NAND 2
5018 +#define PISMO2_CS0 3
5019 +#define PISMO2_CS1 4
5020 +#define PISMO1_ONENAND 5
5022 +#define PISMO2_NAND_CS0 7
5023 +#define PISMO2_NAND_CS1 8
5025 +/* make it readable for the gpmc_init */
5026 +#define PISMO1_NOR_BASE FLASH_BASE
5027 +#define PISMO1_NAND_BASE NAND_BASE
5028 +#define PISMO2_CS0_BASE PISMO2_MAP1
5029 +#define PISMO1_ONEN_BASE ONENAND_MAP
5030 +#define DBG_MPDB_BASE DEBUG_BASE
5032 +#endif /* endif _MEM_H_ */
5033 diff --git a/include/asm-arm/arch-omap3/mmc.h b/include/asm-arm/arch-omap3/mmc.h
5034 new file mode 100644
5035 index 0000000..8631aae
5037 +++ b/include/asm-arm/arch-omap3/mmc.h
5040 + * (C) Copyright 2008
5041 + * Texas Instruments, <www.ti.com>
5042 + * Syed Mohammed Khasim <khasim@ti.com>
5044 + * See file CREDITS for list of people who contributed to this
5047 + * This program is free software; you can redistribute it and/or
5048 + * modify it under the terms of the GNU General Public License as
5049 + * published by the Free Software Foundation's version 2 of
5052 + * This program is distributed in the hope that it will be useful,
5053 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5054 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5055 + * GNU General Public License for more details.
5057 + * You should have received a copy of the GNU General Public License
5058 + * along with this program; if not, write to the Free Software
5059 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5060 + * MA 02111-1307 USA
5066 +#include "mmc_host_def.h"
5069 +#define RSP_TYPE_NONE (RSP_TYPE_NORSP | CCCE_NOCHECK | CICE_NOCHECK)
5070 +#define RSP_TYPE_R1 (RSP_TYPE_LGHT48 | CCCE_CHECK | CICE_CHECK)
5071 +#define RSP_TYPE_R1B (RSP_TYPE_LGHT48B | CCCE_CHECK | CICE_CHECK)
5072 +#define RSP_TYPE_R2 (RSP_TYPE_LGHT136 | CCCE_CHECK | CICE_NOCHECK)
5073 +#define RSP_TYPE_R3 (RSP_TYPE_LGHT48 | CCCE_NOCHECK | CICE_NOCHECK)
5074 +#define RSP_TYPE_R4 (RSP_TYPE_LGHT48 | CCCE_NOCHECK | CICE_NOCHECK)
5075 +#define RSP_TYPE_R5 (RSP_TYPE_LGHT48 | CCCE_CHECK | CICE_CHECK)
5076 +#define RSP_TYPE_R6 (RSP_TYPE_LGHT48 | CCCE_CHECK | CICE_CHECK)
5077 +#define RSP_TYPE_R7 (RSP_TYPE_LGHT48 | CCCE_CHECK | CICE_CHECK)
5079 +/* All supported commands */
5080 +#define MMC_CMD0 (INDEX(0) | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
5081 +#define MMC_CMD1 (INDEX(1) | RSP_TYPE_R3 | DP_NO_DATA | DDIR_WRITE)
5082 +#define MMC_CMD2 (INDEX(2) | RSP_TYPE_R2 | DP_NO_DATA | DDIR_WRITE)
5083 +#define MMC_CMD3 (INDEX(3) | RSP_TYPE_R1 | DP_NO_DATA | DDIR_WRITE)
5084 +#define MMC_SDCMD3 (INDEX(3) | RSP_TYPE_R6 | DP_NO_DATA | DDIR_WRITE)
5085 +#define MMC_CMD4 (INDEX(4) | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
5086 +#define MMC_CMD6 (INDEX(6) | RSP_TYPE_R1B | DP_NO_DATA | DDIR_WRITE)
5087 +#define MMC_CMD7_SELECT (INDEX(7) | RSP_TYPE_R1B | DP_NO_DATA | DDIR_WRITE)
5088 +#define MMC_CMD7_DESELECT (INDEX(7) | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
5089 +#define MMC_CMD8 (INDEX(8) | RSP_TYPE_R1 | DP_DATA | DDIR_READ)
5090 +#define MMC_SDCMD8 (INDEX(8) | RSP_TYPE_R7 | DP_NO_DATA | DDIR_WRITE)
5091 +#define MMC_CMD9 (INDEX(9) | RSP_TYPE_R2 | DP_NO_DATA | DDIR_WRITE)
5092 +#define MMC_CMD12 (INDEX(12) | RSP_TYPE_R1B | DP_NO_DATA | DDIR_WRITE)
5093 +#define MMC_CMD13 (INDEX(13) | RSP_TYPE_R1 | DP_NO_DATA | DDIR_WRITE)
5094 +#define MMC_CMD15 (INDEX(15) | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
5095 +#define MMC_CMD16 (INDEX(16) | RSP_TYPE_R1 | DP_NO_DATA | DDIR_WRITE)
5096 +#define MMC_CMD17 (INDEX(17) | RSP_TYPE_R1 | DP_DATA | DDIR_READ)
5097 +#define MMC_CMD24 (INDEX(24) | RSP_TYPE_R1 | DP_DATA | DDIR_WRITE)
5098 +#define MMC_ACMD6 (INDEX(6) | RSP_TYPE_R1 | DP_NO_DATA | DDIR_WRITE)
5099 +#define MMC_ACMD41 (INDEX(41) | RSP_TYPE_R3 | DP_NO_DATA | DDIR_WRITE)
5100 +#define MMC_ACMD51 (INDEX(51) | RSP_TYPE_R1 | DP_DATA | DDIR_READ)
5101 +#define MMC_CMD55 (INDEX(55) | RSP_TYPE_R1 | DP_NO_DATA | DDIR_WRITE)
5103 +#define MMC_AC_CMD_RCA_MASK (unsigned int)(0xFFFF << 16)
5104 +#define MMC_BC_CMD_DSR_MASK (unsigned int)(0xFFFF << 16)
5105 +#define MMC_DSR_DEFAULT (0x0404)
5106 +#define SD_CMD8_CHECK_PATTERN (0xAA)
5107 +#define SD_CMD8_2_7_3_6_V_RANGE (0x01 << 8)
5109 +/* Clock Configurations and Macros */
5111 +#define MMC_CLOCK_REFERENCE (96)
5112 +#define MMC_RELATIVE_CARD_ADDRESS (0x1234)
5113 +#define MMC_INIT_SEQ_CLK (MMC_CLOCK_REFERENCE * 1000 / 80)
5114 +#define MMC_400kHz_CLK (MMC_CLOCK_REFERENCE * 1000 / 400)
5115 +#define CLKDR(r, f, u) ((((r)*100) / ((f)*(u))) + 1)
5116 +#define CLKD(f, u) (CLKDR(MMC_CLOCK_REFERENCE, f, u))
5118 +#define MMC_OCR_REG_ACCESS_MODE_MASK (0x3 << 29)
5119 +#define MMC_OCR_REG_ACCESS_MODE_BYTE (0x0 << 29)
5120 +#define MMC_OCR_REG_ACCESS_MODE_SECTOR (0x2 << 29)
5122 +#define MMC_OCR_REG_HOST_CAPACITY_SUPPORT_MASK (0x1 << 30)
5123 +#define MMC_OCR_REG_HOST_CAPACITY_SUPPORT_BYTE (0x0 << 30)
5124 +#define MMC_OCR_REG_HOST_CAPACITY_SUPPORT_SECTOR (0x1 << 30)
5126 +#define MMC_SD2_CSD_C_SIZE_LSB_MASK (0xFFFF)
5127 +#define MMC_SD2_CSD_C_SIZE_MSB_MASK (0x003F)
5128 +#define MMC_SD2_CSD_C_SIZE_MSB_OFFSET (16)
5129 +#define MMC_CSD_C_SIZE_LSB_MASK (0x0003)
5130 +#define MMC_CSD_C_SIZE_MSB_MASK (0x03FF)
5131 +#define MMC_CSD_C_SIZE_MSB_OFFSET (2)
5133 +#define MMC_CSD_TRAN_SPEED_UNIT_MASK (0x07 << 0)
5134 +#define MMC_CSD_TRAN_SPEED_FACTOR_MASK (0x0F << 3)
5135 +#define MMC_CSD_TRAN_SPEED_UNIT_100MHZ (0x3 << 0)
5136 +#define MMC_CSD_TRAN_SPEED_FACTOR_1_0 (0x01 << 3)
5137 +#define MMC_CSD_TRAN_SPEED_FACTOR_8_0 (0x0F << 3)
5140 + unsigned not_used:1;
5143 + unsigned file_format:2;
5144 + unsigned tmp_write_protect:1;
5145 + unsigned perm_write_protect:1;
5147 + unsigned file_format_grp:1;
5148 + unsigned content_prot_app:1;
5149 + unsigned reserved_1:4;
5150 + unsigned write_bl_partial:1;
5151 + unsigned write_bl_len:4;
5152 + unsigned r2w_factor:3;
5153 + unsigned default_ecc:2;
5154 + unsigned wp_grp_enable:1;
5155 + unsigned wp_grp_size:5;
5156 + unsigned erase_grp_mult:5;
5157 + unsigned erase_grp_size:5;
5158 + unsigned c_size_mult:3;
5159 + unsigned vdd_w_curr_max:3;
5160 + unsigned vdd_w_curr_min:3;
5161 + unsigned vdd_r_curr_max:3;
5162 + unsigned vdd_r_curr_min:3;
5163 + unsigned c_size_lsb:2;
5164 + unsigned c_size_msb:10;
5165 + unsigned reserved_2:2;
5166 + unsigned dsr_imp:1;
5167 + unsigned read_blk_misalign:1;
5168 + unsigned write_blk_misalign:1;
5169 + unsigned read_bl_partial:1;
5170 + unsigned read_bl_len:4;
5172 + unsigned tran_speed:8;
5175 + unsigned reserved_3:2;
5176 + unsigned spec_vers:4;
5177 + unsigned csd_structure:2;
5180 +/* csd for sd2.0 */
5182 + unsigned not_used:1;
5184 + unsigned reserved_1:2;
5185 + unsigned file_format:2;
5186 + unsigned tmp_write_protect:1;
5187 + unsigned perm_write_protect:1;
5189 + unsigned file_format_grp:1;
5190 + unsigned reserved_2:5;
5191 + unsigned write_bl_partial:1;
5192 + unsigned write_bl_len:4;
5193 + unsigned r2w_factor:3;
5194 + unsigned reserved_3:2;
5195 + unsigned wp_grp_enable:1;
5196 + unsigned wp_grp_size:7;
5197 + unsigned sector_size:7;
5198 + unsigned erase_blk_len:1;
5199 + unsigned reserved_4:1;
5200 + unsigned c_size_lsb:16;
5201 + unsigned c_size_msb:6;
5202 + unsigned reserved_5:6;
5203 + unsigned dsr_imp:1;
5204 + unsigned read_blk_misalign:1;
5205 + unsigned write_blk_misalign:1;
5206 + unsigned read_bl_partial:1;
5207 + unsigned read_bl_len:4;
5209 + unsigned tran_speed:8;
5212 + unsigned reserved_6:6;
5213 + unsigned csd_structure:2;
5214 +} mmc_sd2_csd_reg_t;
5216 +/* extended csd - 512 bytes long */
5218 + unsigned char reserved_1[181];
5219 + unsigned char erasedmemorycontent;
5220 + unsigned char reserved_2;
5221 + unsigned char buswidthmode;
5222 + unsigned char reserved_3;
5223 + unsigned char highspeedinterfacetiming;
5224 + unsigned char reserved_4;
5225 + unsigned char powerclass;
5226 + unsigned char reserved_5;
5227 + unsigned char commandsetrevision;
5228 + unsigned char reserved_6;
5229 + unsigned char commandset;
5230 + unsigned char extendedcsdrevision;
5231 + unsigned char reserved_7;
5232 + unsigned char csdstructureversion;
5233 + unsigned char reserved_8;
5234 + unsigned char cardtype;
5235 + unsigned char reserved_9[3];
5236 + unsigned char powerclass_52mhz_1_95v;
5237 + unsigned char powerclass_26mhz_1_95v;
5238 + unsigned char powerclass_52mhz_3_6v;
5239 + unsigned char powerclass_26mhz_3_6v;
5240 + unsigned char reserved_10;
5241 + unsigned char minreadperf_4b_26mhz;
5242 + unsigned char minwriteperf_4b_26mhz;
5243 + unsigned char minreadperf_8b_26mhz_4b_52mhz;
5244 + unsigned char minwriteperf_8b_26mhz_4b_52mhz;
5245 + unsigned char minreadperf_8b_52mhz;
5246 + unsigned char minwriteperf_8b_52mhz;
5247 + unsigned char reserved_11;
5248 + unsigned int sectorcount;
5249 + unsigned char reserved_12[288];
5250 + unsigned char supportedcommandsets;
5251 + unsigned char reserved_13[7];
5252 +} mmc_extended_csd_reg_t;
5254 +/* mmc sd responce */
5260 + unsigned short cardstatus;
5261 + unsigned short newpublishedrca;
5264 +extern mmc_card_data mmc_dev;
5266 +unsigned char mmc_lowlevel_init(void);
5267 +unsigned char mmc_send_command(unsigned int cmd, unsigned int arg,
5268 + unsigned int *response);
5269 +unsigned char mmc_setup_clock(unsigned int iclk, unsigned short clkd);
5270 +unsigned char mmc_set_opendrain(unsigned char state);
5271 +unsigned char mmc_read_data(unsigned int *output_buf);
5274 diff --git a/include/asm-arm/arch-omap3/mmc_host_def.h b/include/asm-arm/arch-omap3/mmc_host_def.h
5275 new file mode 100644
5276 index 0000000..37aaa08
5278 +++ b/include/asm-arm/arch-omap3/mmc_host_def.h
5281 + * (C) Copyright 2008
5282 + * Texas Instruments, <www.ti.com>
5283 + * Syed Mohammed Khasim <khasim@ti.com>
5285 + * See file CREDITS for list of people who contributed to this
5288 + * This program is free software; you can redistribute it and/or
5289 + * modify it under the terms of the GNU General Public License as
5290 + * published by the Free Software Foundation's version 2 of
5293 + * This program is distributed in the hope that it will be useful,
5294 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5295 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5296 + * GNU General Public License for more details.
5298 + * You should have received a copy of the GNU General Public License
5299 + * along with this program; if not, write to the Free Software
5300 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5301 + * MA 02111-1307 USA
5304 +#ifndef MMC_HOST_DEF_H
5305 +#define MMC_HOST_DEF_H
5308 + * OMAP HSMMC register definitions
5310 +#define OMAP_HSMMC_SYSCONFIG (*(unsigned int *) 0x4809C010)
5311 +#define OMAP_HSMMC_SYSSTATUS (*(unsigned int *) 0x4809C014)
5312 +#define OMAP_HSMMC_CON (*(unsigned int *) 0x4809C02C)
5313 +#define OMAP_HSMMC_BLK (*(unsigned int *) 0x4809C104)
5314 +#define OMAP_HSMMC_ARG (*(unsigned int *) 0x4809C108)
5315 +#define OMAP_HSMMC_CMD (*(unsigned int *) 0x4809C10C)
5316 +#define OMAP_HSMMC_RSP10 (*(unsigned int *) 0x4809C110)
5317 +#define OMAP_HSMMC_RSP32 (*(unsigned int *) 0x4809C114)
5318 +#define OMAP_HSMMC_RSP54 (*(unsigned int *) 0x4809C118)
5319 +#define OMAP_HSMMC_RSP76 (*(unsigned int *) 0x4809C11C)
5320 +#define OMAP_HSMMC_DATA (*(unsigned int *) 0x4809C120)
5321 +#define OMAP_HSMMC_PSTATE (*(unsigned int *) 0x4809C124)
5322 +#define OMAP_HSMMC_HCTL (*(unsigned int *) 0x4809C128)
5323 +#define OMAP_HSMMC_SYSCTL (*(unsigned int *) 0x4809C12C)
5324 +#define OMAP_HSMMC_STAT (*(unsigned int *) 0x4809C130)
5325 +#define OMAP_HSMMC_IE (*(unsigned int *) 0x4809C134)
5326 +#define OMAP_HSMMC_CAPA (*(unsigned int *) 0x4809C140)
5328 +/* T2 Register definitions */
5329 +#define CONTROL_DEV_CONF0 (*(unsigned int *) 0x48002274)
5330 +#define CONTROL_PBIAS_LITE (*(unsigned int *) 0x48002520)
5333 + * OMAP HS MMC Bit definitions
5335 +#define MMC_SOFTRESET (0x1 << 1)
5336 +#define RESETDONE (0x1 << 0)
5337 +#define NOOPENDRAIN (0x0 << 0)
5338 +#define OPENDRAIN (0x1 << 0)
5339 +#define OD (0x1 << 0)
5340 +#define INIT_NOINIT (0x0 << 1)
5341 +#define INIT_INITSTREAM (0x1 << 1)
5342 +#define HR_NOHOSTRESP (0x0 << 2)
5343 +#define STR_BLOCK (0x0 << 3)
5344 +#define MODE_FUNC (0x0 << 4)
5345 +#define DW8_1_4BITMODE (0x0 << 5)
5346 +#define MIT_CTO (0x0 << 6)
5347 +#define CDP_ACTIVEHIGH (0x0 << 7)
5348 +#define WPP_ACTIVEHIGH (0x0 << 8)
5349 +#define RESERVED_MASK (0x3 << 9)
5350 +#define CTPL_MMC_SD (0x0 << 11)
5351 +#define BLEN_512BYTESLEN (0x200 << 0)
5352 +#define NBLK_STPCNT (0x0 << 16)
5353 +#define DE_DISABLE (0x0 << 0)
5354 +#define BCE_DISABLE (0x0 << 1)
5355 +#define ACEN_DISABLE (0x0 << 2)
5356 +#define DDIR_OFFSET (4)
5357 +#define DDIR_MASK (0x1 << 4)
5358 +#define DDIR_WRITE (0x0 << 4)
5359 +#define DDIR_READ (0x1 << 4)
5360 +#define MSBS_SGLEBLK (0x0 << 5)
5361 +#define RSP_TYPE_OFFSET (16)
5362 +#define RSP_TYPE_MASK (0x3 << 16)
5363 +#define RSP_TYPE_NORSP (0x0 << 16)
5364 +#define RSP_TYPE_LGHT136 (0x1 << 16)
5365 +#define RSP_TYPE_LGHT48 (0x2 << 16)
5366 +#define RSP_TYPE_LGHT48B (0x3 << 16)
5367 +#define CCCE_NOCHECK (0x0 << 19)
5368 +#define CCCE_CHECK (0x1 << 19)
5369 +#define CICE_NOCHECK (0x0 << 20)
5370 +#define CICE_CHECK (0x1 << 20)
5371 +#define DP_OFFSET (21)
5372 +#define DP_MASK (0x1 << 21)
5373 +#define DP_NO_DATA (0x0 << 21)
5374 +#define DP_DATA (0x1 << 21)
5375 +#define CMD_TYPE_NORMAL (0x0 << 22)
5376 +#define INDEX_OFFSET (24)
5377 +#define INDEX_MASK (0x3f << 24)
5378 +#define INDEX(i) (i << 24)
5379 +#define DATI_MASK (0x1 << 1)
5380 +#define DATI_CMDDIS (0x1 << 1)
5381 +#define DTW_1_BITMODE (0x0 << 1)
5382 +#define DTW_4_BITMODE (0x1 << 1)
5383 +#define SDBP_PWROFF (0x0 << 8)
5384 +#define SDBP_PWRON (0x1 << 8)
5385 +#define SDVS_1V8 (0x5 << 9)
5386 +#define SDVS_3V0 (0x6 << 9)
5387 +#define ICE_MASK (0x1 << 0)
5388 +#define ICE_STOP (0x0 << 0)
5389 +#define ICS_MASK (0x1 << 1)
5390 +#define ICS_NOTREADY (0x0 << 1)
5391 +#define ICE_OSCILLATE (0x1 << 0)
5392 +#define CEN_MASK (0x1 << 2)
5393 +#define CEN_DISABLE (0x0 << 2)
5394 +#define CEN_ENABLE (0x1 << 2)
5395 +#define CLKD_OFFSET (6)
5396 +#define CLKD_MASK (0x3FF << 6)
5397 +#define DTO_MASK (0xF << 16)
5398 +#define DTO_15THDTO (0xE << 16)
5399 +#define SOFTRESETALL (0x1 << 24)
5400 +#define CC_MASK (0x1 << 0)
5401 +#define TC_MASK (0x1 << 1)
5402 +#define BWR_MASK (0x1 << 4)
5403 +#define BRR_MASK (0x1 << 5)
5404 +#define ERRI_MASK (0x1 << 15)
5405 +#define IE_CC (0x01 << 0)
5406 +#define IE_TC (0x01 << 1)
5407 +#define IE_BWR (0x01 << 4)
5408 +#define IE_BRR (0x01 << 5)
5409 +#define IE_CTO (0x01 << 16)
5410 +#define IE_CCRC (0x01 << 17)
5411 +#define IE_CEB (0x01 << 18)
5412 +#define IE_CIE (0x01 << 19)
5413 +#define IE_DTO (0x01 << 20)
5414 +#define IE_DCRC (0x01 << 21)
5415 +#define IE_DEB (0x01 << 22)
5416 +#define IE_CERR (0x01 << 28)
5417 +#define IE_BADA (0x01 << 29)
5419 +#define VS30_3V0SUP (1 << 25)
5420 +#define VS18_1V8SUP (1 << 26)
5422 +/* Driver definitions */
5423 +#define MMCSD_SECTOR_SIZE (512)
5426 +#define BYTE_MODE 0
5427 +#define SECTOR_MODE 1
5428 +#define CLK_INITSEQ 0
5429 +#define CLK_400KHZ 1
5433 + unsigned int card_type;
5434 + unsigned int version;
5435 + unsigned int mode;
5436 + unsigned int size;
5440 +#define mmc_reg_out(addr, mask, val)\
5441 + (addr) = (((addr)) & (~(mask))) | ((val) & (mask));
5442 +#define mmc_reg_out(addr, mask, val)\
5443 + (addr) = (((addr)) & (~(mask))) | ((val) & (mask));
5445 +#endif /* MMC_HOST_DEF_H */
5446 diff --git a/include/asm-arm/arch-omap3/mux.h b/include/asm-arm/arch-omap3/mux.h
5447 new file mode 100644
5448 index 0000000..ec4aeb0
5450 +++ b/include/asm-arm/arch-omap3/mux.h
5453 + * (C) Copyright 2006-2008
5454 + * Texas Instruments, <www.ti.com>
5455 + * Syed Mohammed Khasim <x0khasim@ti.com>
5457 + * This program is free software; you can redistribute it and/or
5458 + * modify it under the terms of the GNU General Public License as
5459 + * published by the Free Software Foundation; either version 2 of
5460 + * the License, or (at your option) any later version.
5462 + * This program is distributed in the hope that it will be useful,
5463 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5464 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5465 + * GNU General Public License for more details.
5467 + * You should have received a copy of the GNU General Public License
5468 + * along with this program; if not, write to the Free Software
5469 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5470 + * MA 02111-1307 USA
5476 + * IEN - Input Enable
5477 + * IDIS - Input Disable
5478 + * PTD - Pull type Down
5479 + * PTU - Pull type Up
5480 + * DIS - Pull type selection is inactive
5481 + * EN - Pull type selection is active
5485 +#define IEN (1 << 8)
5487 +#define IDIS (0 << 8)
5488 +#define PTU (1 << 4)
5489 +#define PTD (0 << 4)
5490 +#define EN (1 << 3)
5491 +#define DIS (0 << 3)
5503 + * To get the actual address the offset has to added
5504 + * with OMAP34XX_CTRL_BASE to get the actual address
5508 +#define CONTROL_PADCONF_SDRC_D0 0x0030
5509 +#define CONTROL_PADCONF_SDRC_D1 0x0032
5510 +#define CONTROL_PADCONF_SDRC_D2 0x0034
5511 +#define CONTROL_PADCONF_SDRC_D3 0x0036
5512 +#define CONTROL_PADCONF_SDRC_D4 0x0038
5513 +#define CONTROL_PADCONF_SDRC_D5 0x003A
5514 +#define CONTROL_PADCONF_SDRC_D6 0x003C
5515 +#define CONTROL_PADCONF_SDRC_D7 0x003E
5516 +#define CONTROL_PADCONF_SDRC_D8 0x0040
5517 +#define CONTROL_PADCONF_SDRC_D9 0x0042
5518 +#define CONTROL_PADCONF_SDRC_D10 0x0044
5519 +#define CONTROL_PADCONF_SDRC_D11 0x0046
5520 +#define CONTROL_PADCONF_SDRC_D12 0x0048
5521 +#define CONTROL_PADCONF_SDRC_D13 0x004A
5522 +#define CONTROL_PADCONF_SDRC_D14 0x004C
5523 +#define CONTROL_PADCONF_SDRC_D15 0x004E
5524 +#define CONTROL_PADCONF_SDRC_D16 0x0050
5525 +#define CONTROL_PADCONF_SDRC_D17 0x0052
5526 +#define CONTROL_PADCONF_SDRC_D18 0x0054
5527 +#define CONTROL_PADCONF_SDRC_D19 0x0056
5528 +#define CONTROL_PADCONF_SDRC_D20 0x0058
5529 +#define CONTROL_PADCONF_SDRC_D21 0x005A
5530 +#define CONTROL_PADCONF_SDRC_D22 0x005C
5531 +#define CONTROL_PADCONF_SDRC_D23 0x005E
5532 +#define CONTROL_PADCONF_SDRC_D24 0x0060
5533 +#define CONTROL_PADCONF_SDRC_D25 0x0062
5534 +#define CONTROL_PADCONF_SDRC_D26 0x0064
5535 +#define CONTROL_PADCONF_SDRC_D27 0x0066
5536 +#define CONTROL_PADCONF_SDRC_D28 0x0068
5537 +#define CONTROL_PADCONF_SDRC_D29 0x006A
5538 +#define CONTROL_PADCONF_SDRC_D30 0x006C
5539 +#define CONTROL_PADCONF_SDRC_D31 0x006E
5540 +#define CONTROL_PADCONF_SDRC_CLK 0x0070
5541 +#define CONTROL_PADCONF_SDRC_DQS0 0x0072
5542 +#define CONTROL_PADCONF_SDRC_DQS1 0x0074
5543 +#define CONTROL_PADCONF_SDRC_DQS2 0x0076
5544 +#define CONTROL_PADCONF_SDRC_DQS3 0x0078
5546 +#define CONTROL_PADCONF_GPMC_A1 0x007A
5547 +#define CONTROL_PADCONF_GPMC_A2 0x007C
5548 +#define CONTROL_PADCONF_GPMC_A3 0x007E
5549 +#define CONTROL_PADCONF_GPMC_A4 0x0080
5550 +#define CONTROL_PADCONF_GPMC_A5 0x0082
5551 +#define CONTROL_PADCONF_GPMC_A6 0x0084
5552 +#define CONTROL_PADCONF_GPMC_A7 0x0086
5553 +#define CONTROL_PADCONF_GPMC_A8 0x0088
5554 +#define CONTROL_PADCONF_GPMC_A9 0x008A
5555 +#define CONTROL_PADCONF_GPMC_A10 0x008C
5556 +#define CONTROL_PADCONF_GPMC_D0 0x008E
5557 +#define CONTROL_PADCONF_GPMC_D1 0x0090
5558 +#define CONTROL_PADCONF_GPMC_D2 0x0092
5559 +#define CONTROL_PADCONF_GPMC_D3 0x0094
5560 +#define CONTROL_PADCONF_GPMC_D4 0x0096
5561 +#define CONTROL_PADCONF_GPMC_D5 0x0098
5562 +#define CONTROL_PADCONF_GPMC_D6 0x009A
5563 +#define CONTROL_PADCONF_GPMC_D7 0x009C
5564 +#define CONTROL_PADCONF_GPMC_D8 0x009E
5565 +#define CONTROL_PADCONF_GPMC_D9 0x00A0
5566 +#define CONTROL_PADCONF_GPMC_D10 0x00A2
5567 +#define CONTROL_PADCONF_GPMC_D11 0x00A4
5568 +#define CONTROL_PADCONF_GPMC_D12 0x00A6
5569 +#define CONTROL_PADCONF_GPMC_D13 0x00A8
5570 +#define CONTROL_PADCONF_GPMC_D14 0x00AA
5571 +#define CONTROL_PADCONF_GPMC_D15 0x00AC
5572 +#define CONTROL_PADCONF_GPMC_nCS0 0x00AE
5573 +#define CONTROL_PADCONF_GPMC_nCS1 0x00B0
5574 +#define CONTROL_PADCONF_GPMC_nCS2 0x00B2
5575 +#define CONTROL_PADCONF_GPMC_nCS3 0x00B4
5576 +#define CONTROL_PADCONF_GPMC_nCS4 0x00B6
5577 +#define CONTROL_PADCONF_GPMC_nCS5 0x00B8
5578 +#define CONTROL_PADCONF_GPMC_nCS6 0x00BA
5579 +#define CONTROL_PADCONF_GPMC_nCS7 0x00BC
5580 +#define CONTROL_PADCONF_GPMC_CLK 0x00BE
5581 +#define CONTROL_PADCONF_GPMC_nADV_ALE 0x00C0
5582 +#define CONTROL_PADCONF_GPMC_nOE 0x00C2
5583 +#define CONTROL_PADCONF_GPMC_nWE 0x00C4
5584 +#define CONTROL_PADCONF_GPMC_nBE0_CLE 0x00C6
5585 +#define CONTROL_PADCONF_GPMC_nBE1 0x00C8
5586 +#define CONTROL_PADCONF_GPMC_nWP 0x00CA
5587 +#define CONTROL_PADCONF_GPMC_WAIT0 0x00CC
5588 +#define CONTROL_PADCONF_GPMC_WAIT1 0x00CE
5589 +#define CONTROL_PADCONF_GPMC_WAIT2 0x00D0
5590 +#define CONTROL_PADCONF_GPMC_WAIT3 0x00D2
5592 +#define CONTROL_PADCONF_DSS_PCLK 0x00D4
5593 +#define CONTROL_PADCONF_DSS_HSYNC 0x00D6
5594 +#define CONTROL_PADCONF_DSS_VSYNC 0x00D8
5595 +#define CONTROL_PADCONF_DSS_ACBIAS 0x00DA
5596 +#define CONTROL_PADCONF_DSS_DATA0 0x00DC
5597 +#define CONTROL_PADCONF_DSS_DATA1 0x00DE
5598 +#define CONTROL_PADCONF_DSS_DATA2 0x00E0
5599 +#define CONTROL_PADCONF_DSS_DATA3 0x00E2
5600 +#define CONTROL_PADCONF_DSS_DATA4 0x00E4
5601 +#define CONTROL_PADCONF_DSS_DATA5 0x00E6
5602 +#define CONTROL_PADCONF_DSS_DATA6 0x00E8
5603 +#define CONTROL_PADCONF_DSS_DATA7 0x00EA
5604 +#define CONTROL_PADCONF_DSS_DATA8 0x00EC
5605 +#define CONTROL_PADCONF_DSS_DATA9 0x00EE
5606 +#define CONTROL_PADCONF_DSS_DATA10 0x00F0
5607 +#define CONTROL_PADCONF_DSS_DATA11 0x00F2
5608 +#define CONTROL_PADCONF_DSS_DATA12 0x00F4
5609 +#define CONTROL_PADCONF_DSS_DATA13 0x00F6
5610 +#define CONTROL_PADCONF_DSS_DATA14 0x00F8
5611 +#define CONTROL_PADCONF_DSS_DATA15 0x00FA
5612 +#define CONTROL_PADCONF_DSS_DATA16 0x00FC
5613 +#define CONTROL_PADCONF_DSS_DATA17 0x00FE
5614 +#define CONTROL_PADCONF_DSS_DATA18 0x0100
5615 +#define CONTROL_PADCONF_DSS_DATA19 0x0102
5616 +#define CONTROL_PADCONF_DSS_DATA20 0x0104
5617 +#define CONTROL_PADCONF_DSS_DATA21 0x0106
5618 +#define CONTROL_PADCONF_DSS_DATA22 0x0108
5619 +#define CONTROL_PADCONF_DSS_DATA23 0x010A
5621 +#define CONTROL_PADCONF_CAM_HS 0x010C
5622 +#define CONTROL_PADCONF_CAM_VS 0x010E
5623 +#define CONTROL_PADCONF_CAM_XCLKA 0x0110
5624 +#define CONTROL_PADCONF_CAM_PCLK 0x0112
5625 +#define CONTROL_PADCONF_CAM_FLD 0x0114
5626 +#define CONTROL_PADCONF_CAM_D0 0x0116
5627 +#define CONTROL_PADCONF_CAM_D1 0x0118
5628 +#define CONTROL_PADCONF_CAM_D2 0x011A
5629 +#define CONTROL_PADCONF_CAM_D3 0x011C
5630 +#define CONTROL_PADCONF_CAM_D4 0x011E
5631 +#define CONTROL_PADCONF_CAM_D5 0x0120
5632 +#define CONTROL_PADCONF_CAM_D6 0x0122
5633 +#define CONTROL_PADCONF_CAM_D7 0x0124
5634 +#define CONTROL_PADCONF_CAM_D8 0x0126
5635 +#define CONTROL_PADCONF_CAM_D9 0x0128
5636 +#define CONTROL_PADCONF_CAM_D10 0x012A
5637 +#define CONTROL_PADCONF_CAM_D11 0x012C
5638 +#define CONTROL_PADCONF_CAM_XCLKB 0x012E
5639 +#define CONTROL_PADCONF_CAM_WEN 0x0130
5640 +#define CONTROL_PADCONF_CAM_STROBE 0x0132
5641 +#define CONTROL_PADCONF_CSI2_DX0 0x0134
5642 +#define CONTROL_PADCONF_CSI2_DY0 0x0136
5643 +#define CONTROL_PADCONF_CSI2_DX1 0x0138
5644 +#define CONTROL_PADCONF_CSI2_DY1 0x013A
5645 +/*Audio Interface */
5646 +#define CONTROL_PADCONF_McBSP2_FSX 0x013C
5647 +#define CONTROL_PADCONF_McBSP2_CLKX 0x013E
5648 +#define CONTROL_PADCONF_McBSP2_DR 0x0140
5649 +#define CONTROL_PADCONF_McBSP2_DX 0x0142
5650 +#define CONTROL_PADCONF_MMC1_CLK 0x0144
5651 +#define CONTROL_PADCONF_MMC1_CMD 0x0146
5652 +#define CONTROL_PADCONF_MMC1_DAT0 0x0148
5653 +#define CONTROL_PADCONF_MMC1_DAT1 0x014A
5654 +#define CONTROL_PADCONF_MMC1_DAT2 0x014C
5655 +#define CONTROL_PADCONF_MMC1_DAT3 0x014E
5656 +#define CONTROL_PADCONF_MMC1_DAT4 0x0150
5657 +#define CONTROL_PADCONF_MMC1_DAT5 0x0152
5658 +#define CONTROL_PADCONF_MMC1_DAT6 0x0154
5659 +#define CONTROL_PADCONF_MMC1_DAT7 0x0156
5661 +#define CONTROL_PADCONF_MMC2_CLK 0x0158
5662 +#define CONTROL_PADCONF_MMC2_CMD 0x015A
5663 +#define CONTROL_PADCONF_MMC2_DAT0 0x015C
5664 +#define CONTROL_PADCONF_MMC2_DAT1 0x015E
5665 +#define CONTROL_PADCONF_MMC2_DAT2 0x0160
5666 +#define CONTROL_PADCONF_MMC2_DAT3 0x0162
5667 +#define CONTROL_PADCONF_MMC2_DAT4 0x0164
5668 +#define CONTROL_PADCONF_MMC2_DAT5 0x0166
5669 +#define CONTROL_PADCONF_MMC2_DAT6 0x0168
5670 +#define CONTROL_PADCONF_MMC2_DAT7 0x016A
5672 +#define CONTROL_PADCONF_McBSP3_DX 0x016C
5673 +#define CONTROL_PADCONF_McBSP3_DR 0x016E
5674 +#define CONTROL_PADCONF_McBSP3_CLKX 0x0170
5675 +#define CONTROL_PADCONF_McBSP3_FSX 0x0172
5676 +#define CONTROL_PADCONF_UART2_CTS 0x0174
5677 +#define CONTROL_PADCONF_UART2_RTS 0x0176
5678 +#define CONTROL_PADCONF_UART2_TX 0x0178
5679 +#define CONTROL_PADCONF_UART2_RX 0x017A
5680 +/*Modem Interface */
5681 +#define CONTROL_PADCONF_UART1_TX 0x017C
5682 +#define CONTROL_PADCONF_UART1_RTS 0x017E
5683 +#define CONTROL_PADCONF_UART1_CTS 0x0180
5684 +#define CONTROL_PADCONF_UART1_RX 0x0182
5685 +#define CONTROL_PADCONF_McBSP4_CLKX 0x0184
5686 +#define CONTROL_PADCONF_McBSP4_DR 0x0186
5687 +#define CONTROL_PADCONF_McBSP4_DX 0x0188
5688 +#define CONTROL_PADCONF_McBSP4_FSX 0x018A
5689 +#define CONTROL_PADCONF_McBSP1_CLKR 0x018C
5690 +#define CONTROL_PADCONF_McBSP1_FSR 0x018E
5691 +#define CONTROL_PADCONF_McBSP1_DX 0x0190
5692 +#define CONTROL_PADCONF_McBSP1_DR 0x0192
5693 +#define CONTROL_PADCONF_McBSP_CLKS 0x0194
5694 +#define CONTROL_PADCONF_McBSP1_FSX 0x0196
5695 +#define CONTROL_PADCONF_McBSP1_CLKX 0x0198
5696 +/*Serial Interface*/
5697 +#define CONTROL_PADCONF_UART3_CTS_RCTX 0x019A
5698 +#define CONTROL_PADCONF_UART3_RTS_SD 0x019C
5699 +#define CONTROL_PADCONF_UART3_RX_IRRX 0x019E
5700 +#define CONTROL_PADCONF_UART3_TX_IRTX 0x01A0
5701 +#define CONTROL_PADCONF_HSUSB0_CLK 0x01A2
5702 +#define CONTROL_PADCONF_HSUSB0_STP 0x01A4
5703 +#define CONTROL_PADCONF_HSUSB0_DIR 0x01A6
5704 +#define CONTROL_PADCONF_HSUSB0_NXT 0x01A8
5705 +#define CONTROL_PADCONF_HSUSB0_DATA0 0x01AA
5706 +#define CONTROL_PADCONF_HSUSB0_DATA1 0x01AC
5707 +#define CONTROL_PADCONF_HSUSB0_DATA2 0x01AE
5708 +#define CONTROL_PADCONF_HSUSB0_DATA3 0x01B0
5709 +#define CONTROL_PADCONF_HSUSB0_DATA4 0x01B2
5710 +#define CONTROL_PADCONF_HSUSB0_DATA5 0x01B4
5711 +#define CONTROL_PADCONF_HSUSB0_DATA6 0x01B6
5712 +#define CONTROL_PADCONF_HSUSB0_DATA7 0x01B8
5713 +#define CONTROL_PADCONF_I2C1_SCL 0x01BA
5714 +#define CONTROL_PADCONF_I2C1_SDA 0x01BC
5715 +#define CONTROL_PADCONF_I2C2_SCL 0x01BE
5716 +#define CONTROL_PADCONF_I2C2_SDA 0x01C0
5717 +#define CONTROL_PADCONF_I2C3_SCL 0x01C2
5718 +#define CONTROL_PADCONF_I2C3_SDA 0x01C4
5719 +#define CONTROL_PADCONF_I2C4_SCL 0x0A00
5720 +#define CONTROL_PADCONF_I2C4_SDA 0x0A02
5721 +#define CONTROL_PADCONF_HDQ_SIO 0x01C6
5722 +#define CONTROL_PADCONF_McSPI1_CLK 0x01C8
5723 +#define CONTROL_PADCONF_McSPI1_SIMO 0x01CA
5724 +#define CONTROL_PADCONF_McSPI1_SOMI 0x01CC
5725 +#define CONTROL_PADCONF_McSPI1_CS0 0x01CE
5726 +#define CONTROL_PADCONF_McSPI1_CS1 0x01D0
5727 +#define CONTROL_PADCONF_McSPI1_CS2 0x01D2
5728 +#define CONTROL_PADCONF_McSPI1_CS3 0x01D4
5729 +#define CONTROL_PADCONF_McSPI2_CLK 0x01D6
5730 +#define CONTROL_PADCONF_McSPI2_SIMO 0x01D8
5731 +#define CONTROL_PADCONF_McSPI2_SOMI 0x01DA
5732 +#define CONTROL_PADCONF_McSPI2_CS0 0x01DC
5733 +#define CONTROL_PADCONF_McSPI2_CS1 0x01DE
5734 +/*Control and debug */
5735 +#define CONTROL_PADCONF_SYS_32K 0x0A04
5736 +#define CONTROL_PADCONF_SYS_CLKREQ 0x0A06
5737 +#define CONTROL_PADCONF_SYS_nIRQ 0x01E0
5738 +#define CONTROL_PADCONF_SYS_BOOT0 0x0A0A
5739 +#define CONTROL_PADCONF_SYS_BOOT1 0x0A0C
5740 +#define CONTROL_PADCONF_SYS_BOOT2 0x0A0E
5741 +#define CONTROL_PADCONF_SYS_BOOT3 0x0A10
5742 +#define CONTROL_PADCONF_SYS_BOOT4 0x0A12
5743 +#define CONTROL_PADCONF_SYS_BOOT5 0x0A14
5744 +#define CONTROL_PADCONF_SYS_BOOT6 0x0A16
5745 +#define CONTROL_PADCONF_SYS_OFF_MODE 0x0A18
5746 +#define CONTROL_PADCONF_SYS_CLKOUT1 0x0A1A
5747 +#define CONTROL_PADCONF_SYS_CLKOUT2 0x01E2
5748 +#define CONTROL_PADCONF_JTAG_nTRST 0x0A1C
5749 +#define CONTROL_PADCONF_JTAG_TCK 0x0A1E
5750 +#define CONTROL_PADCONF_JTAG_TMS 0x0A20
5751 +#define CONTROL_PADCONF_JTAG_TDI 0x0A22
5752 +#define CONTROL_PADCONF_JTAG_EMU0 0x0A24
5753 +#define CONTROL_PADCONF_JTAG_EMU1 0x0A26
5754 +#define CONTROL_PADCONF_ETK_CLK 0x0A28
5755 +#define CONTROL_PADCONF_ETK_CTL 0x0A2A
5756 +#define CONTROL_PADCONF_ETK_D0 0x0A2C
5757 +#define CONTROL_PADCONF_ETK_D1 0x0A2E
5758 +#define CONTROL_PADCONF_ETK_D2 0x0A30
5759 +#define CONTROL_PADCONF_ETK_D3 0x0A32
5760 +#define CONTROL_PADCONF_ETK_D4 0x0A34
5761 +#define CONTROL_PADCONF_ETK_D5 0x0A36
5762 +#define CONTROL_PADCONF_ETK_D6 0x0A38
5763 +#define CONTROL_PADCONF_ETK_D7 0x0A3A
5764 +#define CONTROL_PADCONF_ETK_D8 0x0A3C
5765 +#define CONTROL_PADCONF_ETK_D9 0x0A3E
5766 +#define CONTROL_PADCONF_ETK_D10 0x0A40
5767 +#define CONTROL_PADCONF_ETK_D11 0x0A42
5768 +#define CONTROL_PADCONF_ETK_D12 0x0A44
5769 +#define CONTROL_PADCONF_ETK_D13 0x0A46
5770 +#define CONTROL_PADCONF_ETK_D14 0x0A48
5771 +#define CONTROL_PADCONF_ETK_D15 0x0A4A
5772 +#define CONTROL_PADCONF_ETK_CLK_ES2 0x05D8
5773 +#define CONTROL_PADCONF_ETK_CTL_ES2 0x05DA
5774 +#define CONTROL_PADCONF_ETK_D0_ES2 0x05DC
5775 +#define CONTROL_PADCONF_ETK_D1_ES2 0x05DE
5776 +#define CONTROL_PADCONF_ETK_D2_ES2 0x05E0
5777 +#define CONTROL_PADCONF_ETK_D3_ES2 0x05E2
5778 +#define CONTROL_PADCONF_ETK_D4_ES2 0x05E4
5779 +#define CONTROL_PADCONF_ETK_D5_ES2 0x05E6
5780 +#define CONTROL_PADCONF_ETK_D6_ES2 0x05E8
5781 +#define CONTROL_PADCONF_ETK_D7_ES2 0x05EA
5782 +#define CONTROL_PADCONF_ETK_D8_ES2 0x05EC
5783 +#define CONTROL_PADCONF_ETK_D9_ES2 0x05EE
5784 +#define CONTROL_PADCONF_ETK_D10_ES2 0x05F0
5785 +#define CONTROL_PADCONF_ETK_D11_ES2 0x05F2
5786 +#define CONTROL_PADCONF_ETK_D12_ES2 0x05F4
5787 +#define CONTROL_PADCONF_ETK_D13_ES2 0x05F6
5788 +#define CONTROL_PADCONF_ETK_D14_ES2 0x05F8
5789 +#define CONTROL_PADCONF_ETK_D15_ES2 0x05FA
5791 +#define CONTROL_PADCONF_d2d_mcad0 0x01E4
5792 +#define CONTROL_PADCONF_d2d_mcad1 0x01E6
5793 +#define CONTROL_PADCONF_d2d_mcad2 0x01E8
5794 +#define CONTROL_PADCONF_d2d_mcad3 0x01EA
5795 +#define CONTROL_PADCONF_d2d_mcad4 0x01EC
5796 +#define CONTROL_PADCONF_d2d_mcad5 0x01EE
5797 +#define CONTROL_PADCONF_d2d_mcad6 0x01F0
5798 +#define CONTROL_PADCONF_d2d_mcad7 0x01F2
5799 +#define CONTROL_PADCONF_d2d_mcad8 0x01F4
5800 +#define CONTROL_PADCONF_d2d_mcad9 0x01F6
5801 +#define CONTROL_PADCONF_d2d_mcad10 0x01F8
5802 +#define CONTROL_PADCONF_d2d_mcad11 0x01FA
5803 +#define CONTROL_PADCONF_d2d_mcad12 0x01FC
5804 +#define CONTROL_PADCONF_d2d_mcad13 0x01FE
5805 +#define CONTROL_PADCONF_d2d_mcad14 0x0200
5806 +#define CONTROL_PADCONF_d2d_mcad15 0x0202
5807 +#define CONTROL_PADCONF_d2d_mcad16 0x0204
5808 +#define CONTROL_PADCONF_d2d_mcad17 0x0206
5809 +#define CONTROL_PADCONF_d2d_mcad18 0x0208
5810 +#define CONTROL_PADCONF_d2d_mcad19 0x020A
5811 +#define CONTROL_PADCONF_d2d_mcad20 0x020C
5812 +#define CONTROL_PADCONF_d2d_mcad21 0x020E
5813 +#define CONTROL_PADCONF_d2d_mcad22 0x0210
5814 +#define CONTROL_PADCONF_d2d_mcad23 0x0212
5815 +#define CONTROL_PADCONF_d2d_mcad24 0x0214
5816 +#define CONTROL_PADCONF_d2d_mcad25 0x0216
5817 +#define CONTROL_PADCONF_d2d_mcad26 0x0218
5818 +#define CONTROL_PADCONF_d2d_mcad27 0x021A
5819 +#define CONTROL_PADCONF_d2d_mcad28 0x021C
5820 +#define CONTROL_PADCONF_d2d_mcad29 0x021E
5821 +#define CONTROL_PADCONF_d2d_mcad30 0x0220
5822 +#define CONTROL_PADCONF_d2d_mcad31 0x0222
5823 +#define CONTROL_PADCONF_d2d_mcad32 0x0224
5824 +#define CONTROL_PADCONF_d2d_mcad33 0x0226
5825 +#define CONTROL_PADCONF_d2d_mcad34 0x0228
5826 +#define CONTROL_PADCONF_d2d_mcad35 0x022A
5827 +#define CONTROL_PADCONF_d2d_mcad36 0x022C
5828 +#define CONTROL_PADCONF_d2d_clk26mi 0x022E
5829 +#define CONTROL_PADCONF_d2d_nrespwron 0x0230
5830 +#define CONTROL_PADCONF_d2d_nreswarm 0x0232
5831 +#define CONTROL_PADCONF_d2d_arm9nirq 0x0234
5832 +#define CONTROL_PADCONF_d2d_uma2p6fiq 0x0236
5833 +#define CONTROL_PADCONF_d2d_spint 0x0238
5834 +#define CONTROL_PADCONF_d2d_frint 0x023A
5835 +#define CONTROL_PADCONF_d2d_dmareq0 0x023C
5836 +#define CONTROL_PADCONF_d2d_dmareq1 0x023E
5837 +#define CONTROL_PADCONF_d2d_dmareq2 0x0240
5838 +#define CONTROL_PADCONF_d2d_dmareq3 0x0242
5839 +#define CONTROL_PADCONF_d2d_n3gtrst 0x0244
5840 +#define CONTROL_PADCONF_d2d_n3gtdi 0x0246
5841 +#define CONTROL_PADCONF_d2d_n3gtdo 0x0248
5842 +#define CONTROL_PADCONF_d2d_n3gtms 0x024A
5843 +#define CONTROL_PADCONF_d2d_n3gtck 0x024C
5844 +#define CONTROL_PADCONF_d2d_n3grtck 0x024E
5845 +#define CONTROL_PADCONF_d2d_mstdby 0x0250
5846 +#define CONTROL_PADCONF_d2d_swakeup 0x0A4C
5847 +#define CONTROL_PADCONF_d2d_idlereq 0x0252
5848 +#define CONTROL_PADCONF_d2d_idleack 0x0254
5849 +#define CONTROL_PADCONF_d2d_mwrite 0x0256
5850 +#define CONTROL_PADCONF_d2d_swrite 0x0258
5851 +#define CONTROL_PADCONF_d2d_mread 0x025A
5852 +#define CONTROL_PADCONF_d2d_sread 0x025C
5853 +#define CONTROL_PADCONF_d2d_mbusflag 0x025E
5854 +#define CONTROL_PADCONF_d2d_sbusflag 0x0260
5855 +#define CONTROL_PADCONF_sdrc_cke0 0x0262
5856 +#define CONTROL_PADCONF_sdrc_cke1 0x0264
5858 +#define MUX_VAL(OFFSET,VALUE)\
5859 + __raw_writew((VALUE), OMAP34XX_CTRL_BASE + (OFFSET));
5861 +#define CP(x) (CONTROL_PADCONF_##x)
5864 + * IEN - Input Enable
5865 + * IDIS - Input Disable
5866 + * PTD - Pull type Down
5867 + * PTU - Pull type Up
5868 + * DIS - Pull type selection is inactive
5869 + * EN - Pull type selection is active
5871 + * The commented string gives the final mux configuration for that pin
5873 +#define MUX_DEFAULT_ES2() \
5875 + MUX_VAL(CP(SDRC_D0), (IEN | PTD | DIS | M0)) /*SDRC_D0*/\
5876 + MUX_VAL(CP(SDRC_D1), (IEN | PTD | DIS | M0)) /*SDRC_D1*/\
5877 + MUX_VAL(CP(SDRC_D2), (IEN | PTD | DIS | M0)) /*SDRC_D2*/\
5878 + MUX_VAL(CP(SDRC_D3), (IEN | PTD | DIS | M0)) /*SDRC_D3*/\
5879 + MUX_VAL(CP(SDRC_D4), (IEN | PTD | DIS | M0)) /*SDRC_D4*/\
5880 + MUX_VAL(CP(SDRC_D5), (IEN | PTD | DIS | M0)) /*SDRC_D5*/\
5881 + MUX_VAL(CP(SDRC_D6), (IEN | PTD | DIS | M0)) /*SDRC_D6*/\
5882 + MUX_VAL(CP(SDRC_D7), (IEN | PTD | DIS | M0)) /*SDRC_D7*/\
5883 + MUX_VAL(CP(SDRC_D8), (IEN | PTD | DIS | M0)) /*SDRC_D8*/\
5884 + MUX_VAL(CP(SDRC_D9), (IEN | PTD | DIS | M0)) /*SDRC_D9*/\
5885 + MUX_VAL(CP(SDRC_D10), (IEN | PTD | DIS | M0)) /*SDRC_D10*/\
5886 + MUX_VAL(CP(SDRC_D11), (IEN | PTD | DIS | M0)) /*SDRC_D11*/\
5887 + MUX_VAL(CP(SDRC_D12), (IEN | PTD | DIS | M0)) /*SDRC_D12*/\
5888 + MUX_VAL(CP(SDRC_D13), (IEN | PTD | DIS | M0)) /*SDRC_D13*/\
5889 + MUX_VAL(CP(SDRC_D14), (IEN | PTD | DIS | M0)) /*SDRC_D14*/\
5890 + MUX_VAL(CP(SDRC_D15), (IEN | PTD | DIS | M0)) /*SDRC_D15*/\
5891 + MUX_VAL(CP(SDRC_D16), (IEN | PTD | DIS | M0)) /*SDRC_D16*/\
5892 + MUX_VAL(CP(SDRC_D17), (IEN | PTD | DIS | M0)) /*SDRC_D17*/\
5893 + MUX_VAL(CP(SDRC_D18), (IEN | PTD | DIS | M0)) /*SDRC_D18*/\
5894 + MUX_VAL(CP(SDRC_D19), (IEN | PTD | DIS | M0)) /*SDRC_D19*/\
5895 + MUX_VAL(CP(SDRC_D20), (IEN | PTD | DIS | M0)) /*SDRC_D20*/\
5896 + MUX_VAL(CP(SDRC_D21), (IEN | PTD | DIS | M0)) /*SDRC_D21*/\
5897 + MUX_VAL(CP(SDRC_D22), (IEN | PTD | DIS | M0)) /*SDRC_D22*/\
5898 + MUX_VAL(CP(SDRC_D23), (IEN | PTD | DIS | M0)) /*SDRC_D23*/\
5899 + MUX_VAL(CP(SDRC_D24), (IEN | PTD | DIS | M0)) /*SDRC_D24*/\
5900 + MUX_VAL(CP(SDRC_D25), (IEN | PTD | DIS | M0)) /*SDRC_D25*/\
5901 + MUX_VAL(CP(SDRC_D26), (IEN | PTD | DIS | M0)) /*SDRC_D26*/\
5902 + MUX_VAL(CP(SDRC_D27), (IEN | PTD | DIS | M0)) /*SDRC_D27*/\
5903 + MUX_VAL(CP(SDRC_D28), (IEN | PTD | DIS | M0)) /*SDRC_D28*/\
5904 + MUX_VAL(CP(SDRC_D29), (IEN | PTD | DIS | M0)) /*SDRC_D29*/\
5905 + MUX_VAL(CP(SDRC_D30), (IEN | PTD | DIS | M0)) /*SDRC_D30*/\
5906 + MUX_VAL(CP(SDRC_D31), (IEN | PTD | DIS | M0)) /*SDRC_D31*/\
5907 + MUX_VAL(CP(SDRC_CLK), (IEN | PTD | DIS | M0)) /*SDRC_CLK*/\
5908 + MUX_VAL(CP(SDRC_DQS0), (IEN | PTD | DIS | M0)) /*SDRC_DQS0*/\
5909 + MUX_VAL(CP(SDRC_DQS1), (IEN | PTD | DIS | M0)) /*SDRC_DQS1*/\
5910 + MUX_VAL(CP(SDRC_DQS2), (IEN | PTD | DIS | M0)) /*SDRC_DQS2*/\
5911 + MUX_VAL(CP(SDRC_DQS3), (IEN | PTD | DIS | M0)) /*SDRC_DQS3*/\
5913 + MUX_VAL(CP(GPMC_A1), (IDIS | PTD | DIS | M0)) /*GPMC_A1*/\
5914 + MUX_VAL(CP(GPMC_A2), (IDIS | PTD | DIS | M0)) /*GPMC_A2*/\
5915 + MUX_VAL(CP(GPMC_A3), (IDIS | PTD | DIS | M0)) /*GPMC_A3*/\
5916 + MUX_VAL(CP(GPMC_A4), (IDIS | PTD | DIS | M0)) /*GPMC_A4*/\
5917 + MUX_VAL(CP(GPMC_A5), (IDIS | PTD | DIS | M0)) /*GPMC_A5*/\
5918 + MUX_VAL(CP(GPMC_A6), (IDIS | PTD | DIS | M0)) /*GPMC_A6*/\
5919 + MUX_VAL(CP(GPMC_A7), (IDIS | PTD | DIS | M0)) /*GPMC_A7*/\
5920 + MUX_VAL(CP(GPMC_A8), (IDIS | PTD | DIS | M0)) /*GPMC_A8*/\
5921 + MUX_VAL(CP(GPMC_A9), (IDIS | PTD | DIS | M0)) /*GPMC_A9*/\
5922 + MUX_VAL(CP(GPMC_A10), (IDIS | PTD | DIS | M0)) /*GPMC_A10*/\
5923 + MUX_VAL(CP(GPMC_D0), (IEN | PTD | DIS | M0)) /*GPMC_D0*/\
5924 + MUX_VAL(CP(GPMC_D1), (IEN | PTD | DIS | M0)) /*GPMC_D1*/\
5925 + MUX_VAL(CP(GPMC_D2), (IEN | PTD | DIS | M0)) /*GPMC_D2*/\
5926 + MUX_VAL(CP(GPMC_D3), (IEN | PTD | DIS | M0)) /*GPMC_D3*/\
5927 + MUX_VAL(CP(GPMC_D4), (IEN | PTD | DIS | M0)) /*GPMC_D4*/\
5928 + MUX_VAL(CP(GPMC_D5), (IEN | PTD | DIS | M0)) /*GPMC_D5*/\
5929 + MUX_VAL(CP(GPMC_D6), (IEN | PTD | DIS | M0)) /*GPMC_D6*/\
5930 + MUX_VAL(CP(GPMC_D7), (IEN | PTD | DIS | M0)) /*GPMC_D7*/\
5931 + MUX_VAL(CP(GPMC_D8), (IEN | PTD | DIS | M0)) /*GPMC_D8*/\
5932 + MUX_VAL(CP(GPMC_D9), (IEN | PTD | DIS | M0)) /*GPMC_D9*/\
5933 + MUX_VAL(CP(GPMC_D10), (IEN | PTD | DIS | M0)) /*GPMC_D10*/\
5934 + MUX_VAL(CP(GPMC_D11), (IEN | PTD | DIS | M0)) /*GPMC_D11*/\
5935 + MUX_VAL(CP(GPMC_D12), (IEN | PTD | DIS | M0)) /*GPMC_D12*/\
5936 + MUX_VAL(CP(GPMC_D13), (IEN | PTD | DIS | M0)) /*GPMC_D13*/\
5937 + MUX_VAL(CP(GPMC_D14), (IEN | PTD | DIS | M0)) /*GPMC_D14*/\
5938 + MUX_VAL(CP(GPMC_D15), (IEN | PTD | DIS | M0)) /*GPMC_D15*/\
5939 + MUX_VAL(CP(GPMC_nCS0), (IDIS | PTU | EN | M0)) /*GPMC_nCS0*/\
5940 + MUX_VAL(CP(GPMC_nCS1), (IDIS | PTU | EN | M0)) /*GPMC_nCS1*/\
5941 + MUX_VAL(CP(GPMC_nCS2), (IDIS | PTU | EN | M0)) /*GPMC_nCS2*/\
5942 + MUX_VAL(CP(GPMC_nCS3), (IDIS | PTU | EN | M0)) /*GPMC_nCS3*/\
5943 + /* For Beagle Rev 2 boards*/\
5944 + MUX_VAL(CP(GPMC_nCS4), (IDIS | PTU | EN | M0))\
5945 + MUX_VAL(CP(GPMC_nCS5), (IDIS | PTD | DIS | M0))\
5946 + MUX_VAL(CP(GPMC_nCS6), (IEN | PTD | DIS | M1))\
5947 + MUX_VAL(CP(GPMC_nCS7), (IEN | PTU | EN | M1))\
5948 + MUX_VAL(CP(GPMC_nBE1), (IEN | PTD | DIS | M0))\
5949 + MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M0))\
5950 + MUX_VAL(CP(GPMC_WAIT3), (IEN | PTU | EN | M0))\
5952 + MUX_VAL(CP(GPMC_CLK), (IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\
5953 + MUX_VAL(CP(GPMC_nADV_ALE), (IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\
5954 + MUX_VAL(CP(GPMC_nOE), (IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\
5955 + MUX_VAL(CP(GPMC_nWE), (IDIS | PTD | DIS | M0)) /*GPMC_nWE*/\
5956 + MUX_VAL(CP(GPMC_nBE0_CLE), (IDIS | PTD | DIS | M0)) /*GPMC_nBE0_CLE*/\
5957 + MUX_VAL(CP(GPMC_nWP), (IEN | PTD | DIS | M0)) /*GPMC_nWP*/\
5958 + MUX_VAL(CP(GPMC_WAIT0), (IEN | PTU | EN | M0)) /*GPMC_WAIT0*/\
5959 + MUX_VAL(CP(GPMC_WAIT1), (IEN | PTU | EN | M0)) /*GPMC_WAIT1*/\
5961 + MUX_VAL(CP(DSS_PCLK), (IDIS | PTD | DIS | M0)) /*DSS_PCLK*/\
5962 + MUX_VAL(CP(DSS_HSYNC), (IDIS | PTD | DIS | M0)) /*DSS_HSYNC*/\
5963 + MUX_VAL(CP(DSS_VSYNC), (IDIS | PTD | DIS | M0)) /*DSS_VSYNC*/\
5964 + MUX_VAL(CP(DSS_ACBIAS), (IDIS | PTD | DIS | M0)) /*DSS_ACBIAS*/\
5965 + MUX_VAL(CP(DSS_DATA0), (IDIS | PTD | DIS | M0)) /*DSS_DATA0*/\
5966 + MUX_VAL(CP(DSS_DATA1), (IDIS | PTD | DIS | M0)) /*DSS_DATA1*/\
5967 + MUX_VAL(CP(DSS_DATA2), (IDIS | PTD | DIS | M0)) /*DSS_DATA2*/\
5968 + MUX_VAL(CP(DSS_DATA3), (IDIS | PTD | DIS | M0)) /*DSS_DATA3*/\
5969 + MUX_VAL(CP(DSS_DATA4), (IDIS | PTD | DIS | M0)) /*DSS_DATA4*/\
5970 + MUX_VAL(CP(DSS_DATA5), (IDIS | PTD | DIS | M0)) /*DSS_DATA5*/\
5971 + MUX_VAL(CP(DSS_DATA6), (IDIS | PTD | DIS | M0)) /*DSS_DATA6*/\
5972 + MUX_VAL(CP(DSS_DATA7), (IDIS | PTD | DIS | M0)) /*DSS_DATA7*/\
5973 + MUX_VAL(CP(DSS_DATA8), (IDIS | PTD | DIS | M0)) /*DSS_DATA8*/\
5974 + MUX_VAL(CP(DSS_DATA9), (IDIS | PTD | DIS | M0)) /*DSS_DATA9*/\
5975 + MUX_VAL(CP(DSS_DATA10), (IDIS | PTD | DIS | M0)) /*DSS_DATA10*/\
5976 + MUX_VAL(CP(DSS_DATA11), (IDIS | PTD | DIS | M0)) /*DSS_DATA11*/\
5977 + MUX_VAL(CP(DSS_DATA12), (IDIS | PTD | DIS | M0)) /*DSS_DATA12*/\
5978 + MUX_VAL(CP(DSS_DATA13), (IDIS | PTD | DIS | M0)) /*DSS_DATA13*/\
5979 + MUX_VAL(CP(DSS_DATA14), (IDIS | PTD | DIS | M0)) /*DSS_DATA14*/\
5980 + MUX_VAL(CP(DSS_DATA15), (IDIS | PTD | DIS | M0)) /*DSS_DATA15*/\
5981 + MUX_VAL(CP(DSS_DATA16), (IDIS | PTD | DIS | M0)) /*DSS_DATA16*/\
5982 + MUX_VAL(CP(DSS_DATA17), (IDIS | PTD | DIS | M0)) /*DSS_DATA17*/\
5983 + MUX_VAL(CP(DSS_DATA18), (IDIS | PTD | DIS | M0)) /*DSS_DATA18*/\
5984 + MUX_VAL(CP(DSS_DATA19), (IDIS | PTD | DIS | M0)) /*DSS_DATA19*/\
5985 + MUX_VAL(CP(DSS_DATA20), (IDIS | PTD | DIS | M0)) /*DSS_DATA20*/\
5986 + MUX_VAL(CP(DSS_DATA21), (IDIS | PTD | DIS | M0)) /*DSS_DATA21*/\
5987 + MUX_VAL(CP(DSS_DATA22), (IDIS | PTD | DIS | M0)) /*DSS_DATA22*/\
5988 + MUX_VAL(CP(DSS_DATA23), (IDIS | PTD | DIS | M0)) /*DSS_DATA23*/\
5990 + MUX_VAL(CP(CAM_HS), (IEN | PTU | EN | M0)) /*CAM_HS */\
5991 + MUX_VAL(CP(CAM_VS), (IEN | PTU | EN | M0)) /*CAM_VS */\
5992 + MUX_VAL(CP(CAM_XCLKA), (IDIS | PTD | DIS | M0)) /*CAM_XCLKA*/\
5993 + MUX_VAL(CP(CAM_PCLK), (IEN | PTU | EN | M0)) /*CAM_PCLK*/\
5994 + MUX_VAL(CP(CAM_FLD), (IDIS | PTD | DIS | M4)) /*GPIO_98*/\
5996 + MUX_VAL(CP(CAM_D0), (IEN | PTD | DIS | M0)) /*CAM_D0*/\
5997 + MUX_VAL(CP(CAM_D1), (IEN | PTD | DIS | M0)) /*CAM_D1*/\
5998 + MUX_VAL(CP(CAM_D2), (IEN | PTD | DIS | M0)) /*CAM_D2*/\
5999 + MUX_VAL(CP(CAM_D3), (IEN | PTD | DIS | M0)) /*CAM_D3*/\
6000 + MUX_VAL(CP(CAM_D4), (IEN | PTD | DIS | M0)) /*CAM_D4*/\
6001 + MUX_VAL(CP(CAM_D5), (IEN | PTD | DIS | M0)) /*CAM_D5*/\
6002 + MUX_VAL(CP(CAM_D6), (IEN | PTD | DIS | M0)) /*CAM_D6*/\
6003 + MUX_VAL(CP(CAM_D7), (IEN | PTD | DIS | M0)) /*CAM_D7*/\
6004 + MUX_VAL(CP(CAM_D8), (IEN | PTD | DIS | M0)) /*CAM_D8*/\
6005 + MUX_VAL(CP(CAM_D9), (IEN | PTD | DIS | M0)) /*CAM_D9*/\
6006 + MUX_VAL(CP(CAM_D10), (IEN | PTD | DIS | M0)) /*CAM_D10*/\
6007 + MUX_VAL(CP(CAM_D11), (IEN | PTD | DIS | M0)) /*CAM_D11*/\
6008 + MUX_VAL(CP(CAM_XCLKB), (IDIS | PTD | DIS | M0)) /*CAM_XCLKB*/\
6009 + MUX_VAL(CP(CAM_WEN), (IEN | PTD | DIS | M4)) /*GPIO_167*/\
6010 + MUX_VAL(CP(CAM_STROBE), (IDIS | PTD | DIS | M0)) /*CAM_STROBE*/\
6011 + MUX_VAL(CP(CSI2_DX0), (IEN | PTD | DIS | M0)) /*CSI2_DX0*/\
6012 + MUX_VAL(CP(CSI2_DY0), (IEN | PTD | DIS | M0)) /*CSI2_DY0*/\
6013 + MUX_VAL(CP(CSI2_DX1), (IEN | PTD | DIS | M0)) /*CSI2_DX1*/\
6014 + MUX_VAL(CP(CSI2_DY1), (IEN | PTD | DIS | M0)) /*CSI2_DY1*/\
6015 + /*Audio Interface */\
6016 + MUX_VAL(CP(McBSP2_FSX), (IEN | PTD | DIS | M0)) /*McBSP2_FSX*/\
6017 + MUX_VAL(CP(McBSP2_CLKX), (IEN | PTD | DIS | M0)) /*McBSP2_CLKX*/\
6018 + MUX_VAL(CP(McBSP2_DR), (IEN | PTD | DIS | M0)) /*McBSP2_DR*/\
6019 + MUX_VAL(CP(McBSP2_DX), (IDIS | PTD | DIS | M0)) /*McBSP2_DX*/\
6020 + /*Expansion card */\
6021 + MUX_VAL(CP(MMC1_CLK), (IDIS | PTU | EN | M0)) /*MMC1_CLK*/\
6022 + MUX_VAL(CP(MMC1_CMD), (IEN | PTU | EN | M0)) /*MMC1_CMD*/\
6023 + MUX_VAL(CP(MMC1_DAT0), (IEN | PTU | EN | M0)) /*MMC1_DAT0*/\
6024 + MUX_VAL(CP(MMC1_DAT1), (IEN | PTU | EN | M0)) /*MMC1_DAT1*/\
6025 + MUX_VAL(CP(MMC1_DAT2), (IEN | PTU | EN | M0)) /*MMC1_DAT2*/\
6026 + MUX_VAL(CP(MMC1_DAT3), (IEN | PTU | EN | M0)) /*MMC1_DAT3*/\
6027 + MUX_VAL(CP(MMC1_DAT4), (IEN | PTU | EN | M0)) /*MMC1_DAT4*/\
6028 + MUX_VAL(CP(MMC1_DAT5), (IEN | PTU | EN | M0)) /*MMC1_DAT5*/\
6029 + MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M0)) /*MMC1_DAT6*/\
6030 + MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M0)) /*MMC1_DAT7*/\
6031 + /*Wireless LAN */\
6032 + MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\
6033 + MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M4)) /*GPIO_131*/\
6034 + MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M4)) /*GPIO_132*/\
6035 + MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M4)) /*GPIO_133*/\
6036 + MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M4)) /*GPIO_134*/\
6037 + MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M4)) /*GPIO_135*/\
6038 + MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M4)) /*GPIO_136*/\
6039 + MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M4)) /*GPIO_137*/\
6040 + MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\
6041 + MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\
6043 + MUX_VAL(CP(McBSP3_DX), (IDIS | PTD | DIS | M4)) /*GPIO_140*/\
6044 + MUX_VAL(CP(McBSP3_DR), (IDIS | PTD | DIS | M4)) /*GPIO_142*/\
6045 + MUX_VAL(CP(McBSP3_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_141*/\
6046 + MUX_VAL(CP(McBSP3_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_143*/\
6047 + MUX_VAL(CP(UART2_CTS), (IEN | PTU | EN | M0)) /*UART2_CTS*/\
6048 + MUX_VAL(CP(UART2_RTS), (IDIS | PTD | DIS | M0)) /*UART2_RTS*/\
6049 + MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/\
6050 + MUX_VAL(CP(UART2_RX), (IEN | PTD | DIS | M0)) /*UART2_RX*/\
6051 + /*Modem Interface */\
6052 + MUX_VAL(CP(UART1_TX), (IDIS | PTD | DIS | M0)) /*UART1_TX*/\
6053 + MUX_VAL(CP(UART1_RTS), (IDIS | PTD | DIS | M4)) /*GPIO_149*/ \
6054 + MUX_VAL(CP(UART1_CTS), (IDIS | PTD | DIS | M4)) /*GPIO_150*/ \
6055 + MUX_VAL(CP(UART1_RX), (IEN | PTD | DIS | M0)) /*UART1_RX*/\
6056 + MUX_VAL(CP(McBSP4_CLKX), (IEN | PTD | DIS | M1)) /*SSI1_DAT_RX*/\
6057 + MUX_VAL(CP(McBSP4_DR), (IEN | PTD | DIS | M1)) /*SSI1_FLAG_RX*/\
6058 + MUX_VAL(CP(McBSP4_DX), (IEN | PTD | DIS | M1)) /*SSI1_RDY_RX*/\
6059 + MUX_VAL(CP(McBSP4_FSX), (IEN | PTD | DIS | M1)) /*SSI1_WAKE*/\
6060 + MUX_VAL(CP(McBSP1_CLKR), (IDIS | PTD | DIS | M4)) /*GPIO_156*/\
6061 + MUX_VAL(CP(McBSP1_FSR), (IDIS | PTU | EN | M4)) /*GPIO_157*/\
6063 + MUX_VAL(CP(McBSP1_DX), (IDIS | PTD | DIS | M4)) /*GPIO_158*/\
6064 + MUX_VAL(CP(McBSP1_DR), (IDIS | PTD | DIS | M4)) /*GPIO_159*/\
6065 + MUX_VAL(CP(McBSP_CLKS), (IEN | PTU | DIS | M0)) /*McBSP_CLKS*/\
6066 + MUX_VAL(CP(McBSP1_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_161*/\
6067 + MUX_VAL(CP(McBSP1_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_162*/\
6068 + /*Serial Interface*/\
6069 + MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M0)) /*UART3_CTS_*/\
6071 + MUX_VAL(CP(UART3_RTS_SD), (IDIS | PTD | DIS | M0)) /*UART3_RTS_SD */\
6072 + MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0)) /*UART3_RX_IRRX*/\
6073 + MUX_VAL(CP(UART3_TX_IRTX), (IDIS | PTD | DIS | M0)) /*UART3_TX_IRTX*/\
6074 + MUX_VAL(CP(HSUSB0_CLK), (IEN | PTD | DIS | M0)) /*HSUSB0_CLK*/\
6075 + MUX_VAL(CP(HSUSB0_STP), (IDIS | PTU | EN | M0)) /*HSUSB0_STP*/\
6076 + MUX_VAL(CP(HSUSB0_DIR), (IEN | PTD | DIS | M0)) /*HSUSB0_DIR*/\
6077 + MUX_VAL(CP(HSUSB0_NXT), (IEN | PTD | DIS | M0)) /*HSUSB0_NXT*/\
6078 + MUX_VAL(CP(HSUSB0_DATA0), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA0*/\
6079 + MUX_VAL(CP(HSUSB0_DATA1), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA1*/\
6080 + MUX_VAL(CP(HSUSB0_DATA2), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA2*/\
6081 + MUX_VAL(CP(HSUSB0_DATA3), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA3*/\
6082 + MUX_VAL(CP(HSUSB0_DATA4), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA4*/\
6083 + MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA5*/\
6084 + MUX_VAL(CP(HSUSB0_DATA6), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA6*/\
6085 + MUX_VAL(CP(HSUSB0_DATA7), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA7*/\
6086 + MUX_VAL(CP(I2C1_SCL), (IEN | PTU | EN | M0)) /*I2C1_SCL*/\
6087 + MUX_VAL(CP(I2C1_SDA), (IEN | PTU | EN | M0)) /*I2C1_SDA*/\
6088 + MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M0)) /*I2C2_SCL*/\
6089 + MUX_VAL(CP(I2C2_SDA), (IEN | PTU | EN | M0)) /*I2C2_SDA*/\
6090 + MUX_VAL(CP(I2C3_SCL), (IEN | PTU | EN | M0)) /*I2C3_SCL*/\
6091 + MUX_VAL(CP(I2C3_SDA), (IEN | PTU | EN | M0)) /*I2C3_SDA*/\
6092 + MUX_VAL(CP(I2C4_SCL), (IEN | PTU | EN | M0)) /*I2C4_SCL*/\
6093 + MUX_VAL(CP(I2C4_SDA), (IEN | PTU | EN | M0)) /*I2C4_SDA*/\
6094 + MUX_VAL(CP(HDQ_SIO), (IDIS | PTU | EN | M4)) /*HDQ_SIO*/\
6095 + MUX_VAL(CP(McSPI1_CLK), (IEN | PTD | DIS | M0)) /*McSPI1_CLK*/\
6096 + MUX_VAL(CP(McSPI1_SIMO), (IEN | PTD | DIS | M0)) /*McSPI1_SIMO */\
6097 + MUX_VAL(CP(McSPI1_SOMI), (IEN | PTD | DIS | M0)) /*McSPI1_SOMI */\
6098 + MUX_VAL(CP(McSPI1_CS0), (IEN | PTD | EN | M0)) /*McSPI1_CS0*/\
6099 + MUX_VAL(CP(McSPI1_CS1), (IDIS | PTD | EN | M0)) /*McSPI1_CS1*/\
6100 + MUX_VAL(CP(McSPI1_CS2), (IDIS | PTD | DIS | M4)) /*GPIO_176*/\
6102 + MUX_VAL(CP(McSPI1_CS3), (IEN | PTD | EN | M0)) /*McSPI1_CS3*/\
6103 + MUX_VAL(CP(McSPI2_CLK), (IEN | PTD | DIS | M0)) /*McSPI2_CLK*/\
6104 + MUX_VAL(CP(McSPI2_SIMO), (IEN | PTD | DIS | M0)) /*McSPI2_SIMO*/\
6105 + MUX_VAL(CP(McSPI2_SOMI), (IEN | PTD | DIS | M0)) /*McSPI2_SOMI*/\
6106 + MUX_VAL(CP(McSPI2_CS0), (IEN | PTD | EN | M0)) /*McSPI2_CS0*/\
6107 + MUX_VAL(CP(McSPI2_CS1), (IEN | PTD | EN | M0)) /*McSPI2_CS1*/\
6108 + /*Control and debug */\
6109 + MUX_VAL(CP(SYS_32K), (IEN | PTD | DIS | M0)) /*SYS_32K*/\
6110 + MUX_VAL(CP(SYS_CLKREQ), (IEN | PTD | DIS | M0)) /*SYS_CLKREQ*/\
6111 + MUX_VAL(CP(SYS_nIRQ), (IEN | PTU | EN | M0)) /*SYS_nIRQ*/\
6112 + MUX_VAL(CP(SYS_BOOT0), (IEN | PTD | DIS | M4)) /*GPIO_2*/\
6114 + MUX_VAL(CP(SYS_BOOT1), (IEN | PTD | DIS | M4)) /*GPIO_3 */\
6115 + MUX_VAL(CP(SYS_BOOT2), (IEN | PTD | DIS | M4)) /*GPIO_4*/\
6117 + MUX_VAL(CP(SYS_BOOT3), (IEN | PTD | DIS | M4)) /*GPIO_5*/\
6119 + MUX_VAL(CP(SYS_BOOT4), (IEN | PTD | DIS | M4)) /*GPIO_6*/\
6121 + MUX_VAL(CP(SYS_BOOT5), (IEN | PTD | DIS | M4)) /*GPIO_7*/\
6123 + MUX_VAL(CP(SYS_BOOT6), (IDIS | PTD | DIS | M4)) /*GPIO_8*/\
6125 + MUX_VAL(CP(SYS_OFF_MODE), (IEN | PTD | DIS | M0)) /*SYS_OFF_MODE*/\
6126 + MUX_VAL(CP(SYS_CLKOUT1), (IEN | PTD | DIS | M0)) /*SYS_CLKOUT1*/\
6127 + MUX_VAL(CP(SYS_CLKOUT2), (IEN | PTU | EN | M4)) /*GPIO_186*/\
6128 + MUX_VAL(CP(ETK_CLK_ES2), (IDIS | PTU | EN | M3)) /*HSUSB1_STP*/\
6129 + MUX_VAL(CP(ETK_CTL_ES2), (IDIS | PTD | DIS | M3)) /*HSUSB1_CLK*/\
6130 + MUX_VAL(CP(ETK_D0_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_DATA0*/\
6131 + MUX_VAL(CP(ETK_D1_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_DATA1*/\
6132 + MUX_VAL(CP(ETK_D2_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_DATA2*/\
6133 + MUX_VAL(CP(ETK_D3_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_DATA7*/\
6134 + MUX_VAL(CP(ETK_D4_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_DATA4*/\
6135 + MUX_VAL(CP(ETK_D5_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_DATA5*/\
6136 + MUX_VAL(CP(ETK_D6_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_DATA6*/\
6137 + MUX_VAL(CP(ETK_D7_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_DATA3*/\
6138 + MUX_VAL(CP(ETK_D8_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_DIR*/\
6139 + MUX_VAL(CP(ETK_D9_ES2), (IEN | PTD | DIS | M3)) /*HSUSB1_NXT*/\
6140 + MUX_VAL(CP(ETK_D10_ES2), (IDIS | PTU | EN | M4)) /*GPIO_24*/\
6141 + MUX_VAL(CP(ETK_D15), (IEN | PTU | EN | M4)) /*GPIO_29*/\
6142 + MUX_VAL(CP(d2d_mcad1), (IEN | PTD | EN | M0)) /*d2d_mcad1*/\
6143 + MUX_VAL(CP(d2d_mcad2), (IEN | PTD | EN | M0)) /*d2d_mcad2*/\
6144 + MUX_VAL(CP(d2d_mcad3), (IEN | PTD | EN | M0)) /*d2d_mcad3*/\
6145 + MUX_VAL(CP(d2d_mcad4), (IEN | PTD | EN | M0)) /*d2d_mcad4*/\
6146 + MUX_VAL(CP(d2d_mcad5), (IEN | PTD | EN | M0)) /*d2d_mcad5*/\
6147 + MUX_VAL(CP(d2d_mcad6), (IEN | PTD | EN | M0)) /*d2d_mcad6*/\
6148 + MUX_VAL(CP(d2d_mcad7), (IEN | PTD | EN | M0)) /*d2d_mcad7*/\
6149 + MUX_VAL(CP(d2d_mcad8), (IEN | PTD | EN | M0)) /*d2d_mcad8*/\
6150 + MUX_VAL(CP(d2d_mcad9), (IEN | PTD | EN | M0)) /*d2d_mcad9*/\
6151 + MUX_VAL(CP(d2d_mcad10), (IEN | PTD | EN | M0)) /*d2d_mcad10*/\
6152 + MUX_VAL(CP(d2d_mcad11), (IEN | PTD | EN | M0)) /*d2d_mcad11*/\
6153 + MUX_VAL(CP(d2d_mcad12), (IEN | PTD | EN | M0)) /*d2d_mcad12*/\
6154 + MUX_VAL(CP(d2d_mcad13), (IEN | PTD | EN | M0)) /*d2d_mcad13*/\
6155 + MUX_VAL(CP(d2d_mcad14), (IEN | PTD | EN | M0)) /*d2d_mcad14*/\
6156 + MUX_VAL(CP(d2d_mcad15), (IEN | PTD | EN | M0)) /*d2d_mcad15*/\
6157 + MUX_VAL(CP(d2d_mcad16), (IEN | PTD | EN | M0)) /*d2d_mcad16*/\
6158 + MUX_VAL(CP(d2d_mcad17), (IEN | PTD | EN | M0)) /*d2d_mcad17*/\
6159 + MUX_VAL(CP(d2d_mcad18), (IEN | PTD | EN | M0)) /*d2d_mcad18*/\
6160 + MUX_VAL(CP(d2d_mcad19), (IEN | PTD | EN | M0)) /*d2d_mcad19*/\
6161 + MUX_VAL(CP(d2d_mcad20), (IEN | PTD | EN | M0)) /*d2d_mcad20*/\
6162 + MUX_VAL(CP(d2d_mcad21), (IEN | PTD | EN | M0)) /*d2d_mcad21*/\
6163 + MUX_VAL(CP(d2d_mcad22), (IEN | PTD | EN | M0)) /*d2d_mcad22*/\
6164 + MUX_VAL(CP(d2d_mcad23), (IEN | PTD | EN | M0)) /*d2d_mcad23*/\
6165 + MUX_VAL(CP(d2d_mcad24), (IEN | PTD | EN | M0)) /*d2d_mcad24*/\
6166 + MUX_VAL(CP(d2d_mcad25), (IEN | PTD | EN | M0)) /*d2d_mcad25*/\
6167 + MUX_VAL(CP(d2d_mcad26), (IEN | PTD | EN | M0)) /*d2d_mcad26*/\
6168 + MUX_VAL(CP(d2d_mcad27), (IEN | PTD | EN | M0)) /*d2d_mcad27*/\
6169 + MUX_VAL(CP(d2d_mcad28), (IEN | PTD | EN | M0)) /*d2d_mcad28*/\
6170 + MUX_VAL(CP(d2d_mcad29), (IEN | PTD | EN | M0)) /*d2d_mcad29*/\
6171 + MUX_VAL(CP(d2d_mcad30), (IEN | PTD | EN | M0)) /*d2d_mcad30*/\
6172 + MUX_VAL(CP(d2d_mcad31), (IEN | PTD | EN | M0)) /*d2d_mcad31*/\
6173 + MUX_VAL(CP(d2d_mcad32), (IEN | PTD | EN | M0)) /*d2d_mcad32*/\
6174 + MUX_VAL(CP(d2d_mcad33), (IEN | PTD | EN | M0)) /*d2d_mcad33*/\
6175 + MUX_VAL(CP(d2d_mcad34), (IEN | PTD | EN | M0)) /*d2d_mcad34*/\
6176 + MUX_VAL(CP(d2d_mcad35), (IEN | PTD | EN | M0)) /*d2d_mcad35*/\
6177 + MUX_VAL(CP(d2d_mcad36), (IEN | PTD | EN | M0)) /*d2d_mcad36*/\
6178 + MUX_VAL(CP(d2d_clk26mi), (IEN | PTD | DIS | M0)) /*d2d_clk26mi*/\
6179 + MUX_VAL(CP(d2d_nrespwron), (IEN | PTD | EN | M0)) /*d2d_nrespwron*/\
6180 + MUX_VAL(CP(d2d_nreswarm), (IEN | PTU | EN | M0)) /*d2d_nreswarm */\
6181 + MUX_VAL(CP(d2d_arm9nirq), (IEN | PTD | DIS | M0)) /*d2d_arm9nirq */\
6182 + MUX_VAL(CP(d2d_uma2p6fiq), (IEN | PTD | DIS | M0)) /*d2d_uma2p6fiq*/\
6183 + MUX_VAL(CP(d2d_spint), (IEN | PTD | EN | M0)) /*d2d_spint*/\
6184 + MUX_VAL(CP(d2d_frint), (IEN | PTD | EN | M0)) /*d2d_frint*/\
6185 + MUX_VAL(CP(d2d_dmareq0), (IEN | PTD | DIS | M0)) /*d2d_dmareq0*/\
6186 + MUX_VAL(CP(d2d_dmareq1), (IEN | PTD | DIS | M0)) /*d2d_dmareq1*/\
6187 + MUX_VAL(CP(d2d_dmareq2), (IEN | PTD | DIS | M0)) /*d2d_dmareq2*/\
6188 + MUX_VAL(CP(d2d_dmareq3), (IEN | PTD | DIS | M0)) /*d2d_dmareq3*/\
6189 + MUX_VAL(CP(d2d_n3gtrst), (IEN | PTD | DIS | M0)) /*d2d_n3gtrst*/\
6190 + MUX_VAL(CP(d2d_n3gtdi), (IEN | PTD | DIS | M0)) /*d2d_n3gtdi*/\
6191 + MUX_VAL(CP(d2d_n3gtdo), (IEN | PTD | DIS | M0)) /*d2d_n3gtdo*/\
6192 + MUX_VAL(CP(d2d_n3gtms), (IEN | PTD | DIS | M0)) /*d2d_n3gtms*/\
6193 + MUX_VAL(CP(d2d_n3gtck), (IEN | PTD | DIS | M0)) /*d2d_n3gtck*/\
6194 + MUX_VAL(CP(d2d_n3grtck), (IEN | PTD | DIS | M0)) /*d2d_n3grtck*/\
6195 + MUX_VAL(CP(d2d_mstdby), (IEN | PTU | EN | M0)) /*d2d_mstdby*/\
6196 + MUX_VAL(CP(d2d_swakeup), (IEN | PTD | EN | M0)) /*d2d_swakeup*/\
6197 + MUX_VAL(CP(d2d_idlereq), (IEN | PTD | DIS | M0)) /*d2d_idlereq*/\
6198 + MUX_VAL(CP(d2d_idleack), (IEN | PTU | EN | M0)) /*d2d_idleack*/\
6199 + MUX_VAL(CP(d2d_mwrite), (IEN | PTD | DIS | M0)) /*d2d_mwrite*/\
6200 + MUX_VAL(CP(d2d_swrite), (IEN | PTD | DIS | M0)) /*d2d_swrite*/\
6201 + MUX_VAL(CP(d2d_mread), (IEN | PTD | DIS | M0)) /*d2d_mread*/\
6202 + MUX_VAL(CP(d2d_sread), (IEN | PTD | DIS | M0)) /*d2d_sread*/\
6203 + MUX_VAL(CP(d2d_mbusflag), (IEN | PTD | DIS | M0)) /*d2d_mbusflag*/\
6204 + MUX_VAL(CP(d2d_sbusflag), (IEN | PTD | DIS | M0)) /*d2d_sbusflag*/\
6205 + MUX_VAL(CP(sdrc_cke0), (IDIS | PTU | EN | M0)) /*sdrc_cke0*/\
6206 + MUX_VAL(CP(sdrc_cke1), (IDIS | PTD | DIS | M7)) /*sdrc_cke1*/\
6209 diff --git a/include/asm-arm/arch-omap3/omap3.h b/include/asm-arm/arch-omap3/omap3.h
6210 new file mode 100644
6211 index 0000000..095bb29
6213 +++ b/include/asm-arm/arch-omap3/omap3.h
6216 + * (C) Copyright 2006-2008
6217 + * Texas Instruments, <www.ti.com>
6218 + * Richard Woodruff <r-woodruff2@ti.com>
6219 + * Syed Mohammed Khasim <x0khasim@ti.com>
6221 + * See file CREDITS for list of people who contributed to this
6224 + * This program is free software; you can redistribute it and/or
6225 + * modify it under the terms of the GNU General Public License as
6226 + * published by the Free Software Foundation; either version 2 of
6227 + * the License, or (at your option) any later version.
6229 + * This program is distributed in the hope that it will be useful,
6230 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6231 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6232 + * GNU General Public License for more details.
6234 + * You should have received a copy of the GNU General Public License
6235 + * along with this program; if not, write to the Free Software
6236 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6237 + * MA 02111-1307 USA
6243 +/* Stuff on L3 Interconnect */
6244 +#define SMX_APE_BASE 0x68000000
6247 +#define OMAP34XX_GPMC_BASE (0x6E000000)
6250 +#define OMAP34XX_SMS_BASE 0x6C000000
6253 +#define OMAP34XX_SDRC_BASE 0x6D000000
6256 + * L4 Peripherals - L4 Wakeup and L4 Core now
6258 +#define OMAP34XX_CORE_L4_IO_BASE 0x48000000
6259 +#define OMAP34XX_WAKEUP_L4_IO_BASE 0x48300000
6260 +#define OMAP34XX_L4_PER 0x49000000
6261 +#define OMAP34XX_L4_IO_BASE OMAP34XX_CORE_L4_IO_BASE
6264 +#define OMAP34XX_CTRL_BASE (OMAP34XX_L4_IO_BASE+0x2000)
6267 +#define OMAP34XX_UART1 (OMAP34XX_L4_IO_BASE+0x6a000)
6268 +#define OMAP34XX_UART2 (OMAP34XX_L4_IO_BASE+0x6c000)
6269 +#define OMAP34XX_UART3 (OMAP34XX_L4_PER+0x20000)
6271 +/* General Purpose Timers */
6272 +#define OMAP34XX_GPT1 0x48318000
6273 +#define OMAP34XX_GPT2 0x49032000
6274 +#define OMAP34XX_GPT3 0x49034000
6275 +#define OMAP34XX_GPT4 0x49036000
6276 +#define OMAP34XX_GPT5 0x49038000
6277 +#define OMAP34XX_GPT6 0x4903A000
6278 +#define OMAP34XX_GPT7 0x4903C000
6279 +#define OMAP34XX_GPT8 0x4903E000
6280 +#define OMAP34XX_GPT9 0x49040000
6281 +#define OMAP34XX_GPT10 0x48086000
6282 +#define OMAP34XX_GPT11 0x48088000
6283 +#define OMAP34XX_GPT12 0x48304000
6285 +/* WatchDog Timers (1 secure, 3 GP) */
6286 +#define WD1_BASE (0x4830C000)
6287 +#define WD2_BASE (0x48314000)
6288 +#define WD3_BASE (0x49030000)
6291 +#define SYNC_32KTIMER_BASE (0x48320000)
6292 +#define S32K_CR (SYNC_32KTIMER_BASE+0x10)
6294 +/* omap3 GPIO registers */
6295 +#define OMAP34XX_GPIO1_BASE 0x48310000
6296 +#define OMAP34XX_GPIO2_BASE 0x49050000
6297 +#define OMAP34XX_GPIO3_BASE 0x49052000
6298 +#define OMAP34XX_GPIO4_BASE 0x49054000
6299 +#define OMAP34XX_GPIO5_BASE 0x49056000
6300 +#define OMAP34XX_GPIO6_BASE 0x49058000
6302 +/* base address for indirect vectors (internal boot mode) */
6303 +#define SRAM_OFFSET0 0x40000000
6304 +#define SRAM_OFFSET1 0x00200000
6305 +#define SRAM_OFFSET2 0x0000F800
6306 +#define SRAM_VECT_CODE (SRAM_OFFSET0|SRAM_OFFSET1|\
6309 +#define LOW_LEVEL_SRAM_STACK 0x4020FFFC
6311 +#define DEBUG_LED1 149 /* gpio */
6312 +#define DEBUG_LED2 150 /* gpio */
6314 +#define XDR_POP 5 /* package on package part */
6315 +#define SDR_DISCRETE 4 /* 128M memory SDR module */
6316 +#define DDR_STACKED 3 /* stacked part on 2422 */
6317 +#define DDR_COMBO 2 /* combo part on cpu daughter card */
6318 +#define DDR_DISCRETE 1 /* 2x16 parts on daughter card */
6320 +#define DDR_100 100 /* type found on most mem d-boards */
6321 +#define DDR_111 111 /* some combo parts */
6322 +#define DDR_133 133 /* most combo, some mem d-boards */
6323 +#define DDR_165 165 /* future parts */
6325 +#define CPU_3430 0x3430
6327 +/* 343x real hardware:
6331 +/* 343x code defines:
6335 +#define CPU_3430_ES1 1
6336 +#define CPU_3430_ES2 2
6338 +#define WIDTH_8BIT 0x0000
6339 +#define WIDTH_16BIT 0x1000 /* bit pos for 16 bit in gpmc */
6341 +/* SDP definitions according to FPGA Rev. Is this OK?? */
6342 +#define SDP_3430_V1 0x1
6343 +#define SDP_3430_V2 0x2
6346 diff --git a/include/asm-arm/arch-omap3/sys_proto.h b/include/asm-arm/arch-omap3/sys_proto.h
6347 new file mode 100644
6348 index 0000000..271b554
6350 +++ b/include/asm-arm/arch-omap3/sys_proto.h
6353 + * (C) Copyright 2004-2008
6354 + * Texas Instruments, <www.ti.com>
6355 + * Richard Woodruff <r-woodruff2@ti.com>
6357 + * This program is free software; you can redistribute it and/or
6358 + * modify it under the terms of the GNU General Public License as
6359 + * published by the Free Software Foundation; either version 2 of
6360 + * the License, or (at your option) any later version.
6362 + * This program is distributed in the hope that it will be useful,
6363 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6364 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
6365 + * GNU General Public License for more details.
6367 + * You should have received a copy of the GNU General Public License
6368 + * along with this program; if not, write to the Free Software
6369 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6370 + * MA 02111-1307 USA
6372 +#ifndef _SYS_PROTO_H_
6373 +#define _SYS_PROTO_H_
6375 +void prcm_init(void);
6376 +void per_clocks_enable(void);
6378 +void memif_init(void);
6379 +void sdrc_init(void);
6380 +void do_sdrc_init(u32, u32);
6381 +void gpmc_init(void);
6383 +void watchdog_init(void);
6384 +void set_muxconf_regs(void);
6386 +u32 get_cpu_type(void);
6387 +u32 get_cpu_rev(void);
6388 +u32 get_mem_type(void);
6389 +u32 get_sysboot_value(void);
6390 +u32 get_gpmc0_base(void);
6391 +u32 is_gpmc_muxed(void);
6392 +u32 get_gpmc0_type(void);
6393 +u32 get_gpmc0_width(void);
6394 +u32 get_board_type(void);
6395 +void display_board_info(u32);
6396 +u32 get_sdr_cs_size(u32 offset);
6397 +u32 running_in_sdram(void);
6398 +u32 running_in_sram(void);
6399 +u32 running_in_flash(void);
6400 +u32 running_from_internal_boot(void);
6401 +u32 get_device_type(void);
6402 +void l2cache_enable(void);
6403 +void secureworld_exit(void);
6404 +void setup_auxcr(void);
6405 +void try_unlock_memory(void);
6406 +u32 get_boot_type(void);
6407 +void audio_init(void);
6408 +void dss_init(void);
6409 +void arm_cache_flush(void);
6410 +void v7_flush_dcache_all(u32);
6411 +void sr32(u32 addr, u32 start_bit, u32 num_bits, u32 value);
6412 +u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound);
6413 +void sdelay(unsigned long loops);
6416 diff --git a/include/configs/omap3530beagle.h b/include/configs/omap3530beagle.h
6417 new file mode 100644
6418 index 0000000..20efbf3
6420 +++ b/include/configs/omap3530beagle.h
6423 + * (C) Copyright 2006-2008
6424 + * Texas Instruments.
6425 + * Richard Woodruff <r-woodruff2@ti.com>
6426 + * Syed Mohammed Khasim <x0khasim@ti.com>
6428 + * Configuration settings for the TI OMAP3530 Beagle board.
6430 + * See file CREDITS for list of people who contributed to this
6433 + * This program is free software; you can redistribute it and/or
6434 + * modify it under the terms of the GNU General Public License as
6435 + * published by the Free Software Foundation; either version 2 of
6436 + * the License, or (at your option) any later version.
6438 + * This program is distributed in the hope that it will be useful,
6439 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6440 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6441 + * GNU General Public License for more details.
6443 + * You should have received a copy of the GNU General Public License
6444 + * along with this program; if not, write to the Free Software
6445 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6446 + * MA 02111-1307 USA
6451 +#include <asm/sizes.h>
6454 + * High Level Configuration Options
6456 +#define CONFIG_ARMCORTEXA8 1 /* This is an ARM V7 CPU core */
6457 +#define CONFIG_OMAP 1 /* in a TI OMAP core */
6458 +#define CONFIG_OMAP34XX 1 /* which is a 34XX */
6459 +#define CONFIG_OMAP3430 1 /* which is in a 3430 */
6460 +#define CONFIG_OMAP3_BEAGLE 1 /* working with BEAGLE */
6461 +#define CONFIG_DOS_PARTITION 1
6463 +#include <asm/arch/cpu.h> /* get chip and board defs */
6464 +#include <asm/arch/omap3.h>
6466 +/* Clock Defines */
6467 +#define V_OSCK 26000000 /* Clock output from T2 */
6468 +#define V_SCLK (V_OSCK >> 1)
6470 +#undef CONFIG_USE_IRQ /* no support for IRQs */
6471 +#define CONFIG_MISC_INIT_R
6473 +#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
6474 +#define CONFIG_SETUP_MEMORY_TAGS 1
6475 +#define CONFIG_INITRD_TAG 1
6476 +#define CONFIG_REVISION_TAG 1
6479 + * Size of malloc() pool
6481 +#define CFG_ENV_SIZE SZ_128K /* Total Size Environment Sector */
6482 +#define CFG_MALLOC_LEN (CFG_ENV_SIZE + SZ_128K)
6483 +#define CFG_GBL_DATA_SIZE 128 /* bytes reserved for initial data */
6486 + * Hardware drivers
6490 + * NS16550 Configuration
6492 +#define V_NS16550_CLK (48000000) /* 48MHz (APLL96/2) */
6494 +#define CFG_NS16550
6495 +#define CFG_NS16550_SERIAL
6496 +#define CFG_NS16550_REG_SIZE (-4)
6497 +#define CFG_NS16550_CLK V_NS16550_CLK
6500 + * select serial console configuration
6502 +#define CONFIG_CONS_INDEX 3
6503 +#define CFG_NS16550_COM3 OMAP34XX_UART3
6504 +#define CONFIG_SERIAL3 3 /* UART3 on Beagle Rev 2 */
6506 +/* allow to overwrite serial and ethaddr */
6507 +#define CONFIG_ENV_OVERWRITE
6508 +#define CONFIG_BAUDRATE 115200
6509 +#define CFG_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200}
6510 +#define CONFIG_MMC 1
6511 +#define CFG_MMC_BASE 0xF0000000
6512 +#define CONFIG_DOS_PARTITION 1
6514 +/* commands to include */
6516 +#define CONFIG_CMD_EXT2 /* EXT2 Support */
6517 +#define CONFIG_CMD_FAT /* FAT support */
6518 +#define CONFIG_CMD_JFFS2 /* JFFS2 Support */
6520 +#define CONFIG_CMD_I2C /* I2C serial bus support */
6521 +#define CONFIG_CMD_MMC /* MMC support */
6522 +#define CONFIG_CMD_NAND /* NAND support */
6524 +#define CONFIG_CMD_AUTOSCRIPT /* autoscript support */
6525 +#define CONFIG_CMD_BDI /* bdinfo */
6526 +#define CONFIG_CMD_BOOTD /* bootd */
6527 +#define CONFIG_CMD_CONSOLE /* coninfo */
6528 +#define CONFIG_CMD_ECHO /* echo arguments */
6529 +#define CONFIG_CMD_ENV /* saveenv */
6530 +#define CONFIG_CMD_ITEST /* Integer (and string) test */
6531 +#define CONFIG_CMD_LOADB /* loadb */
6532 +#define CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop mtest */
6533 +#define CONFIG_CMD_MISC /* misc functions like sleep etc*/
6534 +#define CONFIG_CMD_RUN /* run command in env variable */
6536 +#define CFG_NO_FLASH
6537 +#define CFG_I2C_SPEED 100
6538 +#define CFG_I2C_SLAVE 1
6539 +#define CFG_I2C_BUS 0
6540 +#define CFG_I2C_BUS_SELECT 1
6541 +#define CONFIG_DRIVER_OMAP34XX_I2C 1
6544 + * Board NAND Info.
6546 +#define CFG_NAND_ADDR NAND_BASE /* physical address to access nand */
6547 +#define CFG_NAND_BASE NAND_BASE /* physical address to access nand at CS0 */
6548 +#define CFG_NAND_WIDTH_16
6550 +#define CFG_MAX_NAND_DEVICE 1 /* Max number of NAND devices */
6551 +#define SECTORSIZE 512
6553 +#define NAND_ALLOW_ERASE_ALL
6554 +#define ADDR_COLUMN 1
6555 +#define ADDR_PAGE 2
6556 +#define ADDR_COLUMN_PAGE 3
6558 +#define NAND_ChipID_UNKNOWN 0x00
6559 +#define NAND_MAX_FLOORS 1
6560 +#define NAND_MAX_CHIPS 1
6561 +#define NAND_NO_RB 1
6562 +#define CFG_NAND_WP
6564 +#define CONFIG_JFFS2_NAND
6565 +/* nand device jffs2 lives on */
6566 +#define CONFIG_JFFS2_DEV "nand0"
6567 +/* start of jffs2 partition */
6568 +#define CONFIG_JFFS2_PART_OFFSET 0x680000
6569 +#define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 partition */
6571 +/* Environment information */
6572 +#define CONFIG_BOOTDELAY 10
6574 +#define CONFIG_BOOTCOMMAND "nand read 80200000 280000 400000 ; bootm 80200000"
6576 +#define CONFIG_BOOTARGS "setenv bootargs console=ttyS2,115200n8 noinitrd root=/dev/mtdblock4 rw rootfstype=jffs2"
6578 +#define CONFIG_NETMASK 255.255.254.0
6579 +#define CONFIG_IPADDR 128.247.77.90
6580 +#define CONFIG_SERVERIP 128.247.77.158
6581 +#define CONFIG_BOOTFILE "uImage"
6582 +#define CONFIG_AUTO_COMPLETE 1
6584 + * Miscellaneous configurable options
6586 +#define V_PROMPT "OMAP3 beagleboard.org # "
6588 +#define CFG_LONGHELP /* undef to save memory */
6589 +#define CFG_PROMPT V_PROMPT
6590 +#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
6591 +/* Print Buffer Size */
6592 +#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
6593 +#define CFG_MAXARGS 16 /* max number of command args */
6594 +#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
6596 +#define CFG_MEMTEST_START (OMAP34XX_SDRC_CS0) /* memtest works on */
6597 +#define CFG_MEMTEST_END (OMAP34XX_SDRC_CS0+0x01F00000) /* 31MB */
6599 +#undef CFG_CLKS_IN_HZ /* everything, incl board info, in Hz */
6601 +#define CFG_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load address */
6603 +/* 2430 has 12 GP timers, they can be driven by the SysClk (12/13/19.2) or by
6604 + * 32KHz clk, or from external sig. This rate is divided by a local divisor.
6608 +#define CFG_TIMERBASE OMAP34XX_GPT2
6609 +#define CFG_PVT V_PVT /* 2^(pvt+1) */
6610 +#define CFG_HZ ((V_SCLK)/(2 << CFG_PVT))
6612 +/*-----------------------------------------------------------------------
6615 + * The stack sizes are set up in start.S using the settings below
6617 +#define CONFIG_STACKSIZE SZ_128K /* regular stack */
6618 +#ifdef CONFIG_USE_IRQ
6619 +#define CONFIG_STACKSIZE_IRQ SZ_4K /* IRQ stack */
6620 +#define CONFIG_STACKSIZE_FIQ SZ_4K /* FIQ stack */
6623 +/*-----------------------------------------------------------------------
6624 + * Physical Memory Map
6626 +#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
6627 +#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
6628 +#define PHYS_SDRAM_1_SIZE SZ_32M /* at least 32 meg */
6629 +#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
6631 +/* SDRAM Bank Allocation method */
6632 +#define SDRC_R_B_C 1
6634 +/*-----------------------------------------------------------------------
6635 + * FLASH and environment organization
6638 +/* **** PISMO SUPPORT *** */
6640 +/* Configure the PISMO */
6641 +#define PISMO1_NOR_SIZE_SDPV2 GPMC_SIZE_128M
6642 +#define PISMO1_NOR_SIZE GPMC_SIZE_64M
6644 +#define PISMO1_NAND_SIZE GPMC_SIZE_128M
6645 +#define PISMO1_ONEN_SIZE GPMC_SIZE_128M
6646 +#define DBG_MPDB_SIZE GPMC_SIZE_16M
6647 +#define PISMO2_SIZE 0
6649 +#define CFG_MAX_FLASH_SECT (520) /* max number of sectors on one chip */
6650 +#define CFG_MAX_FLASH_BANKS 2 /* max number of flash banks */
6651 +#define CFG_MONITOR_LEN SZ_256K /* Reserve 2 sectors */
6653 +#define PHYS_FLASH_SIZE_SDPV2 SZ_128M
6654 +#define PHYS_FLASH_SIZE SZ_32M
6656 +#define CFG_FLASH_BASE boot_flash_base
6657 +#define PHYS_FLASH_SECT_SIZE boot_flash_sec
6658 +/* Dummy declaration of flash banks to get compilation right */
6659 +#define CFG_FLASH_BANKS_LIST {0, 0}
6661 +#define CFG_MONITOR_BASE CFG_FLASH_BASE /* Monitor at start of flash */
6662 +#define CFG_ONENAND_BASE ONENAND_MAP
6664 +#define CFG_ENV_IS_IN_NAND 1
6665 +#define ONENAND_ENV_OFFSET 0x260000 /* environment starts here */
6666 +#define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
6668 +#define CFG_ENV_SECT_SIZE boot_flash_sec
6669 +#define CFG_ENV_OFFSET boot_flash_off
6670 +#define CFG_ENV_ADDR SMNAND_ENV_OFFSET
6672 +/*-----------------------------------------------------------------------
6673 + * CFI FLASH driver setup
6675 +/* timeout values are in ticks */
6676 +#define CFG_FLASH_ERASE_TOUT (100*CFG_HZ) /* Timeout for Flash Erase */
6677 +#define CFG_FLASH_WRITE_TOUT (100*CFG_HZ) /* Timeout for Flash Write */
6679 +/* Flash banks JFFS2 should use */
6680 +#define CFG_MAX_MTD_BANKS (CFG_MAX_FLASH_BANKS+CFG_MAX_NAND_DEVICE)
6681 +#define CFG_JFFS2_MEM_NAND
6682 +#define CFG_JFFS2_FIRST_BANK CFG_MAX_FLASH_BANKS /* use flash_info[2] */
6683 +#define CFG_JFFS2_NUM_BANKS 1
6685 +#define ENV_IS_VARIABLE 1
6687 +#ifndef __ASSEMBLY__
6688 +extern unsigned int nand_cs_base;
6689 +extern unsigned int boot_flash_base;
6690 +extern volatile unsigned int boot_flash_env_addr;
6691 +extern unsigned int boot_flash_off;
6692 +extern unsigned int boot_flash_sec;
6693 +extern unsigned int boot_flash_type;
6697 +#define WRITE_NAND_COMMAND(d, adr)\
6698 + __raw_writew(d, (nand_cs_base + GPMC_NAND_CMD))
6699 +#define WRITE_NAND_ADDRESS(d, adr)\
6700 + __raw_writew(d, (nand_cs_base + GPMC_NAND_ADR))
6701 +#define WRITE_NAND(d, adr) __raw_writew(d, (nand_cs_base + GPMC_NAND_DAT))
6702 +#define READ_NAND(adr) __raw_readw((nand_cs_base + GPMC_NAND_DAT))
6704 +/* Other NAND Access APIs */
6705 +#define NAND_WP_OFF()\
6706 + do {*(volatile u32 *)(GPMC_CONFIG) |= 0x00000010; } while (0)
6707 +#define NAND_WP_ON()\
6708 + do {*(volatile u32 *)(GPMC_CONFIG) &= ~0x00000010; } while (0)
6709 +#define NAND_DISABLE_CE(nand)
6710 +#define NAND_ENABLE_CE(nand)
6711 +#define NAND_WAIT_READY(nand) udelay(10)
6713 +#endif /* __CONFIG_H */