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