From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Sam Ravnborg <sam@ravnborg.org>, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v4 14/14] ARM: AT91: skov-arm9cpu: support environment on SD-Card
Date: Tue, 20 Feb 2024 10:31:00 +0100 [thread overview]
Message-ID: <20240220093100.1539120-15-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240220093100.1539120-1-a.fatoum@pengutronix.de>
barebox is meant to boot from SD-Card on this platform, so support a
barebox environment in this case for easier handling.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/boards/skov-arm9cpu/board.c | 8 ++++++++
arch/arm/dts/at91-skov-arm9cpu.dts | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/arch/arm/boards/skov-arm9cpu/board.c b/arch/arm/boards/skov-arm9cpu/board.c
index db6813c0e726..20507922cb24 100644
--- a/arch/arm/boards/skov-arm9cpu/board.c
+++ b/arch/arm/boards/skov-arm9cpu/board.c
@@ -7,6 +7,7 @@
#include <envfs.h>
#include <init.h>
#include <gpio.h>
+#include <bootsource.h>
#include <linux/sizes.h>
@@ -70,6 +71,13 @@ static int skov_arm9_probe(struct device *dev)
mem = mem / SZ_1M;
globalvar_add_simple_int("board.mem", &mem, "%u");
+ /*
+ * NOR first stage bootloader is at91bootstrap, so if we find traces
+ * of barebox in on-chip SRAM, it must mean we have booted from SD
+ */
+ if (is_barebox_arm_head((void *)AT91SAM9263_SRAM0_BASE))
+ bootsource_set_raw(BOOTSOURCE_MMC, BOOTSOURCE_INSTANCE_UNKNOWN);
+
return 0;
}
diff --git a/arch/arm/dts/at91-skov-arm9cpu.dts b/arch/arm/dts/at91-skov-arm9cpu.dts
index ac1d5c0c2e6e..d04d031f4053 100644
--- a/arch/arm/dts/at91-skov-arm9cpu.dts
+++ b/arch/arm/dts/at91-skov-arm9cpu.dts
@@ -16,6 +16,12 @@ / {
chosen {
stdout-path = "serial0:115200n8";
+
+ environment-sd {
+ compatible = "barebox,environment";
+ device-path = &mmc1;
+ file-path = "barebox.env";
+ };
};
flash: nor_flash@10000000 {
--
2.39.2
next prev parent reply other threads:[~2024-02-20 9:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 9:30 [PATCH v4 00/14] ARM: at91: skov-arm9cpu (SAM9263) first stage support Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 01/14] mci: atmel_mci: disable power save mode Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 02/14] mci: atmel_mci: fix zeroing of block length on AT91SAM9263 Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 03/14] ARM: replace ENTRY_FUNCTION_HEAD with ENTRY_FUNCTION_WITHSTACK_HEAD Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 04/14] ARM: at91: use AT91 header instead of generic barebox ARM's Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 05/14] ARM: at91: implement SAM9_ENTRY_FUNCTION Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 06/14] ARM: at91: sam9263_ll: drop PLL charge pump initialization Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 07/14] ARM: at91: sam9263_ll: pass AT91_PMC_LL_AT91SAM9263 to PMC functions Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 08/14] ARM: at91: sam9263_ll: refactor MCK switch to PLLA for clarity Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 09/14] ARM: at91: sam9263_ll: support configuration of PLLB Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 10/14] ARM: dts: AT91: skov-arm9cpu: remove barebox environment on NOR Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 11/14] ARM: at91: skov-arm9cpu: Add SD-Card xload support Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 12/14] ARM: at91: skov-arm9cpu: configure SMC for NOR flash use Ahmad Fatoum
2024-02-20 9:30 ` [PATCH v4 13/14] ARM: at91: skov-arm9cpu: configure more appropriate hostname Ahmad Fatoum
2024-02-20 9:31 ` Ahmad Fatoum [this message]
2024-02-23 7:32 ` [PATCH v4 00/14] ARM: at91: skov-arm9cpu (SAM9263) first stage support 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=20240220093100.1539120-15-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=sam@ravnborg.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