1*6d034093SMichal Simek /* 2*6d034093SMichal Simek * (c) Copyright 2015 Xilinx, Inc. All rights reserved. 3*6d034093SMichal Simek * 4*6d034093SMichal Simek * SPDX-License-Identifier: GPL-2.0+ 5*6d034093SMichal Simek */ 6*6d034093SMichal Simek 7*6d034093SMichal Simek #include <asm/arch/psu_init_gpl.h> 8*6d034093SMichal Simek #include <xil_io.h> 9*6d034093SMichal Simek 10*6d034093SMichal Simek static unsigned long psu_pll_init_data(void) 11*6d034093SMichal Simek { 12*6d034093SMichal Simek psu_mask_write(0xFF5E0034, 0xFE7FEDEFU, 0x7E4B0C62U); 13*6d034093SMichal Simek psu_mask_write(0xFF5E0030, 0x00717F00U, 0x00014600U); 14*6d034093SMichal Simek psu_mask_write(0xFF5E0030, 0x00000008U, 0x00000008U); 15*6d034093SMichal Simek psu_mask_write(0xFF5E0030, 0x00000001U, 0x00000001U); 16*6d034093SMichal Simek psu_mask_write(0xFF5E0030, 0x00000001U, 0x00000000U); 17*6d034093SMichal Simek mask_poll(0xFF5E0040, 0x00000002U); 18*6d034093SMichal Simek psu_mask_write(0xFF5E0030, 0x00000008U, 0x00000000U); 19*6d034093SMichal Simek psu_mask_write(0xFF5E0048, 0x00003F00U, 0x00000300U); 20*6d034093SMichal Simek psu_mask_write(0xFF5E0038, 0x8000FFFFU, 0x00000000U); 21*6d034093SMichal Simek psu_mask_write(0xFF5E0024, 0xFE7FEDEFU, 0x7E672C6CU); 22*6d034093SMichal Simek psu_mask_write(0xFF5E0020, 0x00717F00U, 0x00002D00U); 23*6d034093SMichal Simek psu_mask_write(0xFF5E0020, 0x00000008U, 0x00000008U); 24*6d034093SMichal Simek psu_mask_write(0xFF5E0020, 0x00000001U, 0x00000001U); 25*6d034093SMichal Simek psu_mask_write(0xFF5E0020, 0x00000001U, 0x00000000U); 26*6d034093SMichal Simek mask_poll(0xFF5E0040, 0x00000001U); 27*6d034093SMichal Simek psu_mask_write(0xFF5E0020, 0x00000008U, 0x00000000U); 28*6d034093SMichal Simek psu_mask_write(0xFF5E0044, 0x00003F00U, 0x00000300U); 29*6d034093SMichal Simek psu_mask_write(0xFF5E0028, 0x8000FFFFU, 0x00000000U); 30*6d034093SMichal Simek psu_mask_write(0xFD1A0024, 0xFE7FEDEFU, 0x7E4B0C62U); 31*6d034093SMichal Simek psu_mask_write(0xFD1A0020, 0x00717F00U, 0x00014800U); 32*6d034093SMichal Simek psu_mask_write(0xFD1A0020, 0x00000008U, 0x00000008U); 33*6d034093SMichal Simek psu_mask_write(0xFD1A0020, 0x00000001U, 0x00000001U); 34*6d034093SMichal Simek psu_mask_write(0xFD1A0020, 0x00000001U, 0x00000000U); 35*6d034093SMichal Simek mask_poll(0xFD1A0044, 0x00000001U); 36*6d034093SMichal Simek psu_mask_write(0xFD1A0020, 0x00000008U, 0x00000000U); 37*6d034093SMichal Simek psu_mask_write(0xFD1A0048, 0x00003F00U, 0x00000300U); 38*6d034093SMichal Simek psu_mask_write(0xFD1A0028, 0x8000FFFFU, 0x00000000U); 39*6d034093SMichal Simek psu_mask_write(0xFD1A0030, 0xFE7FEDEFU, 0x7E4B0C62U); 40*6d034093SMichal Simek psu_mask_write(0xFD1A002C, 0x00717F00U, 0x00014000U); 41*6d034093SMichal Simek psu_mask_write(0xFD1A002C, 0x00000008U, 0x00000008U); 42*6d034093SMichal Simek psu_mask_write(0xFD1A002C, 0x00000001U, 0x00000001U); 43*6d034093SMichal Simek psu_mask_write(0xFD1A002C, 0x00000001U, 0x00000000U); 44*6d034093SMichal Simek mask_poll(0xFD1A0044, 0x00000002U); 45*6d034093SMichal Simek psu_mask_write(0xFD1A002C, 0x00000008U, 0x00000000U); 46*6d034093SMichal Simek psu_mask_write(0xFD1A004C, 0x00003F00U, 0x00000300U); 47*6d034093SMichal Simek psu_mask_write(0xFD1A0034, 0x8000FFFFU, 0x00000000U); 48*6d034093SMichal Simek psu_mask_write(0xFD1A003C, 0xFE7FEDEFU, 0x7E4B0C62U); 49*6d034093SMichal Simek psu_mask_write(0xFD1A0038, 0x00717F00U, 0x00014700U); 50*6d034093SMichal Simek psu_mask_write(0xFD1A0038, 0x00000008U, 0x00000008U); 51*6d034093SMichal Simek psu_mask_write(0xFD1A0038, 0x00000001U, 0x00000001U); 52*6d034093SMichal Simek psu_mask_write(0xFD1A0038, 0x00000001U, 0x00000000U); 53*6d034093SMichal Simek mask_poll(0xFD1A0044, 0x00000004U); 54*6d034093SMichal Simek psu_mask_write(0xFD1A0038, 0x00000008U, 0x00000000U); 55*6d034093SMichal Simek psu_mask_write(0xFD1A0050, 0x00003F00U, 0x00000300U); 56*6d034093SMichal Simek psu_mask_write(0xFD1A0040, 0x8000FFFFU, 0x00000000U); 57*6d034093SMichal Simek 58*6d034093SMichal Simek return 1; 59*6d034093SMichal Simek } 60*6d034093SMichal Simek 61*6d034093SMichal Simek static unsigned long psu_clock_init_data(void) 62*6d034093SMichal Simek { 63*6d034093SMichal Simek psu_mask_write(0xFF5E0060, 0x023F3F07U, 0x02010600U); 64*6d034093SMichal Simek psu_mask_write(0xFF5E0064, 0x023F3F07U, 0x02010600U); 65*6d034093SMichal Simek psu_mask_write(0xFF5E004C, 0x023F3F07U, 0x020F0500U); 66*6d034093SMichal Simek psu_mask_write(0xFF5E006C, 0x013F3F07U, 0x01010800U); 67*6d034093SMichal Simek psu_mask_write(0xFF5E0070, 0x013F3F07U, 0x01010800U); 68*6d034093SMichal Simek psu_mask_write(0xFF18030C, 0x00020003U, 0x00000000U); 69*6d034093SMichal Simek psu_mask_write(0xFF5E0074, 0x013F3F07U, 0x01010F00U); 70*6d034093SMichal Simek psu_mask_write(0xFF5E0078, 0x013F3F07U, 0x01010F00U); 71*6d034093SMichal Simek psu_mask_write(0xFF5E0124, 0x013F3F07U, 0x01010F00U); 72*6d034093SMichal Simek psu_mask_write(0xFF5E007C, 0x013F3F07U, 0x01010800U); 73*6d034093SMichal Simek psu_mask_write(0xFF5E0080, 0x013F3F07U, 0x01010800U); 74*6d034093SMichal Simek psu_mask_write(0xFF5E0090, 0x01003F07U, 0x01000302U); 75*6d034093SMichal Simek psu_mask_write(0xFF5E009C, 0x01003F07U, 0x01000602U); 76*6d034093SMichal Simek psu_mask_write(0xFF5E00A4, 0x01003F07U, 0x01000800U); 77*6d034093SMichal Simek psu_mask_write(0xFF5E00A8, 0x01003F07U, 0x01000302U); 78*6d034093SMichal Simek psu_mask_write(0xFF5E00AC, 0x01003F07U, 0x01000F02U); 79*6d034093SMichal Simek psu_mask_write(0xFF5E00B0, 0x01003F07U, 0x01000602U); 80*6d034093SMichal Simek psu_mask_write(0xFF5E00B8, 0x01003F07U, 0x01000302U); 81*6d034093SMichal Simek psu_mask_write(0xFF5E00C0, 0x013F3F07U, 0x01010F00U); 82*6d034093SMichal Simek psu_mask_write(0xFF5E00C4, 0x013F3F07U, 0x01040F00U); 83*6d034093SMichal Simek psu_mask_write(0xFF5E00C8, 0x013F3F07U, 0x01010500U); 84*6d034093SMichal Simek psu_mask_write(0xFF5E00CC, 0x013F3F07U, 0x01010400U); 85*6d034093SMichal Simek psu_mask_write(0xFF5E0108, 0x013F3F07U, 0x01011D02U); 86*6d034093SMichal Simek psu_mask_write(0xFF5E0104, 0x00000007U, 0x00000000U); 87*6d034093SMichal Simek psu_mask_write(0xFF5E0128, 0x01003F07U, 0x01000F00U); 88*6d034093SMichal Simek psu_mask_write(0xFD1A0070, 0x013F3F07U, 0x01010400U); 89*6d034093SMichal Simek psu_mask_write(0xFD1A0074, 0x013F3F07U, 0x01011003U); 90*6d034093SMichal Simek psu_mask_write(0xFD1A007C, 0x013F3F07U, 0x01010F03U); 91*6d034093SMichal Simek psu_mask_write(0xFD1A0060, 0x03003F07U, 0x03000100U); 92*6d034093SMichal Simek psu_mask_write(0xFD1A0068, 0x01003F07U, 0x01000200U); 93*6d034093SMichal Simek psu_mask_write(0xFD1A0080, 0x00003F07U, 0x00000400U); 94*6d034093SMichal Simek psu_mask_write(0xFD1A0084, 0x07003F07U, 0x07000100U); 95*6d034093SMichal Simek psu_mask_write(0xFD1A00B8, 0x01003F07U, 0x01000200U); 96*6d034093SMichal Simek psu_mask_write(0xFD1A00BC, 0x01003F07U, 0x01000200U); 97*6d034093SMichal Simek psu_mask_write(0xFD1A00C0, 0x01003F07U, 0x01000203U); 98*6d034093SMichal Simek psu_mask_write(0xFD1A00C4, 0x01003F07U, 0x01000502U); 99*6d034093SMichal Simek psu_mask_write(0xFD1A00F8, 0x00003F07U, 0x00000200U); 100*6d034093SMichal Simek psu_mask_write(0xFF180380, 0x000000FFU, 0x00000000U); 101*6d034093SMichal Simek psu_mask_write(0xFD610100, 0x00000001U, 0x00000000U); 102*6d034093SMichal Simek psu_mask_write(0xFF180300, 0x00000001U, 0x00000000U); 103*6d034093SMichal Simek psu_mask_write(0xFF410050, 0x00000001U, 0x00000000U); 104*6d034093SMichal Simek 105*6d034093SMichal Simek return 1; 106*6d034093SMichal Simek } 107*6d034093SMichal Simek 108*6d034093SMichal Simek static unsigned long psu_ddr_init_data(void) 109*6d034093SMichal Simek { 110*6d034093SMichal Simek psu_mask_write(0xFD1A0108, 0x00000008U, 0x00000008U); 111*6d034093SMichal Simek psu_mask_write(0xFD070000, 0xE30FBE3DU, 0xC3081020U); 112*6d034093SMichal Simek psu_mask_write(0xFD070010, 0x8000F03FU, 0x00000030U); 113*6d034093SMichal Simek psu_mask_write(0xFD070020, 0x000003F3U, 0x00000102U); 114*6d034093SMichal Simek psu_mask_write(0xFD070024, 0xFFFFFFFFU, 0x0028B090U); 115*6d034093SMichal Simek psu_mask_write(0xFD070030, 0x0000007FU, 0x00000000U); 116*6d034093SMichal Simek psu_mask_write(0xFD070034, 0x00FFFF1FU, 0x00404310U); 117*6d034093SMichal Simek psu_mask_write(0xFD070050, 0x00F1F1F4U, 0x00210000U); 118*6d034093SMichal Simek psu_mask_write(0xFD070054, 0x0FFF0FFFU, 0x00000000U); 119*6d034093SMichal Simek psu_mask_write(0xFD070060, 0x00000073U, 0x00000001U); 120*6d034093SMichal Simek psu_mask_write(0xFD070064, 0x0FFF83FFU, 0x00208030U); 121*6d034093SMichal Simek psu_mask_write(0xFD070070, 0x00000017U, 0x00000010U); 122*6d034093SMichal Simek psu_mask_write(0xFD070074, 0x00000003U, 0x00000000U); 123*6d034093SMichal Simek psu_mask_write(0xFD0700C4, 0x3F000391U, 0x10000200U); 124*6d034093SMichal Simek psu_mask_write(0xFD0700C8, 0x01FF1F3FU, 0x0030051FU); 125*6d034093SMichal Simek psu_mask_write(0xFD0700D0, 0xC3FF0FFFU, 0x0002020AU); 126*6d034093SMichal Simek psu_mask_write(0xFD0700D4, 0x01FF7F0FU, 0x00360000U); 127*6d034093SMichal Simek psu_mask_write(0xFD0700D8, 0x0000FF0FU, 0x00001205U); 128*6d034093SMichal Simek psu_mask_write(0xFD0700DC, 0xFFFFFFFFU, 0x00240012U); 129*6d034093SMichal Simek psu_mask_write(0xFD0700E0, 0xFFFFFFFFU, 0x00310008U); 130*6d034093SMichal Simek psu_mask_write(0xFD0700E4, 0x00FF03FFU, 0x00210004U); 131*6d034093SMichal Simek psu_mask_write(0xFD0700E8, 0xFFFFFFFFU, 0x00000000U); 132*6d034093SMichal Simek psu_mask_write(0xFD0700EC, 0xFFFF0000U, 0x00000000U); 133*6d034093SMichal Simek psu_mask_write(0xFD0700F0, 0x0000003FU, 0x00000010U); 134*6d034093SMichal Simek psu_mask_write(0xFD0700F4, 0x00000FFFU, 0x0000077FU); 135*6d034093SMichal Simek psu_mask_write(0xFD070100, 0x7F3F7F3FU, 0x0E0B010CU); 136*6d034093SMichal Simek psu_mask_write(0xFD070104, 0x001F1F7FU, 0x00030412U); 137*6d034093SMichal Simek psu_mask_write(0xFD070108, 0x3F3F3F3FU, 0x04070F0DU); 138*6d034093SMichal Simek psu_mask_write(0xFD07010C, 0x3FF3F3FFU, 0x00A05000U); 139*6d034093SMichal Simek psu_mask_write(0xFD070110, 0x1F0F0F1FU, 0x05040306U); 140*6d034093SMichal Simek psu_mask_write(0xFD070114, 0x0F0F3F1FU, 0x01020404U); 141*6d034093SMichal Simek psu_mask_write(0xFD070118, 0x0F0F000FU, 0x01010004U); 142*6d034093SMichal Simek psu_mask_write(0xFD07011C, 0x00000F0FU, 0x00000201U); 143*6d034093SMichal Simek psu_mask_write(0xFD070120, 0x7F7F7F7FU, 0x03030303U); 144*6d034093SMichal Simek psu_mask_write(0xFD070124, 0x40070F3FU, 0x0004040DU); 145*6d034093SMichal Simek psu_mask_write(0xFD07012C, 0x7F1F031FU, 0x440C011CU); 146*6d034093SMichal Simek psu_mask_write(0xFD070130, 0x00030F1FU, 0x00020608U); 147*6d034093SMichal Simek psu_mask_write(0xFD070180, 0xF7FF03FFU, 0x810B0008U); 148*6d034093SMichal Simek psu_mask_write(0xFD070184, 0x3FFFFFFFU, 0x00E32DCBU); 149*6d034093SMichal Simek psu_mask_write(0xFD070190, 0x1FBFBF3FU, 0x048B8206U); 150*6d034093SMichal Simek psu_mask_write(0xFD070194, 0xF31F0F0FU, 0x00030304U); 151*6d034093SMichal Simek psu_mask_write(0xFD070198, 0x0FF1F1F1U, 0x07000101U); 152*6d034093SMichal Simek psu_mask_write(0xFD07019C, 0x000000F1U, 0x00000021U); 153*6d034093SMichal Simek psu_mask_write(0xFD0701A0, 0xC3FF03FFU, 0x00400003U); 154*6d034093SMichal Simek psu_mask_write(0xFD0701A4, 0x00FF00FFU, 0x00A00070U); 155*6d034093SMichal Simek psu_mask_write(0xFD0701B0, 0x00000007U, 0x00000004U); 156*6d034093SMichal Simek psu_mask_write(0xFD0701B4, 0x00003F3FU, 0x00000901U); 157*6d034093SMichal Simek psu_mask_write(0xFD0701C0, 0x00000007U, 0x00000001U); 158*6d034093SMichal Simek psu_mask_write(0xFD070200, 0x0000001FU, 0x00000015U); 159*6d034093SMichal Simek psu_mask_write(0xFD070204, 0x001F1F1FU, 0x00070707U); 160*6d034093SMichal Simek psu_mask_write(0xFD070208, 0x0F0F0F0FU, 0x00000000U); 161*6d034093SMichal Simek psu_mask_write(0xFD07020C, 0x0F0F0F0FU, 0x0F000000U); 162*6d034093SMichal Simek psu_mask_write(0xFD070210, 0x00000F0FU, 0x00000F0FU); 163*6d034093SMichal Simek psu_mask_write(0xFD070214, 0x0F0F0F0FU, 0x060F0606U); 164*6d034093SMichal Simek psu_mask_write(0xFD070218, 0x8F0F0F0FU, 0x0F060606U); 165*6d034093SMichal Simek psu_mask_write(0xFD07021C, 0x00000F0FU, 0x00000F0FU); 166*6d034093SMichal Simek psu_mask_write(0xFD070220, 0x00001F1FU, 0x00000000U); 167*6d034093SMichal Simek psu_mask_write(0xFD070224, 0x0F0F0F0FU, 0x06060606U); 168*6d034093SMichal Simek psu_mask_write(0xFD070228, 0x0F0F0F0FU, 0x06060606U); 169*6d034093SMichal Simek psu_mask_write(0xFD07022C, 0x0000000FU, 0x00000006U); 170*6d034093SMichal Simek psu_mask_write(0xFD070240, 0x0F1F0F7CU, 0x04000400U); 171*6d034093SMichal Simek psu_mask_write(0xFD070244, 0x00003333U, 0x00000000U); 172*6d034093SMichal Simek psu_mask_write(0xFD070250, 0x7FFF3F07U, 0x01002001U); 173*6d034093SMichal Simek psu_mask_write(0xFD070264, 0xFF00FFFFU, 0x08000040U); 174*6d034093SMichal Simek psu_mask_write(0xFD07026C, 0xFF00FFFFU, 0x08000040U); 175*6d034093SMichal Simek psu_mask_write(0xFD070280, 0xFFFFFFFFU, 0x00000000U); 176*6d034093SMichal Simek psu_mask_write(0xFD070284, 0xFFFFFFFFU, 0x00000000U); 177*6d034093SMichal Simek psu_mask_write(0xFD070288, 0xFFFFFFFFU, 0x00000000U); 178*6d034093SMichal Simek psu_mask_write(0xFD07028C, 0xFFFFFFFFU, 0x00000000U); 179*6d034093SMichal Simek psu_mask_write(0xFD070290, 0x0000FFFFU, 0x00000000U); 180*6d034093SMichal Simek psu_mask_write(0xFD070294, 0x00000001U, 0x00000001U); 181*6d034093SMichal Simek psu_mask_write(0xFD070300, 0x00000011U, 0x00000000U); 182*6d034093SMichal Simek psu_mask_write(0xFD07030C, 0x80000033U, 0x00000000U); 183*6d034093SMichal Simek psu_mask_write(0xFD070320, 0x00000001U, 0x00000000U); 184*6d034093SMichal Simek psu_mask_write(0xFD070400, 0x00000111U, 0x00000001U); 185*6d034093SMichal Simek psu_mask_write(0xFD070404, 0x000073FFU, 0x0000200FU); 186*6d034093SMichal Simek psu_mask_write(0xFD070408, 0x000073FFU, 0x0000200FU); 187*6d034093SMichal Simek psu_mask_write(0xFD070490, 0x00000001U, 0x00000001U); 188*6d034093SMichal Simek psu_mask_write(0xFD070494, 0x0033000FU, 0x0020000BU); 189*6d034093SMichal Simek psu_mask_write(0xFD070498, 0x07FF07FFU, 0x00000000U); 190*6d034093SMichal Simek psu_mask_write(0xFD0704B4, 0x000073FFU, 0x0000200FU); 191*6d034093SMichal Simek psu_mask_write(0xFD0704B8, 0x000073FFU, 0x0000200FU); 192*6d034093SMichal Simek psu_mask_write(0xFD070540, 0x00000001U, 0x00000001U); 193*6d034093SMichal Simek psu_mask_write(0xFD070544, 0x03330F0FU, 0x02000B03U); 194*6d034093SMichal Simek psu_mask_write(0xFD070548, 0x07FF07FFU, 0x00000000U); 195*6d034093SMichal Simek psu_mask_write(0xFD070564, 0x000073FFU, 0x0000200FU); 196*6d034093SMichal Simek psu_mask_write(0xFD070568, 0x000073FFU, 0x0000200FU); 197*6d034093SMichal Simek psu_mask_write(0xFD0705F0, 0x00000001U, 0x00000001U); 198*6d034093SMichal Simek psu_mask_write(0xFD0705F4, 0x03330F0FU, 0x02000B03U); 199*6d034093SMichal Simek psu_mask_write(0xFD0705F8, 0x07FF07FFU, 0x00000000U); 200*6d034093SMichal Simek psu_mask_write(0xFD070614, 0x000073FFU, 0x0000200FU); 201*6d034093SMichal Simek psu_mask_write(0xFD070618, 0x000073FFU, 0x0000200FU); 202*6d034093SMichal Simek psu_mask_write(0xFD0706A0, 0x00000001U, 0x00000001U); 203*6d034093SMichal Simek psu_mask_write(0xFD0706A4, 0x0033000FU, 0x00100003U); 204*6d034093SMichal Simek psu_mask_write(0xFD0706A8, 0x07FF07FFU, 0x0000004FU); 205*6d034093SMichal Simek psu_mask_write(0xFD0706AC, 0x0033000FU, 0x00100003U); 206*6d034093SMichal Simek psu_mask_write(0xFD0706B0, 0x000007FFU, 0x0000004FU); 207*6d034093SMichal Simek psu_mask_write(0xFD0706C4, 0x000073FFU, 0x0000200FU); 208*6d034093SMichal Simek psu_mask_write(0xFD0706C8, 0x000073FFU, 0x0000200FU); 209*6d034093SMichal Simek psu_mask_write(0xFD070750, 0x00000001U, 0x00000001U); 210*6d034093SMichal Simek psu_mask_write(0xFD070754, 0x0033000FU, 0x00100003U); 211*6d034093SMichal Simek psu_mask_write(0xFD070758, 0x07FF07FFU, 0x0000004FU); 212*6d034093SMichal Simek psu_mask_write(0xFD07075C, 0x0033000FU, 0x00100003U); 213*6d034093SMichal Simek psu_mask_write(0xFD070760, 0x000007FFU, 0x0000004FU); 214*6d034093SMichal Simek psu_mask_write(0xFD070774, 0x000073FFU, 0x0000200FU); 215*6d034093SMichal Simek psu_mask_write(0xFD070778, 0x000073FFU, 0x0000200FU); 216*6d034093SMichal Simek psu_mask_write(0xFD070800, 0x00000001U, 0x00000001U); 217*6d034093SMichal Simek psu_mask_write(0xFD070804, 0x0033000FU, 0x00100003U); 218*6d034093SMichal Simek psu_mask_write(0xFD070808, 0x07FF07FFU, 0x0000004FU); 219*6d034093SMichal Simek psu_mask_write(0xFD07080C, 0x0033000FU, 0x00100003U); 220*6d034093SMichal Simek psu_mask_write(0xFD070810, 0x000007FFU, 0x0000004FU); 221*6d034093SMichal Simek psu_mask_write(0xFD070F04, 0x000001FFU, 0x00000000U); 222*6d034093SMichal Simek psu_mask_write(0xFD070F08, 0x000000FFU, 0x00000000U); 223*6d034093SMichal Simek psu_mask_write(0xFD070F0C, 0x000001FFU, 0x00000010U); 224*6d034093SMichal Simek psu_mask_write(0xFD070F10, 0x000000FFU, 0x0000000FU); 225*6d034093SMichal Simek psu_mask_write(0xFD072190, 0x1FBFBF3FU, 0x07828002U); 226*6d034093SMichal Simek psu_mask_write(0xFD1A0108, 0x0000000CU, 0x00000000U); 227*6d034093SMichal Simek psu_mask_write(0xFD080010, 0xFFFFFFFFU, 0x87001E00U); 228*6d034093SMichal Simek psu_mask_write(0xFD080018, 0xFFFFFFFFU, 0x00F03D28U); 229*6d034093SMichal Simek psu_mask_write(0xFD08001C, 0xFFFFFFFFU, 0x55AA5480U); 230*6d034093SMichal Simek psu_mask_write(0xFD080024, 0xFFFFFFFFU, 0x010100F4U); 231*6d034093SMichal Simek psu_mask_write(0xFD080040, 0xFFFFFFFFU, 0x85642AD0U); 232*6d034093SMichal Simek psu_mask_write(0xFD080044, 0xFFFFFFFFU, 0xA0AA0580U); 233*6d034093SMichal Simek psu_mask_write(0xFD080068, 0xFFFFFFFFU, 0x05102000U); 234*6d034093SMichal Simek psu_mask_write(0xFD080090, 0xFFFFFFFFU, 0x02A040A1U); 235*6d034093SMichal Simek psu_mask_write(0xFD0800C0, 0xFFFFFFFFU, 0x000000D3U); 236*6d034093SMichal Simek psu_mask_write(0xFD080100, 0xFFFFFFFFU, 0x0000040DU); 237*6d034093SMichal Simek psu_mask_write(0xFD080110, 0xFFFFFFFFU, 0x06180C08U); 238*6d034093SMichal Simek psu_mask_write(0xFD080114, 0xFFFFFFFFU, 0x2816050AU); 239*6d034093SMichal Simek psu_mask_write(0xFD080118, 0xFFFFFFFFU, 0x00080064U); 240*6d034093SMichal Simek psu_mask_write(0xFD08011C, 0xFFFFFFFFU, 0x82000501U); 241*6d034093SMichal Simek psu_mask_write(0xFD080120, 0xFFFFFFFFU, 0x00602B08U); 242*6d034093SMichal Simek psu_mask_write(0xFD080124, 0xFFFFFFFFU, 0x00231008U); 243*6d034093SMichal Simek psu_mask_write(0xFD080128, 0xFFFFFFFFU, 0x0000080EU); 244*6d034093SMichal Simek psu_mask_write(0xFD080140, 0xFFFFFFFFU, 0x08400020U); 245*6d034093SMichal Simek psu_mask_write(0xFD080144, 0xFFFFFFFFU, 0x00000C80U); 246*6d034093SMichal Simek psu_mask_write(0xFD080150, 0xFFFFFFFFU, 0x00000000U); 247*6d034093SMichal Simek psu_mask_write(0xFD080154, 0xFFFFFFFFU, 0x00000000U); 248*6d034093SMichal Simek psu_mask_write(0xFD080180, 0xFFFFFFFFU, 0x00000000U); 249*6d034093SMichal Simek psu_mask_write(0xFD080184, 0xFFFFFFFFU, 0x00000024U); 250*6d034093SMichal Simek psu_mask_write(0xFD080188, 0xFFFFFFFFU, 0x00000012U); 251*6d034093SMichal Simek psu_mask_write(0xFD08018C, 0xFFFFFFFFU, 0x00000031U); 252*6d034093SMichal Simek psu_mask_write(0xFD080190, 0xFFFFFFFFU, 0x00000008U); 253*6d034093SMichal Simek psu_mask_write(0xFD080194, 0xFFFFFFFFU, 0x00000000U); 254*6d034093SMichal Simek psu_mask_write(0xFD080198, 0xFFFFFFFFU, 0x00000000U); 255*6d034093SMichal Simek psu_mask_write(0xFD0801AC, 0xFFFFFFFFU, 0x00000056U); 256*6d034093SMichal Simek psu_mask_write(0xFD0801B0, 0xFFFFFFFFU, 0x00000021U); 257*6d034093SMichal Simek psu_mask_write(0xFD0801B4, 0xFFFFFFFFU, 0x00000008U); 258*6d034093SMichal Simek psu_mask_write(0xFD0801B8, 0xFFFFFFFFU, 0x00000019U); 259*6d034093SMichal Simek psu_mask_write(0xFD0801D8, 0xFFFFFFFFU, 0x00000016U); 260*6d034093SMichal Simek psu_mask_write(0xFD080200, 0xFFFFFFFFU, 0x810091C7U); 261*6d034093SMichal Simek psu_mask_write(0xFD080204, 0xFFFFFFFFU, 0x00030236U); 262*6d034093SMichal Simek psu_mask_write(0xFD080240, 0xFFFFFFFFU, 0x00141054U); 263*6d034093SMichal Simek psu_mask_write(0xFD080250, 0xFFFFFFFFU, 0x00088000U); 264*6d034093SMichal Simek psu_mask_write(0xFD080414, 0xFFFFFFFFU, 0x12340800U); 265*6d034093SMichal Simek psu_mask_write(0xFD0804F4, 0xFFFFFFFFU, 0x0000000AU); 266*6d034093SMichal Simek psu_mask_write(0xFD080500, 0xFFFFFFFFU, 0x30000028U); 267*6d034093SMichal Simek psu_mask_write(0xFD080508, 0xFFFFFFFFU, 0x00000000U); 268*6d034093SMichal Simek psu_mask_write(0xFD08050C, 0xFFFFFFFFU, 0x00000005U); 269*6d034093SMichal Simek psu_mask_write(0xFD080510, 0xFFFFFFFFU, 0x00000000U); 270*6d034093SMichal Simek psu_mask_write(0xFD080520, 0xFFFFFFFFU, 0x0300BD99U); 271*6d034093SMichal Simek psu_mask_write(0xFD080528, 0xFFFFFFFFU, 0xF1032019U); 272*6d034093SMichal Simek psu_mask_write(0xFD08052C, 0xFFFFFFFFU, 0x07F001E3U); 273*6d034093SMichal Simek psu_mask_write(0xFD080544, 0xFFFFFFFFU, 0x00000000U); 274*6d034093SMichal Simek psu_mask_write(0xFD080548, 0xFFFFFFFFU, 0x00000000U); 275*6d034093SMichal Simek psu_mask_write(0xFD080558, 0xFFFFFFFFU, 0x00000000U); 276*6d034093SMichal Simek psu_mask_write(0xFD08055C, 0xFFFFFFFFU, 0x00000000U); 277*6d034093SMichal Simek psu_mask_write(0xFD080560, 0xFFFFFFFFU, 0x00000000U); 278*6d034093SMichal Simek psu_mask_write(0xFD080564, 0xFFFFFFFFU, 0x00000000U); 279*6d034093SMichal Simek psu_mask_write(0xFD080680, 0xFFFFFFFFU, 0x00894C58U); 280*6d034093SMichal Simek psu_mask_write(0xFD080684, 0xFFFFFFFFU, 0x0001B39BU); 281*6d034093SMichal Simek psu_mask_write(0xFD080694, 0xFFFFFFFFU, 0x01E10210U); 282*6d034093SMichal Simek psu_mask_write(0xFD080698, 0xFFFFFFFFU, 0x01E10000U); 283*6d034093SMichal Simek psu_mask_write(0xFD0806A4, 0xFFFFFFFFU, 0x0001BB9BU); 284*6d034093SMichal Simek psu_mask_write(0xFD080700, 0xFFFFFFFFU, 0x40800604U); 285*6d034093SMichal Simek psu_mask_write(0xFD080710, 0xFFFFFFFFU, 0x0E00F50CU); 286*6d034093SMichal Simek psu_mask_write(0xFD080714, 0xFFFFFFFFU, 0x09091616U); 287*6d034093SMichal Simek psu_mask_write(0xFD080718, 0xFFFFFFFFU, 0x09092B2BU); 288*6d034093SMichal Simek psu_mask_write(0xFD080800, 0xFFFFFFFFU, 0x40800604U); 289*6d034093SMichal Simek psu_mask_write(0xFD080810, 0xFFFFFFFFU, 0x0E00F50CU); 290*6d034093SMichal Simek psu_mask_write(0xFD080814, 0xFFFFFFFFU, 0x09091616U); 291*6d034093SMichal Simek psu_mask_write(0xFD080818, 0xFFFFFFFFU, 0x09092B2BU); 292*6d034093SMichal Simek psu_mask_write(0xFD080900, 0xFFFFFFFFU, 0x40800604U); 293*6d034093SMichal Simek psu_mask_write(0xFD080904, 0xFFFFFFFFU, 0x00007FFFU); 294*6d034093SMichal Simek psu_mask_write(0xFD080910, 0xFFFFFFFFU, 0x0E00F50CU); 295*6d034093SMichal Simek psu_mask_write(0xFD080914, 0xFFFFFFFFU, 0x09091616U); 296*6d034093SMichal Simek psu_mask_write(0xFD080918, 0xFFFFFFFFU, 0x09092B2BU); 297*6d034093SMichal Simek psu_mask_write(0xFD080A00, 0xFFFFFFFFU, 0x40800604U); 298*6d034093SMichal Simek psu_mask_write(0xFD080A04, 0xFFFFFFFFU, 0x00007FFFU); 299*6d034093SMichal Simek psu_mask_write(0xFD080A10, 0xFFFFFFFFU, 0x0E00F50CU); 300*6d034093SMichal Simek psu_mask_write(0xFD080A14, 0xFFFFFFFFU, 0x09091616U); 301*6d034093SMichal Simek psu_mask_write(0xFD080A18, 0xFFFFFFFFU, 0x09092B2BU); 302*6d034093SMichal Simek psu_mask_write(0xFD080B00, 0xFFFFFFFFU, 0x40800604U); 303*6d034093SMichal Simek psu_mask_write(0xFD080B04, 0xFFFFFFFFU, 0x00007F00U); 304*6d034093SMichal Simek psu_mask_write(0xFD080B10, 0xFFFFFFFFU, 0x0E00BD0CU); 305*6d034093SMichal Simek psu_mask_write(0xFD080B14, 0xFFFFFFFFU, 0x09091616U); 306*6d034093SMichal Simek psu_mask_write(0xFD080B18, 0xFFFFFFFFU, 0x09092B2BU); 307*6d034093SMichal Simek psu_mask_write(0xFD080C00, 0xFFFFFFFFU, 0x40800604U); 308*6d034093SMichal Simek psu_mask_write(0xFD080C04, 0xFFFFFFFFU, 0x00007F00U); 309*6d034093SMichal Simek psu_mask_write(0xFD080C10, 0xFFFFFFFFU, 0x0E00BD0CU); 310*6d034093SMichal Simek psu_mask_write(0xFD080C14, 0xFFFFFFFFU, 0x09091616U); 311*6d034093SMichal Simek psu_mask_write(0xFD080C18, 0xFFFFFFFFU, 0x09092B2BU); 312*6d034093SMichal Simek psu_mask_write(0xFD080D00, 0xFFFFFFFFU, 0x40800604U); 313*6d034093SMichal Simek psu_mask_write(0xFD080D04, 0xFFFFFFFFU, 0x00007F00U); 314*6d034093SMichal Simek psu_mask_write(0xFD080D10, 0xFFFFFFFFU, 0x0E00BD0CU); 315*6d034093SMichal Simek psu_mask_write(0xFD080D14, 0xFFFFFFFFU, 0x09091616U); 316*6d034093SMichal Simek psu_mask_write(0xFD080D18, 0xFFFFFFFFU, 0x09092B2BU); 317*6d034093SMichal Simek psu_mask_write(0xFD080E00, 0xFFFFFFFFU, 0x40800604U); 318*6d034093SMichal Simek psu_mask_write(0xFD080E04, 0xFFFFFFFFU, 0x00007F00U); 319*6d034093SMichal Simek psu_mask_write(0xFD080E10, 0xFFFFFFFFU, 0x0E00BD0CU); 320*6d034093SMichal Simek psu_mask_write(0xFD080E14, 0xFFFFFFFFU, 0x09091616U); 321*6d034093SMichal Simek psu_mask_write(0xFD080E18, 0xFFFFFFFFU, 0x09092B2BU); 322*6d034093SMichal Simek psu_mask_write(0xFD080F00, 0xFFFFFFFFU, 0x40800624U); 323*6d034093SMichal Simek psu_mask_write(0xFD080F04, 0xFFFFFFFFU, 0x00007F00U); 324*6d034093SMichal Simek psu_mask_write(0xFD080F10, 0xFFFFFFFFU, 0x0E00BD0CU); 325*6d034093SMichal Simek psu_mask_write(0xFD080F14, 0xFFFFFFFFU, 0x09091616U); 326*6d034093SMichal Simek psu_mask_write(0xFD080F18, 0xFFFFFFFFU, 0x09092B2BU); 327*6d034093SMichal Simek psu_mask_write(0xFD081400, 0xFFFFFFFFU, 0x2A019FFEU); 328*6d034093SMichal Simek psu_mask_write(0xFD081404, 0xFFFFFFFFU, 0x05102000U); 329*6d034093SMichal Simek psu_mask_write(0xFD08141C, 0xFFFFFFFFU, 0x01264300U); 330*6d034093SMichal Simek psu_mask_write(0xFD08142C, 0xFFFFFFFFU, 0x000C1800U); 331*6d034093SMichal Simek psu_mask_write(0xFD081430, 0xFFFFFFFFU, 0x71000000U); 332*6d034093SMichal Simek psu_mask_write(0xFD081440, 0xFFFFFFFFU, 0x2A019FFEU); 333*6d034093SMichal Simek psu_mask_write(0xFD081444, 0xFFFFFFFFU, 0x05102000U); 334*6d034093SMichal Simek psu_mask_write(0xFD08145C, 0xFFFFFFFFU, 0x01264300U); 335*6d034093SMichal Simek psu_mask_write(0xFD08146C, 0xFFFFFFFFU, 0x000C1800U); 336*6d034093SMichal Simek psu_mask_write(0xFD081470, 0xFFFFFFFFU, 0x71000000U); 337*6d034093SMichal Simek psu_mask_write(0xFD081480, 0xFFFFFFFFU, 0x2A019FFEU); 338*6d034093SMichal Simek psu_mask_write(0xFD081484, 0xFFFFFFFFU, 0x05102000U); 339*6d034093SMichal Simek psu_mask_write(0xFD08149C, 0xFFFFFFFFU, 0x01264300U); 340*6d034093SMichal Simek psu_mask_write(0xFD0814AC, 0xFFFFFFFFU, 0x000C1800U); 341*6d034093SMichal Simek psu_mask_write(0xFD0814B0, 0xFFFFFFFFU, 0x71000000U); 342*6d034093SMichal Simek psu_mask_write(0xFD0814C0, 0xFFFFFFFFU, 0x2A019FFEU); 343*6d034093SMichal Simek psu_mask_write(0xFD0814C4, 0xFFFFFFFFU, 0x05102000U); 344*6d034093SMichal Simek psu_mask_write(0xFD0814DC, 0xFFFFFFFFU, 0x01264300U); 345*6d034093SMichal Simek psu_mask_write(0xFD0814EC, 0xFFFFFFFFU, 0x000C1800U); 346*6d034093SMichal Simek psu_mask_write(0xFD0814F0, 0xFFFFFFFFU, 0x71000000U); 347*6d034093SMichal Simek psu_mask_write(0xFD081500, 0xFFFFFFFFU, 0x2A019FFEU); 348*6d034093SMichal Simek psu_mask_write(0xFD081504, 0xFFFFFFFFU, 0x05102000U); 349*6d034093SMichal Simek psu_mask_write(0xFD08151C, 0xFFFFFFFFU, 0x01264300U); 350*6d034093SMichal Simek psu_mask_write(0xFD08152C, 0xFFFFFFFFU, 0x000C1800U); 351*6d034093SMichal Simek psu_mask_write(0xFD081530, 0xFFFFFFFFU, 0x71000000U); 352*6d034093SMichal Simek psu_mask_write(0xFD0817C4, 0xFFFFFFFFU, 0x05102000U); 353*6d034093SMichal Simek psu_mask_write(0xFD0817DC, 0xFFFFFFFFU, 0x012643C4U); 354*6d034093SMichal Simek 355*6d034093SMichal Simek return 1; 356*6d034093SMichal Simek } 357*6d034093SMichal Simek 358*6d034093SMichal Simek static unsigned long psu_ddr_qos_init_data(void) 359*6d034093SMichal Simek { 360*6d034093SMichal Simek psu_mask_write(0xFD090000, 0x0000FFFFU, 0x00000845U); 361*6d034093SMichal Simek psu_mask_write(0xFD090004, 0x002DB5ADU, 0x002DB5ADU); 362*6d034093SMichal Simek psu_mask_write(0xFD090800, 0xFFFFFFFFU, 0x00000001U); 363*6d034093SMichal Simek psu_mask_write(0xFD09000C, 0x0000007FU, 0x00000010U); 364*6d034093SMichal Simek psu_mask_write(0xFD090010, 0x0000007FU, 0x00000010U); 365*6d034093SMichal Simek psu_mask_write(0xFD380008, 0x0000000FU, 0x00000007U); 366*6d034093SMichal Simek psu_mask_write(0xFD38001C, 0x0000000FU, 0x0000000FU); 367*6d034093SMichal Simek psu_mask_write(0xFD390008, 0x0000000FU, 0x00000003U); 368*6d034093SMichal Simek psu_mask_write(0xFD39001C, 0x0000000FU, 0x00000003U); 369*6d034093SMichal Simek psu_mask_write(0xFD3A0008, 0x0000000FU, 0x00000003U); 370*6d034093SMichal Simek psu_mask_write(0xFD3A001C, 0x0000000FU, 0x00000003U); 371*6d034093SMichal Simek psu_mask_write(0xFD3B0008, 0x0000000FU, 0x00000003U); 372*6d034093SMichal Simek psu_mask_write(0xFD3B001C, 0x0000000FU, 0x00000003U); 373*6d034093SMichal Simek 374*6d034093SMichal Simek return 1; 375*6d034093SMichal Simek } 376*6d034093SMichal Simek 377*6d034093SMichal Simek static unsigned long psu_mio_init_data(void) 378*6d034093SMichal Simek { 379*6d034093SMichal Simek psu_mask_write(0xFF180000, 0x000000FEU, 0x000000C0U); 380*6d034093SMichal Simek psu_mask_write(0xFF180004, 0x000000FEU, 0x000000C0U); 381*6d034093SMichal Simek psu_mask_write(0xFF180008, 0x000000FEU, 0x000000C0U); 382*6d034093SMichal Simek psu_mask_write(0xFF18000C, 0x000000FEU, 0x000000C0U); 383*6d034093SMichal Simek psu_mask_write(0xFF180010, 0x000000FEU, 0x00000040U); 384*6d034093SMichal Simek psu_mask_write(0xFF180014, 0x000000FEU, 0x00000040U); 385*6d034093SMichal Simek psu_mask_write(0xFF180018, 0x000000FEU, 0x00000080U); 386*6d034093SMichal Simek psu_mask_write(0xFF18001C, 0x000000FEU, 0x00000000U); 387*6d034093SMichal Simek psu_mask_write(0xFF180020, 0x000000FEU, 0x00000000U); 388*6d034093SMichal Simek psu_mask_write(0xFF180024, 0x000000FEU, 0x00000080U); 389*6d034093SMichal Simek psu_mask_write(0xFF180028, 0x000000FEU, 0x00000080U); 390*6d034093SMichal Simek psu_mask_write(0xFF18002C, 0x000000FEU, 0x00000080U); 391*6d034093SMichal Simek psu_mask_write(0xFF180030, 0x000000FEU, 0x00000000U); 392*6d034093SMichal Simek psu_mask_write(0xFF180034, 0x000000FEU, 0x00000008U); 393*6d034093SMichal Simek psu_mask_write(0xFF180038, 0x000000FEU, 0x00000008U); 394*6d034093SMichal Simek psu_mask_write(0xFF18003C, 0x000000FEU, 0x00000008U); 395*6d034093SMichal Simek psu_mask_write(0xFF180040, 0x000000FEU, 0x00000008U); 396*6d034093SMichal Simek psu_mask_write(0xFF180044, 0x000000FEU, 0x00000000U); 397*6d034093SMichal Simek psu_mask_write(0xFF180048, 0x000000FEU, 0x00000000U); 398*6d034093SMichal Simek psu_mask_write(0xFF18004C, 0x000000FEU, 0x00000000U); 399*6d034093SMichal Simek psu_mask_write(0xFF180050, 0x000000FEU, 0x00000000U); 400*6d034093SMichal Simek psu_mask_write(0xFF180054, 0x000000FEU, 0x00000008U); 401*6d034093SMichal Simek psu_mask_write(0xFF180058, 0x000000FEU, 0x00000008U); 402*6d034093SMichal Simek psu_mask_write(0xFF18005C, 0x000000FEU, 0x00000000U); 403*6d034093SMichal Simek psu_mask_write(0xFF180060, 0x000000FEU, 0x00000008U); 404*6d034093SMichal Simek psu_mask_write(0xFF180064, 0x000000FEU, 0x00000000U); 405*6d034093SMichal Simek psu_mask_write(0xFF180068, 0x000000FEU, 0x00000000U); 406*6d034093SMichal Simek psu_mask_write(0xFF18006C, 0x000000FEU, 0x00000018U); 407*6d034093SMichal Simek psu_mask_write(0xFF180070, 0x000000FEU, 0x00000018U); 408*6d034093SMichal Simek psu_mask_write(0xFF180074, 0x000000FEU, 0x00000018U); 409*6d034093SMichal Simek psu_mask_write(0xFF180078, 0x000000FEU, 0x00000018U); 410*6d034093SMichal Simek psu_mask_write(0xFF18007C, 0x000000FEU, 0x00000000U); 411*6d034093SMichal Simek psu_mask_write(0xFF180080, 0x000000FEU, 0x00000008U); 412*6d034093SMichal Simek psu_mask_write(0xFF180084, 0x000000FEU, 0x00000008U); 413*6d034093SMichal Simek psu_mask_write(0xFF180088, 0x000000FEU, 0x00000008U); 414*6d034093SMichal Simek psu_mask_write(0xFF18008C, 0x000000FEU, 0x00000000U); 415*6d034093SMichal Simek psu_mask_write(0xFF180090, 0x000000FEU, 0x00000000U); 416*6d034093SMichal Simek psu_mask_write(0xFF180094, 0x000000FEU, 0x00000000U); 417*6d034093SMichal Simek psu_mask_write(0xFF180098, 0x000000FEU, 0x00000080U); 418*6d034093SMichal Simek psu_mask_write(0xFF18009C, 0x000000FEU, 0x00000000U); 419*6d034093SMichal Simek psu_mask_write(0xFF1800A0, 0x000000FEU, 0x00000000U); 420*6d034093SMichal Simek psu_mask_write(0xFF1800A4, 0x000000FEU, 0x00000080U); 421*6d034093SMichal Simek psu_mask_write(0xFF1800A8, 0x000000FEU, 0x00000080U); 422*6d034093SMichal Simek psu_mask_write(0xFF1800AC, 0x000000FEU, 0x00000080U); 423*6d034093SMichal Simek psu_mask_write(0xFF1800B0, 0x000000FEU, 0x00000000U); 424*6d034093SMichal Simek psu_mask_write(0xFF1800B4, 0x000000FEU, 0x00000000U); 425*6d034093SMichal Simek psu_mask_write(0xFF1800B8, 0x000000FEU, 0x00000010U); 426*6d034093SMichal Simek psu_mask_write(0xFF1800BC, 0x000000FEU, 0x00000010U); 427*6d034093SMichal Simek psu_mask_write(0xFF1800C0, 0x000000FEU, 0x00000010U); 428*6d034093SMichal Simek psu_mask_write(0xFF1800C4, 0x000000FEU, 0x00000010U); 429*6d034093SMichal Simek psu_mask_write(0xFF1800C8, 0x000000FEU, 0x00000010U); 430*6d034093SMichal Simek psu_mask_write(0xFF1800CC, 0x000000FEU, 0x00000010U); 431*6d034093SMichal Simek psu_mask_write(0xFF1800D0, 0x000000FEU, 0x00000004U); 432*6d034093SMichal Simek psu_mask_write(0xFF1800D4, 0x000000FEU, 0x00000004U); 433*6d034093SMichal Simek psu_mask_write(0xFF1800D8, 0x000000FEU, 0x00000004U); 434*6d034093SMichal Simek psu_mask_write(0xFF1800DC, 0x000000FEU, 0x00000004U); 435*6d034093SMichal Simek psu_mask_write(0xFF1800E0, 0x000000FEU, 0x00000004U); 436*6d034093SMichal Simek psu_mask_write(0xFF1800E4, 0x000000FEU, 0x00000004U); 437*6d034093SMichal Simek psu_mask_write(0xFF1800E8, 0x000000FEU, 0x00000004U); 438*6d034093SMichal Simek psu_mask_write(0xFF1800EC, 0x000000FEU, 0x00000004U); 439*6d034093SMichal Simek psu_mask_write(0xFF1800F0, 0x000000FEU, 0x00000004U); 440*6d034093SMichal Simek psu_mask_write(0xFF1800F4, 0x000000FEU, 0x00000004U); 441*6d034093SMichal Simek psu_mask_write(0xFF1800F8, 0x000000FEU, 0x00000004U); 442*6d034093SMichal Simek psu_mask_write(0xFF1800FC, 0x000000FEU, 0x00000004U); 443*6d034093SMichal Simek psu_mask_write(0xFF180100, 0x000000FEU, 0x00000004U); 444*6d034093SMichal Simek psu_mask_write(0xFF180104, 0x000000FEU, 0x00000004U); 445*6d034093SMichal Simek psu_mask_write(0xFF180108, 0x000000FEU, 0x00000004U); 446*6d034093SMichal Simek psu_mask_write(0xFF18010C, 0x000000FEU, 0x00000004U); 447*6d034093SMichal Simek psu_mask_write(0xFF180110, 0x000000FEU, 0x00000004U); 448*6d034093SMichal Simek psu_mask_write(0xFF180114, 0x000000FEU, 0x00000004U); 449*6d034093SMichal Simek psu_mask_write(0xFF180118, 0x000000FEU, 0x00000004U); 450*6d034093SMichal Simek psu_mask_write(0xFF18011C, 0x000000FEU, 0x00000004U); 451*6d034093SMichal Simek psu_mask_write(0xFF180120, 0x000000FEU, 0x00000004U); 452*6d034093SMichal Simek psu_mask_write(0xFF180124, 0x000000FEU, 0x00000004U); 453*6d034093SMichal Simek psu_mask_write(0xFF180128, 0x000000FEU, 0x00000004U); 454*6d034093SMichal Simek psu_mask_write(0xFF18012C, 0x000000FEU, 0x00000004U); 455*6d034093SMichal Simek psu_mask_write(0xFF180130, 0x000000FEU, 0x00000000U); 456*6d034093SMichal Simek psu_mask_write(0xFF180134, 0x000000FEU, 0x00000000U); 457*6d034093SMichal Simek psu_mask_write(0xFF180204, 0xFFFFFFFFU, 0x51000006U); 458*6d034093SMichal Simek psu_mask_write(0xFF180208, 0xFFFFFFFFU, 0x00B00000U); 459*6d034093SMichal Simek psu_mask_write(0xFF18020C, 0x00003FFFU, 0x0000000BU); 460*6d034093SMichal Simek psu_mask_write(0xFF180138, 0x03FFFFFFU, 0x039E1FFFU); 461*6d034093SMichal Simek psu_mask_write(0xFF18013C, 0x03FFFFFFU, 0x03FFFFFFU); 462*6d034093SMichal Simek psu_mask_write(0xFF180140, 0x03FFFFFFU, 0x00000000U); 463*6d034093SMichal Simek psu_mask_write(0xFF180144, 0x03FFFFFFU, 0x03FFFFFFU); 464*6d034093SMichal Simek psu_mask_write(0xFF180148, 0x03FFFFFFU, 0x03FFFFFFU); 465*6d034093SMichal Simek psu_mask_write(0xFF18014C, 0x03FFFFFFU, 0x00000000U); 466*6d034093SMichal Simek psu_mask_write(0xFF180154, 0x03FFFFFFU, 0x03FFFFFFU); 467*6d034093SMichal Simek psu_mask_write(0xFF180158, 0x03FFFFFFU, 0x03FFFFFFU); 468*6d034093SMichal Simek psu_mask_write(0xFF18015C, 0x03FFFFFFU, 0x00000000U); 469*6d034093SMichal Simek psu_mask_write(0xFF180160, 0x03FFFFFFU, 0x03FFFFFFU); 470*6d034093SMichal Simek psu_mask_write(0xFF180164, 0x03FFFFFFU, 0x03FFFFFFU); 471*6d034093SMichal Simek psu_mask_write(0xFF180168, 0x03FFFFFFU, 0x00000000U); 472*6d034093SMichal Simek psu_mask_write(0xFF180170, 0x03FFFFFFU, 0x03FFFFFFU); 473*6d034093SMichal Simek psu_mask_write(0xFF180174, 0x03FFFFFFU, 0x03FFFFFFU); 474*6d034093SMichal Simek psu_mask_write(0xFF180178, 0x03FFFFFFU, 0x00000000U); 475*6d034093SMichal Simek psu_mask_write(0xFF18017C, 0x03FFFFFFU, 0x03FFFFFFU); 476*6d034093SMichal Simek psu_mask_write(0xFF180180, 0x03FFFFFFU, 0x03FFFFFFU); 477*6d034093SMichal Simek psu_mask_write(0xFF180184, 0x03FFFFFFU, 0x00000000U); 478*6d034093SMichal Simek psu_mask_write(0xFF180200, 0x0000000FU, 0x00000000U); 479*6d034093SMichal Simek 480*6d034093SMichal Simek return 1; 481*6d034093SMichal Simek } 482*6d034093SMichal Simek 483*6d034093SMichal Simek static unsigned long psu_peripherals_init_data(void) 484*6d034093SMichal Simek { 485*6d034093SMichal Simek psu_mask_write(0xFD1A0100, 0x0001007CU, 0x00000000U); 486*6d034093SMichal Simek psu_mask_write(0xFF5E0238, 0x001A0000U, 0x00000000U); 487*6d034093SMichal Simek psu_mask_write(0xFF5E023C, 0x0093C018U, 0x00000000U); 488*6d034093SMichal Simek psu_mask_write(0xFF5E023C, 0x00000FC0U, 0x00000000U); 489*6d034093SMichal Simek psu_mask_write(0xFF5E0238, 0x00000060U, 0x00000000U); 490*6d034093SMichal Simek psu_mask_write(0xFF180310, 0x00008001U, 0x00000000U); 491*6d034093SMichal Simek psu_mask_write(0xFF180320, 0x33803380U, 0x00800080U); 492*6d034093SMichal Simek psu_mask_write(0xFF18031C, 0x00007FFEU, 0x00006450U); 493*6d034093SMichal Simek psu_mask_write(0xFF180358, 0x00080000U, 0x00080000U); 494*6d034093SMichal Simek psu_mask_write(0xFF18031C, 0x7FFE0000U, 0x64500000U); 495*6d034093SMichal Simek psu_mask_write(0xFF180358, 0x00000008U, 0x00000008U); 496*6d034093SMichal Simek psu_mask_write(0xFF180324, 0x000003C0U, 0x00000000U); 497*6d034093SMichal Simek psu_mask_write(0xFF180324, 0x03C00000U, 0x00000000U); 498*6d034093SMichal Simek psu_mask_write(0xFF5E0238, 0x00000400U, 0x00000000U); 499*6d034093SMichal Simek psu_mask_write(0xFF5E0238, 0x00000018U, 0x00000000U); 500*6d034093SMichal Simek psu_mask_write(0xFF5E0238, 0x00000800U, 0x00000000U); 501*6d034093SMichal Simek psu_mask_write(0xFF5E0238, 0x00000006U, 0x00000000U); 502*6d034093SMichal Simek psu_mask_write(0xFD4AB120, 0x00000007U, 0x00000007U); 503*6d034093SMichal Simek psu_mask_write(0xFF000034, 0x000000FFU, 0x00000005U); 504*6d034093SMichal Simek psu_mask_write(0xFF000018, 0x0000FFFFU, 0x0000008FU); 505*6d034093SMichal Simek psu_mask_write(0xFF000000, 0x000001FFU, 0x00000017U); 506*6d034093SMichal Simek psu_mask_write(0xFF000004, 0x000003FFU, 0x00000020U); 507*6d034093SMichal Simek psu_mask_write(0xFF010034, 0x000000FFU, 0x00000005U); 508*6d034093SMichal Simek psu_mask_write(0xFF010018, 0x0000FFFFU, 0x0000008FU); 509*6d034093SMichal Simek psu_mask_write(0xFF010000, 0x000001FFU, 0x00000017U); 510*6d034093SMichal Simek psu_mask_write(0xFF010004, 0x000003FFU, 0x00000020U); 511*6d034093SMichal Simek psu_mask_write(0xFF5E0238, 0x00040000U, 0x00000000U); 512*6d034093SMichal Simek psu_mask_write(0xFF4B0024, 0x000000FFU, 0x000000FFU); 513*6d034093SMichal Simek psu_mask_write(0xFFCA5000, 0x00001FFFU, 0x00000000U); 514*6d034093SMichal Simek psu_mask_write(0xFD5C0060, 0x000F000FU, 0x00000000U); 515*6d034093SMichal Simek psu_mask_write(0xFFA60040, 0x80000000U, 0x80000000U); 516*6d034093SMichal Simek psu_mask_write(0xFF260020, 0xFFFFFFFFU, 0x05F5DD17U); 517*6d034093SMichal Simek psu_mask_write(0xFF260000, 0x00000001U, 0x00000001U); 518*6d034093SMichal Simek 519*6d034093SMichal Simek return 1; 520*6d034093SMichal Simek } 521*6d034093SMichal Simek 522*6d034093SMichal Simek static unsigned long psu_serdes_init_data(void) 523*6d034093SMichal Simek { 524*6d034093SMichal Simek psu_mask_write(0xFD410000, 0x0000001FU, 0x00000009U); 525*6d034093SMichal Simek psu_mask_write(0xFD410004, 0x0000001FU, 0x00000009U); 526*6d034093SMichal Simek psu_mask_write(0xFD410008, 0x0000001FU, 0x00000008U); 527*6d034093SMichal Simek psu_mask_write(0xFD41000C, 0x0000001FU, 0x00000008U); 528*6d034093SMichal Simek psu_mask_write(0xFD402860, 0x00000082U, 0x00000002U); 529*6d034093SMichal Simek psu_mask_write(0xFD402864, 0x00000080U, 0x00000080U); 530*6d034093SMichal Simek psu_mask_write(0xFD402868, 0x00000081U, 0x00000001U); 531*6d034093SMichal Simek psu_mask_write(0xFD40286C, 0x00000081U, 0x00000001U); 532*6d034093SMichal Simek psu_mask_write(0xFD40A094, 0x00000010U, 0x00000010U); 533*6d034093SMichal Simek psu_mask_write(0xFD40E094, 0x00000010U, 0x00000010U); 534*6d034093SMichal Simek psu_mask_write(0xFD40A368, 0x000000FFU, 0x00000038U); 535*6d034093SMichal Simek psu_mask_write(0xFD40A36C, 0x00000007U, 0x00000003U); 536*6d034093SMichal Simek psu_mask_write(0xFD40E368, 0x000000FFU, 0x00000038U); 537*6d034093SMichal Simek psu_mask_write(0xFD40E36C, 0x00000007U, 0x00000003U); 538*6d034093SMichal Simek psu_mask_write(0xFD402368, 0x000000FFU, 0x00000058U); 539*6d034093SMichal Simek psu_mask_write(0xFD40236C, 0x00000007U, 0x00000003U); 540*6d034093SMichal Simek psu_mask_write(0xFD406368, 0x000000FFU, 0x00000058U); 541*6d034093SMichal Simek psu_mask_write(0xFD40636C, 0x00000007U, 0x00000003U); 542*6d034093SMichal Simek psu_mask_write(0xFD402370, 0x000000FFU, 0x0000007CU); 543*6d034093SMichal Simek psu_mask_write(0xFD402374, 0x000000FFU, 0x00000033U); 544*6d034093SMichal Simek psu_mask_write(0xFD402378, 0x000000FFU, 0x00000002U); 545*6d034093SMichal Simek psu_mask_write(0xFD40237C, 0x00000033U, 0x00000030U); 546*6d034093SMichal Simek psu_mask_write(0xFD406370, 0x000000FFU, 0x0000007CU); 547*6d034093SMichal Simek psu_mask_write(0xFD406374, 0x000000FFU, 0x00000033U); 548*6d034093SMichal Simek psu_mask_write(0xFD406378, 0x000000FFU, 0x00000002U); 549*6d034093SMichal Simek psu_mask_write(0xFD40637C, 0x00000033U, 0x00000030U); 550*6d034093SMichal Simek psu_mask_write(0xFD40A370, 0x000000FFU, 0x000000F4U); 551*6d034093SMichal Simek psu_mask_write(0xFD40A374, 0x000000FFU, 0x00000031U); 552*6d034093SMichal Simek psu_mask_write(0xFD40A378, 0x000000FFU, 0x00000002U); 553*6d034093SMichal Simek psu_mask_write(0xFD40A37C, 0x00000033U, 0x00000030U); 554*6d034093SMichal Simek psu_mask_write(0xFD40E370, 0x000000FFU, 0x000000F4U); 555*6d034093SMichal Simek psu_mask_write(0xFD40E374, 0x000000FFU, 0x00000031U); 556*6d034093SMichal Simek psu_mask_write(0xFD40E378, 0x000000FFU, 0x00000002U); 557*6d034093SMichal Simek psu_mask_write(0xFD40E37C, 0x00000033U, 0x00000030U); 558*6d034093SMichal Simek psu_mask_write(0xFD40906C, 0x00000003U, 0x00000003U); 559*6d034093SMichal Simek psu_mask_write(0xFD4080F4, 0x00000003U, 0x00000003U); 560*6d034093SMichal Simek psu_mask_write(0xFD40D06C, 0x00000003U, 0x00000003U); 561*6d034093SMichal Simek psu_mask_write(0xFD40C0F4, 0x00000003U, 0x00000003U); 562*6d034093SMichal Simek psu_mask_write(0xFD4090CC, 0x00000020U, 0x00000020U); 563*6d034093SMichal Simek psu_mask_write(0xFD40D0CC, 0x00000020U, 0x00000020U); 564*6d034093SMichal Simek psu_mask_write(0xFD401074, 0x00000010U, 0x00000010U); 565*6d034093SMichal Simek psu_mask_write(0xFD405074, 0x00000010U, 0x00000010U); 566*6d034093SMichal Simek psu_mask_write(0xFD409074, 0x00000010U, 0x00000010U); 567*6d034093SMichal Simek psu_mask_write(0xFD40D074, 0x00000010U, 0x00000010U); 568*6d034093SMichal Simek psu_mask_write(0xFD401994, 0x00000007U, 0x00000007U); 569*6d034093SMichal Simek psu_mask_write(0xFD405994, 0x00000007U, 0x00000007U); 570*6d034093SMichal Simek psu_mask_write(0xFD40989C, 0x00000080U, 0x00000080U); 571*6d034093SMichal Simek psu_mask_write(0xFD4098F8, 0x000000FFU, 0x0000001AU); 572*6d034093SMichal Simek psu_mask_write(0xFD4098FC, 0x000000FFU, 0x0000001AU); 573*6d034093SMichal Simek psu_mask_write(0xFD409990, 0x000000FFU, 0x00000010U); 574*6d034093SMichal Simek psu_mask_write(0xFD409924, 0x000000FFU, 0x000000FEU); 575*6d034093SMichal Simek psu_mask_write(0xFD409928, 0x000000FFU, 0x00000000U); 576*6d034093SMichal Simek psu_mask_write(0xFD409900, 0x000000FFU, 0x0000001AU); 577*6d034093SMichal Simek psu_mask_write(0xFD40992C, 0x000000FFU, 0x00000000U); 578*6d034093SMichal Simek psu_mask_write(0xFD409980, 0x000000FFU, 0x000000FFU); 579*6d034093SMichal Simek psu_mask_write(0xFD409914, 0x000000FFU, 0x000000F7U); 580*6d034093SMichal Simek psu_mask_write(0xFD409918, 0x00000001U, 0x00000001U); 581*6d034093SMichal Simek psu_mask_write(0xFD409940, 0x000000FFU, 0x000000F7U); 582*6d034093SMichal Simek psu_mask_write(0xFD409944, 0x00000001U, 0x00000001U); 583*6d034093SMichal Simek psu_mask_write(0xFD409994, 0x00000007U, 0x00000007U); 584*6d034093SMichal Simek psu_mask_write(0xFD40D89C, 0x00000080U, 0x00000080U); 585*6d034093SMichal Simek psu_mask_write(0xFD40D8F8, 0x000000FFU, 0x0000001AU); 586*6d034093SMichal Simek psu_mask_write(0xFD40D8FC, 0x000000FFU, 0x0000001AU); 587*6d034093SMichal Simek psu_mask_write(0xFD40D990, 0x000000FFU, 0x00000010U); 588*6d034093SMichal Simek psu_mask_write(0xFD40D924, 0x000000FFU, 0x000000FEU); 589*6d034093SMichal Simek psu_mask_write(0xFD40D928, 0x000000FFU, 0x00000000U); 590*6d034093SMichal Simek psu_mask_write(0xFD40D900, 0x000000FFU, 0x0000001AU); 591*6d034093SMichal Simek psu_mask_write(0xFD40D92C, 0x000000FFU, 0x00000000U); 592*6d034093SMichal Simek psu_mask_write(0xFD40D980, 0x000000FFU, 0x000000FFU); 593*6d034093SMichal Simek psu_mask_write(0xFD40D914, 0x000000FFU, 0x000000F7U); 594*6d034093SMichal Simek psu_mask_write(0xFD40D918, 0x00000001U, 0x00000001U); 595*6d034093SMichal Simek psu_mask_write(0xFD40D940, 0x000000FFU, 0x000000F7U); 596*6d034093SMichal Simek psu_mask_write(0xFD40D944, 0x00000001U, 0x00000001U); 597*6d034093SMichal Simek psu_mask_write(0xFD40D994, 0x00000007U, 0x00000007U); 598*6d034093SMichal Simek psu_mask_write(0xFD40107C, 0x0000000FU, 0x00000001U); 599*6d034093SMichal Simek psu_mask_write(0xFD40507C, 0x0000000FU, 0x00000001U); 600*6d034093SMichal Simek psu_mask_write(0xFD40907C, 0x0000000FU, 0x00000001U); 601*6d034093SMichal Simek psu_mask_write(0xFD40D07C, 0x0000000FU, 0x00000001U); 602*6d034093SMichal Simek psu_mask_write(0xFD4019A4, 0x000000FFU, 0x000000FFU); 603*6d034093SMichal Simek psu_mask_write(0xFD401038, 0x00000040U, 0x00000040U); 604*6d034093SMichal Simek psu_mask_write(0xFD40102C, 0x00000040U, 0x00000040U); 605*6d034093SMichal Simek psu_mask_write(0xFD4059A4, 0x000000FFU, 0x000000FFU); 606*6d034093SMichal Simek psu_mask_write(0xFD405038, 0x00000040U, 0x00000040U); 607*6d034093SMichal Simek psu_mask_write(0xFD40502C, 0x00000040U, 0x00000040U); 608*6d034093SMichal Simek psu_mask_write(0xFD4099A4, 0x000000FFU, 0x000000FFU); 609*6d034093SMichal Simek psu_mask_write(0xFD409038, 0x00000040U, 0x00000040U); 610*6d034093SMichal Simek psu_mask_write(0xFD40902C, 0x00000040U, 0x00000040U); 611*6d034093SMichal Simek psu_mask_write(0xFD40D9A4, 0x000000FFU, 0x000000FFU); 612*6d034093SMichal Simek psu_mask_write(0xFD40D038, 0x00000040U, 0x00000040U); 613*6d034093SMichal Simek psu_mask_write(0xFD40D02C, 0x00000040U, 0x00000040U); 614*6d034093SMichal Simek psu_mask_write(0xFD4019AC, 0x00000003U, 0x00000000U); 615*6d034093SMichal Simek psu_mask_write(0xFD4059AC, 0x00000003U, 0x00000000U); 616*6d034093SMichal Simek psu_mask_write(0xFD4099AC, 0x00000003U, 0x00000000U); 617*6d034093SMichal Simek psu_mask_write(0xFD40D9AC, 0x00000003U, 0x00000000U); 618*6d034093SMichal Simek psu_mask_write(0xFD401978, 0x00000010U, 0x00000010U); 619*6d034093SMichal Simek psu_mask_write(0xFD405978, 0x00000010U, 0x00000010U); 620*6d034093SMichal Simek psu_mask_write(0xFD409978, 0x00000010U, 0x00000010U); 621*6d034093SMichal Simek psu_mask_write(0xFD40D978, 0x00000010U, 0x00000010U); 622*6d034093SMichal Simek psu_mask_write(0xFD410010, 0x00000077U, 0x00000044U); 623*6d034093SMichal Simek psu_mask_write(0xFD410014, 0x00000077U, 0x00000033U); 624*6d034093SMichal Simek psu_mask_write(0xFD400CB4, 0x00000037U, 0x00000037U); 625*6d034093SMichal Simek psu_mask_write(0xFD404CB4, 0x00000037U, 0x00000037U); 626*6d034093SMichal Simek psu_mask_write(0xFD4001D8, 0x00000001U, 0x00000001U); 627*6d034093SMichal Simek psu_mask_write(0xFD4041D8, 0x00000001U, 0x00000001U); 628*6d034093SMichal Simek psu_mask_write(0xFD404CC0, 0x0000001FU, 0x00000000U); 629*6d034093SMichal Simek psu_mask_write(0xFD400CC0, 0x0000001FU, 0x00000000U); 630*6d034093SMichal Simek psu_mask_write(0xFD404048, 0x000000FFU, 0x00000000U); 631*6d034093SMichal Simek psu_mask_write(0xFD400048, 0x000000FFU, 0x00000000U); 632*6d034093SMichal Simek 633*6d034093SMichal Simek return 1; 634*6d034093SMichal Simek } 635*6d034093SMichal Simek 636*6d034093SMichal Simek static unsigned long psu_resetout_init_data(void) 637*6d034093SMichal Simek { 638*6d034093SMichal Simek psu_mask_write(0xFF5E023C, 0x00000400U, 0x00000000U); 639*6d034093SMichal Simek psu_mask_write(0xFF9D0080, 0x00000001U, 0x00000001U); 640*6d034093SMichal Simek psu_mask_write(0xFF9D007C, 0x00000001U, 0x00000000U); 641*6d034093SMichal Simek psu_mask_write(0xFF5E023C, 0x00000140U, 0x00000000U); 642*6d034093SMichal Simek psu_mask_write(0xFF5E023C, 0x00000800U, 0x00000000U); 643*6d034093SMichal Simek psu_mask_write(0xFF9E0080, 0x00000001U, 0x00000001U); 644*6d034093SMichal Simek psu_mask_write(0xFF9E007C, 0x00000001U, 0x00000000U); 645*6d034093SMichal Simek psu_mask_write(0xFF5E023C, 0x00000280U, 0x00000000U); 646*6d034093SMichal Simek psu_mask_write(0xFD1A0100, 0x00010000U, 0x00000000U); 647*6d034093SMichal Simek psu_mask_write(0xFD4A0200, 0x00000002U, 0x00000000U); 648*6d034093SMichal Simek psu_mask_write(0xFD4A0238, 0x0000000FU, 0x00000000U); 649*6d034093SMichal Simek psu_mask_write(0xFE20C200, 0x00023FFFU, 0x00022457U); 650*6d034093SMichal Simek psu_mask_write(0xFE20C630, 0x003FFF00U, 0x00000000U); 651*6d034093SMichal Simek psu_mask_write(0xFE20C11C, 0x00000600U, 0x00000600U); 652*6d034093SMichal Simek psu_mask_write(0xFE20C12C, 0x00004000U, 0x00004000U); 653*6d034093SMichal Simek psu_mask_write(0xFE30C200, 0x00023FFFU, 0x00022457U); 654*6d034093SMichal Simek psu_mask_write(0xFE30C630, 0x003FFF00U, 0x00000000U); 655*6d034093SMichal Simek psu_mask_write(0xFE30C12C, 0x00004000U, 0x00004000U); 656*6d034093SMichal Simek psu_mask_write(0xFE30C11C, 0x00000600U, 0x00000600U); 657*6d034093SMichal Simek psu_mask_write(0xFD480064, 0x00000200U, 0x00000200U); 658*6d034093SMichal Simek mask_poll(0xFD4063E4, 0x00000010U); 659*6d034093SMichal Simek mask_poll(0xFD40A3E4, 0x00000010U); 660*6d034093SMichal Simek mask_poll(0xFD40E3E4, 0x00000010U); 661*6d034093SMichal Simek 662*6d034093SMichal Simek return 1; 663*6d034093SMichal Simek } 664*6d034093SMichal Simek 665*6d034093SMichal Simek static unsigned long psu_resetin_init_data(void) 666*6d034093SMichal Simek { 667*6d034093SMichal Simek psu_mask_write(0xFF5E023C, 0x00000540U, 0x00000540U); 668*6d034093SMichal Simek psu_mask_write(0xFF5E023C, 0x00000A80U, 0x00000A80U); 669*6d034093SMichal Simek psu_mask_write(0xFD4A0238, 0x0000000FU, 0x0000000AU); 670*6d034093SMichal Simek psu_mask_write(0xFD4A0200, 0x00000002U, 0x00000002U); 671*6d034093SMichal Simek psu_mask_write(0xFD1A0100, 0x00010000U, 0x00010000U); 672*6d034093SMichal Simek 673*6d034093SMichal Simek return 1; 674*6d034093SMichal Simek } 675*6d034093SMichal Simek 676*6d034093SMichal Simek static unsigned long psu_afi_config(void) 677*6d034093SMichal Simek { 678*6d034093SMichal Simek psu_mask_write(0xFD1A0100, 0x00001F80U, 0x00000000U); 679*6d034093SMichal Simek psu_mask_write(0xFF5E023C, 0x00080000U, 0x00000000U); 680*6d034093SMichal Simek psu_mask_write(0xFF419000, 0x00000300U, 0x00000000U); 681*6d034093SMichal Simek 682*6d034093SMichal Simek return 1; 683*6d034093SMichal Simek } 684*6d034093SMichal Simek 685*6d034093SMichal Simek static unsigned long psu_ddr_phybringup_data(void) 686*6d034093SMichal Simek { 687*6d034093SMichal Simek unsigned int regval = 0; 688*6d034093SMichal Simek unsigned int pll_retry = 10; 689*6d034093SMichal Simek unsigned int pll_locked = 0; 690*6d034093SMichal Simek 691*6d034093SMichal Simek while ((pll_retry > 0) && (!pll_locked)) { 692*6d034093SMichal Simek Xil_Out32(0xFD080004, 0x00040010); 693*6d034093SMichal Simek Xil_Out32(0xFD080004, 0x00040011); 694*6d034093SMichal Simek 695*6d034093SMichal Simek while ((Xil_In32(0xFD080030) & 0x1) != 1) 696*6d034093SMichal Simek ; 697*6d034093SMichal Simek 698*6d034093SMichal Simek pll_locked = (Xil_In32(0xFD080030) & 0x80000000) 699*6d034093SMichal Simek >> 31; 700*6d034093SMichal Simek pll_locked &= (Xil_In32(0xFD0807E0) & 0x10000) 701*6d034093SMichal Simek >> 16; 702*6d034093SMichal Simek pll_locked &= (Xil_In32(0xFD0809E0) & 0x10000) 703*6d034093SMichal Simek >> 16; 704*6d034093SMichal Simek pll_retry--; 705*6d034093SMichal Simek } 706*6d034093SMichal Simek Xil_Out32(0xFD0800C0, Xil_In32(0xFD0800C0) | (pll_retry << 16)); 707*6d034093SMichal Simek Xil_Out32(0xFD080004U, 0x00040063U); 708*6d034093SMichal Simek Xil_Out32(0xFD090000U, 0x00000845U); 709*6d034093SMichal Simek Xil_Out32(0xFD090004U, 0x003FFFFFU); 710*6d034093SMichal Simek Xil_Out32(0xFD09000CU, 0x00000010U); 711*6d034093SMichal Simek Xil_Out32(0xFD090010U, 0x00000010U); 712*6d034093SMichal Simek Xil_Out32(0xFD090800U, 0x00000001U); 713*6d034093SMichal Simek 714*6d034093SMichal Simek while ((Xil_In32(0xFD080030U) & 0x0000000FU) != 0x0000000FU) 715*6d034093SMichal Simek ; 716*6d034093SMichal Simek 717*6d034093SMichal Simek prog_reg(0xFD080004U, 0x00000001U, 0x00000000U, 0x00000001U); 718*6d034093SMichal Simek 719*6d034093SMichal Simek while ((Xil_In32(0xFD080030U) & 0x000000FFU) != 0x0000001FU) 720*6d034093SMichal Simek ; 721*6d034093SMichal Simek 722*6d034093SMichal Simek Xil_Out32(0xFD070010U, 0x80000038U); 723*6d034093SMichal Simek Xil_Out32(0xFD0701B0U, 0x00000005U); 724*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 725*6d034093SMichal Simek while ((regval & 0x1) != 0x0) 726*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 727*6d034093SMichal Simek 728*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 729*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 730*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 731*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 732*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 733*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 734*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 735*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 736*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 737*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 738*6d034093SMichal Simek Xil_Out32(0xFD070014U, 0x00000331U); 739*6d034093SMichal Simek Xil_Out32(0xFD070010U, 0x80000038U); 740*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 741*6d034093SMichal Simek while ((regval & 0x1) != 0x0) 742*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 743*6d034093SMichal Simek 744*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 745*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 746*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 747*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 748*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 749*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 750*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 751*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 752*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 753*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 754*6d034093SMichal Simek Xil_Out32(0xFD070014U, 0x00000B36U); 755*6d034093SMichal Simek Xil_Out32(0xFD070010U, 0x80000038U); 756*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 757*6d034093SMichal Simek while ((regval & 0x1) != 0x0) 758*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 759*6d034093SMichal Simek 760*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 761*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 762*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 763*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 764*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 765*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 766*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 767*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 768*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 769*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 770*6d034093SMichal Simek Xil_Out32(0xFD070014U, 0x00000C21U); 771*6d034093SMichal Simek Xil_Out32(0xFD070010U, 0x80000038U); 772*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 773*6d034093SMichal Simek while ((regval & 0x1) != 0x0) 774*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 775*6d034093SMichal Simek 776*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 777*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 778*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 779*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 780*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 781*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 782*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 783*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 784*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 785*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 786*6d034093SMichal Simek Xil_Out32(0xFD070014U, 0x00000E19U); 787*6d034093SMichal Simek Xil_Out32(0xFD070010U, 0x80000038U); 788*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 789*6d034093SMichal Simek while ((regval & 0x1) != 0x0) 790*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 791*6d034093SMichal Simek 792*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 793*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 794*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 795*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 796*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 797*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 798*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 799*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 800*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 801*6d034093SMichal Simek regval = Xil_In32(0xFD070018); 802*6d034093SMichal Simek Xil_Out32(0xFD070014U, 0x00001616U); 803*6d034093SMichal Simek Xil_Out32(0xFD070010U, 0x80000038U); 804*6d034093SMichal Simek Xil_Out32(0xFD070010U, 0x80000030U); 805*6d034093SMichal Simek Xil_Out32(0xFD0701B0U, 0x00000005U); 806*6d034093SMichal Simek Xil_Out32(0xFD070320U, 0x00000001U); 807*6d034093SMichal Simek while ((Xil_In32(0xFD070004U) & 0x0000000FU) != 0x00000001U) 808*6d034093SMichal Simek ; 809*6d034093SMichal Simek 810*6d034093SMichal Simek prog_reg(0xFD080014U, 0x00000040U, 0x00000006U, 0x00000001U); 811*6d034093SMichal Simek Xil_Out32(0xFD080004, 0x0014FE01); 812*6d034093SMichal Simek 813*6d034093SMichal Simek regval = Xil_In32(0xFD080030); 814*6d034093SMichal Simek while (regval != 0x8000007E) 815*6d034093SMichal Simek regval = Xil_In32(0xFD080030); 816*6d034093SMichal Simek 817*6d034093SMichal Simek Xil_Out32(0xFD080200U, 0x010091C7U); 818*6d034093SMichal Simek regval = Xil_In32(0xFD080030); 819*6d034093SMichal Simek while (regval != 0x80008FFF) 820*6d034093SMichal Simek regval = Xil_In32(0xFD080030); 821*6d034093SMichal Simek 822*6d034093SMichal Simek Xil_Out32(0xFD080200U, 0x810091C7U); 823*6d034093SMichal Simek Xil_Out32(0xFD070180U, 0x010B0008U); 824*6d034093SMichal Simek Xil_Out32(0xFD070060U, 0x00000000U); 825*6d034093SMichal Simek prog_reg(0xFD070020U, 0x00000001U, 0x00000000U, 0x00000001U); 826*6d034093SMichal Simek prog_reg(0xFD080014U, 0x00000040U, 0x00000006U, 0x00000000U); 827*6d034093SMichal Simek 828*6d034093SMichal Simek return 1; 829*6d034093SMichal Simek } 830*6d034093SMichal Simek 831*6d034093SMichal Simek static int serdes_enb_coarse_saturation(void) 832*6d034093SMichal Simek { 833*6d034093SMichal Simek Xil_Out32(0xFD402094, 0x00000010); 834*6d034093SMichal Simek Xil_Out32(0xFD406094, 0x00000010); 835*6d034093SMichal Simek Xil_Out32(0xFD40A094, 0x00000010); 836*6d034093SMichal Simek Xil_Out32(0xFD40E094, 0x00000010); 837*6d034093SMichal Simek return 1; 838*6d034093SMichal Simek } 839*6d034093SMichal Simek 840*6d034093SMichal Simek static int serdes_fixcal_code(void) 841*6d034093SMichal Simek { 842*6d034093SMichal Simek int maskstatus = 1; 843*6d034093SMichal Simek unsigned int match_pmos_code[23]; 844*6d034093SMichal Simek unsigned int match_nmos_code[23]; 845*6d034093SMichal Simek unsigned int match_ical_code[7]; 846*6d034093SMichal Simek unsigned int match_rcal_code[7]; 847*6d034093SMichal Simek unsigned int p_code = 0; 848*6d034093SMichal Simek unsigned int n_code = 0; 849*6d034093SMichal Simek unsigned int i_code = 0; 850*6d034093SMichal Simek unsigned int r_code = 0; 851*6d034093SMichal Simek unsigned int repeat_count = 0; 852*6d034093SMichal Simek unsigned int L3_TM_CALIB_DIG20 = 0; 853*6d034093SMichal Simek unsigned int L3_TM_CALIB_DIG19 = 0; 854*6d034093SMichal Simek unsigned int L3_TM_CALIB_DIG18 = 0; 855*6d034093SMichal Simek unsigned int L3_TM_CALIB_DIG16 = 0; 856*6d034093SMichal Simek unsigned int L3_TM_CALIB_DIG15 = 0; 857*6d034093SMichal Simek unsigned int L3_TM_CALIB_DIG14 = 0; 858*6d034093SMichal Simek int i = 0; 859*6d034093SMichal Simek 860*6d034093SMichal Simek for (i = 0; i < 23; i++) { 861*6d034093SMichal Simek match_pmos_code[i] = 0; 862*6d034093SMichal Simek match_nmos_code[i] = 0; 863*6d034093SMichal Simek } 864*6d034093SMichal Simek for (i = 0; i < 7; i++) { 865*6d034093SMichal Simek match_ical_code[i] = 0; 866*6d034093SMichal Simek match_rcal_code[i] = 0; 867*6d034093SMichal Simek } 868*6d034093SMichal Simek 869*6d034093SMichal Simek do { 870*6d034093SMichal Simek Xil_Out32(0xFD410010, 0x00000000); 871*6d034093SMichal Simek Xil_Out32(0xFD410014, 0x00000000); 872*6d034093SMichal Simek 873*6d034093SMichal Simek Xil_Out32(0xFD410010, 0x00000001); 874*6d034093SMichal Simek Xil_Out32(0xFD410014, 0x00000000); 875*6d034093SMichal Simek 876*6d034093SMichal Simek maskstatus = mask_poll(0xFD40EF14, 0x2); 877*6d034093SMichal Simek if (maskstatus == 0) { 878*6d034093SMichal Simek /* xil_printf("#SERDES initialization timed out\n\r");*/ 879*6d034093SMichal Simek return maskstatus; 880*6d034093SMichal Simek } 881*6d034093SMichal Simek 882*6d034093SMichal Simek p_code = mask_read(0xFD40EF18, 0xFFFFFFFF); 883*6d034093SMichal Simek n_code = mask_read(0xFD40EF1C, 0xFFFFFFFF); 884*6d034093SMichal Simek ; 885*6d034093SMichal Simek i_code = mask_read(0xFD40EF24, 0xFFFFFFFF); 886*6d034093SMichal Simek r_code = mask_read(0xFD40EF28, 0xFFFFFFFF); 887*6d034093SMichal Simek ; 888*6d034093SMichal Simek 889*6d034093SMichal Simek if ((p_code >= 0x26) && (p_code <= 0x3C)) 890*6d034093SMichal Simek match_pmos_code[p_code - 0x26] += 1; 891*6d034093SMichal Simek 892*6d034093SMichal Simek if ((n_code >= 0x26) && (n_code <= 0x3C)) 893*6d034093SMichal Simek match_nmos_code[n_code - 0x26] += 1; 894*6d034093SMichal Simek 895*6d034093SMichal Simek if ((i_code >= 0xC) && (i_code <= 0x12)) 896*6d034093SMichal Simek match_ical_code[i_code - 0xC] += 1; 897*6d034093SMichal Simek 898*6d034093SMichal Simek if ((r_code >= 0x6) && (r_code <= 0xC)) 899*6d034093SMichal Simek match_rcal_code[r_code - 0x6] += 1; 900*6d034093SMichal Simek 901*6d034093SMichal Simek } while (repeat_count++ < 10); 902*6d034093SMichal Simek 903*6d034093SMichal Simek for (i = 0; i < 23; i++) { 904*6d034093SMichal Simek if (match_pmos_code[i] >= match_pmos_code[0]) { 905*6d034093SMichal Simek match_pmos_code[0] = match_pmos_code[i]; 906*6d034093SMichal Simek p_code = 0x26 + i; 907*6d034093SMichal Simek } 908*6d034093SMichal Simek if (match_nmos_code[i] >= match_nmos_code[0]) { 909*6d034093SMichal Simek match_nmos_code[0] = match_nmos_code[i]; 910*6d034093SMichal Simek n_code = 0x26 + i; 911*6d034093SMichal Simek } 912*6d034093SMichal Simek } 913*6d034093SMichal Simek 914*6d034093SMichal Simek for (i = 0; i < 7; i++) { 915*6d034093SMichal Simek if (match_ical_code[i] >= match_ical_code[0]) { 916*6d034093SMichal Simek match_ical_code[0] = match_ical_code[i]; 917*6d034093SMichal Simek i_code = 0xC + i; 918*6d034093SMichal Simek } 919*6d034093SMichal Simek if (match_rcal_code[i] >= match_rcal_code[0]) { 920*6d034093SMichal Simek match_rcal_code[0] = match_rcal_code[i]; 921*6d034093SMichal Simek r_code = 0x6 + i; 922*6d034093SMichal Simek } 923*6d034093SMichal Simek } 924*6d034093SMichal Simek 925*6d034093SMichal Simek L3_TM_CALIB_DIG20 = mask_read(0xFD40EC50, 0xFFFFFFF0); 926*6d034093SMichal Simek L3_TM_CALIB_DIG20 = L3_TM_CALIB_DIG20 | 0x8 | ((p_code >> 2) & 0x7); 927*6d034093SMichal Simek 928*6d034093SMichal Simek L3_TM_CALIB_DIG19 = mask_read(0xFD40EC4C, 0xFFFFFF18); 929*6d034093SMichal Simek L3_TM_CALIB_DIG19 = L3_TM_CALIB_DIG19 | ((p_code & 0x3) << 6) 930*6d034093SMichal Simek | 0x20 | 0x4 | ((n_code >> 3) & 0x3); 931*6d034093SMichal Simek 932*6d034093SMichal Simek L3_TM_CALIB_DIG18 = mask_read(0xFD40EC48, 0xFFFFFF0F); 933*6d034093SMichal Simek L3_TM_CALIB_DIG18 = L3_TM_CALIB_DIG18 | ((n_code & 0x7) << 5) | 0x10; 934*6d034093SMichal Simek 935*6d034093SMichal Simek L3_TM_CALIB_DIG16 = mask_read(0xFD40EC40, 0xFFFFFFF8); 936*6d034093SMichal Simek L3_TM_CALIB_DIG16 = L3_TM_CALIB_DIG16 | ((r_code >> 1) & 0x7); 937*6d034093SMichal Simek 938*6d034093SMichal Simek L3_TM_CALIB_DIG15 = mask_read(0xFD40EC3C, 0xFFFFFF30); 939*6d034093SMichal Simek L3_TM_CALIB_DIG15 = L3_TM_CALIB_DIG15 | ((r_code & 0x1) << 7) 940*6d034093SMichal Simek | 0x40 | 0x8 | ((i_code >> 1) & 0x7); 941*6d034093SMichal Simek 942*6d034093SMichal Simek L3_TM_CALIB_DIG14 = mask_read(0xFD40EC38, 0xFFFFFF3F); 943*6d034093SMichal Simek L3_TM_CALIB_DIG14 = L3_TM_CALIB_DIG14 | ((i_code & 0x1) << 7) | 0x40; 944*6d034093SMichal Simek 945*6d034093SMichal Simek Xil_Out32(0xFD40EC50, L3_TM_CALIB_DIG20); 946*6d034093SMichal Simek Xil_Out32(0xFD40EC4C, L3_TM_CALIB_DIG19); 947*6d034093SMichal Simek Xil_Out32(0xFD40EC48, L3_TM_CALIB_DIG18); 948*6d034093SMichal Simek Xil_Out32(0xFD40EC40, L3_TM_CALIB_DIG16); 949*6d034093SMichal Simek Xil_Out32(0xFD40EC3C, L3_TM_CALIB_DIG15); 950*6d034093SMichal Simek Xil_Out32(0xFD40EC38, L3_TM_CALIB_DIG14); 951*6d034093SMichal Simek return maskstatus; 952*6d034093SMichal Simek } 953*6d034093SMichal Simek 954*6d034093SMichal Simek static int init_serdes(void) 955*6d034093SMichal Simek { 956*6d034093SMichal Simek int status = 1; 957*6d034093SMichal Simek 958*6d034093SMichal Simek status &= psu_resetin_init_data(); 959*6d034093SMichal Simek 960*6d034093SMichal Simek status &= serdes_fixcal_code(); 961*6d034093SMichal Simek status &= serdes_enb_coarse_saturation(); 962*6d034093SMichal Simek 963*6d034093SMichal Simek status &= psu_serdes_init_data(); 964*6d034093SMichal Simek status &= psu_resetout_init_data(); 965*6d034093SMichal Simek 966*6d034093SMichal Simek return status; 967*6d034093SMichal Simek } 968*6d034093SMichal Simek 969*6d034093SMichal Simek static void init_peripheral(void) 970*6d034093SMichal Simek { 971*6d034093SMichal Simek psu_mask_write(0xFD5F0018, 0x0000001FU, 0x0000001FU); 972*6d034093SMichal Simek } 973*6d034093SMichal Simek 974*6d034093SMichal Simek int psu_init(void) 975*6d034093SMichal Simek { 976*6d034093SMichal Simek int status = 1; 977*6d034093SMichal Simek 978*6d034093SMichal Simek status &= psu_mio_init_data(); 979*6d034093SMichal Simek status &= psu_pll_init_data(); 980*6d034093SMichal Simek status &= psu_clock_init_data(); 981*6d034093SMichal Simek status &= psu_ddr_init_data(); 982*6d034093SMichal Simek status &= psu_ddr_phybringup_data(); 983*6d034093SMichal Simek status &= psu_peripherals_init_data(); 984*6d034093SMichal Simek status &= init_serdes(); 985*6d034093SMichal Simek init_peripheral(); 986*6d034093SMichal Simek 987*6d034093SMichal Simek status &= psu_afi_config(); 988*6d034093SMichal Simek psu_ddr_qos_init_data(); 989*6d034093SMichal Simek 990*6d034093SMichal Simek if (status == 0) 991*6d034093SMichal Simek return 1; 992*6d034093SMichal Simek return 0; 993*6d034093SMichal Simek } 994