summaryrefslogtreecommitdiff
path: root/packages/dsplink/dsplink.inc
diff options
context:
space:
mode:
Diffstat (limited to 'packages/dsplink/dsplink.inc')
-rw-r--r--packages/dsplink/dsplink.inc137
1 files changed, 102 insertions, 35 deletions
diff --git a/packages/dsplink/dsplink.inc b/packages/dsplink/dsplink.inc
index 00b62973ff..e4f17aeaeb 100644
--- a/packages/dsplink/dsplink.inc
+++ b/packages/dsplink/dsplink.inc
@@ -1,8 +1,6 @@
DESCRIPTION = "DSP Link for TI ARM/DSP processors"
DEPENDS = "virtual/kernel dsplink-module perl-native"
-RDEPENDS_${PN}-module = "update-modules"
-RRECOMMENDS_${PN} = "${PN}-module"
inherit module
@@ -14,6 +12,10 @@ export DSPLINK="${S}"
require ti-paths.inc
do_configure () {
+ # Clean up stale binaries
+ find ${S} -name "*.ko" -delete
+ find ${S} -name "*.o" -delete
+
# Run perl script to create appropriate makefiles (v1.60 and up)
(
cd ${DSPLINK}
@@ -21,8 +23,8 @@ do_configure () {
)
if [ $(echo ${KERNEL_VERSION} | cut -c5,6) -gt 26 ] ; then
- sed -i -e s:asm/semaphore:linux/semaphore: ${S}/gpp/src/osal/Linux/user.c
- sed -i -e s:asm/semaphore:linux/semaphore: ${S}/gpp/src/osal/Linux/2.6.18/sync.c
+ sed -i -e s:asm/semaphore:linux/semaphore: ${DSPLINK}/gpp/src/osal/Linux/user.c
+ sed -i -e s:asm/semaphore:linux/semaphore: ${DSPLINK}/gpp/src/osal/Linux/2.6.18/sync.c
fi
}
@@ -30,8 +32,7 @@ PARALLEL_MAKE = ""
do_compile () {
unset DISPLAY
- sed -i -e s:armv7a:armv7-a:g make/Linux/omap3530_2.6.mk || true
- sed -i -e s:armv7a:armv7-a:g cetools/packages/dsplink/make/Linux/omap3530_2.6.mk || true
+ sed -i -e s:armv7a:armv7-a:g ${DSPLINK}/make/Linux/omap3530_2.6.mk
# export various settings to override the defaults in the makefiles
export DSP_BASE_CGTOOLS=${TITOOLSDIR}/${TICGTOOLSDIR}
@@ -52,47 +53,83 @@ do_compile () {
export ARCHIVER_AR=${TARGET_PREFIX}ar
export BASE_SABIOS=${DSP_BASE_BIOS}
- if [ ! -d ${S}/gpp/BUILD/EXPORT/RELEASE ] ; then
- install -d ${S}/gpp/BUILD/EXPORT/RELEASE
+ if [ ! -d ${DSPLINK}/gpp/BUILD/EXPORT/RELEASE ] ; then
+ install -d ${DSPLINK}/gpp/BUILD/EXPORT/RELEASE
fi
- cp ${WORKDIR}/Makefile-dsplink-gpp ${S}/gpp/BUILD/EXPORT/RELEASE/Makefile
- cd ${S}/gpp/BUILD/EXPORT/RELEASE/
+#dsplinkk.ko bits
+ cp ${WORKDIR}/Makefile-dsplink-gpp ${DSPLINK}/gpp/BUILD/EXPORT/RELEASE/Makefile
+ cd ${DSPLINK}/gpp/BUILD/EXPORT/RELEASE/
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-
-# oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
-# KERNEL_SRC=${STAGING_KERNEL_DIR} \
-# KDIR=${STAGING_KERNEL_DIR} \
-# KERNEL_VERSION=${KERNEL_VERSION} \
-# CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
-# AR="${KERNEL_AR}" \
-# V=1 ${MAKE_TARGETS}
-
export KDIR=${STAGING_KERNEL_DIR}
make -e all
make -e -f ${WORKDIR}/Makefile-dsplink-dsp
+
+#lpm bits
+ if [ -e ${S}/cetools/packages/ti/bios/power/ ] ; then
+ echo "MVTOOL_PREFIX=${TARGET_PREFIX}" > ${S}/Rules.make
+ echo "UCTOOL_PREFIX=${TARGET_PREFIX}" >> ${S}/Rules.make
+ echo "LINUXKERNEL_INSTALL_DIR=${STAGING_KERNEL_DIR}" >> ${S}/Rules.make
+ #export DSPLINK=${STAGING_DIR}/${MULTIMACH_TARGET_SYS}/dsplink
+
+ # Build the DSP power manager kernel module
+ cd ${S}/cetools/packages/ti/bios/power/modules/${DSPPOWERSOC}/lpm
+
+ if [ $(echo ${KERNEL_VERSION} | cut -c5,6) -gt 26 ] ; then
+ sed -i -e s:asm/semaphore:linux/semaphore: lpm_driver.c
+ fi
+
+ rm -f *o
+ make KERNEL_PATH=${STAGING_KERNEL_DIR} \
+ KERNEL_SRC=${STAGING_KERNEL_DIR} \
+ KERNEL_DIR=${STAGING_KERNEL_DIR} \
+ KERNEL_VERSION=${KERNEL_VERSION} \
+ TOOL_PREFIX=${TARGET_PREFIX} \
+ DSPLINK_REPO=${DSPLINK}/../ \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ AR="${KERNEL_AR}"
+ fi
+
+#cmemk bits
+ if [ -e ${S}/cetools/packages/ti/sdo/linuxutils/cmem ] ; then
+ # Build the cmem kernel module
+ # We unset CFLAGS because kernel modules need different ones, this is basically a verbatim copy of kernel.bbclass and module-base.bbclass
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ cd ${S}/cetools/packages/ti/sdo/linuxutils/cmem
+
+ # This sadly breaks doing -c compile more than once, but I don't have a better solution
+ if [ $(echo ${KERNEL_VERSION} | cut -c5,6) -gt 26 ] ; then
+ patch -p0 < ${WORKDIR}/cmemk-class-device-27.diff
+ fi
+
+ oe_runmake clean
+ oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
+ KERNEL_SRC=${STAGING_KERNEL_DIR} \
+ KERNEL_VERSION=${KERNEL_VERSION} \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ AR="${KERNEL_AR}"
+ fi
}
do_install () {
install -d ${D}/${bindir}
-# install ${S}/gpp/BUILD/EXPORT/RELEASE/loopgpp ${D}/${bindir}
- install ${S}/gpp/BUILD/EXPORT/RELEASE/messagegpp ${D}/${bindir}
-# install ${S}/gpp/BUILD/EXPORT/RELEASE/messagemultigpp ${D}/${bindir}
- install ${S}/gpp/BUILD/EXPORT/RELEASE/mpcsxfergpp ${D}/${bindir}
-# install ${S}/gpp/BUILD/EXPORT/RELEASE/mplistgpp ${D}/${bindir}
- install ${S}/gpp/BUILD/EXPORT/RELEASE/readwritegpp ${D}/${bindir}
-# install ${S}/gpp/BUILD/EXPORT/RELEASE/ringiogpp ${D}/${bindir}
- install ${S}/gpp/BUILD/EXPORT/RELEASE/scalegpp ${D}/${bindir} || true
+ install ${DSPLINK}/gpp/BUILD/EXPORT/RELEASE/*gpp ${D}/${bindir} || true
install -d ${D}/${datadir}/dsplink
- for i in $(find ${S}/dsp/BUILD/ -name "*.out") ; do
+ for i in $(find ${DSPLINK}/dsp/BUILD/ -name "*.out") ; do
install ${i} ${D}/${datadir}/dsplink
done
install -d ${D}/${libdir}
- install -m 0755 ${S}/gpp/BUILD/EXPORT/RELEASE/dsplink.lib ${D}/${libdir}
+ install -m 0755 ${DSPLINK}/gpp/BUILD/EXPORT/RELEASE/dsplink.lib ${D}/${libdir}
+
+ install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
+ cp ${DSPLINK}/gpp/BUILD/EXPORT/RELEASE/dsplinkk.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/
+ cp ${S}/cetools/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp || true
+ cp ${S}/cetools/packages/ti/bios/power/${DSPPOWERSOC}/lpm/*.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp || true
+ cp ${S}/cetools/packages/ti/bios/power/modules/${DSPPOWERSOC}/lpm/*.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp || true
}
@@ -102,21 +139,51 @@ do_stage() {
cp -pPr ${S}/* ${STAGING_DIR}/${MULTIMACH_TARGET_SYS}/dsplink/
}
-pkg_postinst_${PN}-module () {
- if [ -n "$D" ]; then
+pkg_postinst_dsplink-module () {
+ if [ -n "$D" ]; then
+ exit 1
+ fi
+ depmod -a
+ update-modules || true
+}
+
+pkg_postrm_dsplink-module () {
+ update-modules || true
+}
+
+PACKAGES =+ "dsplink dsplink-module ti-lpm-module ti-cmemk-module"
+FILES_dsplink-module = "${sysconfdir} /lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/dsplinkk.ko"
+FILES_dsplink = "${bindir}/* ${datadir}/dsplink/* ${libdir}/dsplink.lib"
+
+FILES_ti-lpm-module = "/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/*lpm*ko"
+
+pkg_postinst_ti-lpm-module () {
+ if [ -n "$D" ]; then
+ exit 1
+ fi
+ depmod -a
+ update-modules || true
+}
+
+pkg_postrm_ti-lpm-module () {
+ update-modules || true
+}
+
+FILES_ti-cmemk-module = "${sysconfdir} /lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/cmemk.ko"
+
+pkg_postinst_ti-cmemk-module () {
+ if [ -n "$D" ]; then
exit 1
fi
depmod -a
update-modules || true
}
-pkg_postrm_${PN}-module () {
+pkg_postrm_ti-cmemk-module () {
update-modules || true
}
-PACKAGES =+ "${PN}-module"
-FILES_${PN}-module = "${sysconfdir} /lib/modules"
-FILES_${PN} = "${bindir}/* ${datadir}/dsplink/*"
+
INHIBIT_PACKAGE_STRIP = "1"