summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-08-06 20:20:29 +0200
committerKrzysztof Kozlowski <krzk@kernel.org>2020-08-19 21:10:50 +0200
commitdbd6fefb598b20714be552fae538e12302ad004c (patch)
tree1d27bbd7c387b46a643892dc7994d18ee579e100 /arch/arm/plat-samsung
parent1e574a665ed11ced475d26a783becdc40614f7ac (diff)
downloadlinux-dbd6fefb598b20714be552fae538e12302ad004c.tar.gz
linux-dbd6fefb598b20714be552fae538e12302ad004c.tar.bz2
linux-dbd6fefb598b20714be552fae538e12302ad004c.zip
ARM: samsung: make pm-debug platform independent
The pm-debug code is one of the few things shared between s3c24xx/s3c64xx and the newer s5pv210. In order to make s5pv210 independent of plat-samsung, change the common bits of this code to no longer reference the s3c specific bits. In particular, all the CPU checks need to be moved out of the common code into platform specific files. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20200806182059.2431-12-krzk@kernel.org Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r--arch/arm/plat-samsung/include/plat/pm-common.h19
-rw-r--r--arch/arm/plat-samsung/pm-debug.c16
-rw-r--r--arch/arm/plat-samsung/pm.c5
3 files changed, 22 insertions, 18 deletions
diff --git a/arch/arm/plat-samsung/include/plat/pm-common.h b/arch/arm/plat-samsung/include/plat/pm-common.h
index 467e7c867c46..87fa97fd6e8b 100644
--- a/arch/arm/plat-samsung/include/plat/pm-common.h
+++ b/arch/arm/plat-samsung/include/plat/pm-common.h
@@ -71,13 +71,24 @@ extern void s3c_pm_dbg(const char *msg, ...);
#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
-extern void s3c_pm_save_uarts(void);
-extern void s3c_pm_restore_uarts(void);
+extern void s3c_pm_save_uarts(bool is_s3c24xx);
+extern void s3c_pm_restore_uarts(bool is_s3c24xx);
+
+#ifdef CONFIG_ARCH_S3C64XX
+extern void s3c_pm_arch_update_uart(void __iomem *regs,
+ struct pm_uart_save *save);
+#else
+static inline void
+s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save)
+{
+}
+#endif
+
#else
#define S3C_PMDBG(fmt...) pr_debug(fmt)
-static inline void s3c_pm_save_uarts(void) { }
-static inline void s3c_pm_restore_uarts(void) { }
+static inline void s3c_pm_save_uarts(bool is_s3c24xx) { }
+static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { }
#endif
/* suspend memory checking */
diff --git a/arch/arm/plat-samsung/pm-debug.c b/arch/arm/plat-samsung/pm-debug.c
index 105b61f3304e..482d53753e93 100644
--- a/arch/arm/plat-samsung/pm-debug.c
+++ b/arch/arm/plat-samsung/pm-debug.c
@@ -18,14 +18,6 @@
#include <plat/cpu.h>
#include <plat/pm-common.h>
-#ifdef CONFIG_SAMSUNG_ATAGS
-#include <plat/pm.h>
-#include <mach/pm-core.h>
-#else
-static inline void s3c_pm_arch_update_uart(void __iomem *regs,
- struct pm_uart_save *save) {}
-#endif
-
static struct pm_uart_save uart_save;
extern void printascii(const char *);
@@ -52,7 +44,7 @@ static inline void __iomem *s3c_pm_uart_base(void)
return (void __iomem *)vaddr;
}
-void s3c_pm_save_uarts(void)
+void s3c_pm_save_uarts(bool is_s3c2410)
{
void __iomem *regs = s3c_pm_uart_base();
struct pm_uart_save *save = &uart_save;
@@ -63,14 +55,14 @@ void s3c_pm_save_uarts(void)
save->umcon = __raw_readl(regs + S3C2410_UMCON);
save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV);
- if (!soc_is_s3c2410())
+ if (!is_s3c2410)
save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT);
S3C_PMDBG("UART[%p]: ULCON=%04x, UCON=%04x, UFCON=%04x, UBRDIV=%04x\n",
regs, save->ulcon, save->ucon, save->ufcon, save->ubrdiv);
}
-void s3c_pm_restore_uarts(void)
+void s3c_pm_restore_uarts(bool is_s3c2410)
{
void __iomem *regs = s3c_pm_uart_base();
struct pm_uart_save *save = &uart_save;
@@ -83,6 +75,6 @@ void s3c_pm_restore_uarts(void)
__raw_writel(save->umcon, regs + S3C2410_UMCON);
__raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV);
- if (!soc_is_s3c2410())
+ if (!is_s3c2410)
__raw_writel(save->udivslot, regs + S3C2443_DIVSLOT);
}
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index b40ab7abe6a9..03c22a9dee21 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -25,6 +25,7 @@
#include <asm/irq.h>
+#include <plat/cpu.h>
#include <plat/pm.h>
#include <mach/pm-core.h>
@@ -99,7 +100,7 @@ static int s3c_pm_enter(suspend_state_t state)
samsung_pm_saved_gpios();
}
- s3c_pm_save_uarts();
+ s3c_pm_save_uarts(soc_is_s3c2410());
s3c_pm_save_core();
/* set the irq configuration for wake */
@@ -136,7 +137,7 @@ static int s3c_pm_enter(suspend_state_t state)
/* restore the system state */
s3c_pm_restore_core();
- s3c_pm_restore_uarts();
+ s3c_pm_restore_uarts(soc_is_s3c2410());
if (!of_have_populated_dt()) {
samsung_pm_restore_gpios();