summaryrefslogtreecommitdiffstats
path: root/recipes-ti/local-power-manager/ti-local-power-manager.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/local-power-manager/ti-local-power-manager.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/local-power-manager/ti-local-power-manager.inc')
-rw-r--r--recipes-ti/local-power-manager/ti-local-power-manager.inc130
1 files changed, 130 insertions, 0 deletions
diff --git a/recipes-ti/local-power-manager/ti-local-power-manager.inc b/recipes-ti/local-power-manager/ti-local-power-manager.inc
new file mode 100644
index 00000000..836e1181
--- /dev/null
+++ b/recipes-ti/local-power-manager/ti-local-power-manager.inc
@@ -0,0 +1,130 @@
1DESCRIPTION = "TI Local Power Manager (LPM)"
2HOMEPAGE = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/lpm"
3SECTION = "devel"
4LICENSE = "GPLv2"
5
6# TODO : Hardcoded path to evm3530 - need to fix when adding omap24xx/dm6446 (other lpm targets)
7
8require ../includes/ti-paths.inc
9require ../includes/ti-staging.inc
10
11PROVIDES = "ti-lpm-module"
12PROVIDES += "ti-lpm-utils"
13
14# This package builds a kernel module, use kernel PR as base and append a local version
15PR = "${MACHINE_KERNEL_PR}"
16PR_append = "e"
17
18S = "${WORKDIR}/local_power_manager_linux_${PV}"
19
20SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/lpm/${PV}/exports/local_power_manager_linux_${PV}.tar.gz;name=lpmtarball"
21
22DEPENDS = "ti-dsplink ti-xdctools"
23DEPENDS += "virtual/kernel"
24
25# SOC_FAMILY configuration
26
27LPMDSPPOWERSOC_omap3 = "omap3530"
28LPMDSPPOWERSOC_dm6446 = "dm6446"
29LPMDSPPOWERSOC ?= "<UNDEFINED_LPMDSPPOWERSOC>"
30
31XDC_PLATFORM_dm6446 = "ti.platforms.evmDM6446"
32XDC_PLATFORM_omap3 = "ti.platforms.evm3530"
33XDC_PLATFORM ?= "<UNDEFINED_XDC_PLATFORM>"
34
35do_configure () {
36
37 # Generate a config.bld for XDC
38
39 cat > ${S}/config.bld <<EOF
40
41/* Generated by ti-local-power-manager.inc OE recipe */
42
43var Build = xdc.useModule('xdc.bld.BuildEnvironment');
44
45var GCArmv5T = xdc.useModule('gnu.targets.arm.GCArmv5T');
46GCArmv5T.LONGNAME = "bin/${TARGET_PREFIX}gcc";
47GCArmv5T.rootDir = "${TOOLCHAIN_PATH}";
48GCArmv5T.ccOpts.prefix += " -Wall -fno-strict-aliasing ";
49GCArmv5T.lnkOpts.suffix = GCArmv5T.lnkOpts.suffix.replace("-lstdc++", "");
50GCArmv5T.lnkOpts.suffix += " -lpthread ";
51GCArmv5T.platform = null;
52GCArmv5T.platforms = [
53 "${XDC_PLATFORM}"
54];
55
56/* remove profiles we don't use */
57delete GCArmv5T.profiles["coverage"];
58delete GCArmv5T.profiles["profile"];
59
60Build.targets.\$add(GCArmv5T);
61EOF
62
63}
64
65do_prepsources () {
66
67 # Prepare the tree for rebuiling - generate makefiles and clean
68 XDCPATH=${S} ${XDC_INSTALL_DIR}/xdc .make -PR .
69 XDCPATH=${S} ${XDC_INSTALL_DIR}/xdc clean -PR .
70}
71
72addtask prepsources after do_configure before do_compile
73
74do_compile () {
75
76 # Build the LPM kernel module
77 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
78 cd ${S}/packages/ti/bios/power/modules/${LPMDSPPOWERSOC}/lpm
79 make \
80 DSPLINK_REPO="${LINK_INSTALL_DIR}" \
81 LINUXKERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" \
82 MVTOOL_PREFIX="${TARGET_PREFIX}" \
83 clean default
84
85 # Build the user space library
86 # TODO
87
88 # Build the utilities (lpmON/OFF)
89 cd ${S}
90 XDCPATH=${S} ${XDC_INSTALL_DIR}/xdc -PR .
91}
92
93KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"
94
95do_install () {
96
97 # Install the kernel module
98 install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
99 install -m 0755 ${S}/packages/ti/bios/power/modules/${LPMDSPPOWERSOC}/lpm/*.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
100
101 # Install the Utilities
102 install -d ${D}/${installdir}/ti-lpm-utils
103 install -m 0755 ${S}/packages/ti/bios/power/utils/bin/$(echo ${XDC_PLATFORM} | sed s:\\.:_:g)/linux/release/* ${D}/${installdir}/ti-lpm-utils
104
105 # Install/Stage the Source Tree
106 install -d ${D}${LPM_INSTALL_DIR_RECIPE}
107 cp -pPrf ${S}/* ${D}${LPM_INSTALL_DIR_RECIPE}
108}
109
110PACKAGES += "ti-lpm-module"
111FILES_ti-lpm-module = "/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/*lpm*ko"
112RDEPENDS_ti-lpm-module += "ti-dsplink-module"
113RDEPENDS_ti-lpm-module += "update-modules"
114
115pkg_postinst_ti-lpm-module_append () {
116 if [ -n "$D" ]; then
117 exit 1
118 fi
119 depmod -a
120 update-modules || true
121}
122
123pkg_postrm_ti-lpm-module_append () {
124 update-modules || true
125}
126
127PACKAGES += "ti-lpm-utils"
128RDEPENDS_ti-lpm-utils += "ti-lpm-module"
129FILES_ti-lpm-utils = "${installdir}/ti-lpm-utils/*"
130INSANE_SKIP_ti-lpm-utils = True