mail archive of the barebox mailing list
 help / color / mirror / Atom feed
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 v2 02/11] ARM: at91: sama5d4: add entry point helpers
Date: Mon,  9 Jan 2023 14:08:13 +0100	[thread overview]
Message-ID: <20230109130822.1657470-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230109130822.1657470-1-a.fatoum@pengutronix.de>

Like already done for sama5d2 and sama5d3, provide a set of helpers for
use in device-tree-enabled SAMA5D4 boards.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-at91/ddramc.c                        | 7 +++++++
 arch/arm/mach-at91/include/mach/barebox-arm.h      | 4 ++++
 arch/arm/mach-at91/include/mach/ddramc.h           | 1 +
 arch/arm/mach-at91/include/mach/sama5_bootsource.h | 3 +++
 4 files changed, 15 insertions(+)

diff --git a/arch/arm/mach-at91/ddramc.c b/arch/arm/mach-at91/ddramc.c
index 6383789f641f..1e94fbf9ee67 100644
--- a/arch/arm/mach-at91/ddramc.c
+++ b/arch/arm/mach-at91/ddramc.c
@@ -33,6 +33,13 @@ void __noreturn sama5d3_barebox_entry(unsigned int r4, void *boarddata)
 	barebox_arm_entry(SAMA5_DDRCS, at91sama5d3_get_ddram_size(),
 			  boarddata);
 }
+void __noreturn sama5d4_barebox_entry(unsigned int r4, void *boarddata)
+{
+	__sama5d4_stashed_bootrom_r4 = r4;
+
+	barebox_arm_entry(SAMA5_DDRCS, at91sama5d4_get_ddram_size(),
+			  boarddata);
+}
 
 static int sama5_ddr_probe(struct device *dev)
 {
diff --git a/arch/arm/mach-at91/include/mach/barebox-arm.h b/arch/arm/mach-at91/include/mach/barebox-arm.h
index f6bdd5ab2375..707444180c36 100644
--- a/arch/arm/mach-at91/include/mach/barebox-arm.h
+++ b/arch/arm/mach-at91/include/mach/barebox-arm.h
@@ -5,6 +5,7 @@
 #include <asm/barebox-arm.h>
 #include <asm/common.h>
 #include <mach/sama5d3.h>
+#include <mach/sama5d4.h>
 
 #define SAMA5_ENTRY_FUNCTION(name, stack_top, r4)				\
 	void name (u32 r0, u32 r1, u32 r2, u32 r3);				\
@@ -29,4 +30,7 @@
 #define SAMA5D3_ENTRY_FUNCTION(name, r4)					\
 	SAMA5_ENTRY_FUNCTION(name, SAMA5D3_SRAM_BASE + SAMA5D3_SRAM_SIZE, r4)
 
+#define SAMA5D4_ENTRY_FUNCTION(name, r4)					\
+	SAMA5_ENTRY_FUNCTION(name, SAMA5D4_SRAM_BASE + SAMA5D4_SRAM_SIZE, r4)
+
 #endif
diff --git a/arch/arm/mach-at91/include/mach/ddramc.h b/arch/arm/mach-at91/include/mach/ddramc.h
index 7daef1763641..d09392262e39 100644
--- a/arch/arm/mach-at91/include/mach/ddramc.h
+++ b/arch/arm/mach-at91/include/mach/ddramc.h
@@ -34,5 +34,6 @@ void at91_lpddr1_sdram_initialize(void __iomem *base_address,
 
 void __noreturn sama5d2_barebox_entry(unsigned int r4, void *boarddata);
 void __noreturn sama5d3_barebox_entry(unsigned int r4, void *boarddata);
+void __noreturn sama5d4_barebox_entry(unsigned int r4, void *boarddata);
 
 #endif /* #ifndef __DDRAMC_H__ */
diff --git a/arch/arm/mach-at91/include/mach/sama5_bootsource.h b/arch/arm/mach-at91/include/mach/sama5_bootsource.h
index 931e1f29c8e0..b31d20bc7c34 100644
--- a/arch/arm/mach-at91/include/mach/sama5_bootsource.h
+++ b/arch/arm/mach-at91/include/mach/sama5_bootsource.h
@@ -49,6 +49,9 @@ static inline int sama5_bootsource_instance(u32 reg)
 #define __sama5d3_stashed_bootrom_r4 \
 	(*(volatile u32 *)(SAMA5D3_SRAM_BASE + SAMA5D3_SRAM_SIZE - 0x4))
 
+#define __sama5d4_stashed_bootrom_r4 \
+	(*(volatile u32 *)(SAMA5D4_SRAM_BASE + SAMA5D4_SRAM_SIZE - 0x4))
+
 static inline void __noreturn sama5_boot_xload(void __noreturn (*bb)(void), u32 r4)
 {
 	asm volatile("mov r4, %0" : : "r"(r4) : );
-- 
2.30.2




  parent reply	other threads:[~2023-01-09 13:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 13:08 [PATCH v2 00/11] ARM: at91: sama5d4: add basic Wifx L1 support Ahmad Fatoum
2023-01-09 13:08 ` [PATCH v2 01/11] ARM: at91: sama5: switch to nonnaked entry functions Ahmad Fatoum
2023-01-09 13:08 ` Ahmad Fatoum [this message]
2023-01-09 13:08 ` [PATCH v2 03/11] ARM: at91: sama5d4: enable for DT use Ahmad Fatoum
2023-01-11 10:37   ` Sascha Hauer
2023-01-09 13:08 ` [PATCH v2 04/11] net: macb: match atmel,sama5d4-gem compatible Ahmad Fatoum
2023-01-09 13:08 ` [PATCH v2 05/11] i2c: at91: extend for SAMA5D4 support Ahmad Fatoum
2023-01-09 13:08 ` [PATCH v2 06/11] eeprom: at24: add 24mac402/602 support Ahmad Fatoum
2023-01-09 13:08 ` [PATCH v2 07/11] driver: always ensure probe of RAM registered with mem_platform_driver Ahmad Fatoum
2023-01-09 13:08 ` [PATCH v2 08/11] common: deep-probe: don't build without CONFIG_OFDEVICE Ahmad Fatoum
2023-01-09 13:08 ` [PATCH v2 09/11] pinctrl: at91: make deep-probe compatible Ahmad Fatoum
2023-01-09 13:08 ` [PATCH v2 10/11] ARM: at91: make bootsource code generic to all SAMA5 Ahmad Fatoum
2023-01-09 13:08 ` [PATCH v2 11/11] ARM: at91: SAMA5D4: add Wifx L1 support Ahmad Fatoum
2023-01-10 15:05 ` [PATCH v2 00/11] ARM: at91: sama5d4: add basic " 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=20230109130822.1657470-3-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