aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-06-11 10:23:26 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-06-11 10:23:26 -0400
commit2631182bf93919577730e6a6c4345308db590057 (patch)
tree0cef28fdacc8b4d7cc42ec2f9f3049db726b8403
parent0aacfe1d239952a87c17e38e12df94c4ea979839 (diff)
parentcc63262f27582369737edcb4e810265db2a98ab4 (diff)
Merge branch 'w90x900' into devel
-rw-r--r--arch/arm/Kconfig3
-rw-r--r--arch/arm/configs/w90p910_defconfig423
-rw-r--r--arch/arm/mach-w90x900/Makefile2
-rw-r--r--arch/arm/mach-w90x900/clock.c77
-rw-r--r--arch/arm/mach-w90x900/clock.h36
-rw-r--r--arch/arm/mach-w90x900/cpu.h2
-rw-r--r--arch/arm/mach-w90x900/gpio.c154
-rw-r--r--arch/arm/mach-w90x900/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-w90x900/include/mach/gpio.h34
-rw-r--r--arch/arm/mach-w90x900/include/mach/irqs.h49
-rw-r--r--arch/arm/mach-w90x900/include/mach/map.h101
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-clock.h31
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-usb.h35
-rw-r--r--arch/arm/mach-w90x900/mach-w90p910evb.c164
-rw-r--r--arch/arm/mach-w90x900/mfp-w90p910.c116
-rw-r--r--arch/arm/mach-w90x900/w90p910.c53
16 files changed, 1189 insertions, 98 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8381bd793146..430d2b756165 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -478,6 +478,9 @@ config ARCH_NS9XXX
478config ARCH_W90X900 478config ARCH_W90X900
479 bool "Nuvoton W90X900 CPU" 479 bool "Nuvoton W90X900 CPU"
480 select CPU_ARM926T 480 select CPU_ARM926T
481 select ARCH_REQUIRE_GPIOLIB
482 select GENERIC_GPIO
483 select COMMON_CLKDEV
481 help 484 help
482 Support for Nuvoton (Winbond logic dept.) ARM9 processor,You 485 Support for Nuvoton (Winbond logic dept.) ARM9 processor,You
483 can login www.mcuos.com or www.nuvoton.com to know more. 486 can login www.mcuos.com or www.nuvoton.com to know more.
diff --git a/arch/arm/configs/w90p910_defconfig b/arch/arm/configs/w90p910_defconfig
index 56bda7c6d670..5245655a0ad3 100644
--- a/arch/arm/configs/w90p910_defconfig
+++ b/arch/arm/configs/w90p910_defconfig
@@ -1,11 +1,11 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.27-rc8-git8 3# Linux kernel version: 2.6.30
4# Sat Nov 15 10:05:00 2008 4# Wed Jun 10 22:09:25 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8# CONFIG_GENERIC_GPIO is not set 8CONFIG_GENERIC_GPIO=y
9# CONFIG_GENERIC_TIME is not set 9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set 10# CONFIG_GENERIC_CLOCKEVENTS is not set
11CONFIG_MMU=y 11CONFIG_MMU=y
@@ -22,8 +22,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set 22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_SUPPORTS_AOUT=y
26CONFIG_ZONE_DMA=y
27CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
28CONFIG_VECTORS_BASE=0xffff0000 26CONFIG_VECTORS_BASE=0xffff0000
29CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
@@ -42,10 +40,19 @@ CONFIG_SYSVIPC=y
42CONFIG_SYSVIPC_SYSCTL=y 40CONFIG_SYSVIPC_SYSCTL=y
43CONFIG_BSD_PROCESS_ACCT=y 41CONFIG_BSD_PROCESS_ACCT=y
44# CONFIG_BSD_PROCESS_ACCT_V3 is not set 42# CONFIG_BSD_PROCESS_ACCT_V3 is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_CLASSIC_RCU=y
48# CONFIG_TREE_RCU is not set
49# CONFIG_PREEMPT_RCU is not set
50# CONFIG_TREE_RCU_TRACE is not set
51# CONFIG_PREEMPT_RCU_TRACE is not set
45# CONFIG_IKCONFIG is not set 52# CONFIG_IKCONFIG is not set
46CONFIG_LOG_BUF_SHIFT=17 53CONFIG_LOG_BUF_SHIFT=17
47# CONFIG_CGROUPS is not set
48# CONFIG_GROUP_SCHED is not set 54# CONFIG_GROUP_SCHED is not set
55# CONFIG_CGROUPS is not set
49CONFIG_SYSFS_DEPRECATED=y 56CONFIG_SYSFS_DEPRECATED=y
50CONFIG_SYSFS_DEPRECATED_V2=y 57CONFIG_SYSFS_DEPRECATED_V2=y
51CONFIG_RELAY=y 58CONFIG_RELAY=y
@@ -56,52 +63,53 @@ CONFIG_USER_NS=y
56# CONFIG_PID_NS is not set 63# CONFIG_PID_NS is not set
57CONFIG_BLK_DEV_INITRD=y 64CONFIG_BLK_DEV_INITRD=y
58CONFIG_INITRAMFS_SOURCE="" 65CONFIG_INITRAMFS_SOURCE=""
66CONFIG_RD_GZIP=y
67CONFIG_RD_BZIP2=y
68CONFIG_RD_LZMA=y
69# CONFIG_INITRAMFS_COMPRESSION_NONE is not set
70# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
71# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
72# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y 73CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60CONFIG_SYSCTL=y 74CONFIG_SYSCTL=y
75CONFIG_ANON_INODES=y
61# CONFIG_EMBEDDED is not set 76# CONFIG_EMBEDDED is not set
62CONFIG_UID16=y 77CONFIG_UID16=y
63CONFIG_SYSCTL_SYSCALL=y 78CONFIG_SYSCTL_SYSCALL=y
64CONFIG_KALLSYMS=y 79CONFIG_KALLSYMS=y
65CONFIG_KALLSYMS_EXTRA_PASS=y 80CONFIG_KALLSYMS_EXTRA_PASS=y
81# CONFIG_STRIP_ASM_SYMS is not set
66CONFIG_HOTPLUG=y 82CONFIG_HOTPLUG=y
67CONFIG_PRINTK=y 83CONFIG_PRINTK=y
68CONFIG_BUG=y 84CONFIG_BUG=y
69CONFIG_ELF_CORE=y 85CONFIG_ELF_CORE=y
70CONFIG_COMPAT_BRK=y
71CONFIG_BASE_FULL=y 86CONFIG_BASE_FULL=y
72CONFIG_FUTEX=y 87CONFIG_FUTEX=y
73CONFIG_ANON_INODES=y
74CONFIG_EPOLL=y 88CONFIG_EPOLL=y
75CONFIG_SIGNALFD=y 89CONFIG_SIGNALFD=y
76CONFIG_TIMERFD=y 90CONFIG_TIMERFD=y
77CONFIG_EVENTFD=y 91CONFIG_EVENTFD=y
78CONFIG_SHMEM=y 92CONFIG_SHMEM=y
93CONFIG_AIO=y
79CONFIG_VM_EVENT_COUNTERS=y 94CONFIG_VM_EVENT_COUNTERS=y
95CONFIG_COMPAT_BRK=y
80CONFIG_SLAB=y 96CONFIG_SLAB=y
81# CONFIG_SLUB is not set 97# CONFIG_SLUB is not set
82# CONFIG_SLOB is not set 98# CONFIG_SLOB is not set
83# CONFIG_PROFILING is not set 99# CONFIG_PROFILING is not set
100CONFIG_TRACEPOINTS=y
84# CONFIG_MARKERS is not set 101# CONFIG_MARKERS is not set
85CONFIG_HAVE_OPROFILE=y 102CONFIG_HAVE_OPROFILE=y
86# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
87# CONFIG_HAVE_IOREMAP_PROT is not set
88CONFIG_HAVE_KPROBES=y 103CONFIG_HAVE_KPROBES=y
89CONFIG_HAVE_KRETPROBES=y 104CONFIG_HAVE_KRETPROBES=y
90# CONFIG_HAVE_ARCH_TRACEHOOK is not set 105# CONFIG_SLOW_WORK is not set
91# CONFIG_HAVE_DMA_ATTRS is not set
92# CONFIG_USE_GENERIC_SMP_HELPERS is not set
93# CONFIG_HAVE_CLK is not set
94CONFIG_PROC_PAGE_MONITOR=y
95CONFIG_HAVE_GENERIC_DMA_COHERENT=y 106CONFIG_HAVE_GENERIC_DMA_COHERENT=y
96CONFIG_SLABINFO=y 107CONFIG_SLABINFO=y
97CONFIG_RT_MUTEXES=y 108CONFIG_RT_MUTEXES=y
98# CONFIG_TINY_SHMEM is not set
99CONFIG_BASE_SMALL=0 109CONFIG_BASE_SMALL=0
100# CONFIG_MODULES is not set 110# CONFIG_MODULES is not set
101CONFIG_BLOCK=y 111CONFIG_BLOCK=y
102CONFIG_LBD=y 112CONFIG_LBD=y
103CONFIG_BLK_DEV_IO_TRACE=y
104CONFIG_LSF=y
105CONFIG_BLK_DEV_BSG=y 113CONFIG_BLK_DEV_BSG=y
106# CONFIG_BLK_DEV_INTEGRITY is not set 114# CONFIG_BLK_DEV_INTEGRITY is not set
107 115
@@ -117,7 +125,7 @@ CONFIG_IOSCHED_CFQ=y
117CONFIG_DEFAULT_CFQ=y 125CONFIG_DEFAULT_CFQ=y
118# CONFIG_DEFAULT_NOOP is not set 126# CONFIG_DEFAULT_NOOP is not set
119CONFIG_DEFAULT_IOSCHED="cfq" 127CONFIG_DEFAULT_IOSCHED="cfq"
120CONFIG_CLASSIC_RCU=y 128# CONFIG_FREEZER is not set
121 129
122# 130#
123# System Type 131# System Type
@@ -127,10 +135,10 @@ CONFIG_CLASSIC_RCU=y
127# CONFIG_ARCH_REALVIEW is not set 135# CONFIG_ARCH_REALVIEW is not set
128# CONFIG_ARCH_VERSATILE is not set 136# CONFIG_ARCH_VERSATILE is not set
129# CONFIG_ARCH_AT91 is not set 137# CONFIG_ARCH_AT91 is not set
130# CONFIG_ARCH_CLPS7500 is not set
131# CONFIG_ARCH_CLPS711X is not set 138# CONFIG_ARCH_CLPS711X is not set
132# CONFIG_ARCH_EBSA110 is not set 139# CONFIG_ARCH_EBSA110 is not set
133# CONFIG_ARCH_EP93XX is not set 140# CONFIG_ARCH_EP93XX is not set
141# CONFIG_ARCH_GEMINI is not set
134# CONFIG_ARCH_FOOTBRIDGE is not set 142# CONFIG_ARCH_FOOTBRIDGE is not set
135# CONFIG_ARCH_NETX is not set 143# CONFIG_ARCH_NETX is not set
136# CONFIG_ARCH_H720X is not set 144# CONFIG_ARCH_H720X is not set
@@ -151,23 +159,17 @@ CONFIG_CLASSIC_RCU=y
151# CONFIG_ARCH_ORION5X is not set 159# CONFIG_ARCH_ORION5X is not set
152# CONFIG_ARCH_PNX4008 is not set 160# CONFIG_ARCH_PNX4008 is not set
153# CONFIG_ARCH_PXA is not set 161# CONFIG_ARCH_PXA is not set
162# CONFIG_ARCH_MMP is not set
154# CONFIG_ARCH_RPC is not set 163# CONFIG_ARCH_RPC is not set
155# CONFIG_ARCH_SA1100 is not set 164# CONFIG_ARCH_SA1100 is not set
156# CONFIG_ARCH_S3C2410 is not set 165# CONFIG_ARCH_S3C2410 is not set
166# CONFIG_ARCH_S3C64XX is not set
157# CONFIG_ARCH_SHARK is not set 167# CONFIG_ARCH_SHARK is not set
158# CONFIG_ARCH_LH7A40X is not set 168# CONFIG_ARCH_LH7A40X is not set
159# CONFIG_ARCH_DAVINCI is not set 169# CONFIG_ARCH_DAVINCI is not set
160# CONFIG_ARCH_OMAP is not set 170# CONFIG_ARCH_OMAP is not set
161# CONFIG_ARCH_MSM7X00A is not set 171# CONFIG_ARCH_MSM is not set
162CONFIG_ARCH_W90X900=y 172CONFIG_ARCH_W90X900=y
163
164#
165# Boot options
166#
167
168#
169# Power management
170#
171CONFIG_CPU_W90P910=y 173CONFIG_CPU_W90P910=y
172 174
173# 175#
@@ -198,6 +200,7 @@ CONFIG_ARM_THUMB=y
198# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 200# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
199# CONFIG_CPU_CACHE_ROUND_ROBIN is not set 201# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
200# CONFIG_OUTER_CACHE is not set 202# CONFIG_OUTER_CACHE is not set
203CONFIG_COMMON_CLKDEV=y
201 204
202# 205#
203# Bus support 206# Bus support
@@ -209,27 +212,32 @@ CONFIG_ARM_THUMB=y
209# 212#
210# Kernel Features 213# Kernel Features
211# 214#
212# CONFIG_TICK_ONESHOT is not set 215CONFIG_VMSPLIT_3G=y
216# CONFIG_VMSPLIT_2G is not set
217# CONFIG_VMSPLIT_1G is not set
218CONFIG_PAGE_OFFSET=0xC0000000
213CONFIG_PREEMPT=y 219CONFIG_PREEMPT=y
214CONFIG_HZ=100 220CONFIG_HZ=100
215CONFIG_AEABI=y 221CONFIG_AEABI=y
216CONFIG_OABI_COMPAT=y 222CONFIG_OABI_COMPAT=y
217CONFIG_ARCH_FLATMEM_HAS_HOLES=y 223# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set
218# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 224# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
225# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
226# CONFIG_HIGHMEM is not set
219CONFIG_SELECT_MEMORY_MODEL=y 227CONFIG_SELECT_MEMORY_MODEL=y
220CONFIG_FLATMEM_MANUAL=y 228CONFIG_FLATMEM_MANUAL=y
221# CONFIG_DISCONTIGMEM_MANUAL is not set 229# CONFIG_DISCONTIGMEM_MANUAL is not set
222# CONFIG_SPARSEMEM_MANUAL is not set 230# CONFIG_SPARSEMEM_MANUAL is not set
223CONFIG_FLATMEM=y 231CONFIG_FLATMEM=y
224CONFIG_FLAT_NODE_MEM_MAP=y 232CONFIG_FLAT_NODE_MEM_MAP=y
225# CONFIG_SPARSEMEM_STATIC is not set
226# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
227CONFIG_PAGEFLAGS_EXTENDED=y 233CONFIG_PAGEFLAGS_EXTENDED=y
228CONFIG_SPLIT_PTLOCK_CPUS=4096 234CONFIG_SPLIT_PTLOCK_CPUS=4096
229# CONFIG_RESOURCES_64BIT is not set 235# CONFIG_PHYS_ADDR_T_64BIT is not set
230CONFIG_ZONE_DMA_FLAG=1 236CONFIG_ZONE_DMA_FLAG=0
231CONFIG_BOUNCE=y
232CONFIG_VIRT_TO_BUS=y 237CONFIG_VIRT_TO_BUS=y
238CONFIG_UNEVICTABLE_LRU=y
239CONFIG_HAVE_MLOCK=y
240CONFIG_HAVE_MLOCKED_PAGE_BIT=y
233CONFIG_ALIGNMENT_TRAP=y 241CONFIG_ALIGNMENT_TRAP=y
234 242
235# 243#
@@ -237,12 +245,17 @@ CONFIG_ALIGNMENT_TRAP=y
237# 245#
238CONFIG_ZBOOT_ROM_TEXT=0 246CONFIG_ZBOOT_ROM_TEXT=0
239CONFIG_ZBOOT_ROM_BSS=0 247CONFIG_ZBOOT_ROM_BSS=0
240CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 initrd=0xa00000,4000000 mem=64M" 248CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
241# CONFIG_XIP_KERNEL is not set 249# CONFIG_XIP_KERNEL is not set
242CONFIG_KEXEC=y 250CONFIG_KEXEC=y
243CONFIG_ATAGS_PROC=y 251CONFIG_ATAGS_PROC=y
244 252
245# 253#
254# CPU Power Management
255#
256# CONFIG_CPU_IDLE is not set
257
258#
246# Floating point emulation 259# Floating point emulation
247# 260#
248 261
@@ -258,6 +271,8 @@ CONFIG_FPE_NWFPE=y
258# Userspace binary formats 271# Userspace binary formats
259# 272#
260CONFIG_BINFMT_ELF=y 273CONFIG_BINFMT_ELF=y
274# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
275CONFIG_HAVE_AOUT=y
261# CONFIG_BINFMT_AOUT is not set 276# CONFIG_BINFMT_AOUT is not set
262# CONFIG_BINFMT_MISC is not set 277# CONFIG_BINFMT_MISC is not set
263 278
@@ -282,11 +297,93 @@ CONFIG_FW_LOADER=y
282CONFIG_FIRMWARE_IN_KERNEL=y 297CONFIG_FIRMWARE_IN_KERNEL=y
283CONFIG_EXTRA_FIRMWARE="" 298CONFIG_EXTRA_FIRMWARE=""
284# CONFIG_SYS_HYPERVISOR is not set 299# CONFIG_SYS_HYPERVISOR is not set
285# CONFIG_MTD is not set 300CONFIG_MTD=y
301# CONFIG_MTD_DEBUG is not set
302CONFIG_MTD_CONCAT=y
303CONFIG_MTD_PARTITIONS=y
304# CONFIG_MTD_REDBOOT_PARTS is not set
305# CONFIG_MTD_CMDLINE_PARTS is not set
306# CONFIG_MTD_AFS_PARTS is not set
307# CONFIG_MTD_AR7_PARTS is not set
308
309#
310# User Modules And Translation Layers
311#
312CONFIG_MTD_CHAR=y
313CONFIG_MTD_BLKDEVS=y
314CONFIG_MTD_BLOCK=y
315# CONFIG_FTL is not set
316# CONFIG_NFTL is not set
317# CONFIG_INFTL is not set
318# CONFIG_RFD_FTL is not set
319# CONFIG_SSFDC is not set
320# CONFIG_MTD_OOPS is not set
321
322#
323# RAM/ROM/Flash chip drivers
324#
325CONFIG_MTD_CFI=y
326# CONFIG_MTD_JEDECPROBE is not set
327CONFIG_MTD_GEN_PROBE=y
328# CONFIG_MTD_CFI_ADV_OPTIONS is not set
329CONFIG_MTD_MAP_BANK_WIDTH_1=y
330CONFIG_MTD_MAP_BANK_WIDTH_2=y
331CONFIG_MTD_MAP_BANK_WIDTH_4=y
332# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
333# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
334# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
335CONFIG_MTD_CFI_I1=y
336CONFIG_MTD_CFI_I2=y
337# CONFIG_MTD_CFI_I4 is not set
338# CONFIG_MTD_CFI_I8 is not set
339# CONFIG_MTD_CFI_INTELEXT is not set
340CONFIG_MTD_CFI_AMDSTD=y
341# CONFIG_MTD_CFI_STAA is not set
342CONFIG_MTD_CFI_UTIL=y
343# CONFIG_MTD_RAM is not set
344# CONFIG_MTD_ROM is not set
345# CONFIG_MTD_ABSENT is not set
346
347#
348# Mapping drivers for chip access
349#
350# CONFIG_MTD_COMPLEX_MAPPINGS is not set
351CONFIG_MTD_PHYSMAP=y
352# CONFIG_MTD_PHYSMAP_COMPAT is not set
353# CONFIG_MTD_ARM_INTEGRATOR is not set
354# CONFIG_MTD_PLATRAM is not set
355
356#
357# Self-contained MTD device drivers
358#
359# CONFIG_MTD_SLRAM is not set
360# CONFIG_MTD_PHRAM is not set
361# CONFIG_MTD_MTDRAM is not set
362# CONFIG_MTD_BLOCK2MTD is not set
363
364#
365# Disk-On-Chip Device Drivers
366#
367# CONFIG_MTD_DOC2000 is not set
368# CONFIG_MTD_DOC2001 is not set
369# CONFIG_MTD_DOC2001PLUS is not set
370# CONFIG_MTD_NAND is not set
371# CONFIG_MTD_ONENAND is not set
372
373#
374# LPDDR flash memory drivers
375#
376# CONFIG_MTD_LPDDR is not set
377
378#
379# UBI - Unsorted block images
380#
381# CONFIG_MTD_UBI is not set
286# CONFIG_PARPORT is not set 382# CONFIG_PARPORT is not set
287CONFIG_BLK_DEV=y 383CONFIG_BLK_DEV=y
288# CONFIG_BLK_DEV_COW_COMMON is not set 384# CONFIG_BLK_DEV_COW_COMMON is not set
289# CONFIG_BLK_DEV_LOOP is not set 385# CONFIG_BLK_DEV_LOOP is not set
386# CONFIG_BLK_DEV_UB is not set
290CONFIG_BLK_DEV_RAM=y 387CONFIG_BLK_DEV_RAM=y
291CONFIG_BLK_DEV_RAM_COUNT=16 388CONFIG_BLK_DEV_RAM_COUNT=16
292CONFIG_BLK_DEV_RAM_SIZE=16384 389CONFIG_BLK_DEV_RAM_SIZE=16384
@@ -300,9 +397,41 @@ CONFIG_HAVE_IDE=y
300# SCSI device support 397# SCSI device support
301# 398#
302# CONFIG_RAID_ATTRS is not set 399# CONFIG_RAID_ATTRS is not set
303# CONFIG_SCSI is not set 400CONFIG_SCSI=y
304# CONFIG_SCSI_DMA is not set 401CONFIG_SCSI_DMA=y
402# CONFIG_SCSI_TGT is not set
305# CONFIG_SCSI_NETLINK is not set 403# CONFIG_SCSI_NETLINK is not set
404# CONFIG_SCSI_PROC_FS is not set
405
406#
407# SCSI support type (disk, tape, CD-ROM)
408#
409CONFIG_BLK_DEV_SD=y
410# CONFIG_CHR_DEV_ST is not set
411# CONFIG_CHR_DEV_OSST is not set
412# CONFIG_BLK_DEV_SR is not set
413# CONFIG_CHR_DEV_SG is not set
414# CONFIG_CHR_DEV_SCH is not set
415
416#
417# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
418#
419# CONFIG_SCSI_MULTI_LUN is not set
420# CONFIG_SCSI_CONSTANTS is not set
421# CONFIG_SCSI_LOGGING is not set
422# CONFIG_SCSI_SCAN_ASYNC is not set
423
424#
425# SCSI Transports
426#
427# CONFIG_SCSI_SPI_ATTRS is not set
428# CONFIG_SCSI_FC_ATTRS is not set
429# CONFIG_SCSI_SAS_ATTRS is not set
430# CONFIG_SCSI_SAS_LIBSAS is not set
431# CONFIG_SCSI_SRP_ATTRS is not set
432# CONFIG_SCSI_LOWLEVEL is not set
433# CONFIG_SCSI_DH is not set
434# CONFIG_SCSI_OSD_INITIATOR is not set
306# CONFIG_ATA is not set 435# CONFIG_ATA is not set
307# CONFIG_MD is not set 436# CONFIG_MD is not set
308 437
@@ -354,38 +483,57 @@ CONFIG_HW_CONSOLE=y
354# 483#
355# Serial drivers 484# Serial drivers
356# 485#
357# CONFIG_SERIAL_8250 is not set 486CONFIG_SERIAL_8250=y
487CONFIG_SERIAL_8250_CONSOLE=y
488CONFIG_SERIAL_8250_NR_UARTS=1
489CONFIG_SERIAL_8250_RUNTIME_UARTS=1
490# CONFIG_SERIAL_8250_EXTENDED is not set
358 491
359# 492#
360# Non-8250 serial port support 493# Non-8250 serial port support
361# 494#
362CONFIG_SERIAL_W90X900=y
363# CONFIG_SERIAL_W90X900_PORT1 is not set
364# CONFIG_SERIAL_W90X900_PORT2 is not set
365# CONFIG_SERIAL_W90X900_PORT3 is not set
366# CONFIG_SERIAL_W90X900_PORT4 is not set
367CONFIG_SERIAL_W90X900_CONSOLE=y
368CONFIG_SERIAL_CORE=y 495CONFIG_SERIAL_CORE=y
369CONFIG_SERIAL_CORE_CONSOLE=y 496CONFIG_SERIAL_CORE_CONSOLE=y
370CONFIG_UNIX98_PTYS=y 497CONFIG_UNIX98_PTYS=y
498# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
371# CONFIG_LEGACY_PTYS is not set 499# CONFIG_LEGACY_PTYS is not set
372# CONFIG_IPMI_HANDLER is not set 500# CONFIG_IPMI_HANDLER is not set
373# CONFIG_HW_RANDOM is not set 501# CONFIG_HW_RANDOM is not set
374# CONFIG_NVRAM is not set
375# CONFIG_R3964 is not set 502# CONFIG_R3964 is not set
376# CONFIG_RAW_DRIVER is not set 503# CONFIG_RAW_DRIVER is not set
377# CONFIG_TCG_TPM is not set 504# CONFIG_TCG_TPM is not set
378# CONFIG_I2C is not set 505# CONFIG_I2C is not set
379# CONFIG_SPI is not set 506# CONFIG_SPI is not set
507CONFIG_ARCH_REQUIRE_GPIOLIB=y
508CONFIG_GPIOLIB=y
509# CONFIG_GPIO_SYSFS is not set
510
511#
512# Memory mapped GPIO expanders:
513#
514
515#
516# I2C GPIO expanders:
517#
518
519#
520# PCI GPIO expanders:
521#
522
523#
524# SPI GPIO expanders:
525#
380# CONFIG_W1 is not set 526# CONFIG_W1 is not set
381# CONFIG_POWER_SUPPLY is not set 527# CONFIG_POWER_SUPPLY is not set
382# CONFIG_HWMON is not set 528# CONFIG_HWMON is not set
529# CONFIG_THERMAL is not set
530# CONFIG_THERMAL_HWMON is not set
383# CONFIG_WATCHDOG is not set 531# CONFIG_WATCHDOG is not set
532CONFIG_SSB_POSSIBLE=y
384 533
385# 534#
386# Sonics Silicon Backplane 535# Sonics Silicon Backplane
387# 536#
388CONFIG_SSB_POSSIBLE=y
389# CONFIG_SSB is not set 537# CONFIG_SSB is not set
390 538
391# 539#
@@ -393,10 +541,11 @@ CONFIG_SSB_POSSIBLE=y
393# 541#
394# CONFIG_MFD_CORE is not set 542# CONFIG_MFD_CORE is not set
395# CONFIG_MFD_SM501 is not set 543# CONFIG_MFD_SM501 is not set
544# CONFIG_MFD_ASIC3 is not set
545# CONFIG_HTC_EGPIO is not set
396# CONFIG_HTC_PASIC3 is not set 546# CONFIG_HTC_PASIC3 is not set
397# CONFIG_MFD_TMIO is not set 547# CONFIG_MFD_TMIO is not set
398# CONFIG_MFD_T7L66XB is not set 548# CONFIG_MFD_TC6393XB is not set
399# CONFIG_MFD_TC6387XB is not set
400 549
401# 550#
402# Multimedia devices 551# Multimedia devices
@@ -433,33 +582,131 @@ CONFIG_SSB_POSSIBLE=y
433CONFIG_DUMMY_CONSOLE=y 582CONFIG_DUMMY_CONSOLE=y
434# CONFIG_SOUND is not set 583# CONFIG_SOUND is not set
435# CONFIG_HID_SUPPORT is not set 584# CONFIG_HID_SUPPORT is not set
436# CONFIG_USB_SUPPORT is not set 585CONFIG_USB_SUPPORT=y
586CONFIG_USB_ARCH_HAS_HCD=y
587# CONFIG_USB_ARCH_HAS_OHCI is not set
588# CONFIG_USB_ARCH_HAS_EHCI is not set
589CONFIG_USB=y
590# CONFIG_USB_DEBUG is not set
591# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
592
593#
594# Miscellaneous USB options
595#
596# CONFIG_USB_DEVICEFS is not set
597CONFIG_USB_DEVICE_CLASS=y
598# CONFIG_USB_DYNAMIC_MINORS is not set
599# CONFIG_USB_OTG is not set
600CONFIG_USB_MON=y
601# CONFIG_USB_WUSB is not set
602# CONFIG_USB_WUSB_CBAF is not set
603
604#
605# USB Host Controller Drivers
606#
607# CONFIG_USB_C67X00_HCD is not set
608# CONFIG_USB_OXU210HP_HCD is not set
609# CONFIG_USB_ISP116X_HCD is not set
610# CONFIG_USB_ISP1760_HCD is not set
611# CONFIG_USB_SL811_HCD is not set
612# CONFIG_USB_R8A66597_HCD is not set
613# CONFIG_USB_HWA_HCD is not set
614
615#
616# USB Device Class drivers
617#
618# CONFIG_USB_ACM is not set
619# CONFIG_USB_PRINTER is not set
620# CONFIG_USB_WDM is not set
621# CONFIG_USB_TMC is not set
622
623#
624# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
625#
626
627#
628# also be needed; see USB_STORAGE Help for more info
629#
630CONFIG_USB_STORAGE=y
631# CONFIG_USB_STORAGE_DEBUG is not set
632# CONFIG_USB_STORAGE_DATAFAB is not set
633# CONFIG_USB_STORAGE_FREECOM is not set
634# CONFIG_USB_STORAGE_ISD200 is not set
635# CONFIG_USB_STORAGE_USBAT is not set
636# CONFIG_USB_STORAGE_SDDR09 is not set
637# CONFIG_USB_STORAGE_SDDR55 is not set
638# CONFIG_USB_STORAGE_JUMPSHOT is not set
639# CONFIG_USB_STORAGE_ALAUDA is not set
640# CONFIG_USB_STORAGE_ONETOUCH is not set
641# CONFIG_USB_STORAGE_KARMA is not set
642# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
643# CONFIG_USB_LIBUSUAL is not set
644
645#
646# USB Imaging devices
647#
648# CONFIG_USB_MDC800 is not set
649# CONFIG_USB_MICROTEK is not set
650
651#
652# USB port drivers
653#
654# CONFIG_USB_SERIAL is not set
655
656#
657# USB Miscellaneous drivers
658#
659# CONFIG_USB_EMI62 is not set
660# CONFIG_USB_EMI26 is not set
661# CONFIG_USB_ADUTUX is not set
662# CONFIG_USB_SEVSEG is not set
663# CONFIG_USB_RIO500 is not set
664# CONFIG_USB_LEGOTOWER is not set
665# CONFIG_USB_LCD is not set
666# CONFIG_USB_BERRY_CHARGE is not set
667# CONFIG_USB_LED is not set
668# CONFIG_USB_CYPRESS_CY7C63 is not set
669# CONFIG_USB_CYTHERM is not set
670# CONFIG_USB_IDMOUSE is not set
671# CONFIG_USB_FTDI_ELAN is not set
672# CONFIG_USB_APPLEDISPLAY is not set
673# CONFIG_USB_LD is not set
674# CONFIG_USB_TRANCEVIBRATOR is not set
675# CONFIG_USB_IOWARRIOR is not set
676# CONFIG_USB_ISIGHTFW is not set
677# CONFIG_USB_VST is not set
678# CONFIG_USB_GADGET is not set
679
680#
681# OTG and related infrastructure
682#
683# CONFIG_USB_GPIO_VBUS is not set
684# CONFIG_NOP_USB_XCEIV is not set
437# CONFIG_MMC is not set 685# CONFIG_MMC is not set
686# CONFIG_MEMSTICK is not set
687# CONFIG_ACCESSIBILITY is not set
438# CONFIG_NEW_LEDS is not set 688# CONFIG_NEW_LEDS is not set
439CONFIG_RTC_LIB=y 689CONFIG_RTC_LIB=y
440# CONFIG_RTC_CLASS is not set 690# CONFIG_RTC_CLASS is not set
441# CONFIG_DMADEVICES is not set 691# CONFIG_DMADEVICES is not set
442 692# CONFIG_AUXDISPLAY is not set
443#
444# Voltage and Current regulators
445#
446# CONFIG_REGULATOR is not set 693# CONFIG_REGULATOR is not set
447# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
448# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
449# CONFIG_REGULATOR_BQ24022 is not set
450# CONFIG_UIO is not set 694# CONFIG_UIO is not set
695# CONFIG_STAGING is not set
451 696
452# 697#
453# File systems 698# File systems
454# 699#
455# CONFIG_EXT2_FS is not set 700# CONFIG_EXT2_FS is not set
456# CONFIG_EXT3_FS is not set 701# CONFIG_EXT3_FS is not set
457# CONFIG_EXT4DEV_FS is not set 702# CONFIG_EXT4_FS is not set
458# CONFIG_REISERFS_FS is not set 703# CONFIG_REISERFS_FS is not set
459# CONFIG_JFS_FS is not set 704# CONFIG_JFS_FS is not set
460CONFIG_FS_POSIX_ACL=y 705CONFIG_FS_POSIX_ACL=y
706CONFIG_FILE_LOCKING=y
461# CONFIG_XFS_FS is not set 707# CONFIG_XFS_FS is not set
462# CONFIG_GFS2_FS is not set 708# CONFIG_GFS2_FS is not set
709# CONFIG_BTRFS_FS is not set
463# CONFIG_DNOTIFY is not set 710# CONFIG_DNOTIFY is not set
464# CONFIG_INOTIFY is not set 711# CONFIG_INOTIFY is not set
465# CONFIG_QUOTA is not set 712# CONFIG_QUOTA is not set
@@ -469,6 +716,11 @@ CONFIG_FS_POSIX_ACL=y
469CONFIG_GENERIC_ACL=y 716CONFIG_GENERIC_ACL=y
470 717
471# 718#
719# Caches
720#
721# CONFIG_FSCACHE is not set
722
723#
472# CD-ROM/DVD Filesystems 724# CD-ROM/DVD Filesystems
473# 725#
474# CONFIG_ISO9660_FS is not set 726# CONFIG_ISO9660_FS is not set
@@ -486,15 +738,13 @@ CONFIG_GENERIC_ACL=y
486# 738#
487CONFIG_PROC_FS=y 739CONFIG_PROC_FS=y
488CONFIG_PROC_SYSCTL=y 740CONFIG_PROC_SYSCTL=y
741CONFIG_PROC_PAGE_MONITOR=y
489CONFIG_SYSFS=y 742CONFIG_SYSFS=y
490CONFIG_TMPFS=y 743CONFIG_TMPFS=y
491CONFIG_TMPFS_POSIX_ACL=y 744CONFIG_TMPFS_POSIX_ACL=y
492# CONFIG_HUGETLB_PAGE is not set 745# CONFIG_HUGETLB_PAGE is not set
493# CONFIG_CONFIGFS_FS is not set 746# CONFIG_CONFIGFS_FS is not set
494 747CONFIG_MISC_FILESYSTEMS=y
495#
496# Miscellaneous filesystems
497#
498# CONFIG_ADFS_FS is not set 748# CONFIG_ADFS_FS is not set
499# CONFIG_AFFS_FS is not set 749# CONFIG_AFFS_FS is not set
500# CONFIG_HFS_FS is not set 750# CONFIG_HFS_FS is not set
@@ -502,15 +752,22 @@ CONFIG_TMPFS_POSIX_ACL=y
502# CONFIG_BEFS_FS is not set 752# CONFIG_BEFS_FS is not set
503# CONFIG_BFS_FS is not set 753# CONFIG_BFS_FS is not set
504# CONFIG_EFS_FS is not set 754# CONFIG_EFS_FS is not set
755# CONFIG_JFFS2_FS is not set
505# CONFIG_CRAMFS is not set 756# CONFIG_CRAMFS is not set
757# CONFIG_SQUASHFS is not set
506# CONFIG_VXFS_FS is not set 758# CONFIG_VXFS_FS is not set
507# CONFIG_MINIX_FS is not set 759# CONFIG_MINIX_FS is not set
508# CONFIG_OMFS_FS is not set 760# CONFIG_OMFS_FS is not set
509# CONFIG_HPFS_FS is not set 761# CONFIG_HPFS_FS is not set
510# CONFIG_QNX4FS_FS is not set 762# CONFIG_QNX4FS_FS is not set
511CONFIG_ROMFS_FS=y 763CONFIG_ROMFS_FS=y
764CONFIG_ROMFS_BACKED_BY_BLOCK=y
765# CONFIG_ROMFS_BACKED_BY_MTD is not set
766# CONFIG_ROMFS_BACKED_BY_BOTH is not set
767CONFIG_ROMFS_ON_BLOCK=y
512# CONFIG_SYSV_FS is not set 768# CONFIG_SYSV_FS is not set
513# CONFIG_UFS_FS is not set 769# CONFIG_UFS_FS is not set
770# CONFIG_NILFS2_FS is not set
514 771
515# 772#
516# Partition Types 773# Partition Types
@@ -586,18 +843,36 @@ CONFIG_FRAME_WARN=1024
586CONFIG_DEBUG_FS=y 843CONFIG_DEBUG_FS=y
587# CONFIG_HEADERS_CHECK is not set 844# CONFIG_HEADERS_CHECK is not set
588# CONFIG_DEBUG_KERNEL is not set 845# CONFIG_DEBUG_KERNEL is not set
846CONFIG_STACKTRACE=y
589CONFIG_DEBUG_BUGVERBOSE=y 847CONFIG_DEBUG_BUGVERBOSE=y
590CONFIG_DEBUG_MEMORY_INIT=y 848CONFIG_DEBUG_MEMORY_INIT=y
591CONFIG_FRAME_POINTER=y 849# CONFIG_RCU_CPU_STALL_DETECTOR is not set
592# CONFIG_LATENCYTOP is not set 850# CONFIG_LATENCYTOP is not set
593# CONFIG_SYSCTL_SYSCALL_CHECK is not set 851# CONFIG_SYSCTL_SYSCALL_CHECK is not set
594CONFIG_HAVE_FTRACE=y 852CONFIG_NOP_TRACER=y
595CONFIG_HAVE_DYNAMIC_FTRACE=y 853CONFIG_HAVE_FUNCTION_TRACER=y
596# CONFIG_FTRACE is not set 854CONFIG_RING_BUFFER=y
855CONFIG_TRACING=y
856CONFIG_TRACING_SUPPORT=y
857
858#
859# Tracers
860#
861# CONFIG_FUNCTION_TRACER is not set
597# CONFIG_SCHED_TRACER is not set 862# CONFIG_SCHED_TRACER is not set
598# CONFIG_CONTEXT_SWITCH_TRACER is not set 863# CONFIG_CONTEXT_SWITCH_TRACER is not set
864# CONFIG_EVENT_TRACER is not set
865# CONFIG_BOOT_TRACER is not set
866# CONFIG_TRACE_BRANCH_PROFILING is not set
867# CONFIG_STACK_TRACER is not set
868# CONFIG_KMEMTRACE is not set
869# CONFIG_WORKQUEUE_TRACER is not set
870CONFIG_BLK_DEV_IO_TRACE=y
871# CONFIG_FTRACE_STARTUP_TEST is not set
872# CONFIG_DYNAMIC_DEBUG is not set
599# CONFIG_SAMPLES is not set 873# CONFIG_SAMPLES is not set
600CONFIG_HAVE_ARCH_KGDB=y 874CONFIG_HAVE_ARCH_KGDB=y
875CONFIG_ARM_UNWIND=y
601# CONFIG_DEBUG_USER is not set 876# CONFIG_DEBUG_USER is not set
602 877
603# 878#
@@ -605,14 +880,15 @@ CONFIG_HAVE_ARCH_KGDB=y
605# 880#
606# CONFIG_KEYS is not set 881# CONFIG_KEYS is not set
607# CONFIG_SECURITY is not set 882# CONFIG_SECURITY is not set
883# CONFIG_SECURITYFS is not set
608# CONFIG_SECURITY_FILE_CAPABILITIES is not set 884# CONFIG_SECURITY_FILE_CAPABILITIES is not set
609# CONFIG_CRYPTO is not set 885# CONFIG_CRYPTO is not set
886CONFIG_BINARY_PRINTF=y
610 887
611# 888#
612# Library routines 889# Library routines
613# 890#
614# CONFIG_GENERIC_FIND_FIRST_BIT is not set 891CONFIG_GENERIC_FIND_LAST_BIT=y
615# CONFIG_GENERIC_FIND_NEXT_BIT is not set
616# CONFIG_CRC_CCITT is not set 892# CONFIG_CRC_CCITT is not set
617# CONFIG_CRC16 is not set 893# CONFIG_CRC16 is not set
618# CONFIG_CRC_T10DIF is not set 894# CONFIG_CRC_T10DIF is not set
@@ -620,7 +896,10 @@ CONFIG_HAVE_ARCH_KGDB=y
620# CONFIG_CRC32 is not set 896# CONFIG_CRC32 is not set
621# CONFIG_CRC7 is not set 897# CONFIG_CRC7 is not set
622# CONFIG_LIBCRC32C is not set 898# CONFIG_LIBCRC32C is not set
623CONFIG_PLIST=y 899CONFIG_ZLIB_INFLATE=y
900CONFIG_DECOMPRESS_GZIP=y
901CONFIG_DECOMPRESS_BZIP2=y
902CONFIG_DECOMPRESS_LZMA=y
624CONFIG_HAS_IOMEM=y 903CONFIG_HAS_IOMEM=y
625CONFIG_HAS_IOPORT=y 904CONFIG_HAS_IOPORT=y
626CONFIG_HAS_DMA=y 905CONFIG_HAS_DMA=y
diff --git a/arch/arm/mach-w90x900/Makefile b/arch/arm/mach-w90x900/Makefile
index 0c0c1d63f1c7..d50c94f4dbdf 100644
--- a/arch/arm/mach-w90x900/Makefile
+++ b/arch/arm/mach-w90x900/Makefile
@@ -4,7 +4,7 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := irq.o time.o 7obj-y := irq.o time.o mfp-w90p910.o gpio.o clock.o
8 8
9# W90X900 CPU support files 9# W90X900 CPU support files
10 10
diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c
new file mode 100644
index 000000000000..f420613cd395
--- /dev/null
+++ b/arch/arm/mach-w90x900/clock.c
@@ -0,0 +1,77 @@
1/*
2 * linux/arch/arm/mach-w90x900/clock.c
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License.
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/errno.h>
17#include <linux/err.h>
18#include <linux/string.h>
19#include <linux/clk.h>
20#include <linux/spinlock.h>
21#include <linux/platform_device.h>
22#include <linux/io.h>
23
24#include <mach/hardware.h>
25
26#include "clock.h"
27
28static DEFINE_SPINLOCK(clocks_lock);
29
30int clk_enable(struct clk *clk)
31{
32 unsigned long flags;
33
34 spin_lock_irqsave(&clocks_lock, flags);
35 if (clk->enabled++ == 0)
36 (clk->enable)(clk, 1);
37 spin_unlock_irqrestore(&clocks_lock, flags);
38
39 return 0;
40}
41EXPORT_SYMBOL(clk_enable);
42
43void clk_disable(struct clk *clk)
44{
45 unsigned long flags;
46
47 WARN_ON(clk->enabled == 0);
48
49 spin_lock_irqsave(&clocks_lock, flags);
50 if (--clk->enabled == 0)
51 (clk->enable)(clk, 0);
52 spin_unlock_irqrestore(&clocks_lock, flags);
53}
54EXPORT_SYMBOL(clk_disable);
55
56void w90x900_clk_enable(struct clk *clk, int enable)
57{
58 unsigned int clocks = clk->cken;
59 unsigned long clken;
60
61 clken = __raw_readl(W90X900_VA_CLKPWR);
62
63 if (enable)
64 clken |= clocks;
65 else
66 clken &= ~clocks;
67
68 __raw_writel(clken, W90X900_VA_CLKPWR);
69}
70
71void clks_register(struct clk_lookup *clks, size_t num)
72{
73 int i;
74
75 for (i = 0; i < num; i++)
76 clkdev_add(&clks[i]);
77}
diff --git a/arch/arm/mach-w90x900/clock.h b/arch/arm/mach-w90x900/clock.h
new file mode 100644
index 000000000000..4f27bda76d56
--- /dev/null
+++ b/arch/arm/mach-w90x900/clock.h
@@ -0,0 +1,36 @@
1/*
2 * linux/arch/arm/mach-w90x900/clock.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License.
11 */
12
13#include <asm/clkdev.h>
14
15void w90x900_clk_enable(struct clk *clk, int enable);
16void clks_register(struct clk_lookup *clks, size_t num);
17
18struct clk {
19 unsigned long cken;
20 unsigned int enabled;
21 void (*enable)(struct clk *, int enable);
22};
23
24#define DEFINE_CLK(_name, _ctrlbit) \
25struct clk clk_##_name = { \
26 .enable = w90x900_clk_enable, \
27 .cken = (1 << _ctrlbit), \
28 }
29
30#define DEF_CLKLOOK(_clk, _devname, _conname) \
31 { \
32 .clk = _clk, \
33 .dev_id = _devname, \
34 .con_id = _conname, \
35 }
36
diff --git a/arch/arm/mach-w90x900/cpu.h b/arch/arm/mach-w90x900/cpu.h
index de29ddcb9459..57b5dbabeb41 100644
--- a/arch/arm/mach-w90x900/cpu.h
+++ b/arch/arm/mach-w90x900/cpu.h
@@ -41,7 +41,7 @@ struct sys_timer;
41extern void w90x900_init_irq(void); 41extern void w90x900_init_irq(void);
42extern void w90p910_init_io(struct map_desc *mach_desc, int size); 42extern void w90p910_init_io(struct map_desc *mach_desc, int size);
43extern void w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no); 43extern void w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no);
44extern void w90p910_init_clocks(int xtal); 44extern void w90p910_init_clocks(void);
45extern void w90p910_map_io(struct map_desc *mach_desc, int size); 45extern void w90p910_map_io(struct map_desc *mach_desc, int size);
46extern struct platform_device w90p910_serial_device; 46extern struct platform_device w90p910_serial_device;
47extern struct sys_timer w90x900_timer; 47extern struct sys_timer w90x900_timer;
diff --git a/arch/arm/mach-w90x900/gpio.c b/arch/arm/mach-w90x900/gpio.c
new file mode 100644
index 000000000000..c72e0dfa1825
--- /dev/null
+++ b/arch/arm/mach-w90x900/gpio.c
@@ -0,0 +1,154 @@
1/*
2 * linux/arch/arm/mach-w90p910/gpio.c
3 *
4 * Generic w90p910 GPIO handling
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/clk.h>
14#include <linux/errno.h>
15#include <linux/interrupt.h>
16#include <linux/irq.h>
17#include <linux/debugfs.h>
18#include <linux/seq_file.h>
19#include <linux/kernel.h>
20#include <linux/list.h>
21#include <linux/module.h>
22#include <linux/io.h>
23#include <linux/gpio.h>
24
25#include <mach/hardware.h>
26
27#define GPIO_BASE (W90X900_VA_GPIO)
28#define GPIO_DIR (0x04)
29#define GPIO_OUT (0x08)
30#define GPIO_IN (0x0C)
31#define GROUPINERV (0x10)
32#define GPIO_GPIO(Nb) (0x00000001 << (Nb))
33#define to_w90p910_gpio_chip(c) container_of(c, struct w90p910_gpio_chip, chip)
34
35#define W90P910_GPIO_CHIP(name, base_gpio, nr_gpio) \
36 { \
37 .chip = { \
38 .label = name, \
39 .direction_input = w90p910_dir_input, \
40 .direction_output = w90p910_dir_output, \
41 .get = w90p910_gpio_get, \
42 .set = w90p910_gpio_set, \
43 .base = base_gpio, \
44 .ngpio = nr_gpio, \
45 } \
46 }
47
48struct w90p910_gpio_chip {
49 struct gpio_chip chip;
50 void __iomem *regbase; /* Base of group register*/
51 spinlock_t gpio_lock;
52};
53
54static int w90p910_gpio_get(struct gpio_chip *chip, unsigned offset)
55{
56 struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
57 void __iomem *pio = w90p910_gpio->regbase + GPIO_IN;
58 unsigned int regval;
59
60 regval = __raw_readl(pio);
61 regval &= GPIO_GPIO(offset);
62
63 return (regval != 0);
64}
65
66static void w90p910_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
67{
68 struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
69 void __iomem *pio = w90p910_gpio->regbase + GPIO_OUT;
70 unsigned int regval;
71 unsigned long flags;
72
73 spin_lock_irqsave(&w90p910_gpio->gpio_lock, flags);
74
75 regval = __raw_readl(pio);
76
77 if (val)
78 regval |= GPIO_GPIO(offset);
79 else
80 regval &= ~GPIO_GPIO(offset);
81
82 __raw_writel(regval, pio);
83
84 spin_unlock_irqrestore(&w90p910_gpio->gpio_lock, flags);
85}
86
87static int w90p910_dir_input(struct gpio_chip *chip, unsigned offset)
88{
89 struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
90 void __iomem *pio = w90p910_gpio->regbase + GPIO_DIR;
91 unsigned int regval;
92 unsigned long flags;
93
94 spin_lock_irqsave(&w90p910_gpio->gpio_lock, flags);
95
96 regval = __raw_readl(pio);
97 regval &= ~GPIO_GPIO(offset);
98 __raw_writel(regval, pio);
99
100 spin_unlock_irqrestore(&w90p910_gpio->gpio_lock, flags);
101
102 return 0;
103}
104
105static int w90p910_dir_output(struct gpio_chip *chip, unsigned offset, int val)
106{
107 struct w90p910_gpio_chip *w90p910_gpio = to_w90p910_gpio_chip(chip);
108 void __iomem *outreg = w90p910_gpio->regbase + GPIO_OUT;
109 void __iomem *pio = w90p910_gpio->regbase + GPIO_DIR;
110 unsigned int regval;
111 unsigned long flags;
112
113 spin_lock_irqsave(&w90p910_gpio->gpio_lock, flags);
114
115 regval = __raw_readl(pio);
116 regval |= GPIO_GPIO(offset);
117 __raw_writel(regval, pio);
118
119 regval = __raw_readl(outreg);
120
121 if (val)
122 regval |= GPIO_GPIO(offset);
123 else
124 regval &= ~GPIO_GPIO(offset);
125
126 __raw_writel(regval, outreg);
127
128 spin_unlock_irqrestore(&w90p910_gpio->gpio_lock, flags);
129
130 return 0;
131}
132
133static struct w90p910_gpio_chip w90p910_gpio[] = {
134 W90P910_GPIO_CHIP("GROUPC", 0, 16),
135 W90P910_GPIO_CHIP("GROUPD", 16, 10),
136 W90P910_GPIO_CHIP("GROUPE", 26, 14),
137 W90P910_GPIO_CHIP("GROUPF", 40, 10),
138 W90P910_GPIO_CHIP("GROUPG", 50, 17),
139 W90P910_GPIO_CHIP("GROUPH", 67, 8),
140 W90P910_GPIO_CHIP("GROUPI", 75, 17),
141};
142
143void __init w90p910_init_gpio(int nr_group)
144{
145 unsigned i;
146 struct w90p910_gpio_chip *gpio_chip;
147
148 for (i = 0; i < nr_group; i++) {
149 gpio_chip = &w90p910_gpio[i];
150 spin_lock_init(&gpio_chip->gpio_lock);
151 gpio_chip->regbase = GPIO_BASE + i * GROUPINERV;
152 gpiochip_add(&gpio_chip->chip);
153 }
154}
diff --git a/arch/arm/mach-w90x900/include/mach/clkdev.h b/arch/arm/mach-w90x900/include/mach/clkdev.h
new file mode 100644
index 000000000000..04b37a89801c
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do { } while (0)
6
7#endif
diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h
new file mode 100644
index 000000000000..034da3e390c9
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/gpio.h
@@ -0,0 +1,34 @@
1/*
2 * linux/arch/arm/mach-w90p910/include/mach/gpio.h
3 *
4 * Generic w90p910 GPIO handling
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ASM_ARCH_W90P910_GPIO_H
14#define __ASM_ARCH_W90P910_GPIO_H
15
16#include <mach/hardware.h>
17#include <asm/irq.h>
18#include <asm-generic/gpio.h>
19
20#define gpio_get_value __gpio_get_value
21#define gpio_set_value __gpio_set_value
22#define gpio_cansleep __gpio_cansleep
23
24static inline int gpio_to_irq(unsigned gpio)
25{
26 return gpio;
27}
28
29static inline int irq_to_gpio(unsigned irq)
30{
31 return irq;
32}
33
34#endif
diff --git a/arch/arm/mach-w90x900/include/mach/irqs.h b/arch/arm/mach-w90x900/include/mach/irqs.h
index 1c583f9cbcde..9d5cba3a509f 100644
--- a/arch/arm/mach-w90x900/include/mach/irqs.h
+++ b/arch/arm/mach-w90x900/include/mach/irqs.h
@@ -1,8 +1,7 @@
1/* 1/*
2 * arch/arm/mach-w90x900/include/mach/irqs.h 2 * arch/arm/mach-w90x900/include/mach/irqs.h
3 * 3 *
4 * Copyright (c) 2008 Nuvoton technology corporation 4 * Copyright (c) 2008 Nuvoton technology corporation.
5 * All rights reserved.
6 * 5 *
7 * Wan ZongShun <mcuos.com@gmail.com> 6 * Wan ZongShun <mcuos.com@gmail.com>
8 * 7 *
@@ -10,8 +9,7 @@
10 * 9 *
11 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or 12 * the Free Software Foundation;version 2 of the License.
14 * (at your option) any later version.
15 * 13 *
16 */ 14 */
17 15
@@ -31,6 +29,11 @@
31/* Main cpu interrupts */ 29/* Main cpu interrupts */
32 30
33#define IRQ_WDT W90X900_IRQ(1) 31#define IRQ_WDT W90X900_IRQ(1)
32#define IRQ_GROUP0 W90X900_IRQ(2)
33#define IRQ_GROUP1 W90X900_IRQ(3)
34#define IRQ_ACTL W90X900_IRQ(4)
35#define IRQ_LCD W90X900_IRQ(5)
36#define IRQ_RTC W90X900_IRQ(6)
34#define IRQ_UART0 W90X900_IRQ(7) 37#define IRQ_UART0 W90X900_IRQ(7)
35#define IRQ_UART1 W90X900_IRQ(8) 38#define IRQ_UART1 W90X900_IRQ(8)
36#define IRQ_UART2 W90X900_IRQ(9) 39#define IRQ_UART2 W90X900_IRQ(9)
@@ -39,7 +42,45 @@
39#define IRQ_TIMER0 W90X900_IRQ(12) 42#define IRQ_TIMER0 W90X900_IRQ(12)
40#define IRQ_TIMER1 W90X900_IRQ(13) 43#define IRQ_TIMER1 W90X900_IRQ(13)
41#define IRQ_T_INT_GROUP W90X900_IRQ(14) 44#define IRQ_T_INT_GROUP W90X900_IRQ(14)
45#define IRQ_USBH W90X900_IRQ(15)
46#define IRQ_EMCTX W90X900_IRQ(16)
47#define IRQ_EMCRX W90X900_IRQ(17)
48#define IRQ_GDMAGROUP W90X900_IRQ(18)
49#define IRQ_DMAC W90X900_IRQ(19)
50#define IRQ_FMI W90X900_IRQ(20)
51#define IRQ_USBD W90X900_IRQ(21)
52#define IRQ_ATAPI W90X900_IRQ(22)
53#define IRQ_G2D W90X900_IRQ(23)
54#define IRQ_PCI W90X900_IRQ(24)
55#define IRQ_SCGROUP W90X900_IRQ(25)
56#define IRQ_I2CGROUP W90X900_IRQ(26)
57#define IRQ_SSP W90X900_IRQ(27)
58#define IRQ_PWM W90X900_IRQ(28)
59#define IRQ_KPI W90X900_IRQ(29)
60#define IRQ_P2SGROUP W90X900_IRQ(30)
42#define IRQ_ADC W90X900_IRQ(31) 61#define IRQ_ADC W90X900_IRQ(31)
43#define NR_IRQS (IRQ_ADC+1) 62#define NR_IRQS (IRQ_ADC+1)
44 63
64/*for irq group*/
65
66#define IRQ_PS2_PORT0 0x10000000
67#define IRQ_PS2_PORT1 0x20000000
68#define IRQ_I2C_LINE0 0x04000000
69#define IRQ_I2C_LINE1 0x08000000
70#define IRQ_SC_CARD0 0x01000000
71#define IRQ_SC_CARD1 0x02000000
72#define IRQ_GDMA_CH0 0x00100000
73#define IRQ_GDMA_CH1 0x00200000
74#define IRQ_TIMER2 0x00010000
75#define IRQ_TIMER3 0x00020000
76#define IRQ_TIMER4 0x00040000
77#define IRQ_GROUP0_IRQ0 0x00000001
78#define IRQ_GROUP0_IRQ1 0x00000002
79#define IRQ_GROUP0_IRQ2 0x00000004
80#define IRQ_GROUP0_IRQ3 0x00000008
81#define IRQ_GROUP1_IRQ4 0x00000010
82#define IRQ_GROUP1_IRQ5 0x00000020
83#define IRQ_GROUP1_IRQ6 0x00000040
84#define IRQ_GROUP1_IRQ7 0x00000080
85
45#endif /* __ASM_ARCH_IRQ_H */ 86#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-w90x900/include/mach/map.h b/arch/arm/mach-w90x900/include/mach/map.h
index 79320ebe614b..1a2095304117 100644
--- a/arch/arm/mach-w90x900/include/mach/map.h
+++ b/arch/arm/mach-w90x900/include/mach/map.h
@@ -1,8 +1,7 @@
1/* 1/*
2 * arch/arm/mach-w90x900/include/mach/map.h 2 * arch/arm/mach-w90x900/include/mach/map.h
3 * 3 *
4 * Copyright (c) 2008 Nuvoton technology corporation 4 * Copyright (c) 2008 Nuvoton technology corporation.
5 * All rights reserved.
6 * 5 *
7 * Wan ZongShun <mcuos.com@gmail.com> 6 * Wan ZongShun <mcuos.com@gmail.com>
8 * 7 *
@@ -10,8 +9,7 @@
10 * 9 *
11 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or 12 * the Free Software Foundation;version 2 of the License.
14 * (at your option) any later version.
15 * 13 *
16 */ 14 */
17 15
@@ -34,7 +32,6 @@
34 * interrupt controller is the first thing we put in, to make 32 * interrupt controller is the first thing we put in, to make
35 * the assembly code for the irq detection easier 33 * the assembly code for the irq detection easier
36 */ 34 */
37
38#define W90X900_VA_IRQ W90X900_ADDR(0x00000000) 35#define W90X900_VA_IRQ W90X900_ADDR(0x00000000)
39#define W90X900_PA_IRQ (0xB8002000) 36#define W90X900_PA_IRQ (0xB8002000)
40#define W90X900_SZ_IRQ SZ_4K 37#define W90X900_SZ_IRQ SZ_4K
@@ -44,33 +41,117 @@
44#define W90X900_SZ_GCR SZ_4K 41#define W90X900_SZ_GCR SZ_4K
45 42
46/* Clock and Power management */ 43/* Clock and Power management */
47
48#define W90X900_VA_CLKPWR (W90X900_VA_GCR+0x200) 44#define W90X900_VA_CLKPWR (W90X900_VA_GCR+0x200)
49#define W90X900_PA_CLKPWR (0xB0000200) 45#define W90X900_PA_CLKPWR (0xB0000200)
50#define W90X900_SZ_CLKPWR SZ_4K 46#define W90X900_SZ_CLKPWR SZ_4K
51 47
52/* EBI management */ 48/* EBI management */
53
54#define W90X900_VA_EBI W90X900_ADDR(0x00001000) 49#define W90X900_VA_EBI W90X900_ADDR(0x00001000)
55#define W90X900_PA_EBI (0xB0001000) 50#define W90X900_PA_EBI (0xB0001000)
56#define W90X900_SZ_EBI SZ_4K 51#define W90X900_SZ_EBI SZ_4K
57 52
58/* UARTs */ 53/* UARTs */
59
60#define W90X900_VA_UART W90X900_ADDR(0x08000000) 54#define W90X900_VA_UART W90X900_ADDR(0x08000000)
61#define W90X900_PA_UART (0xB8000000) 55#define W90X900_PA_UART (0xB8000000)
62#define W90X900_SZ_UART SZ_4K 56#define W90X900_SZ_UART SZ_4K
63 57
64/* Timers */ 58/* Timers */
65
66#define W90X900_VA_TIMER W90X900_ADDR(0x08001000) 59#define W90X900_VA_TIMER W90X900_ADDR(0x08001000)
67#define W90X900_PA_TIMER (0xB8001000) 60#define W90X900_PA_TIMER (0xB8001000)
68#define W90X900_SZ_TIMER SZ_4K 61#define W90X900_SZ_TIMER SZ_4K
69 62
70/* GPIO ports */ 63/* GPIO ports */
71
72#define W90X900_VA_GPIO W90X900_ADDR(0x08003000) 64#define W90X900_VA_GPIO W90X900_ADDR(0x08003000)
73#define W90X900_PA_GPIO (0xB8003000) 65#define W90X900_PA_GPIO (0xB8003000)
74#define W90X900_SZ_GPIO SZ_4K 66#define W90X900_SZ_GPIO SZ_4K
75 67
68/* GDMA control */
69#define W90X900_VA_GDMA W90X900_ADDR(0x00004000)
70#define W90X900_PA_GDMA (0xB0004000)
71#define W90X900_SZ_GDMA SZ_4K
72
73/* USB host controller*/
74#define W90X900_VA_USBEHCIHOST W90X900_ADDR(0x00005000)
75#define W90X900_PA_USBEHCIHOST (0xB0005000)
76#define W90X900_SZ_USBEHCIHOST SZ_4K
77
78#define W90X900_VA_USBOHCIHOST W90X900_ADDR(0x00007000)
79#define W90X900_PA_USBOHCIHOST (0xB0007000)
80#define W90X900_SZ_USBOHCIHOST SZ_4K
81
82/* I2C hardware controller */
83#define W90X900_VA_I2C W90X900_ADDR(0x08006000)
84#define W90X900_PA_I2C (0xB8006000)
85#define W90X900_SZ_I2C SZ_4K
86
87/* Keypad Interface*/
88#define W90X900_VA_KPI W90X900_ADDR(0x08008000)
89#define W90X900_PA_KPI (0xB8008000)
90#define W90X900_SZ_KPI SZ_4K
91
92/* Smart card host*/
93#define W90X900_VA_SC W90X900_ADDR(0x08005000)
94#define W90X900_PA_SC (0xB8005000)
95#define W90X900_SZ_SC SZ_4K
96
97/* LCD controller*/
98#define W90X900_VA_LCD W90X900_ADDR(0x00008000)
99#define W90X900_PA_LCD (0xB0008000)
100#define W90X900_SZ_LCD SZ_4K
101
102/* 2D controller*/
103#define W90X900_VA_GE W90X900_ADDR(0x0000B000)
104#define W90X900_PA_GE (0xB000B000)
105#define W90X900_SZ_GE SZ_4K
106
107/* ATAPI */
108#define W90X900_VA_ATAPI W90X900_ADDR(0x0000A000)
109#define W90X900_PA_ATAPI (0xB000A000)
110#define W90X900_SZ_ATAPI SZ_4K
111
112/* ADC */
113#define W90X900_VA_ADC W90X900_ADDR(0x0800A000)
114#define W90X900_PA_ADC (0xB800A000)
115#define W90X900_SZ_ADC SZ_4K
116
117/* PS2 Interface*/
118#define W90X900_VA_PS2 W90X900_ADDR(0x08009000)
119#define W90X900_PA_PS2 (0xB8009000)
120#define W90X900_SZ_PS2 SZ_4K
121
122/* RTC */
123#define W90X900_VA_RTC W90X900_ADDR(0x08004000)
124#define W90X900_PA_RTC (0xB8004000)
125#define W90X900_SZ_RTC SZ_4K
126
127/* Pulse Width Modulation(PWM) Registers */
128#define W90X900_VA_PWM W90X900_ADDR(0x08007000)
129#define W90X900_PA_PWM (0xB8007000)
130#define W90X900_SZ_PWM SZ_4K
131
132/* Audio Controller controller */
133#define W90X900_VA_ACTL W90X900_ADDR(0x00009000)
134#define W90X900_PA_ACTL (0xB0009000)
135#define W90X900_SZ_ACTL SZ_4K
136
137/* DMA controller */
138#define W90X900_VA_DMA W90X900_ADDR(0x0000c000)
139#define W90X900_PA_DMA (0xB000c000)
140#define W90X900_SZ_DMA SZ_4K
141
142/* FMI controller */
143#define W90X900_VA_FMI W90X900_ADDR(0x0000d000)
144#define W90X900_PA_FMI (0xB000d000)
145#define W90X900_SZ_FMI SZ_4K
146
147/* USB Device port */
148#define W90X900_VA_USBDEV W90X900_ADDR(0x00006000)
149#define W90X900_PA_USBDEV (0xB0006000)
150#define W90X900_SZ_USBDEV SZ_4K
151
152/* External MAC control*/
153#define W90X900_VA_EMC W90X900_ADDR(0x00003000)
154#define W90X900_PA_EMC (0xB0003000)
155#define W90X900_SZ_EMC SZ_4K
156
76#endif /* __ASM_ARCH_MAP_H */ 157#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-w90x900/include/mach/regs-clock.h b/arch/arm/mach-w90x900/include/mach/regs-clock.h
new file mode 100644
index 000000000000..f10b6a8dc069
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/regs-clock.h
@@ -0,0 +1,31 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/regs-clock.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_REGS_CLOCK_H
15#define __ASM_ARCH_REGS_CLOCK_H
16
17/* Clock Control Registers */
18#define CLK_BA W90X900_VA_CLKPWR
19#define REG_CLKEN (CLK_BA + 0x00)
20#define REG_CLKSEL (CLK_BA + 0x04)
21#define REG_CLKDIV (CLK_BA + 0x08)
22#define REG_PLLCON0 (CLK_BA + 0x0C)
23#define REG_PLLCON1 (CLK_BA + 0x10)
24#define REG_PMCON (CLK_BA + 0x14)
25#define REG_IRQWAKECON (CLK_BA + 0x18)
26#define REG_IRQWAKEFLAG (CLK_BA + 0x1C)
27#define REG_IPSRST (CLK_BA + 0x20)
28#define REG_CLKEN1 (CLK_BA + 0x24)
29#define REG_CLKDIV1 (CLK_BA + 0x28)
30
31#endif /* __ASM_ARCH_REGS_CLOCK_H */
diff --git a/arch/arm/mach-w90x900/include/mach/regs-usb.h b/arch/arm/mach-w90x900/include/mach/regs-usb.h
new file mode 100644
index 000000000000..ab74b0c2480b
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/regs-usb.h
@@ -0,0 +1,35 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/regs-usb.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_REGS_USB_H
15#define __ASM_ARCH_REGS_USB_H
16
17/* usb Control Registers */
18#define USBH_BA W90X900_VA_USBEHCIHOST
19#define USBD_BA W90X900_VA_USBDEV
20#define USBO_BA W90X900_VA_USBOHCIHOST
21
22/* USB Host Control Registers */
23#define REG_UPSCR0 (USBH_BA+0x064)
24#define REG_UPSCR1 (USBH_BA+0x068)
25#define REG_USBPCR0 (USBH_BA+0x0C4)
26#define REG_USBPCR1 (USBH_BA+0x0C8)
27
28/* USBH OHCI Control Registers */
29#define REG_OpModEn (USBO_BA+0x204)
30/*This bit controls the polarity of over
31*current flag from external power IC.
32*/
33#define OCALow 0x08
34
35#endif /* __ASM_ARCH_REGS_USB_H */
diff --git a/arch/arm/mach-w90x900/mach-w90p910evb.c b/arch/arm/mach-w90x900/mach-w90p910evb.c
index 726ff6798a56..7a62bd348e80 100644
--- a/arch/arm/mach-w90x900/mach-w90p910evb.c
+++ b/arch/arm/mach-w90x900/mach-w90p910evb.c
@@ -3,15 +3,13 @@
3 * 3 *
4 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche 4 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
5 * 5 *
6 * Copyright (C) 2008 Nuvoton technology corporation 6 * Copyright (C) 2008 Nuvoton technology corporation.
7 * All rights reserved.
8 * 7 *
9 * Wan ZongShun <mcuos.com@gmail.com> 8 * Wan ZongShun <mcuos.com@gmail.com>
10 * 9 *
11 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as 11 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of 12 * published by the Free Software Foundation;version 2 of the License.
14 * the License, or (at your option) any later version.
15 * 13 *
16 */ 14 */
17 15
@@ -80,6 +78,156 @@ static struct platform_device w90p910_flash_device = {
80 .num_resources = ARRAY_SIZE(w90p910_flash_resources), 78 .num_resources = ARRAY_SIZE(w90p910_flash_resources),
81}; 79};
82 80
81/* USB EHCI Host Controller */
82
83static struct resource w90x900_usb_ehci_resource[] = {
84 [0] = {
85 .start = W90X900_PA_USBEHCIHOST,
86 .end = W90X900_PA_USBEHCIHOST + W90X900_SZ_USBEHCIHOST - 1,
87 .flags = IORESOURCE_MEM,
88 },
89 [1] = {
90 .start = IRQ_USBH,
91 .end = IRQ_USBH,
92 .flags = IORESOURCE_IRQ,
93 }
94};
95
96static u64 w90x900_device_usb_ehci_dmamask = 0xffffffffUL;
97
98struct platform_device w90x900_device_usb_ehci = {
99 .name = "w90x900-ehci",
100 .id = -1,
101 .num_resources = ARRAY_SIZE(w90x900_usb_ehci_resource),
102 .resource = w90x900_usb_ehci_resource,
103 .dev = {
104 .dma_mask = &w90x900_device_usb_ehci_dmamask,
105 .coherent_dma_mask = 0xffffffffUL
106 }
107};
108EXPORT_SYMBOL(w90x900_device_usb_ehci);
109
110/* USB OHCI Host Controller */
111
112static struct resource w90x900_usb_ohci_resource[] = {
113 [0] = {
114 .start = W90X900_PA_USBOHCIHOST,
115 .end = W90X900_PA_USBOHCIHOST + W90X900_SZ_USBOHCIHOST - 1,
116 .flags = IORESOURCE_MEM,
117 },
118 [1] = {
119 .start = IRQ_USBH,
120 .end = IRQ_USBH,
121 .flags = IORESOURCE_IRQ,
122 }
123};
124
125static u64 w90x900_device_usb_ohci_dmamask = 0xffffffffUL;
126struct platform_device w90x900_device_usb_ohci = {
127 .name = "w90x900-ohci",
128 .id = -1,
129 .num_resources = ARRAY_SIZE(w90x900_usb_ohci_resource),
130 .resource = w90x900_usb_ohci_resource,
131 .dev = {
132 .dma_mask = &w90x900_device_usb_ohci_dmamask,
133 .coherent_dma_mask = 0xffffffffUL
134 }
135};
136EXPORT_SYMBOL(w90x900_device_usb_ohci);
137
138/*TouchScreen controller*/
139
140static struct resource w90x900_ts_resource[] = {
141 [0] = {
142 .start = W90X900_PA_ADC,
143 .end = W90X900_PA_ADC + W90X900_SZ_ADC-1,
144 .flags = IORESOURCE_MEM,
145 },
146 [1] = {
147 .start = IRQ_ADC,
148 .end = IRQ_ADC,
149 .flags = IORESOURCE_IRQ,
150 },
151};
152
153struct platform_device w90x900_device_ts = {
154 .name = "w90x900-ts",
155 .id = -1,
156 .resource = w90x900_ts_resource,
157 .num_resources = ARRAY_SIZE(w90x900_ts_resource),
158};
159EXPORT_SYMBOL(w90x900_device_ts);
160
161/* RTC controller*/
162
163static struct resource w90x900_rtc_resource[] = {
164 [0] = {
165 .start = W90X900_PA_RTC,
166 .end = W90X900_PA_RTC + 0xff,
167 .flags = IORESOURCE_MEM,
168 },
169 [1] = {
170 .start = IRQ_RTC,
171 .end = IRQ_RTC,
172 .flags = IORESOURCE_IRQ,
173 },
174};
175
176struct platform_device w90x900_device_rtc = {
177 .name = "w90x900-rtc",
178 .id = -1,
179 .num_resources = ARRAY_SIZE(w90x900_rtc_resource),
180 .resource = w90x900_rtc_resource,
181};
182EXPORT_SYMBOL(w90x900_device_rtc);
183
184/* KPI controller*/
185
186static struct resource w90x900_kpi_resource[] = {
187 [0] = {
188 .start = W90X900_PA_KPI,
189 .end = W90X900_PA_KPI + W90X900_SZ_KPI - 1,
190 .flags = IORESOURCE_MEM,
191 },
192 [1] = {
193 .start = IRQ_KPI,
194 .end = IRQ_KPI,
195 .flags = IORESOURCE_IRQ,
196 }
197
198};
199
200struct platform_device w90x900_device_kpi = {
201 .name = "w90x900-kpi",
202 .id = -1,
203 .num_resources = ARRAY_SIZE(w90x900_kpi_resource),
204 .resource = w90x900_kpi_resource,
205};
206EXPORT_SYMBOL(w90x900_device_kpi);
207
208/* USB Device (Gadget)*/
209
210static struct resource w90x900_usbgadget_resource[] = {
211 [0] = {
212 .start = W90X900_PA_USBDEV,
213 .end = W90X900_PA_USBDEV + W90X900_SZ_USBDEV - 1,
214 .flags = IORESOURCE_MEM,
215 },
216 [1] = {
217 .start = IRQ_USBD,
218 .end = IRQ_USBD,
219 .flags = IORESOURCE_IRQ,
220 }
221};
222
223struct platform_device w90x900_device_usbgadget = {
224 .name = "w90x900-usbgadget",
225 .id = -1,
226 .num_resources = ARRAY_SIZE(w90x900_usbgadget_resource),
227 .resource = w90x900_usbgadget_resource,
228};
229EXPORT_SYMBOL(w90x900_device_usbgadget);
230
83static struct map_desc w90p910_iodesc[] __initdata = { 231static struct map_desc w90p910_iodesc[] __initdata = {
84}; 232};
85 233
@@ -88,12 +236,18 @@ static struct map_desc w90p910_iodesc[] __initdata = {
88static struct platform_device *w90p910evb_dev[] __initdata = { 236static struct platform_device *w90p910evb_dev[] __initdata = {
89 &w90p910_serial_device, 237 &w90p910_serial_device,
90 &w90p910_flash_device, 238 &w90p910_flash_device,
239 &w90x900_device_usb_ehci,
240 &w90x900_device_usb_ohci,
241 &w90x900_device_ts,
242 &w90x900_device_rtc,
243 &w90x900_device_kpi,
244 &w90x900_device_usbgadget,
91}; 245};
92 246
93static void __init w90p910evb_map_io(void) 247static void __init w90p910evb_map_io(void)
94{ 248{
95 w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc)); 249 w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
96 w90p910_init_clocks(0); 250 w90p910_init_clocks();
97} 251}
98 252
99static void __init w90p910evb_init(void) 253static void __init w90p910evb_init(void)
diff --git a/arch/arm/mach-w90x900/mfp-w90p910.c b/arch/arm/mach-w90x900/mfp-w90p910.c
new file mode 100644
index 000000000000..a3520fefb5e7
--- /dev/null
+++ b/arch/arm/mach-w90x900/mfp-w90p910.c
@@ -0,0 +1,116 @@
1/*
2 * linux/arch/arm/mach-w90x900/mfp-w90p910.c
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation;version 2 of the License.
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/device.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/string.h>
20#include <linux/clk.h>
21#include <linux/mutex.h>
22#include <linux/io.h>
23
24#include <mach/hardware.h>
25
26#define REG_MFSEL (W90X900_VA_GCR + 0xC)
27
28#define GPSELF (0x01 << 1)
29
30#define GPSELC (0x03 << 2)
31#define ENKPI (0x02 << 2)
32#define ENNAND (0x01 << 2)
33
34#define GPSELEI0 (0x01 << 26)
35#define GPSELEI1 (0x01 << 27)
36
37static DECLARE_MUTEX(mfp_sem);
38
39void mfp_set_groupf(struct device *dev)
40{
41 unsigned long mfpen;
42 const char *dev_id;
43
44 BUG_ON(!dev);
45
46 down(&mfp_sem);
47
48 dev_id = dev_name(dev);
49
50 mfpen = __raw_readl(REG_MFSEL);
51
52 if (strcmp(dev_id, "w90p910-emc") == 0)
53 mfpen |= GPSELF;/*enable mac*/
54 else
55 mfpen &= ~GPSELF;/*GPIOF[9:0]*/
56
57 __raw_writel(mfpen, REG_MFSEL);
58
59 up(&mfp_sem);
60}
61EXPORT_SYMBOL(mfp_set_groupf);
62
63void mfp_set_groupc(struct device *dev)
64{
65 unsigned long mfpen;
66 const char *dev_id;
67
68 BUG_ON(!dev);
69
70 down(&mfp_sem);
71
72 dev_id = dev_name(dev);
73
74 mfpen = __raw_readl(REG_MFSEL);
75
76 if (strcmp(dev_id, "w90p910-lcd") == 0)
77 mfpen |= GPSELC;/*enable lcd*/
78 else if (strcmp(dev_id, "w90p910-kpi") == 0) {
79 mfpen &= (~GPSELC);/*enable kpi*/
80 mfpen |= ENKPI;
81 } else if (strcmp(dev_id, "w90p910-nand") == 0) {
82 mfpen &= (~GPSELC);/*enable nand*/
83 mfpen |= ENNAND;
84 } else
85 mfpen &= (~GPSELC);/*GPIOC[14:0]*/
86
87 __raw_writel(mfpen, REG_MFSEL);
88
89 up(&mfp_sem);
90}
91EXPORT_SYMBOL(mfp_set_groupc);
92
93void mfp_set_groupi(struct device *dev, int gpio)
94{
95 unsigned long mfpen;
96 const char *dev_id;
97
98 BUG_ON(!dev);
99
100 down(&mfp_sem);
101
102 dev_id = dev_name(dev);
103
104 mfpen = __raw_readl(REG_MFSEL);
105
106 if (strcmp(dev_id, "w90p910-wdog") == 0)
107 mfpen |= GPSELEI1;/*enable wdog*/
108 else if (strcmp(dev_id, "w90p910-atapi") == 0)
109 mfpen |= GPSELEI0;/*enable atapi*/
110
111 __raw_writel(mfpen, REG_MFSEL);
112
113 up(&mfp_sem);
114}
115EXPORT_SYMBOL(mfp_set_groupi);
116
diff --git a/arch/arm/mach-w90x900/w90p910.c b/arch/arm/mach-w90x900/w90p910.c
index 2bcbaa681b99..1c97e4930b7a 100644
--- a/arch/arm/mach-w90x900/w90p910.c
+++ b/arch/arm/mach-w90x900/w90p910.c
@@ -3,8 +3,7 @@
3 * 3 *
4 * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks 4 * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
5 * 5 *
6 * Copyright (c) 2008 Nuvoton technology corporation 6 * Copyright (c) 2008 Nuvoton technology corporation.
7 * All rights reserved.
8 * 7 *
9 * Wan ZongShun <mcuos.com@gmail.com> 8 * Wan ZongShun <mcuos.com@gmail.com>
10 * 9 *
@@ -12,8 +11,7 @@
12 * 11 *
13 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by 13 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or 14 * the Free Software Foundation;version 2 of the License.
16 * (at your option) any later version.
17 * 15 *
18 */ 16 */
19 17
@@ -36,6 +34,7 @@
36#include <mach/regs-serial.h> 34#include <mach/regs-serial.h>
37 35
38#include "cpu.h" 36#include "cpu.h"
37#include "clock.h"
39 38
40/* Initial IO mappings */ 39/* Initial IO mappings */
41 40
@@ -45,9 +44,52 @@ static struct map_desc w90p910_iodesc[] __initdata = {
45 IODESC_ENT(UART), 44 IODESC_ENT(UART),
46 IODESC_ENT(TIMER), 45 IODESC_ENT(TIMER),
47 IODESC_ENT(EBI), 46 IODESC_ENT(EBI),
47 IODESC_ENT(USBEHCIHOST),
48 IODESC_ENT(USBOHCIHOST),
49 IODESC_ENT(ADC),
50 IODESC_ENT(RTC),
51 IODESC_ENT(KPI),
52 IODESC_ENT(USBDEV),
48 /*IODESC_ENT(LCD),*/ 53 /*IODESC_ENT(LCD),*/
49}; 54};
50 55
56/* Initial clock declarations. */
57static DEFINE_CLK(lcd, 0);
58static DEFINE_CLK(audio, 1);
59static DEFINE_CLK(fmi, 4);
60static DEFINE_CLK(dmac, 5);
61static DEFINE_CLK(atapi, 6);
62static DEFINE_CLK(emc, 7);
63static DEFINE_CLK(usbd, 8);
64static DEFINE_CLK(usbh, 9);
65static DEFINE_CLK(g2d, 10);;
66static DEFINE_CLK(pwm, 18);
67static DEFINE_CLK(ps2, 24);
68static DEFINE_CLK(kpi, 25);
69static DEFINE_CLK(wdt, 26);
70static DEFINE_CLK(gdma, 27);
71static DEFINE_CLK(adc, 28);
72static DEFINE_CLK(usi, 29);
73
74static struct clk_lookup w90p910_clkregs[] = {
75 DEF_CLKLOOK(&clk_lcd, "w90p910-lcd", NULL),
76 DEF_CLKLOOK(&clk_audio, "w90p910-audio", NULL),
77 DEF_CLKLOOK(&clk_fmi, "w90p910-fmi", NULL),
78 DEF_CLKLOOK(&clk_dmac, "w90p910-dmac", NULL),
79 DEF_CLKLOOK(&clk_atapi, "w90p910-atapi", NULL),
80 DEF_CLKLOOK(&clk_emc, "w90p910-emc", NULL),
81 DEF_CLKLOOK(&clk_usbd, "w90p910-usbd", NULL),
82 DEF_CLKLOOK(&clk_usbh, "w90p910-usbh", NULL),
83 DEF_CLKLOOK(&clk_g2d, "w90p910-g2d", NULL),
84 DEF_CLKLOOK(&clk_pwm, "w90p910-pwm", NULL),
85 DEF_CLKLOOK(&clk_ps2, "w90p910-ps2", NULL),
86 DEF_CLKLOOK(&clk_kpi, "w90p910-kpi", NULL),
87 DEF_CLKLOOK(&clk_wdt, "w90p910-wdt", NULL),
88 DEF_CLKLOOK(&clk_gdma, "w90p910-gdma", NULL),
89 DEF_CLKLOOK(&clk_adc, "w90p910-adc", NULL),
90 DEF_CLKLOOK(&clk_usi, "w90p910-usi", NULL),
91};
92
51/* Initial serial platform data */ 93/* Initial serial platform data */
52 94
53struct plat_serial8250_port w90p910_uart_data[] = { 95struct plat_serial8250_port w90p910_uart_data[] = {
@@ -77,8 +119,9 @@ void __init w90p910_map_io(struct map_desc *mach_desc, int mach_size)
77 119
78/*Init W90P910 clock*/ 120/*Init W90P910 clock*/
79 121
80void __init w90p910_init_clocks(int xtal) 122void __init w90p910_init_clocks(void)
81{ 123{
124 clks_register(w90p910_clkregs, ARRAY_SIZE(w90p910_clkregs));
82} 125}
83 126
84static int __init w90p910_init_cpu(void) 127static int __init w90p910_init_cpu(void)