From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: Peng Fan <peng.fan@nxp.com>, "lukma@denx.de" <lukma@denx.de>,
"sjg@chromium.org" <sjg@chromium.org>,
"trini@konsulko.com" <trini@konsulko.com>,
"seanga2@gmail.com" <seanga2@gmail.com>
Cc: "u-boot@lists.denx.de" <u-boot@lists.denx.de>
Subject: RE: [PATCH V2] clk: introduce u-boot,ignore-clk-defaults
Date: Sat, 20 Nov 2021 12:10:54 +0000 [thread overview]
Message-ID: <DU0PR04MB9417D95EEF1B2CE739622A0B889D9@DU0PR04MB9417.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20211029012801.15193-1-peng.fan@oss.nxp.com>
> Subject: [PATCH V2] clk: introduce u-boot,ignore-clk-defaults
>
> 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.
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>
> V2:
> Add R-b tag
> Tom, Simon
> After a thought, I think still put it as a u-boot thing. assigned-clock-x is
> actually Linux specific, however I could not add the new property to Linux,
> because we are supporting SystemReady-IR, we need the
> assigned-clock-x property
> in linux working and ignore it in U-Boot.
Any more thoughts?
Thanks,
Peng.
>
> 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
next prev parent reply other threads:[~2021-11-20 12:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 1:28 [PATCH V2] clk: introduce u-boot,ignore-clk-defaults Peng Fan (OSS)
2021-10-29 0:57 ` Sean Anderson
2021-10-29 2:10 ` Tom Rini
2021-10-29 2:43 ` Sean Anderson
2021-10-29 2:47 ` Tom Rini
2021-11-20 12:10 ` Peng Fan (OSS) [this message]
2021-11-20 12:57 ` Tom Rini
2021-11-20 15:06 ` Sean Anderson
2021-11-20 15:13 ` Tom Rini
2021-11-20 15:21 ` Mark Kettenis
2021-11-20 15:25 ` Tom Rini
2021-11-22 3:34 ` Peng Fan (OSS)
2021-11-22 3:33 ` Peng Fan (OSS)
2021-11-22 3:51 ` Simon Glass
2021-11-22 13:22 ` Tom Rini
2021-11-23 3:02 ` Peng Fan (OSS)
2021-11-23 15:38 ` Tom Rini
2021-11-24 2:16 ` Sean Anderson
2021-11-24 14:10 ` Tom Rini
2021-11-26 18:17 ` Sean Anderson
2021-11-26 18:54 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DU0PR04MB9417D95EEF1B2CE739622A0B889D9@DU0PR04MB9417.eurprd04.prod.outlook.com \
--to=peng.fan@oss.nxp.com \
--cc=lukma@denx.de \
--cc=peng.fan@nxp.com \
--cc=seanga2@gmail.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).