* [PATCH v6 01/14] clk: renesas: r8a78000: Merge debug prints in r8a78000_clk_get()
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 02/14] clk: renesas: r8a78000: Replace sentinel by explicit ID map size Geert Uytterhoeven
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
The two debug prints in r8a78000_clk_get() are very similar.
Merge them into a single debug print.
Note that the clock's name is still printed, but its ID no longer is, as
that is purely internal. The printing of real firmware IDs will be
readded when their handling is added.
While at it, unwrap the (wrongly-indented) continuation of the
r8a78000_clk_get() function header, as it fits on a single line.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
v6:
- Add Reviewed-by,
- Clarify that fw_id printing will be readded later,
v5:
- New.
---
drivers/clk/renesas/r8a78000-cpg.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/renesas/r8a78000-cpg.c b/drivers/clk/renesas/r8a78000-cpg.c
index 6fee05a899f47bf4..0e11ae139fbffd80 100644
--- a/drivers/clk/renesas/r8a78000-cpg.c
+++ b/drivers/clk/renesas/r8a78000-cpg.c
@@ -62,8 +62,7 @@ static const struct clk_map *clk_map_find(const struct clk_map *map, u32 id)
return NULL;
}
-static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec,
- void *data)
+static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec, void *data)
{
struct r8a78000_cpg_priv *priv = data;
struct device *dev = priv->dev;
@@ -82,12 +81,10 @@ static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec,
return ERR_PTR(-ENOENT);
}
- dev_dbg(dev, "Mapping DT clock %u to fixed clock %u\n", id, map->fw_id);
-
hw = priv->fixed_hws[map->fw_id];
- dev_dbg(dev, "clock %u is %s at %lu Hz\n", id, clk_hw_get_name(hw),
- clk_hw_get_rate(hw));
+ dev_dbg(dev, "Mapping DT clock %u to %s at %lu Hz\n", id,
+ clk_hw_get_name(hw), clk_hw_get_rate(hw));
return hw;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 02/14] clk: renesas: r8a78000: Replace sentinel by explicit ID map size
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 01/14] clk: renesas: r8a78000: Merge debug prints in r8a78000_clk_get() Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 04/14] clk: renesas: r8a78000: Add clk_hw to clk_map Geert Uytterhoeven
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven, Laurent Pinchart
From: Geert Uytterhoeven <geert+renesas@glider.be>
The use of a sentinel in the clock ID mapping array will become
cumbersome when the need arises to find out the actual number of
elements in the array. Rework the mapping data structure to fix this,
also improving naming. Add a CLK_ID_MAP() initialization macro for
brevity.
While at it, drop the check for "!map" in clk_id_map_find(), as that
pointer can never be NULL.
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
v6:
- Add Reviewed-by,
v5:
- New.
---
drivers/clk/renesas/r8a78000-cpg.c | 45 +++++++++++++++++-------------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/drivers/clk/renesas/r8a78000-cpg.c b/drivers/clk/renesas/r8a78000-cpg.c
index 0e11ae139fbffd80..03fcd128d4293cfc 100644
--- a/drivers/clk/renesas/r8a78000-cpg.c
+++ b/drivers/clk/renesas/r8a78000-cpg.c
@@ -16,11 +16,21 @@
#include <dt-bindings/clock/renesas,r8a78000-cpg.h>
-struct clk_map {
- int dt_id; /* DT binding clock ID or -1 sentinel */
+struct clk_id_map_entry {
+ u32 dt_id; /* DT binding clock ID */
u32 fw_id; /* FIXED_CLK() ID */
};
+struct clk_id_map {
+ const struct clk_id_map_entry *entries;
+ unsigned int size;
+};
+
+#define CLK_ID_MAP(_entries) &(struct clk_id_map) { \
+ .entries = _entries, \
+ .size = ARRAY_SIZE(_entries), \
+}
+
enum fixed_clk {
FIXED_CLK_66M,
FIXED_CLK_133M,
@@ -40,23 +50,21 @@ static const unsigned long fixed_clk_rates[NUM_FIXED_CLKS] = {
* struct r8a78000_cpg_priv - Clock Pulse Generator Private Data
*
* @dev: CPG device
- * @map: Mapping from DT clock IDs to fixed-rate clocks
+ * @map: Mapping from DT clock IDs to fixed-rate clock IDs
* @fixed_hws: Fixed rate clocks
*/
struct r8a78000_cpg_priv {
struct device *dev;
- const struct clk_map *map;
+ const struct clk_id_map *map;
struct clk_hw *fixed_hws[NUM_FIXED_CLKS];
};
-static const struct clk_map *clk_map_find(const struct clk_map *map, u32 id)
+static const struct clk_id_map_entry *clk_id_map_find(const struct clk_id_map *map,
+ u32 dt_id)
{
- if (!map)
- return NULL;
-
- for (; map->dt_id >= 0; map++) {
- if (map->dt_id == id)
- return map;
+ for (unsigned int i = 0; i < map->size; i++) {
+ if (map->entries[i].dt_id == dt_id)
+ return &map->entries[i];
}
return NULL;
@@ -65,8 +73,8 @@ static const struct clk_map *clk_map_find(const struct clk_map *map, u32 id)
static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec, void *data)
{
struct r8a78000_cpg_priv *priv = data;
+ const struct clk_id_map_entry *entry;
struct device *dev = priv->dev;
- const struct clk_map *map;
struct clk_hw *hw;
u32 id;
@@ -75,13 +83,13 @@ static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec, void *data)
id = spec->args[0];
- map = clk_map_find(priv->map, id);
- if (!map) {
+ entry = clk_id_map_find(priv->map, id);
+ if (!entry) {
dev_err(dev, "Unknown clock %u\n", id);
return ERR_PTR(-ENOENT);
}
- hw = priv->fixed_hws[map->fw_id];
+ hw = priv->fixed_hws[entry->fw_id];
dev_dbg(dev, "Mapping DT clock %u to %s at %lu Hz\n", id,
clk_hw_get_name(hw), clk_hw_get_rate(hw));
@@ -116,7 +124,7 @@ static int r8a78000_cpg_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct r8a78000_cpg_priv *priv;
- const struct clk_map *map;
+ const struct clk_id_map *map;
int ret;
map = of_device_get_match_data(dev);
@@ -137,17 +145,16 @@ static int r8a78000_cpg_probe(struct platform_device *pdev)
return devm_of_clk_add_hw_provider(dev, r8a78000_clk_get, priv);
}
-static const struct clk_map r8a78000_cpg_default[] = {
+static const struct clk_id_map_entry r8a78000_cpg_default[] = {
{ R8A78000_CPG_SGASYNCD4_PERW_BUS, FIXED_CLK(266M) },
{ R8A78000_CPG_SGASYNCD8_PERW_BUS, FIXED_CLK(133M) },
{ R8A78000_CPG_SGASYNCD16_PERW_BUS, FIXED_CLK(66M) },
- { -1 }
};
static const struct of_device_id r8a78000_cpg_match[] = {
{
.compatible = "renesas,r8a78000-cpg",
- .data = &r8a78000_cpg_default,
+ .data = CLK_ID_MAP(r8a78000_cpg_default),
},
{ /* sentinel */ }
};
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 04/14] clk: renesas: r8a78000: Add clk_hw to clk_map
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 01/14] clk: renesas: r8a78000: Merge debug prints in r8a78000_clk_get() Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 02/14] clk: renesas: r8a78000: Replace sentinel by explicit ID map size Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 05/14] clk: renesas: r8a78000: Add SCMI remapping support Geert Uytterhoeven
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
Prepare for mapping to other than fixed-rate clocks by adding an array
of clk_hw pointers, indexed by the clock map entry index, and populating
it up-front.
Move r8a78000_cpg_priv.fixed_hws into get_hws(), as it is no longer
needed afterwards, and drop NUM_FIXED_CLKS.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
v6:
- Add Reviewed-by,
- Move local variables to loop scope where possible,
v5:
- Add Tested-by,
- Rebase,
- Use kzalloc_objs() and __free() instead of devm_k{calloc,free}() for
the temporary array of fixed clocks,
- Replace devm_kcalloc() by devm_kzalloc_objs(),
- Replace unified clk_map by keeping the original clk_id_map and
adding a separate array of clk_hw pointers,
- Let clk_id_map_find() return an index,
- Replace fill_clk_map() by get_hws(),
v4:
- No changes,
v3:
- New.
---
drivers/clk/renesas/r8a78000-cpg.c | 79 ++++++++++++++++++++----------
1 file changed, 52 insertions(+), 27 deletions(-)
diff --git a/drivers/clk/renesas/r8a78000-cpg.c b/drivers/clk/renesas/r8a78000-cpg.c
index 236c638834703f95..b68fd7cd89c994df 100644
--- a/drivers/clk/renesas/r8a78000-cpg.c
+++ b/drivers/clk/renesas/r8a78000-cpg.c
@@ -5,6 +5,7 @@
* Copyright (C) 2026 Glider bv
*/
+#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/dev_printk.h>
@@ -35,10 +36,9 @@ enum fixed_clk {
FIXED_CLK_66M,
FIXED_CLK_133M,
FIXED_CLK_266M,
- NUM_FIXED_CLKS
};
-static const unsigned long fixed_clk_rates[NUM_FIXED_CLKS] = {
+static const unsigned long fixed_clk_rates[] = {
[FIXED_CLK_66M] = 66666000,
[FIXED_CLK_133M] = 133330000,
[FIXED_CLK_266M] = 266660000,
@@ -51,31 +51,30 @@ static const unsigned long fixed_clk_rates[NUM_FIXED_CLKS] = {
*
* @dev: CPG device
* @map: Mapping from DT clock IDs to fixed-rate clock IDs
- * @fixed_hws: Fixed rate clocks
+ * @hws: Clocks, indexed by @map entry index
*/
struct r8a78000_cpg_priv {
struct device *dev;
const struct clk_id_map *map;
- struct clk_hw *fixed_hws[NUM_FIXED_CLKS];
+ struct clk_hw **hws;
};
-static const struct clk_id_map_entry *clk_id_map_find(const struct clk_id_map *map,
- u32 dt_id)
+static int clk_id_map_find(const struct clk_id_map *map, u32 dt_id)
{
for (unsigned int i = 0; i < map->size; i++) {
if (map->entries[i].dt_id == dt_id)
- return &map->entries[i];
+ return i;
}
- return NULL;
+ return -1;
}
static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec, void *data)
{
struct r8a78000_cpg_priv *priv = data;
- const struct clk_id_map_entry *entry;
struct device *dev = priv->dev;
struct clk_hw *hw;
+ int idx;
u32 id;
if (spec->args_count != 1)
@@ -83,13 +82,13 @@ static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec, void *data)
id = spec->args[0];
- entry = clk_id_map_find(priv->map, id);
- if (!entry) {
+ idx = clk_id_map_find(priv->map, id);
+ if (idx < 0) {
dev_err(dev, "Unknown clock %u\n", id);
return ERR_PTR(-ENOENT);
}
- hw = priv->fixed_hws[entry->fw_id];
+ hw = priv->hws[idx];
dev_dbg(dev, "Mapping DT clock %u to %s at %lu Hz\n", id,
clk_hw_get_name(hw), clk_hw_get_rate(hw));
@@ -97,27 +96,54 @@ static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec, void *data)
return hw;
}
-static int register_fixed_clks(struct r8a78000_cpg_priv *priv)
+static struct clk_hw **register_fixed_clks(struct device *dev)
{
- struct device *dev = priv->dev;
- unsigned long rate;
- struct clk_hw *hw;
- const char *name;
+ unsigned int n = ARRAY_SIZE(fixed_clk_rates);
+ struct clk_hw **hws __free(kfree) = kzalloc_objs(*hws, n);
+
+ if (!hws)
+ return ERR_PTR(-ENOMEM);
+
+ for (unsigned int i = 0; i < n; i++) {
+ unsigned long rate = fixed_clk_rates[i];
+ struct clk_hw *hw;
+ const char *name;
- for (unsigned int i = 0; i < ARRAY_SIZE(fixed_clk_rates); i++) {
- rate = fixed_clk_rates[i];
name = devm_kasprintf(dev, GFP_KERNEL, "cpg-%lu", rate);
if (!name)
- return -ENOMEM;
+ return ERR_PTR(-ENOMEM);
hw = devm_clk_hw_register_fixed_rate(dev, name, NULL, 0, rate);
if (IS_ERR(hw))
- return PTR_ERR(hw);
+ return ERR_CAST(hw);
+
+ hws[i] = hw;
+ }
+
+ return_ptr(hws);
+}
+
+static struct clk_hw **get_hws(struct r8a78000_cpg_priv *priv)
+{
+ const struct clk_id_map *map = priv->map;
+ struct device *dev = priv->dev;
+ struct clk_hw **hws;
+
+ struct clk_hw **fixed_hws __free(kfree) = register_fixed_clks(dev);
+ if (IS_ERR(fixed_hws))
+ return ERR_CAST(fixed_hws);
+
+ hws = devm_kzalloc_objs(dev, *hws, map->size);
+ if (!hws)
+ return ERR_PTR(-ENOMEM);
+
+ for (unsigned int i = 0; i < map->size; i++) {
+ u16 fw_id = map->entries[i].fw_id;
- priv->fixed_hws[i] = hw;
+ hws[i] = fixed_hws[fw_id];
}
- return 0;
+ return hws;
}
static int r8a78000_cpg_probe(struct platform_device *pdev)
@@ -125,7 +151,6 @@ static int r8a78000_cpg_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct r8a78000_cpg_priv *priv;
const struct clk_id_map *map;
- int ret;
map = of_device_get_match_data(dev);
if (!map)
@@ -138,9 +163,9 @@ static int r8a78000_cpg_probe(struct platform_device *pdev)
priv->dev = dev;
priv->map = map;
- ret = register_fixed_clks(priv);
- if (ret)
- return ret;
+ priv->hws = get_hws(priv);
+ if (IS_ERR(priv->hws))
+ return PTR_ERR(priv->hws);
return devm_of_clk_add_hw_provider(dev, r8a78000_clk_get, priv);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 05/14] clk: renesas: r8a78000: Add SCMI remapping support
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
` (2 preceding siblings ...)
2026-11-27 16:26 ` [PATCH v6 04/14] clk: renesas: r8a78000: Add clk_hw to clk_map Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 06/14] reset: Extract __reset_control_get_from_provider() Geert Uytterhoeven
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
Extend the Clock Pulse Generator driver for R-Car X5H with SCMI support,
to remap DT clock IDs to abstractions (clocks) offered by the SCMI
firmware when running on a system with SCMI, and SCMI support is
enabled. Take into account some peculiarities of the current SCMI
firmware implementations, and fall-back to fixed-rate clocks as
replacements for SCMI clocks that are not available.
Support for bus clocks used by serial, I2C, and SPI devices is included.
This lets us avoid putting SCMI IDs in DT, and allows us to use the same
hardware description in SoC DTS for systems with and without SCMI
firmware.
Note that fixed-rate clock IDs are now offset to maintain a clear
separation with the SCMI clock ID space, and that the default fallback
map is now populated using a macro, to prevent accidental inclusion of
SCMI firmware clock IDs.
For now, it is assumed SCMI clock IDs are stable, and match SCP FW
SDKv4.31.0 and later.
Suggested-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
v6:
- Add Reviewed-by,
- Move local variables to loop scope where possible,
- Add and use MAP_FIXED() macro to populate r8a78000_cpg_default[],
to prevent accidental inclusion of SCMI firmware clock IDs,
- Explain use of FIXED_CLK_OFFSET,
v5:
- Add Tested-by,
- Rebase,
- Shrink firmware clock IDs to 16 bits,
- Add parentheses to FIXED_CLK() macro definition,
- Extract get_fallback() and simplify fallback code,
- Rework mapping data structures,
- Add missing clk_put() after of_clk_get_from_provider() in get_hws(),
v4:
- Drop unneeded IS_ERR() check after __clk_get_hw(),
- Mark scmi_clk_np __free(device_node),
- Assume all SCMI clock IDs are stable, and drop support for handling
different ID spaces,
- Include initial mapping table for SCP FW SDKv4.31.0 and later,
- Try SCMI clocks first, and fall back to the default fixed-frequency
clocks when not available, as recent firmware versions no longer
restrict access to some bus clocks,
- Drop renesas,scmi-firmware support, just find an arm,scmi node
instead,
- Fall back to the non-SCMI defaults when SCMI clock support is
disabled,
v3:
- Rebase,
- Consistently use /* sentinel */ for zero sentinels,
- s/firmware/renesas,scmi-firmware/,
- Reword,
v2:
- Spin off from "clk: renesas: Add R-Car X5H CPG SCMI remapping
driver",
- Use reverse xmas ordering in r8a78000_cpg_probe(),
- Propagate error codes from scmi_get_base_info() now it can return
-EPROBE_DEFER,
- Improve error message on scmi_get_base_info() failure,
- Check if SCMI firmware node is available,
- Replace the scmi_clk_np member of struct r8a78000_cpg_priv by a
local variable in r8a78000_cpg_probe(), and pass it to
fill_clk_map(),
- Join split short lines,
- Fall back to the default support when SCMI support or firmware is
not available, or when the detected SCMI firmware version is not
supported by the driver,
- Drop mapping tables.
---
drivers/clk/renesas/r8a78000-cpg.c | 145 ++++++++++++++++++++++++++---
1 file changed, 133 insertions(+), 12 deletions(-)
diff --git a/drivers/clk/renesas/r8a78000-cpg.c b/drivers/clk/renesas/r8a78000-cpg.c
index b68fd7cd89c994df..314a765fcd6caf4b 100644
--- a/drivers/clk/renesas/r8a78000-cpg.c
+++ b/drivers/clk/renesas/r8a78000-cpg.c
@@ -13,13 +13,14 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
+#include <linux/scmi_protocol.h>
#include <linux/slab.h>
#include <dt-bindings/clock/renesas,r8a78000-cpg.h>
struct clk_id_map_entry {
u16 dt_id; /* DT binding clock ID */
- u16 fw_id; /* FIXED_CLK() ID */
+ u16 fw_id; /* SCMI firmware clock ID or FIXED_CLK() ID */
};
struct clk_id_map {
@@ -32,6 +33,11 @@ struct clk_id_map {
.size = ARRAY_SIZE(_entries), \
}
+struct cpg_data {
+ const struct clk_id_map *default_map;
+ const struct clk_id_map *fw_map;
+};
+
enum fixed_clk {
FIXED_CLK_66M,
FIXED_CLK_133M,
@@ -44,13 +50,14 @@ static const unsigned long fixed_clk_rates[] = {
[FIXED_CLK_266M] = 266660000,
};
-#define FIXED_CLK(rate) FIXED_CLK_ ## rate
+#define FIXED_CLK_OFFSET 0x8000
+#define FIXED_CLK(rate) (FIXED_CLK_OFFSET + FIXED_CLK_ ## rate)
/**
* struct r8a78000_cpg_priv - Clock Pulse Generator Private Data
*
* @dev: CPG device
- * @map: Mapping from DT clock IDs to fixed-rate clock IDs
+ * @map: Mapping from DT clock IDs to SCMI or fixed-rate clock IDs
* @hws: Clocks, indexed by @map entry index
*/
struct r8a78000_cpg_priv {
@@ -89,6 +96,11 @@ static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec, void *data)
}
hw = priv->hws[idx];
+ if (!hw) {
+ /* CLOCK_ATTRIBUTES is not supported */
+ dev_err(dev, "Clock %u is not available\n", id);
+ return ERR_PTR(-ENOENT);
+ }
dev_dbg(dev, "Mapping DT clock %u to %s at %lu Hz\n", id,
clk_hw_get_name(hw), clk_hw_get_rate(hw));
@@ -96,6 +108,21 @@ static struct clk_hw *r8a78000_clk_get(struct of_phandle_args *spec, void *data)
return hw;
}
+static struct device_node *scmi_find_proto(struct device_node *scmi, u32 proto)
+{
+ for_each_available_child_of_node_scoped(scmi, child) {
+ u32 reg;
+
+ if (of_property_read_u32(child, "reg", ®))
+ continue;
+
+ if (reg == proto)
+ return_ptr(child);
+ }
+
+ return NULL;
+}
+
static struct clk_hw **register_fixed_clks(struct device *dev)
{
unsigned int n = ARRAY_SIZE(fixed_clk_rates);
@@ -123,7 +150,20 @@ static struct clk_hw **register_fixed_clks(struct device *dev)
return_ptr(hws);
}
-static struct clk_hw **get_hws(struct r8a78000_cpg_priv *priv)
+static struct clk_hw *get_fallback(const struct clk_id_map *map, u16 dt_id,
+ struct clk_hw **fixed_hws)
+{
+ for (unsigned int i = 0; i < map->size; i++) {
+ if (map->entries[i].dt_id == dt_id)
+ return fixed_hws[map->entries[i].fw_id - FIXED_CLK_OFFSET];
+ }
+
+ return NULL;
+}
+
+static struct clk_hw **get_hws(struct r8a78000_cpg_priv *priv,
+ const struct clk_id_map *fallback,
+ struct device_node *scmi_clk_np)
{
const struct clk_id_map *map = priv->map;
struct device *dev = priv->dev;
@@ -139,8 +179,39 @@ static struct clk_hw **get_hws(struct r8a78000_cpg_priv *priv)
for (unsigned int i = 0; i < map->size; i++) {
u16 fw_id = map->entries[i].fw_id;
+ struct of_phandle_args scmi_spec;
+ struct clk_hw *hw;
+ struct clk *clk;
+
+ if (fw_id >= FIXED_CLK_OFFSET) {
+ hws[i] = fixed_hws[fw_id - FIXED_CLK_OFFSET];
+ continue;
+ }
+
+ scmi_spec.np = scmi_clk_np;
+ scmi_spec.args_count = 1;
+ scmi_spec.args[0] = fw_id;
+
+ clk = of_clk_get_from_provider(&scmi_spec);
+ if (IS_ERR(clk))
+ return dev_err_cast_probe(dev, clk,
+ "Failed to get SCMI clock %u\n", fw_id);
+
+ hw = __clk_get_hw(clk);
+ clk_put(clk);
+ if (!hw)
+ hw = get_fallback(fallback, map->entries[i].dt_id,
+ fixed_hws);
+ if (!hw) {
+ /* CLOCK_ATTRIBUTES is not supported */
+ dev_warn(dev, "SCMI clock %u is NULL\n", fw_id);
+ continue;
+ }
+
+ dev_dbg(priv->dev, "SCMI clock %u is %s at %lu Hz\n", fw_id,
+ clk_hw_get_name(hw), clk_hw_get_rate(hw));
- hws[i] = fixed_hws[fw_id];
+ hws[i] = hw;
}
return hws;
@@ -148,22 +219,57 @@ static struct clk_hw **get_hws(struct r8a78000_cpg_priv *priv)
static int r8a78000_cpg_probe(struct platform_device *pdev)
{
+ struct device_node *scmi_clk_np __free(device_node) = NULL;
+ struct device_node *scmi __free(device_node) = NULL;
struct device *dev = &pdev->dev;
+ const struct cpg_data *cpg_data;
struct r8a78000_cpg_priv *priv;
const struct clk_id_map *map;
- map = of_device_get_match_data(dev);
- if (!map)
+ cpg_data = of_device_get_match_data(dev);
+ if (!cpg_data)
return -ENODEV;
+ map = cpg_data->default_map;
+
priv = devm_kzalloc_obj(dev, *priv);
if (!priv)
return -ENOMEM;
priv->dev = dev;
+
+ if (!IS_ENABLED(CONFIG_COMMON_CLK_SCMI)) {
+ dev_dbg(dev, "SCMI clock support is disabled\n");
+ goto fallback;
+ }
+
+ scmi = of_find_compatible_node(NULL, NULL, "arm,scmi");
+ if (!scmi) {
+ dev_dbg(dev, "Cannot find SCMI firmware node\n");
+ goto fallback;
+ }
+
+ if (!of_device_is_available(scmi)) {
+ dev_dbg(dev, "SCMI firmware node is not available\n");
+ goto fallback;
+ }
+
+ scmi_clk_np = scmi_find_proto(scmi, SCMI_PROTOCOL_CLOCK);
+ if (!scmi_clk_np) {
+ dev_dbg(dev, "Cannot find SCMI clock management protocol\n");
+ goto fallback;
+ }
+
+ map = cpg_data->fw_map;
+
+fallback:
priv->map = map;
- priv->hws = get_hws(priv);
+ /*
+ * We cannot do lazy look-up in r8a78000_clk_get(), as that function is
+ * called with of_clk_mutex already held.
+ */
+ priv->hws = get_hws(priv, cpg_data->default_map, scmi_clk_np);
if (IS_ERR(priv->hws))
return PTR_ERR(priv->hws);
@@ -171,15 +277,30 @@ static int r8a78000_cpg_probe(struct platform_device *pdev)
}
static const struct clk_id_map_entry r8a78000_cpg_default[] = {
- { R8A78000_CPG_SGASYNCD4_PERW_BUS, FIXED_CLK(266M) },
- { R8A78000_CPG_SGASYNCD8_PERW_BUS, FIXED_CLK(133M) },
- { R8A78000_CPG_SGASYNCD16_PERW_BUS, FIXED_CLK(66M) },
+#define MAP_FIXED(id, rate) { id, FIXED_CLK(rate) }
+ MAP_FIXED(R8A78000_CPG_SGASYNCD4_PERW_BUS, 266M),
+ MAP_FIXED(R8A78000_CPG_SGASYNCD8_PERW_BUS, 133M),
+ MAP_FIXED(R8A78000_CPG_SGASYNCD16_PERW_BUS, 66M),
+#undef MAP_FIXED
+};
+
+static const struct clk_id_map_entry r8a78000_cpg_fw[] = {
+ { R8A78000_CPG_SGASYNCD4_PERW_BUS, 1661 },
+ { R8A78000_CPG_SGASYNCD8_PERW_BUS, 1662 },
+ { R8A78000_CPG_SGASYNCD16_PERW_BUS, 1663 },
+ { R8A78000_CPG_MSO_SCP_MAIN, 1459 },
+ { R8A78000_CPG_MSOCK_PERW_BUS, 1667 },
+};
+
+static const struct cpg_data r8a78000_cpg_data = {
+ .default_map = CLK_ID_MAP(r8a78000_cpg_default),
+ .fw_map = CLK_ID_MAP(r8a78000_cpg_fw),
};
static const struct of_device_id r8a78000_cpg_match[] = {
{
.compatible = "renesas,r8a78000-cpg",
- .data = CLK_ID_MAP(r8a78000_cpg_default),
+ .data = &r8a78000_cpg_data,
},
{ /* sentinel */ }
};
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 06/14] reset: Extract __reset_control_get_from_provider()
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
` (3 preceding siblings ...)
2026-11-27 16:26 ` [PATCH v6 05/14] clk: renesas: r8a78000: Add SCMI remapping support Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 07/14] reset: Add reset_control_get_from_provider_exclusive() Geert Uytterhoeven
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
Extract the code to create a reset_control structure from a given
provider into its own function, so it can be reused later.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v6:
- Rebase,
v5:
- Add Tested-by,
v4:
- Keep RESET_CONTROL_FLAGS_BIT_OPTIONAL clearing in
__fwnode_reset_control_get(),
- Return directly instead of assigning to a local variable, letting us
drop the latter and simplify scoped_guard() to plain guard(),
- Add Reviewed-by,
v3:
- New.
---
drivers/reset/core.c | 85 +++++++++++++++++++++++---------------------
1 file changed, 45 insertions(+), 40 deletions(-)
diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index 0bff49d9b5586403..7679480644e7ecda 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -1227,6 +1227,49 @@ __reset_find_rcdev(const struct fwnode_reference_args *args, bool gpio_fallback)
return NULL;
}
+static struct reset_control *
+__reset_control_get_from_provider(const struct fwnode_reference_args *args,
+ struct fwnode_handle *consumer, int index,
+ bool gpio_fallback,
+ enum reset_control_flags flags)
+{
+ struct reset_controller_dev *rcdev;
+ int rstc_id = -EINVAL;
+
+ guard(mutex)(&reset_list_mutex);
+
+ rcdev = __reset_find_rcdev(args, gpio_fallback);
+ if (!rcdev)
+ return ERR_PTR(-EPROBE_DEFER);
+
+ if (WARN_ON(args->nargs != rcdev->fwnode_reset_n_cells))
+ return ERR_PTR(-EINVAL);
+
+ if (rcdev->of_xlate && is_of_node(consumer)) {
+ struct device_node *np = to_of_node(consumer);
+ struct of_phandle_args of_args;
+ int ret;
+
+ ret = of_parse_phandle_with_args(np,
+ gpio_fallback ? "reset-gpios" : "resets",
+ gpio_fallback ? "#gpio-cells" : "#reset-cells",
+ gpio_fallback ? 0 : index,
+ &of_args);
+ if (ret)
+ return ERR_PTR(ret);
+
+ rstc_id = rcdev->of_xlate(rcdev, &of_args);
+ of_node_put(of_args.np);
+ } else if (rcdev->fwnode_xlate) {
+ rstc_id = rcdev->fwnode_xlate(rcdev, args);
+ }
+ if (rstc_id < 0)
+ return ERR_PTR(rstc_id);
+
+ guard(mutex)(&rcdev->lock);
+ return __reset_control_get_internal(rcdev, rstc_id, flags);
+}
+
struct reset_control *
__fwnode_reset_control_get(struct fwnode_handle *fwnode, const char *id, int index,
enum reset_control_flags flags)
@@ -1234,10 +1277,7 @@ __fwnode_reset_control_get(struct fwnode_handle *fwnode, const char *id, int ind
bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL;
bool gpio_fallback = false;
struct reset_control *rstc = ERR_PTR(-EINVAL);
- struct reset_controller_dev *rcdev;
struct fwnode_reference_args args;
- struct of_phandle_args of_args;
- int rstc_id = -EINVAL;
int ret;
if (!fwnode)
@@ -1279,46 +1319,11 @@ __fwnode_reset_control_get(struct fwnode_handle *fwnode, const char *id, int ind
}
}
- guard(mutex)(&reset_list_mutex);
-
- rcdev = __reset_find_rcdev(&args, gpio_fallback);
- if (!rcdev) {
- rstc = ERR_PTR(-EPROBE_DEFER);
- goto out_put;
- }
-
- if (WARN_ON(args.nargs != rcdev->fwnode_reset_n_cells)) {
- rstc = ERR_PTR(-EINVAL);
- goto out_put;
- }
-
- if (rcdev->of_xlate && is_of_node(fwnode)) {
- ret = of_parse_phandle_with_args(to_of_node(fwnode),
- gpio_fallback ? "reset-gpios" : "resets",
- gpio_fallback ? "#gpio-cells" : "#reset-cells",
- gpio_fallback ? 0 : index,
- &of_args);
- if (ret) {
- rstc = ERR_PTR(ret);
- goto out_put;
- }
-
- rstc_id = rcdev->of_xlate(rcdev, &of_args);
- of_node_put(of_args.np);
- } else if (rcdev->fwnode_xlate) {
- rstc_id = rcdev->fwnode_xlate(rcdev, &args);
- }
- if (rstc_id < 0) {
- rstc = ERR_PTR(rstc_id);
- goto out_put;
- }
-
flags &= ~RESET_CONTROL_FLAGS_BIT_OPTIONAL;
- scoped_guard(mutex, &rcdev->lock)
- rstc = __reset_control_get_internal(rcdev, rstc_id, flags);
+ rstc = __reset_control_get_from_provider(&args, fwnode, index,
+ gpio_fallback, flags);
-out_put:
fwnode_handle_put(args.fwnode);
return rstc;
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 07/14] reset: Add reset_control_get_from_provider_exclusive()
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
` (4 preceding siblings ...)
2026-11-27 16:26 ` [PATCH v6 06/14] reset: Extract __reset_control_get_from_provider() Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 08/14] pmdomain: Make genpd_get_from_provider() return -EPROBE_DEFER Geert Uytterhoeven
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
When stacking two reset controllers, the upper one should go through the
proper channels: request exclusive reset controls and use them via the
reset_control_*() APIs. However, unlike the clock subsystem, which has
of_clk_get_from_provider(), the reset subsystem does not offer a way to
lookup and obtain a reset from a reset provider.
Hence add a public helper reset_control_get_from_provider_exclusive()
to lookup and obtain an exclusive reference to a reset controller, based
on the recently introduced __reset_control_get_from_provider() helper.
This will be used by the R-Car X5H Module Controller driver.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
---
v6:
- Rebase,
v5:
- Add Tested-by, Reviewed-by,
- Move of_node_get() after for-loop that may fail to fix device node
reference leak on failure,
v4:
- Check for overflow when converting (u64) fwnode args to (uint32_t)
OF args,
- Document that reset_control_get_from_provider_exclusive() must not
be given a reference to a GPIO provider,
- Let the dummy return ERR_PTR(-ENOTSUPP) instead of NULL,
v3:
- Replace reset_controller_get_provider() by
reset_control_get_from_provider_exclusive(),
- Add kerneldoc,
v2:
- No changes.
---
drivers/reset/core.c | 40 +++++++++++++++++++++++++++++++++++-----
include/linux/reset.h | 8 ++++++++
2 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index 7679480644e7ecda..649c1dab543805d6 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -1233,6 +1233,7 @@ __reset_control_get_from_provider(const struct fwnode_reference_args *args,
bool gpio_fallback,
enum reset_control_flags flags)
{
+ struct fwnode_handle *fwnode = consumer ?: args->fwnode;
struct reset_controller_dev *rcdev;
int rstc_id = -EINVAL;
@@ -1245,18 +1246,29 @@ __reset_control_get_from_provider(const struct fwnode_reference_args *args,
if (WARN_ON(args->nargs != rcdev->fwnode_reset_n_cells))
return ERR_PTR(-EINVAL);
- if (rcdev->of_xlate && is_of_node(consumer)) {
- struct device_node *np = to_of_node(consumer);
+ if (rcdev->of_xlate && is_of_node(fwnode)) {
+ struct device_node *np = to_of_node(fwnode);
struct of_phandle_args of_args;
int ret;
- ret = of_parse_phandle_with_args(np,
+ if (consumer) {
+ ret = of_parse_phandle_with_args(np,
gpio_fallback ? "reset-gpios" : "resets",
gpio_fallback ? "#gpio-cells" : "#reset-cells",
gpio_fallback ? 0 : index,
&of_args);
- if (ret)
- return ERR_PTR(ret);
+ if (ret)
+ return ERR_PTR(ret);
+ } else {
+ for (unsigned int i = 0; i < args->nargs; i++) {
+ if (args->args[i] > U32_MAX)
+ return ERR_PTR(-EINVAL);
+
+ of_args.args[i] = args->args[i];
+ }
+ of_args.np = of_node_get(np);
+ of_args.args_count = args->nargs;
+ }
rstc_id = rcdev->of_xlate(rcdev, &of_args);
of_node_put(of_args.np);
@@ -1348,6 +1360,24 @@ struct reset_control *__reset_control_get(struct device *dev, const char *id,
}
EXPORT_SYMBOL_GPL(__reset_control_get);
+/**
+ * reset_control_get_from_provider_exclusive - Lookup and obtain an exclusive
+ * reference to a reset controller.
+ * @args: Reference to the reset controller provider with all the args like
+ * reset number. This must not be a reference to a GPIO provider.
+ *
+ * Returns a struct reset_control or IS_ERR() condition containing errno.
+ * If this function is called more than once for the same reset control it will
+ * return -EBUSY.
+ */
+struct reset_control *
+reset_control_get_from_provider_exclusive(const struct fwnode_reference_args *args)
+{
+ return __reset_control_get_from_provider(args, NULL, 0, false,
+ RESET_CONTROL_EXCLUSIVE);
+}
+EXPORT_SYMBOL_GPL(reset_control_get_from_provider_exclusive);
+
int __reset_control_bulk_get(struct device *dev, int num_rstcs,
struct reset_control_bulk_data *rstcs,
enum reset_control_flags flags)
diff --git a/include/linux/reset.h b/include/linux/reset.h
index 9c391cf0c82298a0..384273ec0c7cbef7 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -90,6 +90,8 @@ struct reset_control *__fwnode_reset_control_get(struct fwnode_handle *fwnode,
const char *id, int index, enum reset_control_flags flags);
struct reset_control *__reset_control_get(struct device *dev, const char *id,
int index, enum reset_control_flags flags);
+struct reset_control *reset_control_get_from_provider_exclusive(
+ const struct fwnode_reference_args *args);
void reset_control_put(struct reset_control *rstc);
int __reset_control_bulk_get(struct device *dev, int num_rstcs,
struct reset_control_bulk_data *rstcs,
@@ -173,6 +175,12 @@ static inline struct reset_control *__reset_control_get(
return optional ? NULL : ERR_PTR(-ENOTSUPP);
}
+static inline struct reset_control *reset_control_get_from_provider_exclusive(
+ const struct fwnode_reference_args *args)
+{
+ return ERR_PTR(-ENOTSUPP);
+}
+
static inline int
reset_control_bulk_reset(int num_rstcs, struct reset_control_bulk_data *rstcs)
{
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 08/14] pmdomain: Make genpd_get_from_provider() return -EPROBE_DEFER
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
` (5 preceding siblings ...)
2026-11-27 16:26 ` [PATCH v6 07/14] reset: Add reset_control_get_from_provider_exclusive() Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 09/14] pmdomain: Make genpd_get_from_provider() public Geert Uytterhoeven
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
Unlike provider-based look-up functions in other subsystems[1],
genpd_get_from_provider() returns -ENOENT instead of -EPROBE_DEFER when
the provider is not found, thus not supporting probe deferral.
Currently this is worked around in of_genpd_add_subdomain() by remapping
-ENOENT[2].
Fix this for all current and future callers by returning -EPROBE_DEFER
instead, and drop the no longer needed remapping code.
Note that other callsites either don't care about the actual error code,
or propagate it up. The latter (e.g. of_genpd_add_child_ids()) thus may
start returning -EPROBE_DEFER, which should be fine.
[1] of_clk_get_hw_from_clkspec(), __fwnode_reset_control_get()),
[2] Commit 18027d6f392ee8d8 ("PM: domains: Make of_genpd_add_subdomain()
return -EPROBE_DEFER").
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v6:
- Add more clarification about other callsites,
v5:
- Add Tested-by,
- Clarify that all other callsites should be fine.
v4:
- New.
---
drivers/pmdomain/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index 4e0a76f1f08fc64f..633a6e642b1ba50d 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -3037,7 +3037,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider);
static struct generic_pm_domain *genpd_get_from_provider(
const struct of_phandle_args *genpdspec)
{
- struct generic_pm_domain *genpd = ERR_PTR(-ENOENT);
+ struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER);
struct of_genpd_provider *provider;
if (!genpdspec)
@@ -3292,7 +3292,7 @@ int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec,
out:
mutex_unlock(&gpd_list_lock);
- return ret == -ENOENT ? -EPROBE_DEFER : ret;
+ return ret;
}
EXPORT_SYMBOL_GPL(of_genpd_add_subdomain);
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 09/14] pmdomain: Make genpd_get_from_provider() public
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
` (6 preceding siblings ...)
2026-11-27 16:26 ` [PATCH v6 08/14] pmdomain: Make genpd_get_from_provider() return -EPROBE_DEFER Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 10/14] pmdomain: renesas: r8a78000: Drop MDLC name comment Geert Uytterhoeven
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
Unlike the corresponding function in the clock subsystem[1],
genpd_get_from_provider() is private, and thus cannot be used by PM
Domain drivers.
Make it public, so the R-Car X5H Module Controller driver can call it.
Add an "of_"-prefix for consistency with public genpd function naming.
[1] of_clk_get_from_provider().
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v6:
- No changes,
v5:
- Add Tested-by,
v4:
- Improve patch description,
v3:
- Add "of_" prefix,
v2:
- No changes.
---
drivers/pmdomain/core.c | 22 +++++++++++-----------
include/linux/pm_domain.h | 7 +++++++
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index 633a6e642b1ba50d..467d6e6e34dc21f8 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -3024,7 +3024,7 @@ void of_genpd_del_provider(struct device_node *np)
EXPORT_SYMBOL_GPL(of_genpd_del_provider);
/**
- * genpd_get_from_provider() - Look-up PM domain
+ * of_genpd_get_from_provider() - Look-up PM domain
* @genpdspec: OF phandle args to use for look-up
*
* Looks for a PM domain provider under the node specified by @genpdspec and if
@@ -3034,8 +3034,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider);
* Returns a valid pointer to struct generic_pm_domain on success or ERR_PTR()
* on failure.
*/
-static struct generic_pm_domain *genpd_get_from_provider(
- const struct of_phandle_args *genpdspec)
+struct generic_pm_domain *of_genpd_get_from_provider(const struct of_phandle_args *genpdspec)
{
struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER);
struct of_genpd_provider *provider;
@@ -3057,6 +3056,7 @@ static struct generic_pm_domain *genpd_get_from_provider(
return genpd;
}
+EXPORT_SYMBOL_GPL(of_genpd_get_from_provider);
/**
* of_genpd_add_child_ids() - Parse power-domains-child-ids property
@@ -3129,7 +3129,7 @@ int of_genpd_add_child_ids(struct device_node *np,
goto err_unwind;
/* Get the parent domain */
- parent_genpd = genpd_get_from_provider(&parent_args);
+ parent_genpd = of_genpd_get_from_provider(&parent_args);
of_node_put(parent_args.np);
if (IS_ERR(parent_genpd)) {
pr_err("Failed to get parent domain for %pOF: %ld\n",
@@ -3212,7 +3212,7 @@ int of_genpd_remove_child_ids(struct device_node *np,
if (ret)
continue;
- parent_genpd = genpd_get_from_provider(&parent_args);
+ parent_genpd = of_genpd_get_from_provider(&parent_args);
of_node_put(parent_args.np);
if (IS_ERR(parent_genpd))
continue;
@@ -3243,7 +3243,7 @@ int of_genpd_add_device(const struct of_phandle_args *genpdspec, struct device *
mutex_lock(&gpd_list_lock);
- genpd = genpd_get_from_provider(genpdspec);
+ genpd = of_genpd_get_from_provider(genpdspec);
if (IS_ERR(genpd)) {
ret = PTR_ERR(genpd);
goto out;
@@ -3275,13 +3275,13 @@ int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec,
mutex_lock(&gpd_list_lock);
- parent = genpd_get_from_provider(parent_spec);
+ parent = of_genpd_get_from_provider(parent_spec);
if (IS_ERR(parent)) {
ret = PTR_ERR(parent);
goto out;
}
- subdomain = genpd_get_from_provider(subdomain_spec);
+ subdomain = of_genpd_get_from_provider(subdomain_spec);
if (IS_ERR(subdomain)) {
ret = PTR_ERR(subdomain);
goto out;
@@ -3313,13 +3313,13 @@ int of_genpd_remove_subdomain(const struct of_phandle_args *parent_spec,
mutex_lock(&gpd_list_lock);
- parent = genpd_get_from_provider(parent_spec);
+ parent = of_genpd_get_from_provider(parent_spec);
if (IS_ERR(parent)) {
ret = PTR_ERR(parent);
goto out;
}
- subdomain = genpd_get_from_provider(subdomain_spec);
+ subdomain = of_genpd_get_from_provider(subdomain_spec);
if (IS_ERR(subdomain)) {
ret = PTR_ERR(subdomain);
goto out;
@@ -3507,7 +3507,7 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device *base_dev,
return ret;
mutex_lock(&gpd_list_lock);
- pd = genpd_get_from_provider(&pd_args);
+ pd = of_genpd_get_from_provider(&pd_args);
of_node_put(pd_args.np);
if (IS_ERR(pd)) {
mutex_unlock(&gpd_list_lock);
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index a382b88a023221cf..0f2a9bf48c3e388d 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -466,6 +466,7 @@ int of_genpd_add_provider_simple(struct device_node *np,
int of_genpd_add_provider_onecell(struct device_node *np,
struct genpd_onecell_data *data);
void of_genpd_del_provider(struct device_node *np);
+struct generic_pm_domain *of_genpd_get_from_provider(const struct of_phandle_args *genpdspec);
int of_genpd_add_device(const struct of_phandle_args *args, struct device *dev);
int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec,
const struct of_phandle_args *subdomain_spec);
@@ -500,6 +501,12 @@ static inline int of_genpd_add_provider_onecell(struct device_node *np,
static inline void of_genpd_del_provider(struct device_node *np) {}
+static inline struct generic_pm_domain *of_genpd_get_from_provider(
+ const struct of_phandle_args *genpdspec)
+{
+ return ERR_PTR(-ENODEV);
+}
+
static inline int of_genpd_add_device(const struct of_phandle_args *args,
struct device *dev)
{
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 10/14] pmdomain: renesas: r8a78000: Drop MDLC name comment
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
` (7 preceding siblings ...)
2026-11-27 16:26 ` [PATCH v6 09/14] pmdomain: Make genpd_get_from_provider() public Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 11/14] pmdomain: renesas: r8a78000: Replace sentinel by explicit ID map size Geert Uytterhoeven
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
There is no need to document Module Controller base addresses in
mdlc_info tables, as a mod_map initializer already contains the Module
Controller's name.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
v6:
- Add Reviewed-by,
v5:
- New.
---
drivers/pmdomain/renesas/r8a78000-mdlc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pmdomain/renesas/r8a78000-mdlc.c b/drivers/pmdomain/renesas/r8a78000-mdlc.c
index 75de869872de9e82..1ace1fb10870f646 100644
--- a/drivers/pmdomain/renesas/r8a78000-mdlc.c
+++ b/drivers/pmdomain/renesas/r8a78000-mdlc.c
@@ -299,7 +299,7 @@ static const struct mod_map r8a78000_mdlc_perw_mod_default[] = {
static const struct mdlc_info r8a78000_mdlc_default[] = {
{
- .base = 0xc05d0000 /* mdlc_perw */,
+ .base = 0xc05d0000,
.mod_map = r8a78000_mdlc_perw_mod_default,
},
{ /* sentinel */ }
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 11/14] pmdomain: renesas: r8a78000: Replace sentinel by explicit ID map size
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
` (8 preceding siblings ...)
2026-11-27 16:26 ` [PATCH v6 10/14] pmdomain: renesas: r8a78000: Drop MDLC name comment Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 12/14] pmdomain: renesas: r8a78000: Shrink IDs to 16 bits Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 14/14] arm64: dts: renesas: ironhide: Enable SCMI devpd, sys, clock, and reset Geert Uytterhoeven
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
The use of a sentinel in the module ID mapping array will become
cumbersome when the need arises to find out the actual number of
elements in the array. Rework the mapping data structure to fix this,
also improving naming. Let mod_id_map_find() return an index, to be
used for indexing additional mapping target arrays later.
Add a MOD_ID_MAP() initialization macro for brevity.
While at it, drop the check for "!map" in mod_id_map_find(), as that
pointer can never be NULL.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
v6:
- Add Reviewed-by,
v5:
- New.
---
drivers/pmdomain/renesas/r8a78000-mdlc.c | 49 +++++++++++++-----------
1 file changed, 27 insertions(+), 22 deletions(-)
diff --git a/drivers/pmdomain/renesas/r8a78000-mdlc.c b/drivers/pmdomain/renesas/r8a78000-mdlc.c
index 1ace1fb10870f646..6477abe64511e880 100644
--- a/drivers/pmdomain/renesas/r8a78000-mdlc.c
+++ b/drivers/pmdomain/renesas/r8a78000-mdlc.c
@@ -16,13 +16,23 @@
#include <dt-bindings/power/renesas,r8a78000-mdlc.h>
-struct mod_map {
- int hw_id; /* Hardware module ID or -1 sentinel */
+struct mod_id_map_entry {
+ u32 hw_id; /* Hardware module ID */
};
+struct mod_id_map {
+ const struct mod_id_map_entry *entries;
+ unsigned int size;
+};
+
+#define MOD_ID_MAP(_entries) .mod_map = &(struct mod_id_map) { \
+ .entries = _entries, \
+ .size = ARRAY_SIZE(_entries), \
+}
+
struct mdlc_info {
u32 base;
- const struct mod_map *mod_map;
+ const struct mod_id_map *mod_map;
};
/**
@@ -41,7 +51,7 @@ struct r8a78000_mdlc_priv {
struct reset_controller_dev rcdev;
struct device *dev;
struct device_node *np;
- const struct mod_map *mod_map;
+ const struct mod_id_map *mod_map;
};
static struct generic_pm_domain *r8a78000_genpd_always_on;
@@ -77,17 +87,14 @@ static struct generic_pm_domain *r8a78000_genpd_xlate(
#define rcdev_to_priv(_rcdev) \
container_of(_rcdev, struct r8a78000_mdlc_priv, rcdev)
-static const struct mod_map *mod_map_find(const struct mod_map *map, u32 id)
+static int mod_id_map_find(const struct mod_id_map *map, u32 hw_id)
{
- if (!map)
- return NULL;
-
- for (; map->hw_id >= 0; map++) {
- if (map->hw_id == id)
- return map;
+ for (unsigned int i = 0; i < map->size; i++) {
+ if (map->entries[i].hw_id == hw_id)
+ return i;
}
- return NULL;
+ return -1;
}
static int r8a78000_mdlc_reset_xlate(struct reset_controller_dev *rcdev,
@@ -95,7 +102,7 @@ static int r8a78000_mdlc_reset_xlate(struct reset_controller_dev *rcdev,
{
struct r8a78000_mdlc_priv *priv = rcdev_to_priv(rcdev);
struct device *dev = priv->dev;
- const struct mod_map *map;
+ int idx;
u32 id;
if (spec->args_count != 1)
@@ -103,8 +110,8 @@ static int r8a78000_mdlc_reset_xlate(struct reset_controller_dev *rcdev,
id = spec->args[0];
- map = mod_map_find(priv->mod_map, id);
- if (!map) {
+ idx = mod_id_map_find(priv->mod_map, id);
+ if (idx < 0) {
dev_err(dev, "Unknown reset 0x%x\n", id);
return -ENOENT;
}
@@ -141,9 +148,8 @@ static int r8a78000_mdlc_attach_dev(struct generic_pm_domain *domain,
struct device_node *np = dev->of_node;
struct r8a78000_mdlc_priv *priv;
struct of_phandle_args pd_spec;
- const struct mod_map *map;
unsigned int id;
- int ret;
+ int ret, idx;
ret = of_parse_phandle_with_args(np, "power-domains",
"#power-domain-cells", 0, &pd_spec);
@@ -166,8 +172,8 @@ static int r8a78000_mdlc_attach_dev(struct generic_pm_domain *domain,
id = pd_spec.args[1];
of_node_put(pd_spec.np);
- map = mod_map_find(priv->mod_map, id);
- if (!map) {
+ idx = mod_id_map_find(priv->mod_map, id);
+ if (idx < 0) {
dev_err(dev, "Unknown module 0x%x\n", id);
return -ENOENT;
}
@@ -292,15 +298,14 @@ static int r8a78000_mdlc_probe(struct platform_device *pdev)
return 0;
}
-static const struct mod_map r8a78000_mdlc_perw_mod_default[] = {
+static const struct mod_id_map_entry r8a78000_mdlc_perw_mod_default[] = {
{ 0x54 }, /* HSCIF0 */
- { -1 }
};
static const struct mdlc_info r8a78000_mdlc_default[] = {
{
.base = 0xc05d0000,
- .mod_map = r8a78000_mdlc_perw_mod_default,
+ MOD_ID_MAP(r8a78000_mdlc_perw_mod_default),
},
{ /* sentinel */ }
};
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 12/14] pmdomain: renesas: r8a78000: Shrink IDs to 16 bits
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
` (9 preceding siblings ...)
2026-11-27 16:26 ` [PATCH v6 11/14] pmdomain: renesas: r8a78000: Replace sentinel by explicit ID map size Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
2026-11-27 16:26 ` [PATCH v6 14/14] arm64: dts: renesas: ironhide: Enable SCMI devpd, sys, clock, and reset Geert Uytterhoeven
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
Reduce table size by shrinking hardware module IDs from 32 to 16 bits,
which is still plenty.
While at it, use u32 to store of_phandle_args.args[1] in
r8a78000_mdlc_attach_dev().
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
v6:
- Add Reviewed-by,
v5:
- New.
---
drivers/pmdomain/renesas/r8a78000-mdlc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pmdomain/renesas/r8a78000-mdlc.c b/drivers/pmdomain/renesas/r8a78000-mdlc.c
index 6477abe64511e880..733bf68dab2ce6dc 100644
--- a/drivers/pmdomain/renesas/r8a78000-mdlc.c
+++ b/drivers/pmdomain/renesas/r8a78000-mdlc.c
@@ -17,7 +17,7 @@
#include <dt-bindings/power/renesas,r8a78000-mdlc.h>
struct mod_id_map_entry {
- u32 hw_id; /* Hardware module ID */
+ u16 hw_id; /* Hardware module ID */
};
struct mod_id_map {
@@ -148,8 +148,8 @@ static int r8a78000_mdlc_attach_dev(struct generic_pm_domain *domain,
struct device_node *np = dev->of_node;
struct r8a78000_mdlc_priv *priv;
struct of_phandle_args pd_spec;
- unsigned int id;
int ret, idx;
+ u32 id;
ret = of_parse_phandle_with_args(np, "power-domains",
"#power-domain-cells", 0, &pd_spec);
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v6 14/14] arm64: dts: renesas: ironhide: Enable SCMI devpd, sys, clock, and reset
2026-11-27 16:26 [PATCH v6 00/14] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
` (10 preceding siblings ...)
2026-11-27 16:26 ` [PATCH v6 12/14] pmdomain: renesas: r8a78000: Shrink IDs to 16 bits Geert Uytterhoeven
@ 2026-11-27 16:26 ` Geert Uytterhoeven
11 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-11-27 16:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
Brian Masney, Jerome Brunet, Ulf Hansson, Philipp Zabel,
Rafael J . Wysocki, Marek Vasut, Bartosz Golaszewski,
Konrad Dybcio, Kevin Hilman, Vinod Koul, Wolfram Sang,
Kuninori Morimoto, Laurent Pinchart, Paul Elder,
Clément Le Goffic, Sudeep Holla, Cristian Marussi
Cc: devicetree, linux-clk, linux-pm, linux-renesas-soc, arm-scmi,
linux-arm-kernel, Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@glider.be>
SCP FW SDKv4.28.0 and later for Renesas R-Car X5H Ironhide not only
implement the SCMI base protocol, but also the SCMI power domain, system
power, clock, and reset domain management protocols.
Enable support for the latter by adding the corresponding SCMI protocol
subnodes.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v6:
- No changes,
v5:
- Add Tested-by,
v4:
- No changes,
v3:
- No changes,
v2:
- Fix misindentations,
- Add scmi_clk node, as it is no longer added in earlier commits.
---
.../boot/dts/renesas/r8a78000-ironhide.dts | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts b/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
index b2d6b06c63881896..ade8bcd3a0e5ee8b 100644
--- a/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
+++ b/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
@@ -31,6 +31,25 @@ scmi: scmi {
arm,no-completion-irq;
#address-cells = <1>;
#size-cells = <0>;
+
+ scmi_devpd: protocol@11 {
+ reg = <0x11>;
+ #power-domain-cells = <1>;
+ };
+
+ scmi_sys: protocol@12 {
+ reg = <0x12>;
+ };
+
+ scmi_clk: protocol@14 {
+ reg = <0x14>;
+ #clock-cells = <1>;
+ };
+
+ scmi_reset: protocol@16 {
+ reg = <0x16>;
+ #reset-cells = <1>;
+ };
};
};
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread