aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-sa1100/generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-sa1100/generic.c')
-rw-r--r--arch/arm/mach-sa1100/generic.c64
1 files changed, 33 insertions, 31 deletions
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 3c1fcd696714..59d14f0fdcf8 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -16,9 +16,7 @@
16#include <linux/pm.h> 16#include <linux/pm.h>
17#include <linux/cpufreq.h> 17#include <linux/cpufreq.h>
18#include <linux/ioport.h> 18#include <linux/ioport.h>
19#include <linux/sched.h> /* just for sched_clock() - funny that */
20#include <linux/platform_device.h> 19#include <linux/platform_device.h>
21#include <linux/cnt32_to_63.h>
22 20
23#include <asm/div64.h> 21#include <asm/div64.h>
24#include <mach/hardware.h> 22#include <mach/hardware.h>
@@ -110,27 +108,6 @@ unsigned int sa11x0_getspeed(unsigned int cpu)
110} 108}
111 109
112/* 110/*
113 * This is the SA11x0 sched_clock implementation. This has
114 * a resolution of 271ns, and a maximum value of 32025597s (370 days).
115 *
116 * The return value is guaranteed to be monotonic in that range as
117 * long as there is always less than 582 seconds between successive
118 * calls to this function.
119 *
120 * ( * 1E9 / 3686400 => * 78125 / 288)
121 */
122unsigned long long sched_clock(void)
123{
124 unsigned long long v = cnt32_to_63(OSCR);
125
126 /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
127 v *= 78125<<1;
128 do_div(v, 288<<1);
129
130 return v;
131}
132
133/*
134 * Default power-off for SA1100 111 * Default power-off for SA1100
135 */ 112 */
136static void sa1100_power_off(void) 113static void sa1100_power_off(void)
@@ -163,10 +140,15 @@ static void sa11x0_register_device(struct platform_device *dev, void *data)
163 140
164static struct resource sa11x0udc_resources[] = { 141static struct resource sa11x0udc_resources[] = {
165 [0] = { 142 [0] = {
166 .start = 0x80000000, 143 .start = __PREG(Ser0UDCCR),
167 .end = 0x8000ffff, 144 .end = __PREG(Ser0UDCCR) + 0xffff,
168 .flags = IORESOURCE_MEM, 145 .flags = IORESOURCE_MEM,
169 }, 146 },
147 [1] = {
148 .start = IRQ_Ser0UDC,
149 .end = IRQ_Ser0UDC,
150 .flags = IORESOURCE_IRQ,
151 },
170}; 152};
171 153
172static u64 sa11x0udc_dma_mask = 0xffffffffUL; 154static u64 sa11x0udc_dma_mask = 0xffffffffUL;
@@ -184,10 +166,15 @@ static struct platform_device sa11x0udc_device = {
184 166
185static struct resource sa11x0uart1_resources[] = { 167static struct resource sa11x0uart1_resources[] = {
186 [0] = { 168 [0] = {
187 .start = 0x80010000, 169 .start = __PREG(Ser1UTCR0),
188 .end = 0x8001ffff, 170 .end = __PREG(Ser1UTCR0) + 0xffff,
189 .flags = IORESOURCE_MEM, 171 .flags = IORESOURCE_MEM,
190 }, 172 },
173 [1] = {
174 .start = IRQ_Ser1UART,
175 .end = IRQ_Ser1UART,
176 .flags = IORESOURCE_IRQ,
177 },
191}; 178};
192 179
193static struct platform_device sa11x0uart1_device = { 180static struct platform_device sa11x0uart1_device = {
@@ -199,10 +186,15 @@ static struct platform_device sa11x0uart1_device = {
199 186
200static struct resource sa11x0uart3_resources[] = { 187static struct resource sa11x0uart3_resources[] = {
201 [0] = { 188 [0] = {
202 .start = 0x80050000, 189 .start = __PREG(Ser3UTCR0),
203 .end = 0x8005ffff, 190 .end = __PREG(Ser3UTCR0) + 0xffff,
204 .flags = IORESOURCE_MEM, 191 .flags = IORESOURCE_MEM,
205 }, 192 },
193 [1] = {
194 .start = IRQ_Ser3UART,
195 .end = IRQ_Ser3UART,
196 .flags = IORESOURCE_IRQ,
197 },
206}; 198};
207 199
208static struct platform_device sa11x0uart3_device = { 200static struct platform_device sa11x0uart3_device = {
@@ -214,10 +206,15 @@ static struct platform_device sa11x0uart3_device = {
214 206
215static struct resource sa11x0mcp_resources[] = { 207static struct resource sa11x0mcp_resources[] = {
216 [0] = { 208 [0] = {
217 .start = 0x80060000, 209 .start = __PREG(Ser4MCCR0),
218 .end = 0x8006ffff, 210 .end = __PREG(Ser4MCCR0) + 0xffff,
219 .flags = IORESOURCE_MEM, 211 .flags = IORESOURCE_MEM,
220 }, 212 },
213 [1] = {
214 .start = IRQ_Ser4MCP,
215 .end = IRQ_Ser4MCP,
216 .flags = IORESOURCE_IRQ,
217 },
221}; 218};
222 219
223static u64 sa11x0mcp_dma_mask = 0xffffffffUL; 220static u64 sa11x0mcp_dma_mask = 0xffffffffUL;
@@ -244,6 +241,11 @@ static struct resource sa11x0ssp_resources[] = {
244 .end = 0x8007ffff, 241 .end = 0x8007ffff,
245 .flags = IORESOURCE_MEM, 242 .flags = IORESOURCE_MEM,
246 }, 243 },
244 [1] = {
245 .start = IRQ_Ser4SSP,
246 .end = IRQ_Ser4SSP,
247 .flags = IORESOURCE_IRQ,
248 },
247}; 249};
248 250
249static u64 sa11x0ssp_dma_mask = 0xffffffffUL; 251static u64 sa11x0ssp_dma_mask = 0xffffffffUL;