From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] hw_random: omap-rng: ignore clocks for OMAP3/4
Date: Tue, 10 Jun 2025 21:17:48 +0200 [thread overview]
Message-ID: <20250610191749.2452927-1-a.fatoum@pengutronix.de> (raw)
We do not have clock drivers for OMAP, including the AM33xx.
The omap-rng driver calls clk_get_optional and so far this returned
NULL, because CONFIG_COMMON_CLK_OF_PROVIDER was disabled.
In configurations with the option enabled, we get understandably an
error code, which makes the drive defer probe indefinitely.
We are unlikely to add clock drivers for am33xx after all these years,
so just tweak the RNG driver to require clock driver support only on K3
SoCs.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/hw_random/omap-rng.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/hw_random/omap-rng.c b/drivers/hw_random/omap-rng.c
index 6b69994aad0b..2028be650785 100644
--- a/drivers/hw_random/omap-rng.c
+++ b/drivers/hw_random/omap-rng.c
@@ -133,6 +133,7 @@ struct omap_rng_dev;
* @data_present: Callback to determine if data is available.
* @init: Callback for IP specific initialization sequence.
* @cleanup: Callback for IP specific cleanup sequence.
+ * @ignore_clocks: assume clocks are enabled (barebox-specific)
*/
struct omap_rng_pdata {
u16 *regs;
@@ -140,6 +141,7 @@ struct omap_rng_pdata {
u32 (*data_present)(struct omap_rng_dev *priv);
int (*init)(struct omap_rng_dev *priv);
void (*cleanup)(struct omap_rng_dev *priv);
+ bool ignore_clocks;
};
struct omap_rng_dev {
@@ -230,6 +232,7 @@ static struct omap_rng_pdata omap2_rng_pdata = {
.data_present = omap2_rng_data_present,
.init = omap2_rng_init,
.cleanup = omap2_rng_cleanup,
+ .ignore_clocks = true,
};
static inline u32 omap4_rng_data_present(struct omap_rng_dev *priv)
@@ -299,6 +302,7 @@ static struct omap_rng_pdata omap4_rng_pdata = {
.data_present = omap4_rng_data_present,
.init = omap4_rng_init,
.cleanup = omap4_rng_cleanup,
+ .ignore_clocks = true,
};
static struct omap_rng_pdata eip76_rng_pdata = {
--
2.39.5
next reply other threads:[~2025-06-10 22:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 19:17 Ahmad Fatoum [this message]
2025-06-10 19:17 ` [PATCH 2/2] ARM: configs: omap_defconfig: enable HW_RANDOM_OMAP Ahmad Fatoum
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=20250610191749.2452927-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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