Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191787
b: refs/heads/master
c: 8834133
h: refs/heads/master
i:
  191785: 819c8a0
  191783: 81c148a
v: v3
  • Loading branch information
Will Deacon authored and Russell King committed Apr 29, 2010
1 parent 77909e1 commit 107546a
Show file tree
Hide file tree
Showing 43 changed files with 595 additions and 1,979 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: 2a847513cdecd517f7efc06296c539c3a936cf98
refs/heads/master: 883413341e479d4e9f9c69def4884b4c6e1cef4e
1 change: 0 additions & 1 deletion trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,6 @@ config ARCH_U8500
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
select COMMON_CLKDEV
select ARCH_REQUIRE_GPIOLIB
help
Support for ST-Ericsson's Ux500 architecture

Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/arm/include/asm/pmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
#ifndef __ARM_PMU_H__
#define __ARM_PMU_H__

enum arm_pmu_type {
ARM_PMU_DEVICE_CPU = 0,
ARM_NUM_PMU_DEVICES,
};

#ifdef CONFIG_CPU_HAS_PMU

struct pmu_irqs {
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/mach-nomadik/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ config MACH_NOMADIK_8815NHK
bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
select NOMADIK_8815
select HAS_MTU
select NOMADIK_GPIO

endmenu

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-nomadik/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Object file lists.

obj-y += clock.o
obj-y += clock.o gpio.o

# Cpu revision
obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o
Expand Down
10 changes: 9 additions & 1 deletion trunk/arch/arm/mach-nomadik/board-nhk8815.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <mach/setup.h>
#include <mach/nand.h>
#include <mach/fsmc.h>
#include "clock.h"

/* Initial value for SRC control register: all timers use MXTAL/8 source */
#define SRC_CR_INIT_MASK 0x00007fff
Expand Down Expand Up @@ -201,6 +202,11 @@ static struct amba_device *amba_devs[] __initdata = {
&uart1_device,
};

/* We have a fixed clock alone, by now */
static struct clk nhk8815_clk_48 = {
.rate = 48*1000*1000,
};

static struct resource nhk8815_eth_resources[] = {
{
.name = "smc91x-regs",
Expand Down Expand Up @@ -270,8 +276,10 @@ static void __init nhk8815_platform_init(void)
platform_add_devices(nhk8815_platform_devices,
ARRAY_SIZE(nhk8815_platform_devices));

for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
nmdk_clk_create(&nhk8815_clk_48, amba_devs[i]->dev.init_name);
amba_device_register(amba_devs[i], &iomem_resource);
}
}

MACHINE_START(NOMADIK, "NHK8815")
Expand Down
38 changes: 8 additions & 30 deletions trunk/arch/arm/mach-nomadik/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,14 @@ void clk_disable(struct clk *clk)
}
EXPORT_SYMBOL(clk_disable);

/* We have a fixed clock alone, for now */
static struct clk clk_48 = {
.rate = 48 * 1000 * 1000,
};

/*
* Catch-all default clock to satisfy drivers using the clk API. We don't
* model the actual hardware clocks yet.
*/
static struct clk clk_default;

#define CLK(_clk, dev) \
{ \
.clk = _clk, \
.dev_id = dev, \
}

static struct clk_lookup lookups[] = {
CLK(&clk_48, "uart0"),
CLK(&clk_48, "uart1"),
CLK(&clk_default, "gpio.0"),
CLK(&clk_default, "gpio.1"),
CLK(&clk_default, "gpio.2"),
CLK(&clk_default, "gpio.3"),
};

static int __init clk_init(void)
/* Create a clock structure with the given name */
int nmdk_clk_create(struct clk *clk, const char *dev_id)
{
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
struct clk_lookup *clkdev;

clkdev = clkdev_alloc(clk, NULL, dev_id);
if (!clkdev)
return -ENOMEM;
clkdev_add(clkdev);
return 0;
}

arch_initcall(clk_init);
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-nomadik/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
struct clk {
unsigned long rate;
};
extern int nmdk_clk_create(struct clk *clk, const char *dev_id);
83 changes: 36 additions & 47 deletions trunk/arch/arm/mach-nomadik/cpu-8815.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <linux/init.h>
#include <linux/device.h>
#include <linux/amba/bus.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>

