Google Summer of Code 2007
In the beginning of 2007 I applied at two organizations to do a Google Summer of Code project for them. Both my project proposals got accepted by the respective organization however, the rules stated I could only do one. The project I decided to do was the one was the one that was closest to my academic interests: Embedded Systems. The project proposal was called ARM/DSP Bridge, a project for a linux multimedia device from Neuros Technology International, LCC., called the OSD. The OSD uses the Texas Instruments DM320 multimedia SoC, which houses an ARM9, an TI C5409 DSP and several hardware multimedia accelerators.
Abstract of the Project Proposal
Project Title
ARM/DSP bridge
Synopsis
A combinations of userland tools and a linux kernel module to run code on the
C54x DSP of the DM320 architecture.
Project Details
Currently, the Neuros OSD only makes use of the DSP through closed source
libraries that handle the encoding and decoding of video data and the playback
of PCM data. The purpose of this project is to write a new interface between
code on the ARM side and code on the DSP side. The current vendor of the closed
source binaries has not released any specification on their interface and
therefor the new interface will not be compatible with the current vendor code.
The overall design of the project is the following:
- Linux kernel module:
Implements device interfaces to the DSP. For a very basic
bridge/gateway at least two device interfaces should be present:
- DSP control device that is able to reset the device and make it execute the code in the DSP program memory
- DSP memory device that provides access to the DSP memory space for the userland application.
- Userland application:
A control utility for ARM/DSP bridge. Allows the user to load a DSP program and control DSP reset.
The most minimal implementation of the project would allow the user to write a program for the DSP that is only able to get data through it's on-chip RAM (which also resides in the ARM memory space).
Features that should be added to this minimal implementation before the end of Google Summer of Code:
- Messaging service to allow communication between code on the ARM side and the DSP side. (Most likely an interrupt-driven routine).
- Allocation of external memory for the DSP (internal RAM is somewhat limited).
Project Result
A number of obstacles were in my path, including: lack of documentation (the docs for the DM320 are NDA-only, and not as complete as most public documentation), no C compiler for the DSP (there is an Open Source assembler, but the commercial compiler costs thousands of dollars) and lack of a JTAG/debugger for the DSP. I eventually designed and implemented the following:
- A kernel module which can read and write to DSP internal memory and communicate with a application on the DSP through a library written for the DSP.
- The DSP library (completely written in TI C54x Assembly) running on the DSP which allows for communication and data transfer with the DSP
- A userland utility that is able to read TI COFF-format executables, and through the kernel module, is able to load them onto the DSP
A common communication struct found in DSP internal memory facilitated the communication between the ARM and the DSP. To facilitate data transfers between the two processors a circular buffer was implemented, the actual transfer happened using DMA. During communication and transfer the communication struct would be locked by the initiating processor.
More information can be found in the links below: