From 49f8eb93a0939f8ef9fb5386f6dc8ce5158fd431 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Fri, 3 Jun 2022 14:25:39 +0300 Subject: ARM: OMAP: Use EMIF4 registers for get SDRAM size 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 Link: https://lore.barebox.org/20220603112540.51644-7-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer --- 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; -- cgit v1.2.3