All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: "Ondřej Jirman" <megous@megous.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	linux-rtc@vger.kernel.org,
	devicetree <devicetree@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-sunxi <linux-sunxi@googlegroups.com>
Subject: Re: [linux-sunxi] [PATCH 2/3] rtc: sun6i: Add support for H6 RTC
Date: Mon, 5 Aug 2019 18:16:14 +0800	[thread overview]
Message-ID: <CAGb2v675j-aCLMgPJOzr9yx1XxsUvHRr_K7VnL=p8mSdwpu2jw@mail.gmail.com> (raw)
In-Reply-To: <20190412120730.473-3-megous@megous.com>

On Fri, Apr 12, 2019 at 8:07 PM megous via linux-sunxi
<linux-sunxi@googlegroups.com> wrote:
>
> From: Ondrej Jirman <megous@megous.com>
>
> 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 <megous@megous.com>
> ---
>  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

WARNING: multiple messages have this Message-ID (diff)
From: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
To: "Ondřej Jirman" <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
Cc: Alessandro Zummo
	<a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org>,
	Alexandre Belloni
	<alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>,
	linux-rtc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	linux-kernel
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-sunxi <linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: [PATCH 2/3] rtc: sun6i: Add support for H6 RTC
Date: Mon, 5 Aug 2019 18:16:14 +0800	[thread overview]
Message-ID: <CAGb2v675j-aCLMgPJOzr9yx1XxsUvHRr_K7VnL=p8mSdwpu2jw@mail.gmail.com> (raw)
In-Reply-To: <20190412120730.473-3-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>

On Fri, Apr 12, 2019 at 8:07 PM megous via linux-sunxi
<linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> wrote:
>
> From: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
>
> 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 <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
> ---
>  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

WARNING: multiple messages have this Message-ID (diff)
From: Chen-Yu Tsai <wens@csie.org>
To: "Ondřej Jirman" <megous@megous.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	devicetree <devicetree@vger.kernel.org>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-sunxi <linux-sunxi@googlegroups.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-rtc@vger.kernel.org
Subject: Re: [linux-sunxi] [PATCH 2/3] rtc: sun6i: Add support for H6 RTC
Date: Mon, 5 Aug 2019 18:16:14 +0800	[thread overview]
Message-ID: <CAGb2v675j-aCLMgPJOzr9yx1XxsUvHRr_K7VnL=p8mSdwpu2jw@mail.gmail.com> (raw)
In-Reply-To: <20190412120730.473-3-megous@megous.com>

