| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-w90x900/w90p910.c |
| 3 | * |
| 4 | * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks |
| 5 | * |
| wanzongshun | 604f766 | 2009-05-01 16:14:54 +0100 | [diff] [blame^] | 6 | * Copyright (c) 2008 Nuvoton technology corporation. |
| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 7 | * |
| 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 |
| wanzongshun | 604f766 | 2009-05-01 16:14:54 +0100 | [diff] [blame^] | 14 | * the Free Software Foundation;version 2 of the License. |
| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 15 | * |
| 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> |
| wanzongshun | 17198f2 | 2009-02-04 05:01:38 +0100 | [diff] [blame] | 26 | #include <linux/serial_8250.h> |
| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 27 | |
| 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 | |
| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 38 | /* Initial IO mappings */ |
| 39 | |
| 40 | static 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), |
| wanzongshun | 604f766 | 2009-05-01 16:14:54 +0100 | [diff] [blame^] | 46 | IODESC_ENT(USBEHCIHOST), |
| 47 | IODESC_ENT(USBOHCIHOST), |
| 48 | IODESC_ENT(ADC), |
| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 49 | /*IODESC_ENT(LCD),*/ |
| 50 | }; |
| 51 | |
| wanzongshun | 17198f2 | 2009-02-04 05:01:38 +0100 | [diff] [blame] | 52 | /* Initial serial platform data */ |
| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 53 | |
| wanzongshun | 17198f2 | 2009-02-04 05:01:38 +0100 | [diff] [blame] | 54 | struct plat_serial8250_port w90p910_uart_data[] = { |
| 55 | W90X900_8250PORT(UART0), |
| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 56 | }; |
| 57 | |
| wanzongshun | 17198f2 | 2009-02-04 05:01:38 +0100 | [diff] [blame] | 58 | struct platform_device w90p910_serial_device = { |
| 59 | .name = "serial8250", |
| 60 | .id = PLAT8250_DEV_PLATFORM, |
| 61 | .dev = { |
| 62 | .platform_data = w90p910_uart_data, |
| 63 | }, |
| 64 | }; |
| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 65 | |
| 66 | /*Init W90P910 evb io*/ |
| 67 | |
| 68 | void __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 | |
| 81 | void __init w90p910_init_clocks(int xtal) |
| 82 | { |
| 83 | } |
| 84 | |
| 85 | static int __init w90p910_init_cpu(void) |
| 86 | { |
| 87 | return 0; |
| 88 | } |
| 89 | |
| 90 | static int __init w90x900_arch_init(void) |
| 91 | { |
| wanzongshun | 17198f2 | 2009-02-04 05:01:38 +0100 | [diff] [blame] | 92 | return w90p910_init_cpu(); |
| wanzongshun | 7ec80dd | 2008-12-03 03:55:38 +0100 | [diff] [blame] | 93 | } |
| 94 | arch_initcall(w90x900_arch_init); |