mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-24 08:54:04 +02:00
[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
This commit is contained in:
parent
7a4bc09b34
commit
c33ead0f7c
@ -7,6 +7,7 @@ obj-y += dev-usb-udc.o
|
|||||||
obj-y += dev-enet.o
|
obj-y += dev-enet.o
|
||||||
obj-y += dev-wdt.o
|
obj-y += dev-wdt.o
|
||||||
obj-y += dev-spi.o
|
obj-y += dev-spi.o
|
||||||
|
obj-y += dev-dsp.o
|
||||||
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
||||||
|
|
||||||
obj-y += boards/
|
obj-y += boards/
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <bcm63xx_dev_uart.h>
|
#include <bcm63xx_dev_uart.h>
|
||||||
#include <bcm63xx_dev_wdt.h>
|
#include <bcm63xx_dev_wdt.h>
|
||||||
#include <bcm63xx_dev_enet.h>
|
#include <bcm63xx_dev_enet.h>
|
||||||
|
#include <bcm63xx_dev_dsp.h>
|
||||||
#include <bcm63xx_dev_pcmcia.h>
|
#include <bcm63xx_dev_pcmcia.h>
|
||||||
#include <bcm63xx_dev_usb_ohci.h>
|
#include <bcm63xx_dev_usb_ohci.h>
|
||||||
#include <bcm63xx_dev_usb_ehci.h>
|
#include <bcm63xx_dev_usb_ehci.h>
|
||||||
@ -114,6 +115,14 @@ static struct board_info __initdata board_96348gw_10 = {
|
|||||||
.has_ohci0 = 1,
|
.has_ohci0 = 1,
|
||||||
.has_pccard = 1,
|
.has_pccard = 1,
|
||||||
.has_ehci0 = 1,
|
.has_ehci0 = 1,
|
||||||
|
|
||||||
|
.has_dsp = 1,
|
||||||
|
.dsp = {
|
||||||
|
.gpio_rst = 6,
|
||||||
|
.gpio_int = 34,
|
||||||
|
.cs = 2,
|
||||||
|
.ext_irq = 2,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct board_info __initdata board_96348gw_11 = {
|
static struct board_info __initdata board_96348gw_11 = {
|
||||||
@ -158,6 +167,14 @@ static struct board_info __initdata board_96348gw = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
.has_ohci0 = 1,
|
.has_ohci0 = 1,
|
||||||
|
.has_dsp = 1,
|
||||||
|
|
||||||
|
.dsp = {
|
||||||
|
.gpio_rst = 6,
|
||||||
|
.gpio_int = 34,
|
||||||
|
.ext_irq = 2,
|
||||||
|
.cs = 2,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct board_info __initdata board_FAST2404 = {
|
static struct board_info __initdata board_FAST2404 = {
|
||||||
@ -559,6 +576,10 @@ int __init board_register_devices(void)
|
|||||||
|
|
||||||
if (board.has_udc0)
|
if (board.has_udc0)
|
||||||
bcm63xx_udc_register();
|
bcm63xx_udc_register();
|
||||||
|
|
||||||
|
if (board.has_dsp)
|
||||||
|
bcm63xx_dsp_register(&board.dsp);
|
||||||
|
|
||||||
/* Generate MAC address for WLAN and
|
/* Generate MAC address for WLAN and
|
||||||
* register our SPROM */
|
* register our SPROM */
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
|
56
target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c
Normal file
56
target/linux/brcm63xx/files/arch/mips/bcm63xx/dev-dsp.c
Normal file
@ -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 <florian@openwrt.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
|
#include <bcm63xx_cpu.h>
|
||||||
|
#include <bcm63xx_dev_dsp.h>
|
||||||
|
#include <bcm63xx_regs.h>
|
||||||
|
#include <bcm63xx_io.h>
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef __BCM63XX_DSP_H
|
||||||
|
#define __BCM63XX_DSP_H
|
||||||
|
|
||||||
|
struct bcm63xx_dsp_platform_data {
|
||||||
|
unsigned gpio_rst;
|
||||||
|
unsigned gpio_int;
|
||||||
|
unsigned cs;
|
||||||
|
unsigned ext_irq;
|
||||||
|
};
|
||||||
|
|
||||||
|
int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd);
|
||||||
|
|
||||||
|
#endif /* __BCM63XX_DSP_H */
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <bcm63xx_dev_enet.h>
|
#include <bcm63xx_dev_enet.h>
|
||||||
|
#include <bcm63xx_dev_dsp.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* flash mapping
|
* flash mapping
|
||||||
@ -42,10 +43,14 @@ struct board_info {
|
|||||||
unsigned int has_ohci0:1;
|
unsigned int has_ohci0:1;
|
||||||
unsigned int has_ehci0:1;
|
unsigned int has_ehci0:1;
|
||||||
unsigned int has_udc0:1;
|
unsigned int has_udc0:1;
|
||||||
|
unsigned int has_dsp:1;
|
||||||
|
|
||||||
/* ethernet config */
|
/* ethernet config */
|
||||||
struct bcm63xx_enet_platform_data enet0;
|
struct bcm63xx_enet_platform_data enet0;
|
||||||
struct bcm63xx_enet_platform_data enet1;
|
struct bcm63xx_enet_platform_data enet1;
|
||||||
|
|
||||||
|
/* DSP config */
|
||||||
|
struct bcm63xx_dsp_platform_data dsp;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ! BOARD_BCM963XX_H_ */
|
#endif /* ! BOARD_BCM963XX_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user