diff options
Diffstat (limited to 'arch/arm/mach-realview')
-rw-r--r-- | arch/arm/mach-realview/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/clock.c | 80 | ||||
-rw-r--r-- | arch/arm/mach-realview/clock.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-realview/core.c | 52 | ||||
-rw-r--r-- | arch/arm/mach-realview/core.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/clkdev.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/dma.h | 20 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/io.h | 9 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/memory.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/platform.h | 19 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_eb.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb1176.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb11mp.c | 2 |
13 files changed, 67 insertions, 145 deletions
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig index b117c13407c1..ad911854eb4c 100644 --- a/arch/arm/mach-realview/Kconfig +++ b/arch/arm/mach-realview/Kconfig | |||
@@ -17,6 +17,7 @@ config REALVIEW_EB_A9MP | |||
17 | config REALVIEW_EB_ARM11MP | 17 | config REALVIEW_EB_ARM11MP |
18 | bool "Support ARM11MPCore tile" | 18 | bool "Support ARM11MPCore tile" |
19 | depends on MACH_REALVIEW_EB | 19 | depends on MACH_REALVIEW_EB |
20 | select CPU_V6 | ||
20 | help | 21 | help |
21 | Enable support for the ARM11MPCore tile on the Realview platform. | 22 | Enable support for the ARM11MPCore tile on the Realview platform. |
22 | 23 | ||
@@ -41,6 +42,7 @@ config MACH_REALVIEW_PB11MP | |||
41 | 42 | ||
42 | config MACH_REALVIEW_PB1176 | 43 | config MACH_REALVIEW_PB1176 |
43 | bool "Support RealView/PB1176 platform" | 44 | bool "Support RealView/PB1176 platform" |
45 | select CPU_V6 | ||
44 | select ARM_GIC | 46 | select ARM_GIC |
45 | help | 47 | help |
46 | Include support for the ARM(R) RealView ARM1176 Platform Baseboard. | 48 | Include support for the ARM(R) RealView ARM1176 Platform Baseboard. |
diff --git a/arch/arm/mach-realview/clock.c b/arch/arm/mach-realview/clock.c index 3e706c57833a..a7043115de72 100644 --- a/arch/arm/mach-realview/clock.c +++ b/arch/arm/mach-realview/clock.c | |||
@@ -10,9 +10,11 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/device.h> | ||
13 | #include <linux/list.h> | 14 | #include <linux/list.h> |
14 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
15 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <linux/string.h> | ||
16 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
17 | #include <linux/mutex.h> | 19 | #include <linux/mutex.h> |
18 | 20 | ||
@@ -20,32 +22,6 @@ | |||
20 | 22 | ||
21 | #include "clock.h" | 23 | #include "clock.h" |
22 | 24 | ||
23 | static LIST_HEAD(clocks); | ||
24 | static DEFINE_MUTEX(clocks_mutex); | ||
25 | |||
26 | struct clk *clk_get(struct device *dev, const char *id) | ||
27 | { | ||
28 | struct clk *p, *clk = ERR_PTR(-ENOENT); | ||
29 | |||
30 | mutex_lock(&clocks_mutex); | ||
31 | list_for_each_entry(p, &clocks, node) { | ||
32 | if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { | ||
33 | clk = p; | ||
34 | break; | ||
35 | } | ||
36 | } | ||
37 | mutex_unlock(&clocks_mutex); | ||
38 | |||
39 | return clk; | ||
40 | } | ||
41 | EXPORT_SYMBOL(clk_get); | ||
42 | |||
43 | void clk_put(struct clk *clk) | ||
44 | { | ||
45 | module_put(clk->owner); | ||
46 | } | ||
47 | EXPORT_SYMBOL(clk_put); | ||
48 | |||
49 | int clk_enable(struct clk *clk) | 25 | int clk_enable(struct clk *clk) |
50 | { | 26 | { |
51 | return 0; | 27 | return 0; |
@@ -65,7 +41,9 @@ EXPORT_SYMBOL(clk_get_rate); | |||
65 | 41 | ||
66 | long clk_round_rate(struct clk *clk, unsigned long rate) | 42 | long clk_round_rate(struct clk *clk, unsigned long rate) |
67 | { | 43 | { |
68 | return rate; | 44 | struct icst307_vco vco; |
45 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | ||
46 | return icst307_khz(clk->params, vco) * 1000; | ||
69 | } | 47 | } |
70 | EXPORT_SYMBOL(clk_round_rate); | 48 | EXPORT_SYMBOL(clk_round_rate); |
71 | 49 | ||
@@ -78,57 +56,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
78 | 56 | ||
79 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | 57 | vco = icst307_khz_to_vco(clk->params, rate / 1000); |
80 | clk->rate = icst307_khz(clk->params, vco) * 1000; | 58 | clk->rate = icst307_khz(clk->params, vco) * 1000; |
81 | |||
82 | printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n", | ||
83 | clk->name, vco.s, vco.r, vco.v); | ||
84 | |||
85 | clk->setvco(clk, vco); | 59 | clk->setvco(clk, vco); |
86 | ret = 0; | 60 | ret = 0; |
87 | } | 61 | } |
88 | return ret; | 62 | return ret; |
89 | } | 63 | } |
90 | EXPORT_SYMBOL(clk_set_rate); | 64 | EXPORT_SYMBOL(clk_set_rate); |
91 | |||
92 | /* | ||
93 | * These are fixed clocks. | ||
94 | */ | ||
95 | static struct clk kmi_clk = { | ||
96 | .name = "KMIREFCLK", | ||
97 | .rate = 24000000, | ||
98 | }; | ||
99 | |||
100 | static struct clk uart_clk = { | ||
101 | .name = "UARTCLK", | ||
102 | .rate = 24000000, | ||
103 | }; | ||
104 | |||
105 | static struct clk mmci_clk = { | ||
106 | .name = "MCLK", | ||
107 | .rate = 33000000, | ||
108 | }; | ||
109 | |||
110 | int clk_register(struct clk *clk) | ||
111 | { | ||
112 | mutex_lock(&clocks_mutex); | ||
113 | list_add(&clk->node, &clocks); | ||
114 | mutex_unlock(&clocks_mutex); | ||
115 | return 0; | ||
116 | } | ||
117 | EXPORT_SYMBOL(clk_register); | ||
118 | |||
119 | void clk_unregister(struct clk *clk) | ||
120 | { | ||
121 | mutex_lock(&clocks_mutex); | ||
122 | list_del(&clk->node); | ||
123 | mutex_unlock(&clocks_mutex); | ||
124 | } | ||
125 | EXPORT_SYMBOL(clk_unregister); | ||
126 | |||
127 | static int __init clk_init(void) | ||
128 | { | ||
129 | clk_register(&kmi_clk); | ||
130 | clk_register(&uart_clk); | ||
131 | clk_register(&mmci_clk); | ||
132 | return 0; | ||
133 | } | ||
134 | arch_initcall(clk_init); | ||
diff --git a/arch/arm/mach-realview/clock.h b/arch/arm/mach-realview/clock.h index dadba695e181..ebbb0f06b600 100644 --- a/arch/arm/mach-realview/clock.h +++ b/arch/arm/mach-realview/clock.h | |||
@@ -12,14 +12,8 @@ struct module; | |||
12 | struct icst307_params; | 12 | struct icst307_params; |
13 | 13 | ||
14 | struct clk { | 14 | struct clk { |
15 | struct list_head node; | ||
16 | unsigned long rate; | 15 | unsigned long rate; |
17 | struct module *owner; | ||
18 | const char *name; | ||
19 | const struct icst307_params *params; | 16 | const struct icst307_params *params; |
20 | void *data; | 17 | void *data; |
21 | void (*setvco)(struct clk *, struct icst307_vco vco); | 18 | void (*setvco)(struct clk *, struct icst307_vco vco); |
22 | }; | 19 | }; |
23 | |||
24 | int clk_register(struct clk *clk); | ||
25 | void clk_unregister(struct clk *clk); | ||
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 86aa6d74126f..5f1d55963ced 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/io.h> | 30 | #include <linux/io.h> |
31 | #include <linux/smc911x.h> | 31 | #include <linux/smc911x.h> |
32 | 32 | ||
33 | #include <asm/clkdev.h> | ||
33 | #include <asm/system.h> | 34 | #include <asm/system.h> |
34 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
35 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
@@ -218,13 +219,60 @@ static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco) | |||
218 | writel(0, sys_lock); | 219 | writel(0, sys_lock); |
219 | } | 220 | } |
220 | 221 | ||
221 | struct clk realview_clcd_clk = { | 222 | static struct clk oscvco_clk = { |
222 | .name = "CLCDCLK", | ||
223 | .params = &realview_oscvco_params, | 223 | .params = &realview_oscvco_params, |
224 | .setvco = realview_oscvco_set, | 224 | .setvco = realview_oscvco_set, |
225 | }; | 225 | }; |
226 | 226 | ||
227 | /* | 227 | /* |
228 | * These are fixed clocks. | ||
229 | */ | ||
230 | static struct clk ref24_clk = { | ||
231 | .rate = 24000000, | ||
232 | }; | ||
233 | |||
234 | static struct clk_lookup lookups[] = { | ||
235 | { /* UART0 */ | ||
236 | .dev_id = "dev:f1", | ||
237 | .clk = &ref24_clk, | ||
238 | }, { /* UART1 */ | ||
239 | .dev_id = "dev:f2", | ||
240 | .clk = &ref24_clk, | ||
241 | }, { /* UART2 */ | ||
242 | .dev_id = "dev:f3", | ||
243 | .clk = &ref24_clk, | ||
244 | }, { /* UART3 */ | ||
245 | .dev_id = "fpga:09", | ||
246 | .clk = &ref24_clk, | ||
247 | }, { /* KMI0 */ | ||
248 | .dev_id = "fpga:06", | ||
249 | .clk = &ref24_clk, | ||
250 | }, { /* KMI1 */ | ||
251 | .dev_id = "fpga:07", | ||
252 | .clk = &ref24_clk, | ||
253 | }, { /* MMC0 */ | ||
254 | .dev_id = "fpga:05", | ||
255 | .clk = &ref24_clk, | ||
256 | }, { /* EB:CLCD */ | ||
257 | .dev_id = "dev:20", | ||
258 | .clk = &oscvco_clk, | ||
259 | }, { /* PB:CLCD */ | ||
260 | .dev_id = "issp:20", | ||
261 | .clk = &oscvco_clk, | ||
262 | } | ||
263 | }; | ||
264 | |||
265 | static int __init clk_init(void) | ||
266 | { | ||
267 | int i; | ||
268 | |||
269 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | ||
270 | clkdev_add(&lookups[i]); | ||
271 | return 0; | ||
272 | } | ||
273 | arch_initcall(clk_init); | ||
274 | |||
275 | /* | ||
228 | * CLCD support. | 276 | * CLCD support. |
229 | */ | 277 | */ |
230 | #define SYS_CLCD_NLCDIOON (1 << 2) | 278 | #define SYS_CLCD_NLCDIOON (1 << 2) |
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h index 689c368368f7..63be2abdc19c 100644 --- a/arch/arm/mach-realview/core.h +++ b/arch/arm/mach-realview/core.h | |||
@@ -48,7 +48,6 @@ extern struct platform_device realview_flash_device; | |||
48 | extern struct platform_device realview_i2c_device; | 48 | extern struct platform_device realview_i2c_device; |
49 | extern struct mmc_platform_data realview_mmc0_plat_data; | 49 | extern struct mmc_platform_data realview_mmc0_plat_data; |
50 | extern struct mmc_platform_data realview_mmc1_plat_data; | 50 | extern struct mmc_platform_data realview_mmc1_plat_data; |
51 | extern struct clk realview_clcd_clk; | ||
52 | extern struct clcd_board clcd_plat_data; | 51 | extern struct clcd_board clcd_plat_data; |
53 | extern void __iomem *gic_cpu_base_addr; | 52 | extern void __iomem *gic_cpu_base_addr; |
54 | #ifdef CONFIG_LOCAL_TIMERS | 53 | #ifdef CONFIG_LOCAL_TIMERS |
diff --git a/arch/arm/mach-realview/include/mach/clkdev.h b/arch/arm/mach-realview/include/mach/clkdev.h new file mode 100644 index 000000000000..04b37a89801c --- /dev/null +++ b/arch/arm/mach-realview/include/mach/clkdev.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | ||
2 | #define __ASM_MACH_CLKDEV_H | ||
3 | |||
4 | #define __clk_get(clk) ({ 1; }) | ||
5 | #define __clk_put(clk) do { } while (0) | ||
6 | |||
7 | #endif | ||
diff --git a/arch/arm/mach-realview/include/mach/dma.h b/arch/arm/mach-realview/include/mach/dma.h deleted file mode 100644 index f1a5a1a10952..000000000000 --- a/arch/arm/mach-realview/include/mach/dma.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-realview/include/mach/dma.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited. | ||
5 | * Copyright (C) 1997,1998 Russell King | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
diff --git a/arch/arm/mach-realview/include/mach/io.h b/arch/arm/mach-realview/include/mach/io.h index aa069424d310..f05bcdf605d8 100644 --- a/arch/arm/mach-realview/include/mach/io.h +++ b/arch/arm/mach-realview/include/mach/io.h | |||
@@ -22,12 +22,7 @@ | |||
22 | 22 | ||
23 | #define IO_SPACE_LIMIT 0xffffffff | 23 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 24 | ||
25 | static inline void __iomem *__io(unsigned long addr) | 25 | #define __io(a) __typesafe_io(a) |
26 | { | 26 | #define __mem_pci(a) (a) |
27 | return (void __iomem *)addr; | ||
28 | } | ||
29 | |||
30 | #define __io(a) __io(a) | ||
31 | #define __mem_pci(a) (a) | ||
32 | 27 | ||
33 | #endif | 28 | #endif |
diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h index 759ed10d74fe..293c30025e7e 100644 --- a/arch/arm/mach-realview/include/mach/memory.h +++ b/arch/arm/mach-realview/include/mach/memory.h | |||
@@ -29,14 +29,4 @@ | |||
29 | #define PHYS_OFFSET UL(0x00000000) | 29 | #define PHYS_OFFSET UL(0x00000000) |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | /* | ||
33 | * Virtual view <-> DMA view memory address translations | ||
34 | * virt_to_bus: Used to translate the virtual address to an | ||
35 | * address suitable to be passed to set_dma_addr | ||
36 | * bus_to_virt: Used to convert an address for DMA operations | ||
37 | * to an address that the kernel can use. | ||
38 | */ | ||
39 | #define __virt_to_bus(x) ((x) - PAGE_OFFSET) | ||
40 | #define __bus_to_virt(x) ((x) + PAGE_OFFSET) | ||
41 | |||
42 | #endif | 32 | #endif |
diff --git a/arch/arm/mach-realview/include/mach/platform.h b/arch/arm/mach-realview/include/mach/platform.h index 4034b54950c2..793a3a332712 100644 --- a/arch/arm/mach-realview/include/mach/platform.h +++ b/arch/arm/mach-realview/include/mach/platform.h | |||
@@ -239,27 +239,10 @@ | |||
239 | #define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */ | 239 | #define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */ |
240 | 240 | ||
241 | /* | 241 | /* |
242 | * Application Flash | ||
243 | * | ||
244 | */ | ||
245 | #define FLASH_BASE REALVIEW_FLASH_BASE | ||
246 | #define FLASH_SIZE REALVIEW_FLASH_SIZE | ||
247 | #define FLASH_END (FLASH_BASE + FLASH_SIZE - 1) | ||
248 | #define FLASH_BLOCK_SIZE SZ_128K | ||
249 | |||
250 | /* | ||
251 | * Boot Flash | ||
252 | * | ||
253 | */ | ||
254 | #define EPROM_BASE REALVIEW_BOOT_ROM_HI | ||
255 | #define EPROM_SIZE REALVIEW_BOOT_ROM_SIZE | ||
256 | #define EPROM_END (EPROM_BASE + EPROM_SIZE - 1) | ||
257 | |||
258 | /* | ||
259 | * Clean base - dummy | 242 | * Clean base - dummy |
260 | * | 243 | * |
261 | */ | 244 | */ |
262 | #define CLEAN_BASE EPROM_BASE | 245 | #define CLEAN_BASE REALVIEW_BOOT_ROM_HI |
263 | 246 | ||
264 | /* | 247 | /* |
265 | * System controller bit assignment | 248 | * System controller bit assignment |
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index e9b7b04c2fe6..bed39ed97613 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -363,8 +363,6 @@ static void __init realview_eb_init(void) | |||
363 | #endif | 363 | #endif |
364 | } | 364 | } |
365 | 365 | ||
366 | clk_register(&realview_clcd_clk); | ||
367 | |||
368 | realview_flash_register(&realview_eb_flash_resource, 1); | 366 | realview_flash_register(&realview_eb_flash_resource, 1); |
369 | platform_device_register(&realview_i2c_device); | 367 | platform_device_register(&realview_i2c_device); |
370 | eth_device_register(); | 368 | eth_device_register(); |
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index 0388ed06f1e5..8f0683c22140 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -258,8 +258,6 @@ static void __init realview_pb1176_init(void) | |||
258 | l2x0_init(__io_address(REALVIEW_PB1176_L220_BASE), 0x00730000, 0xfe000fff); | 258 | l2x0_init(__io_address(REALVIEW_PB1176_L220_BASE), 0x00730000, 0xfe000fff); |
259 | #endif | 259 | #endif |
260 | 260 | ||
261 | clk_register(&realview_clcd_clk); | ||
262 | |||
263 | realview_flash_register(&realview_pb1176_flash_resource, 1); | 261 | realview_flash_register(&realview_pb1176_flash_resource, 1); |
264 | realview_eth_register(NULL, realview_pb1176_smsc911x_resources); | 262 | realview_eth_register(NULL, realview_pb1176_smsc911x_resources); |
265 | 263 | ||
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index 3f3f052138f1..3ebdb2dadd6f 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -304,8 +304,6 @@ static void __init realview_pb11mp_init(void) | |||
304 | l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE), 0x00790000, 0xfe000fff); | 304 | l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE), 0x00790000, 0xfe000fff); |
305 | #endif | 305 | #endif |
306 | 306 | ||
307 | clk_register(&realview_clcd_clk); | ||
308 | |||
309 | realview_flash_register(realview_pb11mp_flash_resource, | 307 | realview_flash_register(realview_pb11mp_flash_resource, |
310 | ARRAY_SIZE(realview_pb11mp_flash_resource)); | 308 | ARRAY_SIZE(realview_pb11mp_flash_resource)); |
311 | realview_eth_register(NULL, realview_pb11mp_smsc911x_resources); | 309 | realview_eth_register(NULL, realview_pb11mp_smsc911x_resources); |