2 * (C) Copyright 2004-2009
3 * Texas Instruments, <www.ti.com>
4 * Richard Woodruff <r-woodruff2@ti.com>
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #include <asm/arch/cpu.h>
26 #include <asm/arch/bits.h>
27 #include <asm/arch/mux.h>
28 #include <asm/arch/sys_proto.h>
29 #include <asm/arch/sys_info.h>
30 #include <asm/arch/clocks.h>
31 #include <asm/arch/mem.h>
33 #if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
34 #include <linux/mtd/nand_legacy.h>
37 /* EMIF and DMM registers */
38 #define EMIF1_BASE 0x4c000000
39 #define EMIF2_BASE 0x4d000000
40 #define DMM_BASE 0x4e000000
42 #define EMIF_MOD_ID_REV 0x0000
43 #define EMIF_STATUS 0x0004
44 #define EMIF_SDRAM_CONFIG 0x0008
45 #define EMIF_LPDDR2_NVM_CONFIG 0x000C
46 #define EMIF_SDRAM_REF_CTRL 0x0010
47 #define EMIF_SDRAM_REF_CTRL_SHDW 0x0014
48 #define EMIF_SDRAM_TIM_1 0x0018
49 #define EMIF_SDRAM_TIM_1_SHDW 0x001C
50 #define EMIF_SDRAM_TIM_2 0x0020
51 #define EMIF_SDRAM_TIM_2_SHDW 0x0024
52 #define EMIF_SDRAM_TIM_3 0x0028
53 #define EMIF_SDRAM_TIM_3_SHDW 0x002C
54 #define EMIF_LPDDR2_NVM_TIM 0x0030
55 #define EMIF_LPDDR2_NVM_TIM_SHDW 0x0034
56 #define EMIF_PWR_MGMT_CTRL 0x0038
57 #define EMIF_PWR_MGMT_CTRL_SHDW 0x003C
58 #define EMIF_LPDDR2_MODE_REG_DATA 0x0040
59 #define EMIF_LPDDR2_MODE_REG_CFG 0x0050
60 #define EMIF_L3_CONFIG 0x0054
61 #define EMIF_L3_CFG_VAL_1 0x0058
62 #define EMIF_L3_CFG_VAL_2 0x005C
63 #define IODFT_TLGC 0x0060
64 #define EMIF_PERF_CNT_1 0x0080
65 #define EMIF_PERF_CNT_2 0x0084
66 #define EMIF_PERF_CNT_CFG 0x0088
67 #define EMIF_PERF_CNT_SEL 0x008C
68 #define EMIF_PERF_CNT_TIM 0x0090
69 #define EMIF_READ_IDLE_CTRL 0x0098
70 #define EMIF_READ_IDLE_CTRL_SHDW 0x009c
71 #define EMIF_ZQ_CONFIG 0x00C8
72 #define EMIF_DDR_PHY_CTRL_1 0x00E4
73 #define EMIF_DDR_PHY_CTRL_1_SHDW 0x00E8
74 #define EMIF_DDR_PHY_CTRL_2 0x00EC
76 #define DMM_LISA_MAP_0 0x0040
77 #define DMM_LISA_MAP_1 0x0044
78 #define DMM_LISA_MAP_2 0x0048
79 #define DMM_LISA_MAP_3 0x004C
87 #define REF_EN 0x40000000
106 #define MR1_VALUE (MR1_NWR3 << 5) | (MR1_WC << 4) | (MR1_BT_SEQ << 3) \
109 /* defines for MR2 */
110 #define MR2_RL3_WL1 1
111 #define MR2_RL4_WL2 2
112 #define MR2_RL5_WL2 3
113 #define MR2_RL6_WL3 4
115 /* defines for MR10 */
116 #define MR10_ZQINIT 0xFF
117 #define MR10_ZQRESET 0xC3
118 #define MR10_ZQCL 0xAB
119 #define MR10_ZQCS 0x56
122 /* TODO: FREQ update method is not working so shadow registers programming
123 * is just for same of completeness. This would be safer if auto
124 * trasnitions are working
126 #define FREQ_UPDATE_EMIF
127 /* EMIF Needs to be configured@19.2 MHz and shadow registers
128 * should be programmed for new OPP.
131 #define SDRAM_CONFIG_INIT 0x80800EB1
132 #define DDR_PHY_CTRL_1_INIT 0x849FFFF5
133 #define READ_IDLE_CTRL 0x000501FF
134 #define PWR_MGMT_CTRL 0x4000000f
135 #define PWR_MGMT_CTRL_OPP100 0x4000000f
136 #define ZQ_CONFIG 0x500b3215
138 #define CS1_MR(mr) ((mr) | 0x80000000)
151 const struct ddr_regs ddr_regs_380_mhz = {
155 .phy_ctrl_1 = 0x849FF408,
156 .ref_ctrl = 0x000005ca,
157 .config_init = 0x80000eb1,
158 .config_final = 0x80001ab1,
159 .zq_config = 0x500b3215,
165 * Unused timings - but we may need them later
166 * Keep them commented
169 const struct ddr_regs ddr_regs_400_mhz = {
173 .phy_ctrl_1 = 0x849FF408,
174 .ref_ctrl = 0x00000618,
175 .config_init = 0x80000eb1,
176 .config_final = 0x80001ab1,
177 .zq_config = 0x500b3215,
182 const struct ddr_regs ddr_regs_200_mhz = {
186 .phy_ctrl_1 = 0x849FF405,
187 .ref_ctrl = 0x0000030c,
188 .config_init = 0x80000eb1,
189 .config_final = 0x80000eb1,
190 .zq_config = 0x500b3215,
196 const struct ddr_regs ddr_regs_200_mhz_2cs = {
200 .phy_ctrl_1 = 0x849FF405,
201 .ref_ctrl = 0x0000030c,
202 .config_init = 0x80000eb9,
203 .config_final = 0x80000eb9,
204 .zq_config = 0xD00b3215,
209 /*******************************************************
211 * Description: spinning delay to use before udelay works
212 ******************************************************/
213 static inline void delay(unsigned long loops)
215 __asm__ volatile ("1:\n" "subs %0, %1, #1\n"
216 "bne 1b" : "=r" (loops) : "0"(loops));
220 void big_delay(unsigned int count)
223 for (i=0; i<count; i++)
227 /* TODO: FREQ update method is not working so shadow registers programming
228 * is just for same of completeness. This would be safer if auto
229 * trasnitions are working
231 static int emif_config(unsigned int base)
233 unsigned int reg_value, rev;
234 const struct ddr_regs *ddr_regs;
235 rev = omap_revision();
237 if(rev == OMAP4430_ES1_0)
238 ddr_regs = &ddr_regs_380_mhz;
239 else if (rev == OMAP4430_ES2_0)
240 ddr_regs = &ddr_regs_200_mhz_2cs;
242 * set SDRAM CONFIG register
243 * EMIF_SDRAM_CONFIG[31:29] REG_SDRAM_TYPE = 4 for LPDDR2-S4
244 * EMIF_SDRAM_CONFIG[28:27] REG_IBANK_POS = 0
245 * EMIF_SDRAM_CONFIG[13:10] REG_CL = 3
246 * EMIF_SDRAM_CONFIG[6:4] REG_IBANK = 3 - 8 banks
247 * EMIF_SDRAM_CONFIG[3] REG_EBANK = 0 - CS0
248 * EMIF_SDRAM_CONFIG[2:0] REG_PAGESIZE = 2 - 512- 9 column
249 * JDEC specs - S4-2Gb --8 banks -- R0-R13, C0-c8
251 *(volatile int*)(base + EMIF_LPDDR2_NVM_CONFIG) &= 0xBFFFFFFF;
252 *(volatile int*)(base + EMIF_SDRAM_CONFIG) = ddr_regs->config_init;
254 /* PHY control values */
255 *(volatile int*)(base + EMIF_DDR_PHY_CTRL_1) = DDR_PHY_CTRL_1_INIT;
256 *(volatile int*)(base + EMIF_DDR_PHY_CTRL_1_SHDW)= ddr_regs->phy_ctrl_1;
259 * EMIF_READ_IDLE_CTRL
261 *(volatile int*)(base + EMIF_READ_IDLE_CTRL) = READ_IDLE_CTRL;
262 *(volatile int*)(base + EMIF_READ_IDLE_CTRL_SHDW) = READ_IDLE_CTRL;
267 *(volatile int*)(base + EMIF_SDRAM_TIM_1) = ddr_regs->tim1;
268 *(volatile int*)(base + EMIF_SDRAM_TIM_1_SHDW) = ddr_regs->tim1;
273 *(volatile int*)(base + EMIF_SDRAM_TIM_2) = ddr_regs->tim2;
274 *(volatile int*)(base + EMIF_SDRAM_TIM_2_SHDW) = ddr_regs->tim2;
279 *(volatile int*)(base + EMIF_SDRAM_TIM_3) = ddr_regs->tim3;
280 *(volatile int*)(base + EMIF_SDRAM_TIM_3_SHDW) = ddr_regs->tim3;
282 *(volatile int*)(base + EMIF_ZQ_CONFIG) = ddr_regs->zq_config;
286 //*(volatile int*)(base + EMIF_PWR_MGMT_CTRL) = PWR_MGMT_CTRL;
287 //*(volatile int*)(base + EMIF_PWR_MGMT_CTRL_SHDW) = PWR_MGMT_CTRL_OPP100;
289 * poll MR0 register (DAI bit)
290 * REG_CS[31] = 0 -- Mode register command to CS0
291 * REG_REFRESH_EN[30] = 1 -- Refresh enable after MRW
292 * REG_ADDRESS[7:0] = 00 -- Refresh enable after MRW
295 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = MR0_ADDR;
297 reg_value = *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA);
298 } while ((reg_value & 0x1) != 0);
300 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = CS1_MR(MR0_ADDR);
302 reg_value = *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA);
303 } while ((reg_value & 0x1) != 0);
306 /* set MR10 register */
307 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG)= MR10_ADDR;
308 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = MR10_ZQINIT;
309 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = CS1_MR(MR10_ADDR);
310 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = MR10_ZQINIT;
312 /* wait for tZQINIT=1us */
315 /* set MR1 register */
316 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG)= MR1_ADDR;
317 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = ddr_regs->mr1;
318 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = CS1_MR(MR1_ADDR);
319 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = ddr_regs->mr1;
322 /* set MR2 register RL=6 for OPP100 */
323 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG)= MR2_ADDR;
324 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = ddr_regs->mr2;
325 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = CS1_MR(MR2_ADDR);
326 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = ddr_regs->mr2;
328 /* Set SDRAM CONFIG register again here with final RL-WL value */
329 *(volatile int*)(base + EMIF_SDRAM_CONFIG) = ddr_regs->config_final;
330 *(volatile int*)(base + EMIF_DDR_PHY_CTRL_1) = ddr_regs->phy_ctrl_1;
333 * EMIF_SDRAM_REF_CTRL
334 * refresh rate = DDR_CLK / reg_refresh_rate
335 * 3.9 uS = (400MHz) / reg_refresh_rate
337 *(volatile int*)(base + EMIF_SDRAM_REF_CTRL) = ddr_regs->ref_ctrl;
338 *(volatile int*)(base + EMIF_SDRAM_REF_CTRL_SHDW) = ddr_regs->ref_ctrl;
340 /* set MR16 register */
341 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG)= MR16_ADDR | REF_EN;
342 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = 0;
343 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) =
344 CS1_MR(MR16_ADDR | REF_EN);
345 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = 0;
346 /* LPDDR2 init complete */
349 /*****************************************
351 * Description: Configure DDR
352 * EMIF1 -- CS0 -- DDR1 (256 MB)
353 * EMIF2 -- CS0 -- DDR2 (256 MB)
354 *****************************************/
355 static void ddr_init(void)
357 unsigned int base_addr, rev;
358 rev = omap_revision();
360 if (rev == OMAP4430_ES1_0)
362 /* Configurte the Control Module DDRIO device */
363 __raw_writel(0x1c1c1c1c, 0x4A100638);
364 __raw_writel(0x1c1c1c1c, 0x4A10063c);
365 __raw_writel(0x1c1c1c1c, 0x4A100640);
366 __raw_writel(0x1c1c1c1c, 0x4A100648);
367 __raw_writel(0x1c1c1c1c, 0x4A10064c);
368 __raw_writel(0x1c1c1c1c, 0x4A100650);
369 } else if (rev == OMAP4430_ES2_0) {
370 __raw_writel(0x9e9e9e9e, 0x4A100638);
371 __raw_writel(0x9e9e9e9e, 0x4A10063c);
372 __raw_writel(0x9e9e9e9e, 0x4A100640);
373 __raw_writel(0x9e9e9e9e, 0x4A100648);
374 __raw_writel(0x9e9e9e9e, 0x4A10064c);
375 __raw_writel(0x9e9e9e9e, 0x4A100650);
377 /* LPDDR2IO set to NMOS PTV */
378 __raw_writel(0x00ffc000, 0x4A100704);
385 /* Both EMIFs 128 byte interleaved*/
386 if (rev == OMAP4430_ES1_0)
387 *(volatile int*)(DMM_BASE + DMM_LISA_MAP_0) = 0x80540300;
388 else if (rev == OMAP4430_ES2_0)
389 *(volatile int*)(DMM_BASE + DMM_LISA_MAP_0) = 0x80640300;
391 /* EMIF2 only at 0x90000000 */
392 //*(volatile int*)(DMM_BASE + DMM_LISA_MAP_1) = 0x90400200;
394 *(volatile int*)(DMM_BASE + DMM_LISA_MAP_2) = 0x00000000;
395 *(volatile int*)(DMM_BASE + DMM_LISA_MAP_3) = 0xFF020100;
397 /* DDR needs to be initialised @ 19.2 MHz
398 * So put core DPLL in bypass mode
399 * Configure the Core DPLL but don't lock it
401 configure_core_dpll_no_lock();
403 /* No IDLE: BUG in SDC */
404 //sr32(CM_MEMIF_CLKSTCTRL, 0, 32, 0x2);
405 //while(((*(volatile int*)CM_MEMIF_CLKSTCTRL) & 0x700) != 0x700);
406 *(volatile int*)(EMIF1_BASE + EMIF_PWR_MGMT_CTRL) = 0x0;
407 *(volatile int*)(EMIF2_BASE + EMIF_PWR_MGMT_CTRL) = 0x0;
409 base_addr = EMIF1_BASE;
410 emif_config(base_addr);
412 /* Configure EMIF24D */
413 base_addr = EMIF2_BASE;
414 emif_config(base_addr);
415 /* Lock Core using shadow CM_SHADOW_FREQ_CONFIG1 */
416 lock_core_dpll_shadow();
417 /* TODO: SDC needs few hacks to get DDR freq update working */
419 /* Set DLL_OVERRIDE = 0 */
420 *(volatile int*)CM_DLL_CTRL = 0x0;
424 /* Check for DDR PHY ready for EMIF1 & EMIF2 */
425 while((((*(volatile int*)(EMIF1_BASE + EMIF_STATUS))&(0x04)) != 0x04) \
426 || (((*(volatile int*)(EMIF2_BASE + EMIF_STATUS))&(0x04)) != 0x04));
428 /* Reprogram the DDR PYHY Control register */
429 /* PHY control values */
431 sr32(CM_MEMIF_EMIF_1_CLKCTRL, 0, 32, 0x1);
432 sr32(CM_MEMIF_EMIF_2_CLKCTRL, 0, 32, 0x1);
434 /* Put the Core Subsystem PD to ON State */
436 /* No IDLE: BUG in SDC */
437 //sr32(CM_MEMIF_CLKSTCTRL, 0, 32, 0x2);
438 //while(((*(volatile int*)CM_MEMIF_CLKSTCTRL) & 0x700) != 0x700);
439 *(volatile int*)(EMIF1_BASE + EMIF_PWR_MGMT_CTRL) = 0x80000000;
440 *(volatile int*)(EMIF2_BASE + EMIF_PWR_MGMT_CTRL) = 0x80000000;
443 * In n a specific situation, the OCP interface between the DMM and
445 * 1. A TILER port is used to perform 2D burst writes of
446 * width 1 and height 8
447 * 2. ELLAn port is used to perform reads
448 * 3. All accesses are routed to the same EMIF controller
450 * Work around to avoid this issue REG_SYS_THRESH_MAX value should
451 * be kept higher than default 0x7. As per recommondation 0x0A will
452 * be used for better performance with REG_LL_THRESH_MAX = 0x00
454 *(volatile int*)(EMIF1_BASE + EMIF_L3_CONFIG) = 0x0A0000FF;
455 *(volatile int*)(EMIF2_BASE + EMIF_L3_CONFIG) = 0x0A0000FF;
458 * DMM : DMM_LISA_MAP_0(Section_0)
459 * [31:24] SYS_ADDR 0x80
460 * [22:20] SYS_SIZE 0x7 - 2Gb
461 * [19:18] SDRC_INTLDMM 0x1 - 128 byte
462 * [17:16] SDRC_ADDRSPC 0x0
464 * [7:0] SDRC_ADDR 0X0
466 reset_phy(EMIF1_BASE);
467 reset_phy(EMIF2_BASE);
469 *((volatile int *)0x80000000) = 0;
470 *((volatile int *)0x80000080) = 0;
471 //*((volatile int *)0x90000000) = 0;
473 /*****************************************
474 * Routine: board_init
475 * Description: Early hardware init.
476 *****************************************/
482 /*************************************************************
483 * Routine: get_mem_type(void) - returns the kind of memory connected
484 * to GPMC that we are trying to boot form. Uses SYS BOOT settings.
485 *************************************************************/
486 u32 get_mem_type(void)
488 /* no nand, so return GPMC_NONE */
492 /*****************************************
493 * Routine: secure_unlock
494 * Description: Setup security registers for access
496 *****************************************/
497 void secure_unlock_mem(void)
499 /* Permission values for registers -Full fledged permissions to all */
500 #define UNLOCK_1 0xFFFFFFFF
501 #define UNLOCK_2 0x00000000
502 #define UNLOCK_3 0x0000FFFF
504 /* Protection Module Register Target APE (PM_RT)*/
505 __raw_writel(UNLOCK_1, RT_REQ_INFO_PERMISSION_1);
506 __raw_writel(UNLOCK_1, RT_READ_PERMISSION_0);
507 __raw_writel(UNLOCK_1, RT_WRITE_PERMISSION_0);
508 __raw_writel(UNLOCK_2, RT_ADDR_MATCH_1);
510 __raw_writel(UNLOCK_3, GPMC_REQ_INFO_PERMISSION_0);
511 __raw_writel(UNLOCK_3, GPMC_READ_PERMISSION_0);
512 __raw_writel(UNLOCK_3, GPMC_WRITE_PERMISSION_0);
514 __raw_writel(UNLOCK_3, OCM_REQ_INFO_PERMISSION_0);
515 __raw_writel(UNLOCK_3, OCM_READ_PERMISSION_0);
516 __raw_writel(UNLOCK_3, OCM_WRITE_PERMISSION_0);
517 __raw_writel(UNLOCK_2, OCM_ADDR_MATCH_2);
520 __raw_writel(UNLOCK_3, IVA2_REQ_INFO_PERMISSION_0);
521 __raw_writel(UNLOCK_3, IVA2_READ_PERMISSION_0);
522 __raw_writel(UNLOCK_3, IVA2_WRITE_PERMISSION_0);
524 __raw_writel(UNLOCK_1, SMS_RG_ATT0); /* SDRC region 0 public */
527 /**********************************************************
528 * Routine: try_unlock_sram()
529 * Description: If chip is GP/EMU(special) type, unlock the SRAM for
531 ***********************************************************/
532 void try_unlock_memory(void)
536 /* if GP device unlock device SRAM for general use */
537 /* secure code breaks for Secure/Emulation device - HS/E/T*/
542 #if defined(CONFIG_MPU_600) || defined(CONFIG_MPU_1000)
543 static scale_vcores(void)
545 unsigned int rev = omap_revision();
546 /* For VC bypass only VCOREx_CGF_FORCE is necessary and
547 * VCOREx_CFG_VOLTAGE changes can be discarded
549 /* PRM_VC_CFG_I2C_MODE */
550 *(volatile int*)(0x4A307BA8) = 0x0;
551 /* PRM_VC_CFG_I2C_CLK */
552 *(volatile int*)(0x4A307BAC) = 0x6026;
554 /* set VCORE1 force VSEL */
555 /* PRM_VC_VAL_BYPASS) */
556 if(rev == OMAP4430_ES1_0)
557 *(volatile int*)(0x4A307BA0) = 0x3B5512;
559 *(volatile int*)(0x4A307BA0) = 0x3A5512;
560 *(volatile int*)(0x4A307BA0) |= 0x1000000;
561 while((*(volatile int*)(0x4A307BA0)) & 0x1000000);
563 /* PRM_IRQSTATUS_MPU */
564 *(volatile int*)(0x4A306010) = *(volatile int*)(0x4A306010);
567 /* FIXME: set VCORE2 force VSEL, Check the reset value */
568 /* PRM_VC_VAL_BYPASS) */
569 if(rev == OMAP4430_ES1_0)
570 *(volatile int*)(0x4A307BA0) = 0x315B12;
572 *(volatile int*)(0x4A307BA0) = 0x295B12;
573 *(volatile int*)(0x4A307BA0) |= 0x1000000;
574 while((*(volatile int*)(0x4A307BA0)) & 0x1000000);
576 /* PRM_IRQSTATUS_MPU */
577 *(volatile int*)(0x4A306010) = *(volatile int*)(0x4A306010);
579 /*/set VCORE3 force VSEL */
580 /* PRM_VC_VAL_BYPASS */
581 if(rev == OMAP4430_ES1_0)
582 *(volatile int*)(0x4A307BA0) = 0x316112;
583 else if(rev == OMAP4430_ES2_0)
584 *(volatile int*)(0x4A307BA0) = 0x296112;
585 else if (rev == OMAP4430_ES2_1)
586 *(volatile int*)(0x4A307BA0) = 0x2A6112;
587 *(volatile int*)(0x4A307BA0) |= 0x1000000;
588 while((*(volatile int*)(0x4A307BA0)) & 0x1000000);
590 /* PRM_IRQSTATUS_MPU */
591 *(volatile int*)(0x4A306010) = *(volatile int*)(0x4A306010);
596 /**********************************************************
598 * Description: Does early system init of muxing and clocks.
599 * - Called path is with SRAM stack.
600 **********************************************************/
604 unsigned int rev = omap_revision();
609 /* Writing to AuxCR in U-boot using SMI for GP/EMU DEV */
610 /* Currently SMI in Kernel on ES2 devices seems to have an isse
611 * Once that is resolved, we can postpone this config to kernel
613 //setup_auxcr(get_device_type(), external_boot);
617 /* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
618 #if defined(CONFIG_MPU_600) || defined(CONFIG_MPU_1000)
623 if(rev == OMAP4430_ES2_0) {
624 if (__raw_readl(0x4805D138) & (1<<22)) {
625 sr32(0x4A30a31C, 8, 1, 0x1); /* enable software ioreq */
626 sr32(0x4A30a31C, 1, 2, 0x0); /* set for sys_clk (38.4MHz) */
627 sr32(0x4A30a31C, 16, 4, 0x1); /* set divisor to 2 */
628 sr32(0x4A30a110, 0, 1, 0x1); /* set the clock source to active */
629 sr32(0x4A30a110, 2, 2, 0x3); /* enable clocks */
632 sr32(0x4A30a314, 8, 1, 0x1); /* enable software ioreq */
633 sr32(0x4A30a314, 1, 2, 0x2); /* set for PER_DPLL */
634 sr32(0x4A30a314, 16, 4, 0xf); /* set divisor to 16 */
635 sr32(0x4A30a110, 0, 1, 0x1); /* set the clock source to active */
636 sr32(0x4A30a110, 2, 2, 0x3); /* enable clocks */
642 /*******************************************************
643 * Routine: misc_init_r
644 * Description: Init ethernet (done here so udelay works)
645 ********************************************************/
646 int misc_init_r(void)
651 /******************************************************
652 * Routine: wait_for_command_complete
653 * Description: Wait for posting to finish on watchdog
654 ******************************************************/
655 void wait_for_command_complete(unsigned int wd_base)
659 pending = __raw_readl(wd_base + WWPS);
663 /*******************************************************************
665 * Description: take the Ethernet controller out of reset and wait
666 * for the EEPROM load to complete.
667 ******************************************************************/
669 /**********************************************
671 * Description: sets uboots idea of sdram size
672 **********************************************/
678 #define OMAP44XX_WKUP_CTRL_BASE 0x4A31E000
698 #define MV(OFFSET, VALUE)\
699 __raw_writew((VALUE), OMAP44XX_CTRL_BASE + (OFFSET));
700 #define MV1(OFFSET, VALUE)\
701 __raw_writew((VALUE), OMAP44XX_WKUP_CTRL_BASE + (OFFSET));
703 #define CP(x) (CONTROL_PADCONF_##x)
704 #define WK(x) (CONTROL_WKUP_##x)
707 * IDIS - Input Disable
708 * PTD - Pull type Down
710 * DIS - Pull type selection is inactive
711 * EN - Pull type selection is active
713 * The commented string gives the final mux configuration for that pin
716 #define MUX_DEFAULT_OMAP4() \
717 MV(CP(GPMC_AD0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat0 */ \
718 MV(CP(GPMC_AD1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat1 */ \
719 MV(CP(GPMC_AD2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat2 */ \
720 MV(CP(GPMC_AD3) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat3 */ \
721 MV(CP(GPMC_AD4) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat4 */ \
722 MV(CP(GPMC_AD5) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat5 */ \
723 MV(CP(GPMC_AD6) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat6 */ \
724 MV(CP(GPMC_AD7) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat7 */ \
725 MV(CP(GPMC_AD8) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpio_32 */ \
726 MV(CP(GPMC_AD9) , ( PTU | IEN | M3)) /* gpio_33 */ \
727 MV(CP(GPMC_AD10) , ( PTU | IEN | M3)) /* gpio_34 */ \
728 MV(CP(GPMC_AD11) , ( PTU | IEN | M3)) /* gpio_35 */ \
729 MV(CP(GPMC_AD12) , ( PTU | IEN | M3)) /* gpio_36 */ \
730 MV(CP(GPMC_AD13) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_37 */ \
731 MV(CP(GPMC_AD14) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_38 */ \
732 MV(CP(GPMC_AD15) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_39 */ \
733 MV(CP(GPMC_A16) , ( M3)) /* gpio_40 */ \
734 MV(CP(GPMC_A17) , ( PTD | M3)) /* gpio_41 */ \
735 MV(CP(GPMC_A18) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row6 */ \
736 MV(CP(GPMC_A19) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row7 */ \
737 MV(CP(GPMC_A20) , ( IEN | M3)) /* gpio_44 */ \
738 MV(CP(GPMC_A21) , ( M3)) /* gpio_45 */ \
739 MV(CP(GPMC_A22) , ( M3)) /* gpio_46 */ \
740 MV(CP(GPMC_A23) , ( OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col7 */ \
741 MV(CP(GPMC_A24) , ( PTD | M3)) /* gpio_48 */ \
742 MV(CP(GPMC_A25) , ( PTD | M3)) /* gpio_49 */ \
743 MV(CP(GPMC_NCS0) , ( M3)) /* gpio_50 */ \
744 MV(CP(GPMC_NCS1) , ( IEN | M3)) /* gpio_51 */ \
745 MV(CP(GPMC_NCS2) , ( IEN | M3)) /* gpio_52 */ \
746 MV(CP(GPMC_NCS3) , ( IEN | M3)) /* gpio_53 */ \
747 MV(CP(GPMC_NWP) , ( M3)) /* gpio_54 */ \
748 MV(CP(GPMC_CLK) , ( PTD | M3)) /* gpio_55 */ \
749 MV(CP(GPMC_NADV_ALE) , ( M3)) /* gpio_56 */ \
750 MV(CP(GPMC_NOE) , ( PTU | IEN | OFF_EN | OFF_OUT_PTD | M1)) /* sdmmc2_clk */ \
751 MV(CP(GPMC_NWE) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_cmd */ \
752 MV(CP(GPMC_NBE0_CLE) , ( M3)) /* gpio_59 */ \
753 MV(CP(GPMC_NBE1) , ( PTD | M3)) /* gpio_60 */ \
754 MV(CP(GPMC_WAIT0) , ( PTU | IEN | M3)) /* gpio_61 */ \
755 MV(CP(GPMC_WAIT1), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_62 */ \
756 MV(CP(C2C_DATA11) , ( PTD | M3)) /* gpio_100 */ \
757 MV(CP(C2C_DATA12) , ( PTD | IEN | M3)) /* gpio_101 */ \
758 MV(CP(C2C_DATA13) , ( PTD | M3)) /* gpio_102 */ \
759 MV(CP(C2C_DATA14) , ( M1)) /* dsi2_te0 */ \
760 MV(CP(C2C_DATA15) , ( PTD | M3)) /* gpio_104 */ \
761 MV(CP(HDMI_HPD) , ( M0)) /* hdmi_hpd */ \
762 MV(CP(HDMI_CEC) , ( M0)) /* hdmi_cec */ \
763 MV(CP(HDMI_DDC_SCL) , ( PTU | M0)) /* hdmi_ddc_scl */ \
764 MV(CP(HDMI_DDC_SDA) , ( PTU | IEN | M0)) /* hdmi_ddc_sda */ \
765 MV(CP(CSI21_DX0) , ( IEN | M0)) /* csi21_dx0 */ \
766 MV(CP(CSI21_DY0) , ( IEN | M0)) /* csi21_dy0 */ \
767 MV(CP(CSI21_DX1) , ( IEN | M0)) /* csi21_dx1 */ \
768 MV(CP(CSI21_DY1) , ( IEN | M0)) /* csi21_dy1 */ \
769 MV(CP(CSI21_DX2) , ( IEN | M0)) /* csi21_dx2 */ \
770 MV(CP(CSI21_DY2) , ( IEN | M0)) /* csi21_dy2 */ \
771 MV(CP(CSI21_DX3) , ( PTD | M7)) /* csi21_dx3 */ \
772 MV(CP(CSI21_DY3) , ( PTD | M7)) /* csi21_dy3 */ \
773 MV(CP(CSI21_DX4) , ( PTD | OFF_EN | OFF_PD | OFF_IN | M7)) /* csi21_dx4 */ \
774 MV(CP(CSI21_DY4) , ( PTD | OFF_EN | OFF_PD | OFF_IN | M7)) /* csi21_dy4 */ \
775 MV(CP(CSI22_DX0) , ( IEN | M0)) /* csi22_dx0 */ \
776 MV(CP(CSI22_DY0) , ( IEN | M0)) /* csi22_dy0 */ \
777 MV(CP(CSI22_DX1) , ( IEN | M0)) /* csi22_dx1 */ \
778 MV(CP(CSI22_DY1) , ( IEN | M0)) /* csi22_dy1 */ \
779 MV(CP(CAM_SHUTTER) , ( OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* cam_shutter */ \
780 MV(CP(CAM_STROBE) , ( OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* cam_strobe */ \
781 MV(CP(CAM_GLOBALRESET) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_83 */ \
782 MV(CP(USBB1_ULPITLL_CLK) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_clk */ \
783 MV(CP(USBB1_ULPITLL_STP) , ( OFF_EN | OFF_OUT_PTD | M4)) /* usbb1_ulpiphy_stp */ \
784 MV(CP(USBB1_ULPITLL_DIR) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dir */ \
785 MV(CP(USBB1_ULPITLL_NXT) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_nxt */ \
786 MV(CP(USBB1_ULPITLL_DAT0) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat0 */ \
787 MV(CP(USBB1_ULPITLL_DAT1) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat1 */ \
788 MV(CP(USBB1_ULPITLL_DAT2) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat2 */ \
789 MV(CP(USBB1_ULPITLL_DAT3) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat3 */ \
790 MV(CP(USBB1_ULPITLL_DAT4) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat4 */ \
791 MV(CP(USBB1_ULPITLL_DAT5) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat5 */ \
792 MV(CP(USBB1_ULPITLL_DAT6) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat6 */ \
793 MV(CP(USBB1_ULPITLL_DAT7) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat7 */ \
794 MV(CP(USBB1_HSIC_DATA) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usbb1_hsic_data */ \
795 MV(CP(USBB1_HSIC_STROBE) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usbb1_hsic_strobe */ \
796 MV(CP(USBC1_ICUSB_DP) , ( IEN | M0)) /* usbc1_icusb_dp */ \
797 MV(CP(USBC1_ICUSB_DM) , ( IEN | M0)) /* usbc1_icusb_dm */ \
798 MV(CP(SDMMC1_CLK) , ( PTU | OFF_EN | OFF_OUT_PTD | M0)) /* sdmmc1_clk */ \
799 MV(CP(SDMMC1_CMD) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_cmd */ \
800 MV(CP(SDMMC1_DAT0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat0 */ \
801 MV(CP(SDMMC1_DAT1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat1 */ \
802 MV(CP(SDMMC1_DAT2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat2 */ \
803 MV(CP(SDMMC1_DAT3) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat3 */ \
804 MV(CP(SDMMC1_DAT4) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat4 */ \
805 MV(CP(SDMMC1_DAT5) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat5 */ \
806 MV(CP(SDMMC1_DAT6) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat6 */ \
807 MV(CP(SDMMC1_DAT7) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat7 */ \
808 MV(CP(ABE_MCBSP2_CLKX) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp2_clkx */ \
809 MV(CP(ABE_MCBSP2_DR) , ( IEN | OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp2_dr */ \
810 MV(CP(ABE_MCBSP2_DX) , ( OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp2_dx */ \
811 MV(CP(ABE_MCBSP2_FSX) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp2_fsx */ \
812 MV(CP(ABE_MCBSP1_CLKX) , ( IEN | M1)) /* abe_slimbus1_clock */ \
813 MV(CP(ABE_MCBSP1_DR) , ( IEN | M1)) /* abe_slimbus1_data */ \
814 MV(CP(ABE_MCBSP1_DX) , ( OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp1_dx */ \
815 MV(CP(ABE_MCBSP1_FSX) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp1_fsx */ \
816 MV(CP(ABE_PDM_UL_DATA) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_pdm_ul_data */ \
817 MV(CP(ABE_PDM_DL_DATA) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_pdm_dl_data */ \
818 MV(CP(ABE_PDM_FRAME) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_pdm_frame */ \
819 MV(CP(ABE_PDM_LB_CLK) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_pdm_lb_clk */ \
820 MV(CP(ABE_CLKS) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_clks */ \
821 MV(CP(ABE_DMIC_CLK1) , ( M0)) /* abe_dmic_clk1 */ \
822 MV(CP(ABE_DMIC_DIN1) , ( IEN | M0)) /* abe_dmic_din1 */ \
823 MV(CP(ABE_DMIC_DIN2) , ( IEN | M0)) /* abe_dmic_din2 */ \
824 MV(CP(ABE_DMIC_DIN3) , ( IEN | M0)) /* abe_dmic_din3 */ \
825 MV(CP(UART2_CTS) , ( PTU | IEN | M0)) /* uart2_cts */ \
826 MV(CP(UART2_RTS) , ( M0)) /* uart2_rts */ \
827 MV(CP(UART2_RX) , ( PTU | IEN | M0)) /* uart2_rx */ \
828 MV(CP(UART2_TX) , ( M0)) /* uart2_tx */ \
829 MV(CP(HDQ_SIO) , ( M3)) /* gpio_127 */ \
830 MV(CP(I2C1_SCL) , ( PTU | IEN | M0)) /* i2c1_scl */ \
831 MV(CP(I2C1_SDA) , ( PTU | IEN | M0)) /* i2c1_sda */ \
832 MV(CP(I2C2_SCL) , ( PTU | IEN | M0)) /* i2c2_scl */ \
833 MV(CP(I2C2_SDA) , ( PTU | IEN | M0)) /* i2c2_sda */ \
834 MV(CP(I2C3_SCL) , ( PTU | IEN | M0)) /* i2c3_scl */ \
835 MV(CP(I2C3_SDA) , ( PTU | IEN | M0)) /* i2c3_sda */ \
836 MV(CP(I2C4_SCL) , ( PTU | IEN | M0)) /* i2c4_scl */ \
837 MV(CP(I2C4_SDA) , ( PTU | IEN | M0)) /* i2c4_sda */ \
838 MV(CP(MCSPI1_CLK) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_clk */ \
839 MV(CP(MCSPI1_SOMI) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_somi */ \
840 MV(CP(MCSPI1_SIMO) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_simo */ \
841 MV(CP(MCSPI1_CS0) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_cs0 */ \
842 MV(CP(MCSPI1_CS1) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* mcspi1_cs1 */ \
843 MV(CP(MCSPI1_CS2) , ( PTU | OFF_EN | OFF_OUT_PTU | M3)) /* gpio_139 */ \
844 MV(CP(MCSPI1_CS3) , ( PTU | IEN | M3)) /* gpio_140 */ \
845 MV(CP(UART3_CTS_RCTX) , ( PTU | IEN | M0)) /* uart3_tx */ \
846 MV(CP(UART3_RTS_SD) , ( M0)) /* uart3_rts_sd */ \
847 MV(CP(UART3_RX_IRRX) , ( IEN | M0)) /* uart3_rx */ \
848 MV(CP(UART3_TX_IRTX) , ( M0)) /* uart3_tx */ \
849 MV(CP(SDMMC5_CLK) , ( PTU | IEN | OFF_EN | OFF_OUT_PTD | M0)) /* sdmmc5_clk */ \
850 MV(CP(SDMMC5_CMD) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_cmd */ \
851 MV(CP(SDMMC5_DAT0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat0 */ \
852 MV(CP(SDMMC5_DAT1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat1 */ \
853 MV(CP(SDMMC5_DAT2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat2 */ \
854 MV(CP(SDMMC5_DAT3) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat3 */ \
855 MV(CP(MCSPI4_CLK) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_clk */ \
856 MV(CP(MCSPI4_SIMO) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_simo */ \
857 MV(CP(MCSPI4_SOMI) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_somi */ \
858 MV(CP(MCSPI4_CS0) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_cs0 */ \
859 MV(CP(UART4_RX) , ( IEN | M0)) /* uart4_rx */ \
860 MV(CP(UART4_TX) , ( M0)) /* uart4_tx */ \
861 MV(CP(USBB2_ULPITLL_CLK) , ( IEN | M3)) /* gpio_157 */ \
862 MV(CP(USBB2_ULPITLL_STP) , ( IEN | M5)) /* dispc2_data23 */ \
863 MV(CP(USBB2_ULPITLL_DIR) , ( IEN | M5)) /* dispc2_data22 */ \
864 MV(CP(USBB2_ULPITLL_NXT) , ( IEN | M5)) /* dispc2_data21 */ \
865 MV(CP(USBB2_ULPITLL_DAT0) , ( IEN | M5)) /* dispc2_data20 */ \
866 MV(CP(USBB2_ULPITLL_DAT1) , ( IEN | M5)) /* dispc2_data19 */ \
867 MV(CP(USBB2_ULPITLL_DAT2) , ( IEN | M5)) /* dispc2_data18 */ \
868 MV(CP(USBB2_ULPITLL_DAT3) , ( IEN | M5)) /* dispc2_data15 */ \
869 MV(CP(USBB2_ULPITLL_DAT4) , ( IEN | M5)) /* dispc2_data14 */ \
870 MV(CP(USBB2_ULPITLL_DAT5) , ( IEN | M5)) /* dispc2_data13 */ \
871 MV(CP(USBB2_ULPITLL_DAT6) , ( IEN | M5)) /* dispc2_data12 */ \
872 MV(CP(USBB2_ULPITLL_DAT7) , ( IEN | M5)) /* dispc2_data11 */ \
873 MV(CP(USBB2_HSIC_DATA) , ( PTD | OFF_EN | OFF_OUT_PTU | M3)) /* gpio_169 */ \
874 MV(CP(USBB2_HSIC_STROBE) , ( PTD | OFF_EN | OFF_OUT_PTU | M3)) /* gpio_170 */ \
875 MV(CP(UNIPRO_TX0) , ( PTD | IEN | M3)) /* gpio_171 */ \
876 MV(CP(UNIPRO_TY0) , ( OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col1 */ \
877 MV(CP(UNIPRO_TX1) , ( OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col2 */ \
878 MV(CP(UNIPRO_TY1) , ( OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col3 */ \
879 MV(CP(UNIPRO_TX2) , ( PTU | IEN | M3)) /* gpio_0 */ \
880 MV(CP(UNIPRO_TY2) , ( PTU | IEN | M3)) /* gpio_1 */ \
881 MV(CP(UNIPRO_RX0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row0 */ \
882 MV(CP(UNIPRO_RY0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row1 */ \
883 MV(CP(UNIPRO_RX1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row2 */ \
884 MV(CP(UNIPRO_RY1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row3 */ \
885 MV(CP(UNIPRO_RX2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row4 */ \
886 MV(CP(UNIPRO_RY2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row5 */ \
887 MV(CP(USBA0_OTG_CE) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* usba0_otg_ce */ \
888 MV(CP(USBA0_OTG_DP) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usba0_otg_dp */ \
889 MV(CP(USBA0_OTG_DM) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usba0_otg_dm */ \
890 MV(CP(FREF_CLK1_OUT) , ( M0)) /* fref_clk1_out */ \
891 MV(CP(FREF_CLK2_OUT) , ( PTD | IEN | M3)) /* gpio_182 */ \
892 MV(CP(SYS_NIRQ1) , ( PTU | IEN | M0)) /* sys_nirq1 */ \
893 MV(CP(SYS_NIRQ2) , ( PTU | IEN | M0)) /* sys_nirq2 */ \
894 MV(CP(SYS_BOOT0) , ( PTU | IEN | M3)) /* gpio_184 */ \
895 MV(CP(SYS_BOOT1) , ( M3)) /* gpio_185 */ \
896 MV(CP(SYS_BOOT2) , ( PTD | IEN | M3)) /* gpio_186 */ \
897 MV(CP(SYS_BOOT3) , ( M3)) /* gpio_187 */ \
898 MV(CP(SYS_BOOT4) , ( M3)) /* gpio_188 */ \
899 MV(CP(SYS_BOOT5) , ( PTD | IEN | M3)) /* gpio_189 */ \
900 MV(CP(DPM_EMU0) , ( IEN | M0)) /* dpm_emu0 */ \
901 MV(CP(DPM_EMU1) , ( IEN | M0)) /* dpm_emu1 */ \
902 MV(CP(DPM_EMU2) , ( IEN | M0)) /* dpm_emu2 */ \
903 MV(CP(DPM_EMU3) , ( IEN | M5)) /* dispc2_data10 */ \
904 MV(CP(DPM_EMU4) , ( IEN | M5)) /* dispc2_data9 */ \
905 MV(CP(DPM_EMU5) , ( IEN | M5)) /* dispc2_data16 */ \
906 MV(CP(DPM_EMU6) , ( IEN | M5)) /* dispc2_data17 */ \
907 MV(CP(DPM_EMU7) , ( IEN | M5)) /* dispc2_hsync */ \
908 MV(CP(DPM_EMU8) , ( IEN | M5)) /* dispc2_pclk */ \
909 MV(CP(DPM_EMU9) , ( IEN | M5)) /* dispc2_vsync */ \
910 MV(CP(DPM_EMU10) , ( IEN | M5)) /* dispc2_de */ \
911 MV(CP(DPM_EMU11) , ( IEN | M5)) /* dispc2_data8 */ \
912 MV(CP(DPM_EMU12) , ( IEN | M5)) /* dispc2_data7 */ \
913 MV(CP(DPM_EMU13) , ( IEN | M5)) /* dispc2_data6 */ \
914 MV(CP(DPM_EMU14) , ( IEN | M5)) /* dispc2_data5 */ \
915 MV(CP(DPM_EMU15) , ( IEN | M5)) /* dispc2_data4 */ \
916 MV(CP(DPM_EMU16) , ( M3)) /* gpio_27 */ \
917 MV(CP(DPM_EMU17) , ( IEN | M5)) /* dispc2_data2 */ \
918 MV(CP(DPM_EMU18) , ( IEN | M5)) /* dispc2_data1 */ \
919 MV(CP(DPM_EMU19) , ( IEN | M5)) /* dispc2_data0 */ \
920 MV1(WK(PAD0_SIM_IO) , ( IEN | M0)) /* sim_io */ \
921 MV1(WK(PAD1_SIM_CLK) , ( M0)) /* sim_clk */ \
922 MV1(WK(PAD0_SIM_RESET) , ( M0)) /* sim_reset */ \
923 MV1(WK(PAD1_SIM_CD) , ( PTU | IEN | M0)) /* sim_cd */ \
924 MV1(WK(PAD0_SIM_PWRCTRL) , ( M0)) /* sim_pwrctrl */ \
925 MV1(WK(PAD1_SR_SCL) , ( PTU | IEN | M0)) /* sr_scl */ \
926 MV1(WK(PAD0_SR_SDA) , ( PTU | IEN | M0)) /* sr_sda */ \
927 MV1(WK(PAD1_FREF_XTAL_IN) , ( M0)) /* # */ \
928 MV1(WK(PAD0_FREF_SLICER_IN) , ( M0)) /* fref_slicer_in */ \
929 MV1(WK(PAD1_FREF_CLK_IOREQ) , ( M0)) /* fref_clk_ioreq */ \
930 MV1(WK(PAD0_FREF_CLK0_OUT) , ( M2)) /* sys_drm_msecure */ \
931 MV1(WK(PAD1_FREF_CLK3_REQ) , ( PTU | IEN | M0)) /* # */ \
932 MV1(WK(PAD0_FREF_CLK3_OUT) , ( M0)) /* fref_clk3_out */ \
933 MV1(WK(PAD1_FREF_CLK4_REQ) , ( PTU | IEN | M0)) /* # */ \
934 MV1(WK(PAD0_FREF_CLK4_OUT) , ( M0)) /* # */ \
935 MV1(WK(PAD1_SYS_32K) , ( IEN | M0)) /* sys_32k */ \
936 MV1(WK(PAD0_SYS_NRESPWRON) , ( M0)) /* sys_nrespwron */ \
937 MV1(WK(PAD1_SYS_NRESWARM) , ( M0)) /* sys_nreswarm */ \
938 MV1(WK(PAD0_SYS_PWR_REQ) , ( PTU | M0)) /* sys_pwr_req */ \
939 MV1(WK(PAD1_SYS_PWRON_RESET) , ( M3)) /* gpio_wk29 */ \
940 MV1(WK(PAD0_SYS_BOOT6) , ( IEN | M3)) /* gpio_wk9 */ \
941 MV1(WK(PAD1_SYS_BOOT7) , ( IEN | M3)) /* gpio_wk10 */ \
942 MV1(WK(PAD1_FREF_CLK3_REQ), (M3)) /* gpio_wk30 */ \
943 MV1(WK(PAD1_FREF_CLK4_REQ), (M3)) /* gpio_wk7 */ \
944 MV1(WK(PAD0_FREF_CLK4_OUT), (M3)) /* gpio_wk8 */
946 #define MUX_DEFAULT_OMAP4_ALL() \
947 MV(CP(GPMC_AD0), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat0 */ \
948 MV(CP(GPMC_AD1), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat1 */ \
949 MV(CP(GPMC_AD2), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat2 */ \
950 MV(CP(GPMC_AD3), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat3 */ \
951 MV(CP(GPMC_AD4), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat4 */ \
952 MV(CP(GPMC_AD5), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat5 */ \
953 MV(CP(GPMC_AD6), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat6 */ \
954 MV(CP(GPMC_AD7), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat7 */ \
955 MV(CP(GPMC_AD8), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpio_32 */ \
956 MV(CP(GPMC_AD9), (M3_SAFE)) /* gpio_33 */ \
957 MV(CP(GPMC_AD10), (M3_SAFE)) /* gpio_34 */ \
958 MV(CP(GPMC_AD11), (M3_SAFE)) /* gpio_35 */ \
959 MV(CP(GPMC_AD12), (M3_SAFE)) /* gpio_36 */ \
960 MV(CP(GPMC_AD13), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_37 */ \
961 MV(CP(GPMC_AD14), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_38 */ \
962 MV(CP(GPMC_AD15), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_39 */ \
963 MV(CP(GPMC_A16), (M3_SAFE)) /* gpio_40 */ \
964 MV(CP(GPMC_A17), (M3_SAFE)) /* gpio_41 */ \
965 MV(CP(GPMC_A18), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row6 */ \
966 MV(CP(GPMC_A19), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row7 */ \
967 MV(CP(GPMC_A20), (M3_SAFE)) /* gpio_44 */ \
968 MV(CP(GPMC_A21), (M3_SAFE)) /* gpio_45 */ \
969 MV(CP(GPMC_A22), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col6 */ \
970 MV(CP(GPMC_A23), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col7 */ \
971 MV(CP(GPMC_A24), (M3_SAFE)) /* gpio_48 */ \
972 MV(CP(GPMC_A25), (M3_SAFE)) /* gpio_49 */ \
973 MV(CP(GPMC_NCS0), (M0)) /* gpmc_ncs0 */ \
974 MV(CP(GPMC_NCS1), (M3_SAFE)) /* gpio_51 */ \
975 MV(CP(GPMC_NCS2), (M3_SAFE)) /* gpio_52 */ \
976 MV(CP(GPMC_NCS3), (M3_SAFE)) /* gpio_53 */ \
977 MV(CP(GPMC_NWP), (M0_SAFE)) /* gpmc_nwp */ \
978 MV(CP(GPMC_CLK), (M3_SAFE)) /* gpio_55 */ \
979 MV(CP(GPMC_NADV_ALE), (M0)) /* gpmc_nadv_ale */ \
980 MV(CP(GPMC_NOE), (PTU | OFF_EN | OFF_OUT_PTD | M1)) /* sdmmc2_clk */ \
981 MV(CP(GPMC_NWE), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_cmd */ \
982 MV(CP(GPMC_NBE0_CLE), (M0)) /* gpmc_nbe0_cle*/ \
983 MV(CP(GPMC_NBE1), (M3_SAFE)) /* gpio_60 */ \
984 MV(CP(GPMC_WAIT0), (M0)) /* gpmc_wait */ \
985 MV(CP(GPMC_WAIT1), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_39 */ \
986 MV(CP(C2C_DATA11), (M3_SAFE)) /* gpio_100 */ \
987 MV(CP(C2C_DATA12), (M1_SAFE)) /* dsi1_te0 */ \
988 MV(CP(C2C_DATA13), (M3_SAFE)) /* gpio_102 */ \
989 MV(CP(C2C_DATA14), (M1_SAFE)) /* dsi2_te0 */ \
990 MV(CP(C2C_DATA15), (M3_SAFE)) /* gpio_104 */ \
991 MV(CP(HDMI_HPD), (M0_SAFE)) /* hdmi_hpd */ \
992 MV(CP(HDMI_CEC), (M0_SAFE)) /* hdmi_cec */ \
993 MV(CP(HDMI_DDC_SCL), (M0_SAFE)) /* hdmi_ddc_scl */ \
994 MV(CP(HDMI_DDC_SDA), (M0_SAFE)) /* hdmi_ddc_sda */ \
995 MV(CP(CSI21_DX0), (M0_SAFE)) /* csi21_dx0 */ \
996 MV(CP(CSI21_DY0), (M0_SAFE)) /* csi21_dy0 */ \
997 MV(CP(CSI21_DX1), (M0_SAFE)) /* csi21_dx1 */ \
998 MV(CP(CSI21_DY1), (M0_SAFE)) /* csi21_dy1 */ \
999 MV(CP(CSI21_DX2), (M0_SAFE)) /* csi21_dx2 */ \
1000 MV(CP(CSI21_DY2), (M0_SAFE)) /* csi21_dy2 */ \
1001 MV(CP(CSI21_DX3), (M0_SAFE)) /* csi21_dx3 */ \
1002 MV(CP(CSI21_DY3), (M0_SAFE)) /* csi21_dy3 */ \
1003 MV(CP(CSI21_DX4), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpi_75 */ \
1004 MV(CP(CSI21_DY4), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpi_76 */ \
1005 MV(CP(CSI22_DX0), (M0_SAFE)) /* csi22_dx0 */ \
1006 MV(CP(CSI22_DY0), (M0_SAFE)) /* csi22_dy0 */ \
1007 MV(CP(CSI22_DX1), (M0_SAFE)) /* csi22_dx1 */ \
1008 MV(CP(CSI22_DY1), (M0_SAFE)) /* csi22_dy1 */ \
1009 MV(CP(CAM_SHUTTER), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* cam_shutter */ \
1010 MV(CP(CAM_STROBE), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* cam_strobe */ \
1011 MV(CP(CAM_GLOBALRESET), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_83 */ \
1012 MV(CP(USBB1_ULPITLL_CLK), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_clk */ \
1013 MV(CP(USBB1_ULPITLL_STP), (PTU | OFF_EN | OFF_OUT_PTD | M4)) /* usbb1_ulpiphy_stp */ \
1014 MV(CP(USBB1_ULPITLL_DIR), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dir */ \
1015 MV(CP(USBB1_ULPITLL_NXT), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_nxt */ \
1016 MV(CP(USBB1_ULPITLL_DAT0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat0 */ \
1017 MV(CP(USBB1_ULPITLL_DAT1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat1 */ \
1018 MV(CP(USBB1_ULPITLL_DAT2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat2 */ \
1019 MV(CP(USBB1_ULPITLL_DAT3), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat3 */ \
1020 MV(CP(USBB1_ULPITLL_DAT4), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat4 */ \
1021 MV(CP(USBB1_ULPITLL_DAT5), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat5 */ \
1022 MV(CP(USBB1_ULPITLL_DAT6), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat6 */ \
1023 MV(CP(USBB1_ULPITLL_DAT7), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat7 */ \
1024 MV(CP(USBB1_HSIC_DATA), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usbb1_hsic_data */ \
1025 MV(CP(USBB1_HSIC_STROBE), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usbb1_hsic_strobe */ \
1026 MV(CP(USBC1_ICUSB_DP), (M0_SAFE)) /* usbc1_icusb_dp */ \
1027 MV(CP(USBC1_ICUSB_DM), (M0_SAFE)) /* usbc1_icusb_dm */ \
1028 MV(CP(SDMMC1_CLK), (PTU | OFF_EN | OFF_OUT_PTD | M0)) /* sdmmc1_clk */ \
1029 MV(CP(SDMMC1_CMD), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_cmd */ \
1030 MV(CP(SDMMC1_DAT0), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat0 */ \
1031 MV(CP(SDMMC1_DAT1), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat1 */ \
1032 MV(CP(SDMMC1_DAT2), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat2 */ \
1033 MV(CP(SDMMC1_DAT3), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat3 */ \
1034 MV(CP(SDMMC1_DAT4), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat4 */ \
1035 MV(CP(SDMMC1_DAT5), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat5 */ \
1036 MV(CP(SDMMC1_DAT6), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat6 */ \
1037 MV(CP(SDMMC1_DAT7), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat7 */ \
1038 MV(CP(ABE_MCBSP2_CLKX), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp2_clkx */ \
1039 MV(CP(ABE_MCBSP2_DR), (IEN | OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp2_dr */ \
1040 MV(CP(ABE_MCBSP2_DX), (OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp2_dx */ \
1041 MV(CP(ABE_MCBSP2_FSX), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp2_fsx */ \
1042 MV(CP(ABE_MCBSP1_CLKX), (M1_SAFE)) /* abe_slimbus1_clock */ \
1043 MV(CP(ABE_MCBSP1_DR), (M1_SAFE)) /* abe_slimbus1_data */ \
1044 MV(CP(ABE_MCBSP1_DX), (OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp1_dx */ \
1045 MV(CP(ABE_MCBSP1_FSX), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp1_fsx */ \
1046 MV(CP(ABE_PDM_UL_DATA), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_pdm_ul_data */ \
1047 MV(CP(ABE_PDM_DL_DATA), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_pdm_dl_data */ \
1048 MV(CP(ABE_PDM_FRAME), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_pdm_frame */ \
1049 MV(CP(ABE_PDM_LB_CLK), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_pdm_lb_clk */ \
1050 MV(CP(ABE_CLKS), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_clks */ \
1051 MV(CP(ABE_DMIC_CLK1), (M0_SAFE)) /* abe_dmic_clk1 */ \
1052 MV(CP(ABE_DMIC_DIN1), (M0_SAFE)) /* abe_dmic_din1 */ \
1053 MV(CP(ABE_DMIC_DIN2), (M0_SAFE)) /* abe_dmic_din2 */ \
1054 MV(CP(ABE_DMIC_DIN3), (M0_SAFE)) /* abe_dmic_din3 */ \
1055 MV(CP(UART2_CTS), (PTU | IEN | M0)) /* uart2_cts */ \
1056 MV(CP(UART2_RTS), (M0)) /* uart2_rts */ \
1057 MV(CP(UART2_RX), (PTU | IEN | M0)) /* uart2_rx */ \
1058 MV(CP(UART2_TX), (M0)) /* uart2_tx */ \
1059 MV(CP(HDQ_SIO), (M3_SAFE)) /* gpio_127 */ \
1060 MV(CP(I2C1_SCL), (PTU | IEN | M0)) /* i2c1_scl */ \
1061 MV(CP(I2C1_SDA), (PTU | IEN | M0)) /* i2c1_sda */ \
1062 MV(CP(I2C2_SCL), (PTU | IEN | M0)) /* i2c2_scl */ \
1063 MV(CP(I2C2_SDA), (PTU | IEN | M0)) /* i2c2_sda */ \
1064 MV(CP(I2C3_SCL), (PTU | IEN | M0)) /* i2c3_scl */ \
1065 MV(CP(I2C3_SDA), (PTU | IEN | M0)) /* i2c3_sda */ \
1066 MV(CP(I2C4_SCL), (PTU | IEN | M0)) /* i2c4_scl */ \
1067 MV(CP(I2C4_SDA), (PTU | IEN | M0)) /* i2c4_sda */ \
1068 MV(CP(MCSPI1_CLK), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_clk */ \
1069 MV(CP(MCSPI1_SOMI), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_somi */ \
1070 MV(CP(MCSPI1_SIMO), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_simo */ \
1071 MV(CP(MCSPI1_CS0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_cs0 */ \
1072 MV(CP(MCSPI1_CS1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* mcspi1_cs1 */ \
1073 MV(CP(MCSPI1_CS2), (OFF_EN | OFF_OUT_PTU | M3)) /* gpio_139 */ \
1074 MV(CP(MCSPI1_CS3), (M3_SAFE)) /* gpio_140 */ \
1075 MV(CP(UART3_CTS_RCTX), (PTU | IEN | M0)) /* uart3_tx */ \
1076 MV(CP(UART3_RTS_SD), (M0)) /* uart3_rts_sd */ \
1077 MV(CP(UART3_RX_IRRX), (IEN | M0)) /* uart3_rx */ \
1078 MV(CP(UART3_TX_IRTX), (M0)) /* uart3_tx */ \
1079 MV(CP(SDMMC5_CLK), (PTU | OFF_EN | OFF_OUT_PTD | M0)) /* sdmmc5_clk */ \
1080 MV(CP(SDMMC5_CMD), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_cmd */ \
1081 MV(CP(SDMMC5_DAT0), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat0 */ \
1082 MV(CP(SDMMC5_DAT1), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat1 */ \
1083 MV(CP(SDMMC5_DAT2), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat2 */ \
1084 MV(CP(SDMMC5_DAT3), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat3 */ \
1085 MV(CP(MCSPI4_CLK), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_clk */ \
1086 MV(CP(MCSPI4_SIMO), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_simo */ \
1087 MV(CP(MCSPI4_SOMI), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_somi */ \
1088 MV(CP(MCSPI4_CS0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_cs0 */ \
1089 MV(CP(UART4_RX), (IEN | M0)) /* uart4_rx */ \
1090 MV(CP(UART4_TX), (M0)) /* uart4_tx */ \
1091 MV(CP(USBB2_ULPITLL_CLK), (M3)) /* gpio_157 */ \
1092 MV(CP(USBB2_ULPITLL_STP), (M5)) /* dispc2_data23 */ \
1093 MV(CP(USBB2_ULPITLL_DIR), (M5)) /* dispc2_data22 */ \
1094 MV(CP(USBB2_ULPITLL_NXT), (M5)) /* dispc2_data21 */ \
1095 MV(CP(USBB2_ULPITLL_DAT0), (M5)) /* dispc2_data20 */ \
1096 MV(CP(USBB2_ULPITLL_DAT1), (M5)) /* dispc2_data19 */ \
1097 MV(CP(USBB2_ULPITLL_DAT2), (M5)) /* dispc2_data18 */ \
1098 MV(CP(USBB2_ULPITLL_DAT3), (M5)) /* dispc2_data15 */ \
1099 MV(CP(USBB2_ULPITLL_DAT4), (M5)) /* dispc2_data14 */ \
1100 MV(CP(USBB2_ULPITLL_DAT5), (M5)) /* dispc2_data13 */ \
1101 MV(CP(USBB2_ULPITLL_DAT6), (M5)) /* dispc2_data12 */ \
1102 MV(CP(USBB2_ULPITLL_DAT7), (M5)) /* dispc2_data11 */ \
1103 MV(CP(USBB2_HSIC_DATA), (OFF_EN | OFF_OUT_PTU | M3)) /* gpio_169 */ \
1104 MV(CP(USBB2_HSIC_STROBE), (OFF_EN | OFF_OUT_PTU | M3)) /* gpio_170 */ \
1105 MV(CP(UNIPRO_TX0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col0 */ \
1106 MV(CP(UNIPRO_TY0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col1 */ \
1107 MV(CP(UNIPRO_TX1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col2 */ \
1108 MV(CP(UNIPRO_TY1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col3 */ \
1109 MV(CP(UNIPRO_TX2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpio_0 */ \
1110 MV(CP(UNIPRO_TY2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpio_1 */ \
1111 MV(CP(UNIPRO_RX0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row0 */ \
1112 MV(CP(UNIPRO_RY0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row1 */ \
1113 MV(CP(UNIPRO_RX1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row2 */ \
1114 MV(CP(UNIPRO_RY1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row3 */ \
1115 MV(CP(UNIPRO_RX2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row4 */ \
1116 MV(CP(UNIPRO_RY2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row5 */ \
1117 MV(CP(USBA0_OTG_CE), (PTU | OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* usba0_otg_ce */ \
1118 MV(CP(USBA0_OTG_DP), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usba0_otg_dp */ \
1119 MV(CP(USBA0_OTG_DM), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usba0_otg_dm */ \
1120 MV(CP(FREF_CLK1_OUT), (M0_SAFE)) /* fref_clk1_out */ \
1121 MV(CP(FREF_CLK2_OUT), (M0_SAFE)) /* fref_clk2_out */ \
1122 MV(CP(SYS_NIRQ1), (PTU | IEN | M0)) /* sys_nirq1 */ \
1123 MV(CP(SYS_NIRQ2), (PTU | IEN | M0)) /* sys_nirq2 */ \
1124 MV(CP(SYS_BOOT0), (M3_SAFE)) /* gpio_184 */ \
1125 MV(CP(SYS_BOOT1), (M3_SAFE)) /* gpio_185 */ \
1126 MV(CP(SYS_BOOT2), (M3_SAFE)) /* gpio_186 */ \
1127 MV(CP(SYS_BOOT3), (M3_SAFE)) /* gpio_187 */ \
1128 MV(CP(SYS_BOOT4), (M3_SAFE)) /* gpio_188 */ \
1129 MV(CP(SYS_BOOT5), (M3_SAFE)) /* gpio_189 */ \
1130 MV(CP(DPM_EMU0), (M0_SAFE)) /* dpm_emu0 */ \
1131 MV(CP(DPM_EMU1), (M0_SAFE)) /* dpm_emu1 */ \
1132 MV(CP(DPM_EMU2), (M0_SAFE)) /* dpm_emu2 */ \
1133 MV(CP(DPM_EMU3), (M5)) /* dispc2_data10 */ \
1134 MV(CP(DPM_EMU4), (M5)) /* dispc2_data9 */ \
1135 MV(CP(DPM_EMU5), (M5)) /* dispc2_data16 */ \
1136 MV(CP(DPM_EMU6), (M5)) /* dispc2_data17 */ \
1137 MV(CP(DPM_EMU7), (M5)) /* dispc2_hsync */ \
1138 MV(CP(DPM_EMU8), (M5)) /* dispc2_pclk */ \
1139 MV(CP(DPM_EMU9), (M5)) /* dispc2_vsync */ \
1140 MV(CP(DPM_EMU10), (M5)) /* dispc2_de */ \
1141 MV(CP(DPM_EMU11), (M5)) /* dispc2_data8 */ \
1142 MV(CP(DPM_EMU12), (M5)) /* dispc2_data7 */ \
1143 MV(CP(DPM_EMU13), (M5)) /* dispc2_data6 */ \
1144 MV(CP(DPM_EMU14), (M5)) /* dispc2_data5 */ \
1145 MV(CP(DPM_EMU15), (M5)) /* dispc2_data4 */ \
1146 MV(CP(DPM_EMU16), (M5)) /* dispc2_data3/dmtimer8_pwm_evt */ \
1147 MV(CP(DPM_EMU17), (M5)) /* dispc2_data2 */ \
1148 MV(CP(DPM_EMU18), (M5)) /* dispc2_data1 */ \
1149 MV(CP(DPM_EMU19), (M5)) /* dispc2_data0 */ \
1150 MV1(WK(PAD0_SIM_IO), (M0_SAFE)) /* sim_io */ \
1151 MV1(WK(PAD1_SIM_CLK), (M0_SAFE)) /* sim_clk */ \
1152 MV1(WK(PAD0_SIM_RESET), (M0_SAFE)) /* sim_reset */ \
1153 MV1(WK(PAD1_SIM_CD), (M0_SAFE)) /* sim_cd */ \
1154 MV1(WK(PAD0_SIM_PWRCTRL), (M0_SAFE)) /* sim_pwrctrl */ \
1155 MV1(WK(PAD1_SR_SCL), (PTU | IEN | M0)) /* sr_scl */ \
1156 MV1(WK(PAD0_SR_SDA), (PTU | IEN | M0)) /* sr_sda */ \
1157 MV1(WK(PAD1_FREF_XTAL_IN), (M0_SAFE)) /* # */ \
1158 MV1(WK(PAD0_FREF_SLICER_IN), (M0_SAFE)) /* fref_slicer_in */ \
1159 MV1(WK(PAD1_FREF_CLK_IOREQ), (M0_SAFE)) /* fref_clk_ioreq */ \
1160 MV1(WK(PAD0_FREF_CLK0_OUT), (M0)) /* sys_drm_msecure */ \
1161 MV1(WK(PAD1_FREF_CLK3_REQ), (M0)) /* # */ \
1162 MV1(WK(PAD0_FREF_CLK3_OUT), (M0_SAFE)) /* fref_clk3_out */ \
1163 MV1(WK(PAD1_FREF_CLK4_REQ), (M0_SAFE)) /* # */ \
1164 MV1(WK(PAD0_FREF_CLK4_OUT), (M0_SAFE)) /* # */ \
1165 MV1(WK(PAD1_SYS_32K), (IEN | M0_SAFE)) /* sys_32k */ \
1166 MV1(WK(PAD0_SYS_NRESPWRON), (IEN | M0_SAFE)) /* sys_nrespwron */ \
1167 MV1(WK(PAD1_SYS_NRESWARM), (IEN | M0_SAFE)) /* sys_nreswarm */ \
1168 MV1(WK(PAD0_SYS_PWR_REQ), (M0_SAFE)) /* sys_pwr_req */ \
1169 MV1(WK(PAD1_SYS_PWRON_RESET), (M3_SAFE)) /* gpio_wk29 */ \
1170 MV1(WK(PAD0_SYS_BOOT6), (M3_SAFE)) /* gpio_wk9 */ \
1171 MV1(WK(PAD1_SYS_BOOT7), (M3_SAFE)) /* gpio_wk10 */ \
1172 MV1(WK(PAD1_JTAG_TCK), (IEN | M0)) /* jtag_tck */ \
1173 MV1(WK(PAD0_JTAG_RTCK), (M0)) /* jtag_rtck */ \
1174 MV1(WK(PAD1_JTAG_TMS_TMSC), (IEN | M0)) /* jtag_tms_tmsc */ \
1175 MV1(WK(PAD0_JTAG_TDI), (IEN | M0)) /* jtag_tdi */ \
1176 MV1(WK(PAD1_JTAG_TDO), (M0)) /* jtag_tdo */
1178 /**********************************************************
1179 * Routine: set_muxconf_regs
1180 * Description: Setting up the configuration Mux registers
1181 * specific to the hardware. Many pins need
1182 * to be moved from protect to primary mode.
1183 *********************************************************/
1184 void set_muxconf_regs(void)
1186 MUX_DEFAULT_OMAP4();
1190 /******************************************************************************
1191 * Routine: update_mux()
1192 * Description:Update balls which are different between boards. All should be
1193 * updated to match functionality. However, I'm only updating ones
1194 * which I'll be using for now. When power comes into play they
1195 * all need updating.
1196 *****************************************************************************/
1197 void update_mux(u32 btype, u32 mtype)
1204 /* optionally do something like blinking LED */
1205 void board_hang (void)
1212 void reset_phy(unsigned int base)
1214 *(volatile int*)(base + IODFT_TLGC) |= (1 << 10);