summaryrefslogtreecommitdiffstats
path: root/recipes-ti/dsplink/ti-dsplink.inc
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-03-14 19:10:15 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2011-03-14 19:10:15 +0100
commitc1af7e34f0f780e7fdd93a529445fedb3057c5f3 (patch)
tree5c5d1a77cd2d492cbce4f2bf7823bf02b3764474 /recipes-ti/dsplink/ti-dsplink.inc
parent4884692d7f6b9cc76ab3535fc0790a148b1137f6 (diff)
downloadmeta-ti-c1af7e34f0f780e7fdd93a529445fedb3057c5f3.tar.gz
recipes-ti: initial check in of dsplink stack
* the focus was on to get it to build, not to make the recipes perfect Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes-ti/dsplink/ti-dsplink.inc')
-rw-r--r--recipes-ti/dsplink/ti-dsplink.inc208
1 files changed, 208 insertions, 0 deletions
diff --git a/recipes-ti/dsplink/ti-dsplink.inc b/recipes-ti/dsplink/ti-dsplink.inc
new file mode 100644
index 00000000..396b3561
--- /dev/null
+++ b/recipes-ti/dsplink/ti-dsplink.inc
@@ -0,0 +1,208 @@
1DESCRIPTION = "DSPLINK Inter-Processor Communications (IPC) for TI ARM/DSP processors"
2HOMEPAGE = "http://software-dl.ti.com/dsps/dsps_public_sw/DSPLink/index.html"
3SECTION = "devel"
4LICENSE = "GPLv2"
5
6LIC_FILES_CHKSUM = "file://dsplink/doc/gpl_2.0.pdf;md5=70996be607b61df78ce46093f4afe2bd"
7
8
9# TODO :: KERNEL_CC, should use for kernel cc for module build?
10# TODO :: Need to understand why OBJDUMP is required for kernel module
11# TODO :: Unset required since LDFLAGS gets picked up and used incorrectly - investigate
12# TODO :: Do we need to pass so many variables to each make step?
13
14require ../includes/ti-paths.inc
15require ../includes/ti-staging.inc
16
17PROVIDES = "ti-dsplink-module"
18PROVIDES += "ti-dsplink-examples"
19
20# This package builds a kernel module, use kernel PR as base and append a local version
21PR = "${MACHINE_KERNEL_PR}"
22PR_append = "i"
23
24S = "${WORKDIR}/dsplink_linux_${PV}"
25
26SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/${PV_DL_PATH}/dsplink_linux_${PV}.tar.gz;name=dsplinktarball \
27 file://ti-dsplink-examples-run.sh \
28 file://ti-dsplink-examples-loadmodules.sh \
29 file://ti-dsplink-examples-unloadmodules.sh "
30
31DEPENDS = "ti-dspbios ti-xdctools ti-cgt6x"
32DEPENDS += "virtual/kernel perl-native"
33
34# SOC_FAMILY configuration
35
36DSPLINKPLATFORM_dm6446 = "DAVINCI"
37DSPLINKPLATFORM_dm6467 = "DAVINCIHD"
38DSPLINKPLATFORM_omapl137 = "OMAPL1XX"
39DSPLINKPLATFORM_omapl138 = "OMAPL138"
40DSPLINKPLATFORM_omap3 = "OMAP3530"
41DSPLINKPLATFORM ?= "<UNDEFINED_DSPLINKPLATFORM>"
42
43DSPLINKDSPCFG_dm6446 = "DM6446GEMSHMEM"
44DSPLINKDSPCFG_dm6467 = "DM6467GEMSHMEM"
45DSPLINKDSPCFG_omapl137 = "OMAPL1XXGEMSHMEM"
46DSPLINKDSPCFG_omapl138 = "OMAPL138GEMSHMEM"
47DSPLINKDSPCFG_omap3 = "OMAP3530SHMEM"
48DSPLINKDSPCFG ?= "<UNDEFINED_DSPLINKDSPCFG>"
49
50DSPLINKDSP_dm6446 = "DM6446GEM_0"
51DSPLINKDSP_dm6467 = "DM6467GEM_0"
52DSPLINKDSP_omapl137 = "OMAPL1XXGEM_0"
53DSPLINKDSP_omapl138 = "OMAPL138GEM_0"
54DSPLINKDSP_omap3 = "OMAP3530_0"
55DSPLINKDSP ?= "<UNDEFINED_DSPLINKDSP>"
56
57DSPLINKGPPOS_dm6446 = "DM6446LSP"
58DSPLINKGPPOS_dm6467 = "DM6467LSP"
59DSPLINKGPPOS_omapl137 = "ARM"
60DSPLINKGPPOS_omapl138 = "ARM"
61DSPLINKGPPOS_omap3 = "OMAPLSP"
62DSPLINKGPPOS ?= "<DEFINED_DSPLINKGPPOS>"
63
64# Exported Variable needed by build
65DSPLINK = "${S}/dsplink"
66export DSPLINK
67
68do_configure() {
69
70 # Run perl script to create appropriate makefiles (v1.60 and up)
71 (
72 cd ${DSPLINK}
73 perl config/bin/dsplinkcfg.pl --platform=${DSPLINKPLATFORM} --nodsp=1 \
74 --dspcfg_0=${DSPLINKDSPCFG} --dspos_0=DSPBIOS5XX \
75 --gppos=${DSPLINKGPPOS} --comps=ponslrmc
76 )
77}
78
79do_prepsources () {
80
81 # Prepare the tree for rebuiling - clean and generate interfaces
82 XDCPATH=${DSPLINK} ${XDC_INSTALL_DIR}/xdc .make -PR .
83 XDCPATH=${DSPLINK} ${XDC_INSTALL_DIR}/xdc clean -PR .
84 XDCPATH=${DSPLINK} ${XDC_INSTALL_DIR}/xdc .interfaces -PR .
85}
86
87addtask prepsources after do_configure before do_compile
88
89do_compile() {
90 # TODO :: KERNEL_CC, should use for kernel module build?
91 # TODO :: Need to understand why OBJDUMP is required for kernel module
92 # Unset these since LDFLAGS gets picked up and used incorrectly.... need
93 # investigation
94
95 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
96
97 # Build the gpp user space library
98 cd ${DSPLINK}/gpp/src/api && make \
99 CROSS_COMPILE="${TARGET_PREFIX}" \
100 CC="${TOOLCHAIN_PATH}/${TARGET_PREFIX}gcc" \
101 AR="${TOOLCHAIN_PATH}/${TARGET_PREFIX}ar" \
102 LD="${TOOLCHAIN_PATH}/${TARGET_PREFIX}ld" \
103 COMPILER="${TOOLCHAIN_PATH}/${TARGET_PREFIX}gcc" \
104 ARCHIVER="${TOOLCHAIN_PATH}/${TARGET_PREFIX}ar" \
105 KERNEL_DIR="${STAGING_KERNEL_DIR}" \
106 all
107
108 # Build the gpp kernel space (debug and release)
109 cd ${DSPLINK}/gpp/src && make \
110 OBJDUMP="${TARGET_PREFIX}objdump" \
111 CROSS_COMPILE="${TARGET_PREFIX}" \
112 CC="${TOOLCHAIN_PATH}/${TARGET_PREFIX}gcc" \
113 AR="${TOOLCHAIN_PATH}/${TARGET_PREFIX}ar" \
114 LD="${TOOLCHAIN_PATH}/${TARGET_PREFIX}ld" \
115 COMPILER="${TOOLCHAIN_PATH}/${TARGET_PREFIX}gcc" \
116 ARCHIVER="${TOOLCHAIN_PATH}/${TARGET_PREFIX}ar" \
117 KERNEL_DIR="${STAGING_KERNEL_DIR}" \
118 BASE_BUILDOS="${STAGING_KERNEL_DIR}" \
119 all
120
121 # Build the gpp samples
122 cd ${DSPLINK}/gpp/src/samples && make \
123 BASE_TOOLCHAIN="${TOOLCHAIN_PATH}" \
124 BASE_CGTOOLS="${BASE_TOOLCHAIN}/bin" \
125 OSINC_PLATFORM="${TOOLCHAIN_PATH}/lib/gcc/${TARGET_SYS}/$(${TARGET_PREFIX}gcc -dumpversion)/include" \
126 OSINC_TARGET="${BASE_TOOLCHAIN}/target/usr/include" \
127 CROSS_COMPILE="${TARGET_PREFIX}" \
128 CC="${TOOLCHAIN_PATH}/${TARGET_PREFIX}gcc" \
129 LD="${TOOLCHAIN_PATH}/${TARGET_PREFIX}gcc" \
130 AR="${TOOLCHAIN_PATH}/${TARGET_PREFIX}ar" \
131 COMPILER="${TOOLCHAIN_PATH}/${TARGET_PREFIX}gcc" \
132 LINKER="${TOOLCHAIN_PATH}/${TARGET_PREFIX}gcc" \
133 ARCHIVER="${TOOLCHAIN_PATH}/${TARGET_PREFIX}ar" \
134 KERNEL_DIR="${STAGING_KERNEL_DIR}" \
135 all
136
137 # Build the dsp library (debug and release)
138 cd ${DSPLINK}/dsp/src && make \
139 BASE_CGTOOLS="${CODEGEN_INSTALL_DIR}" \
140 BASE_SABIOS="${BIOS_INSTALL_DIR}" \
141 all
142
143 # Build the dsp samples (debug and release)
144 cd ${DSPLINK}/dsp/src/samples && make \
145 BASE_CGTOOLS="${CODEGEN_INSTALL_DIR}" \
146 BASE_SABIOS="${BIOS_INSTALL_DIR}" \
147 all
148}
149
150KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"
151
152do_install () {
153
154 # Install the kernel module
155 install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
156 install -m 0755 ${DSPLINK}/gpp/export/BIN/Linux/${DSPLINKPLATFORM}/RELEASE/dsplinkk.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/
157
158 # Install the example apps (gpp and dsp)
159 install -d ${D}/${installdir}/ti-dsplink-examples/
160 cp ${DSPLINK}/gpp/export/BIN/Linux/${DSPLINKPLATFORM}/RELEASE/*gpp ${D}/${installdir}/ti-dsplink-examples
161 cp ${DSPLINK}/dsp/export/BIN/DspBios/${DSPLINKPLATFORM}/${DSPLINKDSP}/RELEASE/*.out ${D}/${installdir}/ti-dsplink-examples
162
163 # Install the example apps module un/load scripts
164 install ${WORKDIR}/ti-dsplink-examples-loadmodules.sh ${D}/${installdir}/ti-dsplink-examples
165 install ${WORKDIR}/ti-dsplink-examples-unloadmodules.sh ${D}/${installdir}/ti-dsplink-examples
166 install ${WORKDIR}/ti-dsplink-examples-run.sh ${D}/${installdir}/ti-dsplink-examples
167
168 # Install/Stage the Source Tree
169 install -d ${D}${LINK_INSTALL_DIR_RECIPE}
170 cp -pPrf ${S}/* ${D}${LINK_INSTALL_DIR_RECIPE}
171 chmod -R +w ${D}${LINK_INSTALL_DIR_RECIPE}
172
173 # Changes path of include txt file to use LINK_INSTALL_DIR variable for GPP
174 for i in $(find ${D}${LINK_INSTALL_DIR_RECIPE}/dsplink/gpp/export/BIN/Linux/${DSPLINKPLATFORM}/*/ -name "*.txt"); do
175 sed -i ${i} -e s=${S}=\$\{LINK_INSTALL_DIR\}=g
176 done
177
178 # Changes path of include txt file to use LINK_INSTALL_DIR variable for DSP
179 for i in $(find ${D}${LINK_INSTALL_DIR_RECIPE}/dsplink/dsp/export/BIN/DspBios/${DSPLINKPLATFORM}/${DSPLINKDSP}/*/ -name "*.txt"); do
180 sed -i ${i} -e s=${S}=\$\{LINK_INSTALL_DIR\}=g
181 done
182
183}
184
185PACKAGES += "ti-dsplink-module"
186FILES_ti-dsplink-module = "/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/dsplinkk.ko"
187RDEPENDS_ti-dsplink-module += "update-modules"
188
189pkg_postinst_ti-dsplink-module () {
190#!/bin/sh
191if [ -n "$D" ]; then
192 exit 1
193fi
194
195depmod -a
196update-modules || true
197}
198
199pkg_postrm_ti-dsplink-module () {
200#!/bin/sh
201update-modules || true
202}
203
204PACKAGES += "ti-dsplink-examples"
205RDEPENDS_ti-dsplink-examples_append = " ti-dsplink-module"
206RDEPENDS_ti-dsplink-examples_append_omap3 += " ti-lpm-module ti-lpm-utils"
207FILES_ti-dsplink-examples = "${installdir}/ti-dsplink-examples/*"
208INSANE_SKIP_ti-dsplink-examples = True