All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de, git@xilinx.com
Cc: Michal Simek <monstr@monstr.eu>,
	Ovidiu Panait <ovidiu.panait@windriver.com>
Subject: [PATCH v4 07/23] microblaze: Fix early stack allocation
Date: Wed, 15 Jun 2022 15:21:03 +0200	[thread overview]
Message-ID: <e9aee69646e022fd8a96cbee2d2a07ab81fb6e05.1655299267.git.michal.simek@amd.com> (raw)
In-Reply-To: <cover.1655299267.git.michal.simek@amd.com>

CONFIG_SYS_INIT_SP_OFFSET macro place stack to TEXT_BASE - SYS_MALLOC_F_LEN
but there is no reason to do it now because board_init_f_alloc_reserve()
returns exact location where stack should be. That's why stack location is
calculated at run time and there is no need to hardcode it via macro. This
change will help with placing U-Boot to any address.

Signed-off-by: Michal Simek <michal.simek@amd.com>
---

(no changes since v1)

 arch/microblaze/cpu/start.S          | 2 +-
 include/configs/microblaze-generic.h | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S
index 715ef37b39d9..1acac5faf428 100644
--- a/arch/microblaze/cpu/start.S
+++ b/arch/microblaze/cpu/start.S
@@ -22,7 +22,7 @@ _start:
 #if defined(CONFIG_SPL_BUILD)
 	addi	r1, r0, CONFIG_SPL_STACK_ADDR
 #else
-	addi	r1, r0, CONFIG_SYS_INIT_SP_OFFSET
+	add	r1, r0, r8
 #endif
 
 	addi	r1, r1, -4	/* Decrement SP to top of memory */
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
index 663837f33dc4..60ceb2c817e9 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -18,10 +18,6 @@
 # define CONFIG_SYS_BAUDRATE_TABLE \
 	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
 
-/* Stack location before relocation */
-#define CONFIG_SYS_INIT_SP_OFFSET	(CONFIG_SYS_TEXT_BASE - \
-					 CONFIG_SYS_MALLOC_F_LEN)
-
 #ifdef CONFIG_CFI_FLASH
 /* ?empty sector */
 # define CONFIG_SYS_FLASH_EMPTY_INFO	1
-- 
2.36.1


  parent reply	other threads:[~2022-06-15 13:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 13:20 [PATCH v4 00/23] microblaze: Add support for full relocation Michal Simek
2022-06-15 13:20 ` [PATCH v4 01/23] tools: relocate-rela: Open binary u-boot file later Michal Simek
2022-06-15 13:20 ` [PATCH v4 02/23] Makefile: Fix description for relocate-rela parameters Michal Simek
2022-06-15 13:20 ` [PATCH v4 03/23] tools: relocate-rela: Use global variables Michal Simek
2022-06-15 13:21 ` [PATCH v4 04/23] tools: relocate-rela: Read rela start/end directly from ELF Michal Simek
2022-06-15 13:21 ` [PATCH v4 05/23] microblaze: Switch absolute branches to relative Michal Simek
2022-06-15 13:21 ` [PATCH v4 06/23] microblaze: Fix stack protection behavior Michal Simek
2022-06-15 13:21 ` Michal Simek [this message]
2022-06-15 13:21 ` [PATCH v4 08/23] microblaze: Remove CONFIG_TEXT_BASE from code Michal Simek
2022-06-15 13:21 ` [PATCH v4 09/23] microblaze: Fix typo in exception.c Michal Simek
2022-06-15 13:21 ` [PATCH v4 10/23] mips: Move endianness selection to arch/Kconfig Michal Simek
2022-06-15 13:21 ` [PATCH v4 11/23] microblaze: Enable REMAKE_ELF Michal Simek
2022-06-15 13:21 ` [PATCH v4 12/23] microblaze: Separate code end substraction Michal Simek
2022-06-15 13:21 ` [PATCH v4 13/23] microblaze: Change stack protection address to new stack address Michal Simek
2022-06-15 13:21 ` [PATCH v4 14/23] microblaze: Optimize register usage in relocate_code Michal Simek
2022-06-15 13:21 ` [PATCH v4 15/23] microblaze: Remove code around r20 in relocate_code() Michal Simek
2022-06-15 13:21 ` [PATCH v4 16/23] microblaze: Remove _start symbol handling at U-Boot start Michal Simek
2022-06-15 13:21 ` [PATCH v4 17/23] microblaze: Add comment about reset location Michal Simek
2022-06-15 13:21 ` [PATCH v4 18/23] microblaze: Create SYM_ADDR macro to deal with symbols Michal Simek
2022-06-15 13:21 ` [PATCH v4 19/23] tools: relocate-rela: Extract elf64 reloc to special function Michal Simek
2022-06-15 13:21 ` [PATCH v4 20/23] tools: relocate-rela: Check that relocation works only for EM_AARCH64 Michal Simek
2022-06-15 13:21 ` [PATCH v4 21/23] tools: relocate-rela: Add support for elf32 decoding Michal Simek
2022-06-15 13:21 ` [PATCH v4 22/23] tools: relocate-rela: Add support for 32bit Microblaze relocation Michal Simek
2022-06-15 13:21 ` [PATCH v4 23/23] microblaze: Add support for run time relocation Michal Simek
2022-06-24 12:15 ` [PATCH v4 00/23] microblaze: Add support for full relocation Michal Simek

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=e9aee69646e022fd8a96cbee2d2a07ab81fb6e05.1655299267.git.michal.simek@amd.com \
    --to=monstr@monstr.eu \
    --cc=git@xilinx.com \
    --cc=ovidiu.panait@windriver.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 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.