* [PATCH] at91: sama5d2: Do not use the contents of BSC_CR if the DISABLE_BSCR bit is set in the fuse
@ 2025-03-05 7:48 Alexander Shiyan
2025-03-07 8:03 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2025-03-05 7:48 UTC (permalink / raw)
To: barebox; +Cc: Alexander Shiyan
The DISABLE_BSCR bit in Fuse means "Does not read BSC_CR content,
so the Boot settings are those from the Fuse".
Let's ignore BSC_CR it this case.
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
include/mach/at91/sama5d2.h | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/include/mach/at91/sama5d2.h b/include/mach/at91/sama5d2.h
index 90b566ffc4..d8a450255f 100644
--- a/include/mach/at91/sama5d2.h
+++ b/include/mach/at91/sama5d2.h
@@ -305,16 +305,18 @@ static inline void __iomem *sama5d2_pio_map_bank(int bank, unsigned *id)
static inline u32 sama5d2_bootcfg(void)
{
- u32 __iomem *bureg = SAMA5D2_BASE_SECURAM + 0x1400;
- u32 bsc_cr = readl(SAMA5D2_BASE_SYSC + 0x54);
- u32 __iomem *bootcfg;
+ u32 bsc_cr, bootcfg = readl(SAMA5D2_SFC_DR(16));
- if (bsc_cr & SAMA5D2_BUREG_VALID)
- bootcfg = &bureg[FIELD_GET(SAMA5D2_BUREG_INDEX, bsc_cr)];
- else
- bootcfg = SAMA5D2_SFC_DR(512 / 32);
+ if (bootcfg & SAMA5D2_DISABLE_BSC_CR)
+ return bootcfg;
- return readl(bootcfg);
+ bsc_cr = readl(SAMA5D2_BASE_SYSC + 0x54);
+ if (bsc_cr & SAMA5D2_BUREG_VALID) {
+ u32 __iomem *bureg = SAMA5D2_BASE_SECURAM + 0x1400;
+ bootcfg = readl(&bureg[FIELD_GET(SAMA5D2_BUREG_INDEX, bsc_cr)]);
+ }
+
+ return bootcfg;
}
#endif
--
2.39.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-07 8:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-05 7:48 [PATCH] at91: sama5d2: Do not use the contents of BSC_CR if the DISABLE_BSCR bit is set in the fuse Alexander Shiyan
2025-03-07 8:03 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox