How to get DSP working in beagleboard?

Gentlemen,

I was trying to get DSP programming working in beagleboard on Sunday without any luck. I would
appreciate if someone could give me a hand.

What I have done so far, without luck :frowning:

  1. I found most information is available from omapzoom.org. So I got its git tree, and follow the instruction there, use
    beagleboard default configuration as starting point, and enabled DSP bridge driver. Use the three-step instruction in beagleboard google code project:
    “make CROSS_COMPILE=XXX, distclean; beagleboardConfig; make menuconfig to enable DSP; make uImage”
    But omapzoom’s kernel cannot compile (master branch). There are several strange things, first the make distclean step removed lots of header files that are in git source code control. Second I had compiler error since a structure is not defined anywhere.
    Anyone can compile this kernel? Or know which version in omapzoom’s git tree can compile and works?

  2. Then I downloaded the stable version DSP driver tar ball, and tried to compile it with montavista’s kernel 2.6.26-omap2. I can compile kernel 2.6.26-omap2 without any error. But cannot compile mpu_driver since one function is missing from kernel. (power related constraint_level_get ?).
    Another thing I noticed is 2.6.26-omap2 kernel can have lockup in bootup, like angstrom’s kernel. But I haven’t seen lockup in kernel in google code.

Help is appreciated!
Thanks,
Guo

Gentlemen,

I was trying to get DSP programming working in beagleboard on Sunday without
any luck. I would
appreciate if someone could give me a hand.

What I have done so far, without luck :frowning:

1. I found most information is available from omapzoom.org. So I got its git
tree, and follow the instruction there, use
    beagleboard default configuration as starting point, and enabled DSP
bridge driver. Use the three-step instruction in beagleboard google code
project:
   "make CROSS_COMPILE=XXX, distclean; beagleboardConfig; make menuconfig to
enable DSP; make uImage"
But omapzoom's kernel cannot compile (master branch). There are several
strange things, first the make distclean step removed lots of header files
that are in git source code control. Second I had compiler error since a
structure is not defined anywhere.
   Anyone can compile this kernel? Or know which version in omapzoom's git
tree can compile and works?

I recommend you to try the linux-omap kernel, and add Hiroshi's patches:
http://4869037.web.fc2.com/tidspbridge-20080910.tgz

2. Then I downloaded the stable version DSP driver tar ball, and tried to
compile it with montavista's kernel 2.6.26-omap2. I can compile kernel
2.6.26-omap2 without any error. But cannot compile mpu_driver since one
function is missing from kernel. (power related constraint_level_get ?).
    Another thing I noticed is 2.6.26-omap2 kernel can have lockup in
bootup, like angstrom's kernel. But I haven't seen lockup in kernel in
google code.

Don't try it this way.

I have it working, so if you have questions just ask.

Hi all,

Is that 14M only for the DSP, or is that including some memory for the
framebuffer?

Hi Felipe,

Resending.....

Hi all,

Resending....

Hi Felipe,

Doyu San,

I had some trouble to apply your patches to linux-omap-2.6 kernel.

First I cannot use the latest kernel since usb is broken in 6.27 branch. I depend on usb to have Ethernet working.
I was trying to apply your patches on top of the following stable tag.

v2.6.26-omap2 9882ca1b309ef95e528fe048499b831f99a688a3

The patches can be applied without any trouble. But I have compiler error in “make all” stages.

drivers/dsp/bridge/gen/gb.c:33:27: error: dspbridge/std.h: No such file or directory
drivers/dsp/bridge/gen/gb.c:36:26: error: dspbridge/gs.h: No such file or directory
drivers/dsp/bridge/gen/gb.c:37:26: error: dspbridge/gb.h: No such file or directory

It seems related the header file path changes.

I tried 9-13 patches, 9-11 and 9-10 patches. All have compilation error.

Could you send out the patches based on v2.6.26-omap2 ? Or let us know which linux-omap version
is a good one (usb is working) to apply the dsp patches?

Thanks,
Guo

Hi Guo,

I guess that it can be solved by appending the header file location like:

diff --git a/drivers/dsp/bridge/Kbuild b/drivers/dsp/bridge/Kbuild
index 29b686e..a4f29b6 100644
--- a/drivers/dsp/bridge/Kbuild
+++ b/drivers/dsp/bridge/Kbuild
@@ -33,6 +33,7 @@ ccflags-y += -D_TI_ -D_DB_TIOMAP -DTMS32060 \
     -DCHNL_MESSAGES -DUSE_LEVEL_1_MACROS

