[PATCH v1 1/6] mci: atmel_mci: add PBL support

Sascha Hauer sha at pengutronix.de
Tue Apr 13 05:58:10 BST 2021


On Fri, Apr 09, 2021 at 03:11:44PM +0200, Oleksij Rempel wrote:
> +int at91_mci_bio_init(struct pbl_bio *bio, void __iomem *base,
> +		      unsigned int clock, unsigned int slot)
> +{
> +	struct atmel_mci_priv *priv = &atmci_sdcard;
> +	struct atmel_mci *host = &priv->host;
> +	struct mci_ios ios = { .bus_width = MMC_BUS_WIDTH_4, .clock = 25000000 };
> +
> +	bio->priv = priv;
> +	bio->read = at91_mci_bio_read;
> +
> +	host->regs = base;
> +
> +	atmci_get_cap(host);
> +
> +	/* get real HZ */
> +	host->bus_hz = clock;
> +
> +	host->slot_b = slot;
> +	if (host->slot_b)
> +		host->sdc_reg = ATMCI_SDCSEL_SLOT_B;
> +	else
> +		host->sdc_reg = ATMCI_SDCSEL_SLOT_A;
> +
> +	atmci_writel(host, ATMCI_DTOR, 0x7f);
> +
> +	atmci_common_set_ios(host, &ios);

Is it necessary to call this? The ROM should have already configured the
controller. By relying on this you could drop the controller
initialization code from PBL.

Sascha

-- 
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 |



More information about the barebox mailing list