U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: u-boot@lists.denx.de
Cc: Chris Packham <judge.packham@gmail.com>,
	Simon Glass <sjg@chromium.org>, Stefan Roese <sr@denx.de>,
	Tom Rini <trini@konsulko.com>
Subject: [PATCH] arm: mvebu: AC5: Use finer grained memory map
Date: Fri, 27 Oct 2023 13:44:11 +1300	[thread overview]
Message-ID: <20231027004430.442136-1-judge.packham@gmail.com> (raw)

The ATF implementation for AC5/AC5X ends up with bl31 living in some
internal SRAM. This is in the middle of the large MMIO region that we
were using. Adjust this to be finer grained blocks based on the address
map from the AC5X Family Control and Management Subsystem Functional
Datasheet.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---

 arch/arm/mach-mvebu/alleycat5/cpu.c | 66 ++++++++++++++++++++++-------
 1 file changed, 51 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-mvebu/alleycat5/cpu.c b/arch/arm/mach-mvebu/alleycat5/cpu.c
index 8204d9627515..0f72ae1709be 100644
--- a/arch/arm/mach-mvebu/alleycat5/cpu.c
+++ b/arch/arm/mach-mvebu/alleycat5/cpu.c
@@ -16,7 +16,10 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define RAM_SIZE	SZ_1G
+#define AC5_PTE_BLOCK_DEVICE \
+	(PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | \
+			 PTE_BLOCK_NON_SHARE | \
+			 PTE_BLOCK_PXN | PTE_BLOCK_UXN)
 
 static struct mm_region ac5_mem_map[] = {
 	{
@@ -31,30 +34,63 @@ static struct mm_region ac5_mem_map[] = {
 		.phys = 0x00000000,
 		.virt = 0xa0000000,
 		.size = 0x100000,
-
-		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
-			 PTE_BLOCK_NON_SHARE |
-			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
+		.attrs = AC5_PTE_BLOCK_DEVICE,
 	},
 	{
 		/* MMIO regions */
 		.phys = 0x100000,
 		.virt = 0x100000,
 		.size = 0x3ff00000,
-
-		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
-			 PTE_BLOCK_NON_SHARE |
-			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
+		.attrs = AC5_PTE_BLOCK_DEVICE,
 	},
 	{
-		/* MMIO regions */
 		.phys = 0x7F000000,
 		.virt = 0x7F000000,
-		.size = 0x21000000,
-
-		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
-			 PTE_BLOCK_NON_SHARE |
-			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
+		.size = SZ_8M,
+		.attrs = AC5_PTE_BLOCK_DEVICE,
+	},
+	{
+		.phys = 0x7F800000,
+		.virt = 0x7F800000,
+		.size = SZ_4M,
+		.attrs = AC5_PTE_BLOCK_DEVICE,
+	},
+	{
+		.phys = 0x7FC00000,
+		.virt = 0x7FC00000,
+		.size = SZ_512K,
+		.attrs = AC5_PTE_BLOCK_DEVICE,
+	},
+	{
+		.phys = 0x7FC80000,
+		.virt = 0x7FC80000,
+		.size = SZ_512K,
+		.attrs = AC5_PTE_BLOCK_DEVICE,
+	},
+	{
+		.phys = 0x7FD00000,
+		.virt = 0x7FD00000,
+		.size = SZ_512K,
+		.attrs = AC5_PTE_BLOCK_DEVICE,
+	},
+	/* ATF region 0x7FE00000-0x7FE20000 not mapped */
+	{
+		.phys = 0x7FE80000,
+		.virt = 0x7FE80000,
+		.size = SZ_512K,
+		.attrs = AC5_PTE_BLOCK_DEVICE,
+	},
+	{
+		.phys = 0x7FFF0000,
+		.virt = 0x7FFF0000,
+		.size = SZ_1M,
+		.attrs = AC5_PTE_BLOCK_DEVICE,
+	},
+	{
+		.phys = 0x80000000,
+		.virt = 0x80000000,
+		.size = SZ_2G,
+		.attrs = AC5_PTE_BLOCK_DEVICE,
 	},
 	{
 		0,
-- 
2.42.0


             reply	other threads:[~2023-10-27  0:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  0:44 Chris Packham [this message]
2023-10-27  0:54 ` [PATCH] arm: mvebu: AC5: Use finer grained memory map Tom Rini
2023-10-27  5:04   ` Chris Packham
2024-01-10 14:08 ` Stefan Roese

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=20231027004430.442136-1-judge.packham@gmail.com \
    --to=judge.packham@gmail.com \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox