]> Pileus Git - ~andy/linux/blob - arch/arm/mach-ux500/devices-db8500.c
071b588d33b0099616c4c69985259bc397e76ebd
[~andy/linux] / arch / arm / mach-ux500 / devices-db8500.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 #include <linux/amba/pl022.h>
14 #include <linux/platform_data/dma-ste-dma40.h>
15 #include <linux/mfd/dbx500-prcmu.h>
16
17 #include "setup.h"
18 #include "irqs.h"
19
20 #include "db8500-regs.h"
21 #include "devices-db8500.h"
22 #include "ste-dma40-db8500.h"
23
24 static struct resource dma40_resources[] = {
25         [0] = {
26                 .start = U8500_DMA_BASE,
27                 .end   = U8500_DMA_BASE + SZ_4K - 1,
28                 .flags = IORESOURCE_MEM,
29                 .name  = "base",
30         },
31         [1] = {
32                 .start = U8500_DMA_LCPA_BASE,
33                 .end   = U8500_DMA_LCPA_BASE + 2 * SZ_1K - 1,
34                 .flags = IORESOURCE_MEM,
35                 .name  = "lcpa",
36         },
37         [2] = {
38                 .start = IRQ_DB8500_DMA,
39                 .end   = IRQ_DB8500_DMA,
40                 .flags = IORESOURCE_IRQ,
41         }
42 };
43
44 struct stedma40_platform_data dma40_plat_data = {
45         .disabled_channels = {-1},
46 };
47
48 struct platform_device u8500_dma40_device = {
49         .dev = {
50                 .platform_data = &dma40_plat_data,
51                 .coherent_dma_mask = DMA_BIT_MASK(32),
52         },
53         .name = "dma40",
54         .id = 0,
55         .num_resources = ARRAY_SIZE(dma40_resources),
56         .resource = dma40_resources
57 };
58
59 struct prcmu_pdata db8500_prcmu_pdata = {
60         .ab_platdata    = &ab8500_platdata,
61         .ab_irq         = IRQ_DB8500_AB8500,
62         .irq_base       = IRQ_PRCMU_BASE,
63         .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
64         .legacy_offset  = DB8500_PRCMU_LEGACY_OFFSET,
65 };
66
67 static struct resource db8500_prcmu_res[] = {
68         {
69                 .name  = "prcmu",
70                 .start = U8500_PRCMU_BASE,
71                 .end   = U8500_PRCMU_BASE + SZ_8K - 1,
72                 .flags = IORESOURCE_MEM,
73         },
74         {
75                 .name  = "prcmu-tcdm",
76                 .start = U8500_PRCMU_TCDM_BASE,
77                 .end   = U8500_PRCMU_TCDM_BASE + SZ_4K - 1,
78                 .flags = IORESOURCE_MEM,
79         },
80         {
81                 .name  = "irq",
82                 .start = IRQ_DB8500_PRCMU1,
83                 .end   = IRQ_DB8500_PRCMU1,
84                 .flags = IORESOURCE_IRQ,
85         },
86         {
87                 .name  = "prcmu-tcpm",
88                 .start = U8500_PRCMU_TCPM_BASE,
89                 .end   = U8500_PRCMU_TCPM_BASE + SZ_32K - 1,
90                 .flags = IORESOURCE_MEM,
91         },
92 };
93
94 struct platform_device db8500_prcmu_device = {
95         .name                   = "db8500-prcmu",
96         .resource               = db8500_prcmu_res,
97         .num_resources          = ARRAY_SIZE(db8500_prcmu_res),
98         .dev = {
99                 .platform_data = &db8500_prcmu_pdata,
100         },
101 };