diff options
31 files changed, 1339 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 233a222752c0..79251a9cfb6f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -548,6 +548,15 @@ config ARCH_W90X900 | |||
| 548 | <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ | 548 | <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ |
| 549 | ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller> | 549 | ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller> |
| 550 | 550 | ||
| 551 | config ARCH_NUC93X | ||
| 552 | bool "Nuvoton NUC93X CPU" | ||
| 553 | select CPU_ARM926T | ||
| 554 | select HAVE_CLK | ||
| 555 | select COMMON_CLKDEV | ||
| 556 | help | ||
| 557 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a | ||
| 558 | low-power and high performance MPEG-4/JPEG multimedia controller chip. | ||
| 559 | |||
| 551 | config ARCH_PNX4008 | 560 | config ARCH_PNX4008 |
| 552 | bool "Philips Nexperia PNX4008 Mobile" | 561 | bool "Philips Nexperia PNX4008 Mobile" |
| 553 | select CPU_ARM926T | 562 | select CPU_ARM926T |
| @@ -828,6 +837,8 @@ source "arch/arm/mach-u300/Kconfig" | |||
| 828 | 837 | ||
| 829 | source "arch/arm/mach-w90x900/Kconfig" | 838 | source "arch/arm/mach-w90x900/Kconfig" |
| 830 | 839 | ||
| 840 | source "arch/arm/mach-nuc93x/Kconfig" | ||
| 841 | |||
| 831 | source "arch/arm/mach-bcmring/Kconfig" | 842 | source "arch/arm/mach-bcmring/Kconfig" |
| 832 | 843 | ||
| 833 | source "arch/arm/mach-ux500/Kconfig" | 844 | source "arch/arm/mach-ux500/Kconfig" |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index e9da08483b3c..3eaef160d468 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
| @@ -170,6 +170,7 @@ machine-$(CONFIG_ARCH_U300) := u300 | |||
| 170 | machine-$(CONFIG_ARCH_U8500) := ux500 | 170 | machine-$(CONFIG_ARCH_U8500) := ux500 |
| 171 | machine-$(CONFIG_ARCH_VERSATILE) := versatile | 171 | machine-$(CONFIG_ARCH_VERSATILE) := versatile |
| 172 | machine-$(CONFIG_ARCH_W90X900) := w90x900 | 172 | machine-$(CONFIG_ARCH_W90X900) := w90x900 |
| 173 | machine-$(CONFIG_ARCH_NUC93X) := nuc93x | ||
| 173 | machine-$(CONFIG_FOOTBRIDGE) := footbridge | 174 | machine-$(CONFIG_FOOTBRIDGE) := footbridge |
| 174 | machine-$(CONFIG_ARCH_MXC91231) := mxc91231 | 175 | machine-$(CONFIG_ARCH_MXC91231) := mxc91231 |
| 175 | 176 | ||
diff --git a/arch/arm/mach-nuc93x/Kconfig b/arch/arm/mach-nuc93x/Kconfig new file mode 100644 index 000000000000..2bc40a280fad --- /dev/null +++ b/arch/arm/mach-nuc93x/Kconfig | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | if ARCH_NUC93X | ||
| 2 | |||
| 3 | config CPU_NUC932 | ||
| 4 | bool | ||
| 5 | help | ||
| 6 | Support for NUC932 of Nuvoton NUC93X CPUs. | ||
| 7 | |||
| 8 | menu "NUC932 Machines" | ||
| 9 | |||
| 10 | config MACH_NUC932EVB | ||
| 11 | bool "Nuvoton NUC932 Evaluation Board" | ||
| 12 | default y | ||
| 13 | select CPU_NUC932 | ||
| 14 | help | ||
| 15 | Say Y here if you are using the Nuvoton NUC932EVB | ||
| 16 | |||
| 17 | endmenu | ||
| 18 | |||
| 19 | endif | ||
diff --git a/arch/arm/mach-nuc93x/Makefile b/arch/arm/mach-nuc93x/Makefile new file mode 100644 index 000000000000..440e2dec6c8a --- /dev/null +++ b/arch/arm/mach-nuc93x/Makefile | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | # | ||
| 2 | # Makefile for the linux kernel. | ||
| 3 | # | ||
| 4 | |||
| 5 | # Object file lists. | ||
| 6 | |||
| 7 | obj-y := irq.o time.o dev.o cpu.o clock.o | ||
| 8 | # NUC932 CPU support files | ||
| 9 | |||
| 10 | obj-$(CONFIG_CPU_NUC932) += nuc932.o | ||
| 11 | |||
| 12 | # machine support | ||
| 13 | |||
| 14 | obj-$(CONFIG_MACH_NUC932EVB) += mach-nuc932evb.o | ||
diff --git a/arch/arm/mach-nuc93x/Makefile.boot b/arch/arm/mach-nuc93x/Makefile.boot new file mode 100644 index 000000000000..a057b546b6e5 --- /dev/null +++ b/arch/arm/mach-nuc93x/Makefile.boot | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | zreladdr-y := 0x00008000 | ||
| 2 | params_phys-y := 0x00000100 | ||
| 3 | |||
diff --git a/arch/arm/mach-nuc93x/clock.c b/arch/arm/mach-nuc93x/clock.c new file mode 100644 index 000000000000..0521efbc48c9 --- /dev/null +++ b/arch/arm/mach-nuc93x/clock.c | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-nuc93x/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 | |||
| 28 | static DEFINE_SPINLOCK(clocks_lock); | ||
| 29 | |||
| 30 | int 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 | } | ||
| 41 | EXPORT_SYMBOL(clk_enable); | ||
| 42 | |||
| 43 | void 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 | } | ||
| 54 | EXPORT_SYMBOL(clk_disable); | ||
| 55 | |||
| 56 | unsigned long clk_get_rate(struct clk *clk) | ||
| 57 | { | ||
| 58 | return 27000000; | ||
| 59 | } | ||
| 60 | EXPORT_SYMBOL(clk_get_rate); | ||
| 61 | |||
| 62 | void nuc93x_clk_enable(struct clk *clk, int enable) | ||
| 63 | { | ||
| 64 | unsigned int clocks = clk->cken; | ||
| 65 | unsigned long clken; | ||
| 66 | |||
| 67 | clken = __raw_readl(NUC93X_VA_CLKPWR); | ||
| 68 | |||
| 69 | if (enable) | ||
| 70 | clken |= clocks; | ||
| 71 | |||
