ti-hw-bringup-image: ship musb workaround
[glsdk/meta-ti-glsdk.git] / recipes-ti / codec-engine / ti-codec-engine.inc
1 DESCRIPTION = "Codec Engine for TI ARM/DSP processors"
2 HOMEPAGE = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ce"
3 SECTION = "devel"
4 LICENSE = "BSD"
6 LIC_FILES_CHKSUM = "file://codec_engine_2_26_02_11_manifest.html;md5=912535f1b02ecf329a3979bf313f91e0"
8 # TODO :: Add Codec Engine Library Rebuild
9 # TODO :: Add Examples APP_LOCAL build as well?
10 # TODO :: Check DEPENDS - are the DSP side packages required for ARM-only products?
12 require recipes-ti/includes/ti-paths.inc
13 require recipes-ti/includes/ti-staging.inc
15 PROVIDES += "ti-codec-engine-examples"
17 PR = "${MACHINE_KERNEL_PR}"
18 PR_append = "a"
20 S = "${WORKDIR}/codec_engine_${PV}"
22 SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ce/${PV}/exports/codec_engine_${PV},lite.tar.gz;name=cetarball "
24 DEPENDS = "ti-framework-components ti-xdais ti-xdctools ti-linuxutils"
25 DEPENDS_append_dm6446   = " ti-dspbios ti-dsplink ti-local-power-manager ti-cgt6x ti-biosutils ti-edma3lld"
26 DEPENDS_append_dm6467   = " ti-dspbios ti-dsplink ti-cgt6x ti-biosutils ti-edma3lld"
27 DEPENDS_append_omap3    = " ti-dspbios ti-dsplink ti-local-power-manager ti-cgt6x ti-biosutils ti-edma3lld"
28 DEPENDS_append_omapl137 = " ti-dspbios ti-dsplink ti-cgt6x ti-biosutils ti-edma3lld"
29 DEPENDS_append_omapl138 = " ti-dspbios ti-dsplink ti-cgt6x ti-biosutils ti-edma3lld"
31 # SOC_FAMILY configuration
33 # Define DEVICES variable
34 CEEXAMPLESDEVICES_dm6446     = "DM6446"
35 CEEXAMPLESDEVICES_dm6467     = "DM6467"
36 CEEXAMPLESDEVICES_omap3      = "OMAP3530"
37 CEEXAMPLESDEVICES_dm355      = "DM355"
38 CEEXAMPLESDEVICES_dm365      = "DM365"
39 CEEXAMPLESDEVICES_omapl137   = "OMAPL137"
40 CEEXAMPLESDEVICES_omapl138   = "OMAPL138"
41 CEEXAMPLESDEVICES           ?= "<UNDEFINED_CEEXAMPLESDEVICES>"
43 # Define GPPOS variable
44 CEEXAMPLESGPPOS_dm6446       = "LINUX_GCC"
45 CEEXAMPLESGPPOS_dm6467       = "LINUX_GCC"
46 CEEXAMPLESGPPOS_omap3        = "LINUX_GCC"
47 CEEXAMPLESGPPOS_dm355        = "LINUX_GCC"
48 CEEXAMPLESGPPOS_dm365        = "LINUX_GCC"
49 CEEXAMPLESGPPOS_omapl137     = "LINUX_GCC"
50 CEEXAMPLESGPPOS_omapl138     = "LINUX_GCC"
51 CEEXAMPLESGPPOS             ?= "<UNDEFINED_CEEXAMPLESGPPOS>"
53 # Define PROGRAM variable
54 CEEXAMPLESPROGRAMS_dm6446    = "APP_CLIENT DSP_SERVER"
55 CEEXAMPLESPROGRAMS_dm6467    = "APP_CLIENT DSP_SERVER"
56 CEEXAMPLESPROGRAMS_omap3     = "APP_CLIENT DSP_SERVER"
57 CEEXAMPLESPROGRAMS_dm355     = "APP_LOCAL"
58 CEEXAMPLESPROGRAMS_dm365     = "APP_LOCAL"
59 CEEXAMPLESPROGRAMS_omapl137  = "APP_CLIENT DSP_SERVER"
60 CEEXAMPLESPROGRAMS_omapl138  = "APP_CLIENT DSP_SERVER"
61 CEEXAMPLESPROGRAMS          ?= "<UNDEFINED_CEEXAMPLESPROGRAMS>"
63 do_configure() {
65     # No way to pass this via ENV?
66     sed -i  \
67         -e s:arm-none-linux-gnueabi-:${TARGET_PREFIX}:g \
68         ${S}/examples/xdcpaths.mak
70     # compiler is not under ${TOOLCHAIN_PATH}/bin anymore...
71     sed -i  \
72         -e s:bin/${TARGET_PREFIX}gcc:${TARGET_PREFIX}gcc:g \
73         ${S}/examples/xdcpaths.mak
75     # ... and ar is not there too
76 #    sed -i  \
77 #        -e s:/arm-angstrom-linux-gnueabi/bin/ar:/arm-angstrom-linux-gnueabi-ar:g \
78 #        ${S}/examples/ti/xdais/dm/examples/viddec1_copy/package.mak
79 }
81 do_prepsources() {
83         for i in codecs extensions servers apps ; do
84                 cd ${S}/examples/ti/sdo/ce/examples/$i
85                 make DEVICES="${CEEXAMPLESDEVICES}" \
86                      GPPOS="${CEEXAMPLESGPPOS}" \
87                      PROGRAMS="${CEEXAMPLESPROGRAMS}" \
88                      CE_INSTALL_DIR="${S}" \
89                      XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" \
90                      BIOS_INSTALL_DIR="${BIOS_INSTALL_DIR}" \
91                      BIOSUTILS_INSTALL_DIR="${BIOSUTILS_INSTALL_DIR}" \
92                      DSPLINK_INSTALL_DIR="${LINK_INSTALL_DIR}" \
93                      XDAIS_INSTALL_DIR="${XDAIS_INSTALL_DIR}" \
94                      FC_INSTALL_DIR="${FC_INSTALL_DIR}" \
95                      CMEM_INSTALL_DIR="${CMEM_INSTALL_DIR}" \
96                      LPM_INSTALL_DIR="${LPM_INSTALL_DIR}" \
97                      EDMA3_LLD_INSTALL_DIR="${EDMA3_LLD_INSTALL_DIR}" \
98                      CGTOOLS_V5T="${TOOLCHAIN_PATH}" \
99                      CGTOOLS_C64P="${CODEGEN_INSTALL_DIR}" \
100                      CGTOOLS_C674="${CODEGEN_INSTALL_DIR}" \
101                      clean
102                      # '.make' target was used in CE < 2.26, but its no longer
103                      # supported in CE >= 2.26. Now we are moved to >=2.26 
104                      # hence commenting out the .make target.
105                      # .make clean
106         done
109 addtask prepsources after do_configure before do_compile
111 do_compile () {
113         for i in codecs extensions servers apps ; do
114                 cd ${S}/examples/ti/sdo/ce/examples/$i
115                 make DEVICES="${CEEXAMPLESDEVICES}" \
116                      GPPOS="${CEEXAMPLESGPPOS}" \
117                      PROGRAMS="${CEEXAMPLESPROGRAMS}" \
118                      CE_INSTALL_DIR="${S}" \
119                      XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" \
120                      BIOS_INSTALL_DIR="${BIOS_INSTALL_DIR}" \
121                      BIOSUTILS_INSTALL_DIR="${BIOSUTILS_INSTALL_DIR}" \
122                      DSPLINK_INSTALL_DIR="${LINK_INSTALL_DIR}" \
123                      XDAIS_INSTALL_DIR="${XDAIS_INSTALL_DIR}" \
124                      FC_INSTALL_DIR="${FC_INSTALL_DIR}" \
125                      CMEM_INSTALL_DIR="${CMEM_INSTALL_DIR}" \
126                      LPM_INSTALL_DIR="${LPM_INSTALL_DIR}" \
127                      EDMA3_LLD_INSTALL_DIR="${EDMA3_LLD_INSTALL_DIR}" \
128                      CGTOOLS_V5T="${TOOLCHAIN_PATH}" \
129                      CGTOOLS_C64P="${CODEGEN_INSTALL_DIR}" \
130                      CGTOOLS_C674="${CODEGEN_INSTALL_DIR}" \
131                      all
132         done
135 do_install() {
137         install -d ${D}/${installdir}/ti-codec-engine-examples
138         if [ -e ${S}/examples/apps/system_files/${CEEXAMPLESDEVICES}/loadmodules.sh ]; then
139                 cp ${S}/examples/apps/system_files/${CEEXAMPLESDEVICES}/loadmodules.sh ${D}/${installdir}/ti-codec-engine-examples
140         elif [ -e ${WORKDIR}/loadmodules.sh ]; then
141                 cp ${WORKDIR}/loadmodules.sh ${D}/${installdir}/ti-codec-engine-examples
142         fi
144         cd ${S}/examples/ti/sdo/ce/examples
146         # Install the apps, servers and test data, mirroring the source directory structure
147         #  - Put the servers inside the same folder as the executable
148         #  - TODO - Check nested dirs (e.g. dualcpu_separateconfig)
150         # Put all servers in separate tree.
151         for i in $(find . -name "*.${DSPSUFFIX}"); do
152                 install -d ${D}/${installdir}/ti-codec-engine-examples/servers/`dirname ${i} | cut -f3 -d /`
153                 install ${i} ${D}/${installdir}/ti-codec-engine-examples/servers/`dirname ${i} | cut -f3 -d /`
154         done
156         for i in $(find . -name "*.xv5T"); do
157                 install -d ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
158                 install ${i} ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
159         done
161         for i in $(find . -name "*.dat"); do
162                 install -d ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
163                 install ${i} ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
164         done
166         # For each directory, softlink to the app server, except special cases
167         cd ${D}/${installdir}/ti-codec-engine-examples
168         for i in $(find . -type d | grep -v servers); do
169                 {
170                 pwd
171                 cd ${D}/${installdir}/ti-codec-engine-examples/$i
172                 if [ $(basename $i) = "audio1_ires" ] ; then 
173                         ln -s ../servers/audio1_ires/audio1_ires.${DSPSUFFIX}
174                 elif [ $(basename $i) = "server_api_example" ] ; then
175                         ln -s ../servers/server_api_example/audio_copy.${DSPSUFFIX}
176                 elif [ $(basename $i) != "." ] ; then
177                         ln -s ../servers/all_codecs/all.${DSPSUFFIX}
178                 else
179                         echo Skipping $i
180                 fi
181                 }
182         done
184         # Install/Stage the Source Tree
185         install -d ${D}${CE_INSTALL_DIR_RECIPE}
186         cp -pPrf ${S}/* ${D}${CE_INSTALL_DIR_RECIPE}
189 PACKAGE_ARCH = "${MACHINE_ARCH}"
191 PACKAGES += "ti-codec-engine-examples"
193 RDEPENDS_ti-codec-engine-examples                 = " ti-cmem-module"
194 RDEPENDS_ti-codec-engine-examples_append_dm6446   = " ti-dsplink-module ti-lpm-module"
195 RDEPENDS_ti-codec-engine-examples_append_dm6467   = " ti-dsplink-module"
196 RDEPENDS_ti-codec-engine-examples_append_omap3    = " ti-dsplink-module ti-lpm-module"
197 RDEPENDS_ti-codec-engine-examples_append_omapl137 = " ti-dsplink-module"
198 RDEPENDS_ti-codec-engine-examples_append_omapl138 = " ti-dsplink-module"
199 FILES_ti-codec-engine-examples = "${installdir}/ti-codec-engine-examples/*"
200 INSANE_SKIP_ti-codec-engine-examples = True
202 FILES_${PN}-dbg += "${installdir}/ti-codec-engine-examples/*/.debug"