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