From c33ead0f7c493581d316afb48c2d300c16cd51a6 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 1 Jul 2009 21:00:41 +0000 Subject: [brcm63xx] add the infrastructure to use a MPI/GPIO connected VoIP DSP git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16650 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c (limited to 'target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c') diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c b/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c new file mode 100644 index 000000000..08a2f75c2 --- /dev/null +++ b/target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c @@ -0,0 +1,56 @@ +/* + * Broadcom BCM63xx VoIP DSP registration + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2009 Florian Fainelli + */ + +#include +#include +#include + +#include +#include +#include +#include + +static struct resource voip_dsp_resources[] = { + { + .start = -1, /* filled at runtime */ + .end = -1, /* filled at runtime */ + .flags = IORESOURCE_MEM, + }, + { + .start = -1, /* filled at runtime */ + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device bcm63xx_voip_dsp_device = { + .name = "bcm63xx-voip-dsp", + .id = 0, + .num_resources = ARRAY_SIZE(voip_dsp_resources), + .resource = voip_dsp_resources, +}; + +int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd) +{ + struct bcm63xx_dsp_platform_data *dpd; + u32 val; + + /* Get the memory window */ + val = bcm_mpi_readl(MPI_CSBASE_REG(pd->cs - 1)); + val &= MPI_CSBASE_BASE_MASK; + voip_dsp_resources[0].start = val; + voip_dsp_resources[0].end = val + 0xFFFFFFF; + voip_dsp_resources[1].start = pd->ext_irq; + + /* copy given platform data */ + dpd = bcm63xx_voip_dsp_device.dev.platform_data; + memcpy(dpd, pd, sizeof (*pd)); + + return platform_device_register(&bcm63xx_voip_dsp_device); +} -- cgit v1.2.3