diff options
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.inc | 133 |
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 @@ | |||
1 | DESCRIPTION = "TI Local Power Manager (LPM)" | ||
2 | HOMEPAGE = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/lpm" | ||
3 | SECTION = "devel" | ||
4 | LICENSE = "GPLv2" | ||
5 | |||
6 | LIC_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 | |||
10 | require ../includes/ti-paths.inc | ||
11 | require ../includes/ti-staging.inc | ||
12 | |||
13 | PROVIDES = "ti-lpm-module" | ||
14 | PROVIDES += "ti-lpm-utils" | ||
15 | |||
16 | # This package builds a kernel module, use kernel PR as base and append a local version | ||
17 | PR = "${MACHINE_KERNEL_PR}" | ||
18 | PR_append = "e" | ||
19 | |||
20 | S = "${WORKDIR}/local_power_manager_linux_${PV}" | ||
21 | |||
22 | SRC_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 | |||
24 | DEPENDS = "ti-dsplink ti-xdctools" | ||
25 | DEPENDS += "virtual/kernel" | ||
26 | |||
27 | # SOC_FAMILY configuration | ||
28 | |||
29 | LPMDSPPOWERSOC_omap3 = "omap3530" | ||
30 | LPMDSPPOWERSOC_dm6446 = "dm6446" | ||
31 | LPMDSPPOWERSOC ?= "UNDEFINED_LPMDSPPOWERSOC" | ||
32 | |||
33 | XDC_PLATFORM_dm6446 = "ti.platforms.evmDM6446" | ||
34 | XDC_PLATFORM_omap3 = "ti.platforms.evm3530" | ||
35 | XDC_PLATFORM ?= "UNDEFINED_XDC_PLATFORM" | ||
36 | |||
37 | do_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 | |||
45 | var Build = xdc.useModule('xdc.bld.BuildEnvironment'); | ||
46 | |||
47 | var GCArmv5T = xdc.useModule('gnu.targets.arm.GCArmv5T'); | ||
48 | GCArmv5T.LONGNAME = "${TARGET_PREFIX}gcc"; | ||
49 | GCArmv5T.rootDir = "${TOOLCHAIN_PATH}"; | ||
50 | GCArmv5T.ccOpts.prefix += " -Wall -fno-strict-aliasing "; | ||
51 | GCArmv5T.lnkOpts.suffix = GCArmv5T.lnkOpts.suffix.replace("-lstdc++", ""); | ||
52 | GCArmv5T.lnkOpts.suffix += " -lpthread "; | ||
53 | GCArmv5T.platform = null; | ||
54 | GCArmv5T.platforms = [ | ||
55 | "${XDC_PLATFORM}" | ||
56 | ]; | ||
57 | |||
58 | /* remove profiles we don't use */ | ||
59 | delete GCArmv5T.profiles["coverage"]; | ||
60 | delete GCArmv5T.profiles["profile"]; | ||
61 | |||
62 | Build.targets.\$add(GCArmv5T); | ||
63 | EOF | ||
64 | |||
65 | } | ||
66 | |||
67 | do_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 | |||
74 | addtask prepsources after do_configure before do_compile | ||
75 | |||
76 | do_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 | |||
95 | KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}" | ||
96 | |||
97 | do_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 | |||
112 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
113 | PACKAGES += "ti-lpm-module" | ||
114 | FILES_ti-lpm-module = "/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/*lpm*ko" | ||
115 | RDEPENDS_ti-lpm-module += "ti-dsplink-module" | ||
116 | RDEPENDS_ti-lpm-module += "update-modules" | ||
117 | |||
118 | pkg_postinst_ti-lpm-module_append () { | ||
119 | if [ -n "$D" ]; then | ||
120 | exit 1 | ||
121 | fi | ||
122 | depmod -a | ||
123 | update-modules || true | ||
124 | } | ||
125 | |||
126 | pkg_postrm_ti-lpm-module_append () { | ||
127 | update-modules || true | ||
128 | } | ||
129 | |||
130 | PACKAGES += "ti-lpm-utils" | ||
131 | RDEPENDS_ti-lpm-utils += "ti-lpm-module" | ||
132 | FILES_ti-lpm-utils = "${installdir}/ti-lpm-utils/*" | ||
133 | INSANE_SKIP_ti-lpm-utils = "1" | ||