* [PULL] clockevents for 4.9
@ 2016-09-12 9:10 ` Daniel Lezcano
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:10 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Ingo Molnar, Alexandre Belloni, Joel Stanley, Neil Armstrong,
Linux Kernel Mailing List, linux-arm-kernel
Hi Thomas, Ingo,
This pull request for 4.9 contains a few changes:
- Cleanup the atmel-pit timer (Alexander Belloni)
- Add the Aspeed support (Joel Stanley)
- Replaced setup_irq/request_irq and panic/pr_err on moxart (Daniel
Lezcano)
- Add the Ox820 compatible string for oxnas (Neil Armstrong)
Thanks !
-- Daniel
The following changes since commit 950d8381d915ee293a5b57f91e59dd8115684af1:
Merge branch 'linus' into timers/core, to refresh the branch
(2016-09-08 14:05:16 +0200)
are available in the git repository at:
http://git.linaro.org/people/daniel.lezcano/linux.git clockevents/4.9
for you to fetch changes up to 2ea3401e2a84eed3f5f55b2075706f88df160d85:
clocksource/drivers/oxnas: Add OX820 compatible (2016-09-12 07:28:46
+0200)
----------------------------------------------------------------
Alexandre Belloni (3):
clocksource/drivers/timer-atmel-pit: Drop at91sam926x_pit_common_init
clocksource/drivers/timer-atmel-pit: Remove uselesss WARN_ON_ONCE
clocksource/drivers/timer-atmel-pit: Simplify IRQ handler
Daniel Lezcano (2):
clocksource/drivers/moxart: Replace setup_irq by request_irq
clocksource/drivers/moxart: Replace panic by pr_err
Joel Stanley (3):
clocksource/drivers/moxart: Refactor enable/disable
clocksource/drivers/moxart: Use struct to hold state
clocksource/drivers/moxart: Add Aspeed support
Neil Armstrong (1):
clocksource/drivers/oxnas: Add OX820 compatible
Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt | 4 +++-
Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt | 2 +-
drivers/clocksource/moxart_timer.c | 193
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------
drivers/clocksource/timer-atmel-pit.c | 96
+++++++++++++++++++++++++++++++++++++-----------------------------------------------------------
drivers/clocksource/timer-oxnas-rps.c | 2 ++
5 files changed, 172 insertions(+), 125 deletions(-)
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PULL] clockevents for 4.9
@ 2016-09-12 9:10 ` Daniel Lezcano
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:10 UTC (permalink / raw)
To: linux-arm-kernel
Hi Thomas, Ingo,
This pull request for 4.9 contains a few changes:
- Cleanup the atmel-pit timer (Alexander Belloni)
- Add the Aspeed support (Joel Stanley)
- Replaced setup_irq/request_irq and panic/pr_err on moxart (Daniel
Lezcano)
- Add the Ox820 compatible string for oxnas (Neil Armstrong)
Thanks !
-- Daniel
The following changes since commit 950d8381d915ee293a5b57f91e59dd8115684af1:
Merge branch 'linus' into timers/core, to refresh the branch
(2016-09-08 14:05:16 +0200)
are available in the git repository at:
http://git.linaro.org/people/daniel.lezcano/linux.git clockevents/4.9
for you to fetch changes up to 2ea3401e2a84eed3f5f55b2075706f88df160d85:
clocksource/drivers/oxnas: Add OX820 compatible (2016-09-12 07:28:46
+0200)
----------------------------------------------------------------
Alexandre Belloni (3):
clocksource/drivers/timer-atmel-pit: Drop at91sam926x_pit_common_init
clocksource/drivers/timer-atmel-pit: Remove uselesss WARN_ON_ONCE
clocksource/drivers/timer-atmel-pit: Simplify IRQ handler
Daniel Lezcano (2):
clocksource/drivers/moxart: Replace setup_irq by request_irq
clocksource/drivers/moxart: Replace panic by pr_err
Joel Stanley (3):
clocksource/drivers/moxart: Refactor enable/disable
clocksource/drivers/moxart: Use struct to hold state
clocksource/drivers/moxart: Add Aspeed support
Neil Armstrong (1):
clocksource/drivers/oxnas: Add OX820 compatible
Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt | 4 +++-
Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt | 2 +-
drivers/clocksource/moxart_timer.c | 193
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------
drivers/clocksource/timer-atmel-pit.c | 96
+++++++++++++++++++++++++++++++++++++-----------------------------------------------------------
drivers/clocksource/timer-oxnas-rps.c | 2 ++
5 files changed, 172 insertions(+), 125 deletions(-)
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/9] clocksource/drivers/moxart: Refactor enable/disable
2016-09-12 9:10 ` Daniel Lezcano
(?)
@ 2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` [PATCH 2/9] clocksource/drivers/moxart: Use struct to hold state Daniel Lezcano
` (7 more replies)
-1 siblings, 8 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx; +Cc: mingo, linux-kernel, Joel Stanley
From: Joel Stanley <joel@jms.id.au>
This patch abstracts the enable and disable register writes into their
own functions in preparation for future changes to use SoC specific
values for the writes.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/moxart_timer.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/clocksource/moxart_timer.c b/drivers/clocksource/moxart_timer.c
index 8414544..a3aaa56 100644
--- a/drivers/clocksource/moxart_timer.c
+++ b/drivers/clocksource/moxart_timer.c
@@ -58,15 +58,25 @@
static void __iomem *base;
static unsigned int clock_count_per_tick;
-static int moxart_shutdown(struct clock_event_device *evt)
+static inline void moxart_disable(struct clock_event_device *evt)
{
writel(TIMER1_DISABLE, base + TIMER_CR);
+}
+
+static inline void moxart_enable(struct clock_event_device *evt)
+{
+ writel(TIMER1_ENABLE, base + TIMER_CR);
+}
+
+static int moxart_shutdown(struct clock_event_device *evt)
+{
+ moxart_disable(evt);
return 0;
}
static int moxart_set_oneshot(struct clock_event_device *evt)
{
- writel(TIMER1_DISABLE, base + TIMER_CR);
+ moxart_disable(evt);
writel(~0, base + TIMER1_BASE + REG_LOAD);
return 0;
}
@@ -74,21 +84,21 @@ static int moxart_set_oneshot(struct clock_event_device *evt)
static int moxart_set_periodic(struct clock_event_device *evt)
{
writel(clock_count_per_tick, base + TIMER1_BASE + REG_LOAD);
- writel(TIMER1_ENABLE, base + TIMER_CR);
+ moxart_enable(evt);
return 0;
}
static int moxart_clkevt_next_event(unsigned long cycles,
- struct clock_event_device *unused)
+ struct clock_event_device *evt)
{
u32 u;
- writel(TIMER1_DISABLE, base + TIMER_CR);
+ moxart_disable(evt);
u = readl(base + TIMER1_BASE + REG_COUNT) - cycles;
writel(u, base + TIMER1_BASE + REG_MATCH1);
- writel(TIMER1_ENABLE, base + TIMER_CR);
+ moxart_enable(evt);
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/9] clocksource/drivers/moxart: Use struct to hold state
2016-09-12 9:15 ` [PATCH 1/9] clocksource/drivers/moxart: Refactor enable/disable Daniel Lezcano
@ 2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` Daniel Lezcano
` (6 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx; +Cc: mingo, linux-kernel, Joel Stanley
From: Joel Stanley <joel@jms.id.au>
Add a struct moxart_timer to hold the driver state, including the
irqaction and struct clock_event_device.
Most importantly this holds values for enabling and disabling the timer,
so future support can be added for devices that use different bits for
enable/disable.
In preparation for future hardware support we add a MOXART prefix to the
existing values.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/moxart_timer.c | 147 ++++++++++++++++++++++---------------
1 file changed, 86 insertions(+), 61 deletions(-)
diff --git a/drivers/clocksource/moxart_timer.c b/drivers/clocksource/moxart_timer.c
index a3aaa56..cb0b347 100644
--- a/drivers/clocksource/moxart_timer.c
+++ b/drivers/clocksource/moxart_timer.c
@@ -21,6 +21,7 @@
#include <linux/io.h>
#include <linux/clocksource.h>
#include <linux/bitops.h>
+#include <linux/slab.h>
#define TIMER1_BASE 0x00
#define TIMER2_BASE 0x10
@@ -36,36 +37,51 @@
#define TIMER_INTR_MASK 0x38
/*
- * TIMER_CR flags:
+ * Moxart TIMER_CR flags:
*
- * TIMEREG_CR_*_CLOCK 0: PCLK, 1: EXT1CLK
- * TIMEREG_CR_*_INT overflow interrupt enable bit
+ * MOXART_CR_*_CLOCK 0: PCLK, 1: EXT1CLK
+ * MOXART_CR_*_INT overflow interrupt enable bit
*/
-#define TIMEREG_CR_1_ENABLE BIT(0)
-#define TIMEREG_CR_1_CLOCK BIT(1)
-#define TIMEREG_CR_1_INT BIT(2)
-#define TIMEREG_CR_2_ENABLE BIT(3)
-#define TIMEREG_CR_2_CLOCK BIT(4)
-#define TIMEREG_CR_2_INT BIT(5)
-#define TIMEREG_CR_3_ENABLE BIT(6)
-#define TIMEREG_CR_3_CLOCK BIT(7)
-#define TIMEREG_CR_3_INT BIT(8)
-#define TIMEREG_CR_COUNT_UP BIT(9)
-
-#define TIMER1_ENABLE (TIMEREG_CR_2_ENABLE | TIMEREG_CR_1_ENABLE)
-#define TIMER1_DISABLE (TIMEREG_CR_2_ENABLE)
-
-static void __iomem *base;
-static unsigned int clock_count_per_tick;
+#define MOXART_CR_1_ENABLE BIT(0)
+#define MOXART_CR_1_CLOCK BIT(1)
+#define MOXART_CR_1_INT BIT(2)
+#define MOXART_CR_2_ENABLE BIT(3)
+#define MOXART_CR_2_CLOCK BIT(4)
+#define MOXART_CR_2_INT BIT(5)
+#define MOXART_CR_3_ENABLE BIT(6)
+#define MOXART_CR_3_CLOCK BIT(7)
+#define MOXART_CR_3_INT BIT(8)
+#define MOXART_CR_COUNT_UP BIT(9)
+
+#define MOXART_TIMER1_ENABLE (MOXART_CR_2_ENABLE | MOXART_CR_1_ENABLE)
+#define MOXART_TIMER1_DISABLE (MOXART_CR_2_ENABLE)
+
+struct moxart_timer {
+ void __iomem *base;
+ unsigned int t1_disable_val;
+ unsigned int t1_enable_val;
+ unsigned int count_per_tick;
+ struct clock_event_device clkevt;
+ struct irqaction act;
+};
+
+static inline struct moxart_timer *to_moxart(struct clock_event_device *evt)
+{
+ return container_of(evt, struct moxart_timer, clkevt);
+}
static inline void moxart_disable(struct clock_event_device *evt)
{
- writel(TIMER1_DISABLE, base + TIMER_CR);
+ struct moxart_timer *timer = to_moxart(evt);
+
+ writel(timer->t1_disable_val, timer->base + TIMER_CR);
}
static inline void moxart_enable(struct clock_event_device *evt)
{
- writel(TIMER1_ENABLE, base + TIMER_CR);
+ struct moxart_timer *timer = to_moxart(evt);
+
+ writel(timer->t1_enable_val, timer->base + TIMER_CR);
}
static int moxart_shutdown(struct clock_event_device *evt)
@@ -77,13 +93,17 @@ static int moxart_shutdown(struct clock_event_device *evt)
static int moxart_set_oneshot(struct clock_event_device *evt)
{
moxart_disable(evt);
- writel(~0, base + TIMER1_BASE + REG_LOAD);
+ writel(~0, to_moxart(evt)->base + TIMER1_BASE + REG_LOAD);
return 0;
}
static int moxart_set_periodic(struct clock_event_device *evt)
{
- writel(clock_count_per_tick, base + TIMER1_BASE + REG_LOAD);
+ struct moxart_timer *timer = to_moxart(evt);
+
+ moxart_disable(evt);
+ writel(timer->count_per_tick, timer->base + TIMER1_BASE + REG_LOAD);
+ writel(0, timer->base + TIMER1_BASE + REG_MATCH1);
moxart_enable(evt);
return 0;
}
@@ -91,30 +111,19 @@ static int moxart_set_periodic(struct clock_event_device *evt)
static int moxart_clkevt_next_event(unsigned long cycles,
struct clock_event_device *evt)
{
+ struct moxart_timer *timer = to_moxart(evt);
u32 u;
moxart_disable(evt);
- u = readl(base + TIMER1_BASE + REG_COUNT) - cycles;
- writel(u, base + TIMER1_BASE + REG_MATCH1);
+ u = readl(timer->base + TIMER1_BASE + REG_COUNT) - cycles;
+ writel(u, timer->base + TIMER1_BASE + REG_MATCH1);
moxart_enable(evt);
return 0;
}
-static struct clock_event_device moxart_clockevent = {
- .name = "moxart_timer",
- .rating = 200,
- .features = CLOCK_EVT_FEAT_PERIODIC |
- CLOCK_EVT_FEAT_ONESHOT,
- .set_state_shutdown = moxart_shutdown,
- .set_state_periodic = moxart_set_periodic,
- .set_state_oneshot = moxart_set_oneshot,
- .tick_resume = moxart_set_oneshot,
- .set_next_event = moxart_clkevt_next_event,
-};
-
static irqreturn_t moxart_timer_interrupt(int irq, void *dev_id)
{
struct clock_event_device *evt = dev_id;
@@ -122,21 +131,19 @@ static irqreturn_t moxart_timer_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
-static struct irqaction moxart_timer_irq = {
- .name = "moxart-timer",
- .flags = IRQF_TIMER,
- .handler = moxart_timer_interrupt,
- .dev_id = &moxart_clockevent,
-};
-
static int __init moxart_timer_init(struct device_node *node)
{
int ret, irq;
unsigned long pclk;
struct clk *clk;
+ struct moxart_timer *timer;
- base = of_iomap(node, 0);
- if (!base) {
+ timer = kzalloc(sizeof(*timer), GFP_KERNEL);
+ if (!timer)
+ return -ENOMEM;
+
+ timer->base = of_iomap(node, 0);
+ if (!timer->base) {
pr_err("%s: of_iomap failed\n", node->full_name);
return -ENXIO;
}
@@ -147,12 +154,6 @@ static int __init moxart_timer_init(struct device_node *node)
return -EINVAL;
}
- ret = setup_irq(irq, &moxart_timer_irq);
- if (ret) {
- pr_err("%s: setup_irq failed\n", node->full_name);
- return ret;
- }
-
clk = of_clk_get(node, 0);
if (IS_ERR(clk)) {
pr_err("%s: of_clk_get failed\n", node->full_name);
@@ -161,7 +162,31 @@ static int __init moxart_timer_init(struct device_node *node)
pclk = clk_get_rate(clk);
- ret = clocksource_mmio_init(base + TIMER2_BASE + REG_COUNT,
+ if (of_device_is_compatible(node, "moxa,moxart-timer")) {
+ timer->t1_enable_val = MOXART_TIMER1_ENABLE;
+ timer->t1_disable_val = MOXART_TIMER1_DISABLE;
+ } else
+ panic("%s: unknown platform\n", node->full_name);
+
+ timer->count_per_tick = DIV_ROUND_CLOSEST(pclk, HZ);
+
+ timer->clkevt.name = node->name;
+ timer->clkevt.rating = 200;
+ timer->clkevt.features = CLOCK_EVT_FEAT_PERIODIC |
+ CLOCK_EVT_FEAT_ONESHOT;
+ timer->clkevt.set_state_shutdown = moxart_shutdown;
+ timer->clkevt.set_state_periodic = moxart_set_periodic;
+ timer->clkevt.set_state_oneshot = moxart_set_oneshot;
+ timer->clkevt.tick_resume = moxart_set_oneshot;
+ timer->clkevt.set_next_event = moxart_clkevt_next_event;
+ timer->clkevt.cpumask = cpumask_of(0);
+ timer->clkevt.irq = irq;
+ timer->act.name = node->name;
+ timer->act.flags = IRQF_TIMER;
+ timer->act.handler = moxart_timer_interrupt;
+ timer->act.dev_id = &timer->clkevt;
+
+ ret = clocksource_mmio_init(timer->base + TIMER2_BASE + REG_COUNT,
"moxart_timer", pclk, 200, 32,
clocksource_mmio_readl_down);
if (ret) {
@@ -169,13 +194,14 @@ static int __init moxart_timer_init(struct device_node *node)
return ret;
}
- clock_count_per_tick = DIV_ROUND_CLOSEST(pclk, HZ);
-
- writel(~0, base + TIMER2_BASE + REG_LOAD);
- writel(TIMEREG_CR_2_ENABLE, base + TIMER_CR);
+ ret = setup_irq(irq, &timer->act);
+ if (ret) {
+ pr_err("%s: setup_irq failed\n", node->full_name);
+ return ret;
+ }
- moxart_clockevent.cpumask = cpumask_of(0);
- moxart_clockevent.irq = irq;
+ writel(~0, timer->base + TIMER2_BASE + REG_LOAD);
+ writel(timer->t1_disable_val, timer->base + TIMER_CR);
/*
* documentation is not publicly available:
@@ -183,8 +209,7 @@ static int __init moxart_timer_init(struct device_node *node)
* max_delta 0xfffffffe should be ok because count
* register size is u32
*/
- clockevents_config_and_register(&moxart_clockevent, pclk,
- 0x4, 0xfffffffe);
+ clockevents_config_and_register(&timer->clkevt, pclk, 0x4, 0xfffffffe);
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/9] clocksource/drivers/moxart: Add Aspeed support
@ 2016-09-12 9:15 ` Daniel Lezcano
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx
Cc: mingo, linux-kernel, Joel Stanley, Rob Herring, Rob Herring,
Mark Rutland,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
From: Joel Stanley <joel@jms.id.au>
The Aspeed SoC has timer IP with a very similar register layout to the
moxart timer. This patch adds support for the fourth and fifth gen
aspeed SoCs, and has been tested on the ast2400 and ast2500.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
.../bindings/timer/moxa,moxart-timer.txt | 4 ++-
drivers/clocksource/moxart_timer.c | 32 ++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt b/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
index da2d510..e207c11 100644
--- a/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
+++ b/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
@@ -2,7 +2,9 @@ MOXA ART timer
Required properties:
-- compatible : Must be "moxa,moxart-timer"
+- compatible : Must be one of:
+ - "moxa,moxart-timer"
+ - "aspeed,ast2400-timer"
- reg : Should contain registers location and length
- interrupts : Should contain the timer interrupt number
- clocks : Should contain phandle for the clock that drives the counter
diff --git a/drivers/clocksource/moxart_timer.c b/drivers/clocksource/moxart_timer.c
index cb0b347..ad2bead9 100644
--- a/drivers/clocksource/moxart_timer.c
+++ b/drivers/clocksource/moxart_timer.c
@@ -56,6 +56,23 @@
#define MOXART_TIMER1_ENABLE (MOXART_CR_2_ENABLE | MOXART_CR_1_ENABLE)
#define MOXART_TIMER1_DISABLE (MOXART_CR_2_ENABLE)
+/*
+ * The ASpeed variant of the IP block has a different layout
+ * for the control register
+ */
+#define ASPEED_CR_1_ENABLE BIT(0)
+#define ASPEED_CR_1_CLOCK BIT(1)
+#define ASPEED_CR_1_INT BIT(2)
+#define ASPEED_CR_2_ENABLE BIT(4)
+#define ASPEED_CR_2_CLOCK BIT(5)
+#define ASPEED_CR_2_INT BIT(6)
+#define ASPEED_CR_3_ENABLE BIT(8)
+#define ASPEED_CR_3_CLOCK BIT(9)
+#define ASPEED_CR_3_INT BIT(10)
+
+#define ASPEED_TIMER1_ENABLE (ASPEED_CR_2_ENABLE | ASPEED_CR_1_ENABLE)
+#define ASPEED_TIMER1_DISABLE (ASPEED_CR_2_ENABLE)
+
struct moxart_timer {
void __iomem *base;
unsigned int t1_disable_val;
@@ -165,6 +182,9 @@ static int __init moxart_timer_init(struct device_node *node)
if (of_device_is_compatible(node, "moxa,moxart-timer")) {
timer->t1_enable_val = MOXART_TIMER1_ENABLE;
timer->t1_disable_val = MOXART_TIMER1_DISABLE;
+ } else if (of_device_is_compatible(node, "aspeed,ast2400-timer")) {
+ timer->t1_enable_val = ASPEED_TIMER1_ENABLE;
+ timer->t1_disable_val = ASPEED_TIMER1_DISABLE;
} else
panic("%s: unknown platform\n", node->full_name);
@@ -200,6 +220,17 @@ static int __init moxart_timer_init(struct device_node *node)
return ret;
}
+ /* Clear match registers */
+ writel(0, timer->base + TIMER1_BASE + REG_MATCH1);
+ writel(0, timer->base + TIMER1_BASE + REG_MATCH2);
+ writel(0, timer->base + TIMER2_BASE + REG_MATCH1);
+ writel(0, timer->base + TIMER2_BASE + REG_MATCH2);
+
+ /*
+ * Start timer 2 rolling as our main wall clock source, keep timer 1
+ * disabled
+ */
+ writel(0, timer->base + TIMER_CR);
writel(~0, timer->base + TIMER2_BASE + REG_LOAD);
writel(timer->t1_disable_val, timer->base + TIMER_CR);
@@ -214,3 +245,4 @@ static int __init moxart_timer_init(struct device_node *node)
return 0;
}
CLOCKSOURCE_OF_DECLARE(moxart, "moxa,moxart-timer", moxart_timer_init);
+CLOCKSOURCE_OF_DECLARE(aspeed, "aspeed,ast2400-timer", moxart_timer_init);
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/9] clocksource/drivers/moxart: Add Aspeed support
@ 2016-09-12 9:15 ` Daniel Lezcano
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx-hfZtesqFncYOwBW4kG4KsQ
Cc: mingo-DgEjT+Ai2ygdnm+yROfE0A,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Joel Stanley, Rob Herring,
Rob Herring, Mark Rutland,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
From: Joel Stanley <joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>
The Aspeed SoC has timer IP with a very similar register layout to the
moxart timer. This patch adds support for the fourth and fifth gen
aspeed SoCs, and has been tested on the ast2400 and ast2500.
Signed-off-by: Joel Stanley <joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
.../bindings/timer/moxa,moxart-timer.txt | 4 ++-
drivers/clocksource/moxart_timer.c | 32 ++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt b/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
index da2d510..e207c11 100644
--- a/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
+++ b/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
@@ -2,7 +2,9 @@ MOXA ART timer
Required properties:
-- compatible : Must be "moxa,moxart-timer"
+- compatible : Must be one of:
+ - "moxa,moxart-timer"
+ - "aspeed,ast2400-timer"
- reg : Should contain registers location and length
- interrupts : Should contain the timer interrupt number
- clocks : Should contain phandle for the clock that drives the counter
diff --git a/drivers/clocksource/moxart_timer.c b/drivers/clocksource/moxart_timer.c
index cb0b347..ad2bead9 100644
--- a/drivers/clocksource/moxart_timer.c
+++ b/drivers/clocksource/moxart_timer.c
@@ -56,6 +56,23 @@
#define MOXART_TIMER1_ENABLE (MOXART_CR_2_ENABLE | MOXART_CR_1_ENABLE)
#define MOXART_TIMER1_DISABLE (MOXART_CR_2_ENABLE)
+/*
+ * The ASpeed variant of the IP block has a different layout
+ * for the control register
+ */
+#define ASPEED_CR_1_ENABLE BIT(0)
+#define ASPEED_CR_1_CLOCK BIT(1)
+#define ASPEED_CR_1_INT BIT(2)
+#define ASPEED_CR_2_ENABLE BIT(4)
+#define ASPEED_CR_2_CLOCK BIT(5)
+#define ASPEED_CR_2_INT BIT(6)
+#define ASPEED_CR_3_ENABLE BIT(8)
+#define ASPEED_CR_3_CLOCK BIT(9)
+#define ASPEED_CR_3_INT BIT(10)
+
+#define ASPEED_TIMER1_ENABLE (ASPEED_CR_2_ENABLE | ASPEED_CR_1_ENABLE)
+#define ASPEED_TIMER1_DISABLE (ASPEED_CR_2_ENABLE)
+
struct moxart_timer {
void __iomem *base;
unsigned int t1_disable_val;
@@ -165,6 +182,9 @@ static int __init moxart_timer_init(struct device_node *node)
if (of_device_is_compatible(node, "moxa,moxart-timer")) {
timer->t1_enable_val = MOXART_TIMER1_ENABLE;
timer->t1_disable_val = MOXART_TIMER1_DISABLE;
+ } else if (of_device_is_compatible(node, "aspeed,ast2400-timer")) {
+ timer->t1_enable_val = ASPEED_TIMER1_ENABLE;
+ timer->t1_disable_val = ASPEED_TIMER1_DISABLE;
} else
panic("%s: unknown platform\n", node->full_name);
@@ -200,6 +220,17 @@ static int __init moxart_timer_init(struct device_node *node)
return ret;
}
+ /* Clear match registers */
+ writel(0, timer->base + TIMER1_BASE + REG_MATCH1);
+ writel(0, timer->base + TIMER1_BASE + REG_MATCH2);
+ writel(0, timer->base + TIMER2_BASE + REG_MATCH1);
+ writel(0, timer->base + TIMER2_BASE + REG_MATCH2);
+
+ /*
+ * Start timer 2 rolling as our main wall clock source, keep timer 1
+ * disabled
+ */
+ writel(0, timer->base + TIMER_CR);
writel(~0, timer->base + TIMER2_BASE + REG_LOAD);
writel(timer->t1_disable_val, timer->base + TIMER_CR);
@@ -214,3 +245,4 @@ static int __init moxart_timer_init(struct device_node *node)
return 0;
}
CLOCKSOURCE_OF_DECLARE(moxart, "moxa,moxart-timer", moxart_timer_init);
+CLOCKSOURCE_OF_DECLARE(aspeed, "aspeed,ast2400-timer", moxart_timer_init);
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/9] clocksource/drivers/moxart: Replace setup_irq by request_irq
2016-09-12 9:15 ` [PATCH 1/9] clocksource/drivers/moxart: Refactor enable/disable Daniel Lezcano
2016-09-12 9:15 ` [PATCH 2/9] clocksource/drivers/moxart: Use struct to hold state Daniel Lezcano
2016-09-12 9:15 ` Daniel Lezcano
@ 2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` [PATCH 5/9] clocksource/drivers/moxart: Replace panic by pr_err Daniel Lezcano
` (4 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx; +Cc: mingo, linux-kernel, Joel Stanley
Save memory space and line of code by replacing setup_irq by request_irq.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Joel Stanley <joel@jms.id.au>
---
drivers/clocksource/moxart_timer.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/clocksource/moxart_timer.c b/drivers/clocksource/moxart_timer.c
index ad2bead9..cba25b7 100644
--- a/drivers/clocksource/moxart_timer.c
+++ b/drivers/clocksource/moxart_timer.c
@@ -79,7 +79,6 @@ struct moxart_timer {
unsigned int t1_enable_val;
unsigned int count_per_tick;
struct clock_event_device clkevt;
- struct irqaction act;
};
static inline struct moxart_timer *to_moxart(struct clock_event_device *evt)
@@ -201,10 +200,6 @@ static int __init moxart_timer_init(struct device_node *node)
timer->clkevt.set_next_event = moxart_clkevt_next_event;
timer->clkevt.cpumask = cpumask_of(0);
timer->clkevt.irq = irq;
- timer->act.name = node->name;
- timer->act.flags = IRQF_TIMER;
- timer->act.handler = moxart_timer_interrupt;
- timer->act.dev_id = &timer->clkevt;
ret = clocksource_mmio_init(timer->base + TIMER2_BASE + REG_COUNT,
"moxart_timer", pclk, 200, 32,
@@ -214,7 +209,8 @@ static int __init moxart_timer_init(struct device_node *node)
return ret;
}
- ret = setup_irq(irq, &timer->act);
+ ret = request_irq(irq, moxart_timer_interrupt, IRQF_TIMER,
+ node->name, &timer->clkevt);
if (ret) {
pr_err("%s: setup_irq failed\n", node->full_name);
return ret;
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 5/9] clocksource/drivers/moxart: Replace panic by pr_err
2016-09-12 9:15 ` [PATCH 1/9] clocksource/drivers/moxart: Refactor enable/disable Daniel Lezcano
` (2 preceding siblings ...)
2016-09-12 9:15 ` [PATCH 4/9] clocksource/drivers/moxart: Replace setup_irq by request_irq Daniel Lezcano
@ 2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` [PATCH 6/9] clocksource/drivers/timer-atmel-pit: Drop at91sam926x_pit_common_init Daniel Lezcano
` (3 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx; +Cc: mingo, linux-kernel, Joel Stanley
The clksrc-of code is supposed to catch the return code and fail gracefully.
Don't panic on error, but print the error and exit with a relevant error
code.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Joel Stanley <joel@jms.id.au>
---
drivers/clocksource/moxart_timer.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/moxart_timer.c b/drivers/clocksource/moxart_timer.c
index cba25b7..2a8f470 100644
--- a/drivers/clocksource/moxart_timer.c
+++ b/drivers/clocksource/moxart_timer.c
@@ -184,8 +184,10 @@ static int __init moxart_timer_init(struct device_node *node)
} else if (of_device_is_compatible(node, "aspeed,ast2400-timer")) {
timer->t1_enable_val = ASPEED_TIMER1_ENABLE;
timer->t1_disable_val = ASPEED_TIMER1_DISABLE;
- } else
- panic("%s: unknown platform\n", node->full_name);
+ } else {
+ pr_err("%s: unknown platform\n", node->full_name);
+ return -EINVAL;
+ }
timer->count_per_tick = DIV_ROUND_CLOSEST(pclk, HZ);
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 6/9] clocksource/drivers/timer-atmel-pit: Drop at91sam926x_pit_common_init
2016-09-12 9:15 ` [PATCH 1/9] clocksource/drivers/moxart: Refactor enable/disable Daniel Lezcano
` (3 preceding siblings ...)
2016-09-12 9:15 ` [PATCH 5/9] clocksource/drivers/moxart: Replace panic by pr_err Daniel Lezcano
@ 2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` [PATCH 7/9] clocksource/drivers/timer-atmel-pit: Remove uselesss WARN_ON_ONCE Daniel Lezcano
` (2 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx; +Cc: mingo, linux-kernel, Alexandre Belloni, Nicolas Ferre
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Merge at91sam926x_pit_common_init in at91sam926x_pit_dt_init as this is the
only initialization method now.
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/timer-atmel-pit.c | 79 +++++++++++++++--------------------
1 file changed, 34 insertions(+), 45 deletions(-)
diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c
index 7f0f5b2..da7e6d4 100644
--- a/drivers/clocksource/timer-atmel-pit.c
+++ b/drivers/clocksource/timer-atmel-pit.c
@@ -177,11 +177,41 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
/*
* Set up both clocksource and clockevent support.
*/
-static int __init at91sam926x_pit_common_init(struct pit_data *data)
+static int __init at91sam926x_pit_dt_init(struct device_node *node)
{
- unsigned long pit_rate;
- unsigned bits;
- int ret;
+ unsigned long pit_rate;
+ unsigned bits;
+ int ret;
+ struct pit_data *data;
+
+ data = kzalloc(sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->base = of_iomap(node, 0);
+ if (!data->base) {
+ pr_err("Could not map PIT address\n");
+ return -ENXIO;
+ }
+
+ data->mck = of_clk_get(node, 0);
+ if (IS_ERR(data->mck)) {
+ pr_err("Unable to get mck clk\n");
+ return PTR_ERR(data->mck);
+ }
+
+ ret = clk_prepare_enable(data->mck);
+ if (ret) {
+ pr_err("Unable to enable mck\n");
+ return ret;
+ }
+
+ /* Get the interrupts property */
+ data->irq = irq_of_parse_and_map(node, 0);
+ if (!data->irq) {
+ pr_err("Unable to get IRQ from DT\n");
+ return -EINVAL;
+ }
/*
* Use our actual MCK to figure out how many MCK/16 ticks per
@@ -236,46 +266,5 @@ static int __init at91sam926x_pit_common_init(struct pit_data *data)
return 0;
}
-
-static int __init at91sam926x_pit_dt_init(struct device_node *node)
-{
- struct pit_data *data;
- int ret;
-
- data = kzalloc(sizeof(*data), GFP_KERNEL);
- if (!data)
- return -ENOMEM;
-
- data->base = of_iomap(node, 0);
- if (!data->base) {
- pr_err("Could not map PIT address\n");
- return -ENXIO;
- }
-
- data->mck = of_clk_get(node, 0);
- if (IS_ERR(data->mck))
- /* Fallback on clkdev for !CCF-based boards */
- data->mck = clk_get(NULL, "mck");
-
- if (IS_ERR(data->mck)) {
- pr_err("Unable to get mck clk\n");
- return PTR_ERR(data->mck);
- }
-
- ret = clk_prepare_enable(data->mck);
- if (ret) {
- pr_err("Unable to enable mck\n");
- return ret;
- }
-
- /* Get the interrupts property */
- data->irq = irq_of_parse_and_map(node, 0);
- if (!data->irq) {
- pr_err("Unable to get IRQ from DT\n");
- return -EINVAL;
- }
-
- return at91sam926x_pit_common_init(data);
-}
CLOCKSOURCE_OF_DECLARE(at91sam926x_pit, "atmel,at91sam9260-pit",
at91sam926x_pit_dt_init);
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 7/9] clocksource/drivers/timer-atmel-pit: Remove uselesss WARN_ON_ONCE
2016-09-12 9:15 ` [PATCH 1/9] clocksource/drivers/moxart: Refactor enable/disable Daniel Lezcano
` (4 preceding siblings ...)
2016-09-12 9:15 ` [PATCH 6/9] clocksource/drivers/timer-atmel-pit: Drop at91sam926x_pit_common_init Daniel Lezcano
@ 2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` [PATCH 8/9] clocksource/drivers/timer-atmel-pit: Simplify IRQ handler Daniel Lezcano
2016-09-12 9:15 ` Daniel Lezcano
7 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx; +Cc: mingo, linux-kernel, Alexandre Belloni, Nicolas Ferre
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
IRQ handlers are running with IRQ disabled for a while, remove wrong
comment and useless test.
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/timer-atmel-pit.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c
index da7e6d4..91cf047 100644
--- a/drivers/clocksource/timer-atmel-pit.c
+++ b/drivers/clocksource/timer-atmel-pit.c
@@ -149,12 +149,6 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
{
struct pit_data *data = dev_id;
- /*
- * irqs should be disabled here, but as the irq is shared they are only
- * guaranteed to be off if the timer irq is registered first.
- */
- WARN_ON_ONCE(!irqs_disabled());
-
/* The PIT interrupt may be disabled, and is shared */
if (clockevent_state_periodic(&data->clkevt) &&
(pit_read(data->base, AT91_PIT_SR) & AT91_PIT_PITS)) {
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 8/9] clocksource/drivers/timer-atmel-pit: Simplify IRQ handler
2016-09-12 9:15 ` [PATCH 1/9] clocksource/drivers/moxart: Refactor enable/disable Daniel Lezcano
` (5 preceding siblings ...)
2016-09-12 9:15 ` [PATCH 7/9] clocksource/drivers/timer-atmel-pit: Remove uselesss WARN_ON_ONCE Daniel Lezcano
@ 2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` Daniel Lezcano
7 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx; +Cc: mingo, linux-kernel, Alexandre Belloni, Nicolas Ferre
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Because the PIT is also a proper clocksource, the timekeeping code is
already able to handle lost ticks.
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/timer-atmel-pit.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c
index 91cf047..6555821 100644
--- a/drivers/clocksource/timer-atmel-pit.c
+++ b/drivers/clocksource/timer-atmel-pit.c
@@ -152,15 +152,10 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
/* The PIT interrupt may be disabled, and is shared */
if (clockevent_state_periodic(&data->clkevt) &&
(pit_read(data->base, AT91_PIT_SR) & AT91_PIT_PITS)) {
- unsigned nr_ticks;
-
/* Get number of ticks performed before irq, and ack it */
- nr_ticks = PIT_PICNT(pit_read(data->base, AT91_PIT_PIVR));
- do {
- data->cnt += data->cycle;
- data->clkevt.event_handler(&data->clkevt);
- nr_ticks--;
- } while (nr_ticks);
+ data->cnt += data->cycle * PIT_PICNT(pit_read(data->base,
+ AT91_PIT_PIVR));
+ data->clkevt.event_handler(&data->clkevt);
return IRQ_HANDLED;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 9/9] clocksource/drivers/oxnas: Add OX820 compatible
2016-09-12 9:15 ` [PATCH 1/9] clocksource/drivers/moxart: Refactor enable/disable Daniel Lezcano
2016-09-12 9:15 ` [PATCH 2/9] clocksource/drivers/moxart: Use struct to hold state Daniel Lezcano
@ 2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` [PATCH 4/9] clocksource/drivers/moxart: Replace setup_irq by request_irq Daniel Lezcano
` (5 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx
Cc: mingo, linux-kernel, Neil Armstrong, Rob Herring, Mark Rutland,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
moderated list:ARM/OXNAS platform support
From: Neil Armstrong <narmstrong@baylibre.com>
In order to support the Oxford Semiconductor OX820 SoC, add new
compatible string to rps timer driver.
Also add new string in the dt-bindings.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt | 2 +-
drivers/clocksource/timer-oxnas-rps.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt b/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
index 3ca89cd..d191612 100644
--- a/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
+++ b/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
@@ -2,7 +2,7 @@ Oxford Semiconductor OXNAS SoCs Family RPS Timer
================================================
Required properties:
-- compatible: Should be "oxsemi,ox810se-rps-timer"
+- compatible: Should be "oxsemi,ox810se-rps-timer" or "oxsemi,ox820-rps-timer"
- reg : Specifies base physical address and size of the registers.
- interrupts : The interrupts of the two timers
- clocks : The phandle of the timer clock source
diff --git a/drivers/clocksource/timer-oxnas-rps.c b/drivers/clocksource/timer-oxnas-rps.c
index bd887e2..d630bf4 100644
--- a/drivers/clocksource/timer-oxnas-rps.c
+++ b/drivers/clocksource/timer-oxnas-rps.c
@@ -295,3 +295,5 @@ err_alloc:
CLOCKSOURCE_OF_DECLARE(ox810se_rps,
"oxsemi,ox810se-rps-timer", oxnas_rps_timer_init);
+CLOCKSOURCE_OF_DECLARE(ox820_rps,
+ "oxsemi,ox820se-rps-timer", oxnas_rps_timer_init);
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 9/9] clocksource/drivers/oxnas: Add OX820 compatible
@ 2016-09-12 9:15 ` Daniel Lezcano
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: tglx
Cc: mingo, linux-kernel, Neil Armstrong, Rob Herring, Mark Rutland,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
moderated list:ARM/OXNAS platform support
From: Neil Armstrong <narmstrong@baylibre.com>
In order to support the Oxford Semiconductor OX820 SoC, add new
compatible string to rps timer driver.
Also add new string in the dt-bindings.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt | 2 +-
drivers/clocksource/timer-oxnas-rps.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt b/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
index 3ca89cd..d191612 100644
--- a/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
+++ b/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
@@ -2,7 +2,7 @@ Oxford Semiconductor OXNAS SoCs Family RPS Timer
================================================
Required properties:
-- compatible: Should be "oxsemi,ox810se-rps-timer"
+- compatible: Should be "oxsemi,ox810se-rps-timer" or "oxsemi,ox820-rps-timer"
- reg : Specifies base physical address and size of the registers.
- interrupts : The interrupts of the two timers
- clocks : The phandle of the timer clock source
diff --git a/drivers/clocksource/timer-oxnas-rps.c b/drivers/clocksource/timer-oxnas-rps.c
index bd887e2..d630bf4 100644
--- a/drivers/clocksource/timer-oxnas-rps.c
+++ b/drivers/clocksource/timer-oxnas-rps.c
@@ -295,3 +295,5 @@ err_alloc:
CLOCKSOURCE_OF_DECLARE(ox810se_rps,
"oxsemi,ox810se-rps-timer", oxnas_rps_timer_init);
+CLOCKSOURCE_OF_DECLARE(ox820_rps,
+ "oxsemi,ox820se-rps-timer", oxnas_rps_timer_init);
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 9/9] clocksource/drivers/oxnas: Add OX820 compatible
@ 2016-09-12 9:15 ` Daniel Lezcano
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Lezcano @ 2016-09-12 9:15 UTC (permalink / raw)
To: linux-arm-kernel
From: Neil Armstrong <narmstrong@baylibre.com>
In order to support the Oxford Semiconductor OX820 SoC, add new
compatible string to rps timer driver.
Also add new string in the dt-bindings.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt | 2 +-
drivers/clocksource/timer-oxnas-rps.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt b/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
index 3ca89cd..d191612 100644
--- a/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
+++ b/Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
@@ -2,7 +2,7 @@ Oxford Semiconductor OXNAS SoCs Family RPS Timer
================================================
Required properties:
-- compatible: Should be "oxsemi,ox810se-rps-timer"
+- compatible: Should be "oxsemi,ox810se-rps-timer" or "oxsemi,ox820-rps-timer"
- reg : Specifies base physical address and size of the registers.
- interrupts : The interrupts of the two timers
- clocks : The phandle of the timer clock source
diff --git a/drivers/clocksource/timer-oxnas-rps.c b/drivers/clocksource/timer-oxnas-rps.c
index bd887e2..d630bf4 100644
--- a/drivers/clocksource/timer-oxnas-rps.c
+++ b/drivers/clocksource/timer-oxnas-rps.c
@@ -295,3 +295,5 @@ err_alloc:
CLOCKSOURCE_OF_DECLARE(ox810se_rps,
"oxsemi,ox810se-rps-timer", oxnas_rps_timer_init);
+CLOCKSOURCE_OF_DECLARE(ox820_rps,
+ "oxsemi,ox820se-rps-timer", oxnas_rps_timer_init);
--
2.7.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2016-09-12 9:18 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 9:10 [PULL] clockevents for 4.9 Daniel Lezcano
2016-09-12 9:10 ` Daniel Lezcano
2016-09-12 9:15 ` [PATCH 1/9] clocksource/drivers/moxart: Refactor enable/disable Daniel Lezcano
2016-09-12 9:15 ` [PATCH 2/9] clocksource/drivers/moxart: Use struct to hold state Daniel Lezcano
2016-09-12 9:15 ` [PATCH 3/9] clocksource/drivers/moxart: Add Aspeed support Daniel Lezcano
2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` [PATCH 4/9] clocksource/drivers/moxart: Replace setup_irq by request_irq Daniel Lezcano
2016-09-12 9:15 ` [PATCH 5/9] clocksource/drivers/moxart: Replace panic by pr_err Daniel Lezcano
2016-09-12 9:15 ` [PATCH 6/9] clocksource/drivers/timer-atmel-pit: Drop at91sam926x_pit_common_init Daniel Lezcano
2016-09-12 9:15 ` [PATCH 7/9] clocksource/drivers/timer-atmel-pit: Remove uselesss WARN_ON_ONCE Daniel Lezcano
2016-09-12 9:15 ` [PATCH 8/9] clocksource/drivers/timer-atmel-pit: Simplify IRQ handler Daniel Lezcano
2016-09-12 9:15 ` [PATCH 9/9] clocksource/drivers/oxnas: Add OX820 compatible Daniel Lezcano
2016-09-12 9:15 ` Daniel Lezcano
2016-09-12 9:15 ` Daniel Lezcano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.