374fcceb10a9b082a69ef75a5a89eb6ac6c2fb59
[safe/jmp/linux-2.6] / arch / arm / mach-ux500 / devices.c
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
17 #define __MEM_4K_RESOURCE(x) \
18         .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
19
20 struct amba_device ux500_pl031_device = {
21         .dev = {
22                 .init_name = "pl031",
23         },
24         .res = {
25                 .start  = UX500_RTC_BASE,
26                 .end    = UX500_RTC_BASE + SZ_4K - 1,
27                 .flags  = IORESOURCE_MEM,
28         },
29         .irq = {IRQ_RTC_RTT, NO_IRQ},
30 };
31
32 struct amba_device ux500_uart0_device = {
33         .dev = { .init_name = "uart0" },
34         __MEM_4K_RESOURCE(UX500_UART0_BASE),
35         .irq = {IRQ_UART0, NO_IRQ},
36 };
37
38 struct amba_device ux500_uart1_device = {
39         .dev = { .init_name = "uart1" },
40         __MEM_4K_RESOURCE(UX500_UART1_BASE),
41         .irq = {IRQ_UART1, NO_IRQ},
42 };
43
44 struct amba_device ux500_uart2_device = {
45         .dev = { .init_name = "uart2" },
46         __MEM_4K_RESOURCE(UX500_UART2_BASE),
47         .irq = {IRQ_UART2, NO_IRQ},
48 };
49
50 void __init amba_add_devices(struct amba_device *devs[], int num)
51 {
52         int i;
53
54         for (i = 0; i < num; i++) {
55                 struct amba_device *d = devs[i];
56                 amba_device_register(d, &iomem_resource);
57         }
58 }