mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: barebox@lists.infradead.org
Cc: Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH v1 6/8] ARM: at91: Make sdramc.h useable in multi image builds
Date: Sun, 15 May 2022 21:38:05 +0200	[thread overview]
Message-ID: <20220515193807.354903-7-sam@ravnborg.org> (raw)
In-Reply-To: <20220515193807.354903-1-sam@ravnborg.org>

There is no need to ifdef out all the static inlines as the headers
no longer conflicts. Drop the ifdefs so we can now use the header
in multi image builds.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 .../mach-at91/include/mach/at91sam9_sdramc.h  | 45 ++-----------------
 1 file changed, 4 insertions(+), 41 deletions(-)

diff --git a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
index c34668d7b..fe76f60b0 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
@@ -177,6 +177,10 @@
 
 #ifndef __ASSEMBLY__
 #include <io.h>
+#include <mach/at91sam9260.h>
+#include <mach/at91sam9261.h>
+#include <mach/at91sam9263.h>
+
 static inline u32 at91_get_sdram_size(void *base)
 {
 	u32 val;
@@ -203,14 +207,11 @@ static inline u32 at91_get_sdram_size(void *base)
 	return size;
 }
 
-
 static inline bool at91_is_low_power_sdram(void *base)
 {
 	return readl(base + AT91_SDRAMC_MDR) & AT91_SDRAMC_MD_LOW_POWER_SDRAM;
 }
 
-#ifdef CONFIG_SOC_AT91SAM9260
-#include <mach/at91sam9260.h>
 static inline u32 at91sam9260_get_sdram_size(void)
 {
 	return at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC));
@@ -220,20 +221,7 @@ static inline bool at91sam9260_is_low_power_sdram(void)
 {
 	return at91_is_low_power_sdram(IOMEM(AT91SAM9260_BASE_SDRAMC));
 }
-#else
-static inline u32 at91sam9260_get_sdram_size(void)
-{
-	return 0;
-}
-
-static inline bool at91sam9260_is_low_power_sdram(void)
-{
-	return false;
-}
-#endif
 
-#ifdef CONFIG_SOC_AT91SAM9261
-#include <mach/at91sam9261.h>
 static inline u32 at91sam9261_get_sdram_size(void)
 {
 	return at91_get_sdram_size(IOMEM(AT91SAM9261_BASE_SDRAMC));
@@ -243,20 +231,7 @@ static inline bool at91sam9261_is_low_power_sdram(void)
 {
 	return at91_is_low_power_sdram(IOMEM(AT91SAM9261_BASE_SDRAMC));
 }
-#else
-static inline u32 at91sam9261_get_sdram_size(void)
-{
-	return 0;
-}
-
-static inline bool at91sam9261_is_low_power_sdram(void)
-{
-	return false;
-}
-#endif
 
-#ifdef CONFIG_SOC_AT91SAM9263
-#include <mach/at91sam9263.h>
 static inline u32 at91sam9263_get_sdram_size(int bank)
 {
 	switch (bank) {
@@ -280,18 +255,6 @@ static inline bool at91sam9263_is_low_power_sdram(int bank)
 		return false;
 	}
 }
-#else
-static inline u32 at91sam9263_get_sdram_size(int bank)
-{
-	return 0;
-}
-
-static inline bool at91sam9263_is_low_power_sdram(void)
-{
-	return false;
-}
-#endif
 
 #endif
-
 #endif
-- 
2.34.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  parent reply	other threads:[~2022-05-15 19:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15 19:37 [RFC PATCH v1 0/8] ARM: at91: Add pbl support to skov-arm9cpu Sam Ravnborg
2022-05-15 19:38 ` [PATCH v1 1/8] pwm: atmel: Fix build and update Sam Ravnborg
2022-05-15 19:38 ` [PATCH v1 2/8] ARM: at91: Provide at91_mux_pio_pin for use in lowlevel Sam Ravnborg
2022-05-15 19:38 ` [PATCH v1 3/8] ARM: at91: Add at91sam9 xload_mmc for PBL use Sam Ravnborg
2022-05-15 19:38 ` [PATCH v1 4/8] ARM: at91: Add extra register definitions Sam Ravnborg
2022-05-15 19:38 ` [PATCH v1 5/8] ARM: at91: Add lowlevel helpers for at91sam9263 Sam Ravnborg
2022-05-15 19:38 ` Sam Ravnborg [this message]
2022-05-15 19:38 ` [PATCH v1 7/8] ARM: at91: Add initialize function to sdramc Sam Ravnborg
2022-05-16 10:47   ` Ahmad Fatoum
2022-05-16 15:13     ` Sam Ravnborg
2022-05-15 19:38 ` [PATCH v1 8/8] ARM: at91: Add xload support to skov-arm9cpu Sam Ravnborg
2022-05-16 11:15   ` Ahmad Fatoum
2022-05-16 15:28     ` Sam Ravnborg
2022-05-16 15:35       ` Ahmad Fatoum
2022-05-16 15:47         ` Ahmad Fatoum
2022-05-30  7:20 ` [RFC PATCH v1 0/8] ARM: at91: Add pbl " Sam Ravnborg
2022-06-28 19:23 ` Sam Ravnborg
2022-06-28 21:12   ` Ahmad Fatoum
2022-06-28 21:18     ` Sam Ravnborg
2022-06-28 21:20       ` Ahmad Fatoum

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=20220515193807.354903-7-sam@ravnborg.org \
    --to=sam@ravnborg.org \
    --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