[PATCH] at91: xload: Fix MCI instance selection for SAMA5D3

Alexander Shiyan eagle.alexander923 at gmail.com
Fri May 23 00:44:19 PDT 2025


Use the result of sama5_bootsource_instance(r4) instead of raw r4
to determine the MCI instance index.

Signed-off-by: Alexander Shiyan <eagle.alexander923 at gmail.com>
---
 arch/arm/mach-at91/xload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/xload.c b/arch/arm/mach-at91/xload.c
index 709bf05487..fd3878269e 100644
--- a/arch/arm/mach-at91/xload.c
+++ b/arch/arm/mach-at91/xload.c
@@ -218,7 +218,7 @@ void __noreturn sama5d3_atmci_start_image(u32 r4, unsigned int clock,
 	if (ret > ARRAY_SIZE(sama5d3_mci_instances) - 1)
 		panic("Couldn't determine boot MCI instance\n");
 
-	instance = &sama5d3_mci_instances[r4];
+	instance = &sama5d3_mci_instances[ret];
 
 	sama5d3_pmc_enable_periph_clock(SAMA5D3_ID_PIOD);
 	for (pin = instance->pins; *pin >= 0; pin++) {
-- 
2.39.1




More information about the barebox mailing list