aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-lpc32xx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 18:55:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 18:55:54 -0400
commitc8bc5e39ac110acc88e41dd45d3f99956686f074 (patch)
tree1e4c21347e6d7b3cd7ac649436bbf3e2c1854229 /arch/arm/mach-lpc32xx
parente22057c8599373e5caef0bc42bdb95d2a361ab0d (diff)
parent489e7bece7f6859a7df484a4dce08fa51fb0d876 (diff)
Merge tag 'fixes-non-critical' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull "ARM: Non-critical bug fixes" from Ardn Bergmann: "Simple bug fixes that were not considered important enough for inclusion into 3.3. One bug fix was originally intended for 3.3 but accidentally got missed, but is not marked stable because it should only get backported once later fixes also make it into v3.4. Signed-off-by: Arnd Bergmann <arnd@arndb.de>" * tag 'fixes-non-critical' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (66 commits) iomux-mx25.h slew rate adjusted for LCD __LD pins ARM: davinci: DA850: move da850_register_pm to .init.text ARM: davinci: cpufreq: fix compiler warning ARM: OMAP2+: Fix build for omap4 only builds with missing include of linux/bug.h ARM: OMAP2+: Fix section warnings for hsmmc_init_one ARM: OMAP2+: Fix build issues with missing include of linux/bug.h ARM: OMAP2+: gpmc-smsc911x: only register regulator for first instance ARM: OMAP3+: PM: VP: fix integer truncation error ARM: OMAP2+: PM: fix wakeupgen warning when hotplug disabled ARM: OMAP2+: PM: fix section mismatch with omap2_init_processor_devices() ARM: OMAP2: Fix section warning for n8x0 when CONFIG_MMC_OMAP is not set ARM: OMAP2+: Fix omap24xx_io_desc warning if SoC subtypes are not selected ARM: OMAP1: Fix section mismatch for omap1_init_early() ARM: OMAP1: Fix typo in lcd_dma.c ARM: OMAP: mailbox: trivial whitespace fix ARM: OMAP: Remove definition cpu_is_omap4430() ARM: OMAP2+: included some headers twice ARM: OMAP: clock.c: included linux/debugfs.h twice ARM: OMAP: don't build hwspinlock in vain ARM: OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided ...
Diffstat (limited to 'arch/arm/mach-lpc32xx')
-rw-r--r--arch/arm/mach-lpc32xx/clock.c62
-rw-r--r--arch/arm/mach-lpc32xx/common.h1
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/platform.h51
-rw-r--r--arch/arm/mach-lpc32xx/phy3250.c2
-rw-r--r--arch/arm/mach-lpc32xx/pm.c2
-rw-r--r--arch/arm/mach-lpc32xx/timer.c48
6 files changed, 75 insertions, 91 deletions
diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c
index 1e027514096..0e01bf44479 100644
--- a/arch/arm/mach-lpc32xx/clock.c
+++ b/arch/arm/mach-lpc32xx/clock.c
@@ -82,6 +82,7 @@
82 * will also impact the individual peripheral rates. 82 * will also impact the individual peripheral rates.
83 */ 83 */
84 84
85#include <linux/export.h>
85#include <linux/kernel.h> 86#include <linux/kernel.h>
86#include <linux/list.h> 87#include <linux/list.h>
87#include <linux/errno.h> 88#include <linux/errno.h>
@@ -97,9 +98,10 @@
97#include "clock.h" 98#include "clock.h"
98#include "common.h" 99#include "common.h"
99 100
101static DEFINE_SPINLOCK(global_clkregs_lock);
102
100static struct clk clk_armpll; 103static struct clk clk_armpll;
101static struct clk clk_usbpll; 104static struct clk clk_usbpll;
102static DEFINE_MUTEX(clkm_lock);
103 105
104/* 106/*
105 * Post divider values for PLLs based on selected register value 107 * Post divider values for PLLs based on selected register value
@@ -127,7 +129,7 @@ static struct clk osc_32KHz = {
127static int local_pll397_enable(struct clk *clk, int enable) 129static int local_pll397_enable(struct clk *clk, int enable)
128{ 130{
129 u32 reg; 131 u32 reg;
130 unsigned long timeout = 1 + msecs_to_jiffies(10); 132 unsigned long timeout = jiffies + msecs_to_jiffies(10);
131 133
132 reg = __raw_readl(LPC32XX_CLKPWR_PLL397_CTRL); 134 reg = __raw_readl(LPC32XX_CLKPWR_PLL397_CTRL);
133 135
@@ -142,7 +144,7 @@ static int local_pll397_enable(struct clk *clk, int enable)
142 /* Wait for PLL397 lock */ 144 /* Wait for PLL397 lock */
143 while (((__raw_readl(LPC32XX_CLKPWR_PLL397_CTRL) & 145 while (((__raw_readl(LPC32XX_CLKPWR_PLL397_CTRL) &
144 LPC32XX_CLKPWR_SYSCTRL_PLL397_STS) == 0) && 146 LPC32XX_CLKPWR_SYSCTRL_PLL397_STS) == 0) &&
145 (timeout > jiffies)) 147 time_before(jiffies, timeout))
146 cpu_relax(); 148 cpu_relax();
147 149
148 if ((__raw_readl(LPC32XX_CLKPWR_PLL397_CTRL) & 150 if ((__raw_readl(LPC32XX_CLKPWR_PLL397_CTRL) &
@@ -156,7 +158,7 @@ static int local_pll397_enable(struct clk *clk, int enable)
156static int local_oscmain_enable(struct clk *clk, int enable) 158static int local_oscmain_enable(struct clk *clk, int enable)
157{ 159{
158 u32 reg; 160 u32 reg;
159 unsigned long timeout = 1 + msecs_to_jiffies(10); 161 unsigned long timeout = jiffies + msecs_to_jiffies(10);
160 162
161 reg = __raw_readl(LPC32XX_CLKPWR_MAIN_OSC_CTRL); 163 reg = __raw_readl(LPC32XX_CLKPWR_MAIN_OSC_CTRL);
162 164
@@ -171,7 +173,7 @@ static int local_oscmain_enable(struct clk *clk, int enable)
171 /* Wait for main oscillator to start */ 173 /* Wait for main oscillator to start */
172 while (((__raw_readl(LPC32XX_CLKPWR_MAIN_OSC_CTRL) & 174 while (((__raw_readl(LPC32XX_CLKPWR_MAIN_OSC_CTRL) &
173 LPC32XX_CLKPWR_MOSC_DISABLE) != 0) && 175 LPC32XX_CLKPWR_MOSC_DISABLE) != 0) &&
174 (timeout > jiffies)) 176 time_before(jiffies, timeout))
175 cpu_relax(); 177 cpu_relax();
176 178
177 if ((__raw_readl(LPC32XX_CLKPWR_MAIN_OSC_CTRL) & 179 if ((__raw_readl(LPC32XX_CLKPWR_MAIN_OSC_CTRL) &
@@ -383,7 +385,7 @@ static int local_usbpll_enable(struct clk *clk, int enable)
383{ 385{
384 u32 reg; 386 u32 reg;
385 int ret = -ENODEV; 387 int ret = -ENODEV;
386 unsigned long timeout = 1 + msecs_to_jiffies(10); 388 unsigned long timeout = jiffies + msecs_to_jiffies(10);
387 389
388 reg = __raw_readl(LPC32XX_CLKPWR_USB_CTRL); 390 reg = __raw_readl(LPC32XX_CLKPWR_USB_CTRL);
389 391
@@ -396,7 +398,7 @@ static int local_usbpll_enable(struct clk *clk, int enable)
396 __raw_writel(reg, LPC32XX_CLKPWR_USB_CTRL); 398 __raw_writel(reg, LPC32XX_CLKPWR_USB_CTRL);
397 399
398 /* Wait for PLL lock */ 400 /* Wait for PLL lock */
399 while ((timeout > jiffies) & (ret == -ENODEV)) { 401 while (time_before(jiffies, timeout) && (ret == -ENODEV)) {
400 reg = __raw_readl(LPC32XX_CLKPWR_USB_CTRL); 402 reg = __raw_readl(LPC32XX_CLKPWR_USB_CTRL);
401 if (reg & LPC32XX_CLKPWR_USBCTRL_PLL_STS) 403 if (reg & LPC32XX_CLKPWR_USBCTRL_PLL_STS)
402 ret = 0; 404 ret = 0;
@@ -891,20 +893,8 @@ static struct clk clk_lcd = {
891 .enable_mask = LPC32XX_CLKPWR_LCDCTRL_CLK_EN, 893 .enable_mask = LPC32XX_CLKPWR_LCDCTRL_CLK_EN,
892}; 894};
893 895
894static inline void clk_lock(void)
895{
896 mutex_lock(&clkm_lock);
897}
898
899static inline void clk_unlock(void)
900{
901 mutex_unlock(&clkm_lock);
902}
903
904static void local_clk_disable(struct clk *clk) 896static void local_clk_disable(struct clk *clk)
905{ 897{
906 WARN_ON(clk->usecount == 0);
907
908 /* Don't attempt to disable clock if it has no users */ 898 /* Don't attempt to disable clock if it has no users */
909 if (clk->usecount > 0) { 899 if (clk->usecount > 0) {
910 clk->usecount--; 900 clk->usecount--;
@@ -947,10 +937,11 @@ static int local_clk_enable(struct clk *clk)
947int clk_enable(struct clk *clk) 937int clk_enable(struct clk *clk)
948{ 938{
949 int ret; 939 int ret;
940 unsigned long flags;
950 941
951 clk_lock(); 942 spin_lock_irqsave(&global_clkregs_lock, flags);
952 ret = local_clk_enable(clk); 943 ret = local_clk_enable(clk);
953 clk_unlock(); 944 spin_unlock_irqrestore(&global_clkregs_lock, flags);
954 945
955 return ret; 946 return ret;
956} 947}
@@ -961,9 +952,11 @@ EXPORT_SYMBOL(clk_enable);
961 */ 952 */
962void clk_disable(struct clk *clk) 953void clk_disable(struct clk *clk)
963{ 954{
964 clk_lock(); 955 unsigned long flags;
956
957 spin_lock_irqsave(&global_clkregs_lock, flags);
965 local_clk_disable(clk); 958 local_clk_disable(clk);
966 clk_unlock(); 959 spin_unlock_irqrestore(&global_clkregs_lock, flags);
967} 960}
968EXPORT_SYMBOL(clk_disable); 961EXPORT_SYMBOL(clk_disable);
969 962
@@ -972,13 +965,7 @@ EXPORT_SYMBOL(clk_disable);
972 */ 965 */
973unsigned long clk_get_rate(struct clk *clk) 966unsigned long clk_get_rate(struct clk *clk)
974{ 967{
975 unsigned long rate; 968 return clk->get_rate(clk);
976
977 clk_lock();
978 rate = clk->get_rate(clk);
979 clk_unlock();
980
981 return rate;
982} 969}
983EXPORT_SYMBOL(clk_get_rate); 970EXPORT_SYMBOL(clk_get_rate);
984 971
@@ -994,11 +981,8 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
994 * the actual rate set as part of the peripheral dividers 981 * the actual rate set as part of the peripheral dividers
995 * instead of high level clock control 982 * instead of high level clock control
996 */ 983 */
997 if (clk->set_rate) { 984 if (clk->set_rate)
998 clk_lock();
999 ret = clk->set_rate(clk, rate); 985 ret = clk->set_rate(clk, rate);
1000 clk_unlock();
1001 }
1002 986
1003 return ret; 987 return ret;
1004} 988}
@@ -1009,15 +993,11 @@ EXPORT_SYMBOL(clk_set_rate);
1009 */ 993 */
1010long clk_round_rate(struct clk *clk, unsigned long rate) 994long clk_round_rate(struct clk *clk, unsigned long rate)
1011{ 995{
1012 clk_lock();
1013
1014 if (clk->round_rate) 996 if (clk->round_rate)
1015 rate = clk->round_rate(clk, rate); 997 rate = clk->round_rate(clk, rate);
1016 else 998 else
1017 rate = clk->get_rate(clk); 999 rate = clk->get_rate(clk);
1018 1000
1019 clk_unlock();
1020
1021 return rate; 1001 return rate;
1022} 1002}
1023EXPORT_SYMBOL(clk_round_rate); 1003EXPORT_SYMBOL(clk_round_rate);
@@ -1075,10 +1055,10 @@ static struct clk_lookup lookups[] = {
1075 _REGISTER_CLOCK("dev:ssp1", NULL, clk_ssp1) 1055 _REGISTER_CLOCK("dev:ssp1", NULL, clk_ssp1)
1076 _REGISTER_CLOCK("lpc32xx_keys.0", NULL, clk_kscan) 1056 _REGISTER_CLOCK("lpc32xx_keys.0", NULL, clk_kscan)
1077 _REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand) 1057 _REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand)
1078 _REGISTER_CLOCK("tbd", "i2s0_ck", clk_i2s0) 1058 _REGISTER_CLOCK(NULL, "i2s0_ck", clk_i2s0)
1079 _REGISTER_CLOCK("tbd", "i2s1_ck", clk_i2s1) 1059 _REGISTER_CLOCK(NULL, "i2s1_ck", clk_i2s1)
1080 _REGISTER_CLOCK("ts-lpc32xx", NULL, clk_tsc) 1060 _REGISTER_CLOCK("ts-lpc32xx", NULL, clk_tsc)
1081 _REGISTER_CLOCK("dev:mmc0", "MCLK", clk_mmc) 1061 _REGISTER_CLOCK("dev:mmc0", NULL, clk_mmc)
1082 _REGISTER_CLOCK("lpc-net.0", NULL, clk_net) 1062 _REGISTER_CLOCK("lpc-net.0", NULL, clk_net)
1083 _REGISTER_CLOCK("dev:clcd", NULL, clk_lcd) 1063 _REGISTER_CLOCK("dev:clcd", NULL, clk_lcd)
1084 _REGISTER_CLOCK("lpc32xx_udc", "ck_usbd", clk_usbd) 1064 _REGISTER_CLOCK("lpc32xx_udc", "ck_usbd", clk_usbd)
diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h
index 4b4e700343c..75640bfb097 100644
--- a/arch/arm/mach-lpc32xx/common.h
+++ b/arch/arm/mach-lpc32xx/common.h
@@ -65,7 +65,6 @@ extern u32 clk_get_pclk_div(void);
65 */ 65 */
66extern void lpc32xx_get_uid(u32 devid[4]); 66extern void lpc32xx_get_uid(u32 devid[4]);
67 67
68extern void lpc32xx_watchdog_reset(void);
69extern u32 lpc32xx_return_iram_size(void); 68extern u32 lpc32xx_return_iram_size(void);
70 69
71/* 70/*
diff --git a/arch/arm/mach-lpc32xx/include/mach/platform.h b/arch/arm/mach-lpc32xx/include/mach/platform.h
index 14ea8d1aadb..c584f5bb164 100644
--- a/arch/arm/mach-lpc32xx/include/mach/platform.h
+++ b/arch/arm/mach-lpc32xx/include/mach/platform.h
@@ -591,42 +591,42 @@
591/* 591/*
592 * Timer/counter register offsets 592 * Timer/counter register offsets
593 */ 593 */
594#define LCP32XX_TIMER_IR(x) io_p2v((x) + 0x00) 594#define LPC32XX_TIMER_IR(x) io_p2v((x) + 0x00)
595#define LCP32XX_TIMER_TCR(x) io_p2v((x) + 0x04) 595#define LPC32XX_TIMER_TCR(x) io_p2v((x) + 0x04)
596#define LCP32XX_TIMER_TC(x) io_p2v((x) + 0x08) 596#define LPC32XX_TIMER_TC(x) io_p2v((x) + 0x08)
597#define LCP32XX_TIMER_PR(x) io_p2v((x) + 0x0C) 597#define LPC32XX_TIMER_PR(x) io_p2v((x) + 0x0C)
598#define LCP32XX_TIMER_PC(x) io_p2v((x) + 0x10) 598#define LPC32XX_TIMER_PC(x) io_p2v((x) + 0x10)
599#define LCP32XX_TIMER_MCR(x) io_p2v((x) + 0x14) 599#define LPC32XX_TIMER_MCR(x) io_p2v((x) + 0x14)
600#define LCP32XX_TIMER_MR0(x) io_p2v((x) + 0x18) 600#define LPC32XX_TIMER_MR0(x) io_p2v((x) + 0x18)
601#define LCP32XX_TIMER_MR1(x) io_p2v((x) + 0x1C) 601#define LPC32XX_TIMER_MR1(x) io_p2v((x) + 0x1C)
602#define LCP32XX_TIMER_MR2(x) io_p2v((x) + 0x20) 602#define LPC32XX_TIMER_MR2(x) io_p2v((x) + 0x20)
603#define LCP32XX_TIMER_MR3(x) io_p2v((x) + 0x24) 603#define LPC32XX_TIMER_MR3(x) io_p2v((x) + 0x24)
604#define LCP32XX_TIMER_CCR(x) io_p2v((x) + 0x28) 604#define LPC32XX_TIMER_CCR(x) io_p2v((x) + 0x28)
605#define LCP32XX_TIMER_CR0(x) io_p2v((x) + 0x2C) 605#define LPC32XX_TIMER_CR0(x) io_p2v((x) + 0x2C)
606#define LCP32XX_TIMER_CR1(x) io_p2v((x) + 0x30) 606#define LPC32XX_TIMER_CR1(x) io_p2v((x) + 0x30)
607#define LCP32XX_TIMER_CR2(x) io_p2v((x) + 0x34) 607#define LPC32XX_TIMER_CR2(x) io_p2v((x) + 0x34)
608#define LCP32XX_TIMER_CR3(x) io_p2v((x) + 0x38) 608#define LPC32XX_TIMER_CR3(x) io_p2v((x) + 0x38)
609#define LCP32XX_TIMER_EMR(x) io_p2v((x) + 0x3C) 609#define LPC32XX_TIMER_EMR(x) io_p2v((x) + 0x3C)
610#define LCP32XX_TIMER_CTCR(x) io_p2v((x) + 0x70) 610#define LPC32XX_TIMER_CTCR(x) io_p2v((x) + 0x70)
611 611
612/* 612/*
613 * ir register definitions 613 * ir register definitions
614 */ 614 */
615#define LCP32XX_TIMER_CNTR_MTCH_BIT(n) (1 << ((n) & 0x3)) 615#define LPC32XX_TIMER_CNTR_MTCH_BIT(n) (1 << ((n) & 0x3))
616#define LCP32XX_TIMER_CNTR_CAPT_BIT(n) (1 << (4 + ((n) & 0x3))) 616#define LPC32XX_TIMER_CNTR_CAPT_BIT(n) (1 << (4 + ((n) & 0x3)))
617 617
618/* 618/*
619 * tcr register definitions 619 * tcr register definitions
620 */ 620 */
621#define LCP32XX_TIMER_CNTR_TCR_EN 0x1 621#define LPC32XX_TIMER_CNTR_TCR_EN 0x1
622#define LCP32XX_TIMER_CNTR_TCR_RESET 0x2 622#define LPC32XX_TIMER_CNTR_TCR_RESET 0x2
623 623
624/* 624/*
625 * mcr register definitions 625 * mcr register definitions
626 */ 626 */
627#define LCP32XX_TIMER_CNTR_MCR_MTCH(n) (0x1 << ((n) * 3)) 627#define LPC32XX_TIMER_CNTR_MCR_MTCH(n) (0x1 << ((n) * 3))
628#define LCP32XX_TIMER_CNTR_MCR_RESET(n) (0x1 << (((n) * 3) + 1)) 628#define LPC32XX_TIMER_CNTR_MCR_RESET(n) (0x1 << (((n) * 3) + 1))
629#define LCP32XX_TIMER_CNTR_MCR_STOP(n) (0x1 << (((n) * 3) + 2)) 629#define LPC32XX_TIMER_CNTR_MCR_STOP(n) (0x1 << (((n) * 3) + 2))
630 630
631/* 631/*
632 * Standard UART register offsets 632 * Standard UART register offsets
@@ -690,5 +690,8 @@
690#define LPC32XX_GPIO_P1_MUX_SET _GPREG(0x130) 690#define LPC32XX_GPIO_P1_MUX_SET _GPREG(0x130)
691#define LPC32XX_GPIO_P1_MUX_CLR _GPREG(0x134) 691#define LPC32XX_GPIO_P1_MUX_CLR _GPREG(0x134)
692#define LPC32XX_GPIO_P1_MUX_STATE _GPREG(0x138) 692#define LPC32XX_GPIO_P1_MUX_STATE _GPREG(0x138)
693#define LPC32XX_GPIO_P2_MUX_SET _GPREG(0x028)
694#define LPC32XX_GPIO_P2_MUX_CLR _GPREG(0x02C)
695#define LPC32XX_GPIO_P2_MUX_STATE _GPREG(0x030)
693 696
694#endif 697#endif
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index 5d51c102c25..8571d6250dc 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -247,6 +247,8 @@ static struct platform_device lpc32xx_gpio_led_device = {
247}; 247};
248 248
249static struct platform_device *phy3250_devs[] __initdata = { 249static struct platform_device *phy3250_devs[] __initdata = {
250 &lpc32xx_rtc_device,
251 &lpc32xx_tsc_device,
250 &lpc32xx_i2c0_device, 252 &lpc32xx_i2c0_device,
251 &lpc32xx_i2c1_device, 253 &lpc32xx_i2c1_device,
252 &lpc32xx_i2c2_device, 254 &lpc32xx_i2c2_device,
diff --git a/arch/arm/mach-lpc32xx/pm.c b/arch/arm/mach-lpc32xx/pm.c
index b9c80597b7b..207e81275ff 100644
--- a/arch/arm/mach-lpc32xx/pm.c
+++ b/arch/arm/mach-lpc32xx/pm.c
@@ -13,7 +13,7 @@
13/* 13/*
14 * LPC32XX CPU and system power management 14 * LPC32XX CPU and system power management
15 * 15 *
16 * The LCP32XX has three CPU modes for controlling system power: run, 16 * The LPC32XX has three CPU modes for controlling system power: run,
17 * direct-run, and halt modes. When switching between halt and run modes, 17 * direct-run, and halt modes. When switching between halt and run modes,
18 * the CPU transistions through direct-run mode. For Linux, direct-run 18 * the CPU transistions through direct-run mode. For Linux, direct-run
19 * mode is not used in normal operation. Halt mode is used when the 19 * mode is not used in normal operation. Halt mode is used when the
diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c
index b42c909bbee..c40667c3316 100644
--- a/arch/arm/mach-lpc32xx/timer.c
+++ b/arch/arm/mach-lpc32xx/timer.c
@@ -34,11 +34,11 @@
34static int lpc32xx_clkevt_next_event(unsigned long delta, 34static int lpc32xx_clkevt_next_event(unsigned long delta,
35 struct clock_event_device *dev) 35 struct clock_event_device *dev)
36{ 36{
37 __raw_writel(LCP32XX_TIMER_CNTR_TCR_RESET, 37 __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET,
38 LCP32XX_TIMER_TCR(LPC32XX_TIMER0_BASE)); 38 LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
39 __raw_writel(delta, LCP32XX_TIMER_PR(LPC32XX_TIMER0_BASE)); 39 __raw_writel(delta, LPC32XX_TIMER_PR(LPC32XX_TIMER0_BASE));
40 __raw_writel(LCP32XX_TIMER_CNTR_TCR_EN, 40 __raw_writel(LPC32XX_TIMER_CNTR_TCR_EN,
41 LCP32XX_TIMER_TCR(LPC32XX_TIMER0_BASE)); 41 LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
42 42
43 return 0; 43 return 0;
44} 44}
@@ -58,7 +58,7 @@ static void lpc32xx_clkevt_mode(enum clock_event_mode mode,
58 * disable the timer to wait for the first call to 58 * disable the timer to wait for the first call to
59 * set_next_event(). 59 * set_next_event().
60 */ 60 */
61 __raw_writel(0, LCP32XX_TIMER_TCR(LPC32XX_TIMER0_BASE)); 61 __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
62 break; 62 break;
63 63
64 case CLOCK_EVT_MODE_UNUSED: 64 case CLOCK_EVT_MODE_UNUSED:
@@ -81,8 +81,8 @@ static irqreturn_t lpc32xx_timer_interrupt(int irq, void *dev_id)
81 struct clock_event_device *evt = &lpc32xx_clkevt; 81 struct clock_event_device *evt = &lpc32xx_clkevt;
82 82
83 /* Clear match */ 83 /* Clear match */
84 __raw_writel(LCP32XX_TIMER_CNTR_MTCH_BIT(0), 84 __raw_writel(LPC32XX_TIMER_CNTR_MTCH_BIT(0),
85 LCP32XX_TIMER_IR(LPC32XX_TIMER0_BASE)); 85 LPC32XX_TIMER_IR(LPC32XX_TIMER0_BASE));
86 86
87 evt->event_handler(evt); 87 evt->event_handler(evt);
88 88
@@ -128,14 +128,14 @@ static void __init lpc32xx_timer_init(void)
128 clkrate = clkrate / clk_get_pclk_div(); 128 clkrate = clkrate / clk_get_pclk_div();
129 129
130 /* Initial timer setup */ 130 /* Initial timer setup */
131 __raw_writel(0, LCP32XX_TIMER_TCR(LPC32XX_TIMER0_BASE)); 131 __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
132 __raw_writel(LCP32XX_TIMER_CNTR_MTCH_BIT(0), 132 __raw_writel(LPC32XX_TIMER_CNTR_MTCH_BIT(0),
133 LCP32XX_TIMER_IR(LPC32XX_TIMER0_BASE)); 133 LPC32XX_TIMER_IR(LPC32XX_TIMER0_BASE));
134 __raw_writel(1, LCP32XX_TIMER_MR0(LPC32XX_TIMER0_BASE)); 134 __raw_writel(1, LPC32XX_TIMER_MR0(LPC32XX_TIMER0_BASE));
135 __raw_writel(LCP32XX_TIMER_CNTR_MCR_MTCH(0) | 135 __raw_writel(LPC32XX_TIMER_CNTR_MCR_MTCH(0) |
136 LCP32XX_TIMER_CNTR_MCR_STOP(0) | 136 LPC32XX_TIMER_CNTR_MCR_STOP(0) |
137 LCP32XX_TIMER_CNTR_MCR_RESET(0), 137 LPC32XX_TIMER_CNTR_MCR_RESET(0),
138 LCP32XX_TIMER_MCR(LPC32XX_TIMER0_BASE)); 138 LPC32XX_TIMER_MCR(LPC32XX_TIMER0_BASE));
139 139
140 /* Setup tick interrupt */ 140 /* Setup tick interrupt */
141 setup_irq(IRQ_LPC32XX_TIMER0, &lpc32xx_timer_irq); 141 setup_irq(IRQ_LPC32XX_TIMER0, &lpc32xx_timer_irq);
@@ -151,14 +151,14 @@ static void __init lpc32xx_timer_init(void)
151 clockevents_register_device(&lpc32xx_clkevt); 151 clockevents_register_device(&lpc32xx_clkevt);
152 152
153 /* Use timer1 as clock source. */ 153 /* Use timer1 as clock source. */
154 __raw_writel(LCP32XX_TIMER_CNTR_TCR_RESET, 154 __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET,
155 LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE)); 155 LPC32XX_TIMER_TCR(LPC32XX_TIMER1_BASE));
156 __raw_writel(0, LCP32XX_TIMER_PR(LPC32XX_TIMER1_BASE)); 156 __raw_writel(0, LPC32XX_TIMER_PR(LPC32XX_TIMER1_BASE));
157 __raw_writel(0, LCP32XX_TIMER_MCR(LPC32XX_TIMER1_BASE)); 157 __raw_writel(0, LPC32XX_TIMER_MCR(LPC32XX_TIMER1_BASE));
158 __raw_writel(LCP32XX_TIMER_CNTR_TCR_EN, 158 __raw_writel(LPC32XX_TIMER_CNTR_TCR_EN,
159 LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE)); 159 LPC32XX_TIMER_TCR(LPC32XX_TIMER1_BASE));
160 160
161 clocksource_mmio_init(LCP32XX_TIMER_TC(LPC32XX_TIMER1_BASE), 161 clocksource_mmio_init(LPC32XX_TIMER_TC(LPC32XX_TIMER1_BASE),
162 "lpc32xx_clksrc", clkrate, 300, 32, clocksource_mmio_readl_up); 162 "lpc32xx_clksrc", clkrate, 300, 32, clocksource_mmio_readl_up);
163} 163}
164 164