Skip to contentSkip to conversation

ARM: OMAP: Clean-up DMTIMER

PATCH New Jon Hunter 4 participants 15 messages Nov 13, 2012 – Nov 15, 2012

Subsystems (7)
lore
Share & tools
lore

Jon Hunter

author
#0 lore raw

cover ARM: OMAP: Clean-up DMTIMER

This series cleans-up the DMTIMER code and moves the DMTIMER header from plat/dmtimer.h to plat-omap/dmtimer.h in preparation for single zImage support.

This series in based upon DMTIMER fixes series [1].

Tested on OMAP5912 OSK, OMAP3430 Beagle and OMAP4430 Panda. Testing includes ...
1. Booting kernel on above boards
2. Checking the timer counter is incrementing when configuring and starting a timer
3. Checking the timer overflow interrupt when timer expires.
4. Using different clock sources to operate the timer with.

This has also been boot tested on the AM335x Beagle Bone.

[1] http://marc.info/?l=linux-omap&m=135275633628412&w=2

Jon Hunter (8):
ARM: OMAP: Clean-up dmtimer reset code
ARM: OMAP: Define omap_dm_timer_prepare function as static
ARM: OMAP: Don't store timers physical address
ARM: OMAP2+: Remove unnecessary local variable in timer code
ARM: OMAP: Remove unnecessary omap_dm_timer structure declaration
ARM: OMAP: Add platform data header for DMTIMERs
ARM: OMAP: Remove unnecessary inclusion of dmtimer.h
ARM: OMAP: Move plat/dmtimer.h to plat-omap/dmtimer.h

 arch/arm/mach-omap1/pm.c                           |    2 +-
 arch/arm/mach-omap1/timer.c                        |    3 +-
 arch/arm/mach-omap1/timer32k.c                     |    1 -
 arch/arm/mach-omap2/omap_hwmod_2420_data.c         |    1 -
 arch/arm/mach-omap2/omap_hwmod_2430_data.c         |    1 -
 arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c |    2 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c         |    2 +-
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c         |    2 +-
 arch/arm/mach-omap2/pm-debug.c                     |    1 -
 arch/arm/mach-omap2/timer.c                        |   28 +-
 arch/arm/plat-omap/dmtimer.c                       |   56 ++-
 arch/arm/plat-omap/include/plat-omap/dmtimer.h     |  420 ++++++++++++++++++
 arch/arm/plat-omap/include/plat/dmtimer.h          |  450 --------------------
 drivers/staging/tidspbridge/core/dsp-clock.c       |    2 +-
 drivers/staging/tidspbridge/core/ue_deh.c          |    1 -
 include/linux/platform_data/dmtimer-omap.h         |   31 ++
 16 files changed, 506 insertions(+), 497 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat-omap/dmtimer.h
 delete mode 100644 arch/arm/plat-omap/include/plat/dmtimer.h
 create mode 100644 include/linux/platform_data/dmtimer-omap.h
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/8 ARM: OMAP: Clean-up dmtimer reset code

Only OMAP1 devices use the omap_dm_timer_reset() and so require the omap_dm_timer_wait_for_reset() and __omap_dm_timer_reset() functions. Therefore combine these into a single function called omap_dm_timer_reset() and simplify the code.

The omap_dm_timer_reset() function is now the only place that is using the omap_dm_timer structure member "sys_stat". Therefore, remove this member and just use the register offset definition to simplify and clean-up the code. The TISTAT register is only present on revision 1 timers and so check for this in the omap_dm_timer_reset() function.

Please note that for OMAP1 devices, the TIOCP_CFG register does not have the clock-activity field and so when we reset the timer for an OMAP1 device we only need to configure the idle-mode field in the TIOCP_CFG register.

---
 arch/arm/plat-omap/dmtimer.c              |   50 ++++++++++++++++++-----------
 arch/arm/plat-omap/include/plat/dmtimer.h |   23 -------------
 2 files changed, 31 insertions(+), 42 deletions(-)
arch/arm/plat-omap/dmtimer.c +31 -19
index 9deeb30..4c28452 100644
@@ -99,32 +99,39 @@ static void omap_timer_restore_context(struct omap_dm_timer *timer)
 				timer->context.tclr);
 }
 
