Skip to content

Commit

Permalink
[ARM] 5338/1: Add Nuvoton W90P910 Platform support
Browse files Browse the repository at this point in the history
Add Nuvoton W90X900 ARM9 plat support to linux arm tree,
Now, this patch include only W90P910 EVB of W90P910 CPU,
Its driver is nothing.

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
wanzongshun authored and Russell King committed Dec 3, 2008
1 parent c5b84b3 commit 7ec80dd
Show file tree
Hide file tree
Showing 23 changed files with 986 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,13 @@ config ARCH_MSM
interface to the ARM9 modem processor which runs the baseband stack
and controls some vital subsystems (clock and power control, etc).

config ARCH_W90X900
bool "Nuvoton W90X900 CPU"
select CPU_ARM926T
help
Support for Nuvoton (Winbond logic dept.) ARM9 processor,You
can login www.mcuos.com or www.nuvoton.com to know more.

endchoice

source "arch/arm/mach-clps711x/Kconfig"
Expand Down Expand Up @@ -650,6 +657,8 @@ source "arch/arm/mach-ks8695/Kconfig"

source "arch/arm/mach-msm/Kconfig"

source "arch/arm/mach-w90x900/Kconfig"

# Definitions to make life easier
config ARCH_ACORN
bool
Expand Down
1 change: 1 addition & 0 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ endif
machine-$(CONFIG_ARCH_MSM) := msm
machine-$(CONFIG_ARCH_LOKI) := loki
machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0
machine-$(CONFIG_ARCH_W90X900) := w90x900

ifeq ($(CONFIG_ARCH_EBSA110),y)
# This is what happens if you forget the IOCS16 line.
Expand Down
19 changes: 19 additions & 0 deletions arch/arm/mach-w90x900/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if ARCH_W90X900

config CPU_W90P910
bool
help
Support for W90P910 of Nuvoton W90X900 CPUs.

menu "W90P910 Machines"

config MACH_W90P910EVB
bool "Nuvoton W90P910 Evaluation Board"
default y
select CPU_W90P910
help
Say Y here if you are using the Nuvoton W90P910EVB

endmenu

endif
15 changes: 15 additions & 0 deletions arch/arm/mach-w90x900/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Makefile for the linux kernel.
#

# Object file lists.

obj-y := irq.o time.o

# W90X900 CPU support files

obj-$(CONFIG_CPU_W90P910) += w90p910.o

# machine support

obj-$(CONFIG_MACH_W90P910EVB) += mach-w90p910evb.o
3 changes: 3 additions & 0 deletions arch/arm/mach-w90x900/Makefile.boot
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
zreladdr-y := 0x00008000
params_phys-y := 0x00000100

77 changes: 77 additions & 0 deletions arch/arm/mach-w90x900/cpu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* arch/arm/mach-w90x900/cpu.h
*
* Based on linux/include/asm-arm/plat-s3c24xx/cpu.h by Ben Dooks
*
* Copyright (c) 2008 Nuvoton technology corporation
* All rights reserved.
*
* Header file for W90X900 CPU support
*
* Wan ZongShun <mcuos.com@gmail.com>
*
* 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.
*
*/

#define IODESC_ENT(y) \
{ \
.virtual = (unsigned long)W90X900_VA_##y, \
.pfn = __phys_to_pfn(W90X900_PA_##y), \
.length = W90X900_SZ_##y, \
.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(int xtal);
extern void w90p910_map_io(struct map_desc *mach_desc, int size);
extern struct sys_timer w90x900_timer;

#define W90X900_RES(name) \
struct resource w90x900_##name##_resource[] = { \
[0] = { \
.start = name##_PA, \
.end = name##_PA + 0x0ff, \
.flags = IORESOURCE_MEM, \
}, \
[1] = { \
.start = IRQ_##name, \
.end = IRQ_##name, \
.flags = IORESOURCE_IRQ, \
} \
}

#define W90X900_DEVICE(devname, regname, devid, platdevname) \
struct platform_device w90x900_##devname = { \
.name = platdevname, \
.id = devid, \
.num_resources = ARRAY_SIZE(w90x900_##regname##_resource), \
.resource = w90x900_##regname##_resource, \
}

#define W90X900_UARTCFG(port, flag, uc, ulc, ufc) \
{ \
.hwport = port, \
.flags = flag, \
.ucon = uc, \
.ulcon = ulc, \
.ufcon = ufc, \
}
34 changes: 34 additions & 0 deletions arch/arm/mach-w90x900/include/mach/entry-macro.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* arch/arm/mach-w90x900/include/mach/entry-macro.S
*
* Low-level IRQ helper macros for W90P910-based platforms
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*
*/

#include <mach/hardware.h>
#include <mach/regs-irq.h>

.macro get_irqnr_preamble, base, tmp
.endm

.macro arch_ret_to_user, tmp1, tmp2
.endm

.macro get_irqnr_and_base, irqnr, irqstat, base, tmp

mov \base, #AIC_BA

ldr \irqnr, [ \base, #AIC_IPER]
ldr \irqnr, [ \base, #AIC_ISNR]
cmp \irqnr, #0

.endm

/* currently don't need an disable_fiq macro */

.macro disable_fiq
.endm
24 changes: 24 additions & 0 deletions arch/arm/mach-w90x900/include/mach/hardware.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* arch/arm/mach-w90x900/include/mach/hardware.h
*
* Copyright (c) 2008 Nuvoton technology corporation
* All rights reserved.
*
* Wan ZongShun <mcuos.com@gmail.com>
*
* Based on arch/arm/mach-s3c2410/include/mach/hardware.h
*
* 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.
*
*/

#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H

#include <asm/sizes.h>
#include <mach/map.h>

#endif /* __ASM_ARCH_HARDWARE_H */
30 changes: 30 additions & 0 deletions arch/arm/mach-w90x900/include/mach/io.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* arch/arm/mach-w90x900/include/mach/io.h
*
* Copyright (c) 2008 Nuvoton technology corporation
* All rights reserved.
*
* Wan ZongShun <mcuos.com@gmail.com>
*
* Based on arch/arm/mach-s3c2410/include/mach/io.h
*
* 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.
*
*/

#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H

#define IO_SPACE_LIMIT 0xffffffff

/*
* 1:1 mapping for ioremapped regions.
*/

#define __mem_pci(a) (a)
#define __io(a) __typesafe_io(a)

#endif
45 changes: 45 additions & 0 deletions arch/arm/mach-w90x900/include/mach/irqs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* arch/arm/mach-w90x900/include/mach/irqs.h
*
* Copyright (c) 2008 Nuvoton technology corporation
* All rights reserved.
*
* Wan ZongShun <mcuos.com@gmail.com>
*
* Based on arch/arm/mach-s3c2410/include/mach/irqs.h
*
* 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.
*
*/

#ifndef __ASM_ARCH_IRQS_H
#define __ASM_ARCH_IRQS_H

/*
* we keep the first set of CPU IRQs out of the range of
* the ISA space, so that the PC104 has them to itself
* and we don't end up having to do horrible things to the
* standard ISA drivers....
*
*/

#define W90X900_IRQ(x) (x)

/* Main cpu interrupts */

#define IRQ_WDT W90X900_IRQ(1)
#define IRQ_UART0 W90X900_IRQ(7)
#define IRQ_UART1 W90X900_IRQ(8)
#define IRQ_UART2 W90X900_IRQ(9)
#define IRQ_UART3 W90X900_IRQ(10)
#define IRQ_UART4 W90X900_IRQ(11)
#define IRQ_TIMER0 W90X900_IRQ(12)
#define IRQ_TIMER1 W90X900_IRQ(13)
#define IRQ_T_INT_GROUP W90X900_IRQ(14)
#define IRQ_ADC W90X900_IRQ(31)
#define NR_IRQS (IRQ_ADC+1)

#endif /* __ASM_ARCH_IRQ_H */
76 changes: 76 additions & 0 deletions arch/arm/mach-w90x900/include/mach/map.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* arch/arm/mach-w90x900/include/mach/map.h
*
* Copyright (c) 2008 Nuvoton technology corporation
* All rights reserved.
*
* Wan ZongShun <mcuos.com@gmail.com>
*
* Based on arch/arm/mach-s3c2410/include/mach/map.h
*
* 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.
*
*/

#ifndef __ASM_ARCH_MAP_H
#define __ASM_ARCH_MAP_H

#ifndef __ASSEMBLY__
#define W90X900_ADDR(x) ((void __iomem *)(0xF0000000 + (x)))
#else
#define W90X900_ADDR(x) (0xF0000000 + (x))
#endif

#define AHB_IO_BASE 0xB0000000
#define APB_IO_BASE 0xB8000000
#define CLOCKPW_BASE (APB_IO_BASE+0x200)
#define AIC_IO_BASE (APB_IO_BASE+0x2000)
#define TIMER_IO_BASE (APB_IO_BASE+0x1000)

/*
* interrupt controller is the first thing we put in, to make
* the assembly code for the irq detection easier
*/

#define W90X900_VA_IRQ W90X900_ADDR(0x00000000)
#define W90X900_PA_IRQ (0xB8002000)
#define W90X900_SZ_IRQ SZ_4K

#define W90X900_VA_GCR W90X900_ADDR(0x08002000)
#define W90X900_PA_GCR (0xB0000000)
#define W90X900_SZ_GCR SZ_4K

/* Clock and Power management */

#define W90X900_VA_CLKPWR (W90X900_VA_GCR+0x200)
#define W90X900_PA_CLKPWR (0xB0000200)
#define W90X900_SZ_CLKPWR SZ_4K

/* EBI management */

#define W90X900_VA_EBI W90X900_ADDR(0x00001000)
#define W90X900_PA_EBI (0xB0001000)
#define W90X900_SZ_EBI SZ_4K

/* UARTs */

#define W90X900_VA_UART W90X900_ADDR(0x08000000)
#define W90X900_PA_UART (0xB8000000)
#define W90X900_SZ_UART SZ_4K

/* Timers */

#define W90X900_VA_TIMER W90X900_ADDR(0x08001000)
#define W90X900_PA_TIMER (0xB8001000)
#define W90X900_SZ_TIMER SZ_4K

/* GPIO ports */

#define W90X900_VA_GPIO W90X900_ADDR(0x08003000)
#define W90X900_PA_GPIO (0xB8003000)
#define W90X900_SZ_GPIO SZ_4K

#endif /* __ASM_ARCH_MAP_H */
23 changes: 23 additions & 0 deletions arch/arm/mach-w90x900/include/mach/memory.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* arch/arm/mach-w90x900/include/mach/memory.h
*
* Copyright (c) 2008 Nuvoton technology corporation
* All rights reserved.
*
* Wan ZongShun <mcuos.com@gmail.com>
*
* Based on arch/arm/mach-s3c2410/include/mach/memory.h
*
* 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.
*
*/

#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

#define PHYS_OFFSET UL(0x00000000)

#endif
Loading

0 comments on commit 7ec80dd

Please sign in to comment.