aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-ux500/Makefile2
-rw-r--r--arch/arm/mach-ux500/board-mop500.c13
-rw-r--r--arch/arm/mach-ux500/cpu-u8500.c2
-rw-r--r--arch/arm/mach-ux500/cpu.c10
-rw-r--r--arch/arm/mach-ux500/devices.c37
-rw-r--r--arch/arm/mach-ux500/include/mach/devices.h15
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h6
7 files changed, 70 insertions, 15 deletions
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 6deee85dfbe0..e5b9f742a0c9 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel, U8500 machine. 2# Makefile for the linux kernel, U8500 machine.
3# 3#
4 4
5obj-y := clock.o cpu.o 5obj-y := clock.o cpu.o devices.o
6obj-$(CONFIG_ARCH_U8500) += cpu-u8500.o 6obj-$(CONFIG_ARCH_U8500) += cpu-u8500.o
7obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o 7obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o
8obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o 8obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 9ca47095db76..cc52d53d7727 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -107,18 +107,6 @@ static struct amba_device pl022_device = {
107 .periphid = SSP_PER_ID, 107 .periphid = SSP_PER_ID,
108}; 108};
109 109
110static struct amba_device pl031_device = {
111 .dev = {
112 .init_name = "pl031",
113 },
114 .res = {
115 .start = U8500_RTC_BASE,
116 .end = U8500_RTC_BASE + SZ_4K - 1,
117 .flags = IORESOURCE_MEM,
118 },
119 .irq = {IRQ_RTC_RTT, NO_IRQ},
120};
121
122#define U8500_I2C_RESOURCES(id, size) \ 110#define U8500_I2C_RESOURCES(id, size) \
123static struct resource u8500_i2c_resources_##id[] = { \ 111static struct resource u8500_i2c_resources_##id[] = { \
124 [0] = { \ 112 [0] = { \
@@ -188,7 +176,6 @@ static struct amba_device *amba_devs[] __initdata = {
188 &uart1_device, 176 &uart1_device,
189 &uart2_device, 177 &uart2_device,
190 &pl022_device, 178 &pl022_device,
191 &pl031_device,
192}; 179};
193 180
194/* add any platform devices here - TODO */ 181/* add any platform devices here - TODO */
diff --git a/arch/arm/mach-ux500/cpu-u8500.c b/arch/arm/mach-ux500/cpu-u8500.c
index c80beca0f977..730d020f0f99 100644
--- a/arch/arm/mach-ux500/cpu-u8500.c
+++ b/arch/arm/mach-ux500/cpu-u8500.c
@@ -106,6 +106,8 @@ void __init u8500_map_io(void)
106 */ 106 */
107void __init u8500_init_devices(void) 107void __init u8500_init_devices(void)
108{ 108{
109 ux500_init_devices();
110
109 /* Register the platform devices */ 111 /* Register the platform devices */
110 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); 112 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
111 113
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index e6a8058cd735..05615c094493 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -16,6 +16,7 @@
16 16
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/setup.h> 18#include <mach/setup.h>
19#include <mach/devices.h>
19 20
20#include "clock.h" 21#include "clock.h"
21 22
@@ -41,11 +42,20 @@ static struct map_desc ux500_io_desc[] __initdata = {
41 __IO_DEV_DESC(UX500_BACKUPRAM0_BASE, SZ_8K), 42 __IO_DEV_DESC(UX500_BACKUPRAM0_BASE, SZ_8K),
42}; 43};
43 44
45static struct amba_device *ux500_amba_devs[] __initdata = {
46 &ux500_pl031_device,
47};
48
44void __init ux500_map_io(void) 49void __init ux500_map_io(void)
45{ 50{
46 iotable_init(ux500_io_desc, ARRAY_SIZE(ux500_io_desc)); 51 iotable_init(ux500_io_desc, ARRAY_SIZE(ux500_io_desc));
47} 52}
48 53
54void __init ux500_init_devices(void)
55{
56 amba_add_devices(ux500_amba_devs, ARRAY_SIZE(ux500_amba_devs));
57}
58
49void __init ux500_init_irq(void) 59void __init ux500_init_irq(void)
50{ 60{
51 gic_dist_init(0, __io_address(UX500_GIC_DIST_BASE), 29); 61 gic_dist_init(0, __io_address(UX500_GIC_DIST_BASE), 29);
diff --git a/arch/arm/mach-ux500/devices.c b/arch/arm/mach-ux500/devices.c
new file mode 100644
index 000000000000..eef686a4802f
--- /dev/null
+++ b/arch/arm/mach-ux500/devices.c
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <linux/kernel.h>
9#include <linux/platform_device.h>
10#include <linux/interrupt.h>
11#include <linux/io.h>
12#include <linux/amba/bus.h>
13
14#include <mach/hardware.h>
15#include <mach/setup.h>
16
17struct amba_device ux500_pl031_device = {
18 .dev = {
19 .init_name = "pl031",
20 },
21 .res = {
22 .start = UX500_RTC_BASE,
23 .end = UX500_RTC_BASE + SZ_4K - 1,
24 .flags = IORESOURCE_MEM,
25 },
26 .irq = {IRQ_RTC_RTT, NO_IRQ},
27};
28
29void __init amba_add_devices(struct amba_device *devs[], int num)
30{
31 int i;
32
33 for (i = 0; i < num; i++) {
34 struct amba_device *d = devs[i];
35 amba_device_register(d, &iomem_resource);
36 }
37}
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/include/mach/devices.h
new file mode 100644
index 000000000000..5bca7c605cd6
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/devices.h
@@ -0,0 +1,15 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License (GPL) version 2
5 */
6
7#ifndef __ASM_ARCH_DEVICES_H__
8#define __ASM_ARCH_DEVICES_H__
9
10struct platform_device;
11struct amba_device;
12
13extern struct amba_device ux500_pl031_device;
14
15#endif
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index 6c4c348fbdbb..6187effe92db 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -17,11 +17,15 @@
17extern void __init ux500_map_io(void); 17extern void __init ux500_map_io(void);
18extern void __init u8500_map_io(void); 18extern void __init u8500_map_io(void);
19 19
20extern void u8500_init_devices(void); 20extern void __init ux500_init_devices(void);
21extern void __init u8500_init_devices(void);
22
21extern void __init ux500_init_irq(void); 23extern void __init ux500_init_irq(void);
22/* We re-use nomadik_timer for this platform */ 24/* We re-use nomadik_timer for this platform */
23extern void nmdk_timer_init(void); 25extern void nmdk_timer_init(void);
24 26
27extern void __init amba_add_devices(struct amba_device *devs[], int num);
28
25struct sys_timer; 29struct sys_timer;
26extern struct sys_timer u8500_timer; 30extern struct sys_timer u8500_timer;
27 31