linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] bcm63xx: add infrastructure for MPI-connected VoIP DSP
@ 2009-08-07 21:46 Florian Fainelli
  2009-08-08 12:00 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2009-08-07 21:46 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Maxime Bizon, linux-mips

This patch adds the required infrastructure to register
a MPI and GPIO connected VoIP DSP. We will register
devices in a subsequent patch.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile
index 92d07f0..70ba038 100644
--- a/arch/mips/bcm63xx/Makefile
+++ b/arch/mips/bcm63xx/Makefile
@@ -4,6 +4,7 @@ obj-y		+= dev-pcmcia.o
 obj-y		+= dev-usb-ohci.o
 obj-y		+= dev-usb-ehci.o
 obj-y		+= dev-enet.o
+obj-y		+= dev-dsp.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 obj-y		+= boards/
diff --git a/arch/mips/bcm63xx/dev-dsp.c b/arch/mips/bcm63xx/dev-dsp.c
new file mode 100644
index 0000000..08a2f75
--- /dev/null
+++ b/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 <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);
+}
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
new file mode 100644
index 0000000..b587d45
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
@@ -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 */
diff --git a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
index 17e4e7e..9fde025 100644
--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
@@ -3,6 +3,7 @@
 
 #include <linux/types.h>
 #include <bcm63xx_dev_enet.h>
+#include <bcm63xx_dev_dsp.h>
 
 /*
  * flash mapping
@@ -41,10 +42,14 @@ struct board_info {
 	unsigned int	has_pccard:1;
 	unsigned int	has_ohci0:1;
 	unsigned int	has_ehci0:1;
+	unsigned int	has_dsp:1;
 
 	/* ethernet config */
 	struct bcm63xx_enet_platform_data enet0;
 	struct bcm63xx_enet_platform_data enet1;
+
+	/* DSP config */
+	struct bcm63xx_dsp_platform_data dsp;
 };
 
 #endif /* ! BOARD_BCM963XX_H_ */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/8] bcm63xx: add infrastructure for MPI-connected VoIP DSP
  2009-08-07 21:46 [PATCH 1/8] bcm63xx: add infrastructure for MPI-connected VoIP DSP Florian Fainelli
@ 2009-08-08 12:00 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2009-08-08 12:00 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Maxime Bizon, linux-mips

On Fri, Aug 07, 2009 at 11:46:21PM +0200, Florian Fainelli wrote:

> This patch adds the required infrastructure to register
> a MPI and GPIO connected VoIP DSP. We will register
> devices in a subsequent patch.
> 
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile
> index 92d07f0..70ba038 100644
> --- a/arch/mips/bcm63xx/Makefile
> +++ b/arch/mips/bcm63xx/Makefile
> @@ -4,6 +4,7 @@ obj-y		+= dev-pcmcia.o
>  obj-y		+= dev-usb-ohci.o
>  obj-y		+= dev-usb-ehci.o
>  obj-y		+= dev-enet.o
> +obj-y		+= dev-dsp.o
>  obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
>  
>  obj-y		+= boards/
> diff --git a/arch/mips/bcm63xx/dev-dsp.c b/arch/mips/bcm63xx/dev-dsp.c
> new file mode 100644
> index 0000000..08a2f75
> --- /dev/null
> +++ b/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 <florian@openwrt.org> 
                                                              ^^^

You *wham* shall *wham* not *wham* sumbit *wham* trailing *wham* whitespace :-)

I cleaned that but it's really YOUR job to do that.

   Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-08 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07 21:46 [PATCH 1/8] bcm63xx: add infrastructure for MPI-connected VoIP DSP Florian Fainelli
2009-08-08 12:00 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).