aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-realview/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-realview/core.c')
-rw-r--r--arch/arm/mach-realview/core.c63
1 files changed, 14 insertions, 49 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 75dbc8791d05..5c23450d2d1d 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -31,6 +31,7 @@
31#include <linux/amba/mmci.h> 31#include <linux/amba/mmci.h>
32#include <linux/gfp.h> 32#include <linux/gfp.h>
33#include <linux/clkdev.h> 33#include <linux/clkdev.h>
34#include <linux/mtd/physmap.h>
34 35
35#include <asm/system.h> 36#include <asm/system.h>
36#include <mach/hardware.h> 37#include <mach/hardware.h>
@@ -41,7 +42,6 @@
41#include <asm/hardware/icst.h> 42#include <asm/hardware/icst.h>
42 43
43#include <asm/mach/arch.h> 44#include <asm/mach/arch.h>
44#include <asm/mach/flash.h>
45#include <asm/mach/irq.h> 45#include <asm/mach/irq.h>
46#include <asm/mach/map.h> 46#include <asm/mach/map.h>
47 47
@@ -56,48 +56,9 @@
56 56
57#include "core.h" 57#include "core.h"
58 58
59#ifdef CONFIG_ZONE_DMA
60/*
61 * Adjust the zones if there are restrictions for DMA access.
62 */
63void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)
64{
65 unsigned long dma_size = SZ_256M >> PAGE_SHIFT;
66
67 if (!machine_is_realview_pbx() || size[0] <= dma_size)
68 return;
69
70 size[ZONE_NORMAL] = size[0] - dma_size;
71 size[ZONE_DMA] = dma_size;
72 hole[ZONE_NORMAL] = hole[0];
73 hole[ZONE_DMA] = 0;
74}
75#endif
76
77
78#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) 59#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)
79 60
80static int realview_flash_init(void) 61static void realview_flash_set_vpp(struct platform_device *pdev, int on)
81{
82 u32 val;
83
84 val = __raw_readl(REALVIEW_FLASHCTRL);
85 val &= ~REALVIEW_FLASHPROG_FLVPPEN;
86 __raw_writel(val, REALVIEW_FLASHCTRL);
87
88 return 0;
89}
90
91static void realview_flash_exit(void)
92{
93 u32 val;
94
95 val = __raw_readl(REALVIEW_FLASHCTRL);
96 val &= ~REALVIEW_FLASHPROG_FLVPPEN;
97 __raw_writel(val, REALVIEW_FLASHCTRL);
98}
99
100static void realview_flash_set_vpp(int on)
101{ 62{
102 u32 val; 63 u32 val;
103 64
@@ -109,16 +70,13 @@ static void realview_flash_set_vpp(int on)
109 __raw_writel(val, REALVIEW_FLASHCTRL); 70 __raw_writel(val, REALVIEW_FLASHCTRL);
110} 71}
111 72
112static struct flash_platform_data realview_flash_data = { 73static struct physmap_flash_data realview_flash_data = {
113 .map_name = "cfi_probe",
114 .width = 4, 74 .width = 4,
115 .init = realview_flash_init,
116 .exit = realview_flash_exit,
117 .set_vpp = realview_flash_set_vpp, 75 .set_vpp = realview_flash_set_vpp,
118}; 76};
119 77
120struct platform_device realview_flash_device = { 78struct platform_device realview_flash_device = {
121 .name = "armflash", 79 .name = "physmap-flash",
122 .id = 0, 80 .id = 0,
123 .dev = { 81 .dev = {
124 .platform_data = &realview_flash_data, 82 .platform_data = &realview_flash_data,
@@ -315,6 +273,10 @@ static struct clk ref24_clk = {
315 .rate = 24000000, 273 .rate = 24000000,
316}; 274};
317 275
276static struct clk sp804_clk = {
277 .rate = 1000000,
278};
279
318static struct clk dummy_apb_pclk; 280static struct clk dummy_apb_pclk;
319 281
320static struct clk_lookup lookups[] = { 282static struct clk_lookup lookups[] = {
@@ -357,7 +319,10 @@ static struct clk_lookup lookups[] = {
357 }, { /* SSP */ 319 }, { /* SSP */
358 .dev_id = "dev:ssp0", 320 .dev_id = "dev:ssp0",
359 .clk = &ref24_clk, 321 .clk = &ref24_clk,
360 } 322 }, { /* SP804 timers */
323 .dev_id = "sp804",
324 .clk = &sp804_clk,
325 },
361}; 326};
362 327
363void __init realview_init_early(void) 328void __init realview_init_early(void)
@@ -545,8 +510,8 @@ void __init realview_timer_init(unsigned int timer_irq)
545 writel(0, timer2_va_base + TIMER_CTRL); 510 writel(0, timer2_va_base + TIMER_CTRL);
546 writel(0, timer3_va_base + TIMER_CTRL); 511 writel(0, timer3_va_base + TIMER_CTRL);
547 512
548 sp804_clocksource_init(timer3_va_base); 513 sp804_clocksource_init(timer3_va_base, "timer3");
549 sp804_clockevents_init(timer0_va_base, timer_irq); 514 sp804_clockevents_init(timer0_va_base, timer_irq, "timer0");
550} 515}
551 516
552/* 517/*