linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH 07/07] ARM: shmobile: Koelsch SYS-DMAC and SDHI prototype
Date: Tue, 10 Jun 2014 23:04:07 +0000	[thread overview]
Message-ID: <20140610230407.13594.80741.sendpatchset@w520> (raw)

From: Magnus Damm <damm+renesas@opensource.se>

Hook up SYS-DMAC prototype support for SDHI on Koelsch.

Local platform device version of SYS-DMAC and local slave IDs
are used together with AUXDATA. CD and WP pins, regulators
and clocks are provided via DT.

Only the DT reference case is covered. Not for upstream merge.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 arch/arm/mach-shmobile/board-koelsch-reference.c |   61 +++++++++++++++++++++-
 1 file changed, 60 insertions(+), 1 deletion(-)

--- 0010/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ work/arch/arm/mach-shmobile/board-koelsch-reference.c	2014-06-11 06:58:45.000000000 +0900
@@ -68,10 +68,19 @@ static const struct resource du_resource
 
 #include <linux/sh_dma.h>
 #include <mach/dma-register.h>
+#include <linux/mmc/host.h>
+#include <linux/mfd/tmio.h>
+#include <linux/mmc/sh_mobile_sdhi.h>
 
 /* Local DMA slave IDs */
 enum {
 	RCAR_DMA_SLAVE_KOELSCH_INVALID = 0,
+	SYS_DMAC_SLAVE_SDHI0_TX,
+	SYS_DMAC_SLAVE_SDHI0_RX,
+	SYS_DMAC_SLAVE_SDHI1_TX,
+	SYS_DMAC_SLAVE_SDHI1_RX,
+	SYS_DMAC_SLAVE_SDHI2_TX,
+	SYS_DMAC_SLAVE_SDHI2_RX,
 };
 
 #define DMAE_CHANNEL(a, b)			\
@@ -97,6 +106,9 @@ enum {
 }
 
 static const struct sh_dmae_slave_config r8a7791_sys_dmac_slaves[] = {
+	SYS_DMAC_SLAVE(SDHI0, 16, 0xee100000, 0x60, 0x2060, 0xcd, 0xce),
+	SYS_DMAC_SLAVE(SDHI1, 16, 0xee140000, 0x30, 0x2030, 0xc1, 0xc2),
+	SYS_DMAC_SLAVE(SDHI2, 16, 0xee160000, 0x30, 0x2030, 0xd3, 0xd4),
 };
 
 static const struct sh_dmae_channel r8a7791_sys_dmac_channels[] = {
@@ -158,6 +170,52 @@ static void __init koelsch_add_dmac_prot
 	r8a7791_register_sys_dmac(0);
 }
 
+static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
+	.dma_slave_tx   = SYS_DMAC_SLAVE_SDHI0_TX,
+	.dma_slave_rx   = SYS_DMAC_SLAVE_SDHI0_RX,
+	.dma_rx_offset  = 0x2000,
+
+	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
+			  MMC_CAP_POWER_OFF_CARD,
+	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
+			  TMIO_MMC_WRPROTECT_DISABLE,
+};
+
+static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
+	.dma_slave_tx   = SYS_DMAC_SLAVE_SDHI1_TX,
+	.dma_slave_rx   = SYS_DMAC_SLAVE_SDHI1_RX,
+	.dma_rx_offset  = 0x2000,
+
+	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
+			  MMC_CAP_POWER_OFF_CARD,
+	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
+			  TMIO_MMC_WRPROTECT_DISABLE,
+};
+
+static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
+	.dma_slave_tx   = SYS_DMAC_SLAVE_SDHI2_TX,
+	.dma_slave_rx   = SYS_DMAC_SLAVE_SDHI2_RX,
+	.dma_rx_offset  = 0x2000,
+
+	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
+			  MMC_CAP_POWER_OFF_CARD,
+	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
+			  TMIO_MMC_WRPROTECT_DISABLE,
+};
+
+static struct of_dev_auxdata koelsch_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("renesas,sdhi-r8a7791", 0xee100000, "sdhi0",
+			&sdhi0_info),
+	OF_DEV_AUXDATA("renesas,sdhi-r8a7791", 0xee140000, "sdhi1",
+			&sdhi1_info),
+	OF_DEV_AUXDATA("renesas,sdhi-r8a7791", 0xee160000, "sdhi2",
+			&sdhi2_info),
+	{},
+};
+
 static void __init koelsch_add_du_device(void)
 {
 	struct platform_device_info info = {
@@ -189,7 +247,8 @@ static void __init koelsch_add_standard_
 	shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
 	r8a7791_add_dt_devices();
 	koelsch_add_dmac_prototype();
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	of_platform_populate(NULL, of_default_bus_match_table,
+			     koelsch_auxdata_lookup, NULL);
 
 	koelsch_add_du_device();
 }

                 reply	other threads:[~2014-06-10 23:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20140610230407.13594.80741.sendpatchset@w520 \
    --to=magnus.damm@gmail.com \
    --cc=linux-sh@vger.kernel.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).