summaryrefslogtreecommitdiff
path: root/recipes/ti/ti-codec-engine.inc
blob: dc5294a927aeb3d84de0dde7d571fc410690c4be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
DESCRIPTION = "Codec Engine for TI ARM/DSP processors"
HOMEPAGE = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ce"
SECTION = "devel"

# TODO :: Add Codec Engine Library Rebuild
# TODO :: Add Examples APP_LOCAL build as well?
# TODO :: Check DEPENDS - are the DSP side packages required for ARM-only products?

require ti-paths.inc
require ti-staging.inc

PROVIDES += "ti-codec-engine-examples"

PR = "r3"

S = "${WORKDIR}/codec_engine_${PV}"

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"

DEPENDS = "ti-framework-components ti-xdais ti-xdctools ti-cgt6x ti-biosutils ti-edma3lld ti-linuxutils"
DEPENDS_append_dm6446 	= " ti-dspbios ti-dsplink ti-local-power-manager"
DEPENDS_append_dm6467 	= " ti-dspbios ti-dsplink"
DEPENDS_append_omap3   	= " ti-dspbios ti-dsplink ti-local-power-manager"
DEPENDS_append_omapl137 = " ti-dspbios ti-dsplink"
DEPENDS_append_omapl138 = " ti-dspbios ti-dsplink"

# SOC_FAMILY configuration

# Define DEVICES variable
CEEXAMPLESDEVICES_dm6446     = "DM6446"
CEEXAMPLESDEVICES_dm6467     = "DM6467"
CEEXAMPLESDEVICES_omap3      = "OMAP3530"
CEEXAMPLESDEVICES_dm355      = "DM355"
CEEXAMPLESDEVICES_dm365      = "DM365"
CEEXAMPLESDEVICES_omapl137   = "OMAPL137"
CEEXAMPLESDEVICES_omapl138   = "OMAPL138"
CEEXAMPLESDEVICES           ?= "<UNDEFINED_CEEXAMPLESDEVICES>"

# Define GPPOS variable
CEEXAMPLESGPPOS_dm6446       = "LINUX_GCC"
CEEXAMPLESGPPOS_dm6467       = "LINUX_GCC"
CEEXAMPLESGPPOS_omap3        = "LINUX_GCC"
CEEXAMPLESGPPOS_dm355        = "LINUX_GCC"
CEEXAMPLESGPPOS_dm365        = "LINUX_GCC"
CEEXAMPLESGPPOS_omapl137     = "LINUX_GCC"
CEEXAMPLESGPPOS_omapl138     = "LINUX_GCC"
CEEXAMPLESGPPOS             ?= "<UNDEFINED_CEEXAMPLESGPPOS>"

# Define PROGRAM variable
CEEXAMPLESPROGRAMS_dm6446    = "APP_CLIENT DSP_SERVER"
CEEXAMPLESPROGRAMS_dm6467    = "APP_CLIENT DSP_SERVER"
CEEXAMPLESPROGRAMS_omap3     = "APP_CLIENT DSP_SERVER"
CEEXAMPLESPROGRAMS_dm355     = "APP_LOCAL"
CEEXAMPLESPROGRAMS_dm365     = "APP_LOCAL"
CEEXAMPLESPROGRAMS_omapl137  = "APP_CLIENT DSP_SERVER"
CEEXAMPLESPROGRAMS_omapl138  = "APP_CLIENT DSP_SERVER"
CEEXAMPLESPROGRAMS          ?= "<UNDEFINED_CEEXAMPLESPROGRAMS>"

do_configure() {

    # No way to pass this via ENV?
    sed -i  \
        -e s:arm-none-linux-gnueabi-:${TARGET_PREFIX}:g \
        ${S}/examples/xdcpaths.mak
}

do_prepsources() {

        for i in codecs extensions servers apps ; do
                cd ${S}/examples/ti/sdo/ce/examples/$i
                make DEVICES="${CEEXAMPLESDEVICES}" \
                     GPPOS="${CEEXAMPLESGPPOS}" \
                     PROGRAMS="${CEEXAMPLESPROGRAMS}" \
                     CE_INSTALL_DIR="${S}" \
                     XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" \
                     BIOS_INSTALL_DIR="${BIOS_INSTALL_DIR}" \
                     BIOSUTILS_INSTALL_DIR="${BIOSUTILS_INSTALL_DIR}" \
		     DSPLINK_INSTALL_DIR="${LINK_INSTALL_DIR}" \
                     XDAIS_INSTALL_DIR="${XDAIS_INSTALL_DIR}" \
                     FC_INSTALL_DIR="${FC_INSTALL_DIR}" \
                     CMEM_INSTALL_DIR="${CMEM_INSTALL_DIR}" \
                     LPM_INSTALL_DIR="${LPM_INSTALL_DIR}" \
                     EDMA3_LLD_INSTALL_DIR="${EDMA3_LLD_INSTALL_DIR}" \
                     CGTOOLS_V5T="${TOOLCHAIN_PATH}" \
                     CGTOOLS_C64P="${CODEGEN_INSTALL_DIR}" \
                     CGTOOLS_C674="${CODEGEN_INSTALL_DIR}" \
                     clean
        done
}

