From patchwork Sat Jun 15 15:41:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2727461 Return-Path: X-Original-To: patchwork-linux-arm@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 21B549F8E4 for ; Sat, 15 Jun 2013 15:42:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 404B12018B for ; Sat, 15 Jun 2013 15:42:01 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BDE120189 for ; Sat, 15 Jun 2013 15:41:59 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Unsbq-0000uE-W4; Sat, 15 Jun 2013 15:41:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Unsbo-0007Xe-8o; Sat, 15 Jun 2013 15:41:44 +0000 Received: from smtp44.i.mail.ru ([94.100.177.104]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Unsbk-0007X0-TD for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2013 15:41:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=8wNtCJ1VxVx/N2AejgL7MZtpxl/iANbz3YmgZfNe+18=; b=fu2PJFHvN23spTSCF5k0tT97oD0Dg0RTHEmqkq0MHE72hHZt5OPvwDSYjC9Nan3guJYRgzKrSK3nbCkA2geBVOLQnBCVd7DbtFdVVsdnbq+v0MLGF1XhIR8wv1y2CzaagH7xMqCG1FtdNuLdKXh7CoXNhHLV/5R3H2CBCb7B8JQ=; Received: from [188.134.40.128] (port=14246 helo=shc.zet) by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1UnsbK-0008KN-G5; Sat, 15 Jun 2013 19:41:14 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: imx: Add RTC support for i.MX27 Date: Sat, 15 Jun 2013 19:41:06 +0400 Message-Id: <1371310866-6136-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130615_114141_432374_500C5EE0 X-CRM114-Status: GOOD ( 12.00 ) X-Spam-Score: -2.0 (--) Cc: Shawn Guo , Russell King , Arnd Bergmann , Sascha Hauer , Alexander Shiyan X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,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 This patch adds support using i.MX27 On-Chip RTC from board files. Signed-off-by: Alexander Shiyan --- arch/arm/mach-imx/devices-imx27.h | 4 ++++ arch/arm/mach-imx/devices/devices-common.h | 1 + arch/arm/mach-imx/devices/platform-mxc_rtc.c | 14 ++++++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h index 1309625..7d1aac2 100644 --- a/arch/arm/mach-imx/devices-imx27.h +++ b/arch/arm/mach-imx/devices-imx27.h @@ -73,6 +73,10 @@ extern const struct imx_mxc_nand_data imx27_mxc_nand_data; #define imx27_add_mxc_nand(pdata) \ imx_add_mxc_nand(&imx27_mxc_nand_data, pdata) +extern const struct imx_mxc_rtc_data imx27_mxc_rtc_data; +#define imx27_add_mxc_rtc() \ + imx_add_mxc_rtc(&imx27_mxc_rtc_data) + extern const struct imx_mxc_w1_data imx27_mxc_w1_data; #define imx27_add_mxc_w1() \ imx_add_mxc_w1(&imx27_mxc_w1_data) diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h index 453e20b..32c49c6 100644 --- a/arch/arm/mach-imx/devices/devices-common.h +++ b/arch/arm/mach-imx/devices/devices-common.h @@ -305,6 +305,7 @@ struct platform_device *__init imx_add_mxc_pwm( struct imx_mxc_rtc_data { const char *devid; resource_size_t iobase; + resource_size_t iosize; resource_size_t irq; }; struct platform_device *__init imx_add_mxc_rtc( diff --git a/arch/arm/mach-imx/devices/platform-mxc_rtc.c b/arch/arm/mach-imx/devices/platform-mxc_rtc.c index c7fffaa..385fe4e 100644 --- a/arch/arm/mach-imx/devices/platform-mxc_rtc.c +++ b/arch/arm/mach-imx/devices/platform-mxc_rtc.c @@ -9,21 +9,27 @@ #include "../hardware.h" #include "devices-common.h" -#define imx_mxc_rtc_data_entry_single(soc, _devid) \ +#define imx_mxc_rtc_data_entry_single(soc, _devid, _size) \ { \ .devid = _devid, \ .iobase = soc ## _RTC_BASE_ADDR, \ + .iosize = _size, \ .irq = soc ## _INT_RTC, \ } +#ifdef CONFIG_SOC_IMX27 +const struct imx_mxc_rtc_data imx27_mxc_rtc_data __initconst = + imx_mxc_rtc_data_entry_single(MX27, "imx21-rtc", SZ_4K); +#endif /* ifdef CONFIG_SOC_IMX27 */ + #ifdef CONFIG_SOC_IMX31 const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst = - imx_mxc_rtc_data_entry_single(MX31, "imx21-rtc"); + imx_mxc_rtc_data_entry_single(MX31, "imx21-rtc", SZ_16K); #endif /* ifdef CONFIG_SOC_IMX31 */ #ifdef CONFIG_SOC_IMX35 const struct imx_mxc_rtc_data imx35_mxc_rtc_data __initconst = - imx_mxc_rtc_data_entry_single(MX35, "imx21-rtc"); + imx_mxc_rtc_data_entry_single(MX35, "imx21-rtc", SZ_16K); #endif /* ifdef CONFIG_SOC_IMX35 */ struct platform_device *__init imx_add_mxc_rtc( @@ -32,7 +38,7 @@ struct platform_device *__init imx_add_mxc_rtc( struct resource res[] = { { .start = data->iobase, - .end = data->iobase + SZ_16K - 1, + .end = data->iobase + data->iosize - 1, .flags = IORESOURCE_MEM, }, { .start = data->irq,