Re: [PATCH v2] ARM: Add common files of platform definition and cpu implementing

From: Wan ZongShun
Date: Tue Aug 18 2009 - 07:12:23 EST


Dear Russell ,

Sir, this patch subject should be [PATCH v2 1/3].

2009/8/18 Wan ZongShun <mcuos.com@xxxxxxxxx>:
> Dear Russell,
>
> According to your advice, I wrapped up the adding 'cpu.c'
> and 'dev.c' patches to the previous patch fixing the w90p910.
>
> At the same time, I renamed all 'w90x900' to 'nuc900' in every
> c file of w90x900 platform.
>
> The previous nine patches were integrated into three, one
> is to add the common files and modify some marks of w90p910
> platform, another is to add nuc950 platform files, the other
> is to add nuc960 platform files. I will submit them by three
> patches.
>
> Thanks a lot for your help.
>
> Signed-off-by: Wan ZongShun <mcuos.com@xxxxxxxxx>
> ---
> Âarch/arm/mach-w90x900/Makefile         |  Â8 +-
> Âarch/arm/mach-w90x900/clksel.c         |  12 +-
> Âarch/arm/mach-w90x900/clock.c         Â|  Â4 +-
> Âarch/arm/mach-w90x900/clock.h         Â|  Â8 +-
> Âarch/arm/mach-w90x900/{w90p910.c => cpu.c} Â Â | Â122 ++++----
> Âarch/arm/mach-w90x900/cpu.h          Â|  50 ++--
> Âarch/arm/mach-w90x900/dev.c          Â| Â389 ++++++++++++++++++++++
> Âarch/arm/mach-w90x900/gpio.c          |  78 +++---
> Âarch/arm/mach-w90x900/irq.c          Â|  30 +-
> Âarch/arm/mach-w90x900/mach-nuc910evb.c     |  44 +++
> Âarch/arm/mach-w90x900/mach-w90p910evb.c    Â| Â407 ------------------------
> Âarch/arm/mach-w90x900/{mfp-w90p910.c => mfp.c} | Â 38 ++--
> Âarch/arm/mach-w90x900/nuc910.c         |  60 ++++
> Âarch/arm/mach-w90x900/nuc910.h         |  28 ++
> Âarch/arm/mach-w90x900/time.c          |  70 ++--
> Â15 files changed, 725 insertions(+), 623 deletions(-)
> Ârename arch/arm/mach-w90x900/{w90p910.c => cpu.c} (53%)
> Âcreate mode 100644 arch/arm/mach-w90x900/dev.c
> Âcreate mode 100644 arch/arm/mach-w90x900/mach-nuc910evb.c
> Âdelete mode 100644 arch/arm/mach-w90x900/mach-w90p910evb.c
> Ârename arch/arm/mach-w90x900/{mfp-w90p910.c => mfp.c} (77%)
> Âcreate mode 100644 arch/arm/mach-w90x900/nuc910.c
> Âcreate mode 100644 arch/arm/mach-w90x900/nuc910.h
>
> diff --git a/arch/arm/mach-w90x900/Makefile b/arch/arm/mach-w90x900/Makefile
> index 3ccd625..e38aa32 100644
> --- a/arch/arm/mach-w90x900/Makefile
> +++ b/arch/arm/mach-w90x900/Makefile
> @@ -4,12 +4,12 @@
>
> Â# Object file lists.
>
> -obj-y             Â:= irq.o time.o mfp-w90p910.o gpio.o clock.o
> -obj-y             Â+= clksel.o
> +obj-y             Â:= irq.o time.o mfp.o gpio.o clock.o
> +obj-y             Â+= clksel.o dev.o cpu.o
> Â# W90X900 CPU support files
>
> -obj-$(CONFIG_CPU_W90P910) Â Â Â+= w90p910.o
> +obj-$(CONFIG_CPU_W90P910) Â Â Â+= nuc910.o
>
> Â# machine support
>
> -obj-$(CONFIG_MACH_W90P910EVB) Â+= mach-w90p910evb.o
> +obj-$(CONFIG_MACH_W90P910EVB) Â+= mach-nuc910evb.o
> diff --git a/arch/arm/mach-w90x900/clksel.c b/arch/arm/mach-w90x900/clksel.c
> index 5a77eb9..3de4a52 100644
> --- a/arch/arm/mach-w90x900/clksel.c
> +++ b/arch/arm/mach-w90x900/clksel.c
> @@ -42,13 +42,13 @@ static void clock_source_select(const char *dev_id, unsigned int clkval)
>
> Â Â Â Âclksel = __raw_readl(REG_CLKSEL);
>
> - Â Â Â if (strcmp(dev_id, "w90p910-ms") == 0)
> + Â Â Â if (strcmp(dev_id, "nuc900-ms") == 0)
> Â Â Â Â Â Â Â Âoffset = MSOFFSET;
> - Â Â Â else if (strcmp(dev_id, "w90p910-atapi") == 0)
> + Â Â Â else if (strcmp(dev_id, "nuc900-atapi") == 0)
> Â Â Â Â Â Â Â Âoffset = ATAOFFSET;
> - Â Â Â else if (strcmp(dev_id, "w90p910-lcd") == 0)
> + Â Â Â else if (strcmp(dev_id, "nuc900-lcd") == 0)
> Â Â Â Â Â Â Â Âoffset = LCDOFFSET;
> - Â Â Â else if (strcmp(dev_id, "w90p910-audio") == 0)
> + Â Â Â else if (strcmp(dev_id, "nuc900-audio") == 0)
> Â Â Â Â Â Â Â Âoffset = AUDOFFSET;
> Â Â Â Âelse
> Â Â Â Â Â Â Â Âoffset = CPUOFFSET;
> @@ -59,7 +59,7 @@ static void clock_source_select(const char *dev_id, unsigned int clkval)
> Â Â Â Â__raw_writel(clksel, REG_CLKSEL);
> Â}
>
> -void w90p910_clock_source(struct device *dev, unsigned char *src)
> +void nuc900_clock_source(struct device *dev, unsigned char *src)
> Â{
> Â Â Â Âunsigned int clkval;
> Â Â Â Âconst char *dev_id;
> @@ -87,5 +87,5 @@ void w90p910_clock_source(struct device *dev, unsigned char *src)
>
> Â Â Â Âmutex_unlock(&clksel_sem);
> Â}
> -EXPORT_SYMBOL(w90p910_clock_source);
> +EXPORT_SYMBOL(nuc900_clock_source);
>
> diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c
> index 70b6710..b785994 100644
> --- a/arch/arm/mach-w90x900/clock.c
> +++ b/arch/arm/mach-w90x900/clock.c
> @@ -61,7 +61,7 @@ unsigned long clk_get_rate(struct clk *clk)
> Â}
> ÂEXPORT_SYMBOL(clk_get_rate);
>
> -void w90x900_clk_enable(struct clk *clk, int enable)
> +void nuc900_clk_enable(struct clk *clk, int enable)
> Â{
> Â Â Â Âunsigned int clocks = clk->cken;
> Â Â Â Âunsigned long clken;
> @@ -76,7 +76,7 @@ void w90x900_clk_enable(struct clk *clk, int enable)
> Â Â Â Â__raw_writel(clken, W90X900_VA_CLKPWR);
> Â}
>
> -void w90x900_subclk_enable(struct clk *clk, int enable)
> +void nuc900_subclk_enable(struct clk *clk, int enable)
> Â{
> Â Â Â Âunsigned int clocks = clk->cken;
> Â Â Â Âunsigned long clken;
> diff --git a/arch/arm/mach-w90x900/clock.h b/arch/arm/mach-w90x900/clock.h
> index d2f0e50..f5816a0 100644
> --- a/arch/arm/mach-w90x900/clock.h
> +++ b/arch/arm/mach-w90x900/clock.h
> @@ -12,8 +12,8 @@
>
> Â#include <asm/clkdev.h>
>
> -void w90x900_clk_enable(struct clk *clk, int enable);
> -void w90x900_subclk_enable(struct clk *clk, int enable);
> +void nuc900_clk_enable(struct clk *clk, int enable);
> +void nuc900_subclk_enable(struct clk *clk, int enable);
> Âvoid clks_register(struct clk_lookup *clks, size_t num);
>
> Âstruct clk {
> @@ -24,13 +24,13 @@ struct clk {
>
> Â#define DEFINE_CLK(_name, _ctrlbit) Â Â Â Â Â Â Â Â Â Â\
> Âstruct clk clk_##_name = { Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> - Â Â Â Â Â Â Â .enable = w90x900_clk_enable, Â Â Â Â Â \
> + Â Â Â Â Â Â Â .enable = nuc900_clk_enable, Â Â Â Â Â Â\
>        Â.cken  = (1 << _ctrlbit),       Â\
> Â Â Â Â}
>
> Â#define DEFINE_SUBCLK(_name, _ctrlbit) Â Â Â Â Â Â Â Â \
> Âstruct clk clk_##_name = { Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> - Â Â Â Â Â Â Â .enable = w90x900_subclk_enable, Â Â Â Â\
> + Â Â Â Â Â Â Â .enable = nuc900_subclk_enable, \
>        Â.cken  = (1 << _ctrlbit),       Â\
> Â Â Â Â}
>
> diff --git a/arch/arm/mach-w90x900/w90p910.c b/arch/arm/mach-w90x900/cpu.c
> similarity index 53%
> rename from arch/arm/mach-w90x900/w90p910.c
> rename to arch/arm/mach-w90x900/cpu.c
> index d33723b..921cef9 100644
> --- a/arch/arm/mach-w90x900/w90p910.c
> +++ b/arch/arm/mach-w90x900/cpu.c
> @@ -1,13 +1,11 @@
> Â/*
> - * linux/arch/arm/mach-w90x900/w90p910.c
> + * linux/arch/arm/mach-w90x900/cpu.c
> Â*
> - * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
> - *
> - * Copyright (c) 2008 Nuvoton technology corporation.
> + * Copyright (c) 2009 Nuvoton corporation.
> Â*
> Â* Wan ZongShun <mcuos.com@xxxxxxxxx>
> Â*
> - * W90P910 cpu support
> + * NUC900 series cpu common 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
> @@ -41,19 +39,12 @@
>
> Â/* Initial IO mappings */
>
> -static struct map_desc w90p910_iodesc[] __initdata = {
> +static struct map_desc nuc900_iodesc[] __initdata = {
> Â Â Â ÂIODESC_ENT(IRQ),
> Â Â Â ÂIODESC_ENT(GCR),
> Â Â Â ÂIODESC_ENT(UART),
> Â Â Â ÂIODESC_ENT(TIMER),
> Â Â Â ÂIODESC_ENT(EBI),
> - Â Â Â IODESC_ENT(USBEHCIHOST),
> - Â Â Â IODESC_ENT(USBOHCIHOST),
> - Â Â Â IODESC_ENT(ADC),
> - Â Â Â IODESC_ENT(RTC),
> - Â Â Â IODESC_ENT(KPI),
> - Â Â Â IODESC_ENT(USBDEV),
> - Â Â Â /*IODESC_ENT(LCD),*/
> Â};
>
> Â/* Initial clock declarations. */
> @@ -78,58 +69,45 @@ static DEFINE_CLK(adc, 28);
> Âstatic DEFINE_CLK(usi, 29);
> Âstatic DEFINE_CLK(ext, 0);
>
> -static struct clk_lookup w90p910_clkregs[] = {
> - Â Â Â DEF_CLKLOOK(&clk_lcd, "w90p910-lcd", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_audio, "w90p910-audio", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_fmi, "w90p910-fmi", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_ms, "w90p910-fmi", "MS"),
> - Â Â Â DEF_CLKLOOK(&clk_sd, "w90p910-fmi", "SD"),
> - Â Â Â DEF_CLKLOOK(&clk_dmac, "w90p910-dmac", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_atapi, "w90p910-atapi", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_emc, "w90p910-emc", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_rmii, "w90p910-emc", "RMII"),
> - Â Â Â DEF_CLKLOOK(&clk_usbd, "w90p910-usbd", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_usbh, "w90p910-usbh", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_g2d, "w90p910-g2d", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_pwm, "w90p910-pwm", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_ps2, "w90p910-ps2", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_kpi, "w90p910-kpi", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_wdt, "w90p910-wdt", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_gdma, "w90p910-gdma", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_adc, "w90p910-adc", NULL),
> - Â Â Â DEF_CLKLOOK(&clk_usi, "w90p910-spi", NULL),
> +static struct clk_lookup nuc900_clkregs[] = {
> + Â Â Â DEF_CLKLOOK(&clk_lcd, "nuc900-lcd", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_audio, "nuc900-audio", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_fmi, "nuc900-fmi", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_ms, "nuc900-fmi", "MS"),
> + Â Â Â DEF_CLKLOOK(&clk_sd, "nuc900-fmi", "SD"),
> + Â Â Â DEF_CLKLOOK(&clk_dmac, "nuc900-dmac", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_atapi, "nuc900-atapi", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_emc, "nuc900-emc", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_rmii, "nuc900-emc", "RMII"),
> + Â Â Â DEF_CLKLOOK(&clk_usbd, "nuc900-usbd", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_usbh, "nuc900-usbh", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_g2d, "nuc900-g2d", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_pwm, "nuc900-pwm", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_ps2, "nuc900-ps2", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL),
> + Â Â Â DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL),
> Â Â Â ÂDEF_CLKLOOK(&clk_ext, NULL, "ext"),
> Â};
>
> Â/* Initial serial platform data */
>
> -struct plat_serial8250_port w90p910_uart_data[] = {
> - Â Â Â W90X900_8250PORT(UART0),
> +struct plat_serial8250_port nuc900_uart_data[] = {
> + Â Â Â NUC900_8250PORT(UART0),
> Â};
>
> -struct platform_device w90p910_serial_device = {
> +struct platform_device nuc900_serial_device = {
>    Â.name          = "serial8250",
>    Â.id           = PLAT8250_DEV_PLATFORM,
>    Â.dev          Â= {
> - Â Â Â Â Â Â Â .platform_data Â= w90p910_uart_data,
> + Â Â Â Â Â Â Â .platform_data Â= nuc900_uart_data,
> Â Â Â Â},
> Â};
>
> -/*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);
> -}
> -
> -/*Set W90P910 cpu frequence*/
> -static int __init w90p910_set_clkval(unsigned int cpufreq)
> +/*Set NUC900 series cpu frequence*/
> +static int __init nuc900_set_clkval(unsigned int cpufreq)
> Â{
> Â Â Â Âunsigned int pllclk, ahbclk, apbclk, val;
>
> @@ -178,7 +156,7 @@ static int __init w90p910_set_clkval(unsigned int cpufreq)
>
> Â Â Â Âreturn Â0;
> Â}
> -static int __init w90p910_set_cpufreq(char *str)
> +static int __init nuc900_set_cpufreq(char *str)
> Â{
> Â Â Â Âunsigned long cpufreq, val;
>
> @@ -187,9 +165,9 @@ static int __init w90p910_set_cpufreq(char *str)
>
> Â Â Â Âstrict_strtoul(str, 0, &cpufreq);
>
> - Â Â Â w90p910_clock_source(NULL, "ext");
> + Â Â Â nuc900_clock_source(NULL, "ext");
>
> - Â Â Â w90p910_set_clkval(cpufreq);
> + Â Â Â nuc900_set_clkval(cpufreq);
>
> Â Â Â Âmdelay(1);
>
> @@ -198,27 +176,37 @@ static int __init w90p910_set_cpufreq(char *str)
> Â Â Â Âval |= DEFAULTSKEW;
> Â Â Â Â__raw_writel(val, REG_CKSKEW);
>
> - Â Â Â w90p910_clock_source(NULL, "pll0");
> + Â Â Â nuc900_clock_source(NULL, "pll0");
>
> Â Â Â Âreturn 1;
> Â}
>
> -__setup("cpufreq=", w90p910_set_cpufreq);
> +__setup("cpufreq=", nuc900_set_cpufreq);
>
> -/*Init W90P910 clock*/
> +/*Init NUC900 evb io*/
>
> -void __init w90p910_init_clocks(void)
> +void __init nuc900_map_io(struct map_desc *mach_desc, int mach_size)
> Â{
> - Â Â Â clks_register(w90p910_clkregs, ARRAY_SIZE(w90p910_clkregs));
> -}
> + Â Â Â unsigned long idcode = 0x0;
>
> -static int __init w90p910_init_cpu(void)
> -{
> - Â Â Â return 0;
> + Â Â Â iotable_init(mach_desc, mach_size);
> + Â Â Â iotable_init(nuc900_iodesc, ARRAY_SIZE(nuc900_iodesc));
> +
> + Â Â Â idcode = __raw_readl(NUC900PDID);
> + Â Â Â if (idcode == NUC910_CPUID)
> + Â Â Â Â Â Â Â printk(KERN_INFO "CPU type 0x%08lx is NUC910\n", idcode);
> + Â Â Â else if (idcode == NUC920_CPUID)
> + Â Â Â Â Â Â Â printk(KERN_INFO "CPU type 0x%08lx is NUC920\n", idcode);
> + Â Â Â else if (idcode == NUC950_CPUID)
> + Â Â Â Â Â Â Â printk(KERN_INFO "CPU type 0x%08lx is NUC950\n", idcode);
> + Â Â Â else if (idcode == NUC960_CPUID)
> + Â Â Â Â Â Â Â printk(KERN_INFO "CPU type 0x%08lx is NUC960\n", idcode);
> Â}
>
> -static int __init w90x900_arch_init(void)
> +/*Init NUC900 clock*/
> +
> +void __init nuc900_init_clocks(void)
> Â{
> - Â Â Â return w90p910_init_cpu();
> + Â Â Â clks_register(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs));
> Â}
> -arch_initcall(w90x900_arch_init);
> +
> diff --git a/arch/arm/mach-w90x900/cpu.h b/arch/arm/mach-w90x900/cpu.h
> index ddde959..4d58ba1 100644
> --- a/arch/arm/mach-w90x900/cpu.h
> +++ b/arch/arm/mach-w90x900/cpu.h
> @@ -6,7 +6,7 @@
> Â* Copyright (c) 2008 Nuvoton technology corporation
> Â* All rights reserved.
> Â*
> - * Header file for W90X900 CPU support
> + * Header file for NUC900 CPU support
> Â*
> Â* Wan ZongShun <mcuos.com@xxxxxxxxx>
> Â*
> @@ -24,30 +24,7 @@
>    Â.type  Â= MT_DEVICE,              \
> Â}
>
> -/*Cpu identifier register*/
> -
> -#define W90X900PDID Â ÂW90X900_VA_GCR
> -#define W90P910_CPUID Â0x02900910
> -#define W90P920_CPUID Â0x02900920
> -#define W90P950_CPUID Â0x02900950
> -#define W90N960_CPUID Â0x02900960
> -
> -struct w90x900_uartcfg;
> -struct map_desc;
> -struct sys_timer;
> -
> -/* core initialisation functions */
> -
> -extern void w90x900_init_irq(void);
> -extern void w90p910_init_io(struct map_desc *mach_desc, int size);
> -extern void w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no);
> -extern void w90p910_init_clocks(void);
> -extern void w90p910_map_io(struct map_desc *mach_desc, int size);
> -extern struct platform_device w90p910_serial_device;
> -extern struct sys_timer w90x900_timer;
> -extern void w90p910_clock_source(struct device *dev, unsigned char *src);
> -
> -#define W90X900_8250PORT(name) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> +#define NUC900_8250PORT(name) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â\
> Â{ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â\
>    Â.membase    Â= name##_BA,              Â\
>    Â.mapbase    Â= name##_PA,              Â\
> @@ -57,3 +34,26 @@ extern void w90p910_clock_source(struct device *dev, unsigned char *src);
>    Â.iotype     = UPIO_MEM,               \
>    Â.flags     Â= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,  Â\
> Â}
> +
> +/*Cpu identifier register*/
> +
> +#define NUC900PDID Â Â W90X900_VA_GCR
> +#define NUC910_CPUID Â 0x02900910
> +#define NUC920_CPUID Â 0x02900920
> +#define NUC950_CPUID Â 0x02900950
> +#define NUC960_CPUID Â 0x02900960
> +
> +/* extern file from cpu.c */
> +
> +extern void nuc900_clock_source(struct device *dev, unsigned char *src);
> +extern void nuc900_init_clocks(void);
> +extern void nuc900_map_io(struct map_desc *mach_desc, int mach_size);
> +extern void nuc900_board_init(struct platform_device **device, int size);
> +
> +/* for either public between 910 and 920, or between 920 and 950 */
> +
> +extern struct platform_device nuc900_serial_device;
> +extern struct platform_device nuc900_device_fmi;
> +extern struct platform_device nuc900_device_kpi;
> +extern struct platform_device nuc900_device_rtc;
> +extern struct platform_device nuc900_device_ts;
> diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c
> new file mode 100644
> index 0000000..2a6f98d
> --- /dev/null
> +++ b/arch/arm/mach-w90x900/dev.c
> @@ -0,0 +1,389 @@
> +/*
> + * linux/arch/arm/mach-w90x900/dev.c
> + *
> + * Copyright (C) 2009 Nuvoton corporation.
> + *
> + * Wan ZongShun <mcuos.com@xxxxxxxxx>
> + *
> + * 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;version 2 of the License.
> + *
> + */
> +
> +#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/mtd/physmap.h>
> +#include <linux/mtd/mtd.h>
> +#include <linux/mtd/partitions.h>
> +
> +#include <linux/spi/spi.h>
> +#include <linux/spi/flash.h>
> +
> +#include <asm/mach/arch.h>
> +#include <asm/mach/map.h>
> +#include <asm/mach/irq.h>
> +#include <asm/mach-types.h>
> +
> +#include <mach/regs-serial.h>
> +#include <mach/map.h>
> +
> +#include "cpu.h"
> +
> +/*NUC900 evb norflash driver data */
> +
> +#define NUC900_FLASH_BASE Â Â Â0xA0000000
> +#define NUC900_FLASH_SIZE Â Â Â0x400000
> +#define SPIOFFSET Â Â Â Â Â Â Â0x200
> +#define SPIOREG_SIZE Â Â Â Â Â 0x100
> +
> +static struct mtd_partition nuc900_flash_partitions[] = {
> + Â Â Â {
> +        .name  =    "NOR Partition 1 for kernel (960K)",
> +        .size  =    0xF0000,
> + Â Â Â Â Â Â Â .offset = Â Â Â 0x10000,
> + Â Â Â },
> + Â Â Â {
> +        .name  =    "NOR Partition 2 for image (1M)",
> +        .size  =    0x100000,
> + Â Â Â Â Â Â Â .offset = Â Â Â 0x100000,
> + Â Â Â },
> + Â Â Â {
> +        .name  =    "NOR Partition 3 for user (2M)",
> +        .size  =    0x200000,
> + Â Â Â Â Â Â Â .offset = Â Â Â 0x00200000,
> + Â Â Â }
> +};
> +
> +static struct physmap_flash_data nuc900_flash_data = {
> +    .width     Â=    2,
> +    .parts     Â=    nuc900_flash_partitions,
> +    .nr_parts    =    ARRAY_SIZE(nuc900_flash_partitions),
> +};
> +
> +static struct resource nuc900_flash_resources[] = {
> + Â Â Â {
> + Â Â Â Â Â Â Â .start Â= Â Â Â NUC900_FLASH_BASE,
> +        .end  Â=    NUC900_FLASH_BASE + NUC900_FLASH_SIZE - 1,
> + Â Â Â Â Â Â Â .flags Â= Â Â Â IORESOURCE_MEM,
> + Â Â Â }
> +};
> +
> +static struct platform_device nuc900_flash_device = {
> +    .name      =    "physmap-flash",
> +    .id       =    0,
> +    .dev      Â= {
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â .platform_data = &nuc900_flash_data,
> + Â Â Â Â Â Â Â Â Â Â Â },
> +    .resource    =    nuc900_flash_resources,
> + Â Â Â .num_resources Â= Â Â Â ARRAY_SIZE(nuc900_flash_resources),
> +};
> +
> +/* USB EHCI Host Controller */
> +
> +static struct resource nuc900_usb_ehci_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_USBEHCIHOST,
> +        .end  = W90X900_PA_USBEHCIHOST + W90X900_SZ_USBEHCIHOST - 1,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_USBH,
> +        .end  = IRQ_USBH,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â }
> +};
> +
> +static u64 nuc900_device_usb_ehci_dmamask = 0xffffffffUL;
> +
> +static struct platform_device nuc900_device_usb_ehci = {
> +    .name       = "nuc900-ehci",
> +    .id        = -1,
> +    .num_resources  Â= ARRAY_SIZE(nuc900_usb_ehci_resource),
> +    .resource     = nuc900_usb_ehci_resource,
> +    .dev       Â= {
> + Â Â Â Â Â Â Â .dma_mask = &nuc900_device_usb_ehci_dmamask,
> + Â Â Â Â Â Â Â .coherent_dma_mask = 0xffffffffUL
> + Â Â Â }
> +};
> +
> +/* USB OHCI Host Controller */
> +
> +static struct resource nuc900_usb_ohci_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_USBOHCIHOST,
> +        .end  = W90X900_PA_USBOHCIHOST + W90X900_SZ_USBOHCIHOST - 1,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_USBH,
> +        .end  = IRQ_USBH,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â }
> +};
> +
> +static u64 nuc900_device_usb_ohci_dmamask = 0xffffffffUL;
> +static struct platform_device nuc900_device_usb_ohci = {
> +    .name       = "nuc900-ohci",
> +    .id        = -1,
> +    .num_resources  Â= ARRAY_SIZE(nuc900_usb_ohci_resource),
> +    .resource     = nuc900_usb_ohci_resource,
> +    .dev       Â= {
> + Â Â Â Â Â Â Â .dma_mask = &nuc900_device_usb_ohci_dmamask,
> + Â Â Â Â Â Â Â .coherent_dma_mask = 0xffffffffUL
> + Â Â Â }
> +};
> +
> +/* USB Device (Gadget)*/
> +
> +static struct resource nuc900_usbgadget_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_USBDEV,
> +        .end  = W90X900_PA_USBDEV + W90X900_SZ_USBDEV - 1,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_USBD,
> +        .end  = IRQ_USBD,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â }
> +};
> +
> +static struct platform_device nuc900_device_usbgadget = {
> +    .name      = "nuc900-usbgadget",
> +    .id       = -1,
> + Â Â Â .num_resources Â= ARRAY_SIZE(nuc900_usbgadget_resource),
> +    .resource    = nuc900_usbgadget_resource,
> +};
> +
> +/* MAC device */
> +
> +static struct resource nuc900_emc_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_EMC,
> +        .end  = W90X900_PA_EMC + W90X900_SZ_EMC - 1,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_EMCTX,
> +        .end  = IRQ_EMCTX,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â },
> + Â Â Â [2] = {
> + Â Â Â Â Â Â Â .start = IRQ_EMCRX,
> +        .end  = IRQ_EMCRX,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â }
> +};
> +
> +static u64 nuc900_device_emc_dmamask = 0xffffffffUL;
> +static struct platform_device nuc900_device_emc = {
> +    .name      = "nuc900-emc",
> +    .id       = -1,
> + Â Â Â .num_resources Â= ARRAY_SIZE(nuc900_emc_resource),
> +    .resource    = nuc900_emc_resource,
> +    .dev       Â= {
> + Â Â Â Â Â Â Â .dma_mask = &nuc900_device_emc_dmamask,
> + Â Â Â Â Â Â Â .coherent_dma_mask = 0xffffffffUL
> + Â Â Â }
> +};
> +
> +/* SPI device */
> +
> +static struct resource nuc900_spi_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_I2C + SPIOFFSET,
> +        .end  = W90X900_PA_I2C + SPIOFFSET + SPIOREG_SIZE - 1,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_SSP,
> +        .end  = IRQ_SSP,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â }
> +};
> +
> +static struct platform_device nuc900_device_spi = {
> +    .name      = "nuc900-spi",
> +    .id       = -1,
> + Â Â Â .num_resources Â= ARRAY_SIZE(nuc900_spi_resource),
> +    .resource    = nuc900_spi_resource,
> +};
> +
> +/* spi device, spi flash info */
> +
> +static struct mtd_partition nuc900_spi_flash_partitions[] = {
> + Â Â Â {
> + Â Â Â Â Â Â Â .name = "bootloader(spi)",
> + Â Â Â Â Â Â Â .size = 0x0100000,
> + Â Â Â Â Â Â Â .offset = 0,
> + Â Â Â },
> +};
> +
> +static struct flash_platform_data nuc900_spi_flash_data = {
> + Â Â Â .name = "m25p80",
> + Â Â Â .parts = Ânuc900_spi_flash_partitions,
> + Â Â Â .nr_parts = ARRAY_SIZE(nuc900_spi_flash_partitions),
> + Â Â Â .type = "w25x16",
> +};
> +
> +static struct spi_board_info nuc900_spi_board_info[] __initdata = {
> + Â Â Â {
> + Â Â Â Â Â Â Â .modalias = "m25p80",
> + Â Â Â Â Â Â Â .max_speed_hz = 20000000,
> + Â Â Â Â Â Â Â .bus_num = 0,
> + Â Â Â Â Â Â Â .chip_select = 1,
> + Â Â Â Â Â Â Â .platform_data = &nuc900_spi_flash_data,
> + Â Â Â Â Â Â Â .mode = SPI_MODE_0,
> + Â Â Â },
> +};
> +
> +/* WDT Device */
> +
> +static struct resource nuc900_wdt_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_TIMER,
> +        .end  = W90X900_PA_TIMER + W90X900_SZ_TIMER - 1,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_WDT,
> +        .end  = IRQ_WDT,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â }
> +};
> +
> +static struct platform_device nuc900_device_wdt = {
> +    .name      = "nuc900-wdt",
> +    .id       = -1,
> + Â Â Â .num_resources Â= ARRAY_SIZE(nuc900_wdt_resource),
> +    .resource    = nuc900_wdt_resource,
> +};
> +
> +/*
> + * public device definition between 910 and 920, or 910
> + * and 950 or 950 and 960...,their dev platform register
> + * should be in specific file such as nuc950, nuc960 c
> + * files rather than the public dev.c file here. so the
> + * corresponding platform_device definition should not be
> + * static.
> +*/
> +
> +/* RTC controller*/
> +
> +static struct resource nuc900_rtc_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_RTC,
> +        .end  = W90X900_PA_RTC + 0xff,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_RTC,
> +        .end  = IRQ_RTC,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â },
> +};
> +
> +struct platform_device nuc900_device_rtc = {
> +    .name      = "nuc900-rtc",
> +    .id       = -1,
> + Â Â Â .num_resources Â= ARRAY_SIZE(nuc900_rtc_resource),
> +    .resource    = nuc900_rtc_resource,
> +};
> +
> +/*TouchScreen controller*/
> +
> +static struct resource nuc900_ts_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_ADC,
> +        .end  = W90X900_PA_ADC + W90X900_SZ_ADC-1,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_ADC,
> +        .end  = IRQ_ADC,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â },
> +};
> +
> +struct platform_device nuc900_device_ts = {
> +    .name      = "nuc900-ts",
> +    .id       = -1,
> +    .resource    = nuc900_ts_resource,
> + Â Â Â .num_resources Â= ARRAY_SIZE(nuc900_ts_resource),
> +};
> +
> +/* FMI Device */
> +
> +static struct resource nuc900_fmi_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_FMI,
> +        .end  = W90X900_PA_FMI + W90X900_SZ_FMI - 1,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_FMI,
> +        .end  = IRQ_FMI,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â }
> +};
> +
> +struct platform_device nuc900_device_fmi = {
> +    .name      = "nuc900-fmi",
> +    .id       = -1,
> + Â Â Â .num_resources Â= ARRAY_SIZE(nuc900_fmi_resource),
> +    .resource    = nuc900_fmi_resource,
> +};
> +
> +/* KPI controller*/
> +
> +static struct resource nuc900_kpi_resource[] = {
> + Â Â Â [0] = {
> + Â Â Â Â Â Â Â .start = W90X900_PA_KPI,
> +        .end  = W90X900_PA_KPI + W90X900_SZ_KPI - 1,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> + Â Â Â },
> + Â Â Â [1] = {
> + Â Â Â Â Â Â Â .start = IRQ_KPI,
> +        .end  = IRQ_KPI,
> + Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> + Â Â Â }
> +
> +};
> +
> +struct platform_device nuc900_device_kpi = {
> +    .name      = "nuc900-kpi",
> +    .id       = -1,
> + Â Â Â .num_resources Â= ARRAY_SIZE(nuc900_kpi_resource),
> +    .resource    = nuc900_kpi_resource,
> +};
> +
> +/*Here should be your evb resourse,such as LCD*/
> +
> +static struct platform_device *nuc900_public_dev[] __initdata = {
> + Â Â Â &nuc900_serial_device,
> + Â Â Â &nuc900_flash_device,
> + Â Â Â &nuc900_device_usb_ehci,
> + Â Â Â &nuc900_device_usb_ohci,
> + Â Â Â &nuc900_device_usbgadget,
> + Â Â Â &nuc900_device_emc,
> + Â Â Â &nuc900_device_spi,
> + Â Â Â &nuc900_device_wdt,
> +};
> +
> +/* Provide adding specific CPU platform devices API */
> +
> +void __init nuc900_board_init(struct platform_device **device, int size)
> +{
> + Â Â Â platform_add_devices(device, size);
> + Â Â Â platform_add_devices(nuc900_public_dev, ARRAY_SIZE(nuc900_public_dev));
> + Â Â Â spi_register_board_info(nuc900_spi_board_info,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ARRAY_SIZE(nuc900_spi_board_info));
> +}
> +
> diff --git a/arch/arm/mach-w90x900/gpio.c b/arch/arm/mach-w90x900/gpio.c
> index c72e0df..ba05aec 100644
> --- a/arch/arm/mach-w90x900/gpio.c
> +++ b/arch/arm/mach-w90x900/gpio.c
> @@ -1,7 +1,7 @@
> Â/*
> - * linux/arch/arm/mach-w90p910/gpio.c
> + * linux/arch/arm/mach-w90x900/gpio.c
> Â*
> - * Generic w90p910 GPIO handling
> + * Generic nuc900 GPIO handling
> Â*
> Â* ÂWan ZongShun <mcuos.com@xxxxxxxxx>
> Â*
> @@ -30,31 +30,31 @@
> Â#define GPIO_IN Â Â Â Â Â Â Â Â Â Â Â Â(0x0C)
> Â#define GROUPINERV Â Â Â Â Â Â (0x10)
> Â#define GPIO_GPIO(Nb) Â Â Â Â Â(0x00000001 << (Nb))
> -#define to_w90p910_gpio_chip(c) container_of(c, struct w90p910_gpio_chip, chip)
> +#define to_nuc900_gpio_chip(c) container_of(c, struct nuc900_gpio_chip, chip)
>
> -#define W90P910_GPIO_CHIP(name, base_gpio, nr_gpio) Â Â Â Â Â Â Â Â Â Â\
> +#define NUC900_GPIO_CHIP(name, base_gpio, nr_gpio) Â Â Â Â Â Â Â Â Â Â \
> Â Â Â Â{ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> Â Â Â Â Â Â Â Â.chip = { Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
>            Â.label      Â= name,            \
> - Â Â Â Â Â Â Â Â Â Â Â .direction_input Â= w90p910_dir_input, Â Â Â Â Â\
> - Â Â Â Â Â Â Â Â Â Â Â .direction_output = w90p910_dir_output, Â Â Â Â \
> -            .get       Â= w90p910_gpio_get,      \
> -            .set       Â= w90p910_gpio_set,      \
> + Â Â Â Â Â Â Â Â Â Â Â .direction_input Â= nuc900_dir_input, Â Â Â Â Â \
> + Â Â Â Â Â Â Â Â Â Â Â .direction_output = nuc900_dir_output, Â Â Â Â Â\
> +            .get       Â= nuc900_gpio_get,      Â\
> +            .set       Â= nuc900_gpio_set,      Â\
>            Â.base       = base_gpio,         Â\
>            Â.ngpio      Â= nr_gpio,          Â\
> Â Â Â Â Â Â Â Â} Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> Â Â Â Â}
>
> -struct w90p910_gpio_chip {
> +struct nuc900_gpio_chip {
>    Âstruct gpio_chip    Âchip;
>    Âvoid __iomem      Â*regbase;    /* Base of group register*/
>    Âspinlock_t       Âgpio_lock;
> Â};
>
> -static int w90p910_gpio_get(struct gpio_chip *chip, unsigned offset)
> +static int nuc900_gpio_get(struct gpio_chip *chip, unsigned offset)
> Â{
> - Â Â Â struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
> - Â Â Â void __iomem *pio = w90p910_gpio->regbase + GPIO_IN;
> + Â Â Â struct nuc900_gpio_chip *nuc900_gpio = to_nuc900_gpio_chip(chip);
> + Â Â Â void __iomem *pio = nuc900_gpio->regbase + GPIO_IN;
> Â Â Â Âunsigned int regval;
>
> Â Â Â Âregval = __raw_readl(pio);
> @@ -63,14 +63,14 @@ static int w90p910_gpio_get(struct gpio_chip *chip, unsigned offset)
> Â Â Â Âreturn (regval != 0);
> Â}
>
> -static void w90p910_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
> +static void nuc900_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
> Â{
> - Â Â Â struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
> - Â Â Â void __iomem *pio = w90p910_gpio->regbase + GPIO_OUT;
> + Â Â Â struct nuc900_gpio_chip *nuc900_gpio = to_nuc900_gpio_chip(chip);
> + Â Â Â void __iomem *pio = nuc900_gpio->regbase + GPIO_OUT;
> Â Â Â Âunsigned int regval;
> Â Â Â Âunsigned long flags;
>
> - Â Â Â spin_lock_irqsave(&w90p910_gpio->gpio_lock, flags);
> + Â Â Â spin_lock_irqsave(&nuc900_gpio->gpio_lock, flags);
>
> Â Â Â Âregval = __raw_readl(pio);
>
> @@ -81,36 +81,36 @@ static void w90p910_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
>
> Â Â Â Â__raw_writel(regval, pio);
>
> - Â Â Â spin_unlock_irqrestore(&w90p910_gpio->gpio_lock, flags);
> + Â Â Â spin_unlock_irqrestore(&nuc900_gpio->gpio_lock, flags);
> Â}
>
> -static int w90p910_dir_input(struct gpio_chip *chip, unsigned offset)
> +static int nuc900_dir_input(struct gpio_chip *chip, unsigned offset)
> Â{
> - Â Â Â struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
> - Â Â Â void __iomem *pio = w90p910_gpio->regbase + GPIO_DIR;
> + Â Â Â struct nuc900_gpio_chip *nuc900_gpio = to_nuc900_gpio_chip(chip);
> + Â Â Â void __iomem *pio = nuc900_gpio->regbase + GPIO_DIR;
> Â Â Â Âunsigned int regval;
> Â Â Â Âunsigned long flags;
>
> - Â Â Â spin_lock_irqsave(&w90p910_gpio->gpio_lock, flags);
> + Â Â Â spin_lock_irqsave(&nuc900_gpio->gpio_lock, flags);
>
> Â Â Â Âregval = __raw_readl(pio);
> Â Â Â Âregval &= ~GPIO_GPIO(offset);
> Â Â Â Â__raw_writel(regval, pio);
>
> - Â Â Â spin_unlock_irqrestore(&w90p910_gpio->gpio_lock, flags);
> + Â Â Â spin_unlock_irqrestore(&nuc900_gpio->gpio_lock, flags);
>
> Â Â Â Âreturn 0;
> Â}
>
> -static int w90p910_dir_output(struct gpio_chip *chip, unsigned offset, int val)
> +static int nuc900_dir_output(struct gpio_chip *chip, unsigned offset, int val)
> Â{
> - Â Â Â struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
> - Â Â Â void __iomem *outreg = w90p910_gpio->regbase + GPIO_OUT;
> - Â Â Â void __iomem *pio = w90p910_gpio->regbase + GPIO_DIR;
> + Â Â Â struct nuc900_gpio_chip *nuc900_gpio = to_nuc900_gpio_chip(chip);
> + Â Â Â void __iomem *outreg = nuc900_gpio->regbase + GPIO_OUT;
> + Â Â Â void __iomem *pio = nuc900_gpio->regbase + GPIO_DIR;
> Â Â Â Âunsigned int regval;
> Â Â Â Âunsigned long flags;
>
> - Â Â Â spin_lock_irqsave(&w90p910_gpio->gpio_lock, flags);
> + Â Â Â spin_lock_irqsave(&nuc900_gpio->gpio_lock, flags);
>
> Â Â Â Âregval = __raw_readl(pio);
> Â Â Â Âregval |= GPIO_GPIO(offset);
> @@ -125,28 +125,28 @@ static int w90p910_dir_output(struct gpio_chip *chip, unsigned offset, int val)
>
> Â Â Â Â__raw_writel(regval, outreg);
>
> - Â Â Â spin_unlock_irqrestore(&w90p910_gpio->gpio_lock, flags);
> + Â Â Â spin_unlock_irqrestore(&nuc900_gpio->gpio_lock, flags);
>
> Â Â Â Âreturn 0;
> Â}
>
> -static struct w90p910_gpio_chip w90p910_gpio[] = {
> - Â Â Â W90P910_GPIO_CHIP("GROUPC", 0, 16),
> - Â Â Â W90P910_GPIO_CHIP("GROUPD", 16, 10),
> - Â Â Â W90P910_GPIO_CHIP("GROUPE", 26, 14),
> - Â Â Â W90P910_GPIO_CHIP("GROUPF", 40, 10),
> - Â Â Â W90P910_GPIO_CHIP("GROUPG", 50, 17),
> - Â Â Â W90P910_GPIO_CHIP("GROUPH", 67, 8),
> - Â Â Â W90P910_GPIO_CHIP("GROUPI", 75, 17),
> +static struct nuc900_gpio_chip nuc900_gpio[] = {
> + Â Â Â NUC900_GPIO_CHIP("GROUPC", 0, 16),
> + Â Â Â NUC900_GPIO_CHIP("GROUPD", 16, 10),
> + Â Â Â NUC900_GPIO_CHIP("GROUPE", 26, 14),
> + Â Â Â NUC900_GPIO_CHIP("GROUPF", 40, 10),
> + Â Â Â NUC900_GPIO_CHIP("GROUPG", 50, 17),
> + Â Â Â NUC900_GPIO_CHIP("GROUPH", 67, 8),
> + Â Â Â NUC900_GPIO_CHIP("GROUPI", 75, 17),
> Â};
>
> -void __init w90p910_init_gpio(int nr_group)
> +void __init nuc900_init_gpio(int nr_group)
> Â{
>    Âunsigned    Âi;
> - Â Â Â struct w90p910_gpio_chip *gpio_chip;
> + Â Â Â struct nuc900_gpio_chip *gpio_chip;
>
> Â Â Â Âfor (i = 0; i < nr_group; i++) {
> - Â Â Â Â Â Â Â gpio_chip = &w90p910_gpio[i];
> + Â Â Â Â Â Â Â gpio_chip = &nuc900_gpio[i];
> Â Â Â Â Â Â Â Âspin_lock_init(&gpio_chip->gpio_lock);
> Â Â Â Â Â Â Â Âgpio_chip->regbase = GPIO_BASE + i * GROUPINERV;
> Â Â Â Â Â Â Â Âgpiochip_add(&gpio_chip->chip);
> diff --git a/arch/arm/mach-w90x900/irq.c b/arch/arm/mach-w90x900/irq.c
> index a296c9b..0ce9d8e 100644
> --- a/arch/arm/mach-w90x900/irq.c
> +++ b/arch/arm/mach-w90x900/irq.c
> @@ -36,13 +36,13 @@ struct group_irq {
>
> Âstatic DEFINE_SPINLOCK(groupirq_lock);
>
> -#define DEFINE_GROUP(_name, _ctrlbit, _num) Â Â Â Â Â Â Â Â Â Â\
> -struct group_irq group_##_name = { Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> -        .enable     = w90x900_group_enable,     \
> -        .gpen      = ((2 ^ _num) - 1) << _ctrlbit, \
> +#define DEFINE_GROUP(_name, _ctrlbit, _num) Â Â Â Â Â Â Â Â Â Â Â Â Â Â\
> +struct group_irq group_##_name = { Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> +        .enable     = nuc900_group_enable,         Â\
> +        .gpen      = ((1 << _num) - 1) << _ctrlbit,    Â\
> Â Â Â Â}
>
> -static void w90x900_group_enable(struct group_irq *gpirq, int enable);
> +static void nuc900_group_enable(struct group_irq *gpirq, int enable);
>
> Âstatic DEFINE_GROUP(nirq0, 0, 4);
> Âstatic DEFINE_GROUP(nirq1, 4, 4);
> @@ -77,7 +77,7 @@ static void group_irq_disable(struct group_irq *group_irq)
> Â Â Â Âspin_unlock_irqrestore(&groupirq_lock, flags);
> Â}
>
> -static void w90x900_group_enable(struct group_irq *gpirq, int enable)
> +static void nuc900_group_enable(struct group_irq *gpirq, int enable)
> Â{
> Â Â Â Âunsigned int groupen = gpirq->gpen;
> Â Â Â Âunsigned long regval;
> @@ -92,7 +92,7 @@ static void w90x900_group_enable(struct group_irq *gpirq, int enable)
> Â Â Â Â__raw_writel(regval, REG_AIC_GEN);
> Â}
>
> -static void w90x900_irq_mask(unsigned int irq)
> +static void nuc900_irq_mask(unsigned int irq)
> Â{
> Â Â Â Âstruct group_irq *group_irq;
>
> @@ -143,12 +143,12 @@ static void w90x900_irq_mask(unsigned int irq)
> Â* to REG_AIC_EOSCR for ACK
> Â*/
>
> -static void w90x900_irq_ack(unsigned int irq)
> +static void nuc900_irq_ack(unsigned int irq)
> Â{
> Â Â Â Â__raw_writel(0x01, REG_AIC_EOSCR);
> Â}
>
> -static void w90x900_irq_unmask(unsigned int irq)
> +static void nuc900_irq_unmask(unsigned int irq)
> Â{
> Â Â Â Âstruct group_irq *group_irq;
>
> @@ -194,20 +194,20 @@ static void w90x900_irq_unmask(unsigned int irq)
> Â Â Â Â Â Â Â Âgroup_irq_enable(group_irq);
> Â}
>
> -static struct irq_chip w90x900_irq_chip = {
> -    .ack    = w90x900_irq_ack,
> -    .mask   Â= w90x900_irq_mask,
> -    .unmask  Â= w90x900_irq_unmask,
> +static struct irq_chip nuc900_irq_chip = {
> +    .ack    = nuc900_irq_ack,
> +    .mask   Â= nuc900_irq_mask,
> +    .unmask  Â= nuc900_irq_unmask,
> Â};
>
> -void __init w90x900_init_irq(void)
> +void __init nuc900_init_irq(void)
> Â{
> Â Â Â Âint irqno;
>
> Â Â Â Â__raw_writel(0xFFFFFFFE, REG_AIC_MDCR);
>
> Â Â Â Âfor (irqno = IRQ_WDT; irqno <= IRQ_ADC; irqno++) {
> - Â Â Â Â Â Â Â set_irq_chip(irqno, &w90x900_irq_chip);
> + Â Â Â Â Â Â Â set_irq_chip(irqno, &nuc900_irq_chip);
> Â Â Â Â Â Â Â Âset_irq_handler(irqno, handle_level_irq);
> Â Â Â Â Â Â Â Âset_irq_flags(irqno, IRQF_VALID);
> Â Â Â Â}
> diff --git a/arch/arm/mach-w90x900/mach-nuc910evb.c b/arch/arm/mach-w90x900/mach-nuc910evb.c
> new file mode 100644
> index 0000000..ec05bda
> --- /dev/null
> +++ b/arch/arm/mach-w90x900/mach-nuc910evb.c
> @@ -0,0 +1,44 @@
> +/*
> + * linux/arch/arm/mach-w90x900/mach-nuc910evb.c
> + *
> + * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
> + *
> + * Copyright (C) 2008 Nuvoton technology corporation.
> + *
> + * Wan ZongShun <mcuos.com@xxxxxxxxx>
> + *
> + * 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;version 2 of the License.
> + *
> + */
> +
> +#include <linux/platform_device.h>
> +#include <asm/mach/arch.h>
> +#include <asm/mach/map.h>
> +#include <asm/mach-types.h>
> +#include <mach/map.h>
> +
> +#include "nuc910.h"
> +
> +static void __init nuc910evb_map_io(void)
> +{
> + Â Â Â nuc910_map_io();
> + Â Â Â nuc910_init_clocks();
> +}
> +
> +static void __init nuc910evb_init(void)
> +{
> + Â Â Â nuc910_board_init();
> +}
> +
> +MACHINE_START(W90P910EVB, "W90P910EVB")
> + Â Â Â /* Maintainer: Wan ZongShun */
> +    .phys_io    Â= W90X900_PA_UART,
> +    .io_pg_offst  Â= (((u32)W90X900_VA_UART) >> 18) & 0xfffc,
> +    .boot_params  Â= 0,
> +    .map_io     = nuc910evb_map_io,
> +    .init_irq    = nuc900_init_irq,
> +    .init_machine  = nuc910evb_init,
> +    .timer     Â= &nuc900_timer,
> +MACHINE_END
> diff --git a/arch/arm/mach-w90x900/mach-w90p910evb.c b/arch/arm/mach-w90x900/mach-w90p910evb.c
> deleted file mode 100644
> index 117578a..0000000
> --- a/arch/arm/mach-w90x900/mach-w90p910evb.c
> +++ /dev/null
> @@ -1,407 +0,0 @@
> -/*
> - * linux/arch/arm/mach-w90x900/mach-w90p910evb.c
> - *
> - * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
> - *
> - * Copyright (C) 2008 Nuvoton technology corporation.
> - *
> - * Wan ZongShun <mcuos.com@xxxxxxxxx>
> - *
> - * 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;version 2 of the License.
> - *
> - */
> -
> -#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/mtd/physmap.h>
> -#include <linux/mtd/mtd.h>
> -#include <linux/mtd/partitions.h>
> -
> -#include <linux/spi/spi.h>
> -#include <linux/spi/flash.h>
> -
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -#include <asm/mach/irq.h>
> -#include <asm/mach-types.h>
> -
> -#include <mach/regs-serial.h>
> -#include <mach/map.h>
> -
> -#include "cpu.h"
> -/*w90p910 evb norflash driver data */
> -
> -#define W90P910_FLASH_BASE Â Â 0xA0000000
> -#define W90P910_FLASH_SIZE Â Â 0x400000
> -#define SPIOFFSET Â Â Â Â Â Â Â0x200
> -#define SPIOREG_SIZE Â Â Â Â Â 0x100
> -
> -static struct mtd_partition w90p910_flash_partitions[] = {
> - Â Â Â {
> -        .name  =    "NOR Partition 1 for kernel (960K)",
> -        .size  =    0xF0000,
> - Â Â Â Â Â Â Â .offset = Â Â Â 0x10000,
> - Â Â Â },
> - Â Â Â {
> -        .name  =    "NOR Partition 2 for image (1M)",
> -        .size  =    0x100000,
> - Â Â Â Â Â Â Â .offset = Â Â Â 0x100000,
> - Â Â Â },
> - Â Â Â {
> -        .name  =    "NOR Partition 3 for user (2M)",
> -        .size  =    0x200000,
> - Â Â Â Â Â Â Â .offset = Â Â Â 0x00200000,
> - Â Â Â }
> -};
> -
> -static struct physmap_flash_data w90p910_flash_data = {
> -    .width     Â=    2,
> -    .parts     Â=    w90p910_flash_partitions,
> -    .nr_parts    =    ARRAY_SIZE(w90p910_flash_partitions),
> -};
> -
> -static struct resource w90p910_flash_resources[] = {
> - Â Â Â {
> - Â Â Â Â Â Â Â .start Â= Â Â Â W90P910_FLASH_BASE,
> -        .end  Â=    W90P910_FLASH_BASE + W90P910_FLASH_SIZE - 1,
> - Â Â Â Â Â Â Â .flags Â= Â Â Â IORESOURCE_MEM,
> - Â Â Â }
> -};
> -
> -static struct platform_device w90p910_flash_device = {
> -    .name      =    "physmap-flash",
> -    .id       =    0,
> -    .dev      Â= {
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â .platform_data = &w90p910_flash_data,
> - Â Â Â Â Â Â Â Â Â Â Â },
> -    .resource    =    w90p910_flash_resources,
> - Â Â Â .num_resources Â= Â Â Â ARRAY_SIZE(w90p910_flash_resources),
> -};
> -
> -/* USB EHCI Host Controller */
> -
> -static struct resource w90x900_usb_ehci_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_USBEHCIHOST,
> -        .end  = W90X900_PA_USBEHCIHOST + W90X900_SZ_USBEHCIHOST - 1,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_USBH,
> -        .end  = IRQ_USBH,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â }
> -};
> -
> -static u64 w90x900_device_usb_ehci_dmamask = 0xffffffffUL;
> -
> -struct platform_device w90x900_device_usb_ehci = {
> -    .name       = "w90x900-ehci",
> -    .id        = -1,
> -    .num_resources  Â= ARRAY_SIZE(w90x900_usb_ehci_resource),
> -    .resource     = w90x900_usb_ehci_resource,
> -    .dev       Â= {
> - Â Â Â Â Â Â Â .dma_mask = &w90x900_device_usb_ehci_dmamask,
> - Â Â Â Â Â Â Â .coherent_dma_mask = 0xffffffffUL
> - Â Â Â }
> -};
> -EXPORT_SYMBOL(w90x900_device_usb_ehci);
> -
> -/* USB OHCI Host Controller */
> -
> -static struct resource w90x900_usb_ohci_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_USBOHCIHOST,
> -        .end  = W90X900_PA_USBOHCIHOST + W90X900_SZ_USBOHCIHOST - 1,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_USBH,
> -        .end  = IRQ_USBH,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â }
> -};
> -
> -static u64 w90x900_device_usb_ohci_dmamask = 0xffffffffUL;
> -struct platform_device w90x900_device_usb_ohci = {
> -    .name       = "w90x900-ohci",
> -    .id        = -1,
> -    .num_resources  Â= ARRAY_SIZE(w90x900_usb_ohci_resource),
> -    .resource     = w90x900_usb_ohci_resource,
> -    .dev       Â= {
> - Â Â Â Â Â Â Â .dma_mask = &w90x900_device_usb_ohci_dmamask,
> - Â Â Â Â Â Â Â .coherent_dma_mask = 0xffffffffUL
> - Â Â Â }
> -};
> -EXPORT_SYMBOL(w90x900_device_usb_ohci);
> -
> -/*TouchScreen controller*/
> -
> -static struct resource w90x900_ts_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_ADC,
> -        .end  = W90X900_PA_ADC + W90X900_SZ_ADC-1,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_ADC,
> -        .end  = IRQ_ADC,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â },
> -};
> -
> -struct platform_device w90x900_device_ts = {
> -    .name      = "w90x900-ts",
> -    .id       = -1,
> -    .resource    = w90x900_ts_resource,
> - Â Â Â .num_resources Â= ARRAY_SIZE(w90x900_ts_resource),
> -};
> -EXPORT_SYMBOL(w90x900_device_ts);
> -
> -/* RTC controller*/
> -
> -static struct resource w90x900_rtc_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_RTC,
> -        .end  = W90X900_PA_RTC + 0xff,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_RTC,
> -        .end  = IRQ_RTC,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â },
> -};
> -
> -struct platform_device w90x900_device_rtc = {
> -    .name      = "w90x900-rtc",
> -    .id       = -1,
> - Â Â Â .num_resources Â= ARRAY_SIZE(w90x900_rtc_resource),
> -    .resource    = w90x900_rtc_resource,
> -};
> -EXPORT_SYMBOL(w90x900_device_rtc);
> -
> -/* KPI controller*/
> -
> -static struct resource w90x900_kpi_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_KPI,
> -        .end  = W90X900_PA_KPI + W90X900_SZ_KPI - 1,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_KPI,
> -        .end  = IRQ_KPI,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â }
> -
> -};
> -
> -struct platform_device w90x900_device_kpi = {
> -    .name      = "w90x900-kpi",
> -    .id       = -1,
> - Â Â Â .num_resources Â= ARRAY_SIZE(w90x900_kpi_resource),
> -    .resource    = w90x900_kpi_resource,
> -};
> -EXPORT_SYMBOL(w90x900_device_kpi);
> -
> -/* USB Device (Gadget)*/
> -
> -static struct resource w90x900_usbgadget_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_USBDEV,
> -        .end  = W90X900_PA_USBDEV + W90X900_SZ_USBDEV - 1,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_USBD,
> -        .end  = IRQ_USBD,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â }
> -};
> -
> -struct platform_device w90x900_device_usbgadget = {
> -    .name      = "w90x900-usbgadget",
> -    .id       = -1,
> - Â Â Â .num_resources Â= ARRAY_SIZE(w90x900_usbgadget_resource),
> -    .resource    = w90x900_usbgadget_resource,
> -};
> -EXPORT_SYMBOL(w90x900_device_usbgadget);
> -
> -/* FMI Device */
> -
> -static struct resource w90p910_fmi_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_FMI,
> -        .end  = W90X900_PA_FMI + W90X900_SZ_FMI - 1,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_FMI,
> -        .end  = IRQ_FMI,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â }
> -};
> -
> -static struct platform_device w90p910_device_fmi = {
> -    .name      = "w90p910-fmi",
> -    .id       = -1,
> - Â Â Â .num_resources Â= ARRAY_SIZE(w90p910_fmi_resource),
> -    .resource    = w90p910_fmi_resource,
> -};
> -
> -/* MAC device */
> -
> -static struct resource w90x900_emc_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_EMC,
> -        .end  = W90X900_PA_EMC + W90X900_SZ_EMC - 1,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_EMCTX,
> -        .end  = IRQ_EMCTX,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â },
> - Â Â Â [2] = {
> - Â Â Â Â Â Â Â .start = IRQ_EMCRX,
> -        .end  = IRQ_EMCRX,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â }
> -};
> -
> -static u64 w90x900_device_emc_dmamask = 0xffffffffUL;
> -static struct platform_device w90p910_device_emc = {
> -    .name      = "w90p910-emc",
> -    .id       = -1,
> - Â Â Â .num_resources Â= ARRAY_SIZE(w90x900_emc_resource),
> -    .resource    = w90x900_emc_resource,
> -    .dev       Â= {
> - Â Â Â Â Â Â Â .dma_mask = &w90x900_device_emc_dmamask,
> - Â Â Â Â Â Â Â .coherent_dma_mask = 0xffffffffUL
> - Â Â Â }
> -};
> -
> -/* SPI device */
> -
> -static struct resource w90p910_spi_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_I2C + SPIOFFSET,
> -        .end  = W90X900_PA_I2C + SPIOFFSET + SPIOREG_SIZE - 1,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_SSP,
> -        .end  = IRQ_SSP,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â }
> -};
> -
> -static struct platform_device w90p910_device_spi = {
> -    .name      = "w90p910-spi",
> -    .id       = -1,
> - Â Â Â .num_resources Â= ARRAY_SIZE(w90p910_spi_resource),
> -    .resource    = w90p910_spi_resource,
> -};
> -
> -/* spi device, spi flash info */
> -
> -static struct mtd_partition w90p910_spi_flash_partitions[] = {
> - Â Â Â {
> - Â Â Â Â Â Â Â .name = "bootloader(spi)",
> - Â Â Â Â Â Â Â .size = 0x0100000,
> - Â Â Â Â Â Â Â .offset = 0,
> - Â Â Â },
> -};
> -
> -static struct flash_platform_data w90p910_spi_flash_data = {
> - Â Â Â .name = "m25p80",
> - Â Â Â .parts = Âw90p910_spi_flash_partitions,
> - Â Â Â .nr_parts = ARRAY_SIZE(w90p910_spi_flash_partitions),
> - Â Â Â .type = "w25x16",
> -};
> -
> -static struct spi_board_info w90p910_spi_board_info[] __initdata = {
> - Â Â Â {
> - Â Â Â Â Â Â Â .modalias = "m25p80",
> - Â Â Â Â Â Â Â .max_speed_hz = 20000000,
> - Â Â Â Â Â Â Â .bus_num = 0,
> - Â Â Â Â Â Â Â .chip_select = 1,
> - Â Â Â Â Â Â Â .platform_data = &w90p910_spi_flash_data,
> - Â Â Â Â Â Â Â .mode = SPI_MODE_0,
> - Â Â Â },
> -};
> -
> -/* WDT Device */
> -
> -static struct resource w90p910_wdt_resource[] = {
> - Â Â Â [0] = {
> - Â Â Â Â Â Â Â .start = W90X900_PA_TIMER,
> -        .end  = W90X900_PA_TIMER + W90X900_SZ_TIMER - 1,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_MEM,
> - Â Â Â },
> - Â Â Â [1] = {
> - Â Â Â Â Â Â Â .start = IRQ_WDT,
> -        .end  = IRQ_WDT,
> - Â Â Â Â Â Â Â .flags = IORESOURCE_IRQ,
> - Â Â Â }
> -};
> -
> -static struct platform_device w90p910_device_wdt = {
> -    .name      = "w90p910-wdt",
> -    .id       = -1,
> - Â Â Â .num_resources Â= ARRAY_SIZE(w90p910_wdt_resource),
> -    .resource    = w90p910_wdt_resource,
> -};
> -
> -static struct map_desc w90p910_iodesc[] __initdata = {
> -};
> -
> -/*Here should be your evb resourse,such as LCD*/
> -
> -static struct platform_device *w90p910evb_dev[] __initdata = {
> - Â Â Â &w90p910_serial_device,
> - Â Â Â &w90p910_flash_device,
> - Â Â Â &w90x900_device_usb_ehci,
> - Â Â Â &w90x900_device_usb_ohci,
> - Â Â Â &w90x900_device_ts,
> - Â Â Â &w90x900_device_rtc,
> - Â Â Â &w90x900_device_kpi,
> - Â Â Â &w90x900_device_usbgadget,
> - Â Â Â &w90p910_device_fmi,
> - Â Â Â &w90p910_device_emc,
> - Â Â Â &w90p910_device_spi,
> - Â Â Â &w90p910_device_wdt,
> -};
> -
> -static void __init w90p910evb_map_io(void)
> -{
> - Â Â Â w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
> - Â Â Â w90p910_init_clocks();
> -}
> -
> -static void __init w90p910evb_init(void)
> -{
> - Â Â Â platform_add_devices(w90p910evb_dev, ARRAY_SIZE(w90p910evb_dev));
> - Â Â Â spi_register_board_info(w90p910_spi_board_info,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ARRAY_SIZE(w90p910_spi_board_info));
> -}
> -
> -MACHINE_START(W90P910EVB, "W90P910EVB")
> - Â Â Â /* Maintainer: Wan ZongShun */
> -    .phys_io    Â= W90X900_PA_UART,
> -    .io_pg_offst  Â= (((u32)W90X900_VA_UART) >> 18) & 0xfffc,
> -    .boot_params  Â= 0,
> -    .map_io     = w90p910evb_map_io,
> -    .init_irq    = w90x900_init_irq,
> -    .init_machine  = w90p910evb_init,
> -    .timer     Â= &w90x900_timer,
> -MACHINE_END
> diff --git a/arch/arm/mach-w90x900/mfp-w90p910.c b/arch/arm/mach-w90x900/mfp.c
> similarity index 77%
> rename from arch/arm/mach-w90x900/mfp-w90p910.c
> rename to arch/arm/mach-w90x900/mfp.c
> index 4533098..a47dc9a 100644
> --- a/arch/arm/mach-w90x900/mfp-w90p910.c
> +++ b/arch/arm/mach-w90x900/mfp.c
> @@ -1,5 +1,5 @@
> Â/*
> - * linux/arch/arm/mach-w90x900/mfp-w90p910.c
> + * linux/arch/arm/mach-w90x900/mfp.c
> Â*
> Â* Copyright (c) 2008 Nuvoton technology corporation
> Â*
> @@ -55,7 +55,7 @@ void mfp_set_groupf(struct device *dev)
>
> Â Â Â Âmfpen = __raw_readl(REG_MFSEL);
>
> - Â Â Â if (strcmp(dev_id, "w90p910-emc") == 0)
> + Â Â Â if (strcmp(dev_id, "nuc900-emc") == 0)
> Â Â Â Â Â Â Â Âmfpen |= GPSELF;/*enable mac*/
> Â Â Â Âelse
> Â Â Â Â Â Â Â Âmfpen &= ~GPSELF;/*GPIOF[9:0]*/
> @@ -79,16 +79,16 @@ void mfp_set_groupc(struct device *dev)
>
> Â Â Â Âmfpen = __raw_readl(REG_MFSEL);
>
> - Â Â Â if (strcmp(dev_id, "w90p910-lcd") == 0)
> + Â Â Â if (strcmp(dev_id, "nuc900-lcd") == 0)
> Â Â Â Â Â Â Â Âmfpen |= GPSELC;/*enable lcd*/
> - Â Â Â else if (strcmp(dev_id, "w90p910-kpi") == 0) {
> - Â Â Â Â Â Â Â Â Â Â Â mfpen &= (~GPSELC);/*enable kpi*/
> - Â Â Â Â Â Â Â Â Â Â Â mfpen |= ENKPI;
> - Â Â Â Â Â Â Â } else if (strcmp(dev_id, "w90p910-nand") == 0) {
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mfpen &= (~GPSELC);/*enable nand*/
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mfpen |= ENNAND;
> - Â Â Â Â Â Â Â Â Â Â Â } else
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mfpen &= (~GPSELC);/*GPIOC[14:0]*/
> + Â Â Â else if (strcmp(dev_id, "nuc900-kpi") == 0) {
> + Â Â Â Â Â Â Â mfpen &= (~GPSELC);/*enable kpi*/
> + Â Â Â Â Â Â Â mfpen |= ENKPI;
> + Â Â Â } else if (strcmp(dev_id, "nuc900-nand") == 0) {
> + Â Â Â Â Â Â Â mfpen &= (~GPSELC);/*enable nand*/
> + Â Â Â Â Â Â Â mfpen |= ENNAND;
> + Â Â Â } else
> + Â Â Â Â Â Â Â mfpen &= (~GPSELC);/*GPIOC[14:0]*/
>
> Â Â Â Â__raw_writel(mfpen, REG_MFSEL);
>
> @@ -111,12 +111,12 @@ void mfp_set_groupi(struct device *dev)
>
> Â Â Â Âmfpen &= ~GPSELEI1;/*default gpio16*/
>
> - Â Â Â if (strcmp(dev_id, "w90p910-wdog") == 0)
> + Â Â Â if (strcmp(dev_id, "nuc900-wdog") == 0)
> Â Â Â Â Â Â Â Âmfpen |= GPSELEI1;/*enable wdog*/
> - Â Â Â Â Â Â Â else if (strcmp(dev_id, "w90p910-atapi") == 0)
> - Â Â Â Â Â Â Â Â Â Â Â mfpen |= GPSELEI0;/*enable atapi*/
> - Â Â Â Â Â Â Â Â Â Â Â else if (strcmp(dev_id, "w90p910-keypad") == 0)
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mfpen &= ~GPSELEI0;/*enable keypad*/
> + Â Â Â else if (strcmp(dev_id, "nuc900-atapi") == 0)
> + Â Â Â Â Â Â Â mfpen |= GPSELEI0;/*enable atapi*/
> + Â Â Â else if (strcmp(dev_id, "nuc900-keypad") == 0)
> + Â Â Â Â Â Â Â mfpen &= ~GPSELEI0;/*enable keypad*/
>
> Â Â Â Â__raw_writel(mfpen, REG_MFSEL);
>
> @@ -137,13 +137,13 @@ void mfp_set_groupg(struct device *dev)
>
> Â Â Â Âmfpen = __raw_readl(REG_MFSEL);
>
> - Â Â Â if (strcmp(dev_id, "w90p910-spi") == 0) {
> + Â Â Â if (strcmp(dev_id, "nuc900-spi") == 0) {
> Â Â Â Â Â Â Â Âmfpen &= ~(GPIOG0TO1 | GPIOG2TO3);
> Â Â Â Â Â Â Â Âmfpen |= ENSPI;/*enable spi*/
> - Â Â Â } else if (strcmp(dev_id, "w90p910-i2c0") == 0) {
> + Â Â Â } else if (strcmp(dev_id, "nuc900-i2c0") == 0) {
> Â Â Â Â Â Â Â Âmfpen &= ~(GPIOG0TO1);
> Â Â Â Â Â Â Â Âmfpen |= ENI2C0;/*enable i2c0*/
> - Â Â Â } else if (strcmp(dev_id, "w90p910-i2c1") == 0) {
> + Â Â Â } else if (strcmp(dev_id, "nuc900-i2c1") == 0) {
> Â Â Â Â Â Â Â Âmfpen &= ~(GPIOG2TO3);
> Â Â Â Â Â Â Â Âmfpen |= ENI2C1;/*enable i2c1*/
> Â Â Â Â} else {
> diff --git a/arch/arm/mach-w90x900/nuc910.c b/arch/arm/mach-w90x900/nuc910.c
> new file mode 100644
> index 0000000..656f03b
> --- /dev/null
> +++ b/arch/arm/mach-w90x900/nuc910.c
> @@ -0,0 +1,60 @@
> +/*
> + * linux/arch/arm/mach-w90x900/nuc910.c
> + *
> + * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
> + *
> + * Copyright (c) 2009 Nuvoton corporation.
> + *
> + * Wan ZongShun <mcuos.com@xxxxxxxxx>
> + *
> + * NUC910 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;version 2 of the License.
> + *
> + */
> +
> +#include <linux/platform_device.h>
> +#include <asm/mach/map.h>
> +#include <mach/hardware.h>
> +#include "cpu.h"
> +#include "clock.h"
> +
> +/* define specific CPU platform device */
> +
> +static struct platform_device *nuc910_dev[] __initdata = {
> + Â Â Â &nuc900_device_ts,
> + Â Â Â &nuc900_device_rtc,
> +};
> +
> +/* define specific CPU platform io map */
> +
> +static struct map_desc nuc910evb_iodesc[] __initdata = {
> + Â Â Â IODESC_ENT(USBEHCIHOST),
> + Â Â Â IODESC_ENT(USBOHCIHOST),
> + Â Â Â IODESC_ENT(KPI),
> + Â Â Â IODESC_ENT(USBDEV),
> + Â Â Â IODESC_ENT(ADC),
> +};
> +
> +/*Init NUC910 evb io*/
> +
> +void __init nuc910_map_io(void)
> +{
> + Â Â Â nuc900_map_io(nuc910evb_iodesc, ARRAY_SIZE(nuc910evb_iodesc));
> +}
> +
> +/*Init NUC910 clock*/
> +
> +void __init nuc910_init_clocks(void)
> +{
> + Â Â Â nuc900_init_clocks();
> +}
> +
> +/*Init NUC910 board info*/
> +
> +void __init nuc910_board_init(void)
> +{
> + Â Â Â nuc900_board_init(nuc910_dev, ARRAY_SIZE(nuc910_dev));
> +}
> diff --git a/arch/arm/mach-w90x900/nuc910.h b/arch/arm/mach-w90x900/nuc910.h
> new file mode 100644
> index 0000000..83e9ba5
> --- /dev/null
> +++ b/arch/arm/mach-w90x900/nuc910.h
> @@ -0,0 +1,28 @@
> +/*
> + * arch/arm/mach-w90x900/nuc910.h
> + *
> + * Copyright (c) 2008 Nuvoton corporation
> + *
> + * Header file for NUC900 CPU support
> + *
> + * Wan ZongShun <mcuos.com@xxxxxxxxx>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +struct map_desc;
> +struct sys_timer;
> +
> +/* core initialisation functions */
> +
> +extern void nuc900_init_irq(void);
> +extern struct sys_timer nuc900_timer;
> +
> +/* extern file from nuc910.c */
> +
> +extern void nuc910_board_init(void);
> +extern void nuc910_init_clocks(void);
> +extern void nuc910_map_io(void);
> diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
> index 5e06770..4128af8 100644
> --- a/arch/arm/mach-w90x900/time.c
> +++ b/arch/arm/mach-w90x900/time.c
> @@ -44,7 +44,7 @@
>
> Âunsigned int timer0_load;
>
> -static void w90p910_clockevent_setmode(enum clock_event_mode mode,
> +static void nuc900_clockevent_setmode(enum clock_event_mode mode,
> Â Â Â Â Â Â Â Âstruct clock_event_device *clk)
> Â{
> Â Â Â Âunsigned int val;
> @@ -71,7 +71,7 @@ static void w90p910_clockevent_setmode(enum clock_event_mode mode,
> Â Â Â Â__raw_writel(val, REG_TCSR0);
> Â}
>
> -static int w90p910_clockevent_setnextevent(unsigned long evt,
> +static int nuc900_clockevent_setnextevent(unsigned long evt,
> Â Â Â Â Â Â Â Âstruct clock_event_device *clk)
> Â{
> Â Â Â Âunsigned int val;
> @@ -85,20 +85,20 @@ static int w90p910_clockevent_setnextevent(unsigned long evt,
> Â Â Â Âreturn 0;
> Â}
>
> -static struct clock_event_device w90p910_clockevent_device = {
> -    .name      = "w90p910-timer0",
> +static struct clock_event_device nuc900_clockevent_device = {
> +    .name      = "nuc900-timer0",
>    Â.shift     Â= 32,
>    Â.features    = CLOCK_EVT_MODE_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
> -    .set_mode    = w90p910_clockevent_setmode,
> - Â Â Â .set_next_event = w90p910_clockevent_setnextevent,
> +    .set_mode    = nuc900_clockevent_setmode,
> + Â Â Â .set_next_event = nuc900_clockevent_setnextevent,
>    Â.rating     = 300,
> Â};
>
> Â/*IRQ handler for the timer*/
>
> -static irqreturn_t w90p910_timer0_interrupt(int irq, void *dev_id)
> +static irqreturn_t nuc900_timer0_interrupt(int irq, void *dev_id)
> Â{
> - Â Â Â struct clock_event_device *evt = &w90p910_clockevent_device;
> + Â Â Â struct clock_event_device *evt = &nuc900_clockevent_device;
>
> Â Â Â Â__raw_writel(0x01, REG_TISR); /* clear TIF0 */
>
> @@ -106,40 +106,40 @@ static irqreturn_t w90p910_timer0_interrupt(int irq, void *dev_id)
> Â Â Â Âreturn IRQ_HANDLED;
> Â}
>
> -static struct irqaction w90p910_timer0_irq = {
> -    .name      = "w90p910-timer0",
> +static struct irqaction nuc900_timer0_irq = {
> +    .name      = "nuc900-timer0",
>    Â.flags     Â= IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
> -    .handler    Â= w90p910_timer0_interrupt,
> +    .handler    Â= nuc900_timer0_interrupt,
> Â};
>
> -static void __init w90p910_clockevents_init(unsigned int rate)
> +static void __init nuc900_clockevents_init(unsigned int rate)
> Â{
> - Â Â Â w90p910_clockevent_device.mult = div_sc(rate, NSEC_PER_SEC,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â w90p910_clockevent_device.shift);
> - Â Â Â w90p910_clockevent_device.max_delta_ns = clockevent_delta2ns(0xffffffff,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &w90p910_clockevent_device);
> - Â Â Â w90p910_clockevent_device.min_delta_ns = clockevent_delta2ns(0xf,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &w90p910_clockevent_device);
> - Â Â Â w90p910_clockevent_device.cpumask = cpumask_of(0);
> -
> - Â Â Â clockevents_register_device(&w90p910_clockevent_device);
> + Â Â Â nuc900_clockevent_device.mult = div_sc(rate, NSEC_PER_SEC,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nuc900_clockevent_device.shift);
> + Â Â Â nuc900_clockevent_device.max_delta_ns = clockevent_delta2ns(0xffffffff,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &nuc900_clockevent_device);
> + Â Â Â nuc900_clockevent_device.min_delta_ns = clockevent_delta2ns(0xf,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &nuc900_clockevent_device);
> + Â Â Â nuc900_clockevent_device.cpumask = cpumask_of(0);
> +
> + Â Â Â clockevents_register_device(&nuc900_clockevent_device);
> Â}
>
> -static cycle_t w90p910_get_cycles(struct clocksource *cs)
> +static cycle_t nuc900_get_cycles(struct clocksource *cs)
> Â{
> Â Â Â Âreturn ~__raw_readl(REG_TDR1);
> Â}
>
> -static struct clocksource clocksource_w90p910 = {
> -    .name  = "w90p910-timer1",
> +static struct clocksource clocksource_nuc900 = {
> +    .name  = "nuc900-timer1",
> Â Â Â Â.rating = 200,
> -    .read  = w90p910_get_cycles,
> +    .read  = nuc900_get_cycles,
>    Â.mask  = CLOCKSOURCE_MASK(32),
> Â Â Â Â.shift Â= 20,
> Â Â Â Â.flags Â= CLOCK_SOURCE_IS_CONTINUOUS,
> Â};
>
> -static void __init w90p910_clocksource_init(unsigned int rate)
> +static void __init nuc900_clocksource_init(unsigned int rate)
> Â{
> Â Â Â Âunsigned int val;
>
> @@ -149,12 +149,12 @@ static void __init w90p910_clocksource_init(unsigned int rate)
> Â Â Â Âval |= (COUNTEN | PERIOD);
> Â Â Â Â__raw_writel(val, REG_TCSR1);
>
> - Â Â Â clocksource_w90p910.mult =
> - Â Â Â Â Â Â Â clocksource_khz2mult((rate / 1000), clocksource_w90p910.shift);
> - Â Â Â clocksource_register(&clocksource_w90p910);
> + Â Â Â clocksource_nuc900.mult =
> + Â Â Â Â Â Â Â clocksource_khz2mult((rate / 1000), clocksource_nuc900.shift);
> + Â Â Â clocksource_register(&clocksource_nuc900);
> Â}
>
> -static void __init w90p910_timer_init(void)
> +static void __init nuc900_timer_init(void)
> Â{
> Â Â Â Âstruct clk *ck_ext = clk_get(NULL, "ext");
>    Âunsigned int  Ârate;
> @@ -171,12 +171,12 @@ static void __init w90p910_timer_init(void)
> Â Â Â Â__raw_writel(RESETINT, REG_TISR);
> Â Â Â Âtimer0_load = (rate / TICKS_PER_SEC);
>
> - Â Â Â setup_irq(IRQ_TIMER0, &w90p910_timer0_irq);
> + Â Â Â setup_irq(IRQ_TIMER0, &nuc900_timer0_irq);
>
> - Â Â Â w90p910_clocksource_init(rate);
> - Â Â Â w90p910_clockevents_init(rate);
> + Â Â Â nuc900_clocksource_init(rate);
> + Â Â Â nuc900_clockevents_init(rate);
> Â}
>
> -struct sys_timer w90x900_timer = {
> -    .init      = w90p910_timer_init,
> +struct sys_timer nuc900_timer = {
> +    .init      = nuc900_timer_init,
> Â};
> --
> 1.5.6.3
>



--
Wan z.s
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/