183d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
26d034093SMichal Simek /*
36d034093SMichal Simek  * (c) Copyright 2015 Xilinx, Inc. All rights reserved.
46d034093SMichal Simek  */
56d034093SMichal Simek 
66d034093SMichal Simek #include <asm/arch/psu_init_gpl.h>
76d034093SMichal Simek #include <xil_io.h>
86d034093SMichal Simek 
96d034093SMichal Simek static unsigned long psu_pll_init_data(void)
106d034093SMichal Simek {
116d034093SMichal Simek 	psu_mask_write(0xFF5E0034, 0xFE7FEDEFU, 0x7E4B0C62U);
126d034093SMichal Simek 	psu_mask_write(0xFF5E0030, 0x00717F00U, 0x00014600U);
136d034093SMichal Simek 	psu_mask_write(0xFF5E0030, 0x00000008U, 0x00000008U);
146d034093SMichal Simek 	psu_mask_write(0xFF5E0030, 0x00000001U, 0x00000001U);
156d034093SMichal Simek 	psu_mask_write(0xFF5E0030, 0x00000001U, 0x00000000U);
166d034093SMichal Simek 	mask_poll(0xFF5E0040, 0x00000002U);
176d034093SMichal Simek 	psu_mask_write(0xFF5E0030, 0x00000008U, 0x00000000U);
186d034093SMichal Simek 	psu_mask_write(0xFF5E0048, 0x00003F00U, 0x00000300U);
196d034093SMichal Simek 	psu_mask_write(0xFF5E0038, 0x8000FFFFU, 0x00000000U);
206d034093SMichal Simek 	psu_mask_write(0xFF5E0024, 0xFE7FEDEFU, 0x7E672C6CU);
216d034093SMichal Simek 	psu_mask_write(0xFF5E0020, 0x00717F00U, 0x00002D00U);
226d034093SMichal Simek 	psu_mask_write(0xFF5E0020, 0x00000008U, 0x00000008U);
236d034093SMichal Simek 	psu_mask_write(0xFF5E0020, 0x00000001U, 0x00000001U);
246d034093SMichal Simek 	psu_mask_write(0xFF5E0020, 0x00000001U, 0x00000000U);
256d034093SMichal Simek 	mask_poll(0xFF5E0040, 0x00000001U);
266d034093SMichal Simek 	psu_mask_write(0xFF5E0020, 0x00000008U, 0x00000000U);
276d034093SMichal Simek 	psu_mask_write(0xFF5E0044, 0x00003F00U, 0x00000300U);
286d034093SMichal Simek 	psu_mask_write(0xFF5E0028, 0x8000FFFFU, 0x00000000U);
296d034093SMichal Simek 	psu_mask_write(0xFD1A0024, 0xFE7FEDEFU, 0x7E4B0C62U);
306d034093SMichal Simek 	psu_mask_write(0xFD1A0020, 0x00717F00U, 0x00014800U);
316d034093SMichal Simek 	psu_mask_write(0xFD1A0020, 0x00000008U, 0x00000008U);
326d034093SMichal Simek 	psu_mask_write(0xFD1A0020, 0x00000001U, 0x00000001U);
336d034093SMichal Simek 	psu_mask_write(0xFD1A0020, 0x00000001U, 0x00000000U);
346d034093SMichal Simek 	mask_poll(0xFD1A0044, 0x00000001U);
356d034093SMichal Simek 	psu_mask_write(0xFD1A0020, 0x00000008U, 0x00000000U);
366d034093SMichal Simek 	psu_mask_write(0xFD1A0048, 0x00003F00U, 0x00000300U);
376d034093SMichal Simek 	psu_mask_write(0xFD1A0028, 0x8000FFFFU, 0x00000000U);
386d034093SMichal Simek 	psu_mask_write(0xFD1A0030, 0xFE7FEDEFU, 0x7E4B0C62U);
396d034093SMichal Simek 	psu_mask_write(0xFD1A002C, 0x00717F00U, 0x00014000U);
406d034093SMichal Simek 	psu_mask_write(0xFD1A002C, 0x00000008U, 0x00000008U);
416d034093SMichal Simek 	psu_mask_write(0xFD1A002C, 0x00000001U, 0x00000001U);
426d034093SMichal Simek 	psu_mask_write(0xFD1A002C, 0x00000001U, 0x00000000U);
436d034093SMichal Simek 	mask_poll(0xFD1A0044, 0x00000002U);
446d034093SMichal Simek 	psu_mask_write(0xFD1A002C, 0x00000008U, 0x00000000U);
456d034093SMichal Simek 	psu_mask_write(0xFD1A004C, 0x00003F00U, 0x00000300U);
466d034093SMichal Simek 	psu_mask_write(0xFD1A0034, 0x8000FFFFU, 0x00000000U);
476d034093SMichal Simek 	psu_mask_write(0xFD1A003C, 0xFE7FEDEFU, 0x7E4B0C62U);
486d034093SMichal Simek 	psu_mask_write(0xFD1A0038, 0x00717F00U, 0x00014700U);
496d034093SMichal Simek 	psu_mask_write(0xFD1A0038, 0x00000008U, 0x00000008U);
506d034093SMichal Simek 	psu_mask_write(0xFD1A0038, 0x00000001U, 0x00000001U);
516d034093SMichal Simek 	psu_mask_write(0xFD1A0038, 0x00000001U, 0x00000000U);
526d034093SMichal Simek 	mask_poll(0xFD1A0044, 0x00000004U);
536d034093SMichal Simek 	psu_mask_write(0xFD1A0038, 0x00000008U, 0x00000000U);
546d034093SMichal Simek 	psu_mask_write(0xFD1A0050, 0x00003F00U, 0x00000300U);
556d034093SMichal Simek 	psu_mask_write(0xFD1A0040, 0x8000FFFFU, 0x00000000U);
566d034093SMichal Simek 
576d034093SMichal Simek 	return 1;
586d034093SMichal Simek }
596d034093SMichal Simek 
606d034093SMichal Simek static unsigned long psu_clock_init_data(void)
616d034093SMichal Simek {
626d034093SMichal Simek 	psu_mask_write(0xFF5E0060, 0x023F3F07U, 0x02010600U);
636d034093SMichal Simek 	psu_mask_write(0xFF5E0064, 0x023F3F07U, 0x02010600U);
646d034093SMichal Simek 	psu_mask_write(0xFF5E004C, 0x023F3F07U, 0x020F0500U);
656d034093SMichal Simek 	psu_mask_write(0xFF5E006C, 0x013F3F07U, 0x01010800U);
666d034093SMichal Simek 	psu_mask_write(0xFF5E0070, 0x013F3F07U, 0x01010800U);
676d034093SMichal Simek 	psu_mask_write(0xFF18030C, 0x00020003U, 0x00000000U);
686d034093SMichal Simek 	psu_mask_write(0xFF5E0074, 0x013F3F07U, 0x01010F00U);
696d034093SMichal Simek 	psu_mask_write(0xFF5E0078, 0x013F3F07U, 0x01010F00U);
706d034093SMichal Simek 	psu_mask_write(0xFF5E0124, 0x013F3F07U, 0x01010F00U);
716d034093SMichal Simek 	psu_mask_write(0xFF5E007C, 0x013F3F07U, 0x01010800U);
726d034093SMichal Simek 	psu_mask_write(0xFF5E0080, 0x013F3F07U, 0x01010800U);
736d034093SMichal Simek 	psu_mask_write(0xFF5E0090, 0x01003F07U, 0x01000302U);
746d034093SMichal Simek 	psu_mask_write(0xFF5E009C, 0x01003F07U, 0x01000602U);
756d034093SMichal Simek 	psu_mask_write(0xFF5E00A4, 0x01003F07U, 0x01000800U);
766d034093SMichal Simek 	psu_mask_write(0xFF5E00A8, 0x01003F07U, 0x01000302U);
776d034093SMichal Simek 	psu_mask_write(0xFF5E00AC, 0x01003F07U, 0x01000F02U);
786d034093SMichal Simek 	psu_mask_write(0xFF5E00B0, 0x01003F07U, 0x01000602U);
796d034093SMichal Simek 	psu_mask_write(0xFF5E00B8, 0x01003F07U, 0x01000302U);
806d034093SMichal Simek 	psu_mask_write(0xFF5E00C0, 0x013F3F07U, 0x01010F00U);
816d034093SMichal Simek 	psu_mask_write(0xFF5E00C4, 0x013F3F07U, 0x01040F00U);
826d034093SMichal Simek 	psu_mask_write(0xFF5E00C8, 0x013F3F07U, 0x01010500U);
836d034093SMichal Simek 	psu_mask_write(0xFF5E00CC, 0x013F3F07U, 0x01010400U);
846d034093SMichal Simek 	psu_mask_write(0xFF5E0108, 0x013F3F07U, 0x01011D02U);
856d034093SMichal Simek 	psu_mask_write(0xFF5E0104, 0x00000007U, 0x00000000U);
866d034093SMichal Simek 	psu_mask_write(0xFF5E0128, 0x01003F07U, 0x01000F00U);
876d034093SMichal Simek 	psu_mask_write(0xFD1A0070, 0x013F3F07U, 0x01010400U);
886d034093SMichal Simek 	psu_mask_write(0xFD1A0074, 0x013F3F07U, 0x01011003U);
896d034093SMichal Simek 	psu_mask_write(0xFD1A007C, 0x013F3F07U, 0x01010F03U);
906d034093SMichal Simek 	psu_mask_write(0xFD1A0060, 0x03003F07U, 0x03000100U);
916d034093SMichal Simek 	psu_mask_write(0xFD1A0068, 0x01003F07U, 0x01000200U);
926d034093SMichal Simek 	psu_mask_write(0xFD1A0080, 0x00003F07U, 0x00000400U);
936d034093SMichal Simek 	psu_mask_write(0xFD1A0084, 0x07003F07U, 0x07000100U);
946d034093SMichal Simek 	psu_mask_write(0xFD1A00B8, 0x01003F07U, 0x01000200U);
956d034093SMichal Simek 	psu_mask_write(0xFD1A00BC, 0x01003F07U, 0x01000200U);
966d034093SMichal Simek 	psu_mask_write(0xFD1A00C0, 0x01003F07U, 0x01000203U);
976d034093SMichal Simek 	psu_mask_write(0xFD1A00C4, 0x01003F07U, 0x01000502U);
986d034093SMichal Simek 	psu_mask_write(0xFD1A00F8, 0x00003F07U, 0x00000200U);
996d034093SMichal Simek 	psu_mask_write(0xFF180380, 0x000000FFU, 0x00000000U);
1006d034093SMichal Simek 	psu_mask_write(0xFD610100, 0x00000001U, 0x00000000U);
1016d034093SMichal Simek 	psu_mask_write(0xFF180300, 0x00000001U, 0x00000000U);
1026d034093SMichal Simek 	psu_mask_write(0xFF410050, 0x00000001U, 0x00000000U);
1036d034093SMichal Simek 
1046d034093SMichal Simek 	return 1;
1056d034093SMichal Simek }
1066d034093SMichal Simek 
1076d034093SMichal Simek static unsigned long psu_ddr_init_data(void)
1086d034093SMichal Simek {
1096d034093SMichal Simek 	psu_mask_write(0xFD1A0108, 0x00000008U, 0x00000008U);
1106d034093SMichal Simek 	psu_mask_write(0xFD070000, 0xE30FBE3DU, 0xC3081020U);
1116d034093SMichal Simek 	psu_mask_write(0xFD070010, 0x8000F03FU, 0x00000030U);
1126d034093SMichal Simek 	psu_mask_write(0xFD070020, 0x000003F3U, 0x00000102U);
1136d034093SMichal Simek 	psu_mask_write(0xFD070024, 0xFFFFFFFFU, 0x0028B090U);
1146d034093SMichal Simek 	psu_mask_write(0xFD070030, 0x0000007FU, 0x00000000U);
1156d034093SMichal Simek 	psu_mask_write(0xFD070034, 0x00FFFF1FU, 0x00404310U);
1166d034093SMichal Simek 	psu_mask_write(0xFD070050, 0x00F1F1F4U, 0x00210000U);
1176d034093SMichal Simek 	psu_mask_write(0xFD070054, 0x0FFF0FFFU, 0x00000000U);
1186d034093SMichal Simek 	psu_mask_write(0xFD070060, 0x00000073U, 0x00000001U);
1196d034093SMichal Simek 	psu_mask_write(0xFD070064, 0x0FFF83FFU, 0x00208030U);
1206d034093SMichal Simek 	psu_mask_write(0xFD070070, 0x00000017U, 0x00000010U);
1216d034093SMichal Simek 	psu_mask_write(0xFD070074, 0x00000003U, 0x00000000U);
1226d034093SMichal Simek 	psu_mask_write(0xFD0700C4, 0x3F000391U, 0x10000200U);
1236d034093SMichal Simek 	psu_mask_write(0xFD0700C8, 0x01FF1F3FU, 0x0030051FU);
1246d034093SMichal Simek 	psu_mask_write(0xFD0700D0, 0xC3FF0FFFU, 0x0002020AU);
1256d034093SMichal Simek 	psu_mask_write(0xFD0700D4, 0x01FF7F0FU, 0x00360000U);
1266d034093SMichal Simek 	psu_mask_write(0xFD0700D8, 0x0000FF0FU, 0x00001205U);
1276d034093SMichal Simek 	psu_mask_write(0xFD0700DC, 0xFFFFFFFFU, 0x00240012U);
1286d034093SMichal Simek 	psu_mask_write(0xFD0700E0, 0xFFFFFFFFU, 0x00310008U);
1296d034093SMichal Simek 	psu_mask_write(0xFD0700E4, 0x00FF03FFU, 0x00210004U);
1306d034093SMichal Simek 	psu_mask_write(0xFD0700E8, 0xFFFFFFFFU, 0x00000000U);
1316d034093SMichal Simek 	psu_mask_write(0xFD0700EC, 0xFFFF0000U, 0x00000000U);
1326d034093SMichal Simek 	psu_mask_write(0xFD0700F0, 0x0000003FU, 0x00000010U);
1336d034093SMichal Simek 	psu_mask_write(0xFD0700F4, 0x00000FFFU, 0x0000077FU);
1346d034093SMichal Simek 	psu_mask_write(0xFD070100, 0x7F3F7F3FU, 0x0E0B010CU);
1356d034093SMichal Simek 	psu_mask_write(0xFD070104, 0x001F1F7FU, 0x00030412U);
1366d034093SMichal Simek 	psu_mask_write(0xFD070108, 0x3F3F3F3FU, 0x04070F0DU);
1376d034093SMichal Simek 	psu_mask_write(0xFD07010C, 0x3FF3F3FFU, 0x00A05000U);
1386d034093SMichal Simek 	psu_mask_write(0xFD070110, 0x1F0F0F1FU, 0x05040306U);
1396d034093SMichal Simek 	psu_mask_write(0xFD070114, 0x0F0F3F1FU, 0x01020404U);
1406d034093SMichal Simek 	psu_mask_write(0xFD070118, 0x0F0F000FU, 0x01010004U);
1416d034093SMichal Simek 	psu_mask_write(0xFD07011C, 0x00000F0FU, 0x00000201U);
1426d034093SMichal Simek 	psu_mask_write(0xFD070120, 0x7F7F7F7FU, 0x03030303U);
1436d034093SMichal Simek 	psu_mask_write(0xFD070124, 0x40070F3FU, 0x0004040DU);
1446d034093SMichal Simek 	psu_mask_write(0xFD07012C, 0x7F1F031FU, 0x440C011CU);
1456d034093SMichal Simek 	psu_mask_write(0xFD070130, 0x00030F1FU, 0x00020608U);
1466d034093SMichal Simek 	psu_mask_write(0xFD070180, 0xF7FF03FFU, 0x810B0008U);
1476d034093SMichal Simek 	psu_mask_write(0xFD070184, 0x3FFFFFFFU, 0x00E32DCBU);
1486d034093SMichal Simek 	psu_mask_write(0xFD070190, 0x1FBFBF3FU, 0x048B8206U);
1496d034093SMichal Simek 	psu_mask_write(0xFD070194, 0xF31F0F0FU, 0x00030304U);
1506d034093SMichal Simek 	psu_mask_write(0xFD070198, 0x0FF1F1F1U, 0x07000101U);
1516d034093SMichal Simek 	psu_mask_write(0xFD07019C, 0x000000F1U, 0x00000021U);
1526d034093SMichal Simek 	psu_mask_write(0xFD0701A0, 0xC3FF03FFU, 0x00400003U);
1536d034093SMichal Simek 	psu_mask_write(0xFD0701A4, 0x00FF00FFU, 0x00A00070U);
1546d034093SMichal Simek 	psu_mask_write(0xFD0701B0, 0x00000007U, 0x00000004U);
1556d034093SMichal Simek 	psu_mask_write(0xFD0701B4, 0x00003F3FU, 0x00000901U);
1566d034093SMichal Simek 	psu_mask_write(0xFD0701C0, 0x00000007U, 0x00000001U);
1576d034093SMichal Simek 	psu_mask_write(0xFD070200, 0x0000001FU, 0x00000015U);
1586d034093SMichal Simek 	psu_mask_write(0xFD070204, 0x001F1F1FU, 0x00070707U);
1596d034093SMichal Simek 	psu_mask_write(0xFD070208, 0x0F0F0F0FU, 0x00000000U);
1606d034093SMichal Simek 	psu_mask_write(0xFD07020C, 0x0F0F0F0FU, 0x0F000000U);
1616d034093SMichal Simek 	psu_mask_write(0xFD070210, 0x00000F0FU, 0x00000F0FU);
1626d034093SMichal Simek 	psu_mask_write(0xFD070214, 0x0F0F0F0FU, 0x060F0606U);
1636d034093SMichal Simek 	psu_mask_write(0xFD070218, 0x8F0F0F0FU, 0x0F060606U);
1646d034093SMichal Simek 	psu_mask_write(0xFD07021C, 0x00000F0FU, 0x00000F0FU);
1656d034093SMichal Simek 	psu_mask_write(0xFD070220, 0x00001F1FU, 0x00000000U);
1666d034093SMichal Simek 	psu_mask_write(0xFD070224, 0x0F0F0F0FU, 0x06060606U);
1676d034093SMichal Simek 	psu_mask_write(0xFD070228, 0x0F0F0F0FU, 0x06060606U);
1686d034093SMichal Simek 	psu_mask_write(0xFD07022C, 0x0000000FU, 0x00000006U);
1696d034093SMichal Simek 	psu_mask_write(0xFD070240, 0x0F1F0F7CU, 0x04000400U);
1706d034093SMichal Simek 	psu_mask_write(0xFD070244, 0x00003333U, 0x00000000U);
1716d034093SMichal Simek 	psu_mask_write(0xFD070250, 0x7FFF3F07U, 0x01002001U);
1726d034093SMichal Simek 	psu_mask_write(0xFD070264, 0xFF00FFFFU, 0x08000040U);
1736d034093SMichal Simek 	psu_mask_write(0xFD07026C, 0xFF00FFFFU, 0x08000040U);
1746d034093SMichal Simek 	psu_mask_write(0xFD070280, 0xFFFFFFFFU, 0x00000000U);
1756d034093SMichal Simek 	psu_mask_write(0xFD070284, 0xFFFFFFFFU, 0x00000000U);
1766d034093SMichal Simek 	psu_mask_write(0xFD070288, 0xFFFFFFFFU, 0x00000000U);
1776d034093SMichal Simek 	psu_mask_write(0xFD07028C, 0xFFFFFFFFU, 0x00000000U);
1786d034093SMichal Simek 	psu_mask_write(0xFD070290, 0x0000FFFFU, 0x00000000U);
1796d034093SMichal Simek 	psu_mask_write(0xFD070294, 0x00000001U, 0x00000001U);
1806d034093SMichal Simek 	psu_mask_write(0xFD070300, 0x00000011U, 0x00000000U);
1816d034093SMichal Simek 	psu_mask_write(0xFD07030C, 0x80000033U, 0x00000000U);
1826d034093SMichal Simek 	psu_mask_write(0xFD070320, 0x00000001U, 0x00000000U);
1836d034093SMichal Simek 	psu_mask_write(0xFD070400, 0x00000111U, 0x00000001U);
1846d034093SMichal Simek 	psu_mask_write(0xFD070404, 0x000073FFU, 0x0000200FU);
1856d034093SMichal Simek 	psu_mask_write(0xFD070408, 0x000073FFU, 0x0000200FU);
1866d034093SMichal Simek 	psu_mask_write(0xFD070490, 0x00000001U, 0x00000001U);
1876d034093SMichal Simek 	psu_mask_write(0xFD070494, 0x0033000FU, 0x0020000BU);
1886d034093SMichal Simek 	psu_mask_write(0xFD070498, 0x07FF07FFU, 0x00000000U);
1896d034093SMichal Simek 	psu_mask_write(0xFD0704B4, 0x000073FFU, 0x0000200FU);
1906d034093SMichal Simek 	psu_mask_write(0xFD0704B8, 0x000073FFU, 0x0000200FU);
1916d034093SMichal Simek 	psu_mask_write(0xFD070540, 0x00000001U, 0x00000001U);
1926d034093SMichal Simek 	psu_mask_write(0xFD070544, 0x03330F0FU, 0x02000B03U);
1936d034093SMichal Simek 	psu_mask_write(0xFD070548, 0x07FF07FFU, 0x00000000U);
1946d034093SMichal Simek 	psu_mask_write(0xFD070564, 0x000073FFU, 0x0000200FU);
1956d034093SMichal Simek 	psu_mask_write(0xFD070568, 0x000073FFU, 0x0000200FU);
1966d034093SMichal Simek 	psu_mask_write(0xFD0705F0, 0x00000001U, 0x00000001U);
1976d034093SMichal Simek 	psu_mask_write(0xFD0705F4, 0x03330F0FU, 0x02000B03U);
1986d034093SMichal Simek 	psu_mask_write(0xFD0705F8, 0x07FF07FFU, 0x00000000U);
1996d034093SMichal Simek 	psu_mask_write(0xFD070614, 0x000073FFU, 0x0000200FU);
2006d034093SMichal Simek 	psu_mask_write(0xFD070618, 0x000073FFU, 0x0000200FU);
2016d034093SMichal Simek 	psu_mask_write(0xFD0706A0, 0x00000001U, 0x00000001U);
2026d034093SMichal Simek 	psu_mask_write(0xFD0706A4, 0x0033000FU, 0x00100003U);
2036d034093SMichal Simek 	psu_mask_write(0xFD0706A8, 0x07FF07FFU, 0x0000004FU);
2046d034093SMichal Simek 	psu_mask_write(0xFD0706AC, 0x0033000FU, 0x00100003U);
2056d034093SMichal Simek 	psu_mask_write(0xFD0706B0, 0x000007FFU, 0x0000004FU);
2066d034093SMichal Simek 	psu_mask_write(0xFD0706C4, 0x000073FFU, 0x0000200FU);
2076d034093SMichal Simek 	psu_mask_write(0xFD0706C8, 0x000073FFU, 0x0000200FU);
2086d034093SMichal Simek 	psu_mask_write(0xFD070750, 0x00000001U, 0x00000001U);
2096d034093SMichal Simek 	psu_mask_write(0xFD070754, 0x0033000FU, 0x00100003U);
2106d034093SMichal Simek 	psu_mask_write(0xFD070758, 0x07FF07FFU, 0x0000004FU);
2116d034093SMichal Simek 	psu_mask_write(0xFD07075C, 0x0033000FU, 0x00100003U);
2126d034093SMichal Simek 	psu_mask_write(0xFD070760, 0x000007FFU, 0x0000004FU);
2136d034093SMichal Simek 	psu_mask_write(0xFD070774, 0x000073FFU, 0x0000200FU);
2146d034093SMichal Simek 	psu_mask_write(0xFD070778, 0x000073FFU, 0x0000200FU);
2156d034093SMichal Simek 	psu_mask_write(0xFD070800, 0x00000001U, 0x00000001U);
2166d034093SMichal Simek 	psu_mask_write(0xFD070804, 0x0033000FU, 0x00100003U);
2176d034093SMichal Simek 	psu_mask_write(0xFD070808, 0x07FF07FFU, 0x0000004FU);
2186d034093SMichal Simek 	psu_mask_write(0xFD07080C, 0x0033000FU, 0x00100003U);
2196d034093SMichal Simek 	psu_mask_write(0xFD070810, 0x000007FFU, 0x0000004FU);
2206d034093SMichal Simek 	psu_mask_write(0xFD070F04, 0x000001FFU, 0x00000000U);
2216d034093SMichal Simek 	psu_mask_write(0xFD070F08, 0x000000FFU, 0x00000000U);
2226d034093SMichal Simek 	psu_mask_write(0xFD070F0C, 0x000001FFU, 0x00000010U);
2236d034093SMichal Simek 	psu_mask_write(0xFD070F10, 0x000000FFU, 0x0000000FU);
2246d034093SMichal Simek 	psu_mask_write(0xFD072190, 0x1FBFBF3FU, 0x07828002U);
2256d034093SMichal Simek 	psu_mask_write(0xFD1A0108, 0x0000000CU, 0x00000000U);
2266d034093SMichal Simek 	psu_mask_write(0xFD080010, 0xFFFFFFFFU, 0x87001E00U);
2276d034093SMichal Simek 	psu_mask_write(0xFD080018, 0xFFFFFFFFU, 0x00F03D28U);
2286d034093SMichal Simek 	psu_mask_write(0xFD08001C, 0xFFFFFFFFU, 0x55AA5480U);
2296d034093SMichal Simek 	psu_mask_write(0xFD080024, 0xFFFFFFFFU, 0x010100F4U);
2306d034093SMichal Simek 	psu_mask_write(0xFD080040, 0xFFFFFFFFU, 0x85642AD0U);
2316d034093SMichal Simek 	psu_mask_write(0xFD080044, 0xFFFFFFFFU, 0xA0AA0580U);
2326d034093SMichal Simek 	psu_mask_write(0xFD080068, 0xFFFFFFFFU, 0x05102000U);
2336d034093SMichal Simek 	psu_mask_write(0xFD080090, 0xFFFFFFFFU, 0x02A040A1U);
2346d034093SMichal Simek 	psu_mask_write(0xFD0800C0, 0xFFFFFFFFU, 0x000000D3U);
2356d034093SMichal Simek 	psu_mask_write(0xFD080100, 0xFFFFFFFFU, 0x0000040DU);
2366d034093SMichal Simek 	psu_mask_write(0xFD080110, 0xFFFFFFFFU, 0x06180C08U);
2376d034093SMichal Simek 	psu_mask_write(0xFD080114, 0xFFFFFFFFU, 0x2816050AU);
2386d034093SMichal Simek 	psu_mask_write(0xFD080118, 0xFFFFFFFFU, 0x00080064U);
2396d034093SMichal Simek 	psu_mask_write(0xFD08011C, 0xFFFFFFFFU, 0x82000501U);
2406d034093SMichal Simek 	psu_mask_write(0xFD080120, 0xFFFFFFFFU, 0x00602B08U);
2416d034093SMichal Simek 	psu_mask_write(0xFD080124, 0xFFFFFFFFU, 0x00231008U);
2426d034093SMichal Simek 	psu_mask_write(0xFD080128, 0xFFFFFFFFU, 0x0000080EU);
2436d034093SMichal Simek 	psu_mask_write(0xFD080140, 0xFFFFFFFFU, 0x08400020U);
2446d034093SMichal Simek 	psu_mask_write(0xFD080144, 0xFFFFFFFFU, 0x00000C80U);
2456d034093SMichal Simek 	psu_mask_write(0xFD080150, 0xFFFFFFFFU, 0x00000000U);
2466d034093SMichal Simek 	psu_mask_write(0xFD080154, 0xFFFFFFFFU, 0x00000000U);
2476d034093SMichal Simek 	psu_mask_write(0xFD080180, 0xFFFFFFFFU, 0x00000000U);
2486d034093SMichal Simek 	psu_mask_write(0xFD080184, 0xFFFFFFFFU, 0x00000024U);
2496d034093SMichal Simek 	psu_mask_write(0xFD080188, 0xFFFFFFFFU, 0x00000012U);
2506d034093SMichal Simek 	psu_mask_write(0xFD08018C, 0xFFFFFFFFU, 0x00000031U);
2516d034093SMichal Simek 	psu_mask_write(0xFD080190, 0xFFFFFFFFU, 0x00000008U);
2526d034093SMichal Simek 	psu_mask_write(0xFD080194, 0xFFFFFFFFU, 0x00000000U);
2536d034093SMichal Simek 	psu_mask_write(0xFD080198, 0xFFFFFFFFU, 0x00000000U);
2546d034093SMichal Simek 	psu_mask_write(0xFD0801AC, 0xFFFFFFFFU, 0x00000056U);
2556d034093SMichal Simek 	psu_mask_write(0xFD0801B0, 0xFFFFFFFFU, 0x00000021U);
2566d034093SMichal Simek 	psu_mask_write(0xFD0801B4, 0xFFFFFFFFU, 0x00000008U);
2576d034093SMichal Simek 	psu_mask_write(0xFD0801B8, 0xFFFFFFFFU, 0x00000019U);
2586d034093SMichal Simek 	psu_mask_write(0xFD0801D8, 0xFFFFFFFFU, 0x00000016U);
2596d034093SMichal Simek 	psu_mask_write(0xFD080200, 0xFFFFFFFFU, 0x810091C7U);
2606d034093SMichal Simek 	psu_mask_write(0xFD080204, 0xFFFFFFFFU, 0x00030236U);
2616d034093SMichal Simek 	psu_mask_write(0xFD080240, 0xFFFFFFFFU, 0x00141054U);
2626d034093SMichal Simek 	psu_mask_write(0xFD080250, 0xFFFFFFFFU, 0x00088000U);
2636d034093SMichal Simek 	psu_mask_write(0xFD080414, 0xFFFFFFFFU, 0x12340800U);
2646d034093SMichal Simek 	psu_mask_write(0xFD0804F4, 0xFFFFFFFFU, 0x0000000AU);
2656d034093SMichal Simek 	psu_mask_write(0xFD080500, 0xFFFFFFFFU, 0x30000028U);
2666d034093SMichal Simek 	psu_mask_write(0xFD080508, 0xFFFFFFFFU, 0x00000000U);
2676d034093SMichal Simek 	psu_mask_write(0xFD08050C, 0xFFFFFFFFU, 0x00000005U);
2686d034093SMichal Simek 	psu_mask_write(0xFD080510, 0xFFFFFFFFU, 0x00000000U);
2696d034093SMichal Simek 	psu_mask_write(0xFD080520, 0xFFFFFFFFU, 0x0300BD99U);
2706d034093SMichal Simek 	psu_mask_write(0xFD080528, 0xFFFFFFFFU, 0xF1032019U);
2716d034093SMichal Simek 	psu_mask_write(0xFD08052C, 0xFFFFFFFFU, 0x07F001E3U);
2726d034093SMichal Simek 	psu_mask_write(0xFD080544, 0xFFFFFFFFU, 0x00000000U);
2736d034093SMichal Simek 	psu_mask_write(0xFD080548, 0xFFFFFFFFU, 0x00000000U);
2746d034093SMichal Simek 	psu_mask_write(0xFD080558, 0xFFFFFFFFU, 0x00000000U);
2756d034093SMichal Simek 	psu_mask_write(0xFD08055C, 0xFFFFFFFFU, 0x00000000U);
2766d034093SMichal Simek 	psu_mask_write(0xFD080560, 0xFFFFFFFFU, 0x00000000U);
2776d034093SMichal Simek 	psu_mask_write(0xFD080564, 0xFFFFFFFFU, 0x00000000U);
2786d034093SMichal Simek 	psu_mask_write(0xFD080680, 0xFFFFFFFFU, 0x00894C58U);
2796d034093SMichal Simek 	psu_mask_write(0xFD080684, 0xFFFFFFFFU, 0x0001B39BU);
2806d034093SMichal Simek 	psu_mask_write(0xFD080694, 0xFFFFFFFFU, 0x01E10210U);
2816d034093SMichal Simek 	psu_mask_write(0xFD080698, 0xFFFFFFFFU, 0x01E10000U);
2826d034093SMichal Simek 	psu_mask_write(0xFD0806A4, 0xFFFFFFFFU, 0x0001BB9BU);
2836d034093SMichal Simek 	psu_mask_write(0xFD080700, 0xFFFFFFFFU, 0x40800604U);
2846d034093SMichal Simek 	psu_mask_write(0xFD080710, 0xFFFFFFFFU, 0x0E00F50CU);
2856d034093SMichal Simek 	psu_mask_write(0xFD080714, 0xFFFFFFFFU, 0x09091616U);
2866d034093SMichal Simek 	psu_mask_write(0xFD080718, 0xFFFFFFFFU, 0x09092B2BU);
2876d034093SMichal Simek 	psu_mask_write(0xFD080800, 0xFFFFFFFFU, 0x40800604U);
2886d034093SMichal Simek 	psu_mask_write(0xFD080810, 0xFFFFFFFFU, 0x0E00F50CU);
2896d034093SMichal Simek 	psu_mask_write(0xFD080814, 0xFFFFFFFFU, 0x09091616U);
2906d034093SMichal Simek 	psu_mask_write(0xFD080818, 0xFFFFFFFFU, 0x09092B2BU);
2916d034093SMichal Simek 	psu_mask_write(0xFD080900, 0xFFFFFFFFU, 0x40800604U);
2926d034093SMichal Simek 	psu_mask_write(0xFD080904, 0xFFFFFFFFU, 0x00007FFFU);
2936d034093SMichal Simek 	psu_mask_write(0xFD080910, 0xFFFFFFFFU, 0x0E00F50CU);
2946d034093SMichal Simek 	psu_mask_write(0xFD080914, 0xFFFFFFFFU, 0x09091616U);
2956d034093SMichal Simek 	psu_mask_write(0xFD080918, 0xFFFFFFFFU, 0x09092B2BU);
2966d034093SMichal Simek 	psu_mask_write(0xFD080A00, 0xFFFFFFFFU, 0x40800604U);
2976d034093SMichal Simek 	psu_mask_write(0xFD080A04, 0xFFFFFFFFU, 0x00007FFFU);
2986d034093SMichal Simek 	psu_mask_write(0xFD080A10, 0xFFFFFFFFU, 0x0E00F50CU);
2996d034093SMichal Simek 	psu_mask_write(0xFD080A14, 0xFFFFFFFFU, 0x09091616U);
3006d034093SMichal Simek 	psu_mask_write(0xFD080A18, 0xFFFFFFFFU, 0x09092B2BU);
3016d034093SMichal Simek 	psu_mask_write(0xFD080B00, 0xFFFFFFFFU, 0x40800604U);
3026d034093SMichal Simek 	psu_mask_write(0xFD080B04, 0xFFFFFFFFU, 0x00007F00U);
3036d034093SMichal Simek 	psu_mask_write(0xFD080B10, 0xFFFFFFFFU, 0x0E00BD0CU);
3046d034093SMichal Simek 	psu_mask_write(0xFD080B14, 0xFFFFFFFFU, 0x09091616U);
3056d034093SMichal Simek 	psu_mask_write(0xFD080B18, 0xFFFFFFFFU, 0x09092B2BU);
3066d034093SMichal Simek 	psu_mask_write(0xFD080C00, 0xFFFFFFFFU, 0x40800604U);
3076d034093SMichal Simek 	psu_mask_write(0xFD080C04, 0xFFFFFFFFU, 0x00007F00U);
3086d034093SMichal Simek 	psu_mask_write(0xFD080C10, 0xFFFFFFFFU, 0x0E00BD0CU);
3096d034093SMichal Simek 	psu_mask_write(0xFD080C14, 0xFFFFFFFFU, 0x09091616U);
3106d034093SMichal Simek 	psu_mask_write(0xFD080C18, 0xFFFFFFFFU, 0x09092B2BU);
3116d034093SMichal Simek 	psu_mask_write(0xFD080D00, 0xFFFFFFFFU, 0x40800604U);
3126d034093SMichal Simek 	psu_mask_write(0xFD080D04, 0xFFFFFFFFU, 0x00007F00U);
3136d034093SMichal Simek 	psu_mask_write(0xFD080D10, 0xFFFFFFFFU, 0x0E00BD0CU);
3146d034093SMichal Simek 	psu_mask_write(0xFD080D14, 0xFFFFFFFFU, 0x09091616U);
3156d034093SMichal Simek 	psu_mask_write(0xFD080D18, 0xFFFFFFFFU, 0x09092B2BU);
3166d034093SMichal Simek 	psu_mask_write(0xFD080E00, 0xFFFFFFFFU, 0x40800604U);
3176d034093SMichal Simek 	psu_mask_write(0xFD080E04, 0xFFFFFFFFU, 0x00007F00U);
3186d034093SMichal Simek 	psu_mask_write(0xFD080E10, 0xFFFFFFFFU, 0x0E00BD0CU);
3196d034093SMichal Simek 	psu_mask_write(0xFD080E14, 0xFFFFFFFFU, 0x09091616U);
3206d034093SMichal Simek 	psu_mask_write(0xFD080E18, 0xFFFFFFFFU, 0x09092B2BU);
3216d034093SMichal Simek 	psu_mask_write(0xFD080F00, 0xFFFFFFFFU, 0x40800624U);
3226d034093SMichal Simek 	psu_mask_write(0xFD080F04, 0xFFFFFFFFU, 0x00007F00U);
3236d034093SMichal Simek 	psu_mask_write(0xFD080F10, 0xFFFFFFFFU, 0x0E00BD0CU);
3246d034093SMichal Simek 	psu_mask_write(0xFD080F14, 0xFFFFFFFFU, 0x09091616U);
3256d034093SMichal Simek 	psu_mask_write(0xFD080F18, 0xFFFFFFFFU, 0x09092B2BU);
3266d034093SMichal Simek 	psu_mask_write(0xFD081400, 0xFFFFFFFFU, 0x2A019FFEU);
3276d034093SMichal Simek 	psu_mask_write(0xFD081404, 0xFFFFFFFFU, 0x05102000U);
3286d034093SMichal Simek 	psu_mask_write(0xFD08141C, 0xFFFFFFFFU, 0x01264300U);
3296d034093SMichal Simek 	psu_mask_write(0xFD08142C, 0xFFFFFFFFU, 0x000C1800U);
3306d034093SMichal Simek 	psu_mask_write(0xFD081430, 0xFFFFFFFFU, 0x71000000U);
3316d034093SMichal Simek 	psu_mask_write(0xFD081440, 0xFFFFFFFFU, 0x2A019FFEU);
3326d034093SMichal Simek 	psu_mask_write(0xFD081444, 0xFFFFFFFFU, 0x05102000U);
3336d034093SMichal Simek 	psu_mask_write(0xFD08145C, 0xFFFFFFFFU, 0x01264300U);
3346d034093SMichal Simek 	psu_mask_write(0xFD08146C, 0xFFFFFFFFU, 0x000C1800U);
3356d034093SMichal Simek 	psu_mask_write(0xFD081470, 0xFFFFFFFFU, 0x71000000U);
3366d034093SMichal Simek 	psu_mask_write(0xFD081480, 0xFFFFFFFFU, 0x2A019FFEU);
3376d034093SMichal Simek 	psu_mask_write(0xFD081484, 0xFFFFFFFFU, 0x05102000U);
3386d034093SMichal Simek 	psu_mask_write(0xFD08149C, 0xFFFFFFFFU, 0x01264300U);
3396d034093SMichal Simek 	psu_mask_write(0xFD0814AC, 0xFFFFFFFFU, 0x000C1800U);
3406d034093SMichal Simek 	psu_mask_write(0xFD0814B0, 0xFFFFFFFFU, 0x71000000U);
3416d034093SMichal Simek 	psu_mask_write(0xFD0814C0, 0xFFFFFFFFU, 0x2A019FFEU);
3426d034093SMichal Simek 	psu_mask_write(0xFD0814C4, 0xFFFFFFFFU, 0x05102000U);
3436d034093SMichal Simek 	psu_mask_write(0xFD0814DC, 0xFFFFFFFFU, 0x01264300U);
3446d034093SMichal Simek 	psu_mask_write(0xFD0814EC, 0xFFFFFFFFU, 0x000C1800U);
3456d034093SMichal Simek 	psu_mask_write(0xFD0814F0, 0xFFFFFFFFU, 0x71000000U);
3466d034093SMichal Simek 	psu_mask_write(0xFD081500, 0xFFFFFFFFU, 0x2A019FFEU);
3476d034093SMichal Simek 	psu_mask_write(0xFD081504, 0xFFFFFFFFU, 0x05102000U);
3486d034093SMichal Simek 	psu_mask_write(0xFD08151C, 0xFFFFFFFFU, 0x01264300U);
3496d034093SMichal Simek 	psu_mask_write(0xFD08152C, 0xFFFFFFFFU, 0x000C1800U);
3506d034093SMichal Simek 	psu_mask_write(0xFD081530, 0xFFFFFFFFU, 0x71000000U);
3516d034093SMichal Simek 	psu_mask_write(0xFD0817C4, 0xFFFFFFFFU, 0x05102000U);
3526d034093SMichal Simek 	psu_mask_write(0xFD0817DC, 0xFFFFFFFFU, 0x012643C4U);
3536d034093SMichal Simek 
3546d034093SMichal Simek 	return 1;
3556d034093SMichal Simek }
3566d034093SMichal Simek 
3576d034093SMichal Simek static unsigned long psu_ddr_qos_init_data(void)
3586d034093SMichal Simek {
3596d034093SMichal Simek 	psu_mask_write(0xFD090000, 0x0000FFFFU, 0x00000845U);
3606d034093SMichal Simek 	psu_mask_write(0xFD090004, 0x002DB5ADU, 0x002DB5ADU);
3616d034093SMichal Simek 	psu_mask_write(0xFD090800, 0xFFFFFFFFU, 0x00000001U);
3626d034093SMichal Simek 	psu_mask_write(0xFD09000C, 0x0000007FU, 0x00000010U);
3636d034093SMichal Simek 	psu_mask_write(0xFD090010, 0x0000007FU, 0x00000010U);
3646d034093SMichal Simek 	psu_mask_write(0xFD380008, 0x0000000FU, 0x00000007U);
3656d034093SMichal Simek 	psu_mask_write(0xFD38001C, 0x0000000FU, 0x0000000FU);
3666d034093SMichal Simek 	psu_mask_write(0xFD390008, 0x0000000FU, 0x00000003U);
3676d034093SMichal Simek 	psu_mask_write(0xFD39001C, 0x0000000FU, 0x00000003U);
3686d034093SMichal Simek 	psu_mask_write(0xFD3A0008, 0x0000000FU, 0x00000003U);
3696d034093SMichal Simek 	psu_mask_write(0xFD3A001C, 0x0000000FU, 0x00000003U);
3706d034093SMichal Simek 	psu_mask_write(0xFD3B0008, 0x0000000FU, 0x00000003U);
3716d034093SMichal Simek 	psu_mask_write(0xFD3B001C, 0x0000000FU, 0x00000003U);
3726d034093SMichal Simek 
3736d034093SMichal Simek 	return 1;
3746d034093SMichal Simek }
3756d034093SMichal Simek 
3766d034093SMichal Simek static unsigned long psu_mio_init_data(void)
3776d034093SMichal Simek {
3786d034093SMichal Simek 	psu_mask_write(0xFF180000, 0x000000FEU, 0x000000C0U);
3796d034093SMichal Simek 	psu_mask_write(0xFF180004, 0x000000FEU, 0x000000C0U);
3806d034093SMichal Simek 	psu_mask_write(0xFF180008, 0x000000FEU, 0x000000C0U);
3816d034093SMichal Simek 	psu_mask_write(0xFF18000C, 0x000000FEU, 0x000000C0U);
3826d034093SMichal Simek 	psu_mask_write(0xFF180010, 0x000000FEU, 0x00000040U);
3836d034093SMichal Simek 	psu_mask_write(0xFF180014, 0x000000FEU, 0x00000040U);
3846d034093SMichal Simek 	psu_mask_write(0xFF180018, 0x000000FEU, 0x00000080U);
3856d034093SMichal Simek 	psu_mask_write(0xFF18001C, 0x000000FEU, 0x00000000U);
3866d034093SMichal Simek 	psu_mask_write(0xFF180020, 0x000000FEU, 0x00000000U);
3876d034093SMichal Simek 	psu_mask_write(0xFF180024, 0x000000FEU, 0x00000080U);
3886d034093SMichal Simek 	psu_mask_write(0xFF180028, 0x000000FEU, 0x00000080U);
3896d034093SMichal Simek 	psu_mask_write(0xFF18002C, 0x000000FEU, 0x00000080U);
3906d034093SMichal Simek 	psu_mask_write(0xFF180030, 0x000000FEU, 0x00000000U);
3916d034093SMichal Simek 	psu_mask_write(0xFF180034, 0x000000FEU, 0x00000008U);
3926d034093SMichal Simek 	psu_mask_write(0xFF180038, 0x000000FEU, 0x00000008U);
3936d034093SMichal Simek 	psu_mask_write(0xFF18003C, 0x000000FEU, 0x00000008U);
3946d034093SMichal Simek 	psu_mask_write(0xFF180040, 0x000000FEU, 0x00000008U);
3956d034093SMichal Simek 	psu_mask_write(0xFF180044, 0x000000FEU, 0x00000000U);
3966d034093SMichal Simek 	psu_mask_write(0xFF180048, 0x000000FEU, 0x00000000U);
3976d034093SMichal Simek 	psu_mask_write(0xFF18004C, 0x000000FEU, 0x00000000U);
3986d034093SMichal Simek 	psu_mask_write(0xFF180050, 0x000000FEU, 0x00000000U);
3996d034093SMichal Simek 	psu_mask_write(0xFF180054, 0x000000FEU, 0x00000008U);
4006d034093SMichal Simek 	psu_mask_write(0xFF180058, 0x000000FEU, 0x00000008U);
4016d034093SMichal Simek 	psu_mask_write(0xFF18005C, 0x000000FEU, 0x00000000U);
4026d034093SMichal Simek 	psu_mask_write(0xFF180060, 0x000000FEU, 0x00000008U);
4036d034093SMichal Simek 	psu_mask_write(0xFF180064, 0x000000FEU, 0x00000000U);
4046d034093SMichal Simek 	psu_mask_write(0xFF180068, 0x000000FEU, 0x00000000U);
4056d034093SMichal Simek 	psu_mask_write(0xFF18006C, 0x000000FEU, 0x00000018U);
4066d034093SMichal Simek 	psu_mask_write(0xFF180070, 0x000000FEU, 0x00000018U);
4076d034093SMichal Simek 	psu_mask_write(0xFF180074, 0x000000FEU, 0x00000018U);
4086d034093SMichal Simek 	psu_mask_write(0xFF180078, 0x000000FEU, 0x00000018U);
4096d034093SMichal Simek 	psu_mask_write(0xFF18007C, 0x000000FEU, 0x00000000U);
4106d034093SMichal Simek 	psu_mask_write(0xFF180080, 0x000000FEU, 0x00000008U);
4116d034093SMichal Simek 	psu_mask_write(0xFF180084, 0x000000FEU, 0x00000008U);
4126d034093SMichal Simek 	psu_mask_write(0xFF180088, 0x000000FEU, 0x00000008U);
4136d034093SMichal Simek 	psu_mask_write(0xFF18008C, 0x000000FEU, 0x00000000U);
4146d034093SMichal Simek 	psu_mask_write(0xFF180090, 0x000000FEU, 0x00000000U);
4156d034093SMichal Simek 	psu_mask_write(0xFF180094, 0x000000FEU, 0x00000000U);
4166d034093SMichal Simek 	psu_mask_write(0xFF180098, 0x000000FEU, 0x00000080U);
4176d034093SMichal Simek 	psu_mask_write(0xFF18009C, 0x000000FEU, 0x00000000U);
4186d034093SMichal Simek 	psu_mask_write(0xFF1800A0, 0x000000FEU, 0x00000000U);
4196d034093SMichal Simek 	psu_mask_write(0xFF1800A4, 0x000000FEU, 0x00000080U);
4206d034093SMichal Simek 	psu_mask_write(0xFF1800A8, 0x000000FEU, 0x00000080U);
4216d034093SMichal Simek 	psu_mask_write(0xFF1800AC, 0x000000FEU, 0x00000080U);
4226d034093SMichal Simek 	psu_mask_write(0xFF1800B0, 0x000000FEU, 0x00000000U);
4236d034093SMichal Simek 	psu_mask_write(0xFF1800B4, 0x000000FEU, 0x00000000U);
4246d034093SMichal Simek 	psu_mask_write(0xFF1800B8, 0x000000FEU, 0x00000010U);
4256d034093SMichal Simek 	psu_mask_write(0xFF1800BC, 0x000000FEU, 0x00000010U);
4266d034093SMichal Simek 	psu_mask_write(0xFF1800C0, 0x000000FEU, 0x00000010U);
4276d034093SMichal Simek 	psu_mask_write(0xFF1800C4, 0x000000FEU, 0x00000010U);
4286d034093SMichal Simek 	psu_mask_write(0xFF1800C8, 0x000000FEU, 0x00000010U);
4296d034093SMichal Simek 	psu_mask_write(0xFF1800CC, 0x000000FEU, 0x00000010U);
4306d034093SMichal Simek 	psu_mask_write(0xFF1800D0, 0x000000FEU, 0x00000004U);
4316d034093SMichal Simek 	psu_mask_write(0xFF1800D4, 0x000000FEU, 0x00000004U);
4326d034093SMichal Simek 	psu_mask_write(0xFF1800D8, 0x000000FEU, 0x00000004U);
4336d034093SMichal Simek 	psu_mask_write(0xFF1800DC, 0x000000FEU, 0x00000004U);
4346d034093SMichal Simek 	psu_mask_write(0xFF1800E0, 0x000000FEU, 0x00000004U);
4356d034093SMichal Simek 	psu_mask_write(0xFF1800E4, 0x000000FEU, 0x00000004U);
4366d034093SMichal Simek 	psu_mask_write(0xFF1800E8, 0x000000FEU, 0x00000004U);
4376d034093SMichal Simek 	psu_mask_write(0xFF1800EC, 0x000000FEU, 0x00000004U);
4386d034093SMichal Simek 	psu_mask_write(0xFF1800F0, 0x000000FEU, 0x00000004U);
4396d034093SMichal Simek 	psu_mask_write(0xFF1800F4, 0x000000FEU, 0x00000004U);
4406d034093SMichal Simek 	psu_mask_write(0xFF1800F8, 0x000000FEU, 0x00000004U);
4416d034093SMichal Simek 	psu_mask_write(0xFF1800FC, 0x000000FEU, 0x00000004U);
4426d034093SMichal Simek 	psu_mask_write(0xFF180100, 0x000000FEU, 0x00000004U);
4436d034093SMichal Simek 	psu_mask_write(0xFF180104, 0x000000FEU, 0x00000004U);
4446d034093SMichal Simek 	psu_mask_write(0xFF180108, 0x000000FEU, 0x00000004U);
4456d034093SMichal Simek 	psu_mask_write(0xFF18010C, 0x000000FEU, 0x00000004U);
4466d034093SMichal Simek 	psu_mask_write(0xFF180110, 0x000000FEU, 0x00000004U);
4476d034093SMichal Simek 	psu_mask_write(0xFF180114, 0x000000FEU, 0x00000004U);
4486d034093SMichal Simek 	psu_mask_write(0xFF180118, 0x000000FEU, 0x00000004U);
4496d034093SMichal Simek 	psu_mask_write(0xFF18011C, 0x000000FEU, 0x00000004U);
4506d034093SMichal Simek 	psu_mask_write(0xFF180120, 0x000000FEU, 0x00000004U);
4516d034093SMichal Simek 	psu_mask_write(0xFF180124, 0x000000FEU, 0x00000004U);
4526d034093SMichal Simek 	psu_mask_write(0xFF180128, 0x000000FEU, 0x00000004U);
4536d034093SMichal Simek 	psu_mask_write(0xFF18012C, 0x000000FEU, 0x00000004U);
4546d034093SMichal Simek 	psu_mask_write(0xFF180130, 0x000000FEU, 0x00000000U);
4556d034093SMichal Simek 	psu_mask_write(0xFF180134, 0x000000FEU, 0x00000000U);
4566d034093SMichal Simek 	psu_mask_write(0xFF180204, 0xFFFFFFFFU, 0x51000006U);
4576d034093SMichal Simek 	psu_mask_write(0xFF180208, 0xFFFFFFFFU, 0x00B00000U);
4586d034093SMichal Simek 	psu_mask_write(0xFF18020C, 0x00003FFFU, 0x0000000BU);
4596d034093SMichal Simek 	psu_mask_write(0xFF180138, 0x03FFFFFFU, 0x039E1FFFU);
4606d034093SMichal Simek 	psu_mask_write(0xFF18013C, 0x03FFFFFFU, 0x03FFFFFFU);
4616d034093SMichal Simek 	psu_mask_write(0xFF180140, 0x03FFFFFFU, 0x00000000U);
4626d034093SMichal Simek 	psu_mask_write(0xFF180144, 0x03FFFFFFU, 0x03FFFFFFU);
4636d034093SMichal Simek 	psu_mask_write(0xFF180148, 0x03FFFFFFU, 0x03FFFFFFU);
4646d034093SMichal Simek 	psu_mask_write(0xFF18014C, 0x03FFFFFFU, 0x00000000U);
4656d034093SMichal Simek 	psu_mask_write(0xFF180154, 0x03FFFFFFU, 0x03FFFFFFU);
4666d034093SMichal Simek 	psu_mask_write(0xFF180158, 0x03FFFFFFU, 0x03FFFFFFU);
4676d034093SMichal Simek 	psu_mask_write(0xFF18015C, 0x03FFFFFFU, 0x00000000U);
4686d034093SMichal Simek 	psu_mask_write(0xFF180160, 0x03FFFFFFU, 0x03FFFFFFU);
4696d034093SMichal Simek 	psu_mask_write(0xFF180164, 0x03FFFFFFU, 0x03FFFFFFU);
4706d034093SMichal Simek 	psu_mask_write(0xFF180168, 0x03FFFFFFU, 0x00000000U);
4716d034093SMichal Simek 	psu_mask_write(0xFF180170, 0x03FFFFFFU, 0x03FFFFFFU);
4726d034093SMichal Simek 	psu_mask_write(0xFF180174, 0x03FFFFFFU, 0x03FFFFFFU);
4736d034093SMichal Simek 	psu_mask_write(0xFF180178, 0x03FFFFFFU, 0x00000000U);
4746d034093SMichal Simek 	psu_mask_write(0xFF18017C, 0x03FFFFFFU, 0x03FFFFFFU);
4756d034093SMichal Simek 	psu_mask_write(0xFF180180, 0x03FFFFFFU, 0x03FFFFFFU);
4766d034093SMichal Simek 	psu_mask_write(0xFF180184, 0x03FFFFFFU, 0x00000000U);
4776d034093SMichal Simek 	psu_mask_write(0xFF180200, 0x0000000FU, 0x00000000U);
4786d034093SMichal Simek 
4796d034093SMichal Simek 	return 1;
4806d034093SMichal Simek }
4816d034093SMichal Simek 
4826d034093SMichal Simek static unsigned long psu_peripherals_init_data(void)
4836d034093SMichal Simek {
484*e00656b2SMichal Simek 	psu_mask_write(0xFD1A0100, 0x0001807CU, 0x00000000U);
4856d034093SMichal Simek 	psu_mask_write(0xFF5E0238, 0x001A0000U, 0x00000000U);
4866d034093SMichal Simek 	psu_mask_write(0xFF5E023C, 0x0093C018U, 0x00000000U);
4876d034093SMichal Simek 	psu_mask_write(0xFF5E023C, 0x00000FC0U, 0x00000000U);
4886d034093SMichal Simek 	psu_mask_write(0xFF5E0238, 0x00000060U, 0x00000000U);
4896d034093SMichal Simek 	psu_mask_write(0xFF180310, 0x00008001U, 0x00000000U);
4906d034093SMichal Simek 	psu_mask_write(0xFF180320, 0x33803380U, 0x00800080U);
4916d034093SMichal Simek 	psu_mask_write(0xFF18031C, 0x00007FFEU, 0x00006450U);
4926d034093SMichal Simek 	psu_mask_write(0xFF180358, 0x00080000U, 0x00080000U);
4936d034093SMichal Simek 	psu_mask_write(0xFF18031C, 0x7FFE0000U, 0x64500000U);
4946d034093SMichal Simek 	psu_mask_write(0xFF180358, 0x00000008U, 0x00000008U);
4956d034093SMichal Simek 	psu_mask_write(0xFF180324, 0x000003C0U, 0x00000000U);
4966d034093SMichal Simek 	psu_mask_write(0xFF180324, 0x03C00000U, 0x00000000U);
4976d034093SMichal Simek 	psu_mask_write(0xFF5E0238, 0x00000400U, 0x00000000U);
4986d034093SMichal Simek 	psu_mask_write(0xFF5E0238, 0x00000018U, 0x00000000U);
4996d034093SMichal Simek 	psu_mask_write(0xFF5E0238, 0x00000800U, 0x00000000U);
5006d034093SMichal Simek 	psu_mask_write(0xFF5E0238, 0x00000006U, 0x00000000U);
5016d034093SMichal Simek 	psu_mask_write(0xFD4AB120, 0x00000007U, 0x00000007U);
5026d034093SMichal Simek 	psu_mask_write(0xFF000034, 0x000000FFU, 0x00000005U);
5036d034093SMichal Simek 	psu_mask_write(0xFF000018, 0x0000FFFFU, 0x0000008FU);
5046d034093SMichal Simek 	psu_mask_write(0xFF000000, 0x000001FFU, 0x00000017U);
5056d034093SMichal Simek 	psu_mask_write(0xFF000004, 0x000003FFU, 0x00000020U);
5066d034093SMichal Simek 	psu_mask_write(0xFF010034, 0x000000FFU, 0x00000005U);
5076d034093SMichal Simek 	psu_mask_write(0xFF010018, 0x0000FFFFU, 0x0000008FU);
5086d034093SMichal Simek 	psu_mask_write(0xFF010000, 0x000001FFU, 0x00000017U);
5096d034093SMichal Simek 	psu_mask_write(0xFF010004, 0x000003FFU, 0x00000020U);
5106d034093SMichal Simek 	psu_mask_write(0xFF5E0238, 0x00040000U, 0x00000000U);
5116d034093SMichal Simek 	psu_mask_write(0xFF4B0024, 0x000000FFU, 0x000000FFU);
5126d034093SMichal Simek 	psu_mask_write(0xFFCA5000, 0x00001FFFU, 0x00000000U);
5136d034093SMichal Simek 	psu_mask_write(0xFD5C0060, 0x000F000FU, 0x00000000U);
5146d034093SMichal Simek 	psu_mask_write(0xFFA60040, 0x80000000U, 0x80000000U);
5156d034093SMichal Simek 	psu_mask_write(0xFF260020, 0xFFFFFFFFU, 0x05F5DD17U);
5166d034093SMichal Simek 	psu_mask_write(0xFF260000, 0x00000001U, 0x00000001U);
5176d034093SMichal Simek 
5186d034093SMichal Simek 	return 1;
5196d034093SMichal Simek }
5206d034093SMichal Simek 
5216d034093SMichal Simek static unsigned long psu_serdes_init_data(void)
5226d034093SMichal Simek {
5236d034093SMichal Simek 	psu_mask_write(0xFD410000, 0x0000001FU, 0x00000009U);
5246d034093SMichal Simek 	psu_mask_write(0xFD410004, 0x0000001FU, 0x00000009U);
5256d034093SMichal Simek 	psu_mask_write(0xFD410008, 0x0000001FU, 0x00000008U);
5266d034093SMichal Simek 	psu_mask_write(0xFD41000C, 0x0000001FU, 0x00000008U);
5276d034093SMichal Simek 	psu_mask_write(0xFD402860, 0x00000082U, 0x00000002U);
5286d034093SMichal Simek 	psu_mask_write(0xFD402864, 0x00000080U, 0x00000080U);
5296d034093SMichal Simek 	psu_mask_write(0xFD402868, 0x00000081U, 0x00000001U);
5306d034093SMichal Simek 	psu_mask_write(0xFD40286C, 0x00000081U, 0x00000001U);
5316d034093SMichal Simek 	psu_mask_write(0xFD40A094, 0x00000010U, 0x00000010U);
5326d034093SMichal Simek 	psu_mask_write(0xFD40E094, 0x00000010U, 0x00000010U);
5336d034093SMichal Simek 	psu_mask_write(0xFD40A368, 0x000000FFU, 0x00000038U);
5346d034093SMichal Simek 	psu_mask_write(0xFD40A36C, 0x00000007U, 0x00000003U);
5356d034093SMichal Simek 	psu_mask_write(0xFD40E368, 0x000000FFU, 0x00000038U);
5366d034093SMichal Simek 	psu_mask_write(0xFD40E36C, 0x00000007U, 0x00000003U);
5376d034093SMichal Simek 	psu_mask_write(0xFD402368, 0x000000FFU, 0x00000058U);
5386d034093SMichal Simek 	psu_mask_write(0xFD40236C, 0x00000007U, 0x00000003U);
5396d034093SMichal Simek 	psu_mask_write(0xFD406368, 0x000000FFU, 0x00000058U);
5406d034093SMichal Simek 	psu_mask_write(0xFD40636C, 0x00000007U, 0x00000003U);
5416d034093SMichal Simek 	psu_mask_write(0xFD402370, 0x000000FFU, 0x0000007CU);
5426d034093SMichal Simek 	psu_mask_write(0xFD402374, 0x000000FFU, 0x00000033U);
5436d034093SMichal Simek 	psu_mask_write(0xFD402378, 0x000000FFU, 0x00000002U);
5446d034093SMichal Simek 	psu_mask_write(0xFD40237C, 0x00000033U, 0x00000030U);
5456d034093SMichal Simek 	psu_mask_write(0xFD406370, 0x000000FFU, 0x0000007CU);
5466d034093SMichal Simek 	psu_mask_write(0xFD406374, 0x000000FFU, 0x00000033U);
5476d034093SMichal Simek 	psu_mask_write(0xFD406378, 0x000000FFU, 0x00000002U);
5486d034093SMichal Simek 	psu_mask_write(0xFD40637C, 0x00000033U, 0x00000030U);
5496d034093SMichal Simek 	psu_mask_write(0xFD40A370, 0x000000FFU, 0x000000F4U);
5506d034093SMichal Simek 	psu_mask_write(0xFD40A374, 0x000000FFU, 0x00000031U);
5516d034093SMichal Simek 	psu_mask_write(0xFD40A378, 0x000000FFU, 0x00000002U);
5526d034093SMichal Simek 	psu_mask_write(0xFD40A37C, 0x00000033U, 0x00000030U);
5536d034093SMichal Simek 	psu_mask_write(0xFD40E370, 0x000000FFU, 0x000000F4U);
5546d034093SMichal Simek 	psu_mask_write(0xFD40E374, 0x000000FFU, 0x00000031U);
5556d034093SMichal Simek 	psu_mask_write(0xFD40E378, 0x000000FFU, 0x00000002U);
5566d034093SMichal Simek 	psu_mask_write(0xFD40E37C, 0x00000033U, 0x00000030U);
5576d034093SMichal Simek 	psu_mask_write(0xFD40906C, 0x00000003U, 0x00000003U);
5586d034093SMichal Simek 	psu_mask_write(0xFD4080F4, 0x00000003U, 0x00000003U);
5596d034093SMichal Simek 	psu_mask_write(0xFD40D06C, 0x00000003U, 0x00000003U);
5606d034093SMichal Simek 	psu_mask_write(0xFD40C0F4, 0x00000003U, 0x00000003U);
5616d034093SMichal Simek 	psu_mask_write(0xFD4090CC, 0x00000020U, 0x00000020U);
5626d034093SMichal Simek 	psu_mask_write(0xFD40D0CC, 0x00000020U, 0x00000020U);
5636d034093SMichal Simek 	psu_mask_write(0xFD401074, 0x00000010U, 0x00000010U);
5646d034093SMichal Simek 	psu_mask_write(0xFD405074, 0x00000010U, 0x00000010U);
5656d034093SMichal Simek 	psu_mask_write(0xFD409074, 0x00000010U, 0x00000010U);
5666d034093SMichal Simek 	psu_mask_write(0xFD40D074, 0x00000010U, 0x00000010U);
5676d034093SMichal Simek 	psu_mask_write(0xFD401994, 0x00000007U, 0x00000007U);
5686d034093SMichal Simek 	psu_mask_write(0xFD405994, 0x00000007U, 0x00000007U);
5696d034093SMichal Simek 	psu_mask_write(0xFD40989C, 0x00000080U, 0x00000080U);
5706d034093SMichal Simek 	psu_mask_write(0xFD4098F8, 0x000000FFU, 0x0000001AU);
5716d034093SMichal Simek 	psu_mask_write(0xFD4098FC, 0x000000FFU, 0x0000001AU);
5726d034093SMichal Simek 	psu_mask_write(0xFD409990, 0x000000FFU, 0x00000010U);
5736d034093SMichal Simek 	psu_mask_write(0xFD409924, 0x000000FFU, 0x000000FEU);
5746d034093SMichal Simek 	psu_mask_write(0xFD409928, 0x000000FFU, 0x00000000U);
5756d034093SMichal Simek 	psu_mask_write(0xFD409900, 0x000000FFU, 0x0000001AU);
5766d034093SMichal Simek 	psu_mask_write(0xFD40992C, 0x000000FFU, 0x00000000U);
5776d034093SMichal Simek 	psu_mask_write(0xFD409980, 0x000000FFU, 0x000000FFU);
5786d034093SMichal Simek 	psu_mask_write(0xFD409914, 0x000000FFU, 0x000000F7U);
5796d034093SMichal Simek 	psu_mask_write(0xFD409918, 0x00000001U, 0x00000001U);
5806d034093SMichal Simek 	psu_mask_write(0xFD409940, 0x000000FFU, 0x000000F7U);
5816d034093SMichal Simek 	psu_mask_write(0xFD409944, 0x00000001U, 0x00000001U);
5826d034093SMichal Simek 	psu_mask_write(0xFD409994, 0x00000007U, 0x00000007U);
5836d034093SMichal Simek 	psu_mask_write(0xFD40D89C, 0x00000080U, 0x00000080U);
5846d034093SMichal Simek 	psu_mask_write(0xFD40D8F8, 0x000000FFU, 0x0000001AU);
5856d034093SMichal Simek 	psu_mask_write(0xFD40D8FC, 0x000000FFU, 0x0000001AU);
5866d034093SMichal Simek 	psu_mask_write(0xFD40D990, 0x000000FFU, 0x00000010U);
5876d034093SMichal Simek 	psu_mask_write(0xFD40D924, 0x000000FFU, 0x000000FEU);
5886d034093SMichal Simek 	psu_mask_write(0xFD40D928, 0x000000FFU, 0x00000000U);
5896d034093SMichal Simek 	psu_mask_write(0xFD40D900, 0x000000FFU, 0x0000001AU);
5906d034093SMichal Simek 	psu_mask_write(0xFD40D92C, 0x000000FFU, 0x00000000U);
5916d034093SMichal Simek 	psu_mask_write(0xFD40D980, 0x000000FFU, 0x000000FFU);
5926d034093SMichal Simek 	psu_mask_write(0xFD40D914, 0x000000FFU, 0x000000F7U);
5936d034093SMichal Simek 	psu_mask_write(0xFD40D918, 0x00000001U, 0x00000001U);
5946d034093SMichal Simek 	psu_mask_write(0xFD40D940, 0x000000FFU, 0x000000F7U);
5956d034093SMichal Simek 	psu_mask_write(0xFD40D944, 0x00000001U, 0x00000001U);
5966d034093SMichal Simek 	psu_mask_write(0xFD40D994, 0x00000007U, 0x00000007U);
5976d034093SMichal Simek 	psu_mask_write(0xFD40107C, 0x0000000FU, 0x00000001U);
5986d034093SMichal Simek 	psu_mask_write(0xFD40507C, 0x0000000FU, 0x00000001U);
5996d034093SMichal Simek 	psu_mask_write(0xFD40907C, 0x0000000FU, 0x00000001U);
6006d034093SMichal Simek 	psu_mask_write(0xFD40D07C, 0x0000000FU, 0x00000001U);
6016d034093SMichal Simek 	psu_mask_write(0xFD4019A4, 0x000000FFU, 0x000000FFU);
6026d034093SMichal Simek 	psu_mask_write(0xFD401038, 0x00000040U, 0x00000040U);
6036d034093SMichal Simek 	psu_mask_write(0xFD40102C, 0x00000040U, 0x00000040U);
6046d034093SMichal Simek 	psu_mask_write(0xFD4059A4, 0x000000FFU, 0x000000FFU);
6056d034093SMichal Simek 	psu_mask_write(0xFD405038, 0x00000040U, 0x00000040U);
6066d034093SMichal Simek 	psu_mask_write(0xFD40502C, 0x00000040U, 0x00000040U);
6076d034093SMichal Simek 	psu_mask_write(0xFD4099A4, 0x000000FFU, 0x000000FFU);
6086d034093SMichal Simek 	psu_mask_write(0xFD409038, 0x00000040U, 0x00000040U);
6096d034093SMichal Simek 	psu_mask_write(0xFD40902C, 0x00000040U, 0x00000040U);
6106d034093SMichal Simek 	psu_mask_write(0xFD40D9A4, 0x000000FFU, 0x000000FFU);
6116d034093SMichal Simek 	psu_mask_write(0xFD40D038, 0x00000040U, 0x00000040U);
6126d034093SMichal Simek 	psu_mask_write(0xFD40D02C, 0x00000040U, 0x00000040U);
6136d034093SMichal Simek 	psu_mask_write(0xFD4019AC, 0x00000003U, 0x00000000U);
6146d034093SMichal Simek 	psu_mask_write(0xFD4059AC, 0x00000003U, 0x00000000U);
6156d034093SMichal Simek 	psu_mask_write(0xFD4099AC, 0x00000003U, 0x00000000U);
6166d034093SMichal Simek 	psu_mask_write(0xFD40D9AC, 0x00000003U, 0x00000000U);
6176d034093SMichal Simek 	psu_mask_write(0xFD401978, 0x00000010U, 0x00000010U);
6186d034093SMichal Simek 	psu_mask_write(0xFD405978, 0x00000010U, 0x00000010U);
6196d034093SMichal Simek 	psu_mask_write(0xFD409978, 0x00000010U, 0x00000010U);
6206d034093SMichal Simek 	psu_mask_write(0xFD40D978, 0x00000010U, 0x00000010U);
6216d034093SMichal Simek 	psu_mask_write(0xFD410010, 0x00000077U, 0x00000044U);
6226d034093SMichal Simek 	psu_mask_write(0xFD410014, 0x00000077U, 0x00000033U);
6236d034093SMichal Simek 	psu_mask_write(0xFD400CB4, 0x00000037U, 0x00000037U);
6246d034093SMichal Simek 	psu_mask_write(0xFD404CB4, 0x00000037U, 0x00000037U);
6256d034093SMichal Simek 	psu_mask_write(0xFD4001D8, 0x00000001U, 0x00000001U);
6266d034093SMichal Simek 	psu_mask_write(0xFD4041D8, 0x00000001U, 0x00000001U);
6276d034093SMichal Simek 	psu_mask_write(0xFD404CC0, 0x0000001FU, 0x00000000U);
6286d034093SMichal Simek 	psu_mask_write(0xFD400CC0, 0x0000001FU, 0x00000000U);
6296d034093SMichal Simek 	psu_mask_write(0xFD404048, 0x000000FFU, 0x00000000U);
6306d034093SMichal Simek 	psu_mask_write(0xFD400048, 0x000000FFU, 0x00000000U);
6316d034093SMichal Simek 
6326d034093SMichal Simek 	return 1;
6336d034093SMichal Simek }
6346d034093SMichal Simek 
6356d034093SMichal Simek static unsigned long psu_resetout_init_data(void)
6366d034093SMichal Simek {
6376d034093SMichal Simek 	psu_mask_write(0xFF5E023C, 0x00000400U, 0x00000000U);
6386d034093SMichal Simek 	psu_mask_write(0xFF9D0080, 0x00000001U, 0x00000001U);
6396d034093SMichal Simek 	psu_mask_write(0xFF9D007C, 0x00000001U, 0x00000000U);
6406d034093SMichal Simek 	psu_mask_write(0xFF5E023C, 0x00000140U, 0x00000000U);
6416d034093SMichal Simek 	psu_mask_write(0xFF5E023C, 0x00000800U, 0x00000000U);
6426d034093SMichal Simek 	psu_mask_write(0xFF9E0080, 0x00000001U, 0x00000001U);
6436d034093SMichal Simek 	psu_mask_write(0xFF9E007C, 0x00000001U, 0x00000000U);
6446d034093SMichal Simek 	psu_mask_write(0xFF5E023C, 0x00000280U, 0x00000000U);
6456d034093SMichal Simek 	psu_mask_write(0xFD1A0100, 0x00010000U, 0x00000000U);
6466d034093SMichal Simek 	psu_mask_write(0xFD4A0200, 0x00000002U, 0x00000000U);
6476d034093SMichal Simek 	psu_mask_write(0xFD4A0238, 0x0000000FU, 0x00000000U);
6486d034093SMichal Simek 	psu_mask_write(0xFE20C200, 0x00023FFFU, 0x00022457U);
6496d034093SMichal Simek 	psu_mask_write(0xFE20C630, 0x003FFF00U, 0x00000000U);
6506d034093SMichal Simek 	psu_mask_write(0xFE20C11C, 0x00000600U, 0x00000600U);
6516d034093SMichal Simek 	psu_mask_write(0xFE20C12C, 0x00004000U, 0x00004000U);
6526d034093SMichal Simek 	psu_mask_write(0xFE30C200, 0x00023FFFU, 0x00022457U);
6536d034093SMichal Simek 	psu_mask_write(0xFE30C630, 0x003FFF00U, 0x00000000U);
6546d034093SMichal Simek 	psu_mask_write(0xFE30C12C, 0x00004000U, 0x00004000U);
6556d034093SMichal Simek 	psu_mask_write(0xFE30C11C, 0x00000600U, 0x00000600U);
6566d034093SMichal Simek 	psu_mask_write(0xFD480064, 0x00000200U, 0x00000200U);
6576d034093SMichal Simek 	mask_poll(0xFD4063E4, 0x00000010U);
6586d034093SMichal Simek 	mask_poll(0xFD40A3E4, 0x00000010U);
6596d034093SMichal Simek 	mask_poll(0xFD40E3E4, 0x00000010U);
6606d034093SMichal Simek 
6616d034093SMichal Simek 	return 1;
6626d034093SMichal Simek }
6636d034093SMichal Simek 
6646d034093SMichal Simek static unsigned long psu_resetin_init_data(void)
6656d034093SMichal Simek {
6666d034093SMichal Simek 	psu_mask_write(0xFF5E023C, 0x00000540U, 0x00000540U);
6676d034093SMichal Simek 	psu_mask_write(0xFF5E023C, 0x00000A80U, 0x00000A80U);
6686d034093SMichal Simek 	psu_mask_write(0xFD4A0238, 0x0000000FU, 0x0000000AU);
6696d034093SMichal Simek 	psu_mask_write(0xFD4A0200, 0x00000002U, 0x00000002U);
6706d034093SMichal Simek 	psu_mask_write(0xFD1A0100, 0x00010000U, 0x00010000U);
6716d034093SMichal Simek 
6726d034093SMichal Simek 	return 1;
6736d034093SMichal Simek }
6746d034093SMichal Simek 
6756d034093SMichal Simek static unsigned long psu_afi_config(void)
6766d034093SMichal Simek {
6776d034093SMichal Simek 	psu_mask_write(0xFD1A0100, 0x00001F80U, 0x00000000U);
6786d034093SMichal Simek 	psu_mask_write(0xFF5E023C, 0x00080000U, 0x00000000U);
6796d034093SMichal Simek 	psu_mask_write(0xFF419000, 0x00000300U, 0x00000000U);
6806d034093SMichal Simek 
6816d034093SMichal Simek 	return 1;
6826d034093SMichal Simek }
6836d034093SMichal Simek 
6846d034093SMichal Simek static unsigned long psu_ddr_phybringup_data(void)
6856d034093SMichal Simek {
6866d034093SMichal Simek 	unsigned int regval = 0;
6876d034093SMichal Simek 	unsigned int pll_retry = 10;
6886d034093SMichal Simek 	unsigned int pll_locked = 0;
6896d034093SMichal Simek 
6906d034093SMichal Simek 	while ((pll_retry > 0) && (!pll_locked)) {
6916d034093SMichal Simek 		Xil_Out32(0xFD080004, 0x00040010);
6926d034093SMichal Simek 		Xil_Out32(0xFD080004, 0x00040011);
6936d034093SMichal Simek 
6946d034093SMichal Simek 		while ((Xil_In32(0xFD080030) & 0x1) != 1)
6956d034093SMichal Simek 			;
6966d034093SMichal Simek 
6976d034093SMichal Simek 		pll_locked = (Xil_In32(0xFD080030) & 0x80000000)
6986d034093SMichal Simek 		    >> 31;
6996d034093SMichal Simek 		pll_locked &= (Xil_In32(0xFD0807E0) & 0x10000)
7006d034093SMichal Simek 		    >> 16;
7016d034093SMichal Simek 		pll_locked &= (Xil_In32(0xFD0809E0) & 0x10000)
7026d034093SMichal Simek 		    >> 16;
7036d034093SMichal Simek 		pll_retry--;
7046d034093SMichal Simek 	}
7056d034093SMichal Simek 	Xil_Out32(0xFD0800C0, Xil_In32(0xFD0800C0) | (pll_retry << 16));
7066d034093SMichal Simek 	Xil_Out32(0xFD080004U, 0x00040063U);
7076d034093SMichal Simek 	Xil_Out32(0xFD090000U, 0x00000845U);
7086d034093SMichal Simek 	Xil_Out32(0xFD090004U, 0x003FFFFFU);
7096d034093SMichal Simek 	Xil_Out32(0xFD09000CU, 0x00000010U);
7106d034093SMichal Simek 	Xil_Out32(0xFD090010U, 0x00000010U);
7116d034093SMichal Simek 	Xil_Out32(0xFD090800U, 0x00000001U);
7126d034093SMichal Simek 
7136d034093SMichal Simek 	while ((Xil_In32(0xFD080030U) & 0x0000000FU) != 0x0000000FU)
7146d034093SMichal Simek 		;
7156d034093SMichal Simek 
7166d034093SMichal Simek 	prog_reg(0xFD080004U, 0x00000001U, 0x00000000U, 0x00000001U);
7176d034093SMichal Simek 
7186d034093SMichal Simek 	while ((Xil_In32(0xFD080030U) & 0x000000FFU) != 0x0000001FU)
7196d034093SMichal Simek 		;
7206d034093SMichal Simek 
7216d034093SMichal Simek 	Xil_Out32(0xFD070010U, 0x80000038U);
7226d034093SMichal Simek 	Xil_Out32(0xFD0701B0U, 0x00000005U);
7236d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7246d034093SMichal Simek 	while ((regval & 0x1) != 0x0)
7256d034093SMichal Simek 		regval = Xil_In32(0xFD070018);
7266d034093SMichal Simek 
7276d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7286d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7296d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7306d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7316d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7326d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7336d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7346d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7356d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7366d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7376d034093SMichal Simek 	Xil_Out32(0xFD070014U, 0x00000331U);
7386d034093SMichal Simek 	Xil_Out32(0xFD070010U, 0x80000038U);
7396d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7406d034093SMichal Simek 	while ((regval & 0x1) != 0x0)
7416d034093SMichal Simek 		regval = Xil_In32(0xFD070018);
7426d034093SMichal Simek 
7436d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7446d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7456d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7466d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7476d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7486d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7496d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7506d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7516d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7526d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7536d034093SMichal Simek 	Xil_Out32(0xFD070014U, 0x00000B36U);
7546d034093SMichal Simek 	Xil_Out32(0xFD070010U, 0x80000038U);
7556d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7566d034093SMichal Simek 	while ((regval & 0x1) != 0x0)
7576d034093SMichal Simek 		regval = Xil_In32(0xFD070018);
7586d034093SMichal Simek 
7596d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7606d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7616d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7626d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7636d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7646d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7656d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7666d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7676d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7686d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7696d034093SMichal Simek 	Xil_Out32(0xFD070014U, 0x00000C21U);
7706d034093SMichal Simek 	Xil_Out32(0xFD070010U, 0x80000038U);
7716d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7726d034093SMichal Simek 	while ((regval & 0x1) != 0x0)
7736d034093SMichal Simek 		regval = Xil_In32(0xFD070018);
7746d034093SMichal Simek 
7756d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7766d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7776d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7786d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7796d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7806d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7816d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7826d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7836d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7846d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7856d034093SMichal Simek 	Xil_Out32(0xFD070014U, 0x00000E19U);
7866d034093SMichal Simek 	Xil_Out32(0xFD070010U, 0x80000038U);
7876d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7886d034093SMichal Simek 	while ((regval & 0x1) != 0x0)
7896d034093SMichal Simek 		regval = Xil_In32(0xFD070018);
7906d034093SMichal Simek 
7916d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7926d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7936d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7946d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7956d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7966d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7976d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7986d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
7996d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
8006d034093SMichal Simek 	regval = Xil_In32(0xFD070018);
8016d034093SMichal Simek 	Xil_Out32(0xFD070014U, 0x00001616U);
8026d034093SMichal Simek 	Xil_Out32(0xFD070010U, 0x80000038U);
8036d034093SMichal Simek 	Xil_Out32(0xFD070010U, 0x80000030U);
8046d034093SMichal Simek 	Xil_Out32(0xFD0701B0U, 0x00000005U);
8056d034093SMichal Simek 	Xil_Out32(0xFD070320U, 0x00000001U);
8066d034093SMichal Simek 	while ((Xil_In32(0xFD070004U) & 0x0000000FU) != 0x00000001U)
8076d034093SMichal Simek 		;
8086d034093SMichal Simek 
8096d034093SMichal Simek 	prog_reg(0xFD080014U, 0x00000040U, 0x00000006U, 0x00000001U);
8106d034093SMichal Simek 	Xil_Out32(0xFD080004, 0x0014FE01);
8116d034093SMichal Simek 
8126d034093SMichal Simek 	regval = Xil_In32(0xFD080030);
8136d034093SMichal Simek 	while (regval != 0x8000007E)
8146d034093SMichal Simek 		regval = Xil_In32(0xFD080030);
8156d034093SMichal Simek 
8166d034093SMichal Simek 	Xil_Out32(0xFD080200U, 0x010091C7U);
8176d034093SMichal Simek 	regval = Xil_In32(0xFD080030);
8186d034093SMichal Simek 	while (regval != 0x80008FFF)
8196d034093SMichal Simek 		regval = Xil_In32(0xFD080030);
8206d034093SMichal Simek 
8216d034093SMichal Simek 	Xil_Out32(0xFD080200U, 0x810091C7U);
8226d034093SMichal Simek 	Xil_Out32(0xFD070180U, 0x010B0008U);
8236d034093SMichal Simek 	Xil_Out32(0xFD070060U, 0x00000000U);
8246d034093SMichal Simek 	prog_reg(0xFD070020U, 0x00000001U, 0x00000000U, 0x00000001U);
8256d034093SMichal Simek 	prog_reg(0xFD080014U, 0x00000040U, 0x00000006U, 0x00000000U);
8266d034093SMichal Simek 
8276d034093SMichal Simek 	return 1;
8286d034093SMichal Simek }
8296d034093SMichal Simek 
8306d034093SMichal Simek static int serdes_enb_coarse_saturation(void)
8316d034093SMichal Simek {
8326d034093SMichal Simek 	Xil_Out32(0xFD402094, 0x00000010);
8336d034093SMichal Simek 	Xil_Out32(0xFD406094, 0x00000010);
8346d034093SMichal Simek 	Xil_Out32(0xFD40A094, 0x00000010);
8356d034093SMichal Simek 	Xil_Out32(0xFD40E094, 0x00000010);
8366d034093SMichal Simek 	return 1;
8376d034093SMichal Simek }
8386d034093SMichal Simek 
8396d034093SMichal Simek static int serdes_fixcal_code(void)
8406d034093SMichal Simek {
8416d034093SMichal Simek 	int maskstatus = 1;
8426d034093SMichal Simek 	unsigned int match_pmos_code[23];
8436d034093SMichal Simek 	unsigned int match_nmos_code[23];
8446d034093SMichal Simek 	unsigned int match_ical_code[7];
8456d034093SMichal Simek 	unsigned int match_rcal_code[7];
8466d034093SMichal Simek 	unsigned int p_code = 0;
8476d034093SMichal Simek 	unsigned int n_code = 0;
8486d034093SMichal Simek 	unsigned int i_code = 0;
8496d034093SMichal Simek 	unsigned int r_code = 0;
8506d034093SMichal Simek 	unsigned int repeat_count = 0;
8516d034093SMichal Simek 	unsigned int L3_TM_CALIB_DIG20 = 0;
8526d034093SMichal Simek 	unsigned int L3_TM_CALIB_DIG19 = 0;
8536d034093SMichal Simek 	unsigned int L3_TM_CALIB_DIG18 = 0;
8546d034093SMichal Simek 	unsigned int L3_TM_CALIB_DIG16 = 0;
8556d034093SMichal Simek 	unsigned int L3_TM_CALIB_DIG15 = 0;
8566d034093SMichal Simek 	unsigned int L3_TM_CALIB_DIG14 = 0;
8576d034093SMichal Simek 	int i = 0;
8586d034093SMichal Simek 
8596d034093SMichal Simek 	for (i = 0; i < 23; i++) {
8606d034093SMichal Simek 		match_pmos_code[i] = 0;
8616d034093SMichal Simek 		match_nmos_code[i] = 0;
8626d034093SMichal Simek 	}
8636d034093SMichal Simek 	for (i = 0; i < 7; i++) {
8646d034093SMichal Simek 		match_ical_code[i] = 0;
8656d034093SMichal Simek 		match_rcal_code[i] = 0;
8666d034093SMichal Simek 	}
8676d034093SMichal Simek 
8686d034093SMichal Simek 	do {
8696d034093SMichal Simek 		Xil_Out32(0xFD410010, 0x00000000);
8706d034093SMichal Simek 		Xil_Out32(0xFD410014, 0x00000000);
8716d034093SMichal Simek 
8726d034093SMichal Simek 		Xil_Out32(0xFD410010, 0x00000001);
8736d034093SMichal Simek 		Xil_Out32(0xFD410014, 0x00000000);
8746d034093SMichal Simek 
8756d034093SMichal Simek 		maskstatus = mask_poll(0xFD40EF14, 0x2);
8766d034093SMichal Simek 		if (maskstatus == 0) {
8776d034093SMichal Simek 			/* xil_printf("#SERDES initialization timed out\n\r");*/
8786d034093SMichal Simek 			return maskstatus;
8796d034093SMichal Simek 		}
8806d034093SMichal Simek 
8816d034093SMichal Simek 		p_code = mask_read(0xFD40EF18, 0xFFFFFFFF);
8826d034093SMichal Simek 		n_code = mask_read(0xFD40EF1C, 0xFFFFFFFF);
8836d034093SMichal Simek 		;
8846d034093SMichal Simek 		i_code = mask_read(0xFD40EF24, 0xFFFFFFFF);
8856d034093SMichal Simek 		r_code = mask_read(0xFD40EF28, 0xFFFFFFFF);
8866d034093SMichal Simek 		;
8876d034093SMichal Simek 
8886d034093SMichal Simek 		if ((p_code >= 0x26) && (p_code <= 0x3C))
8896d034093SMichal Simek 			match_pmos_code[p_code - 0x26] += 1;
8906d034093SMichal Simek 
8916d034093SMichal Simek 		if ((n_code >= 0x26) && (n_code <= 0x3C))
8926d034093SMichal Simek 			match_nmos_code[n_code - 0x26] += 1;
8936d034093SMichal Simek 
8946d034093SMichal Simek 		if ((i_code >= 0xC) && (i_code <= 0x12))
8956d034093SMichal Simek 			match_ical_code[i_code - 0xC] += 1;
8966d034093SMichal Simek 
8976d034093SMichal Simek 		if ((r_code >= 0x6) && (r_code <= 0xC))
8986d034093SMichal Simek 			match_rcal_code[r_code - 0x6] += 1;
8996d034093SMichal Simek 
9006d034093SMichal Simek 	} while (repeat_count++ < 10);
9016d034093SMichal Simek 
9026d034093SMichal Simek 	for (i = 0; i < 23; i++) {
9036d034093SMichal Simek 		if (match_pmos_code[i] >= match_pmos_code[0]) {
9046d034093SMichal Simek 			match_pmos_code[0] = match_pmos_code[i];
9056d034093SMichal Simek 			p_code = 0x26 + i;
9066d034093SMichal Simek 		}
9076d034093SMichal Simek 		if (match_nmos_code[i] >= match_nmos_code[0]) {
9086d034093SMichal Simek 			match_nmos_code[0] = match_nmos_code[i];
9096d034093SMichal Simek 			n_code = 0x26 + i;
9106d034093SMichal Simek 		}
9116d034093SMichal Simek 	}
9126d034093SMichal Simek 
9136d034093SMichal Simek 	for (i = 0; i < 7; i++) {
9146d034093SMichal Simek 		if (match_ical_code[i] >= match_ical_code[0]) {
9156d034093SMichal Simek 			match_ical_code[0] = match_ical_code[i];
9166d034093SMichal Simek 			i_code = 0xC + i;
9176d034093SMichal Simek 		}
9186d034093SMichal Simek 		if (match_rcal_code[i] >= match_rcal_code[0]) {
9196d034093SMichal Simek 			match_rcal_code[0] = match_rcal_code[i];
9206d034093SMichal Simek 			r_code = 0x6 + i;
9216d034093SMichal Simek 		}
9226d034093SMichal Simek 	}
9236d034093SMichal Simek 
9246d034093SMichal Simek 	L3_TM_CALIB_DIG20 = mask_read(0xFD40EC50, 0xFFFFFFF0);
9256d034093SMichal Simek 	L3_TM_CALIB_DIG20 = L3_TM_CALIB_DIG20 | 0x8 | ((p_code >> 2) & 0x7);
9266d034093SMichal Simek 
9276d034093SMichal Simek 	L3_TM_CALIB_DIG19 = mask_read(0xFD40EC4C, 0xFFFFFF18);
9286d034093SMichal Simek 	L3_TM_CALIB_DIG19 = L3_TM_CALIB_DIG19 | ((p_code & 0x3) << 6)
9296d034093SMichal Simek 			    | 0x20 | 0x4 | ((n_code >> 3) & 0x3);
9306d034093SMichal Simek 
9316d034093SMichal Simek 	L3_TM_CALIB_DIG18 = mask_read(0xFD40EC48, 0xFFFFFF0F);
9326d034093SMichal Simek 	L3_TM_CALIB_DIG18 = L3_TM_CALIB_DIG18 | ((n_code & 0x7) << 5) | 0x10;
9336d034093SMichal Simek 
9346d034093SMichal Simek 	L3_TM_CALIB_DIG16 = mask_read(0xFD40EC40, 0xFFFFFFF8);
9356d034093SMichal Simek 	L3_TM_CALIB_DIG16 = L3_TM_CALIB_DIG16 | ((r_code >> 1) & 0x7);
9366d034093SMichal Simek 
9376d034093SMichal Simek 	L3_TM_CALIB_DIG15 = mask_read(0xFD40EC3C, 0xFFFFFF30);
9386d034093SMichal Simek 	L3_TM_CALIB_DIG15 = L3_TM_CALIB_DIG15 | ((r_code & 0x1) << 7)
9396d034093SMichal Simek 			    | 0x40 | 0x8 | ((i_code >> 1) & 0x7);
9406d034093SMichal Simek 
9416d034093SMichal Simek 	L3_TM_CALIB_DIG14 = mask_read(0xFD40EC38, 0xFFFFFF3F);
9426d034093SMichal Simek 	L3_TM_CALIB_DIG14 = L3_TM_CALIB_DIG14 | ((i_code & 0x1) << 7) | 0x40;
9436d034093SMichal Simek 
9446d034093SMichal Simek 	Xil_Out32(0xFD40EC50, L3_TM_CALIB_DIG20);
9456d034093SMichal Simek 	Xil_Out32(0xFD40EC4C, L3_TM_CALIB_DIG19);
9466d034093SMichal Simek 	Xil_Out32(0xFD40EC48, L3_TM_CALIB_DIG18);
9476d034093SMichal Simek 	Xil_Out32(0xFD40EC40, L3_TM_CALIB_DIG16);
9486d034093SMichal Simek 	Xil_Out32(0xFD40EC3C, L3_TM_CALIB_DIG15);
9496d034093SMichal Simek 	Xil_Out32(0xFD40EC38, L3_TM_CALIB_DIG14);
9506d034093SMichal Simek 	return maskstatus;
9516d034093SMichal Simek }
9526d034093SMichal Simek 
9536d034093SMichal Simek static int init_serdes(void)
9546d034093SMichal Simek {
9556d034093SMichal Simek 	int status = 1;
9566d034093SMichal Simek 
9576d034093SMichal Simek 	status &= psu_resetin_init_data();
9586d034093SMichal Simek 
9596d034093SMichal Simek 	status &= serdes_fixcal_code();
9606d034093SMichal Simek 	status &= serdes_enb_coarse_saturation();
9616d034093SMichal Simek 
9626d034093SMichal Simek 	status &= psu_serdes_init_data();
9636d034093SMichal Simek 	status &= psu_resetout_init_data();
9646d034093SMichal Simek 
9656d034093SMichal Simek 	return status;
9666d034093SMichal Simek }
9676d034093SMichal Simek 
9686d034093SMichal Simek static void init_peripheral(void)
9696d034093SMichal Simek {
9706d034093SMichal Simek 	psu_mask_write(0xFD5F0018, 0x0000001FU, 0x0000001FU);
9716d034093SMichal Simek }
9726d034093SMichal Simek 
9736d034093SMichal Simek int psu_init(void)
9746d034093SMichal Simek {
9756d034093SMichal Simek 	int status = 1;
9766d034093SMichal Simek 
9776d034093SMichal Simek 	status &= psu_mio_init_data();
9786d034093SMichal Simek 	status &= psu_pll_init_data();
9796d034093SMichal Simek 	status &= psu_clock_init_data();
9806d034093SMichal Simek 	status &= psu_ddr_init_data();
9816d034093SMichal Simek 	status &= psu_ddr_phybringup_data();
9826d034093SMichal Simek 	status &= psu_peripherals_init_data();
9836d034093SMichal Simek 	status &= init_serdes();
9846d034093SMichal Simek 	init_peripheral();
9856d034093SMichal Simek 
9866d034093SMichal Simek 	status &= psu_afi_config();
9876d034093SMichal Simek 	psu_ddr_qos_init_data();
9886d034093SMichal Simek 
9896d034093SMichal Simek 	if (status == 0)
9906d034093SMichal Simek 		return 1;
9916d034093SMichal Simek 	return 0;
9926d034093SMichal Simek }
993