[RFC 7/8] ARM: OMAP: Use EMIF4 registers for get SDRAM size

Alexander Shiyan eagle.alexander923 at gmail.com
Fri Jun 3 04:25:39 PDT 2022


Instead of using the registers of the control module, we will use
the EMIF registers in am335x_sdram_size().
This can help when porting this function to other CPU variants.

Signed-off-by: Alexander Shiyan <eagle.alexander923 at gmail.com>
---
 arch/arm/mach-omap/am33xx_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c
index bdfa0e9e26..2727ebdf7f 100644
--- a/arch/arm/mach-omap/am33xx_generic.c
+++ b/arch/arm/mach-omap/am33xx_generic.c
@@ -349,9 +349,9 @@ void am33xx_config_sdram(const struct am33xx_emif_regs *regs)
  */
 unsigned long am335x_sdram_size(void)
 {
+	uint32_t sdram_config = readl(IOMEM(AM33XX_EMIF4_BASE + EMIF4_SDRAM_CONFIG));
 	int rows, cols, width, banks;
 	unsigned long size;
-	uint32_t sdram_config = readl(CM_EMIF_SDRAM_CONFIG);
 
 	rows = ((sdram_config >> 7) & 0x7) + 9;
 	cols = (sdram_config & 0x7) + 8;
-- 
2.32.0




More information about the barebox mailing list