From: Adrian Hunter <adrian.hunter@intel.com>
To: Gregory CLEMENT <gregory.clement@free-electrons.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc@vger.kernel.org
Cc: Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
devicetree@vger.kernel.org,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
linux-arm-kernel@lists.infradead.org,
Ziji Hu <huziji@marvell.com>, "Jack(SH) Zhu" <jmzhu@marvell.com>,
Jimmy Xu <zmxu@marvell.com>, Jisheng Zhang <jszhang@marvell.com>,
Nadav Haklai <nadavh@marvell.com>, Ryan Gao <ygao@marvell.com>,
Doug Jones <dougj@marvell.com>,
Shiwu Zhang <zhangshw@marvell.com>, Victor Gu <xigu@marvell.com>,
"Wei(SOCP) Liu" <liuw@marvell.com>,
Wilson Ding <dingwei@marvell.com>,
Xueping Liu <xpliu@marvell.com>,
Hilbert Zhang <zzhang@marvell.com>, Keji Zhang <keji@marvell.com>,
Liuliu Zhao <zhaoliul@marvell.com>,
Peng Zhu <zhupeng@marvell.com>, Yu Cao <yucao@marvell.com>,
Romain Perier <romain.perier@free-electrons.com>,
Yehuda Yitschak <yehuday@marvell.com>,
Marcin Wojtas <mw@semihalf.com>, Hanna Hawa <hannah@marvell.com>,
Kostya Porotchkin <kostap@marvell.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/10] mmc: sdhci-xenon: Add support to PHYs of Marvell Xenon SDHC
Date: Tue, 11 Oct 2016 15:39:17 +0300 [thread overview]
Message-ID: <bfe30317-bb3b-b3dc-e9df-87b6ba100307@intel.com> (raw)
In-Reply-To: <e08ffb085d02a784b28456ac47fa4dc6540a9139.1475853198.git-series.gregory.clement@free-electrons.com>
On 07/10/16 18:22, Gregory CLEMENT wrote:
> From: Ziji Hu <huziji@marvell.com>
>
> Marvell Xenon eMMC/SD/SDIO Host Controller contains PHY.
> Three types of PHYs are supported.
>
> Add support to multiple types of PHYs init and configuration.
> Add register definitions of PHYs.
>
> Signed-off-by: Hu Ziji <huziji@marvell.com>
> Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
> MAINTAINERS | 1 +-
> drivers/mmc/host/Makefile | 2 +-
> drivers/mmc/host/sdhci-xenon-phy.c | 1141 +++++++++++++++++++++++++++++-
> drivers/mmc/host/sdhci-xenon-phy.h | 157 ++++-
> drivers/mmc/host/sdhci-xenon.c | 4 +-
> drivers/mmc/host/sdhci-xenon.h | 17 +-
> 6 files changed, 1321 insertions(+), 1 deletion(-)
> create mode 100644 drivers/mmc/host/sdhci-xenon-phy.c
> create mode 100644 drivers/mmc/host/sdhci-xenon-phy.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 859420e5dfd3..b5673c2ee5f2 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7583,6 +7583,7 @@ M: Ziji Hu <huziji@marvell.com>
> L: linux-mmc@vger.kernel.org
> S: Supported
> F: drivers/mmc/host/sdhci-xenon.*
> +F: drivers/mmc/host/sdhci-xenon-phy.*
> F: Documentation/devicetree/bindings/mmc/marvell,sdhci-xenon.txt
>
> MATROX FRAMEBUFFER DRIVER
> diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
> index 75eaf743486c..4f2854556ff7 100644
> --- a/drivers/mmc/host/Makefile
> +++ b/drivers/mmc/host/Makefile
> @@ -82,4 +82,4 @@ ifeq ($(CONFIG_CB710_DEBUG),y)
> endif
>
> obj-$(CONFIG_MMC_SDHCI_XENON) += sdhci-xenon-driver.o
> -sdhci-xenon-driver-y += sdhci-xenon.o
> +sdhci-xenon-driver-y += sdhci-xenon.o sdhci-xenon-phy.o
> diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c
> new file mode 100644
> index 000000000000..4eb8fea1bec9
> --- /dev/null
> +++ b/drivers/mmc/host/sdhci-xenon-phy.c
<SNIP>
> +static int __xenon_emmc_delay_adj_test(struct mmc_card *card)
> +{
> + int err;
> + u8 *ext_csd = NULL;
> +
> + err = mmc_get_ext_csd(card, &ext_csd);
> + kfree(ext_csd);
> +
> + return err;
> +}
> +
> +static int __xenon_sdio_delay_adj_test(struct mmc_card *card)
> +{
> + struct mmc_command cmd = {0};
> + int err;
> +
> + cmd.opcode = SD_IO_RW_DIRECT;
> + cmd.flags = MMC_RSP_R5 | MMC_CMD_AC;
> +
> + err = mmc_wait_for_cmd(card->host, &cmd, 0);
> + if (err)
> + return err;
> +
> + if (cmd.resp[0] & R5_ERROR)
> + return -EIO;
> + if (cmd.resp[0] & R5_FUNCTION_NUMBER)
> + return -EINVAL;
> + if (cmd.resp[0] & R5_OUT_OF_RANGE)
> + return -ERANGE;
> + return 0;
> +}
> +
> +static int __xenon_sd_delay_adj_test(struct mmc_card *card)
> +{
> + struct mmc_command cmd = {0};
> + int err;
> +
> + cmd.opcode = MMC_SEND_STATUS;
> + cmd.arg = card->rca << 16;
> + cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
> +
> + err = mmc_wait_for_cmd(card->host, &cmd, 0);
> + return err;
> +}
> +
> +static int xenon_delay_adj_test(struct mmc_card *card)
> +{
> + WARN_ON(!card);
> + WARN_ON(!card->host);
> +
> + if (mmc_card_mmc(card))
> + return __xenon_emmc_delay_adj_test(card);
> + else if (mmc_card_sd(card))
> + return __xenon_sd_delay_adj_test(card);
> + else if (mmc_card_sdio(card))
> + return __xenon_sdio_delay_adj_test(card);
> + else
> + return -EINVAL;
> +}
So you are issuing commands from the ->set_ios() callback. I would want to
get Ulf's OK for that before going further.
One thing: you will need to ensure you don't trigger get HS400 re-tuning
because it will call back into ->set_ios().
And you have the problem that you need to get a reference to the card before
the card device has been added. As I wrote in response to the previous
patch, you should get Ulf's help with that too.
next prev parent reply other threads:[~2016-10-11 12:46 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-07 15:22 [PATCH 0/10] mmc: Add support to Marvell Xenon SD Host Controller Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 1/10] mmc: sdhci: Export sdhci_set_ios() from sdhci.c Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 2/10] mmc: sdhci: Export sdhci_start_signal_voltage_switch() in sdhci.c Gregory CLEMENT
2016-10-08 2:40 ` Shawn Lin
2016-10-08 6:26 ` Ziji Hu
2016-10-07 15:22 ` [PATCH 3/10] mmc: sdhci: Export sdhci_execute_tuning() " Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 4/10] MAINTAINERS: add entry for Marvell Xenon MMC Host Controller drivers Gregory CLEMENT
2016-10-07 20:44 ` Joe Perches
2016-10-08 0:59 ` Ziji Hu
2016-10-07 15:22 ` [PATCH 5/10] dt: bindings: Add bindings for Marvell Xenon SD Host Controller Gregory CLEMENT
2016-10-10 21:34 ` Rob Herring
2016-10-11 10:03 ` Ziji Hu
2016-10-18 13:29 ` Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 6/10] mmc: sdhci-xenon: Add Marvell Xenon SDHC core functionality Gregory CLEMENT
2016-10-11 12:37 ` Adrian Hunter
2016-10-12 11:58 ` Ziji Hu
2016-10-12 13:07 ` Adrian Hunter
2016-10-13 5:38 ` Ziji Hu
2016-10-17 8:14 ` Adrian Hunter
2016-10-18 12:09 ` Ziji Hu
2016-10-07 15:22 ` [PATCH 7/10] mmc: sdhci-xenon: Add support to PHYs of Marvell Xenon SDHC Gregory CLEMENT
2016-10-08 2:44 ` Shawn Lin
2016-10-08 9:28 ` Ziji Hu
2016-10-09 13:34 ` Shawn Lin
2016-10-11 12:39 ` Adrian Hunter [this message]
2016-10-12 12:17 ` Ziji Hu
2016-10-17 7:55 ` Adrian Hunter
2016-10-18 12:04 ` Ziji Hu
2016-10-18 13:09 ` Adrian Hunter
2016-10-07 15:22 ` [PATCH 8/10] arm64: dts: marvell: add eMMC support for Armada 37xx Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 9/10] arm64: dts: marvell: add sdhci support for Armada 7K/8K Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 10/10] arm64: configs: enable SDHCI driver for Xenon Gregory CLEMENT
-- strict thread matches above, loose matches on Subject: below --
2016-10-31 11:09 [PATCH 0/10] mmc: Add support to Marvell Xenon SD Host Controller Gregory CLEMENT
2016-10-31 11:09 ` [PATCH 7/10] mmc: sdhci-xenon: Add support to PHYs of Marvell Xenon SDHC Gregory CLEMENT
2016-11-24 9:56 ` Arnd Bergmann
2016-11-24 10:57 ` Ziji Hu
2016-11-24 11:09 ` Arnd Bergmann
2016-11-24 11:37 ` Ulf Hansson
2016-11-24 13:34 ` Ziji Hu
2016-11-24 14:33 ` Ulf Hansson
2016-11-24 15:37 ` Ziji Hu
2016-11-28 10:10 ` Ziji Hu
2016-11-28 11:13 ` Ulf Hansson
2016-11-28 11:38 ` Ziji Hu
2016-11-28 15:16 ` Ulf Hansson
2016-11-29 2:53 ` Ziji Hu
2016-11-29 7:49 ` Ulf Hansson
2016-11-29 10:33 ` Ziji Hu
2016-11-29 11:11 ` Ulf Hansson
2016-11-29 12:00 ` Ziji Hu
2016-11-28 11:09 ` Ulf Hansson
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=bfe30317-bb3b-b3dc-e9df-87b6ba100307@intel.com \
--to=adrian.hunter@intel.com \
--cc=andrew@lunn.ch \
--cc=devicetree@vger.kernel.org \
--cc=dingwei@marvell.com \
--cc=dougj@marvell.com \
--cc=gregory.clement@free-electrons.com \
--cc=hannah@marvell.com \
--cc=huziji@marvell.com \
--cc=jason@lakedaemon.net \
--cc=jmzhu@marvell.com \
--cc=jszhang@marvell.com \
--cc=keji@marvell.com \
--cc=kostap@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=liuw@marvell.com \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=robh+dt@kernel.org \
--cc=romain.perier@free-electrons.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=ulf.hansson@linaro.org \
--cc=xigu@marvell.com \
--cc=xpliu@marvell.com \
--cc=yehuday@marvell.com \
--cc=ygao@marvell.com \
--cc=yucao@marvell.com \
--cc=zhangshw@marvell.com \
--cc=zhaoliul@marvell.com \
--cc=zhupeng@marvell.com \
--cc=zmxu@marvell.com \
--cc=zzhang@marvell.com \
/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