Skip to contentSkip to conversation

DSP: Move code to use only one dsp_common.h

PATCH In review Tony Lindgren 3 participants 11 messages Nov 28, 2007 – Dec 3, 2007

Subsystems (5)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

PATCH 1/2 DSP: Move code to use only one dsp_common.h

Hi all,

As discussed earlier, here are the patches to move dspgateway to under drivers.

Hiroshi san & Toshihiro san, can you take a quick look at these two patches and ack?

I've only compile tested on osk and n800. There should not be any functional changes. Some inline functions I had to export though.

Regards,

Tony

Quoted 1 line

From a4945cb4c9427fd5bcf699607bab1d9cc9f32dae Mon Sep 17 00:00:00 2001

From: Tony Lindgren <[email protected]>
Date: Tue, 27 Nov 2007 20:37:53 -0800
Subject: [PATCH] DSP: Move code to use only one dsp_common.h

Remove arch-arm/plat-omap/dsp/dsp_common.h, and move definitions to include/asm-arm/arch-omap/dsp_common.h.

This is done in order to prepare dsp for moving to live under drivers. No functional changes.

---
 arch/arm/mach-omap1/board-nokia770.c   |    3 +-
 arch/arm/mach-omap1/mmu.c              |    2 +
 arch/arm/mach-omap1/mmu.h              |    3 -
 arch/arm/mach-omap1/pm.c               |    1 -
 arch/arm/mach-omap2/board-n800-audio.c |    2 +-
 arch/arm/mach-omap2/board-n800-dsp.c   |    3 +-
 arch/arm/mach-omap2/mmu.h              |    3 -
 arch/arm/plat-omap/devices.c           |    3 +-
 arch/arm/plat-omap/dsp/dsp.h           |  144 +++++++++++++++++++-
 arch/arm/plat-omap/dsp/dsp_common.c    |    4 +-
 arch/arm/plat-omap/dsp/dsp_common.h    |  241 --------------------------------
 arch/arm/plat-omap/dsp/dsp_core.c      |   37 +++++-
 arch/arm/plat-omap/dsp/uaccess_dsp.h   |    3 +-
 arch/arm/plat-omap/mcbsp.c             |    2 +-
 arch/arm/plat-omap/mmu.c               |    1 +
 include/asm-arm/arch-omap/dsp_common.h |   39 +++++
 16 files changed, 231 insertions(+), 260 deletions(-)
 delete mode 100644 arch/arm/plat-omap/dsp/dsp_common.h
arch/arm/mach-omap1/board-nokia770.c +1 -2
index da0b90f..54502b1 100644
@@ -36,8 +36,7 @@
 #include <asm/arch/omapfb.h>
 #include <asm/arch/hwa742.h>
 #include <asm/arch/lcd_mipid.h>
-
-#include "../plat-omap/dsp/dsp_common.h"
+#include <asm/arch/dsp_common.h>
 
 #define ADS7846_PENDOWN_GPIO	15
 
arch/arm/mach-omap1/mmu.c +2 -0
index f1b682a..a254410 100644
@@ -32,6 +32,8 @@
 #include <linux/err.h>
 #include "mmu.h"
 #include <asm/tlbflush.h>
+#include <asm/arch/dsp.h>
+#include <asm/arch/dsp_common.h>
 
 static void *dspvect_page;
 #define DSP_INIT_PAGE	0xfff000
arch/arm/mach-omap1/mmu.h +0 -3
index 75966b2..9ab2d99 100644
@@ -118,9 +118,6 @@ static inline void omap_mmu_write_reg(struct omap_mmu *mmu,
 	__raw_writew(val, mmu->base + reg);
 }
 
-int omap_dsp_request_mem(void);
-void omap_dsp_release_mem(void);
-
 static inline void omap_mmu_itack(struct omap_mmu *mmu)
 {
 	omap_mmu_write_reg(mmu, OMAP_MMU_IT_ACK_IT_ACK, OMAP_MMU_IT_ACK);
arch/arm/mach-omap1/pm.c +0 -1
index 10aa872..afc4874 100644
@@ -57,7 +57,6 @@
 #include <asm/arch/pm.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/dma.h>
-#include <asm/arch/dsp_common.h>
 #include <asm/arch/dmtimer.h>
 
 static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
arch/arm/mach-omap2/board-n800-audio.c +1 -1
index 5940f61..75c4e4e 100644
@@ -29,7 +29,7 @@
 #include <asm/io.h>
 #include <asm/arch/eac.h>
 
-#include "../plat-omap/dsp/dsp_common.h"
+#include <asm/arch/dsp_common.h>
 
 #if defined(CONFIG_SPI_TSC2301_AUDIO) && defined(CONFIG_SND_OMAP24XX_EAC)
 #define AUDIO_ENABLED
arch/arm/mach-omap2/board-n800-dsp.c +1 -2
index b6da02f..d524b62 100644
@@ -30,8 +30,7 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/board.h>
-
-#include "../plat-omap/dsp/dsp_common.h"
+#include <asm/arch/dsp_common.h>
 
 #if	defined(CONFIG_OMAP_DSP)
 
arch/arm/mach-omap2/mmu.h +0 -3
index c4922d1..736932e 100644
@@ -59,9 +59,6 @@
 
 #define IOMAP_VAL	0x3f
 
-#define omap_dsp_request_mem()	do { } while (0)
-#define omap_dsp_release_mem()	do { } while (0)
-
 #define INIT_TLB_ENTRY(ent,v,p,ps)				\
 do {								\
 	(ent)->va	= (v);					\
arch/arm/plat-omap/devices.c +1 -2
index c25070b..aa5c6ca 100644
@@ -25,6 +25,7 @@
 #include <asm/arch/mux.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/menelaus.h>
+#include <asm/arch/dsp_common.h>
 
 #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
 # include "../mach-omap2/control.h"
@@ -32,8 +33,6 @@
 
 #if	defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
 
-#include "../plat-omap/dsp/dsp_common.h"
-
 static struct dsp_platform_data dsp_pdata = {
 	.kdev_list = LIST_HEAD_INIT(dsp_pdata.kdev_list),
 };
arch/arm/plat-omap/dsp/dsp.h +143 -1

162 lines not on this page · raw message

arch/arm/plat-omap/dsp/dsp_common.c +3 -1
index b7a7ed3..99be995 100644
@@ -33,10 +33,12 @@
 #include <asm/io.h>
 #include <asm/tlbflush.h>
 #include <asm/irq.h>
+#include <asm/arch/dsp_common.h>
+#include "dsp.h"
+
 #ifdef CONFIG_ARCH_OMAP1
 #include <asm/arch/tc.h>
 #endif
-#include "dsp_common.h"
 
 #if defined(CONFIG_ARCH_OMAP1)
 #define dsp_boot_config(mode)	omap_writew((mode), MPUI_DSP_BOOT_CONFIG)
arch/arm/plat-omap/dsp/dsp_common.h deleted +0 -241

241 lines not on this page · raw message

arch/arm/plat-omap/dsp/dsp_core.c +36 -1
index f3a91d0..05274be 100644
@@ -30,11 +30,11 @@
 #include <linux/clk.h>
 #include <asm/delay.h>
 #include <asm/arch/mailbox.h>
+#include <asm/arch/dsp.h>
 #include <asm/arch/dsp_common.h>
 #include "dsp_mbcmd.h"
 #include "dsp.h"
 #include "ipbuf.h"
-#include "dsp_common.h"
 
 MODULE_AUTHOR("Toshihiro Kobayashi <[email protected]>");
 MODULE_DESCRIPTION("OMAP DSP driver module");
@@ -454,6 +454,41 @@ static void mbox_kfunc(struct mbcmd *mb)
 	}
 }
 
