All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: introduce u-boot,ignore-clk-defaults
@ 2021-10-13  9:37 Peng Fan (OSS)
  2021-10-14 15:11 ` Simon Glass
  2021-10-15  1:10 ` Sean Anderson
  0 siblings, 2 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2021-10-13  9:37 UTC (permalink / raw)
  To: lukma, sjg, trini, seanga2; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Current code has a force clk_set_defaults in multiple stages,
U-Boot reuse the same device tree and Linux Kernel device tree,
but we not register all the clks as Linux Kernel, so clk_set_defaults
will fail and cause the clk provider registeration fail.

So introduce a new property to ignore the default settings which could
be used by any node that wanna ignore default settings.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 doc/device-tree-bindings/device.txt | 3 +++
 drivers/clk/clk-uclass.c            | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/doc/device-tree-bindings/device.txt b/doc/device-tree-bindings/device.txt
index 73ce2a3b5b..fe34ced268 100644
--- a/doc/device-tree-bindings/device.txt
+++ b/doc/device-tree-bindings/device.txt
@@ -28,6 +28,9 @@ the acpi,compatible property.
     Linux will only load the driver if the device can be detected (e.g. on I2C
     bus). Note that this is an out-of-tree Linux feature.
 
+Common device bindings that could be shared listed below:
+ - u-boot,ignore-clk-defaults : ignore the assigned-clock-parents
+   and assigned-clock-rates for a device that has the property.
 
 Example
 -------
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 493018b33e..6bf3179e7b 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -376,6 +376,9 @@ int clk_set_defaults(struct udevice *dev, enum clk_defaults_stage stage)
 	if (!dev_has_ofnode(dev))
 		return 0;
 
+	if (ofnode_get_property(dev_ofnode(dev), "u-boot,ignore-clk-defaults", NULL))
+		return 0;
+
 	/*
 	 * To avoid setting defaults twice, don't set them before relocation.
 	 * However, still set them for SPL. And still set them if explicitly
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-10-26  2:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  9:37 [PATCH] clk: introduce u-boot,ignore-clk-defaults Peng Fan (OSS)
2021-10-14 15:11 ` Simon Glass
2021-10-14 15:14   ` Tom Rini
2021-10-15  8:58   ` Peng Fan (OSS)
2021-10-24 19:53     ` Simon Glass
2021-10-15  1:10 ` Sean Anderson
2021-10-15  1:17   ` Peng Fan
2021-10-15  2:19     ` Simon Glass
2021-10-25  0:13       ` Sean Anderson
2021-10-25 15:18         ` Simon Glass
2021-10-26  1:23           ` Sean Anderson
2021-10-26  1:59             ` Sean Anderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.