From patchwork Sat Feb 20 10:20:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 8366011 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0EF15C0554 for ; Sat, 20 Feb 2016 10:24:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B9B72052D for ; Sat, 20 Feb 2016 10:24:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 074882054D for ; Sat, 20 Feb 2016 10:24:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aX4fZ-0003pE-5b; Sat, 20 Feb 2016 10:21:45 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aX4fD-0003lM-1r for linux-arm-kernel@lists.infradead.org; Sat, 20 Feb 2016 10:21:24 +0000 Received: by mail-wm0-x233.google.com with SMTP id g62so98704904wme.0 for ; Sat, 20 Feb 2016 02:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nMFIECVaJvWrtafmJJDLp4EjxAJQfGPkCOUCenYM3Bc=; b=seC7q7HJtidWSuquFFuWF/Wd4ZDrwrIjFXbSZYkHbjKDh43CyAw5wNqq48nfALlWO2 sU3oc8FqISyPW9rOKmcdTVpBeuQsziNl/wIqTr8vHwcoLD1qgXqmkq3vLwaBwaVIf1rt Ut45NWAP5s86CliyyygLuE31ej7HeU2VNjW7lkywJgHLk0ZFDYoLyul4+SxD8dUoXubR Rzq+M1yWZ1P7/ru+OwamtPfxL4+y1BOpBrjRI0EPZdTbfMEpXljGBJRXi+um3BT1IElS Tz0M+jFm0cwazg7WlpAKWyjpaKivKfzigIhR9+9oqa66pFsFEKvUlS4lIZzdA5LbKYWi 3L0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nMFIECVaJvWrtafmJJDLp4EjxAJQfGPkCOUCenYM3Bc=; b=mIzuJYPJCxEKgapxnko7U1PiyKE3zJZtPlvipxocteB9j/cZpcJ8DUPXoNWAVrmyxD 141O6Iq9F76AzBPZmlw0Ib0htyY35mzZh5CZ/KN597A7iHkpLMVc8/5DMIMSPXiqsN1x +RsG69NunyH3SPHFa4QQKOuOMgfTkZ/NkrYXbxwIA8S0t8neWF3bImExMqVOjfpHH/2V +qSyzrGOa1F31wPXdPRqoVgRoufwP8yPTL+s3YmCNieA2ErZI5lGup5jcKtl7a9hawil XU0Sl3lz+NONqVai58TFiAL6s35Ruyg2huvSFHBC/cHOvTaRkE171e/A9+blelUa3fiC y3PA== X-Gm-Message-State: AG10YOTJK7RqE4EMOzXIijkZIwvuzuTypeYne7q2IPR8y7qOvIKzHsmnoguF3HBOHJgHVw94 X-Received: by 10.194.129.132 with SMTP id nw4mr16814801wjb.165.1455963666347; Sat, 20 Feb 2016 02:21:06 -0800 (PST) Received: from localhost.localdomain (rm-19-3-118.service.infuturo.it. [151.19.3.118]) by smtp.gmail.com with ESMTPSA id k4sm11500660wmc.12.2016.02.20.02.21.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 20 Feb 2016 02:21:05 -0800 (PST) From: Michael Trimarchi To: shawnguo@kernel.org, kernel@pengutronix.de Subject: [PATCH 3/4] ARM: dts: imx6ul: Add GPMI nand controller support Date: Sat, 20 Feb 2016 11:20:51 +0100 Message-Id: <1455963652-24618-4-git-send-email-michael@amarulasolutions.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455963652-24618-1-git-send-email-michael@amarulasolutions.com> References: <1455963652-24618-1-git-send-email-michael@amarulasolutions.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160220_022123_288459_5E309D6D X-CRM114-Status: GOOD ( 11.14 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fabio.estevam@freescale.com, devicetree@vger.kernel.org, computersforpeace@gmail.com, michael@amarulasolutions.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 Add support for GPMI nand controller. Signed-off-by: Michael Trimarchi --- arch/arm/boot/dts/imx6ul.dtsi | 33 +++++++++++++++++++++++++++++++++ drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 ++++++++++ drivers/mtd/nand/gpmi-nand/gpmi-nand.h | 6 ++++-- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/imx6ul.dtsi b/arch/arm/boot/dts/imx6ul.dtsi index f369fa4..42b0a29 100644 --- a/arch/arm/boot/dts/imx6ul.dtsi +++ b/arch/arm/boot/dts/imx6ul.dtsi @@ -142,6 +142,39 @@ reg = <0x00900000 0x20000>; }; + dma_apbh: dma-apbh@01804000 { + compatible = "fsl,imx6ul-dma-apbh", "fsl,imx28-dma-apbh"; + reg = <0x01804000 0x2000>; + interrupts = , + , + , + ; + interrupt-names = "gpmi0", "gpmi1", "gpmi2", "gpmi3"; + #dma-cells = <1>; + dma-channels = <4>; + clocks = <&clks IMX6UL_CLK_APBHDMA>; + }; + + gpmi: gpmi-nand@01806000 { + compatible = "fsl,imx6ul-gpmi-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x01806000 0x2000>, <0x01808000 0x4000>; + reg-names = "gpmi-nand", "bch"; + interrupts = ; + interrupt-names = "bch"; + clocks = <&clks IMX6UL_CLK_GPMI_IO>, + <&clks IMX6UL_CLK_GPMI_APB>, + <&clks IMX6UL_CLK_GPMI_BCH>, + <&clks IMX6UL_CLK_GPMI_BCH_APB>, + <&clks IMX6UL_CLK_PER_BCH>; + clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch", + "gpmi_bch_apb", "per1_bch"; + dmas = <&dma_apbh 0>; + dma-names = "rx-tx"; + status = "disabled"; + }; + aips1: aips-bus@02000000 { compatible = "fsl,aips-bus", "simple-bus"; #address-cells = <1>; diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 235ddcb..b7528a1 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c @@ -77,6 +77,12 @@ static const struct gpmi_devdata gpmi_devdata_imx6sx = { .max_chain_delay = 12, }; +static const struct gpmi_devdata gpmi_devdata_imx6ul = { + .type = IS_MX6UL, + .bch_max_ecc_strength = 40, + .max_chain_delay = 12, +}; + static irqreturn_t bch_irq(int irq, void *cookie) { struct gpmi_nand_data *this = cookie; @@ -1975,7 +1981,11 @@ static const struct of_device_id gpmi_nand_id_table[] = { }, { .compatible = "fsl,imx6sx-gpmi-nand", .data = &gpmi_devdata_imx6sx, + }, { + .compatible = "fsl,imx6ul-gpmi-nand", + .data = &gpmi_devdata_imx6ul, }, {} + }; MODULE_DEVICE_TABLE(of, gpmi_nand_id_table); diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h index 4e49a1f..c5fa52a 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h @@ -123,7 +123,8 @@ enum gpmi_type { IS_MX23, IS_MX28, IS_MX6Q, - IS_MX6SX + IS_MX6SX, + IS_MX6UL, }; struct gpmi_devdata { @@ -305,6 +306,7 @@ void gpmi_copy_bits(u8 *dst, size_t dst_bit_off, #define GPMI_IS_MX28(x) ((x)->devdata->type == IS_MX28) #define GPMI_IS_MX6Q(x) ((x)->devdata->type == IS_MX6Q) #define GPMI_IS_MX6SX(x) ((x)->devdata->type == IS_MX6SX) +#define GPMI_IS_MX6UL(x) ((x)->devdata->type == IS_MX6UL) -#define GPMI_IS_MX6(x) (GPMI_IS_MX6Q(x) || GPMI_IS_MX6SX(x)) +#define GPMI_IS_MX6(x) (GPMI_IS_MX6Q(x) || GPMI_IS_MX6SX(x) || GPMI_IS_MX6UL(x)) #endif