All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abhilash Kesavan <a.kesavan@samsung.com>
To: linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com,
	nicolas.pitre@linaro.org
Cc: kesavan.abhilash@gmail.com, abrestic@chromium.org,
	dianders@chromium.org, Abhilash Kesavan <a.kesavan@samsung.com>
Subject: [PATCH] ARM: EXYNOS: Restore the entry address setup code post-resume
Date: Thu, 26 Jun 2014 16:28:32 +0530	[thread overview]
Message-ID: <1403780312-22885-1-git-send-email-a.kesavan@samsung.com> (raw)

Setup the mcpm entry address again on system resume as the
iRAM contents are lost across an s2r cycle.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
---
This has been tested after applying the Exynos5420 S2R support series
along with Nicolas Pitre's boot cluster CCI enablement patches on Peach
Pit.

 arch/arm/mach-exynos/mcpm-exynos.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
index 8c610e2..0bf734d 100644
--- a/arch/arm/mach-exynos/mcpm-exynos.c
+++ b/arch/arm/mach-exynos/mcpm-exynos.c
@@ -15,6 +15,7 @@
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/of_address.h>
+#include <linux/syscore_ops.h>
 
 #include <asm/cputype.h>
 #include <asm/cp15.h>
@@ -26,6 +27,7 @@
 #define EXYNOS5420_CPUS_PER_CLUSTER	4
 #define EXYNOS5420_NR_CLUSTERS		2
 
+static void __iomem *ns_sram_base_addr;
 /*
  * The common v7_exit_coherency_flush API could not be used because of the
  * Erratum 799270 workaround. This macro is the same as the common one (in
@@ -308,10 +310,26 @@ static const struct of_device_id exynos_dt_mcpm_match[] = {
 	{},
 };
 
+static void exynos_mcpm_setup_entry_point(void)
+{
+	/*
+	 * U-Boot SPL is hardcoded to jump to the start of ns_sram_base_addr
+	 * as part of secondary_cpu_start().  Let's redirect it to the
+	 * mcpm_entry_point(). This is done during both secondary boot-up as
+	 * well as system resume.
+	 */
+	__raw_writel(0xe59f0000, ns_sram_base_addr);     /* ldr r0, [pc, #0] */
+	__raw_writel(0xe12fff10, ns_sram_base_addr + 4); /* bx  r0 */
+	__raw_writel(virt_to_phys(mcpm_entry_point), ns_sram_base_addr + 8);
+}
+
+static struct syscore_ops exynos_mcpm_syscore_ops = {
+	.resume	= exynos_mcpm_setup_entry_point,
+};
+
 static int __init exynos_mcpm_init(void)
 {
 	struct device_node *node;
-	void __iomem *ns_sram_base_addr;
 	int ret;
 
 	node = of_find_matching_node(NULL, exynos_dt_mcpm_match);
@@ -357,16 +375,9 @@ static int __init exynos_mcpm_init(void)
 
 	pr_info("Exynos MCPM support installed\n");
 
-	/*
-	 * U-Boot SPL is hardcoded to jump to the start of ns_sram_base_addr
-	 * as part of secondary_cpu_start().  Let's redirect it to the
-	 * mcpm_entry_point().
-	 */
-	__raw_writel(0xe59f0000, ns_sram_base_addr);     /* ldr r0, [pc, #0] */
-	__raw_writel(0xe12fff10, ns_sram_base_addr + 4); /* bx  r0 */
-	__raw_writel(virt_to_phys(mcpm_entry_point), ns_sram_base_addr + 8);
+	exynos_mcpm_setup_entry_point();
 
-	iounmap(ns_sram_base_addr);
+	register_syscore_ops(&exynos_mcpm_syscore_ops);
 
 	return ret;
 }
-- 
1.8.3.2

WARNING: multiple messages have this Message-ID (diff)
From: a.kesavan@samsung.com (Abhilash Kesavan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: EXYNOS: Restore the entry address setup code post-resume
Date: Thu, 26 Jun 2014 16:28:32 +0530	[thread overview]
Message-ID: <1403780312-22885-1-git-send-email-a.kesavan@samsung.com> (raw)

Setup the mcpm entry address again on system resume as the
iRAM contents are lost across an s2r cycle.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
---
This has been tested after applying the Exynos5420 S2R support series
along with Nicolas Pitre's boot cluster CCI enablement patches on Peach
Pit.

 arch/arm/mach-exynos/mcpm-exynos.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
index 8c610e2..0bf734d 100644
--- a/arch/arm/mach-exynos/mcpm-exynos.c
+++ b/arch/arm/mach-exynos/mcpm-exynos.c
@@ -15,6 +15,7 @@
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/of_address.h>
+#include <linux/syscore_ops.h>
 
 #include <asm/cputype.h>
 #include <asm/cp15.h>
@@ -26,6 +27,7 @@
 #define EXYNOS5420_CPUS_PER_CLUSTER	4
 #define EXYNOS5420_NR_CLUSTERS		2
 
+static void __iomem *ns_sram_base_addr;
 /*
  * The common v7_exit_coherency_flush API could not be used because of the
  * Erratum 799270 workaround. This macro is the same as the common one (in
@@ -308,10 +310,26 @@ static const struct of_device_id exynos_dt_mcpm_match[] = {
 	{},
 };
 
+static void exynos_mcpm_setup_entry_point(void)
+{
+	/*
+	 * U-Boot SPL is hardcoded to jump to the start of ns_sram_base_addr
+	 * as part of secondary_cpu_start().  Let's redirect it to the
+	 * mcpm_entry_point(). This is done during both secondary boot-up as
+	 * well as system resume.
+	 */
+	__raw_writel(0xe59f0000, ns_sram_base_addr);     /* ldr r0, [pc, #0] */
+	__raw_writel(0xe12fff10, ns_sram_base_addr + 4); /* bx  r0 */
+	__raw_writel(virt_to_phys(mcpm_entry_point), ns_sram_base_addr + 8);
+}
+
+static struct syscore_ops exynos_mcpm_syscore_ops = {
+	.resume	= exynos_mcpm_setup_entry_point,
+};
+
 static int __init exynos_mcpm_init(void)
 {
 	struct device_node *node;
-	void __iomem *ns_sram_base_addr;
 	int ret;
 
 	node = of_find_matching_node(NULL, exynos_dt_mcpm_match);
@@ -357,16 +375,9 @@ static int __init exynos_mcpm_init(void)
 
 	pr_info("Exynos MCPM support installed\n");
 
-	/*
-	 * U-Boot SPL is hardcoded to jump to the start of ns_sram_base_addr
-	 * as part of secondary_cpu_start().  Let's redirect it to the
-	 * mcpm_entry_point().
-	 */
-	__raw_writel(0xe59f0000, ns_sram_base_addr);     /* ldr r0, [pc, #0] */
-	__raw_writel(0xe12fff10, ns_sram_base_addr + 4); /* bx  r0 */
-	__raw_writel(virt_to_phys(mcpm_entry_point), ns_sram_base_addr + 8);
+	exynos_mcpm_setup_entry_point();
 
-	iounmap(ns_sram_base_addr);
+	register_syscore_ops(&exynos_mcpm_syscore_ops);
 
 	return ret;
 }
