Last updated: 10 May 2010
NOTE: These instructions are to compile dspbridge branch in kernel-dspbridge dev.omapzoom project. However, they give a fair overview to build other branches and kernels.
Check out the news under DSPBridge Branch section.
About DSP Bridge
DSP Bridge driver provides features to control and communicate with DSP enabling parallel processing for multimedia acceleration. It enables the applications running on MPU to offload the processing to DSP.
Some of the key features of DSP Bridge are:
Messaging: Ability to exchange fixed size control messages with DSP Dynamic memory management: Ability to dynamically map files to DSP address space Dynamic loading: Ability to dynamically load new nodes on DSP at run time Power Management: Static and dynamic power management for DSP
Getting Started with DSP Bridge
The DSP Bridge code base is available in two forms.
The latest DSP Bridge has been included into the staging tree, a functional version can be found on kernel 2.6.37 (when released). Also the branches are available on the kernel-dspbridge git tree
- staging-linus: staging branch based on 2.6.37-rc1 (mirrored for staging tree)
- dspbridge: driver based on linux-omap (latest can vary depending on lo activity)
- tidspbridge-2.6.37-rc1: local branch based on 2.6.37-rc1
All branches contain the same code.
NOTE: For tidspbridge driver, the recommended is to get it from the git.kernel.org mainline kernel.
Also available the userspace files repository.
Before proceeding, check for the tools:
Set up a tool chain, the tool chain versions comonly used are Code Sourcery ARM Sourcery G++ 2008q3 or 2007q3.
Set cross compile variable.
Be sure that you have the mkimage tool visible in the exported PATH, this is generated while compiling u-boot under u-boot/tools folder, you can clone u-boot repository from here.
Building Kernel Image with Bridge Driver Support (git tree approach)
For beagleboard users you shall use the repository pointed by eLinux Kernel Howto.
Clone linux-bridge repository with the following command:
git clone git://dev.omapzoom.org/pub/scm/tidspbridge/kernel-dspbridge.git
Checkout dspbridge branch, remember this tree is based on linux-omap tree, any porting to other kernels may require some fetch and merge.
cd kernel-dspbridge git checkout -b my_dspbridge --track origin/dspbridge
Configure your board.
Select any desired kernel options
Select from menuconfig the options to enable Bridge driver as shown in the figures below:
Select staging drivers, inside it, deselect the option to exclude staging driver from being built.
Toggle between "*" or "M" to build Kernel image with builtin support or as a loadable kernel module.
Bridge driver options menu:
--- DSP Bridge driver [ ] Enable Bridge Dynamic Voltage and Frequency Scaling (DVFS) Bridge DVFS depends on other kernel options, it will not be displayed until you enable them. (0x600000) Physical memory pool size (Byte) Amount of memory allocated for bridge. This needs that dspbridge.ko is installed before the driver, refer to working with bridge [ ] DSP Bridge Debug Support Bridge GT trace debug system.
Make the Kernel Image and modules after saving your changes in menuconfig.
make uImage && make modules
At this point, you should have a uImage, and depending on your configuration either the driver built-in as part of the kernel or as a module.
If bridge was compiled as a module, the .ko file are located at:
arch/arm/plat-omap/mailbox.ko arch/arm/mach-omap2/mailbox_mach.ko drivers/dsp/bridge/bridgedriver.ko
Note that on the latest versions, bridge has migrated to use omap mailbox driver.
Copy these files to the file system.
Build Userspace Files
Initial environment setup
Set up an arm tool chain, the tool chain versions comonly used are Code Sourcery ARM Sourcery G++ 2008q3 or 2007q3 You must also have the libstdc++5 installed in your host.
Set cross compile variable.
Set up dsp toolchain, to compile dsp samples you will need the CGT 6.0.7 or later version (Code Generation Tools) and the DSP/BIOS 5.21.03 package (subsequent version not compatible with user-space source). Please note that you might be required to register to gain access to those files.
# Create your dsp toolchain folder (DEPOT); installing DSP required # software in a single location will help you save time from editing # config.bld and specifyng the paths to your tools mkdir /dsp-tc/
# Install directories: # CGT: /dsp-tc/cgt6x-6.0.7 # BIOS: /dsp-tc/bios_5_33_04
# If you are changing from the recommended CGT version, you need to # match the version used to the one defined in product.mak
# Export your DEPOT folder export DEPOT=/dsp-tc/
Building Userspace Files
Clone userspace repository with the following command:
git clone git://dev.omapzoom.org/pub/scm/tidspbridge/userspace-dspbridge.git
Note: The repository has documents, and a source folder. Since 2012-04-27 there are no more precompiled dsp binaries, there is an unofficial location to download them .
Checkout userspace master branch or tag.
git checkout -b my_userspace --track origin/master
note : for the build steps you may also check the README file found in the repository source.
In /source/product.mak file, change the below version numbers to match the tools version numbers:
# DSP BIOS SABIOS_VER = 5.33.04 SABIOS_VER_2 = 5_33_04
# CodeGen Tools CGT55_VER = 3.2.2 CGT6X_VER = 6.0.7
Check also the config.bld file :
Check the CGT path définition : tiTargets.C64P.rootDir = depot + "/<your dir prefix>" + c6xCodeGenVersion;
Compile the package from the 'source' folder.
make clean # clean all make all # clean, compile and install all make .api # clean, compile and install API only make .samples # clean, compile and install samples only make .dsp # clean, compile and install DSP binaires only
# The output will be created under: userspace/source/target
Copy the compiled binaries into the filesystem, target/dspbridge folder and target/lib/*
cp -r target/dspbridge my_filesystem/ cp target/lib/* my_filesystem/lib/
Working with bridge driver
Boot your kernel, when you receive the console prompt:
If bridge was compiled as part of the kernel, jump to step 2.
1. Install dspbridge and bridgedriver modules.
modprobe tidspbridge (if module is installed in /lib/modules/... path) OR insmod <pathtomodule>/tidspbridge.ko
If everything went fine, /dev/DspBridge should be created, cat /proc/interrupts should show 26 and 28 assigned to bridge.
2. Load a baseimage.
A baseimage is a file containing all DSP/BIOS primitives to work with the dsp. While building the userspace files ddspbase_tiomap3430 (static) and dynbase_tiomap3430 (dynamic) baseimages were created. A static baseimage links all the nodes that will be used during execution. A dynamic baseimage loads the nodes at runtime by registering DLLs (dll64P).
Loading the dynamic baseimage:
Register the dll
./dynreg.out -r <sample>dyn_3430.dll64P
3. Execute a sample.
A sample is a bridge native application, that uses the API to communicate to the DSP through bridge driver. These are: ping, dmmcopy, strmcopy, scale, cexec, dynreg.
It is used to load and start a DSP baseimage.
Usage: cexec.out <baseimage> Options: -v Verbose. -T Load, Start and exit execution. If not used cexec waits for user input before exiting. Source: userspace-dspbridge/source/samples/mpu/src/cexec
Illustrates the fundamental control and messaging mechanisms used between ARM applications and BIOS tasks.
Usage: ping.out <no. msg> Options: <no. msg> Number of messages to be sent to DSP, if not specified, ping will send 50 messages. Source: userspace-dspbridge/source/samples/mpu/src/ping
Stream copy application demonstrates simple data streaming between a GPP (arm) task and a DSP task node, and end-of-stream handling. It copies data from file to file on the host file system.
Usage: strmcopy.out <streaming transport id> <input> <output> strmcopy_dyn.out <streaming transport id> <input> <output> Options: <streaming transport id> 0 - proc-copy 1 - dsp-dma (unsupported) 2 - zero-copy (unsupported) <input> Input file to copy <output> Output file to write Source: userspace-dspbridge/source/samples/mpu/src/strmcopy
It provide an example of how a XDAIS algorithm can be integrated into the DSP/BIOS node framework. It sends buffers of data to the DSP to be scaled and returned back.
Usage: scale.out <iterations> scale_dyn.out <iterations> Options: <iterations> Number of iterations Source: userspace-dspbridge/source/samples/mpu/src/scale
Dynamic Memory mapping example to demonstrate basic usage of DMM APIs, it maps two buffers allocated on the ARM to two regions in the DSP virtual address space. It reads the data from an input file into the first buffer, using messaging to synchronize buffer access, DSP copies the contents of the first buffer to the second buffer and returns it to the sample, the sample compares both buffer to be the same and continues execution until the input end of file.
Usage: dmmcopy.out <input> <output> Options: <input> Input file <output> Output file Source: userspace-dspbridge/source/samples/mpu/src/dmmcopy
Used to register nodes that are going to be dynamically loaded along with any corresponding or dependent libraries.
Usage: dynreg.out <args> <library path> Options: -v verbose mode. -ls Short list of currently registered node in the Node Database -ln Long list of currently registered node in the Node Database -r <lib_path> Register dynamic library -u <lib_path> Unregister dynamic library -? displays "dynreg" usage. Source: userspace-dspbridge/source/samples/mpu/src/dynreg
The latest DSP Bridge source code exists on the dev.omapzoom Git Tree under drivers/dsp/dspbridge.
User space Bridge libraries and samples
Download the user space Bridge components:
Download the DSP binaries:
- Documents on Brigde Overview, Integrating Bridge etc.
- DSP Howto for Beagleboard at elinux.org
In the works (pushed)
- Kernel was rebased to 2.6.33
- Removed camel case.
- Custom mailbox was replaced to use OMAP Mailbox modules.
- Cherry-picked mailbox fixes to imporve stability, it is planned to remove these once they are included in the kernel.
- Removal of SYNC, NTFY, CLK, MEM and REG.
- Rebase of WDT and Recovery features.
In the works (development)
- Checkpatch fixes
- Sparse fixes
- Get kfifo mailbox changes (http://marc.info/?l=linux-omap&m=127307361716482&w=2)
- Get fix cache + mem API issues (http://marc.info/?l=linux-omap&m=127274684325463&w=2)
- Step into 2.6.34-rc#
DSP/Bridge patch status
For status on dspbridge patches check: dspbridge patchwork
dspbridge version 0.2 (Kernel 2.6.32)
Released: 18 Mar 2010
- Trivial checkpatch fixes.
- File history removal and CONTRIBUTORS file created.
- Remove DPC module.
- Enhancement to return correct error codes.
- Removal of LIST module.
- Enumeration cleanups.
- Fix for cache operation against kernel address instead of user's.
- MEM module cleanups.
- Remove conditional check from the InputMsg function.
- Enhancement to Resource cleanup functionality.
- Typedef trivial cleanups.
- Removal of debug custom implementation.