[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251125150632.299890-13-biju.das.jz@bp.renesas.com>
Date: Tue, 25 Nov 2025 15:06:14 +0000
From: Biju <biju.das.au@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>
Cc: Biju Das <biju.das.jz@...renesas.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org,
devicetree@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
Biju Das <biju.das.au@...il.com>
Subject: [PATCH v4 12/16] serial: sh-sci: Add support for RZ/G3E RSCI clks
From: Biju Das <biju.das.jz@...renesas.com>
RZ/G3E RSCI has 6 clocks (5 module clocks + 1 external clock). Add
support for the module clocks.
Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
---
v3->v4:
* Replaced clock name of RZ/G3E from bus->pclk
* Rearranged clocks tclk{4,16,64}.
* Reduced the checks in sci_init_clocks() by avoid looking up clocks that
are not relevant for the port.
v2->v3:
* No change.
v1->v2:
* Updated commit description.
---
drivers/tty/serial/sh-sci-common.h | 3 +++
drivers/tty/serial/sh-sci.c | 10 ++++++++++
2 files changed, 13 insertions(+)
diff --git a/drivers/tty/serial/sh-sci-common.h b/drivers/tty/serial/sh-sci-common.h
index abcd5bcc7c36..5d30771278b4 100644
--- a/drivers/tty/serial/sh-sci-common.h
+++ b/drivers/tty/serial/sh-sci-common.h
@@ -16,6 +16,9 @@ enum SCI_CLKS {
SCI_SCK, /* Optional External Clock */
SCI_BRG_INT, /* Optional BRG Internal Clock Source */
SCI_SCIF_CLK, /* Optional BRG External Clock Source */
+ SCI_FCK_DIV4, /* Optional Functional Clock frequency-divided by 4 */
+ SCI_FCK_DIV16, /* Optional Functional Clock frequency-divided by 16 */
+ SCI_FCK_DIV64, /* Optional Functional Clock frequency-divided by 64 */
SCI_NUM_CLKS
};
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 9afc3b8aae91..d7c25635bb2a 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3172,6 +3172,9 @@ static int sci_init_clocks(struct sci_port *sci_port, struct device *dev)
[SCI_SCK] = "sck",
[SCI_BRG_INT] = "brg_int",
[SCI_SCIF_CLK] = "scif_clk",
+ [SCI_FCK_DIV4] = "tclk_div4",
+ [SCI_FCK_DIV16] = "tclk_div16",
+ [SCI_FCK_DIV64] = "tclk_div64",
};
struct clk *clk;
unsigned int i;
@@ -3181,6 +3184,9 @@ static int sci_init_clocks(struct sci_port *sci_port, struct device *dev)
} else if (sci_port->type == RSCI_PORT_SCIF16) {
clk_names[SCI_FCK] = "operation";
clk_names[SCI_BRG_INT] = "bus";
+ } else if (sci_port->type == RSCI_PORT_SCIF32) {
+ clk_names[SCI_FCK] = "tclk";
+ clk_names[SCI_BRG_INT] = "pclk";
}
for (i = 0; i < SCI_NUM_CLKS; i++) {
@@ -3194,6 +3200,10 @@ static int sci_init_clocks(struct sci_port *sci_port, struct device *dev)
(i == SCI_FCK || i == SCI_BRG_INT))
return dev_err_probe(dev, -ENODEV, "failed to get %s\n", name);
+ if (!clk && sci_port->type == RSCI_PORT_SCIF32 &&
+ (i != SCI_SCK && i != SCI_SCIF_CLK))
+ return dev_err_probe(dev, -ENODEV, "failed to get %s\n", name);
+
if (!clk && i == SCI_FCK) {
/*
* Not all SH platforms declare a clock lookup entry
--
2.43.0
Powered by blists - more mailing lists