mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] hw_random: omap-rng: ignore clocks for OMAP3/4
@ 2025-06-10 19:17 Ahmad Fatoum
  2025-06-10 19:17 ` [PATCH 2/2] ARM: configs: omap_defconfig: enable HW_RANDOM_OMAP Ahmad Fatoum
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-06-10 19:17 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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




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

* [PATCH 2/2] ARM: configs: omap_defconfig: enable HW_RANDOM_OMAP
  2025-06-10 19:17 [PATCH 1/2] hw_random: omap-rng: ignore clocks for OMAP3/4 Ahmad Fatoum
@ 2025-06-10 19:17 ` Ahmad Fatoum
  0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Fatoum @ 2025-06-10 19:17 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We recently added a OMAP RNG driver, so let's enable it in the
defconfig.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/configs/omap_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/configs/omap_defconfig b/arch/arm/configs/omap_defconfig
index 2383ffcb2c37..5c2c5540f5a6 100644
--- a/arch/arm/configs/omap_defconfig
+++ b/arch/arm/configs/omap_defconfig
@@ -17,7 +17,6 @@ CONFIG_MMU=y
 CONFIG_MALLOC_SIZE=0x0
 CONFIG_MALLOC_TLSF=y
 CONFIG_KALLSYMS=y
-CONFIG_RELOCATABLE=y
 CONFIG_PROMPT="barebox> "
 CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
@@ -134,6 +133,8 @@ CONFIG_LED_TRIGGERS=y
 CONFIG_EEPROM_AT24=y
 CONFIG_WATCHDOG=y
 CONFIG_WATCHDOG_OMAP=y
+CONFIG_HWRNG=y
+CONFIG_HW_RANDOM_OMAP=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_BUS_OMAP_GPMC=y
-- 
2.39.5




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

end of thread, other threads:[~2025-06-10 22:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-10 19:17 [PATCH 1/2] hw_random: omap-rng: ignore clocks for OMAP3/4 Ahmad Fatoum
2025-06-10 19:17 ` [PATCH 2/2] ARM: configs: omap_defconfig: enable HW_RANDOM_OMAP Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox