<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/rtc/rtc-stm32.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-08-14T09:37:07+00:00</updated>
<entry>
<title>rtc: stm32: add alarm A out feature</title>
<updated>2024-08-14T09:37:07+00:00</updated>
<author>
<name>Valentin Caron</name>
<email>valentin.caron@foss.st.com</email>
</author>
<published>2024-07-22T16:00:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=04dcadb87da68d1349b658b1fef04f077b78c13c'/>
<id>urn:sha1:04dcadb87da68d1349b658b1fef04f077b78c13c</id>
<content type='text'>
STM32 RTC can pulse some SOC pins when an RTC alarm expires.
This patch adds this functionality for alarm A. The pulse can out on three
pins RTC_OUT1, RTC_OUT2, RTC_OUT2_RMP (PC13, PB2, PI8 on stm32mp15)
(PC13, PB2, PI1 on stm32mp13) (PC13, PF4/PF6, PI8 on stm32mp25).

This patch only adds the functionality for devices which are using
st,stm32mp1-rtc and st,stm32mp25-rtc compatible.

Add "alarm-a" in pinmux functions.

Signed-off-by: Valentin Caron &lt;valentin.caron@foss.st.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Link: https://lore.kernel.org/r/20240722160022.454226-5-valentin.caron@foss.st.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: stm32: add Low Speed Clock Output (LSCO) support</title>
<updated>2024-08-14T09:37:07+00:00</updated>
<author>
<name>Valentin Caron</name>
<email>valentin.caron@foss.st.com</email>
</author>
<published>2024-07-22T16:00:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bb7b0df2be5c6b7bfe0cf9c93067c5b1489566ca'/>
<id>urn:sha1:bb7b0df2be5c6b7bfe0cf9c93067c5b1489566ca</id>
<content type='text'>
RTC is able to output on a pin the "LSE" internal clock.

STM32 RTC is now registered as a clock provider.
It provides rtc_lsco clock, that means RTC_LSCO is output on either
RTC_OUT1 or RTC_OUT2_RMP, depending on pinmux DT property.
The clock is marked as CLK_IGNORE_UNUSED and CLK_IS_CRITICAL because
RTC_LSCO can be early required by devices needed it to init.

Add LSCO in pinmux functions.

Add "stm32_rtc_clean_outs" to disable LSCO. As RTC is part of "backup"
power domain, it is not reset during shutdown or reboot. So force LSCO
disable at probe.

Co-developed-by: Amelie Delaunay &lt;amelie.delaunay@foss.st.com&gt;
Signed-off-by: Amelie Delaunay &lt;amelie.delaunay@foss.st.com&gt;
Signed-off-by: Valentin Caron &lt;valentin.caron@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240722160022.454226-4-valentin.caron@foss.st.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: stm32: add pinctrl and pinmux interfaces</title>
<updated>2024-08-14T09:37:07+00:00</updated>
<author>
<name>Valentin Caron</name>
<email>valentin.caron@foss.st.com</email>
</author>
<published>2024-07-22T16:00:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=16ad2bc09efbcb9cb24f8d879ac218421cbef690'/>
<id>urn:sha1:16ad2bc09efbcb9cb24f8d879ac218421cbef690</id>
<content type='text'>
STM32 RTC is capable to handle 3 specific pins of the soc.
"out1, out2 and out2_rmp". To handle this, we use pinctrl framework.
There is a single pin per group.

Signed-off-by: Valentin Caron &lt;valentin.caron@foss.st.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Link: https://lore.kernel.org/r/20240722160022.454226-3-valentin.caron@foss.st.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: stm32: add new st,stm32mp25-rtc compatible and check RIF configuration</title>
<updated>2024-07-10T15:15:33+00:00</updated>
<author>
<name>Valentin Caron</name>
<email>valentin.caron@foss.st.com</email>
</author>
<published>2024-07-08T15:34:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=efa9c5be2caecae7dfa4f29c6ab3d4a2f341eb15'/>
<id>urn:sha1:efa9c5be2caecae7dfa4f29c6ab3d4a2f341eb15</id>
<content type='text'>
Introduce new st,stm32mp25-rtc compatible. It is based on st,stm32mp1-rtc.

