1 /* SPDX-License-Identifier: BSD-3-Clause */
6 /***********************************************************************/
8 /***********************************************************************/
9 #include "dramc_register.h"
12 //Definitions to enable specific freq's LP4 ACTiming support (To save code size)
13 #define SUPPORT_LP5_DDR6400_ACTIM 0
14 #define SUPPORT_LP5_DDR5500_ACTIM 0
15 #define SUPPORT_LP5_DDR4266_ACTIM 0
16 #define SUPPORT_LP5_DDR3200_ACTIM 0
17 #define SUPPORT_LP4_DDR4266_ACTIM 1
18 #define SUPPORT_LP4_DDR3733_ACTIM 1
19 #define SUPPORT_LP4_DDR3200_ACTIM 1
20 #define SUPPORT_LP4_DDR2667_ACTIM 0
21 #define SUPPORT_LP4_DDR2400_ACTIM 1
22 #define SUPPORT_LP4_DDR1866_ACTIM 1
23 #define SUPPORT_LP4_DDR1600_ACTIM 1
24 #define SUPPORT_LP4_DDR1333_ACTIM 0
25 #define SUPPORT_LP4_DDR1200_ACTIM 1
26 #define SUPPORT_LP4_DDR800_ACTIM 1
27 #if ENABLE_DDR400_OPEN_LOOP_MODE_OPTION
28 #define SUPPORT_LP4_DDR400_ACTIM 1
30 #define SUPPORT_LP4_DDR400_ACTIM 0
32 /* Used to keep track the total number of LP4 ACTimings */
33 /* Since READ_DBI is enable/disabled using preprocessor C define
34 * -> Save code size by excluding unneeded ACTimingTable entries
35 * Note 1: READ_DBI on/off is for (LP4 data rate >= DDR2667 (FSP1))
36 * Must make sure DDR3733 is the 1st entry (DMCATRAIN_INTV is used)
40 #if SUPPORT_LP4_DDR4266_ACTIM
42 AC_TIME_LP4_BYTE_DDR4266_RDBI_ON
= 0,
43 AC_TIME_LP4_NORM_DDR4266_RDBI_ON
,
44 #else //(ENABLE_READ_DBI == 0)
45 AC_TIME_LP4_BYTE_DDR4266_RDBI_OFF
,
46 AC_TIME_LP4_NORM_DDR4266_RDBI_OFF
,
47 #endif //ENABLE_READ_DBI
50 #if SUPPORT_LP4_DDR3733_ACTIM
52 AC_TIME_LP4_BYTE_DDR3733_RDBI_ON
,
53 AC_TIME_LP4_NORM_DDR3733_RDBI_ON
,
54 #else //(ENABLE_READ_DBI == 0)
55 AC_TIME_LP4_BYTE_DDR3733_RDBI_OFF
,
56 AC_TIME_LP4_NORM_DDR3733_RDBI_OFF
,
57 #endif //ENABLE_READ_DBI
60 #if SUPPORT_LP4_DDR3200_ACTIM
62 AC_TIME_LP4_BYTE_DDR3200_RDBI_ON
,
63 AC_TIME_LP4_NORM_DDR3200_RDBI_ON
,
64 #else //(ENABLE_READ_DBI == 0)
65 AC_TIME_LP4_BYTE_DDR3200_RDBI_OFF
,
66 AC_TIME_LP4_NORM_DDR3200_RDBI_OFF
,
67 #endif //ENABLE_READ_DBI
70 #if SUPPORT_LP4_DDR2667_ACTIM
72 AC_TIME_LP4_BYTE_DDR2667_RDBI_ON
,
73 AC_TIME_LP4_NORM_DDR2667_RDBI_ON
,
74 #else //(ENABLE_READ_DBI == 0)
75 AC_TIME_LP4_BYTE_DDR2667_RDBI_OFF
,
76 AC_TIME_LP4_NORM_DDR2667_RDBI_OFF
,
77 #endif //ENABLE_READ_DBI
80 #if SUPPORT_LP4_DDR2400_ACTIM
81 AC_TIME_LP4_BYTE_DDR2400_RDBI_OFF
,
82 AC_TIME_LP4_NORM_DDR2400_RDBI_OFF
,
85 #if SUPPORT_LP4_DDR1866_ACTIM
86 AC_TIME_LP4_BYTE_DDR1866_RDBI_OFF
,
87 AC_TIME_LP4_NORM_DDR1866_RDBI_OFF
,
90 #if SUPPORT_LP4_DDR1600_ACTIM
91 AC_TIME_LP4_BYTE_DDR1600_RDBI_OFF
,
92 AC_TIME_LP4_NORM_DDR1600_RDBI_OFF
,
93 AC_TIME_LP4_BYTE_DDR1600_DIV4_RDBI_OFF
,
94 AC_TIME_LP4_NORM_DDR1600_DIV4_RDBI_OFF
,
97 #if SUPPORT_LP4_DDR1333_ACTIM
98 AC_TIME_LP4_BYTE_DDR1333_RDBI_OFF
,
99 AC_TIME_LP4_NORM_DDR1333_RDBI_OFF
,
103 #if SUPPORT_LP4_DDR1200_ACTIM
104 AC_TIME_LP4_BYTE_DDR1200_RDBI_OFF
,
105 AC_TIME_LP4_NORM_DDR1200_RDBI_OFF
,
106 AC_TIME_LP4_BYTE_DDR1200_DIV4_RDBI_OFF
,
107 AC_TIME_LP4_NORM_DDR1200_DIV4_RDBI_OFF
,
110 #if SUPPORT_LP4_DDR800_ACTIM
111 AC_TIME_LP4_BYTE_DDR800_RDBI_OFF
,
112 AC_TIME_LP4_NORM_DDR800_RDBI_OFF
,
113 AC_TIME_LP4_BYTE_DDR800_DIV4_RDBI_OFF
,
114 AC_TIME_LP4_NORM_DDR800_DIV4_RDBI_OFF
,
117 #if SUPPORT_LP4_DDR400_ACTIM
118 AC_TIME_LP4_BYTE_DDR400_RDBI_OFF
,
119 AC_TIME_LP4_NORM_DDR400_RDBI_OFF
,
123 } AC_TIMING_LP4_COUNT_TYPE_T
;
125 #define AC_TIMING_NUMBER_LP5 0
127 /* ACTiming struct declaration (declared here due Fld_wid for each register type)
128 * Should include all fields from ACTiming excel file (And update the correct values in UpdateACTimingReg()
129 * Note: DQSINCTL, DATLAT aren't in ACTiming excel file (internal delay parameters)
131 typedef struct _ACTime_T_LP4
133 U8 dramType
, cbtMode
, readDBI
;
136 U8 readLat
, writeLat
;
137 U8 dqsinctl
, datlat
; //DQSINCTL, DATLAT aren't in ACTiming excel file
196 //DRAMC_REG_SHU_AC_TIME_05T ===================================
235 typedef struct _ACTime_T_LP5
237 U8 dramType
, cbtMode
, readDBI
;
240 U8 readLat
, writeLat
;
241 U8 dqsinctl
, datlat
; //DQSINCTL, DATLAT aren't in ACTiming excel file
276 U8 xrtw2r_odt_off_otf_off
;
277 U8 xrtw2r_odt_on_otf_off
;
278 U8 xrtw2r_odt_off_otf_on
;
279 U8 xrtw2r_odt_on_otf_on
;
284 U8 xrtw2w_odt_off_wck
;
285 U8 xrtw2w_odt_on_wck
;
286 U8 xrtw2r_odt_off_wck
;
287 U8 xrtw2r_odt_on_wck
;
288 U8 xrtr2w_odt_off_wck
;
289 U8 xrtr2w_odt_on_wck
;
313 //DRAMC_REG_SHU_AC_TIME_05T ===================================
353 //ACTimingTbl[] forward declaration
355 extern U8
vDramcACTimingGetDatLat(DRAMC_CTX_T
*p
);
356 extern DRAM_STATUS_T
DdrUpdateACTiming(DRAMC_CTX_T
*p
);