@@ -68,6 +68,9 @@ static int read_eeprom(struct am43xx_board_id *header)
6868 strncpy (am43xx_board_name , (char * )header -> name , sizeof (header -> name ));
6969 am43xx_board_name [sizeof (header -> name )] = 0 ;
7070
71+ strncpy (am43xx_board_rev , (char * )header -> version , sizeof (header -> version ));
72+ am43xx_board_rev [sizeof (header -> version )] = 0 ;
73+
7174 return 0 ;
7275}
7376
@@ -217,6 +220,44 @@ const struct emif_regs ddr3_emif_regs_400Mhz = {
217220 .emif_rd_wr_exec_thresh = 0x00000405
218221};
219222
223+ /* EMIF DDR3 Configurations are different for beta AM43X GP EVMs */
224+ const struct emif_regs ddr3_emif_regs_400Mhz_beta = {
225+ .sdram_config = 0x638413B2 ,
226+ .ref_ctrl = 0x00000C30 ,
227+ .sdram_tim1 = 0xEAAAD4DB ,
228+ .sdram_tim2 = 0x266B7FDA ,
229+ .sdram_tim3 = 0x107F8678 ,
230+ .read_idle_ctrl = 0x00050000 ,
231+ .zq_config = 0x50074BE4 ,
232+ .temp_alert_config = 0x0 ,
233+ .emif_ddr_phy_ctlr_1 = 0x0E004008 ,
234+ .emif_ddr_ext_phy_ctrl_1 = 0x08020080 ,
235+ .emif_ddr_ext_phy_ctrl_2 = 0x00000065 ,
236+ .emif_ddr_ext_phy_ctrl_3 = 0x00000091 ,
237+ .emif_ddr_ext_phy_ctrl_4 = 0x000000B5 ,
238+ .emif_ddr_ext_phy_ctrl_5 = 0x000000E5 ,
239+ .emif_rd_wr_exec_thresh = 0x00000405
240+ };
241+
242+ /* EMIF DDR3 Configurations are different for production AM43X GP EVMs */
243+ const struct emif_regs ddr3_emif_regs_400Mhz_production = {
244+ .sdram_config = 0x638413B2 ,
245+ .ref_ctrl = 0x00000C30 ,
246+ .sdram_tim1 = 0xEAAAD4DB ,
247+ .sdram_tim2 = 0x266B7FDA ,
248+ .sdram_tim3 = 0x107F8678 ,
249+ .read_idle_ctrl = 0x00050000 ,
250+ .zq_config = 0x50074BE4 ,
251+ .temp_alert_config = 0x0 ,
252+ .emif_ddr_phy_ctlr_1 = 0x0E004008 ,
253+ .emif_ddr_ext_phy_ctrl_1 = 0x08020080 ,
254+ .emif_ddr_ext_phy_ctrl_2 = 0x00000066 ,
255+ .emif_ddr_ext_phy_ctrl_3 = 0x00000091 ,
256+ .emif_ddr_ext_phy_ctrl_4 = 0x000000B9 ,
257+ .emif_ddr_ext_phy_ctrl_5 = 0x000000E6 ,
258+ .emif_rd_wr_exec_thresh = 0x00000405
259+ };
260+
220261static const struct emif_regs ddr3_sk_emif_regs_400Mhz = {
221262 .sdram_config = 0x638413b2 ,
222263 .sdram_config2 = 0x00000000 ,
@@ -262,6 +303,52 @@ const u32 ext_phy_ctrl_const_base_ddr3[] = {
262303 0x08102040
263304};
264305
306+ const u32 ext_phy_ctrl_const_base_ddr3_beta [] = {
307+ 0x00000000 ,
308+ 0x00000045 ,
309+ 0x00000046 ,
310+ 0x00000048 ,
311+ 0x00000047 ,
312+ 0x00000000 ,
313+ 0x0000004C ,
314+ 0x00000070 ,
315+ 0x00000085 ,
316+ 0x000000A3 ,
317+ 0x00000000 ,
318+ 0x0000000C ,
319+ 0x00000030 ,
320+ 0x00000045 ,
321+ 0x00000063 ,
322+ 0x00000000 ,
323+ 0x0 ,
324+ 0x0 ,
325+ 0x40000000 ,
326+ 0x08102040
327+ };
328+
329+ const u32 ext_phy_ctrl_const_base_ddr3_production [] = {
330+ 0x00000000 ,
331+ 0x00000044 ,
332+ 0x00000044 ,
333+ 0x00000046 ,
334+ 0x00000046 ,
335+ 0x00000000 ,
336+ 0x00000059 ,
337+ 0x00000077 ,
338+ 0x00000093 ,
339+ 0x000000A8 ,
340+ 0x00000000 ,
341+ 0x00000019 ,
342+ 0x00000037 ,
343+ 0x00000053 ,
344+ 0x00000068 ,
345+ 0x00000000 ,
346+ 0x0 ,
347+ 0x0 ,
348+ 0x40000000 ,
349+ 0x08102040
350+ };
351+
265352static const u32 ext_phy_ctrl_const_base_ddr3_sk [] = {
266353 /* first 5 are taken care by emif_regs */
267354 0x00700070 ,
@@ -309,6 +396,12 @@ void emif_get_ext_phy_ctrl_const_regs(const u32 **regs, u32 *size)
309396 if (board_is_eposevm ()) {
310397 * regs = ext_phy_ctrl_const_base_lpddr2 ;
311398 * size = ARRAY_SIZE (ext_phy_ctrl_const_base_lpddr2 );
399+ } else if (board_is_evm_14_or_later ()) {
400+ * regs = ext_phy_ctrl_const_base_ddr3_production ;
401+ * size = ARRAY_SIZE (ext_phy_ctrl_const_base_ddr3_production );
402+ } else if (board_is_evm_12_or_later ()) {
403+ * regs = ext_phy_ctrl_const_base_ddr3_beta ;
404+ * size = ARRAY_SIZE (ext_phy_ctrl_const_base_ddr3_beta );
312405 } else if (board_is_gpevm ()) {
313406 * regs = ext_phy_ctrl_const_base_ddr3 ;
314407 * size = ARRAY_SIZE (ext_phy_ctrl_const_base_ddr3 );
@@ -473,6 +566,14 @@ void sdram_init(void)
473566 */
474567 if (board_is_eposevm ()) {
475568 config_ddr (0 , & ioregs_lpddr2 , NULL , NULL , & emif_regs_lpddr2 , 0 );
569+ } else if (board_is_evm_14_or_later ()) {
570+ enable_vtt_regulator ();
571+ config_ddr (0 , & ioregs_ddr3 , NULL , NULL ,
572+ & ddr3_emif_regs_400Mhz_production , 0 );
573+ } else if (board_is_evm_12_or_later ()) {
574+ enable_vtt_regulator ();
575+ config_ddr (0 , & ioregs_ddr3 , NULL , NULL ,
576+ & ddr3_emif_regs_400Mhz_beta , 0 );
476577 } else if (board_is_gpevm ()) {
477578 enable_vtt_regulator ();
478579 config_ddr (0 , & ioregs_ddr3 , NULL , NULL ,
0 commit comments