NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Processor SDK Linux MMIP
Overview[edit]
This Wiki page provides information on IPUMM and DSPDCE firmware in Processor SDK (version 02.00.00 and after). It is applicable to AM57xx devices. Overall, this guide includes the following contents.
- How to rebuild IPUMM firmware on a Ubuntu machine
- How to switch to use DSPDCE firmware on devices
Rebuild IPUMM Firmware[edit]
Pre-built IPUMM firmware images can be located on target file system at /lib/firmware/dra7-ipu2-fw.xem4. In case there is a need to rebuild the IPUMM firmware, the instructions below are provided for rebuilding IPUMM firmware. It assumes that everything is done on a Ubuntu machine.
IPUMM GIT Repo[edit]
IPUMM is publically available at https://git.ti.com/ivimm/ipumm. To clone the git repository, execute the following command.
git clone git://git.ti.com/ivimm/ipumm.git
To checkout a particular tag, e.g., 3.00.09.01, run the following command:
cd ipumm git checkout [tag, e.g., 3.00.09.01]
IPUMM Build Tools[edit]
Making IPUMM depends on the following tools.
- Codec Engine: Codec Engine Product Releases
- Framework Components: Framework Components Product Releases
- IPC: IPC Product Releases
- XDAIS: XDAIS Product Releases
- BIOS: SYS/BIOS Product Releases
- XDC Tools: XDCTools Product Releases
- TMS470 CGT ARM: The compiler tools are provided as part of CCS.CCSv6 Download
Each release of IPUMM is verified with particular versions of the tools above. Check top level Makefile of ipumm to identify the versions to be downloaded and installed. For example, the tool versions used in IPUMM 3.00.09.01 are listed as below:
XDCVERSION ?= xdctools_3_31_02_38_core BIOSVERSION ?= bios_6_42_02_29 IPCVERSION ?= ipc_3_40_01_08 CEVERSION ?= codec_engine_3_24_00_08 FCVERSION ?= framework_components_3_40_01_04 XDAISVERSION ?= xdais_7_24_00_04 # TI Compiler Settings export TMS470CGTOOLPATH ?= $(BIOSTOOLSROOT)/ccsv6/tools/compiler/ti-cgt-arm_5.2.5
Below are direct download links and install instructions for IPUMM 3.00.09.01 build tools. When installing the tools, it is preferable to install all the tools to the same directory, e.g., /opt/ti.
- Download and untar codec_engine_3_24_00_08,lite.tar.gz
- Download and untar framework_components_3_40_01_04,lite.tar.gz
- Download and unzip ipc_3_40_01_08.zip
- Download and untar xdais_7_24_00_04.tar.gz
- Download and install bios_setuplinux_6_42_02_29.bin
- Download and untar xdctools_3_31_02_38_core_linux.zip
- Download and install CCSv6 Build#6.1.1.00022. Ensure that "TI ARM Compiler" is selected during the installation. After the installation, the compiler tools (version 5.2.5) are located at [ccs_install_dir]/ccsv6/tools/compiler/ti-cgt-arm_5.2.5.
Build IPUMM[edit]
Setup Environment[edit]
Export the following environment variables:
export BIOSTOOLSROOT=<path where all tools are hosted> export IPCSRC=<path where IPC is installed> export TMS470CGTOOLPATH=<path to CGTOOL ARM Compiler is installed>
Example for IPUMM 3.00.09.01 assuming all the tools are installed to /opt/ti directory:
export BIOSTOOLSROOT=/opt/ti export IPCSRC=/opt/ti/ipc_3_40_01_08 export TMS470CGTOOLPATH=/opt/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.5
Build IPUMM[edit]
Follow the steps below to build IPUMM firmware.
export HWVERSION=ES10 cd ipumm make unconfig make vayu_smp_config make clean make ducatibin
After the build is completed, two different images will get created. Select the correct one for your devices.
* dra7-ipu2-fw.xem4: This firmware will be used for Linux or Android.
The firmware is built with the resource table defined in platform/ti/dce/baseimage/custom_rsc_table_vayu_ipu.h
The corresponding map file is: platform/ti/dce/baseimage/package/cfg/out/ipu/release/ipu.xem4.map
* dra7xx-m4-ipu2.xem4: This firmware will be used for QNX.
The firmware is built with the resource table defined in platform/ti/dce/baseimage/qnx_custom_rsc_table_vayu_ipu.h
The corresponding map file is: platform/ti/dce/baseimage/package/cfg/out/ipu/release/qnx_ipu.xem4.map
Firmware Loading and Unloading
The table below shows the remote cores and their corresponding definitions in the kernel dtsi files ([ti-processor-sdk-linux-am57xx-evm-[ver]]/board-support/linux-[ver]/arch/arm/boot/dts/dra7.dtsi, and dra74x.dtsi
), as well as the argument to be used in the loading/unloading commands.
Remote Core | Definition in dtsi file | Argument in loading/unloading |
IPU1 | ipu@58820000 | 58820000.ipu |
IPU2 | ipu@55020000 | 55020000.ipu |
DSP1 | dsp@40800000 | 40800000.dsp |
DSP2 | dsp@41000000 | 41000000.dsp |
For example, the argument of 55020000.ipu
corresponds to IPU2 as can be seen from dra7.dtsi
.
ipu2: ipu@55020000 { compatible = "ti,dra7-rproc-ipu";
In the sections below, 55020000.ipu
will be used as the example. For a specific use case, please select the corresponding argument which is applicable.
Unloading and loading remotecores at runtime[edit]
It is possible to unload and reload a remotecore at runtime from Linux using the sysfs
interface.
target $ cd /sys/bus/platform/drivers/omap-rproc/ target $ echo 55020000.ipu > unbind target $ echo 55020000.ipu > bind
The echo 55020000.ipu > unbind
command tears down the communication channels between the A15 and the remotecore and unloads the remotecore. Any application level shutdown that needs to be performed needs to be handled by the system integrator.
The echo 55020000.ipu > bind
loads the appropriate firmware binary onto the remotecore.
Changing the remotecore binary at runtime[edit]
To change the remotecore binary at runtime
- Unload the remotecore using
unbind
. - Change the remotecore binary in the firmware folder. Default location is
/lib/firmware
on the target filesystem. - Load the remotecore using
bind
.
target $ cd /sys/bus/platform/drivers/omap-rproc/ target $ echo 55020000.ipu > unbind target $ cp /home/root/new-binary.xem4 /lib/firmware/dra7-ipu2-fw.xem4 target $ echo 55020000.ipu > bind
If it is desirable to avoid overwriting the existing remote binaries, the method of symbolic links can be used instead of direct copy. For example, Processor SDK provides two types of DSP remotecore binaries: one for DSPDCE (dra7-dsp1-fw.xe66.dspdce-fw) and another one for OpenCL (dra7-dsp1-fw.xe66.opencl-monitor). dra7-dsp1-fw.xe66 is created as a symbolic link by default pointing to the OpenCL binary. When it is needed to switch to DSPDCE, the symbolic link of dra7-dsp1-fw.xe66 can be updated pointing to dra7-dsp1-fw.xe66.dspdce-fw.
target $ cd /sys/bus/platform/drivers/omap-rproc/ target $ echo 40800000.dsp > unbind target $ rm /lib/firmware/dra7-dsp1-fw.xe66 target $ ln -s /lib/firmware/dra7-dsp1-fw.xe66.dspdce-fw /lib/firmware/dra7-dsp1-fw.xe66 target $ echo 40800000.dsp > bind
After the switch, copycodectest application can be run to verify that DSPDCE firmware is loaded. This application fills the input buffer with a number entered as the argument and after process the output buffer is tested for the same pattern.
usage: copycodectest pattern.
Example:
target # copycodectest 123
Sample console output:
root@am57xx-evm:~# copycodectest 123 0x22070: Opening Engine.. Created dsp_universalCopy Fill input buffer with pattern 123 Verifing the UniversalCopy algorithm copycodectest executed successfully
Loading firmware during initial boot without using udev[edit]
During the default boot, firmware is supplied to the kernel by udev
. Starting the udev
service on boot causes a few seconds increase in boot time. In cases where a quick boot is required, the user may not start the udev
service in boot. In such cases, firmware can be supplied to the kernel using the sysfs interface. An example script is shown below.
FW_NAMES="dra7-dsp1-fw.xe66 dra7-dsp2-fw.xe66 dra7-ipu1-fw.xem4 dra7-ipu2-fw.xem4" for FW in $FW_NAMES ; do echo 1 > /sys/class/firmware/$FW/loading cat /lib/firmware/$FW > /sys/class/firmware/$FW/data echo 0 > /sys/class/firmware/$FW/loading done