Skip to contentSkip to conversation

ARM: imx: ddr: Add deskew register programming

PATCH New Marek Vasut 2 participants 2 messages Aug 5, 2020 – Aug 18, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: ddr: Add deskew register programming

Fill is code for programming the DDR_PHY_CMD_DESKEW_CONx registers, which are optional, but can be used to fill in the byte lane delays.

Cc Fabio Estevam <[email protected]>
Cc NXP i.MX U-Boot Team <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/include/asm/arch-mx7/mx7-ddr.h | 16 +++++++++++++---
 arch/arm/mach-imx/mx7/ddr.c             |  9 +++++++++
 2 files changed, 22 insertions(+), 3 deletions(-)
arch/arm/include/asm/arch-mx7/mx7-ddr.h +13 -3
index bea5dd8ec5..8ac721114c 100644
@@ -136,11 +136,21 @@ struct ddr_phy {
 	u32 offset_wr_con0;	/* 0x0030 */
 	u32 reserved5[0x07];
 	u32 cmd_sdll_con0;	/* 0x0050 */
-	u32 reserved6[0x12];
+	u32 reserved6[0x06];
+	u32 cmd_lvl_con0;	/* 0x006c */
+	u32 reserved7[0x02];
+	u32 cmd_lvl_con3;	/* 0x0078 */
+	u32 cmd_deskew_con0;	/* 0x007c */
+	u32 cmd_deskew_con1;	/* 0x0080 */
+	u32 cmd_deskew_con2;	/* 0x0084 */
+	u32 cmd_deskew_con3;	/* 0x0088 */
+	u32 reserved8[0x02];
+	u32 cmd_deskew_con4;	/* 0x0094 */
+	u32 reserved9;
 	u32 drvds_con0;		/* 0x009c */
-	u32 reserved7[0x04];
+	u32 reserved10[0x04];
 	u32 mdll_con0;		/* 0x00b0 */
-	u32 reserved8[0x03];
+	u32 reserved11[0x03];
 	u32 zq_con0;		/* 0x00c0 */
 };
 
arch/arm/mach-imx/mx7/ddr.c +9 -0
index 45954ed1ed..cf25569765 100644
@@ -106,6 +106,15 @@ void mx7_dram_cfg(struct ddrc *ddrc_regs_val, struct ddrc_mp *ddrc_mp_val,
 	       ~DDR_PHY_CMD_SDLL_CON0_CTRL_RESYNC_MASK,
 	       &ddr_phy_regs->cmd_sdll_con0);
 	writel(ddr_phy_regs_val->offset_lp_con0, &ddr_phy_regs->offset_lp_con0);
+	writel(ddr_phy_regs_val->cmd_deskew_con0,
+	       &ddr_phy_regs->cmd_deskew_con0);
+	writel(ddr_phy_regs_val->cmd_deskew_con1,
+	       &ddr_phy_regs->cmd_deskew_con1);
+	writel(ddr_phy_regs_val->cmd_deskew_con2,
+	       &ddr_phy_regs->cmd_deskew_con2);
+	writel(ddr_phy_regs_val->cmd_deskew_con3,
+	       &ddr_phy_regs->cmd_deskew_con3);
+	writel(ddr_phy_regs_val->cmd_lvl_con0, &ddr_phy_regs->cmd_lvl_con0);
 
 	/* calibration */
 	for (i = 0; i < calib_param->num_val; i++)
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/1 ARM: imx: ddr: Add deskew register programming

Quoted 7 lines

Fill is code for programming the DDR_PHY_CMD_DESKEW_CONx registers, which are optional, but can be used to fill in the byte lane delays.

Cc Fabio Estevam <[email protected]>
Cc NXP i.MX U-Boot Team <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================