-- 
1.8.3.2

             reply	other threads:[~2014-06-26 10:56 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 10:58 Abhilash Kesavan [this message]
2014-06-26 10:58 ` [PATCH] ARM: EXYNOS: Restore the entry address setup code post-resume Abhilash Kesavan
2014-06-26 12:25 ` Abhilash Kesavan
2014-06-26 12:25   ` Abhilash Kesavan
2014-06-26 14:35   ` Lorenzo Pieralisi
2014-06-26 14:35     ` Lorenzo Pieralisi
2014-06-26 14:53   ` Lorenzo Pieralisi
2014-06-26 14:53     ` Lorenzo Pieralisi
2014-06-26 20:06   ` Nicolas Pitre
2014-06-26 20:06     ` Nicolas Pitre
2014-06-27  1:49     ` Abhilash Kesavan
2014-06-27  1:49       ` Abhilash Kesavan
2014-06-30 18:28 ` [PATCH v2] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 Abhilash Kesavan
2014-06-30 18:28   ` Abhilash Kesavan
2014-07-01  4:19   ` Nicolas Pitre
2014-07-01  4:19     ` Nicolas Pitre
2014-07-01 13:14     ` Abhilash Kesavan
2014-07-01 13:14       ` Abhilash Kesavan
2014-07-01 13:50       ` Lorenzo Pieralisi
2014-07-01 13:50         ` Lorenzo Pieralisi
2014-07-01 20:02         ` Nicolas Pitre
2014-07-01 20:02           ` Nicolas Pitre
2014-07-02 14:59   ` [RFC PATCH v3] " Abhilash Kesavan
2014-07-02 14:59     ` Abhilash Kesavan
2014-07-03  5:02     ` [RFC PATCH v4] " Abhilash Kesavan
2014-07-03  5:02       ` Abhilash Kesavan
2014-07-03 13:29       ` Nicolas Pitre
2014-07-03 13:29         ` Nicolas Pitre
2014-07-03 14:46         ` Abhilash Kesavan
2014-07-03 14:46           ` Abhilash Kesavan
2014-07-03 14:46       ` [PATCH v5] " Abhilash Kesavan
2014-07-03 14:46         ` Abhilash Kesavan
2014-07-03 15:45         ` several messages Nicolas Pitre
2014-07-03 15:45           ` Nicolas Pitre
2014-07-03 16:19           ` Abhilash Kesavan
2014-07-03 16:19             ` Abhilash Kesavan
2014-07-03 19:00             ` Nicolas Pitre
2014-07-03 19:00               ` Nicolas Pitre
2014-07-03 20:00               ` Abhilash Kesavan
2014-07-03 20:00                 ` Abhilash Kesavan
2014-07-04  4:13                 ` Nicolas Pitre
2014-07-04  4:13                   ` Nicolas Pitre
2014-07-04 17:45                   ` Abhilash Kesavan
2014-07-04 17:45                     ` Abhilash Kesavan
2014-07-04 17:47         ` [PATCH v6] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 Abhilash Kesavan
2014-07-04 17:47           ` Abhilash Kesavan
2014-07-04 19:45           ` [PATCH v7] " Abhilash Kesavan
2014-07-04 19:45             ` Abhilash Kesavan
2014-07-04 21:00             ` Nicolas Pitre
2014-07-04 21:00               ` Nicolas Pitre
2014-07-04 21:21               ` Abhilash Kesavan
2014-07-04 21:21                 ` Abhilash Kesavan
2014-07-08 10:53                 ` Lorenzo Pieralisi
2014-07-08 10:53                   ` Lorenzo Pieralisi
2014-07-08 13:39                   ` Abhilash Kesavan
2014-07-08 13:39                     ` Abhilash Kesavan
2014-07-08 15:19                     ` Lorenzo Pieralisi
2014-07-08 15:19                       ` Lorenzo Pieralisi

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=1403780312-22885-1-git-send-email-a.kesavan@samsung.com \
    --to=a.kesavan@samsung.com \
    --cc=abrestic@chromium.org \
    --cc=dianders@chromium.org \
    --cc=kesavan.abhilash@gmail.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=nicolas.pitre@linaro.org \
    /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.