core.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. /*
  2. * linux/arch/arm/mach-realview/core.c
  3. *
  4. * Copyright (C) 1999 - 2003 ARM Limited
  5. * Copyright (C) 2000 Deep Blue Solutions Ltd
  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. */
  21. #include <linux/init.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/dma-mapping.h>
  24. #include <linux/sysdev.h>
  25. #include <linux/interrupt.h>
  26. #include <linux/amba/bus.h>
  27. #include <linux/amba/clcd.h>
  28. #include <linux/clocksource.h>
  29. #include <linux/clockchips.h>
  30. #include <asm/system.h>
  31. #include <asm/hardware.h>
  32. #include <asm/io.h>
  33. #include <asm/irq.h>
  34. #include <asm/leds.h>
  35. #include <asm/hardware/arm_timer.h>
  36. #include <asm/hardware/icst307.h>
  37. #include <asm/mach/arch.h>
  38. #include <asm/mach/flash.h>
  39. #include <asm/mach/irq.h>
  40. #include <asm/mach/map.h>
  41. #include <asm/mach/mmc.h>
  42. #include <asm/hardware/gic.h>
  43. #include "core.h"
  44. #include "clock.h"
  45. #define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET)
  46. /* used by entry-macro.S */
  47. void __iomem *gic_cpu_base_addr;
  48. /*
  49. * This is the RealView sched_clock implementation. This has
  50. * a resolution of 41.7ns, and a maximum value of about 179s.
  51. */
  52. unsigned long long sched_clock(void)
  53. {
  54. unsigned long long v;
  55. v = (unsigned long long)readl(REALVIEW_REFCOUNTER) * 125;
  56. do_div(v, 3);
  57. return v;
  58. }
  59. #define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)
  60. static int realview_flash_init(void)
  61. {
  62. u32 val;
  63. val = __raw_readl(REALVIEW_FLASHCTRL);
  64. val &= ~REALVIEW_FLASHPROG_FLVPPEN;
  65. __raw_writel(val, REALVIEW_FLASHCTRL);
  66. return 0;
  67. }
  68. static void realview_flash_exit(void)
  69. {
  70. u32 val;
  71. val = __raw_readl(REALVIEW_FLASHCTRL);
  72. val &= ~REALVIEW_FLASHPROG_FLVPPEN;
  73. __raw_writel(val, REALVIEW_FLASHCTRL);
  74. }
  75. static void realview_flash_set_vpp(int on)
  76. {
  77. u32 val;
  78. val = __raw_readl(REALVIEW_FLASHCTRL);
  79. if (on)
  80. val |= REALVIEW_FLASHPROG_FLVPPEN;
  81. else
  82. val &= ~REALVIEW_FLASHPROG_FLVPPEN;
  83. __raw_writel(val, REALVIEW_FLASHCTRL);
  84. }
  85. static struct flash_platform_data realview_flash_data = {
  86. .map_name = "cfi_probe",
  87. .width = 4,
  88. .init = realview_flash_init,
  89. .exit = realview_flash_exit,
  90. .set_vpp = realview_flash_set_vpp,
  91. };
  92. static struct resource realview_flash_resource = {
  93. .start = REALVIEW_FLASH_BASE,
  94. .end = REALVIEW_FLASH_BASE + REALVIEW_FLASH_SIZE,
  95. .flags = IORESOURCE_MEM,
  96. };
  97. struct platform_device realview_flash_device = {
  98. .name = "armflash",
  99. .id = 0,
  100. .dev = {
  101. .platform_data = &realview_flash_data,
  102. },
  103. .num_resources = 1,
  104. .resource = &realview_flash_resource,
  105. };
  106. static struct resource realview_i2c_resource = {
  107. .start = REALVIEW_I2C_BASE,
  108. .end = REALVIEW_I2C_BASE + SZ_4K - 1,
  109. .flags = IORESOURCE_MEM,
  110. };
  111. struct platform_device realview_i2c_device = {
  112. .name = "versatile-i2c",
  113. .id = -1,
  114. .num_resources = 1,
  115. .resource = &realview_i2c_resource,
  116. };
  117. #define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET)
  118. static unsigned int realview_mmc_status(struct device *dev)
  119. {
  120. struct amba_device *adev = container_of(dev, struct amba_device, dev);
  121. u32 mask;
  122. if (adev->res.start == REALVIEW_MMCI0_BASE)
  123. mask = 1;
  124. else
  125. mask = 2;
  126. return readl(REALVIEW_SYSMCI) & mask;
  127. }
  128. struct mmc_platform_data realview_mmc0_plat_data = {
  129. .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
  130. .status = realview_mmc_status,
  131. };
  132. struct mmc_platform_data realview_mmc1_plat_data = {
  133. .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
  134. .status = realview_mmc_status,
  135. };
  136. /*
  137. * Clock handling
  138. */
  139. static const struct icst307_params realview_oscvco_params = {
  140. .ref = 24000,
  141. .vco_max = 200000,
  142. .vd_min = 4 + 8,
  143. .vd_max = 511 + 8,
  144. .rd_min = 1 + 2,
  145. .rd_max = 127 + 2,
  146. };
  147. static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco)
  148. {
  149. void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET;
  150. void __iomem *sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET;
  151. u32 val;
  152. val = readl(sys_osc) & ~0x7ffff;
  153. val |= vco.v | (vco.r << 9) | (vco.s << 16);
  154. writel(0xa05f, sys_lock);
  155. writel(val, sys_osc);
  156. writel(0, sys_lock);
  157. }
  158. struct clk realview_clcd_clk = {
  159. .name = "CLCDCLK",
  160. .params = &realview_oscvco_params,
  161. .setvco = realview_oscvco_set,
  162. };
  163. /*
  164. * CLCD support.
  165. */
  166. #define SYS_CLCD_NLCDIOON (1 << 2)
  167. #define SYS_CLCD_VDDPOSSWITCH (1 << 3)
  168. #define SYS_CLCD_PWR3V5SWITCH (1 << 4)
  169. #define SYS_CLCD_ID_MASK (0x1f << 8)
  170. #define SYS_CLCD_ID_SANYO_3_8 (0x00 << 8)
  171. #define SYS_CLCD_ID_UNKNOWN_8_4 (0x01 << 8)
  172. #define SYS_CLCD_ID_EPSON_2_2 (0x02 << 8)
  173. #define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8)
  174. #define SYS_CLCD_ID_VGA (0x1f << 8)
  175. static struct clcd_panel vga = {
  176. .mode = {
  177. .name = "VGA",
  178. .refresh = 60,
  179. .xres = 640,
  180. .yres = 480,
  181. .pixclock = 39721,
  182. .left_margin = 40,
  183. .right_margin = 24,
  184. .upper_margin = 32,
  185. .lower_margin = 11,
  186. .hsync_len = 96,
  187. .vsync_len = 2,
  188. .sync = 0,
  189. .vmode = FB_VMODE_NONINTERLACED,
  190. },
  191. .width = -1,
  192. .height = -1,
  193. .tim2 = TIM2_BCD | TIM2_IPC,
  194. .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
  195. .bpp = 16,
  196. };
  197. static struct clcd_panel sanyo_3_8_in = {
  198. .mode = {
  199. .name = "Sanyo QVGA",
  200. .refresh = 116,
  201. .xres = 320,
  202. .yres = 240,
  203. .pixclock = 100000,
  204. .left_margin = 6,
  205. .right_margin = 6,
  206. .upper_margin = 5,
  207. .lower_margin = 5,
  208. .hsync_len = 6,
  209. .vsync_len = 6,
  210. .sync = 0,
  211. .vmode = FB_VMODE_NONINTERLACED,
  212. },
  213. .width = -1,
  214. .height = -1,
  215. .tim2 = TIM2_BCD,
  216. .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
  217. .bpp = 16,
  218. };
  219. static struct clcd_panel sanyo_2_5_in = {
  220. .mode = {
  221. .name = "Sanyo QVGA Portrait",
  222. .refresh = 116,
  223. .xres = 240,
  224. .yres = 320,
  225. .pixclock = 100000,
  226. .left_margin = 20,
  227. .right_margin = 10,
  228. .upper_margin = 2,
  229. .lower_margin = 2,
  230. .hsync_len = 10,
  231. .vsync_len = 2,
  232. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  233. .vmode = FB_VMODE_NONINTERLACED,
  234. },
  235. .width = -1,
  236. .height = -1,
  237. .tim2 = TIM2_IVS | TIM2_IHS | TIM2_IPC,
  238. .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
  239. .bpp = 16,
  240. };
  241. static struct clcd_panel epson_2_2_in = {
  242. .mode = {
  243. .name = "Epson QCIF",
  244. .refresh = 390,
  245. .xres = 176,
  246. .yres = 220,
  247. .pixclock = 62500,
  248. .left_margin = 3,
  249. .right_margin = 2,
  250. .upper_margin = 1,
  251. .lower_margin = 0,
  252. .hsync_len = 3,
  253. .vsync_len = 2,
  254. .sync = 0,
  255. .vmode = FB_VMODE_NONINTERLACED,
  256. },
  257. .width = -1,
  258. .height = -1,
  259. .tim2 = TIM2_BCD | TIM2_IPC,
  260. .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
  261. .bpp = 16,
  262. };
  263. /*
  264. * Detect which LCD panel is connected, and return the appropriate
  265. * clcd_panel structure. Note: we do not have any information on
  266. * the required timings for the 8.4in panel, so we presently assume
  267. * VGA timings.
  268. */
  269. static struct clcd_panel *realview_clcd_panel(void)
  270. {
  271. void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
  272. struct clcd_panel *panel = &vga;
  273. u32 val;
  274. val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
  275. if (val == SYS_CLCD_ID_SANYO_3_8)
  276. panel = &sanyo_3_8_in;
  277. else if (val == SYS_CLCD_ID_SANYO_2_5)
  278. panel = &sanyo_2_5_in;
  279. else if (val == SYS_CLCD_ID_EPSON_2_2)
  280. panel = &epson_2_2_in;
  281. else if (val == SYS_CLCD_ID_VGA)
  282. panel = &vga;
  283. else {
  284. printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n",
  285. val);
  286. panel = &vga;
  287. }
  288. return panel;
  289. }
  290. /*
  291. * Disable all display connectors on the interface module.
  292. */
  293. static void realview_clcd_disable(struct clcd_fb *fb)
  294. {
  295. void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
  296. u32 val;
  297. val = readl(sys_clcd);
  298. val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
  299. writel(val, sys_clcd);
  300. }
  301. /*
  302. * Enable the relevant connector on the interface module.
  303. */
  304. static void realview_clcd_enable(struct clcd_fb *fb)
  305. {
  306. void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
  307. u32 val;
  308. /*
  309. * Enable the PSUs
  310. */
  311. val = readl(sys_clcd);
  312. val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
  313. writel(val, sys_clcd);
  314. }
  315. static unsigned long framesize = SZ_1M;
  316. static int realview_clcd_setup(struct clcd_fb *fb)
  317. {
  318. dma_addr_t dma;
  319. fb->panel = realview_clcd_panel();
  320. fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
  321. &dma, GFP_KERNEL);
  322. if (!fb->fb.screen_base) {
  323. printk(KERN_ERR "CLCD: unable to map framebuffer\n");
  324. return -ENOMEM;
  325. }
  326. fb->fb.fix.smem_start = dma;
  327. fb->fb.fix.smem_len = framesize;
  328. return 0;
  329. }
  330. static int realview_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
  331. {
  332. return dma_mmap_writecombine(&fb->dev->dev, vma,
  333. fb->fb.screen_base,
  334. fb->fb.fix.smem_start,
  335. fb->fb.fix.smem_len);
  336. }
  337. static void realview_clcd_remove(struct clcd_fb *fb)
  338. {
  339. dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
  340. fb->fb.screen_base, fb->fb.fix.smem_start);
  341. }
  342. struct clcd_board clcd_plat_data = {
  343. .name = "RealView",
  344. .check = clcdfb_check,
  345. .decode = clcdfb_decode,
  346. .disable = realview_clcd_disable,
  347. .enable = realview_clcd_enable,
  348. .setup = realview_clcd_setup,
  349. .mmap = realview_clcd_mmap,
  350. .remove = realview_clcd_remove,
  351. };
  352. #ifdef CONFIG_LEDS
  353. #define VA_LEDS_BASE (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET)
  354. void realview_leds_event(led_event_t ledevt)
  355. {
  356. unsigned long flags;
  357. u32 val;
  358. local_irq_save(flags);
  359. val = readl(VA_LEDS_BASE);
  360. switch (ledevt) {
  361. case led_idle_start:
  362. val = val & ~REALVIEW_SYS_LED0;
  363. break;
  364. case led_idle_end:
  365. val = val | REALVIEW_SYS_LED0;
  366. break;
  367. case led_timer:
  368. val = val ^ REALVIEW_SYS_LED1;
  369. break;
  370. case led_halted:
  371. val = 0;
  372. break;
  373. default:
  374. break;
  375. }
  376. writel(val, VA_LEDS_BASE);
  377. local_irq_restore(flags);
  378. }
  379. #endif /* CONFIG_LEDS */
  380. /*
  381. * Where is the timer (VA)?
  382. */
  383. #define TIMER0_VA_BASE __io_address(REALVIEW_TIMER0_1_BASE)
  384. #define TIMER1_VA_BASE (__io_address(REALVIEW_TIMER0_1_BASE) + 0x20)
  385. #define TIMER2_VA_BASE __io_address(REALVIEW_TIMER2_3_BASE)
  386. #define TIMER3_VA_BASE (__io_address(REALVIEW_TIMER2_3_BASE) + 0x20)
  387. /*
  388. * How long is the timer interval?
  389. */
  390. #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
  391. #if TIMER_INTERVAL >= 0x100000
  392. #define TIMER_RELOAD (TIMER_INTERVAL >> 8)
  393. #define TIMER_DIVISOR (TIMER_CTRL_DIV256)
  394. #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
  395. #elif TIMER_INTERVAL >= 0x10000
  396. #define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */
  397. #define TIMER_DIVISOR (TIMER_CTRL_DIV16)
  398. #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
  399. #else
  400. #define TIMER_RELOAD (TIMER_INTERVAL)
  401. #define TIMER_DIVISOR (TIMER_CTRL_DIV1)
  402. #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
  403. #endif
  404. static void timer_set_mode(enum clock_event_mode mode,
  405. struct clock_event_device *clk)
  406. {
  407. unsigned long ctrl;
  408. switch(mode) {
  409. case CLOCK_EVT_MODE_PERIODIC:
  410. writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);
  411. ctrl = TIMER_CTRL_PERIODIC;
  412. ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE;
  413. break;
  414. case CLOCK_EVT_MODE_ONESHOT:
  415. /* period set, and timer enabled in 'next_event' hook */
  416. ctrl = TIMER_CTRL_ONESHOT;
  417. ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE;
  418. break;
  419. case CLOCK_EVT_MODE_UNUSED:
  420. case CLOCK_EVT_MODE_SHUTDOWN:
  421. default:
  422. ctrl = 0;
  423. }
  424. writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL);
  425. }
  426. static int timer_set_next_event(unsigned long evt,
  427. struct clock_event_device *unused)
  428. {
  429. unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL);
  430. writel(evt, TIMER0_VA_BASE + TIMER_LOAD);
  431. writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL);
  432. return 0;
  433. }
  434. static struct clock_event_device timer0_clockevent = {
  435. .name = "timer0",
  436. .shift = 32,
  437. .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
  438. .set_mode = timer_set_mode,
  439. .set_next_event = timer_set_next_event,
  440. .rating = 300,
  441. .cpumask = CPU_MASK_ALL,
  442. };
  443. static void __init realview_clockevents_init(unsigned int timer_irq)
  444. {
  445. timer0_clockevent.irq = timer_irq;
  446. timer0_clockevent.mult =
  447. div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift);
  448. timer0_clockevent.max_delta_ns =
  449. clockevent_delta2ns(0xffffffff, &timer0_clockevent);
  450. timer0_clockevent.min_delta_ns =
  451. clockevent_delta2ns(0xf, &timer0_clockevent);
  452. clockevents_register_device(&timer0_clockevent);
  453. }
  454. /*
  455. * IRQ handler for the timer
  456. */
  457. static irqreturn_t realview_timer_interrupt(int irq, void *dev_id)
  458. {
  459. struct clock_event_device *evt = &timer0_clockevent;
  460. /* clear the interrupt */
  461. writel(1, TIMER0_VA_BASE + TIMER_INTCLR);
  462. evt->event_handler(evt);
  463. return IRQ_HANDLED;
  464. }
  465. static struct irqaction realview_timer_irq = {
  466. .name = "RealView Timer Tick",
  467. .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
  468. .handler = realview_timer_interrupt,
  469. };
  470. static cycle_t realview_get_cycles(void)
  471. {
  472. return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
  473. }
  474. static struct clocksource clocksource_realview = {
  475. .name = "timer3",
  476. .rating = 200,
  477. .read = realview_get_cycles,
  478. .mask = CLOCKSOURCE_MASK(32),
  479. .shift = 20,
  480. .flags = CLOCK_SOURCE_IS_CONTINUOUS,
  481. };
  482. static void __init realview_clocksource_init(void)
  483. {
  484. /* setup timer 0 as free-running clocksource */
  485. writel(0, TIMER3_VA_BASE + TIMER_CTRL);
  486. writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD);
  487. writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE);
  488. writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
  489. TIMER3_VA_BASE + TIMER_CTRL);
  490. clocksource_realview.mult =
  491. clocksource_khz2mult(1000, clocksource_realview.shift);
  492. clocksource_register(&clocksource_realview);
  493. }
  494. /*
  495. * Set up the clock source and clock events devices
  496. */
  497. void __init realview_timer_init(unsigned int timer_irq)
  498. {
  499. u32 val;
  500. #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
  501. /*
  502. * The dummy clock device has to be registered before the main device
  503. * so that the latter will broadcast the clock events
  504. */
  505. local_timer_setup(smp_processor_id());
  506. #endif
  507. /*
  508. * set clock frequency:
  509. * REALVIEW_REFCLK is 32KHz
  510. * REALVIEW_TIMCLK is 1MHz
  511. */
  512. val = readl(__io_address(REALVIEW_SCTL_BASE));
  513. writel((REALVIEW_TIMCLK << REALVIEW_TIMER1_EnSel) |
  514. (REALVIEW_TIMCLK << REALVIEW_TIMER2_EnSel) |
  515. (REALVIEW_TIMCLK << REALVIEW_TIMER3_EnSel) |
  516. (REALVIEW_TIMCLK << REALVIEW_TIMER4_EnSel) | val,
  517. __io_address(REALVIEW_SCTL_BASE));
  518. /*
  519. * Initialise to a known state (all timers off)
  520. */
  521. writel(0, TIMER0_VA_BASE + TIMER_CTRL);
  522. writel(0, TIMER1_VA_BASE + TIMER_CTRL);
  523. writel(0, TIMER2_VA_BASE + TIMER_CTRL);
  524. writel(0, TIMER3_VA_BASE + TIMER_CTRL);
  525. /*
  526. * Make irqs happen for the system timer
  527. */
  528. setup_irq(timer_irq, &realview_timer_irq);
  529. realview_clocksource_init();
  530. realview_clockevents_init(timer_irq);
  531. }