]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: emif-common: Add ecc specific emif registers
authorLokesh Vutla <lokeshvutla@ti.com>
Fri, 29 Dec 2017 06:17:47 +0000 (11:47 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 19 Jan 2018 20:49:25 +0000 (15:49 -0500)
This is a slight difference in emif_ddr_phy_status register offsets for
DRA7xx EMIF and older versions. And ecc registers are available only
in DRA7xx EMIC. Add support for this difference and ecc registers.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
arch/arm/include/asm/emif.h
arch/arm/mach-omap2/emif-common.c

index 9a46340deb318a5457cdf3c32946a115fad61ed8..a661ba9032b0d2ed2b48ce7d2d6378685dd087fa 100644 (file)
@@ -664,12 +664,27 @@ struct emif_reg_struct {
        u32 emif_prio_class_serv_map;
        u32 emif_connect_id_serv_1_map;
        u32 emif_connect_id_serv_2_map;
-       u32 padding8[5];
+       u32 padding8;
+       u32 emif_ecc_ctrl_reg;
+       u32 emif_ecc_address_range_1;
+       u32 emif_ecc_address_range_2;
+       u32 padding8_1;
        u32 emif_rd_wr_exec_thresh;
        u32 emif_cos_config;
+#if defined(CONFIG_DRA7XX) || defined(CONFIG_ARCH_KEYSTONE)
+       u32 padding9[2];
+       u32 emif_1b_ecc_err_cnt;
+       u32 emif_1b_ecc_err_thrush;
+       u32 emif_1b_ecc_err_dist_1;
+       u32 emif_1b_ecc_err_addr_log;
+       u32 emif_2b_ecc_err_addr_log;
+       u32 emif_ddr_phy_status[28];
+       u32 padding10[19];
+#else
        u32 padding9[6];
        u32 emif_ddr_phy_status[28];
        u32 padding10[20];
+#endif
        u32 emif_ddr_ext_phy_ctrl_1;
        u32 emif_ddr_ext_phy_ctrl_1_shdw;
        u32 emif_ddr_ext_phy_ctrl_2;
index def7fe0f0a85bae647d502fde2ccad04d93fc0c3..2b03dbecf4283ae377483f476aa576a4369054c6 100644 (file)
@@ -255,7 +255,7 @@ static void update_hwleveling_output(u32 base, const struct emif_regs *regs)
        u32 *emif_ext_phy_ctrl_reg, *emif_phy_status;
        u32 reg, i, phy;
 
-       emif_phy_status = (u32 *)&emif->emif_ddr_phy_status[7];
+       emif_phy_status = (u32 *)&emif->emif_ddr_phy_status[6];
        phy = readl(&emif->emif_ddr_phy_ctrl_1);
 
        /* Update PHY_REG_RDDQS_RATIO */
@@ -269,7 +269,7 @@ static void update_hwleveling_output(u32 base, const struct emif_regs *regs)
 
        /* Update PHY_REG_FIFO_WE_SLAVE_RATIO */
        emif_ext_phy_ctrl_reg = (u32 *)&emif->emif_ddr_ext_phy_ctrl_2;
-       emif_phy_status = (u32 *)&emif->emif_ddr_phy_status[12];
+       emif_phy_status = (u32 *)&emif->emif_ddr_phy_status[11];
        if (!(phy & EMIF_DDR_PHY_CTRL_1_RDLVLGATE_MASK_MASK))
                for (i = 0; i < PHY_FIFO_WE_SLAVE_RATIO_REGS; i++) {
                        reg = readl(emif_phy_status++);
@@ -279,7 +279,7 @@ static void update_hwleveling_output(u32 base, const struct emif_regs *regs)
 
        /* Update PHY_REG_WR_DQ/DQS_SLAVE_RATIO */
        emif_ext_phy_ctrl_reg = (u32 *)&emif->emif_ddr_ext_phy_ctrl_12;
-       emif_phy_status = (u32 *)&emif->emif_ddr_phy_status[17];
+       emif_phy_status = (u32 *)&emif->emif_ddr_phy_status[16];
        if (!(phy & EMIF_DDR_PHY_CTRL_1_WRLVL_MASK_MASK))
                for (i = 0; i < PHY_REG_WR_DQ_SLAVE_RATIO_REGS; i++) {
                        reg = readl(emif_phy_status++);