From patchwork Fri Apr 25 09:31:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 342729 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ve0-f185.google.com (mail-ve0-f185.google.com [209.85.128.185]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 834451419F2 for ; Fri, 25 Apr 2014 19:31:28 +1000 (EST) Received: by mail-ve0-f185.google.com with SMTP id jw12sf718515veb.2 for ; Fri, 25 Apr 2014 02:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe:content-type; bh=hs2s1VDiLed9bcIwTzbyHFDtxVavCQA24Tiw0GtHy4s=; b=K+c/uXYlwD66qwpNj6rfkUdheUV09wUFEYAowWjaaVjrQPRGVo4jennXpqyj+iHXkj hfyxrIq4nwZ9zPL6C6FDeltMLj7DY2M4pPmVK7rraqliJa1cYqoQ1y8SY4+zgnBSX7fv +KhyMZEGhbSIgKGcO7407ZB1W0LXNS78q5d9vFiEPt0nzaeRYCIcTYwmHwEjMDsY/8gR GpyZCPlILUtwgiFgmMOKF4G3vGa5VWcyT1FkHyu80HQRpFB2WqEf42Rw4PskOzrgLpWG A6R2yOoKqpNkdgJzV30KuIqsHkNrq2P2T33OTKIeJaJ270TBfmfpB1vnvLZSF3Uj/ZA4 K3Jw== X-Received: by 10.140.109.203 with SMTP id l69mr27qgf.32.1398418285098; Fri, 25 Apr 2014 02:31:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.140.81.81 with SMTP id e75ls556731qgd.29.gmail; Fri, 25 Apr 2014 02:31:24 -0700 (PDT) X-Received: by 10.58.178.81 with SMTP id cw17mr3759817vec.37.1398418284754; Fri, 25 Apr 2014 02:31:24 -0700 (PDT) Received: from collaborate-mta1.arm.com (fw-tnat.austin.arm.com. [217.140.110.23]) by gmr-mx.google.com with ESMTP id jx10si2589452pbd.2.2014.04.25.02.31.24 for ; Fri, 25 Apr 2014 02:31:24 -0700 (PDT) Received-SPF: pass (google.com: domain of marc.zyngier@arm.com designates 217.140.110.23 as permitted sender) client-ip=217.140.110.23; Received: from e102391-lin.cambridge.arm.com (e102391-lin.cambridge.arm.com [10.1.209.166]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 8B21713FCF2; Fri, 25 Apr 2014 04:31:23 -0500 (CDT) From: Marc Zyngier To: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com Cc: Russell King , Will Deacon , Catalin Marinas , Alessandro Zummo Subject: [rtc-linux] [PATCH 7/7] arm64: rtc: plug the PC CMOS RTC using MMIO accessors Date: Fri, 25 Apr 2014 10:31:15 +0100 Message-Id: <1398418275-9671-8-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1398418275-9671-1-git-send-email-marc.zyngier@arm.com> References: <1398418275-9671-1-git-send-email-marc.zyngier@arm.com> X-Original-Sender: marc.zyngier@arm.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of marc.zyngier@arm.com designates 217.140.110.23 as permitted sender) smtp.mail=marc.zyngier@arm.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Add the now minimal gunk to enable the PC-style CMOS RTC. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/mc146818rtc.h | 10 ++++++++++ drivers/rtc/Kconfig | 5 +++-- drivers/rtc/rtc-cmos.c | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 arch/arm64/include/asm/mc146818rtc.h diff --git a/arch/arm64/include/asm/mc146818rtc.h b/arch/arm64/include/asm/mc146818rtc.h new file mode 100644 index 0000000..79cc1f3 --- /dev/null +++ b/arch/arm64/include/asm/mc146818rtc.h @@ -0,0 +1,10 @@ +/* + * Machine dependent access functions for RTC registers. + * In the arm64 case, pretty much nothing. + */ +#ifndef __ARM64_MC146818RTC_H__ +#define __ARM64_MC146818RTC_H__ + +#define RTC_ALWAYS_BCD 0 + +#endif /* __ARM64_MC146818RTC_H__ */ diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index b2a512e..5944c92 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -660,10 +660,11 @@ comment "Platform RTC drivers" config RTC_DRV_CMOS tristate "PC-style 'CMOS'" - depends on X86 || ARM || M32R || PPC || MIPS || SPARC64 + depends on X86 || ARM || M32R || PPC || MIPS || SPARC64 || ARM64 default y if X86 select RTC_DRV_CMOS_MMIO if ARM - select RTC_DRV_CMOS_PRIV_LOCK if ARM + select RTC_DRV_CMOS_MMIO_STRICT if ARM64 + select RTC_DRV_CMOS_PRIV_LOCK if (ARM || ARM64) help Say "yes" here to get direct support for the real time clock found in every PC or ACPI-based system, and some other boards. diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index eb5d05c..d84e3a5 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -754,7 +754,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq) address_space = 64; #elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) \ || defined(__sparc__) || defined(__mips__) \ - || defined(__powerpc__) + || defined(__powerpc__) || defined(CONFIG_ARM64) address_space = 128; #else #warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes.