diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-03-20 18:42:24 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-03-20 18:42:24 -0400 |
commit | f907ab06bb021bcb91d39c8d1b36536ebdb318fa (patch) | |
tree | 6020618997a6ea1b5f5b59c89df35344023f7c82 /arch/arm/mach-lpc32xx | |
parent | 7cc026f21e2acdcea8640df5da470c6fdca92911 (diff) | |
parent | 489e7bece7f6859a7df484a4dce08fa51fb0d876 (diff) |
Merge branch 'next/fixes-non-critical' into next/drivers
Conflicts:
arch/arm/mach-lpc32xx/clock.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
The conflicts with pxa are non-obvious, we have multiple branches
adding and removing the same clock settings. According to
Haojian Zhuang, removing the sa1100 rtc dummy clock is the correct
fix here.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-lpc32xx')
-rw-r--r-- | arch/arm/mach-lpc32xx/clock.c | 62 | ||||
-rw-r--r-- | arch/arm/mach-lpc32xx/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-lpc32xx/include/mach/platform.h | 51 | ||||
-rw-r--r-- | arch/arm/mach-lpc32xx/phy3250.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-lpc32xx/pm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-lpc32xx/timer.c | 48 |
6 files changed, 75 insertions, 91 deletions
diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c index 473015ac07bd..f55c772d1816 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 | ||
101 | static DEFINE_SPINLOCK(global_clkregs_lock); | ||
102 | |||
100 | static struct clk clk_armpll; | 103 | static struct clk clk_armpll; |
101 | static struct clk clk_usbpll; | 104 | static struct clk clk_usbpll; |
102 | static 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 = { | |||
127 | static int local_pll397_enable(struct clk *clk, int enable) | 129 | static 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) | |||
156 | static int local_oscmain_enable(struct clk *clk, int enable) | 158 | static 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; |
@@ -926,20 +928,8 @@ static struct clk clk_lcd = { | |||
926 | .enable_mask = LPC32XX_CLKPWR_LCDCTRL_CLK_EN, | 928 | .enable_mask = LPC32XX_CLKPWR_LCDCTRL_CLK_EN, |
927 | }; | 929 | }; |
928 | 930 | ||
929 | static inline void clk_lock(void) | ||
930 | { | ||
931 | mutex_lock(&clkm_lock); | ||
932 | } | ||
933 | |||
934 | static inline void clk_unlock(void) | ||
935 | { | ||
936 | mutex_unlock(&clkm_lock); | ||
937 | } | ||
938 | |||
939 | static void local_clk_disable(struct clk *clk) | 931 | static void local_clk_disable(struct clk *clk) |
940 | { | 932 | { |
941 | WARN_ON(clk->usecount == 0); | ||
942 | |||
943 | /* Don't attempt to disable clock if it has no users */ | 933 | /* Don't attempt to disable clock if it has no users */ |
944 | if (clk->usecount > 0) { | 934 | if (clk->usecount > 0) { |
945 | clk->usecount--; | 935 | clk->usecount--; |
@@ -982,10 +972,11 @@ static int local_clk_enable(struct clk *clk) | |||
982 | int clk_enable(struct clk *clk) | 972 | int clk_enable(struct clk *clk) |
983 | { | 973 | { |
984 | int ret; | 974 | int ret; |
975 | unsigned long flags; | ||
985 | 976 | ||
986 | clk_lock(); | 977 | spin_lock_irqsave(&global_clkregs_lock, flags); |
987 | ret = local_clk_enable(clk); | 978 | ret = local_clk_enable(clk); |
988 | clk_unlock(); | 979 | spin_unlock_irqrestore(&global_clkregs_lock, flags); |
989 | 980 | ||
990 | return ret; | 981 | return ret; |
991 | } | 982 | } |
@@ -996,9 +987,11 @@ EXPORT_SYMBOL(clk_enable); | |||
996 | */ | 987 | */ |
997 | void clk_disable(struct clk *clk) | 988 | void clk_disable(struct clk *clk) |
998 | { | 989 | { |
999 | clk_lock(); | 990 | unsigned long flags; |
991 | |||
992 | spin_lock_irqsave(&global_clkregs_lock, flags); | ||
1000 | local_clk_disable(clk); | 993 | local_clk_disable(clk); |
1001 | clk_unlock(); | 994 | spin_unlock_irqrestore(&global_clkregs_lock, flags); |
1002 | } | 995 | } |
1003 | EXPORT_SYMBOL(clk_disable); | 996 | EXPORT_SYMBOL(clk_disable); |
1004 | 997 | ||
@@ -1007,13 +1000,7 @@ EXPORT_SYMBOL(clk_disable); | |||
1007 | */ | 1000 | */ |
1008 | unsigned long clk_get_rate(struct clk *clk) | 1001 | unsigned long clk_get_rate(struct clk *clk) |
1009 | { | 1002 | { |
1010 | unsigned long rate; | 1003 | return clk->get_rate(clk); |
1011 | |||
1012 | clk_lock(); | ||
1013 | rate = clk->get_rate(clk); | ||
1014 | clk_unlock(); | ||
1015 | |||
1016 | return rate; | ||
1017 | } | 1004 | } |
1018 | EXPORT_SYMBOL(clk_get_rate); | 1005 | EXPORT_SYMBOL(clk_get_rate); |
1019 | 1006 | ||
@@ -1029,11 +1016,8 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
1029 | * the actual rate set as part of the peripheral dividers | 1016 | * the actual rate set as part of the peripheral dividers |
1030 | * instead of high level clock control | 1017 | * instead of high level clock control |
1031 | */ | 1018 | */ |
1032 | if (clk->set_rate) { | 1019 | if (clk->set_rate) |
1033 | clk_lock(); | ||
1034 | ret = clk->set_rate(clk, rate); | 1020 | ret = clk->set_rate(clk, rate); |
1035 | clk_unlock(); | ||
1036 | } | ||
1037 | 1021 | ||
1038 | return ret; | 1022 | return ret; |
1039 | } | 1023 | } |
@@ -1044,15 +1028,11 @@ EXPORT_SYMBOL(clk_set_rate); | |||
1044 | */ | 1028 | */ |
1045 | long clk_round_rate(struct clk *clk, unsigned long rate) | 1029 | long clk_round_rate(struct clk *clk, unsigned long rate) |
1046 | { | 1030 | { |
1047 | clk_lock(); | ||
1048 | |||
1049 | if (clk->round_rate) | 1031 | if (clk->round_rate) |
1050 | rate = clk->round_rate(clk, rate); | 1032 | rate = clk->round_rate(clk, rate); |
1051 | else | 1033 | else |
1052 | rate = clk->get_rate(clk); | 1034 | rate = clk->get_rate(clk); |
1053 | 1035 | ||
1054 | clk_unlock(); | ||
1055 | |||
1056 | return rate; | 1036 | return rate; |
1057 | } | 1037 | } |
1058 | EXPORT_SYMBOL(clk_round_rate); | 1038 | EXPORT_SYMBOL(clk_round_rate); |
@@ -1111,10 +1091,10 @@ static struct clk_lookup lookups[] = { | |||
1111 | _REGISTER_CLOCK("lpc32xx_keys.0", NULL, clk_kscan) | 1091 | _REGISTER_CLOCK("lpc32xx_keys.0", NULL, clk_kscan) |
1112 | _REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand) | 1092 | _REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand) |
1113 | _REGISTER_CLOCK("lpc32xx-adc", NULL, clk_adc) | 1093 | _REGISTER_CLOCK("lpc32xx-adc", NULL, clk_adc) |
1114 | _REGISTER_CLOCK("tbd", "i2s0_ck", clk_i2s0) | 1094 | _REGISTER_CLOCK(NULL, "i2s0_ck", clk_i2s0) |
1115 | _REGISTER_CLOCK("tbd", "i2s1_ck", clk_i2s1) | 1095 | _REGISTER_CLOCK(NULL, "i2s1_ck", clk_i2s1) |
1116 | _REGISTER_CLOCK("ts-lpc32xx", NULL, clk_tsc) | 1096 | _REGISTER_CLOCK("ts-lpc32xx", NULL, clk_tsc) |
1117 | _REGISTER_CLOCK("dev:mmc0", "MCLK", clk_mmc) | 1097 | _REGISTER_CLOCK("dev:mmc0", NULL, clk_mmc) |
1118 | _REGISTER_CLOCK("lpc-net.0", NULL, clk_net) | 1098 | _REGISTER_CLOCK("lpc-net.0", NULL, clk_net) |
1119 | _REGISTER_CLOCK("dev:clcd", NULL, clk_lcd) | 1099 | _REGISTER_CLOCK("dev:clcd", NULL, clk_lcd) |
1120 | _REGISTER_CLOCK("lpc32xx_udc", "ck_usbd", clk_usbd) | 1100 | _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 04b72739eb9c..68f2e46d98ad 100644 --- a/arch/arm/mach-lpc32xx/common.h +++ b/arch/arm/mach-lpc32xx/common.h | |||
@@ -66,7 +66,6 @@ extern u32 clk_get_pclk_div(void); | |||
66 | */ | 66 | */ |
67 | extern void lpc32xx_get_uid(u32 devid[4]); | 67 | extern void lpc32xx_get_uid(u32 devid[4]); |
68 | 68 | ||
69 | extern void lpc32xx_watchdog_reset(void); | ||
70 | extern u32 lpc32xx_return_iram_size(void); | 69 | extern u32 lpc32xx_return_iram_size(void); |
71 | 70 | ||
72 | /* | 71 | /* |
diff --git a/arch/arm/mach-lpc32xx/include/mach/platform.h b/arch/arm/mach-lpc32xx/include/mach/platform.h index 14ea8d1aadb5..c584f5bb164f 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 a539f4f72f28..0d79a3f8a5e0 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 | ||
249 | static struct platform_device *phy3250_devs[] __initdata = { | 249 | static 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 b9c80597b7bf..207e81275ff0 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 b42c909bbeeb..c40667c33161 100644 --- a/arch/arm/mach-lpc32xx/timer.c +++ b/arch/arm/mach-lpc32xx/timer.c | |||
@@ -34,11 +34,11 @@ | |||
34 | static int lpc32xx_clkevt_next_event(unsigned long delta, | 34 | static 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 | ||