Hi all,
as you know, the wiki shows the DM816x SW leveling procedure
http://processors.wiki.ti.com/index.php/DM816x_C6A816x_AM389x_DDR3_Init
However with DM816x EZSDK 5.03 and 5.04 the u-boot code does not match up with the wiki anymore. Essentially I am trying to understand two things about how to modify u-boot with values from the CCS executable:
(1) The CCS program gives separate values for EMIF0 and EMIF1. How are EMIF0 and EMIF1 values entered into the u-boot code?
(2) The CCS program gives separate values for indvidual byte lanes. How are these separate byte lane values added into the u-boot code?
Here is what comes out of the CCS program for either EMIF0 or EMIF1
*********************************************************
Byte level Slave Ratio Search Program Values
*********************************************************
BYTE3 BYTE2 BYTE1 BYTE0
*********************************************************
Read DQS MAX 5d 60 78 77
Read DQS MIN 8 8 4 8
Read DQS OPT 32 34 31 38
*********************************************************
Read DQS GATE MAX 1ec 1d1 1b5 1a0
Read DQS GATE MIN 8f 7c 63 41
Read DQS GATE OPT 13d 126 10c f0
*********************************************************
Write DQS MAX 97 a3 8c 8b
Write DQS MIN 0 0 0 0
Write DQS OPT 4b 51 46 45
*********************************************************
Here is SDK 5.03. It looks like each byte lane gets the same value. It is also unclear how to enter EMIF0 vs EMIF1
#if defined(CONFIG_TI816X_DDR3_SW_LEVELING)
/* These values are obtained from the CCS app */
#define RD_DQS_GATE 0x1B3
#define RD_DQS 0x35
#define WR_DQS 0x93
#endif
#endif /* CONFIG_TI816X_DDR_796 */
#if defined(CONFIG_TI816X_DDR3_SW_LEVELING)
#define WR_DQS_RATIO_BYTE_LANE3 ((WR_DQS << 10) | WR_DQS)
#define WR_DQS_RATIO_BYTE_LANE2 ((WR_DQS << 10) | WR_DQS)
#define WR_DQS_RATIO_BYTE_LANE1 ((WR_DQS << 10) | WR_DQS)
#define WR_DQS_RATIO_BYTE_LANE0 ((WR_DQS << 10) | WR_DQS)
#define WR_DATA_RATIO_BYTE_LANE3 (((WR_DQS + 0x40) << 10) | (WR_DQS + 0x40))
#define WR_DATA_RATIO_BYTE_LANE2 (((WR_DQS + 0x40) << 10) | (WR_DQS + 0x40))
#define WR_DATA_RATIO_BYTE_LANE1 (((WR_DQS + 0x40) << 10) | (WR_DQS + 0x40))
#define WR_DATA_RATIO_BYTE_LANE0 (((WR_DQS + 0x40) << 10) | (WR_DQS + 0x40))
#define RD_DQS_RATIO ((RD_DQS << 10) | RD_DQS)
#define DQS_GATE_BYTE_LANE0 ((RD_DQS_GATE << 10) | RD_DQS_GATE)
#define DQS_GATE_BYTE_LANE1 ((RD_DQS_GATE << 10) | RD_DQS_GATE)
#define DQS_GATE_BYTE_LANE2 ((RD_DQS_GATE << 10) | RD_DQS_GATE)
#define DQS_GATE_BYTE_LANE3 ((RD_DQS_GATE << 10) | RD_DQS_GATE)
#endif /* CONFIG_TI816X_DDR3_SW_LEVELING */
Here is SDK5.04. I am thinking the first piece of code separates EMIF0 from EMIF1 (please confirm), but the second piece of code still enters the same values for each byte lane.
#if defined(CONFIG_TI816X_DDR3_SW_LEVELING)
/* These values are obtained from the CCS app */
#define RD_DQS_GATE ((emif == 0) ? 0x1B3 : 0x1B3)
#define RD_DQS ((emif == 0) ? 0x35 : 0x35)
#define WR_DQS ((emif == 0) ? 0x93 : 0x93)
#endif
#endif /* CONFIG_TI816X_DDR_796 */
#if defined(CONFIG_TI816X_DDR3_SW_LEVELING)
#define WR_DQS_RATIO_BYTE_LANE3 ((WR_DQS << 10) | WR_DQS)
#define WR_DQS_RATIO_BYTE_LANE2 ((WR_DQS << 10) | WR_DQS)
#define WR_DQS_RATIO_BYTE_LANE1 ((WR_DQS << 10) | WR_DQS)
#define WR_DQS_RATIO_BYTE_LANE0 ((WR_DQS << 10) | WR_DQS)
#define WR_DATA_RATIO_BYTE_LANE3 (((WR_DQS + 0x40) << 10) | (WR_DQS + 0x40))
#define WR_DATA_RATIO_BYTE_LANE2 (((WR_DQS + 0x40) << 10) | (WR_DQS + 0x40))
#define WR_DATA_RATIO_BYTE_LANE1 (((WR_DQS + 0x40) << 10) | (WR_DQS + 0x40))
#define WR_DATA_RATIO_BYTE_LANE0 (((WR_DQS + 0x40) << 10) | (WR_DQS + 0x40))
#define RD_DQS_RATIO ((RD_DQS << 10) | RD_DQS)
#define DQS_GATE_BYTE_LANE0 ((RD_DQS_GATE << 10) | RD_DQS_GATE)
#define DQS_GATE_BYTE_LANE1 ((RD_DQS_GATE << 10) | RD_DQS_GATE)
#define DQS_GATE_BYTE_LANE2 ((RD_DQS_GATE << 10) | RD_DQS_GATE)
#define DQS_GATE_BYTE_LANE3 ((RD_DQS_GATE << 10) | RD_DQS_GATE)
#endif /* CONFIG_TI816X_DDR3_SW_LEVELING */
#endif /* CONFIG_TI816X_EVM_DDR3 */
Could you clarify how to enter the values from the CCS program into uboot?
Could someone also update the wiki with that information?
Thanks,
--Gunter