1*79629b1aSNicolas Le Bayon /* 2*79629b1aSNicolas Le Bayon * Copyright (C) 2021-2024, STMicroelectronics - All Rights Reserved 3*79629b1aSNicolas Le Bayon * 4*79629b1aSNicolas Le Bayon * SPDX-License-Identifier: BSD-3-Clause 5*79629b1aSNicolas Le Bayon */ 6*79629b1aSNicolas Le Bayon 7*79629b1aSNicolas Le Bayon #ifndef DDRPHY_PHYINIT_STRUCT_H 8*79629b1aSNicolas Le Bayon #define DDRPHY_PHYINIT_STRUCT_H 9*79629b1aSNicolas Le Bayon 10*79629b1aSNicolas Le Bayon /* This file defines the internal data structures used in PhyInit to store user configuration */ 11*79629b1aSNicolas Le Bayon 12*79629b1aSNicolas Le Bayon /* DIMM Type definitions */ 13*79629b1aSNicolas Le Bayon #define DDR_DIMMTYPE_NODIMM 4U /* No DIMM (Soldered-on) */ 14*79629b1aSNicolas Le Bayon 15*79629b1aSNicolas Le Bayon /* 16*79629b1aSNicolas Le Bayon * Structure for basic user inputs 17*79629b1aSNicolas Le Bayon * 18*79629b1aSNicolas Le Bayon * The following basic data structure must be set and completed correctly so 19*79629b1aSNicolas Le Bayon * that the PhyInit software package can accurate program PHY registers. 20*79629b1aSNicolas Le Bayon */ 21*79629b1aSNicolas Le Bayon struct user_input_basic { 22*79629b1aSNicolas Le Bayon uint32_t dramtype; /* 23*79629b1aSNicolas Le Bayon * DRAM module type. 24*79629b1aSNicolas Le Bayon * 25*79629b1aSNicolas Le Bayon * Value | Description 26*79629b1aSNicolas Le Bayon * ----- | ------ 27*79629b1aSNicolas Le Bayon * 0x0 | DDR4 28*79629b1aSNicolas Le Bayon * 0x1 | DDR3 29*79629b1aSNicolas Le Bayon * 0x2 | LPDDR4 30*79629b1aSNicolas Le Bayon */ 31*79629b1aSNicolas Le Bayon 32*79629b1aSNicolas Le Bayon uint32_t dimmtype; /* 33*79629b1aSNicolas Le Bayon * DIMM type. 34*79629b1aSNicolas Le Bayon * 35*79629b1aSNicolas Le Bayon * Value | Description 36*79629b1aSNicolas Le Bayon * ----- | ------ 37*79629b1aSNicolas Le Bayon * 0x4 | No DIMM (Soldered-on) (DDR_DIMMTYPE_NODIMM) 38*79629b1aSNicolas Le Bayon */ 39*79629b1aSNicolas Le Bayon 40*79629b1aSNicolas Le Bayon uint32_t lp4xmode; /* 41*79629b1aSNicolas Le Bayon * LPDDR4X mode support. 42*79629b1aSNicolas Le Bayon * Only used for LPDDR4, but not valid here. 43*79629b1aSNicolas Le Bayon * 44*79629b1aSNicolas Le Bayon * Value | Description 45*79629b1aSNicolas Le Bayon * ----- | ------ 46*79629b1aSNicolas Le Bayon * 0x0 | LPDDR4 mode, when dramtype is LPDDR4 47*79629b1aSNicolas Le Bayon */ 48*79629b1aSNicolas Le Bayon 49*79629b1aSNicolas Le Bayon uint32_t numdbyte; /* Number of dbytes physically instantiated */ 50*79629b1aSNicolas Le Bayon 51*79629b1aSNicolas Le Bayon uint32_t numactivedbytedfi0; /* Number of active dbytes to be controlled by dfi0 */ 52*79629b1aSNicolas Le Bayon 53*79629b1aSNicolas Le Bayon uint32_t numactivedbytedfi1; /* 54*79629b1aSNicolas Le Bayon * Number of active dbytes to be controlled by dfi1. 55*79629b1aSNicolas Le Bayon * Only used for LPDDR4. 56*79629b1aSNicolas Le Bayon */ 57*79629b1aSNicolas Le Bayon 58*79629b1aSNicolas Le Bayon uint32_t numanib; /* Number of ANIBs physically instantiated */ 59*79629b1aSNicolas Le Bayon 60*79629b1aSNicolas Le Bayon uint32_t numrank_dfi0; /* Number of ranks in DFI0 channel */ 61*79629b1aSNicolas Le Bayon 62*79629b1aSNicolas Le Bayon uint32_t numrank_dfi1; /* Number of ranks in DFI1 channel (if DFI1 exists) */ 63*79629b1aSNicolas Le Bayon 64*79629b1aSNicolas Le Bayon uint32_t dramdatawidth; /* 65*79629b1aSNicolas Le Bayon * Width of the DRAM device. 66*79629b1aSNicolas Le Bayon * 67*79629b1aSNicolas Le Bayon * Enter 4,8,16 or 32 depending on protocol and dram type 68*79629b1aSNicolas Le Bayon * according below table. 69*79629b1aSNicolas Le Bayon * 70*79629b1aSNicolas Le Bayon * Protocol | Valid Options | Default 71*79629b1aSNicolas Le Bayon * -------- | ------------- | --- 72*79629b1aSNicolas Le Bayon * DDR3 | 4,8,16 | 8 73*79629b1aSNicolas Le Bayon * DDR4 | 4,8,16 | 8 74*79629b1aSNicolas Le Bayon * LPDDR4 | 8,16 | 16 75*79629b1aSNicolas Le Bayon * 76*79629b1aSNicolas Le Bayon * For mixed x8 and x16 width devices, set variable to x8. 77*79629b1aSNicolas Le Bayon */ 78*79629b1aSNicolas Le Bayon 79*79629b1aSNicolas Le Bayon uint32_t numpstates; /* Number of p-states used. Must be set to 1 */ 80*79629b1aSNicolas Le Bayon 81*79629b1aSNicolas Le Bayon uint32_t frequency; /* 82*79629b1aSNicolas Le Bayon * Memclk frequency for each PState. 83*79629b1aSNicolas Le Bayon * Memclk frequency in MHz round up to next highest integer. 84*79629b1aSNicolas Le Bayon * Enter 334 for 333.333, etc. 85*79629b1aSNicolas Le Bayon */ 86*79629b1aSNicolas Le Bayon 87*79629b1aSNicolas Le Bayon uint32_t pllbypass; /* 88*79629b1aSNicolas Le Bayon * Indicates if PLL should be in Bypass mode. 89*79629b1aSNicolas Le Bayon * If DDR datarate < 333, PLL must be in Bypass Mode. 90*79629b1aSNicolas Le Bayon * 91*79629b1aSNicolas Le Bayon * Value | Description 92*79629b1aSNicolas Le Bayon * ----- | ------ 93*79629b1aSNicolas Le Bayon * 0x1 | Enabled 94*79629b1aSNicolas Le Bayon * 0x0 | Disabled 95*79629b1aSNicolas Le Bayon */ 96*79629b1aSNicolas Le Bayon 97*79629b1aSNicolas Le Bayon uint32_t dfifreqratio; /* 98*79629b1aSNicolas Le Bayon * Selected Dfi Frequency ratio. 99*79629b1aSNicolas Le Bayon * Used to program the dfifreqratio register. This register 100*79629b1aSNicolas Le Bayon * controls how dfi_freq_ratio input pin should be driven 101*79629b1aSNicolas Le Bayon * inaccordance with DFI Spec. 102*79629b1aSNicolas Le Bayon * 103*79629b1aSNicolas Le Bayon * Binary Value | Description 104*79629b1aSNicolas Le Bayon * ----- | ------ 105*79629b1aSNicolas Le Bayon * 2'b01 | 1:2 DFI Frequency Ratio (default) 106*79629b1aSNicolas Le Bayon */ 107*79629b1aSNicolas Le Bayon 108*79629b1aSNicolas Le Bayon uint32_t dfi1exists; /* Indicates if the PHY configuration has Dfi1 channel */ 109*79629b1aSNicolas Le Bayon 110*79629b1aSNicolas Le Bayon uint32_t train2d; /* Obsolete. Not used. */ 111*79629b1aSNicolas Le Bayon 112*79629b1aSNicolas Le Bayon uint32_t hardmacrover; /* 113*79629b1aSNicolas Le Bayon * Hard Macro Family version in use. 114*79629b1aSNicolas Le Bayon * 115*79629b1aSNicolas Le Bayon * Value | Description 116*79629b1aSNicolas Le Bayon * ----- | ------ 117*79629b1aSNicolas Le Bayon * 3 | hardmacro family D 118*79629b1aSNicolas Le Bayon */ 119*79629b1aSNicolas Le Bayon 120*79629b1aSNicolas Le Bayon uint32_t readdbienable; /* Obsolete. Not Used. */ 121*79629b1aSNicolas Le Bayon 122*79629b1aSNicolas Le Bayon uint32_t dfimode; /* Obsolete. Not Used. */ 123*79629b1aSNicolas Le Bayon }; 124*79629b1aSNicolas Le Bayon 125*79629b1aSNicolas Le Bayon /* 126*79629b1aSNicolas Le Bayon * Structure for advanced user inputs 127*79629b1aSNicolas Le Bayon */ 128*79629b1aSNicolas Le Bayon struct user_input_advanced { 129*79629b1aSNicolas Le Bayon uint32_t lp4rxpreamblemode; /* 130*79629b1aSNicolas Le Bayon * Selects between DRAM read static vs toggle preamble. 131*79629b1aSNicolas Le Bayon * Determine desired DRAM Read Preamble Mode based on SI 132*79629b1aSNicolas Le Bayon * Analysis and DRAM Part in use. 133*79629b1aSNicolas Le Bayon * The PHY training firmware will program DRAM mr1-OP[3] 134*79629b1aSNicolas Le Bayon * after training based on setting. 135*79629b1aSNicolas Le Bayon * 136*79629b1aSNicolas Le Bayon * Value | Description 137*79629b1aSNicolas Le Bayon * ----- | ------ 138*79629b1aSNicolas Le Bayon * 0x1 | toggling preamble 139*79629b1aSNicolas Le Bayon * 0x0 | static preamble 140*79629b1aSNicolas Le Bayon */ 141*79629b1aSNicolas Le Bayon 142*79629b1aSNicolas Le Bayon uint32_t lp4postambleext; /* 143*79629b1aSNicolas Le Bayon * Extend write postamble in LPDDR4. 144*79629b1aSNicolas Le Bayon * Only used for LPDDR4. 145*79629b1aSNicolas Le Bayon * This variable is used to calculate LPDDR4 mr3-OP[1] set 146*79629b1aSNicolas Le Bayon * in the messageBlock. 147*79629b1aSNicolas Le Bayon * The training firmware will set DRAM MR according to MR 148*79629b1aSNicolas Le Bayon * value in the messageBlock at the end of training. 149*79629b1aSNicolas Le Bayon * Set value according to your SI analysis and DRAM 150*79629b1aSNicolas Le Bayon * requirement. 151*79629b1aSNicolas Le Bayon * 152*79629b1aSNicolas Le Bayon * Value | Description 153*79629b1aSNicolas Le Bayon * ----- | ------ 154*79629b1aSNicolas Le Bayon * 0x0 | half Memclk postamble 155*79629b1aSNicolas Le Bayon * 0x1 | 1.5 Memclk postabmle (default) 156*79629b1aSNicolas Le Bayon */ 157*79629b1aSNicolas Le Bayon 158*79629b1aSNicolas Le Bayon uint32_t d4rxpreamblelength; /* 159*79629b1aSNicolas Le Bayon * Length of read preamble in DDR4 mode. 160*79629b1aSNicolas Le Bayon * Only used for DDR4. 161*79629b1aSNicolas Le Bayon * This variable is used to calculate DDR4 mr4-OP[11] set 162*79629b1aSNicolas Le Bayon * in the messageBlock. 163*79629b1aSNicolas Le Bayon * The training firmware will set DRAM MR according to MR 164*79629b1aSNicolas Le Bayon * value in the messageBlock at the end of training. 165*79629b1aSNicolas Le Bayon * Set value according to your SI analysis and DRAM 166*79629b1aSNicolas Le Bayon * requirement. 167*79629b1aSNicolas Le Bayon * 168*79629b1aSNicolas Le Bayon * Value | Description 169*79629b1aSNicolas Le Bayon * ----- | ------ 170*79629b1aSNicolas Le Bayon * 0x0 | 1 Tck 171*79629b1aSNicolas Le Bayon * 0x1 | 2 Tck (default) 172*79629b1aSNicolas Le Bayon */ 173*79629b1aSNicolas Le Bayon 174*79629b1aSNicolas Le Bayon uint32_t d4txpreamblelength; /* 175*79629b1aSNicolas Le Bayon * Length of write preamble in DDR4 mode. 176*79629b1aSNicolas Le Bayon * Only used for DDR4. 177*79629b1aSNicolas Le Bayon * This variable is used to calculate DDR4 mr4-OP[12] set 178*79629b1aSNicolas Le Bayon * in the messageBlock. 179*79629b1aSNicolas Le Bayon * The training firmware will set DRAM MR according to MR 180*79629b1aSNicolas Le Bayon * value in the messageBlock at the end of training. 181*79629b1aSNicolas Le Bayon * Set value according to your SI analysis and DRAM 182*79629b1aSNicolas Le Bayon * requirement. 183*79629b1aSNicolas Le Bayon * 184*79629b1aSNicolas Le Bayon * Value | Description 185*79629b1aSNicolas Le Bayon * ----- | ------ 186*79629b1aSNicolas Le Bayon * 0x0 | 1 Tck (default) 187*79629b1aSNicolas Le Bayon * 0x1 | 2 Tck 188*79629b1aSNicolas Le Bayon */ 189*79629b1aSNicolas Le Bayon 190*79629b1aSNicolas Le Bayon uint32_t extcalresval; /* 191*79629b1aSNicolas Le Bayon * External Impedance calibration pull-down resistor value 192*79629b1aSNicolas Le Bayon * select. 193*79629b1aSNicolas Le Bayon * Indicates value of impedance calibration pull-down 194*79629b1aSNicolas Le Bayon * resistor connected to BP_ZN pin of the PHY. 195*79629b1aSNicolas Le Bayon * Value | Description 196*79629b1aSNicolas Le Bayon * ----- | ------ 197*79629b1aSNicolas Le Bayon * 0x0 | 240 ohm (default) 198*79629b1aSNicolas Le Bayon */ 199*79629b1aSNicolas Le Bayon 200*79629b1aSNicolas Le Bayon uint32_t is2ttiming; /* 201*79629b1aSNicolas Le Bayon * Set to 1 to use 2T timing for address/command, otherwise 202*79629b1aSNicolas Le Bayon * 1T timing will be used. 203*79629b1aSNicolas Le Bayon * Determine 1T or 2T Timing operation mode based on SI 204*79629b1aSNicolas Le Bayon * Analysis and DRAM Timing. 205*79629b1aSNicolas Le Bayon * - In 1T mode, CK, CS, CA all have the same nominal 206*79629b1aSNicolas Le Bayon * timing, ie. ATxDly[6:0] will have same value for all 207*79629b1aSNicolas Le Bayon * ANIBs. 208*79629b1aSNicolas Le Bayon * - In 2T mode, CK, CS,have the same nominal timing 209*79629b1aSNicolas Le Bayon * (e.g. AtxDly[6:0]=0x00), while CA is delayed by 1UI 210*79629b1aSNicolas Le Bayon * (e.g. ATxDly[6:0]=0x40) 211*79629b1aSNicolas Le Bayon * Used to program phycfg setting in messageBlock. 212*79629b1aSNicolas Le Bayon * 213*79629b1aSNicolas Le Bayon * Value | Description 214*79629b1aSNicolas Le Bayon * ----- | ------ 215*79629b1aSNicolas Le Bayon * 0x0 | 1T Timing (default) 216*79629b1aSNicolas Le Bayon * 0x1 | 2T Timing 217*79629b1aSNicolas Le Bayon */ 218*79629b1aSNicolas Le Bayon 219*79629b1aSNicolas Le Bayon uint32_t odtimpedance; /* 220*79629b1aSNicolas Le Bayon * ODT impedance in ohm. 221*79629b1aSNicolas Le Bayon * Used for programming TxOdtDrvStren registers. 222*79629b1aSNicolas Le Bayon * Enter 0 for open/high-impedance. 223*79629b1aSNicolas Le Bayon * Default value: 60 224*79629b1aSNicolas Le Bayon */ 225*79629b1aSNicolas Le Bayon 226*79629b1aSNicolas Le Bayon uint32_t tximpedance; /* 227*79629b1aSNicolas Le Bayon * Tx Drive Impedance for DQ/DQS in ohm. 228*79629b1aSNicolas Le Bayon * Used for programming TxImpedanceCtrl1 registers. 229*79629b1aSNicolas Le Bayon * Enter 0 for open/high-impedance. 230*79629b1aSNicolas Le Bayon * Default value: 60 231*79629b1aSNicolas Le Bayon */ 232*79629b1aSNicolas Le Bayon 233*79629b1aSNicolas Le Bayon uint32_t atximpedance; /* 234*79629b1aSNicolas Le Bayon * Tx Drive Impedance for AC in ohm. 235*79629b1aSNicolas Le Bayon * Used for programming ATxImpedance register. 236*79629b1aSNicolas Le Bayon * Enter 0 for open/high-impedance 237*79629b1aSNicolas Le Bayon * Default value: 20 (HMA,HMB,HMC,HMD), 40 (HME) 238*79629b1aSNicolas Le Bayon */ 239*79629b1aSNicolas Le Bayon 240*79629b1aSNicolas Le Bayon uint32_t memalerten; /* 241*79629b1aSNicolas Le Bayon * Enables BP_ALERT programming of PHY registers. 242*79629b1aSNicolas Le Bayon * Only used for DDR3 and DDR4. 243*79629b1aSNicolas Le Bayon * Used for programming MemAlertControl and MemAlertControl2 244*79629b1aSNicolas Le Bayon * registers. 245*79629b1aSNicolas Le Bayon * Program if you require using BP_ALERT pin (to receive or 246*79629b1aSNicolas Le Bayon * terminate signal) of the PHY otherwise leave at default 247*79629b1aSNicolas Le Bayon * value to save power. 248*79629b1aSNicolas Le Bayon * 249*79629b1aSNicolas Le Bayon * Value | Description 250*79629b1aSNicolas Le Bayon * ----- | ------ 251*79629b1aSNicolas Le Bayon * 0x0 | Disable BP_ALERT (default) 252*79629b1aSNicolas Le Bayon */ 253*79629b1aSNicolas Le Bayon 254*79629b1aSNicolas Le Bayon uint32_t memalertpuimp; /* 255*79629b1aSNicolas Le Bayon * Specify MemAlert Pull-up Termination Impedance. 256*79629b1aSNicolas Le Bayon * Programs the pull-up termination on BP_ALERT. 257*79629b1aSNicolas Le Bayon * Not valid here (fixed 0 value). 258*79629b1aSNicolas Le Bayon */ 259*79629b1aSNicolas Le Bayon 260*79629b1aSNicolas Le Bayon uint32_t memalertvreflevel; /* 261*79629b1aSNicolas Le Bayon * Specify the Vref level for BP_ALERT(MemAlert) Receiver. 262*79629b1aSNicolas Le Bayon * Not valid here (fixed 0 value). 263*79629b1aSNicolas Le Bayon */ 264*79629b1aSNicolas Le Bayon 265*79629b1aSNicolas Le Bayon uint32_t memalertsyncbypass; /* 266*79629b1aSNicolas Le Bayon * When set, this bit bypasses the DfiClk synchronizer on 267*79629b1aSNicolas Le Bayon * dfi_alert_n. 268*79629b1aSNicolas Le Bayon * Not valid here (fixed 0 value). 269*79629b1aSNicolas Le Bayon */ 270*79629b1aSNicolas Le Bayon 271*79629b1aSNicolas Le Bayon uint32_t disdynadrtri; /* 272*79629b1aSNicolas Le Bayon * Disable Dynamic Per-MEMCLK Address Tristate feature. 273*79629b1aSNicolas Le Bayon * Program this variable if you require to disable this 274*79629b1aSNicolas Le Bayon * feature. 275*79629b1aSNicolas Le Bayon * - In DDR3/2T and DDR4/2T/2N modes, the dynamic tristate 276*79629b1aSNicolas Le Bayon * feature should be disabled if the controller cannot 277*79629b1aSNicolas Le Bayon * follow the 2T PHY tristate protocol. 278*79629b1aSNicolas Le Bayon * - In LPDDR4 mode, the dynamic tristate feature should 279*79629b1aSNicolas Le Bayon * be disabled. 280*79629b1aSNicolas Le Bayon * 281*79629b1aSNicolas Le Bayon * Value | Description 282*79629b1aSNicolas Le Bayon * ----- | ------ 283*79629b1aSNicolas Le Bayon * 0x1 | Disable Dynamic Tristate 284*79629b1aSNicolas Le Bayon */ 285*79629b1aSNicolas Le Bayon 286*79629b1aSNicolas Le Bayon uint32_t phymstrtraininterval; /* 287*79629b1aSNicolas Le Bayon * Specifies the how frequent dfi_phymstr_req is issued by 288*79629b1aSNicolas Le Bayon * PHY. 289*79629b1aSNicolas Le Bayon * Only required in LPDDR4. 290*79629b1aSNicolas Le Bayon * Based on SI analysis determine how frequent DRAM drift 291*79629b1aSNicolas Le Bayon * compensation and re-training is required. 292*79629b1aSNicolas Le Bayon * Determine if Memory controller supports DFI PHY Master 293*79629b1aSNicolas Le Bayon * Interface. 294*79629b1aSNicolas Le Bayon * Program based on desired setting for 295*79629b1aSNicolas Le Bayon * PPTTrainSetup.PhyMstrTrainInterval register. 296*79629b1aSNicolas Le Bayon * Default value: 0xa 297*79629b1aSNicolas Le Bayon * 298*79629b1aSNicolas Le Bayon * Example: 299*79629b1aSNicolas Le Bayon * Value | Description 300*79629b1aSNicolas Le Bayon * ----- | ------ 301*79629b1aSNicolas Le Bayon * 0xa | PPT Train Interval = 268435456 MEMCLKs (default) 302*79629b1aSNicolas Le Bayon */ 303*79629b1aSNicolas Le Bayon 304*79629b1aSNicolas Le Bayon uint32_t phymstrmaxreqtoack; /* 305*79629b1aSNicolas Le Bayon * Max time from dfi_phymstr_req asserted to dfi_phymstr_ack 306*79629b1aSNicolas Le Bayon * asserted. 307*79629b1aSNicolas Le Bayon * Only required in LPDDR4. 308*79629b1aSNicolas Le Bayon * Based on your Memory controller's(MC) specification 309*79629b1aSNicolas Le Bayon * determine how long the PHY should wait for the assertion 310*79629b1aSNicolas Le Bayon * of dfi_phymstr_ack once dfi_phymstr_req has been issued 311*79629b1aSNicolas Le Bayon * by the PHY. If the MC does not ack the PHY's request, PHY 312*79629b1aSNicolas Le Bayon * may issue dfi_error. 313*79629b1aSNicolas Le Bayon * This value will be used to program 314*79629b1aSNicolas Le Bayon * PPTTrainSetup.PhyMstrMaxReqToAck register. 315*79629b1aSNicolas Le Bayon * Default value: 0x5 316*79629b1aSNicolas Le Bayon * 317*79629b1aSNicolas Le Bayon * Example: 318*79629b1aSNicolas Le Bayon * Value | Description 319*79629b1aSNicolas Le Bayon * ----- | ------ 320*79629b1aSNicolas Le Bayon * 0x5 | PPT Max. Req to Ack. = 8192 MEMCLKs (default) 321*79629b1aSNicolas Le Bayon */ 322*79629b1aSNicolas Le Bayon 323*79629b1aSNicolas Le Bayon uint32_t wdqsext; /* 324*79629b1aSNicolas Le Bayon * Enable Write DQS Extension feature of PHY. 325*79629b1aSNicolas Le Bayon * 326*79629b1aSNicolas Le Bayon * Value | Description 327*79629b1aSNicolas Le Bayon * ----- | ------ 328*79629b1aSNicolas Le Bayon * 0x0 | Disable Write DQS Extension feature. (default) 329*79629b1aSNicolas Le Bayon * 0x1 | Enable Write DQS Extension feature. 330*79629b1aSNicolas Le Bayon */ 331*79629b1aSNicolas Le Bayon 332*79629b1aSNicolas Le Bayon uint32_t calinterval; /* 333*79629b1aSNicolas Le Bayon * Specifies the interval between successive calibrations, 334*79629b1aSNicolas Le Bayon * in mS. 335*79629b1aSNicolas Le Bayon * Program variable based on desired setting for 336*79629b1aSNicolas Le Bayon * CalRate.CalInterval register. 337*79629b1aSNicolas Le Bayon * - Fixed 0x9 value (20mS interval) 338*79629b1aSNicolas Le Bayon */ 339*79629b1aSNicolas Le Bayon 340*79629b1aSNicolas Le Bayon uint32_t calonce; /* 341*79629b1aSNicolas Le Bayon * This setting changes the behaviour of CalRun register. 342*79629b1aSNicolas Le Bayon * If you desire to manually trigger impedance calibration 343*79629b1aSNicolas Le Bayon * in mission mode set this variable to 1, and toggle CalRun 344*79629b1aSNicolas Le Bayon * in mission mode. 345*79629b1aSNicolas Le Bayon * 346*79629b1aSNicolas Le Bayon * Value | Description 347*79629b1aSNicolas Le Bayon * ----- | ------ 348*79629b1aSNicolas Le Bayon * 0x0 | Calibration will proceed at the rate determined 349*79629b1aSNicolas Le Bayon * | by CalInterval. This field should only be changed 350*79629b1aSNicolas Le Bayon * | while the calibrator is idle. ie before csr 351*79629b1aSNicolas Le Bayon * | CalRun is set. 352*79629b1aSNicolas Le Bayon */ 353*79629b1aSNicolas Le Bayon 354*79629b1aSNicolas Le Bayon uint32_t lp4rl; /* 355*79629b1aSNicolas Le Bayon * LPDDR4 Dram Read Latency. 356*79629b1aSNicolas Le Bayon * Applicable only if dramtype == LPDDR4. 357*79629b1aSNicolas Le Bayon * This variable is used to calculate LPDDR4 mr2-OP[2:0] 358*79629b1aSNicolas Le Bayon * set in the messageBlock. 359*79629b1aSNicolas Le Bayon * The training firmware will set DRAM MR according to MR 360*79629b1aSNicolas Le Bayon * value in the messageBlock at the end of training. 361*79629b1aSNicolas Le Bayon * Please refer to JEDEC JESD209-4A (LPDDR4) Spec for 362*79629b1aSNicolas Le Bayon * definition of MR. 363*79629b1aSNicolas Le Bayon * Determine values based on your DRAM part's supported 364*79629b1aSNicolas Le Bayon * speed and latency bin. 365*79629b1aSNicolas Le Bayon * Default: calculated based on user_input_basic.frequency 366*79629b1aSNicolas Le Bayon * and "JEDEC JESD209-4A (LPDDR4)" Table 28 "Read and Write 367*79629b1aSNicolas Le Bayon * Latencies". 368*79629b1aSNicolas Le Bayon * Lowest latency selected when more than one latency can be 369*79629b1aSNicolas Le Bayon * used. For example given configuration for LPDDR4, x16, 370*79629b1aSNicolas Le Bayon * NoDbi and DDR533, RL=10 is selected rather than 14. 371*79629b1aSNicolas Le Bayon */ 372*79629b1aSNicolas Le Bayon 373*79629b1aSNicolas Le Bayon uint32_t lp4wl; /* 374*79629b1aSNicolas Le Bayon * LPDDR4 Dram Write Latency. 375*79629b1aSNicolas Le Bayon * Applicable only if dramtype == LPDDR4. 376*79629b1aSNicolas Le Bayon * This variable is used to calculate LPDDR4 mr2-OP[5:3] 377*79629b1aSNicolas Le Bayon * set in the messageBlock. 378*79629b1aSNicolas Le Bayon * The training firmware will set DRAM MR according to MR 379*79629b1aSNicolas Le Bayon * value in the messageBlock at the end of training. 380*79629b1aSNicolas Le Bayon * Please refer to JEDEC JESD209-4A (LPDDR4) Spec for 381*79629b1aSNicolas Le Bayon * definition of MR. 382*79629b1aSNicolas Le Bayon * Determine values based on your DRAM part's supported 383*79629b1aSNicolas Le Bayon * speed and latency bin. 384*79629b1aSNicolas Le Bayon * Default: calculated based on user_input_basic.frequency 385*79629b1aSNicolas Le Bayon * and "JEDEC JESD209-4A (LPDDR4)" Table 28 "Read and Write 386*79629b1aSNicolas Le Bayon * Latencies". 387*79629b1aSNicolas Le Bayon * Lowest latency selected when more than one latency can be 388*79629b1aSNicolas Le Bayon * used. 389*79629b1aSNicolas Le Bayon */ 390*79629b1aSNicolas Le Bayon 391*79629b1aSNicolas Le Bayon uint32_t lp4wls; /* 392*79629b1aSNicolas Le Bayon * LPDDR4 Dram WL Set. 393*79629b1aSNicolas Le Bayon * Applicable only if dramtype == LPDDR4. 394*79629b1aSNicolas Le Bayon * This variable is used to calculate LPDDR4 mr2-OP[6] set 395*79629b1aSNicolas Le Bayon * in the messageBlock. 396*79629b1aSNicolas Le Bayon * The training firmware will set DRAM MR according to MR 397*79629b1aSNicolas Le Bayon * value in the messageBlock at the end of training. 398*79629b1aSNicolas Le Bayon * Please refer to JEDEC JESD209-4A (LPDDR4) Spec for 399*79629b1aSNicolas Le Bayon * definition of MR. 400*79629b1aSNicolas Le Bayon * Determine value based on Memory controllers requirement 401*79629b1aSNicolas Le Bayon * of DRAM State after PHY training. 402*79629b1aSNicolas Le Bayon * 403*79629b1aSNicolas Le Bayon * Value | Description 404*79629b1aSNicolas Le Bayon * --- | --- 405*79629b1aSNicolas Le Bayon * 0x0 | WL Set "A" (default) 406*79629b1aSNicolas Le Bayon */ 407*79629b1aSNicolas Le Bayon 408*79629b1aSNicolas Le Bayon uint32_t lp4dbird; /* 409*79629b1aSNicolas Le Bayon * LPDDR4 Dram DBI-Read Enable. 410*79629b1aSNicolas Le Bayon * Applicable only if dramtype == LPDDR4. 411*79629b1aSNicolas Le Bayon * Determine if you require to using DBI for the given 412*79629b1aSNicolas Le Bayon * PState. 413*79629b1aSNicolas Le Bayon * If Read DBI is not used PHY receivers are turned off to 414*79629b1aSNicolas Le Bayon * save power. 415*79629b1aSNicolas Le Bayon * This variable is used to calculate LPDDR4 mr3-OP[6] set 416*79629b1aSNicolas Le Bayon * in the messageBlock. 417*79629b1aSNicolas Le Bayon * The training firmware will set DRAM MR according to MR 418*79629b1aSNicolas Le Bayon * value in the messageBlock at the end of training. 419*79629b1aSNicolas Le Bayon * PHY register DMIPinPresent is programmed based on this 420*79629b1aSNicolas Le Bayon * parameter. 421*79629b1aSNicolas Le Bayon * Please refer to JEDEC JESD209-4A (LPDDR4) Spec for 422*79629b1aSNicolas Le Bayon * definition of MR. 423*79629b1aSNicolas Le Bayon * 424*79629b1aSNicolas Le Bayon * Value | Description 425*79629b1aSNicolas Le Bayon * --- | --- 426*79629b1aSNicolas Le Bayon * 0x0 | Disabled (default) 427*79629b1aSNicolas Le Bayon * 0x1 | Enabled 428*79629b1aSNicolas Le Bayon */ 429*79629b1aSNicolas Le Bayon 430*79629b1aSNicolas Le Bayon uint32_t lp4dbiwr; /* 431*79629b1aSNicolas Le Bayon * LPDDR4 Dram DBI-Write Enable. 432*79629b1aSNicolas Le Bayon * Applicable only if dramtype == LPDDR4. 433*79629b1aSNicolas Le Bayon * This variable is used to calculate LPDDR4 mr3-OP[7] set 434*79629b1aSNicolas Le Bayon * in the messageBlock. 435*79629b1aSNicolas Le Bayon * The training firmware will set DRAM MR according to MR 436*79629b1aSNicolas Le Bayon * value in the messageBlock at the end of training. 437*79629b1aSNicolas Le Bayon * Please refer to JEDEC JESD209-4A (LPDDR4) Spec for 438*79629b1aSNicolas Le Bayon * definition of MR. 439*79629b1aSNicolas Le Bayon * 440*79629b1aSNicolas Le Bayon * Value | Description 441*79629b1aSNicolas Le Bayon * --- | --- 442*79629b1aSNicolas Le Bayon * 0x0 | Disabled (default) 443*79629b1aSNicolas Le Bayon * 0x1 | Enabled 444*79629b1aSNicolas Le Bayon */ 445*79629b1aSNicolas Le Bayon 446*79629b1aSNicolas Le Bayon uint32_t lp4nwr; /* 447*79629b1aSNicolas Le Bayon * LPDDR4 Write-Recovery for Auto- Pre-charge commands. 448*79629b1aSNicolas Le Bayon * Applicable only if dramtype == LPDDR4. 449*79629b1aSNicolas Le Bayon * This variable is used to calculate LPDDR4 mr1-OP[6:4] set 450*79629b1aSNicolas Le Bayon * in the messageBlock. 451*79629b1aSNicolas Le Bayon * The training firmware will set DRAM MR according to MR 452*79629b1aSNicolas Le Bayon * value in the messageBlock at the end of training. 453*79629b1aSNicolas Le Bayon * Please refer to JEDEC JESD209-4A (LPDDR4) Spec for 454*79629b1aSNicolas Le Bayon * definition of MR. 455*79629b1aSNicolas Le Bayon * Determine values based on your DRAM part's supported 456*79629b1aSNicolas Le Bayon * speed and latency bin. 457*79629b1aSNicolas Le Bayon * Default: calculated based on user_input_basic.frequency 458*79629b1aSNicolas Le Bayon * and "JEDEC JESD209-4A (LPDDR4)" Table 28 "Read and Write 459*79629b1aSNicolas Le Bayon * Latencies". 460*79629b1aSNicolas Le Bayon * Lowest latency selected when more than one latency can be 461*79629b1aSNicolas Le Bayon * used. 462*79629b1aSNicolas Le Bayon * 463*79629b1aSNicolas Le Bayon * Binary Value | Description 464*79629b1aSNicolas Le Bayon * --- | --- 465*79629b1aSNicolas Le Bayon * 000 | nWR = 6 (default) 466*79629b1aSNicolas Le Bayon * 001 | nWR = 10 467*79629b1aSNicolas Le Bayon * 010 | nWR = 16 468*79629b1aSNicolas Le Bayon * 011 | nWR = 20 469*79629b1aSNicolas Le Bayon * 100 | nWR = 24 470*79629b1aSNicolas Le Bayon * 101 | nWR = 30 471*79629b1aSNicolas Le Bayon * 110 | nWR = 34 472*79629b1aSNicolas Le Bayon * 111 | nWR = 40 473*79629b1aSNicolas Le Bayon */ 474*79629b1aSNicolas Le Bayon 475*79629b1aSNicolas Le Bayon uint32_t lp4lowpowerdrv; /* 476*79629b1aSNicolas Le Bayon * Configure output Driver in Low power mode. 477*79629b1aSNicolas Le Bayon * Feature only supported for Hard Macro Family E (HME). 478*79629b1aSNicolas Le Bayon * Use NMOS Pull-up for Low-Power IO. 479*79629b1aSNicolas Le Bayon * Not valid here 480*79629b1aSNicolas Le Bayon */ 481*79629b1aSNicolas Le Bayon 482*79629b1aSNicolas Le Bayon uint32_t drambyteswap; /* 483*79629b1aSNicolas Le Bayon * DRAM Oscillator count source mapping for skip_training. 484*79629b1aSNicolas Le Bayon * The PHY supports swapping of DRAM oscillator count values 485*79629b1aSNicolas Le Bayon * between paired DBytes for the purpose of tDQSDQ DRAM 486*79629b1aSNicolas Le Bayon * Drift Compensation(DDC). 487*79629b1aSNicolas Le Bayon * Each DByte has a register bit to control the source of 488*79629b1aSNicolas Le Bayon * the oscillator count value used to perform tDQSDQ Drift 489*79629b1aSNicolas Le Bayon * compensation. 490*79629b1aSNicolas Le Bayon * On silicon the training firmware will determine the DByte 491*79629b1aSNicolas Le Bayon * swap and program PptCtlStatic register to select 492*79629b1aSNicolas Le Bayon * oscillator count source. When skip_train is used, 493*79629b1aSNicolas Le Bayon * training firmware is skipped thus manual programming may 494*79629b1aSNicolas Le Bayon * be required depending on configuration. 495*79629b1aSNicolas Le Bayon * The default hardware configuration is for odd Dbyte 496*79629b1aSNicolas Le Bayon * instance n to use oscillator count values from its paired 497*79629b1aSNicolas Le Bayon * Dbyte instance n-1. So Dbyte1 will use the oscillator 498*79629b1aSNicolas Le Bayon * count values from Dbyte0, Dbyte3 will use Dbyte2 and so 499*79629b1aSNicolas Le Bayon * on. This is required for DRAM Data width =16. 500*79629b1aSNicolas Le Bayon * Each bit of this field corresponds to a DBYTE: 501*79629b1aSNicolas Le Bayon * - bit-0 = setting for DBYTE0 502*79629b1aSNicolas Le Bayon * - bit-1 = setting for DBYTE1 503*79629b1aSNicolas Le Bayon * - bit-2 = setting for DBYTE2 504*79629b1aSNicolas Le Bayon * - . . . 505*79629b1aSNicolas Le Bayon * - bit-n = setting for DBYTEn 506*79629b1aSNicolas Le Bayon * By setting the associated bit for each DByte to 1, PHY 507*79629b1aSNicolas Le Bayon * will use non-default source for count value. 508*79629b1aSNicolas Le Bayon * - for even Dbytes, non-default source is to use the odd 509*79629b1aSNicolas Le Bayon * pair count value. 510*79629b1aSNicolas Le Bayon * - for odd Dbytes, no-default source to use data 511*79629b1aSNicolas Le Bayon * received directly from the DRAM. 512*79629b1aSNicolas Le Bayon * Byte swapping must be the same across different ranks. 513*79629b1aSNicolas Le Bayon * Default value: 0x0 514*79629b1aSNicolas Le Bayon * If Byte mode devices are indicated via the x8mode 515*79629b1aSNicolas Le Bayon * messageBlock parameter, this variable is ignored as PHY 516*79629b1aSNicolas Le Bayon * only supports a limited configuration set based on Byte 517*79629b1aSNicolas Le Bayon * mode configuration. 518*79629b1aSNicolas Le Bayon * 519*79629b1aSNicolas Le Bayon * Example: 520*79629b1aSNicolas Le Bayon * DramByteSwap = 0x03 - Dbyte0: use count values from 521*79629b1aSNicolas Le Bayon * Dbyte1, Dbyte1 uses count values received directly 522*79629b1aSNicolas Le Bayon * received from DRAM. 523*79629b1aSNicolas Le Bayon * Rest of Dbytes have default source for DRAM oscilator 524*79629b1aSNicolas Le Bayon * count. 525*79629b1aSNicolas Le Bayon */ 526*79629b1aSNicolas Le Bayon 527*79629b1aSNicolas Le Bayon uint32_t rxenbackoff; /* 528*79629b1aSNicolas Le Bayon * Determines the Placement of PHY Read Gate signal. 529*79629b1aSNicolas Le Bayon * Only used in LPDDR4 when lp4rxpreamblemode==0 (static 530*79629b1aSNicolas Le Bayon * preamble) for skip_train==true. 531*79629b1aSNicolas Le Bayon * For other dramtypes or LPDDR4-toggling-preamble no 532*79629b1aSNicolas Le Bayon * options are available and PhyInit will set position as 533*79629b1aSNicolas Le Bayon * required. See source code in 534*79629b1aSNicolas Le Bayon * ddrphy_phyinit_c_initphyconfig() to see how the 535*79629b1aSNicolas Le Bayon * RxEnBackOff register is set. 536*79629b1aSNicolas Le Bayon * For skip_train==false, FW will set the position based on 537*79629b1aSNicolas Le Bayon * Preamble. 538*79629b1aSNicolas Le Bayon * We recommend keeping this setting at default value. 539*79629b1aSNicolas Le Bayon * SI analysis is required to determine if default value 540*79629b1aSNicolas Le Bayon * needs to be changed. 541*79629b1aSNicolas Le Bayon * 542*79629b1aSNicolas Le Bayon * Value | Description 543*79629b1aSNicolas Le Bayon * ----- | --- 544*79629b1aSNicolas Le Bayon * 0x1 | Position read gate 1UI from the first valid edge 545*79629b1aSNicolas Le Bayon * | of DQS_t (LPDDR4 Static preamble only) (default) 546*79629b1aSNicolas Le Bayon */ 547*79629b1aSNicolas Le Bayon 548*79629b1aSNicolas Le Bayon uint32_t trainsequencectrl; /* 549*79629b1aSNicolas Le Bayon * Firmware Training Sequence Control. 550*79629b1aSNicolas Le Bayon * This input is used to program sequencectrl in 551*79629b1aSNicolas Le Bayon * messageBlock. 552*79629b1aSNicolas Le Bayon * It controls the training stages executed by firmware. 553*79629b1aSNicolas Le Bayon * For production silicon we recommend to use default value 554*79629b1aSNicolas Le Bayon * programmed by PhyInit. 555*79629b1aSNicolas Le Bayon */ 556*79629b1aSNicolas Le Bayon 557*79629b1aSNicolas Le Bayon uint32_t snpsumctlopt; /* 558*79629b1aSNicolas Le Bayon * Enable Fast Frequency Change (FFC) Optimizations 559*79629b1aSNicolas Le Bayon * specific to UMCTL2 (DDRCTRL). 560*79629b1aSNicolas Le Bayon * Not valid for dimmtype=NODIMM. 561*79629b1aSNicolas Le Bayon * Consult DDRCTRL documentation in Reference Manual to 562*79629b1aSNicolas Le Bayon * ensure when optimizations can be enabled. 563*79629b1aSNicolas Le Bayon * 564*79629b1aSNicolas Le Bayon * Value | Description 565*79629b1aSNicolas Le Bayon * ----- | --- 566*79629b1aSNicolas Le Bayon * 0 | Disable FFC MRW optimization (default) 567*79629b1aSNicolas Le Bayon */ 568*79629b1aSNicolas Le Bayon 569*79629b1aSNicolas Le Bayon uint32_t snpsumctlf0rc5x; /* 570*79629b1aSNicolas Le Bayon * F0RX5x RCD Control Word when using Fast Frequency 571*79629b1aSNicolas Le Bayon * Change(FFC) optimizations specific to UMCTL2 572*79629b1aSNicolas Le Bayon * Not valid for dimmtype=NODIMM. 573*79629b1aSNicolas Le Bayon * Only valid for when SnpsUmctlOpt=1. 574*79629b1aSNicolas Le Bayon * When UMCTL2 optimizations are enabled PHY will perform 575*79629b1aSNicolas Le Bayon * RCD MRW during fast frequency change request. 576*79629b1aSNicolas Le Bayon * The correct RCD control word value for each PState must 577*79629b1aSNicolas Le Bayon * be programmed in this field. 578*79629b1aSNicolas Le Bayon * Consult the RCD spec and UMCTL documentation to 579*79629b1aSNicolas Le Bayon * determine the correct value based on DRAM configuration 580*79629b1aSNicolas Le Bayon * and operating speed. 581*79629b1aSNicolas Le Bayon */ 582*79629b1aSNicolas Le Bayon 583*79629b1aSNicolas Le Bayon uint32_t txslewrisedq; /* 584*79629b1aSNicolas Le Bayon * Pull-up slew rate control for DBYTE Tx. 585*79629b1aSNicolas Le Bayon * Value specified here will be written to register 586*79629b1aSNicolas Le Bayon * TxSlewRate.TxPreP by PhyInit. 587*79629b1aSNicolas Le Bayon * See register description for more information. 588*79629b1aSNicolas Le Bayon */ 589*79629b1aSNicolas Le Bayon 590*79629b1aSNicolas Le Bayon uint32_t txslewfalldq; /* 591*79629b1aSNicolas Le Bayon * Pull-down slew rate control for DBYTE Tx. 592*79629b1aSNicolas Le Bayon * Value specified here will be written to 593*79629b1aSNicolas Le Bayon * TxSlewRate.TxPreN by PhyInit. 594*79629b1aSNicolas Le Bayon * See register description for more information. 595*79629b1aSNicolas Le Bayon */ 596*79629b1aSNicolas Le Bayon 597*79629b1aSNicolas Le Bayon uint32_t txslewriseac; /* 598*79629b1aSNicolas Le Bayon * Pull-up slew rate control for ANIB Tx. 599*79629b1aSNicolas Le Bayon * Value specified here will be written to 600*79629b1aSNicolas Le Bayon * ATxSlewRate.ATxPreP. 601*79629b1aSNicolas Le Bayon * See register description for more information. 602*79629b1aSNicolas Le Bayon */ 603*79629b1aSNicolas Le Bayon 604*79629b1aSNicolas Le Bayon uint32_t txslewfallac; /* 605*79629b1aSNicolas Le Bayon * Pull-down slew rate control for ANIB Tx. 606*79629b1aSNicolas Le Bayon * Value specified here will be written to 607*79629b1aSNicolas Le Bayon * ATxSlewRate.ATxPreN. 608*79629b1aSNicolas Le Bayon * See register description for more information. 609*79629b1aSNicolas Le Bayon */ 610*79629b1aSNicolas Le Bayon 611*79629b1aSNicolas Le Bayon uint32_t disableretraining; /* 612*79629b1aSNicolas Le Bayon * Disable PHY DRAM Drift compensation re-training. 613*79629b1aSNicolas Le Bayon * Only applied to LPDDR4. No retraining is required in 614*79629b1aSNicolas Le Bayon * DDR4/3. 615*79629b1aSNicolas Le Bayon * Disable PHY re-training during DFI frequency change 616*79629b1aSNicolas Le Bayon * requests in LPDDR4. 617*79629b1aSNicolas Le Bayon * The purpose of retraining is to compensate for drift in 618*79629b1aSNicolas Le Bayon * the DRAM. 619*79629b1aSNicolas Le Bayon * Determine based on SI analysis and DRAM datasheet if 620*79629b1aSNicolas Le Bayon * retraining can be disabled. 621*79629b1aSNicolas Le Bayon * 622*79629b1aSNicolas Le Bayon * Value | Description 623*79629b1aSNicolas Le Bayon * ----- | --- 624*79629b1aSNicolas Le Bayon * 0x1 | Disable retraining 625*79629b1aSNicolas Le Bayon * 0x0 | Enable retraining 626*79629b1aSNicolas Le Bayon */ 627*79629b1aSNicolas Le Bayon 628*79629b1aSNicolas Le Bayon uint32_t disablephyupdate; /* 629*79629b1aSNicolas Le Bayon * Disable DFI PHY Update feature. 630*79629b1aSNicolas Le Bayon * Only effects LPDDR4. 631*79629b1aSNicolas Le Bayon * Disable DFI PHY Update feature. When set PHY will not 632*79629b1aSNicolas Le Bayon * assert dfi0/1_phyupd_req. 633*79629b1aSNicolas Le Bayon * 634*79629b1aSNicolas Le Bayon * Value | Description 635*79629b1aSNicolas Le Bayon * ----- | --- 636*79629b1aSNicolas Le Bayon * 0x1 | Disable DFI PHY Update 637*79629b1aSNicolas Le Bayon * 0x0 | Enable DFI PHY Update 638*79629b1aSNicolas Le Bayon */ 639*79629b1aSNicolas Le Bayon 640*79629b1aSNicolas Le Bayon uint32_t enablehighclkskewfix; /* 641*79629b1aSNicolas Le Bayon * Enable alternative PIE program. 642*79629b1aSNicolas Le Bayon * If enabled the PIE reinitializes the FIFO pointers a 643*79629b1aSNicolas Le Bayon * second time due for designs with large skew between 644*79629b1aSNicolas Le Bayon * chiplet DfiClk branches. If enabled PIE latencies in all 645*79629b1aSNicolas Le Bayon * protocols are increased by 60 DfiClks. 646*79629b1aSNicolas Le Bayon * 647*79629b1aSNicolas Le Bayon * Value | Description 648*79629b1aSNicolas Le Bayon * ----- | --- 649*79629b1aSNicolas Le Bayon * 0x0 | Disable (default) 650*79629b1aSNicolas Le Bayon */ 651*79629b1aSNicolas Le Bayon 652*79629b1aSNicolas Le Bayon uint32_t disableunusedaddrlns; /* 653*79629b1aSNicolas Le Bayon * Turn off or tristate Address Lanes when possible. 654*79629b1aSNicolas Le Bayon * 655*79629b1aSNicolas Le Bayon * When enabled, PHY will tristate unused address lanes to 656*79629b1aSNicolas Le Bayon * save power when possible by using Acx4AnibDis and 657*79629b1aSNicolas Le Bayon * AForceTriCont registers. 658*79629b1aSNicolas Le Bayon * This feature is only implemented for the default PHY 659*79629b1aSNicolas Le Bayon * Address bump mapping and Ranks must be populated in 660*79629b1aSNicolas Le Bayon * order. ie Rank1 cannot be used if Rank0 is unpopulated. 661*79629b1aSNicolas Le Bayon * For alternative bump mapping follow the following 662*79629b1aSNicolas Le Bayon * guideline to achieve maximum power savings: 663*79629b1aSNicolas Le Bayon * - For each unused BP_A bump program AForceTriCont[4:0] 664*79629b1aSNicolas Le Bayon * bits based on register description. 665*79629b1aSNicolas Le Bayon * - if all lanes of an Anib are unused _AND_ ANIB is not 666*79629b1aSNicolas Le Bayon * the first or last instance set bit associated with 667*79629b1aSNicolas Le Bayon * the instance in Acs4AnibDis registers. see register 668*79629b1aSNicolas Le Bayon * description for details. 669*79629b1aSNicolas Le Bayon * 670*79629b1aSNicolas Le Bayon * Value | Description 671*79629b1aSNicolas Le Bayon * ----- | --- 672*79629b1aSNicolas Le Bayon * 0x1 | Enable 673*79629b1aSNicolas Le Bayon */ 674*79629b1aSNicolas Le Bayon 675*79629b1aSNicolas Le Bayon uint32_t phyinitsequencenum; /* 676*79629b1aSNicolas Le Bayon * Switches between supported phyinit training sequences. 677*79629b1aSNicolas Le Bayon * 678*79629b1aSNicolas Le Bayon * Value | Description 679*79629b1aSNicolas Le Bayon * ----- | --- 680*79629b1aSNicolas Le Bayon * 0x0 | Minimizes number of Imem/Dmem loads (default) 681*79629b1aSNicolas Le Bayon */ 682*79629b1aSNicolas Le Bayon 683*79629b1aSNicolas Le Bayon uint32_t enabledficspolarityfix;/* 684*79629b1aSNicolas Le Bayon * Enable alternative PIE program. 685*79629b1aSNicolas Le Bayon * Set to 1 if PUB_VERSION <2.43a, otherwise set to 0. If 686*79629b1aSNicolas Le Bayon * enabled the PIE programs Dfi{Rd,Wr}DataCsDestMap CSR's 687*79629b1aSNicolas Le Bayon * to default values 0x00E4 before running PPT. 688*79629b1aSNicolas Le Bayon * Before exiting PPT, PIE will restore 689*79629b1aSNicolas Le Bayon * Dfi{Rd,Wr}DataCsDestMap CSR's to 0x00E1. 690*79629b1aSNicolas Le Bayon * 691*79629b1aSNicolas Le Bayon * Value | Description 692*79629b1aSNicolas Le Bayon * ----- | --- 693*79629b1aSNicolas Le Bayon * 0x0 | Disable (default) 694*79629b1aSNicolas Le Bayon */ 695*79629b1aSNicolas Le Bayon 696*79629b1aSNicolas Le Bayon uint32_t phyvref; /* 697*79629b1aSNicolas Le Bayon * Must be programmed with the Vref level to be used by the 698*79629b1aSNicolas Le Bayon * PHY during reads. 699*79629b1aSNicolas Le Bayon * The units of this field are a percentage of VDDQ 700*79629b1aSNicolas Le Bayon * according to the following equation: 701*79629b1aSNicolas Le Bayon * Receiver Vref = VDDQ*phyvref[6:0]/128 702*79629b1aSNicolas Le Bayon * For example to set Vref at 0.75*VDDQ, set this field to 703*79629b1aSNicolas Le Bayon * 0x60. 704*79629b1aSNicolas Le Bayon * For digital simulation, any legal value can be used. For 705*79629b1aSNicolas Le Bayon * silicon, the users must calculate the analytical Vref by 706*79629b1aSNicolas Le Bayon * using the impedances, terminations, and series resistance 707*79629b1aSNicolas Le Bayon * present in the system. 708*79629b1aSNicolas Le Bayon */ 709*79629b1aSNicolas Le Bayon 710*79629b1aSNicolas Le Bayon uint32_t sequencectrl; /* 711*79629b1aSNicolas Le Bayon * Controls the training steps to be run. Each bit 712*79629b1aSNicolas Le Bayon * corresponds to a training step. 713*79629b1aSNicolas Le Bayon * If the bit is set to 1, the training step will run. 714*79629b1aSNicolas Le Bayon * If the bit is set to 0, the training step will be 715*79629b1aSNicolas Le Bayon * skipped. 716*79629b1aSNicolas Le Bayon * Training step to bit mapping: 717*79629b1aSNicolas Le Bayon * sequencectrl[0] = Run DevInit - Device/phy 718*79629b1aSNicolas Le Bayon * initialization. Should always be set. 719*79629b1aSNicolas Le Bayon * sequencectrl[1] = Run WrLvl - Write leveling 720*79629b1aSNicolas Le Bayon * sequencectrl[2] = Run RxEn - Read gate training 721*79629b1aSNicolas Le Bayon * sequencectrl[3] = Run RdDQS1D - 1d read dqs training 722*79629b1aSNicolas Le Bayon * sequencectrl[4] = Run WrDQ1D - 1d write dq training 723*79629b1aSNicolas Le Bayon * sequencectrl[5] = RFU, must be zero 724*79629b1aSNicolas Le Bayon * sequencectrl[6] = RFU, must be zero 725*79629b1aSNicolas Le Bayon * sequencectrl[7] = RFU, must be zero 726*79629b1aSNicolas Le Bayon * sequencectrl[8] = Run RdDeskew - Per lane read dq deskew 727*79629b1aSNicolas Le Bayon * training 728*79629b1aSNicolas Le Bayon * sequencectrl[9] = Run MxRdLat - Max read latency training 729*79629b1aSNicolas Le Bayon * sequencectrl[10] = RFU, must be zero 730*79629b1aSNicolas Le Bayon * sequencectrl[11] = RFU, must be zero 731*79629b1aSNicolas Le Bayon * sequencectrl[12] = RFU, must be zero 732*79629b1aSNicolas Le Bayon * sequencectrl[13] = RFU, must be zero 733*79629b1aSNicolas Le Bayon * sequencectrl[15-14] = RFU, must be zero 734*79629b1aSNicolas Le Bayon */ 735*79629b1aSNicolas Le Bayon }; 736*79629b1aSNicolas Le Bayon 737*79629b1aSNicolas Le Bayon /* 738*79629b1aSNicolas Le Bayon * Structure for mode register user inputs 739*79629b1aSNicolas Le Bayon * 740*79629b1aSNicolas Le Bayon * The following data structure must be set and completed correctly so that the PhyInit software 741*79629b1aSNicolas Le Bayon * package can accurate fill message block structure. 742*79629b1aSNicolas Le Bayon * Only some mrx are used per DDR type, on related width: 743*79629b1aSNicolas Le Bayon * - DDR3: mr0..2 are used (16-bits values) 744*79629b1aSNicolas Le Bayon * - DDR4: mr0..6 are used (16-bits values) 745*79629b1aSNicolas Le Bayon * - LPDDR4: mr1..4 and mr11..22 are used (8-bits values) 746*79629b1aSNicolas Le Bayon */ 747*79629b1aSNicolas Le Bayon struct user_input_mode_register { 748*79629b1aSNicolas Le Bayon uint32_t mr0; 749*79629b1aSNicolas Le Bayon uint32_t mr1; 750*79629b1aSNicolas Le Bayon uint32_t mr2; 751*79629b1aSNicolas Le Bayon uint32_t mr3; 752*79629b1aSNicolas Le Bayon uint32_t mr4; 753*79629b1aSNicolas Le Bayon uint32_t mr5; 754*79629b1aSNicolas Le Bayon uint32_t mr6; 755*79629b1aSNicolas Le Bayon uint32_t mr11; 756*79629b1aSNicolas Le Bayon uint32_t mr12; 757*79629b1aSNicolas Le Bayon uint32_t mr13; 758*79629b1aSNicolas Le Bayon uint32_t mr14; 759*79629b1aSNicolas Le Bayon uint32_t mr22; 760*79629b1aSNicolas Le Bayon }; 761*79629b1aSNicolas Le Bayon 762*79629b1aSNicolas Le Bayon /* 763*79629b1aSNicolas Le Bayon * Structure for swizzle user inputs 764*79629b1aSNicolas Le Bayon * 765*79629b1aSNicolas Le Bayon * The following data structure must be set and completed correctly sothat the PhyInit software 766*79629b1aSNicolas Le Bayon * package can accurate set swizzle (IO muxing) config. 767*79629b1aSNicolas Le Bayon * Only some swizzles are used per DDR type: 768*79629b1aSNicolas Le Bayon * - DDR3/DDR4: swizzle 0..32 are used 769*79629b1aSNicolas Le Bayon * - 26 for hwtswizzle 770*79629b1aSNicolas Le Bayon * - 7 for acswizzle 771*79629b1aSNicolas Le Bayon * - LPDDR4: swizzle 0..43 are used 772*79629b1aSNicolas Le Bayon * - 8 per byte for dqlnsel (total 32) 773*79629b1aSNicolas Le Bayon * - 6 for mapcaatodfi 774*79629b1aSNicolas Le Bayon * - 6 for mapcabtodfi 775*79629b1aSNicolas Le Bayon */ 776*79629b1aSNicolas Le Bayon #define NB_HWT_SWIZZLE 26U 777*79629b1aSNicolas Le Bayon #define NB_AC_SWIZZLE 7U 778*79629b1aSNicolas Le Bayon #define NB_DQLNSEL_SWIZZLE_PER_BYTE 8U 779*79629b1aSNicolas Le Bayon #define NB_MAPCAATODFI_SWIZZLE 6U 780*79629b1aSNicolas Le Bayon #define NB_MAPCABTODFI_SWIZZLE 6U 781*79629b1aSNicolas Le Bayon #define NB_SWIZZLE 44 782*79629b1aSNicolas Le Bayon struct user_input_swizzle { 783*79629b1aSNicolas Le Bayon uint32_t swizzle[NB_SWIZZLE]; 784*79629b1aSNicolas Le Bayon }; 785*79629b1aSNicolas Le Bayon 786*79629b1aSNicolas Le Bayon #endif /* DDRPHY_PHYINIT_STRUCT_H */ 787