Some A33 based boards use odt, while others do not, so make this configurable.

Signed-off-by: Hans de Goede <hdego...@redhat.com>
---
 arch/arm/cpu/armv7/sunxi/dram_sun8i_a33.c | 3 +--
 board/sunxi/Kconfig                       | 8 ++++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/sunxi/dram_sun8i_a33.c 
b/arch/arm/cpu/armv7/sunxi/dram_sun8i_a33.c
index 979bb3c..a7a0a2e 100644
--- a/arch/arm/cpu/armv7/sunxi/dram_sun8i_a33.c
+++ b/arch/arm/cpu/armv7/sunxi/dram_sun8i_a33.c
@@ -19,7 +19,6 @@
 #define DRAM_CLK_MUL 2
 #define DRAM_CLK_DIV 4
 #define DRAM_SIGMA_DELTA_ENABLE 1
-#define DRAM_ODT_EN 0
 
 struct dram_para {
        u8 cs1;
@@ -215,7 +214,7 @@ static int mctl_channel_init(struct dram_para *para)
        clrbits_le32(&mctl_ctl->pgcr0, 0x3f << 0);
 
        /* Set ODT */
-       if ((CONFIG_DRAM_CLK > 400) && DRAM_ODT_EN) {
+       if ((CONFIG_DRAM_CLK > 400) && CONFIG_DRAM_ODT_EN) {
                setbits_le32(DXnGCR0(0), 0x3 << 9);
                setbits_le32(DXnGCR0(1), 0x3 << 9);
        } else {
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 940b6c7..d4ae6c7 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -95,6 +95,14 @@ config DRAM_ZQ
        ---help---
        Set the dram zq value.
 
+if MACH_SUN8I_A33
+config DRAM_ODT_EN
+       int "sunxi dram odt enable"
+       default 0
+       ---help---
+       Set this to 1 to enable dram odt (on die termination)
+endif
+
 if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
 config DRAM_EMR1
        int "sunxi dram emr1 value"
-- 
2.4.0

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to