-static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer)
+static int omap_dm_timer_reset(struct omap_dm_timer *timer)
 {
-	int c;
+	u32 l, timeout = 100000;
 
-	if (!timer->sys_stat)
-		return;
+	if (timer->revision != 1)
+		return -EINVAL;
 
-	c = 0;
-	while (!(__raw_readl(timer->sys_stat) & 1)) {
-		c++;
-		if (c > 100000) {
-			printk(KERN_ERR "Timer failed to reset\n");
-			return;
-		}
+	omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06);
+
+	do {
+		l = __omap_dm_timer_read(timer,
+					 OMAP_TIMER_V1_SYS_STAT_OFFSET, 0);
+	} while (!l && timeout--);
+
+	if (!timeout) {
+		dev_err(&timer->pdev->dev, "Timer failed to reset\n");
+		return -ETIMEDOUT;
 	}
-}
 
-static void omap_dm_timer_reset(struct omap_dm_timer *timer)
-{
-	omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06);
-	omap_dm_timer_wait_for_reset(timer);
-	__omap_dm_timer_reset(timer, 0, 0);
+	/* Configure timer for smart-idle mode */
+	l = __omap_dm_timer_read(timer, OMAP_TIMER_OCP_CFG_OFFSET, 0);
+	l |= 0x2 << 0x3;
+	__omap_dm_timer_write(timer, OMAP_TIMER_OCP_CFG_OFFSET, l, 0);
+
+	timer->posted = 0;
+
+	return 0;
 }
 
 int omap_dm_timer_prepare(struct omap_dm_timer *timer)
 {
+	int rc;
+
 	/*
 	 * FIXME: OMAP1 devices do not use the clock framework for dmtimers so
 	 * do not call clk_get() for these devices.
@@ -140,8 +147,13 @@ int omap_dm_timer_prepare(struct omap_dm_timer *timer)
 
 	omap_dm_timer_enable(timer);
 
-	if (timer->capability & OMAP_TIMER_NEEDS_RESET)
-		omap_dm_timer_reset(timer);
+	if (timer->capability & OMAP_TIMER_NEEDS_RESET) {
+		rc = omap_dm_timer_reset(timer);
+		if (rc) {
+			omap_dm_timer_disable(timer);
+			return rc;
+		}
+	}
 
 	__omap_dm_timer_enable_posted(timer);
 	omap_dm_timer_disable(timer);
arch/arm/plat-omap/include/plat/dmtimer.h +0 -23
index 05a36e1..c5c890d 100644
@@ -267,7 +267,6 @@ struct omap_dm_timer {
 	struct clk *fclk;
 
 	void __iomem	*io_base;
-	void __iomem	*sys_stat;	/* TISTAT timer status */
 	void __iomem	*irq_stat;	/* TISR/IRQSTATUS interrupt status */
 	void __iomem	*irq_ena;	/* irq enable */
 	void __iomem	*irq_dis;	/* irq disable, only on v2 ip */
@@ -317,8 +316,6 @@ static inline void __omap_dm_timer_init_regs(struct omap_dm_timer *timer)
 	tidr = __raw_readl(timer->io_base);
 	if (!(tidr >> 16)) {
 		timer->revision = 1;
-		timer->sys_stat = timer->io_base +
-				OMAP_TIMER_V1_SYS_STAT_OFFSET;
 		timer->irq_stat = timer->io_base + OMAP_TIMER_V1_STAT_OFFSET;
 		timer->irq_ena = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
 		timer->irq_dis = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
@@ -326,7 +323,6 @@ static inline void __omap_dm_timer_init_regs(struct omap_dm_timer *timer)
 		timer->func_base = timer->io_base;
 	} else {
 		timer->revision = 2;
-		timer->sys_stat = NULL;
 		timer->irq_stat = timer->io_base + OMAP_TIMER_V2_IRQSTATUS;
 		timer->irq_ena = timer->io_base + OMAP_TIMER_V2_IRQENABLE_SET;
 		timer->irq_dis = timer->io_base + OMAP_TIMER_V2_IRQENABLE_CLR;
@@ -337,25 +333,6 @@ static inline void __omap_dm_timer_init_regs(struct omap_dm_timer *timer)
 	}
 }
 
