Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
[pandora-kernel.git] / arch / arm / mach-w90x900 / w90p910.c
1 /*
2  * linux/arch/arm/mach-w90x900/w90p910.c
3  *
4  * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
5  *
6  * Copyright (c) 2008 Nuvoton technology corporation
7  * All rights reserved.
8  *
9  * Wan ZongShun <mcuos.com@gmail.com>
10  *
11  * W90P910 cpu support
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  */
19
20 #include <linux/kernel.h>
21 #include <linux/types.h>
22 #include <linux/interrupt.h>
23 #include <linux/list.h>
24 #include <linux/timer.h>
25 #include <linux/init.h>
26 #include <linux/platform_device.h>
27 #include <linux/io.h>
28 #include <linux/serial_8250.h>
29
30 #include <asm/mach/arch.h>
31 #include <asm/mach/map.h>
32 #include <asm/mach/irq.h>
33 #include <asm/irq.h>
34
35 #include <mach/hardware.h>
36 #include <mach/regs-serial.h>
37
38 #include "cpu.h"
39
40 /* Initial IO mappings */
41
42 static struct map_desc w90p910_iodesc[] __initdata = {
43         IODESC_ENT(IRQ),
44         IODESC_ENT(GCR),
45         IODESC_ENT(UART),
46         IODESC_ENT(TIMER),
47         IODESC_ENT(EBI),
48         /*IODESC_ENT(LCD),*/
49 };
50
51 /* Initial serial platform data */
52
53 struct plat_serial8250_port w90p910_uart_data[] = {
54         W90X900_8250PORT(UART0),
55 };
56
57 struct platform_device w90p910_serial_device = {
58         .name                   = "serial8250",
59         .id                     = PLAT8250_DEV_PLATFORM,
60         .dev                    = {
61                 .platform_data  = w90p910_uart_data,
62         },
63 };
64
65 /*Init W90P910 evb io*/
66
67 void __init w90p910_map_io(struct map_desc *mach_desc, int mach_size)
68 {
69         unsigned long idcode = 0x0;
70
71         iotable_init(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
72
73         idcode = __raw_readl(W90X900PDID);
74         if (idcode != W90P910_CPUID)
75                 printk(KERN_ERR "CPU type 0x%08lx is not W90P910\n", idcode);
76 }
77
78 /*Init W90P910 clock*/
79
80 void __init w90p910_init_clocks(int xtal)
81 {
82 }
83
84 static int __init w90p910_init_cpu(void)
85 {
86         return 0;
87 }
88
89 static int __init w90x900_arch_init(void)
90 {
91         return w90p910_init_cpu();
92 }
93 arch_initcall(w90x900_arch_init);