From patchwork Thu Feb 21 12:19:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 2171361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 3C5883FD4E for ; Thu, 21 Feb 2013 12:22:52 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U8V7t-00075d-Ic; Thu, 21 Feb 2013 12:19:50 +0000 Received: from mail-wi0-f178.google.com ([209.85.212.178]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U8V7e-00073i-KM for linux-arm-kernel@lists.infradead.org; Thu, 21 Feb 2013 12:19:36 +0000 Received: by mail-wi0-f178.google.com with SMTP id o1so7454995wic.11 for ; Thu, 21 Feb 2013 04:19:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=y6futu+hXBCxhZrIL0TX4szstzflF+uRhjc78VAPs94=; b=Wq39LtpESnk9NZxG+u72ly4keoxRIxi5HPFVpUZCljF2YnMYcBZXa3tL3sdH5eRtne i64f4wtIGryLWhYtMB91YIpGRW9/WphvxiqDx3BQrjTrLsYp5/54tDRHSrxYbJ4OrNQl CA1wMx1+CJbc24IDQotSb8adKFHpkRd4G1+X2GLiv0/44QtmaLOywMHig/0KOrNolTmF 4pOxVxQkkugK3CH4gNT0c47FAeMwoEb6Vs/7eJ0Hr6CYaxTv/Na1/K5zEQ8qv1t8RdZx x6vyF1nHX2ZSiZ2rF3q8m6fTXfytSB18/8vz/in5w6kX56vlJThJ8h7U0+84b01MUsWL b27A== X-Received: by 10.194.236.233 with SMTP id ux9mr40682400wjc.36.1361449173135; Thu, 21 Feb 2013 04:19:33 -0800 (PST) Received: from piscis.vsilicon.net (58.210.217.87.dynamic.jazztel.es. [87.217.210.58]) by mx.google.com with ESMTPS id bg5sm39762672wib.8.2013.02.21.04.19.31 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Feb 2013 04:19:32 -0800 (PST) From: Javier Martin To: kernel@pengutronix.de Subject: [PATCH 1/3] i.MX27: Add platform support for SAHARA2. Date: Thu, 21 Feb 2013 13:19:20 +0100 Message-Id: <1361449162-27302-2-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1361449162-27302-1-git-send-email-javier.martin@vista-silicon.com> References: <1361449162-27302-1-git-send-email-javier.martin@vista-silicon.com> X-Gm-Message-State: ALoCoQnt03EsVfQiqvEnxulII/80/Uvo3jPk6cO0pTMwku+ykh/TCrgZrTzDl68vfbM7IqBEnPba X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130221_071934_894619_EA7D9BAC X-CRM114-Status: GOOD ( 16.36 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.178 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: swarren@nvidia.com, herbert@gondor.apana.org.au, arnd@arndb.de, Javier Martin , tony@atomide.com, linux-crypto@vger.kernel.org, shawn.guo@linaro.org, davem@davemloft.net, linux-arm-kernel@lists.infradead.org, gcembed@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org i.MX27 devices include this HW cryptographic accelerator. Signed-off-by: Javier Martin --- arch/arm/mach-imx/clk-imx27.c | 2 ++ arch/arm/mach-imx/devices-imx27.h | 4 +++ arch/arm/mach-imx/devices/Kconfig | 4 +++ arch/arm/mach-imx/devices/Makefile | 1 + arch/arm/mach-imx/devices/devices-common.h | 8 +++++ arch/arm/mach-imx/devices/platform-imx27-sahara.c | 37 +++++++++++++++++++++ 6 files changed, 56 insertions(+) create mode 100644 arch/arm/mach-imx/devices/platform-imx27-sahara.c diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c index 4c1d1e4..0b9664a 100644 --- a/arch/arm/mach-imx/clk-imx27.c +++ b/arch/arm/mach-imx/clk-imx27.c @@ -253,6 +253,8 @@ int __init mx27_clocks_init(unsigned long fref) clk_register_clkdev(clk[nfc_baud_gate], NULL, "imx27-nand.0"); clk_register_clkdev(clk[vpu_baud_gate], "per", "coda-imx27.0"); clk_register_clkdev(clk[vpu_ahb_gate], "ahb", "coda-imx27.0"); + clk_register_clkdev(clk[sahara_ahb_gate], "ahb", "sahara-imx27.0"); + clk_register_clkdev(clk[sahara_ipg_gate], "ipg", "sahara-imx27.0"); clk_register_clkdev(clk[dma_ahb_gate], "ahb", "imx27-dma"); clk_register_clkdev(clk[dma_ipg_gate], "ipg", "imx27-dma"); clk_register_clkdev(clk[fec_ipg_gate], "ipg", "imx27-fec.0"); diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h index 1309625..3bc95d8 100644 --- a/arch/arm/mach-imx/devices-imx27.h +++ b/arch/arm/mach-imx/devices-imx27.h @@ -20,6 +20,10 @@ extern const struct imx_imx27_coda_data imx27_coda_data; #define imx27_add_coda() \ imx_add_imx27_coda(&imx27_coda_data) +extern const struct imx_imx27_sahara_data imx27_sahara_data; +#define imx27_add_sahara() \ + imx_add_imx27_sahara(&imx27_sahara_data) + extern const struct imx_imx2_wdt_data imx27_imx2_wdt_data; #define imx27_add_imx2_wdt() \ imx_add_imx2_wdt(&imx27_imx2_wdt_data) diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig index 9a8f1ca..3edaa8d 100644 --- a/arch/arm/mach-imx/devices/Kconfig +++ b/arch/arm/mach-imx/devices/Kconfig @@ -20,6 +20,10 @@ config IMX_HAVE_PLATFORM_IMX27_CODA bool default y if SOC_IMX27 +config IMX_HAVE_PLATFORM_IMX27_SAHARA + bool + default y if SOC_IMX27 + config IMX_HAVE_PLATFORM_IMX2_WDT bool diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile index 6acf37e..f5534a2 100644 --- a/arch/arm/mach-imx/devices/Makefile +++ b/arch/arm/mach-imx/devices/Makefile @@ -7,6 +7,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o obj-y += platform-gpio-mxc.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX21_HCD) += platform-imx21-hcd.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX27_CODA) += platform-imx27-coda.o +obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX27_SAHARA) += platform-imx27-sahara.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMXDI_RTC) += platform-imxdi_rtc.o obj-y += platform-imx-dma.o diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h index 6277baf..48065b2 100644 --- a/arch/arm/mach-imx/devices/devices-common.h +++ b/arch/arm/mach-imx/devices/devices-common.h @@ -91,6 +91,14 @@ struct imx_imx27_coda_data { struct platform_device *__init imx_add_imx27_coda( const struct imx_imx27_coda_data *data); +struct imx_imx27_sahara_data { + resource_size_t iobase; + resource_size_t iosize; + resource_size_t irq; +}; +struct platform_device *__init imx_add_imx27_sahara( + const struct imx_imx27_sahara_data *data); + struct imx_imx2_wdt_data { int id; resource_size_t iobase; diff --git a/arch/arm/mach-imx/devices/platform-imx27-sahara.c b/arch/arm/mach-imx/devices/platform-imx27-sahara.c new file mode 100644 index 0000000..94288f4 --- /dev/null +++ b/arch/arm/mach-imx/devices/platform-imx27-sahara.c @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 Vista Silicon + * Javier Martin + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation. + */ + +#include "../hardware.h" +#include "devices-common.h" + +#ifdef CONFIG_SOC_IMX27 +const struct imx_imx27_sahara_data imx27_sahara_data __initconst = { + .iobase = MX27_SAHARA_BASE_ADDR, + .iosize = SZ_2K, + .irq = MX27_INT_SAHARA, +}; +#endif + +struct platform_device *__init imx_add_imx27_sahara( + const struct imx_imx27_sahara_data *data) +{ + struct resource res[] = { + { + .start = data->iobase, + .end = data->iobase + data->iosize - 1, + .flags = IORESOURCE_MEM, + }, { + .start = data->irq, + .end = data->irq, + .flags = IORESOURCE_IRQ, + }, + }; + return imx_add_platform_device_dmamask("sahara-imx27", 0, res, 2, NULL, + 0, DMA_BIT_MASK(32)); +}