at91: sama5d2: Do not use the contents of BSC_CR if the DISABLE_BSCR bit is set in the fuse
PATCH 1/1 at91: sama5d2: Do not use the contents of BSC_CR if the DISABLE_BSCR bit is set in the fuse
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 <[email protected]>
--- include/mach/at91/sama5d2.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
include/mach/at91/sama5d2.h +10 -8
@@ -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
Signature · 1 line
2.39.1
Sascha Hauer
AppliedQuoted 5 lines · Alexander Shiyan
The
DISABLE_BSCRbit in Fuse means "Does not readBSC_CRcontent, so the Boot settings are those from the Fuse".
Let's ignoreBSC_CRit this case.
Applied, thanks!
[1/1] at91: sama5d2: Do not use the contents of BSC_CR if the DISABLE_BSCR bit is set in the fuse
https://git.pengutronix.de/cgit/barebox/commit/?id=1d0c9343b7f4 (link may not be stable)
Best regards,
Signature · 1 line
Sascha Hauer <[email protected]>