blob: 516a6f57d1598b2379c623c24cc88362389eea7f [file] [log] [blame]
Rabin Vincent9e4e7fe2010-05-03 08:03:52 +01001/*
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>
Rabin Vincent5b1f7dd2010-05-03 08:25:52 +010012#include <linux/gpio.h>
Rabin Vincent9e4e7fe2010-05-03 08:03:52 +010013#include <linux/amba/bus.h>
Linus Walleij5d7b8462010-10-14 13:57:59 +020014#include <linux/amba/pl022.h>
Linus Walleij865fab62012-10-18 14:20:16 +020015#include <linux/platform_data/dma-ste-dma40.h>
Linus Walleij05ec2602013-02-07 10:17:31 +010016#include <linux/mfd/dbx500-prcmu.h>
Linus Walleij7b8ddb02010-05-27 15:21:26 -070017
Arnd Bergmanne657bcf2013-03-21 22:51:12 +010018#include "setup.h"
Arnd Bergmanneba52742013-03-21 22:51:08 +010019#include "irqs.h"
Rabin Vincent9e4e7fe2010-05-03 08:03:52 +010020
Linus Walleij174e7792013-03-19 15:41:55 +010021#include "db8500-regs.h"
Linus Walleij05ec2602013-02-07 10:17:31 +010022#include "devices-db8500.h"
Linus Walleij7b8ddb02010-05-27 15:21:26 -070023#include "ste-dma40-db8500.h"
24
Linus Walleij7b8ddb02010-05-27 15:21:26 -070025static struct resource dma40_resources[] = {
26 [0] = {
27 .start = U8500_DMA_BASE,
Jonas Aaberg5aa12e82010-06-20 21:26:14 +000028 .end = U8500_DMA_BASE + SZ_4K - 1,
Linus Walleij7b8ddb02010-05-27 15:21:26 -070029 .flags = IORESOURCE_MEM,
Jonas Aaberg5aa12e82010-06-20 21:26:14 +000030 .name = "base",
Linus Walleij7b8ddb02010-05-27 15:21:26 -070031 },
32 [1] = {
33 .start = U8500_DMA_LCPA_BASE,
Jonas Aaberg5aa12e82010-06-20 21:26:14 +000034 .end = U8500_DMA_LCPA_BASE + 2 * SZ_1K - 1,
Linus Walleij7b8ddb02010-05-27 15:21:26 -070035 .flags = IORESOURCE_MEM,
Jonas Aaberg5aa12e82010-06-20 21:26:14 +000036 .name = "lcpa",
Linus Walleij7b8ddb02010-05-27 15:21:26 -070037 },
38 [2] = {
Rabin Vincent60559302010-07-26 11:09:27 +010039 .start = IRQ_DB8500_DMA,
40 .end = IRQ_DB8500_DMA,
Jonas Aaberg5aa12e82010-06-20 21:26:14 +000041 .flags = IORESOURCE_IRQ,
42 }
Linus Walleij7b8ddb02010-05-27 15:21:26 -070043};
44
Lee Jones252f27b2013-05-03 15:32:13 +010045struct stedma40_platform_data dma40_plat_data = {
Jonas Aaberg59516722010-06-20 21:26:45 +000046 .disabled_channels = {-1},
Linus Walleij7b8ddb02010-05-27 15:21:26 -070047};
48
49struct platform_device u8500_dma40_device = {
50 .dev = {
51 .platform_data = &dma40_plat_data,
52 },
53 .name = "dma40",
54 .id = 0,
55 .num_resources = ARRAY_SIZE(dma40_resources),
56 .resource = dma40_resources
57};
58
Sundar Iyer4c61c842010-09-29 19:43:09 -070059struct resource keypad_resources[] = {
60 [0] = {
61 .start = U8500_SKE_BASE,
62 .end = U8500_SKE_BASE + SZ_4K - 1,
63 .flags = IORESOURCE_MEM,
64 },
65 [1] = {
66 .start = IRQ_DB8500_KB,
67 .end = IRQ_DB8500_KB,
68 .flags = IORESOURCE_IRQ,
69 },
70};
71
Sundar Iyere43abe62010-12-03 20:35:36 +053072struct platform_device u8500_ske_keypad_device = {
Sundar Iyer4c61c842010-09-29 19:43:09 -070073 .name = "nmk-ske-keypad",
74 .id = -1,
75 .num_resources = ARRAY_SIZE(keypad_resources),
76 .resource = keypad_resources,
77};
Linus Walleij05ec2602013-02-07 10:17:31 +010078
79struct prcmu_pdata db8500_prcmu_pdata = {
80 .ab_platdata = &ab8500_platdata,
Arnd Bergmann55b175d2013-03-21 22:51:07 +010081 .ab_irq = IRQ_DB8500_AB8500,
82 .irq_base = IRQ_PRCMU_BASE,
Linus Walleij05ec2602013-02-07 10:17:31 +010083 .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
84 .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
85};
86
87static struct resource db8500_prcmu_res[] = {
88 {
89 .name = "prcmu",
90 .start = U8500_PRCMU_BASE,
91 .end = U8500_PRCMU_BASE + SZ_8K - 1,
92 .flags = IORESOURCE_MEM,
93 },
94 {
95 .name = "prcmu-tcdm",
96 .start = U8500_PRCMU_TCDM_BASE,
97 .end = U8500_PRCMU_TCDM_BASE + SZ_4K - 1,
98 .flags = IORESOURCE_MEM,
99 },
100 {
101 .name = "irq",
102 .start = IRQ_DB8500_PRCMU1,
103 .end = IRQ_DB8500_PRCMU1,
104 .flags = IORESOURCE_IRQ,
105 },
106 {
107 .name = "prcmu-tcpm",
108 .start = U8500_PRCMU_TCPM_BASE,
Lee Jones5dc60e02013-04-02 14:21:48 +0100109 .end = U8500_PRCMU_TCPM_BASE + SZ_32K - 1,
Linus Walleij05ec2602013-02-07 10:17:31 +0100110 .flags = IORESOURCE_MEM,
111 },
112};
113
114struct platform_device db8500_prcmu_device = {
115 .name = "db8500-prcmu",
116 .resource = db8500_prcmu_res,
117 .num_resources = ARRAY_SIZE(db8500_prcmu_res),
118 .dev = {
119 .platform_data = &db8500_prcmu_pdata,
120 },
121};