-/* Assumes the source clock has been set by caller */
-static inline void __omap_dm_timer_reset(struct omap_dm_timer *timer,
-					int autoidle, int wakeup)
-{
-	u32 l;
-
-	l = __raw_readl(timer->io_base + OMAP_TIMER_OCP_CFG_OFFSET);
-	l |= 0x02 << 3;  /* Set to smart-idle mode */
-	l |= 0x2 << 8;   /* Set clock activity to perserve f-clock on idle */
-
-	if (autoidle)
-		l |= 0x1 << 0;
-
-	if (wakeup)
-		l |= 1 << 2;
-
-	__raw_writel(l, timer->io_base + OMAP_TIMER_OCP_CFG_OFFSET);
-}
-
 /*
  * __omap_dm_timer_enable_posted - enables write posted mode
  * @timer:      pointer to timer instance handle
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/8 ARM: OMAP: Define omap_dm_timer_prepare function as static

In reply to Jon Hunter

The omap_dm_timer_prepare function is a local function only used in the dmtimer.c file. Therefore, make this a static function and remove its declaration from the dmtimer.h file.

---
 arch/arm/plat-omap/dmtimer.c              |    2 +-
 arch/arm/plat-omap/include/plat/dmtimer.h |    2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
arch/arm/plat-omap/dmtimer.c +1 -1
index 4c28452..efe4774 100644
@@ -128,7 +128,7 @@ static int omap_dm_timer_reset(struct omap_dm_timer *timer)
 	return 0;
 }
 
-int omap_dm_timer_prepare(struct omap_dm_timer *timer)
+static int omap_dm_timer_prepare(struct omap_dm_timer *timer)
 {
 	int rc;
 
arch/arm/plat-omap/include/plat/dmtimer.h +0 -2
index c5c890d..40383b6 100644
@@ -286,8 +286,6 @@ struct omap_dm_timer {
 	struct list_head node;
 };
 
-int omap_dm_timer_prepare(struct omap_dm_timer *timer);
-
 static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg,
 						int posted)
 {
Signature · 1 line
1.7.9.5
author
#3 lore raw

PATCH 3/8 ARM: OMAP: Don't store timers physical address

In reply to Jon Hunter

The OMAP2+ system timer code stores the physical address of the timer but never uses it. Remove this and clean-up the code by removing the local variable "size" and changing the names of the local variables mem_rsrc and irq_rsrc to mem and irq, respectively.

---
 arch/arm/mach-omap2/timer.c               |   13 +++++--------
 arch/arm/plat-omap/include/plat/dmtimer.h |    1 -
 2 files changed, 5 insertions(+), 9 deletions(-)
arch/arm/mach-omap2/timer.c +5 -8
index 099e406..e9fcc5f 100644
@@ -245,8 +245,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
 	const char *oh_name;
 	struct device_node *np;
 	struct omap_hwmod *oh;
-	struct resource irq_rsrc, mem_rsrc;
-	size_t size;
+	struct resource irq, mem;
 	int res = 0;
 	int r;
 
@@ -280,20 +279,18 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
 
 	if (!of_have_populated_dt()) {
 		r = omap_hwmod_get_resource_byname(oh, IORESOURCE_IRQ, NULL,
-						   &irq_rsrc);
+						   &irq);
 		if (r)
 			return -ENXIO;
-		timer->irq = irq_rsrc.start;
+		timer->irq = irq.start;
 
 		r = omap_hwmod_get_resource_byname(oh, IORESOURCE_MEM, NULL,
-						   &mem_rsrc);
+						   &mem);
 		if (r)
 			return -ENXIO;
-		timer->phys_base = mem_rsrc.start;
-		size = mem_rsrc.end - mem_rsrc.start;
 
 		/* Static mapping, never released */
-		timer->io_base = ioremap(timer->phys_base, size);
+		timer->io_base = ioremap(mem.start, mem.end - mem.start);
 	}
 
 	if (!timer->io_base)