Difference is that stm32mp25 soc implements a triple protection on RTC
registers:
- Secure bit based protection
- Privileged context based protection
- Compartment ID filtering based protection
This driver will now check theses configurations before probing to avoid
exceptions and fake reads on register.

At this time, driver needs only to check two resources: INIT and ALARM_A.
Other resources are not used.

Resource isolation framework (RIF) is a comprehensive set of hardware
blocks designed to enforce and manage isolation of STM32 hardware
resources, like memory and peripherals.

Link: https://www.st.com/resource/en/reference_manual/rm0457-stm32mp25xx-advanced-armbased-3264bit-mpus-stmicroelectronics.pdf#page=4081
Signed-off-by: Valentin Caron &lt;valentin.caron@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240708153434.416287-3-valentin.caron@foss.st.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: stm32: Use NOIRQ_SYSTEM_SLEEP_PM_OPS()</title>
<updated>2023-08-16T22:53:00+00:00</updated>
<author>
<name>Nathan Chancellor</name>
<email>nathan@kernel.org</email>
</author>
<published>2023-08-15T22:16:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2cf2a1acc6ebdffc6363de9156db8737f33c1803'/>
<id>urn:sha1:2cf2a1acc6ebdffc6363de9156db8737f33c1803</id>
<content type='text'>
After the switch to SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() and a subsequent
fix, stm32_rtc_{suspend,resume}() are unused when CONFIG_PM_SLEEP is not
set because SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is a no-op in that
configuration:

  drivers/rtc/rtc-stm32.c:904:12: error: 'stm32_rtc_resume' defined but not used [-Werror=unused-function]
    904 | static int stm32_rtc_resume(struct device *dev)
        |            ^~~~~~~~~~~~~~~~
  drivers/rtc/rtc-stm32.c:894:12: error: 'stm32_rtc_suspend' defined but not used [-Werror=unused-function]
    894 | static int stm32_rtc_suspend(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

The non-"SET_" version of this macro, NOIRQ_SYSTEM_SLEEP_PM_OPS(), is
designed to handle this situation by only assigning the callbacks when
CONFIG_PM_SLEEP is set while allowing the functions to appear used to
the compiler. Switch to that macro to resolve the warnings. There is no
functional change with this, as SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is
defined using NOIRQ_SYSTEM_SLEEP_PM_OPS() when CONFIG_PM_SLEEP is set.

Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://lore.kernel.org/r/20230815-rtc-stm32-unused-pm-funcs-v1-1-82eb8e02d903@kernel.org
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: stm32: remove incorrect #ifdef check</title>
<updated>2023-08-10T07:22:04+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2023-08-01T10:59:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a69c610e13e2b2de8a1ed2683f13e21b3200bd7a'/>
<id>urn:sha1:a69c610e13e2b2de8a1ed2683f13e21b3200bd7a</id>
<content type='text'>
After a previous commit changed the driver over to
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(), the suspend/resume
functions must no longer be hidden behind an #ifdef:

In file included from include/linux/clk.h:13,
                 from drivers/rtc/rtc-stm32.c:8:
drivers/rtc/rtc-stm32.c:927:39: error: 'stm32_rtc_suspend' undeclared here (not in a function); did you mean 'stm32_rtc_probe'?
  927 |         SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(stm32_rtc_suspend, stm32_rtc_resume)
      |                                       ^~~~~~~~~~~~~~~~~
include/linux/kernel.h:58:44: note: in definition of macro 'PTR_IF'
   58 | #define PTR_IF(cond, ptr)       ((cond) ? (ptr) : NULL)
      |                                            ^~~
include/linux/pm.h:329:26: note: in expansion of macro 'pm_sleep_ptr'
  329 |         .suspend_noirq = pm_sleep_ptr(suspend_fn), \
      |                          ^~~~~~~~~~~~

Fixes: fb9a7e5360dc8 ("rtc: stm32: change PM callbacks to "_noirq()"")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Valentin Caron &lt;valentin.caron@foss.st.com&gt;
Link: https://lore.kernel.org/r/20230801105932.3738430-1-arnd@kernel.org
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: Explicitly include correct DT includes</title>
<updated>2023-07-27T21:31:29+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-07-24T20:54:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=48144c2890503b919bc8ee128b63e37008d69250'/>
<id>urn:sha1:48144c2890503b919bc8ee128b63e37008d69250</id>
<content type='text'>
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Link: https://lore.kernel.org/r/20230724205456.767430-1-robh@kernel.org
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: stm32: fix unnecessary parentheses</title>
<updated>2023-07-27T21:03:34+00:00</updated>
<author>
<name>Valentin Caron</name>
<email>valentin.caron@foss.st.com</email>
</author>
<published>2023-07-05T17:43:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=650915ecd8f8cbb58e1ef55430f9e15ae03fd7d8'/>
<id>urn:sha1:650915ecd8f8cbb58e1ef55430f9e15ae03fd7d8</id>
<content type='text'>
Fix a few style issues reported by checkpatch.pl:
- Unnecessary parentheses
- Lines should not end with a '('

Signed-off-by: Valentin Caron &lt;valentin.caron@foss.st.com&gt;
Link: https://lore.kernel.org/r/20230705174357.353616-8-valentin.caron@foss.st.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: stm32: fix issues of stm32_rtc_valid_alrm function</title>
<updated>2023-07-27T21:03:34+00:00</updated>
<author>
<name>Valentin Caron</name>
<email>valentin.caron@foss.st.com</email>
</author>
<published>2023-07-05T17:43:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=46828a5f89044b8e057f6bbb50ae2bac926a0fa2'/>
<id>urn:sha1:46828a5f89044b8e057f6bbb50ae2bac926a0fa2</id>
<content type='text'>
stm32_rtc_valid_alrm function has some issues :
- arithmetical operations are impossible on BCD values
- "cur_mon + 1" can overflow
- the use case with the next month, the same day/hour/minutes went wrong

To solve that, we prefer to use timestamp comparison.
e.g. : On 5 Dec. 2021, the alarm limit is 5 Jan. 2022 (+31 days)
       On 31 Jan 2021, the alarm limit is 28 Feb. 2022 (+28 days)

Signed-off-by: Valentin Caron &lt;valentin.caron@foss.st.com&gt;
Link: https://lore.kernel.org/r/20230705174357.353616-7-valentin.caron@foss.st.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: stm32: change PM callbacks to "_noirq()"</title>
<updated>2023-07-27T21:03:34+00:00</updated>
<author>
<name>Gabriel Fernandez</name>
<email>gabriel.fernandez@foss.st.com</email>
</author>
<published>2023-07-05T17:43:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fb9a7e5360dc8089097337a9685f6fed350a310f'/>
<id>urn:sha1:fb9a7e5360dc8089097337a9685f6fed350a310f</id>
<content type='text'>
The RTC driver stops the RTCAPB clock during suspend, but the
irq handler from RTC is called before starting clock. Then we are
blocked while accessing RTC registers.

We changes PM callbacks to '_no_irq()' to disable irq during
resume callback and so irq handler will be called after the enable
of RTCAPB clock.

Signed-off-by: Gabriel Fernandez &lt;gabriel.fernandez@foss.st.com&gt;
Signed-off-by: Valentin Caron &lt;valentin.caron@foss.st.com&gt;
Link: https://lore.kernel.org/r/20230705174357.353616-6-valentin.caron@foss.st.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
</feed>
