From patchwork Tue Sep 16 15:04:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 4918231 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 EE8689F349 for ; Tue, 16 Sep 2014 15:02:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E03C2201E4 for ; Tue, 16 Sep 2014 15:04:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1580A20136 for ; Tue, 16 Sep 2014 15:04:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754126AbaIPPEJ (ORCPT ); Tue, 16 Sep 2014 11:04:09 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:37288 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753952AbaIPPEH (ORCPT ); Tue, 16 Sep 2014 11:04:07 -0400 Received: by mail-wi0-f176.google.com with SMTP id ex7so6537795wid.3 for ; Tue, 16 Sep 2014 08:04:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=2tv+UVdkBV7kwZpx11+glCWnGht/DBgrAP/5Yege8c4=; b=m9JlUbojl5wNeyQsBlx11414my48cywGx6LwFgRJajuIL2cWWNcpivOJItQ/RRMbS7 sexzwxAcOmvjOKJAqEGZ8/BbAeZNIkDxrYweXpBCJFTLb6kvXIRoBDFyubPY3lQTyqM+ 2GYxfzfDo7aElIEuCE69VcDff8yAcqqj1b0RaboU4d80Bl1rZ7/6cbXaPsgKoQe478qI 7ONzeMRPDsIOy4agVMHBH21cMviqsrsvtX6Tg6PmO1/UuLSfBpHgTAUjLmQhLhtL1U1T u1vuntI5J4z91LGa4yS1lVK5VurixJ8JUJfxkpBs20cNI3fbSKJFccy4keMfQoLWUk3U wTHw== X-Gm-Message-State: ALoCoQkRIDKlSShgkwqby3ULIlA3Rfb2ovvFLwc2MD8ymID1kIr35qq0bqhEd+XiRZL8sn+IAVLU MIME-Version: 1.0 X-Received: by 10.180.205.234 with SMTP id lj10mr33524425wic.1.1410879846606; Tue, 16 Sep 2014 08:04:06 -0700 (PDT) Received: by 10.180.104.162 with HTTP; Tue, 16 Sep 2014 08:04:06 -0700 (PDT) X-Originating-IP: [95.23.61.81] In-Reply-To: References: <1409216559-22402-1-git-send-email-cw00.choi@samsung.com> <1409216559-22402-5-git-send-email-cw00.choi@samsung.com> Date: Tue, 16 Sep 2014 17:04:06 +0200 Message-ID: Subject: Re: [PATCHv3 4/5] rtc: s3c: Add support for RTC of Exynos3250 SoC From: Javier Martinez Canillas To: Chanwoo Choi , Douglas Anderson Cc: Alessandro Zummo , Kukjin Kim , akpm , Kyungmin Park , rtc-linux@googlegroups.com, Linux Kernel , "linux-samsung-soc@vger.kernel.org" Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 [adding Doug Anderson as cc] On Tue, Sep 16, 2014 at 3:48 PM, Javier Martinez Canillas wrote: > On Thu, Aug 28, 2014 at 11:02 AM, Chanwoo Choi wrote: >> This patch add support for RTC of Exynos3250 SoC. The Exynos3250 needs source >> clock(32.768KHz) for RTC block. If source clock of RTC is registerd on clock >> list of common clk framework, Exynos RTC drvier have to control this clock. >> >> Clock list for s3c-rtc device: >> - rtc : CLK_RTC of CLK_GATE_IP_PERIR is gate clock for RTC. >> - rtc_src : XrtcXTI is 32.768.kHz source clock for RTC. > > Is this RTC source clock needed for all Exynos SoCs? > By looking at the Exynos5420 user manual I see that there is indeed a XrtcXTI clock pad and the doc says: "XRTCXTI: Specifies a clock from 32.768 kHz crystal pad with XRTCXTI and XRTCXTO pins. RTC uses this clock as the source of a real-time clock." Also by looking at the board schematic I see that the 32KHZAP clock from the Maxim77802 PMIC is used as the external 32.768.kHz source clock for the RTC but that information is not in the downstream ChromeOS DTS since AFAIU the Maxim driver in that tree predates the common clock framework so the PMIC clocks were modeled as regulators. >> @@ -480,11 +530,19 @@ static int s3c_rtc_probe(struct platform_device *pdev) >> >> info->rtc_clk = devm_clk_get(&pdev->dev, "rtc"); >> if (IS_ERR(info->rtc_clk)) { >> - dev_err(&pdev->dev, "failed to find rtc clock source\n"); >> + dev_err(&pdev->dev, "failed to find rtc clock\n"); >> return PTR_ERR(info->rtc_clk); >> } >> clk_prepare_enable(info->rtc_clk); >> >> + info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src"); >> + if (IS_ERR(info->rtc_src_clk)) { >> + dev_err(&pdev->dev, "failed to find rtc source clock\n"); >> + return PTR_ERR(info->rtc_src_clk); > > On an Exynos5420 Peach Pit machine I'm having the following error and > the driver fails to probe: > > [ 2.095700] s3c-rtc: probe of 101e0000.rtc failed with error -2 > > Reverting this patch fixes the issue and the s3c RTC works again on > this machine. > The following change [0] in the Peach Pit DTS makes the RTC to claim the external clock and is working again but I'm not sure if $subject is correct in making the "rtc_src" property mandatory since it breaks backward DT compatibility. Best regards, Javier [0] the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts index 9a23382..47d7a5b 100644 --- a/arch/arm/boot/dts/exynos5420-peach-pit.dts +++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts @@ -12,6 +12,7 @@ #include #include #include +#include #include "exynos5420.dtsi" / { @@ -151,7 +152,7 @@ status = "okay"; clock-frequency = <400000>; - max77802-pmic@9 { + max77802: max77802-pmic@9 { compatible = "maxim,max77802"; interrupt-parent = <&gpx3>; interrupts = <1 IRQ_TYPE_NONE>; @@ -726,6 +727,8 @@ }; &rtc { + clocks = <&clock CLK_RTC>, <&max77802 MAX77802_CLK_32K_AP>; + clock-names = "rtc", "rtc_src"; status = "okay"; }; -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in