xref: /rk3399_ARM-atf/include/drivers/st/stm32mp_ddrctrl_regs.h (revision 79629b1a79bd1ee254077d4e76fea05ba73b9bab)
106e55dc8SNicolas Le Bayon /*
2d596023bSNicolas Le Bayon  * Copyright (c) 2022-2024, STMicroelectronics - All Rights Reserved
306e55dc8SNicolas Le Bayon  *
406e55dc8SNicolas Le Bayon  * SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
506e55dc8SNicolas Le Bayon  */
606e55dc8SNicolas Le Bayon 
706e55dc8SNicolas Le Bayon #ifndef STM32MP_DDRCTRL_REGS_H
806e55dc8SNicolas Le Bayon #define STM32MP_DDRCTRL_REGS_H
906e55dc8SNicolas Le Bayon 
1006e55dc8SNicolas Le Bayon #include <cdefs.h>
1106e55dc8SNicolas Le Bayon #include <stdint.h>
1206e55dc8SNicolas Le Bayon 
1306e55dc8SNicolas Le Bayon #include <lib/utils_def.h>
1406e55dc8SNicolas Le Bayon 
1506e55dc8SNicolas Le Bayon /* DDR Controller (DDRCTRL) registers */
1606e55dc8SNicolas Le Bayon struct stm32mp_ddrctl {
1706e55dc8SNicolas Le Bayon 	uint32_t mstr ;		/* 0x0 Master */
1806e55dc8SNicolas Le Bayon 	uint32_t stat;		/* 0x4 Operating Mode Status */
1906e55dc8SNicolas Le Bayon 	uint8_t reserved008[0x10 - 0x8];
2006e55dc8SNicolas Le Bayon 	uint32_t mrctrl0;	/* 0x10 Control 0 */
2106e55dc8SNicolas Le Bayon 	uint32_t mrctrl1;	/* 0x14 Control 1 */
2206e55dc8SNicolas Le Bayon 	uint32_t mrstat;	/* 0x18 Status */
2306e55dc8SNicolas Le Bayon 	uint32_t mrctrl2;	/* 0x1c Control 2 */
2406e55dc8SNicolas Le Bayon 	uint32_t derateen;	/* 0x20 Temperature Derate Enable */
2506e55dc8SNicolas Le Bayon 	uint32_t derateint;	/* 0x24 Temperature Derate Interval */
2606e55dc8SNicolas Le Bayon 	uint32_t reserved028;
2706e55dc8SNicolas Le Bayon 	uint32_t deratectl;	/* 0x2c Temperature Derate Control */
2806e55dc8SNicolas Le Bayon 	uint32_t pwrctl;	/* 0x30 Low Power Control */
2906e55dc8SNicolas Le Bayon 	uint32_t pwrtmg;	/* 0x34 Low Power Timing */
3006e55dc8SNicolas Le Bayon 	uint32_t hwlpctl;	/* 0x38 Hardware Low Power Control */
3106e55dc8SNicolas Le Bayon 	uint8_t reserved03c[0x50 - 0x3c];
3206e55dc8SNicolas Le Bayon 	uint32_t rfshctl0;	/* 0x50 Refresh Control 0 */
3306e55dc8SNicolas Le Bayon 	uint32_t rfshctl1;	/* 0x54 Refresh Control 1 */
3406e55dc8SNicolas Le Bayon 	uint32_t reserved058;	/* 0x58 Refresh Control 2 */
3506e55dc8SNicolas Le Bayon 	uint32_t reserved05C;
3606e55dc8SNicolas Le Bayon 	uint32_t rfshctl3;	/* 0x60 Refresh Control 0 */
3706e55dc8SNicolas Le Bayon 	uint32_t rfshtmg;	/* 0x64 Refresh Timing */
3806e55dc8SNicolas Le Bayon 	uint32_t rfshtmg1;	/* 0x68 Refresh Timing 1 */
3906e55dc8SNicolas Le Bayon 	uint8_t reserved06c[0xc0 - 0x6c];
4006e55dc8SNicolas Le Bayon 	uint32_t crcparctl0;	/* 0xc0 CRC Parity Control0 */
4106e55dc8SNicolas Le Bayon 	uint32_t crcparctl1;	/* 0xc4 CRC Parity Control1 */
4206e55dc8SNicolas Le Bayon 	uint32_t reserved0c8;	/* 0xc8 CRC Parity Control2 */
4306e55dc8SNicolas Le Bayon 	uint32_t crcparstat;	/* 0xcc CRC Parity Status */
4406e55dc8SNicolas Le Bayon 	uint32_t init0;		/* 0xd0 SDRAM Initialization 0 */
4506e55dc8SNicolas Le Bayon 	uint32_t init1;		/* 0xd4 SDRAM Initialization 1 */
4606e55dc8SNicolas Le Bayon 	uint32_t init2;		/* 0xd8 SDRAM Initialization 2 */
4706e55dc8SNicolas Le Bayon 	uint32_t init3;		/* 0xdc SDRAM Initialization 3 */
4806e55dc8SNicolas Le Bayon 	uint32_t init4;		/* 0xe0 SDRAM Initialization 4 */
4906e55dc8SNicolas Le Bayon 	uint32_t init5;		/* 0xe4 SDRAM Initialization 5 */
5006e55dc8SNicolas Le Bayon 	uint32_t init6;		/* 0xe8 SDRAM Initialization 6 */
5106e55dc8SNicolas Le Bayon 	uint32_t init7;		/* 0xec SDRAM Initialization 7 */
5206e55dc8SNicolas Le Bayon 	uint32_t dimmctl;	/* 0xf0 DIMM Control */
5306e55dc8SNicolas Le Bayon 	uint32_t rankctl;	/* 0xf4 Rank Control */
54*79629b1aSNicolas Le Bayon 	uint32_t rankctl1;	/* 0xf8 Rank Control 1 */
55*79629b1aSNicolas Le Bayon 	uint8_t reserved0fc[0x100 - 0xfc];
5606e55dc8SNicolas Le Bayon 	uint32_t dramtmg0;	/* 0x100 SDRAM Timing 0 */
5706e55dc8SNicolas Le Bayon 	uint32_t dramtmg1;	/* 0x104 SDRAM Timing 1 */
5806e55dc8SNicolas Le Bayon 	uint32_t dramtmg2;	/* 0x108 SDRAM Timing 2 */
5906e55dc8SNicolas Le Bayon 	uint32_t dramtmg3;	/* 0x10c SDRAM Timing 3 */
6006e55dc8SNicolas Le Bayon 	uint32_t dramtmg4;	/* 0x110 SDRAM Timing 4 */
6106e55dc8SNicolas Le Bayon 	uint32_t dramtmg5;	/* 0x114 SDRAM Timing 5 */
6206e55dc8SNicolas Le Bayon 	uint32_t dramtmg6;	/* 0x118 SDRAM Timing 6 */
6306e55dc8SNicolas Le Bayon 	uint32_t dramtmg7;	/* 0x11c SDRAM Timing 7 */
6406e55dc8SNicolas Le Bayon 	uint32_t dramtmg8;	/* 0x120 SDRAM Timing 8 */
6506e55dc8SNicolas Le Bayon 	uint32_t dramtmg9;	/* 0x124 SDRAM Timing 9 */
6606e55dc8SNicolas Le Bayon 	uint32_t dramtmg10;	/* 0x128 SDRAM Timing 10 */
6706e55dc8SNicolas Le Bayon 	uint32_t dramtmg11;	/* 0x12c SDRAM Timing 11 */
6806e55dc8SNicolas Le Bayon 	uint32_t dramtmg12;	/* 0x130 SDRAM Timing 12 */
6906e55dc8SNicolas Le Bayon 	uint32_t dramtmg13;	/* 0x134 SDRAM Timing 13 */
7006e55dc8SNicolas Le Bayon 	uint32_t dramtmg14;	/* 0x138 SDRAM Timing 14 */
7106e55dc8SNicolas Le Bayon 	uint32_t dramtmg15;	/* 0x13c SDRAM Timing 15 */
7206e55dc8SNicolas Le Bayon 	uint8_t reserved140[0x180 - 0x140];
7306e55dc8SNicolas Le Bayon 	uint32_t zqctl0;	/* 0x180 ZQ Control 0 */
7406e55dc8SNicolas Le Bayon 	uint32_t zqctl1;	/* 0x184 ZQ Control 1 */
7506e55dc8SNicolas Le Bayon 	uint32_t zqctl2;	/* 0x188 ZQ Control 2 */
7606e55dc8SNicolas Le Bayon 	uint32_t zqstat;	/* 0x18c ZQ Status */
7706e55dc8SNicolas Le Bayon 	uint32_t dfitmg0;	/* 0x190 DFI Timing 0 */
7806e55dc8SNicolas Le Bayon 	uint32_t dfitmg1;	/* 0x194 DFI Timing 1 */
7906e55dc8SNicolas Le Bayon 	uint32_t dfilpcfg0;	/* 0x198 DFI Low Power Configuration 0 */
8006e55dc8SNicolas Le Bayon 	uint32_t dfilpcfg1;	/* 0x19c DFI Low Power Configuration 1 */
8106e55dc8SNicolas Le Bayon 	uint32_t dfiupd0;	/* 0x1a0 DFI Update 0 */
8206e55dc8SNicolas Le Bayon 	uint32_t dfiupd1;	/* 0x1a4 DFI Update 1 */
8306e55dc8SNicolas Le Bayon 	uint32_t dfiupd2;	/* 0x1a8 DFI Update 2 */
8406e55dc8SNicolas Le Bayon 	uint32_t reserved1ac;
8506e55dc8SNicolas Le Bayon 	uint32_t dfimisc;	/* 0x1b0 DFI Miscellaneous Control */
8606e55dc8SNicolas Le Bayon 	uint32_t dfitmg2;	/* 0x1b4 DFI Timing 2 */
8706e55dc8SNicolas Le Bayon 	uint32_t dfitmg3;	/* 0x1b8 DFI Timing 3 */
8806e55dc8SNicolas Le Bayon 	uint32_t dfistat;	/* 0x1bc DFI Status */
8906e55dc8SNicolas Le Bayon 	uint32_t dbictl;	/* 0x1c0 DM/DBI Control */
9006e55dc8SNicolas Le Bayon 	uint32_t dfiphymstr;	/* 0x1c4 DFI PHY Master interface */
9106e55dc8SNicolas Le Bayon 	uint8_t reserved1c8[0x200 - 0x1c8];
9206e55dc8SNicolas Le Bayon 	uint32_t addrmap0;	/* 0x200 Address Map 0 */
9306e55dc8SNicolas Le Bayon 	uint32_t addrmap1;	/* 0x204 Address Map 1 */
9406e55dc8SNicolas Le Bayon 	uint32_t addrmap2;	/* 0x208 Address Map 2 */
9506e55dc8SNicolas Le Bayon 	uint32_t addrmap3;	/* 0x20c Address Map 3 */
9606e55dc8SNicolas Le Bayon 	uint32_t addrmap4;	/* 0x210 Address Map 4 */
9706e55dc8SNicolas Le Bayon 	uint32_t addrmap5;	/* 0x214 Address Map 5 */
9806e55dc8SNicolas Le Bayon 	uint32_t addrmap6;	/* 0x218 Address Map 6 */
9906e55dc8SNicolas Le Bayon 	uint32_t addrmap7;	/* 0x21c Address Map 7 */
10006e55dc8SNicolas Le Bayon 	uint32_t addrmap8;	/* 0x220 Address Map 8 */
10106e55dc8SNicolas Le Bayon 	uint32_t addrmap9;	/* 0x224 Address Map 9 */
10206e55dc8SNicolas Le Bayon 	uint32_t addrmap10;	/* 0x228 Address Map 10 */
10306e55dc8SNicolas Le Bayon 	uint32_t addrmap11;	/* 0x22C Address Map 11 */
10406e55dc8SNicolas Le Bayon 	uint8_t reserved230[0x240 - 0x230];
10506e55dc8SNicolas Le Bayon 	uint32_t odtcfg;	/* 0x240 ODT Configuration */
10606e55dc8SNicolas Le Bayon 	uint32_t odtmap;	/* 0x244 ODT/Rank Map */
10706e55dc8SNicolas Le Bayon 	uint8_t reserved248[0x250 - 0x248];
10806e55dc8SNicolas Le Bayon 	uint32_t sched;		/* 0x250 Scheduler Control */
10906e55dc8SNicolas Le Bayon 	uint32_t sched1;	/* 0x254 Scheduler Control 1 */
11006e55dc8SNicolas Le Bayon 	uint32_t reserved258;
11106e55dc8SNicolas Le Bayon 	uint32_t perfhpr1;	/* 0x25c High Priority Read CAM 1 */
11206e55dc8SNicolas Le Bayon 	uint32_t reserved260;
11306e55dc8SNicolas Le Bayon 	uint32_t perflpr1;	/* 0x264 Low Priority Read CAM 1 */
11406e55dc8SNicolas Le Bayon 	uint32_t reserved268;
11506e55dc8SNicolas Le Bayon 	uint32_t perfwr1;	/* 0x26c Write CAM 1 */
116*79629b1aSNicolas Le Bayon 	uint32_t sched3;	/* 0x270 Scheduler Control 3 */
117*79629b1aSNicolas Le Bayon 	uint32_t sched4;	/* 0x274 Scheduler Control 4 */
118*79629b1aSNicolas Le Bayon 	uint8_t reserved278[0x300 - 0x278];
11906e55dc8SNicolas Le Bayon 	uint32_t dbg0;		/* 0x300 Debug 0 */
12006e55dc8SNicolas Le Bayon 	uint32_t dbg1;		/* 0x304 Debug 1 */
12106e55dc8SNicolas Le Bayon 	uint32_t dbgcam;	/* 0x308 CAM Debug */
12206e55dc8SNicolas Le Bayon 	uint32_t dbgcmd;	/* 0x30c Command Debug */
12306e55dc8SNicolas Le Bayon 	uint32_t dbgstat;	/* 0x310 Status Debug */
12406e55dc8SNicolas Le Bayon 	uint8_t reserved314[0x320 - 0x314];
12506e55dc8SNicolas Le Bayon 	uint32_t swctl;		/* 0x320 Software Programming Control Enable */
12606e55dc8SNicolas Le Bayon 	uint32_t swstat;	/* 0x324 Software Programming Control Status */
127*79629b1aSNicolas Le Bayon 	uint32_t swctlstatic;	/* 0x328 Statics Write Enable */
128*79629b1aSNicolas Le Bayon 	uint8_t reserved32c[0x36c - 0x32c];
12906e55dc8SNicolas Le Bayon 	uint32_t poisoncfg;	/* 0x36c AXI Poison Configuration Register */
13006e55dc8SNicolas Le Bayon 	uint32_t poisonstat;	/* 0x370 AXI Poison Status Register */
13106e55dc8SNicolas Le Bayon 	uint8_t reserved374[0x3f0 - 0x374];
13206e55dc8SNicolas Le Bayon 	uint32_t deratestat;	/* 0x3f0 Temperature Derate Status */
13306e55dc8SNicolas Le Bayon 	uint8_t reserved3f4[0x3fc - 0x3f4];
13406e55dc8SNicolas Le Bayon 
13506e55dc8SNicolas Le Bayon 	/* Multi Port registers */
13606e55dc8SNicolas Le Bayon 	uint32_t pstat;		/* 0x3fc Port Status */
13706e55dc8SNicolas Le Bayon 	uint32_t pccfg;		/* 0x400 Port Common Configuration */
13806e55dc8SNicolas Le Bayon 
13906e55dc8SNicolas Le Bayon 	/* PORT 0 */
14006e55dc8SNicolas Le Bayon 	uint32_t pcfgr_0;	/* 0x404 Configuration Read */
14106e55dc8SNicolas Le Bayon 	uint32_t pcfgw_0;	/* 0x408 Configuration Write */
14206e55dc8SNicolas Le Bayon 	uint8_t reserved40c[0x490 - 0x40c];
14306e55dc8SNicolas Le Bayon 	uint32_t pctrl_0;	/* 0x490 Port Control Register */
14406e55dc8SNicolas Le Bayon 	uint32_t pcfgqos0_0;	/* 0x494 Read QoS Configuration 0 */
14506e55dc8SNicolas Le Bayon 	uint32_t pcfgqos1_0;	/* 0x498 Read QoS Configuration 1 */
14606e55dc8SNicolas Le Bayon 	uint32_t pcfgwqos0_0;	/* 0x49c Write QoS Configuration 0 */
14706e55dc8SNicolas Le Bayon 	uint32_t pcfgwqos1_0;	/* 0x4a0 Write QoS Configuration 1 */
14806e55dc8SNicolas Le Bayon 	uint8_t reserved4a4[0x4b4 - 0x4a4];
14906e55dc8SNicolas Le Bayon 
15006e55dc8SNicolas Le Bayon #if STM32MP_DDR_DUAL_AXI_PORT
15106e55dc8SNicolas Le Bayon 	/* PORT 1 */
15206e55dc8SNicolas Le Bayon 	uint32_t pcfgr_1;	/* 0x4b4 Configuration Read */
15306e55dc8SNicolas Le Bayon 	uint32_t pcfgw_1;	/* 0x4b8 Configuration Write */
15406e55dc8SNicolas Le Bayon 	uint8_t reserved4bc[0x540 - 0x4bc];
15506e55dc8SNicolas Le Bayon 	uint32_t pctrl_1;	/* 0x540 Port 2 Control Register */
15606e55dc8SNicolas Le Bayon 	uint32_t pcfgqos0_1;	/* 0x544 Read QoS Configuration 0 */
15706e55dc8SNicolas Le Bayon 	uint32_t pcfgqos1_1;	/* 0x548 Read QoS Configuration 1 */
15806e55dc8SNicolas Le Bayon 	uint32_t pcfgwqos0_1;	/* 0x54c Write QoS Configuration 0 */
15906e55dc8SNicolas Le Bayon 	uint32_t pcfgwqos1_1;	/* 0x550 Write QoS Configuration 1 */
160*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR_DUAL_AXI_PORT */
16106e55dc8SNicolas Le Bayon 
16206e55dc8SNicolas Le Bayon 	uint8_t reserved554[0xff0 - 0x554];
16306e55dc8SNicolas Le Bayon 	uint32_t umctl2_ver_number;	/* 0xff0 UMCTL2 Version Number */
16406e55dc8SNicolas Le Bayon } __packed;
16506e55dc8SNicolas Le Bayon 
16606e55dc8SNicolas Le Bayon /* DDR Controller registers offsets */
16706e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR				0x000
16806e55dc8SNicolas Le Bayon #define DDRCTRL_STAT				0x004
16906e55dc8SNicolas Le Bayon #define DDRCTRL_MRCTRL0				0x010
17006e55dc8SNicolas Le Bayon #define DDRCTRL_MRSTAT				0x018
17106e55dc8SNicolas Le Bayon #define DDRCTRL_PWRCTL				0x030
17206e55dc8SNicolas Le Bayon #define DDRCTRL_PWRTMG				0x034
17306e55dc8SNicolas Le Bayon #define DDRCTRL_HWLPCTL				0x038
17406e55dc8SNicolas Le Bayon #define DDRCTRL_RFSHCTL3			0x060
17506e55dc8SNicolas Le Bayon #define DDRCTRL_RFSHTMG				0x064
17606e55dc8SNicolas Le Bayon #define DDRCTRL_INIT0				0x0D0
177*79629b1aSNicolas Le Bayon #define DDRCTRL_DFILPCFG0			0x198
17806e55dc8SNicolas Le Bayon #define DDRCTRL_DFIMISC				0x1B0
17906e55dc8SNicolas Le Bayon #define DDRCTRL_DBG1				0x304
18006e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCAM				0x308
18106e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCMD				0x30C
18206e55dc8SNicolas Le Bayon #define DDRCTRL_DBGSTAT				0x310
18306e55dc8SNicolas Le Bayon #define DDRCTRL_SWCTL				0x320
18406e55dc8SNicolas Le Bayon #define DDRCTRL_SWSTAT				0x324
18506e55dc8SNicolas Le Bayon #define DDRCTRL_PSTAT				0x3FC
18606e55dc8SNicolas Le Bayon #define DDRCTRL_PCTRL_0				0x490
18706e55dc8SNicolas Le Bayon #if STM32MP_DDR_DUAL_AXI_PORT
18806e55dc8SNicolas Le Bayon #define DDRCTRL_PCTRL_1				0x540
189*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR_DUAL_AXI_PORT */
19006e55dc8SNicolas Le Bayon 
19106e55dc8SNicolas Le Bayon /* DDR Controller Register fields */
19206e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_DDR3			BIT(0)
19306e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_LPDDR2			BIT(2)
19406e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_LPDDR3			BIT(3)
19506e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_DDR4			BIT(4)
19606e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_LPDDR4			BIT(5)
19706e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_DATA_BUS_WIDTH_MASK	GENMASK(13, 12)
19806e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_DATA_BUS_WIDTH_FULL	0
19906e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_DATA_BUS_WIDTH_HALF	BIT(12)
20006e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_DATA_BUS_WIDTH_QUARTER	BIT(13)
20106e55dc8SNicolas Le Bayon #define DDRCTRL_MSTR_DLL_OFF_MODE		BIT(15)
20206e55dc8SNicolas Le Bayon 
20306e55dc8SNicolas Le Bayon #define DDRCTRL_STAT_OPERATING_MODE_MASK	GENMASK(2, 0)
20406e55dc8SNicolas Le Bayon #define DDRCTRL_STAT_OPERATING_MODE_NORMAL	BIT(0)
20506e55dc8SNicolas Le Bayon #define DDRCTRL_STAT_OPERATING_MODE_SR		(BIT(0) | BIT(1))
20606e55dc8SNicolas Le Bayon #define DDRCTRL_STAT_SELFREF_TYPE_MASK		GENMASK(5, 4)
20706e55dc8SNicolas Le Bayon #define DDRCTRL_STAT_SELFREF_TYPE_ASR		(BIT(4) | BIT(5))
20806e55dc8SNicolas Le Bayon #define DDRCTRL_STAT_SELFREF_TYPE_SR		BIT(5)
209*79629b1aSNicolas Le Bayon #define DDRCTRL_STAT_SELFREF_STATE_MASK		GENMASK(9, 8)
210*79629b1aSNicolas Le Bayon #define DDRCTRL_STAT_SELFREF_STATE_SRPD		BIT(9)
21106e55dc8SNicolas Le Bayon 
21206e55dc8SNicolas Le Bayon #define DDRCTRL_MRCTRL0_MR_TYPE_WRITE		U(0)
21306e55dc8SNicolas Le Bayon /* Only one rank supported */
21406e55dc8SNicolas Le Bayon #define DDRCTRL_MRCTRL0_MR_RANK_SHIFT		4
21506e55dc8SNicolas Le Bayon #define DDRCTRL_MRCTRL0_MR_RANK_ALL \
21606e55dc8SNicolas Le Bayon 					BIT(DDRCTRL_MRCTRL0_MR_RANK_SHIFT)
21706e55dc8SNicolas Le Bayon #define DDRCTRL_MRCTRL0_MR_ADDR_SHIFT		12
21806e55dc8SNicolas Le Bayon #define DDRCTRL_MRCTRL0_MR_ADDR_MASK		GENMASK(15, 12)
21906e55dc8SNicolas Le Bayon #define DDRCTRL_MRCTRL0_MR_WR			BIT(31)
22006e55dc8SNicolas Le Bayon 
22106e55dc8SNicolas Le Bayon #define DDRCTRL_MRSTAT_MR_WR_BUSY		BIT(0)
22206e55dc8SNicolas Le Bayon 
22306e55dc8SNicolas Le Bayon #define DDRCTRL_PWRCTL_SELFREF_EN		BIT(0)
22406e55dc8SNicolas Le Bayon #define DDRCTRL_PWRCTL_POWERDOWN_EN		BIT(1)
22506e55dc8SNicolas Le Bayon #define DDRCTRL_PWRCTL_EN_DFI_DRAM_CLK_DISABLE	BIT(3)
22606e55dc8SNicolas Le Bayon #define DDRCTRL_PWRCTL_SELFREF_SW		BIT(5)
227*79629b1aSNicolas Le Bayon #define DDRCTRL_PWRCTL_STAY_IN_SELFREF		BIT(6)
22806e55dc8SNicolas Le Bayon 
22906e55dc8SNicolas Le Bayon #define DDRCTRL_PWRTMG_SELFREF_TO_X32_MASK	GENMASK(23, 16)
23006e55dc8SNicolas Le Bayon #define DDRCTRL_PWRTMG_SELFREF_TO_X32_0		BIT(16)
23106e55dc8SNicolas Le Bayon 
23206e55dc8SNicolas Le Bayon #define DDRCTRL_RFSHCTL3_DIS_AUTO_REFRESH	BIT(0)
23306e55dc8SNicolas Le Bayon #define DDRCTRL_RFSHCTL3_REFRESH_UPDATE_LEVEL	BIT(1)
23406e55dc8SNicolas Le Bayon 
23506e55dc8SNicolas Le Bayon #define DDRCTRL_HWLPCTL_HW_LP_EN		BIT(0)
236*79629b1aSNicolas Le Bayon #define DDRCTRL_HWLPCTL_HW_LP_EXIT_IDLE_EN	BIT(1)
237*79629b1aSNicolas Le Bayon #define DDRCTRL_HWLPCTL_HW_LP_IDLE_X32_MASK	GENMASK(27, 16)
238*79629b1aSNicolas Le Bayon #define DDRCTRL_HWLPCTL_HW_LP_IDLE_X32_SHIFT	16
23906e55dc8SNicolas Le Bayon 
24006e55dc8SNicolas Le Bayon #define DDRCTRL_RFSHTMG_T_RFC_NOM_X1_X32_MASK	GENMASK(27, 16)
24106e55dc8SNicolas Le Bayon #define DDRCTRL_RFSHTMG_T_RFC_NOM_X1_X32_SHIFT	16
24206e55dc8SNicolas Le Bayon 
24306e55dc8SNicolas Le Bayon #define DDRCTRL_INIT0_SKIP_DRAM_INIT_MASK	GENMASK(31, 30)
24406e55dc8SNicolas Le Bayon #define DDRCTRL_INIT0_SKIP_DRAM_INIT_NORMAL	BIT(30)
24506e55dc8SNicolas Le Bayon 
246*79629b1aSNicolas Le Bayon #define DDRCTRL_DFILPCFG0_DFI_LP_EN_SR		BIT(8)
247*79629b1aSNicolas Le Bayon 
24806e55dc8SNicolas Le Bayon #define DDRCTRL_DFIMISC_DFI_INIT_COMPLETE_EN	BIT(0)
24906e55dc8SNicolas Le Bayon #define DDRCTRL_DFIMISC_DFI_INIT_START		BIT(5)
250*79629b1aSNicolas Le Bayon #define DDRCTRL_DFIMISC_DFI_FREQUENCY		GENMASK(12, 8)
25106e55dc8SNicolas Le Bayon 
25206e55dc8SNicolas Le Bayon #define DDRCTRL_DFISTAT_DFI_INIT_COMPLETE	BIT(0)
253*79629b1aSNicolas Le Bayon #define DDRCTRL_DFISTAT_DFI_LP_ACK		BIT(1)
25406e55dc8SNicolas Le Bayon 
255*79629b1aSNicolas Le Bayon #define DDRCTRL_DBG1_DIS_DQ			BIT(0)
25606e55dc8SNicolas Le Bayon #define DDRCTRL_DBG1_DIS_HIF			BIT(1)
25706e55dc8SNicolas Le Bayon 
25806e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCAM_WR_DATA_PIPELINE_EMPTY	BIT(29)
25906e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCAM_RD_DATA_PIPELINE_EMPTY	BIT(28)
26006e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCAM_DBG_WR_Q_EMPTY		BIT(26)
261d596023bSNicolas Le Bayon #define DDRCTRL_DBGCAM_DBG_RD_Q_EMPTY		BIT(25)
26206e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCAM_DBG_LPR_Q_DEPTH		GENMASK(12, 8)
26306e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCAM_DBG_HPR_Q_DEPTH		GENMASK(4, 0)
26406e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCAM_DATA_PIPELINE_EMPTY \
26506e55dc8SNicolas Le Bayon 		(DDRCTRL_DBGCAM_WR_DATA_PIPELINE_EMPTY | \
26606e55dc8SNicolas Le Bayon 		 DDRCTRL_DBGCAM_RD_DATA_PIPELINE_EMPTY)
267d596023bSNicolas Le Bayon #define DDRCTRL_DBG_Q_AND_DATA_PIPELINE_EMPTY \
268d596023bSNicolas Le Bayon 		(DDRCTRL_DBGCAM_DBG_WR_Q_EMPTY | \
269d596023bSNicolas Le Bayon 		 DDRCTRL_DBGCAM_DBG_RD_Q_EMPTY | \
270d596023bSNicolas Le Bayon 		 DDRCTRL_DBGCAM_DATA_PIPELINE_EMPTY)
27106e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCAM_DBG_Q_DEPTH \
27206e55dc8SNicolas Le Bayon 		(DDRCTRL_DBGCAM_DBG_WR_Q_EMPTY | \
27306e55dc8SNicolas Le Bayon 		 DDRCTRL_DBGCAM_DBG_LPR_Q_DEPTH | \
27406e55dc8SNicolas Le Bayon 		 DDRCTRL_DBGCAM_DBG_HPR_Q_DEPTH)
27506e55dc8SNicolas Le Bayon 
27606e55dc8SNicolas Le Bayon #define DDRCTRL_DBGCMD_RANK0_REFRESH		BIT(0)
27706e55dc8SNicolas Le Bayon 
27806e55dc8SNicolas Le Bayon #define DDRCTRL_DBGSTAT_RANK0_REFRESH_BUSY	BIT(0)
27906e55dc8SNicolas Le Bayon 
28006e55dc8SNicolas Le Bayon #define DDRCTRL_SWCTL_SW_DONE			BIT(0)
28106e55dc8SNicolas Le Bayon 
28206e55dc8SNicolas Le Bayon #define DDRCTRL_SWSTAT_SW_DONE_ACK		BIT(0)
28306e55dc8SNicolas Le Bayon 
28406e55dc8SNicolas Le Bayon #define DDRCTRL_PCTRL_N_PORT_EN			BIT(0)
28506e55dc8SNicolas Le Bayon 
28606e55dc8SNicolas Le Bayon #endif /* STM32MP_DDRCTRL_REGS_H */
287