diff options
author | Arnd Bergmann <arnd@arndb.de> | 2019-09-18 18:42:52 +0300 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2022-05-07 23:55:49 +0300 |
commit | fd13f8117f7a2d4054bf420ec1428e918a24a480 (patch) | |
tree | 99c55a437057e8277373a261f769577c6b27cbe3 /arch/arm/mach-pxa/smemc.c | |
parent | 5c6603e741921c75f67a724e798642ed50a6328e (diff) | |
download | linux-fd13f8117f7a2d4054bf420ec1428e918a24a480.tar.xz |
ARM: pxa: move smemc register access from clk to platform
The get_sdram_rows() and get_memclkdiv() helpers need smemc
register that are separate from the clk registers, move
them out of the clk driver, and use an extern declaration
instead.
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Link: https://lore.kernel.org/lkml/87pnielzo4.fsf@belgarion.home/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-pxa/smemc.c')
-rw-r--r-- | arch/arm/mach-pxa/smemc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c index 47b99549d616..0bbc91b9b05e 100644 --- a/arch/arm/mach-pxa/smemc.c +++ b/arch/arm/mach-pxa/smemc.c @@ -11,6 +11,7 @@ #include <linux/soc/pxa/cpu.h> #include <mach/smemc.h> +#include <linux/soc/pxa/smemc.h> #ifdef CONFIG_PM static unsigned long msc[2]; @@ -70,3 +71,11 @@ static int __init smemc_init(void) } subsys_initcall(smemc_init); #endif + +static const unsigned int df_clkdiv[4] = { 1, 2, 4, 1 }; +unsigned int pxa3xx_smemc_get_memclkdiv(void) +{ + unsigned long memclkcfg = __raw_readl(MEMCLKCFG); + + return df_clkdiv[(memclkcfg >> 16) & 0x3]; +} |