[PATCH 02/10] ARM: i.MX51: esdctl: Replace magic value with ESDMISC_DDR2_8_BANK

Andrey Smirnov andrew.smirnov at gmail.com
Tue Apr 10 16:53:15 PDT 2018


Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
 arch/arm/mach-imx/esdctl.c              | 2 +-
 arch/arm/mach-imx/include/mach/esdctl.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index 895761e73..1d6fa2995 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -120,7 +120,7 @@ static inline unsigned long imx_v3_sdram_size(void __iomem *esdctlbase, int num)
 
 	size = imx_v2_sdram_size(esdctlbase, num);
 
-	if (readl(esdctlbase + IMX_ESDMISC) & (1 << 6))
+	if (readl(esdctlbase + IMX_ESDMISC) & ESDMISC_DDR2_8_BANK)
 		size *= 2;
 
 	if (size > SZ_256M)
diff --git a/arch/arm/mach-imx/include/mach/esdctl.h b/arch/arm/mach-imx/include/mach/esdctl.h
index 66dcc8974..53710b0f2 100644
--- a/arch/arm/mach-imx/include/mach/esdctl.h
+++ b/arch/arm/mach-imx/include/mach/esdctl.h
@@ -48,6 +48,7 @@
 #define ESDMISC_MDDR_MDIS		0x00000010
 #define ESDMISC_LHD			0x00000020
 #define ESDMISC_SDRAMRDY		0x80000000
+#define ESDMISC_DDR2_8_BANK		BIT(6)
 
 #define	ESDCFGx_tXP_MASK 		0x00600000
 #define ESDCFGx_tXP_1			0x00000000
-- 
2.14.3




More information about the barebox mailing list