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 const struct ddr_regs ddr_regs_400_mhz_2cs = {
210 /* tRRD changed from 10ns to 12.5ns because of the tFAW requirement*/
214 .phy_ctrl_1 = 0x849FF408,
215 .ref_ctrl = 0x00000618,
216 .config_init = 0x80000eb9,
217 .config_final = 0x80001ab9,
218 .zq_config = 0xD00b3215,
223 /*******************************************************
225 * Description: spinning delay to use before udelay works
226 ******************************************************/
227 static inline void delay(unsigned long loops)
229 __asm__ volatile ("1:\n" "subs %0, %1, #1\n"
230 "bne 1b" : "=r" (loops) : "0"(loops));
234 void big_delay(unsigned int count)
237 for (i = 0; i < count; i++)
241 /* TODO: FREQ update method is not working so shadow registers programming
242 * is just for same of completeness. This would be safer if auto
243 * trasnitions are working
245 static int emif_config(unsigned int base)
247 unsigned int reg_value, rev;
248 const struct ddr_regs *ddr_regs;
249 rev = omap_revision();
251 if (rev == OMAP4430_ES1_0)
252 ddr_regs = &ddr_regs_380_mhz;
253 else if (rev == OMAP4430_ES2_0)
254 ddr_regs = &ddr_regs_200_mhz_2cs;
255 else if (rev >= OMAP4430_ES2_1)
256 ddr_regs = &ddr_regs_400_mhz_2cs;
258 * set SDRAM CONFIG register
259 * EMIF_SDRAM_CONFIG[31:29] REG_SDRAM_TYPE = 4 for LPDDR2-S4
260 * EMIF_SDRAM_CONFIG[28:27] REG_IBANK_POS = 0
261 * EMIF_SDRAM_CONFIG[13:10] REG_CL = 3
262 * EMIF_SDRAM_CONFIG[6:4] REG_IBANK = 3 - 8 banks
263 * EMIF_SDRAM_CONFIG[3] REG_EBANK = 0 - CS0
264 * EMIF_SDRAM_CONFIG[2:0] REG_PAGESIZE = 2 - 512- 9 column
265 * JDEC specs - S4-2Gb --8 banks -- R0-R13, C0-c8
267 *(volatile int*)(base + EMIF_LPDDR2_NVM_CONFIG) &= 0xBFFFFFFF;
268 *(volatile int*)(base + EMIF_SDRAM_CONFIG) = ddr_regs->config_init;
270 /* PHY control values */
271 *(volatile int*)(base + EMIF_DDR_PHY_CTRL_1) = DDR_PHY_CTRL_1_INIT;
272 *(volatile int*)(base + EMIF_DDR_PHY_CTRL_1_SHDW)= ddr_regs->phy_ctrl_1;
275 * EMIF_READ_IDLE_CTRL
277 *(volatile int*)(base + EMIF_READ_IDLE_CTRL) = READ_IDLE_CTRL;
278 *(volatile int*)(base + EMIF_READ_IDLE_CTRL_SHDW) = READ_IDLE_CTRL;
283 *(volatile int*)(base + EMIF_SDRAM_TIM_1) = ddr_regs->tim1;
284 *(volatile int*)(base + EMIF_SDRAM_TIM_1_SHDW) = ddr_regs->tim1;
289 *(volatile int*)(base + EMIF_SDRAM_TIM_2) = ddr_regs->tim2;
290 *(volatile int*)(base + EMIF_SDRAM_TIM_2_SHDW) = ddr_regs->tim2;
295 *(volatile int*)(base + EMIF_SDRAM_TIM_3) = ddr_regs->tim3;
296 *(volatile int*)(base + EMIF_SDRAM_TIM_3_SHDW) = ddr_regs->tim3;
298 *(volatile int*)(base + EMIF_ZQ_CONFIG) = ddr_regs->zq_config;
302 //*(volatile int*)(base + EMIF_PWR_MGMT_CTRL) = PWR_MGMT_CTRL;
303 //*(volatile int*)(base + EMIF_PWR_MGMT_CTRL_SHDW) = PWR_MGMT_CTRL_OPP100;
305 * poll MR0 register (DAI bit)
306 * REG_CS[31] = 0 -- Mode register command to CS0
307 * REG_REFRESH_EN[30] = 1 -- Refresh enable after MRW
308 * REG_ADDRESS[7:0] = 00 -- Refresh enable after MRW
311 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = MR0_ADDR;
313 reg_value = *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA);
314 } while ((reg_value & 0x1) != 0);
316 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = CS1_MR(MR0_ADDR);
318 reg_value = *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA);
319 } while ((reg_value & 0x1) != 0);
322 /* set MR10 register */
323 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG)= MR10_ADDR;
324 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = MR10_ZQINIT;
325 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = CS1_MR(MR10_ADDR);
326 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = MR10_ZQINIT;
328 /* wait for tZQINIT=1us */
331 /* set MR1 register */
332 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG)= MR1_ADDR;
333 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = ddr_regs->mr1;
334 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = CS1_MR(MR1_ADDR);
335 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = ddr_regs->mr1;
338 /* set MR2 register RL=6 for OPP100 */
339 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG)= MR2_ADDR;
340 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = ddr_regs->mr2;
341 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) = CS1_MR(MR2_ADDR);
342 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = ddr_regs->mr2;
344 /* Set SDRAM CONFIG register again here with final RL-WL value */
345 *(volatile int*)(base + EMIF_SDRAM_CONFIG) = ddr_regs->config_final;
346 *(volatile int*)(base + EMIF_DDR_PHY_CTRL_1) = ddr_regs->phy_ctrl_1;
349 * EMIF_SDRAM_REF_CTRL
350 * refresh rate = DDR_CLK / reg_refresh_rate
351 * 3.9 uS = (400MHz) / reg_refresh_rate
353 *(volatile int*)(base + EMIF_SDRAM_REF_CTRL) = ddr_regs->ref_ctrl;
354 *(volatile int*)(base + EMIF_SDRAM_REF_CTRL_SHDW) = ddr_regs->ref_ctrl;
356 /* set MR16 register */
357 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG)= MR16_ADDR | REF_EN;
358 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = 0;
359 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_CFG) =
360 CS1_MR(MR16_ADDR | REF_EN);
361 *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = 0;
362 /* LPDDR2 init complete */
365 /*****************************************
367 * Description: Configure DDR
368 * EMIF1 -- CS0 -- DDR1 (256 MB)
369 * EMIF2 -- CS0 -- DDR2 (256 MB)
370 *****************************************/
371 static void ddr_init(void)
373 unsigned int base_addr, rev;
374 rev = omap_revision();
376 if (rev == OMAP4430_ES1_0) {
377 /* Configurte the Control Module DDRIO device */
378 __raw_writel(0x1c1c1c1c, 0x4A100638);
379 __raw_writel(0x1c1c1c1c, 0x4A10063c);
380 __raw_writel(0x1c1c1c1c, 0x4A100640);
381 __raw_writel(0x1c1c1c1c, 0x4A100648);
382 __raw_writel(0x1c1c1c1c, 0x4A10064c);
383 __raw_writel(0x1c1c1c1c, 0x4A100650);
384 /* LPDDR2IO set to NMOS PTV */
385 __raw_writel(0x00ffc000, 0x4A100704);
386 } else if (rev == OMAP4430_ES2_0) {
387 __raw_writel(0x9e9e9e9e, 0x4A100638);
388 __raw_writel(0x9e9e9e9e, 0x4A10063c);
389 __raw_writel(0x9e9e9e9e, 0x4A100640);
390 __raw_writel(0x9e9e9e9e, 0x4A100648);
391 __raw_writel(0x9e9e9e9e, 0x4A10064c);
392 __raw_writel(0x9e9e9e9e, 0x4A100650);
393 /* LPDDR2IO set to NMOS PTV */
394 __raw_writel(0x00ffc000, 0x4A100704);
401 /* Both EMIFs 128 byte interleaved*/
402 if (rev == OMAP4430_ES1_0)
403 *(volatile int*)(DMM_BASE + DMM_LISA_MAP_0) = 0x80540300;
405 *(volatile int*)(DMM_BASE + DMM_LISA_MAP_0) = 0x80640300;
407 /* EMIF2 only at 0x90000000 */
408 //*(volatile int*)(DMM_BASE + DMM_LISA_MAP_1) = 0x90400200;
410 *(volatile int*)(DMM_BASE + DMM_LISA_MAP_2) = 0x00000000;
411 *(volatile int*)(DMM_BASE + DMM_LISA_MAP_3) = 0xFF020100;
413 /* DDR needs to be initialised @ 19.2 MHz
414 * So put core DPLL in bypass mode
415 * Configure the Core DPLL but don't lock it
417 configure_core_dpll_no_lock();
419 /* No IDLE: BUG in SDC */
420 //sr32(CM_MEMIF_CLKSTCTRL, 0, 32, 0x2);
421 //while(((*(volatile int*)CM_MEMIF_CLKSTCTRL) & 0x700) != 0x700);
422 *(volatile int*)(EMIF1_BASE + EMIF_PWR_MGMT_CTRL) = 0x0;
423 *(volatile int*)(EMIF2_BASE + EMIF_PWR_MGMT_CTRL) = 0x0;
425 base_addr = EMIF1_BASE;
426 emif_config(base_addr);
428 /* Configure EMIF24D */
429 base_addr = EMIF2_BASE;
430 emif_config(base_addr);
431 /* Lock Core using shadow CM_SHADOW_FREQ_CONFIG1 */
432 lock_core_dpll_shadow();
433 /* TODO: SDC needs few hacks to get DDR freq update working */
435 /* Set DLL_OVERRIDE = 0 */
436 *(volatile int*)CM_DLL_CTRL = 0x0;
440 /* Check for DDR PHY ready for EMIF1 & EMIF2 */
441 while((((*(volatile int*)(EMIF1_BASE + EMIF_STATUS))&(0x04)) != 0x04) \
442 || (((*(volatile int*)(EMIF2_BASE + EMIF_STATUS))&(0x04)) != 0x04));
444 /* Reprogram the DDR PYHY Control register */
445 /* PHY control values */
447 sr32(CM_MEMIF_EMIF_1_CLKCTRL, 0, 32, 0x1);
448 sr32(CM_MEMIF_EMIF_2_CLKCTRL, 0, 32, 0x1);
450 /* Put the Core Subsystem PD to ON State */
452 /* No IDLE: BUG in SDC */
453 //sr32(CM_MEMIF_CLKSTCTRL, 0, 32, 0x2);
454 //while(((*(volatile int*)CM_MEMIF_CLKSTCTRL) & 0x700) != 0x700);
455 *(volatile int*)(EMIF1_BASE + EMIF_PWR_MGMT_CTRL) = 0x80000000;
456 *(volatile int*)(EMIF2_BASE + EMIF_PWR_MGMT_CTRL) = 0x80000000;
459 * In n a specific situation, the OCP interface between the DMM and
461 * 1. A TILER port is used to perform 2D burst writes of
462 * width 1 and height 8
463 * 2. ELLAn port is used to perform reads
464 * 3. All accesses are routed to the same EMIF controller
466 * Work around to avoid this issue REG_SYS_THRESH_MAX value should
467 * be kept higher than default 0x7. As per recommondation 0x0A will
468 * be used for better performance with REG_LL_THRESH_MAX = 0x00
470 if (rev == OMAP4430_ES1_0) {
471 *(volatile int*)(EMIF1_BASE + EMIF_L3_CONFIG) = 0x0A0000FF;
472 *(volatile int*)(EMIF2_BASE + EMIF_L3_CONFIG) = 0x0A0000FF;
476 * DMM : DMM_LISA_MAP_0(Section_0)
477 * [31:24] SYS_ADDR 0x80
478 * [22:20] SYS_SIZE 0x7 - 2Gb
479 * [19:18] SDRC_INTLDMM 0x1 - 128 byte
480 * [17:16] SDRC_ADDRSPC 0x0
482 * [7:0] SDRC_ADDR 0X0
484 reset_phy(EMIF1_BASE);
485 reset_phy(EMIF2_BASE);
487 *((volatile int *)0x80000000) = 0;
488 *((volatile int *)0x80000080) = 0;
489 //*((volatile int *)0x90000000) = 0;
491 /*****************************************
492 * Routine: board_init
493 * Description: Early hardware init.
494 *****************************************/
500 /*************************************************************
501 * Routine: get_mem_type(void) - returns the kind of memory connected
502 * to GPMC that we are trying to boot form. Uses SYS BOOT settings.
503 *************************************************************/
504 u32 get_mem_type(void)
506 /* no nand, so return GPMC_NONE */
510 /*****************************************
511 * Routine: secure_unlock
512 * Description: Setup security registers for access
514 *****************************************/
515 void secure_unlock_mem(void)
517 /* Permission values for registers -Full fledged permissions to all */
518 #define UNLOCK_1 0xFFFFFFFF
519 #define UNLOCK_2 0x00000000
520 #define UNLOCK_3 0x0000FFFF
522 /* Protection Module Register Target APE (PM_RT)*/
523 __raw_writel(UNLOCK_1, RT_REQ_INFO_PERMISSION_1);
524 __raw_writel(UNLOCK_1, RT_READ_PERMISSION_0);
525 __raw_writel(UNLOCK_1, RT_WRITE_PERMISSION_0);
526 __raw_writel(UNLOCK_2, RT_ADDR_MATCH_1);
528 __raw_writel(UNLOCK_3, GPMC_REQ_INFO_PERMISSION_0);
529 __raw_writel(UNLOCK_3, GPMC_READ_PERMISSION_0);
530 __raw_writel(UNLOCK_3, GPMC_WRITE_PERMISSION_0);
532 __raw_writel(UNLOCK_3, OCM_REQ_INFO_PERMISSION_0);
533 __raw_writel(UNLOCK_3, OCM_READ_PERMISSION_0);
534 __raw_writel(UNLOCK_3, OCM_WRITE_PERMISSION_0);
535 __raw_writel(UNLOCK_2, OCM_ADDR_MATCH_2);
538 __raw_writel(UNLOCK_3, IVA2_REQ_INFO_PERMISSION_0);
539 __raw_writel(UNLOCK_3, IVA2_READ_PERMISSION_0);
540 __raw_writel(UNLOCK_3, IVA2_WRITE_PERMISSION_0);
542 __raw_writel(UNLOCK_1, SMS_RG_ATT0); /* SDRC region 0 public */
545 /**********************************************************
546 * Routine: try_unlock_sram()
547 * Description: If chip is GP/EMU(special) type, unlock the SRAM for
549 ***********************************************************/
550 void try_unlock_memory(void)
554 /* if GP device unlock device SRAM for general use */
555 /* secure code breaks for Secure/Emulation device - HS/E/T*/
560 #if defined(CONFIG_MPU_600) || defined(CONFIG_MPU_1000)
561 static scale_vcores(void)
563 unsigned int rev = omap_revision();
564 /* For VC bypass only VCOREx_CGF_FORCE is necessary and
565 * VCOREx_CFG_VOLTAGE changes can be discarded
567 /* PRM_VC_CFG_I2C_MODE */
568 *(volatile int*)(0x4A307BA8) = 0x0;
569 /* PRM_VC_CFG_I2C_CLK */
570 *(volatile int*)(0x4A307BAC) = 0x6026;
572 /* set VCORE1 force VSEL */
573 /* PRM_VC_VAL_BYPASS) */
574 if(rev == OMAP4430_ES1_0)
575 *(volatile int*)(0x4A307BA0) = 0x3B5512;
577 *(volatile int*)(0x4A307BA0) = 0x3A5512;
579 *(volatile int*)(0x4A307BA0) |= 0x1000000;
580 while((*(volatile int*)(0x4A307BA0)) & 0x1000000);
582 /* PRM_IRQSTATUS_MPU */
583 *(volatile int*)(0x4A306010) = *(volatile int*)(0x4A306010);
586 /* FIXME: set VCORE2 force VSEL, Check the reset value */
587 /* PRM_VC_VAL_BYPASS) */
588 if(rev == OMAP4430_ES1_0)
589 *(volatile int*)(0x4A307BA0) = 0x315B12;
591 *(volatile int*)(0x4A307BA0) = 0x295B12;
592 *(volatile int*)(0x4A307BA0) |= 0x1000000;
593 while((*(volatile int*)(0x4A307BA0)) & 0x1000000);
595 /* PRM_IRQSTATUS_MPU */
596 *(volatile int*)(0x4A306010) = *(volatile int*)(0x4A306010);
598 /*/set VCORE3 force VSEL */
599 /* PRM_VC_VAL_BYPASS */
600 if(rev == OMAP4430_ES1_0)
601 *(volatile int*)(0x4A307BA0) = 0x316112;
602 else if (rev == OMAP4430_ES2_0)
603 *(volatile int*)(0x4A307BA0) = 0x296112;
604 else if (rev >= OMAP4430_ES2_1)
605 *(volatile int*)(0x4A307BA0) = 0x2A6112;
606 *(volatile int*)(0x4A307BA0) |= 0x1000000;
607 while((*(volatile int*)(0x4A307BA0)) & 0x1000000);
609 /* PRM_IRQSTATUS_MPU */
610 *(volatile int*)(0x4A306010) = *(volatile int*)(0x4A306010);
615 /**********************************************************
617 * Description: Does early system init of muxing and clocks.
618 * - Called path is with SRAM stack.
619 **********************************************************/
623 unsigned int rev = omap_revision();
628 /* Writing to AuxCR in U-boot using SMI for GP/EMU DEV */
629 /* Currently SMI in Kernel on ES2 devices seems to have an isse
630 * Once that is resolved, we can postpone this config to kernel
632 //setup_auxcr(get_device_type(), external_boot);
636 /* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
637 #if defined(CONFIG_MPU_600) || defined(CONFIG_MPU_1000)
642 if (rev != OMAP4430_ES1_0) {
643 if (__raw_readl(0x4805D138) & (1<<22)) {
644 /* enable software ioreq */
645 sr32(0x4A30a31C, 8, 1, 0x1);
646 /* set for sys_clk (38.4MHz) */
647 sr32(0x4A30a31C, 1, 2, 0x0);
648 /* set divisor to 2 */
649 sr32(0x4A30a31C, 16, 4, 0x1);
650 /* set the clock source to active */
651 sr32(0x4A30a110, 0, 1, 0x1);
653 sr32(0x4A30a110, 2, 2, 0x3);
655 /* enable software ioreq */
656 sr32(0x4A30a314, 8, 1, 0x1);
657 /* set for PER_DPLL */
658 sr32(0x4A30a314, 1, 2, 0x2);
659 /* set divisor to 16 */
660 sr32(0x4A30a314, 16, 4, 0xf);
661 /* set the clock source to active */
662 sr32(0x4A30a110, 0, 1, 0x1);
664 sr32(0x4A30a110, 2, 2, 0x3);
670 /*******************************************************
671 * Routine: misc_init_r
672 * Description: Init ethernet (done here so udelay works)
673 ********************************************************/
674 int misc_init_r(void)
679 /******************************************************
680 * Routine: wait_for_command_complete
681 * Description: Wait for posting to finish on watchdog
682 ******************************************************/
683 void wait_for_command_complete(unsigned int wd_base)
687 pending = __raw_readl(wd_base + WWPS);
691 /*******************************************************************
693 * Description: take the Ethernet controller out of reset and wait
694 * for the EEPROM load to complete.
695 ******************************************************************/
697 /**********************************************
699 * Description: sets uboots idea of sdram size
700 **********************************************/
706 #define OMAP44XX_WKUP_CTRL_BASE 0x4A31E000
726 #define MV(OFFSET, VALUE)\
727 __raw_writew((VALUE), OMAP44XX_CTRL_BASE + (OFFSET));
728 #define MV1(OFFSET, VALUE)\
729 __raw_writew((VALUE), OMAP44XX_WKUP_CTRL_BASE + (OFFSET));
731 #define CP(x) (CONTROL_PADCONF_##x)
732 #define WK(x) (CONTROL_WKUP_##x)
735 * IDIS - Input Disable
736 * PTD - Pull type Down
738 * DIS - Pull type selection is inactive
739 * EN - Pull type selection is active
741 * The commented string gives the final mux configuration for that pin
744 #define MUX_DEFAULT_OMAP4() \
745 MV(CP(GPMC_AD0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat0 */ \
746 MV(CP(GPMC_AD1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat1 */ \
747 MV(CP(GPMC_AD2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat2 */ \
748 MV(CP(GPMC_AD3) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat3 */ \
749 MV(CP(GPMC_AD4) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat4 */ \
750 MV(CP(GPMC_AD5) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat5 */ \
751 MV(CP(GPMC_AD6) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat6 */ \
752 MV(CP(GPMC_AD7) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat7 */ \
753 MV(CP(GPMC_AD8) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpio_32 */ \
754 MV(CP(GPMC_AD9) , ( PTU | IEN | M3)) /* gpio_33 */ \
755 MV(CP(GPMC_AD10) , ( PTU | IEN | M3)) /* gpio_34 */ \
756 MV(CP(GPMC_AD11) , ( PTU | IEN | M3)) /* gpio_35 */ \
757 MV(CP(GPMC_AD12) , ( PTU | IEN | M3)) /* gpio_36 */ \
758 MV(CP(GPMC_AD13) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_37 */ \
759 MV(CP(GPMC_AD14) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_38 */ \
760 MV(CP(GPMC_AD15) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_39 */ \
761 MV(CP(GPMC_A16) , ( M3)) /* gpio_40 */ \
762 MV(CP(GPMC_A17) , ( PTD | M3)) /* gpio_41 */ \
763 MV(CP(GPMC_A18) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row6 */ \
764 MV(CP(GPMC_A19) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row7 */ \
765 MV(CP(GPMC_A20) , ( IEN | M3)) /* gpio_44 */ \
766 MV(CP(GPMC_A21) , ( M3)) /* gpio_45 */ \
767 MV(CP(GPMC_A22) , ( M3)) /* gpio_46 */ \
768 MV(CP(GPMC_A23) , ( OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col7 */ \
769 MV(CP(GPMC_A24) , ( PTD | M3)) /* gpio_48 */ \
770 MV(CP(GPMC_A25) , ( PTD | M3)) /* gpio_49 */ \
771 MV(CP(GPMC_NCS0) , ( M3)) /* gpio_50 */ \
772 MV(CP(GPMC_NCS1) , ( IEN | M3)) /* gpio_51 */ \
773 MV(CP(GPMC_NCS2) , ( IEN | M3)) /* gpio_52 */ \
774 MV(CP(GPMC_NCS3) , ( IEN | M3)) /* gpio_53 */ \
775 MV(CP(GPMC_NWP) , ( M3)) /* gpio_54 */ \
776 MV(CP(GPMC_CLK) , ( PTD | M3)) /* gpio_55 */ \
777 MV(CP(GPMC_NADV_ALE) , ( M3)) /* gpio_56 */ \
778 MV(CP(GPMC_NOE) , ( PTU | IEN | OFF_EN | OFF_OUT_PTD | M1)) /* sdmmc2_clk */ \
779 MV(CP(GPMC_NWE) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_cmd */ \
780 MV(CP(GPMC_NBE0_CLE) , ( M3)) /* gpio_59 */ \
781 MV(CP(GPMC_NBE1) , ( PTD | M3)) /* gpio_60 */ \
782 MV(CP(GPMC_WAIT0) , ( PTU | IEN | M3)) /* gpio_61 */ \
783 MV(CP(GPMC_WAIT1), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_62 */ \
784 MV(CP(C2C_DATA11) , ( PTD | M3)) /* gpio_100 */ \
785 MV(CP(C2C_DATA12) , ( PTD | IEN | M3)) /* gpio_101 */ \
786 MV(CP(C2C_DATA13) , ( PTD | M3)) /* gpio_102 */ \
787 MV(CP(C2C_DATA14) , ( M1)) /* dsi2_te0 */ \
788 MV(CP(C2C_DATA15) , ( PTD | M3)) /* gpio_104 */ \
789 MV(CP(HDMI_HPD) , ( M0)) /* hdmi_hpd */ \
790 MV(CP(HDMI_CEC) , ( M0)) /* hdmi_cec */ \
791 MV(CP(HDMI_DDC_SCL) , ( PTU | M0)) /* hdmi_ddc_scl */ \
792 MV(CP(HDMI_DDC_SDA) , ( PTU | IEN | M0)) /* hdmi_ddc_sda */ \
793 MV(CP(CSI21_DX0) , ( IEN | M0)) /* csi21_dx0 */ \
794 MV(CP(CSI21_DY0) , ( IEN | M0)) /* csi21_dy0 */ \
795 MV(CP(CSI21_DX1) , ( IEN | M0)) /* csi21_dx1 */ \
796 MV(CP(CSI21_DY1) , ( IEN | M0)) /* csi21_dy1 */ \
797 MV(CP(CSI21_DX2) , ( IEN | M0)) /* csi21_dx2 */ \
798 MV(CP(CSI21_DY2) , ( IEN | M0)) /* csi21_dy2 */ \
799 MV(CP(CSI21_DX3) , ( PTD | M7)) /* csi21_dx3 */ \
800 MV(CP(CSI21_DY3) , ( PTD | M7)) /* csi21_dy3 */ \
801 MV(CP(CSI21_DX4) , ( PTD | OFF_EN | OFF_PD | OFF_IN | M7)) /* csi21_dx4 */ \
802 MV(CP(CSI21_DY4) , ( PTD | OFF_EN | OFF_PD | OFF_IN | M7)) /* csi21_dy4 */ \
803 MV(CP(CSI22_DX0) , ( IEN | M0)) /* csi22_dx0 */ \
804 MV(CP(CSI22_DY0) , ( IEN | M0)) /* csi22_dy0 */ \
805 MV(CP(CSI22_DX1) , ( IEN | M0)) /* csi22_dx1 */ \
806 MV(CP(CSI22_DY1) , ( IEN | M0)) /* csi22_dy1 */ \
807 MV(CP(CAM_SHUTTER) , ( OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* cam_shutter */ \
808 MV(CP(CAM_STROBE) , ( OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* cam_strobe */ \
809 MV(CP(CAM_GLOBALRESET) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_83 */ \
810 MV(CP(USBB1_ULPITLL_CLK) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_clk */ \
811 MV(CP(USBB1_ULPITLL_STP) , ( OFF_EN | OFF_OUT_PTD | M4)) /* usbb1_ulpiphy_stp */ \
812 MV(CP(USBB1_ULPITLL_DIR) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dir */ \
813 MV(CP(USBB1_ULPITLL_NXT) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_nxt */ \
814 MV(CP(USBB1_ULPITLL_DAT0) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat0 */ \
815 MV(CP(USBB1_ULPITLL_DAT1) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat1 */ \
816 MV(CP(USBB1_ULPITLL_DAT2) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat2 */ \
817 MV(CP(USBB1_ULPITLL_DAT3) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat3 */ \
818 MV(CP(USBB1_ULPITLL_DAT4) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat4 */ \
819 MV(CP(USBB1_ULPITLL_DAT5) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat5 */ \
820 MV(CP(USBB1_ULPITLL_DAT6) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat6 */ \
821 MV(CP(USBB1_ULPITLL_DAT7) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat7 */ \
822 MV(CP(USBB1_HSIC_DATA) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usbb1_hsic_data */ \
823 MV(CP(USBB1_HSIC_STROBE) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usbb1_hsic_strobe */ \
824 MV(CP(USBC1_ICUSB_DP) , ( IEN | M0)) /* usbc1_icusb_dp */ \
825 MV(CP(USBC1_ICUSB_DM) , ( IEN | M0)) /* usbc1_icusb_dm */ \
826 MV(CP(SDMMC1_CLK) , ( PTU | OFF_EN | OFF_OUT_PTD | M0)) /* sdmmc1_clk */ \
827 MV(CP(SDMMC1_CMD) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_cmd */ \
828 MV(CP(SDMMC1_DAT0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat0 */ \
829 MV(CP(SDMMC1_DAT1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat1 */ \
830 MV(CP(SDMMC1_DAT2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat2 */ \
831 MV(CP(SDMMC1_DAT3) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat3 */ \
832 MV(CP(SDMMC1_DAT4) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat4 */ \
833 MV(CP(SDMMC1_DAT5) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat5 */ \
834 MV(CP(SDMMC1_DAT6) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat6 */ \
835 MV(CP(SDMMC1_DAT7) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat7 */ \
836 MV(CP(ABE_MCBSP2_CLKX) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp2_clkx */ \
837 MV(CP(ABE_MCBSP2_DR) , ( IEN | OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp2_dr */ \
838 MV(CP(ABE_MCBSP2_DX) , ( OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp2_dx */ \
839 MV(CP(ABE_MCBSP2_FSX) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp2_fsx */ \
840 MV(CP(ABE_MCBSP1_CLKX) , ( IEN | M1)) /* abe_slimbus1_clock */ \
841 MV(CP(ABE_MCBSP1_DR) , ( IEN | M1)) /* abe_slimbus1_data */ \
842 MV(CP(ABE_MCBSP1_DX) , ( OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp1_dx */ \
843 MV(CP(ABE_MCBSP1_FSX) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp1_fsx */ \
844 MV(CP(ABE_PDM_UL_DATA) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_pdm_ul_data */ \
845 MV(CP(ABE_PDM_DL_DATA) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_pdm_dl_data */ \
846 MV(CP(ABE_PDM_FRAME) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_pdm_frame */ \
847 MV(CP(ABE_PDM_LB_CLK) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_pdm_lb_clk */ \
848 MV(CP(ABE_CLKS) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_clks */ \
849 MV(CP(ABE_DMIC_CLK1) , ( M0)) /* abe_dmic_clk1 */ \
850 MV(CP(ABE_DMIC_DIN1) , ( IEN | M0)) /* abe_dmic_din1 */ \
851 MV(CP(ABE_DMIC_DIN2) , ( IEN | M0)) /* abe_dmic_din2 */ \
852 MV(CP(ABE_DMIC_DIN3) , ( IEN | M0)) /* abe_dmic_din3 */ \
853 MV(CP(UART2_CTS) , ( PTU | IEN | M0)) /* uart2_cts */ \
854 MV(CP(UART2_RTS) , ( M0)) /* uart2_rts */ \
855 MV(CP(UART2_RX) , ( PTU | IEN | M0)) /* uart2_rx */ \
856 MV(CP(UART2_TX) , ( M0)) /* uart2_tx */ \
857 MV(CP(HDQ_SIO) , ( M3)) /* gpio_127 */ \
858 MV(CP(I2C1_SCL) , ( PTU | IEN | M0)) /* i2c1_scl */ \
859 MV(CP(I2C1_SDA) , ( PTU | IEN | M0)) /* i2c1_sda */ \
860 MV(CP(I2C2_SCL) , ( PTU | IEN | M0)) /* i2c2_scl */ \
861 MV(CP(I2C2_SDA) , ( PTU | IEN | M0)) /* i2c2_sda */ \
862 MV(CP(I2C3_SCL) , ( PTU | IEN | M0)) /* i2c3_scl */ \
863 MV(CP(I2C3_SDA) , ( PTU | IEN | M0)) /* i2c3_sda */ \
864 MV(CP(I2C4_SCL) , ( PTU | IEN | M0)) /* i2c4_scl */ \
865 MV(CP(I2C4_SDA) , ( PTU | IEN | M0)) /* i2c4_sda */ \
866 MV(CP(MCSPI1_CLK) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_clk */ \
867 MV(CP(MCSPI1_SOMI) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_somi */ \
868 MV(CP(MCSPI1_SIMO) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_simo */ \
869 MV(CP(MCSPI1_CS0) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_cs0 */ \
870 MV(CP(MCSPI1_CS1) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* mcspi1_cs1 */ \
871 MV(CP(MCSPI1_CS2) , ( PTU | OFF_EN | OFF_OUT_PTU | M3)) /* gpio_139 */ \
872 MV(CP(MCSPI1_CS3) , ( PTU | IEN | M3)) /* gpio_140 */ \
873 MV(CP(UART3_CTS_RCTX) , ( PTU | IEN | M0)) /* uart3_tx */ \
874 MV(CP(UART3_RTS_SD) , ( M0)) /* uart3_rts_sd */ \
875 MV(CP(UART3_RX_IRRX) , ( IEN | M0)) /* uart3_rx */ \
876 MV(CP(UART3_TX_IRTX) , ( M0)) /* uart3_tx */ \
877 MV(CP(SDMMC5_CLK) , ( PTU | IEN | OFF_EN | OFF_OUT_PTD | M0)) /* sdmmc5_clk */ \
878 MV(CP(SDMMC5_CMD) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_cmd */ \
879 MV(CP(SDMMC5_DAT0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat0 */ \
880 MV(CP(SDMMC5_DAT1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat1 */ \
881 MV(CP(SDMMC5_DAT2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat2 */ \
882 MV(CP(SDMMC5_DAT3) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat3 */ \
883 MV(CP(MCSPI4_CLK) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_clk */ \
884 MV(CP(MCSPI4_SIMO) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_simo */ \
885 MV(CP(MCSPI4_SOMI) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_somi */ \
886 MV(CP(MCSPI4_CS0) , ( PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_cs0 */ \
887 MV(CP(UART4_RX) , ( IEN | M0)) /* uart4_rx */ \
888 MV(CP(UART4_TX) , ( M0)) /* uart4_tx */ \
889 MV(CP(USBB2_ULPITLL_CLK) , ( IEN | M3)) /* gpio_157 */ \
890 MV(CP(USBB2_ULPITLL_STP) , ( IEN | M5)) /* dispc2_data23 */ \
891 MV(CP(USBB2_ULPITLL_DIR) , ( IEN | M5)) /* dispc2_data22 */ \
892 MV(CP(USBB2_ULPITLL_NXT) , ( IEN | M5)) /* dispc2_data21 */ \
893 MV(CP(USBB2_ULPITLL_DAT0) , ( IEN | M5)) /* dispc2_data20 */ \
894 MV(CP(USBB2_ULPITLL_DAT1) , ( IEN | M5)) /* dispc2_data19 */ \
895 MV(CP(USBB2_ULPITLL_DAT2) , ( IEN | M5)) /* dispc2_data18 */ \
896 MV(CP(USBB2_ULPITLL_DAT3) , ( IEN | M5)) /* dispc2_data15 */ \
897 MV(CP(USBB2_ULPITLL_DAT4) , ( IEN | M5)) /* dispc2_data14 */ \
898 MV(CP(USBB2_ULPITLL_DAT5) , ( IEN | M5)) /* dispc2_data13 */ \
899 MV(CP(USBB2_ULPITLL_DAT6) , ( IEN | M5)) /* dispc2_data12 */ \
900 MV(CP(USBB2_ULPITLL_DAT7) , ( IEN | M5)) /* dispc2_data11 */ \
901 MV(CP(USBB2_HSIC_DATA) , ( PTD | OFF_EN | OFF_OUT_PTU | M3)) /* gpio_169 */ \
902 MV(CP(USBB2_HSIC_STROBE) , ( PTD | OFF_EN | OFF_OUT_PTU | M3)) /* gpio_170 */ \
903 MV(CP(UNIPRO_TX0) , ( PTD | IEN | M3)) /* gpio_171 */ \
904 MV(CP(UNIPRO_TY0) , ( OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col1 */ \
905 MV(CP(UNIPRO_TX1) , ( OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col2 */ \
906 MV(CP(UNIPRO_TY1) , ( OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col3 */ \
907 MV(CP(UNIPRO_TX2) , ( PTU | IEN | M3)) /* gpio_0 */ \
908 MV(CP(UNIPRO_TY2) , ( PTU | IEN | M3)) /* gpio_1 */ \
909 MV(CP(UNIPRO_RX0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row0 */ \
910 MV(CP(UNIPRO_RY0) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row1 */ \
911 MV(CP(UNIPRO_RX1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row2 */ \
912 MV(CP(UNIPRO_RY1) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row3 */ \
913 MV(CP(UNIPRO_RX2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row4 */ \
914 MV(CP(UNIPRO_RY2) , ( PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row5 */ \
915 MV(CP(USBA0_OTG_CE) , ( PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* usba0_otg_ce */ \
916 MV(CP(USBA0_OTG_DP) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usba0_otg_dp */ \
917 MV(CP(USBA0_OTG_DM) , ( IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usba0_otg_dm */ \
918 MV(CP(FREF_CLK1_OUT) , ( M0)) /* fref_clk1_out */ \
919 MV(CP(FREF_CLK2_OUT) , ( PTD | IEN | M3)) /* gpio_182 */ \
920 MV(CP(SYS_NIRQ1) , ( PTU | IEN | M0)) /* sys_nirq1 */ \
921 MV(CP(SYS_NIRQ2) , ( PTU | IEN | M0)) /* sys_nirq2 */ \
922 MV(CP(SYS_BOOT0) , ( PTU | IEN | M3)) /* gpio_184 */ \
923 MV(CP(SYS_BOOT1) , ( M3)) /* gpio_185 */ \
924 MV(CP(SYS_BOOT2) , ( PTD | IEN | M3)) /* gpio_186 */ \
925 MV(CP(SYS_BOOT3) , ( M3)) /* gpio_187 */ \
926 MV(CP(SYS_BOOT4) , ( M3)) /* gpio_188 */ \
927 MV(CP(SYS_BOOT5) , ( PTD | IEN | M3)) /* gpio_189 */ \
928 MV(CP(DPM_EMU0) , ( IEN | M0)) /* dpm_emu0 */ \
929 MV(CP(DPM_EMU1) , ( IEN | M0)) /* dpm_emu1 */ \
930 MV(CP(DPM_EMU2) , ( IEN | M0)) /* dpm_emu2 */ \
931 MV(CP(DPM_EMU3) , ( IEN | M5)) /* dispc2_data10 */ \
932 MV(CP(DPM_EMU4) , ( IEN | M5)) /* dispc2_data9 */ \
933 MV(CP(DPM_EMU5) , ( IEN | M5)) /* dispc2_data16 */ \
934 MV(CP(DPM_EMU6) , ( IEN | M5)) /* dispc2_data17 */ \
935 MV(CP(DPM_EMU7) , ( IEN | M5)) /* dispc2_hsync */ \
936 MV(CP(DPM_EMU8) , ( IEN | M5)) /* dispc2_pclk */ \
937 MV(CP(DPM_EMU9) , ( IEN | M5)) /* dispc2_vsync */ \
938 MV(CP(DPM_EMU10) , ( IEN | M5)) /* dispc2_de */ \
939 MV(CP(DPM_EMU11) , ( IEN | M5)) /* dispc2_data8 */ \
940 MV(CP(DPM_EMU12) , ( IEN | M5)) /* dispc2_data7 */ \
941 MV(CP(DPM_EMU13) , ( IEN | M5)) /* dispc2_data6 */ \
942 MV(CP(DPM_EMU14) , ( IEN | M5)) /* dispc2_data5 */ \
943 MV(CP(DPM_EMU15) , ( IEN | M5)) /* dispc2_data4 */ \
944 MV(CP(DPM_EMU16) , ( M3)) /* gpio_27 */ \
945 MV(CP(DPM_EMU17) , ( IEN | M5)) /* dispc2_data2 */ \
946 MV(CP(DPM_EMU18) , ( IEN | M5)) /* dispc2_data1 */ \
947 MV(CP(DPM_EMU19) , ( IEN | M5)) /* dispc2_data0 */ \
948 MV1(WK(PAD0_SIM_IO) , ( IEN | M0)) /* sim_io */ \
949 MV1(WK(PAD1_SIM_CLK) , ( M0)) /* sim_clk */ \
950 MV1(WK(PAD0_SIM_RESET) , ( M0)) /* sim_reset */ \
951 MV1(WK(PAD1_SIM_CD) , ( PTU | IEN | M0)) /* sim_cd */ \
952 MV1(WK(PAD0_SIM_PWRCTRL) , ( M0)) /* sim_pwrctrl */ \
953 MV1(WK(PAD1_SR_SCL) , ( PTU | IEN | M0)) /* sr_scl */ \
954 MV1(WK(PAD0_SR_SDA) , ( PTU | IEN | M0)) /* sr_sda */ \
955 MV1(WK(PAD1_FREF_XTAL_IN) , ( M0)) /* # */ \
956 MV1(WK(PAD0_FREF_SLICER_IN) , ( M0)) /* fref_slicer_in */ \
957 MV1(WK(PAD1_FREF_CLK_IOREQ) , ( M0)) /* fref_clk_ioreq */ \
958 MV1(WK(PAD0_FREF_CLK0_OUT) , ( M2)) /* sys_drm_msecure */ \
959 MV1(WK(PAD1_FREF_CLK3_REQ) , ( PTU | IEN | M0)) /* # */ \
960 MV1(WK(PAD0_FREF_CLK3_OUT) , ( M0)) /* fref_clk3_out */ \
961 MV1(WK(PAD1_FREF_CLK4_REQ) , ( PTU | IEN | M0)) /* # */ \
962 MV1(WK(PAD0_FREF_CLK4_OUT) , ( M0)) /* # */ \
963 MV1(WK(PAD1_SYS_32K) , ( IEN | M0)) /* sys_32k */ \
964 MV1(WK(PAD0_SYS_NRESPWRON) , ( M0)) /* sys_nrespwron */ \
965 MV1(WK(PAD1_SYS_NRESWARM) , ( M0)) /* sys_nreswarm */ \
966 MV1(WK(PAD0_SYS_PWR_REQ) , ( PTU | M0)) /* sys_pwr_req */ \
967 MV1(WK(PAD1_SYS_PWRON_RESET) , ( M3)) /* gpio_wk29 */ \
968 MV1(WK(PAD0_SYS_BOOT6) , ( IEN | M3)) /* gpio_wk9 */ \
969 MV1(WK(PAD1_SYS_BOOT7) , ( IEN | M3)) /* gpio_wk10 */ \
970 MV1(WK(PAD1_FREF_CLK3_REQ), (M3)) /* gpio_wk30 */ \
971 MV1(WK(PAD1_FREF_CLK4_REQ), (M3)) /* gpio_wk7 */ \
972 MV1(WK(PAD0_FREF_CLK4_OUT), (M3)) /* gpio_wk8 */
974 #define MUX_DEFAULT_OMAP4_ALL() \
975 MV(CP(GPMC_AD0), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat0 */ \
976 MV(CP(GPMC_AD1), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat1 */ \
977 MV(CP(GPMC_AD2), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat2 */ \
978 MV(CP(GPMC_AD3), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat3 */ \
979 MV(CP(GPMC_AD4), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat4 */ \
980 MV(CP(GPMC_AD5), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat5 */ \
981 MV(CP(GPMC_AD6), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat6 */ \
982 MV(CP(GPMC_AD7), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_dat7 */ \
983 MV(CP(GPMC_AD8), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpio_32 */ \
984 MV(CP(GPMC_AD9), (M3_SAFE)) /* gpio_33 */ \
985 MV(CP(GPMC_AD10), (M3_SAFE)) /* gpio_34 */ \
986 MV(CP(GPMC_AD11), (M3_SAFE)) /* gpio_35 */ \
987 MV(CP(GPMC_AD12), (M3_SAFE)) /* gpio_36 */ \
988 MV(CP(GPMC_AD13), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_37 */ \
989 MV(CP(GPMC_AD14), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_38 */ \
990 MV(CP(GPMC_AD15), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_39 */ \
991 MV(CP(GPMC_A16), (M3_SAFE)) /* gpio_40 */ \
992 MV(CP(GPMC_A17), (M3_SAFE)) /* gpio_41 */ \
993 MV(CP(GPMC_A18), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row6 */ \
994 MV(CP(GPMC_A19), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row7 */ \
995 MV(CP(GPMC_A20), (M3_SAFE)) /* gpio_44 */ \
996 MV(CP(GPMC_A21), (M3_SAFE)) /* gpio_45 */ \
997 MV(CP(GPMC_A22), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col6 */ \
998 MV(CP(GPMC_A23), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col7 */ \
999 MV(CP(GPMC_A24), (M3_SAFE)) /* gpio_48 */ \
1000 MV(CP(GPMC_A25), (M3_SAFE)) /* gpio_49 */ \
1001 MV(CP(GPMC_NCS0), (M0)) /* gpmc_ncs0 */ \
1002 MV(CP(GPMC_NCS1), (M3_SAFE)) /* gpio_51 */ \
1003 MV(CP(GPMC_NCS2), (M3_SAFE)) /* gpio_52 */ \
1004 MV(CP(GPMC_NCS3), (M3_SAFE)) /* gpio_53 */ \
1005 MV(CP(GPMC_NWP), (M0_SAFE)) /* gpmc_nwp */ \
1006 MV(CP(GPMC_CLK), (M3_SAFE)) /* gpio_55 */ \
1007 MV(CP(GPMC_NADV_ALE), (M0)) /* gpmc_nadv_ale */ \
1008 MV(CP(GPMC_NOE), (PTU | OFF_EN | OFF_OUT_PTD | M1)) /* sdmmc2_clk */ \
1009 MV(CP(GPMC_NWE), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* sdmmc2_cmd */ \
1010 MV(CP(GPMC_NBE0_CLE), (M0)) /* gpmc_nbe0_cle*/ \
1011 MV(CP(GPMC_NBE1), (M3_SAFE)) /* gpio_60 */ \
1012 MV(CP(GPMC_WAIT0), (M0)) /* gpmc_wait */ \
1013 MV(CP(GPMC_WAIT1), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_39 */ \
1014 MV(CP(C2C_DATA11), (M3_SAFE)) /* gpio_100 */ \
1015 MV(CP(C2C_DATA12), (M1_SAFE)) /* dsi1_te0 */ \
1016 MV(CP(C2C_DATA13), (M3_SAFE)) /* gpio_102 */ \
1017 MV(CP(C2C_DATA14), (M1_SAFE)) /* dsi2_te0 */ \
1018 MV(CP(C2C_DATA15), (M3_SAFE)) /* gpio_104 */ \
1019 MV(CP(HDMI_HPD), (M0_SAFE)) /* hdmi_hpd */ \
1020 MV(CP(HDMI_CEC), (M0_SAFE)) /* hdmi_cec */ \
1021 MV(CP(HDMI_DDC_SCL), (M0_SAFE)) /* hdmi_ddc_scl */ \
1022 MV(CP(HDMI_DDC_SDA), (M0_SAFE)) /* hdmi_ddc_sda */ \
1023 MV(CP(CSI21_DX0), (M0_SAFE)) /* csi21_dx0 */ \
1024 MV(CP(CSI21_DY0), (M0_SAFE)) /* csi21_dy0 */ \
1025 MV(CP(CSI21_DX1), (M0_SAFE)) /* csi21_dx1 */ \
1026 MV(CP(CSI21_DY1), (M0_SAFE)) /* csi21_dy1 */ \
1027 MV(CP(CSI21_DX2), (M0_SAFE)) /* csi21_dx2 */ \
1028 MV(CP(CSI21_DY2), (M0_SAFE)) /* csi21_dy2 */ \
1029 MV(CP(CSI21_DX3), (M0_SAFE)) /* csi21_dx3 */ \
1030 MV(CP(CSI21_DY3), (M0_SAFE)) /* csi21_dy3 */ \
1031 MV(CP(CSI21_DX4), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpi_75 */ \
1032 MV(CP(CSI21_DY4), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpi_76 */ \
1033 MV(CP(CSI22_DX0), (M0_SAFE)) /* csi22_dx0 */ \
1034 MV(CP(CSI22_DY0), (M0_SAFE)) /* csi22_dy0 */ \
1035 MV(CP(CSI22_DX1), (M0_SAFE)) /* csi22_dx1 */ \
1036 MV(CP(CSI22_DY1), (M0_SAFE)) /* csi22_dy1 */ \
1037 MV(CP(CAM_SHUTTER), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* cam_shutter */ \
1038 MV(CP(CAM_STROBE), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* cam_strobe */ \
1039 MV(CP(CAM_GLOBALRESET), (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)) /* gpio_83 */ \
1040 MV(CP(USBB1_ULPITLL_CLK), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_clk */ \
1041 MV(CP(USBB1_ULPITLL_STP), (PTU | OFF_EN | OFF_OUT_PTD | M4)) /* usbb1_ulpiphy_stp */ \
1042 MV(CP(USBB1_ULPITLL_DIR), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dir */ \
1043 MV(CP(USBB1_ULPITLL_NXT), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_nxt */ \
1044 MV(CP(USBB1_ULPITLL_DAT0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat0 */ \
1045 MV(CP(USBB1_ULPITLL_DAT1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat1 */ \
1046 MV(CP(USBB1_ULPITLL_DAT2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat2 */ \
1047 MV(CP(USBB1_ULPITLL_DAT3), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat3 */ \
1048 MV(CP(USBB1_ULPITLL_DAT4), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat4 */ \
1049 MV(CP(USBB1_ULPITLL_DAT5), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat5 */ \
1050 MV(CP(USBB1_ULPITLL_DAT6), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat6 */ \
1051 MV(CP(USBB1_ULPITLL_DAT7), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)) /* usbb1_ulpiphy_dat7 */ \
1052 MV(CP(USBB1_HSIC_DATA), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usbb1_hsic_data */ \
1053 MV(CP(USBB1_HSIC_STROBE), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usbb1_hsic_strobe */ \
1054 MV(CP(USBC1_ICUSB_DP), (M0_SAFE)) /* usbc1_icusb_dp */ \
1055 MV(CP(USBC1_ICUSB_DM), (M0_SAFE)) /* usbc1_icusb_dm */ \
1056 MV(CP(SDMMC1_CLK), (PTU | OFF_EN | OFF_OUT_PTD | M0)) /* sdmmc1_clk */ \
1057 MV(CP(SDMMC1_CMD), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_cmd */ \
1058 MV(CP(SDMMC1_DAT0), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat0 */ \
1059 MV(CP(SDMMC1_DAT1), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat1 */ \
1060 MV(CP(SDMMC1_DAT2), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat2 */ \
1061 MV(CP(SDMMC1_DAT3), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat3 */ \
1062 MV(CP(SDMMC1_DAT4), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat4 */ \
1063 MV(CP(SDMMC1_DAT5), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat5 */ \
1064 MV(CP(SDMMC1_DAT6), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat6 */ \
1065 MV(CP(SDMMC1_DAT7), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc1_dat7 */ \
1066 MV(CP(ABE_MCBSP2_CLKX), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp2_clkx */ \
1067 MV(CP(ABE_MCBSP2_DR), (IEN | OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp2_dr */ \
1068 MV(CP(ABE_MCBSP2_DX), (OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp2_dx */ \
1069 MV(CP(ABE_MCBSP2_FSX), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp2_fsx */ \
1070 MV(CP(ABE_MCBSP1_CLKX), (M1_SAFE)) /* abe_slimbus1_clock */ \
1071 MV(CP(ABE_MCBSP1_DR), (M1_SAFE)) /* abe_slimbus1_data */ \
1072 MV(CP(ABE_MCBSP1_DX), (OFF_EN | OFF_OUT_PTD | M0)) /* abe_mcbsp1_dx */ \
1073 MV(CP(ABE_MCBSP1_FSX), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* abe_mcbsp1_fsx */ \
1074 MV(CP(ABE_PDM_UL_DATA), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_pdm_ul_data */ \
1075 MV(CP(ABE_PDM_DL_DATA), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_pdm_dl_data */ \
1076 MV(CP(ABE_PDM_FRAME), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_pdm_frame */ \
1077 MV(CP(ABE_PDM_LB_CLK), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_pdm_lb_clk */ \
1078 MV(CP(ABE_CLKS), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* abe_clks */ \
1079 MV(CP(ABE_DMIC_CLK1), (M0_SAFE)) /* abe_dmic_clk1 */ \
1080 MV(CP(ABE_DMIC_DIN1), (M0_SAFE)) /* abe_dmic_din1 */ \
1081 MV(CP(ABE_DMIC_DIN2), (M0_SAFE)) /* abe_dmic_din2 */ \
1082 MV(CP(ABE_DMIC_DIN3), (M0_SAFE)) /* abe_dmic_din3 */ \
1083 MV(CP(UART2_CTS), (PTU | IEN | M0)) /* uart2_cts */ \
1084 MV(CP(UART2_RTS), (M0)) /* uart2_rts */ \
1085 MV(CP(UART2_RX), (PTU | IEN | M0)) /* uart2_rx */ \
1086 MV(CP(UART2_TX), (M0)) /* uart2_tx */ \
1087 MV(CP(HDQ_SIO), (M3_SAFE)) /* gpio_127 */ \
1088 MV(CP(I2C1_SCL), (PTU | IEN | M0)) /* i2c1_scl */ \
1089 MV(CP(I2C1_SDA), (PTU | IEN | M0)) /* i2c1_sda */ \
1090 MV(CP(I2C2_SCL), (PTU | IEN | M0)) /* i2c2_scl */ \
1091 MV(CP(I2C2_SDA), (PTU | IEN | M0)) /* i2c2_sda */ \
1092 MV(CP(I2C3_SCL), (PTU | IEN | M0)) /* i2c3_scl */ \
1093 MV(CP(I2C3_SDA), (PTU | IEN | M0)) /* i2c3_sda */ \
1094 MV(CP(I2C4_SCL), (PTU | IEN | M0)) /* i2c4_scl */ \
1095 MV(CP(I2C4_SDA), (PTU | IEN | M0)) /* i2c4_sda */ \
1096 MV(CP(MCSPI1_CLK), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_clk */ \
1097 MV(CP(MCSPI1_SOMI), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_somi */ \
1098 MV(CP(MCSPI1_SIMO), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_simo */ \
1099 MV(CP(MCSPI1_CS0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi1_cs0 */ \
1100 MV(CP(MCSPI1_CS1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0_SAFE)) /* mcspi1_cs1 */ \
1101 MV(CP(MCSPI1_CS2), (OFF_EN | OFF_OUT_PTU | M3)) /* gpio_139 */ \
1102 MV(CP(MCSPI1_CS3), (M3_SAFE)) /* gpio_140 */ \
1103 MV(CP(UART3_CTS_RCTX), (PTU | IEN | M0)) /* uart3_tx */ \
1104 MV(CP(UART3_RTS_SD), (M0)) /* uart3_rts_sd */ \
1105 MV(CP(UART3_RX_IRRX), (IEN | M0)) /* uart3_rx */ \
1106 MV(CP(UART3_TX_IRTX), (M0)) /* uart3_tx */ \
1107 MV(CP(SDMMC5_CLK), (PTU | OFF_EN | OFF_OUT_PTD | M0)) /* sdmmc5_clk */ \
1108 MV(CP(SDMMC5_CMD), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_cmd */ \
1109 MV(CP(SDMMC5_DAT0), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat0 */ \
1110 MV(CP(SDMMC5_DAT1), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat1 */ \
1111 MV(CP(SDMMC5_DAT2), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat2 */ \
1112 MV(CP(SDMMC5_DAT3), (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* sdmmc5_dat3 */ \
1113 MV(CP(MCSPI4_CLK), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_clk */ \
1114 MV(CP(MCSPI4_SIMO), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_simo */ \
1115 MV(CP(MCSPI4_SOMI), (IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_somi */ \
1116 MV(CP(MCSPI4_CS0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* mcspi4_cs0 */ \
1117 MV(CP(UART4_RX), (IEN | M0)) /* uart4_rx */ \
1118 MV(CP(UART4_TX), (M0)) /* uart4_tx */ \
1119 MV(CP(USBB2_ULPITLL_CLK), (M3)) /* gpio_157 */ \
1120 MV(CP(USBB2_ULPITLL_STP), (M5)) /* dispc2_data23 */ \
1121 MV(CP(USBB2_ULPITLL_DIR), (M5)) /* dispc2_data22 */ \
1122 MV(CP(USBB2_ULPITLL_NXT), (M5)) /* dispc2_data21 */ \
1123 MV(CP(USBB2_ULPITLL_DAT0), (M5)) /* dispc2_data20 */ \
1124 MV(CP(USBB2_ULPITLL_DAT1), (M5)) /* dispc2_data19 */ \
1125 MV(CP(USBB2_ULPITLL_DAT2), (M5)) /* dispc2_data18 */ \
1126 MV(CP(USBB2_ULPITLL_DAT3), (M5)) /* dispc2_data15 */ \
1127 MV(CP(USBB2_ULPITLL_DAT4), (M5)) /* dispc2_data14 */ \
1128 MV(CP(USBB2_ULPITLL_DAT5), (M5)) /* dispc2_data13 */ \
1129 MV(CP(USBB2_ULPITLL_DAT6), (M5)) /* dispc2_data12 */ \
1130 MV(CP(USBB2_ULPITLL_DAT7), (M5)) /* dispc2_data11 */ \
1131 MV(CP(USBB2_HSIC_DATA), (OFF_EN | OFF_OUT_PTU | M3)) /* gpio_169 */ \
1132 MV(CP(USBB2_HSIC_STROBE), (OFF_EN | OFF_OUT_PTU | M3)) /* gpio_170 */ \
1133 MV(CP(UNIPRO_TX0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col0 */ \
1134 MV(CP(UNIPRO_TY0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col1 */ \
1135 MV(CP(UNIPRO_TX1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col2 */ \
1136 MV(CP(UNIPRO_TY1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_col3 */ \
1137 MV(CP(UNIPRO_TX2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpio_0 */ \
1138 MV(CP(UNIPRO_TY2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M3)) /* gpio_1 */ \
1139 MV(CP(UNIPRO_RX0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row0 */ \
1140 MV(CP(UNIPRO_RY0), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row1 */ \
1141 MV(CP(UNIPRO_RX1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row2 */ \
1142 MV(CP(UNIPRO_RY1), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row3 */ \
1143 MV(CP(UNIPRO_RX2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row4 */ \
1144 MV(CP(UNIPRO_RY2), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M1)) /* kpd_row5 */ \
1145 MV(CP(USBA0_OTG_CE), (PTU | OFF_EN | OFF_PD | OFF_OUT_PTD | M0)) /* usba0_otg_ce */ \
1146 MV(CP(USBA0_OTG_DP), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usba0_otg_dp */ \
1147 MV(CP(USBA0_OTG_DM), (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M0)) /* usba0_otg_dm */ \
1148 MV(CP(FREF_CLK1_OUT), (M0_SAFE)) /* fref_clk1_out */ \
1149 MV(CP(FREF_CLK2_OUT), (M0_SAFE)) /* fref_clk2_out */ \
1150 MV(CP(SYS_NIRQ1), (PTU | IEN | M0)) /* sys_nirq1 */ \
1151 MV(CP(SYS_NIRQ2), (PTU | IEN | M0)) /* sys_nirq2 */ \
1152 MV(CP(SYS_BOOT0), (M3_SAFE)) /* gpio_184 */ \
1153 MV(CP(SYS_BOOT1), (M3_SAFE)) /* gpio_185 */ \
1154 MV(CP(SYS_BOOT2), (M3_SAFE)) /* gpio_186 */ \
1155 MV(CP(SYS_BOOT3), (M3_SAFE)) /* gpio_187 */ \
1156 MV(CP(SYS_BOOT4), (M3_SAFE)) /* gpio_188 */ \
1157 MV(CP(SYS_BOOT5), (M3_SAFE)) /* gpio_189 */ \
1158 MV(CP(DPM_EMU0), (M0_SAFE)) /* dpm_emu0 */ \
1159 MV(CP(DPM_EMU1), (M0_SAFE)) /* dpm_emu1 */ \
1160 MV(CP(DPM_EMU2), (M0_SAFE)) /* dpm_emu2 */ \
1161 MV(CP(DPM_EMU3), (M5)) /* dispc2_data10 */ \
1162 MV(CP(DPM_EMU4), (M5)) /* dispc2_data9 */ \
1163 MV(CP(DPM_EMU5), (M5)) /* dispc2_data16 */ \
1164 MV(CP(DPM_EMU6), (M5)) /* dispc2_data17 */ \
1165 MV(CP(DPM_EMU7), (M5)) /* dispc2_hsync */ \
1166 MV(CP(DPM_EMU8), (M5)) /* dispc2_pclk */ \
1167 MV(CP(DPM_EMU9), (M5)) /* dispc2_vsync */ \
1168 MV(CP(DPM_EMU10), (M5)) /* dispc2_de */ \
1169 MV(CP(DPM_EMU11), (M5)) /* dispc2_data8 */ \
1170 MV(CP(DPM_EMU12), (M5)) /* dispc2_data7 */ \
1171 MV(CP(DPM_EMU13), (M5)) /* dispc2_data6 */ \
1172 MV(CP(DPM_EMU14), (M5)) /* dispc2_data5 */ \
1173 MV(CP(DPM_EMU15), (M5)) /* dispc2_data4 */ \
1174 MV(CP(DPM_EMU16), (M5)) /* dispc2_data3/dmtimer8_pwm_evt */ \
1175 MV(CP(DPM_EMU17), (M5)) /* dispc2_data2 */ \
1176 MV(CP(DPM_EMU18), (M5)) /* dispc2_data1 */ \
1177 MV(CP(DPM_EMU19), (M5)) /* dispc2_data0 */ \
1178 MV1(WK(PAD0_SIM_IO), (M0_SAFE)) /* sim_io */ \
1179 MV1(WK(PAD1_SIM_CLK), (M0_SAFE)) /* sim_clk */ \
1180 MV1(WK(PAD0_SIM_RESET), (M0_SAFE)) /* sim_reset */ \
1181 MV1(WK(PAD1_SIM_CD), (M0_SAFE)) /* sim_cd */ \
1182 MV1(WK(PAD0_SIM_PWRCTRL), (M0_SAFE)) /* sim_pwrctrl */ \
1183 MV1(WK(PAD1_SR_SCL), (PTU | IEN | M0)) /* sr_scl */ \
1184 MV1(WK(PAD0_SR_SDA), (PTU | IEN | M0)) /* sr_sda */ \
1185 MV1(WK(PAD1_FREF_XTAL_IN), (M0_SAFE)) /* # */ \
1186 MV1(WK(PAD0_FREF_SLICER_IN), (M0_SAFE)) /* fref_slicer_in */ \
1187 MV1(WK(PAD1_FREF_CLK_IOREQ), (M0_SAFE)) /* fref_clk_ioreq */ \
1188 MV1(WK(PAD0_FREF_CLK0_OUT), (M0)) /* sys_drm_msecure */ \
1189 MV1(WK(PAD1_FREF_CLK3_REQ), (M0)) /* # */ \
1190 MV1(WK(PAD0_FREF_CLK3_OUT), (M0_SAFE)) /* fref_clk3_out */ \
1191 MV1(WK(PAD1_FREF_CLK4_REQ), (M0_SAFE)) /* # */ \
1192 MV1(WK(PAD0_FREF_CLK4_OUT), (M0_SAFE)) /* # */ \
1193 MV1(WK(PAD1_SYS_32K), (IEN | M0_SAFE)) /* sys_32k */ \
1194 MV1(WK(PAD0_SYS_NRESPWRON), (IEN | M0_SAFE)) /* sys_nrespwron */ \
1195 MV1(WK(PAD1_SYS_NRESWARM), (IEN | M0_SAFE)) /* sys_nreswarm */ \
1196 MV1(WK(PAD0_SYS_PWR_REQ), (M0_SAFE)) /* sys_pwr_req */ \
1197 MV1(WK(PAD1_SYS_PWRON_RESET), (M3_SAFE)) /* gpio_wk29 */ \
1198 MV1(WK(PAD0_SYS_BOOT6), (M3_SAFE)) /* gpio_wk9 */ \
1199 MV1(WK(PAD1_SYS_BOOT7), (M3_SAFE)) /* gpio_wk10 */ \
1200 MV1(WK(PAD1_JTAG_TCK), (IEN | M0)) /* jtag_tck */ \
1201 MV1(WK(PAD0_JTAG_RTCK), (M0)) /* jtag_rtck */ \
1202 MV1(WK(PAD1_JTAG_TMS_TMSC), (IEN | M0)) /* jtag_tms_tmsc */ \
1203 MV1(WK(PAD0_JTAG_TDI), (IEN | M0)) /* jtag_tdi */ \
1204 MV1(WK(PAD1_JTAG_TDO), (M0)) /* jtag_tdo */
1206 /**********************************************************
1207 * Routine: set_muxconf_regs
1208 * Description: Setting up the configuration Mux registers
1209 * specific to the hardware. Many pins need
1210 * to be moved from protect to primary mode.
1211 *********************************************************/
1212 void set_muxconf_regs(void)
1214 MUX_DEFAULT_OMAP4();
1218 /******************************************************************************
1219 * Routine: update_mux()
1220 * Description:Update balls which are different between boards. All should be
1221 * updated to match functionality. However, I'm only updating ones
1222 * which I'll be using for now. When power comes into play they
1223 * all need updating.
1224 *****************************************************************************/
1225 void update_mux(u32 btype, u32 mtype)
1232 /* optionally do something like blinking LED */
1233 void board_hang(void)
1243 void reset_phy(unsigned int base)
1245 *(volatile int*)(base + IODFT_TLGC) |= (1 << 10);