All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Branden <sbranden@broadcom.com>
To: Stefan Wahren <stefan.wahren@i2se.com>,
	Ray Jui <rjui@broadcom.com>, Jon Mason <jonmason@broadcom.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Lee Jones <lee@kernel.org>, Eric Anholt <eric@anholt.net>
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	kernel@martin.sperl.org, devicetree@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH 4/5 RFC] mmc: sdhci-iproc: add bcm2835 support
Date: Mon, 18 Jan 2016 13:47:21 -0800	[thread overview]
Message-ID: <569D5D69.9000003@broadcom.com> (raw)
In-Reply-To: <1453042744-16196-5-git-send-email-stefan.wahren@i2se.com>

Hi Stefan,

The caps likely need to be looked at in greater detail. Some comments 
inline.

Regards,
  Scott

On 16-01-17 06: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.
>
> Suggested-by: Scott Branden <sbranden@broadcom.com>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
>   drivers/mmc/host/Kconfig       |    6 +++---
>   drivers/mmc/host/sdhci-iproc.c |   20 ++++++++++++++++++--
>   2 files changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index 1526b8a..60de1e4 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -318,15 +318,15 @@ config MMC_SDHCI_F_SDH30
>   	  If unsure, say N.
>
>   config MMC_SDHCI_IPROC
> -	tristate "SDHCI platform support for the iProc SD/MMC Controller"
> -	depends on ARCH_BCM_IPROC || COMPILE_TEST
> +	tristate "SDHCI support for the BCM2835 & iProc SD/MMC Controller"
> +	depends on ARCH_BCM2835 || ARCH_BCM_IPROC || COMPILE_TEST
>   	depends on MMC_SDHCI_PLTFM
>   	default ARCH_BCM_IPROC
>   	select MMC_SDHCI_IO_ACCESSORS
>   	help
>   	  This selects the iProc SD/MMC controller.
>
> -	  If you have an IPROC platform with SD or MMC devices,
> +	  If you have a BCM2835 or IPROC platform with SD or MMC devices,
>   	  say Y or M here.
>
>   	  If unsure, say N.
> diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
> index 55bc348..88399eb 100644
> --- a/drivers/mmc/host/sdhci-iproc.c
> +++ b/drivers/mmc/host/sdhci-iproc.c
> @@ -167,7 +167,20 @@ static const struct sdhci_iproc_data iproc_data = {
>   	.caps1 = 0x00000064,
>   };
>
> +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,
caps here may be closer to iproc settings - need to review this.

> +};
> +
>   static const struct of_device_id sdhci_iproc_of_match[] = {
> +	{ .compatible = "brcm,bcm2835-sdhci", .data = &bcm2835_data },
>   	{ .compatible = "brcm,sdhci-iproc-cygnus", .data = &iproc_data },
>   	{ }
>   };
> @@ -180,6 +193,7 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
>   	struct sdhci_host *host;
>   	struct sdhci_iproc_host *iproc_host;
>   	struct sdhci_pltfm_host *pltfm_host;
> +	struct device_node *np = pdev->dev.of_node;
>   	int ret;
>
>   	match = of_match_device(sdhci_iproc_of_match, &pdev->dev);
> @@ -199,8 +213,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
>   	mmc_of_parse(host->mmc);
>   	sdhci_get_of_property(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;
It is fine to limit this to cygnus.  But, it may work on RPI as well for 
higher speed SD cards...
> +	}
>
>   	pltfm_host->clk = devm_clk_get(&pdev->dev, NULL);
>   	if (IS_ERR(pltfm_host->clk)) {
>


  reply	other threads:[~2016-01-18 21:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-17 14:58 [PATCH 0/5 RFC] mmc: sdhci-iproc: add bcm2835 support Stefan Wahren
     [not found] ` <1453042744-16196-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2016-01-17 14:59   ` [PATCH 1/5 RFC] mmc: sdhci-iproc: Clean up platform allocations if shdci init fails Stefan Wahren
2016-01-18 21:31     ` Scott Branden
2016-01-27 14:16     ` Ulf Hansson
2016-01-17 14:59   ` [PATCH 2/5 RFC] mmc: sdhci-iproc: Actually enable the clock Stefan Wahren
2016-01-18 21:35     ` Scott Branden
     [not found]     ` <1453042744-16196-3-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2016-01-27 14:16       ` Ulf Hansson
2016-01-27 19:11         ` Stefan Wahren
2016-01-27 21:11           ` Ulf Hansson
2016-01-17 14:59   ` [PATCH 3/5 RFC] ARM: bcm283x: specify sdhci quirks in dtsi file Stefan Wahren
2016-01-18 21:40     ` Scott Branden
     [not found]     ` <1453042744-16196-4-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2016-01-26  4:31       ` Stephen Warren
2016-01-17 14:59   ` [PATCH 4/5 RFC] mmc: sdhci-iproc: add bcm2835 support Stefan Wahren
2016-01-18 21:47     ` Scott Branden [this message]
2016-01-19 19:25       ` Stefan Wahren
2016-01-19 19:47         ` Scott Branden
2016-01-19  1:32     ` Jaehoon Chung
     [not found]       ` <569D923D.60306-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-01-20 21:23         ` Stefan Wahren
     [not found]     ` <1453042744-16196-5-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2016-01-26  4:34       ` Stephen Warren
2016-01-17 14:59 ` [PATCH 5/5 RFC] DT: sdhci-iproc: add bcm2835 compatible Stefan Wahren
2016-01-18 21:47   ` Scott Branden
2016-01-20 16:50   ` Rob Herring
2016-01-19 21:00 ` [PATCH 0/5 RFC] mmc: sdhci-iproc: add bcm2835 support Eric Anholt
2016-01-20 21:18   ` Stefan Wahren
2016-01-28 22:19     ` Eric Anholt

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=569D5D69.9000003@broadcom.com \
    --to=sbranden@broadcom.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eric@anholt.net \
    --cc=jonmason@broadcom.com \
    --cc=kernel@martin.sperl.org \
    --cc=lee@kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=stefan.wahren@i2se.com \
    --cc=swarren@wwwdotorg.org \
    --cc=ulf.hansson@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.