2 * Broadcom BCM63xx VoIP DSP registration
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
11 #include <linux/init.h>
12 #include <linux/kernel.h>
13 #include <linux/platform_device.h>
15 #include <bcm63xx_cpu.h>
16 #include <bcm63xx_dev_dsp.h>
17 #include <bcm63xx_regs.h>
18 #include <bcm63xx_io.h>
20 static struct resource voip_dsp_resources
[] = {
22 .start
= -1, /* filled at runtime */
23 .end
= -1, /* filled at runtime */
24 .flags
= IORESOURCE_MEM
,
27 .start
= -1, /* filled at runtime */
28 .flags
= IORESOURCE_IRQ
,
32 static struct platform_device bcm63xx_voip_dsp_device
= {
33 .name
= "bcm63xx-voip-dsp",
35 .num_resources
= ARRAY_SIZE(voip_dsp_resources
),
36 .resource
= voip_dsp_resources
,
39 int __init
bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data
*pd
)
41 struct bcm63xx_dsp_platform_data
*dpd
;
44 /* Get the memory window */
45 val
= bcm_mpi_readl(MPI_CSBASE_REG(pd
->cs
- 1));
46 val
&= MPI_CSBASE_BASE_MASK
;
47 voip_dsp_resources
[0].start
= val
;
48 voip_dsp_resources
[0].end
= val
+ 0xFFFFFFF;
49 voip_dsp_resources
[1].start
= pd
->ext_irq
;
51 /* copy given platform data */
52 dpd
= bcm63xx_voip_dsp_device
.dev
.platform_data
;
53 memcpy(dpd
, pd
, sizeof (*pd
));
55 return platform_device_register(&bcm63xx_voip_dsp_device
);