addtask prepsources after do_configure before do_compile

do_compile () {

        for i in codecs extensions servers apps ; do
                cd ${S}/examples/ti/sdo/ce/examples/$i
                make DEVICES="${CEEXAMPLESDEVICES}" \
                     GPPOS="${CEEXAMPLESGPPOS}" \
                     PROGRAMS="${CEEXAMPLESPROGRAMS}" \
                     CE_INSTALL_DIR="${S}" \
                     XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" \
                     BIOS_INSTALL_DIR="${BIOS_INSTALL_DIR}" \
                     BIOSUTILS_INSTALL_DIR="${BIOSUTILS_INSTALL_DIR}" \
		     DSPLINK_INSTALL_DIR="${LINK_INSTALL_DIR}" \
                     XDAIS_INSTALL_DIR="${XDAIS_INSTALL_DIR}" \
                     FC_INSTALL_DIR="${FC_INSTALL_DIR}" \
                     CMEM_INSTALL_DIR="${CMEM_INSTALL_DIR}" \
                     LPM_INSTALL_DIR="${LPM_INSTALL_DIR}" \
                     EDMA3_LLD_INSTALL_DIR="${EDMA3_LLD_INSTALL_DIR}" \
                     CGTOOLS_V5T="${TOOLCHAIN_PATH}" \
                     CGTOOLS_C64P="${CODEGEN_INSTALL_DIR}" \
                     CGTOOLS_C674="${CODEGEN_INSTALL_DIR}" \
                     all
        done
}

do_install() {

	install -d ${D}/${installdir}/ti-codec-engine-examples
	if [ -e ${S}/examples/apps/system_files/${CEEXAMPLESDEVICES}/loadmodules.sh ]; then
		cp ${S}/examples/apps/system_files/${CEEXAMPLESDEVICES}/loadmodules.sh ${D}/${installdir}/ti-codec-engine-examples
	fi

	cd ${S}/examples/ti/sdo/ce/examples

	# Install the apps, servers and test data, mirroring the source directory structure
	#  - Put the servers inside the same folder as the executable
	#  - TODO - Check nested dirs (e.g. dualcpu_separateconfig)

        # Put all servers in separate tree.
        for i in $(find . -name "*.${DSPSUFFIX}"); do
                install -d ${D}/${installdir}/ti-codec-engine-examples/servers/`dirname ${i} | cut -f3 -d /`
                install ${i} ${D}/${installdir}/ti-codec-engine-examples/servers/`dirname ${i} | cut -f3 -d /`
        done

	for i in $(find . -name "*.xv5T"); do
		install -d ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
		install ${i} ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
	done

	for i in $(find . -name "*.dat"); do
		install -d ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
		install ${i} ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
        done

	# For each directory, softlink to the app server, except special cases
	cd ${D}/${installdir}/ti-codec-engine-examples
	for i in $(find . -type d | grep -v servers); do
		{
		pwd
		cd ${D}/${installdir}/ti-codec-engine-examples/$i
		if [ $(basename $i) == "audio1_ires" ] ; then 
			ln -s ../servers/audio1_ires/audio1_ires.${DSPSUFFIX}
		elif [ $(basename $i) == "server_api_example" ] ; then
			ln -s ../servers/server_api_example/audio_copy.${DSPSUFFIX}
                elif [ $(basename $i) != "." ] ; then
			ln -s ../servers/all_codecs/all.${DSPSUFFIX}
		else
			echo Skipping $i
		fi
		}
	done

        # Install/Stage the Source Tree
        install -d ${D}${CE_INSTALL_DIR_RECIPE}
        cp -pPrf ${S}/* ${D}${CE_INSTALL_DIR_RECIPE}
}

PACKAGES += "ti-codec-engine-examples"

RDEPENDS_ti-codec-engine-examples                 = " ti-cmem-module"
RDEPENDS_ti-codec-engine-examples_append_dm6446   = " ti-dsplink-module ti-lpm-module"
RDEPENDS_ti-codec-engine-examples_append_dm6467   = " ti-dsplink-module"
RDEPENDS_ti-codec-engine-examples_append_omap3    = " ti-dsplink-module ti-lpm-module"
RDEPENDS_ti-codec-engine-examples_append_omapl137 = " ti-dsplink-module"
RDEPENDS_ti-codec-engine-examples_append_omapl138 = " ti-dsplink-module"
FILES_ti-codec-engine-examples = "${installdir}/ti-codec-engine-examples/*"
INSANE_SKIP_ti-codec-engine-examples = True