Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Board specific setup info |
| 3 | * |
| 4 | * (C) Copyright 2008 |
| 5 | * Texas Instruments, <www.ti.com> |
| 6 | * |
| 7 | * Initial Code by: |
| 8 | * Richard Woodruff <r-woodruff2@ti.com> |
| 9 | * Syed Mohammed Khasim <khasim@ti.com> |
| 10 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 11 | * SPDX-License-Identifier: GPL-2.0+ |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 12 | */ |
| 13 | |
| 14 | #include <config.h> |
| 15 | #include <version.h> |
| 16 | #include <asm/arch/mem.h> |
| 17 | #include <asm/arch/clocks_omap3.h> |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 18 | #include <linux/linkage.h> |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 19 | |
Pali Rohár | 7c3c76e | 2012-01-24 04:27:58 +0000 | [diff] [blame] | 20 | #ifdef CONFIG_SPL_BUILD |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 21 | ENTRY(save_boot_params) |
Simon Schwarz | c692fef | 2011-09-14 15:32:57 -0400 | [diff] [blame] | 22 | ldr r4, =omap3_boot_device |
| 23 | ldr r5, [r0, #0x4] |
| 24 | and r5, r5, #0xff |
| 25 | str r5, [r4] |
Simon Schwarz | c692fef | 2011-09-14 15:32:57 -0400 | [diff] [blame] | 26 | bx lr |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 27 | ENDPROC(save_boot_params) |
Pali Rohár | 7c3c76e | 2012-01-24 04:27:58 +0000 | [diff] [blame] | 28 | #endif |
Simon Schwarz | 4bfb242 | 2011-09-14 15:31:33 -0400 | [diff] [blame] | 29 | |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 30 | ENTRY(omap3_gp_romcode_call) |
Aneesh V | d16dd01 | 2011-06-16 23:30:53 +0000 | [diff] [blame] | 31 | PUSH {r4-r12, lr} @ Save all registers from ROM code! |
| 32 | MOV r12, r0 @ Copy the Service ID in R12 |
| 33 | MOV r0, r1 @ Copy parameter to R0 |
| 34 | mcr p15, 0, r0, c7, c10, 4 @ DSB |
| 35 | mcr p15, 0, r0, c7, c10, 5 @ DMB |
| 36 | .word 0xe1600070 @ SMC #0 to enter monitor - hand assembled |
| 37 | @ because we use -march=armv5 |
| 38 | POP {r4-r12, pc} |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 39 | ENDPROC(omap3_gp_romcode_call) |
Aneesh V | d16dd01 | 2011-06-16 23:30:53 +0000 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | * Funtion for making PPA HAL API calls in secure devices |
| 43 | * Input: |
| 44 | * R0 - Service ID |
| 45 | * R1 - paramer list |
| 46 | */ |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 47 | ENTRY(do_omap3_emu_romcode_call) |
Aneesh V | d16dd01 | 2011-06-16 23:30:53 +0000 | [diff] [blame] | 48 | PUSH {r4-r12, lr} @ Save all registers from ROM code! |
| 49 | MOV r12, r0 @ Copy the Secure Service ID in R12 |
| 50 | MOV r3, r1 @ Copy the pointer to va_list in R3 |
| 51 | MOV r1, #0 @ Process ID - 0 |
| 52 | MOV r2, #OMAP3_EMU_HAL_START_HAL_CRITICAL @ Copy the pointer |
| 53 | @ to va_list in R3 |
| 54 | MOV r6, #0xFF @ Indicate new Task call |
| 55 | mcr p15, 0, r0, c7, c10, 4 @ DSB |
| 56 | mcr p15, 0, r0, c7, c10, 5 @ DMB |
| 57 | .word 0xe1600071 @ SMC #1 to call PPA service - hand assembled |
| 58 | @ because we use -march=armv5 |
| 59 | POP {r4-r12, pc} |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 60 | ENDPROC(do_omap3_emu_romcode_call) |
Aneesh V | d16dd01 | 2011-06-16 23:30:53 +0000 | [diff] [blame] | 61 | |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 62 | #if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_NAND_BOOT) |
| 63 | /************************************************************************** |
| 64 | * cpy_clk_code: relocates clock code into SRAM where its safer to execute |
| 65 | * R1 = SRAM destination address. |
| 66 | *************************************************************************/ |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 67 | ENTRY(cpy_clk_code) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 68 | /* Copy DPLL code into SRAM */ |
Albert ARIBAUD | e3d0ad5 | 2013-08-10 19:03:59 +0200 | [diff] [blame] | 69 | adr r0, go_to_speed /* copy from start of go_to_speed... */ |
| 70 | adr r2, lowlevel_init /* ... up to start of low_level_init */ |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 71 | next2: |
| 72 | ldmia r0!, {r3 - r10} /* copy from source address [r0] */ |
| 73 | stmia r1!, {r3 - r10} /* copy to target address [r1] */ |
| 74 | cmp r0, r2 /* until source end address [r2] */ |
Albert ARIBAUD | e3d0ad5 | 2013-08-10 19:03:59 +0200 | [diff] [blame] | 75 | blo next2 |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 76 | mov pc, lr /* back to caller */ |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 77 | ENDPROC(cpy_clk_code) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 78 | |
| 79 | /* *************************************************************************** |
| 80 | * go_to_speed: -Moves to bypass, -Commits clock dividers, -puts dpll at speed |
| 81 | * -executed from SRAM. |
| 82 | * R0 = CM_CLKEN_PLL-bypass value |
| 83 | * R1 = CM_CLKSEL1_PLL-m, n, and divider values |
| 84 | * R2 = CM_CLKSEL_CORE-divider values |
| 85 | * R3 = CM_IDLEST_CKGEN - addr dpll lock wait |
| 86 | * |
| 87 | * Note: If core unlocks/relocks and SDRAM is running fast already it gets |
| 88 | * confused. A reset of the controller gets it back. Taking away its |
| 89 | * L3 when its not in self refresh seems bad for it. Normally, this |
| 90 | * code runs from flash before SDR is init so that should be ok. |
| 91 | ****************************************************************************/ |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 92 | ENTRY(go_to_speed) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 93 | stmfd sp!, {r4 - r6} |
| 94 | |
| 95 | /* move into fast relock bypass */ |
| 96 | ldr r4, pll_ctl_add |
| 97 | str r0, [r4] |
| 98 | wait1: |
| 99 | ldr r5, [r3] /* get status */ |
| 100 | and r5, r5, #0x1 /* isolate core status */ |
| 101 | cmp r5, #0x1 /* still locked? */ |
| 102 | beq wait1 /* if lock, loop */ |
| 103 | |
| 104 | /* set new dpll dividers _after_ in bypass */ |
| 105 | ldr r5, pll_div_add1 |
| 106 | str r1, [r5] /* set m, n, m2 */ |
| 107 | ldr r5, pll_div_add2 |
| 108 | str r2, [r5] /* set l3/l4/.. dividers*/ |
| 109 | ldr r5, pll_div_add3 /* wkup */ |
| 110 | ldr r2, pll_div_val3 /* rsm val */ |
| 111 | str r2, [r5] |
| 112 | ldr r5, pll_div_add4 /* gfx */ |
| 113 | ldr r2, pll_div_val4 |
| 114 | str r2, [r5] |
| 115 | ldr r5, pll_div_add5 /* emu */ |
| 116 | ldr r2, pll_div_val5 |
| 117 | str r2, [r5] |
| 118 | |
| 119 | /* now prepare GPMC (flash) for new dpll speed */ |
| 120 | /* flash needs to be stable when we jump back to it */ |
| 121 | ldr r5, flash_cfg3_addr |
| 122 | ldr r2, flash_cfg3_val |
| 123 | str r2, [r5] |
| 124 | ldr r5, flash_cfg4_addr |
| 125 | ldr r2, flash_cfg4_val |
| 126 | str r2, [r5] |
| 127 | ldr r5, flash_cfg5_addr |
| 128 | ldr r2, flash_cfg5_val |
| 129 | str r2, [r5] |
| 130 | ldr r5, flash_cfg1_addr |
| 131 | ldr r2, [r5] |
| 132 | orr r2, r2, #0x3 /* up gpmc divider */ |
| 133 | str r2, [r5] |
| 134 | |
| 135 | /* lock DPLL3 and wait a bit */ |
| 136 | orr r0, r0, #0x7 /* set up for lock mode */ |
| 137 | str r0, [r4] /* lock */ |
| 138 | nop /* ARM slow at this point working at sys_clk */ |
| 139 | nop |
| 140 | nop |
| 141 | nop |
| 142 | wait2: |
| 143 | ldr r5, [r3] /* get status */ |
| 144 | and r5, r5, #0x1 /* isolate core status */ |
| 145 | cmp r5, #0x1 /* still locked? */ |
| 146 | bne wait2 /* if lock, loop */ |
| 147 | nop |
| 148 | nop |
| 149 | nop |
| 150 | nop |
| 151 | ldmfd sp!, {r4 - r6} |
| 152 | mov pc, lr /* back to caller, locked */ |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 153 | ENDPROC(go_to_speed) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 154 | |
| 155 | _go_to_speed: .word go_to_speed |
| 156 | |
| 157 | /* these constants need to be close for PIC code */ |
| 158 | /* The Nor has to be in the Flash Base CS0 for this condition to happen */ |
| 159 | flash_cfg1_addr: |
Penda Naveen Kumar | fc8b7aa | 2009-07-31 00:06:36 +0530 | [diff] [blame] | 160 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG1) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 161 | flash_cfg3_addr: |
Penda Naveen Kumar | fc8b7aa | 2009-07-31 00:06:36 +0530 | [diff] [blame] | 162 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG3) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 163 | flash_cfg3_val: |
| 164 | .word STNOR_GPMC_CONFIG3 |
| 165 | flash_cfg4_addr: |
Penda Naveen Kumar | fc8b7aa | 2009-07-31 00:06:36 +0530 | [diff] [blame] | 166 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG4) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 167 | flash_cfg4_val: |
| 168 | .word STNOR_GPMC_CONFIG4 |
| 169 | flash_cfg5_val: |
| 170 | .word STNOR_GPMC_CONFIG5 |
| 171 | flash_cfg5_addr: |
Penda Naveen Kumar | fc8b7aa | 2009-07-31 00:06:36 +0530 | [diff] [blame] | 172 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG5) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 173 | pll_ctl_add: |
| 174 | .word CM_CLKEN_PLL |
| 175 | pll_div_add1: |
| 176 | .word CM_CLKSEL1_PLL |
| 177 | pll_div_add2: |
| 178 | .word CM_CLKSEL_CORE |
| 179 | pll_div_add3: |
| 180 | .word CM_CLKSEL_WKUP |
| 181 | pll_div_val3: |
| 182 | .word (WKUP_RSM << 1) |
| 183 | pll_div_add4: |
| 184 | .word CM_CLKSEL_GFX |
| 185 | pll_div_val4: |
| 186 | .word (GFX_DIV << 0) |
| 187 | pll_div_add5: |
| 188 | .word CM_CLKSEL1_EMU |
| 189 | pll_div_val5: |
| 190 | .word CLSEL1_EMU_VAL |
| 191 | |
| 192 | #endif |
| 193 | |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 194 | ENTRY(lowlevel_init) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 195 | ldr sp, SRAM_STACK |
Albert ARIBAUD | f30ef81 | 2012-10-07 09:24:10 +0000 | [diff] [blame] | 196 | str ip, [sp] /* stash ip register */ |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 197 | mov ip, lr /* save link reg across call */ |
Aneesh V | 49a2e55 | 2011-11-21 23:34:01 +0000 | [diff] [blame] | 198 | #if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_ONENAND_BOOT) |
| 199 | /* |
| 200 | * No need to copy/exec the clock code - DPLL adjust already done |
| 201 | * in NAND/oneNAND Boot. |
| 202 | */ |
| 203 | ldr r1, =SRAM_CLK_CODE |
| 204 | bl cpy_clk_code |
| 205 | #endif /* NAND Boot */ |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 206 | mov lr, ip /* restore link reg */ |
Albert ARIBAUD | f30ef81 | 2012-10-07 09:24:10 +0000 | [diff] [blame] | 207 | ldr ip, [sp] /* restore save ip */ |
| 208 | /* tail-call s_init to setup pll, mux, memory */ |
| 209 | b s_init |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 210 | |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 211 | ENDPROC(lowlevel_init) |
Dirk Behme | 595d37b | 2008-12-14 09:47:14 +0100 | [diff] [blame] | 212 | |
| 213 | /* the literal pools origin */ |
| 214 | .ltorg |
| 215 | |
| 216 | REG_CONTROL_STATUS: |
| 217 | .word CONTROL_STATUS |
| 218 | SRAM_STACK: |
| 219 | .word LOW_LEVEL_SRAM_STACK |
| 220 | |
| 221 | /* DPLL(1-4) PARAM TABLES */ |
| 222 | |
| 223 | /* |
| 224 | * Each of the tables has M, N, FREQSEL, M2 values defined for nominal |
| 225 | * OPP (1.2V). The fields are defined according to dpll_param struct (clock.c). |
| 226 | * The values are defined for all possible sysclk and for ES1 and ES2. |
| 227 | */ |
| 228 | |
| 229 | mpu_dpll_param: |
| 230 | /* 12MHz */ |
| 231 | /* ES1 */ |
| 232 | .word MPU_M_12_ES1, MPU_N_12_ES1, MPU_FSEL_12_ES1, MPU_M2_12_ES1 |
| 233 | /* ES2 */ |
| 234 | .word MPU_M_12_ES2, MPU_N_12_ES2, MPU_FSEL_12_ES2, MPU_M2_ES2 |
| 235 | /* 3410 */ |
| 236 | .word MPU_M_12, MPU_N_12, MPU_FSEL_12, MPU_M2_12 |
| 237 | |
| 238 | /* 13MHz */ |
| 239 | /* ES1 */ |
| 240 | .word MPU_M_13_ES1, MPU_N_13_ES1, MPU_FSEL_13_ES1, MPU_M2_13_ES1 |
| 241 | /* ES2 */ |
| 242 | .word MPU_M_13_ES2, MPU_N_13_ES2, MPU_FSEL_13_ES2, MPU_M2_13_ES2 |
| 243 | /* 3410 */ |
| 244 | .word MPU_M_13, MPU_N_13, MPU_FSEL_13, MPU_M2_13 |
| 245 | |
| 246 | /* 19.2MHz */ |
| 247 | /* ES1 */ |
| 248 | .word MPU_M_19P2_ES1, MPU_N_19P2_ES1, MPU_FSEL_19P2_ES1, MPU_M2_19P2_ES1 |
| 249 | /* ES2 */ |
| 250 | .word MPU_M_19P2_ES2, MPU_N_19P2_ES2, MPU_FSEL_19P2_ES2, MPU_M2_19P2_ES2 |
| 251 | /* 3410 */ |
| 252 | .word MPU_M_19P2, MPU_N_19P2, MPU_FSEL_19P2, MPU_M2_19P2 |
| 253 | |
| 254 | /* 26MHz */ |
| 255 | /* ES1 */ |
| 256 | .word MPU_M_26_ES1, MPU_N_26_ES1, MPU_FSEL_26_ES1, MPU_M2_26_ES1 |
| 257 | /* ES2 */ |
| 258 | .word MPU_M_26_ES2, MPU_N_26_ES2, MPU_FSEL_26_ES2, MPU_M2_26_ES2 |
| 259 | /* 3410 */ |
| 260 | .word MPU_M_26, MPU_N_26, MPU_FSEL_26, MPU_M2_26 |
| 261 | |
| 262 | /* 38.4MHz */ |
| 263 | /* ES1 */ |
| 264 | .word MPU_M_38P4_ES1, MPU_N_38P4_ES1, MPU_FSEL_38P4_ES1, MPU_M2_38P4_ES1 |
| 265 | /* ES2 */ |
| 266 | .word MPU_M_38P4_ES2, MPU_N_38P4_ES2, MPU_FSEL_38P4_ES2, MPU_M2_38P4_ES2 |
| 267 | /* 3410 */ |
| 268 | .word MPU_M_38P4, MPU_N_38P4, MPU_FSEL_38P4, MPU_M2_38P4 |
| 269 | |
| 270 | |
| 271 | .globl get_mpu_dpll_param |
| 272 | get_mpu_dpll_param: |
| 273 | adr r0, mpu_dpll_param |
| 274 | mov pc, lr |
| 275 | |
| 276 | iva_dpll_param: |
| 277 | /* 12MHz */ |
| 278 | /* ES1 */ |
| 279 | .word IVA_M_12_ES1, IVA_N_12_ES1, IVA_FSEL_12_ES1, IVA_M2_12_ES1 |
| 280 | /* ES2 */ |
| 281 | .word IVA_M_12_ES2, IVA_N_12_ES2, IVA_FSEL_12_ES2, IVA_M2_12_ES2 |
| 282 | /* 3410 */ |
| 283 | .word IVA_M_12, IVA_N_12, IVA_FSEL_12, IVA_M2_12 |
| 284 | |
| 285 | /* 13MHz */ |
| 286 | /* ES1 */ |
| 287 | .word IVA_M_13_ES1, IVA_N_13_ES1, IVA_FSEL_13_ES1, IVA_M2_13_ES1 |
| 288 | /* ES2 */ |
| 289 | .word IVA_M_13_ES2, IVA_N_13_ES2, IVA_FSEL_13_ES2, IVA_M2_13_ES2 |
| 290 | /* 3410 */ |
| 291 | .word IVA_M_13, IVA_N_13, IVA_FSEL_13, IVA_M2_13 |
| 292 | |
| 293 | /* 19.2MHz */ |
| 294 | /* ES1 */ |
| 295 | .word IVA_M_19P2_ES1, IVA_N_19P2_ES1, IVA_FSEL_19P2_ES1, IVA_M2_19P2_ES1 |
| 296 | /* ES2 */ |
| 297 | .word IVA_M_19P2_ES2, IVA_N_19P2_ES2, IVA_FSEL_19P2_ES2, IVA_M2_19P2_ES2 |
| 298 | /* 3410 */ |
| 299 | .word IVA_M_19P2, IVA_N_19P2, IVA_FSEL_19P2, IVA_M2_19P2 |
| 300 | |
| 301 | /* 26MHz */ |
| 302 | /* ES1 */ |
| 303 | .word IVA_M_26_ES1, IVA_N_26_ES1, IVA_FSEL_26_ES1, IVA_M2_26_ES1 |
| 304 | /* ES2 */ |
| 305 | .word IVA_M_26_ES2, IVA_N_26_ES2, IVA_FSEL_26_ES2, IVA_M2_26_ES2 |
| 306 | /* 3410 */ |
| 307 | .word IVA_M_26, IVA_N_26, IVA_FSEL_26, IVA_M2_26 |
| 308 | |
| 309 | /* 38.4MHz */ |
| 310 | /* ES1 */ |
| 311 | .word IVA_M_38P4_ES1, IVA_N_38P4_ES1, IVA_FSEL_38P4_ES1, IVA_M2_38P4_ES1 |
| 312 | /* ES2 */ |
| 313 | .word IVA_M_38P4_ES2, IVA_N_38P4_ES2, IVA_FSEL_38P4_ES2, IVA_M2_38P4_ES2 |
| 314 | /* 3410 */ |
| 315 | .word IVA_M_38P4, IVA_N_38P4, IVA_FSEL_38P4, IVA_M2_38P4 |
| 316 | |
| 317 | |
| 318 | .globl get_iva_dpll_param |
| 319 | get_iva_dpll_param: |
| 320 | adr r0, iva_dpll_param |
| 321 | mov pc, lr |
| 322 | |
| 323 | /* Core DPLL targets for L3 at 166 & L133 */ |
| 324 | core_dpll_param: |
| 325 | /* 12MHz */ |
| 326 | /* ES1 */ |
| 327 | .word CORE_M_12_ES1, CORE_N_12_ES1, CORE_FSL_12_ES1, CORE_M2_12_ES1 |
| 328 | /* ES2 */ |
| 329 | .word CORE_M_12, CORE_N_12, CORE_FSEL_12, CORE_M2_12 |
| 330 | /* 3410 */ |
| 331 | .word CORE_M_12, CORE_N_12, CORE_FSEL_12, CORE_M2_12 |
| 332 | |
| 333 | /* 13MHz */ |
| 334 | /* ES1 */ |
| 335 | .word CORE_M_13_ES1, CORE_N_13_ES1, CORE_FSL_13_ES1, CORE_M2_13_ES1 |
| 336 | /* ES2 */ |
| 337 | .word CORE_M_13, CORE_N_13, CORE_FSEL_13, CORE_M2_13 |
| 338 | /* 3410 */ |
| 339 | .word CORE_M_13, CORE_N_13, CORE_FSEL_13, CORE_M2_13 |
| 340 | |
| 341 | /* 19.2MHz */ |
| 342 | /* ES1 */ |
| 343 | .word CORE_M_19P2_ES1, CORE_N_19P2_ES1, CORE_FSL_19P2_ES1, CORE_M2_19P2_ES1 |
| 344 | /* ES2 */ |
| 345 | .word CORE_M_19P2, CORE_N_19P2, CORE_FSEL_19P2, CORE_M2_19P2 |
| 346 | /* 3410 */ |
| 347 | .word CORE_M_19P2, CORE_N_19P2, CORE_FSEL_19P2, CORE_M2_19P2 |
| 348 | |
| 349 | /* 26MHz */ |
| 350 | /* ES1 */ |
| 351 | .word CORE_M_26_ES1, CORE_N_26_ES1, CORE_FSL_26_ES1, CORE_M2_26_ES1 |
| 352 | /* ES2 */ |
| 353 | .word CORE_M_26, CORE_N_26, CORE_FSEL_26, CORE_M2_26 |
| 354 | /* 3410 */ |
| 355 | .word CORE_M_26, CORE_N_26, CORE_FSEL_26, CORE_M2_26 |
| 356 | |
| 357 | /* 38.4MHz */ |
| 358 | /* ES1 */ |
| 359 | .word CORE_M_38P4_ES1, CORE_N_38P4_ES1, CORE_FSL_38P4_ES1, CORE_M2_38P4_ES1 |
| 360 | /* ES2 */ |
| 361 | .word CORE_M_38P4, CORE_N_38P4, CORE_FSEL_38P4, CORE_M2_38P4 |
| 362 | /* 3410 */ |
| 363 | .word CORE_M_38P4, CORE_N_38P4, CORE_FSEL_38P4, CORE_M2_38P4 |
| 364 | |
| 365 | .globl get_core_dpll_param |
| 366 | get_core_dpll_param: |
| 367 | adr r0, core_dpll_param |
| 368 | mov pc, lr |
| 369 | |
| 370 | /* PER DPLL values are same for both ES1 and ES2 */ |
| 371 | per_dpll_param: |
| 372 | /* 12MHz */ |
| 373 | .word PER_M_12, PER_N_12, PER_FSEL_12, PER_M2_12 |
| 374 | |
| 375 | /* 13MHz */ |
| 376 | .word PER_M_13, PER_N_13, PER_FSEL_13, PER_M2_13 |
| 377 | |
| 378 | /* 19.2MHz */ |
| 379 | .word PER_M_19P2, PER_N_19P2, PER_FSEL_19P2, PER_M2_19P2 |
| 380 | |
| 381 | /* 26MHz */ |
| 382 | .word PER_M_26, PER_N_26, PER_FSEL_26, PER_M2_26 |
| 383 | |
| 384 | /* 38.4MHz */ |
| 385 | .word PER_M_38P4, PER_N_38P4, PER_FSEL_38P4, PER_M2_38P4 |
| 386 | |
| 387 | .globl get_per_dpll_param |
| 388 | get_per_dpll_param: |
| 389 | adr r0, per_dpll_param |
| 390 | mov pc, lr |
Steve Sakoman | 24e81c1 | 2010-08-18 07:34:09 -0700 | [diff] [blame] | 391 | |
Alexander Holler | 96b549e | 2011-04-19 09:27:55 -0400 | [diff] [blame] | 392 | /* PER2 DPLL values */ |
| 393 | per2_dpll_param: |
| 394 | /* 12MHz */ |
| 395 | .word PER2_M_12, PER2_N_12, PER2_FSEL_12, PER2_M2_12 |
| 396 | |
| 397 | /* 13MHz */ |
| 398 | .word PER2_M_13, PER2_N_13, PER2_FSEL_13, PER2_M2_13 |
| 399 | |
| 400 | /* 19.2MHz */ |
| 401 | .word PER2_M_19P2, PER2_N_19P2, PER2_FSEL_19P2, PER2_M2_19P2 |
| 402 | |
| 403 | /* 26MHz */ |
| 404 | .word PER2_M_26, PER2_N_26, PER2_FSEL_26, PER2_M2_26 |
| 405 | |
| 406 | /* 38.4MHz */ |
| 407 | .word PER2_M_38P4, PER2_N_38P4, PER2_FSEL_38P4, PER2_M2_38P4 |
| 408 | |
| 409 | .globl get_per2_dpll_param |
| 410 | get_per2_dpll_param: |
| 411 | adr r0, per2_dpll_param |
| 412 | mov pc, lr |
| 413 | |
Steve Sakoman | 24e81c1 | 2010-08-18 07:34:09 -0700 | [diff] [blame] | 414 | /* |
| 415 | * Tables for 36XX/37XX devices |
| 416 | * |
| 417 | */ |
| 418 | mpu_36x_dpll_param: |
| 419 | /* 12MHz */ |
| 420 | .word 50, 0, 0, 1 |
| 421 | /* 13MHz */ |
| 422 | .word 600, 12, 0, 1 |
| 423 | /* 19.2MHz */ |
| 424 | .word 125, 3, 0, 1 |
| 425 | /* 26MHz */ |
| 426 | .word 300, 12, 0, 1 |
| 427 | /* 38.4MHz */ |
| 428 | .word 125, 7, 0, 1 |
| 429 | |
| 430 | iva_36x_dpll_param: |
| 431 | /* 12MHz */ |
| 432 | .word 130, 2, 0, 1 |
| 433 | /* 13MHz */ |
| 434 | .word 20, 0, 0, 1 |
| 435 | /* 19.2MHz */ |
| 436 | .word 325, 11, 0, 1 |
| 437 | /* 26MHz */ |
| 438 | .word 10, 0, 0, 1 |
| 439 | /* 38.4MHz */ |
| 440 | .word 325, 23, 0, 1 |
| 441 | |
| 442 | core_36x_dpll_param: |
| 443 | /* 12MHz */ |
| 444 | .word 100, 2, 0, 1 |
| 445 | /* 13MHz */ |
| 446 | .word 400, 12, 0, 1 |
| 447 | /* 19.2MHz */ |
| 448 | .word 375, 17, 0, 1 |
| 449 | /* 26MHz */ |
| 450 | .word 200, 12, 0, 1 |
| 451 | /* 38.4MHz */ |
| 452 | .word 375, 35, 0, 1 |
| 453 | |
| 454 | per_36x_dpll_param: |
| 455 | /* SYSCLK M N M2 M3 M4 M5 M6 m2DIV */ |
| 456 | .word 12000, 360, 4, 9, 16, 5, 4, 3, 1 |
| 457 | .word 13000, 864, 12, 9, 16, 9, 4, 3, 1 |
| 458 | .word 19200, 360, 7, 9, 16, 5, 4, 3, 1 |
| 459 | .word 26000, 432, 12, 9, 16, 9, 4, 3, 1 |
| 460 | .word 38400, 360, 15, 9, 16, 5, 4, 3, 1 |
| 461 | |
Naumann Andreas | 7330fd7 | 2013-07-09 09:43:17 +0200 | [diff] [blame] | 462 | per2_36x_dpll_param: |
| 463 | /* 12MHz */ |
| 464 | .word PER2_36XX_M_12, PER2_36XX_N_12, 0, PER2_36XX_M2_12 |
| 465 | /* 13MHz */ |
| 466 | .word PER2_36XX_M_13, PER2_36XX_N_13, 0, PER2_36XX_M2_13 |
| 467 | /* 19.2MHz */ |
| 468 | .word PER2_36XX_M_19P2, PER2_36XX_N_19P2, 0, PER2_36XX_M2_19P2 |
| 469 | /* 26MHz */ |
| 470 | .word PER2_36XX_M_26, PER2_36XX_N_26, 0, PER2_36XX_M2_26 |
| 471 | /* 38.4MHz */ |
| 472 | .word PER2_36XX_M_38P4, PER2_36XX_N_38P4, 0, PER2_36XX_M2_38P4 |
| 473 | |
| 474 | |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 475 | ENTRY(get_36x_mpu_dpll_param) |
Steve Sakoman | 24e81c1 | 2010-08-18 07:34:09 -0700 | [diff] [blame] | 476 | adr r0, mpu_36x_dpll_param |
| 477 | mov pc, lr |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 478 | ENDPROC(get_36x_mpu_dpll_param) |
Steve Sakoman | 24e81c1 | 2010-08-18 07:34:09 -0700 | [diff] [blame] | 479 | |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 480 | ENTRY(get_36x_iva_dpll_param) |
Steve Sakoman | 24e81c1 | 2010-08-18 07:34:09 -0700 | [diff] [blame] | 481 | adr r0, iva_36x_dpll_param |
| 482 | mov pc, lr |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 483 | ENDPROC(get_36x_iva_dpll_param) |
Steve Sakoman | 24e81c1 | 2010-08-18 07:34:09 -0700 | [diff] [blame] | 484 | |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 485 | ENTRY(get_36x_core_dpll_param) |
Steve Sakoman | 24e81c1 | 2010-08-18 07:34:09 -0700 | [diff] [blame] | 486 | adr r0, core_36x_dpll_param |
| 487 | mov pc, lr |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 488 | ENDPROC(get_36x_core_dpll_param) |
Steve Sakoman | 24e81c1 | 2010-08-18 07:34:09 -0700 | [diff] [blame] | 489 | |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 490 | ENTRY(get_36x_per_dpll_param) |
Steve Sakoman | 24e81c1 | 2010-08-18 07:34:09 -0700 | [diff] [blame] | 491 | adr r0, per_36x_dpll_param |
| 492 | mov pc, lr |
Aneesh V | fd8798b | 2012-03-08 07:20:18 +0000 | [diff] [blame] | 493 | ENDPROC(get_36x_per_dpll_param) |
Naumann Andreas | 7330fd7 | 2013-07-09 09:43:17 +0200 | [diff] [blame] | 494 | |
| 495 | ENTRY(get_36x_per2_dpll_param) |
| 496 | adr r0, per2_36x_dpll_param |
| 497 | mov pc, lr |
| 498 | ENDPROC(get_36x_per2_dpll_param) |