On Fri, Apr 12, 2019 at 8:07 PM megous via linux-sunxi
<linux-sunxi@googlegroups.com> wrote:
>
> From: Ondrej Jirman <megous@megous.com>
>
> 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 <megous@megous.com>
> ---
>  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

  reply	other threads:[~2019-08-05 10:16 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 12:07 [PATCH 0/3] Add basic support for RTC on Allwinner H6 SoC megous
2019-04-12 12:07 ` megous
2019-04-12 12:07 ` megous via linux-sunxi
2019-04-12 12:07 ` [PATCH 1/3] dt-bindings: Add compatible for H6 RTC megous
2019-04-12 12:07   ` megous
2019-04-12 12:07   ` megous via linux-sunxi
2019-08-05 10:16   ` [linux-sunxi] " Chen-Yu Tsai
2019-08-05 10:16     ` Chen-Yu Tsai
2019-08-05 10:16     ` Chen-Yu Tsai
2019-04-12 12:07 ` [PATCH 2/3] rtc: sun6i: Add support " megous
2019-04-12 12:07   ` megous
2019-04-12 12:07   ` megous via linux-sunxi
2019-08-05 10:16   ` Chen-Yu Tsai [this message]
2019-08-05 10:16     ` [linux-sunxi] " Chen-Yu Tsai
2019-08-05 10:16     ` Chen-Yu Tsai
2019-08-05 10:20     ` [linux-sunxi] " Ondřej Jirman
2019-08-05 10:20       ` Ondřej Jirman
2019-08-05 10:45     ` Ondřej Jirman
2019-08-05 10:45       ` Ondřej Jirman
2019-08-05 10:45       ` Ondřej Jirman
2019-08-05 10:54       ` [linux-sunxi] " Chen-Yu Tsai
2019-08-05 10:54         ` Chen-Yu Tsai
2019-08-05 11:10         ` Ondřej Jirman
2019-08-05 11:10           ` Ondřej Jirman
2019-08-05 11:10           ` Ondřej Jirman
2019-08-05 11:21           ` [linux-sunxi] " Chen-Yu Tsai
2019-08-05 11:21             ` Chen-Yu Tsai
2019-08-05 11:21             ` Chen-Yu Tsai
2019-08-05 12:16           ` [linux-sunxi] " Clément Péron
2019-08-05 12:16             ` Clément Péron
2019-04-12 12:07 ` [PATCH 3/3] arm64: dts: sun50i-h6: Add support for RTC and fix the clock tree megous
2019-04-12 12:07   ` megous
2019-04-12 12:07   ` megous via linux-sunxi
2019-04-15  8:18 ` [linux-sunxi] [PATCH 0/3] Add basic support for RTC on Allwinner H6 SoC Chen-Yu Tsai
2019-04-15  8:18   ` Chen-Yu Tsai
2019-04-15  8:18   ` Chen-Yu Tsai
2019-04-15 14:22   ` [linux-sunxi] " Ondřej Jirman
2019-04-15 14:22     ` Ondřej Jirman
2019-04-15 14:22     ` 'Ondřej Jirman' via linux-sunxi
2019-04-15 14:33     ` [linux-sunxi] " Maxime Ripard
2019-04-15 14:33       ` Maxime Ripard
2019-04-15 14:33       ` Maxime Ripard
2019-04-15 14:39       ` [linux-sunxi] " Chen-Yu Tsai
2019-04-15 14:39         ` Chen-Yu Tsai
2019-04-15 14:39         ` Chen-Yu Tsai
2019-04-15 14:35     ` [linux-sunxi] " Chen-Yu Tsai
2019-04-15 14:35       ` Chen-Yu Tsai
2019-04-15 14:35       ` Chen-Yu Tsai
2019-04-15 15:17       ` [linux-sunxi] " Ondřej Jirman
2019-04-15 15:17         ` Ondřej Jirman
2019-04-15 15:17         ` 'Ondřej Jirman' via linux-sunxi
2019-08-06 18:30   ` [linux-sunxi] " Ondřej Jirman
2019-08-06 18:30     ` Ondřej Jirman
2019-08-06 18:30     ` Ondřej Jirman
2019-08-06 22:27     ` [linux-sunxi] " Ondřej Jirman
2019-08-06 22:27       ` Ondřej Jirman
2019-08-06 22:27       ` Ondřej Jirman
2019-08-07 10:55     ` [linux-sunxi] " Alexandre Belloni
2019-08-07 10:55       ` Alexandre Belloni
2019-08-07 10:55       ` Alexandre Belloni
2019-08-08  5:48       ` [linux-sunxi] " Chen-Yu Tsai
2019-08-08  5:48         ` Chen-Yu Tsai
2019-08-08  5:48         ` Chen-Yu Tsai
2019-08-08 12:12       ` [linux-sunxi] " Ondřej Jirman
2019-08-08 12:12         ` Ondřej Jirman
2019-08-08 12:12         ` Ondřej Jirman
2019-08-08 23:39         ` [linux-sunxi] " Alexandre Belloni
2019-08-08 23:39           ` Alexandre Belloni
2019-08-08 23:39           ` Alexandre Belloni
2019-08-09  9:16           ` [linux-sunxi] " Ondřej Jirman
2019-08-09  9:16             ` Ondřej Jirman
2019-08-09  9:16             ` Ondřej Jirman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGb2v675j-aCLMgPJOzr9yx1XxsUvHRr_K7VnL=p8mSdwpu2jw@mail.gmail.com' \
    --to=wens@csie.org \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=megous@megous.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.