linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] openrisc: init: Add support for common clk
@ 2022-01-11  3:00 Stafford Horne
  2022-01-11 16:31 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Stafford Horne @ 2022-01-11  3:00 UTC (permalink / raw)
  To: LKML
  Cc: Gabriel Somlo, Geert Uytterhoeven, Stafford Horne, Jonas Bonn,
	Stefan Kristiansson, Randy Dunlap, openrisc

When testing the new litex_mmc driver it was found to not work on
OpenRISC due to missing support for common clk.  This patch does the
basic initialization to allow OpenRISC to use the common clk framework.

Signed-off-by: Stafford Horne <shorne@gmail.com>
---
 arch/openrisc/Kconfig       | 1 +
 arch/openrisc/kernel/time.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index c2491b295d60..f724b3f1aeed 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -10,6 +10,7 @@ config OPENRISC
 	select ARCH_HAS_DMA_SET_UNCACHED
 	select ARCH_HAS_DMA_CLEAR_UNCACHED
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
+	select COMMON_CLK
 	select OF
 	select OF_EARLY_FLATTREE
 	select IRQ_DOMAIN
diff --git a/arch/openrisc/kernel/time.c b/arch/openrisc/kernel/time.c
index a6e69386f82a..6d18989d63d0 100644
--- a/arch/openrisc/kernel/time.c
+++ b/arch/openrisc/kernel/time.c
@@ -20,6 +20,7 @@
 #include <linux/clockchips.h>
 #include <linux/irq.h>
 #include <linux/io.h>
+#include <linux/of_clk.h>
 
 #include <asm/cpuinfo.h>
 
@@ -169,4 +170,7 @@ void __init time_init(void)
 
 	openrisc_timer_init();
 	openrisc_clockevent_init();
+
+	of_clk_init(NULL);
+	timer_probe();
 }
-- 
2.31.1


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

* Re: [PATCH] openrisc: init: Add support for common clk
  2022-01-11  3:00 [PATCH] openrisc: init: Add support for common clk Stafford Horne
@ 2022-01-11 16:31 ` Geert Uytterhoeven
  2022-01-11 21:12   ` Stafford Horne
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2022-01-11 16:31 UTC (permalink / raw)
  To: Stafford Horne
  Cc: LKML, Gabriel Somlo, Jonas Bonn, Stefan Kristiansson,
	Randy Dunlap, Openrisc

Hi Stafford,

On Tue, Jan 11, 2022 at 4:01 AM Stafford Horne <shorne@gmail.com> wrote:
> When testing the new litex_mmc driver it was found to not work on
> OpenRISC due to missing support for common clk.  This patch does the
> basic initialization to allow OpenRISC to use the common clk framework.
>
> Signed-off-by: Stafford Horne <shorne@gmail.com>

Thanks for your patch!

This matches what other architectures are doing, and is IMHO the way
forward for sharing FPGA drivers among architectures.
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] openrisc: init: Add support for common clk
  2022-01-11 16:31 ` Geert Uytterhoeven
@ 2022-01-11 21:12   ` Stafford Horne
  0 siblings, 0 replies; 3+ messages in thread
From: Stafford Horne @ 2022-01-11 21:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: LKML, Gabriel Somlo, Jonas Bonn, Stefan Kristiansson,
	Randy Dunlap, Openrisc

On Tue, Jan 11, 2022 at 05:31:05PM +0100, Geert Uytterhoeven wrote:
> Hi Stafford,
> 
> On Tue, Jan 11, 2022 at 4:01 AM Stafford Horne <shorne@gmail.com> wrote:
> > When testing the new litex_mmc driver it was found to not work on
> > OpenRISC due to missing support for common clk.  This patch does the
> > basic initialization to allow OpenRISC to use the common clk framework.
> >
> > Signed-off-by: Stafford Horne <shorne@gmail.com>
> 
> Thanks for your patch!
> 
> This matches what other architectures are doing, and is IMHO the way
> forward for sharing FPGA drivers among architectures.
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Thank you.

-Stafford

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

end of thread, other threads:[~2022-01-11 21:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11  3:00 [PATCH] openrisc: init: Add support for common clk Stafford Horne
2022-01-11 16:31 ` Geert Uytterhoeven
2022-01-11 21:12   ` Stafford Horne

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).