All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Kukjin Kim <kgene@kernel.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Subject: [PATCH v2 12/41] ARM: samsung: make pm-debug platform independent
Date: Thu,  6 Aug 2020 20:20:29 +0200	[thread overview]
Message-ID: <20200806182059.2431-12-krzk@kernel.org> (raw)
In-Reply-To: <20200806181932.2253-1-krzk@kernel.org>

From: Arnd Bergmann <arnd@arndb.de>

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>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 arch/arm/mach-s3c24xx/include/mach/pm-core.h  |  5 --
 arch/arm/mach-s3c64xx/include/mach/pm-core.h  | 42 ----------------
 arch/arm/mach-s3c64xx/pm.c                    | 50 +++++++++++++++++++
 arch/arm/mach-s5pv210/pm.c                    |  4 +-
 .../arm/plat-samsung/include/plat/pm-common.h | 19 +++++--
 arch/arm/plat-samsung/pm-debug.c              | 16 ++----
 arch/arm/plat-samsung/pm.c                    |  5 +-
 7 files changed, 74 insertions(+), 67 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/include/mach/pm-core.h b/arch/arm/mach-s3c24xx/include/mach/pm-core.h
index cd6406820cb1..8f87606c4cdc 100644
--- a/arch/arm/mach-s3c24xx/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c24xx/include/mach/pm-core.h
@@ -77,11 +77,6 @@ static inline void s3c_pm_arch_show_resume_irqs(void)
 				s3c_irqwake_eintmask);
 }
 
-static inline void s3c_pm_arch_update_uart(void __iomem *regs,
-					   struct pm_uart_save *save)
-{
-}
-
 static inline void s3c_pm_restored_gpios(void) { }
 static inline void samsung_pm_saved_gpios(void) { }
 
diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
index 1c7d179a86f3..33cf242734a0 100644
--- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
@@ -65,48 +65,6 @@ static inline void s3c_pm_arch_show_resume_irqs(void)
 #define s3c_irqwake_intallow  0
 #endif
 
-static inline void s3c_pm_arch_update_uart(void __iomem *regs,
-					   struct pm_uart_save *save)
-{
-	u32 ucon = __raw_readl(regs + S3C2410_UCON);
-	u32 ucon_clk = ucon & S3C6400_UCON_CLKMASK;
-	u32 save_clk = save->ucon & S3C6400_UCON_CLKMASK;
-	u32 new_ucon;
-	u32 delta;
-
-	/* S3C64XX UART blocks only support level interrupts, so ensure that
-	 * when we restore unused UART blocks we force the level interrupt
-	 * settigs. */
-	save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL;
-
-	/* We have a constraint on changing the clock type of the UART
-	 * between UCLKx and PCLK, so ensure that when we restore UCON
-	 * that the CLK field is correctly modified if the bootloader
-	 * has changed anything.
-	 */
-	if (ucon_clk != save_clk) {
-		new_ucon = save->ucon;
-		delta = ucon_clk ^ save_clk;
-
-		/* change from UCLKx => wrong PCLK,
-		 * either UCLK can be tested for by a bit-test
-		 * with UCLK0 */
-		if (ucon_clk & S3C6400_UCON_UCLK0 &&
-		    !(save_clk & S3C6400_UCON_UCLK0) &&
-		    delta & S3C6400_UCON_PCLK2) {
-			new_ucon &= ~S3C6400_UCON_UCLK0;
-		} else if (delta == S3C6400_UCON_PCLK2) {
-			/* as an precaution, don't change from
-			 * PCLK2 => PCLK or vice-versa */
-			new_ucon ^= S3C6400_UCON_PCLK2;
-		}
-
-		S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n",
-			  ucon, new_ucon, save->ucon);
-		save->ucon = new_ucon;
-	}
-}
-
 static inline void s3c_pm_restored_gpios(void)
 {
 	/* ensure sleep mode has been cleared from the system */
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index fd6dbb263ed5..a612e9779057 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -305,6 +305,56 @@ static void s3c64xx_pm_prepare(void)
 	__raw_writel(__raw_readl(S3C64XX_WAKEUP_STAT), S3C64XX_WAKEUP_STAT);
 }
 
