diff options
Diffstat (limited to 'recipes-ti/codec-engine/ti-dmai.inc')
-rw-r--r-- | recipes-ti/codec-engine/ti-dmai.inc | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/recipes-ti/codec-engine/ti-dmai.inc b/recipes-ti/codec-engine/ti-dmai.inc new file mode 100644 index 00000000..d072ecd1 --- /dev/null +++ b/recipes-ti/codec-engine/ti-dmai.inc | |||
@@ -0,0 +1,158 @@ | |||
1 | DESCRIPTION = "Davinci Multimedia Application Interface (DMAI) for TI ARM/DSP processors" | ||
2 | HOMEPAGE = "https://gforge.ti.com/gf/project/dmai/" | ||
3 | SECTION = "multimedia" | ||
4 | LICENSE = "BSD" | ||
5 | |||
6 | # TODO :: | ||
7 | |||
8 | require recipes-ti/includes/ti-paths.inc | ||
9 | require recipes-ti/includes/ti-staging.inc | ||
10 | |||
11 | PROVIDES += "ti-dmai-apps" | ||
12 | |||
13 | PE = "1" | ||
14 | |||
15 | SRCREV ?= "<UNDEFINED_SRCREV>" | ||
16 | DMAIBRANCH ?= "<UNDEFINED_DMAIBRANCH>" | ||
17 | |||
18 | S = "${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/dmai_${PV}" | ||
19 | |||
20 | SRC_URI = "svn://gforge.ti.com/svn/dmai/;module=${DMAIBRANCH};proto=https;user=anonymous;pswd='' \ | ||
21 | file://loadmodules-ti-dmai-dm6446_al.sh \ | ||
22 | file://loadmodules-ti-dmai-dm6467_al.sh \ | ||
23 | file://loadmodules-ti-dmai-o3530_al.sh \ | ||
24 | file://loadmodules-ti-dmai-dm355_al.sh \ | ||
25 | file://loadmodules-ti-dmai-dm365_al.sh \ | ||
26 | file://loadmodules-ti-dmai-ol137_al.sh \ | ||
27 | file://loadmodules-ti-dmai-ol138_al.sh \ | ||
28 | file://doxygen_templates.tar.gz \ | ||
29 | file://arago-tdox \ | ||
30 | " | ||
31 | |||
32 | DEPENDS = "virtual/kernel alsa-lib ti-framework-components ti-codec-engine ti-xdctools" | ||
33 | |||
34 | DEPENDS_append_dm6446 = " ti-codecs-dm6446 ti-dspbios ti-cgt6x ti-linuxutils" | ||
35 | DEPENDS_append_dm6467 = " ti-codecs-dm6467 ti-dspbios ti-cgt6x ti-linuxutils" | ||
36 | DEPENDS_append_omap3 = " ti-codecs-omap3530 ti-dspbios ti-cgt6x ti-linuxutils" | ||
37 | DEPENDS_append_dm355 = " ti-codecs-dm355" | ||
38 | DEPENDS_append_dm365 = " ti-codecs-dm365" | ||
39 | DEPENDS_append_omapl137 = " ti-codecs-omapl137 ti-dspbios ti-cgt6x ti-linuxutils" | ||
40 | DEPENDS_append_omapl138 = " ti-codecs-omapl138 ti-dspbios ti-cgt6x ti-linuxutils" | ||
41 | |||
42 | # Define DMAI build time variables | ||
43 | DMAIPLATFORM_dm6446 = "dm6446_al" | ||
44 | DMAIPLATFORM_dm6467 = "dm6467_al" | ||
45 | DMAIPLATFORM_omap3 = "o3530_al" | ||
46 | DMAIPLATFORM_dm355 = "dm355_al" | ||
47 | DMAIPLATFORM_dm365 = "dm365_al" | ||
48 | DMAIPLATFORM_omapl137 = "ol137_al" | ||
49 | DMAIPLATFORM_omapl138 = "ol138_al" | ||
50 | DMAIPLATFORM ?= "<UNDEFINED_DMAIPLATFORM>" | ||
51 | |||
52 | # Need to set this for other platforms as well | ||
53 | #GPPOS_dm355 = "LINUX_GCC" | ||
54 | #GPPOS_dm365 = "LINUX_GCC" | ||
55 | #GPPOS ?= "<UNDEFINEDGPPOS>" | ||
56 | |||
57 | # Need to re-define this for OMAP-L137/L138 | ||
58 | DSPSUFFIX_omapl137 = "x64P" | ||
59 | DSPSUFFIX_omapl138 = "x64P" | ||
60 | DSPSUFFIX ?= "x64p" | ||
61 | |||
62 | # This is needed for dm355/dm365 targets in order to find ti.sdo.codecs.g711 | ||
63 | # TODO :: review - should we just pass this in do_compile? | ||
64 | USER_XDC_PATH = "${CE_INSTALL_DIR}/examples" | ||
65 | |||
66 | PARALLEL_MAKE = "" | ||
67 | |||
68 | do_prepsources() { | ||
69 | # run the release steps - this will delete .svn file and run doxygen to | ||
70 | # generate proper documentation of the source etc. | ||
71 | find ${WORKDIR}/${DMAIBRANCH} -name .svn -type d | xargs rm -rf | ||
72 | cp -pPrf ${WORKDIR}/doxygen_templates ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface | ||
73 | cp -pPrf ${WORKDIR}/arago-tdox ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/tdox | ||
74 | chmod a+x ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/release.sh | ||
75 | chmod a+x ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/tdox | ||
76 | sed -i 's|tdox|./tdox|g' ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/release.sh | ||
77 | (cd ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface; ./release.sh ${PV}) | ||
78 | } | ||
79 | |||
80 | # run prepare sources before do_patch to ensure that sourceipk picks the right sources. | ||
81 | addtask prepsources after do_unpack before do_patch | ||
82 | |||
83 | do_compile () { | ||
84 | # Recent kernel headers warn against inclusion from userspace | ||
85 | for makefile in $(find ${S} -name "Makefile") ; do | ||
86 | sed -i -e s:-Werror::g $makefile | ||
87 | done | ||
88 | |||
89 | # Angstrom 2008 breaks with -Wl,-T, while angstrom 2010 needs it | ||
90 | if [ $(${TARGET_PREFIX}gcc -dumpversion | awk -F. '{print $2}') -gt 3 ] ; then | ||
91 | # Fix up linkerscripts, recent toolchains need -T to prepend the default script to the custom one | ||
92 | for appmakefile in $(find ${S} -name "Makefile.app") ; do | ||
93 | sed -i -e 's: $(XDC_CFG)/linker.cmd: -Wl,-T,$(XDC_CFG)/linker.cmd:g' $appmakefile | ||
94 | done | ||
95 | fi | ||
96 | |||
97 | # TODO :: Why do we do this? | ||
98 | unset DMAI_INSTALL_DIR | ||
99 | cd ${S} | ||
100 | |||
101 | make XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" PLATFORM="${DMAIPLATFORM}" clean | ||
102 | |||
103 | for dir in ${S}; do | ||
104 | cd $dir | ||
105 | # TODO: Figure out how to pass the alsa require location, currently | ||
106 | # LINUXLIBS_INSTALL_DIR is hard-coded for armv5te | ||
107 | make \ | ||
108 | CE_INSTALL_DIR="${CE_INSTALL_DIR}" \ | ||
109 | CODEC_INSTALL_DIR="${CODEC_INSTALL_DIR}" \ | ||
110 | FC_INSTALL_DIR="${FC_INSTALL_DIR}" \ | ||
111 | LINUXKERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" \ | ||
112 | XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" \ | ||
113 | CODEGEN_INSTALL_DIR="${CODEGEN_INSTALL_DIR}" \ | ||
114 | BIOS_INSTALL_DIR="${BIOS_INSTALL_DIR}"\ | ||
115 | LINUXLIBS_INSTALL_DIR="${STAGING_DIR_TARGET}/usr" \ | ||
116 | USER_XDC_PATH="${USER_XDC_PATH}" \ | ||
117 | CROSS_COMPILE="${TOOLCHAIN_PATH}/bin/${TARGET_PREFIX}" \ | ||
118 | VERBOSE="true" \ | ||
119 | XDAIS_INSTALL_DIR="${XDAIS_INSTALL_DIR}" \ | ||
120 | LINK_INSTALL_DIR="${LINK_INSTALL_DIR}" \ | ||
121 | CMEM_INSTALL_DIR="${CMEM_INSTALL_DIR}" \ | ||
122 | LPM_INSTALL_DIR="${LPM_INSTALL_DIR}" \ | ||
123 | C6ACCEL_INSTALL_DIR=${C6ACCEL_INSTALL_DIR} \ | ||
124 | MVTOOL_PREFIX="${TARGET_PREFIX}" \ | ||
125 | PLATFORM="${DMAIPLATFORM}" | ||
126 | done | ||
127 | } | ||
128 | |||
129 | do_install () { | ||
130 | |||
131 | # TODO :: Why do we do this? | ||
132 | unset DMAI_INSTALL_DIR | ||
133 | |||
134 | install -d ${D}/${installdir}/ti-dmai-apps | ||
135 | cd ${S} | ||
136 | make PLATFORM="${DMAIPLATFORM}" EXEC_DIR=${D}/${installdir}/ti-dmai-apps install | ||
137 | install -m 0755 ${WORKDIR}/loadmodules-ti-dmai-${DMAIPLATFORM}.sh ${D}/${installdir}/ti-dmai-apps/loadmodules.sh | ||
138 | |||
139 | install -d ${D}${DMAI_INSTALL_DIR_RECIPE} | ||
140 | cp -pPrf ${S}/* ${D}${DMAI_INSTALL_DIR_RECIPE} | ||
141 | } | ||
142 | |||
143 | PACKAGES += "ti-dmai-apps" | ||
144 | FILES_ti-dmai-apps = "${installdir}/ti-dmai-apps/*" | ||
145 | INSANE_SKIP_ti-dmai-apps = True | ||
146 | |||
147 | RDEPENDS_ti-dmai-apps_dm6446 += "ti-codecs-dm6446-server ti-cmem-module ti-dsplink-module" | ||
148 | RDEPENDS_ti-dmai-apps_dm6467 += "ti-codecs-dm6467 ti-cmem-module ti-dsplink-module" | ||
149 | RDEPENDS_ti-dmai-apps_omap3 += "ti-codecs-omap3530-server ti-cmem-module ti-dsplink-module ti-lpm-module ti-sdma-module" | ||
150 | RDEPENDS_ti-dmai-apps_dm355 += "ti-codecs-dm355 ti-cmem-module ti-dm355mm-module" | ||
151 | RDEPENDS_ti-dmai-apps_dm365 += "ti-codecs-dm365 ti-cmem-module ti-dm365mm-module ti-edma-module ti-irq-module" | ||
152 | RDEPENDS_ti-dmai-apps_omapl137 += "ti-codecs-omapl137-server ti-cmem-module ti-dsplink-module" | ||
153 | RDEPENDS_ti-dmai-apps_omapl138 += "ti-codecs-omapl138-server ti-cmem-module ti-dsplink-module" | ||
154 | |||
155 | pkg_postinst_ti-dmai-apps () { | ||
156 | ln -sf ${installdir}/ti-codecs-server/*.${DSPSUFFIX} ${installdir}/ti-dmai-apps/ | ||
157 | } | ||
158 | |||