arch/arm/plat-omap/include/plat/dmtimer.h +0 -1
index 40383b6..b60e2b6 100644
@@ -261,7 +261,6 @@ int omap_dm_timers_active(void);
 		(_OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET | (WP_TOWR << WPSHIFT))
 
 struct omap_dm_timer {
-	unsigned long phys_base;
 	int id;
 	int irq;
 	struct clk *fclk;
Signature · 1 line
1.7.9.5
author
#4 lore raw

PATCH 4/8 ARM: OMAP2+: Remove unnecessary local variable in timer code

In reply to Jon Hunter

The function omap_dm_timer_init_one() declares two local variables of type int that are used to store the return value of functions called. One such local variable is sufficient and so remove one of these local variables.

---
 arch/arm/mach-omap2/timer.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/timer.c +5 -6
index e9fcc5f..1a662df 100644
@@ -246,8 +246,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
 	struct device_node *np;
 	struct omap_hwmod *oh;
 	struct resource irq, mem;
-	int res = 0;
-	int r;
+	int r = 0;
 
 	if (of_have_populated_dt()) {
 		np = omap_get_timer_dt(omap_timer_match, NULL);
@@ -307,10 +306,10 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
 
 		src = clk_get(NULL, fck_source);
 		if (IS_ERR(src)) {
-			res = -EINVAL;
+			r = -EINVAL;
 		} else {
-			res = clk_set_parent(timer->fclk, src);
-			if (IS_ERR_VALUE(res))
+			r = clk_set_parent(timer->fclk, src);
+			if (IS_ERR_VALUE(r))
 				pr_warn("%s: %s cannot set source\n",
 					__func__, oh->name);
 			clk_put(src);
@@ -331,7 +330,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
 	timer->rate = clk_get_rate(timer->fclk);
 	timer->reserved = 1;
 
-	return res;
+	return r;
 }
 
 static void __init omap2_gp_clockevent_init(int gptimer_id,
Signature · 1 line
1.7.9.5
author
#5 lore raw

PATCH 5/8 ARM: OMAP: Remove unnecessary omap_dm_timer structure declaration

In reply to Jon Hunter

Remove unnecessary declaration of structure omap_dm_timer from dmtimer.h and move the actual declaration of structure omap_dm_timer towards top of dmtimer.h to avoid any compilation errors.

---
 arch/arm/plat-omap/include/plat/dmtimer.h |   52 ++++++++++++++---------------
 1 file changed, 25 insertions(+), 27 deletions(-)
arch/arm/plat-omap/include/plat/dmtimer.h +25 -27
index b60e2b6..b3cd91b 100644
@@ -79,8 +79,6 @@ struct omap_timer_capability_dev_attr {
 	u32 timer_capability;
 };
 
-struct omap_dm_timer;
-
 struct timer_regs {
 	u32 tidr;
 	u32 tier;
@@ -101,6 +99,31 @@ struct timer_regs {
 	u32 towr;
 };
 
+struct omap_dm_timer {
+	int id;
+	int irq;
+	struct clk *fclk;
+
+	void __iomem	*io_base;
+	void __iomem	*irq_stat;	/* TISR/IRQSTATUS interrupt status */
+	void __iomem	*irq_ena;	/* irq enable */
+	void __iomem	*irq_dis;	/* irq disable, only on v2 ip */
+	void __iomem	*pend;		/* write pending */
+	void __iomem	*func_base;	/* function register base */
+
+	unsigned long rate;
+	unsigned reserved:1;
+	unsigned posted:1;
+	struct timer_regs context;
+	int (*get_context_loss_count)(struct device *);
+	int ctx_loss_count;
+	int revision;
+	u32 capability;
+	u32 errata;
+	struct platform_device *pdev;
+	struct list_head node;
+};
+
 struct dmtimer_platform_data {
 	/* set_timer_src - Only used for OMAP1 devices */
 	int (*set_timer_src)(struct platform_device *pdev, int source);
@@ -260,31 +283,6 @@ int omap_dm_timers_active(void);
 #define OMAP_TIMER_TICK_INT_MASK_COUNT_REG				\
 		(_OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET | (WP_TOWR << WPSHIFT))
 
-struct omap_dm_timer {
-	int id;
-	int irq;
-	struct clk *fclk;
-
-	void __iomem	*io_base;
-	void __iomem	*irq_stat;	/* TISR/IRQSTATUS interrupt status */
-	void __iomem	*irq_ena;	/* irq enable */
-	void __iomem	*irq_dis;	/* irq disable, only on v2 ip */
-	void __iomem	*pend;		/* write pending */
-	void __iomem	*func_base;	/* function register base */
-
-	unsigned long rate;
-	unsigned reserved:1;
-	unsigned posted:1;
-	struct timer_regs context;
-	int (*get_context_loss_count)(struct device *);
-	int ctx_loss_count;
-	int revision;
-	u32 capability;
-	u32 errata;
-	struct platform_device *pdev;
-	struct list_head node;
-};
-
 static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg,
 						int posted)
 {
Signature · 1 line
1.7.9.5
author
#6 lore raw

PATCH 6/8 ARM: OMAP: Add platform data header for DMTIMERs

In reply to Jon Hunter

Move definition of dmtimer platform data structure in to its own header under <linux/platform_data>.

---
 arch/arm/mach-omap1/timer.c                |    1 +
 arch/arm/mach-omap2/timer.c                |    2 ++
 arch/arm/plat-omap/dmtimer.c               |    2 ++
 arch/arm/plat-omap/include/plat/dmtimer.h  |    8 -------
 include/linux/platform_data/dmtimer-omap.h |   31 ++++++++++++++++++++++++++++
 5 files changed, 36 insertions(+), 8 deletions(-)
 create mode 100644 include/linux/platform_data/dmtimer-omap.h
arch/arm/mach-omap1/timer.c +1 -0
index cdeb9d3..bde7a35 100644
@@ -25,6 +25,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/platform_device.h>
+#include <linux/platform_data/dmtimer-omap.h>
 
 #include <mach/irqs.h>
 
arch/arm/mach-omap2/timer.c +2 -0
index 1a662df..4daa8b4 100644
@@ -39,6 +39,8 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
+#include <linux/platform_device.h>
+#include <linux/platform_data/dmtimer-omap.h>
 
 #include <asm/mach/time.h>
 #include <asm/smp_twd.h>
arch/arm/plat-omap/dmtimer.c +2 -0
index efe4774..89585c2 100644
@@ -43,6 +43,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/platform_data/dmtimer-omap.h>
 
 #include <plat/dmtimer.h>
 
arch/arm/plat-omap/include/plat/dmtimer.h +0 -8
index b3cd91b..a3fbc48 100644
@@ -124,14 +124,6 @@ struct omap_dm_timer {
 	struct list_head node;
 };
 
-struct dmtimer_platform_data {
-	/* set_timer_src - Only used for OMAP1 devices */
-	int (*set_timer_src)(struct platform_device *pdev, int source);
-	u32 timer_errata;
-	u32 timer_capability;
-	int (*get_context_loss_count)(struct device *);
-};
-
 int omap_dm_timer_reserve_systimer(int id);
 struct omap_dm_timer *omap_dm_timer_request(void);
 struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id);
include/linux/platform_data/dmtimer-omap.h new file +31 -0
new file mode 100644
index 0000000..a19b78d
@@ -0,0 +1,31 @@
+/*
+ * DMTIMER platform data for TI OMAP platforms
+ *
+ * Copyright (C) 2012 Texas Instruments
+ * Author: Jon Hunter <[email protected]>
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __PLATFORM_DATA_DMTIMER_OMAP_H__
+#define __PLATFORM_DATA_DMTIMER_OMAP_H__
+
+struct dmtimer_platform_data {
+	/* set_timer_src - Only used for OMAP1 devices */
+	int (*set_timer_src)(struct platform_device *pdev, int source);
+	u32 timer_capability;
+	u32 timer_errata;
+	int (*get_context_loss_count)(struct device *);
+};
+
+#endif /* __PLATFORM_DATA_DMTIMER_OMAP_H__ */
Signature · 1 line
1.7.9.5
author
#7 lore raw

PATCH 7/8 ARM: OMAP: Remove unnecessary inclusion of dmtimer.h

In reply to Jon Hunter

Some source files are including dmtimer.h but not actually using any dmtimer definitions or functions. Therefore, remove the inclusion dmtimer.h from these source files.

---
 arch/arm/mach-omap1/timer32k.c             |    1 -
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |    1 -
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |    1 -
 arch/arm/mach-omap2/pm-debug.c             |    1 -
 drivers/staging/tidspbridge/core/ue_deh.c  |    1 -
 5 files changed, 5 deletions(-)
arch/arm/mach-omap1/timer32k.c +0 -1
index 8936819..41152fa 100644
@@ -51,7 +51,6 @@
 #include <asm/mach/time.h>
 
 #include <plat/counter-32k.h>
-#include <plat/dmtimer.h>
 
 #include <mach/hardware.h>
 
arch/arm/mach-omap2/omap_hwmod_2420_data.c +0 -1
index a8b3368..e8efe3d 100644
@@ -17,7 +17,6 @@
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include <plat-omap/dma-omap.h>
-#include <plat/dmtimer.h>
 
 #include "omap_hwmod.h"
 #include "l3_2xxx.h"
arch/arm/mach-omap2/omap_hwmod_2430_data.c +0 -1
index dc768c5..32d17e3 100644
@@ -18,7 +18,6 @@
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include <plat-omap/dma-omap.h>
-#include <plat/dmtimer.h>
 
 #include "omap_hwmod.h"
 #include "mmc.h"
arch/arm/mach-omap2/pm-debug.c +0 -1
index 3cf4fdf..e2c291f 100644
@@ -30,7 +30,6 @@
 #include "clock.h"
 #include "powerdomain.h"
 #include "clockdomain.h"
-#include <plat/dmtimer.h>
 #include "omap-pm.h"
 
 #include "soc.h"
drivers/staging/tidspbridge/core/ue_deh.c +0 -1
index 3d28b23..6aea6f1 100644
@@ -19,7 +19,6 @@
 
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
-#include <plat/dmtimer.h>
 
 #include <dspbridge/dbdefs.h>
 #include <dspbridge/dspdeh.h>
Signature · 1 line
1.7.9.5
author
#8 lore raw

PATCH 7/8 ARM: OMAP: Remove unnecessary inclusion of dmtimer.h

Quoted 66 lines · Jon Hunter

Some source files are including dmtimer.h but not actually using any dmtimer definitions or functions. Therefore, remove the inclusion dmtimer.h from these source files.

---
 arch/arm/mach-omap1/timer32k.c             |    1 -
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |    1 -
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |    1 -
 arch/arm/mach-omap2/pm-debug.c             |    1 -
 drivers/staging/tidspbridge/core/ue_deh.c  |    1 -
 5 files changed, 5 deletions(-)
arch/arm/mach-omap1/timer32k.c +0 -1
index 8936819..41152fa 100644
@@ -51,7 +51,6 @@
 #include <asm/mach/time.h>
 
 #include <plat/counter-32k.h>
-#include <plat/dmtimer.h>
 
 #include <mach/hardware.h>
 
arch/arm/mach-omap2/omap_hwmod_2420_data.c +0 -1
index a8b3368..e8efe3d 100644
@@ -17,7 +17,6 @@
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include <plat-omap/dma-omap.h>
-#include <plat/dmtimer.h>
 
 #include "omap_hwmod.h"
 #include "l3_2xxx.h"
arch/arm/mach-omap2/omap_hwmod_2430_data.c +0 -1
index dc768c5..32d17e3 100644
@@ -18,7 +18,6 @@
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include <plat-omap/dma-omap.h>
-#include <plat/dmtimer.h>
 
 #include "omap_hwmod.h"
 #include "mmc.h"
arch/arm/mach-omap2/pm-debug.c +0 -1
index 3cf4fdf..e2c291f 100644
@@ -30,7 +30,6 @@
 #include "clock.h"
 #include "powerdomain.h"
 #include "clockdomain.h"
-#include <plat/dmtimer.h>
 #include "omap-pm.h"
 
 #include "soc.h"
drivers/staging/tidspbridge/core/ue_deh.c +0 -0
index 3d28b23..6aea6f1 100644

drivers/staging/tidspbridge/core/ue_deh.c line 24

Quoted 7 lines
drivers/staging/tidspbridge/core/ue_deh.c +0 -1
@@ -19,7 +19,6 @@
 
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
-#include <plat/dmtimer.h>
 
 #include <dspbridge/dbdefs.h>
 #include <dspbridge/dspdeh.h>

Hi Omar, I should have had you in copy on this one. Are you ok with the removal of the above dmtimer.h include? It does not appear that this file needs to include dmtimer.h.

Is it ok for this to go through Tony's tree? If so, care to ACK?

Cheers
Jon

#9 lore raw

PATCH 7/8 ARM: OMAP: Remove unnecessary inclusion of dmtimer.h

Hi Jon,

Quoted 10 lines · Jon Hunter
Quoted 10 lines
drivers/staging/tidspbridge/core/ue_deh.c +0 -1
index 3d28b23..6aea6f1 100644
@@ -19,7 +19,6 @@
 
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
-#include <plat/dmtimer.h>
 
Quoted 6 lines

drivers/staging/tidspbridge/core/ue_deh.c line 24

Quoted 2 lines
drivers/staging/tidspbridge/core/ue_deh.c +0 -0
 #include <dspbridge/dbdefs.h>
 #include <dspbridge/dspdeh.h>

Hi Omar, I should have had you in copy on this one. Are you ok with the removal of the above dmtimer.h include? It does not appear that this file needs to include dmtimer.h.

Indeed, we don't use it here.

Quoted 1 line

Is it ok for this to go through Tony's tree? If so, care to ACK?

Looks fine to me, but I believe you will want to let Greg know if this patch will bypass staging tree.

Cheers,

Omar

#10 lore raw

PATCH 7/8 ARM: OMAP: Remove unnecessary inclusion of dmtimer.h

Quoted 20 lines · Omar Ramirez Luna

Hi Jon,

Quoted 10 lines · Jon Hunter
Quoted 10 lines
drivers/staging/tidspbridge/core/ue_deh.c +0 -1
index 3d28b23..6aea6f1 100644
@@ -19,7 +19,6 @@
 
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
-#include <plat/dmtimer.h>
 
Quoted 6 lines

drivers/staging/tidspbridge/core/ue_deh.c line 24

Quoted 2 lines
drivers/staging/tidspbridge/core/ue_deh.c +0 -0
 #include <dspbridge/dbdefs.h>
 #include <dspbridge/dspdeh.h>

Hi Omar, I should have had you in copy on this one. Are you ok with the removal of the above dmtimer.h include? It does not appear that this file needs to include dmtimer.h.

Quoted 6 lines

Indeed, we don't use it here.

Quoted 1 line

Is it ok for this to go through Tony's tree? If so, care to ACK?

Looks fine to me, but I believe you will want to let Greg know if this patch will bypass staging tree.

That's fine with me for such trivial stuff.

greg k-h

author
#11 lore raw

PATCH 8/8 ARM: OMAP: Move plat/dmtimer.h to plat-omap/dmtimer.h

In reply to Jon Hunter

Move plat/dmtimer.h to plat-omap/dmtimer.h in order to support a single zImage for ARM devices.

---
 arch/arm/mach-omap1/pm.c                           |    2 +-
 arch/arm/mach-omap1/timer.c                        |    2 +-
 arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c |    2 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c         |    2 +-
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c         |    2 +-
 arch/arm/mach-omap2/timer.c                        |    2 +-
 arch/arm/plat-omap/dmtimer.c                       |    2 +-
 arch/arm/plat-omap/include/plat-omap/dmtimer.h     |  420 ++++++++++++++++++++
 arch/arm/plat-omap/include/plat/dmtimer.h          |  414 -------------------
 drivers/staging/tidspbridge/core/dsp-clock.c       |    2 +-
 10 files changed, 428 insertions(+), 422 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat-omap/dmtimer.h
 delete mode 100644 arch/arm/plat-omap/include/plat/dmtimer.h
arch/arm/mach-omap1/pm.c +1 -1
index 66d663a..ecc1f76 100644
@@ -53,7 +53,7 @@
 #include <mach/tc.h>
 #include <mach/mux.h>
 #include <plat-omap/dma-omap.h>
-#include <plat/dmtimer.h>
+#include <plat-omap/dmtimer.h>
 
 #include <mach/irqs.h>
 
arch/arm/mach-omap1/timer.c +1 -1
index bde7a35..0089fb7 100644
@@ -29,7 +29,7 @@
 
 #include <mach/irqs.h>
 
-#include <plat/dmtimer.h>
+#include <plat-omap/dmtimer.h>
 
 #define OMAP1610_GPTIMER1_BASE		0xfffb1400
 #define OMAP1610_GPTIMER2_BASE		0xfffb1c00
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c +1 -1
index 0db8f45..a4169b6 100644
@@ -11,7 +11,7 @@
 
 #include <linux/platform_data/gpio-omap.h>
 #include <plat-omap/dma-omap.h>
-#include <plat/dmtimer.h>
+#include <plat-omap/dmtimer.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include "omap_hwmod.h"
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
index addc1c2..ff835ed 100644
@@ -24,7 +24,7 @@
 #include "l4_3xxx.h"
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
-#include <plat/dmtimer.h>
+#include <plat-omap/dmtimer.h>
 #include <plat/iommu.h>
 
 #include "am35xx.h"
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -1
index 399f4ce..2750efe 100644
@@ -27,7 +27,7 @@
 
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/asoc-ti-mcbsp.h>
-#include <plat/dmtimer.h>
+#include <plat-omap/dmtimer.h>
 #include <plat/iommu.h>
 
 #include "omap_hwmod.h"
arch/arm/mach-omap2/timer.c +1 -1
index 4daa8b4..b8ee64a 100644
@@ -50,7 +50,7 @@
 #include "omap_hwmod.h"
 #include "omap_device.h"
 #include <plat/counter-32k.h>
-#include <plat/dmtimer.h>
+#include <plat-omap/dmtimer.h>
 #include "omap-pm.h"
 
 #include "soc.h"
arch/arm/plat-omap/dmtimer.c +1 -1
index 89585c2..a1d45c7 100644
@@ -46,7 +46,7 @@
 #include <linux/platform_device.h>
 #include <linux/platform_data/dmtimer-omap.h>
 
-#include <plat/dmtimer.h>
+#include <plat-omap/dmtimer.h>
 
 static u32 omap_reserved_systimers;
 static LIST_HEAD(omap_timer_list);
arch/arm/plat-omap/include/plat-omap/dmtimer.h new file +420 -0

420 lines not on this page · raw message

arch/arm/plat-omap/include/plat/dmtimer.h deleted +0 -414

414 lines not on this page · raw message

drivers/staging/tidspbridge/core/dsp-clock.c +1 -1
index b647207..6bb0300 100644
@@ -22,7 +22,7 @@
 
 /*  ----------------------------------- Host OS */
 #include <dspbridge/host_os.h>
-#include <plat/dmtimer.h>
+#include <plat-omap/dmtimer.h>
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 
 /*  ----------------------------------- DSP/BIOS Bridge */
Signature · 1 line
1.7.9.5
maintainer
#12 lore raw

PATCH 8/8 ARM: OMAP: Move plat/dmtimer.h to plat-omap/dmtimer.h

Quoted 2 lines · Jon Hunter

Move plat/dmtimer.h to plat-omap/dmtimer.h in order to support a single zImage for ARM devices.

Let's skip this one for now as it turns out this solution won't work either for multiplatform without adding nasty hacks to arch/arm/Makefile to include arch/arm/plat-omap.

Sorry I don't have any real solution in mind other than making the remaining dmtimer.h users to use Linux generic timer functions, or pass the dmtimer functions in platform_data for now.

Regards,

Tony

author
#13 lore raw

PATCH 8/8 ARM: OMAP: Move plat/dmtimer.h to plat-omap/dmtimer.h

Quoted 11 lines · Tony Lindgren
Quoted 2 lines · Jon Hunter

Move plat/dmtimer.h to plat-omap/dmtimer.h in order to support a single zImage for ARM devices.

Let's skip this one for now as it turns out this solution won't work either for multiplatform without adding nasty hacks to arch/arm/Makefile to include arch/arm/plat-omap.

Sorry I don't have any real solution in mind other than making the remaining dmtimer.h users to use Linux generic timer functions, or pass the dmtimer functions in platform_data for now.

Ok, no problem. Are you happy with the others?

One thing that we could do, is not include the dmtimer driver in the multi-platform build for now. I believe that only the dsp/iva/gfx is using this driver currently.

I believe that there are some issues with building the kernel without the dmtimer and so I can look into fixing that.

Is there a way to not include dmtimer with multi-platform but still enable in omap2plus_defconfig? Or are we planning to kill omap2plus_defconfig too?

Cheers
Jon

maintainer
#14 lore raw

PATCH 8/8 ARM: OMAP: Move plat/dmtimer.h to plat-omap/dmtimer.h

Quoted 10 lines · Jon Hunter
Quoted 8 lines · Tony Lindgren
Quoted 2 lines · Jon Hunter

Move plat/dmtimer.h to plat-omap/dmtimer.h in order to support a single zImage for ARM devices.

Let's skip this one for now as it turns out this solution won't work either for multiplatform without adding nasty hacks to arch/arm/Makefile to include arch/arm/plat-omap.

Quoted 5 lines
Quoted 3 lines

Sorry I don't have any real solution in mind other than making the remaining dmtimer.h users to use Linux generic timer functions, or pass the dmtimer functions in platform_data for now.

Ok, no problem. Are you happy with the others?

The others look OK to me thanks.

Quoted 3 lines

One thing that we could do, is not include the dmtimer driver in the multi-platform build for now. I believe that only the dsp/iva/gfx is using this driver currently.

Looks like the users are drivers/staging/tidspbridge and drivers/media/rc/ir-rx51.c. Both could use platform_data pointers for now, but that really just postpones the problem.

Quoted 2 lines

I believe that there are some issues with building the kernel without the dmtimer and so I can look into fixing that.

We can include it from <plat/dmtimer.h> for arch/arm/*omap*/* code, but not for drivers.

Quoted 3 lines

Is there a way to not include dmtimer with multi-platform but still enable in omap2plus_defconfig? Or are we planning to kill omap2plus_defconfig too?

We'll be keeping omap2plus_defconfig, but once we enable multiplatform support there's really no reason to go back.

Regards,

Tony