+#ifdef CONFIG_SAMSUNG_PM_DEBUG
+void s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save)
+{
+	u32 ucon;
+	u32 ucon_clk
+	u32 save_clk;
+	u32 new_ucon;
+	u32 delta;
+
+	if (!soc_is_s3c64xx())
+		return;
+
+	ucon = __raw_readl(regs + S3C2410_UCON);
+	ucon_clk = ucon & S3C6400_UCON_CLKMASK;
+	sav_clk = save->ucon & S3C6400_UCON_CLKMASK;
+
+	/* S3C64XX UART blocks only support level interrupts, so ensure that
+	 * when we restore unused UART blocks we force the level interrupt
+	 * settigs. */
+	save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL;
+
+	/* We have a constraint on changing the clock type of the UART
+	 * between UCLKx and PCLK, so ensure that when we restore UCON
+	 * that the CLK field is correctly modified if the bootloader
+	 * has changed anything.
+	 */
+	if (ucon_clk != save_clk) {
+		new_ucon = save->ucon;
+		delta = ucon_clk ^ save_clk;
+
+		/* change from UCLKx => wrong PCLK,
+		 * either UCLK can be tested for by a bit-test
+		 * with UCLK0 */
+		if (ucon_clk & S3C6400_UCON_UCLK0 &&
+		    !(save_clk & S3C6400_UCON_UCLK0) &&
+		    delta & S3C6400_UCON_PCLK2) {
+			new_ucon &= ~S3C6400_UCON_UCLK0;
+		} else if (delta == S3C6400_UCON_PCLK2) {
+			/* as an precaution, don't change from
+			 * PCLK2 => PCLK or vice-versa */
+			new_ucon ^= S3C6400_UCON_PCLK2;
+		}
+
+		S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n",
+			  ucon, new_ucon, save->ucon);
+		save->ucon = new_ucon;
+	}
+}
+#endif
+
 int __init s3c64xx_pm_init(void)
 {
 	int i;
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index 725e6746f345..efdb5a27c060 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -111,7 +111,7 @@ static int s5pv210_suspend_enter(suspend_state_t state)
 		return -EINVAL;
 	}
 
-	s3c_pm_save_uarts();
+	s3c_pm_save_uarts(false);
 	s5pv210_pm_prepare();
 	flush_cache_all();
 	s3c_pm_check_store();
@@ -120,7 +120,7 @@ static int s5pv210_suspend_enter(suspend_state_t state)
 	if (ret)
 		return ret;
 
-	s3c_pm_restore_uarts();
+	s3c_pm_restore_uarts(false);
 
 	S3C_PMDBG("%s: wakeup stat: %08x\n", __func__,
 			__raw_readl(S5P_WAKEUP_STAT));
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();
-- 
2.17.1


WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzk@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Kukjin Kim <kgene@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 12/41] ARM: samsung: make pm-debug platform independent
Date: Thu,  6 Aug 2020 20:20:29 +0200	[thread overview]
Message-ID: <20200806182059.2431-12-krzk@kernel.org> (raw)
In-Reply-To: <20200806181932.2253-1-krzk@kernel.org>

From: Arnd Bergmann <arnd@arndb.de>

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>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 arch/arm/mach-s3c24xx/include/mach/pm-core.h  |  5 --
 arch/arm/mach-s3c64xx/include/mach/pm-core.h  | 42 ----------------
 arch/arm/mach-s3c64xx/pm.c                    | 50 +++++++++++++++++++
 arch/arm/mach-s5pv210/pm.c                    |  4 +-
 .../arm/plat-samsung/include/plat/pm-common.h | 19 +++++--
 arch/arm/plat-samsung/pm-debug.c              | 16 ++----
 arch/arm/plat-samsung/pm.c                    |  5 +-
 7 files changed, 74 insertions(+), 67 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/include/mach/pm-core.h b/arch/arm/mach-s3c24xx/include/mach/pm-core.h
index cd6406820cb1..8f87606c4cdc 100644
--- a/arch/arm/mach-s3c24xx/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c24xx/include/mach/pm-core.h
@@ -77,11 +77,6 @@ static inline void s3c_pm_arch_show_resume_irqs(void)
 				s3c_irqwake_eintmask);
 }
 
-static inline void s3c_pm_arch_update_uart(void __iomem *regs,
-					   struct pm_uart_save *save)
-{
-}
-
 static inline void s3c_pm_restored_gpios(void) { }
 static inline void samsung_pm_saved_gpios(void) { }
 
diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
index 1c7d179a86f3..33cf242734a0 100644
--- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
@@ -65,48 +65,6 @@ static inline void s3c_pm_arch_show_resume_irqs(void)
 #define s3c_irqwake_intallow  0
 #endif
 
-static inline void s3c_pm_arch_update_uart(void __iomem *regs,
-					   struct pm_uart_save *save)
-{
-	u32 ucon = __raw_readl(regs + S3C2410_UCON);
-	u32 ucon_clk = ucon & S3C6400_UCON_CLKMASK;
-	u32 save_clk = save->ucon & S3C6400_UCON_CLKMASK;
-	u32 new_ucon;
-	u32 delta;
-
-	/* S3C64XX UART blocks only support level interrupts, so ensure that
-	 * when we restore unused UART blocks we force the level interrupt
-	 * settigs. */
-	save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL;
-
-	/* We have a constraint on changing the clock type of the UART
-	 * between UCLKx and PCLK, so ensure that when we restore UCON
-	 * that the CLK field is correctly modified if the bootloader
-	 * has changed anything.
-	 */
-	if (ucon_clk != save_clk) {
-		new_ucon = save->ucon;
-		delta = ucon_clk ^ save_clk;
-
-		/* change from UCLKx => wrong PCLK,
-		 * either UCLK can be tested for by a bit-test
-		 * with UCLK0 */
-		if (ucon_clk & S3C6400_UCON_UCLK0 &&
-		    !(save_clk & S3C6400_UCON_UCLK0) &&
-		    delta & S3C6400_UCON_PCLK2) {
-			new_ucon &= ~S3C6400_UCON_UCLK0;
-		} else if (delta == S3C6400_UCON_PCLK2) {
-			/* as an precaution, don't change from
-			 * PCLK2 => PCLK or vice-versa */
-			new_ucon ^= S3C6400_UCON_PCLK2;
-		}
-
-		S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n",
-			  ucon, new_ucon, save->ucon);
-		save->ucon = new_ucon;
-	}
-}
-
 static inline void s3c_pm_restored_gpios(void)
 {
 	/* ensure sleep mode has been cleared from the system */
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index fd6dbb263ed5..a612e9779057 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -305,6 +305,56 @@ static void s3c64xx_pm_prepare(void)
 	__raw_writel(__raw_readl(S3C64XX_WAKEUP_STAT), S3C64XX_WAKEUP_STAT);
 }
 
+#ifdef CONFIG_SAMSUNG_PM_DEBUG
+void s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save)
+{
+	u32 ucon;
+	u32 ucon_clk
+	u32 save_clk;
+	u32 new_ucon;
+	u32 delta;
+
+	if (!soc_is_s3c64xx())
+		return;
+
+	ucon = __raw_readl(regs + S3C2410_UCON);
+	ucon_clk = ucon & S3C6400_UCON_CLKMASK;
+	sav_clk = save->ucon & S3C6400_UCON_CLKMASK;
+
+	/* S3C64XX UART blocks only support level interrupts, so ensure that
+	 * when we restore unused UART blocks we force the level interrupt
+	 * settigs. */
+	save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL;
+
+	/* We have a constraint on changing the clock type of the UART
+	 * between UCLKx and PCLK, so ensure that when we restore UCON
+	 * that the CLK field is correctly modified if the bootloader
+	 * has changed anything.
+	 */
+	if (ucon_clk != save_clk) {
+		new_ucon = save->ucon;
+		delta = ucon_clk ^ save_clk;
+
+		/* change from UCLKx => wrong PCLK,
+		 * either UCLK can be tested for by a bit-test
+		 * with UCLK0 */
+		if (ucon_clk & S3C6400_UCON_UCLK0 &&
+		    !(save_clk & S3C6400_UCON_UCLK0) &&
+		    delta & S3C6400_UCON_PCLK2) {
+			new_ucon &= ~S3C6400_UCON_UCLK0;
+		} else if (delta == S3C6400_UCON_PCLK2) {
+			/* as an precaution, don't change from
+			 * PCLK2 => PCLK or vice-versa */
+			new_ucon ^= S3C6400_UCON_PCLK2;
+		}
+
+		S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n",
+			  ucon, new_ucon, save->ucon);
+		save->ucon = new_ucon;
+	}
+}
+#endif
+
 int __init s3c64xx_pm_init(void)
 {
 	int i;
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index 725e6746f345..efdb5a27c060 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -111,7 +111,7 @@ static int s5pv210_suspend_enter(suspend_state_t state)
 		return -EINVAL;
 	}
 
