From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5D7AC0650F for ; Mon, 5 Aug 2019 10:16:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83A532087B for ; Mon, 5 Aug 2019 10:16:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728318AbfHEKQe (ORCPT ); Mon, 5 Aug 2019 06:16:34 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:35888 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728190AbfHEKQd (ORCPT ); Mon, 5 Aug 2019 06:16:33 -0400 Received: by mail-ed1-f65.google.com with SMTP id k21so78154441edq.3; Mon, 05 Aug 2019 03:16:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3byZm4WW5S66f9sH9AAiCJ18IamGlDO717O/42CmSCg=; b=gt/k6a71k8lNHd/S6ml9DU9yj5zJQ4XfIW24iRo4Sz0Qugt0d8rIms/CrfJQc9ARf9 VjqTLD3qoTAx+RIQEpazxpQ0trQMieBBb9GZkN2n+Z+kBbbLvY09DqnRYxXzyYXvmW0b 51oHu0PV2r1LVEMKJ1G7fZZ9AbelehL3INlMUIny4I82QhLTbECTY/uXts1TOkv0G3kx Omxqcpy5/f8zfR3Lq2Pns0CLoZISxKIJQbNHI/HNJ0ZlKDehLL7X71fdX2aERclow+EK 89S+gxy9TzUYRyyy0dHuqkB3w+iY1QjaF+erF0AWnmNgKfAEFKhDL24jN3z8ZF+vwxlp tPdA== X-Gm-Message-State: APjAAAXHA3vTlmCunbSFhI3iva+CpVa4ppnmLxavLXhowp8QWYqLIgBS 7sQSDu4IVS0osiDj9989RPCX3swelbA= X-Google-Smtp-Source: APXvYqxAN0sxCtDc4KhWPVHTXzChQfZCMBd7qpDFXGJMW0lrk+7+ss52WdJZUbQ1knMd9Zk3P8ACpw== X-Received: by 2002:aa7:c515:: with SMTP id o21mr132330413edq.2.1565000190536; Mon, 05 Aug 2019 03:16:30 -0700 (PDT) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com. [209.85.221.54]) by smtp.gmail.com with ESMTPSA id h10sm18916541edn.86.2019.08.05.03.16.29 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 05 Aug 2019 03:16:30 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id c2so80591053wrm.8; Mon, 05 Aug 2019 03:16:29 -0700 (PDT) X-Received: by 2002:adf:c613:: with SMTP id n19mr104922068wrg.109.1565000189770; Mon, 05 Aug 2019 03:16:29 -0700 (PDT) MIME-Version: 1.0 References: <20190412120730.473-1-megous@megous.com> <20190412120730.473-3-megous@megous.com> In-Reply-To: <20190412120730.473-3-megous@megous.com> From: Chen-Yu Tsai Date: Mon, 5 Aug 2019 18:16:14 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linux-sunxi] [PATCH 2/3] rtc: sun6i: Add support for H6 RTC To: =?UTF-8?Q?Ond=C5=99ej_Jirman?= Cc: Alessandro Zummo , Alexandre Belloni , Rob Herring , Mark Rutland , Maxime Ripard , linux-rtc@vger.kernel.org, devicetree , linux-arm-kernel , linux-kernel , linux-sunxi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 12, 2019 at 8:07 PM megous via linux-sunxi wrote: > > From: Ondrej Jirman > > RTC on H6 is mostly the same as on H5 and H3. It has slight differences > mostly in features that are not yet supported by this driver. > > Some differences are already stated in the comments in existing code. > One other difference is that H6 has extra bit in LOSC_CTRL_REG, called > EXT_LOSC_EN to enable/disable external low speed crystal oscillator. > > It also has bit EXT_LOSC_STA in LOSC_AUTO_SWT_STA_REG, to check whether > external low speed oscillator is working correctly. > > This patch adds support for enabling LOSC when necessary: > > - during reparenting > - when probing the clock > > H6 also has capacbility to automatically reparent RTC clock from > external crystal oscillator, to internal RC oscillator, if external > oscillator fails. This is enabled by default. Disable it during > probe. > > Signed-off-by: Ondrej Jirman > --- > drivers/rtc/rtc-sun6i.c | 40 ++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 38 insertions(+), 2 deletions(-) > > diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c > index 11f56de52179..7375a530c565 100644 > --- a/drivers/rtc/rtc-sun6i.c > +++ b/drivers/rtc/rtc-sun6i.c > @@ -41,9 +41,11 @@ > /* Control register */ > #define SUN6I_LOSC_CTRL 0x0000 > #define SUN6I_LOSC_CTRL_KEY (0x16aa << 16) > +#define SUN6I_LOSC_CTRL_AUTO_SWT_BYPASS BIT(15) Manual says bit 14? Or is this different from LOSC_AUTO_SWT_EN? The rest looks ok. ChenYu From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen-Yu Tsai Subject: Re: [PATCH 2/3] rtc: sun6i: Add support for H6 RTC Date: Mon, 5 Aug 2019 18:16:14 +0800 Message-ID: References: <20190412120730.473-1-megous@megous.com> <20190412120730.473-3-megous@megous.com> Reply-To: wens-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org In-Reply-To: <20190412120730.473-3-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: =?UTF-8?Q?Ond=C5=99ej_Jirman?= Cc: Alessandro Zummo , Alexandre Belloni , Rob Herring , Mark Rutland , Maxime Ripard , linux-rtc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree , linux-arm-kernel , linux-kernel , linux-sunxi List-Id: devicetree@vger.kernel.org On Fri, Apr 12, 2019 at 8:07 PM megous via linux-sunxi wrote: > > From: Ondrej Jirman > > RTC on H6 is mostly the same as on H5 and H3. It has slight differences > mostly in features that are not yet supported by this driver. > > Some differences are already stated in the comments in existing code. > One other difference is that H6 has extra bit in LOSC_CTRL_REG, called > EXT_LOSC_EN to enable/disable external low speed crystal oscillator. > > It also has bit EXT_LOSC_STA in LOSC_AUTO_SWT_STA_REG, to check whether > external low speed oscillator is working correctly. > > This patch adds support for enabling LOSC when necessary: > > - during reparenting > - when probing the clock > > H6 also has capacbility to automatically reparent RTC clock from > external crystal oscillator, to internal RC oscillator, if external > oscillator fails. This is enabled by default. Disable it during > probe. > > Signed-off-by: Ondrej Jirman > --- > drivers/rtc/rtc-sun6i.c | 40 ++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 38 insertions(+), 2 deletions(-) > > diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c > index 11f56de52179..7375a530c565 100644 > --- a/drivers/rtc/rtc-sun6i.c > +++ b/drivers/rtc/rtc-sun6i.c > @@ -41,9 +41,11 @@ > /* Control register */ > #define SUN6I_LOSC_CTRL 0x0000 > #define SUN6I_LOSC_CTRL_KEY (0x16aa << 16) > +#define SUN6I_LOSC_CTRL_AUTO_SWT_BYPASS BIT(15) Manual says bit 14? Or is this different from LOSC_AUTO_SWT_EN? The rest looks ok. ChenYu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B27DCC0650F for ; Mon, 5 Aug 2019 10:17:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E2112087B for ; Mon, 5 Aug 2019 10:17:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AC6Oa6u0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E2112087B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csie.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xMBo9jJS778dBKobFzlU9hGCnp3UI1aRHOSFzTMi/hc=; b=AC6Oa6u08LrPKw H9ILVsWGRo1awodpQlElyGHivrPb0Ssg3SIpZnTOtBZMtD3/tdsByW2MDm/nnWZdKzX+bBgmImNnM v0ian4LPneSXkqEgkR59gsp3M/IiWpkzekdgoJnLjI0q0BdDvjYZUTAHO+Od8hQFW5mq76P3Grmmo BlHZIKWO+OrhUyZ+RVjDGXJtBEZ9zprRE40vLcSAwYJZXoPgLUPhsK/XXr6lqjgOjRsHwH4vK3xQP qjYDInnu9aldgYR9iQf0cOofVwXvVnx6hbp82ytMPF/m1kPzDon3n3o0K3q2pS7yNXNV5cKLSe8BG SP8rvkpMUoGvZo2drhzg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hua3T-0004kD-G1; Mon, 05 Aug 2019 10:17:27 +0000 Received: from mail-ed1-f68.google.com ([209.85.208.68]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hua2a-0003s4-RW for linux-arm-kernel@lists.infradead.org; Mon, 05 Aug 2019 10:16:34 +0000 Received: by mail-ed1-f68.google.com with SMTP id w20so78111901edd.2 for ; Mon, 05 Aug 2019 03:16:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3byZm4WW5S66f9sH9AAiCJ18IamGlDO717O/42CmSCg=; b=N9UXdqDYQQ6UXnEwSkzoheCOVbjAJLY9UU5/8aK3XWwkFZlxSH11XsDsBQMs4MBU+7 u2SVSyAaruNVyBxU6C8zN0WMilNg5X6w0x/xbSTep5rpYpSG/BxqPCcwV52vs0F33mO/ 1Vnr4A31xPbgZy51jmZh7agEtuhrcG/e1gSbzk59d8+soR4yf0s3+8oilPKL9CiSvc/H O5MjhYhFPIpGcbNOEzSX4TgDsTlzwPgTovt54pGKhTOIU4dQSD/tLzlfch4jmbiVIio0 LcKamWvrSgeODzy1qiDnll2lwaAWU1uqCgI0j2E4KYj38hEKf20STInyNNGe7eeubLEq UbVA== X-Gm-Message-State: APjAAAXIKGtp4eEKZcIiGthNnn7zNvzs3k8IILJsZveGnsJgC1OA/V4Q qsJL1EVlRv7ArN6V117QqaKxNi2x2Qo= X-Google-Smtp-Source: APXvYqyPrlpo8WJkWmCFJ9DyE2tzuCnGnVZyF+Z7qSzeIchDG7hTZ0PO4qnimEArHPGvFQaO7w9aAw== X-Received: by 2002:a50:f70c:: with SMTP id g12mr134221180edn.139.1565000190619; Mon, 05 Aug 2019 03:16:30 -0700 (PDT) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com. [209.85.221.43]) by smtp.gmail.com with ESMTPSA id g7sm19500740eda.52.2019.08.05.03.16.29 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 05 Aug 2019 03:16:30 -0700 (PDT) Received: by mail-wr1-f43.google.com with SMTP id g17so83809998wrr.5 for ; Mon, 05 Aug 2019 03:16:29 -0700 (PDT) X-Received: by 2002:adf:c613:: with SMTP id n19mr104922068wrg.109.1565000189770; Mon, 05 Aug 2019 03:16:29 -0700 (PDT) MIME-Version: 1.0 References: <20190412120730.473-1-megous@megous.com> <20190412120730.473-3-megous@megous.com> In-Reply-To: <20190412120730.473-3-megous@megous.com> From: Chen-Yu Tsai Date: Mon, 5 Aug 2019 18:16:14 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linux-sunxi] [PATCH 2/3] rtc: sun6i: Add support for H6 RTC To: =?UTF-8?Q?Ond=C5=99ej_Jirman?= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190805_031632_972872_6FD86C6F X-CRM114-Status: GOOD ( 20.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Alessandro Zummo , Alexandre Belloni , devicetree , Maxime Ripard , linux-kernel , linux-sunxi , Rob Herring , linux-arm-kernel , linux-rtc@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 12, 2019 at 8:07 PM megous via linux-sunxi wrote: > > From: Ondrej Jirman > > RTC on H6 is mostly the same as on H5 and H3. It has slight differences > mostly in features that are not yet supported by this driver. > > Some differences are already stated in the comments in existing code. > One other difference is that H6 has extra bit in LOSC_CTRL_REG, called > EXT_LOSC_EN to enable/disable external low speed crystal oscillator. > > It also has bit EXT_LOSC_STA in LOSC_AUTO_SWT_STA_REG, to check whether > external low speed oscillator is working correctly. > > This patch adds support for enabling LOSC when necessary: > > - during reparenting > - when probing the clock > > H6 also has capacbility to automatically reparent RTC clock from > external crystal oscillator, to internal RC oscillator, if external > oscillator fails. This is enabled by default. Disable it during > probe. > > Signed-off-by: Ondrej Jirman > --- > drivers/rtc/rtc-sun6i.c | 40 ++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 38 insertions(+), 2 deletions(-) > > diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c > index 11f56de52179..7375a530c565 100644 > --- a/drivers/rtc/rtc-sun6i.c > +++ b/drivers/rtc/rtc-sun6i.c > @@ -41,9 +41,11 @@ > /* Control register */ > #define SUN6I_LOSC_CTRL 0x0000 > #define SUN6I_LOSC_CTRL_KEY (0x16aa << 16) > +#define SUN6I_LOSC_CTRL_AUTO_SWT_BYPASS BIT(15) Manual says bit 14? Or is this different from LOSC_AUTO_SWT_EN? The rest looks ok. ChenYu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel