1*77fa0457SPeng Fan/* 2*77fa0457SPeng Fan * Copyright (C) 2016 Freescale Semiconductor, Inc. 3*77fa0457SPeng Fan * 4*77fa0457SPeng Fan * SPDX-License-Identifier: GPL-2.0+ 5*77fa0457SPeng Fan */ 6*77fa0457SPeng Fan 7*77fa0457SPeng Fan#include <config.h> 8*77fa0457SPeng Fan 9*77fa0457SPeng Fan.macro imx7ulp_ddr_freq_decrease 10*77fa0457SPeng Fan ldr r2, =0x403f0000 11*77fa0457SPeng Fan ldr r3, =0x00000000 12*77fa0457SPeng Fan str r3, [r2, #0xdc] 13*77fa0457SPeng Fan 14*77fa0457SPeng Fan ldr r2, =0x403e0000 15*77fa0457SPeng Fan ldr r3, =0x01000020 16*77fa0457SPeng Fan str r3, [r2, #0x40] 17*77fa0457SPeng Fan ldr r3, =0x01000000 18*77fa0457SPeng Fan str r3, [r2, #0x500] 19*77fa0457SPeng Fan ldr r3, =0x80808080 20*77fa0457SPeng Fan str r3, [r2, #0x50c] 21*77fa0457SPeng Fan ldr r3, =0x00140000 22*77fa0457SPeng Fan str r3, [r2, #0x508] 23*77fa0457SPeng Fan ldr r3, =0x00000004 24*77fa0457SPeng Fan str r3, [r2, #0x510] 25*77fa0457SPeng Fan ldr r3, =0x00000002 26*77fa0457SPeng Fan str r3, [r2, #0x514] 27*77fa0457SPeng Fan ldr r3, =0x00000001 28*77fa0457SPeng Fan str r3, [r2, #0x500] 29*77fa0457SPeng Fan 30*77fa0457SPeng Fan ldr r3, =0x01000000 31*77fa0457SPeng Fanwait1: 32*77fa0457SPeng Fan ldr r4, [r2, #0x500] 33*77fa0457SPeng Fan and r4, r3 34*77fa0457SPeng Fan cmp r4, r3 35*77fa0457SPeng Fan bne wait1 36*77fa0457SPeng Fan 37*77fa0457SPeng Fan ldr r3, =0x8080801E 38*77fa0457SPeng Fan str r3, [r2, #0x50c] 39*77fa0457SPeng Fan 40*77fa0457SPeng Fan ldr r3, =0x00000040 41*77fa0457SPeng Fanwait2: 42*77fa0457SPeng Fan ldr r4, [r2, #0x50c] 43*77fa0457SPeng Fan and r4, r3 44*77fa0457SPeng Fan cmp r4, r3 45*77fa0457SPeng Fan bne wait2 46*77fa0457SPeng Fan 47*77fa0457SPeng Fan ldr r3, =0x00000001 48*77fa0457SPeng Fan str r3, [r2, #0x30] 49*77fa0457SPeng Fan ldr r3, =0x11000020 50*77fa0457SPeng Fan str r3, [r2, #0x40] 51*77fa0457SPeng Fan 52*77fa0457SPeng Fan ldr r2, =0x403f0000 53*77fa0457SPeng Fan ldr r3, =0x42000000 54*77fa0457SPeng Fan str r3, [r2, #0xdc] 55*77fa0457SPeng Fan 56*77fa0457SPeng Fan.endm 57*77fa0457SPeng Fan 58*77fa0457SPeng Fan.macro imx7ulp_evk_ddr_setting 59*77fa0457SPeng Fan 60*77fa0457SPeng Fan imx7ulp_ddr_freq_decrease 61*77fa0457SPeng Fan 62*77fa0457SPeng Fan /* Enable MMDC PCC clock */ 63*77fa0457SPeng Fan ldr r2, =0x40b30000 64*77fa0457SPeng Fan ldr r3, =0x40000000 65*77fa0457SPeng Fan str r3, [r2, #0xac] 66*77fa0457SPeng Fan 67*77fa0457SPeng Fan /* Configure DDR pad */ 68*77fa0457SPeng Fan ldr r0, =0x40ad0000 69*77fa0457SPeng Fan ldr r1, =0x00040000 70*77fa0457SPeng Fan str r1, [r0, #0x128] 71*77fa0457SPeng Fan ldr r1, =0x0 72*77fa0457SPeng Fan str r1, [r0, #0xf8] 73*77fa0457SPeng Fan ldr r1, =0x00000180 74*77fa0457SPeng Fan str r1, [r0, #0xd8] 75*77fa0457SPeng Fan ldr r1, =0x00000180 76*77fa0457SPeng Fan str r1, [r0, #0x108] 77*77fa0457SPeng Fan ldr r1, =0x00000180 78*77fa0457SPeng Fan str r1, [r0, #0x104] 79*77fa0457SPeng Fan ldr r1, =0x00010000 80*77fa0457SPeng Fan str r1, [r0, #0x124] 81*77fa0457SPeng Fan ldr r1, =0x0000018C 82*77fa0457SPeng Fan str r1, [r0, #0x80] 83*77fa0457SPeng Fan ldr r1, =0x0000018C 84*77fa0457SPeng Fan str r1, [r0, #0x84] 85*77fa0457SPeng Fan ldr r1, =0x0000018C 86*77fa0457SPeng Fan str r1, [r0, #0x88] 87*77fa0457SPeng Fan ldr r1, =0x0000018C 88*77fa0457SPeng Fan str r1, [r0, #0x8c] 89*77fa0457SPeng Fan 90*77fa0457SPeng Fan ldr r1, =0x00010000 91*77fa0457SPeng Fan str r1, [r0, #0x120] 92*77fa0457SPeng Fan ldr r1, =0x00000180 93*77fa0457SPeng Fan str r1, [r0, #0x10c] 94*77fa0457SPeng Fan ldr r1, =0x00000180 95*77fa0457SPeng Fan str r1, [r0, #0x110] 96*77fa0457SPeng Fan ldr r1, =0x00000180 97*77fa0457SPeng Fan str r1, [r0, #0x114] 98*77fa0457SPeng Fan ldr r1, =0x00000180 99*77fa0457SPeng Fan str r1, [r0, #0x118] 100*77fa0457SPeng Fan ldr r1, =0x00000180 101*77fa0457SPeng Fan str r1, [r0, #0x90] 102*77fa0457SPeng Fan ldr r1, =0x00000180 103*77fa0457SPeng Fan str r1, [r0, #0x94] 104*77fa0457SPeng Fan ldr r1, =0x00000180 105*77fa0457SPeng Fan str r1, [r0, #0x98] 106*77fa0457SPeng Fan ldr r1, =0x00000180 107*77fa0457SPeng Fan str r1, [r0, #0x9c] 108*77fa0457SPeng Fan ldr r1, =0x00040000 109*77fa0457SPeng Fan str r1, [r0, #0xe0] 110*77fa0457SPeng Fan ldr r1, =0x00040000 111*77fa0457SPeng Fan str r1, [r0, #0xe4] 112*77fa0457SPeng Fan 113*77fa0457SPeng Fan ldr r0, =0x40ab0000 114*77fa0457SPeng Fan ldr r1, =0x00008000 115*77fa0457SPeng Fan str r1, [r0, #0x1c] 116*77fa0457SPeng Fan ldr r1, =0xA1390003 117*77fa0457SPeng Fan str r1, [r0, #0x800] 118*77fa0457SPeng Fan ldr r1, =0x0D3900A0 119*77fa0457SPeng Fan str r1, [r0, #0x85c] 120*77fa0457SPeng Fan ldr r1, =0x00400000 121*77fa0457SPeng Fan str r1, [r0, #0x890] 122*77fa0457SPeng Fan 123*77fa0457SPeng Fan ldr r1, =0x40404040 124*77fa0457SPeng Fan str r1, [r0, #0x848] 125*77fa0457SPeng Fan ldr r1, =0x40404040 126*77fa0457SPeng Fan str r1, [r0, #0x850] 127*77fa0457SPeng Fan ldr r1, =0x33333333 128*77fa0457SPeng Fan str r1, [r0, #0x81c] 129*77fa0457SPeng Fan ldr r1, =0x33333333 130*77fa0457SPeng Fan str r1, [r0, #0x820] 131*77fa0457SPeng Fan ldr r1, =0x33333333 132*77fa0457SPeng Fan str r1, [r0, #0x824] 133*77fa0457SPeng Fan ldr r1, =0x33333333 134*77fa0457SPeng Fan str r1, [r0, #0x828] 135*77fa0457SPeng Fan 136*77fa0457SPeng Fan ldr r1, =0xf3333333 137*77fa0457SPeng Fan str r1, [r0, #0x82c] 138*77fa0457SPeng Fan ldr r1, =0xf3333333 139*77fa0457SPeng Fan str r1, [r0, #0x830] 140*77fa0457SPeng Fan ldr r1, =0xf3333333 141*77fa0457SPeng Fan str r1, [r0, #0x834] 142*77fa0457SPeng Fan ldr r1, =0xf3333333 143*77fa0457SPeng Fan str r1, [r0, #0x838] 144*77fa0457SPeng Fan 145*77fa0457SPeng Fan ldr r1, =0x24922492 146*77fa0457SPeng Fan str r1, [r0, #0x8c0] 147*77fa0457SPeng Fan ldr r1, =0x00000800 148*77fa0457SPeng Fan str r1, [r0, #0x8b8] 149*77fa0457SPeng Fan 150*77fa0457SPeng Fan ldr r1, =0x00020052 151*77fa0457SPeng Fan str r1, [r0, #0x4] 152*77fa0457SPeng Fan ldr r1, =0x292C42F3 153*77fa0457SPeng Fan str r1, [r0, #0xc] 154*77fa0457SPeng Fan ldr r1, =0x00100A22 155*77fa0457SPeng Fan str r1, [r0, #0x10] 156*77fa0457SPeng Fan ldr r1, =0x00120556 157*77fa0457SPeng Fan str r1, [r0, #0x38] 158*77fa0457SPeng Fan ldr r1, =0x00C700DB 159*77fa0457SPeng Fan str r1, [r0, #0x14] 160*77fa0457SPeng Fan ldr r1, =0x00211718 161*77fa0457SPeng Fan str r1, [r0, #0x18] 162*77fa0457SPeng Fan 163*77fa0457SPeng Fan ldr r1, =0x0F9F26D2 164*77fa0457SPeng Fan str r1, [r0, #0x2c] 165*77fa0457SPeng Fan ldr r1, =0x009F0E10 166*77fa0457SPeng Fan str r1, [r0, #0x30] 167*77fa0457SPeng Fan ldr r1, =0x0000003F 168*77fa0457SPeng Fan str r1, [r0, #0x40] 169*77fa0457SPeng Fan ldr r1, =0xC3190000 170*77fa0457SPeng Fan str r1, [r0, #0x0] 171*77fa0457SPeng Fan 172*77fa0457SPeng Fan ldr r1, =0x00008050 173*77fa0457SPeng Fan str r1, [r0, #0x1c] 174*77fa0457SPeng Fan ldr r1, =0x00008058 175*77fa0457SPeng Fan str r1, [r0, #0x1c] 176*77fa0457SPeng Fan ldr r1, =0x003F8030 177*77fa0457SPeng Fan str r1, [r0, #0x1c] 178*77fa0457SPeng Fan ldr r1, =0x003F8038 179*77fa0457SPeng Fan str r1, [r0, #0x1c] 180*77fa0457SPeng Fan ldr r1, =0xFF0A8030 181*77fa0457SPeng Fan str r1, [r0, #0x1c] 182*77fa0457SPeng Fan ldr r1, =0xFF0A8038 183*77fa0457SPeng Fan str r1, [r0, #0x1c] 184*77fa0457SPeng Fan ldr r1, =0x04028030 185*77fa0457SPeng Fan str r1, [r0, #0x1c] 186*77fa0457SPeng Fan ldr r1, =0x04028038 187*77fa0457SPeng Fan str r1, [r0, #0x1c] 188*77fa0457SPeng Fan ldr r1, =0x83018030 189*77fa0457SPeng Fan str r1, [r0, #0x1c] 190*77fa0457SPeng Fan ldr r1, =0x83018038 191*77fa0457SPeng Fan str r1, [r0, #0x1c] 192*77fa0457SPeng Fan ldr r1, =0x01038030 193*77fa0457SPeng Fan str r1, [r0, #0x1c] 194*77fa0457SPeng Fan ldr r1, =0x01038038 195*77fa0457SPeng Fan str r1, [r0, #0x1c] 196*77fa0457SPeng Fan 197*77fa0457SPeng Fan ldr r1, =0x20000000 198*77fa0457SPeng Fan str r1, [r0, #0x83c] 199*77fa0457SPeng Fan 200*77fa0457SPeng Fan ldr r1, =0x00001800 201*77fa0457SPeng Fan str r1, [r0, #0x20] 202*77fa0457SPeng Fan ldr r1, =0xA1310000 203*77fa0457SPeng Fan str r1, [r0, #0x800] 204*77fa0457SPeng Fan ldr r1, =0x00020052 205*77fa0457SPeng Fan str r1, [r0, #0x4] 206*77fa0457SPeng Fan ldr r1, =0x00011006 207*77fa0457SPeng Fan str r1, [r0, #0x404] 208*77fa0457SPeng Fan ldr r1, =0x00000000 209*77fa0457SPeng Fan str r1, [r0, #0x1c] 210*77fa0457SPeng Fan 211*77fa0457SPeng Fan.endm 212*77fa0457SPeng Fan 213*77fa0457SPeng Fan.macro imx7ulp_clock_gating 214*77fa0457SPeng Fan.endm 215*77fa0457SPeng Fan 216*77fa0457SPeng Fan.macro imx7ulp_qos_setting 217*77fa0457SPeng Fan.endm 218*77fa0457SPeng Fan 219*77fa0457SPeng Fan.macro imx7ulp_ddr_setting 220*77fa0457SPeng Fan imx7ulp_evk_ddr_setting 221*77fa0457SPeng Fan.endm 222*77fa0457SPeng Fan 223*77fa0457SPeng Fan/* include the common plugin code here */ 224*77fa0457SPeng Fan#include <asm/arch/mx7ulp_plugin.S> 225