From ae5c88f29a9d169f366ba7d3cb656d8cbcbd3c55 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Mon, 2 Nov 2015 08:09:32 +0100 Subject: nv-conf-systemd: cpu hot-plug configuration and startup Systemd startup script for NVIDIA T30 CPU hot-plug configuration. --- recipes-core/nv-conf/files/nv-conf.service | 12 ++++++++++ recipes-core/nv-conf/files/nv-conf.sh | 35 ++++++++++++++++++++++++++++++ recipes-core/nv-conf/nv-conf-systemd.bb | 32 +++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 recipes-core/nv-conf/files/nv-conf.service create mode 100644 recipes-core/nv-conf/files/nv-conf.sh create mode 100644 recipes-core/nv-conf/nv-conf-systemd.bb (limited to 'recipes-core') diff --git a/recipes-core/nv-conf/files/nv-conf.service b/recipes-core/nv-conf/files/nv-conf.service new file mode 100644 index 0000000..3226c6b --- /dev/null +++ b/recipes-core/nv-conf/files/nv-conf.service @@ -0,0 +1,12 @@ +[Unit] +Description=Enable NVIDIA T30 CPU Hot-Plugging +DefaultDependencies=no +After=sysinit.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/nv-conf.sh + +[Install] +WantedBy=sysinit.target diff --git a/recipes-core/nv-conf/files/nv-conf.sh b/recipes-core/nv-conf/files/nv-conf.sh new file mode 100644 index 0000000..6376c5d --- /dev/null +++ b/recipes-core/nv-conf/files/nv-conf.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# NVIDIA specific init script + +# power state +if [ -e /sys/power/state ]; then + chmod 0666 /sys/power/state +fi + +# turn off low-power core migration for now +if [ -e /sys/module/cpu_tegra3/parameters/no_lp ] ; then + echo Y > /sys/module/cpu_tegra3/parameters/no_lp +fi + +# enable CPU hot-plugging +if [ -e /sys/module/cpu_tegra3/parameters/auto_hotplug ] ; then + echo 1 > /sys/module/cpu_tegra3/parameters/auto_hotplug +fi + +# lp2 idle state +if [ -e /sys/module/cpuidle/parameters/lp2_in_idle ] ; then + echo "Y" > /sys/module/cpuidle/parameters/lp2_in_idle +fi + +# mmc read ahead size +if [ -e /sys/block/mmcblk0/queue/read_ahead_kb ]; then + echo 2048 > /sys/block/mmcblk0/queue/read_ahead_kb +fi +if [ -e /sys/block/mmcblk1/queue/read_ahead_kb ]; then + echo 2048 > /sys/block/mmcblk1/queue/read_ahead_kb +fi +if [ -e /sys/block/mmcblk2/queue/read_ahead_kb ]; then + echo 2048 > /sys/block/mmcblk2/queue/read_ahead_kb +fi + +exit 0 diff --git a/recipes-core/nv-conf/nv-conf-systemd.bb b/recipes-core/nv-conf/nv-conf-systemd.bb new file mode 100644 index 0000000..c592bc3 --- /dev/null +++ b/recipes-core/nv-conf/nv-conf-systemd.bb @@ -0,0 +1,32 @@ +SECTION = "sysinit" +SUMMARY = "NVIDIA T30 CPU hot-plug configuration and startup" +RDEPENDS_${PN} = "" +# The license is meant for this recipe and the files it installs. +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690" + +PR = "r1" + +inherit allarch systemd + +SRC_URI = " \ + file://nv-conf.sh \ + file://nv-conf.service \ +" + +do_install() { + install -d ${D}/${bindir} + install -m 0755 ${WORKDIR}/nv-conf.sh ${D}/${bindir}/ + + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/nv-conf.service ${D}${systemd_unitdir}/system +} + +FILES_${PN} += " \ + ${systemd_unitdir}/system \ +" + +NATIVE_SYSTEMD_SUPPORT = "1" +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "nv-conf.service" + -- cgit v1.2.3