Lakka-LibreELEC/projects/L4T/devices/Switch/initramfs/platform_init
GavinDarkglider bb321a5eed
Lakka-v5.x Switch Support Fixes (#1753)
* Switch: it builds

* Switch: Use udev to finalize usb gadget to save from systemd looping service restart until cable connected.

* Switch: Update kernel stuff again

* Switch: Downgrade Alsa packages to version in 4.x tree

* Joycond: Update Switch version

* Switch: Minor fixes

* LibreELEC: Fix a few broken files from upstream pull

* Switch: Fix LibreELEC build.

* Switch: Update bootloader stuff

* L4T: FFMPEG: Add support for nvv4l2 decoder/encoder

* FFMPEG: Add back encoder support for game recording in retroarch

* FFMPEG: revert a few changes, and add support for vulkan.
2022-10-13 21:05:34 +03:00

52 lines
1.5 KiB
Bash

#!/bin/sh
#Screen Init
echo 4 > /sys/class/graphics/fb0/blank;
echo 0 > /sys/class/graphics/fb0/state;
echo 0 > /sys/class/graphics/fb0/blank;
#sysfs poke for reboot2payload
echo 1 > /sys/devices/r2p/default_payload_ready
#Set up Schedutil
CPU_SCHEDUTIL_GOV=0
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors ]; \
then
read governors < \
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
case $governors in
*schedutil*)
CPU_SCHEDUTIL_GOV=1
;;
esac
fi
if [ $CPU_SCHEDUTIL_GOV -eq 1 ]; then
for scaling_governor in \
/sys/devices/system/cpu/cpu[0-7]/cpufreq/scaling_governor; do
echo schedutil > $scaling_governor
done
if [ -e /sys/devices/system/cpu/cpufreq/schedutil/rate_limit_us ]; \
then
echo 2000 > \
/sys/devices/system/cpu/cpufreq/schedutil/rate_limit_us
fi
if [ -e /sys/devices/system/cpu/cpufreq/schedutil/up_rate_limit_us ]; then
echo 0 > /sys/devices/system/cpu/cpufreq/schedutil/up_rate_limit_us
fi
if [ -e /sys/devices/system/cpu/cpufreq/schedutil/down_rate_limit_us ]; then
echo 500 > /sys/devices/system/cpu/cpufreq/schedutil/down_rate_limit_us
fi
if [ -e /sys/devices/system/cpu/cpufreq/schedutil/capacity_margin ]; then
echo 1024 > /sys/devices/system/cpu/cpufreq/schedutil/capacity_margin
fi
fi
if [ ! "$(cat /proc/cmdline | grep performance_mode=1)" = "" ]; then
for scaling_governor in \
/sys/devices/system/cpu/cpu[0-7]/cpufreq/scaling_governor; do
echo performance > $scaling_governor
done
fi