From patchwork Tue Jun 10 23:51:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 4332911 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 850529F314 for ; Tue, 10 Jun 2014 23:49:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90F2A201F5 for ; Tue, 10 Jun 2014 23:49:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AAF5E201EC for ; Tue, 10 Jun 2014 23:49:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752183AbaFJXtY (ORCPT ); Tue, 10 Jun 2014 19:49:24 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:36727 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752087AbaFJXtY (ORCPT ); Tue, 10 Jun 2014 19:49:24 -0400 Received: by mail-pd0-f175.google.com with SMTP id z10so6575106pdj.6 for ; Tue, 10 Jun 2014 16:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:subject; bh=dVOT2NN7/yVATPQjEcUHVnzfRWajh6oYUqj84G+fY3U=; b=CO21Llb9SeRmVoO2KAhUnFSp+juKgdKOGFlDB9IMGpH7InI/I8eHfs/6/R5fv7yL48 D7mHWCdg/RM3dUnr3NWfYZp9Rb5pY6OoxEsCOjaN4ZaBZCH7TtOoQFyuGfR2AfrtfVJc B6v04h2ErISV/cxbw8XZESzmoPYJLg7oQWnu6tzV2no03EMjL94MqN3zBQyNVUMoXW/N aQM4UQEO5IU6tMFiyHPIjlr2EhEET5Tr89iL4xrxHVAzsK2BcWffHqog+Ix+uQ2offm2 I3GkGOPFz2HPC5yreo0wxPYqS7Tq3nXjBzzTQ/PO1zldLAkFhDcJEy0SagIOJ6rrapUv 0bGg== X-Received: by 10.66.155.227 with SMTP id vz3mr8865879pab.26.1402444163640; Tue, 10 Jun 2014 16:49:23 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by mx.google.com with ESMTPSA id se3sm71480289pbb.80.2014.06.10.16.49.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jun 2014 16:49:22 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm Date: Wed, 11 Jun 2014 08:51:29 +0900 Message-Id: <20140610235129.16048.68945.sendpatchset@w520> Subject: [PATCH v2] ARM: shmobile: Koelsch SYS-DMAC and SDHI prototype V2 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm 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. Updates patch 7 of the following series: [PATCH 00/07] ARM: shmobile: Lager/Koelsch MMCIF/SDHI LPAE DMA prototype Changes since V1: - Initialize SYS_DMAC_SLAVE_SDHI0_TX to 64 to coexist with other DMACs. This is done to split the slave ID space and allow other DMACs to use the initial portion of the slave ID space. Without this fix other DMACs like for instance sound prototype support will not work with this prototype patch series and SDHI will be broken. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/board-koelsch-reference.c | 61 +++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0010/arch/arm/mach-shmobile/board-koelsch-reference.c +++ work/arch/arm/mach-shmobile/board-koelsch-reference.c 2014-06-11 08:38:38.000000000 +0900 @@ -68,10 +68,19 @@ static const struct resource du_resource #include #include +#include +#include +#include /* Local DMA slave IDs */ enum { RCAR_DMA_SLAVE_KOELSCH_INVALID = 0, + SYS_DMAC_SLAVE_SDHI0_TX = 64, + 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(); }