From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org,
alexandre.belloni@bootlin.com, magnus.damm@gmail.com,
p.zabel@pengutronix.de, linux-renesas-soc@vger.kernel.org,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v3 05/12] dt-bindings: rtc: renesas,rzg3s-rtc: Document the Renesas RTCA-3 IP
Date: Thu, 10 Oct 2024 12:52:52 +0300 [thread overview]
Message-ID: <1c733190-bd46-43d0-8f3d-62e0ed5fde42@tuxon.dev> (raw)
In-Reply-To: <CAMuHMdWeGC_N3-XF29+UUR43OGJKqVNNHs042J8HRuNpiD=vOg@mail.gmail.com>
Hi, Geert,
On 10.10.2024 12:29, Geert Uytterhoeven wrote:
> Hi Claudiu,
>
> On Fri, Aug 30, 2024 at 3:02 PM Claudiu <claudiu.beznea@tuxon.dev> wrote:
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> Document the RTC IP (RTCA-3) available on the Renesas RZ/G3S SoC.
>> The RTC IP available on Renesas RZ/V2H is almost identical with the
>> one found on Renesas RZ/G3S (it misses the time capture functionality
>> which is not yet implemented on proposed driver). For this, added also a
>> generic compatible that will be used at the moment as fallback for both
>> RZ/G3S and RZ/V2H.
>>
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>> ---
>>
>> Changes in v3:
>> - added RTC bus clock, reset and power-domain; it has been detected
>> by reverse engineering that RTC and VBATTB clock, reset and power
>> domain are shared; HW manual doesn't mention it
>> - updated example with these and with assigned-clock properties
>> needed to configure the VBATTCLK MUX with proper parent
>> - updated example section with dt-bindings/clock/r9a08g045-cpg.h
>> and dt-bindings/clock/r9a08g045-vbattb.h includes
>> - for all these, dropped Conor's Rb tag
>
> Thanks for the update!
>
> Sorry for chiming in late, but this RTCA-3 block seems to be a
> derivative of the RTC blocks found on older SuperH SoCs, and on RZ/A1
> and RZ/A2 ARM SoCs. Differences are found in (lack of)
> 100/1000-year-count parts and the Year Alarm Enable Register, and in
> some control register bits.
At a 1st look it seems so, yes. I was inclined at the beginning to just use
the rtc-sh but the RZ/G3S HW manual mentions a lot of restrictions that
need to be followed when configuring the IP. Because of these restrictions
I chose to have a different driver. Otherwise the rtc-sh would have become
way too complication as far as I can tell.
From these restriction I can mention:
- wait for 2*1/64 periods when configuring the alarm
- from HW manual: When the RCR1 register is modified,
check that all the
bits have been updated before proceeding to the next processing
- from HW manual: section 22.6.4. Notes on writing to and
reading from registers) after writing to count registers, alarm
registers, year alarm enable register, bits RCR2.AADJE, AADJP,
and HR24 register, we need to do 3 empty reads before being
able to fetch the registers content.
- updates to RCR2.START need to be checked before continuing (note 2 from
HW manual on RCR2 register: After writing to this bit, confirm that its
value has actually changed before proceeding with further processing)
- there are many bits that are synchronized w/ count source and need to be
checked before proceeding (when setting it up).
- According to HW manual (section 22.4.2. Clock and count mode setting
procedure) we need to wait at least 6 cycles of the 32KHz clock after
clock was enabled.
- According to HW manual (section 22.3.19. RTC Control
Register 2) when set 24 hours mode this needs to be done separate from
stop operation.
- According to HW manual (section 22.6.3. Notes on writing to and reading
from registers) after reset we need to wait 6 clock cycles before
writing to RTC registers.
- According to HW manual (section 22.6.4. Notes on writing to and reading
from registers) we need to wait 1/128 seconds while the clock is
operating (RCR2.START bit = 1) to be able to read the counters after a
return from reset.
- and there are other restrictions
Thank you,
Claudiu Beznea
>
> The SuperH and RZ/A1 variant is supported by drivers/rtc/rtc-sh.c;
> DT bindings for the latter are found in
> Documentation/devicetree/bindings/rtc/renesas,sh-rtc.yaml.
>
> (My first guess was that RTC-A1 is used on RZ/A1, RTC-A2 on RZ/A2,
> and RTC-A3 on RZ/A3, but apparently RZ/A3UL does not have an RTC...
> Oh well, at least it is used on later RZ series SoCs...)
>
> Gr{oetje,eeting}s,
>
> Geert
>
next prev parent reply other threads:[~2024-10-10 9:52 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 13:02 [PATCH v3 00/12] Add RTC support for the Renesas RZ/G3S SoC Claudiu
2024-08-30 13:02 ` [PATCH v3 01/12] dt-bindings: clock: renesas,r9a08g045-vbattb: Document VBATTB Claudiu
2024-08-30 17:46 ` Rob Herring
2024-08-30 22:06 ` Alexandre Belloni
2024-09-02 14:55 ` claudiu beznea
2024-09-03 6:58 ` Biju Das
2024-09-03 7:23 ` Geert Uytterhoeven
2024-09-03 7:25 ` Biju Das
2024-09-03 7:29 ` Biju Das
2024-09-03 7:28 ` claudiu beznea
2024-09-03 7:36 ` Biju Das
2024-09-03 7:40 ` Geert Uytterhoeven
2024-09-03 7:44 ` claudiu beznea
2024-09-03 7:51 ` Biju Das
2024-10-10 9:58 ` Geert Uytterhoeven
2024-10-10 10:08 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 02/12] dt-bindings: clock: r9a08g045-vbattb: Add clock IDs for the VBATTB controller Claudiu
2024-08-30 17:47 ` Rob Herring
2024-10-10 9:55 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 03/12] clk: linux/clk-provider.h: Add devm_clk_hw_register_gate_parent_hw() Claudiu
2024-10-10 10:00 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 04/12] clk: renesas: clk-vbattb: Add VBATTB clock driver Claudiu
2024-10-10 10:06 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 05/12] dt-bindings: rtc: renesas,rzg3s-rtc: Document the Renesas RTCA-3 IP Claudiu
2024-08-30 15:44 ` Rob Herring (Arm)
2024-10-10 9:29 ` Geert Uytterhoeven
2024-10-10 9:52 ` claudiu beznea [this message]
2024-10-10 15:31 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 06/12] rtc: renesas-rtca3: Add driver for RTCA-3 available on Renesas RZ/G3S SoC Claudiu
2024-08-30 22:25 ` Alexandre Belloni
2024-09-02 14:49 ` claudiu beznea
2024-09-02 20:28 ` Alexandre Belloni
2024-09-03 7:29 ` claudiu beznea
2024-09-03 16:09 ` claudiu beznea
2024-09-03 17:36 ` Alexandre Belloni
2024-10-17 10:45 ` Wolfram Sang
2024-10-17 10:51 ` Geert Uytterhoeven
2024-10-17 11:04 ` Wolfram Sang
2024-08-30 13:02 ` [PATCH v3 07/12] arm64: dts: renesas: r9a08g045: Add VBATTB node Claudiu
2024-09-03 19:48 ` Stephen Boyd
2024-09-04 12:17 ` claudiu beznea
2024-09-05 18:09 ` Stephen Boyd
2024-09-06 7:28 ` Geert Uytterhoeven
2024-09-06 23:01 ` Stephen Boyd
2024-09-09 12:11 ` Geert Uytterhoeven
2024-09-09 21:18 ` Stephen Boyd
2024-09-10 8:02 ` Geert Uytterhoeven
2024-10-10 15:17 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 08/12] arm64: dts: renesas: r9a08g045: Add RTC node Claudiu
2024-10-10 15:22 ` Geert Uytterhoeven
2024-10-11 10:28 ` claudiu beznea
2024-10-16 22:03 ` Alexandre Belloni
2024-10-17 7:57 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 09/12] arm64: dts: renesas: rzg3s-smarc-som: Enable VBATTB Claudiu
2024-10-10 15:28 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 10/12] arm64: dts: renesas: rzg3s-smarc-som: Enable RTC Claudiu
2024-10-10 15:28 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 11/12] arm64: defconfig: Enable VBATTB clock Claudiu
2024-10-10 15:29 ` Geert Uytterhoeven
2024-08-30 13:02 ` [PATCH v3 12/12] arm64: defconfig: Enable Renesas RTCA-3 flag Claudiu
2024-10-10 15:30 ` Geert Uytterhoeven
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=1c733190-bd46-43d0-8f3d-62e0ed5fde42@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sboyd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®