aboutsummaryrefslogtreecommitdiffstats
path: root/extras/recipes-ti/local-power-manager
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-ti/local-power-manager')
-rw-r--r--extras/recipes-ti/local-power-manager/ti-local-power-manager.inc133
-rw-r--r--extras/recipes-ti/local-power-manager/ti-local-power-manager/lpm-1_24_01-replace-define-OPT.patch24
-rw-r--r--extras/recipes-ti/local-power-manager/ti-local-power-manager/lpm-BKL-fix.patch72
-rw-r--r--extras/recipes-ti/local-power-manager/ti-local-power-manager_1.24.02.09.bb10
4 files changed, 239 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 @@
+DESCRIPTION = "TI Local Power Manager (LPM)"
+HOMEPAGE = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/lpm"
+SECTION = "devel"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://gpl_2.0.txt;md5=ebb5c50ab7cab4baeffba14977030c07"
+
+# TODO : Hardcoded path to evm3530 - need to fix when adding omap24xx/dm6446 (other lpm targets)
+
+require ../includes/ti-paths.inc
+require ../includes/ti-staging.inc
+
+PROVIDES = "ti-lpm-module"
+PROVIDES += "ti-lpm-utils"
+
+# This package builds a kernel module, use kernel PR as base and append a local version
+PR = "${MACHINE_KERNEL_PR}"
+PR_append = "e"
+
+S = "${WORKDIR}/local_power_manager_linux_${PV}"
+
+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"
+
+DEPENDS = "ti-dsplink ti-xdctools"
+DEPENDS += "virtual/kernel"
+
+# SOC_FAMILY configuration
+
+LPMDSPPOWERSOC_omap3 = "omap3530"
+LPMDSPPOWERSOC_dm6446 = "dm6446"
+LPMDSPPOWERSOC ?= "UNDEFINED_LPMDSPPOWERSOC"
+
+XDC_PLATFORM_dm6446 = "ti.platforms.evmDM6446"
+XDC_PLATFORM_omap3 = "ti.platforms.evm3530"
+XDC_PLATFORM ?= "UNDEFINED_XDC_PLATFORM"
+
+do_configure () {
+
+ # Generate a config.bld for XDC
+
+ cat > ${S}/config.bld <<EOF
+
+/* Generated by ti-local-power-manager.inc OE recipe */
+
+var Build = xdc.useModule('xdc.bld.BuildEnvironment');
+
+var GCArmv5T = xdc.useModule('gnu.targets.arm.GCArmv5T');
+GCArmv5T.LONGNAME = "${TARGET_PREFIX}gcc";
+GCArmv5T.rootDir = "${TOOLCHAIN_PATH}";
+GCArmv5T.ccOpts.prefix += " -Wall -fno-strict-aliasing ";
+GCArmv5T.lnkOpts.suffix = GCArmv5T.lnkOpts.suffix.replace("-lstdc++", "");
+GCArmv5T.lnkOpts.suffix += " -lpthread ";
+GCArmv5T.platform = null;
+GCArmv5T.platforms = [
+ "${XDC_PLATFORM}"
+];
+
+/* remove profiles we don't use */
+delete GCArmv5T.profiles["coverage"];
+delete GCArmv5T.profiles["profile"];
+
+Build.targets.\$add(GCArmv5T);
+EOF
+
+}
+
+do_prepsources () {
+
+ # Prepare the tree for rebuiling - generate makefiles and clean
+ XDCPATH=${S} ${XDC_INSTALL_DIR}/xdc .make -PR .
+ XDCPATH=${S} ${XDC_INSTALL_DIR}/xdc clean -PR .
+}
+
+addtask prepsources after do_configure before do_compile
+
+do_compile () {
+
+ # Build the LPM kernel module
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ cd ${S}/packages/ti/bios/power/modules/${LPMDSPPOWERSOC}/lpm
+ make \
+ DSPLINK_REPO="${LINK_INSTALL_DIR}" \
+ LINUXKERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" \
+ MVTOOL_PREFIX="${TARGET_PREFIX}" \
+ clean default
+
+ # Build the user space library
+ # TODO
+
+ # Build the utilities (lpmON/OFF)
+ cd ${S}
+ XDCPATH=${S} ${XDC_INSTALL_DIR}/xdc -PR .
+}
+
+KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"
+
+do_install () {
+
+ # Install the kernel module
+ install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
+ install -m 0755 ${S}/packages/ti/bios/power/modules/${LPMDSPPOWERSOC}/lpm/*.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
+
+ # Install the Utilities
+ install -d ${D}/${installdir}/ti-lpm-utils
+ install -m 0755 ${S}/packages/ti/bios/power/utils/bin/$(echo ${XDC_PLATFORM} | tr . _)/linux/release/* ${D}/${installdir}/ti-lpm-utils
+
+ # Install/Stage the Source Tree
+ install -d ${D}${LPM_INSTALL_DIR_RECIPE}
+ cp -pPrf ${S}/* ${D}${LPM_INSTALL_DIR_RECIPE}
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+PACKAGES += "ti-lpm-module"
+FILES_ti-lpm-module = "/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/*lpm*ko"
+RDEPENDS_ti-lpm-module += "ti-dsplink-module"
+RDEPENDS_ti-lpm-module += "update-modules"
+
+pkg_postinst_ti-lpm-module_append () {
+ if [ -n "$D" ]; then
+ exit 1
+ fi
+ depmod -a
+ update-modules || true
+}
+
+pkg_postrm_ti-lpm-module_append () {
+ update-modules || true
+}
+
+PACKAGES += "ti-lpm-utils"
+RDEPENDS_ti-lpm-utils += "ti-lpm-module"
+FILES_ti-lpm-utils = "${installdir}/ti-lpm-utils/*"
+INSANE_SKIP_ti-lpm-utils = "1"
diff --git a/extras/recipes-ti/local-power-manager/ti-local-power-manager/lpm-1_24_01-replace-define-OPT.patch b/extras/recipes-ti/local-power-manager/ti-local-power-manager/lpm-1_24_01-replace-define-OPT.patch
new file mode 100644
index 00000000..120792b8
--- /dev/null
+++ b/extras/recipes-ti/local-power-manager/ti-local-power-manager/lpm-1_24_01-replace-define-OPT.patch
@@ -0,0 +1,24 @@
+diff -uNr local_power_manager_linux_1_24_01_orig/packages/ti/bios/power/modules/dm6446/lpm/Makefile local_power_manager_linux_1_24_01/packages/ti/bios/power/modules/dm6446/lpm/Makefile
+--- local_power_manager_linux_1_24_01_orig/packages/ti/bios/power/modules/dm6446/lpm/Makefile 2009-07-22 23:10:04.000000000 -0500
++++ local_power_manager_linux_1_24_01/packages/ti/bios/power/modules/dm6446/lpm/Makefile 2010-04-16 15:26:14.000000000 -0500
+@@ -54,7 +54,7 @@
+ endif
+
+ MAKE_OPTS = ARCH=arm CROSS_COMPILE=$(MVTOOL_PREFIX)
+-CFLAGS = -DUSE_UDEV -DOS_LINUX -DLINUX_KERNEL \
++CFLAGS = -DUSE_UDEV -DOS_LINUX -DLINUX_KERNEL -DOPT="" \
+ $(LINK_DEFS) $(LINK_INCS) $(LINK_INCS_INTERNAL)
+
+ # Invoke the kernel build system
+diff -uNr local_power_manager_linux_1_24_01_orig/packages/ti/bios/power/modules/omap3530/lpm/Makefile local_power_manager_linux_1_24_01/packages/ti/bios/power/modules/omap3530/lpm/Makefile
+--- local_power_manager_linux_1_24_01_orig/packages/ti/bios/power/modules/omap3530/lpm/Makefile 2009-07-22 23:10:05.000000000 -0500
++++ local_power_manager_linux_1_24_01/packages/ti/bios/power/modules/omap3530/lpm/Makefile 2010-04-16 15:26:38.000000000 -0500
+@@ -54,7 +54,7 @@
+ endif
+
+ MAKE_OPTS = ARCH=arm CROSS_COMPILE=$(MVTOOL_PREFIX)
+-CFLAGS = -DUSE_UDEV -DOS_LINUX -DLINUX_KERNEL \
++CFLAGS = -DUSE_UDEV -DOS_LINUX -DLINUX_KERNEL -DOPT="" \
+ $(LINK_DEFS) $(LINK_INCS) $(LINK_INCS_INTERNAL)
+
+ # Invoke the kernel build system
diff --git a/extras/recipes-ti/local-power-manager/ti-local-power-manager/lpm-BKL-fix.patch b/extras/recipes-ti/local-power-manager/ti-local-power-manager/lpm-BKL-fix.patch
new file mode 100644
index 00000000..4b5a537a
--- /dev/null
+++ b/extras/recipes-ti/local-power-manager/ti-local-power-manager/lpm-BKL-fix.patch
@@ -0,0 +1,72 @@
+From b7e83000f316f5f109b9237fde4d1c576534aa1a Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 4 Jan 2011 14:21:02 +0100
+Subject: [PATCH] Fix build with 2.6.37rcX
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ .../bios/power/modules/omap3530/lpm/lpm_driver.c | 12 +++++++++---
+ 1 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c b/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
+index fa22ea3..4663fc9 100644
+--- a/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
++++ b/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
+@@ -40,6 +40,7 @@
+ #include <asm/semaphore.h>
+ #endif
+ #include <linux/io.h>
++#include <linux/slab.h>
+
+ #include "lpm_driver.h"
+ #include "lpm_dev.h"
+@@ -95,7 +96,7 @@ static int enablevicp = -1;
+ module_param(enablevicp, int, S_IRUGO);
+
+ /* forward declaration of system calls (used by Linux driver) */
+-static int lpm_ioctl (struct inode *inode, struct file *filp,
++static long lpm_ioctl (struct file *filp,
+ unsigned int cmd, unsigned long args);
+ static int lpm_open (struct inode *inode, struct file *filp);
+ static int lpm_release (struct inode *inode, struct file *filp);
+@@ -111,7 +112,7 @@ static void lpm_os_trace (char *fmt, ...);
+
+ static struct file_operations lpm_fops = {
+ .owner = THIS_MODULE,
+- .ioctl = lpm_ioctl,
++ .unlocked_ioctl = lpm_ioctl,
+ .open = lpm_open,
+ .release = lpm_release,
+ };
+@@ -244,7 +245,11 @@ static int __init lpm_init(void)
+ lpm->inst[i].major = MAJOR(lpm->first);
+ lpm->inst[i].minor = MINOR(lpm->first) + i;
+ INIT_LIST_HEAD(&lpm->inst[i].clients);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+ init_MUTEX(&lpm->inst[i].sem);
++#else
++ sema_init(&lpm->inst[i].sem,1);
++#endif
+ init_completion(&lpm->inst[i].event);
+ lpm_devAttrs.os_instance = (void *)&lpm->inst[i];
+ LPM_init(i, &lpm->inst[i].lpm, &lpm_devAttrs);
+@@ -320,7 +325,7 @@ fail_02:
+ /*
+ * ======== lpm_ioctl ========
+ */
+-static int lpm_ioctl(struct inode *inode, struct file *filp,
++static long lpm_ioctl(struct file *filp,
+ unsigned int cmd, unsigned long args)
+ {
+ struct LPM_Dev *dev;
+@@ -328,6 +333,7 @@ static int lpm_ioctl(struct inode *inode, struct file *filp,
+ LPM_Client *client;
+ LPM_Status lpmStat = LPM_SOK;
+ int stat = 0;
++ struct inode *inode = filp->f_dentry->d_inode;
+
+ TRACE(KERN_ALERT "--> lpm_ioctl, cmd: 0x%X\n", cmd);
+
+--
+1.6.6.1
+
diff --git a/extras/recipes-ti/local-power-manager/ti-local-power-manager_1.24.02.09.bb b/extras/recipes-ti/local-power-manager/ti-local-power-manager_1.24.02.09.bb
new file mode 100644
index 00000000..759561f3
--- /dev/null
+++ b/extras/recipes-ti/local-power-manager/ti-local-power-manager_1.24.02.09.bb
@@ -0,0 +1,10 @@
+require ti-local-power-manager.inc
+
+PV = "1_24_02_09"
+PE = "1"
+
+SRC_URI += "file://lpm-BKL-fix.patch"
+
+SRC_URI[lpmtarball.md5sum] = "3d05453df26dfc811de04839d74c2f2b"
+SRC_URI[lpmtarball.sha256sum] = "7335959a6217df17289f81839e6c6948f31cc0797ebc5389edef7190ed3ea589"
+