diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-02-28 07:38:46 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-02-28 07:38:46 -0500 |
commit | 7169ff4a0942adf524f25713eaed30599d438926 (patch) | |
tree | 08e7077a48d2d5acd4008fec28a913e1d6ee29ee /arch/arm/mach-mmp | |
parent | e135e4506c6d3e9b196890877a9a2815f71b04ac (diff) | |
parent | 4128e27584f58bce9f56a9a0346650c94a651332 (diff) |
Merge branch 'rtc-sa1100' of git://github.com/hzhuang1/linux into next/drivers
* 'rtc-sa1100' of git://github.com/hzhuang1/linux:
ARM: mmp: enable rtc in pxa910
rtc: sa1100: enable clk support
ARM: pxa: add rtc dummy clock
ARM: sa1100: clean up clock support
rtc: sa1100: declare irq in resource
rtc: sa1100: remove verification code of alarm
rtc: sa1100: remove periodic code
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r-- | arch/arm/mach-mmp/include/mach/pxa910.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-mmp/include/mach/regs-apbc.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-mmp/include/mach/regs-rtc.h | 23 | ||||
-rw-r--r-- | arch/arm/mach-mmp/pxa910.c | 27 | ||||
-rw-r--r-- | arch/arm/mach-mmp/ttc_dkb.c | 1 |
5 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h index 4de13abef7bb..e2e1f1e5e124 100644 --- a/arch/arm/mach-mmp/include/mach/pxa910.h +++ b/arch/arm/mach-mmp/include/mach/pxa910.h | |||
@@ -22,6 +22,7 @@ extern struct pxa_device_desc pxa910_device_pwm4; | |||
22 | extern struct pxa_device_desc pxa910_device_nand; | 22 | extern struct pxa_device_desc pxa910_device_nand; |
23 | 23 | ||
24 | extern struct platform_device pxa910_device_gpio; | 24 | extern struct platform_device pxa910_device_gpio; |
25 | extern struct platform_device pxa910_device_rtc; | ||
25 | 26 | ||
26 | static inline int pxa910_add_uart(int id) | 27 | static inline int pxa910_add_uart(int id) |
27 | { | 28 | { |
diff --git a/arch/arm/mach-mmp/include/mach/regs-apbc.h b/arch/arm/mach-mmp/include/mach/regs-apbc.h index 1a96585336ba..8a37fb003655 100644 --- a/arch/arm/mach-mmp/include/mach/regs-apbc.h +++ b/arch/arm/mach-mmp/include/mach/regs-apbc.h | |||
@@ -57,6 +57,7 @@ | |||
57 | #define APBC_PXA910_SSP1 APBC_REG(0x01c) | 57 | #define APBC_PXA910_SSP1 APBC_REG(0x01c) |
58 | #define APBC_PXA910_SSP2 APBC_REG(0x020) | 58 | #define APBC_PXA910_SSP2 APBC_REG(0x020) |
59 | #define APBC_PXA910_IPC APBC_REG(0x024) | 59 | #define APBC_PXA910_IPC APBC_REG(0x024) |
60 | #define APBC_PXA910_RTC APBC_REG(0x028) | ||
60 | #define APBC_PXA910_TWSI0 APBC_REG(0x02c) | 61 | #define APBC_PXA910_TWSI0 APBC_REG(0x02c) |
61 | #define APBC_PXA910_KPC APBC_REG(0x030) | 62 | #define APBC_PXA910_KPC APBC_REG(0x030) |
62 | #define APBC_PXA910_TIMERS APBC_REG(0x034) | 63 | #define APBC_PXA910_TIMERS APBC_REG(0x034) |
diff --git a/arch/arm/mach-mmp/include/mach/regs-rtc.h b/arch/arm/mach-mmp/include/mach/regs-rtc.h new file mode 100644 index 000000000000..5bff886a3941 --- /dev/null +++ b/arch/arm/mach-mmp/include/mach/regs-rtc.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef __ASM_MACH_REGS_RTC_H | ||
2 | #define __ASM_MACH_REGS_RTC_H | ||
3 | |||
4 | #include <mach/addr-map.h> | ||
5 | |||
6 | #define RTC_VIRT_BASE (APB_VIRT_BASE + 0x10000) | ||
7 | #define RTC_REG(x) (*((volatile u32 __iomem *)(RTC_VIRT_BASE + (x)))) | ||
8 | |||
9 | /* | ||
10 | * Real Time Clock | ||
11 | */ | ||
12 | |||
13 | #define RCNR RTC_REG(0x00) /* RTC Count Register */ | ||
14 | #define RTAR RTC_REG(0x04) /* RTC Alarm Register */ | ||
15 | #define RTSR RTC_REG(0x08) /* RTC Status Register */ | ||
16 | #define RTTR RTC_REG(0x0C) /* RTC Timer Trim Register */ | ||
17 | |||
18 | #define RTSR_HZE (1 << 3) /* HZ interrupt enable */ | ||
19 | #define RTSR_ALE (1 << 2) /* RTC alarm interrupt enable */ | ||
20 | #define RTSR_HZ (1 << 1) /* HZ rising-edge detected */ | ||
21 | #define RTSR_AL (1 << 0) /* RTC alarm detected */ | ||
22 | |||
23 | #endif /* __ASM_MACH_REGS_RTC_H */ | ||
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 3241a25784d0..b6e152723974 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
@@ -92,6 +92,7 @@ static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000); | |||
92 | static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); | 92 | static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); |
93 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); | 93 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); |
94 | static APBC_CLK(gpio, PXA910_GPIO, 0, 13000000); | 94 | static APBC_CLK(gpio, PXA910_GPIO, 0, 13000000); |
95 | static APBC_CLK(rtc, PXA910_RTC, 8, 32768); | ||
95 | 96 | ||
96 | static APMU_CLK(nand, NAND, 0x19b, 156000000); | 97 | static APMU_CLK(nand, NAND, 0x19b, 156000000); |
97 | static APMU_CLK(u2o, USB, 0x1b, 480000000); | 98 | static APMU_CLK(u2o, USB, 0x1b, 480000000); |
@@ -109,6 +110,7 @@ static struct clk_lookup pxa910_clkregs[] = { | |||
109 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 110 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
110 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | 111 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), |
111 | INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), | 112 | INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), |
113 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), | ||
112 | }; | 114 | }; |
113 | 115 | ||
114 | static int __init pxa910_init(void) | 116 | static int __init pxa910_init(void) |
@@ -183,3 +185,28 @@ struct platform_device pxa910_device_gpio = { | |||
183 | .num_resources = ARRAY_SIZE(pxa910_resource_gpio), | 185 | .num_resources = ARRAY_SIZE(pxa910_resource_gpio), |
184 | .resource = pxa910_resource_gpio, | 186 | .resource = pxa910_resource_gpio, |
185 | }; | 187 | }; |
188 | |||
189 | static struct resource pxa910_resource_rtc[] = { | ||
190 | { | ||
191 | .start = 0xd4010000, | ||
192 | .end = 0xd401003f, | ||
193 | .flags = IORESOURCE_MEM, | ||
194 | }, { | ||
195 | .start = IRQ_PXA910_RTC_INT, | ||
196 | .end = IRQ_PXA910_RTC_INT, | ||
197 | .name = "rtc 1Hz", | ||
198 | .flags = IORESOURCE_IRQ, | ||
199 | }, { | ||
200 | .start = IRQ_PXA910_RTC_ALARM, | ||
201 | .end = IRQ_PXA910_RTC_ALARM, | ||
202 | .name = "rtc alarm", | ||
203 | .flags = IORESOURCE_IRQ, | ||
204 | }, | ||
205 | }; | ||
206 | |||
207 | struct platform_device pxa910_device_rtc = { | ||
208 | .name = "sa1100-rtc", | ||
209 | .id = -1, | ||
210 | .num_resources = ARRAY_SIZE(pxa910_resource_rtc), | ||
211 | .resource = pxa910_resource_rtc, | ||
212 | }; | ||
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c index 5ac5d5832e45..e72c709da44f 100644 --- a/arch/arm/mach-mmp/ttc_dkb.c +++ b/arch/arm/mach-mmp/ttc_dkb.c | |||
@@ -124,6 +124,7 @@ static struct platform_device ttc_dkb_device_onenand = { | |||
124 | 124 | ||
125 | static struct platform_device *ttc_dkb_devices[] = { | 125 | static struct platform_device *ttc_dkb_devices[] = { |
126 | &pxa910_device_gpio, | 126 | &pxa910_device_gpio, |
127 | &pxa910_device_rtc, | ||
127 | &ttc_dkb_device_onenand, | 128 | &ttc_dkb_device_onenand, |
128 | }; | 129 | }; |
129 | 130 | ||