+#if defined(CONFIG_ARCH_OMAP1)
+static inline void dsp_clk_enable(void) {}
+static inline void dsp_clk_disable(void) {}
+#elif defined(CONFIG_ARCH_OMAP2)
+static inline void dsp_clk_enable(void)
+{
+	u32 r;
+
+	/*XXX should be handled in mach-omap[1,2] XXX*/
+	prm_write_mod_reg(OMAP24XX_FORCESTATE | (1 << OMAP_POWERSTATE_SHIFT),
+			  OMAP24XX_DSP_MOD, PM_PWSTCTRL);
+
+	r = cm_read_mod_reg(OMAP24XX_DSP_MOD, CM_AUTOIDLE);
+	r |= OMAP2420_AUTO_DSP_IPI;
+	cm_write_mod_reg(r, OMAP24XX_DSP_MOD, CM_AUTOIDLE);
+
+	r = cm_read_mod_reg(OMAP24XX_DSP_MOD, CM_CLKSTCTRL);
+	r |= OMAP24XX_AUTOSTATE_DSP;
+	cm_write_mod_reg(r, OMAP24XX_DSP_MOD, CM_CLKSTCTRL);
+
+	clk_enable(dsp_fck_handle);
+	clk_enable(dsp_ick_handle);
+	__dsp_per_enable();
+}
+static inline void dsp_clk_disable(void)
+{
+	__dsp_per_disable();
+	clk_disable(dsp_ick_handle);
+	clk_disable(dsp_fck_handle);
+
+	prm_write_mod_reg(OMAP24XX_FORCESTATE | (3 << OMAP_POWERSTATE_SHIFT),
+			  OMAP24XX_DSP_MOD, PM_PWSTCTRL);
+}
+#endif
+
 int dsp_late_init(void)
 {
 	int ret;
arch/arm/plat-omap/dsp/uaccess_dsp.h +2 -1
index 9291930..028814f 100644
@@ -25,7 +25,8 @@
 #define _OMAP_DSP_UACCESS_DSP_H
 
 #include <asm/uaccess.h>
-#include "dsp_common.h"
+#include <asm/arch/dsp_common.h>
+#include "dsp.h"
 
 #define HAVE_ASM_COPY_FROM_USER_DSP_2B
 
arch/arm/plat-omap/mcbsp.c +1 -1
index f2ebad2..a17b5ae 100644
@@ -28,8 +28,8 @@
 #include <asm/arch/dma.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/irqs.h>
-#include <asm/arch/dsp_common.h>
 #include <asm/arch/mcbsp.h>
+#include <asm/arch/dsp_common.h>
 
 #ifdef CONFIG_MCBSP_DEBUG
 #define DBG(x...)	printk(x)
arch/arm/plat-omap/mmu.c +1 -0
index 890a9c8..c92afd6 100644
@@ -38,6 +38,7 @@
 #include <asm/pgtable.h>
 #include <asm/arch/mmu.h>
 #include <asm/sizes.h>
+#include <asm/arch/dsp_common.h>
 
 #if defined(CONFIG_ARCH_OMAP1)
 #include "../mach-omap1/mmu.h"
include/asm-arm/arch-omap/dsp_common.h +39 -0
index c61f868..a11deed 100644
@@ -24,11 +24,50 @@
 #ifndef ASM_ARCH_DSP_COMMON_H
 #define ASM_ARCH_DSP_COMMON_H
 
+#include <linux/clk.h>
+
+struct dsp_kfunc_device {
+	char		*name;
+	struct clk	*fck;
+	struct clk	*ick;;
+	spinlock_t	 lock;
+	int		 enabled;
+	int		 type;
+#define DSP_KFUNC_DEV_TYPE_COMMON	1
+#define DSP_KFUNC_DEV_TYPE_AUDIO	2
+
+	struct list_head	entry;
+
+	int	(*probe)(struct dsp_kfunc_device *, int);
+	int	(*remove)(struct dsp_kfunc_device *, int);
+	int	(*enable)(struct dsp_kfunc_device *, int);
+	int	(*disable)(struct dsp_kfunc_device *, int);
+};
+
+extern int dsp_kfunc_device_register(struct dsp_kfunc_device *);
+
+struct dsp_platform_data {
+	struct list_head kdev_list;
+};
+
+struct omap_dsp {
+	struct mutex		lock;
+	int			enabled;	/* stored peripheral status */
+	struct omap_mmu		*mmu;
+	struct omap_mbox	*mbox;
+	struct device		*dev;
+	struct list_head	*kdev_list;
+	int			initialized;
+};
+
 #ifdef CONFIG_ARCH_OMAP1
 extern void omap_dsp_request_mpui(void);
 extern void omap_dsp_release_mpui(void);
 extern int omap_dsp_request_mem(void);
 extern int omap_dsp_release_mem(void);
+#elif defined(CONFIG_ARCH_OMAP2)
+#define omap_dsp_request_mem()	do { } while (0)
+#define omap_dsp_release_mem()	do { } while (0)
 #endif
 
 #endif /* ASM_ARCH_DSP_COMMON_H */
Signature · 1 line
1.5.3.6.GIT
author maintainer
#1 lore raw

Re: [PATCH 2/2] DSP: Move dspgateway to drivers/dsp/dspgateway

This patch does the actual moving of the files.

Tony

Quoted 1 line

From c43c710df9b75494ce931f8e4b730a7f54d56d05 Mon Sep 17 00:00:00 2001

From: Tony Lindgren <[email protected]>
Date: Tue, 27 Nov 2007 21:13:02 -0800
Subject: [PATCH] DSP: Move dspgateway to drivers/dsp/dspgateway

Move dspgateway to drivers/dsp/dspgateway

---
 arch/arm/Kconfig                      |    1 +
 arch/arm/mach-omap1/mmu.c             |    6 +
 arch/arm/mach-omap1/mmu.h             |    7 -
 arch/arm/mach-omap2/mmu.h             |    6 +-
 arch/arm/plat-omap/Kconfig            |    2 -
 arch/arm/plat-omap/Makefile           |    3 -
 arch/arm/plat-omap/dsp/Kconfig        |   24 -
 arch/arm/plat-omap/dsp/Makefile       |   15 -
 arch/arm/plat-omap/dsp/dsp.h          |  391 -----
 arch/arm/plat-omap/dsp/dsp_common.c   |  627 -------
 arch/arm/plat-omap/dsp/dsp_core.c     |  663 -------
 arch/arm/plat-omap/dsp/dsp_ctl.c      | 1069 ------------
 arch/arm/plat-omap/dsp/dsp_ctl_core.c |  132 --
 arch/arm/plat-omap/dsp/dsp_mbcmd.h    |  147 --
 arch/arm/plat-omap/dsp/dsp_mem.c      |  482 ------
 arch/arm/plat-omap/dsp/error.c        |  227 ---
 arch/arm/plat-omap/dsp/hardware_dsp.h |   34 -
 arch/arm/plat-omap/dsp/ipbuf.c        |  353 ----
 arch/arm/plat-omap/dsp/ipbuf.h        |  193 ---
 arch/arm/plat-omap/dsp/mblog.c        |  280 ---
 arch/arm/plat-omap/dsp/mmu.h          |  140 --
 arch/arm/plat-omap/dsp/omap1_dsp.h    |  114 --
 arch/arm/plat-omap/dsp/omap2_dsp.h    |   95 -
 arch/arm/plat-omap/dsp/proclist.h     |   87 -
 arch/arm/plat-omap/dsp/task.c         | 3042 ---------------------------------
 arch/arm/plat-omap/dsp/taskwatch.c    |  163 --
 arch/arm/plat-omap/dsp/uaccess_dsp.S  |   77 -
 arch/arm/plat-omap/dsp/uaccess_dsp.h  |  176 --
 drivers/Makefile                      |    1 +
 drivers/dsp/dspgateway/Kconfig        |   24 +
 drivers/dsp/dspgateway/Makefile       |   15 +
 drivers/dsp/dspgateway/dsp.h          |  391 +++++
 drivers/dsp/dspgateway/dsp_common.c   |  627 +++++++
 drivers/dsp/dspgateway/dsp_core.c     |  663 +++++++
 drivers/dsp/dspgateway/dsp_ctl.c      | 1069 ++++++++++++
 drivers/dsp/dspgateway/dsp_ctl_core.c |  132 ++
 drivers/dsp/dspgateway/dsp_mbcmd.h    |  147 ++
 drivers/dsp/dspgateway/dsp_mem.c      |  484 ++++++
 drivers/dsp/dspgateway/error.c        |  227 +++
 drivers/dsp/dspgateway/hardware_dsp.h |   34 +
 drivers/dsp/dspgateway/ipbuf.c        |  353 ++++
 drivers/dsp/dspgateway/ipbuf.h        |  193 +++
 drivers/dsp/dspgateway/mblog.c        |  280 +++
 drivers/dsp/dspgateway/mmu.h          |  140 ++
 drivers/dsp/dspgateway/omap1_dsp.h    |  114 ++
 drivers/dsp/dspgateway/omap2_dsp.h    |   95 +
 drivers/dsp/dspgateway/proclist.h     |   87 +
 drivers/dsp/dspgateway/task.c         | 3042 +++++++++++++++++++++++++++++++++
 drivers/dsp/dspgateway/taskwatch.c    |  163 ++
 drivers/dsp/dspgateway/uaccess_dsp.S  |   77 +
 drivers/dsp/dspgateway/uaccess_dsp.h  |  176 ++
 include/asm-arm/arch-omap/mmu.h       |   10 +
 52 files changed, 8552 insertions(+), 8548 deletions(-)
 delete mode 100644 arch/arm/plat-omap/dsp/Kconfig
 delete mode 100644 arch/arm/plat-omap/dsp/Makefile
 delete mode 100644 arch/arm/plat-omap/dsp/dsp.h
 delete mode 100644 arch/arm/plat-omap/dsp/dsp_common.c
 delete mode 100644 arch/arm/plat-omap/dsp/dsp_core.c
 delete mode 100644 arch/arm/plat-omap/dsp/dsp_ctl.c
 delete mode 100644 arch/arm/plat-omap/dsp/dsp_ctl_core.c
 delete mode 100644 arch/arm/plat-omap/dsp/dsp_mbcmd.h
 delete mode 100644 arch/arm/plat-omap/dsp/dsp_mem.c
 delete mode 100644 arch/arm/plat-omap/dsp/error.c
 delete mode 100644 arch/arm/plat-omap/dsp/hardware_dsp.h
 delete mode 100644 arch/arm/plat-omap/dsp/ipbuf.c
 delete mode 100644 arch/arm/plat-omap/dsp/ipbuf.h
 delete mode 100644 arch/arm/plat-omap/dsp/mblog.c
 delete mode 100644 arch/arm/plat-omap/dsp/mmu.h
 delete mode 100644 arch/arm/plat-omap/dsp/omap1_dsp.h
 delete mode 100644 arch/arm/plat-omap/dsp/omap2_dsp.h
 delete mode 100644 arch/arm/plat-omap/dsp/proclist.h
 delete mode 100644 arch/arm/plat-omap/dsp/task.c
 delete mode 100644 arch/arm/plat-omap/dsp/taskwatch.c
 delete mode 100644 arch/arm/plat-omap/dsp/uaccess_dsp.S
 delete mode 100644 arch/arm/plat-omap/dsp/uaccess_dsp.h
 create mode 100644 drivers/dsp/dspgateway/Kconfig
 create mode 100644 drivers/dsp/dspgateway/Makefile
 create mode 100644 drivers/dsp/dspgateway/dsp.h
 create mode 100644 drivers/dsp/dspgateway/dsp_common.c
 create mode 100644 drivers/dsp/dspgateway/dsp_core.c
 create mode 100644 drivers/dsp/dspgateway/dsp_ctl.c
 create mode 100644 drivers/dsp/dspgateway/dsp_ctl_core.c
 create mode 100644 drivers/dsp/dspgateway/dsp_mbcmd.h
 create mode 100644 drivers/dsp/dspgateway/dsp_mem.c
 create mode 100644 drivers/dsp/dspgateway/error.c
 create mode 100644 drivers/dsp/dspgateway/hardware_dsp.h
 create mode 100644 drivers/dsp/dspgateway/ipbuf.c
 create mode 100644 drivers/dsp/dspgateway/ipbuf.h
 create mode 100644 drivers/dsp/dspgateway/mblog.c
 create mode 100644 drivers/dsp/dspgateway/mmu.h
 create mode 100644 drivers/dsp/dspgateway/omap1_dsp.h
 create mode 100644 drivers/dsp/dspgateway/omap2_dsp.h
 create mode 100644 drivers/dsp/dspgateway/proclist.h
 create mode 100644 drivers/dsp/dspgateway/task.c
 create mode 100644 drivers/dsp/dspgateway/taskwatch.c
 create mode 100644 drivers/dsp/dspgateway/uaccess_dsp.S
 create mode 100644 drivers/dsp/dspgateway/uaccess_dsp.h
arch/arm/Kconfig +1 -0
index d589397..f468fee 100644
@@ -1081,6 +1081,7 @@ source "drivers/dma/Kconfig"
 
 if ARCH_OMAP
 source "drivers/cbus/Kconfig"
+source "drivers/dsp/dspgateway/Kconfig"
 endif
 
 endmenu
arch/arm/mach-omap1/mmu.c +6 -0
index a254410..c7cb4ff 100644
@@ -81,6 +81,12 @@ void dsp_mem_usecount_clear(void)
 }
 EXPORT_SYMBOL_GPL(dsp_mem_usecount_clear);
 
