[PATCH 4/5 RFC] mmc: sdhci-iproc: add bcm2835 support

Stephen Warren swarren at wwwdotorg.org
Mon Jan 25 20:34:04 PST 2016


On 01/17/2016 07:59 AM, Stefan Wahren wrote:
> Scott Branden from Broadcom said that the BCM2835 eMMC IP core is
> very similar to IPROC and share most of the quirks. So use this driver
> instead of separate one.
> 
> The sdhci-iproc contains a better workaround for the clock domain
> crossing problem which doesn't need any delays. This results in a
> better write performance.
> 
> Btw we get the rid of the SDHCI_CAPABILITIES hack in the sdhci_readl
> function.

> diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c

> +static const struct sdhci_pltfm_data sdhci_bcm2835_pltfm_data = {
> +	.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
> +		| SDHCI_QUIRK_MISSING_CAPS,
> +	.ops = &sdhci_iproc_ops,
> +};
> +
> +static const struct sdhci_iproc_data bcm2835_data = {
> +	.pdata = &sdhci_bcm2835_pltfm_data,
> +	.caps = SDHCI_CAN_VDD_330,
> +	.caps1 = 0x00000000,
> +};

> @@ -199,8 +213,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev)

> -	/* Enable EMMC 1/8V DDR capable */
> -	host->mmc->caps |= MMC_CAP_1_8V_DDR;
> +	if (of_device_is_compatible(np, "brcm,sdhci-iproc-cygnus")) {
> +		/* Enable EMMC 1/8V DDR capable */
> +		host->mmc->caps |= MMC_CAP_1_8V_DDR;
> +	}

Rather that placing device-specific of_device_is_compatible() throughout
the driver, I think it'd be better to key off a field in bcm2835_data or
sdhci_bcm2835_pltfm_data. That way, if the driver starts supporting
additional devices that want this MMC_CAP_1_8V_DDR, you can simply set
that up in the relevant data structure, rather than adding a mess of
of_device_is_compatible("a") || of_device_is_compatible("b") || ... to
the code.



More information about the linux-rpi-kernel mailing list