All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] include: configs: am**x/j721e/j721s2_evm.h: Move the stack pointer init address in arm64
@ 2022-04-19 15:26 Aswath Govindraju
  2022-05-05 18:53 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Aswath Govindraju @ 2022-04-19 15:26 UTC (permalink / raw)
  Cc: u-boot, Tom Rini, Dave Gerlach, Vignesh Raghavendra,
	Praneeth Bajjuri, Aswath Govindraju

Currently, in case of arm64 bootloader and U-Boot the stack pointer is
initialized at an offset of NON_SECURE_MSRAM_SIZE from arm64 SPL's text
base address. After jumping to arm64, execution is done out of DDR.
Therefore, having an offset corresponding to the size of MSRAM does not
have any significance.

Instead, initialize the stack pointer after an offset of 4MB from the SPL
text base address. This helps in allocating larger memory for stack.

  ┌────────────────────┐0x80080000
  │                    │
  │   arm64 SPL        │
  ├────────────────────┤
  │        ▲           │
  │        │           │
  │      STACK         │
  ├────────────────────┤0x80480000
  │ Memory for Load    │
  │ Buffer Allocation  │
  ├────────────────────┤0x80800000
  │                    │
  │    U-Boot Image    │
  │                    │
  └────────────────────┘

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---

Notes: 
- Verified SD and DFU boot modes on platforms where
  this change will have an effect and are supported

- AM64
  - SD boot mode,
    https://pastebin.ubuntu.com/p/YDBjhTqwSK/
  - DFU boot mode,
    https://pastebin.ubuntu.com/p/Xsjn4h7h2W/
  - "Error setting up memory banksize. -22"
    This error was present even without the
    changes done by this patch

- J721e
  - SD boot mode,
    https://pastebin.ubuntu.com/p/NpVvKjMMxc/
  - DFU boot mode,
    https://pastebin.ubuntu.com/p/MZPS4Wmkj5/

- J7200
  - SD boot mode,
    https://pastebin.ubuntu.com/p/QyyC8WFsS2/
  - DFU boot mode,
    https://pastebin.ubuntu.com/p/Nmjf3mVRyH/

- J721s2
  - SD boot mode,
    https://pastebin.ubuntu.com/p/xh96CP8ndB/

- AM654
  - SD boot mode,
    https://pastebin.ubuntu.com/p/DbFjFSvj2C/

 include/configs/am64x_evm.h  | 3 +--
 include/configs/am65x_evm.h  | 3 +--
 include/configs/j721e_evm.h  | 3 +--
 include/configs/j721s2_evm.h | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/include/configs/am64x_evm.h b/include/configs/am64x_evm.h
index 135cb3c2ee20..d84a8db97ede 100644
--- a/include/configs/am64x_evm.h
+++ b/include/configs/am64x_evm.h
@@ -24,8 +24,7 @@
 
 #define CONFIG_SPL_MAX_SIZE		CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
 #if defined(CONFIG_TARGET_AM642_A53_EVM)
-#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE +	\
-					CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE - 4)
+#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE + SZ_4M)
 #else
 /*
  * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h
index 55fa6419e33d..b1f9050f3f5b 100644
--- a/include/configs/am65x_evm.h
+++ b/include/configs/am65x_evm.h
@@ -19,8 +19,7 @@
 
 /* SPL Loader Configuration */
 #ifdef CONFIG_TARGET_AM654_A53_EVM
-#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE +	\
-					 CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE + SZ_4M)
 #else
 /*
  * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h
index df3c16540ba3..2590ee6b0140 100644
--- a/include/configs/j721e_evm.h
+++ b/include/configs/j721e_evm.h
@@ -20,8 +20,7 @@
 
 /* SPL Loader Configuration */
 #if defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
-#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE +	\
-					 CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE + SZ_4M)
 #define CONFIG_SYS_UBOOT_BASE		0x50280000
 /* Image load address in RAM for DFU boot*/
 #else
diff --git a/include/configs/j721s2_evm.h b/include/configs/j721s2_evm.h
index f0d56b8778ee..a5505f079b43 100644
--- a/include/configs/j721s2_evm.h
+++ b/include/configs/j721s2_evm.h
@@ -21,8 +21,7 @@
 
 /* SPL Loader Configuration */
 #if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
-#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE +	\
-					 CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE + SZ_4M)
 #define CONFIG_SYS_UBOOT_BASE		0x50280000
 /* Image load address in RAM for DFU boot*/
 #else
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] include: configs: am**x/j721e/j721s2_evm.h: Move the stack pointer init address in arm64
  2022-04-19 15:26 [PATCH] include: configs: am**x/j721e/j721s2_evm.h: Move the stack pointer init address in arm64 Aswath Govindraju
@ 2022-05-05 18:53 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2022-05-05 18:53 UTC (permalink / raw)
  To: Aswath Govindraju
  Cc: u-boot, Dave Gerlach, Vignesh Raghavendra, Praneeth Bajjuri

[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]

On Tue, Apr 19, 2022 at 08:56:02PM +0530, Aswath Govindraju wrote:

> Currently, in case of arm64 bootloader and U-Boot the stack pointer is
> initialized at an offset of NON_SECURE_MSRAM_SIZE from arm64 SPL's text
> base address. After jumping to arm64, execution is done out of DDR.
> Therefore, having an offset corresponding to the size of MSRAM does not
> have any significance.
> 
> Instead, initialize the stack pointer after an offset of 4MB from the SPL
> text base address. This helps in allocating larger memory for stack.
> 
>   ┌────────────────────┐0x80080000
>   │                    │
>   │   arm64 SPL        │
>   ├────────────────────┤
>   │        ▲           │
>   │        │           │
>   │      STACK         │
>   ├────────────────────┤0x80480000
>   │ Memory for Load    │
>   │ Buffer Allocation  │
>   ├────────────────────┤0x80800000
>   │                    │
>   │    U-Boot Image    │
>   │                    │
>   └────────────────────┘
> 
> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-05 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 15:26 [PATCH] include: configs: am**x/j721e/j721s2_evm.h: Move the stack pointer init address in arm64 Aswath Govindraju
2022-05-05 18:53 ` Tom Rini

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.