summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Redfearn <matt.redfearn@imgtec.com>2015-08-20 11:24:37 +0300
committerMatt Redfearn <matt.redfearn@imgtec.com>2015-08-20 11:24:37 +0300
commita79229b661839b0ac55018527c79d93e130d61f1 (patch)
treea81b3fc8950eb33c242e66a526760648fa776892
parentbed765e054fe8a3b42562453e3f99939d872e21e (diff)
downloadCI20_u-boot-a79229b661839b0ac55018527c79d93e130d61f1.tar.xz
jz4780: sdram: Make PHY pullup / pulldown board specific
v1 boards with the Hynix RAM should have a different pullup impedance set to v2 boards with the Samsung RAM. This patch makes the pullup / pulldown values device specific and removes the constant from the Ci20 config Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
-rw-r--r--arch/mips/cpu/xburst/jz4780/sdram.c6
-rwxr-xr-xarch/mips/cpu/xburst/jz4780/sdram/H5TQ2G83CFR.h3
-rw-r--r--arch/mips/cpu/xburst/jz4780/sdram/K4B2G0846Q.h3
-rw-r--r--arch/mips/cpu/xburst/jz4780/sdram/ddr_parameters.h3
-rw-r--r--include/configs/ci20.h2
5 files changed, 12 insertions, 5 deletions
diff --git a/arch/mips/cpu/xburst/jz4780/sdram.c b/arch/mips/cpu/xburst/jz4780/sdram.c
index b5cedf63b..431e6f64b 100644
--- a/arch/mips/cpu/xburst/jz4780/sdram.c
+++ b/arch/mips/cpu/xburst/jz4780/sdram.c
@@ -165,12 +165,12 @@ static void ddr_phy_init(const struct jz4780_ddr_config *ddr_config)
}
}
- /* Override impedence */
+ /* Override impedance */
tmp = readl(DDRP_ZQXCR0(0));
tmp &= ~0x3ff;
- tmp |= (CONFIG_SYS_DDR3PHY_PULLUP_IMPEDANCE & 0x1f) <<
+ tmp |= (ddr_config->pullup & 0x1f) <<
DDRP_ZQXCR_PULLUP_IMPE_BIT;
- tmp |= (CONFIG_SYS_DDR3PHY_PULLDOWN_IMPEDANCE & 0x1f) <<
+ tmp |= (ddr_config->pulldn & 0x1f) <<
DDRP_ZQXCR_PULLDOWN_IMPE_BIT;
tmp |= DDRP_ZQXCR_ZDEN;
writel(tmp, DDRP_ZQXCR0(0));
diff --git a/arch/mips/cpu/xburst/jz4780/sdram/H5TQ2G83CFR.h b/arch/mips/cpu/xburst/jz4780/sdram/H5TQ2G83CFR.h
index 6fc6541d3..cb7a458cb 100755
--- a/arch/mips/cpu/xburst/jz4780/sdram/H5TQ2G83CFR.h
+++ b/arch/mips/cpu/xburst/jz4780/sdram/H5TQ2G83CFR.h
@@ -144,6 +144,9 @@ static const struct jz4780_ddr_config H5TQ2G83CFR_48_config = {
.dtpr0 = 0x2c906690,
.dtpr1 = 0x005608a0,
.dtpr2 = 0x10042a00,
+
+ .pullup = 0x0e,
+ .pulldn = 0x0e,
};
#endif /* __DDR3_H5TQ2G83CFR_CONFIG_H */
diff --git a/arch/mips/cpu/xburst/jz4780/sdram/K4B2G0846Q.h b/arch/mips/cpu/xburst/jz4780/sdram/K4B2G0846Q.h
index ab4df221e..ae1284e2c 100644
--- a/arch/mips/cpu/xburst/jz4780/sdram/K4B2G0846Q.h
+++ b/arch/mips/cpu/xburst/jz4780/sdram/K4B2G0846Q.h
@@ -145,5 +145,8 @@ static const struct jz4780_ddr_config K4B2G0846Q_48_config = {
.dtpr0 = 0x2a8f6690,
.dtpr1 = 0x00400860,
.dtpr2 = 0x10042a00,
+
+ .pullup = 0x0b,
+ .pulldn = 0x0b,
};
#endif /* __DDR3_K4B2G0846Q_CONFIG_H */
diff --git a/arch/mips/cpu/xburst/jz4780/sdram/ddr_parameters.h b/arch/mips/cpu/xburst/jz4780/sdram/ddr_parameters.h
index 68936b9ec..107b2b7ee 100644
--- a/arch/mips/cpu/xburst/jz4780/sdram/ddr_parameters.h
+++ b/arch/mips/cpu/xburst/jz4780/sdram/ddr_parameters.h
@@ -67,6 +67,9 @@ struct jz4780_ddr_config {
u32 dtpr0; /* DRAM Timing Parameters Register 0 */
u32 dtpr1; /* DRAM Timing Parameters Register 1 */
u32 dtpr2; /* DRAM Timing Parameters Register 2 */
+
+ u8 pullup; /* PHY pullup impedance */
+ u8 pulldn; /* PHY pulldown impedance */
};
diff --git a/include/configs/ci20.h b/include/configs/ci20.h
index 21d68c5ea..a1c292bb4 100644
--- a/include/configs/ci20.h
+++ b/include/configs/ci20.h
@@ -38,8 +38,6 @@
#define CONFIG_SYS_DDR3_K4B2G0846Q
#define CONFIG_SYS_MEM_SPEED CONFIG_SYS_CPU_SPEED
#define CONFIG_SYS_MEM_DIV 3
-#define CONFIG_SYS_DDR3PHY_PULLUP_IMPEDANCE 0xe
-#define CONFIG_SYS_DDR3PHY_PULLDOWN_IMPEDANCE 0xe
#define CONFIG_SYS_AUDIO_SPEED (768 * 1000000)