mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>,
	 Michael Tretter <m.tretter@pengutronix.de>
Subject: [PATCH 3/6] arm: socfpga: agilex5: extract function to request qspi access
Date: Wed, 06 May 2026 11:06:09 +0200	[thread overview]
Message-ID: <20260506-socfpga-agilex5-qspi-v1-3-94def85c1b80@pengutronix.de> (raw)
In-Reply-To: <20260506-socfpga-agilex5-qspi-v1-0-94def85c1b80@pengutronix.de>

Requesting access to the QSPI flash access may actually fail due to the
firmware configuration. Tell the user about the failure, since other
features, for example, barebox environment in flash, may rely on QSPI
flash access.

Extract a helper function and print a warning, if QSPI flash access was
not granted.

Since requesting QSPI flash access is currently the only function that
uses the S10 mailbox, move socfgpa_mailbox_s10_init(), too.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 arch/arm/mach-socfpga/atf.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-socfpga/atf.c b/arch/arm/mach-socfpga/atf.c
index c7be4e11d2ea..3719bde0e8bb 100644
--- a/arch/arm/mach-socfpga/atf.c
+++ b/arch/arm/mach-socfpga/atf.c
@@ -12,6 +12,23 @@
 #include <mach/socfpga/soc64-sdram.h>
 #include <mach/socfpga/soc64-system-manager.h>
 
+static void socfpga_agilex5_qspi_init(void)
+{
+	int ret;
+
+	ret = socfpga_mailbox_s10_init();
+	if (ret) {
+		pr_warn("Failed to init s10 mailbox: %d\n", ret);
+		return;
+	}
+
+	ret = socfpga_mailbox_s10_qspi_open();
+	if (ret) {
+		pr_warn("Failed to request QSPI access: %d\n", ret);
+		return;
+	}
+}
+
 static void __noreturn agilex5_load_and_start_image_via_tfa(void)
 {
 	void *bl31 = (void *)AGILEX5_ATF_BL31_BASE_ADDR;
@@ -55,8 +72,7 @@ void __noreturn agilex5_barebox_entry(void *fdt)
 			writel(LCR_BKSE, SOCFPGA_UART0_ADDRESS + LCR);
 		agilex5_ddr_init_full();
 
-		socfpga_mailbox_s10_init();
-		socfpga_mailbox_s10_qspi_open();
+		socfpga_agilex5_qspi_init();
 
 		agilex5_load_and_start_image_via_tfa();
 		__builtin_unreachable();

-- 
2.47.3




  parent reply	other threads:[~2026-05-06  9:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06  9:06 [PATCH 0/6] arm: socfpga: agilex5: cleanup QSPI flash low level code Michael Tretter
2026-05-06  9:06 ` [PATCH 1/6] arm: socfpga: agilex5: add missing include soc64-regs.h Michael Tretter
2026-05-06  9:06 ` [PATCH 2/6] arm: socfgpa: agilex5: remove mailbox_s10 from barebox proper Michael Tretter
2026-05-06  9:06 ` Michael Tretter [this message]
2026-05-06  9:06 ` [PATCH 4/6] arm: socfpga: mailbox_s10: keep clock rate in Hz Michael Tretter
2026-05-06  9:06 ` [PATCH 5/6] arm: socfpga: mailbox_s10: add write_qspi_refclk helper Michael Tretter
2026-05-06  9:06 ` [PATCH 6/6] arm: socfpga: agilex5: extract write_qspi_refclk from mailbox Michael Tretter
2026-05-07 10:48 ` [PATCH 0/6] arm: socfpga: agilex5: cleanup QSPI flash low level code 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=20260506-socfpga-agilex5-qspi-v1-3-94def85c1b80@pengutronix.de \
    --to=m.tretter@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=s.trumtrar@pengutronix.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