#Header files
+ccflags-y += -Iarch/arm/plat-omap/include
ccflags-y += -Idrivers/dsp/bridge/services
ccflags-y += -Idrivers/dsp/bridge/wmd
ccflags-y += -Idrivers/dsp/bridge/pmgr

I haven't tested the above, if it doesn't work, try to adjust the above path.

  Hiroshi DOYU

Still cannot have the dsp driver to compile for v2.6.26-omap2 tag. The
code is using new mach/clock.h brought in from a later merge.

But after bisecting around. I found the last good version before omap usb
is broken.

commit c9a955b1458b9e9f8aa2a1760622929927e898b2
Author: Jouni Hogander <jouni.hogander@nokia.com>

The version after that is mainline 2.6.27-rc5 to l-o merge. Seems broke
beagle usb.

Now the dsp patches applied sucessfully on top of
c9a955b1458b9e9f8aa2a1760622929927e898b2.

But when I try to insert the module, I got the following error.
Any thought on this?

Another thing is I cannot find the ddbase_tiomap3430.dof64P file, I can
only find ddspbase_tiomap3430.dof64P.

[root@beagleboard /dspbridge_binaries]# modprobe bridgedriver
phys_mempool_base=0 base_img=ddspbase_tiomap3430.dof64P
coherent allocation too big (requested 0x400000 mask 0xffffffff)
insmod: cannot insert
'/lib/modules/2.6.27-rc3-omap1-04876-g5ab15e2/kernel/drivers/dsp/bridge/bridgedriver.ko':
Operation not permitted
modprobe: failed to load module bridgedriver

Thanks,
Guo

Hi Guo,

Hi Guo,

From: “ext Guo Tang” <tangguo77@gmail.com>
Subject: Re: [beagleboard] Re: How to get DSP working in beagleboard?

Date: Thu, 18 Sep 2008 23:27:26 -0700 (PDT)

Still cannot have the dsp driver to compile for v2.6.26-omap2 tag. The
code is using new mach/clock.h brought in from a later merge.

right. for this backporting, you may need something like:

sed -i -e ‘s@<mach/@<asm/arch/@g’ drivers/dsp/bridge//.[ch]

But after bisecting around. I found the last good version before omap usb
is broken.

commit c9a955b1458b9e9f8aa2a1760622929927e898b2
Author: Jouni Hogander <jouni.hogander@nokia.com>
Date: Fri Aug 15 12:31:24 2008 +0300

The version after that is mainline 2.6.27-rc5 to l-o merge. Seems broke
beagle usb.

Now the dsp patches applied sucessfully on top of
c9a955b1458b9e9f8aa2a1760622929927e898b2.

I think that the above should be reported on l-o ML, and someone could help.

http://vger.kernel.org/vger-lists.html#linux-omap

But when I try to insert the module, I got the following error.
Any thought on this?

Did you set the following “CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14” in menuconfig?

My fault. I didn’t. I am using the default value from beagle board default configuration, which is
CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=4

One question: Which entry in menuconfig set CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE? I am not suppose to edit the .config file manually, right? I used “git grep CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE”, but I cannot find which kconfig file is controlling that.

Hi Guo,

I'm not sure you really need that file.

I always use baseimage.dof which is found on the omapzoom site:
https://omapzoom.org/gf/project/openmax/

Hi Guo,

From: "ext guo tang" <tangguo77@gmail.com>
Subject: Re: [beagleboard] Re: How to get DSP working in beagleboard?
Date: Fri, 19 Sep 2008 08:26:20 -0700

<snip>

> >
> > > But when I try to insert the module, I got the following error.
> > > Any thought on this?
> >
> > Did you set the following "CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14" in
> > menuconfig?
>
>
> My fault. I didn't. I am using the default value from beagle board default
> configuration, which is
> CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=4
>
> One question: Which entry in menuconfig set
> CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE? I am not suppose to edit the .config
> file manually, right? I used "git grep CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE",
> but I cannot find which kconfig file is controlling that.

-> Device Drivers
     -> Graphics support
       -> Support for frame buffer devices (FB [=y])
         -> OMAP frame buffer support (EXPERIMENTAL) (FB_OMAP [=y])

You can fine it in the above.

Thanks!

Now modeprobe return no error codes. I tried both
base_img=ddspbase_tiomap3430.dof64P and baseimage.dof. No error.

When I tried to run ./ping.out, I get error "missing libbridge.so.2".
Then I compiled mpu_api from dspbridge_LDP_v1.4.tar.gz package (Is this
the right one to work with the 09-13 bridge driver?), copy the resulting
libbridge.so to target, then ln -s libbridge.so libbridge.so.2.

Run ./ping.out

[root@beagleboard /dspbridge_binaries]# ./ping.out
DSP device detected !!
DSPNode_Allocate failed: 0x80008008

Any suggestion on where could be wrong?

Thanks,
Guo

<snip>

When I tried to run ./ping.out, I get error "missing libbridge.so.2".
Then I compiled mpu_api from dspbridge_LDP_v1.4.tar.gz package (Is this
the right one to work with the 09-13 bridge driver?), copy the resulting
libbridge.so to target, then ln -s libbridge.so libbridge.so.2.

Run ./ping.out

[root@beagleboard /dspbridge_binaries]# ./ping.out
DSP device detected !!
DSPNode_Allocate failed: 0x80008008

Any suggestion on where could be wrong?

How about setting memory reservation for 6MB from 128MB ram in advance
as below?

ex)

- Append "mem=122m" on CONFIG_CMDLINE of kernel menuconfig
- modprobe phys_mempool_base=0x87a00000 phys_mempool_size=0x600000

  Hiroshi DOYU

From: "ext Guo Tang" <tangguo77@gmail.com>
Subject: Re: [beagleboard] Re: How to get DSP working in beagleboard?
Date: Sat, 20 Sep 2008 23:26:42 -0700 (PDT)

<snip>

> When I tried to run ./ping.out, I get error "missing libbridge.so.2".
> Then I compiled mpu_api from dspbridge_LDP_v1.4.tar.gz package (Is this
> the right one to work with the 09-13 bridge driver?), copy the resulting
> libbridge.so to target, then ln -s libbridge.so libbridge.so.2.
>
> Run ./ping.out
>
> [root@beagleboard /dspbridge_binaries]# ./ping.out
> DSP device detected !!
> DSPNode_Allocate failed: 0x80008008
>
> Any suggestion on where could be wrong?

How about setting memory reservation for 6MB from 128MB ram in advance
as below?

It does not work. But I think it might because I am not in the latest
version of l-o tree, not the dspbridge driver.

I updated to the latest l-o version. Then applied your 0913 patches, then
picked up the usb fixed from mans' tree (the beagle-10 tag).

Author: Mans Rullgard <mans@mansr.com>

    usb: musb: fix something
    
    This makes USB work on the Beagleboard. I don't know why.

The result is a little strange.
If I load the module this following way, ping.out will fail
[root@beagleboard /dspbridge_binaries]# modprobe bridgedriver
phys_mempool_base=0 base_img=baseimage.dof
[root@beagleboard /dspbridge_binaries]# ./ping.out
DSP device detected !!
DSPNode_Allocate failed: 0x8000801d

Load a different base image

modprobe bridgedriver phys_mempool_base=0
base_img=ddspbase_tiomap3430.dof64P
DSP device detected !!
DSPNodeCreate succeeded
DSPNode_registerNotify succeeded
DSPNode_run succeeded
Ping: Id 1.000000 Msg 0.000000 Mem 15408.000000
Ping: Id 1.000000 Msg 1.000000 Mem 15408.000000
...

It works!

But it is very unstable, if I run ping.out several times, I will ended up
with a really bad system crash with tons of the following logging in
console.

irq -33, desc: c0331cf8, depth: 0, count: 0, unhandled: 0
->handle_irq(): c0071500, handle_bad_irq+0x0/0x228
->chip(): 00000000, 0x0
->action(): 00000000
...

Any idea on how to fix this?
If the base image will make a difference here, where can I download the
ddbase_tiomap3430.dof64P image in your original instruction?

Another thing, your 0920 patch seems cannot be applied. I got the
following errors.

Applying: BRIDGE: Remove paths in header comment
error: arch/arm/plat-omap/include/dspbridge/_chnl_sm.h: does not exist in
index
error: arch/arm/plat-omap/include/dspbridge/_dcd.h: does not exist in
index
error: arch/arm/plat-omap/include/dspbridge/brddefs.h: does not exist in
index

I found in the tarball, you have two patches named 0001-xxx
0001-BRIDGE-Kconfig-Entry.patch
0001-BRIDGE-Remove-paths-in-header-comment.patch

Is the second 0001 there by mistake? Take the second one out seems solved
the
problem.

Thanks,
Guo

Hi Guo,

Hi Hiroshi,

I have seen these messages a lot, not only on the beagleboard.