From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Loc Ho <lho@apm.com>,
chris@printf.net, ulf.hansson@linaro.org,
michal.simek@xilinx.com, devicetree@vger.kernel.org,
linux-mmc@vger.kernel.org, patches@apm.com, jcm@redhat.com
Subject: Re: [PATCH 2/3] mmc: Add APM X-Gene SoC SDHC controller support to Arasan SDHCI driver
Date: Mon, 19 May 2014 11:07:51 +0200 [thread overview]
Message-ID: <5286335.Al3nIKDAQo@wuerfel> (raw)
In-Reply-To: <1400398918-1502-3-git-send-email-lho@apm.com>
On Sunday 18 May 2014 01:41:57 Loc Ho wrote:
> @@ -34,6 +36,19 @@
> */
> struct sdhci_arasan_data {
> struct clk *clk_ahb;
> + struct platform_device *pdev;
> + void __iomem *ahb_aim_csr;
> + const struct sdhci_arasan_ahb_ops *ahb_ops;
> +};
> +
> +/**
> + * struct sdhci_arasan_ahb_ops
> + * @init_ahb Initialize translation bus
> + * @xlat_addr Set up an 64-bit addressing translation
> + */
> +struct sdhci_arasan_ahb_ops {
> + int (*init_ahb)(struct sdhci_arasan_data *data);
> + void (*xlat_addr)(struct sdhci_arasan_data *data, u64 dma_addr);
> };
>
> static unsigned int sdhci_arasan_get_timeout_clock(struct sdhci_host *host)
> @@ -51,7 +66,21 @@ static unsigned int sdhci_arasan_get_timeout_clock(struct sdhci_host *host)
> return freq;
> }
>
> +static void sdhci_arasan_writel(struct sdhci_host *host, u32 val, int reg)
> +{
> + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> + struct sdhci_arasan_data *sdhci_arasan = pltfm_host->priv;
> +
> + if (reg == SDHCI_DMA_ADDRESS) {
> + if (sdhci_arasan->ahb_ops && sdhci_arasan->ahb_ops->xlat_addr)
> + sdhci_arasan->ahb_ops->xlat_addr(sdhci_arasan,
> + sg_dma_address(host->data->sg));
> + }
> + writel(val, host->ioaddr + reg);
> +}
> +
> static struct sdhci_ops sdhci_arasan_ops = {
> + .write_l = sdhci_arasan_writel,
> .get_max_clock = sdhci_pltfm_clk_get_max_clock,
> .get_timeout_clock = sdhci_arasan_get_timeout_clock,
> };
This looks like you are doing it at the wrong place. From what I understand,
you are using the AHB inbound window as a minimal IOMMU. Why don't you make
this a proper IOMMU driver instead and leave the SDHCI driver unchanged?
Arnd
next prev parent reply other threads:[~2014-05-19 9:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 7:41 [PATCH 0/3] mmc: Add APM X-Gene SoC SDHC controller support to Arasan SDHCI driver Loc Ho
[not found] ` <1400398918-1502-1-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
2014-05-18 7:41 ` [PATCH 1/3] Documentation: Update Arasan SDHC documentation for the APM X-Gene SoC SDHC DTS binding Loc Ho
[not found] ` <1400398918-1502-2-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
2014-05-18 7:41 ` [PATCH 2/3] mmc: Add APM X-Gene SoC SDHC controller support to Arasan SDHCI driver Loc Ho
[not found] ` <1400398918-1502-3-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
2014-05-18 7:41 ` [PATCH 3/3] arm64: Add APM X-Gene SoC SDHC controller DTS entry Loc Ho
2014-05-19 9:07 ` Arnd Bergmann [this message]
2014-05-29 18:45 ` [PATCH 2/3] mmc: Add APM X-Gene SoC SDHC controller support to Arasan SDHCI driver Loc Ho
2014-05-19 9:09 ` [PATCH 1/3] Documentation: Update Arasan SDHC documentation for the APM X-Gene SoC SDHC DTS binding Arnd Bergmann
2014-05-19 12:32 ` Mark Rutland
2014-05-29 18:54 ` Loc Ho
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=5286335.Al3nIKDAQo@wuerfel \
--to=arnd@arndb.de \
--cc=chris@printf.net \
--cc=devicetree@vger.kernel.org \
--cc=jcm@redhat.com \
--cc=lho@apm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=patches@apm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).