]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'clps7500' into devel
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Thu, 27 Nov 2008 12:39:43 +0000 (12:39 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 27 Nov 2008 12:39:43 +0000 (12:39 +0000)
Conflicts:

arch/arm/Kconfig

69 files changed:
arch/arm/Kconfig
arch/arm/boot/compressed/misc.c
arch/arm/common/Kconfig
arch/arm/common/Makefile
arch/arm/common/clkdev.c [new file with mode: 0644]
arch/arm/include/asm/clkdev.h [new file with mode: 0644]
arch/arm/include/asm/page.h
arch/arm/include/asm/processor.h
arch/arm/include/asm/string.h
arch/arm/include/asm/uaccess.h
arch/arm/lib/memset.S
arch/arm/mach-at91/Kconfig
arch/arm/mach-integrator/clock.c
arch/arm/mach-integrator/clock.h
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/impd1.c
arch/arm/mach-integrator/include/mach/clkdev.h [new file with mode: 0644]
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-omap1/Kconfig
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/clock.c
arch/arm/mach-pxa/clock.h
arch/arm/mach-pxa/include/mach/clkdev.h [new file with mode: 0644]
arch/arm/mach-pxa/pwm.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/pxa300.c
arch/arm/mach-pxa/pxa320.c
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/ssp.c
arch/arm/mach-realview/Kconfig
arch/arm/mach-realview/clock.c
arch/arm/mach-realview/clock.h
arch/arm/mach-realview/core.c
arch/arm/mach-realview/core.h
arch/arm/mach-realview/include/mach/clkdev.h [new file with mode: 0644]
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-realview/realview_pb1176.c
arch/arm/mach-realview/realview_pb11mp.c
arch/arm/mach-s3c2410/Kconfig
arch/arm/mach-s3c2412/Kconfig
arch/arm/mach-s3c2440/Kconfig
arch/arm/mach-s3c2442/Kconfig
arch/arm/mach-sa1100/clock.c
arch/arm/mach-versatile/Kconfig
arch/arm/mach-versatile/clock.c
arch/arm/mach-versatile/clock.h
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/include/mach/clkdev.h [new file with mode: 0644]
arch/arm/mm/Kconfig
arch/arm/mm/mmu.c
arch/arm/mm/pgd.c
arch/arm/plat-mxc/Kconfig
arch/arm/plat-omap/Kconfig
drivers/i2c/busses/i2c-pxa.c
drivers/input/keyboard/pxa27x_keypad.c
drivers/media/video/pxa_camera.c
drivers/mfd/asic3.c
drivers/mmc/host/pxamci.c
drivers/mtd/maps/ixp2000.c
drivers/mtd/maps/ixp4xx.c
drivers/mtd/nand/pxa3xx_nand.c
drivers/mtd/nand/s3c2410.c
drivers/serial/pxa.c
drivers/usb/gadget/pxa25x_udc.c
drivers/usb/gadget/pxa27x_udc.c
drivers/usb/host/ohci-pxa27x.c
drivers/video/pxafb.c
drivers/video/sa1100fb.c

index 6946d95c939e12e95d015d74ff47ac1f7833b1d7..29759cd255539372caaa879794ce2b53b83f1299 100644 (file)
@@ -201,6 +201,7 @@ choice
 
 config ARCH_AAEC2000
        bool "Agilent AAEC-2000 based"
+       select CPU_ARM920T
        select ARM_AMBA
        select HAVE_CLK
        help
@@ -210,6 +211,7 @@ config ARCH_INTEGRATOR
        bool "ARM Ltd. Integrator family"
        select ARM_AMBA
        select HAVE_CLK
+       select COMMON_CLKDEV
        select ICST525
        help
          Support for ARM's Integrator platform.
@@ -218,6 +220,7 @@ config ARCH_REALVIEW
        bool "ARM Ltd. RealView family"
        select ARM_AMBA
        select HAVE_CLK
+       select COMMON_CLKDEV
        select ICST307
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@ -229,6 +232,7 @@ config ARCH_VERSATILE
        select ARM_AMBA
        select ARM_VIC
        select HAVE_CLK
+       select COMMON_CLKDEV
        select ICST307
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@ -245,11 +249,13 @@ config ARCH_AT91
 
 config ARCH_CLPS711X
        bool "Cirrus Logic CLPS711x/EP721x-based"
+       select CPU_ARM720T
        help
          Support for Cirrus Logic 711x/721x based boards.
 
 config ARCH_EBSA110
        bool "EBSA-110"
+       select CPU_SA110
        select ISA
        select NO_IOPORT
        help
@@ -260,6 +266,7 @@ config ARCH_EBSA110
 
 config ARCH_EP93XX
        bool "EP93xx-based"
+       select CPU_ARM920T
        select ARM_AMBA
        select ARM_VIC
        select GENERIC_GPIO
@@ -270,6 +277,7 @@ config ARCH_EP93XX
 
 config ARCH_FOOTBRIDGE
        bool "FootBridge"
+       select CPU_SA110
        select FOOTBRIDGE
        help
          Support for systems based on the DC21285 companion chip
@@ -277,18 +285,21 @@ config ARCH_FOOTBRIDGE
 
 config ARCH_NETX
        bool "Hilscher NetX based"
+       select CPU_ARM926T
        select ARM_VIC
        help
          This enables support for systems based on the Hilscher NetX Soc
 
 config ARCH_H720X
        bool "Hynix HMS720x-based"
+       select CPU_ARM720T
        select ISA_DMA_API
        help
          This enables support for systems based on the Hynix HMS720x
 
 config ARCH_IMX
        bool "IMX"
+       select CPU_ARM920T
        select GENERIC_GPIO
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@ -298,6 +309,7 @@ config ARCH_IMX
 config ARCH_IOP13XX
        bool "IOP13xx-based"
        depends on MMU
+       select CPU_XSC3
        select PLAT_IOP
        select PCI
        select ARCH_SUPPORTS_MSI
@@ -308,6 +320,7 @@ config ARCH_IOP13XX
 config ARCH_IOP32X
        bool "IOP32x-based"
        depends on MMU
+       select CPU_XSCALE
        select PLAT_IOP
        select PCI
        select GENERIC_GPIO
@@ -319,6 +332,7 @@ config ARCH_IOP32X
 config ARCH_IOP33X
        bool "IOP33x-based"
        depends on MMU
+       select CPU_XSCALE
        select PLAT_IOP
        select PCI
        select GENERIC_GPIO
@@ -329,6 +343,7 @@ config ARCH_IOP33X
 config ARCH_IXP23XX
        bool "IXP23XX-based"
        depends on MMU
+       select CPU_XSC3
        select PCI
        help
          Support for Intel's IXP23xx (XScale) family of processors.
@@ -336,6 +351,7 @@ config ARCH_IXP23XX
 config ARCH_IXP2000
        bool "IXP2400/2800-based"
        depends on MMU
+       select CPU_XSCALE
        select PCI
        help
          Support for Intel's IXP2400/2800 (XScale) family of processors.
@@ -343,6 +359,7 @@ config ARCH_IXP2000
 config ARCH_IXP4XX
        bool "IXP4xx-based"
        depends on MMU
+       select CPU_XSCALE
        select GENERIC_GPIO
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@ -352,6 +369,7 @@ config ARCH_IXP4XX
 
 config ARCH_L7200
        bool "LinkUp-L7200"
+       select CPU_ARM720T
        select FIQ
        help
          Say Y here if you intend to run this kernel on a LinkUp Systems
@@ -365,6 +383,7 @@ config ARCH_L7200
 
 config ARCH_KIRKWOOD
        bool "Marvell Kirkwood"
+       select CPU_FEROCEON
        select PCI
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@ -375,6 +394,7 @@ config ARCH_KIRKWOOD
 
 config ARCH_KS8695
        bool "Micrel/Kendin KS8695"
+       select CPU_ARM922T
        select GENERIC_GPIO
        help
          Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
@@ -382,6 +402,7 @@ config ARCH_KS8695
 
 config ARCH_NS9XXX
        bool "NetSilicon NS9xxx"
+       select CPU_ARM926T
        select GENERIC_GPIO
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@ -394,6 +415,7 @@ config ARCH_NS9XXX
 
 config ARCH_LOKI
        bool "Marvell Loki (88RC8480)"
+       select CPU_FEROCEON
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        select PLAT_ORION
@@ -402,6 +424,7 @@ config ARCH_LOKI
 
 config ARCH_MV78XX0
        bool "Marvell MV78xx0"
+       select CPU_FEROCEON
        select PCI
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@ -423,6 +446,7 @@ config ARCH_MXC
 config ARCH_ORION5X
        bool "Marvell Orion"
        depends on MMU
+       select CPU_FEROCEON
        select PCI
        select GENERIC_GPIO
        select GENERIC_TIME
@@ -435,6 +459,7 @@ config ARCH_ORION5X
 
 config ARCH_PNX4008
        bool "Philips Nexperia PNX4008 Mobile"
+       select CPU_ARM926T
        select HAVE_CLK
        help
          This enables support for Philips PNX4008 mobile platform.
@@ -445,6 +470,7 @@ config ARCH_PXA
        select ARCH_MTD_XIP
        select GENERIC_GPIO
        select HAVE_CLK
+       select COMMON_CLKDEV
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@ -468,6 +494,7 @@ config ARCH_RPC
 
 config ARCH_SA1100
        bool "SA1100-based"
+       select CPU_SA1100
        select ISA
        select ARCH_SPARSEMEM_ENABLE
        select ARCH_MTD_XIP
@@ -491,6 +518,7 @@ config ARCH_S3C2410
 
 config ARCH_SHARK
        bool "Shark"
+       select CPU_SA110
        select ISA
        select ISA_DMA
        select ZONE_DMA
@@ -501,6 +529,7 @@ config ARCH_SHARK
 
 config ARCH_LH7A40X
        bool "Sharp LH7A40X"
+       select CPU_ARM922T
        select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM
        select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM
        help
@@ -511,6 +540,7 @@ config ARCH_LH7A40X
 
 config ARCH_DAVINCI
        bool "TI DaVinci"
+       select CPU_ARM926T
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
@@ -532,6 +562,7 @@ config ARCH_OMAP
 
 config ARCH_MSM
        bool "Qualcomm MSM"
+       select CPU_V6
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        help
index 65ce8fff29db1583890fe54f438f6f03385e11a9..3fc08413fff05803a3f555de749917b56962b966 100644 (file)
@@ -86,6 +86,8 @@ static void putstr(const char *ptr)
 
 #define __ptr_t void *
 
+#define memzero(s,n) __memzero(s,n)
+
 /*
  * Optimised C version of memzero for the ARM.
  */
index 86b5e6982660da255a13148a9392dc4d73def0b4..a2cd9beaf37daeb85c20627255b808f0fdf883a6 100644 (file)
@@ -33,3 +33,6 @@ config SHARPSL_PM
 
 config SHARP_SCOOP
        bool
+
+config COMMON_CLKDEV
+       bool
index 325e4b6a6afbdc842df5a822cdc507998508d55b..7cb7961d81cb977ec2b56b45208188875980966f 100644 (file)
@@ -17,3 +17,4 @@ obj-$(CONFIG_SHARP_SCOOP)     += scoop.o
 obj-$(CONFIG_ARCH_IXP2000)     += uengine.o
 obj-$(CONFIG_ARCH_IXP23XX)     += uengine.o
 obj-$(CONFIG_PCI_HOST_ITE8152)  += it8152.o
+obj-$(CONFIG_COMMON_CLKDEV)    += clkdev.o
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c
new file mode 100644 (file)
index 0000000..17a17b4
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ *  arch/arm/common/clkdev.c
+ *
+ *  Copyright (C) 2008 Russell King.
+ *
+ * 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.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/string.h>
+#include <linux/mutex.h>
+
+#include <asm/clkdev.h>
+#include <mach/clkdev.h>
+
+static LIST_HEAD(clocks);
+static DEFINE_MUTEX(clocks_mutex);
+
+static struct clk *clk_find(const char *dev_id, const char *con_id)
+{
+       struct clk_lookup *p;
+       struct clk *clk = NULL;
+       int match, best = 0;
+
+       list_for_each_entry(p, &clocks, node) {
+               if ((p->dev_id && !dev_id) || (p->con_id && !con_id))
+                       continue;
+               match = 0;
+               if (p->dev_id)
+                       match += 2 * (strcmp(p->dev_id, dev_id) == 0);
+               if (p->con_id)
+                       match += 1 * (strcmp(p->con_id, con_id) == 0);
+               if (match == 0)
+                       continue;
+
+               if (match > best) {
+                       clk = p->clk;
+                       best = match;
+               }
+       }
+       return clk;
+}
+
+struct clk *clk_get(struct device *dev, const char *con_id)
+{
+       const char *dev_id = dev ? dev_name(dev) : NULL;
+       struct clk *clk;
+
+       mutex_lock(&clocks_mutex);
+       clk = clk_find(dev_id, con_id);
+       if (clk && !__clk_get(clk))
+               clk = NULL;
+       mutex_unlock(&clocks_mutex);
+
+       return clk ? clk : ERR_PTR(-ENOENT);
+}
+EXPORT_SYMBOL(clk_get);
+
+void clk_put(struct clk *clk)
+{
+       __clk_put(clk);
+}
+EXPORT_SYMBOL(clk_put);
+
+void clkdev_add(struct clk_lookup *cl)
+{
+       mutex_lock(&clocks_mutex);
+       list_add_tail(&cl->node, &clocks);
+       mutex_unlock(&clocks_mutex);
+}
+EXPORT_SYMBOL(clkdev_add);
+
+#define MAX_DEV_ID     20
+#define MAX_CON_ID     16
+
+struct clk_lookup_alloc {
+       struct clk_lookup cl;
+       char    dev_id[MAX_DEV_ID];
+       char    con_id[MAX_CON_ID];
+};
+
+struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
+       const char *dev_fmt, ...)
+{
+       struct clk_lookup_alloc *cla;
+
+       cla = kzalloc(sizeof(*cla), GFP_KERNEL);
+       if (!cla)
+               return NULL;
+
+       cla->cl.clk = clk;
+       if (con_id) {
+               strlcpy(cla->con_id, con_id, sizeof(cla->con_id));
+               cla->cl.con_id = cla->con_id;
+       }
+
+       if (dev_fmt) {
+               va_list ap;
+
+               va_start(ap, dev_fmt);
+               vscnprintf(cla->dev_id, sizeof(cla->dev_id), dev_fmt, ap);
+               cla->cl.dev_id = cla->dev_id;
+               va_end(ap);
+       }
+
+       return &cla->cl;
+}
+EXPORT_SYMBOL(clkdev_alloc);
+
+/*
+ * clkdev_drop - remove a clock dynamically allocated
+ */
+void clkdev_drop(struct clk_lookup *cl)
+{
+       mutex_lock(&clocks_mutex);
+       list_del(&cl->node);
+       mutex_unlock(&clocks_mutex);
+       kfree(cl);
+}
+EXPORT_SYMBOL(clkdev_drop);
diff --git a/arch/arm/include/asm/clkdev.h b/arch/arm/include/asm/clkdev.h
new file mode 100644 (file)
index 0000000..b6ec7c6
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ *  arch/arm/include/asm/clkdev.h
+ *
+ *  Copyright (C) 2008 Russell King.
+ *
+ * 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.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+struct clk;
+
+struct clk_lookup {
+       struct list_head        node;
+       const char              *dev_id;
+       const char              *con_id;
+       struct clk              *clk;
+};
+
+struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
+       const char *dev_fmt, ...);
+
+void clkdev_add(struct clk_lookup *cl);
+void clkdev_drop(struct clk_lookup *cl);
+
+#endif
index bed1c0a0036865c40aab88e95b8500e701e940ce..5fee45e23038ba73a85b69dc10980449de40b541 100644 (file)
@@ -133,7 +133,7 @@ extern void __cpu_copy_user_page(void *to, const void *from,
 #define clear_user_page(addr,vaddr,pg)  __cpu_clear_user_page(addr, vaddr)
 #define copy_user_page(to,from,vaddr,pg) __cpu_copy_user_page(to, from, vaddr)
 
-#define clear_page(page)       memzero((void *)(page), PAGE_SIZE)
+#define clear_page(page)       memset((void *)(page), 0, PAGE_SIZE)
 extern void copy_page(void *to, const void *from);
 
 #undef STRICT_MM_TYPECHECKS
index 517a4d6ffc74b791691a3a2f65099bb6352e5e64..2320508443a50ea79d512fa74f584b504174417d 100644 (file)
@@ -64,7 +64,7 @@ struct thread_struct {
 ({                                                                     \
        unsigned long *stack = (unsigned long *)sp;                     \
        set_fs(USER_DS);                                                \
-       memzero(regs->uregs, sizeof(regs->uregs));                      \
+       memset(regs->uregs, 0, sizeof(regs->uregs));                    \
        if (current->personality & ADDR_LIMIT_32BIT)                    \
                regs->ARM_cpsr = USR_MODE;                              \
        else                                                            \
index e50c4a39b699779f9af151397eeeb022ff2da0f5..cf4f3aad0fc1c2154c6cf3839ff21bb1c46d6499 100644 (file)
@@ -21,7 +21,6 @@ extern void * memmove(void *, const void *, __kernel_size_t);
 #define __HAVE_ARCH_MEMCHR
 extern void * memchr(const void *, int, __kernel_size_t);
 
-#define __HAVE_ARCH_MEMZERO
 #define __HAVE_ARCH_MEMSET
 extern void * memset(void *, int, __kernel_size_t);
 
@@ -39,12 +38,4 @@ extern void __memzero(void *ptr, __kernel_size_t n);
                (__p);                                                  \
        })
 
-#define memzero(p,n)                                                   \
-       ({                                                              \
-               void *__p = (p); size_t __n = n;                        \
-               if ((__n) != 0)                                         \
-                       __memzero((__p),(__n));                         \
-               (__p);                                                  \
-        })
-
 #endif
index e98ec60b34002b4f2457982c8312600efd7216be..cbb7a37e297800ae36feb34e22bc4f32caf81989 100644 (file)
@@ -400,7 +400,7 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __u
        if (access_ok(VERIFY_READ, from, n))
                n = __copy_from_user(to, from, n);
        else /* security hole - plug it */
-               memzero(to, n);
+               memset(to, 0, n);
        return n;
 }
 
index 761eefa762437de156387da70fbe006004c950cb..650d5923ab83cd849c38db3a64c55fccf36a631a 100644 (file)
@@ -25,7 +25,7 @@
        add     r2, r2, r3              @ 1 (r2 = r2 - (4 - r3))
 /*
  * The pointer is now aligned and the length is adjusted.  Try doing the
- * memzero again.
+ * memset again.
  */
 
 ENTRY(memset)
index 5aafb2e2ca7a538335957df1508009f5784f0230..95dc71aaa6687f39289a6c147682e1aab19a340d 100644 (file)
@@ -7,36 +7,43 @@ choice
 
 config ARCH_AT91RM9200
        bool "AT91RM9200"
+       select CPU_ARM920T
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91SAM9260
        bool "AT91SAM9260 or AT91SAM9XE"
+       select CPU_ARM926T
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91SAM9261
        bool "AT91SAM9261"
+       select CPU_ARM926T
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91SAM9263
        bool "AT91SAM9263"
+       select CPU_ARM926T
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91SAM9RL
        bool "AT91SAM9RL"
+       select CPU_ARM926T
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91SAM9G20
        bool "AT91SAM9G20"
+       select CPU_ARM926T
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91CAP9
        bool "AT91CAP9"
+       select CPU_ARM926T
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
 
index 8d761fdd2ecdaf3b44ea2e0f926f581963780766..989ecf5f5c4685a9b8afedf0677e8e0a88d63f82 100644 (file)
  */
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/list.h>
 #include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/string.h>
 #include <linux/clk.h>
 #include <linux/mutex.h>
 
-#include <asm/hardware/icst525.h>
-
-#include "clock.h"
-
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
-
-struct clk *clk_get(struct device *dev, const char *id)
-{
-       struct clk *p, *clk = ERR_PTR(-ENOENT);
-
-       mutex_lock(&clocks_mutex);
-       list_for_each_entry(p, &clocks, node) {
-               if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
-                       clk = p;
-                       break;
-               }
-       }
-       mutex_unlock(&clocks_mutex);
-
-       return clk;
-}
-EXPORT_SYMBOL(clk_get);
-
-void clk_put(struct clk *clk)
-{
-       module_put(clk->owner);
-}
-EXPORT_SYMBOL(clk_put);
+#include <asm/clkdev.h>
+#include <mach/clkdev.h>
 
 int clk_enable(struct clk *clk)
 {
@@ -67,7 +37,6 @@ EXPORT_SYMBOL(clk_get_rate);
 long clk_round_rate(struct clk *clk, unsigned long rate)
 {
        struct icst525_vco vco;
-
        vco = icst525_khz_to_vco(clk->params, rate / 1000);
        return icst525_khz(clk->params, vco) * 1000;
 }
@@ -76,56 +45,15 @@ EXPORT_SYMBOL(clk_round_rate);
 int clk_set_rate(struct clk *clk, unsigned long rate)
 {
        int ret = -EIO;
+
        if (clk->setvco) {
                struct icst525_vco vco;
 
                vco = icst525_khz_to_vco(clk->params, rate / 1000);
                clk->rate = icst525_khz(clk->params, vco) * 1000;
-
-               printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n",
-                       clk->name, vco.s, vco.r, vco.v);
-
                clk->setvco(clk, vco);
                ret = 0;
        }
-       return 0;
+       return ret;
 }
 EXPORT_SYMBOL(clk_set_rate);
