diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-30 17:36:49 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-30 17:36:49 -0800 |
commit | 14a3c4ab0e58d143c7928c9eb2f2610205e13bf2 (patch) | |
tree | 885992999d7a1a2fd3586efcf32ebcbcbc3a72aa /arch/arm/mach-w90x900/w90p910.c | |
parent | 1af237a099a3b8ff56aa384f605c6a68af7bf288 (diff) | |
parent | 47992cbdaef2f18a47871b2ed01ad27f568c8b73 (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (407 commits)
[ARM] pxafb: add support for overlay1 and overlay2 as framebuffer devices
[ARM] pxafb: cleanup of the timing checking code
[ARM] pxafb: cleanup of the color format manipulation code
[ARM] pxafb: add palette format support for LCCR4_PAL_FOR_3
[ARM] pxafb: add support for FBIOPAN_DISPLAY by dma braching
[ARM] pxafb: allow pxafb_set_par() to start from arbitrary yoffset
[ARM] pxafb: allow video memory size to be configurable
[ARM] pxa: add document on the MFP design and how to use it
[ARM] sa1100_wdt: don't assume CLOCK_TICK_RATE to be a constant
[ARM] rtc-sa1100: don't assume CLOCK_TICK_RATE to be a constant
[ARM] pxa/tavorevb: update board support (smartpanel LCD + keypad)
[ARM] pxa: Update eseries defconfig
[ARM] 5352/1: add w90p910-plat config file
[ARM] s3c: S3C options should depend on PLAT_S3C
[ARM] mv78xx0: implement GPIO and GPIO interrupt support
[ARM] Kirkwood: implement GPIO and GPIO interrupt support
[ARM] Orion: share GPIO IRQ handling code
[ARM] Orion: share GPIO handling code
[ARM] s3c: define __io using the typesafe version
[ARM] S3C64XX: Ensure CPU_V6 is selected
...
Diffstat (limited to 'arch/arm/mach-w90x900/w90p910.c')
-rw-r--r-- | arch/arm/mach-w90x900/w90p910.c | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/arch/arm/mach-w90x900/w90p910.c b/arch/arm/mach-w90x900/w90p910.c new file mode 100644 index 00000000000..aa783bc9431 --- /dev/null +++ b/arch/arm/mach-w90x900/w90p910.c @@ -0,0 +1,134 @@ +/* + * linux/arch/arm/mach-w90x900/w90p910.c + * + * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks + * + * Copyright (c) 2008 Nuvoton technology corporation + * All rights reserved. + * + * Wan ZongShun <mcuos.com@gmail.com> + * + * W90P910 cpu support + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + */ + +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/interrupt.h> +#include <linux/list.h> +#include <linux/timer.h> +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/io.h> + +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <asm/mach/irq.h> +#include <asm/irq.h> + +#include <mach/hardware.h> +#include <mach/regs-serial.h> + +#include "cpu.h" + +/*W90P910 has five uarts*/ + +#define MAX_UART_COUNT 5 +static int uart_count; +static struct platform_device *uart_devs[MAX_UART_COUNT-1]; + +/* Initial IO mappings */ + +static struct map_desc w90p910_iodesc[] __initdata = { + IODESC_ENT(IRQ), + IODESC_ENT(GCR), + IODESC_ENT(UART), + IODESC_ENT(TIMER), + IODESC_ENT(EBI), + /*IODESC_ENT(LCD),*/ +}; + +/*Init the dev resource*/ + +static W90X900_RES(UART0); +static W90X900_RES(UART1); +static W90X900_RES(UART2); +static W90X900_RES(UART3); +static W90X900_RES(UART4); +static W90X900_DEVICE(uart0, UART0, 0, "w90x900-uart"); +static W90X900_DEVICE(uart1, UART1, 1, "w90x900-uart"); +static W90X900_DEVICE(uart2, UART2, 2, "w90x900-uart"); +static W90X900_DEVICE(uart3, UART3, 3, "w90x900-uart"); +static W90X900_DEVICE(uart4, UART4, 4, "w90x900-uart"); + +static struct platform_device *uart_devices[] __initdata = { + &w90x900_uart0, + &w90x900_uart1, + &w90x900_uart2, + &w90x900_uart3, + &w90x900_uart4 +}; + +/*Init W90P910 uart device*/ + +void __init w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no) +{ + struct platform_device *platdev; + int uart, uartdev; + + /*By min() to judge count of uart be used indeed*/ + + uartdev = ARRAY_SIZE(uart_devices); + no = min(uartdev, no); + + for (uart = 0; uart < no; uart++, cfg++) { + if (cfg->hwport != uart) + printk(KERN_ERR "w90x900_uartcfg[%d] error\n", uart); + platdev = uart_devices[cfg->hwport]; + uart_devs[uart] = platdev; + platdev->dev.platform_data = cfg; + } + uart_count = uart; +} + +/*Init W90P910 evb io*/ + +void __init w90p910_map_io(struct map_desc *mach_desc, int mach_size) +{ + unsigned long idcode = 0x0; + + iotable_init(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc)); + + idcode = __raw_readl(W90X900PDID); + if (idcode != W90P910_CPUID) + printk(KERN_ERR "CPU type 0x%08lx is not W90P910\n", idcode); +} + +/*Init W90P910 clock*/ + +void __init w90p910_init_clocks(int xtal) +{ +} + +static int __init w90p910_init_cpu(void) +{ + return 0; +} + +static int __init w90x900_arch_init(void) +{ + int ret; + + ret = w90p910_init_cpu(); + if (ret != 0) + return ret; + + return platform_add_devices(uart_devs, uart_count); + +} +arch_initcall(w90x900_arch_init); |