summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZubairLK <ZubairLK@users.noreply.github.com>2015-08-20 11:28:09 +0300
committerZubairLK <ZubairLK@users.noreply.github.com>2015-08-20 11:28:09 +0300
commita64f00a7537803a436275d97a47e5201aa3e9918 (patch)
treea81b3fc8950eb33c242e66a526760648fa776892
parentb07a6684eae9c680f205e216943dfc2d8e57a3f1 (diff)
parenta79229b661839b0ac55018527c79d93e130d61f1 (diff)
downloadCI20_u-boot-a64f00a7537803a436275d97a47e5201aa3e9918.tar.xz
Merge pull request #8 from mpredfearn/ci20-v2013.10-revision-detect
jz4780: sdram: Make PHY pullup / pulldown board specific
-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)