-	s3c_pm_save_uarts();
+	s3c_pm_save_uarts(false);
 	s5pv210_pm_prepare();
 	flush_cache_all();
 	s3c_pm_check_store();
@@ -120,7 +120,7 @@ static int s5pv210_suspend_enter(suspend_state_t state)
 	if (ret)
 		return ret;
 
-	s3c_pm_restore_uarts();
+	s3c_pm_restore_uarts(false);
 
 	S3C_PMDBG("%s: wakeup stat: %08x\n", __func__,
 			__raw_readl(S5P_WAKEUP_STAT));
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();
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-08-06 18:37 UTC|newest]

Thread overview: 154+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06 18:19 [PATCH v2 00/41] spi / fbdev / cpufreq / usb / mmc / hwmon / ARM: Prepare for multiplatform S3C Krzysztof Kozlowski
2020-08-06 18:19 ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 01/41] ARM: s3c: Remove unneeded machine header includes Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-19 12:15   ` Mark Brown
2020-08-19 12:15     ` Mark Brown
2020-08-19 19:02     ` Krzysztof Kozlowski
2020-08-19 19:02       ` Krzysztof Kozlowski
2020-08-19 19:17       ` Mark Brown
2020-08-19 19:17         ` Mark Brown
2020-08-20 15:39         ` Krzysztof Kozlowski
2020-08-20 15:39           ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 02/41] mmc: s3cmci: Remove unneeded machine header include Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-12 14:05   ` Ulf Hansson
2020-08-12 14:05     ` Ulf Hansson
2020-08-06 18:20 ` [PATCH v2 03/41] ARM: s3c24xx: fix mmc gpio lookup tables Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-13  8:10   ` Linus Walleij
2020-08-13  8:10     ` Linus Walleij
2020-08-06 18:20 ` [PATCH v2 04/41] ARM: s3c24xx: iotiming: make functions static Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 05/41] ARM: s3c24xx: make S3C24XX_MISCCR access indirect Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-12  7:53   ` Stephen Boyd
2020-08-12  7:53     ` Stephen Boyd
2020-08-06 18:20 ` [PATCH v2 06/41] ARM: s3c24xx: pass pointer to clk driver via platform data Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-12  7:55   ` Stephen Boyd
2020-08-12  7:55     ` Stephen Boyd
2020-08-06 18:20 ` [PATCH v2 07/41] ARM: s3c24xx: simplify mach/io.h Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 08/41] usb: gadget: s3c: use platform resources Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07 13:57   ` Felipe Balbi
2020-08-07 13:57     ` Felipe Balbi
2020-08-06 18:20 ` [PATCH v2 09/41] usb: gadget: s3c-hsudc: remove platform header dependency Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07 13:59   ` Felipe Balbi
2020-08-07 13:59     ` Felipe Balbi
2020-08-07 17:42     ` Arnd Bergmann
2020-08-07 17:42       ` Arnd Bergmann
2020-08-09  8:44       ` Krzysztof Kozlowski
2020-08-09  8:44         ` Krzysztof Kozlowski
2020-08-10 12:51       ` Felipe Balbi
2020-08-10 12:51         ` Felipe Balbi
2020-08-06 18:20 ` [PATCH v2 10/41] ARM: samsung: don't build plat/pm-common for Exynos Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 11/41] ARM: samsung: remove s3c_pm_debug_init() Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` Krzysztof Kozlowski [this message]
2020-08-06 18:20   ` [PATCH v2 12/41] ARM: samsung: make pm-debug platform independent Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 13/41] ARM: samsung: move CONFIG_DEBUG_S3C_UART to Kconfig.debug Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 14/41] ARM: exynos: use private samsung_cpu_id copy Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 15/41] ARM: exynos: stop selecting PLAT_SAMSUNG Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 16/41] ARM: samsung: move pm check code to drivers/soc Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 17/41] ARM: s5pv210: use private pm save/restore Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 18/41] ARM: s5pv210: don't imply CONFIG_PLAT_SAMSUNG Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07 11:35   ` Mark Brown
2020-08-07 11:35     ` Mark Brown
2020-08-07 11:35     ` Mark Brown
2020-08-06 18:20 ` [PATCH v2 19/41] ARM: s3c64xx: remove mach/hardware.h Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 20/41] ARM: s3c24xx: move regs-spi.h into spi driver Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07 11:34   ` Mark Brown
2020-08-07 11:34     ` Mark Brown
2020-08-06 18:20 ` [PATCH v2 21/41] ARM: s3c24xx: move irqchip driver back into platform Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07  8:01   ` Marc Zyngier
2020-08-07  8:01     ` Marc Zyngier
2020-08-06 18:20 ` [PATCH v2 22/41] ARM: s3c: adc: move header to linux/soc/samsung Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 23/41] ARM: s3c24xx: move spi fiq handler into platform Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07 11:50   ` Mark Brown
2020-08-07 11:50     ` Mark Brown
2020-08-19 19:51   ` Krzysztof Kozlowski
2020-08-19 19:51     ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 24/41] ASoC: samsung: h1940: turn into platform driver Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 25/41] ASoC: samsung: neo1973: " Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 26/41] ASoC: samsung: rx1950: " Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 27/41] ASoC: samsung: s3c2412-i2s: avoid hardcoded S3C2410_PA_IIS Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 28/41] ARM: s3c24xx: move iis pinctrl config into boards Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07 11:51   ` Mark Brown
2020-08-07 11:51     ` Mark Brown
2020-08-07 11:51     ` Mark Brown
2020-08-06 18:20 ` [PATCH v2 29/41] ARM: s3c24xx: move s3cmci pinctrl handling into board files Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 30/41] ARM: s3c24xx: include mach/irqs.h where needed Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 31/41] ARM: s3c24xx: spi: avoid hardcoding fiq number in driver Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07 11:51   ` Mark Brown
2020-08-07 11:51     ` Mark Brown
2020-08-06 18:20 ` [PATCH v2 32/41] ARM: s3c24xx: bast: avoid irq_desc array usage Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 33/41] fbdev: s3c2410fb: remove mach header dependency Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 34/41] cpufreq: s3c24xx: split out registers Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07  4:54   ` Viresh Kumar
2020-08-07  4:54     ` Viresh Kumar
2020-08-06 18:20 ` [PATCH v2 35/41] ARM: s3c: remove cpufreq header dependencies Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07  4:56   ` Viresh Kumar
2020-08-07  4:56     ` Viresh Kumar
2020-08-06 18:20 ` [PATCH v2 36/41] cpufreq: s3c2412: use global s3c2412_cpufreq_setrefresh Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07  4:57   ` Viresh Kumar
2020-08-07  4:57     ` Viresh Kumar
2020-08-06 18:20 ` [PATCH v2 37/41] cpufreq: s3c24xx: move low-level clk reg access into platform code Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-07  4:58   ` Viresh Kumar
2020-08-07  4:58     ` Viresh Kumar
2020-08-06 18:20 ` [PATCH v2 38/41] ARM: s3c24xx: stop including mach/hardware.h from mach/io.h Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 39/41] ARM: s3c: move into a common directory Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 40/41] ARM: s3c: make headers local if possible Krzysztof Kozlowski
2020-08-06 18:20   ` Krzysztof Kozlowski
2020-08-06 18:20 ` [PATCH v2 41/41] MAINTAINERS: Add more name matches for Samsung SoC entries Krzysztof Kozlowski
2020-08-06 21:57 ` [PATCH v2 00/41] spi / fbdev / cpufreq / usb / mmc / hwmon / ARM: Prepare for multiplatform S3C Arnd Bergmann
2020-08-06 21:57   ` Arnd Bergmann
2020-08-07 11:33 ` Mark Brown
2020-08-07 11:33   ` Mark Brown
2020-08-07 11:33   ` Mark Brown
2020-08-07 11:44   ` Krzysztof Kozlowski
2020-08-07 11:44     ` Krzysztof Kozlowski
2020-08-07 11:44     ` Krzysztof Kozlowski
2020-08-20 15:59 ` Krzysztof Kozlowski
2020-08-20 15:59   ` Krzysztof Kozlowski
2020-08-20 15:59   ` Krzysztof Kozlowski
2020-08-21 13:52   ` Bartlomiej Zolnierkiewicz
2020-08-21 13:52     ` Bartlomiej Zolnierkiewicz
2020-08-21 13:52     ` Bartlomiej Zolnierkiewicz
2020-08-21 13:52     ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200806182059.2431-12-krzk@kernel.org \
    --to=krzk@kernel.org \
    --cc=arnd@arndb.de \
    --cc=kgene@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.