clk: renesas: cpg-mssr: Ignore all clocks assigned to non-Linux system
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 10 Jan 2024 01:14:55 +0000 (01:14 +0000)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 23 Jan 2024 20:23:34 +0000 (21:23 +0100)
commit6aa175476490166847df7659d30be8b1b9bac395
treea96b80ac18bd7691bc9e0da520979e48153fe708
parent28c5d4e40752fc39507a647b20649c5ca1cf33b7
clk: renesas: cpg-mssr: Ignore all clocks assigned to non-Linux system

Some boards might use Linux and another OS at the same time. In such
case, currently, during booting, Linux will stop necessary module clocks
which are not used on the Linux side, but are used by another OS.

To avoid such situation, renesas-cpg-mssr tries to find
status = "reserved" devices (A), and adds CLK_IGNORE_UNUSED flag to its
<&cgp CPG_MOD xxx> clock (B).

Table 2.4: Values for status property
https://github.com/devicetree-org/devicetree-specification/releases/download/v0.4/devicetree-specification-v0.4.pdf

"reserved"
Indicates that the device is operational, but should not be
used. Typically this is used for devices that are controlled
by another software component, such as platform firmware.

ex)
scif5: serial@e6f30000 {
...
(B) clocks = <&cpg CPG_MOD 202>,
 <&cpg CPG_CORE R8A7795_CLK_S3D1>,
 <&scif_clk>;
...
(A) status = "reserved";
};

Cc: Aymeric Aillet <aymeric.aillet@iot.bzh>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/878r4ygfap.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/clk/renesas/renesas-cpg-mssr.c