From patchwork Wed Jun 25 00:40:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 4415361 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 443A9BEEAA for ; Wed, 25 Jun 2014 00:38:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B0A92037A for ; Wed, 25 Jun 2014 00:38:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33A0F20170 for ; Wed, 25 Jun 2014 00:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbaFYAii (ORCPT ); Tue, 24 Jun 2014 20:38:38 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:62297 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751862AbaFYAii (ORCPT ); Tue, 24 Jun 2014 20:38:38 -0400 Received: by mail-pd0-f169.google.com with SMTP id g10so900945pdj.14 for ; Tue, 24 Jun 2014 17:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=p4wde0J6LDTmeat1EJHkEt3qF9mR3IUj0ftc7AtZEaY=; b=U8tR7Yfe2oYKccoyacTZMlDarivIzKLold0Ch2IAZVrNAfAlrSQF11un6VNikqHpn9 soZBPvEmvXM67c1dr91a4r6dbTSLjmoHX3LMdLC1oC0OxN4GEu573eSrPglV7Mo10HGO HUhba2+VVqmk6Ht9Jrc7pfDUvpynQCrGi3RExPQMzThVjQsLco1Vi6P51gj/NreYQEAD 997bQ9NSqtw3+oOsc/ELgBzwbaxOpuqRrRMaf+bdEKA+G/Rj1atDJl8PqYml4y1u2eHp mTJK+CCQYNO5A7GnmAHRG1lnTiIDAq7d8PsyJplaIubeQWQ9nZIFrVoRLgHlJDlUicHt lUHA== X-Received: by 10.66.159.34 with SMTP id wz2mr6293568pab.96.1403656717762; Tue, 24 Jun 2014 17:38:37 -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 nx12sm8886883pab.6.2014.06.24.17.38.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jun 2014 17:38:36 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , geert+renesas@glider.be Date: Wed, 25 Jun 2014 09:40:44 +0900 Message-Id: <20140625004044.18295.6047.sendpatchset@w520> In-Reply-To: <20140625004027.18295.39707.sendpatchset@w520> References: <20140625004027.18295.39707.sendpatchset@w520> Subject: [PATCH 02/05] ARM: shmobile: Lager SYS-DMAC and SCIF prototype Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Enable TX DMA for r8a7790 / Lager SCIF devices. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/board-lager-reference.c | 83 ++++++++++++++++++++++++ 1 file changed, 83 insertions(+) -- 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 --- 0012/arch/arm/mach-shmobile/board-lager-reference.c +++ work/arch/arm/mach-shmobile/board-lager-reference.c 2014-06-25 08:09:53.000000000 +0900 @@ -76,6 +76,7 @@ static const struct resource du_resource #include #include #include +#include /* Local DMA slave IDs */ enum { @@ -88,6 +89,26 @@ enum { SYS_DMAC_SLAVE_SDHI0_RX, SYS_DMAC_SLAVE_SDHI2_TX, SYS_DMAC_SLAVE_SDHI2_RX, + SYS_DMAC_SLAVE_SCIF0_TX, + SYS_DMAC_SLAVE_SCIF0_RX, + SYS_DMAC_SLAVE_SCIF1_TX, + SYS_DMAC_SLAVE_SCIF1_RX, + SYS_DMAC_SLAVE_SCIFA0_TX, + SYS_DMAC_SLAVE_SCIFA0_RX, + SYS_DMAC_SLAVE_SCIFA1_TX, + SYS_DMAC_SLAVE_SCIFA1_RX, + SYS_DMAC_SLAVE_SCIFA2_TX, + SYS_DMAC_SLAVE_SCIFA2_RX, + SYS_DMAC_SLAVE_SCIFB0_TX, + SYS_DMAC_SLAVE_SCIFB0_RX, + SYS_DMAC_SLAVE_SCIFB1_TX, + SYS_DMAC_SLAVE_SCIFB1_RX, + SYS_DMAC_SLAVE_SCIFB2_TX, + SYS_DMAC_SLAVE_SCIFB2_RX, + SYS_DMAC_SLAVE_HSCIF0_TX, + SYS_DMAC_SLAVE_HSCIF0_RX, + SYS_DMAC_SLAVE_HSCIF1_TX, + SYS_DMAC_SLAVE_HSCIF1_RX, }; #define DMAE_CHANNEL(a, b) \ @@ -112,11 +133,29 @@ enum { .mid_rid = r, \ } +#define SYS_DMAC_SLAVE_TX(_id, _bit, _addr, toffset, roffset, t, r) \ +{ \ + .slave_id = SYS_DMAC_SLAVE_## _id ##_TX, \ + .addr = _addr + toffset, \ + .chcr = CHCR_TX(XMIT_SZ_## _bit ##BIT), \ + .mid_rid = t, \ +} + static const struct sh_dmae_slave_config r8a7790_sys_dmac_slaves[] = { SYS_DMAC_SLAVE(MMCIF0, 32, 0xee200000, 0x34, 0x34, 0xd1, 0xd2), SYS_DMAC_SLAVE(MMCIF1, 32, 0xee220000, 0x34, 0x34, 0xe1, 0xe2), SYS_DMAC_SLAVE(SDHI0, 16, 0xee100000, 0x60, 0x2060, 0xcd, 0xce), SYS_DMAC_SLAVE(SDHI2, 16, 0xee140000, 0x30, 0x2030, 0xc1, 0xc2), + SYS_DMAC_SLAVE_TX(SCIF0, 8, 0xe6e60000, 0xc, 0x14, 0x29, 0x2a), + SYS_DMAC_SLAVE_TX(SCIF1, 8, 0xe6e68000, 0xc, 0x14, 0x2d, 0x2e), + SYS_DMAC_SLAVE_TX(SCIFA0, 8, 0xe6c40000, 0x20, 0x24, 0x21, 0x22), + SYS_DMAC_SLAVE_TX(SCIFA1, 8, 0xe6c50000, 0x20, 0x24, 0x25, 0x26), + SYS_DMAC_SLAVE_TX(SCIFA2, 8, 0xe6c60000, 0x20, 0x24, 0x27, 0x28), + SYS_DMAC_SLAVE_TX(SCIFB0, 8, 0xe6c20000, 0x40, 0x60, 0x3d, 0x3e), + SYS_DMAC_SLAVE_TX(SCIFB1, 8, 0xe6c30000, 0x40, 0x60, 0x19, 0x1a), + SYS_DMAC_SLAVE_TX(SCIFB2, 8, 0xe6ce0000, 0x40, 0x60, 0x1d, 0x1e), + SYS_DMAC_SLAVE_TX(HSCIF0, 8, 0xe62c0000, 0xc, 0x14, 0x39, 0x3a), + SYS_DMAC_SLAVE_TX(HSCIF1, 8, 0xe62c8000, 0xc, 0x14, 0x4d, 0x4e), }; static const struct sh_dmae_channel r8a7790_sys_dmac_channels[] = { @@ -211,6 +250,40 @@ static struct sh_mobile_sdhi_info sdhi2_ TMIO_MMC_WRPROTECT_DISABLE, }; +#define SCIF_PD(scif_type, index, scif_index) \ +static struct plat_sci_port scif##index##_platform_data = { \ + .type = PORT_##scif_type, \ + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \ + .scscr = SCSCR_RE | SCSCR_TE, \ + .dma_slave_tx = SYS_DMAC_SLAVE_##scif_type##scif_index##_TX, \ + .dma_slave_rx = SYS_DMAC_SLAVE_##scif_type##scif_index##_RX, \ +} + +#define PDATA_SCIF(index, baseaddr, irq, i) SCIF_PD(SCIF, index, i) +#define PDATA_SCIFA(index, baseaddr, irq, i) SCIF_PD(SCIFA, index, i) +#define PDATA_SCIFB(index, baseaddr, irq, i) SCIF_PD(SCIFB, index, i) +#define PDATA_HSCIF(index, baseaddr, irq, i) SCIF_PD(HSCIF, index, i) + +PDATA_SCIFA(0, 0xe6c40000, gic_spi(144), 0); /* SCIFA0 */ +PDATA_SCIFA(1, 0xe6c50000, gic_spi(145), 1); /* SCIFA1 */ +PDATA_SCIFB(2, 0xe6c20000, gic_spi(148), 0); /* SCIFB0 */ +PDATA_SCIFB(3, 0xe6c30000, gic_spi(149), 1); /* SCIFB1 */ +PDATA_SCIFB(4, 0xe6ce0000, gic_spi(150), 2); /* SCIFB2 */ +PDATA_SCIFA(5, 0xe6c60000, gic_spi(151), 2); /* SCIFA2 */ +PDATA_SCIF(6, 0xe6e60000, gic_spi(152), 0); /* SCIF0 */ +PDATA_SCIF(7, 0xe6e68000, gic_spi(153), 1); /* SCIF1 */ +PDATA_HSCIF(8, 0xe62c0000, gic_spi(154), 0); /* HSCIF0 */ +PDATA_HSCIF(9, 0xe62c8000, gic_spi(155), 1); /* HSCIF1 */ + +#define SCIF_AD(scif_type, index, baseaddr) \ + OF_DEV_AUXDATA("renesas," scif_type "-r8a7790", baseaddr, \ + "sh-sci." # index, &scif##index##_platform_data) + +#define AUXDATA_SCIF(index, baseaddr, irq) SCIF_AD("scif", index, baseaddr) +#define AUXDATA_SCIFA(index, baseaddr, irq) SCIF_AD("scifa", index, baseaddr) +#define AUXDATA_SCIFB(index, baseaddr, irq) SCIF_AD("scifb", index, baseaddr) +#define AUXDATA_HSCIF(index, baseaddr, irq) SCIF_AD("hscif", index, baseaddr) + static struct of_dev_auxdata lager_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("renesas,mmcif-r8a7790", 0xee220000, "sh_mmcif", &mmcif1_pdata), @@ -218,6 +291,16 @@ static struct of_dev_auxdata lager_auxda &sdhi0_info), OF_DEV_AUXDATA("renesas,sdhi-r8a7790", 0xee140000, "sdhi2", &sdhi2_info), + AUXDATA_SCIFA(0, 0xe6c40000, gic_spi(144)), /* SCIFA0 */ + AUXDATA_SCIFA(1, 0xe6c50000, gic_spi(145)), /* SCIFA1 */ + AUXDATA_SCIFB(2, 0xe6c20000, gic_spi(148)), /* SCIFB0 */ + AUXDATA_SCIFB(3, 0xe6c30000, gic_spi(149)), /* SCIFB1 */ + AUXDATA_SCIFB(4, 0xe6ce0000, gic_spi(150)), /* SCIFB2 */ + AUXDATA_SCIFA(5, 0xe6c60000, gic_spi(151)), /* SCIFA2 */ + AUXDATA_SCIF(6, 0xe6e60000, gic_spi(152)), /* SCIF0 */ + AUXDATA_SCIF(7, 0xe6e68000, gic_spi(153)), /* SCIF1 */ + AUXDATA_HSCIF(8, 0xe62c0000, gic_spi(154)), /* HSCIF0 */ + AUXDATA_HSCIF(9, 0xe62c8000, gic_spi(155)), /* HSCIF1 */ {}, };