* [PATCH 2/4] ARM: sa1100: enable MULTI_IRQ_HANDLER for all boards
2013-11-01 10:52 [PATCH 1/4] ARM: sa1100: add irq handler to prepare MULTI_IRQ_HANDLER Dmitry Eremin-Solenikov
@ 2013-11-01 10:52 ` Dmitry Eremin-Solenikov
2013-11-01 10:52 ` [PATCH 3/4] ARM: sa1100: drop entry-macro.S Dmitry Eremin-Solenikov
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2013-11-01 10:52 UTC (permalink / raw)
To: linux-arm-kernel
Use sa1100_handle_irq to handle irqs on all sa1100 boards.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-sa1100/assabet.c | 1 +
arch/arm/mach-sa1100/badge4.c | 1 +
arch/arm/mach-sa1100/cerf.c | 1 +
arch/arm/mach-sa1100/collie.c | 1 +
arch/arm/mach-sa1100/h3100.c | 1 +
arch/arm/mach-sa1100/h3600.c | 1 +
arch/arm/mach-sa1100/hackkit.c | 1 +
arch/arm/mach-sa1100/jornada720.c | 1 +
arch/arm/mach-sa1100/lart.c | 1 +
arch/arm/mach-sa1100/nanoengine.c | 1 +
arch/arm/mach-sa1100/pleb.c | 1 +
arch/arm/mach-sa1100/shannon.c | 1 +
arch/arm/mach-sa1100/simpad.c | 1 +
14 files changed, 14 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 799ef94..5c86d8a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -693,6 +693,7 @@ config ARCH_SA1100
select GENERIC_CLOCKEVENTS
select HAVE_IDE
select ISA
+ select MULTI_IRQ_HANDLER
select NEED_MACH_MEMORY_H
select SPARSE_IRQ
help
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index c9808c6..d745297 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -625,6 +625,7 @@ MACHINE_START(ASSABET, "Intel-Assabet")
.map_io = assabet_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = assabet_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index 63361b6..acbaae4 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -335,6 +335,7 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
.map_io = badge4_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_late = sa11x0_init_late,
.init_time = sa1100_timer_init,
#ifdef CONFIG_SA1111
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index 2d25ece..cad0ada 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -174,6 +174,7 @@ MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
.map_io = cerf_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = cerf_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = cerf_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 7fb96eb..3e26ddc 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -399,6 +399,7 @@ MACHINE_START(COLLIE, "Sharp-Collie")
.map_io = collie_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = collie_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c
index b8f2b15..5ab169d 100644
--- a/arch/arm/mach-sa1100/h3100.c
+++ b/arch/arm/mach-sa1100/h3100.c
@@ -108,6 +108,7 @@ MACHINE_START(H3100, "Compaq iPAQ H3100")
.map_io = h3100_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = h3100_mach_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index b8dc5bd..7209c0e 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -158,6 +158,7 @@ MACHINE_START(H3600, "Compaq iPAQ H3600")
.map_io = h3600_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = h3600_mach_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index 643d5f2..1998805 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -229,6 +229,7 @@ MACHINE_START(HACKKIT, "HackKit Cpu Board")
.map_io = hackkit_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = hackkit_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index c0b1f5b..74d5894 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -346,6 +346,7 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
.map_io = jornada720_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = jornada720_mach_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 51b0eb5..2f3c8a1 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -169,6 +169,7 @@ MACHINE_START(LART, "LART")
.map_io = lart_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_machine = lart_init,
.init_late = sa11x0_init_late,
.init_time = sa1100_timer_init,
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c
index f1cb378..b35b1ca 100644
--- a/arch/arm/mach-sa1100/nanoengine.c
+++ b/arch/arm/mach-sa1100/nanoengine.c
@@ -110,6 +110,7 @@ MACHINE_START(NANOENGINE, "BSE nanoEngine")
.map_io = nanoengine_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = nanoengine_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
index 0912618..f35c4d9 100644
--- a/arch/arm/mach-sa1100/pleb.c
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -133,6 +133,7 @@ MACHINE_START(PLEB, "PLEB")
.map_io = pleb_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = pleb_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index c8866bc..975dc95 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -102,6 +102,7 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
.map_io = shannon_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_time = sa1100_timer_init,
.init_machine = shannon_init,
.init_late = sa11x0_init_late,
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 41e476e..f40b07e 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -396,6 +396,7 @@ MACHINE_START(SIMPAD, "Simpad")
.map_io = simpad_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq,
+ .handle_irq = sa1100_handle_irq,
.init_late = sa11x0_init_late,
.init_time = sa1100_timer_init,
.restart = sa11x0_restart,
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/4] ARM: sa1100: drop entry-macro.S
2013-11-01 10:52 [PATCH 1/4] ARM: sa1100: add irq handler to prepare MULTI_IRQ_HANDLER Dmitry Eremin-Solenikov
2013-11-01 10:52 ` [PATCH 2/4] ARM: sa1100: enable MULTI_IRQ_HANDLER for all boards Dmitry Eremin-Solenikov
@ 2013-11-01 10:52 ` Dmitry Eremin-Solenikov
2013-11-01 10:52 ` [PATCH 4/4] ARM: sa1100: switch to COMMON_CLK framework Dmitry Eremin-Solenikov
2013-11-12 13:44 ` [PATCH 1/4] ARM: sa1100: add irq handler to prepare MULTI_IRQ_HANDLER Linus Walleij
3 siblings, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2013-11-01 10:52 UTC (permalink / raw)
To: linux-arm-kernel
As mach-sa1100 was converted to MULTI_IRQ_HANDLER, drop now-unused
entry-macro.S file.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
---
arch/arm/mach-sa1100/include/mach/entry-macro.S | 41 -------------------------
1 file changed, 41 deletions(-)
delete mode 100644 arch/arm/mach-sa1100/include/mach/entry-macro.S
diff --git a/arch/arm/mach-sa1100/include/mach/entry-macro.S b/arch/arm/mach-sa1100/include/mach/entry-macro.S
deleted file mode 100644
index 8cf7630..0000000
--- a/arch/arm/mach-sa1100/include/mach/entry-macro.S
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * arch/arm/mach-sa1100/include/mach/entry-macro.S
- *
- * Low-level IRQ helper macros for SA1100-based platforms
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
- .macro get_irqnr_preamble, base, tmp
- mov \base, #0xfa000000 @ ICIP = 0xfa050000
- add \base, \base, #0x00050000
- .endm
-
- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
- ldr \irqstat, [\base] @ get irqs
- ldr \irqnr, [\base, #4] @ ICMR = 0xfa050004
- ands \irqstat, \irqstat, \irqnr
- mov \irqnr, #0
- beq 1001f
- tst \irqstat, #0xff
- moveq \irqstat, \irqstat, lsr #8
- addeq \irqnr, \irqnr, #8
- tsteq \irqstat, #0xff
- moveq \irqstat, \irqstat, lsr #8
- addeq \irqnr, \irqnr, #8
- tsteq \irqstat, #0xff
- moveq \irqstat, \irqstat, lsr #8
- addeq \irqnr, \irqnr, #8
- tst \irqstat, #0x0f
- moveq \irqstat, \irqstat, lsr #4
- addeq \irqnr, \irqnr, #4
- tst \irqstat, #0x03
- moveq \irqstat, \irqstat, lsr #2
- addeq \irqnr, \irqnr, #2
- tst \irqstat, #0x01
- addeqs \irqnr, \irqnr, #1
-1001:
- .endm
-
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] ARM: sa1100: switch to COMMON_CLK framework
2013-11-01 10:52 [PATCH 1/4] ARM: sa1100: add irq handler to prepare MULTI_IRQ_HANDLER Dmitry Eremin-Solenikov
2013-11-01 10:52 ` [PATCH 2/4] ARM: sa1100: enable MULTI_IRQ_HANDLER for all boards Dmitry Eremin-Solenikov
2013-11-01 10:52 ` [PATCH 3/4] ARM: sa1100: drop entry-macro.S Dmitry Eremin-Solenikov
@ 2013-11-01 10:52 ` Dmitry Eremin-Solenikov
2013-11-01 10:59 ` Russell King - ARM Linux
2013-11-12 13:44 ` [PATCH 1/4] ARM: sa1100: add irq handler to prepare MULTI_IRQ_HANDLER Linus Walleij
3 siblings, 1 reply; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2013-11-01 10:52 UTC (permalink / raw)
To: linux-arm-kernel
Implement common clock framework support for SA-1100.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
---
arch/arm/Kconfig | 2 +-
arch/arm/mach-sa1100/clock.c | 100 ----------------------------------
arch/arm/mach-sa1100/generic.c | 2 +
drivers/clk/Makefile | 1 +
drivers/clk/clk-sa1100.c | 121 +++++++++++++++++++++++++++++++++++++++++
include/linux/clk/sa1100.h | 14 +++++
6 files changed, 139 insertions(+), 101 deletions(-)
delete mode 100644 arch/arm/mach-sa1100/clock.c
create mode 100644 drivers/clk/clk-sa1100.c
create mode 100644 include/linux/clk/sa1100.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5c86d8a..b28e518 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -686,8 +686,8 @@ config ARCH_SA1100
select ARCH_MTD_XIP
select ARCH_REQUIRE_GPIOLIB
select ARCH_SPARSEMEM_ENABLE
- select CLKDEV_LOOKUP
select CLKSRC_MMIO
+ select COMMON_CLK
select CPU_FREQ
select CPU_SA1100
select GENERIC_CLOCKEVENTS
diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c
deleted file mode 100644
index 172ebd0..0000000
--- a/arch/arm/mach-sa1100/clock.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * linux/arch/arm/mach-sa1100/clock.c
- */
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/device.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/string.h>
-#include <linux/clk.h>
-#include <linux/spinlock.h>
-#include <linux/mutex.h>
-#include <linux/io.h>
-#include <linux/clkdev.h>
-
-#include <mach/hardware.h>
-
-struct clkops {
- void (*enable)(struct clk *);
- void (*disable)(struct clk *);
-};
-
-struct clk {
- const struct clkops *ops;
- unsigned int enabled;
-};
-
-#define DEFINE_CLK(_name, _ops) \
-struct clk clk_##_name = { \
- .ops = _ops, \
- }
-
-static DEFINE_SPINLOCK(clocks_lock);
-
-static void clk_gpio27_enable(struct clk *clk)
-{
- /*
- * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111:
- * (SA-1110 Developer's Manual, section 9.1.2.1)
- */
- GAFR |= GPIO_32_768kHz;
- GPDR |= GPIO_32_768kHz;
- TUCR = TUCR_3_6864MHz;
-}
-
-static void clk_gpio27_disable(struct clk *clk)
-{
- TUCR = 0;
- GPDR &= ~GPIO_32_768kHz;
- GAFR &= ~GPIO_32_768kHz;
-}
-
-int clk_enable(struct clk *clk)
-{
- unsigned long flags;
-
- if (clk) {
- spin_lock_irqsave(&clocks_lock, flags);
- if (clk->enabled++ == 0)
- clk->ops->enable(clk);
- spin_unlock_irqrestore(&clocks_lock, flags);
- }
-
- return 0;
-}
-EXPORT_SYMBOL(clk_enable);
-
-void clk_disable(struct clk *clk)
-{
- unsigned long flags;
-
- if (clk) {
- WARN_ON(clk->enabled == 0);
- spin_lock_irqsave(&clocks_lock, flags);
- if (--clk->enabled == 0)
- clk->ops->disable(clk);
- spin_unlock_irqrestore(&clocks_lock, flags);
- }
-}
-EXPORT_SYMBOL(clk_disable);
-
-const struct clkops clk_gpio27_ops = {
- .enable = clk_gpio27_enable,
- .disable = clk_gpio27_disable,
-};
-
-static DEFINE_CLK(gpio27, &clk_gpio27_ops);
-
-static struct clk_lookup sa11xx_clkregs[] = {
- CLKDEV_INIT("sa1111.0", NULL, &clk_gpio27),
- CLKDEV_INIT("sa1100-rtc", NULL, NULL),
-};
-
-static int __init sa11xx_clk_init(void)
-{
- clkdev_add_table(sa11xx_clkregs, ARRAY_SIZE(sa11xx_clkregs));
- return 0;
-}
-core_initcall(sa11xx_clk_init);
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index d4ea142..f35dd06 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -20,6 +20,7 @@
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
+#include <linux/clk/sa1100.h>
#include <video/sa1100fb.h>
@@ -312,6 +313,7 @@ static struct platform_device *sa11x0_devices[] __initdata = {
static int __init sa1100_init(void)
{
pm_power_off = sa1100_power_off;
+ sa1100_clocks_init();
return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices));
}
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index fe3121b..0d46402 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -26,6 +26,7 @@ obj-$(CONFIG_ARCH_MMP) += mmp/
endif
obj-$(CONFIG_MACH_LOONGSON1) += clk-ls1x.o
obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
+obj-$(CONFIG_ARCH_SA1100) += clk-sa1100.o
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
obj-$(CONFIG_ARCH_U8500) += ux500/
obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o
diff --git a/drivers/clk/clk-sa1100.c b/drivers/clk/clk-sa1100.c
new file mode 100644
index 0000000..b79d0f4
--- /dev/null
+++ b/drivers/clk/clk-sa1100.c
@@ -0,0 +1,121 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/clk-provider.h>
+#include <linux/clkdev.h>
+
+#include <mach/hardware.h>
+
+enum {
+ osc32k768, osc3M6864,
+ gpio27_3M6864,
+ clk_max,
+};
+
+static struct clk *clks[clk_max];
+
+/*
+ * In reality it is a switch between 32k768 and 3M6864, driven on GPIO27,
+ * if it is enabled by GPIO Alternate function.
+ * However nobody uses 32k768 output (as it seems), so there is no point
+ * implementing it as a switch.
+ */
+static int gpio27_enabled;
+static int clk_gpio27_enable(struct clk_hw *hw)
+{
+ /*
+ * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111:
+ * (SA-1110 Developer's Manual, section 9.1.2.1)
+ */
+ GAFR |= GPIO_32_768kHz;
+ GPDR |= GPIO_32_768kHz;
+ TUCR = TUCR_3_6864MHz;
+
+ gpio27_enabled = 1;
+ return 0;
+}
+
+static void clk_gpio27_disable(struct clk_hw *hw)
+{
+ gpio27_enabled = 0;
+ TUCR = 0;
+ GPDR &= ~GPIO_32_768kHz;
+ GAFR &= ~GPIO_32_768kHz;
+}
+
+static int clk_gpio27_is_enabled(struct clk_hw *hw)
+{
+ return gpio27_enabled;
+}
+
+static const struct clk_ops clk_gpio27_ops = {
+ .enable = clk_gpio27_enable,
+ .disable = clk_gpio27_disable,
+ .is_enabled = clk_gpio27_is_enabled,
+};
+
+static struct clk *clk_register_gpio27(struct device *dev, const char *name,
+ const char *parent_name, unsigned long flags)
+{
+ struct clk_hw *gpio27;
+ struct clk *clk;
+ struct clk_init_data init;
+
+ /* allocate the gpio27 */
+ gpio27 = kzalloc(sizeof(struct clk_hw), GFP_KERNEL);
+ if (!gpio27) {
+ pr_err("%s: could not allocate gpio27d clk\n", __func__);
+ return ERR_PTR(-ENOMEM);
+ }
+
+ init.name = name;
+ init.ops = &clk_gpio27_ops;
+ init.flags = flags | CLK_IS_BASIC;
+ init.parent_names = (parent_name ? &parent_name : NULL);
+ init.num_parents = (parent_name ? 1 : 0);
+
+ /* struct clk_gpio27 assignments */
+ gpio27->init = &init;
+
+ clk = clk_register(dev, gpio27);
+
+ if (IS_ERR(clk))
+ kfree(gpio27);
+
+ return clk;
+}
+
+/* Fixed clocks on sa1100 */
+int __init sa1100_clocks_init(void)
+{
+ int i;
+
+ clks[osc32k768] = clk_register_fixed_rate(NULL, "osc32k768", NULL,
+ CLK_IS_ROOT, 32768);
+ clks[osc3M6864] = clk_register_fixed_rate(NULL, "osc3M6864", NULL,
+ CLK_IS_ROOT, 3686400);
+ clks[gpio27_3M6864] = clk_register_gpio27(NULL, "gpio27_3M6864",
+ "osc3M6864", 0);
+
+ clk_register_clkdev(clks[gpio27_3M6864], NULL, "sa1111.0");
+ clk_register_clkdev(clks[osc32k768], NULL, "sa1100-rtc");
+
+ for (i = 0; i < ARRAY_SIZE(clks); i++)
+ if (IS_ERR(clks[i])) {
+ pr_err("SA1100 clk %d: register failed with %ld\n",
+ i, PTR_ERR(clks[i]));
+ return PTR_ERR(clks[i]);
+ }
+
+ return 0;
+}
diff --git a/include/linux/clk/sa1100.h b/include/linux/clk/sa1100.h
new file mode 100644
index 0000000..497de03
--- /dev/null
+++ b/include/linux/clk/sa1100.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2013 Dmitry Eremin-Solenikov
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX_CLK_SA1100_H
+#define __LINUX_CLK_SA1100_H
+
+int sa1100_clocks_init(void);
+
+#endif
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/4] ARM: sa1100: switch to COMMON_CLK framework
2013-11-01 10:52 ` [PATCH 4/4] ARM: sa1100: switch to COMMON_CLK framework Dmitry Eremin-Solenikov
@ 2013-11-01 10:59 ` Russell King - ARM Linux
2013-11-01 11:21 ` Dmitry Eremin-Solenikov
2013-11-01 19:54 ` Dmitry Eremin-Solenikov
0 siblings, 2 replies; 8+ messages in thread
From: Russell King - ARM Linux @ 2013-11-01 10:59 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Nov 01, 2013 at 02:52:11PM +0400, Dmitry Eremin-Solenikov wrote:
> +#include <linux/kernel.h>
> +#include <linux/clk-provider.h>
> +#include <linux/clkdev.h>
> +
> +#include <mach/hardware.h>
If the aim of this patch set is to move SA11x0 towards multiplatform,
then this has just failed with the above include. It would be better
not to try this without first solving the problem of the SoC register
definitions.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/4] ARM: sa1100: switch to COMMON_CLK framework
2013-11-01 10:59 ` Russell King - ARM Linux
@ 2013-11-01 11:21 ` Dmitry Eremin-Solenikov
2013-11-01 19:54 ` Dmitry Eremin-Solenikov
1 sibling, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2013-11-01 11:21 UTC (permalink / raw)
To: linux-arm-kernel
On 01/11/13 14:59, Russell King - ARM Linux wrote:
> On Fri, Nov 01, 2013 at 02:52:11PM +0400, Dmitry Eremin-Solenikov wrote:
>> +#include <linux/kernel.h>
>> +#include <linux/clk-provider.h>
>> +#include <linux/clkdev.h>
>> +
>> +#include <mach/hardware.h>
>
> If the aim of this patch set is to move SA11x0 towards multiplatform,
> then this has just failed with the above include. It would be better
> not to try this without first solving the problem of the SoC register
> definitions.
OK, still learning "new ARM" ways. Is it ok to remap fixed addresses in
that file?
And second question: what would be better: to leave that code as is,
or to convert that to 3M6864/32k768 multiplexer (TUCR bit) +
enable/disable (GAFR/GPDR)? I ain't sure that all other TUCR modes
were ever used.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/4] ARM: sa1100: switch to COMMON_CLK framework
2013-11-01 10:59 ` Russell King - ARM Linux
2013-11-01 11:21 ` Dmitry Eremin-Solenikov
@ 2013-11-01 19:54 ` Dmitry Eremin-Solenikov
1 sibling, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2013-11-01 19:54 UTC (permalink / raw)
To: linux-arm-kernel
On 01/11/13 14:59, Russell King - ARM Linux wrote:
> On Fri, Nov 01, 2013 at 02:52:11PM +0400, Dmitry Eremin-Solenikov wrote:
>> +#include <linux/kernel.h>
>> +#include <linux/clk-provider.h>
>> +#include <linux/clkdev.h>
>> +
>> +#include <mach/hardware.h>
>
> If the aim of this patch set is to move SA11x0 towards multiplatform,
> then this has just failed with the above include. It would be better
> not to try this without first solving the problem of the SoC register
> definitions.
Also what about first three patches?
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/4] ARM: sa1100: add irq handler to prepare MULTI_IRQ_HANDLER
2013-11-01 10:52 [PATCH 1/4] ARM: sa1100: add irq handler to prepare MULTI_IRQ_HANDLER Dmitry Eremin-Solenikov
` (2 preceding siblings ...)
2013-11-01 10:52 ` [PATCH 4/4] ARM: sa1100: switch to COMMON_CLK framework Dmitry Eremin-Solenikov
@ 2013-11-12 13:44 ` Linus Walleij
3 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2013-11-12 13:44 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Nov 1, 2013 at 11:52 AM, Dmitry Eremin-Solenikov
<dmitry_eremin@mentor.com> wrote:
> Add sa1100_handle_irq implementating handle_irq for sa1100 platform.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
As it happens I had a larger series doing this and some more refactorings
in the SA1100 irq driver, like using irqdomain for mapping all IRQs. Sorry
for not noting this earlier :-(
I cleaned it up and sending it now and we can have a fight on
which patches to take ;-)
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread