increase dvbapp PR.
[vuplus_openembedded] / recipes / ti / ti-dsplink-module_1.61.3.bb
1 DESCRIPTION = "DSPLINK 1.61.3 module for TI ARM/DSP processors"
2
3 require ti-paths.inc
4 inherit module
5
6 # compile and run time dependencies
7 DEPENDS         += "virtual/kernel perl-native ti-dspbios-native ti-cgt6x-native update-modules ti-xdctools-native"
8
9 #This is a kernel module, don't set PR directly
10 MACHINE_KERNEL_PR_append = "b"                                                  
11
12 # tconf from xdctools dislikes '.' in pwd :/
13 PV = "1_61_03"
14
15 SRC_URI = "http://install.source.dir.local/dsplink_1_61_03.tar.gz \
16                    file://loadmodules-ti-dsplink-apps.sh \
17                    file://unloadmodules-ti-dsplink-apps.sh"
18
19 # Set the source directory
20 S = "${WORKDIR}/dsplink_1_61_03"
21         
22 # DSPLINK - Config Variable for different platform
23 DSPLINKPLATFORM                                 ?= "DAVINCI"
24 DSPLINKPLATFORM_dm6446                  ?= "DAVINCI"
25 DSPLINKPLATFORM_omapl137        ?= "OMAPL1XX"
26
27 DSPLINKDSPCFG                                   ?= "DM6446GEMSHMEM"
28 DSPLINKDSPCFG_dm6446                    ?= "DM6446GEMSHMEM"
29 DSPLINKDSPCFG_omapl137  ?= "OMAPL1XXGEMSHMEM"
30
31 DSPLINKGPPOS                                    ?= "MVL5G"
32 DSPLINKGPPOS_dm6446                     ?= "MVL5G"
33 DSPLINKGPPOS_omapl137   ?= "MVL5G"
34
35 DSPLINK = "${S}/dsplink"
36 export DSPLINK
37
38 STAGING_TI_DSPBIOS_DIR="${STAGING_DIR_NATIVE}/ti-dspbios-native"
39 STAGING_TI_CGT6x_DIR="${STAGING_DIR_NATIVE}/ti-cgt6x-native"
40 STAGING_TI_XDCTOOL_INSTALL_DIR="${STAGING_DIR_NATIVE}/ti-xdctools-native"
41
42 do_compile() {
43
44         # asm/page.h is gone with linux-libc-headers 2.6.31.
45         # We can safely sed it out since it has been empty for the past 2 years
46         sed -i /page.h/d ${S}/dsplink/gpp/src/api/Linux/drv_api.c 
47
48     # Run perl script to create appropriate makefiles (v1.60 and up)
49     (
50     cd ${DSPLINK}
51     perl config/bin/dsplinkcfg.pl --platform=${DSPLINKPLATFORM} --nodsp=1 \
52         --dspcfg_0=${DSPLINKDSPCFG} --dspos_0=DSPBIOS5XX \
53         --gppos=${DSPLINKGPPOS} --comps=ponslrm
54     )
55
56           # dsplink makefile is hard-coded to use kbuild only on OMAP3530.
57     # we are forcing  to use kbuild on other platforms.
58           sed -i  's/OMAP3530/${DSPLINKPLATFORM}/g' ${DSPLINK}/gpp/src/Makefile 
59
60     # TODO :: KERNEL_CC, etc need replacing with user CC
61     # TODO :: Need to understand why OBJDUMP is required for kernel module
62     # Unset these since LDFLAGS gets picked up and used incorrectly.... need 
63     # investigation
64
65     unset CFLAGS CPPFLAGS CXXFLAGS  LDFLAGS
66     
67     # Build the gpp user space library
68     cd ${DSPLINK}/gpp/src/api
69     make \
70       CROSS_COMPILE="${TARGET_PREFIX}" \
71       CC="${KERNEL_CC}" \
72       AR="${KERNEL_AR}" \
73       LD="${KERNEL_LD}" \
74       COMPILER="${KERNEL_CC}" \
75       ARCHIVER="${KERNEL_AR}" \
76       KERNEL_DIR="${STAGING_KERNEL_DIR}" \
77       clean all
78
79     # Build the gpp kernel space (debug and release)
80     cd ${DSPLINK}/gpp/src
81     make \
82       OBJDUMP="${TARGET_PREFIX}objdump" \
83       CROSS_COMPILE="${TARGET_PREFIX}" \
84       CC="${KERNEL_CC}" \
85       AR="${KERNEL_AR}" \
86       LD="${KERNEL_LD}" \
87       COMPILER="${KERNEL_CC}" \
88       ARCHIVER="${KERNEL_AR}" \
89       KERNEL_DIR="${STAGING_KERNEL_DIR}" \
90       clean all
91
92     # Build the gpp samples
93     cd ${DSPLINK}/gpp/src/samples
94     make \
95       BASE_TOOLCHAIN="${CROSS_DIR}" \
96       BASE_CGTOOLS="${BASE_TOOLCHAIN}/bin" \
97       OSINC_PLATFORM="${CROSS_DIR}/lib/gcc/${TARGET_SYS}/$(${TARGET_PREFIX}gcc -dumpversion)/include" \
98       OSINC_TARGET="${BASE_TOOLCHAIN}/target/usr/include" \
99       CROSS_COMPILE="${TARGET_PREFIX}" \
100       CC="${KERNEL_CC}" \
101       AR="${KERNEL_AR}" \
102       LD="${KERNEL_LD}" \
103       COMPILER="${KERNEL_CC}" \
104       LINKER="${KERNEL_CC}" \
105       ARCHIVER="${KERNEL_AR}" \
106       KERNEL_DIR="${STAGING_KERNEL_DIR}" \
107       clean all
108
109     # Build the dsp library (debug and release)
110     cd ${DSPLINK}/dsp/src
111     make \
112       BASE_CGTOOLS="${STAGING_TI_CGT6x_DIR}" \
113       BASE_SABIOS="${STAGING_TI_DSPBIOS_DIR}" \
114       clean all
115
116     # Build the dsp samples (debug and release)
117     cd ${DSPLINK}/dsp/src/samples
118     make \
119       BASE_CGTOOLS="${STAGING_TI_CGT6x_DIR}" \
120       BASE_SABIOS="${STAGING_TI_DSPBIOS_DIR}" \
121       clean all
122 }
123
124 do_install () {
125     # DSPLINK driver - kernel module
126     install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
127     install -m 0755 ${DSPLINK}/gpp/export/BIN/Linux/${DSPLINKPLATFORM}/RELEASE/dsplinkk.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/ 
128
129     # DSPLINK library
130     install -d ${D}/${installdir}/dsplink/libs
131     install -m 0755 ${DSPLINK}/gpp/export/BIN/Linux/${DSPLINKPLATFORM}/RELEASE/dsplink.lib  ${D}/${installdir}/dsplink/libs
132
133     # DSPLINK sample apps
134     install -d ${D}/${installdir}/dsplink/apps
135     
136     cp ${DSPLINK}/gpp/export/BIN/Linux/${DSPLINKPLATFORM}/RELEASE/*gpp ${D}/${installdir}/dsplink/apps
137     
138     for i in $(find ${DSPLINK}/dsp/BUILD/ -name "*.out") ; do
139         cp ${i} ${D}/${installdir}/dsplink/apps
140     done
141
142     # DSPLINK test app module un/load scripts
143     install ${WORKDIR}/loadmodules-ti-dsplink-apps.sh ${D}/${installdir}/dsplink/apps
144     install ${WORKDIR}/unloadmodules-ti-dsplink-apps.sh ${D}/${installdir}/dsplink/apps
145 }
146
147 do_stage () {
148     install -d ${STAGING_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/packages
149     cp -pPrf ${S}/* ${STAGING_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/packages
150 }
151
152 INHIBIT_PACKAGE_STRIP = "1"
153
154 PACKAGES += " ti-dsplink-apps" 
155 FILES_ti-dsplink-apps = "${installdir}/dsplink/*"
156
157 # Disable QA check untils we figure out how to pass LDFLAGS in build
158 INSANE_SKIP_${PN} = True
159 INSANE_SKIP_ti-dsplink-apps = True
160