blob: d2e4a16c9e0010af71637aadeaf9f6b678140a2e [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 *
wanzongshun604f7662009-05-01 16:14:54 +01006 * Copyright (c) 2008 Nuvoton technology corporation.
wanzongshun7ec80dd2008-12-03 03:55:38 +01007 *
8 * Wan ZongShun <mcuos.com@gmail.com>
9 *
10 * W90P910 cpu support
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
wanzongshun604f7662009-05-01 16:14:54 +010014 * the Free Software Foundation;version 2 of the License.
wanzongshun7ec80dd2008-12-03 03:55:38 +010015 *
16 */
17
18#include <linux/kernel.h>
19#include <linux/types.h>
20#include <linux/interrupt.h>
21#include <linux/list.h>
22#include <linux/timer.h>
23#include <linux/init.h>
24#include <linux/platform_device.h>
25#include <linux/io.h>
wanzongshun17198f22009-02-04 05:01:38 +010026#include <linux/serial_8250.h>
wanzongshun7ec80dd2008-12-03 03:55:38 +010027
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <asm/mach/irq.h>
31#include <asm/irq.h>
32
33#include <mach/hardware.h>
34#include <mach/regs-serial.h>
35
36#include "cpu.h"
37
wanzongshun7ec80dd2008-12-03 03:55:38 +010038/* Initial IO mappings */
39
40static struct map_desc w90p910_iodesc[] __initdata = {
41 IODESC_ENT(IRQ),
42 IODESC_ENT(GCR),
43 IODESC_ENT(UART),
44 IODESC_ENT(TIMER),
45 IODESC_ENT(EBI),
wanzongshun604f7662009-05-01 16:14:54 +010046 IODESC_ENT(USBEHCIHOST),
47 IODESC_ENT(USBOHCIHOST),
48 IODESC_ENT(ADC),
wanzongshun7ec80dd2008-12-03 03:55:38 +010049 /*IODESC_ENT(LCD),*/
50};
51
wanzongshun17198f22009-02-04 05:01:38 +010052/* Initial serial platform data */
wanzongshun7ec80dd2008-12-03 03:55:38 +010053
wanzongshun17198f22009-02-04 05:01:38 +010054struct plat_serial8250_port w90p910_uart_data[] = {
55 W90X900_8250PORT(UART0),
wanzongshun7ec80dd2008-12-03 03:55:38 +010056};
57
wanzongshun17198f22009-02-04 05:01:38 +010058struct platform_device w90p910_serial_device = {
59 .name = "serial8250",
60 .id = PLAT8250_DEV_PLATFORM,
61 .dev = {
62 .platform_data = w90p910_uart_data,
63 },
64};
wanzongshun7ec80dd2008-12-03 03:55:38 +010065
66/*Init W90P910 evb io*/
67
68void __init w90p910_map_io(struct map_desc *mach_desc, int mach_size)
69{
70 unsigned long idcode = 0x0;
71
72 iotable_init(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
73
74 idcode = __raw_readl(W90X900PDID);
75 if (idcode != W90P910_CPUID)
76 printk(KERN_ERR "CPU type 0x%08lx is not W90P910\n", idcode);
77}
78
79/*Init W90P910 clock*/
80
81void __init w90p910_init_clocks(int xtal)
82{
83}
84
85static int __init w90p910_init_cpu(void)
86{
87 return 0;
88}
89
90static int __init w90x900_arch_init(void)
91{
wanzongshun17198f22009-02-04 05:01:38 +010092 return w90p910_init_cpu();
wanzongshun7ec80dd2008-12-03 03:55:38 +010093}
94arch_initcall(w90x900_arch_init);