Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123548
b: refs/heads/master
c: 31bccbf
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Nov 27, 2008
1 parent 35377d3 commit 4a7e9ff
Show file tree
Hide file tree
Showing 70 changed files with 699 additions and 665 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 635f0258e5ae526034486b4ae9020e64bfb7d27e
refs/heads/master: 31bccbf39208133415000520c79ebe7b291786df
31 changes: 31 additions & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ choice

config ARCH_AAEC2000
bool "Agilent AAEC-2000 based"
select CPU_ARM920T
select ARM_AMBA
select HAVE_CLK
help
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -270,25 +277,29 @@ config ARCH_EP93XX

config ARCH_FOOTBRIDGE
bool "FootBridge"
select CPU_SA110
select FOOTBRIDGE
help
Support for systems based on the DC21285 companion chip
("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.

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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -329,20 +343,23 @@ 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.

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.

config ARCH_IXP4XX
bool "IXP4xx-based"
depends on MMU
select CPU_XSCALE
select GENERIC_GPIO
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
Expand All @@ -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
Expand All @@ -365,6 +383,7 @@ config ARCH_L7200

config ARCH_KIRKWOOD
bool "Marvell Kirkwood"
select CPU_FEROCEON
select PCI
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
Expand All @@ -375,13 +394,15 @@ 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
System-on-Chip devices.

config ARCH_NS9XXX
bool "NetSilicon NS9xxx"
select CPU_ARM926T
select GENERIC_GPIO
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
Expand All @@ -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
Expand All @@ -402,6 +424,7 @@ config ARCH_LOKI

config ARCH_MV78XX0
bool "Marvell MV78xx0"
select CPU_FEROCEON
select PCI
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand All @@ -491,6 +518,7 @@ config ARCH_S3C2410

config ARCH_SHARK
bool "Shark"
select CPU_SA110
select ISA
select ISA_DMA
select ZONE_DMA
Expand All @@ -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
Expand All @@ -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
Expand All @@ -532,6 +562,7 @@ config ARCH_OMAP

config ARCH_MSM
bool "Qualcomm MSM"
select CPU_V6
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
help
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/boot/compressed/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ config SHARPSL_PM

config SHARP_SCOOP
bool

config COMMON_CLKDEV
bool
1 change: 1 addition & 0 deletions trunk/arch/arm/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
128 changes: 128 additions & 0 deletions trunk/arch/arm/common/clkdev.c
Original file line number Diff line number Diff line change
@@ -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);
Loading

0 comments on commit 4a7e9ff

Please sign in to comment.