All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Magnus Damm <magnus.damm@gmail.com>,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>, Ard Biesheuvel <ardb@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: linux-renesas-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mtd@lists.infradead.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH/RFC 2/4] ARM: shmobile: rcar-gen2: Reserve boot area when SMP is enabled
Date: Thu, 31 Aug 2023 13:17:45 +0200	[thread overview]
Message-ID: <091150233acb0557a2ad3294d67b2adb6758670c.1693409184.git.geert+renesas@glider.be> (raw)
In-Reply-To: <cover.1693409184.git.geert+renesas@glider.be>

CPU core bringup on R-Car Gen2 SoCs uses the Cortex-A7/A15 Boot Address
Register to specify the boot area of the System CPU.  With this enabled,
when the System CPU accesses a physical address in the range from 0x0 to
0x3ffff, the top address bits are replaced by those specified in the
SBAR register.  Hence any device residing in the low 256 KiB of physical
address space cannot be accessed.

Prevent conflicts by reserving this memory region using
request_mem_region().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-shmobile/pm-rcar-gen2.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c
index 7447e5fd7ed41e99..3453d5733224df44 100644
--- a/arch/arm/mach-shmobile/pm-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c
@@ -52,6 +52,11 @@ void __init rcar_gen2_pm_init(void)
 	struct resource res;
 	int error;
 
+	if (!request_mem_region(0, SZ_256K, "Boot Area")) {
+		pr_err("Failed to request boot area\n");
+		return;
+	};
+
 	for_each_of_cpu_node(np) {
 		if (of_device_is_compatible(np, "arm,cortex-a15"))
 			has_a15 = true;
-- 
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Magnus Damm <magnus.damm@gmail.com>,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>, Ard Biesheuvel <ardb@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: linux-renesas-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mtd@lists.infradead.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH/RFC 2/4] ARM: shmobile: rcar-gen2: Reserve boot area when SMP is enabled
Date: Thu, 31 Aug 2023 13:17:45 +0200	[thread overview]
Message-ID: <091150233acb0557a2ad3294d67b2adb6758670c.1693409184.git.geert+renesas@glider.be> (raw)
In-Reply-To: <cover.1693409184.git.geert+renesas@glider.be>

CPU core bringup on R-Car Gen2 SoCs uses the Cortex-A7/A15 Boot Address
Register to specify the boot area of the System CPU.  With this enabled,
when the System CPU accesses a physical address in the range from 0x0 to
0x3ffff, the top address bits are replaced by those specified in the
SBAR register.  Hence any device residing in the low 256 KiB of physical
address space cannot be accessed.

Prevent conflicts by reserving this memory region using
request_mem_region().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-shmobile/pm-rcar-gen2.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c
index 7447e5fd7ed41e99..3453d5733224df44 100644
--- a/arch/arm/mach-shmobile/pm-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c
@@ -52,6 +52,11 @@ void __init rcar_gen2_pm_init(void)
 	struct resource res;
 	int error;
 
+	if (!request_mem_region(0, SZ_256K, "Boot Area")) {
+		pr_err("Failed to request boot area\n");
+		return;
+	};
+
 	for_each_of_cpu_node(np) {
 		if (of_device_is_compatible(np, "arm,cortex-a15"))
 			has_a15 = true;
-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Magnus Damm <magnus.damm@gmail.com>,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>, Ard Biesheuvel <ardb@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: linux-renesas-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mtd@lists.infradead.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH/RFC 2/4] ARM: shmobile: rcar-gen2: Reserve boot area when SMP is enabled
Date: Thu, 31 Aug 2023 13:17:45 +0200	[thread overview]
Message-ID: <091150233acb0557a2ad3294d67b2adb6758670c.1693409184.git.geert+renesas@glider.be> (raw)
In-Reply-To: <cover.1693409184.git.geert+renesas@glider.be>

CPU core bringup on R-Car Gen2 SoCs uses the Cortex-A7/A15 Boot Address
Register to specify the boot area of the System CPU.  With this enabled,
when the System CPU accesses a physical address in the range from 0x0 to
0x3ffff, the top address bits are replaced by those specified in the
SBAR register.  Hence any device residing in the low 256 KiB of physical
address space cannot be accessed.

Prevent conflicts by reserving this memory region using
request_mem_region().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-shmobile/pm-rcar-gen2.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c
index 7447e5fd7ed41e99..3453d5733224df44 100644
--- a/arch/arm/mach-shmobile/pm-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c
@@ -52,6 +52,11 @@ void __init rcar_gen2_pm_init(void)
 	struct resource res;
 	int error;
 
+	if (!request_mem_region(0, SZ_256K, "Boot Area")) {
+		pr_err("Failed to request boot area\n");
+		return;
+	};
+
 	for_each_of_cpu_node(np) {
 		if (of_device_is_compatible(np, "arm,cortex-a15"))
 			has_a15 = true;
-- 
2.34.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:[~2023-08-31 11:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 11:17 [PATCH/RFC 0/4] ARM: shmobile: Reserve boot area when SMP is enabled Geert Uytterhoeven
2023-08-31 11:17 ` Geert Uytterhoeven
2023-08-31 11:17 ` Geert Uytterhoeven
2023-08-31 11:17 ` [PATCH 1/4] ARM: shmobile: rcar-gen2: Remove unneeded once handling Geert Uytterhoeven
2023-08-31 11:17   ` Geert Uytterhoeven
2023-08-31 11:17   ` Geert Uytterhoeven
2023-08-31 11:17 ` Geert Uytterhoeven [this message]
2023-08-31 11:17   ` [PATCH/RFC 2/4] ARM: shmobile: rcar-gen2: Reserve boot area when SMP is enabled Geert Uytterhoeven
2023-08-31 11:17   ` Geert Uytterhoeven
2023-08-31 11:17 ` [PATCH/RFC 3/4] ARM: shmobile: r8a7779: " Geert Uytterhoeven
2023-08-31 11:17   ` Geert Uytterhoeven
2023-08-31 11:17   ` Geert Uytterhoeven
2023-08-31 11:17 ` [PATCH/RFC 4/4] ARM: shmobile: sh73a0: " Geert Uytterhoeven
2023-08-31 11:17   ` Geert Uytterhoeven
2023-08-31 11:17   ` Geert Uytterhoeven
2023-09-25  7:15 ` [PATCH/RFC 0/4] ARM: shmobile: " Geert Uytterhoeven
2023-09-25  7:15   ` Geert Uytterhoeven
2023-09-25  7:15   ` Geert Uytterhoeven

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=091150233acb0557a2ad3294d67b2adb6758670c.1693409184.git.geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=magnus.damm@gmail.com \
    --cc=marek.vasut+renesas@gmail.com \
    /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.