mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Oleksij Rempel <linux@rempel-privat.de>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	barebox@lists.infradead.org
Subject: Re: [PATCH v2 2/6] ARM: at91: xload-mmc: add sama5d3_atmci_start_image() helper
Date: Fri, 23 Apr 2021 17:56:43 +0200	[thread overview]
Message-ID: <47f914b9-1764-f3c7-9bab-9203c387af25@pengutronix.de> (raw)
In-Reply-To: <b4c7ee6f-7ef1-1c6b-be6f-bc44b81ccfdf@rempel-privat.de>

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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-04-23 15:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 14:28 [PATCH v2 0/6] add multiimage support for sama5d3 based microchip-ksz9477-evb board Oleksij Rempel
2021-04-23 14:28 ` [PATCH v2 1/6] mci: atmel_mci: add PBL support Oleksij Rempel
2021-04-23 14:28 ` [PATCH v2 2/6] ARM: at91: xload-mmc: add sama5d3_atmci_start_image() helper Oleksij Rempel
2021-04-23 15:26   ` Ahmad Fatoum
2021-04-23 15:54     ` Oleksij Rempel
2021-04-23 15:56       ` Ahmad Fatoum [this message]
2021-05-03 10:51   ` Sascha Hauer
2021-04-23 14:28 ` [PATCH v2 3/6] ARM: at91: ddramc: add sama5d3_barebox_entry() handler Oleksij Rempel
2021-04-23 14:28 ` [PATCH v2 4/6] ARM: at91: add __sama5d3_stashed_bootrom_r4 helper Oleksij Rempel
2021-04-23 14:28 ` [PATCH v2 5/6] ARM: at91: add sama5d3_lowlevel_init() helpers Oleksij Rempel
2021-04-23 14:28 ` [PATCH v2 6/6] ARM: at91: sama5d3: add multiimage support for the microchip-ksz9477-evb Oleksij Rempel
2021-04-23 15:29   ` Ahmad Fatoum
2021-04-23 15:51     ` Oleksij Rempel
2021-04-23 15:58       ` Ahmad Fatoum
2021-05-03 10:51 ` [PATCH v2 0/6] add multiimage support for sama5d3 based microchip-ksz9477-evb board 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=47f914b9-1764-f3c7-9bab-9203c387af25@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=linux@rempel-privat.de \
    --cc=o.rempel@pengutronix.de \
    /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