aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-stmp378x/stmp378x.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-stmp378x/stmp378x.c')
-rw-r--r--arch/arm/mach-stmp378x/stmp378x.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/arch/arm/mach-stmp378x/stmp378x.c b/arch/arm/mach-stmp378x/stmp378x.c
index 9a363fb2acf3..ddd49a760fd4 100644
--- a/arch/arm/mach-stmp378x/stmp378x.c
+++ b/arch/arm/mach-stmp378x/stmp378x.c
@@ -19,6 +19,7 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/dma-mapping.h>
22 23
23#include <asm/dma.h> 24#include <asm/dma.h>
24#include <asm/setup.h> 25#include <asm/setup.h>
@@ -39,6 +40,8 @@
39#include <mach/regs-icoll.h> 40#include <mach/regs-icoll.h>
40#include <mach/regs-apbh.h> 41#include <mach/regs-apbh.h>
41#include <mach/regs-apbx.h> 42#include <mach/regs-apbx.h>
43#include <mach/regs-pxp.h>
44#include <mach/regs-i2c.h>
42 45
43#include "stmp378x.h" 46#include "stmp378x.h"
44/* 47/*
@@ -232,6 +235,64 @@ static struct map_desc stmp378x_io_desc[] __initdata = {
232 }, 235 },
233}; 236};
234 237
238
239static u64 common_dmamask = DMA_BIT_MASK(32);
240
241/*
242 * devices that are present only on stmp378x, not on all 3xxx boards:
243 * PxP
244 * I2C
245 */
246static struct resource pxp_resource[] = {
247 {
248 .flags = IORESOURCE_MEM,
249 .start = REGS_PXP_PHYS,
250 .end = REGS_PXP_PHYS + REGS_PXP_SIZE,
251 }, {
252 .flags = IORESOURCE_IRQ,
253 .start = IRQ_PXP,
254 .end = IRQ_PXP,
255 },
256};
257
258struct platform_device stmp378x_pxp = {
259 .name = "stmp3xxx-pxp",
260 .id = -1,
261 .dev = {
262 .dma_mask = &common_dmamask,
263 .coherent_dma_mask = DMA_BIT_MASK(32),
264 },
265 .num_resources = ARRAY_SIZE(pxp_resource),
266 .resource = pxp_resource,
267};
268
269static struct resource i2c_resources[] = {
270 {
271 .flags = IORESOURCE_IRQ,
272 .start = IRQ_I2C_ERROR,
273 .end = IRQ_I2C_ERROR,
274 }, {
275 .flags = IORESOURCE_MEM,
276 .start = REGS_I2C_PHYS,
277 .end = REGS_I2C_PHYS + REGS_I2C_SIZE,
278 }, {
279 .flags = IORESOURCE_DMA,
280 .start = STMP3XXX_DMA(3, STMP3XXX_BUS_APBX),
281 .end = STMP3XXX_DMA(3, STMP3XXX_BUS_APBX),
282 },
283};
284
285struct platform_device stmp378x_i2c = {
286 .name = "i2c_stmp3xxx",
287 .id = 0,
288 .dev = {
289 .dma_mask = &common_dmamask,
290 .coherent_dma_mask = DMA_BIT_MASK(32),
291 },
292 .resource = i2c_resources,
293 .num_resources = ARRAY_SIZE(i2c_resources),
294};
295
235void __init stmp378x_map_io(void) 296void __init stmp378x_map_io(void)
236{ 297{
237 iotable_init(stmp378x_io_desc, ARRAY_SIZE(stmp378x_io_desc)); 298 iotable_init(stmp378x_io_desc, ARRAY_SIZE(stmp378x_io_desc));