diff options
author | Roland Stigge <stigge@antcom.de> | 2012-03-13 16:14:01 -0400 |
---|---|---|
committer | Roland Stigge <stigge@antcom.de> | 2012-03-13 16:14:01 -0400 |
commit | 73d43d00649985cf6509b4f99a720665f1b7c559 (patch) | |
tree | 83bf1a95c38838661152baf3990073a45c19ec8f /arch | |
parent | bb200029fc5812b4189914597f0341cd841b6f46 (diff) | |
parent | cfac337b0fbcad5181096ab72bb24a05bd444562 (diff) |
Merge branch 'lpc32xx/fixup2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc into lpc32xx/tmp
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-lpc32xx/include/mach/platform.h | 51 | ||||
-rw-r--r-- | arch/arm/mach-lpc32xx/pm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-lpc32xx/timer.c | 48 |
3 files changed, 52 insertions, 49 deletions
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/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 | ||