Hi, On 23.04.21 17:54, Oleksij Rempel wrote: > Am 23.04.21 um 17:26 schrieb Ahmad Fatoum: >> Hello Oleksij, >> >> On 23.04.21 16:28, Oleksij Rempel wrote: >>> +void __noreturn sama5d3_atmci_start_image(u32 boot_src, unsigned int clock, >>> + unsigned int slot) >>> +{ >>> + void *buf = (void *)SAMA5_DDRCS; >>> + const struct atmci_instance *instance; >>> + struct pbl_bio bio; >>> + const s8 *pin; >>> + int ret; >>> + >>> + ret = sama5_bootsource_instance(boot_src); >>> + if (ret > ARRAY_SIZE(atmci_instances) - 1) >>> + panic("Couldn't determine boot MCI instance\n"); >>> + >>> + instance = &atmci_instances[boot_src]; >> >> What's the difference between slot and instance? > > there are 3 MCI controllers (instances), each controller has multiple > slots. Usually slots board specific and configured over devicetree. > >> Looks to me like you could drop slot in favor of instance and support >> booting from any controller with the same image? > > Currently it is not supported. For some reasons i was not able to detect > boot source. In any case, this can be investigated separately if some > will need this functionality. Ok. > >>> + >>> + sama5d3_pmc_enable_periph_clock(SAMA5D2_ID_PIOD); >>> + for (pin = instance->pins; *pin >= 0; pin++) { >>> + at91_mux_pio3_pin(IOMEM(SAMA5D3_BASE_PIOD), >>> + pin_to_mask(*pin), instance->periph, 0); >>> + } >>> + >>> + sama5d3_pmc_enable_periph_clock(instance->id); >>> + >>> + ret = at91_mci_bio_init(&bio, instance->base, clock, slot); >>> + if (ret) >>> + goto out_panic; >>> + >>> + at91_fat_start_image(&bio, buf, SZ_16M, boot_src); >>> + >>> +out_panic: >>> + panic("FAT chainloading failed\n"); >>> +} >>> >> > > > -- > Regards, > Oleksij > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox