mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH 9/9] ARM: zynq: zed: always relocate in PBL
Date: Fri, 13 Dec 2024 22:00:15 +0100	[thread overview]
Message-ID: <20241213210015.357249-9-dev@lynxeye.de> (raw)
In-Reply-To: <20241213210015.357249-1-dev@lynxeye.de>

The PBL console is currently broken, as the setup relocates the
running code, invalidating the previously computed FDT address.
Relocate always to avoid those differences in behavior.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 arch/arm/boards/avnet-zedboard/lowlevel.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boards/avnet-zedboard/lowlevel.c b/arch/arm/boards/avnet-zedboard/lowlevel.c
index 1ecddf24085f..026a03d04be8 100644
--- a/arch/arm/boards/avnet-zedboard/lowlevel.c
+++ b/arch/arm/boards/avnet-zedboard/lowlevel.c
@@ -276,10 +276,6 @@ static void avnet_zedboard_ps7_init(void)
 
 static void avnet_zedboard_pbl_console_init(void)
 {
-	relocate_to_current_adr();
-	setup_c();
-	barrier();
-
 	cadence_uart_init((void *)ZYNQ_UART1_BASE_ADDR);
 	pbl_set_putc(cadence_uart_putc, (void *)ZYNQ_UART1_BASE_ADDR);
 
@@ -288,9 +284,6 @@ static void avnet_zedboard_pbl_console_init(void)
 
 ENTRY_FUNCTION_WITHSTACK(start_avnet_zedboard, 0xfffff000, r0, r1, r2)
 {
-
-	void *fdt = __dtb_z_zynq_zed_start + get_runtime_offset();
-
 	/* MIO_07 in GPIO Mode 3.3V VIO, can be uncomented because it is the default value */
 	writel(0x0000DF0D, ZYNQ_SLCR_UNLOCK);
 	writel(0x00000600, 0xF800071C );
@@ -305,8 +298,12 @@ ENTRY_FUNCTION_WITHSTACK(start_avnet_zedboard, 0xfffff000, r0, r1, r2)
 
 	avnet_zedboard_ps7_init();
 
+	relocate_to_current_adr();
+	setup_c();
+	barrier();
+
 	if (IS_ENABLED(CONFIG_PBL_CONSOLE))
 		avnet_zedboard_pbl_console_init();
 
-	barebox_arm_entry(0, SZ_512M, fdt);
+	barebox_arm_entry(0, SZ_512M, __dtb_z_zynq_zed_start);
 }
-- 
2.47.1




  parent reply	other threads:[~2024-12-13 21:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 21:00 [PATCH 1/9] ARM: zynq: add MMC aliases Lucas Stach
2024-12-13 21:00 ` [PATCH 2/9] ARM: zynq: zed: define SDHCI bus-width Lucas Stach
2024-12-13 21:00 ` [PATCH 3/9] ARM: zynq: zed: guard board initcall Lucas Stach
2024-12-13 21:00 ` [PATCH 4/9] ARM: zynq: zed: add environment Lucas Stach
2024-12-13 21:00 ` [PATCH 5/9] ARM: zynq: zed: add Barebox update handler Lucas Stach
2024-12-13 21:00 ` [PATCH 6/9] ARM: zynq: enable some useful things in defconfig Lucas Stach
2024-12-13 21:00 ` [PATCH 7/9] ARM: zynq: zed: switch to entry function with stack Lucas Stach
2024-12-13 21:00 ` [PATCH 8/9] ARM: zynq: call common arm lowlevel init from zynq lowlevel init Lucas Stach
2024-12-13 21:00 ` Lucas Stach [this message]
2024-12-16  7:24 ` [PATCH 1/9] ARM: zynq: add MMC aliases Sascha Hauer

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=20241213210015.357249-9-dev@lynxeye.de \
    --to=dev@lynxeye.de \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox