blob: 2bcbaa681b9925ba8ba15e885d4a08eb44dab64f [file] [log] [blame]
wanzongshun7ec80dd2008-12-03 03:55:38 +01001/*
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>
wanzongshun17198f22009-02-04 05:01:38 +010028#include <linux/serial_8250.h>
wanzongshun7ec80dd2008-12-03 03:55:38 +010029
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
wanzongshun7ec80dd2008-12-03 03:55:38 +010040/* Initial IO mappings */
41
42static 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
wanzongshun17198f22009-02-04 05:01:38 +010051/* Initial serial platform data */
wanzongshun7ec80dd2008-12-03 03:55:38 +010052
wanzongshun17198f22009-02-04 05:01:38 +010053struct plat_serial8250_port w90p910_uart_data[] = {
54 W90X900_8250PORT(UART0),
wanzongshun7ec80dd2008-12-03 03:55:38 +010055};
56
wanzongshun17198f22009-02-04 05:01:38 +010057struct platform_device w90p910_serial_device = {
58 .name = "serial8250",
59 .id = PLAT8250_DEV_PLATFORM,
60 .dev = {
61 .platform_data = w90p910_uart_data,
62 },
63};
wanzongshun7ec80dd2008-12-03 03:55:38 +010064
65/*Init W90P910 evb io*/
66
67void __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
80void __init w90p910_init_clocks(int xtal)
81{
82}
83
84static int __init w90p910_init_cpu(void)
85{
86 return 0;
87}
88
89static int __init w90x900_arch_init(void)
90{
wanzongshun17198f22009-02-04 05:01:38 +010091 return w90p910_init_cpu();
wanzongshun7ec80dd2008-12-03 03:55:38 +010092}
93arch_initcall(w90x900_arch_init);