#include <mach/hardware.h>
Expand All @@ -31,66 +30,60 @@
#include <asm/cacheflush.h>
#include <asm/hardware/cache-l2x0.h>

#define __MEM_4K_RESOURCE(x) \
.res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}

/* The 8815 has 4 GPIO blocks, let's register them immediately */

#define GPIO_RESOURCE(block) \
{ \
.start = NOMADIK_GPIO##block##_BASE, \
.end = NOMADIK_GPIO##block##_BASE + SZ_4K - 1, \
.flags = IORESOURCE_MEM, \
}, \
{ \
.start = IRQ_GPIO##block, \
.end = IRQ_GPIO##block, \
.flags = IORESOURCE_IRQ, \
}

#define GPIO_DEVICE(block) \
{ \
.name = "gpio", \
.id = block, \
.num_resources = 2, \
.resource = &cpu8815_gpio_resources[block * 2], \
.dev = { \
.platform_data = &cpu8815_gpio[block], \
}, \
}

static struct nmk_gpio_platform_data cpu8815_gpio[] = {
{
.name = "GPIO-0-31",
.first_gpio = 0,
.first_irq = NOMADIK_GPIO_TO_IRQ(0),
.parent_irq = IRQ_GPIO0,
}, {
.name = "GPIO-32-63",
.first_gpio = 32,
.first_irq = NOMADIK_GPIO_TO_IRQ(32),
.parent_irq = IRQ_GPIO1,
}, {
.name = "GPIO-64-95",
.first_gpio = 64,
.first_irq = NOMADIK_GPIO_TO_IRQ(64),
.parent_irq = IRQ_GPIO2,
}, {
.name = "GPIO-96-127", /* 124..127 not routed to pin */
.first_gpio = 96,
.first_irq = NOMADIK_GPIO_TO_IRQ(96),
.parent_irq = IRQ_GPIO3,
}
};

static struct resource cpu8815_gpio_resources[] = {
GPIO_RESOURCE(0),
GPIO_RESOURCE(1),
GPIO_RESOURCE(2),
GPIO_RESOURCE(3),
};
#define __MEM_4K_RESOURCE(x) \
.res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}

static struct platform_device cpu8815_platform_gpio[] = {
GPIO_DEVICE(0),
GPIO_DEVICE(1),
GPIO_DEVICE(2),
GPIO_DEVICE(3),
static struct amba_device cpu8815_amba_gpio[] = {
{
.dev = {
.init_name = "gpio0",
.platform_data = cpu8815_gpio + 0,
},
__MEM_4K_RESOURCE(NOMADIK_GPIO0_BASE),
}, {
.dev = {
.init_name = "gpio1",
.platform_data = cpu8815_gpio + 1,
},
__MEM_4K_RESOURCE(NOMADIK_GPIO1_BASE),
}, {
.dev = {
.init_name = "gpio2",
.platform_data = cpu8815_gpio + 2,
},
__MEM_4K_RESOURCE(NOMADIK_GPIO2_BASE),
}, {
.dev = {
.init_name = "gpio3",
.platform_data = cpu8815_gpio + 3,
},
__MEM_4K_RESOURCE(NOMADIK_GPIO3_BASE),
},
};

static struct amba_device cpu8815_amba_rng = {
Expand All @@ -100,22 +93,18 @@ static struct amba_device cpu8815_amba_rng = {
__MEM_4K_RESOURCE(NOMADIK_RNG_BASE),
};

static struct platform_device *platform_devs[] __initdata = {
cpu8815_platform_gpio + 0,
cpu8815_platform_gpio + 1,
cpu8815_platform_gpio + 2,
cpu8815_platform_gpio + 3,
};

static struct amba_device *amba_devs[] __initdata = {
cpu8815_amba_gpio + 0,
cpu8815_amba_gpio + 1,
cpu8815_amba_gpio + 2,
cpu8815_amba_gpio + 3,
&cpu8815_amba_rng
};

static int __init cpu8815_init(void)
{
int i;

platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
amba_device_register(amba_devs[i], &iomem_resource);
return 0;
Expand Down
Loading

0 comments on commit 107546a

Please sign in to comment.