Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4ae54f9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull timer code update from Thomas Gleixner:
 - armada SoC clocksource overhaul with a trivial merge conflict
 - Minor improvements to various SoC clocksource drivers

* 'timers/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource: armada-370-xp: Add detailed clock requirements in devicetree binding
  clocksource: armada-370-xp: Get reference fixed-clock by name
  clocksource: armada-370-xp: Replace WARN_ON with BUG_ON
  clocksource: armada-370-xp: Fix device-tree binding
  clocksource: armada-370-xp: Introduce new compatibles
  clocksource: armada-370-xp: Use CLOCKSOURCE_OF_DECLARE
  clocksource: armada-370-xp: Simplify TIMER_CTRL register access
  clocksource: armada-370-xp: Use BIT()
  ARM: timer-sp: Set dynamic irq affinity
  ARM: nomadik: add dynamic irq flag to the timer
  clocksource: sh_cmt: 32-bit control register support
  clocksource: em_sti: Convert to devm_* managed helpers
parents 3369d116 63ce2cc4
Loading
Loading
Loading
Loading
+31 −5
Original line number Diff line number Diff line
@@ -2,14 +2,40 @@ Marvell Armada 370 and Armada XP Timers
---------------------------------------

Required properties:
- compatible: Should be "marvell,armada-370-xp-timer"
- compatible: Should be either "marvell,armada-370-timer" or
  "marvell,armada-xp-timer" as appropriate.
- interrupts: Should contain the list of Global Timer interrupts and
  then local timer interrupts
- reg: Should contain location and length for timers register. First
  pair for the Global Timer registers, second pair for the
  local/private timers.
- clocks: clock driving the timer hardware

Optional properties:
- marvell,timer-25Mhz: Tells whether the Global timer supports the 25
  Mhz fixed mode (available on Armada XP and not on Armada 370)
Clocks required for compatible = "marvell,armada-370-timer":
- clocks : Must contain a single entry describing the clock input

Clocks required for compatible = "marvell,armada-xp-timer":
- clocks : Must contain an entry for each entry in clock-names.
- clock-names : Must include the following entries:
  "nbclk" (L2/coherency fabric clock),
  "fixed" (Reference 25 MHz fixed-clock).

Examples:

- Armada 370:

	timer {
		compatible = "marvell,armada-370-timer";
		reg = <0x20300 0x30>, <0x21040 0x30>;
		interrupts = <37>, <38>, <39>, <40>, <5>, <6>;
		clocks = <&coreclk 2>;
	};

- Armada XP:

	timer {
		compatible = "marvell,armada-xp-timer";
		reg = <0x20300 0x30>, <0x21040 0x30>;
		interrupts = <37>, <38>, <39>, <40>, <5>, <6>;
		clocks = <&coreclk 2>, <&refclk>;
		clock-names = "nbclk", "fixed";
	};
+2 −1
Original line number Diff line number Diff line
@@ -166,7 +166,8 @@ static int sp804_set_next_event(unsigned long next,
}

static struct clock_event_device sp804_clockevent = {
	.features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
	.features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
		CLOCK_EVT_FEAT_DYNIRQ,
	.set_mode	= sp804_set_mode,
	.set_next_event	= sp804_set_next_event,
	.rating		= 300,
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/io.h>
#include <linux/time-armada-370-xp.h>
#include <linux/clocksource.h>
#include <linux/dma-mapping.h>
#include <linux/mbus.h>
#include <asm/hardware/cache-l2x0.h>
@@ -37,7 +37,7 @@ static void __init armada_370_xp_map_io(void)
static void __init armada_370_xp_timer_and_clk_init(void)
{
	of_clk_init(NULL);
	armada_370_xp_timer_init();
	clocksource_of_init();
	coherency_init();
	BUG_ON(mvebu_mbus_dt_init());
#ifdef CONFIG_CACHE_L2X0
+14 −35
Original line number Diff line number Diff line
@@ -315,68 +315,47 @@ static int em_sti_probe(struct platform_device *pdev)
{
	struct em_sti_priv *p;
	struct resource *res;
	int irq, ret;
	int irq;

	p = kzalloc(sizeof(*p), GFP_KERNEL);
	p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
	if (p == NULL) {
		dev_err(&pdev->dev, "failed to allocate driver data\n");
		ret = -ENOMEM;
		goto err0;
		return -ENOMEM;
	}

	p->pdev = pdev;
	platform_set_drvdata(pdev, p);

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
		dev_err(&pdev->dev, "failed to get I/O memory\n");
		ret = -EINVAL;
		goto err0;
	}

	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		dev_err(&pdev->dev, "failed to get irq\n");
		ret = -EINVAL;
		goto err0;
		return -EINVAL;
	}

	/* map memory, let base point to the STI instance */
	p->base = ioremap_nocache(res->start, resource_size(res));
	if (p->base == NULL) {
		dev_err(&pdev->dev, "failed to remap I/O memory\n");
		ret = -ENXIO;
		goto err0;
	}
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	p->base = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(p->base))
		return PTR_ERR(p->base);

	/* get hold of clock */
	p->clk = clk_get(&pdev->dev, "sclk");
	p->clk = devm_clk_get(&pdev->dev, "sclk");
	if (IS_ERR(p->clk)) {
		dev_err(&pdev->dev, "cannot get clock\n");
		ret = PTR_ERR(p->clk);
		goto err1;
		return PTR_ERR(p->clk);
	}

	if (request_irq(irq, em_sti_interrupt,
	if (devm_request_irq(&pdev->dev, irq, em_sti_interrupt,
			     IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING,
			     dev_name(&pdev->dev), p)) {
		dev_err(&pdev->dev, "failed to request low IRQ\n");
		ret = -ENOENT;
		goto err2;
		return -ENOENT;
	}

	raw_spin_lock_init(&p->lock);
	em_sti_register_clockevent(p);
	em_sti_register_clocksource(p);
	return 0;

err2:
	clk_put(p->clk);
err1:
	iounmap(p->base);
err0:
	kfree(p);
	return ret;
}

static int em_sti_remove(struct platform_device *pdev)
+2 −1
Original line number Diff line number Diff line
@@ -165,7 +165,8 @@ static void nmdk_clkevt_resume(struct clock_event_device *cedev)

static struct clock_event_device nmdk_clkevt = {
	.name		= "mtu_1",
	.features	= CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
	.features	= CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC |
	                  CLOCK_EVT_FEAT_DYNIRQ,
	.rating		= 200,
	.set_mode	= nmdk_clkevt_mode,
	.set_next_event	= nmdk_clkevt_next,
Loading