+void omap_mmu_itack(struct omap_mmu *mmu)
+{
+	omap_mmu_write_reg(mmu, OMAP_MMU_IT_ACK_IT_ACK, OMAP_MMU_IT_ACK);
+}
+EXPORT_SYMBOL(omap_mmu_itack);
+
 static int omap1_mmu_mem_enable(struct omap_mmu *mmu, void *addr)
 {
 	int ret = 0;
arch/arm/mach-omap1/mmu.h +0 -7
index 9ab2d99..521c3bf 100644
@@ -95,8 +95,6 @@ do {							\
 	(ent)->ap	= OMAP_MMU_RAM_L_AP_FA;		\
 } while (0)
 
-extern struct omap_mmu_ops omap1_mmu_ops;
-
 struct omap_mmu_tlb_entry {
 	unsigned long va;
 	unsigned long pa;
@@ -118,9 +116,4 @@ static inline void omap_mmu_write_reg(struct omap_mmu *mmu,
 	__raw_writew(val, mmu->base + reg);
 }
 
-static inline void omap_mmu_itack(struct omap_mmu *mmu)
-{
-	omap_mmu_write_reg(mmu, OMAP_MMU_IT_ACK_IT_ACK, OMAP_MMU_IT_ACK);
-}
-
 #endif /* __MACH_OMAP1_MMU_H */
arch/arm/mach-omap2/mmu.h +1 -5
index 736932e..818ea8c 100644
@@ -93,8 +93,6 @@ do {								\
 	(ent)->mixed	= 0;					\
 } while (0)
 
-extern struct omap_mmu_ops omap2_mmu_ops;
-
 struct omap_mmu_tlb_entry {
 	unsigned long va;
 	unsigned long pa;
@@ -115,7 +113,5 @@ static inline void omap_mmu_write_reg(struct omap_mmu *mmu,
 {
 	__raw_writel(val, mmu->base + reg);
 }
-static inline void omap_mmu_itack(struct omap_mmu *mmu)
-{
-}
+
 #endif /* __MACH_OMAP2_MMU_H */
arch/arm/plat-omap/Kconfig +0 -2
index d1558df..3cb9545 100644
@@ -211,8 +211,6 @@ config OMAP_SERIAL_WAKE
 	  to data on the serial RX line. This allows you to wake the
 	  system from serial console.
 
-source "arch/arm/plat-omap/dsp/Kconfig"
-
 endmenu
 
 endif
arch/arm/plat-omap/Makefile +0 -3
index 4eaef7e..c1ada8f 100644
@@ -32,6 +32,3 @@ obj-$(CONFIG_OMAP_MMU_FWK) += mmu.o
 # OMAP mailbox framework
 obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
 
-# DSP subsystem
-obj-y += dsp/
-obj-$(CONFIG_OMAP_DSP) += mailbox.o
arch/arm/plat-omap/dsp/Kconfig deleted +0 -24
deleted file mode 100644
index 122164a..0000000
@@ -1,24 +0,0 @@
-
-config OMAP_DSP
-	tristate "OMAP DSP driver (DSP Gateway)"
-	depends on ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP24XX
-	select OMAP_MMU_FWK
-	select OMAP_MBOX_FWK
-	help
-	  This enables OMAP DSP driver, DSP Gateway.
-
-config OMAP_DSP_MBCMD_VERBOSE
-	bool "Mailbox Command Verbose LOG"
-	depends on OMAP_DSP
-	help
-          This enables kernel log output in the Mailbox command exchanges
-	  in the DSP Gateway driver.
-
-config OMAP_DSP_FBEXPORT
-	bool "Framebuffer export to DSP"
-	depends on OMAP_DSP && FB
-	help
-          This enables to map the frame buffer to DSP.
-	  By doing this, DSP can access the frame buffer directly without
-	  bothering ARM.
-
arch/arm/plat-omap/dsp/Makefile deleted +0 -15
deleted file mode 100644
index c7d86f3..0000000
@@ -1,15 +0,0 @@
-#
-# Makefile for the OMAP DSP driver.
-#
-
-# The target object and module list name.
-
-obj-y := dsp_common.o
-
-obj-$(CONFIG_OMAP_DSP) += dsp.o
-
-# Declare multi-part drivers
-
-dsp-objs	:= dsp_core.o ipbuf.o mblog.o task.o \
-		   dsp_ctl_core.o dsp_ctl.o taskwatch.o error.o dsp_mem.o \
-		   uaccess_dsp.o
arch/arm/plat-omap/dsp/dsp.h deleted +0 -391

391 lines not on this page · raw message

arch/arm/plat-omap/dsp/dsp_common.c deleted +0 -627

627 lines not on this page · raw message

arch/arm/plat-omap/dsp/dsp_core.c deleted +0 -663

663 lines not on this page · raw message

arch/arm/plat-omap/dsp/dsp_ctl.c deleted +0 -1069

1,069 lines not on this page · raw message

arch/arm/plat-omap/dsp/dsp_ctl_core.c deleted +0 -132

132 lines not on this page · raw message

arch/arm/plat-omap/dsp/dsp_mbcmd.h deleted +0 -147

13 lines not on this page · raw message

arch/arm/plat-omap/dsp/dsp_mem.c deleted +0 -482

482 lines not on this page · raw message

arch/arm/plat-omap/dsp/error.c deleted +0 -227

227 lines not on this page · raw message

arch/arm/plat-omap/dsp/hardware_dsp.h deleted +0 -34
deleted file mode 100644
index 5af46f8..0000000

Lines of this file are not shown. View the raw message.

arch/arm/plat-omap/dsp/ipbuf.c deleted +0 -353

353 lines not on this page · raw message

arch/arm/plat-omap/dsp/ipbuf.h deleted +0 -193

193 lines not on this page · raw message

arch/arm/plat-omap/dsp/mblog.c deleted +0 -280

280 lines not on this page · raw message

arch/arm/plat-omap/dsp/mmu.h deleted +0 -140

140 lines not on this page · raw message

arch/arm/plat-omap/dsp/omap1_dsp.h deleted +0 -114

114 lines not on this page · raw message

arch/arm/plat-omap/dsp/omap2_dsp.h deleted +0 -95

95 lines not on this page · raw message

arch/arm/plat-omap/dsp/proclist.h deleted +0 -87

87 lines not on this page · raw message

arch/arm/plat-omap/dsp/task.c deleted +0 -3042

3,042 lines not on this page · raw message

arch/arm/plat-omap/dsp/taskwatch.c deleted +0 -163

163 lines not on this page · raw message

arch/arm/plat-omap/dsp/uaccess_dsp.S deleted +0 -77

77 lines not on this page · raw message

arch/arm/plat-omap/dsp/uaccess_dsp.h deleted +0 -176

176 lines not on this page · raw message

drivers/Makefile +1 -0
index 94b4442..b10394e 100644

Lines of this file are not shown. View the raw message.

drivers/dsp/dspgateway/Kconfig new file +24 -0
new file mode 100644
index 0000000..122164a

Lines of this file are not shown. View the raw message.

drivers/dsp/dspgateway/Makefile new file +15 -0
new file mode 100644
index 0000000..c7d86f3

Lines of this file are not shown. View the raw message.

drivers/dsp/dspgateway/dsp.h new file +391 -0

391 lines not on this page · raw message

drivers/dsp/dspgateway/dsp_common.c new file +627 -0

627 lines not on this page · raw message

drivers/dsp/dspgateway/dsp_core.c new file +663 -0

663 lines not on this page · raw message

drivers/dsp/dspgateway/dsp_ctl.c new file +1069 -0

1,069 lines not on this page · raw message

drivers/dsp/dspgateway/dsp_ctl_core.c new file +132 -0

132 lines not on this page · raw message

drivers/dsp/dspgateway/dsp_mbcmd.h new file +147 -0

147 lines not on this page · raw message

drivers/dsp/dspgateway/dsp_mem.c new file +484 -0

484 lines not on this page · raw message

drivers/dsp/dspgateway/error.c new file +227 -0

227 lines not on this page · raw message

drivers/dsp/dspgateway/hardware_dsp.h new file +34 -0
new file mode 100644
index 0000000..5af46f8

Lines of this file are not shown. View the raw message.

drivers/dsp/dspgateway/ipbuf.c new file +353 -0

353 lines not on this page · raw message

drivers/dsp/dspgateway/ipbuf.h new file +193 -0

193 lines not on this page · raw message

drivers/dsp/dspgateway/mblog.c new file +280 -0

280 lines not on this page · raw message

drivers/dsp/dspgateway/mmu.h new file +140 -0

140 lines not on this page · raw message

drivers/dsp/dspgateway/omap1_dsp.h new file +114 -0

114 lines not on this page · raw message

drivers/dsp/dspgateway/omap2_dsp.h new file +95 -0

95 lines not on this page · raw message

drivers/dsp/dspgateway/proclist.h new file +87 -0

87 lines not on this page · raw message

drivers/dsp/dspgateway/task.c new file +3042 -0

3,042 lines not on this page · raw message

drivers/dsp/dspgateway/taskwatch.c new file +163 -0

163 lines not on this page · raw message

drivers/dsp/dspgateway/uaccess_dsp.S new file +77 -0

77 lines not on this page · raw message

drivers/dsp/dspgateway/uaccess_dsp.h new file +176 -0

176 lines not on this page · raw message

include/asm-arm/arch-omap/mmu.h +10 -0
index 6c5869c..714ee1d 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.5.3.6.GIT

Part of the diff is not shown here. View the raw message.

#2 lore raw
In reply to Tony Lindgren

Hi Tony,

From: "ext Tony Lindgren" <[email protected]>
Subject: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Tue, 27 Nov 2007 21:18:12 -0800

Quoted 10 lines

Hi all,

As discussed earlier, here are the patches to move dspgateway to under drivers.

Hiroshi san & Toshihiro san, can you take a quick look at these two patches and ack?

I've only compile tested on osk and n800. There should not be any functional changes. Some inline functions I had to export though.

Thank you for the patch, but it doesn't seem to work. I am now investigating....

At least, I'd like to make sure that the code itself works fine at this migration both on N8x0 and OSK.

Hiroshi DOYU

author maintainer
#3 lore raw
Quoted 11 lines · Hiroshi DOYU

Hi Tony,

From: "ext Tony Lindgren" <[email protected]>
Subject: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Tue, 27 Nov 2007 21:18:12 -0800

Quoted 5 lines

Hi all,

As discussed earlier, here are the patches to move dspgateway to under drivers.

Quoted 8 lines
Quoted 5 lines

Hiroshi san & Toshihiro san, can you take a quick look at these two patches and ack?

I've only compile tested on osk and n800. There should not be any functional changes. Some inline functions I had to export though.

Thank you for the patch, but it doesn't seem to work. I am now investigating....

Oops, does the DSP get initialized?

Quoted 2 lines

At least, I'd like to make sure that the code itself works fine at this migration both on N8x0 and OSK.

Yes that would be great :)

Tony

author maintainer
#4 lore raw
Quoted 21 lines · Tony Lindgren
Quoted 11 lines · Hiroshi DOYU

Hi Tony,

From: "ext Tony Lindgren" <[email protected]>
Subject: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Tue, 27 Nov 2007 21:18:12 -0800

Quoted 5 lines

Hi all,

As discussed earlier, here are the patches to move dspgateway to under drivers.

Quoted 8 lines
Quoted 5 lines

Hiroshi san & Toshihiro san, can you take a quick look at these two patches and ack?

I've only compile tested on osk and n800. There should not be any functional changes. Some inline functions I had to export though.

Thank you for the patch, but it doesn't seem to work. I am now investigating....

Quoted 6 lines

Oops, does the DSP get initialized?

Quoted 2 lines

At least, I'd like to make sure that the code itself works fine at this migration both on N8x0 and OSK.

Yes that would be great :)

No idea why it would not work, but here's one more clean-up patch in order to send the MMU framework upstream.

Tony

Quoted 1 line

From 870324f3b330e7df6e5391b1c379c029b6c9f5f3 Mon Sep 17 00:00:00 2001

From: Tony Lindgren <[email protected]>
Date: Wed, 28 Nov 2007 15:33:49 -0800
Subject: [PATCH] DSP: Clean up memory allocation return values

Clean up memory allocation return values

arch/arm/mach-omap1/mmu.c +0 -1
index c7cb4ff..2d05708 100644
@@ -32,7 +32,6 @@
 #include <linux/err.h>
 #include "mmu.h"
 #include <asm/tlbflush.h>
-#include <asm/arch/dsp.h>
 #include <asm/arch/dsp_common.h>
 
 static void *dspvect_page;
arch/arm/plat-omap/mcbsp.c +9 -2
index a17b5ae..4083cf5 100644
@@ -28,8 +28,8 @@
 #include <asm/arch/dma.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/irqs.h>
-#include <asm/arch/mcbsp.h>
 #include <asm/arch/dsp_common.h>
+#include <asm/arch/mcbsp.h>
 
 #ifdef CONFIG_MCBSP_DEBUG
 #define DBG(x...)	printk(x)
@@ -197,7 +197,14 @@ static int omap_mcbsp_check(unsigned int id)
 static void omap_mcbsp_dsp_request(void)
 {
 	if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
-		omap_dsp_request_mem();
+		int ret;
+
+		ret = omap_dsp_request_mem();
+		if (ret < 0) {
+			printk(KERN_ERR "Could not get dsp memory: %i\n", ret);
+			return;
+		}
+
 		clk_enable(mcbsp_dsp_ck);
 		clk_enable(mcbsp_api_ck);
 
arch/arm/plat-omap/mmu.c +28 -9
index c92afd6..c80d411 100644
@@ -588,9 +588,12 @@ int omap_mmu_load_tlb_entry(struct omap_mmu *mmu,
 {
 	struct omap_mmu_tlb_lock lock;
 	struct cam_ram_regset *cr;
+	int ret;
 
 	clk_enable(mmu->clk);
-	omap_dsp_request_mem();
+	ret = omap_dsp_request_mem();
+	if (ret < 0)
+		goto out;
 
 	omap_mmu_get_tlb_lock(mmu, &lock);
 	for (lock.victim = 0; lock.victim < lock.base; lock.victim++) {
@@ -624,6 +627,7 @@ found_victim:
 	omap_mmu_set_tlb_lock(mmu, &lock);
 
 	omap_dsp_release_mem();
+out:
 	clk_disable(mmu->clk);
 	return 0;
 }
@@ -638,11 +642,13 @@ omap_mmu_cam_va(struct omap_mmu *mmu, struct cam_ram_regset *cr)
 int omap_mmu_clear_tlb_entry(struct omap_mmu *mmu, unsigned long vadr)
 {
 	struct omap_mmu_tlb_lock lock;
-	int i;
+	int i, ret = 0;
 	int max_valid = 0;
 
 	clk_enable(mmu->clk);
-	omap_dsp_request_mem();
+	ret = omap_dsp_request_mem();
+	if (ret < 0)
+		goto out;
 
 	omap_mmu_get_tlb_lock(mmu, &lock);
 	for (i = 0; i < lock.base; i++) {
@@ -666,23 +672,28 @@ int omap_mmu_clear_tlb_entry(struct omap_mmu *mmu, unsigned long vadr)
 	omap_mmu_set_tlb_lock(mmu, &lock);
 
 	omap_dsp_release_mem();
+out:
 	clk_disable(mmu->clk);
-	return 0;
+	return ret;
 }
 EXPORT_SYMBOL_GPL(omap_mmu_clear_tlb_entry);
 
 static void omap_mmu_gflush(struct omap_mmu *mmu)
 {
 	struct omap_mmu_tlb_lock lock;
+	int ret;
 
 	clk_enable(mmu->clk);
-	omap_dsp_request_mem();
+	ret = omap_dsp_request_mem();
+	if (ret < 0)
+		goto out;
 
 	omap_mmu_write_reg(mmu, 0x1, OMAP_MMU_GFLUSH);
 	lock.base = lock.victim = mmu->nr_exmap_preserved;
 	omap_mmu_set_tlb_lock(mmu, &lock);
 
 	omap_dsp_release_mem();
+out:
 	clk_disable(mmu->clk);
 }
 
@@ -1073,7 +1084,10 @@ static int omap_mmu_init(struct omap_mmu *mmu)
 	int ret = 0;
 
 	clk_enable(mmu->clk);
-	omap_dsp_request_mem();
+	ret = omap_dsp_request_mem();
+	if (ret < 0)
+		goto out;
+
 	down_write(&mmu->exmap_sem);
 
 	ret = request_irq(mmu->irq, omap_mmu_interrupt, IRQF_DISABLED,
@@ -1093,9 +1107,10 @@ static int omap_mmu_init(struct omap_mmu *mmu)
 
 	if (unlikely(mmu->ops->startup))
 		ret = mmu->ops->startup(mmu);
- fail:
+fail:
 	up_write(&mmu->exmap_sem);
 	omap_dsp_release_mem();
+out:
 	clk_disable(mmu->clk);
 
 	return ret;
@@ -1309,15 +1324,18 @@ static ssize_t omap_mmu_show(struct device *dev, struct device_attribute *attr,
 {
 	struct omap_mmu *mmu = dev_get_drvdata(dev);
 	struct omap_mmu_tlb_lock tlb_lock;
-	int ret = -EIO;
+	int ret;
 
 	clk_enable(mmu->clk);
-	omap_dsp_request_mem();
+	ret = omap_dsp_request_mem();
+	if (ret < 0)
+		goto out;
 
 	down_read(&mmu->exmap_sem);
 
 	omap_mmu_get_tlb_lock(mmu, &tlb_lock);
 
+	ret = -EIO;
 	if (likely(mmu->ops->show))
 		ret = mmu->ops->show(mmu, buf, &tlb_lock);
 
@@ -1326,6 +1344,7 @@ static ssize_t omap_mmu_show(struct device *dev, struct device_attribute *attr,
 
 	up_read(&mmu->exmap_sem);
 	omap_dsp_release_mem();
+out:
 	clk_disable(mmu->clk);
 
 	return ret;
include/asm-arm/arch-omap/dsp_common.h +5 -2
index a11deed..c52b6c6 100644
@@ -66,8 +66,11 @@ extern void omap_dsp_release_mpui(void);
 extern int omap_dsp_request_mem(void);
 extern int omap_dsp_release_mem(void);
 #elif defined(CONFIG_ARCH_OMAP2)
-#define omap_dsp_request_mem()	do { } while (0)
-#define omap_dsp_release_mem()	do { } while (0)
+static inline int omap_dsp_request_mem(void)
+{
+	return 0;
+}
+#define omap_dsp_release_mem()	do {} while (0)
 #endif
 
 #endif /* ASM_ARCH_DSP_COMMON_H */
#5 lore raw

Hi Tony,

From: "ext Tony Lindgren" <[email protected]>
Subject: Re: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Wed, 28 Nov 2007 15:35:24 -0800

Quoted 24 lines · Tony Lindgren
Quoted 23 lines · Hiroshi DOYU
Quoted 11 lines

Hi Tony,

From: "ext Tony Lindgren" <[email protected]>
Subject: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Tue, 27 Nov 2007 21:18:12 -0800

Quoted 5 lines

Hi all,

As discussed earlier, here are the patches to move dspgateway to under drivers.

Quoted 8 lines
Quoted 5 lines

Hiroshi san & Toshihiro san, can you take a quick look at these two patches and ack?

I've only compile tested on osk and n800. There should not be any functional changes. Some inline functions I had to export though.

Thank you for the patch, but it doesn't seem to work. I am now investigating....

Oops, does the DSP get initialized?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

At least, I'd like to make sure that the code itself works fine at this migration both on N8x0 and OSK.

Yes that would be great :)

No idea why it would not work, but here's one more clean-up patch in order to send the MMU framework upstream.

With OSK5912, I verified that the demo program("demo_console") worked fine with your 3 patches. Probably something was broken just with OMAP2. I am checking it bit more.

Hiroshi DOYU

author maintainer
#6 lore raw
Quoted 33 lines · Hiroshi DOYU

Hi Tony,

From: "ext Tony Lindgren" <[email protected]>
Subject: Re: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Wed, 28 Nov 2007 15:35:24 -0800

Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Hiroshi DOYU
Quoted 11 lines

Hi Tony,

From: "ext Tony Lindgren" <[email protected]>
Subject: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Tue, 27 Nov 2007 21:18:12 -0800

Quoted 5 lines

Hi all,

As discussed earlier, here are the patches to move dspgateway to under drivers.

Quoted 8 lines
Quoted 5 lines

Hiroshi san & Toshihiro san, can you take a quick look at these two patches and ack?

I've only compile tested on osk and n800. There should not be any functional changes. Some inline functions I had to export though.

Thank you for the patch, but it doesn't seem to work. I am now investigating....

Oops, does the DSP get initialized?

Quoted 2 lines

At least, I'd like to make sure that the code itself works fine at this migration both on N8x0 and OSK.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Yes that would be great :)

No idea why it would not work, but here's one more clean-up patch in order to send the MMU framework upstream.

With OSK5912, I verified that the demo program("demo_console") worked fine with your 3 patches. Probably something was broken just with OMAP2. I am checking it bit more.

OK, that's good to hear. Let's wait until you're happy before pushing this.

Tony

author maintainer
#7 lore raw

Hi,

Quoted 39 lines · Tony Lindgren
Quoted 38 lines · Hiroshi DOYU

Hi Tony,

From: "ext Tony Lindgren" <[email protected]>
Subject: Re: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Wed, 28 Nov 2007 15:35:24 -0800

Quoted 31 lines · Tony Lindgren
Quoted 21 lines · Hiroshi DOYU
Quoted 11 lines

Hi Tony,

From: "ext Tony Lindgren" <[email protected]>
Subject: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Tue, 27 Nov 2007 21:18:12 -0800

Quoted 5 lines

Hi all,

As discussed earlier, here are the patches to move dspgateway to under drivers.

Quoted 8 lines
Quoted 5 lines

Hiroshi san & Toshihiro san, can you take a quick look at these two patches and ack?

I've only compile tested on osk and n800. There should not be any functional changes. Some inline functions I had to export though.

Thank you for the patch, but it doesn't seem to work. I am now investigating....

Quoted 6 lines

Oops, does the DSP get initialized?

Quoted 2 lines

At least, I'd like to make sure that the code itself works fine at this migration both on N8x0 and OSK.

Yes that would be great :)

No idea why it would not work, but here's one more clean-up patch in order to send the MMU framework upstream.

Quoted 6 lines
Quoted 3 lines

With OSK5912, I verified that the demo program("demo_console") worked fine with your 3 patches. Probably something was broken just with OMAP2. I am checking it bit more.

OK, that's good to hear. Let's wait until you're happy before pushing this.

I've pushed these patches, Hiroshi is looking into why omap2 dsp is not currently working while omap1 is. It seems the problem is unrelated to these patches.

Regards,

Tony

#8 lore raw

From: "ext Tony Lindgren" <[email protected]>
Subject: Re: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Fri, 30 Nov 2007 12:02:22 -0800

Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

With OSK5912, I verified that the demo program("demo_console") worked fine with your 3 patches. Probably something was broken just with OMAP2. I am checking it bit more.

OK, that's good to hear. Let's wait until you're happy before pushing this.

I've pushed these patches, Hiroshi is looking into why omap2 dsp is not currently working while omap1 is. It seems the problem is unrelated to these patches.

Actually dspgw itself is basically working with omap2 also. Probably there seems to be some missing update patches from N8x0 for other drivers, which are supposed to come soon.

Anyway, thank you for you patches.

Hiroshi DOYU

#9 lore raw

Hi,

Quoted 15 lines · Hiroshi DOYU

From: "ext Tony Lindgren" <[email protected]>
Subject: Re: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Fri, 30 Nov 2007 12:02:22 -0800

Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

With OSK5912, I verified that the demo program("demo_console") worked fine with your 3 patches. Probably something was broken just with OMAP2. I am checking it bit more.

OK, that's good to hear. Let's wait until you're happy before pushing this.

I've pushed these patches, Hiroshi is looking into why omap2 dsp is not currently working while omap1 is. It seems the problem is unrelated to these patches.

Quoted 8 lines

Actually dspgw itself is basically working with omap2 also. Probably there seems to be some missing update patches from N8x0 for other drivers, which are supposed to come soon.

Anyway, thank you for you patches.

Hiroshi DOYU

Is there any plan to move dspgw code to use "dspfs" instead?

-- --Trilok Soni

#10 lore raw

Hi Trilok,

From: "ext Trilok Soni" <[email protected]>
Subject: Re: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Mon, 3 Dec 2007 16:03:25 +0530

Quoted 22 lines

Hi,

Quoted 19 lines · Hiroshi DOYU

From: "ext Tony Lindgren" <[email protected]>
Subject: Re: [PATCH 1/2] DSP: Move code to use only one dsp_common.h
Date: Fri, 30 Nov 2007 12:02:22 -0800

Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

With OSK5912, I verified that the demo program("demo_console") worked fine with your 3 patches. Probably something was broken just with OMAP2. I am checking it bit more.

OK, that's good to hear. Let's wait until you're happy before pushing this.

I've pushed these patches, Hiroshi is looking into why omap2 dsp is not currently working while omap1 is. It seems the problem is unrelated to these patches.

Actually dspgw itself is basically working with omap2 also. Probably there seems to be some missing update patches from N8x0 for other drivers, which are supposed to come soon.

Quoted 6 lines
Quoted 4 lines

Anyway, thank you for you patches.

Hiroshi DOYU

Is there any plan to move dspgw code to use "dspfs" instead?

No, we don't have any plan, unfortunately.

Hiroshi DOYU