From: Russell King - ARM Linux <linux@arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org, John Stultz <johnstul@us.ibm.com>, Thomas Gleixner <tglx@linutronix.de> Cc: Tony Lindgren <tony@atomide.com>, linux-omap@vger.kernel.org Subject: [PATCH 04/13] ARM: omap1: convert to using readl/writel instead of volatile struct Date: Tue, 10 May 2011 08:28:37 +0100 [thread overview] Message-ID: <E1QJhMz-0000yZ-NF@rmk-PC.arm.linux.org.uk> (raw) In-Reply-To: <20110510072700.GA29869@n2100.arm.linux.org.uk> Cc: Tony Lindgren <tony@atomide.com> Cc: linux-omap@vger.kernel.org Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> --- arch/arm/mach-omap1/time.c | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index e2c29b4..e7ab616 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c @@ -68,49 +68,50 @@ typedef struct { } omap_mpu_timer_regs_t; #define omap_mpu_timer_base(n) \ -((volatile omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ +((omap_mpu_timer_regs_t __iomem *)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ (n)*OMAP_MPU_TIMER_OFFSET)) static inline unsigned long notrace omap_mpu_timer_read(int nr) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); - return timer->read_tim; + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); + return readl(&timer->read_tim); } static inline void omap_mpu_set_autoreset(int nr) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); - timer->cntl = timer->cntl | MPU_TIMER_AR; + writel(readl(&timer->cntl) | MPU_TIMER_AR, &timer->cntl); } static inline void omap_mpu_remove_autoreset(int nr) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); - timer->cntl = timer->cntl & ~MPU_TIMER_AR; + writel(readl(&timer->cntl) & ~MPU_TIMER_AR, &timer->cntl); } static inline void omap_mpu_timer_start(int nr, unsigned long load_val, int autoreset) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); - unsigned int timerflags = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST); + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); + unsigned int timerflags = MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST; - if (autoreset) timerflags |= MPU_TIMER_AR; + if (autoreset) + timerflags |= MPU_TIMER_AR; - timer->cntl = MPU_TIMER_CLOCK_ENABLE; + writel(MPU_TIMER_CLOCK_ENABLE, &timer->cntl); udelay(1); - timer->load_tim = load_val; + writel(load_val, &timer->load_tim); udelay(1); - timer->cntl = timerflags; + writel(timerflags, &timer->cntl); } static inline void omap_mpu_timer_stop(int nr) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); - timer->cntl &= ~MPU_TIMER_ST; + writel(readl(&timer->cntl) & ~MPU_TIMER_ST, &timer->cntl); } /* -- 1.7.4.4
WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/13] ARM: omap1: convert to using readl/writel instead of volatile struct Date: Tue, 10 May 2011 08:28:37 +0100 [thread overview] Message-ID: <E1QJhMz-0000yZ-NF@rmk-PC.arm.linux.org.uk> (raw) In-Reply-To: <20110510072700.GA29869@n2100.arm.linux.org.uk> Cc: Tony Lindgren <tony@atomide.com> Cc: linux-omap at vger.kernel.org Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> --- arch/arm/mach-omap1/time.c | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index e2c29b4..e7ab616 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c @@ -68,49 +68,50 @@ typedef struct { } omap_mpu_timer_regs_t; #define omap_mpu_timer_base(n) \ -((volatile omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ +((omap_mpu_timer_regs_t __iomem *)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ (n)*OMAP_MPU_TIMER_OFFSET)) static inline unsigned long notrace omap_mpu_timer_read(int nr) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); - return timer->read_tim; + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); + return readl(&timer->read_tim); } static inline void omap_mpu_set_autoreset(int nr) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); - timer->cntl = timer->cntl | MPU_TIMER_AR; + writel(readl(&timer->cntl) | MPU_TIMER_AR, &timer->cntl); } static inline void omap_mpu_remove_autoreset(int nr) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); - timer->cntl = timer->cntl & ~MPU_TIMER_AR; + writel(readl(&timer->cntl) & ~MPU_TIMER_AR, &timer->cntl); } static inline void omap_mpu_timer_start(int nr, unsigned long load_val, int autoreset) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); - unsigned int timerflags = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST); + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); + unsigned int timerflags = MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST; - if (autoreset) timerflags |= MPU_TIMER_AR; + if (autoreset) + timerflags |= MPU_TIMER_AR; - timer->cntl = MPU_TIMER_CLOCK_ENABLE; + writel(MPU_TIMER_CLOCK_ENABLE, &timer->cntl); udelay(1); - timer->load_tim = load_val; + writel(load_val, &timer->load_tim); udelay(1); - timer->cntl = timerflags; + writel(timerflags, &timer->cntl); } static inline void omap_mpu_timer_stop(int nr) { - volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); + omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); - timer->cntl &= ~MPU_TIMER_ST; + writel(readl(&timer->cntl) & ~MPU_TIMER_ST, &timer->cntl); } /* -- 1.7.4.4
next prev parent reply other threads:[~2011-05-10 7:29 UTC|newest] Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-05-10 7:27 [PATCH 00/13] Consolidate simple ARM MMIO clock sources Russell King - ARM Linux 2011-05-10 7:27 ` Russell King - ARM Linux 2011-05-10 7:27 ` [PATCH 01/13] Make clocksource name const Russell King - ARM Linux 2011-05-10 7:27 ` Russell King - ARM Linux 2011-05-10 7:27 ` [PATCH 02/13] ARM: s5p: consolidate selection of timer register Russell King - ARM Linux 2011-05-12 7:01 ` Kukjin Kim 2011-05-10 7:28 ` [PATCH 03/13] ARM: omap1: delete useless interrupt handler Russell King - ARM Linux 2011-05-10 7:28 ` Russell King - ARM Linux 2011-05-10 12:49 ` Kevin Hilman 2011-05-10 12:49 ` Kevin Hilman 2011-05-12 7:25 ` Tony Lindgren 2011-05-12 7:25 ` Tony Lindgren 2011-05-10 7:28 ` Russell King - ARM Linux [this message] 2011-05-10 7:28 ` [PATCH 04/13] ARM: omap1: convert to using readl/writel instead of volatile struct Russell King - ARM Linux 2011-05-12 7:45 ` Tony Lindgren 2011-05-12 7:45 ` Tony Lindgren 2011-05-10 7:28 ` [PATCH 05/13] ARM: update sa1100 to reflect PXA updates Russell King - ARM Linux 2011-05-10 7:29 ` [PATCH 06/13] clocksource: add common mmio clocksource Russell King - ARM Linux 2011-05-10 7:29 ` Russell King - ARM Linux 2011-05-10 8:38 ` Sascha Hauer 2011-05-10 8:38 ` Sascha Hauer 2011-05-10 8:46 ` Russell King - ARM Linux 2011-05-10 8:46 ` Russell King - ARM Linux 2011-05-12 7:43 ` Tony Lindgren 2011-05-12 7:43 ` Tony Lindgren 2011-05-10 9:59 ` Russell King - ARM Linux 2011-05-10 9:59 ` Russell King - ARM Linux 2011-05-11 8:15 ` viresh kumar 2011-05-11 8:15 ` viresh kumar 2011-05-11 8:35 ` [PATCH 06/13 v2] " Russell King - ARM Linux 2011-05-11 8:35 ` Russell King - ARM Linux 2011-05-12 8:03 ` [PATCH 06/13] " Thomas Gleixner 2011-05-12 8:03 ` Thomas Gleixner 2011-05-10 7:29 ` [PATCH 07/13] clocksource: convert ARM 32-bit up counting clocksources Russell King - ARM Linux 2011-05-10 21:10 ` Linus Walleij 2011-05-11 7:52 ` Russell King - ARM Linux 2011-05-11 0:16 ` Hans J. Koch 2011-05-11 7:52 ` Russell King - ARM Linux 2011-05-11 8:07 ` Hans J. Koch 2011-05-15 3:53 ` Colin Cross 2011-05-26 8:32 ` Richard Cochran 2011-05-10 7:31 ` [PATCH 08/13] clocksource: convert ARM 32-bit down " Russell King - ARM Linux 2011-05-10 12:39 ` Nicolas Pitre 2011-05-11 7:53 ` Russell King - ARM Linux 2011-05-11 13:45 ` Nicolas Pitre 2011-05-10 21:04 ` Linus Walleij 2011-05-11 7:53 ` Russell King - ARM Linux 2011-05-12 12:47 ` [PATCH 08/13 v2] " Russell King - ARM Linux 2011-05-13 14:30 ` Catalin Marinas 2011-05-10 7:31 ` [PATCH 09/13] clocksource: convert W90x900 24-bit down counting clocksource Russell King - ARM Linux 2011-05-10 7:31 ` [PATCH 10/13] clocksource: convert Integrator/AP 16-bit " Russell King - ARM Linux 2011-05-10 7:32 ` [PATCH 11/13] clocksource: convert SPEAr platforms 16-bit up " Russell King - ARM Linux 2011-05-11 3:31 ` viresh kumar 2011-05-11 7:53 ` Russell King - ARM Linux 2011-05-11 8:13 ` viresh kumar 2011-05-10 7:34 ` [PATCH 12/13] clocksource: convert MXS timrotv2 to 32-bit down " Russell King - ARM Linux 2011-05-16 14:31 ` Shawn Guo 2011-05-16 15:16 ` Shawn Guo 2011-05-16 17:18 ` Russell King - ARM Linux 2011-05-10 7:34 ` [PATCH 13/13] clocksource: convert OMAP1 " Russell King - ARM Linux 2011-05-10 7:34 ` Russell King - ARM Linux 2011-05-12 7:46 ` Tony Lindgren 2011-05-12 7:46 ` Tony Lindgren 2011-05-10 7:39 ` [PATCH 08/13] clocksource: convert ARM 32-bit down counting clocksources Alessandro Rubini 2011-05-10 8:07 ` Russell King - ARM Linux 2011-05-12 13:49 ` [PATCH 14/13] clocksource: ARM sp804: allow clocksource name to be specified Russell King - ARM Linux 2011-05-13 14:32 ` Catalin Marinas 2011-05-12 13:51 ` [PATCH 15/13] clocksource: ARM sp804: obtain sp804 timer rate via clks Russell King - ARM Linux 2011-05-13 15:01 ` Catalin Marinas
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=E1QJhMz-0000yZ-NF@rmk-PC.arm.linux.org.uk \ --to=linux@arm.linux.org.uk \ --cc=johnstul@us.ibm.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ --cc=tglx@linutronix.de \ --cc=tony@atomide.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.