-
-/*
- * These are fixed clocks.
- */
-static struct clk kmi_clk = {
-       .name   = "KMIREFCLK",
-       .rate   = 24000000,
-};
-
-static struct clk uart_clk = {
-       .name   = "UARTCLK",
-       .rate   = 14745600,
-};
-
-int clk_register(struct clk *clk)
-{
-       mutex_lock(&clocks_mutex);
-       list_add(&clk->node, &clocks);
-       mutex_unlock(&clocks_mutex);
-       return 0;
-}
-EXPORT_SYMBOL(clk_register);
-
-void clk_unregister(struct clk *clk)
-{
-       mutex_lock(&clocks_mutex);
-       list_del(&clk->node);
-       mutex_unlock(&clocks_mutex);
-}
-EXPORT_SYMBOL(clk_unregister);
-
-static int __init clk_init(void)
-{
-       clk_register(&kmi_clk);
-       clk_register(&uart_clk);
-       return 0;
-}
-arch_initcall(clk_init);
index 09e6328ceba98627717d8ed1f5ce37859270b2a9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,25 +0,0 @@
-/*
- *  linux/arch/arm/mach-integrator/clock.h
- *
- *  Copyright (C) 2004 ARM Limited.
- *  Written by Deep Blue Solutions Limited.
- *
- * 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 module;
-struct icst525_params;
-
-struct clk {
-       struct list_head        node;
-       unsigned long           rate;
-       struct module           *owner;
-       const char              *name;
-       const struct icst525_params *params;
-       void                    *data;
-       void                    (*setvco)(struct clk *, struct icst525_vco vco);
-};
-
-int clk_register(struct clk *clk);
-void clk_unregister(struct clk *clk);
index 595b7392ee4eb9bfdad41ba8b9cc69243d49cf6c..c89c949b4d459930fc7ed6d0098cbe8e7126f3fa 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/amba/serial.h>
 #include <linux/io.h>
 
+#include <asm/clkdev.h>
+#include <mach/clkdev.h>
 #include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/hardware/arm_timer.h>
@@ -108,10 +110,43 @@ static struct amba_device *amba_devs[] __initdata = {
        &kmi1_device,
 };
 
+/*
+ * These are fixed clocks.
+ */
+static struct clk clk24mhz = {
+       .rate   = 24000000,
+};
+
+static struct clk uartclk = {
+       .rate   = 14745600,
+};
+
+static struct clk_lookup lookups[] __initdata = {
+       {       /* UART0 */
+               .dev_id         = "mb:16",
+               .clk            = &uartclk,
+       }, {    /* UART1 */
+               .dev_id         = "mb:17",
+               .clk            = &uartclk,
+       }, {    /* KMI0 */
+               .dev_id         = "mb:18",
+               .clk            = &clk24mhz,
+       }, {    /* KMI1 */
+               .dev_id         = "mb:19",
+               .clk            = &clk24mhz,
+       }, {    /* MMCI - IntegratorCP */
+               .dev_id         = "mb:1c",
+               .clk            = &uartclk,
+       }
+};
+
 static int __init integrator_init(void)
 {
        int i;
 
+       for (i = 0; i < ARRAY_SIZE(lookups); i++)
+               clkdev_add(&lookups[i]);
+
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];
                amba_device_register(d, &iomem_resource);
index 172299a783021395f778c9a46eb771f7a152dafb..0058c937719ed7f7400fe8a1388e9c9e8f73e777 100644 (file)
 #include <linux/amba/clcd.h>
 #include <linux/io.h>
 
+#include <asm/clkdev.h>
+#include <mach/clkdev.h>
 #include <asm/hardware/icst525.h>
 #include <mach/lm.h>
 #include <mach/impd1.h>
 #include <asm/sizes.h>
 
-#include "clock.h"
-
 static int module_id;
 
 module_param_named(lmid, module_id, int, 0444);
@@ -37,6 +37,7 @@ MODULE_PARM_DESC(lmid, "logic module stack position");
 struct impd1_module {
        void __iomem    *base;
        struct clk      vcos[2];
+       struct clk_lookup *clks[3];
 };
 
 static const struct icst525_params impd1_vco_params = {
@@ -339,9 +340,8 @@ static struct impd1_device impd1_devs[] = {
        }
 };
 
-static const char *impd1_vconames[2] = {
-       "CLCDCLK",
-       "AUXVCO2",
+static struct clk fixed_14745600 = {
+       .rate = 14745600,
 };
 
 static int impd1_probe(struct lm_device *dev)
@@ -374,14 +374,20 @@ static int impd1_probe(struct lm_device *dev)
 
        for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) {
                impd1->vcos[i].owner = THIS_MODULE,
-               impd1->vcos[i].name = impd1_vconames[i],
                impd1->vcos[i].params = &impd1_vco_params,
                impd1->vcos[i].data = impd1,
                impd1->vcos[i].setvco = impd1_setvco;
-
-               clk_register(&impd1->vcos[i]);
        }
 
+       impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000",
+                                       dev->id);
+       impd1->clks[1] = clkdev_alloc(&fixed_14745600, NULL, "lm%x:00100",
+                                       dev->id);
+       impd1->clks[2] = clkdev_alloc(&fixed_14745600, NULL, "lm%x:00200",
+                                       dev->id);
+       for (i = 0; i < ARRAY_SIZE(impd1->clks); i++)
+               clkdev_add(impd1->clks[i]);
+
        for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) {
                struct impd1_device *idev = impd1_devs + i;
                struct amba_device *d;
@@ -434,8 +440,8 @@ static void impd1_remove(struct lm_device *dev)
 
        device_for_each_child(&dev->dev, NULL, impd1_remove_one);
 
-       for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++)
-               clk_unregister(&impd1->vcos[i]);
+       for (i = 0; i < ARRAY_SIZE(impd1->clks); i++)
+               clkdev_drop(impd1->clks[i]);
 
        lm_set_drvdata(dev, NULL);
 
diff --git a/arch/arm/mach-integrator/include/mach/clkdev.h b/arch/arm/mach-integrator/include/mach/clkdev.h
new file mode 100644 (file)
index 0000000..9293e41
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#include <linux/module.h>
+#include <asm/hardware/icst525.h>
+
+struct clk {
+       unsigned long           rate;
+       struct module           *owner;
+       const struct icst525_params *params;
+       void                    *data;
+       void                    (*setvco)(struct clk *, struct icst525_vco vco);
+};
+
+static inline int __clk_get(struct clk *clk)
+{
+       return try_module_get(clk->owner);
+}
+
+static inline void __clk_put(struct clk *clk)
+{
+       module_put(clk->owner);
+}
+
+#endif
index 88026ccd5ac9b9b81074b12b17f48e6629c8e5b9..427c2d8dc1239bc835121f4b3e19956c5b0721c8 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/amba/clcd.h>
 #include <linux/io.h>
 
+#include <asm/clkdev.h>
+#include <mach/clkdev.h>
 #include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/setup.h>
@@ -38,7 +40,6 @@
 #include <asm/mach/time.h>
 
 #include "common.h"
-#include "clock.h"
 
 #define INTCP_PA_MMC_BASE              0x1c000000
 #define INTCP_PA_AACI_BASE             0x1d000000
@@ -289,15 +290,16 @@ static void cp_auxvco_set(struct clk *clk, struct icst525_vco vco)
        writel(0, CM_LOCK);
 }
 
-static struct clk cp_clcd_clk = {
-       .name   = "CLCDCLK",
+static struct clk cp_auxclk = {
        .params = &cp_auxvco_params,
        .setvco = cp_auxvco_set,
 };
 
-static struct clk cp_mmci_clk = {
-       .name   = "MCLK",
-       .rate   = 14745600,
+static struct clk_lookup cp_lookups[] = {
+       {       /* CLCD */
+               .dev_id         = "mb:c0",
+               .clk            = &cp_auxclk,
+       },
 };
 
 /*
@@ -554,8 +556,8 @@ static void __init intcp_init(void)
 {
        int i;
 
-       clk_register(&cp_clcd_clk);
-       clk_register(&cp_mmci_clk);
+       for (i = 0; i < ARRAY_SIZE(cp_lookups); i++)
+               clkdev_add(&cp_lookups[i]);
 
        platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs));
 
index 79f0b1f8497be84a210e7330b4a87843c5eb14c1..10a301e32434639e737f18db0832e6657001d66c 100644 (file)
@@ -4,16 +4,19 @@ comment "OMAP Core Type"
 config ARCH_OMAP730
        depends on ARCH_OMAP1
        bool "OMAP730 Based System"
+       select CPU_ARM926T
        select ARCH_OMAP_OTG
 
 config ARCH_OMAP15XX
        depends on ARCH_OMAP1
        default y
        bool "OMAP15xx Based System"
+       select CPU_ARM925T
 
 config ARCH_OMAP16XX
        depends on ARCH_OMAP1
        bool "OMAP16xx Based System"
+       select CPU_ARM926T
        select ARCH_OMAP_OTG
 
 comment "OMAP Board Type"
index a062235e83a8b4c3b272c3d7af016d85dcd8b2ba..740f0a382bac696117051c5350162a0701f25097 100644 (file)
@@ -386,16 +386,19 @@ endmenu
 
 config PXA25x
        bool
+       select CPU_XSCALE
        help
          Select code specific to PXA21x/25x/26x variants
 
 config PXA27x
        bool
+       select CPU_XSCALE
        help
          Select code specific to PXA27x variants
 
 config PXA3xx
        bool
+       select CPU_XSC3
        help
          Select code specific to PXA3xx variants
 
index ca8e205381577ab07f05fec6e573f77554672c3c..a3e0e1989a6b55dd0873a6c9a61f55516b322173 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 
+#include <asm/clkdev.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/pxa2xx-gpio.h>
 #include <mach/hardware.h>
 #include "generic.h"
 #include "clock.h"
 
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
 static DEFINE_SPINLOCK(clocks_lock);
 
-static struct clk *clk_lookup(struct device *dev, const char *id)
-{
-       struct clk *p;
-
-       list_for_each_entry(p, &clocks, node)
-               if (strcmp(id, p->name) == 0 && p->dev == dev)
-                       return p;
-
-       return NULL;
-}
-
-struct clk *clk_get(struct device *dev, const char *id)
-{
-       struct clk *p, *clk = ERR_PTR(-ENOENT);
-
-       mutex_lock(&clocks_mutex);
-       p = clk_lookup(dev, id);
-       if (!p)
-               p = clk_lookup(NULL, id);
-       if (p)
-               clk = p;
-       mutex_unlock(&clocks_mutex);
-
-       if (!IS_ERR(clk) && clk->ops == NULL)
-               clk = clk->other;
-
-       return clk;
-}
-EXPORT_SYMBOL(clk_get);
-
-void clk_put(struct clk *clk)
-{
-}
-EXPORT_SYMBOL(clk_put);
-
 int clk_enable(struct clk *clk)
 {
        unsigned long flags;
@@ -116,37 +80,27 @@ const struct clkops clk_cken_ops = {
        .disable        = clk_cken_disable,
 };
 
-void clks_register(struct clk *clks, size_t num)
+void clks_register(struct clk_lookup *clks, size_t num)
 {
        int i;
 
-       mutex_lock(&clocks_mutex);
        for (i = 0; i < num; i++)
-               list_add(&clks[i].node, &clocks);
-       mutex_unlock(&clocks_mutex);
+               clkdev_add(&clks[i]);
 }
 
 int clk_add_alias(char *alias, struct device *alias_dev, char *id,
        struct device *dev)
 {
-       struct clk *r = clk_lookup(dev, id);
-       struct clk *new;
+       struct clk *r = clk_get(dev, id);
+       struct clk_lookup *l;
 
        if (!r)
                return -ENODEV;
 
-       new = kzalloc(sizeof(struct clk), GFP_KERNEL);
-
-       if (!new)
-               return -ENOMEM;
-
-       new->name = alias;
-       new->dev = alias_dev;
-       new->other = r;
-
-       mutex_lock(&clocks_mutex);
-       list_add(&new->node, &clocks);
-       mutex_unlock(&clocks_mutex);
-
+       l = clkdev_alloc(r, alias, alias_dev ? dev_name(alias_dev) : NULL);
+       clk_put(r);
+       if (!l)
+               return -ENODEV;
+       clkdev_add(l);
        return 0;
 }
index 73be795fe3bfe5dcb04a25fa95c2488910efa20c..4e9c613c6767e24b557f83281927e4c9df01ce6e 100644 (file)
@@ -1,6 +1,4 @@
-#include <linux/list.h>
-
-struct clk;
+#include <asm/clkdev.h>
 
 struct clkops {
        void                    (*enable)(struct clk *);
@@ -9,9 +7,6 @@ struct clkops {
 };
 
 struct clk {
-       struct list_head        node;
-       const char              *name;
-       struct device           *dev;
        const struct clkops     *ops;
        unsigned long           rate;
        unsigned int            cken;
@@ -20,41 +15,31 @@ struct clk {
        struct clk              *other;
 };
 
-#define INIT_CKEN(_name, _cken, _rate, _delay, _dev)   \
+#define INIT_CLKREG(_clk,_devname,_conname)            \
        {                                               \
-               .name   = _name,                        \
-               .dev    = _dev,                         \
+               .clk            = _clk,                 \
+               .dev_id         = _devname,             \
+               .con_id         = _conname,             \
+       }
+
+#define DEFINE_CKEN(_name, _cken, _rate, _delay)       \
+struct clk clk_##_name = {                             \
                .ops    = &clk_cken_ops,                \
                .rate   = _rate,                        \
                .cken   = CKEN_##_cken,                 \
                .delay  = _delay,                       \
        }
 
-#define INIT_CK(_name, _cken, _ops, _dev)              \
-       {                                               \
-               .name   = _name,                        \
-               .dev    = _dev,                         \
+#define DEFINE_CK(_name, _cken, _ops)                  \
+struct clk clk_##_name = {                             \
                .ops    = _ops,                         \
                .cken   = CKEN_##_cken,                 \
        }
 
-/*
- * This is a placeholder to alias one clock device+name pair
- * to another struct clk.
- */
-#define INIT_CKOTHER(_name, _other, _dev)              \
-       {                                               \
-               .name   = _name,                        \
-               .dev    = _dev,                         \
-               .other  = _other,                       \
-       }
-
-#define INIT_CLK(_name, _ops, _rate, _delay, _dev)      \
-       {                                               \
-               .name   = _name,                        \
-               .dev    = _dev,                         \
-               .ops    = _ops,                         \
-               .rate   = _rate,                        \
+#define DEFINE_CLK(_name, _ops, _rate, _delay)         \
+struct clk clk_##_name = {                             \
+               .ops    = _ops,                         \
+               .rate   = _rate,                        \
                .delay  = _delay,                       \
        }
 
@@ -64,20 +49,16 @@ void clk_cken_enable(struct clk *clk);
 void clk_cken_disable(struct clk *clk);
 
 #ifdef CONFIG_PXA3xx
-#define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev) \
-       {                                               \
-               .name   = _name,                        \
-               .dev    = _dev,                         \
+#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay)  \
+struct clk clk_##_name = {                             \
                .ops    = &clk_pxa3xx_cken_ops,         \
                .rate   = _rate,                        \
                .cken   = CKEN_##_cken,                 \
                .delay  = _delay,                       \
        }
 
-#define PXA3xx_CK(_name, _cken, _ops, _dev)            \
-       {                                               \
-               .name   = _name,                        \
-               .dev    = _dev,                         \
+#define DEFINE_PXA3_CK(_name, _cken, _ops)             \
+struct clk clk_##_name = {                             \
                .ops    = _ops,                         \
                .cken   = CKEN_##_cken,                 \
        }
@@ -87,7 +68,7 @@ extern void clk_pxa3xx_cken_enable(struct clk *);
 extern void clk_pxa3xx_cken_disable(struct clk *);
 #endif
 
-void clks_register(struct clk *clks, size_t num);
+void clks_register(struct clk_lookup *clks, size_t num);
 int clk_add_alias(char *alias, struct device *alias_dev, char *id,
        struct device *dev);
 
diff --git a/arch/arm/mach-pxa/include/mach/clkdev.h b/arch/arm/mach-pxa/include/mach/clkdev.h
new file mode 100644 (file)
index 0000000..04b37a8
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
index 74e2ead8cee80fa7f52ca7d7e40b64ce8005fc00..3ca7ffc6904b04ebdb80b74b8408e0ea9f610ab4 100644 (file)
@@ -173,7 +173,7 @@ static struct pwm_device *pwm_probe(struct platform_device *pdev,
                return ERR_PTR(-ENOMEM);
        }
 
-       pwm->clk = clk_get(&pdev->dev, "PWMCLK");
+       pwm->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(pwm->clk)) {
                ret = PTR_ERR(pwm->clk);
                goto err_free;
index 25d17a1dab78bd68606224d233e6660960de0300..344b3282caf93ed7872d2c75841d279991daa201 100644 (file)
@@ -167,36 +167,51 @@ static const struct clkops clk_pxa25x_gpio11_ops = {
  * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz
  * 147.456MHz -> UART 14.7456MHz, AC97 12.288MHz, I2S 5.672MHz (allegedly)
  */
-static struct clk pxa25x_hwuart_clk =
-       INIT_CKEN("UARTCLK", HWUART, 14745600, 1, &pxa_device_hwuart.dev)
-;
+static DEFINE_CKEN(pxa25x_hwuart, HWUART, 14745600, 1);
+
+static struct clk_lookup pxa25x_hwuart_clkreg =
+       INIT_CLKREG(&clk_pxa25x_hwuart, "pxa2xx-uart.3", NULL);
 
 /*
  * PXA 2xx clock declarations.
  */
-static struct clk pxa25x_clks[] = {
-       INIT_CK("LCDCLK", LCD, &clk_pxa25x_lcd_ops, &pxa_device_fb.dev),
-       INIT_CKEN("UARTCLK", FFUART, 14745600, 1, &pxa_device_ffuart.dev),
-       INIT_CKEN("UARTCLK", BTUART, 14745600, 1, &pxa_device_btuart.dev),
-       INIT_CKEN("UARTCLK", STUART, 14745600, 1, NULL),
-       INIT_CKEN("UDCCLK", USB, 47923000, 5, &pxa25x_device_udc.dev),
-       INIT_CLK("GPIO11_CLK", &clk_pxa25x_gpio11_ops, 3686400, 0, NULL),
-       INIT_CLK("GPIO12_CLK", &clk_pxa25x_gpio12_ops, 32768, 0, NULL),
-       INIT_CKEN("MMCCLK", MMC, 19169000, 0, &pxa_device_mci.dev),
-       INIT_CKEN("I2CCLK", I2C, 31949000, 0, &pxa_device_i2c.dev),
-
-       INIT_CKEN("SSPCLK",  SSP, 3686400, 0, &pxa25x_device_ssp.dev),
-       INIT_CKEN("SSPCLK", NSSP, 3686400, 0, &pxa25x_device_nssp.dev),
-       INIT_CKEN("SSPCLK", ASSP, 3686400, 0, &pxa25x_device_assp.dev),
-       INIT_CKEN("PWMCLK", PWM0, 3686400, 0, &pxa25x_device_pwm0.dev),
-       INIT_CKEN("PWMCLK", PWM1, 3686400, 0, &pxa25x_device_pwm1.dev),
-
-       INIT_CKEN("AC97CLK",     AC97,     24576000, 0, NULL),
-
-       /*
-       INIT_CKEN("I2SCLK",  I2S,  14745600, 0, NULL),
-       */
-       INIT_CKEN("FICPCLK", FICP, 47923000, 0, NULL),
+static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops);
+static DEFINE_CKEN(pxa25x_ffuart, FFUART, 14745600, 1);
+static DEFINE_CKEN(pxa25x_btuart, BTUART, 14745600, 1);
+static DEFINE_CKEN(pxa25x_stuart, STUART, 14745600, 1);
+static DEFINE_CKEN(pxa25x_usb, USB, 47923000, 5);
+static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0);
+static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0);
+static DEFINE_CKEN(pxa25x_mmc, MMC, 19169000, 0);
+static DEFINE_CKEN(pxa25x_i2c, I2C, 31949000, 0);
+static DEFINE_CKEN(pxa25x_ssp, SSP, 3686400, 0);
+static DEFINE_CKEN(pxa25x_nssp, NSSP, 3686400, 0);
+static DEFINE_CKEN(pxa25x_assp, ASSP, 3686400, 0);
+static DEFINE_CKEN(pxa25x_pwm0, PWM0, 3686400, 0);
+static DEFINE_CKEN(pxa25x_pwm1, PWM1, 3686400, 0);
+static DEFINE_CKEN(pxa25x_ac97, AC97, 24576000, 0);
+static DEFINE_CKEN(pxa25x_i2s, I2S, 14745600, 0);
+static DEFINE_CKEN(pxa25x_ficp, FICP, 47923000, 0);
+
+static struct clk_lookup pxa25x_clkregs[] = {
+       INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL),
+       INIT_CLKREG(&clk_pxa25x_ffuart, "pxa2xx-uart.0", NULL),
+       INIT_CLKREG(&clk_pxa25x_btuart, "pxa2xx-uart.1", NULL),
+       INIT_CLKREG(&clk_pxa25x_stuart, "pxa2xx-uart.2", NULL),
+       INIT_CLKREG(&clk_pxa25x_usb, "pxa25x-udc", NULL),
+       INIT_CLKREG(&clk_pxa25x_mmc, "pxa2xx-mci.0", NULL),
+       INIT_CLKREG(&clk_pxa25x_i2c, "pxa2xx-i2c.0", NULL),
+       INIT_CLKREG(&clk_pxa25x_ssp, "pxa25x-ssp.0", NULL),
+       INIT_CLKREG(&clk_pxa25x_nssp, "pxa25x-nssp.1", NULL),
+       INIT_CLKREG(&clk_pxa25x_assp, "pxa25x-nssp.2", NULL),
+       INIT_CLKREG(&clk_pxa25x_pwm0, "pxa25x-pwm.0", NULL),
+       INIT_CLKREG(&clk_pxa25x_pwm1, "pxa25x-pwm.1", NULL),
+       INIT_CLKREG(&clk_pxa25x_i2s, "pxa2xx-i2s", NULL),
+       INIT_CLKREG(&clk_pxa25x_stuart, "pxa2xx-ir", "UARTCLK"),
+       INIT_CLKREG(&clk_pxa25x_ficp, "pxa2xx-ir", "FICPCLK"),
+       INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"),
+       INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"),
+       INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"),
 };
 
 #ifdef CONFIG_PM
@@ -336,7 +351,7 @@ static int __init pxa25x_init(void)
 
                reset_status = RCSR;
 
-               clks_register(pxa25x_clks, ARRAY_SIZE(pxa25x_clks));
+               clks_register(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs));
 
                if ((ret = pxa_init_dma(16)))
                        return ret;
@@ -357,7 +372,7 @@ static int __init pxa25x_init(void)
 
        /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */
        if (cpu_is_pxa255() || cpu_is_pxa26x()) {
-               clks_register(&pxa25x_hwuart_clk, 1);
+               clks_register(&pxa25x_hwuart_clkreg, 1);
                ret = platform_device_register(&pxa_device_hwuart);
        }
 
index 3e4ab2279c99b31c0a9b1c009d55543dc4a93fff..15c8e5b9f9bc9f5dad9a927a182bdab0c4651083 100644 (file)
@@ -144,40 +144,59 @@ static const struct clkops clk_pxa27x_lcd_ops = {
        .getrate        = clk_pxa27x_lcd_getrate,
 };
 
-static struct clk pxa27x_clks[] = {
-       INIT_CK("LCDCLK", LCD,    &clk_pxa27x_lcd_ops, &pxa_device_fb.dev),
-       INIT_CK("CAMCLK", CAMERA, &clk_pxa27x_lcd_ops, NULL),
-
-       INIT_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
-       INIT_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
-       INIT_CKEN("UARTCLK", STUART, 14857000, 1, NULL),
-
-       INIT_CKEN("I2SCLK",  I2S,  14682000, 0, &pxa_device_i2s.dev),
-       INIT_CKEN("I2CCLK",  I2C,  32842000, 0, &pxa_device_i2c.dev),
-       INIT_CKEN("UDCCLK",  USB,  48000000, 5, &pxa27x_device_udc.dev),
-       INIT_CKEN("MMCCLK",  MMC,  19500000, 0, &pxa_device_mci.dev),
-       INIT_CKEN("FICPCLK", FICP, 48000000, 0, &pxa_device_ficp.dev),
-
-       INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev),
-       INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev),
-       INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev),
-
-       INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
-       INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
-       INIT_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev),
-       INIT_CKEN("PWMCLK", PWM0, 13000000, 0, &pxa27x_device_pwm0.dev),
-       INIT_CKEN("PWMCLK", PWM1, 13000000, 0, &pxa27x_device_pwm1.dev),
-
-       INIT_CKEN("AC97CLK",     AC97,     24576000, 0, NULL),
-       INIT_CKEN("AC97CONFCLK", AC97CONF, 24576000, 0, NULL),
-
-       /*
-       INIT_CKEN("MSLCLK",  MSL,  48000000, 0, NULL),
-       INIT_CKEN("USIMCLK", USIM, 48000000, 0, NULL),
-       INIT_CKEN("MSTKCLK", MEMSTK, 19500000, 0, NULL),
-       INIT_CKEN("IMCLK",   IM,   0, 0, NULL),
-       INIT_CKEN("MEMCLK",  MEMC, 0, 0, NULL),
-       */
+static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops);
+static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops);
+static DEFINE_CKEN(pxa27x_ffuart, FFUART, 14857000, 1);
+static DEFINE_CKEN(pxa27x_btuart, BTUART, 14857000, 1);
+static DEFINE_CKEN(pxa27x_stuart, STUART, 14857000, 1);
+static DEFINE_CKEN(pxa27x_i2s, I2S, 14682000, 0);
+static DEFINE_CKEN(pxa27x_i2c, I2C, 32842000, 0);
+static DEFINE_CKEN(pxa27x_usb, USB, 48000000, 5);
+static DEFINE_CKEN(pxa27x_mmc, MMC, 19500000, 0);
+static DEFINE_CKEN(pxa27x_ficp, FICP, 48000000, 0);
+static DEFINE_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0);
+static DEFINE_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0);
+static DEFINE_CKEN(pxa27x_keypad, KEYPAD, 32768, 0);
+static DEFINE_CKEN(pxa27x_ssp1, SSP1, 13000000, 0);
+static DEFINE_CKEN(pxa27x_ssp2, SSP2, 13000000, 0);
+static DEFINE_CKEN(pxa27x_ssp3, SSP3, 13000000, 0);
+static DEFINE_CKEN(pxa27x_pwm0, PWM0, 13000000, 0);
+static DEFINE_CKEN(pxa27x_pwm1, PWM1, 13000000, 0);
+static DEFINE_CKEN(pxa27x_ac97, AC97, 24576000, 0);
+static DEFINE_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0);
+static DEFINE_CKEN(pxa27x_msl, MSL, 48000000, 0);
+static DEFINE_CKEN(pxa27x_usim, USIM, 48000000, 0);
+static DEFINE_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0);
+static DEFINE_CKEN(pxa27x_im, IM, 0, 0);
+static DEFINE_CKEN(pxa27x_memc, MEMC, 0, 0);
+
+static struct clk_lookup pxa27x_clkregs[] = {
+       INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL),
+       INIT_CLKREG(&clk_pxa27x_camera, "pxa27x-camera.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_ffuart, "pxa2xx-uart.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_btuart, "pxa2xx-uart.1", NULL),
+       INIT_CLKREG(&clk_pxa27x_stuart, "pxa2xx-uart.2", NULL),
+       INIT_CLKREG(&clk_pxa27x_i2s, "pxa2xx-i2s", NULL),
+       INIT_CLKREG(&clk_pxa27x_i2c, "pxa2xx-i2c.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_usb, "pxa27x-udc", NULL),
+       INIT_CLKREG(&clk_pxa27x_mmc, "pxa2xx-mci.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_stuart, "pxa2xx-ir", "UARTCLK"),
+       INIT_CLKREG(&clk_pxa27x_ficp, "pxa2xx-ir", "FICPCLK"),
+       INIT_CLKREG(&clk_pxa27x_usbhost, "pxa27x-ohci", NULL),
+       INIT_CLKREG(&clk_pxa27x_pwri2c, "pxa2xx-i2c.1", NULL),
+       INIT_CLKREG(&clk_pxa27x_keypad, "pxa27x-keypad", NULL),
+       INIT_CLKREG(&clk_pxa27x_ssp1, "pxa27x-ssp.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_ssp2, "pxa27x-ssp.1", NULL),
+       INIT_CLKREG(&clk_pxa27x_ssp3, "pxa27x-ssp.2", NULL),
+       INIT_CLKREG(&clk_pxa27x_pwm0, "pxa27x-pwm.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_pwm1, "pxa27x-pwm.1", NULL),
+       INIT_CLKREG(&clk_pxa27x_ac97, NULL, "AC97CLK"),
+       INIT_CLKREG(&clk_pxa27x_ac97conf, NULL, "AC97CONFCLK"),
+       INIT_CLKREG(&clk_pxa27x_msl, NULL, "MSLCLK"),
+       INIT_CLKREG(&clk_pxa27x_usim, NULL, "USIMCLK"),
+       INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"),
+       INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"),
+       INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"),
 };
 
 #ifdef CONFIG_PM
@@ -380,7 +399,7 @@ static int __init pxa27x_init(void)
 
                reset_status = RCSR;
 
-               clks_register(pxa27x_clks, ARRAY_SIZE(pxa27x_clks));
+               clks_register(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs));
 
                if ((ret = pxa_init_dma(32)))
                        return ret;
index 9adc7fc4618aacb561ca6fe9a5ab02df5c942086..f735e58e666997c7c92cd985d812ba6197ea7f76 100644 (file)
@@ -85,14 +85,16 @@ static struct pxa3xx_mfp_addr_map pxa310_mfp_addr_map[] __initdata = {
        MFP_ADDR_END,
 };
 
-static struct clk common_clks[] = {
-       PXA3xx_CKEN("NANDCLK", NAND, 156000000, 0, &pxa3xx_device_nand.dev),
+static DEFINE_PXA3_CKEN(common_nand, NAND, 156000000, 0);
+
+static struct clk_lookup common_clkregs[] = {
+       INIT_CLKREG(&clk_common_nand, "pxa3xx-nand", "NANDCLK"),
 };
 
-static struct clk pxa310_clks[] = {
-#ifdef CONFIG_CPU_PXA310
-       PXA3xx_CKEN("MMCCLK", MMC3, 19500000, 0, &pxa3xx_device_mci3.dev),
-#endif
+static DEFINE_PXA3_CKEN(pxa310_mmc3, MMC3, 19500000, 0);
+
+static struct clk_lookup pxa310_clkregs[] = {
+       INIT_CLKREG(&clk_pxa310_mmc3, "pxa2xx-mci.2", "MMCCLK"),
 };
 
 static int __init pxa300_init(void)
@@ -100,12 +102,12 @@ static int __init pxa300_init(void)
        if (cpu_is_pxa300() || cpu_is_pxa310()) {
                pxa3xx_init_mfp();
                pxa3xx_mfp_init_addr(pxa300_mfp_addr_map);
-               clks_register(ARRAY_AND_SIZE(common_clks));
+               clks_register(ARRAY_AND_SIZE(common_clkregs));
        }
 
        if (cpu_is_pxa310()) {
                pxa3xx_mfp_init_addr(pxa310_mfp_addr_map);
-               clks_register(ARRAY_AND_SIZE(pxa310_clks));
+               clks_register(ARRAY_AND_SIZE(pxa310_clkregs));
        }
 
        return 0;
index 016eb18f01a3859dc89c1eeebe68900f568e46d5..effe408c186f24b648a02ef5114df14e91e91780 100644 (file)
@@ -80,8 +80,10 @@ static struct pxa3xx_mfp_addr_map pxa320_mfp_addr_map[] __initdata = {
        MFP_ADDR_END,
 };
 
-static struct clk pxa320_clks[] = {
-       PXA3xx_CKEN("NANDCLK", NAND, 104000000, 0, &pxa3xx_device_nand.dev),
+static DEFINE_PXA3_CKEN(pxa320_nand, NAND, 104000000, 0);
+
+static struct clk_lookup pxa320_clkregs[] = {
+       INIT_CLKREG(&clk_pxa320_nand, "pxa3xx-nand", "NANDCLK"),
 };
 
 static int __init pxa320_init(void)
@@ -89,7 +91,7 @@ static int __init pxa320_init(void)
        if (cpu_is_pxa320()) {
                pxa3xx_init_mfp();
                pxa3xx_mfp_init_addr(pxa320_mfp_addr_map);
-               clks_register(ARRAY_AND_SIZE(pxa320_clks));
+               clks_register(ARRAY_AND_SIZE(pxa320_clkregs));
        }
 
        return 0;
index b3cd5d0b0f353e970d58a9f02f49194b2c87529a..b7e53829d376748dbebce72a4417e76093a1b3b9 100644 (file)
@@ -216,43 +216,58 @@ static const struct clkops clk_dummy_ops = {
        .disable        = clk_dummy_disable,
 };
 
-static struct clk pxa3xx_clks[] = {
-       {
-               .name           = "CLK_POUT",
-               .ops            = &clk_pout_ops,
-               .rate           = 13000000,
-               .delay          = 70,
-       },
-
-       /* Power I2C clock is always on */
-       {
-               .name           = "I2CCLK",
-               .ops            = &clk_dummy_ops,
-               .dev            = &pxa3xx_device_i2c_power.dev,
-       },
-
-       PXA3xx_CK("LCDCLK",  LCD,    &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
-       PXA3xx_CK("CAMCLK",  CAMERA, &clk_pxa3xx_hsio_ops, NULL),
-       PXA3xx_CK("AC97CLK", AC97,   &clk_pxa3xx_ac97_ops, NULL),
-
-       PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
-       PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
-       PXA3xx_CKEN("UARTCLK", STUART, 14857000, 1, NULL),
-
-       PXA3xx_CKEN("I2CCLK", I2C,  32842000, 0, &pxa_device_i2c.dev),
-       PXA3xx_CKEN("UDCCLK", UDC,  48000000, 5, &pxa27x_device_udc.dev),
-       PXA3xx_CKEN("USBCLK", USBH, 48000000, 0, &pxa27x_device_ohci.dev),
-       PXA3xx_CKEN("KBDCLK", KEYPAD,  32768, 0, &pxa27x_device_keypad.dev),
+static struct clk clk_pxa3xx_pout = {
+       .ops            = &clk_pout_ops,
+       .rate           = 13000000,
+       .delay          = 70,
+};
 
-       PXA3xx_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
-       PXA3xx_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
-       PXA3xx_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev),
-       PXA3xx_CKEN("SSPCLK", SSP4, 13000000, 0, &pxa3xx_device_ssp4.dev),
-       PXA3xx_CKEN("PWMCLK", PWM0, 13000000, 0, &pxa27x_device_pwm0.dev),
-       PXA3xx_CKEN("PWMCLK", PWM1, 13000000, 0, &pxa27x_device_pwm1.dev),
+static struct clk clk_dummy = {
+       .ops            = &clk_dummy_ops,
+};
 
-       PXA3xx_CKEN("MMCCLK", MMC1, 19500000, 0, &pxa_device_mci.dev),
-       PXA3xx_CKEN("MMCCLK", MMC2, 19500000, 0, &pxa3xx_device_mci2.dev),
+static DEFINE_PXA3_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops);
+static DEFINE_PXA3_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops);
+static DEFINE_PXA3_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops);
+static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1);
+static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1);
+static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1);
+static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5);
+static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_ssp3, SSP3, 13000000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_ssp4, SSP4, 13000000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_pwm0, PWM0, 13000000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_pwm1, PWM1, 13000000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0);
+static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0);
+
+static struct clk_lookup pxa3xx_clkregs[] = {
+       INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"),
+       /* Power I2C clock is always on */
+       INIT_CLKREG(&clk_dummy, "pxa2xx-i2c.1", NULL),
+       INIT_CLKREG(&clk_pxa3xx_lcd, "pxa2xx-fb", NULL),
+       INIT_CLKREG(&clk_pxa3xx_camera, NULL, "CAMCLK"),
+       INIT_CLKREG(&clk_pxa3xx_ac97, NULL, "AC97CLK"),
+       INIT_CLKREG(&clk_pxa3xx_ffuart, "pxa2xx-uart.0", NULL),
+       INIT_CLKREG(&clk_pxa3xx_btuart, "pxa2xx-uart.1", NULL),
+       INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-uart.2", NULL),
+       INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-ir", "UARTCLK"),
+       INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL),
+       INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL),
+       INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL),
+       INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL),
+       INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL),
+       INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL),
+       INIT_CLKREG(&clk_pxa3xx_ssp3, "pxa27x-ssp.2", NULL),
+       INIT_CLKREG(&clk_pxa3xx_ssp4, "pxa27x-ssp.3", NULL),
+       INIT_CLKREG(&clk_pxa3xx_pwm0, "pxa27x-pwm.0", NULL),
+       INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL),
+       INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL),
+       INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL),
 };
 
 #ifdef CONFIG_PM
@@ -595,7 +610,7 @@ static int __init pxa3xx_init(void)
                 */
                ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
 
-               clks_register(pxa3xx_clks, ARRAY_SIZE(pxa3xx_clks));
+               clks_register(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs));
 
                if ((ret = pxa_init_dma(32)))
                        return ret;
index 2c31ec72568856019be0482d9dc4fa2a730dcb01..6f42004db3ed1fc398108ad35467cda4612838ae 100644 (file)
@@ -356,7 +356,7 @@ static int __devinit ssp_probe(struct platform_device *pdev, int type)
        }
        ssp->pdev = pdev;
 
-       ssp->clk = clk_get(&pdev->dev, "SSPCLK");
+       ssp->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(ssp->clk)) {
                ret = PTR_ERR(ssp->clk);
                goto err_free;
index 5ccde7cf39e868ce129c4f4fc204903d1f72f6d8..603d1db9baf05b11cdaedecdea6a019da428c2e4 100644 (file)
@@ -10,6 +10,7 @@ config MACH_REALVIEW_EB
 config REALVIEW_EB_ARM11MP
        bool "Support ARM11MPCore tile"
        depends on MACH_REALVIEW_EB
+       select CPU_V6
        help
          Enable support for the ARM11MPCore tile on the Realview platform.
 
@@ -33,6 +34,7 @@ config MACH_REALVIEW_PB11MP
 
 config MACH_REALVIEW_PB1176
        bool "Support RealView/PB1176 platform"
+       select CPU_V6
        select ARM_GIC
        help
          Include support for the ARM(R) RealView ARM1176 Platform Baseboard.
index 3347c4236a60bd6cb2b34cbadc09d0d966614ebf..a7043115de72638022aefa73f7a829a49e515302 100644 (file)
  */
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/device.h>
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/err.h>
+#include <linux/string.h>
 #include <linux/clk.h>
 #include <linux/mutex.h>
 
 
 #include "clock.h"
 
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
-
-struct clk *clk_get(struct device *dev, const char *id)
-{
-       struct clk *p, *clk = ERR_PTR(-ENOENT);
-
-       mutex_lock(&clocks_mutex);
-       list_for_each_entry(p, &clocks, node) {
-               if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
-                       clk = p;
-                       break;
-               }
-       }
-       mutex_unlock(&clocks_mutex);
-
-       return clk;
-}
-EXPORT_SYMBOL(clk_get);
-
-void clk_put(struct clk *clk)
-{
-       module_put(clk->owner);
-}
-EXPORT_SYMBOL(clk_put);
-
 int clk_enable(struct clk *clk)
 {
        return 0;
@@ -65,7 +41,9 @@ EXPORT_SYMBOL(clk_get_rate);
 
 long clk_round_rate(struct clk *clk, unsigned long rate)
 {
-       return rate;
+       struct icst307_vco vco;
+       vco = icst307_khz_to_vco(clk->params, rate / 1000);
+       return icst307_khz(clk->params, vco) * 1000;
 }
 EXPORT_SYMBOL(clk_round_rate);
 
@@ -78,57 +56,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 
                vco = icst307_khz_to_vco(clk->params, rate / 1000);
                clk->rate = icst307_khz(clk->params, vco) * 1000;
-
-               printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n",
-                       clk->name, vco.s, vco.r, vco.v);
-
                clk->setvco(clk, vco);
                ret = 0;
        }
        return ret;
 }
 EXPORT_SYMBOL(clk_set_rate);
-
-/*
- * These are fixed clocks.
- */
-static struct clk kmi_clk = {
-       .name   = "KMIREFCLK",
-       .rate   = 24000000,
-};
-
-static struct clk uart_clk = {
-       .name   = "UARTCLK",
-       .rate   = 24000000,
-};
-
-static struct clk mmci_clk = {
-       .name   = "MCLK",
-       .rate   = 24000000,
-};
-
-int clk_register(struct clk *clk)
-{
-       mutex_lock(&clocks_mutex);
-       list_add(&clk->node, &clocks);
-       mutex_unlock(&clocks_mutex);
-       return 0;
-}
-EXPORT_SYMBOL(clk_register);
-
-void clk_unregister(struct clk *clk)
-{
-       mutex_lock(&clocks_mutex);
-       list_del(&clk->node);
-       mutex_unlock(&clocks_mutex);
-}
-EXPORT_SYMBOL(clk_unregister);
-
-static int __init clk_init(void)
-{
-       clk_register(&kmi_clk);
-       clk_register(&uart_clk);
-       clk_register(&mmci_clk);
-       return 0;
-}
-arch_initcall(clk_init);
index dadba695e181dd18f572d6af6140427195205c54..ebbb0f06b6007860802116670fe8dca9e2fb2e4e 100644 (file)
@@ -12,14 +12,8 @@ struct module;
 struct icst307_params;
 
 struct clk {
-       struct list_head        node;
        unsigned long           rate;
-       struct module           *owner;
-       const char              *name;
        const struct icst307_params *params;
        void                    *data;
        void                    (*setvco)(struct clk *, struct icst307_vco vco);
 };
-
-int clk_register(struct clk *clk);
-void clk_unregister(struct clk *clk);
index 2f04d54711e7b86ad204a0916ba012e5234d91fd..2491374818e978322aedb16cecba419183e49f25 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/clockchips.h>
 #include <linux/io.h>
 
+#include <asm/clkdev.h>
 #include <asm/system.h>
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -188,12 +189,59 @@ static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco)
        writel(0, sys_lock);
 }
 
-struct clk realview_clcd_clk = {
-       .name   = "CLCDCLK",
+static struct clk oscvco_clk = {
        .params = &realview_oscvco_params,
        .setvco = realview_oscvco_set,
 };
 
+/*
+ * These are fixed clocks.
+ */
+static struct clk ref24_clk = {
+       .rate   = 24000000,
+};
+
+static struct clk_lookup lookups[] = {
+       {       /* UART0 */
+               .dev_id         = "dev:f1",
+               .clk            = &ref24_clk,
+       }, {    /* UART1 */
+               .dev_id         = "dev:f2",
+               .clk            = &ref24_clk,
+       }, {    /* UART2 */
+               .dev_id         = "dev:f3",
+               .clk            = &ref24_clk,
+       }, {    /* UART3 */
+               .dev_id         = "fpga:09",
+               .clk            = &ref24_clk,
+       }, {    /* KMI0 */
+               .dev_id         = "fpga:06",
+               .clk            = &ref24_clk,
+       }, {    /* KMI1 */
+               .dev_id         = "fpga:07",
+               .clk            = &ref24_clk,
+       }, {    /* MMC0 */
+               .dev_id         = "fpga:05",
+               .clk            = &ref24_clk,
+       }, {    /* EB:CLCD */
+               .dev_id         = "dev:20",
+               .clk            = &oscvco_clk,
+       }, {    /* PB:CLCD */
+               .dev_id         = "issp:20",
+               .clk            = &oscvco_clk,
+       }
+};
+
+static int __init clk_init(void)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(lookups); i++)
+               clkdev_add(&lookups[i]);
+       return 0;
+}
+arch_initcall(clk_init);
+
 /*
  * CLCD support.
  */
index 3cea92c70d8f1df407e3b7f10da4d0470ab5ee0d..614e8cb31713a6483f9106a83fd82f0cbd0781ae 100644 (file)
@@ -48,7 +48,6 @@ extern struct platform_device realview_flash_device;
 extern struct platform_device realview_i2c_device;
 extern struct mmc_platform_data realview_mmc0_plat_data;
 extern struct mmc_platform_data realview_mmc1_plat_data;
-extern struct clk realview_clcd_clk;
 extern struct clcd_board clcd_plat_data;
 extern void __iomem *gic_cpu_base_addr;
 #ifdef CONFIG_LOCAL_TIMERS
diff --git a/arch/arm/mach-realview/include/mach/clkdev.h b/arch/arm/mach-realview/include/mach/clkdev.h
new file mode 100644 (file)
index 0000000..04b37a8
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
index eb829eb1ebe29dceb394952205fae68e52575c47..3420e2e719e6ae7630eb8bca18fd7133c4ca2d6f 100644 (file)
@@ -372,8 +372,6 @@ static void __init realview_eb_init(void)
 #endif
        }
 
-       clk_register(&realview_clcd_clk);
-
        realview_flash_register(&realview_eb_flash_resource, 1);
        platform_device_register(&realview_i2c_device);
        eth_device_register();
index cccdb3eb90fe94e0a41ffb6e30171759a6a3fe53..0481416d37c947238a370f8a1328393d2f005384 100644 (file)
@@ -265,8 +265,6 @@ static void __init realview_pb1176_init(void)
        l2x0_init(__io_address(REALVIEW_PB1176_L220_BASE), 0x00730000, 0xfe000fff);
 #endif
 
-       clk_register(&realview_clcd_clk);
-
        realview_flash_register(&realview_pb1176_flash_resource, 1);
        platform_device_register(&realview_pb1176_smsc911x_device);
 
index 8b863148ec18b2b55f3571aa713d3bb787630ed5..6197dd8e8edf8a509d0ec021b6483e2af1cef7ff 100644 (file)
@@ -312,8 +312,6 @@ static void __init realview_pb11mp_init(void)
        l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE), 0x00790000, 0xfe000fff);
 #endif
 
-       clk_register(&realview_clcd_clk);
-
        realview_flash_register(realview_pb11mp_flash_resource,
                                ARRAY_SIZE(realview_pb11mp_flash_resource));
        platform_device_register(&realview_pb11mp_smsc911x_device);
index 99fdc736698c25c2428aa6ede50a759b718d84b3..7315569fbfd7736184cb048aeb4f9f195bf4b61c 100644 (file)
@@ -7,6 +7,7 @@
 config CPU_S3C2410
        bool
        depends on ARCH_S3C2410
+       select CPU_ARM920T
        select S3C2410_CLOCK
        select S3C2410_GPIO
        select CPU_LLSERIAL_S3C2410
index c59a9d2ee9a642c355d9a092bc4e738053ba5784..ca99564ae4b56c917a73a48dd357244c2d3fe654 100644 (file)
@@ -7,6 +7,7 @@
 config CPU_S3C2412
        bool
        depends on ARCH_S3C2410
+       select CPU_ARM926T
        select CPU_LLSERIAL_S3C2440
        select S3C2412_PM if PM
        select S3C2412_DMA if S3C2410_DMA
index 25de042ab9961745e1f125d56c2d070392a1ea1d..0429d255b0d83eecdd64a05868ce6184b1b98ae0 100644 (file)
@@ -7,6 +7,7 @@
 config CPU_S3C2440
        bool
        depends on ARCH_S3C2410
+       select CPU_ARM920T
        select S3C2410_CLOCK
        select S3C2410_PM if PM
        select S3C2410_GPIO
index 26d131a77074ae7efe431099491b1ade31738109..b289d198020e0c180bb5bbe8fa77df8934305f06 100644 (file)
@@ -7,6 +7,7 @@
 config CPU_S3C2442
        bool
        depends on ARCH_S3C2410
+       select CPU_ARM920T
        select S3C2410_CLOCK
        select S3C2410_GPIO
        select S3C2410_PM if PM
index 43c30f84abf2b05c6a6212948bb4069d0f5904ea..dab3c6347a8f2d8e80bafba18b6916f8f97161f9 100644 (file)
@@ -3,6 +3,7 @@
  */
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/device.h>
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <mach/hardware.h>
 
 /*
- * Very simple clock implementation - we only have one clock to
- * deal with at the moment, so we only match using the "name".
+ * Very simple clock implementation - we only have one clock to deal with.
  */
 struct clk {
-       struct list_head        node;
-       unsigned long           rate;
-       const char              *name;
        unsigned int            enabled;
-       void                    (*enable)(void);
-       void                    (*disable)(void);
 };
 
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
+static void clk_gpio27_enable(void)
+{
+       /*
+        * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111:
+        * (SA-1110 Developer's Manual, section 9.1.2.1)
+        */
+       GAFR |= GPIO_32_768kHz;
+       GPDR |= GPIO_32_768kHz;
+       TUCR = TUCR_3_6864MHz;
+}
+
+static void clk_gpio27_disable(void)
+{
+       TUCR = 0;
+       GPDR &= ~GPIO_32_768kHz;
+       GAFR &= ~GPIO_32_768kHz;
+}
+
+static struct clk clk_gpio27;
+
 static DEFINE_SPINLOCK(clocks_lock);
 
 struct clk *clk_get(struct device *dev, const char *id)
 {
-       struct clk *p, *clk = ERR_PTR(-ENOENT);
-
-       mutex_lock(&clocks_mutex);
-       list_for_each_entry(p, &clocks, node) {
-               if (strcmp(id, p->name) == 0) {
-                       clk = p;
-                       break;
-               }
-       }
-       mutex_unlock(&clocks_mutex);
+       const char *devname = dev_name(dev);
 
-       return clk;
+       return strcmp(devname, "sa1111.0") ? ERR_PTR(-ENOENT) : &clk_gpio27;
 }
 EXPORT_SYMBOL(clk_get);
 
@@ -58,7 +62,7 @@ int clk_enable(struct clk *clk)
 
        spin_lock_irqsave(&clocks_lock, flags);
        if (clk->enabled++ == 0)
-               clk->enable();
+               clk_gpio27_enable();
        spin_unlock_irqrestore(&clocks_lock, flags);
        return 0;
 }
@@ -72,63 +76,13 @@ void clk_disable(struct clk *clk)
 
        spin_lock_irqsave(&clocks_lock, flags);
        if (--clk->enabled == 0)
-               clk->disable();
+               clk_gpio27_disable();
        spin_unlock_irqrestore(&clocks_lock, flags);
 }
 EXPORT_SYMBOL(clk_disable);
 
 unsigned long clk_get_rate(struct clk *clk)
 {
-       return clk->rate;
+       return 3686400;
 }
 EXPORT_SYMBOL(clk_get_rate);
-
-
-static void clk_gpio27_enable(void)
-{
-       /*
-        * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111:
-        * (SA-1110 Developer's Manual, section 9.1.2.1)
-        */
-       GAFR |= GPIO_32_768kHz;
-       GPDR |= GPIO_32_768kHz;
-       TUCR = TUCR_3_6864MHz;
-}
-
-static void clk_gpio27_disable(void)
-{
-       TUCR = 0;
-       GPDR &= ~GPIO_32_768kHz;
-       GAFR &= ~GPIO_32_768kHz;
-}
-
-static struct clk clk_gpio27 = {
-       .name           = "SA1111_CLK",
-       .rate           = 3686400,
-       .enable         = clk_gpio27_enable,
-       .disable        = clk_gpio27_disable,
-};
-
-int clk_register(struct clk *clk)
-{
-       mutex_lock(&clocks_mutex);
-       list_add(&clk->node, &clocks);
-       mutex_unlock(&clocks_mutex);
-       return 0;
-}
-EXPORT_SYMBOL(clk_register);
-
-void clk_unregister(struct clk *clk)
-{
-       mutex_lock(&clocks_mutex);
-       list_del(&clk->node);
-       mutex_unlock(&clocks_mutex);
-}
-EXPORT_SYMBOL(clk_unregister);
-
-static int __init clk_init(void)
-{
-       clk_register(&clk_gpio27);
-       return 0;
-}
-arch_initcall(clk_init);
index 95096afd527154665468168c5cf3928375cff085..c781f30c8368a0d9dc4f33f271f91121f08c29fc 100644 (file)
@@ -3,12 +3,14 @@ menu "Versatile platform type"
 
 config ARCH_VERSATILE_PB
        bool "Support Versatile/PB platform"
+       select CPU_ARM926T
        default y
        help
          Include support for the ARM(R) Versatile/PB platform.
 
 config MACH_VERSATILE_AB
        bool "Support Versatile/AB platform"
+       select CPU_ARM926T
        help
          Include support for the ARM(R) Versatile/AP platform.
 
index 58937f1fb38ce7b4d805f86771d1ccdac9383457..c50a44ea7ee6d4c3fa947f53062373092d417455 100644 (file)
@@ -10,6 +10,7 @@
  */
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/device.h>
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/mutex.h>
 
+#include <asm/clkdev.h>
 #include <asm/hardware/icst307.h>
 
 #include "clock.h"
 
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
-
-struct clk *clk_get(struct device *dev, const char *id)
-{
-       struct clk *p, *clk = ERR_PTR(-ENOENT);
-
-       mutex_lock(&clocks_mutex);
-       list_for_each_entry(p, &clocks, node) {
-               if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
-                       clk = p;
-                       break;
-               }
-       }
-       mutex_unlock(&clocks_mutex);
-
-       return clk;
-}
-EXPORT_SYMBOL(clk_get);
-
-void clk_put(struct clk *clk)
-{
-       module_put(clk->owner);
-}
-EXPORT_SYMBOL(clk_put);
-
 int clk_enable(struct clk *clk)
 {
        return 0;
@@ -66,7 +42,9 @@ EXPORT_SYMBOL(clk_get_rate);
 
 long clk_round_rate(struct clk *clk, unsigned long rate)
 {
-       return rate;
+       struct icst307_vco vco;
+       vco = icst307_khz_to_vco(clk->params, rate / 1000);
+       return icst307_khz(clk->params, vco) * 1000;
 }
 EXPORT_SYMBOL(clk_round_rate);
 
@@ -79,57 +57,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 
                vco = icst307_khz_to_vco(clk->params, rate / 1000);
                clk->rate = icst307_khz(clk->params, vco) * 1000;
-
-               printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n",
-                       clk->name, vco.s, vco.r, vco.v);
-
                clk->setvco(clk, vco);
                ret = 0;
        }
        return ret;
 }
 EXPORT_SYMBOL(clk_set_rate);
-
-/*
- * These are fixed clocks.
- */
-static struct clk kmi_clk = {
-       .name   = "KMIREFCLK",
-       .rate   = 24000000,
-};
-
-static struct clk uart_clk = {
-       .name   = "UARTCLK",
-       .rate   = 24000000,
-};
-
-static struct clk mmci_clk = {
-       .name   = "MCLK",
-       .rate   = 24000000,
-};
-
-int clk_register(struct clk *clk)
-{
-       mutex_lock(&clocks_mutex);
-       list_add(&clk->node, &clocks);
-       mutex_unlock(&clocks_mutex);
-       return 0;
-}
-EXPORT_SYMBOL(clk_register);
-
-void clk_unregister(struct clk *clk)
-{
-       mutex_lock(&clocks_mutex);
-       list_del(&clk->node);
-       mutex_unlock(&clocks_mutex);
-}
-EXPORT_SYMBOL(clk_unregister);
-
-static int __init clk_init(void)
-{
-       clk_register(&kmi_clk);
-       clk_register(&uart_clk);
-       clk_register(&mmci_clk);
-       return 0;
-}
-arch_initcall(clk_init);
index 8b0b61dd17e43389b587c6e118e72812ebc16b30..03468fdc3e58f7b1fc4a8071d5cd1234678ebbb8 100644 (file)
@@ -12,14 +12,9 @@ struct module;
 struct icst307_params;
 
 struct clk {
-       struct list_head        node;
        unsigned long           rate;
-       struct module           *owner;
-       const char              *name;
        const struct icst307_params *params;
+       u32                     oscoff;
        void                    *data;
        void                    (*setvco)(struct clk *, struct icst307_vco vco);
 };
-
-int clk_register(struct clk *clk);
-void clk_unregister(struct clk *clk);
index 565e0ba0d67e082b9481f6008d065302a5b0042f..df25aa138509c95aec6dfcb391f8409de5b182a8 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/cnt32_to_63.h>
 #include <linux/io.h>
 
+#include <asm/clkdev.h>
 #include <asm/system.h>
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -373,22 +374,60 @@ static const struct icst307_params versatile_oscvco_params = {
 
 static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco)
 {
-       void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET;
-       void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET;
+       void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
+       void __iomem *sys_lock = sys + VERSATILE_SYS_LOCK_OFFSET;
        u32 val;
 
-       val = readl(sys_osc) & ~0x7ffff;
+       val = readl(sys + clk->oscoff) & ~0x7ffff;
        val |= vco.v | (vco.r << 9) | (vco.s << 16);
 
        writel(0xa05f, sys_lock);
-       writel(val, sys_osc);
+       writel(val, sys + clk->oscoff);
        writel(0, sys_lock);
 }
 
-static struct clk versatile_clcd_clk = {
-       .name   = "CLCDCLK",
+static struct clk osc4_clk = {
        .params = &versatile_oscvco_params,
-       .setvco = versatile_oscvco_set,
+       .oscoff = VERSATILE_SYS_OSCCLCD_OFFSET,
+       .setvco = versatile_oscvco_set,
+};
+
+/*
+ * These are fixed clocks.
+ */
+static struct clk ref24_clk = {
+       .rate   = 24000000,
+};
+
+static struct clk_lookup lookups[] __initdata = {
+       {       /* UART0 */
+               .dev_id         = "dev:f1",
+               .clk            = &ref24_clk,
+       }, {    /* UART1 */
+               .dev_id         = "dev:f2",
+               .clk            = &ref24_clk,
+       }, {    /* UART2 */
+               .dev_id         = "dev:f3",
+               .clk            = &ref24_clk,
+       }, {    /* UART3 */
+               .dev_id         = "fpga:09",
+               .clk            = &ref24_clk,
+       }, {    /* KMI0 */
+               .dev_id         = "fpga:06",
+               .clk            = &ref24_clk,
+       }, {    /* KMI1 */
+               .dev_id         = "fpga:07",
+               .clk            = &ref24_clk,
+       }, {    /* MMC0 */
+               .dev_id         = "fpga:05",
+               .clk            = &ref24_clk,
+       }, {    /* MMC1 */
+               .dev_id         = "fpga:0b",
+               .clk            = &ref24_clk,
+       }, {    /* CLCD */
+               .dev_id         = "dev:20",
+               .clk            = &osc4_clk,
+       }
 };
 
 /*
@@ -786,7 +825,8 @@ void __init versatile_init(void)
 {
        int i;
 
-       clk_register(&versatile_clcd_clk);
+       for (i = 0; i < ARRAY_SIZE(lookups); i++)
+               clkdev_add(&lookups[i]);
 
        platform_device_register(&versatile_flash_device);
        platform_device_register(&versatile_i2c_device);
diff --git a/arch/arm/mach-versatile/include/mach/clkdev.h b/arch/arm/mach-versatile/include/mach/clkdev.h
new file mode 100644 (file)
index 0000000..04b37a8
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
index ab5f7a21350b3af41bd6a227d1920f09c8091ed1..cf44de512830099998279173c38598fedc3e6ff7 100644 (file)
@@ -10,8 +10,7 @@ config CPU_32
 
 # ARM610
 config CPU_ARM610
-       bool "Support ARM610 processor"
-       depends on ARCH_RPC
+       bool "Support ARM610 processor" if ARCH_RPC
        select CPU_32v3
        select CPU_CACHE_V3
        select CPU_CACHE_VIVT
@@ -43,8 +42,7 @@ config CPU_ARM7TDMI
 
 # ARM710
 config CPU_ARM710
-       bool "Support ARM710 processor" if !ARCH_CLPS7500 && ARCH_RPC
-       default y if ARCH_CLPS7500
+       bool "Support ARM710 processor" if ARCH_RPC
        select CPU_32v3
        select CPU_CACHE_V3
        select CPU_CACHE_VIVT
@@ -63,8 +61,7 @@ config CPU_ARM710
 
 # ARM720T
 config CPU_ARM720T
-       bool "Support ARM720T processor" if !ARCH_CLPS711X && !ARCH_L7200 && !ARCH_CDB89712 && ARCH_INTEGRATOR
-       default y if ARCH_CLPS711X || ARCH_L7200 || ARCH_CDB89712 || ARCH_H720X
+       bool "Support ARM720T processor" if ARCH_INTEGRATOR
        select CPU_32v4T
        select CPU_ABRT_LV4T
        select CPU_PABRT_NOIFAR
@@ -114,9 +111,7 @@ config CPU_ARM9TDMI
 
 # ARM920T
 config CPU_ARM920T
-       bool "Support ARM920T processor"
-       depends on ARCH_EP93XX || ARCH_INTEGRATOR || CPU_S3C2410 || CPU_S3C2440 || CPU_S3C2442 || ARCH_IMX || ARCH_AAEC2000 || ARCH_AT91RM9200
-       default y if CPU_S3C2410 || CPU_S3C2440 || CPU_S3C2442 || ARCH_AT91RM9200
+       bool "Support ARM920T processor" if ARCH_INTEGRATOR
        select CPU_32v4T
        select CPU_ABRT_EV4T
        select CPU_PABRT_NOIFAR
@@ -138,8 +133,6 @@ config CPU_ARM920T
 # ARM922T
 config CPU_ARM922T
        bool "Support ARM922T processor" if ARCH_INTEGRATOR
-       depends on ARCH_LH7A40X || ARCH_INTEGRATOR || ARCH_KS8695
-       default y if ARCH_LH7A40X || ARCH_KS8695
        select CPU_32v4T
        select CPU_ABRT_EV4T
        select CPU_PABRT_NOIFAR
@@ -159,8 +152,6 @@ config CPU_ARM922T
 # ARM925T
 config CPU_ARM925T
        bool "Support ARM925T processor" if ARCH_OMAP1
-       depends on ARCH_OMAP15XX
-       default y if ARCH_OMAP15XX
        select CPU_32v4T
        select CPU_ABRT_EV4T
        select CPU_PABRT_NOIFAR
@@ -179,22 +170,7 @@ config CPU_ARM925T
 
 # ARM926T
 config CPU_ARM926T
-       bool "Support ARM926T processor"
-       depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || \
-               MACH_VERSATILE_AB || ARCH_OMAP730 || \
-               ARCH_OMAP16XX || MACH_REALVIEW_EB || \
-               ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || \
-               ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || \
-               ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || \
-               ARCH_AT91SAM9G20 || ARCH_AT91CAP9 || \
-               ARCH_NS9XXX || ARCH_DAVINCI || ARCH_MX2
-       default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || \
-               ARCH_OMAP730 || ARCH_OMAP16XX || \
-               ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || \
-               ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || \
-               ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || \
-               ARCH_AT91SAM9G20 || ARCH_AT91CAP9 || \
-               ARCH_NS9XXX || ARCH_DAVINCI || ARCH_MX2
+       bool "Support ARM926T processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB
        select CPU_32v5
        select CPU_ABRT_EV5TJ
        select CPU_PABRT_NOIFAR
@@ -247,8 +223,7 @@ config CPU_ARM946E
 
 # ARM1020 - needs validating
 config CPU_ARM1020
-       bool "Support ARM1020T (rev 0) processor"
-       depends on ARCH_INTEGRATOR
+       bool "Support ARM1020T (rev 0) processor" if ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV4T
        select CPU_PABRT_NOIFAR
@@ -266,8 +241,7 @@ config CPU_ARM1020
 
 # ARM1020E - needs validating
 config CPU_ARM1020E
-       bool "Support ARM1020E processor"
-       depends on ARCH_INTEGRATOR
+       bool "Support ARM1020E processor" if ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV4T
        select CPU_PABRT_NOIFAR
@@ -280,8 +254,7 @@ config CPU_ARM1020E
 
 # ARM1022E
 config CPU_ARM1022
-       bool "Support ARM1022E processor"
-       depends on ARCH_INTEGRATOR
+       bool "Support ARM1022E processor" if ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV4T
        select CPU_PABRT_NOIFAR
@@ -299,8 +272,7 @@ config CPU_ARM1022
 
 # ARM1026EJ-S
 config CPU_ARM1026
-       bool "Support ARM1026EJ-S processor"
-       depends on ARCH_INTEGRATOR
+       bool "Support ARM1026EJ-S processor" if ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10
        select CPU_PABRT_NOIFAR
@@ -317,8 +289,7 @@ config CPU_ARM1026
 
 # SA110
 config CPU_SA110
-       bool "Support StrongARM(R) SA-110 processor" if !ARCH_EBSA110 && !FOOTBRIDGE && !ARCH_TBOX && !ARCH_SHARK && !ARCH_NEXUSPCI && ARCH_RPC
-       default y if ARCH_EBSA110 || FOOTBRIDGE || ARCH_TBOX || ARCH_SHARK || ARCH_NEXUSPCI
+       bool "Support StrongARM(R) SA-110 processor" if ARCH_RPC
        select CPU_32v3 if ARCH_RPC
        select CPU_32v4 if !ARCH_RPC
        select CPU_ABRT_EV4
@@ -340,8 +311,6 @@ config CPU_SA110
 # SA1100
 config CPU_SA1100
        bool
-       depends on ARCH_SA1100
-       default y
        select CPU_32v4
        select CPU_ABRT_EV4
        select CPU_PABRT_NOIFAR
@@ -353,8 +322,6 @@ config CPU_SA1100
 # XScale
 config CPU_XSCALE
        bool
-       depends on ARCH_IOP32X || ARCH_IOP33X || PXA25x || PXA27x || ARCH_IXP4XX || ARCH_IXP2000
-       default y
        select CPU_32v5
        select CPU_ABRT_EV5T
        select CPU_PABRT_NOIFAR
@@ -365,8 +332,6 @@ config CPU_XSCALE
 # XScale Core Version 3
 config CPU_XSC3
        bool
-       depends on ARCH_IXP23XX || ARCH_IOP13XX || PXA3xx
-       default y
        select CPU_32v5
        select CPU_ABRT_EV5T
        select CPU_PABRT_NOIFAR
@@ -378,8 +343,6 @@ config CPU_XSC3
 # Feroceon
 config CPU_FEROCEON
        bool
-       depends on ARCH_ORION5X || ARCH_LOKI || ARCH_KIRKWOOD || ARCH_MV78XX0
-       default y
        select CPU_32v5
        select CPU_ABRT_EV5T
        select CPU_PABRT_NOIFAR
@@ -399,10 +362,7 @@ config CPU_FEROCEON_OLD_ID
 
 # ARMv6
 config CPU_V6
-       bool "Support ARM V6 processor"
-       depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP2 || ARCH_MX3 || ARCH_MSM || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176
-       default y if ARCH_MX3
-       default y if ARCH_MSM
+       bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB
        select CPU_32v6
        select CPU_ABRT_EV6
        select CPU_PABRT_NOIFAR
@@ -427,8 +387,7 @@ config CPU_32v6K
 
 # ARMv7
 config CPU_V7
-       bool "Support ARM V7 processor"
-       depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP3
+       bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB
        select CPU_32v6K
        select CPU_32v7
        select CPU_ABRT_EV7
index 7f36c825718d37e6f424c57d8e81e2547692a0e4..f24803c1fb0b7f067e525e0bee76c56705c50b9e 100644 (file)
@@ -896,7 +896,7 @@ void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
         * allocate the zero page.  Note that we count on this going ok.
         */
        zero_page = alloc_bootmem_low_pages(PAGE_SIZE);
-       memzero(zero_page, PAGE_SIZE);
+       memset(zero_page, 0, PAGE_SIZE);
        empty_zero_page = virt_to_page(zero_page);
        flush_dcache_page(empty_zero_page);
 }
index e0f19ab91163e589562d7b070f29d673fc9ef33f..2690146161ba31e01236f6fe6d90d32e7bc76bf4 100644 (file)
@@ -31,7 +31,7 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
        if (!new_pgd)
                goto no_pgd;
 
-       memzero(new_pgd, FIRST_KERNEL_PGD_NR * sizeof(pgd_t));
+       memset(new_pgd, 0, FIRST_KERNEL_PGD_NR * sizeof(pgd_t));
 
        /*
         * Copy over the kernel and IO PGD entries
index b2a7e3fad117f44c97160c191ab8e34eff66dc0a..a1612958a59eb0f754ea86fcf835fd2ece52c62d 100644 (file)
@@ -8,11 +8,13 @@ choice
 
 config ARCH_MX2
        bool "MX2-based"
+       select CPU_ARM926T
        help
          This enables support for systems based on the Freescale i.MX2 family
 
 config ARCH_MX3
        bool "MX3-based"
+       select CPU_V6
        help
          This enables support for systems based on the Freescale i.MX3 family
 
index a94f0c44ebc8286b042f39a8de172c7d80eb4238..46d3b0b9ce696eaef46d895a37b7a694059dd554 100644 (file)
@@ -14,9 +14,11 @@ config ARCH_OMAP1
 
 config ARCH_OMAP2
        bool "TI OMAP2"
+       select CPU_V6
 
 config ARCH_OMAP3
        bool "TI OMAP3"
+       select CPU_V7
 
 endchoice
 
index 906f9b9d715d50af2c555424ae323effc74d05d9..587f5b2380d473677360fb187919ff65358e5bbd 100644 (file)
@@ -1016,7 +1016,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
        snprintf(i2c->adap.name, sizeof(i2c->adap.name), "pxa_i2c-i2c.%u",
                 i2c->adap.nr);
 
-       i2c->clk = clk_get(&dev->dev, "I2CCLK");
+       i2c->clk = clk_get(&dev->dev, NULL);
        if (IS_ERR(i2c->clk)) {
                ret = PTR_ERR(i2c->clk);
                goto eclk;
index 6d30c6d334c38eca442b3e2902e338a8230d3733..0d2fc64a5e1cead895be0a0c22cd96a500faf1c0 100644 (file)
@@ -475,7 +475,7 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev)
                goto failed_free_mem;
        }
 
-       keypad->clk = clk_get(&pdev->dev, "KBDCLK");
+       keypad->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(keypad->clk)) {
                dev_err(&pdev->dev, "failed to get keypad clock\n");
                error = PTR_ERR(keypad->clk);
index eb6be580292899ed8a6b5d0fa41b204f52d9f07d..6586f0b1336371a53a9ee936c0b8cbd270169905 100644 (file)
@@ -1071,7 +1071,7 @@ static int pxa_camera_probe(struct platform_device *pdev)
                goto exit;
        }
 
-       pcdev->clk = clk_get(&pdev->dev, "CAMCLK");
+       pcdev->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(pcdev->clk)) {
                err = PTR_ERR(pcdev->clk);
                goto exit_kfree;
index e4c0db4dc7b199cfad30f9f4e318c54bc31d0e61..9e485459f63b389c0a63a7139dcb18bbab6bba2e 100644 (file)
@@ -474,9 +474,9 @@ static __init int asic3_gpio_probe(struct platform_device *pdev,
        u16 dir_reg[ASIC3_NUM_GPIO_BANKS];
        int i;
 
-       memzero(alt_reg, ASIC3_NUM_GPIO_BANKS * sizeof(u16));
-       memzero(out_reg, ASIC3_NUM_GPIO_BANKS * sizeof(u16));
-       memzero(dir_reg, ASIC3_NUM_GPIO_BANKS * sizeof(u16));
+       memset(alt_reg, 0, ASIC3_NUM_GPIO_BANKS * sizeof(u16));
+       memset(out_reg, 0, ASIC3_NUM_GPIO_BANKS * sizeof(u16));
+       memset(dir_reg, 0, ASIC3_NUM_GPIO_BANKS * sizeof(u16));
 
        /* Enable all GPIOs */
        asic3_write_register(asic, ASIC3_GPIO_OFFSET(A, MASK), 0xffff);
index ebfaa99609394b14d47d3028cb5b6bc393608409..a1700a80e2fddb82a854fcda4cbe52c32bbd798c 100644 (file)
@@ -533,7 +533,7 @@ static int pxamci_probe(struct platform_device *pdev)
        host->pdata = pdev->dev.platform_data;
        host->clkrt = CLKRT_OFF;
 
-       host->clk = clk_get(&pdev->dev, "MMCCLK");
+       host->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(host->clk)) {
                ret = PTR_ERR(host->clk);
                host->clk = NULL;
index dcdb1f17577db3ba909219ef7160744abb8040b8..3ea1de9be7203aedb92ae1014db058eba4d3620e 100644 (file)
@@ -170,7 +170,7 @@ static int ixp2000_flash_probe(struct platform_device *dev)
                err = -ENOMEM;
                goto Error;
        }
-       memzero(info, sizeof(struct ixp2000_flash_info));
+       memset(info, 0, sizeof(struct ixp2000_flash_info));
 
        platform_set_drvdata(dev, info);
 
index 9c7a5fbd4e512e93c58de1f08ee2d2b388ca8af7..16555cbeaea4572e383189ea88f3f153338431b8 100644 (file)
@@ -201,7 +201,7 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
                err = -ENOMEM;
                goto Error;
        }
-       memzero(info, sizeof(struct ixp4xx_flash_info));
+       memset(info, 0, sizeof(struct ixp4xx_flash_info));
 
        platform_set_drvdata(dev, info);
 
index c0fa9c9edf089c1a039ded475fb13740cfa52d1f..61c922a8356fc9b985b89b4f7ae72940d2a63b4b 100644 (file)
@@ -1079,7 +1079,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
        this = &info->nand_chip;
        mtd->priv = info;
 
-       info->clk = clk_get(&pdev->dev, "NANDCLK");
+       info->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(info->clk)) {
                dev_err(&pdev->dev, "failed to get nand clock\n");
                ret = PTR_ERR(info->clk);
index 556139ed1fdf8b50919dfa078fe74a98626008d6..bc9aa64bf187000c7bb2e3dd431a57cc810b62a8 100644 (file)
@@ -818,7 +818,7 @@ static int s3c24xx_nand_probe(struct platform_device *pdev,
                goto exit_error;
        }
 
-       memzero(info, sizeof(*info));
+       memset(info, 0, sizeof(*info));
        platform_set_drvdata(pdev, info);
 
        spin_lock_init(&info->controller.lock);
@@ -883,7 +883,7 @@ static int s3c24xx_nand_probe(struct platform_device *pdev,
                goto exit_error;
        }
 
-       memzero(info->mtds, size);
+       memset(info->mtds, 0, size);
 
        /* initialise all possible chips */
 
index abc00be55433f428bba85a73bdb0e010d653d123..8ea314bc00c14474bfda45d8f3b4c90d3add1ef5 100644 (file)
@@ -766,7 +766,7 @@ static int serial_pxa_probe(struct platform_device *dev)
        if (!sport)
                return -ENOMEM;
 
-       sport->clk = clk_get(&dev->dev, "UARTCLK");
+       sport->clk = clk_get(&dev->dev, NULL);
        if (IS_ERR(sport->clk)) {
                ret = PTR_ERR(sport->clk);
                goto err_free;
index da6e93c201d20183b7d804591f880cf6005e6683..a4790f3c7cd3f7bcf758cab1440378466f4d4280 100644 (file)
@@ -2145,7 +2145,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
        if (irq < 0)
                return -ENODEV;
 
-       dev->clk = clk_get(&pdev->dev, "UDCCLK");
+       dev->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(dev->clk)) {
                retval = PTR_ERR(dev->clk);
                goto err_clk;
index caa37c95802c925ad9f9caff5f71071e69e22383..944e4ff641dfc68b814501dc5a92065593f71198 100644 (file)
@@ -2226,7 +2226,7 @@ static int __init pxa_udc_probe(struct platform_device *pdev)
        udc->dev = &pdev->dev;
        udc->mach = pdev->dev.platform_data;
 
-       udc->clk = clk_get(&pdev->dev, "UDCCLK");
+       udc->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(udc->clk)) {
                retval = PTR_ERR(udc->clk);
                goto err_clk;
index e294d430733b1b5e92a05cdc6cb837b41b067f8b..e44dc2cbca24006e1b81d57cf589213ee823295c 100644 (file)
@@ -296,7 +296,7 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device
                return -ENXIO;
        }
 
-       usb_clk = clk_get(&pdev->dev, "USBCLK");
+       usb_clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(usb_clk))
                return PTR_ERR(usb_clk);
 
index cc59c52e1103dfdd48cd161fb37a385023890b5a..0bc2c5a127b943365f3038cc2fbd83871a724275 100644 (file)
@@ -1429,7 +1429,7 @@ static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev)
        memset(fbi, 0, sizeof(struct pxafb_info));
        fbi->dev = dev;
 
-       fbi->clk = clk_get(dev, "LCDCLK");
+       fbi->clk = clk_get(dev, NULL);
        if (IS_ERR(fbi->clk)) {
                kfree(fbi);
                return NULL;
index c052bd4c0b0676c7d843ec5d465afed6fb56d1c8..076f946fa0f544dc611ff69d08be2ff3425e8ba2 100644 (file)
  *     - convert dma address types to dma_addr_t
  *     - remove unused 'montype' stuff
  *     - remove redundant zero inits of init_var after the initial
- *       memzero.
+ *       memset.
  *     - remove allow_modeset (acornfb idea does not belong here)
  *
  * 2001/05/28: <rmk@arm.linux.org.uk>