mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: barebox@lists.infradead.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH] ARM: at91: setup: improve address handling for DBGU and CHIPID detection
Date: Wed, 18 Jun 2025 09:35:50 +0300	[thread overview]
Message-ID: <20250618063552.23777-3-eagle.alexander923@gmail.com> (raw)
In-Reply-To: <20250618063552.23777-1-eagle.alexander923@gmail.com>

This patch enhances type safety and replaces hardcoded addresses with
SoC-specific constants for DBGU and CHIPID detection.

Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
 arch/arm/mach-at91/setup.c   | 6 +++---
 include/mach/at91/hardware.h | 2 --
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index e8d45c30dd..e726495726 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -186,7 +186,7 @@ static void __init dbgu_soc_detect(u32 dbgu_base)
 	}
 }
 
-static void __init chipid_soc_detect(u32 chipid_base)
+static void __init chipid_soc_detect(void __iomem *chipid_base)
 {
 	u32 cidr, socid;
 
@@ -345,9 +345,9 @@ static int at91_detect(void)
 	if (!at91_soc_is_detected())
 		dbgu_soc_detect(AT91_BASE_DBGU1);
 	if (!at91_soc_is_detected())
-		dbgu_soc_detect(AT91_BASE_DBGU2);
+		dbgu_soc_detect(SAMA5D4_BASE_DBGU);
 	if (!at91_soc_is_detected())
-		chipid_soc_detect(0xfc069000);
+		chipid_soc_detect(SAMA5D2_BASE_CHIPID);
 
 	if (!at91_soc_is_detected())
 		panic("AT91: Impossible to detect the SOC type");
diff --git a/include/mach/at91/hardware.h b/include/mach/at91/hardware.h
index 5d2fd872ab..104ad11648 100644
--- a/include/mach/at91/hardware.h
+++ b/include/mach/at91/hardware.h
@@ -12,8 +12,6 @@
 #define AT91_BASE_DBGU0	0xfffff200
 /* 9263, 9g45 */
 #define AT91_BASE_DBGU1	0xffffee00
-/* sama5d4 */
-#define AT91_BASE_DBGU2	0xfc069000
 
 #include <mach/at91/at91rm9200.h>
 #include <mach/at91/at91sam9260.h>
-- 
2.39.1




  parent reply	other threads:[~2025-06-18  6:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18  6:35 [PATCH] ARM: at91: clock: remove unused SAMA5D2/SAMA5D3 support from legacy clock driver Alexander Shiyan
2025-06-18  6:35 ` [PATCH] ARM: at91: sam9x5ek: enable missing DT and clock options for devicetree boot Alexander Shiyan
2025-06-18 10:13   ` Sascha Hauer
2025-06-18  6:35 ` Alexander Shiyan [this message]
2025-06-18 10:13   ` [PATCH] ARM: at91: setup: improve address handling for DBGU and CHIPID detection Sascha Hauer
2025-06-18  6:35 ` [PATCH] ARM: at91: setup: refactor SoC subtype detection with switch statements Alexander Shiyan
2025-06-18 10:13   ` Sascha Hauer
2025-06-18  6:35 ` [PATCH] ARM: at91: xload: use pin_to_mask for peripheral pin configuration Alexander Shiyan
2025-06-18 10:13   ` (subset) " Sascha Hauer
2025-06-18 10:13   ` Sascha Hauer
2025-06-18 10:13 ` (subset) [PATCH] ARM: at91: clock: remove unused SAMA5D2/SAMA5D3 support from legacy clock driver 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=20250618063552.23777-3-eagle.alexander923@gmail.com \
    --to=eagle.alexander923@gmail.com \
    --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