Switch: Tons of fixes, with poor commit history. lol. (#1839)

* Switch: Minor kernel config update

* fat32-boot: Attempt to fix umounting flash partition to prevent possible corruption on reboot

* Switch: Bootloader: Fix mistake in boot.txt that wasnt properly setting up dvfsb stuff

* Switch: Add user for retroarch to run as

* Busybox: Fix writing flash partition when using fat32-boot option to give all users write access

* Audio: Pulseaudio-configs: Minor updates for use when running apps as non root user

* Switch: Finalize changes so for running as non root user.

* Retroarch: Revert broken WAR in retroarch-config script

* Switch: Fix default retroarch config, to work out of box with new user

* Fix retroarch controller configs for switch, and add line to fix it to the update.sh file

* Add back missing lite gamepad config, which got lost in a rebase somewhere

* Retroarch: Start Reworking Switch Clocks

* Switch: Bump switch specific package versions, and add changes needed to make built in lakka clock speed menu work properly. Also hide gamemode.

* Retroarch: add patch to remove game mode from menu to all builds

* Switch: dont enable overclock by default

* sort

* Sort me.

* Switch: Drop old flycast from switch build in favor of newer core.

This has some issues with some games showing artifact bars using vulkan renderer,
but also fixes a lot of issues. As a work around to this issue, users can set opengl renderer, and the bars will not be there.

* More to sort

* Fix CEC stuff

* Fix dock audio switching with new user config

* WIP: GPU Clocks

* sort

* fix quotes

* Add working single joycon configs

* Update Switch Joycond to latest

* Switch: Retroarch: add bluetooth ertm disable, and add patch to fix l2cap kernel hang

* Switch: Update image stuff, so kernel reflects Lakka/Libreelec kernel makes in uimage header, and re-arange some things to make them global

* Switch: Linux: Enable Xpad Driver for wired xbox controllers

* Switch: More xpadneo stuff
This should at a minimum fix issues with Xbox One S controllers
8bitdo and GuliKit KingKong Controller families will probably need more
hid-core patching to redirect them to this driver for support.

Also, when 0.10 version of Xpadneo is released, It will stop building due to kernel not having this patch:
f07b3c1da9

When the time comes, this will need to be looked into.

* xpadneo: update package

* Switch: Update U-Boot to Switchroot 2023-NX03 version

* Switch: Update kernel to Switchroot 5.1.0

* Switch: Create Singular switch-bsp Package
This package consolodates the switch specific configs into one package,
as this feels cleaner, and easier to deal with later, if/when needed.
This package combines the switch-alsa-ucm and switch-bluetooth-dock stuff
into one package.

---------

Co-authored-by: Tomáš Kelemen (vudiq) <vudiq@vudiq.sk>
This commit is contained in:
GavinDarkglider 2023-06-09 17:17:06 -07:00 committed by GitHub
parent 635c166b93
commit 3cc9dbb9ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
74 changed files with 3607 additions and 1543 deletions

View File

@ -1,4 +1,5 @@
PKG_NAME="pulseaudio-configs"
PKG_VERSION="1.1"
PKG_LICENSE="GPL"
PKG_DEPENDS_TARGET="alsa-plugins pulseaudio"
PKG_LONGDESC="Standard configs for pulseaudio"

View File

@ -19,10 +19,10 @@
; default-sink =
; default-source =
; default-server =
default-server = unix:/tmp/pulse-server
; default-dbus-server =
; autospawn = yes
autospawn = no
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog
@ -33,3 +33,5 @@
; auto-connect-localhost = no
; auto-connect-display = no
enable-memfd = yes

View File

@ -72,10 +72,11 @@ load-module module-bluetooth-discover
.endif
### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
load-module module-native-protocol-unix auth-group=audio socket=/tmp/pulse-server
### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)

View File

@ -2,9 +2,9 @@ PKG_NAME="joycond"
PKG_DEPENDS_TARGET="toolchain cmake:host libevdev systemd"
PKG_SITE="https://github.com/DanielOgorchock/joycond"
if [ "${PROJECT}" = "L4T" -a "${DEVICE}" = "Switch" ]; then
PKG_VERSION="031f04311a912514cea9deb020512ee6d7063398"
PKG_SHA256="c2681b1f7723acf0e51e318be3194202e3a77627c78aa39e0a70797d0155dcba"
PKG_URL="https://gitlab.com/switchroot/userspace/joycond/-/archive/c48187fcdacda1b139297e4944a149125e0800b2/joycond-c48187fcdacda1b139297e4944a149125e0800b2.tar.gz"
PKG_VERSION="2bcdbed65b4829d9bb359bff7db4df3b822dc7a1"
PKG_SHA256="9bafe7867dad22394e0133ef4fd828932891d50271aabbd03b49374496cdec0b"
PKG_URL="https://gitlab.com/switchroot/userspace/joycond/-/archive/2bcdbed65b4829d9bb359bff7db4df3b822dc7a1/joycond-2bcdbed65b4829d9bb359bff7db4df3b822dc7a1.tar.gz"
else
PKG_VERSION="2d3f553060291f1bfee2e49fc2ca4a768b289df8"
PKG_SHA256="34ba2a4ffd35f2b2bbebd8ce47d17f2238d991bc6262653d0617b28f864e4b63"

View File

@ -1,5 +1,5 @@
PKG_NAME="retroarch"
PKG_VERSION="ad89b0c655fc1d25adfcdf40268e95c5d0391111"
PKG_VERSION="5a7ac3d06b32d87d7a4e17f09b65560eb4681b85"
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/libretro/RetroArch"
PKG_URL="${PKG_SITE}.git"
@ -318,9 +318,6 @@ makeinstall_target() {
sed -i -e 's|^menu_driver =.*|menu_driver = "ozone"|' ${INSTALL}/etc/retroarch.cfg
if [ ! "${PROJECT}" = "Ayn" -a ! "${DEVICE}" = "Odin" ]; then
#Set Default Joycon index to Combined Joycons.
echo 'input_player1_joypad_index = "2"' >> ${INSTALL}/etc/retroarch.cfg
#Set Joypad as joypad with analog
echo 'input_libretro_device_p1 = "5"' >> ${INSTALL}/etc/retroarch.cfg
else

View File

@ -4,15 +4,3 @@ for i in 5 4 3 2 1 0; do [ -e /dev/snd/pcmC${i}D0p ] && export ALSA_CARD=$i; don
echo "ALSA_CARD=\"$ALSA_CARD\"" > /run/libreelec/retroarch.conf
echo "LD_LIBRARY_PATH=\"/usr/lib:/tmp/cores\"" >> /run/libreelec/retroarch.conf
# WAR: Do to everything running as root, udev doesnt properly hide L/R joycon on 3 out of 4 revisions nintendo switch
# which makes the combined controller index 2, but on Nintendo Switch Lite, on first boot we need to change this to 1
# or built in gamepad needs user intervention to be used.
SERIAL_PREFIX=$(cat /sys/firmware/devicetree/base/serial-number)
SERIAL_PREFIX=${SERIAL_PREFIX:0:3}
if [ ${SERIAL_PREFIX} = "NXV" -a ! -f /storage/.config/retroarch/retroarch.cfg ]; then
cp /etc/retroarch.cfg /storage/.config/retroarch/retroarch.cfg
sed -i -e 's|input_player1_joypad_index = \"2\"|input_player1_joypad_index = \"0\"|' /storage/.config/retroarch/retroarch.cfg
fi

View File

@ -0,0 +1,18 @@
input_driver = "udev"
input_device = "Nintendo Switch Left Joy-Con Test"
input_vendor_id = "1406"
input_product_id = "8198"
input_b_btn = "9"
input_y_btn = "7"
input_select_btn = "5"
input_start_btn = "0"
input_up_axis = "+0"
input_down_axis = "-0"
input_left_axis = "-1"
input_right_axis = "+1"
input_a_btn = "8"
input_x_btn = "10"
input_l_btn = "2"
input_r_btn = "4"

View File

@ -0,0 +1,18 @@
input_driver = "udev"
input_device = "Nintendo Switch Right Joy-Con"
input_vendor_id = "1406"
input_product_id = "8199"
input_b_btn = "1"
input_y_btn = "0"
input_select_btn = "9"
input_start_btn = "8"
input_up_axis = "-0"
input_down_axis = "+0"
input_left_axis = "+1"
input_right_axis = "-1"
input_a_btn = "2"
input_x_btn = "3"
input_l_btn = "4"
input_r_btn = "6"

View File

@ -0,0 +1,29 @@
input_driver = "udev"
input_device = "Nintendo Switch Lite Gamepad"
input_vendor_id = "1406"
input_product_id = "61731"
input_b_btn = "0"
input_y_btn = "3"
input_select_btn = "9"
input_start_btn = "10"
input_up_btn = "14"
input_down_btn = "15"
input_left_btn = "16"
input_right_btn = "17"
input_a_btn = "1"
input_x_btn = "2"
input_l_btn = "5"
input_r_btn = "6"
input_l2_btn = "7"
input_r2_btn = "8"
input_l3_btn = "12"
input_r3_btn = "13"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+2"
input_r_x_minus_axis = "-2"
input_r_y_plus_axis = "+3"
input_r_y_minus_axis = "-3"
input_gun_trigger_mbtn = "1"

View File

@ -15,7 +15,8 @@ makeinstall_target() {
rm "${INSTALL}"/etc/retroarch-joypad-autoconfig/udev/Nintendo\ -\ Switch\ Pro\ Controller.cfg
rm "${INSTALL}"/etc/retroarch-joypad-autoconfig/udev/Nintendo-Switch-Online_NES-Controller_Left.cfg
rm "${INSTALL}"/etc/retroarch-joypad-autoconfig/udev/Nintendo-Switch-Online_NES-Controller_Right.cfg
rm "${INSTALL}"/etc/retroarch-joypad-autoconfig/udev/Nintendo\ Switch\ Left\ Joy-Con.cfg
rm "${INSTALL}"/etc/retroarch-joypad-autoconfig/udev/Nintendo\ Switch\ Right\ Joy-Con.cfg
#Place Working configs
cp -Pr "${PKG_DIR}"/joypad_configs/* "${INSTALL}"/etc/retroarch-joypad-autoconfig/

View File

@ -1,11 +1,11 @@
PKG_NAME="xpadneo"
PKG_VERSION="0.9.1"
PKG_SHA256="1f3617b0689d93877a706a52037649d6cad011cf70491b5b43da015a02312058"
PKG_VERSION="0.9.5"
PKG_SHA256="7518f75d7d30ae1c10ff110e7b066907a7e2c4586a670441d7c4bac9fc7afd52"
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/atar-axis/xpadneo"
PKG_URL="$PKG_SITE/archive/refs/tags/v$PKG_VERSION.tar.gz"
PKG_URL="${PKG_SITE}/archive/refs/tags/v${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_NEED_UNPACK="${LINUX_DEPENDS}"
PKG_LONGDESC="Advanced Linux Driver for Xbox One Wireless Gamepad"
PKG_TOOLCHAIN="manual"
PKG_IS_KERNEL_PKG="yes"
@ -15,17 +15,17 @@ pre_make_target() {
}
make_target() {
kernel_make -C $(kernel_path) M=$PKG_BUILD/hid-xpadneo/src modules
kernel_make -C $(kernel_path) M=${PKG_BUILD}/hid-xpadneo/src modules
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/kernel/drivers/hid
cp -v $PKG_BUILD/hid-xpadneo/src/*.ko $INSTALL/$(get_full_module_dir)/kernel/drivers/hid/
mkdir -p ${INSTALL}/$(get_full_module_dir)/kernel/drivers/hid
cp -v ${PKG_BUILD}/hid-xpadneo/src/*.ko ${INSTALL}/$(get_full_module_dir)/kernel/drivers/hid/
mkdir -p $INSTALL/usr/lib/udev/rules.d
cp -v $PKG_BUILD/hid-xpadneo/etc-udev-rules.d/*.rules $INSTALL/usr/lib/udev/rules.d/
mkdir -p ${INSTALL}/usr/lib/udev/rules.d
cp -v ${PKG_BUILD}/hid-xpadneo/etc-udev-rules.d/*.rules ${INSTALL}/usr/lib/udev/rules.d/
mkdir -p $INSTALL/usr/lib/modprobe.d
cp -v $PKG_BUILD/hid-xpadneo/etc-modprobe.d/*.conf $INSTALL/usr/lib/modprobe.d/
echo "options hid_xpadneo trigger_rumble_mode=2" >> $INSTALL/usr/lib/modprobe.d/xpadneo.conf
mkdir -p ${INSTALL}/usr/lib/modprobe.d
cp -v ${PKG_BUILD}/hid-xpadneo/etc-modprobe.d/*.conf ${INSTALL}/usr/lib/modprobe.d/
echo "options hid_xpadneo trigger_rumble_mode=2" >> ${INSTALL}/usr/lib/modprobe.d/xpadneo.conf
}

View File

@ -28,7 +28,7 @@ case "${LINUX}" in
PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz"
;;
L4T)
PKG_VERSION=${DEVICE}
PKG_VERSION=${DEVICE}-${SWITCHROOT_VERSION}
PKG_URL="l4t-kernel-sources"
GET_HANDLER_SUPPORT="l4t-kernel-sources"
PKG_PATCH_DIRS="${PROJECT} ${PROJECT}/${DEVICE}"

View File

@ -97,10 +97,14 @@ post_makeinstall_target() {
post_install() {
add_user system x 430 430 "service" "/var/run/connman" "/bin/sh"
add_group system 430
add_group system 430 ${DISTRO}
enable_service connman.service
if [ "${WIREGUARD_SUPPORT}" = "yes" ]; then
enable_service connman-vpn.service
fi
if [ "${PROJECT}" = "L4T" -a "${DEVICE}" = "Switch" ]; then
echo chmod u+s ${BUILD}/image/system/usr/bin/connmanctl >> ${FAKEROOT_SCRIPT}
fi
}

View File

@ -195,6 +195,10 @@ post_install() {
add_user root "${ROOT_PWD}" 0 0 "Root User" "/storage" "/bin/sh"
add_group root 0
add_group users 100
if [ "${PROJECT}" = "L4T" -a "${DEVICE}" = "Switch" ]; then
add_user "${DISTRO}" "$(${TOOLCHAIN}/bin/cryptpw -m sha512 "${DISTRO}")" 1000 1000 "${DISTRO} User" "/storage" "/sbin/nologin"
add_group "${DISTRO}" 1000 ${DISTRO}
fi
add_user nobody x 65534 65534 "Nobody" "/" "/bin/sh"
add_group nogroup 65534

View File

@ -557,9 +557,9 @@ mount_flash() {
if [ ! "$FAT32_BOOT" = "yes" ]; then
mount_part "$boot" "/flash" "ro,noatime"
else
mount_part "$boot" "/flash" "rw,noatime"
mount_part "$boot" "/flash" "rw,noatime,umask=0000"
fi
if [ -f /flash/post-flash.sh ]; then
. /flash/post-flash.sh
fi

View File

@ -234,6 +234,8 @@ post_makeinstall_target() {
ln -sf /usr/bin/systemctl ${INSTALL}/usr/sbin/shutdown
ln -sf /usr/bin/systemctl ${INSTALL}/usr/sbin/telinit
chmod u+s ${INSTALL}/usr/bin/systemctl
# strip
debug_strip ${INSTALL}/usr
@ -268,20 +270,20 @@ post_install() {
add_group systemd-network 193
add_user systemd-network x 193 193 "systemd-network" "/" "/bin/sh"
add_group audio 63
add_group cdrom 11
add_group dialout 18
add_group disk 6
add_group floppy 19
add_group audio 63 ${DISTRO}
add_group cdrom 11 ${DISTRO}
add_group dialout 18 ${DISTRO}
add_group disk 6 ${DISTRO}
add_group floppy 19 ${DISTRO}
add_group kmem 9
add_group kvm 10
add_group lp 7
add_group render 12
add_group tape 33
add_group tty 5
add_group video 39
add_group video 39 ${DISTRO}
add_group utmp 22
add_group input 199
add_group input 199 ${DISTRO}
enable_service machine-id.service
enable_service debugconfig.service
@ -293,4 +295,11 @@ post_install() {
enable_service network-base.service
enable_service systemd-timesyncd.service
enable_service systemd-timesyncd-setup.service
#Add service to properly remount flash partition when using fat32-boot kernel command line option.
enable_service remount_flash_ro.service
if [ "${PROJECT}" = "L4T" -a "${DEVICE}" = "Switch" ]; then
echo chmod u+s ${BUILD}/image/system/usr/bin/systemctl >> ${FAKEROOT_SCRIPT}
fi
}

View File

@ -0,0 +1,12 @@
[Unit]
Description=Remount /flash as RO
ConditionKernelCommandLine=fat32-boot
DefaultDependencies=no
After=final.target
[Service]
Type=oneshot
ExecStart=mount -o remount,ro /flash
[Install]
WantedBy=final.target

View File

@ -41,10 +41,3 @@ if [ $CPU_SCHEDUTIL_GOV -eq 1 ]; 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

View File

@ -215,7 +215,7 @@ CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
# CONFIG_SLUB_DEBUG is not set
CONFIG_COMPAT_BRK=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
@ -306,13 +306,11 @@ CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
# CONFIG_BLK_DEV_BSGLIB is not set
CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_BLK_DEV_THROTTLING=y
# CONFIG_BLK_CMDLINE_PARSER is not set
#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
# CONFIG_ACORN_PARTITION is not set
# CONFIG_AIX_PARTITION is not set
# CONFIG_OSF_PARTITION is not set
@ -392,7 +390,7 @@ CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DOMAINS_GENERIC=y
CONFIG_PCI_SYSCALL=y
CONFIG_PCIEPORTBUS=y
# CONFIG_PCIEPORTBUS is not set
CONFIG_PCIEAER=y
CONFIG_PCIE_ECRC=y
CONFIG_PCIEASPM=y
@ -545,12 +543,11 @@ CONFIG_ZPOOL=y
CONFIG_ZBUD=y
# CONFIG_Z3FOLD is not set
CONFIG_ZSMALLOC=y
# CONFIG_PGTABLE_MAPPING is not set
CONFIG_PGTABLE_MAPPING=y
# CONFIG_ZSMALLOC_STAT is not set
CONFIG_GENERIC_EARLY_IOREMAP=y
# CONFIG_IDLE_PAGE_TRACKING is not set
CONFIG_ZONE_DEVICE=y
CONFIG_DEVICE_PRIVATE=y
# CONFIG_DEVICE_PUBLIC is not set
CONFIG_FRAME_VECTOR=y
CONFIG_ARCH_MEMORY_PROBE=y
@ -574,7 +571,6 @@ CONFIG_SETEND_EMULATION=y
#
# CONFIG_ARM64_HW_AFDBM is not set
# CONFIG_ARM64_PAN is not set
CONFIG_ARM64_LSE_ATOMICS=y
# CONFIG_ARM64_VHE is not set
#
@ -655,8 +651,6 @@ CONFIG_DT_IDLE_STATES=y
# ARM CPU Idle Drivers
#
CONFIG_ARM_CPUIDLE=y
CONFIG_CPU_IDLE_TEGRA18X=y
CONFIG_CPU_IDLE_TEGRA19X=y
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
#
@ -1112,7 +1106,6 @@ CONFIG_TEGRA_AHB=y
# Generic Driver Options
#
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_STANDALONE=y
@ -1271,7 +1264,7 @@ CONFIG_BLK_DEV_NBD=m
# CONFIG_BLK_DEV_SKD is not set
# CONFIG_BLK_DEV_SX8 is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_COUNT=4
CONFIG_BLK_DEV_RAM_SIZE=8192
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
@ -1383,7 +1376,6 @@ CONFIG_SENSORS_NCT1008=y
CONFIG_TSKIN_FAN_THERM_EST=y
# CONFIG_EQOS_APE_HWDEP is not set
# CONFIG_TEGRA_SKIN is not set
CONFIG_TEGRA_PCIE_EP_MEM=y
# CONFIG_NVS is not set
# CONFIG_NVS_LIGHT is not set
# CONFIG_NVS_PROXIMITY is not set
@ -1602,22 +1594,10 @@ CONFIG_WLAN=y
# CONFIG_WLAN_VENDOR_ATH is not set
# CONFIG_WLAN_VENDOR_ATMEL is not set
CONFIG_WLAN_VENDOR_BROADCOM=y
CONFIG_B43=y
CONFIG_B43_BCMA=y
CONFIG_B43_SSB=y
CONFIG_B43_BUSES_BCMA_AND_SSB=y
# CONFIG_B43_BUSES_BCMA is not set
# CONFIG_B43_BUSES_SSB is not set
CONFIG_B43_PCI_AUTOSELECT=y
CONFIG_B43_PCICORE_AUTOSELECT=y
# CONFIG_B43_SDIO is not set
CONFIG_B43_BCMA_PIO=y
CONFIG_B43_PIO=y
CONFIG_B43_PHY_G=y
CONFIG_B43_PHY_N=y
CONFIG_B43_PHY_LP=y
CONFIG_B43_PHY_HT=y
CONFIG_B43_LEDS=y
# CONFIG_B43_DEBUG is not set
# CONFIG_B43LEGACY is not set
CONFIG_BRCMUTIL=y
@ -1625,7 +1605,7 @@ CONFIG_BRCMUTIL=y
CONFIG_BRCMFMAC=m
CONFIG_BRCMFMAC_PROTO_BCDC=y
CONFIG_BRCMFMAC_PROTO_MSGBUF=y
CONFIG_BRCMFMAC_SDIO=y
# CONFIG_BRCMFMAC_SDIO is not set
# CONFIG_BRCMFMAC_USB is not set
CONFIG_BRCMFMAC_PCIE=y
# CONFIG_BRCM_TRACING is not set
@ -1746,7 +1726,7 @@ CONFIG_JOYCON_SERDEV_FF=y
# CONFIG_JOYSTICK_ZHENHUA is not set
# CONFIG_JOYSTICK_AS5011 is not set
# CONFIG_JOYSTICK_JOYDUMP is not set
# CONFIG_JOYSTICK_XPAD is not set
CONFIG_JOYSTICK_XPAD=m
CONFIG_INPUT_TABLET=y
# CONFIG_TABLET_USB_ACECAD is not set
# CONFIG_TABLET_USB_AIPTEK is not set
@ -1941,7 +1921,8 @@ CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
# CONFIG_TTY_PRINTK is not set
# CONFIG_HVC_DCC is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_TEGRA=y
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@ -2014,7 +1995,7 @@ CONFIG_I2C_ALGOBIT=y
# CONFIG_I2C_RK3X is not set
# CONFIG_I2C_SIMTEC is not set
CONFIG_I2C_TEGRA=y
CONFIG_I2C_TEGRA_SLAVE=y
CONFIG_I2C_TEGRA_SLAVE=m
# CONFIG_I2C_THUNDERX is not set
# CONFIG_I2C_XILINX is not set
@ -2122,10 +2103,10 @@ CONFIG_PINCTRL_MAX77620=y
CONFIG_PINCTRL_TEGRA=y
CONFIG_PINCTRL_TEGRA210=y
CONFIG_PINCTRL_TEGRA_XUSB=y
CONFIG_PINCTRL_TEGRA186=y
#CONFIG_PINCTRL_TEGRA186 is not set
# CONFIG_PINCTRL_TEGRA186_PADCTL is not set
# CONFIG_PINCTRL_TEGRA186_DPAUX is not set
CONFIG_PINCTRL_TEGRA194=y
# CONFIG_PINCTRL_TEGRA194 is not set
# CONFIG_PINCTRL_TEGRA194_PEXCLK_PADCTL is not set
CONFIG_GPIOLIB=y
CONFIG_OF_GPIO=y
@ -2194,7 +2175,7 @@ CONFIG_GPIO_MAX77620=y
#
# USB GPIO expanders
#
CONFIG_GPIO_TEGRA186=y
# CONFIG_GPIO_TEGRA186 is not set
# CONFIG_GPIO_TMPM32X_I2C is not set
CONFIG_PADCTRL=y
CONFIG_PADCTRL_GENERIC_TEGRA_IO_PAD=y
@ -2600,7 +2581,7 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_REGULATOR_ANATOP is not set
# CONFIG_REGULATOR_DA9210 is not set
# CONFIG_REGULATOR_DA9211 is not set
# CONFIG_REGULATOR_FAN53555 is not set
CONFIG_REGULATOR_FAN53555=y
CONFIG_REGULATOR_GPIO=y
# CONFIG_REGULATOR_ISL9305 is not set
# CONFIG_REGULATOR_ISL6271A is not set
@ -2969,11 +2950,11 @@ CONFIG_TEGRA_GRHOST_NVDEC=y
CONFIG_TEGRA_GRHOST_NVENC=y
CONFIG_TEGRA_GRHOST_NVJPG=y
CONFIG_TEGRA_GRHOST_TSEC=y
CONFIG_TEGRA_GRHOST_NVCSI=y
# CONFIG_TEGRA_GRHOST_NVCSI is not set
CONFIG_TEGRA_GRHOST_SCALE=y
CONFIG_TEGRA_GRHOST_DEFAULT_TIMEOUT=10000
CONFIG_TEGRA_GRHOST_SYNC=y
CONFIG_TEGRA_GRHOST_VHOST=y
# CONFIG_TEGRA_GRHOST_VHOST is not set
# CONFIG_NVDEC_BOOTLOADER is not set
CONFIG_TSEC_USE_WPR=y
CONFIG_TEGRA_CAMERA_PLATFORM=y
@ -3597,7 +3578,7 @@ CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_BLOCK_BOUNCE=y
# CONFIG_SDIO_UART is not set
CONFIG_MMC_TEST=y
CONFIG_MMC_TEST=m
# CONFIG_MMC_SIMULATE_MAX_SPEED is not set
# CONFIG_MMC_FFU is not set
# CONFIG_MMCQD_CPU_AFFINITY is not set
@ -3624,7 +3605,6 @@ CONFIG_MMC_SDHCI_TEGRA=y
# CONFIG_MMC_USDHI6ROL0 is not set
# CONFIG_MMC_TOSHIBA_PCI is not set
# CONFIG_MMC_MTK is not set
CONFIG_MMC_CQ_HCI=y
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
@ -3951,8 +3931,6 @@ CONFIG_STAGING=y
# CONFIG_SPEAKUP is not set
# CONFIG_MFD_NVEC is not set
#
# Android
#
# CONFIG_FIQ_DEBUGGER is not set
# CONFIG_FIQ_WATCHDOG is not set
@ -3970,12 +3948,7 @@ CONFIG_SYNC=y
# CONFIG_MOST is not set
# CONFIG_KS7010 is not set
# CONFIG_GREYBUS is not set
CONFIG_STEPPER=y
CONFIG_STEPPER_PCA=y
#
# STEPPER drivers
#
# CONFIG_USB_WPAN_HCD is not set
# CONFIG_GOLDFISH is not set
# CONFIG_CHROME_PLATFORMS is not set
@ -4467,7 +4440,6 @@ CONFIG_PWM_TEGRA=y
CONFIG_PWM_TEGRA_TACHOMETER=y
CONFIG_PWM_TEGRA_PMC_BLINK=y
CONFIG_PWM_TEGRA_PMC_SOFT_LED_BLINK=y
CONFIG_PWM_TEGRA_DFLL=y
CONFIG_IRQCHIP=y
CONFIG_ARM_GIC=y
CONFIG_FIQ=y
@ -4846,7 +4818,7 @@ CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
# CONFIG_BOOT_PRINTK_DELAY is not set
CONFIG_DYNAMIC_DEBUG=y
# CONFIG_DYNAMIC_DEBUG is not set
#
# Compile-time checks and compiler options
@ -4888,7 +4860,7 @@ CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=400
# CONFIG_DEBUG_KMEMLEAK_TEST is not set
CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y
CONFIG_DEBUG_KMEMLEAK_SCAN_ON=y
# CONFIG_DEBUG_KMEMLEAK_SCAN_ON is not set
# CONFIG_DEBUG_STACK_USAGE is not set
CONFIG_DEBUG_VM=y
# CONFIG_DEBUG_VM_VMACACHE is not set
@ -5204,7 +5176,7 @@ CONFIG_TEGRA_CRYPTO_DEV=y
CONFIG_CRYPTO_DEV_TEGRA_SE=y
CONFIG_CRYPTO_DEV_TEGRA_ELLIPTIC_SE=y
CONFIG_CRYPTO_DEV_TEGRA_SE_USE_HOST1X_INTERFACE=y
# CONFIG_CRYPTO_DEV_TEGRA_VIRTUAL_SE_INTERFACE is not set
CONFIG_CRYPTO_DEV_TEGRA_VIRTUAL_SE_INTERFACE=y
# CONFIG_ASYMMETRIC_KEY_TYPE is not set
#

View File

@ -11,12 +11,27 @@ case ${TARGET_ARCH} in
;;
esac
ADDITIONAL_PACKAGES+=" switch-joycon-bluetooth-dock-configs switch-alsa-ucm-configs libcec v4l-utils usb-gadget-scripts switch-cpu-profile switch-gpu-profile"
if [ "${DISTRO}" = "Lakka" ]; then
DISTRO_PATH="lakka"
DISTRO_ICON="icon_lakka_hue.bmp"
HEKATE_SPLASH="splash_lakka.bmp"
ID="SWR-LAK"
ADDITIONAL_PACKAGES+=" mergerfs"
elif [ "${DISTRO}" = "LibreELEC" ]; then
DISTRO_PATH="libreelec"
DISTRO_ICON="icon_libreelec_hue.bmp"
HEKATE_SPLASH="splash_libreelec.bmp"
ID="SWR-LIB"
else
echo "Unknown distro, expect issues"
fi
ADDITIONAL_PACKAGES+=" switch-bsp libcec v4l-utils"
#Remove since we include driver in kernel now. Module Config/udev rules
#Included in switch-bsp package, to match version in kernel(0.9.5).
ADDITIONAL_PACKAGES="${ADDITIONAL_PACKAGES/xpadneo/}"
if [ ${PULSEAUDIO_SUPPORT} = "yes" ]; then
ADDITIONAL_PACKAGES+=" pulseaudio-configs"
fi
@ -24,20 +39,21 @@ fi
BOOTLOADER="switch-bootloader" # this is a fake bootloader since coreboot and u-boot are sideloaded
ADDITIONAL_DRIVERS+=" xf86-input-libinput"
#Add proper version for kernel based upon switchroot version Only used for switch
SWITCHROOT_VERSION=5.1.0
GENERIC_L4T_VERSION=32.3.1
L4T_DEVICE_TYPE="t210"
#L4T_COMBINED_KERNEL_SHA256="c3a8df6836cb4581162da6f4d380c2a730f69b3bac8bbaf4c2ec6c73ab5461cd"
L4T_DEVICE_CUSTOM_BOARD_NAME="nx"
L4T_KERNEL_4_9_REPO="https://gitlab.com/switchroot/kernel/l4t-kernel-4.9.git"
L4T_KERNEL_4_9_REPO_BRANCH="linux-5.0.0-dev"
L4T_KERNEL_4_9_REPO_SHA256="68e1648524c7deacc9e7346113aa2f60edadc7f2"
L4T_KERNEL_4_9_REPO="https://github.com/CTCaer/switch-l4t-kernel-4.9.git"
L4T_KERNEL_4_9_REPO_BRANCH="linux-5.1.0"
L4T_KERNEL_4_9_REPO_SHA256="3eb000b1983eeeb7038b551b539c88458a42a1d6"
L4T_KERNEL_NVIDIA_REPO="https://gitlab.com/switchroot/kernel/l4t-kernel-nvidia.git"
L4T_KERNEL_NVIDIA_REPO_BRANCH="linux-5.0.0-dev"
L4T_KERNEL_NVIDIA_REPO_SHA256="2a7d8df2de59dc388f2ced76ac2f1180d324d985"
L4T_KERNEL_NVIDIA_REPO="https://github.com/CTCaer/switch-l4t-kernel-nvidia.git"
L4T_KERNEL_NVIDIA_REPO_BRANCH="linux-5.1.0"
L4T_KERNEL_NVIDIA_REPO_SHA256="578d533b99cd5d5c3e57760431d2f621307265cf"
L4T_KERNEL_NVGPU_REPO="https://gitlab.com/switchroot/kernel/l4t-kernel-nvgpu.git"
L4T_KERNEL_NVGPU_REPO_BRANCH="linux-3.4.0-r32.5"
@ -60,6 +76,6 @@ L4T_DEVICE_T210_REPO_BRANCH="l4t/l4t-r32.3.1"
#L4T_DEVICE_T210_REPO_SHA256="0d7816046cb06b637a3b70381a5e4994fd897c35"
#Apply Custom Device DTS tree.
L4T_DEVICE_CUSTOM_REPO="https://gitlab.com/switchroot/kernel/l4t-platform-t210-switch.git"
L4T_DEVICE_CUSTOM_REPO_BRANCH="linux-5.0.0-dev"
L4T_DEVICE_CUSTOM_REPO_SHA256="8abfc0ac0241a501284ecc2cd11737f5967f7f58"
L4T_DEVICE_CUSTOM_REPO="https://github.com/CTCaer/switch-l4t-platform-t210-nx.git"
L4T_DEVICE_CUSTOM_REPO_BRANCH="linux-5.1.0"
L4T_DEVICE_CUSTOM_REPO_SHA256="9af1d3a9f991b8c8761395986844c7b3c4446b6f"

View File

@ -5,7 +5,9 @@ ConditionKernelCommandLine=!retroarch=0
Requires=graphical.target
[Service]
Environment=HOME=/storage DISPLAY=:0
Environment=HOME=/storage DISPLAY=:0 PULSE_SERVER=127.0.0.1
User=Lakka
Group=Lakka
EnvironmentFile=-/run/libreelec/retroarch.conf
EnvironmentFile=-/storage/.cache/services/retroarch.conf
ExecStartPre=-/usr/lib/retroarch/retroarch-config

View File

@ -1,11 +0,0 @@
PKG_NAME="switch-alsa-ucm-configs"
PKG_DEPENDS_TARGET="alsa-lib alsa-ucm-conf"
PKG_SECTION="virtual"
PKG_LONGDESC="Nintendo Switch Alsa UCM Configs"
post_install() {
mkdir -p ${INSTALL}/usr/share/alsa/ucm2
cp -Prv ${PKG_DIR}/ucm_data/* ${INSTALL}/usr/share/alsa/ucm2/
#Audio Fix Service
enable_service alsa-init.service
}

View File

@ -1,131 +0,0 @@
#
# ALSA library configuration file
#
# Copyright (c) 2018-2019 NVIDIA Corporation. All Rights Reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property and
# proprietary rights in and to this software and related documentation. Any
# use, reproduction, disclosure or distribution of this software and related
# documentation without an express license agreement from NVIDIA Corporation
# is strictly prohibited.
#
# Configuration for Tegra soundcards
CARDINFO{driver}=="tegra-snd-t210r", GOTO="Tegra210 Init"
CARDINFO{driver}=="tegra-snd-t186r", GOTO="Tegra186 Init"
CARDINFO{driver}=="tegra-snd-t19x-", GOTO="Tegra186 Init"
RESULT="false", EXIT="return"
LABEL="Tegra210 Init"
CTL{reset}="mixer"
#CTL{name}="OPE2 Mux", CTL{value}="None"
GOTO="Tegra Common Init"
LABEL="Tegra186 Init"
CTL{reset}="mixer"
CTL{name}="ADMAIF11 Mux", CTL{value}="None"
CTL{name}="ADMAIF12 Mux", CTL{value}="None"
CTL{name}="ADMAIF13 Mux", CTL{value}="None"
CTL{name}="ADMAIF14 Mux", CTL{value}="None"
CTL{name}="ADMAIF15 Mux", CTL{value}="None"
CTL{name}="ADMAIF16 Mux", CTL{value}="None"
CTL{name}="ADMAIF17 Mux", CTL{value}="None"
CTL{name}="ADMAIF18 Mux", CTL{value}="None"
CTL{name}="ADMAIF19 Mux", CTL{value}="None"
CTL{name}="ADMAIF20 Mux", CTL{value}="None"
CTL{name}="ADX3 Mux", CTL{value}="None"
CTL{name}="ADX4 Mux", CTL{value}="None"
CTL{name}="AMX3-1 Mux", CTL{value}="None"
CTL{name}="AMX3-2 Mux", CTL{value}="None"
CTL{name}="AMX3-3 Mux", CTL{value}="None"
CTL{name}="AMX3-4 Mux", CTL{value}="None"
CTL{name}="AMX4-1 Mux", CTL{value}="None"
CTL{name}="AMX4-2 Mux", CTL{value}="None"
CTL{name}="AMX4-3 Mux", CTL{value}="None"
CTL{name}="AMX4-4 Mux", CTL{value}="None"
CTL{name}="ASRC1-1 Mux", CTL{value}="None"
CTL{name}="ASRC1-2 Mux", CTL{value}="None"
CTL{name}="ASRC1-3 Mux", CTL{value}="None"
CTL{name}="ASRC1-4 Mux", CTL{value}="None"
CTL{name}="ASRC1-5 Mux", CTL{value}="None"
CTL{name}="ASRC1-6 Mux", CTL{value}="None"
CTL{name}="Denominator1 Mux", CTL{value}="None"
CTL{name}="Denominator2 Mux", CTL{value}="None"
CTL{name}="Denominator3 Mux", CTL{value}="None"
CTL{name}="Denominator4 Mux", CTL{value}="None"
CTL{name}="Denominator5 Mux", CTL{value}="None"
CTL{name}="Denominator6 Mux", CTL{value}="None"
CTL{name}="DSPK1 Mux", CTL{value}="None"
CTL{name}="DSPK2 Mux", CTL{value}="None"
CTL{name}="I2S6 Mux", CTL{value}="None"
CTL{name}="Numerator1 Mux", CTL{value}="None"
CTL{name}="Numerator2 Mux", CTL{value}="None"
CTL{name}="Numerator3 Mux", CTL{value}="None"
CTL{name}="Numerator4 Mux", CTL{value}="None"
CTL{name}="Numerator5 Mux", CTL{value}="None"
CTL{name}="Numerator6 Mux", CTL{value}="None"
LABEL="Tegra Common Init"
CTL{reset}="mixer"
CTL{name}="ADMAIF1 Mux", CTL{value}="None"
CTL{name}="ADMAIF2 Mux", CTL{value}="None"
CTL{name}="ADMAIF3 Mux", CTL{value}="None"
CTL{name}="ADMAIF4 Mux", CTL{value}="None"
CTL{name}="ADMAIF5 Mux", CTL{value}="None"
CTL{name}="ADMAIF6 Mux", CTL{value}="None"
CTL{name}="ADMAIF7 Mux", CTL{value}="None"
CTL{name}="ADMAIF8 Mux", CTL{value}="None"
CTL{name}="ADMAIF9 Mux", CTL{value}="None"
CTL{name}="ADMAIF10 Mux", CTL{value}="None"
CTL{name}="ADX1 Mux", CTL{value}="None"
CTL{name}="ADX2 Mux", CTL{value}="None"
CTL{name}="AFC1 Mux", CTL{value}="None"
CTL{name}="AFC2 Mux", CTL{value}="None"
CTL{name}="AFC3 Mux", CTL{value}="None"
CTL{name}="AFC4 Mux", CTL{value}="None"
CTL{name}="AFC5 Mux", CTL{value}="None"
CTL{name}="AFC6 Mux", CTL{value}="None"
CTL{name}="AMX1-1 Mux", CTL{value}="None"
CTL{name}="AMX1-2 Mux", CTL{value}="None"
CTL{name}="AMX1-3 Mux", CTL{value}="None"
CTL{name}="AMX1-4 Mux", CTL{value}="None"
CTL{name}="AMX2-1 Mux", CTL{value}="None"
CTL{name}="AMX2-2 Mux", CTL{value}="None"
CTL{name}="AMX2-3 Mux", CTL{value}="None"
CTL{name}="AMX2-4 Mux", CTL{value}="None"
CTL{name}="I2S1 Mux", CTL{value}="None"
CTL{name}="I2S2 Mux", CTL{value}="None"
CTL{name}="I2S3 Mux", CTL{value}="None"
CTL{name}="I2S4 Mux", CTL{value}="None"
CTL{name}="I2S5 Mux", CTL{value}="None"
CTL{name}="MIXER1-1 Mux", CTL{value}="None"
CTL{name}="MIXER1-2 Mux", CTL{value}="None"
CTL{name}="MIXER1-3 Mux", CTL{value}="None"
CTL{name}="MIXER1-4 Mux", CTL{value}="None"
CTL{name}="MIXER1-5 Mux", CTL{value}="None"
CTL{name}="MIXER1-6 Mux", CTL{value}="None"
CTL{name}="MIXER1-7 Mux", CTL{value}="None"
CTL{name}="MIXER1-8 Mux", CTL{value}="None"
CTL{name}="MIXER1-9 Mux", CTL{value}="None"
CTL{name}="MIXER1-10 Mux", CTL{value}="None"
CTL{name}="MVC1 Mux", CTL{value}="None"
CTL{name}="MVC2 Mux", CTL{value}="None"
CTL{name}="OPE1 Mux", CTL{value}="None"
CTL{name}="SFC1 Mux", CTL{value}="None"
CTL{name}="SFC2 Mux", CTL{value}="None"
CTL{name}="SFC3 Mux", CTL{value}="None"
CTL{name}="SFC4 Mux", CTL{value}="None"
CTL{name}="SPKPROT1 Mux", CTL{value}="None"
CARDINFO{driver}=="tegra-snd-t210r", \
CTL{name}="I2S1 Loopback", CTL{do_search}=="0", \
CTL{name}="ADMAIF1 Mux", CTL{value}="I2S1" \
CTL{name}="I2S1 Mux", CTL{value}="ADMAIF1"
CARDINFO{driver}=="tegra-snd-t186r", \
CTL{name}="ADMAIF1 Mux", CTL{value}="I2S1" \
CTL{name}="I2S1 Mux", CTL{value}="ADMAIF1"
CARDINFO{driver}=="tegra-snd-t19x-", \
CTL{name}="ADMAIF1 Mux", CTL{value}="I2S1" \
CTL{name}="I2S1 Mux", CTL{value}="ADMAIF1" \
CTL{name}="ADMAIF2 Mux", CTL{value}="I2S2" \
CTL{name}="I2S2 Mux", CTL{value}="ADMAIF2"
PRINT="Reset Tegra APE sound-card controls\n"
RESULT="true", EXIT="return"

View File

@ -1,70 +0,0 @@
#
# ALSA library configuration file
#
# Copyright (c) 2018-2019 NVIDIA Corporation. All Rights Reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property and
# proprietary rights in and to this software and related documentation. Any
# use, reproduction, disclosure or distribution of this software and related
# documentation without an express license agreement from NVIDIA Corporation
# is strictly prohibited.
#
# Configuration for Tegra soundcards using the RT565x codec
CARDINFO{driver}=="tegra-snd-t210r", GOTO="Tegra RT565x Init"
CARDINFO{driver}=="tegra-snd-t186r", GOTO="Tegra RT565x Init"
CARDINFO{driver}=="tegra-snd-t19x-", GOTO="Tegra RT565x Init"
RESULT="false", EXIT="return"
LABEL="Tegra RT565x Init"
CTL{reset}="mixer"
CTL{name}="x TDM Data Mux",PROGRAM!="__ctl_search",GOTO="Tegra RT565x Next"
# RT565x playback setup
CTL{name}="x Headphone Playback Volume", CTL{value}="31,31"
CTL{name}="x Stereo DAC MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="x Stereo DAC MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="x HPO R Playback Switch", CTL{value}="on"
CTL{name}="x HPO L Playback Switch", CTL{value}="on"
CTL{name}="x DAC1 Playback Volume", CTL{value}="175,175"
CTL{name}="x DAC1 Playback Switch", CTL{value}="on"
CTL{name}="x DAC1 MIXR DAC1 Switch", CTL{value}="on"
CTL{name}="x DAC1 MIXL DAC1 Switch", CTL{value}="on"
# RT565x capture setup
CTL{name}="x RECMIX1L BST1 Switch", CTL{value}="on"
CTL{name}="x RECMIX1R BST1 Switch", CTL{value}="on"
CTL{name}="x Stereo1 ADC Source", CTL{value}="ADC1"
CTL{name}="x Stereo1 ADC1 Source", CTL{value}="ADC"
CTL{name}="x Stereo1 ADC MIXL ADC1 Switch", CTL{value}="on"
CTL{name}="x Stereo1 ADC MIXR ADC1 Switch", CTL{value}="on"
CTL{name}="x TDM Data Mux", CTL{value}="AD1:AD2:DAC:NUL"
CTL{name}="x IN1 Boost Volume", CTL{value}="43"
PRINT="Initialised RT565x codec with prefix 'x'\n"
LABEL="Tegra RT565x Next"
CTL{name}="y TDM Data Mux",PROGRAM!="__ctl_search",RESULT="true", EXIT="return"
# RT565x playback setup
CTL{name}="y Headphone Playback Volume", CTL{value}="31,31"
CTL{name}="y Stereo DAC MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="y Stereo DAC MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="y HPO R Playback Switch", CTL{value}="on"
CTL{name}="y HPO L Playback Switch", CTL{value}="on"
CTL{name}="y DAC1 Playback Volume", CTL{value}="175,175"
CTL{name}="y DAC1 Playback Switch", CTL{value}="on"
CTL{name}="y DAC1 MIXR DAC1 Switch", CTL{value}="on"
CTL{name}="y DAC1 MIXL DAC1 Switch", CTL{value}="on"
# RT565x capture setup
CTL{name}="y RECMIX1L BST1 Switch", CTL{value}="on"
CTL{name}="y RECMIX1R BST1 Switch", CTL{value}="on"
CTL{name}="y Stereo1 ADC Source", CTL{value}="ADC1"
CTL{name}="y Stereo1 ADC1 Source", CTL{value}="ADC"
CTL{name}="y Stereo1 ADC MIXL ADC1 Switch", CTL{value}="on"
CTL{name}="y Stereo1 ADC MIXR ADC1 Switch", CTL{value}="on"
CTL{name}="y TDM Data Mux", CTL{value}="AD1:AD2:DAC:NUL"
CTL{name}="y IN1 Boost Volume", CTL{value}="43"
PRINT="Initialised RT565x codec with prefix 'y'\n"
RESULT="true", EXIT="return"

View File

@ -16,7 +16,7 @@ Below you can find all supported keys and their defaults.
Mandatory!
[id=@DISTRO_ID@]
Set FS Label name. SWR-UBU by default.
Set FS Label name. @DISTRO_ID@ by default.
Used to automatically find the correct linux partition.
================================================================================
@ -49,10 +49,6 @@ Below you can find all supported keys and their defaults.
[als_enable=1]
1: Enable Ambient Light Sensor.
[cec_enable=0]
1: Enable auto DP/HDMI CEC negotiation.
[bootargs_extra=]
Set extra kernel command line arguments.
@ -79,17 +75,4 @@ Below you can find all supported keys and their defaults.
- 2133000
[performance_mode=0]
0: Use default schedutil cpu governor
1: Use Performance CPU governor
[dock_freq_switch_enabled=0]
0: Do not autoswitch clocks when docking/undocking
1: Autoswitch clocks when docking/undocking.
This feature only auto changes speeds to the HOS defaults for both tablet/docked mode.
It also doesnt switch even if set if you change clocks manually. This is intentional,
as I give you a menu to set clocks, and dont want to override your settings. If
you set clock back to stock clock speed, it will start auto swapping again.
================================================================================

View File

@ -10,8 +10,6 @@ test -n ${als_enable} || setenv als_enable 1
test -n ${usb3_enable} || setenv usb3_enable 0
test -n ${4k60_disable} || setenv 4k60_disable 0
test -n ${dvfsb} || setenv dvfsb 0
test -n ${cec_enable} || setenv cec_enable 0
test -n ${performance_mode} || setenv performance_mode 0
test -n ${dock_freq_switch_enabled} || setenv dock_freq_switch_enabled 0
# Set logging params for each serial type.
@ -150,11 +148,21 @@ if test ${sku} = 2 -a -n "${VLIM}"; then
fi
# Enable SLT DVFS.
if test ${dvfsb} = 1; then
echoe SLT DVFS B enabled
setenv bootargs_extra ${bootargs_extra} "speedo_tegra210.cspd_id=2 speedo_tegra210.cspd_id=2 speedo_tegra210.gspd_id=2"
fi
# Enable SLT DVFS.
if test ${t210b01} = 1 -a ${dvfsb} = 1; then
echoe DVFS B-Side enabled
setenv bootargs_extra ${bootargs_extra} "speedo_tegra210.sku_id=0x83 speedo_tegra210.cspd_id=2 speedo_tegra210.sspd_id=2 speedo_tegra210.gspd_id=2"
if test ${sku} != 2; then
# 2397 MHz CPU and 1075 MHz GPU hard limit.
fdt set /cpufreq/cpu-scaling-data max-frequency <0x249348>
fdt set /dvfs nvidia,gpu-max-freq-khz <0x106800>
else
# 2091 MHz CPU and 844 MHz GPU hard limit. Vali.
fdt set /cpufreq/cpu-scaling-data max-frequency <0x1FE7F8>
fdt set /dvfs nvidia,gpu-max-freq-khz <0xCE400>
fi
fi
# Set serial number.
@ -213,8 +221,7 @@ if test -n ${device_wifi_mac}; then fdt set /chosen nvidia,wifi-mac ${device_wif
# Set kernel cdmline.
setenv bootargs ${bootargs_extra} "boot=/dev/mmcblk0p1 BOOT_IMAGE=@DISTRO_PATH@/KERNEL SYSTEM_IMAGE=@DISTRO_PATH@/SYSTEM nofsck fat32-boot cec_enabled=${cec_enable} \
dock_freq_switch_enabled=${dock_freq_switch_enabled} performance_mode=${performance_mode} \
setenv bootargs ${bootargs_extra} "boot=/dev/mmcblk0p1 BOOT_IMAGE=@DISTRO_PATH@/KERNEL SYSTEM_IMAGE=@DISTRO_PATH@/SYSTEM nofsck fat32-boot \
firmware_class.path=/usr/lib/firmware \
pmc_r2p.enabled=1 pmc_r2p.action=${r2p_action} \
pmc_r2p.param1=${autoboot} pmc_r2p.param2=${autoboot_list} \

View File

@ -1,25 +1,9 @@
PKG_NAME="switch-bootloader"
PKG_VERSION="2.1"
PKG_VERSION="2.3"
PKG_ARCH="any"
PKG_DEPENDS_TARGET="switch-u-boot:host switch-u-boot:target switch-atf:target"
PKG_TOOLCHAIN="manual"
if [ "${DISTRO}" = "Lakka" ]; then
DISTRO_PATH="lakka"
DISTRO_ICON="icon_lakka_hue.bmp"
HEKATE_SPLASH="splash_lakka.bmp"
ID="SWR-LAK"
elif [ "${DISTRO}" = "LibreELEC" ]; then
DISTRO_PATH="libreelec"
DISTRO_ICON="icon_libreelec_hue.bmp"
HEKATE_SPLASH="splash_libreelec.bmp"
ID="SWR-LIB"
else
echo "Unknown distro, expect issues"
fi
make_target() {
cat << EOF > ${PKG_BUILD}/${DISTRO}.ini
[${DISTRO}]
@ -70,6 +54,7 @@ makeinstall_target() {
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/splash.bmp" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/splash.bmp
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/README_CONFIG.txt" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/README_CONFIG.txt
mkdir -p \${BOOT_ROOT}/${DISTRO_PATH}/boot
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/storage/.config/retroarch/retroarch.cfg" ] && sed -i -e 's|input_player1_joypad_index = "2"|input_player1_joypad_index = "0"|' \${BOOT_ROOT}/${DISTRO_PATH}/storage/.config/retroarch/retroarch.cfg
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/nx-plat.dtimg \${BOOT_ROOT}/${DISTRO_PATH}/
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/README_CONFIG.txt \${BOOT_ROOT}/${DISTRO_PATH}/
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/boot.scr \${BOOT_ROOT}/${DISTRO_PATH}/boot/

View File

@ -0,0 +1,6 @@
alias hid:b0005g*v0000045Ep000002E0 hid_xpadneo
alias hid:b0005g*v0000045Ep000002FD hid_xpadneo
alias hid:b0005g*v0000045Ep00000B05 hid_xpadneo
alias hid:b0005g*v0000045Ep00000B13 hid_xpadneo
alias hid:b0005g*v0000045Ep00000B20 hid_xpadneo
alias hid:b0005g*v0000045Ep00000B22 hid_xpadneo

View File

@ -0,0 +1,26 @@
PKG_NAME="switch-bsp"
PKG_VERSION=1.0"
PKG_LICENSE="GPL"
PKG_DEPENDS_TARGET="joycond rewritefs xdotool alsa-lib alsa-ucm-conf usb-gadget-scripts"
PKG_SECTION="virtual"
PKG_LONGDESC="LibreELEC Nintendo Switch Board Support"
post_install() {
enable_service xorg-configure-switch.service
enable_service var-bluetoothconfig.mount
enable_service pair-joycon.service
enable_service fix-permissions.service
enable_service alsa-init.service
mkdir -p ${INSTALL}/usr/bin
cp -Pv ${PKG_DIR}/scripts/pair-joycon.sh ${INSTALL}/usr/bin
cp -Pv ${PKG_DIR}/scripts/dock-hotplug ${INSTALL}/usr/bin
cp -pv ${PKG_DIR}/scripts/fix-sysfs-permissions.sh ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/usr/share/alsa/ucm2
cp -Prv ${PKG_DIR}/ucm_data/* ${INSTALL}/usr/share/alsa/ucm2/
#Fix Script Permissions
chmod +x ${INSTALL}/usr/bin/pair-joycon.sh
chmod +x ${INSTALL}/usr/bin/dock-hotplug
chmod +x ${INSTALL}/usr/bin/fix-sysfs-permissions.sh
}

View File

@ -22,7 +22,7 @@ dock_hotplug_handle() {
do
if [ ! -e "$x" ]; then continue; fi
export DISPLAY=":${x#X}"
PULSE_SERVER="127.0.0.1"
export PULSE_SERVER="127.0.0.1"
if [[ "$1" -eq 1 ]]
then
@ -37,17 +37,6 @@ dock_hotplug_handle() {
# Reapply config to avoid X stubbornness.
sleep 0.2
xrandr --output DSI-0 --off --output DP-0 $DP_SETTINGS
#AutoSwitch CPU/GPU profiles
if [ ! "$(cat /proc/cmdline | grep dock_freq_switch_enabled=1)" = "" ]; then
if [ "$(cpu-profile get)" = "Stock Performance" ]; then
cpu-profile set "Maximum Performance"
fi
if [ "$(gpu-profile get)" = "Handheld Stock Mode" ]; then
gpu-profile set "Docked Stock Mode"
fi
fi
else
xrandr --output DSI-0 --primary --mode 720x1280 --rotate left --panning 1280x720+0+0 --pos 0x0 --dpi 237 --output DP-0 --off
pactl set-card-profile 1 HiFi
@ -59,17 +48,7 @@ dock_hotplug_handle() {
# Reapply config to avoid X stubbornness.
sleep 0.2
xrandr --output DP-0 --off --output DSI-0 --primary --mode 720x1280 --rotate left --panning 1280x720+0+0 --pos 0x0 --dpi 237
#AutoSwitch CPU/GPU profiles
if [ ! "$(cat /proc/cmdline | grep dock_freq_switch_enabled=1)" = "" ]; then
if [ "$(cpu-profile get)" = "Maximum Performance" ]; then
cpu-profile set "Stock Performance"
fi
if [ "$(gpu-profile get)" = "Docked Stock Mode" ]; then
gpu-profile set "Handheld Stock Mode"
fi
fi
fi
fi
done
# Wait for X to set current resolution.
@ -91,7 +70,7 @@ while [ "$i" -le "$LOOPS" ]; do
if grep -q 1 "/sys/class/switch/dp/state"; then DP_ENABLED=1; else DP_ENABLED=0; fi
# Prepare CEC info.
if [ ! "$(cat /proc/cmdline | grep cec_enabled=1)" = "" ]; then
if [ -f /tmp/.CEC ]; then
if [[ "$DP_ENABLED" -eq 0 ]]; then cec-ctl -C
else cec-ctl -s -o NintendoSwitch --playback --active-source phys-addr="$(cec-ctl | sed -n 's/.*Physical Address.*: //p')"; fi
fi

View File

@ -0,0 +1,27 @@
#!/bin/sh
#Allow all users to take advantage of changing Clock stuff, and setting R2P stuff.
#CPU
/usr/bin/busybox chmod 766 /sys/kernel/tegra_cpufreq/overclock
/usr/bin/busybox chmod 766 /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
/usr/bin/busybox chmod 766 /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
/usr/bin/busybox chmod 766 /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
#GPU
/usr/bin/busybox chmod 766 /sys/devices/57000000.gpu/devfreq/57000000.gpu/governor
/usr/bin/busybox chmod 766 /sys/devices/57000000.gpu/devfreq/57000000.gpu/max_freq
/usr/bin/busybox chmod 766 /sys/devices/57000000.gpu/devfreq/57000000.gpu/min_freq
#Bluetooth ERTM disable toggle
/usr/bin/busybox chmod 766 /sys/module/bluetooth/parameters/disable_ertm
#R2P
/usr/bin/busybox chmod 766 /sys/module/pmc_r2p/parameters/enabled
/usr/bin/busybox chmod 766 /sys/module/pmc_r2p/parameters/action
/usr/bin/busybox chmod 766 /sys/module/pmc_r2p/parameters/entry_id
/usr/bin/busybox chmod 766 /sys/module/pmc_r2p/parameters/param1
/usr/bin/busybox chmod 766 /sys/module/pmc_r2p/parameters/param2
#Brightness
/usr/bin/busybox chmod 766 /sys/class/backlight/backlight/brightness

View File

@ -0,0 +1,15 @@
[Unit]
Description=Fix permissions on sysfs nodes.
Before=graphical.target kodi.service retroarch.service
After=multi-user.target
After=xorg.service
[Service]
Environment=TERM=linux
Type=oneshot
ExecStart=/usr/bin/fix-sysfs-permissions.sh
StandardError=journal
RemainAfterExit=no
[Install]
WantedBy=graphical.target

View File

@ -7,7 +7,7 @@ Before=bluetooth.service
Environment=TERM=linux
Type=oneshot
ExecStart=/usr/bin/pair-joycon.sh
StandardError=syslog
StandardError=journal
RemainAfterExit=no
[Install]

View File

@ -0,0 +1,2 @@
#FIXME(issue-291) Work around Steamlink not properly detecting the mappings
ACTION=="add|change", DRIVERS=="xpadneo", SUBSYSTEM=="hidraw", MODE:="0000"

View File

@ -0,0 +1,2 @@
ACTION=="add", KERNEL=="0005:045E:02FD.*|0005:045E:02E0.*|0005:045E:0B05.*|0005:045E:0B13.*|0005:045E:0B20.*|0005:045E:0B22.*", SUBSYSTEM=="hid", DRIVER!="xpadneo", ATTR{driver/unbind}="%k", ATTR{[drivers/hid:xpadneo]bind}="%k"
ACTION=="add|change", DRIVERS=="xpadneo", SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="1", TAG+="uaccess", MODE="0664", ENV{LIBINPUT_IGNORE_DEVICE}="1"

View File

@ -1,15 +0,0 @@
PKG_NAME="switch-cpu-profile"
PKG_VERSION="1.1"
PKG_DEPENDS_TARGET="Python3"
PKG_TOOLCHAIN="manual"
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
#cp -v ${PKG_DIR}/scripts/cpu-profile ${INSTALL}/usr/bin
touch ${INSTALL}/usr/bin/cpu-profile
chmod +x ${INSTALL}/usr/bin/cpu-profile
}
post_install() {
enable_service switch-cpu-profile.service
}

View File

@ -1,135 +0,0 @@
#!/usr/bin/python
import sys
'''
This is a script to manage the Switch CPU clock profiles. When shutting down, the current profile is lost -
therefore, this script must be called at each reboot to restore the default profile.
Written by natinusala for Lakka. See print_usage() for usage.
For now the profile is not retained and is set to default speed when rebooting.
'''
# File corresponding to the current profile
PROFILE_FILE = "/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq"
OVERCLOCK_FILE = "/sys/kernel/tegra_cpufreq/overclock"
SAVED_PROFILE_FILE = "/storage/.config/.cpu_profile"
# Profiles list, in KHz - max 2091000
PROFILES = {
"Max Overdrive +3": "2091000",
"Max Overdrive +2": "1989000",
"Max Overdrive +1": "1887000",
"Maximum Performance": "1785000",
"High Performance": "1581000",
"Boost Performance": "1224000",
"Stock Performance": "1020000",
"Powersaving Mode 1": "918000",
"Powersaving Mode 2": "816000",
"Powersaving Mode 3": "714000",
}
# Default profile
DEFAULT_PROFILE = "Stock Performance"
def get_saved_profile():
try:
f=open(SAVED_PROFILE_FILE, "r")
except IOError:
return DEFAULT_PROFILE
NEW_DEFAULT_PROFILE = str(f.read().strip())
if NEW_DEFAULT_PROFILE == '':
return DEFAULT_PROFILE
else:
return NEW_DEFAULT_PROFILE
def save_profile(profile):
with open(SAVED_PROFILE_FILE, "w") as f:
f.write(profile)
f.flush()
def get_profile():
with open(PROFILE_FILE, "r") as f:
pstate = str(f.read().strip())
profile_code = pstate
for profile in PROFILES:
if profile_code == PROFILES[profile]:
return profile
raise Exception("Unknown profile code %s" % profile_code)
def apply_profile(profile):
if profile not in PROFILES:
raise Exception("Unknown profile %s" % profile)
with open(PROFILE_FILE, "w") as f:
f.write(PROFILES[profile])
f.flush()
print(("Applied profile %s" % profile))
def unlock_full_power():
with open(OVERCLOCK_FILE, "w") as f:
f.write("1")
f.flush()
print("Granted overclock access")
def print_usage():
print('''
Usage :
cpu-profile init
Sets the default profile - should be called on boot
cpu-profile list
Lists all the available profiles and their corresponding frequency
cpu-profile set <profile>
Sets the current profile to <profile>
cpu-profile get
Gets the current profile name
''')
def print_profiles():
print("Format : <name> - <freq in KHz> [* : enabled] [d : reboot default]")
max_profile_name_length = max([len(x) for x in list(PROFILES.keys())])
current_profile = get_profile()
for profile in reversed(list(PROFILES.keys())):
profile_name = profile
profile_freq = PROFILES[profile]
is_default = (profile_name == DEFAULT_PROFILE)
is_current = (current_profile == profile_name)
padding = " " * (max_profile_name_length - len(profile_name))
print("%s%s - %s %s %s" % (profile_name, padding, profile_freq, "*" if is_current else " ", "d" if is_default else ""))
# Main
if __name__ == "__main__":
argc = len(sys.argv)
if argc == 2:
if sys.argv[1] == "init":
apply_profile(get_saved_profile())
unlock_full_power()
elif sys.argv[1] == "get":
print(get_profile())
elif sys.argv[1] == "list":
print_profiles()
else:
print_usage()
elif argc == 3:
if sys.argv[1] == "set":
apply_profile(sys.argv[2])
save_profile(sys.argv[2])
else:
print_usage()
else:
print_usage()

View File

@ -1,15 +0,0 @@
[Unit]
Description=Switch CPU Profile
ConditionKernelCommandLine=!installer
Requires=xorg.service
After=xorg.service
[Service]
Environment=TERM=linux
Type=oneshot
ExecStart=/usr/bin/cpu-profile init
StandardError=syslog
RemainAfterExit=no
[Install]
WantedBy=graphical.target

View File

@ -1,16 +0,0 @@
PKG_NAME="switch-gpu-profile"
PKG_VERSION="1.1"
PKG_DEPENDS_TARGET="Python3"
PKG_TOOLCHAIN="manual"
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
#cp -v ${PKG_DIR}/scripts/gpu-profile ${INSTALL}/usr/bin
touch ${INSTALL}/usr/bin/cpu-profile
chmod +x ${INSTALL}/usr/bin/cpu-profile
}
post_install() {
enable_service switch-gpu-profile.service
}

View File

@ -1,126 +0,0 @@
#!/usr/bin/python
import sys
'''
This is a script to manage the Switch GPU clock profiles. When shutting down, the current profile is lost -
therefore, this script must be called at each reboot to restore the default profile.
Written by natinusala for Lakka. See print_usage() for usage.
For now the profile is not retained and is set to default non-docked speed when rebooting.
L4T variant.
'''
# File corresponding to the current profile
PROFILE_FILE_MAX = "/sys/devices/57000000.gpu/devfreq/57000000.gpu/max_freq"
PROFILE_FILE_MIN = "/sys/devices/57000000.gpu/devfreq/57000000.gpu/min_freq"
SAVED_PROFILE_FILE = "/storage/.config/.gpu_profile"
# Profiles list
PROFILES = {
"Docked Stock +2": "921600000", # 921 Mhz
"Docked Stock +1": "844800000", # 844 Mhz
"Docked Stock Mode": "768000000", # 768 Mhz
"Handheld Boost +3": "691200000", # 691 Mhz
"Handheld Boost +2": "614400000", # 614 Mhz
"Handheld Boost +1": "537600000", # 537 Mhz
"Handheld Boost Mode": "460800000", # 460 Mhz
"Handheld Stock +1": "384000000", # 384 Mhz
"Handheld Stock Mode": "307200000", # 307 Mhz
"Powersaving +2": "230400000", # 230 Mhz
"Powersaving +1": "153600000", # 153 Mhz
"Powersaving Mode": "76800000", # 76 Mhz
}
# Default profile
DEFAULT_PROFILE = "Handheld Stock Mode"
def get_saved_profile():
try:
f=open(SAVED_PROFILE_FILE, "r")
except IOError:
return DEFAULT_PROFILE
NEW_DEFAULT_PROFILE = str(f.read().strip())
if NEW_DEFAULT_PROFILE == '':
return DEFAULT_PROFILE
else:
return NEW_DEFAULT_PROFILE
def save_profile(profile):
with open(SAVED_PROFILE_FILE, "w") as f:
f.write(profile)
f.flush()
def get_profile():
with open(PROFILE_FILE_MAX, "r") as f:
pstate = str(f.read().strip())
for profile in PROFILES:
if pstate == PROFILES[profile]:
return profile
raise Exception("Unknown profile %s" % pstate)
def apply_profile(profile):
if profile not in PROFILES:
raise Exception("Unknown profile %s" % profile)
files = []
cur_profile = int(PROFILES[get_profile()])
new_profile = int(PROFILES[profile])
if new_profile < cur_profile:
files = [
PROFILE_FILE_MIN,
PROFILE_FILE_MAX
]
else:
files = [
PROFILE_FILE_MAX,
PROFILE_FILE_MIN
]
for pfile in files:
with open(pfile, "w") as f:
f.write(PROFILES[profile])
f.flush()
print(("Applied profile %s" % profile))
def print_usage():
print('''
Usage :
gpu-profile init
Sets the default profile - should be called on boot
gpu-profile set <profile>
Sets the current profile to <profile>
gpu-profile get
Gets the current profile name
''')
# Main
if __name__ == "__main__":
argc = len(sys.argv)
if argc == 2:
if sys.argv[1] == "init":
apply_profile(get_saved_profile())
elif sys.argv[1] == "get":
print(get_profile())
else:
print_usage()
elif argc == 3:
if sys.argv[1] == "set":
apply_profile(sys.argv[2])
save_profile(sys.argv[2])
else:
print_usage()
else:
print_usage()

View File

@ -1,15 +0,0 @@
[Unit]
Description=Switch GPU Profile
ConditionKernelCommandLine=!installer
Requires=xorg.service
After=xorg.service
[Service]
Environment=TERM=linux
Type=oneshot
ExecStart=/usr/bin/gpu-profile init
StandardError=syslog
RemainAfterExit=no
[Install]
WantedBy=graphical.target

View File

@ -1,18 +0,0 @@
PKG_NAME="switch-joycon-bluetooth-dock-configs"
PKG_LICENSE="GPL"
PKG_DEPENDS_TARGET="joycond rewritefs xdotool"
PKG_SECTION="virtual"
PKG_LONGDESC="Scripts for docking, and pairing joycons. Bluez config mount"
post_install() {
enable_service xorg-configure-switch.service
enable_service var-bluetoothconfig.mount
enable_service pair-joycon.service
mkdir -p ${INSTALL}/usr/bin
cp -Pv ${PKG_DIR}/scripts/pair-joycon.sh ${INSTALL}/usr/bin
cp -Pv ${PKG_DIR}/scripts/dock-hotplug ${INSTALL}/usr/bin
chmod +x ${INSTALL}/usr/bin/pair-joycon.sh
chmod +x ${INSTALL}/usr/bin/dock-hotplug
}

View File

@ -1,5 +1,5 @@
PKG_NAME="switch-u-boot"
PKG_VERSION="f6ee487cdf2a2efaf0cac8d1b3b003ea90fb1ef3"
PKG_VERSION="dd5432fa2ad727b3af159a704367a6e1fd6f246d"
PKG_GIT_CLONE_BRANCH="linux-hekatf"
PKG_DEPENDS_HOST="toolchain Python3:host gcc:host swig:host"
PKG_DEPENDS_TARGET="toolchain Python3 gcc:target swig:host"

View File

@ -1,4 +1,5 @@
PKG_NAME="usb-gadget-scripts"
PKG_VERSION="2.0"
PKG_DEPENDS_TARGET="umtp-responder"
PKG_SHORTDESC="Nintendo Switch USB Gadget scripts, and configs"
PKG_TOOLCHAIN="manual"

View File

@ -1,62 +0,0 @@
From ae51813c1048c789057660b96dfbb1943432d663 Mon Sep 17 00:00:00 2001
From: Ronald Brown <rbrown4014@yahoo.com>
Date: Mon, 12 Apr 2021 19:18:55 +0000
Subject: [PATCH] Revert "arm64: Add 32-bit sigcontext definition to uapi
signcontext.h"
This reverts commit a868475f632336bd368ca40e3edafa70b5138181.
---
arch/arm64/include/uapi/asm/sigcontext.h | 32 ------------------------
1 file changed, 32 deletions(-)
diff --git a/arch/arm64/include/uapi/asm/sigcontext.h b/arch/arm64/include/uapi/asm/sigcontext.h
index c731ca011ca3..ee469be1ae1d 100644
--- a/arch/arm64/include/uapi/asm/sigcontext.h
+++ b/arch/arm64/include/uapi/asm/sigcontext.h
@@ -16,7 +16,6 @@
#ifndef _UAPI__ASM_SIGCONTEXT_H
#define _UAPI__ASM_SIGCONTEXT_H
-#ifdef CONFIG_64BIT
#include <linux/types.h>
/*
@@ -62,35 +61,4 @@ struct esr_context {
__u64 esr;
};
-#else /* CONFIG_64BIT */
-
-/*
- * Signal context structure - contains all info to do with the state
- * before the signal handler was invoked. Note: only add new entries
- * to the end of the structure.
- */
-struct sigcontext {
- unsigned long trap_no;
- unsigned long error_code;
- unsigned long oldmask;
- unsigned long arm_r0;
- unsigned long arm_r1;
- unsigned long arm_r2;
- unsigned long arm_r3;
- unsigned long arm_r4;
- unsigned long arm_r5;
- unsigned long arm_r6;
- unsigned long arm_r7;
- unsigned long arm_r8;
- unsigned long arm_r9;
- unsigned long arm_r10;
- unsigned long arm_fp;
- unsigned long arm_ip;
- unsigned long arm_sp;
- unsigned long arm_lr;
- unsigned long arm_pc;
- unsigned long arm_cpsr;
- unsigned long fault_address;
-};
-#endif /* CONFIG_64BIT */
#endif /* _UAPI__ASM_SIGCONTEXT_H */
--
GitLab

View File

@ -1,22 +1,13 @@
From ec7fa0e304bcd9be9e3b6e40f7bfa8e1a0042989 Mon Sep 17 00:00:00 2001
From: Ronald Brown <rbrown4014@yahoo.com>
Date: Wed, 14 Apr 2021 08:02:49 -0700
Subject: [PATCH] Change dts to fix volume mappings in lakka.
---
.../nx/kernel-dts/nx-platforms/tegra210-nx-keys.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nvidia/platform/t210/nx/kernel-dts/nx-platforms/tegra210-nx-keys.dtsi b/nvidia/platform/t210/nx/kernel-dts/nx-platforms/tegra210-nx-keys.dtsi
index 8c508ec9d413..b80774f5980c 100644
--- a/nvidia/platform/t210/nx/kernel-dts/nx-platforms/tegra210-nx-keys.dtsi
+++ b/nvidia/platform/t210/nx/kernel-dts/nx-platforms/tegra210-nx-keys.dtsi
@@ -23,13 +23,13 @@
diff -Naur linux-Switch-5.1.0/nvidia/platform/t210/nx/kernel-dts/nx-platforms/tegra210-nx-keys.dtsi linux-Switch-5.1.0-2/nvidia/platform/t210/nx/kernel-dts/nx-platforms/tegra210-nx-keys.dtsi
--- linux-Switch-5.1.0/nvidia/platform/t210/nx/kernel-dts/nx-platforms/tegra210-nx-keys.dtsi 2023-04-12 07:00:12.773160197 +0200
+++ linux-Switch-5.1.0-2/nvidia/platform/t210/nx/kernel-dts/nx-platforms/tegra210-nx-keys.dtsi 2023-04-12 07:02:08.027831616 +0200
@@ -37,14 +37,14 @@
volume_down {
label = "Volume Down";
gpios = <&gpio TEGRA_GPIO(X, 7) GPIO_ACTIVE_LOW>;
- linux,code = <KEY_VOLUMEDOWN>;
+ linux,code = <KEY_KPMINUS>;
debounce-interval = <16>;
};
volume_up {
@ -24,9 +15,6 @@ index 8c508ec9d413..b80774f5980c 100644
gpios = <&gpio TEGRA_GPIO(X, 6) GPIO_ACTIVE_LOW>;
- linux,code = <KEY_VOLUMEUP>;
+ linux,code = <KEY_KPPLUS>;
debounce-interval = <16>;
};
};
};
--
GitLab

View File

@ -1,139 +0,0 @@
From 17e1b086f229d01ac5a0bedb83d4fa949e604b5a Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 8 Dec 2020 18:29:12 +0100
Subject: [PATCH] Bluetooth: L2CAP: Try harder to accept device not knowing
options The current implementation of L2CAP options negotiation will continue
the negotiation when a device responds with L2CAP_CONF_UNACCEPT ("unaccepted
options"), but not when the device replies with L2CAP_CONF_UNKNOWN ("unknown
options").
Trying to continue the negotiation without ERTM support will allow
Bluetooth-capable XBox One controllers (notably models 1708 and 1797)
to connect.
btmon before patch:
> ACL Data RX: Handle 256 flags 0x02 dlen 16 #64 [hci0] 59.182702
L2CAP: Connection Response (0x03) ident 2 len 8
Destination CID: 64
Source CID: 64
Result: Connection successful (0x0000)
Status: No further information available (0x0000)
< ACL Data TX: Handle 256 flags 0x00 dlen 23 #65 [hci0] 59.182744
L2CAP: Configure Request (0x04) ident 3 len 15
Destination CID: 64
Flags: 0x0000
Option: Retransmission and Flow Control (0x04) [mandatory]
Mode: Basic (0x00)
TX window size: 0
Max transmit: 0
Retransmission timeout: 0
Monitor timeout: 0
Maximum PDU size: 0
> ACL Data RX: Handle 256 flags 0x02 dlen 16 #66 [hci0] 59.183948
L2CAP: Configure Request (0x04) ident 1 len 8
Destination CID: 64
Flags: 0x0000
Option: Maximum Transmission Unit (0x01) [mandatory]
MTU: 1480
< ACL Data TX: Handle 256 flags 0x00 dlen 18 #67 [hci0] 59.183994
L2CAP: Configure Response (0x05) ident 1 len 10
Source CID: 64
Flags: 0x0000
Result: Success (0x0000)
Option: Maximum Transmission Unit (0x01) [mandatory]
MTU: 1480
> ACL Data RX: Handle 256 flags 0x02 dlen 15 #69 [hci0] 59.187676
L2CAP: Configure Response (0x05) ident 3 len 7
Source CID: 64
Flags: 0x0000
Result: Failure - unknown options (0x0003)
04 .
< ACL Data TX: Handle 256 flags 0x00 dlen 12 #70 [hci0] 59.187722
L2CAP: Disconnection Request (0x06) ident 4 len 4
Destination CID: 64
Source CID: 64
> ACL Data RX: Handle 256 flags 0x02 dlen 12 #73 [hci0] 59.192714
L2CAP: Disconnection Response (0x07) ident 4 len 4
Destination CID: 64
Source CID: 64
btmon after patch:
> ACL Data RX: Handle 256 flags 0x02 dlen 16 #248 [hci0] 103.502970
L2CAP: Connection Response (0x03) ident 5 len 8
Destination CID: 65
Source CID: 65
Result: Connection pending (0x0001)
Status: No further information available (0x0000)
> ACL Data RX: Handle 256 flags 0x02 dlen 16 #249 [hci0] 103.504184
L2CAP: Connection Response (0x03) ident 5 len 8
Destination CID: 65
Source CID: 65
Result: Connection successful (0x0000)
Status: No further information available (0x0000)
< ACL Data TX: Handle 256 flags 0x00 dlen 23 #250 [hci0] 103.504398
L2CAP: Configure Request (0x04) ident 6 len 15
Destination CID: 65
Flags: 0x0000
Option: Retransmission and Flow Control (0x04) [mandatory]
Mode: Basic (0x00)
TX window size: 0
Max transmit: 0
Retransmission timeout: 0
Monitor timeout: 0
Maximum PDU size: 0
> ACL Data RX: Handle 256 flags 0x02 dlen 16 #251 [hci0] 103.505472
L2CAP: Configure Request (0x04) ident 3 len 8
Destination CID: 65
Flags: 0x0000
Option: Maximum Transmission Unit (0x01) [mandatory]
MTU: 1480
< ACL Data TX: Handle 256 flags 0x00 dlen 18 #252 [hci0] 103.505689
L2CAP: Configure Response (0x05) ident 3 len 10
Source CID: 65
Flags: 0x0000
Result: Success (0x0000)
Option: Maximum Transmission Unit (0x01) [mandatory]
MTU: 1480
> ACL Data RX: Handle 256 flags 0x02 dlen 15 #254 [hci0] 103.509165
L2CAP: Configure Response (0x05) ident 6 len 7
Source CID: 65
Flags: 0x0000
Result: Failure - unknown options (0x0003)
04 .
< ACL Data TX: Handle 256 flags 0x00 dlen 12 #255 [hci0] 103.509426
L2CAP: Configure Request (0x04) ident 7 len 4
Destination CID: 65
Flags: 0x0000
< ACL Data TX: Handle 256 flags 0x00 dlen 12 #257 [hci0] 103.511870
L2CAP: Connection Request (0x02) ident 8 len 4
PSM: 1 (0x0001)
Source CID: 66
> ACL Data RX: Handle 256 flags 0x02 dlen 14 #259 [hci0] 103.514121
L2CAP: Configure Response (0x05) ident 7 len 6
Source CID: 65
Flags: 0x0000
Result: Success (0x0000)
Signed-off-by: Florian Dollinger <dollinger.florian@gmx.de>
Co-developed-by: Florian Dollinger <dollinger.florian@gmx.de>
Reviewed-by: Luiz Augusto Von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
net/bluetooth/l2cap_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 1fc23cb4a3e0..076b3567b670 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4200,6 +4200,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn,
}
goto done;
+ case L2CAP_CONF_UNKNOWN:
case L2CAP_CONF_UNACCEPT:
if (chan->num_conf_rsp <= L2CAP_CONF_MAX_CONF_RSP) {
char req[64];
--
GitLab

View File

@ -1,119 +0,0 @@
From aeca165be222b3486fbe7df7a04e6370c4558a7f Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Thu, 6 Aug 2020 11:17:11 -0700
Subject: [PATCH] Bluetooth: A2MP: Fix not initializing all members
This fixes various places where a stack variable is used uninitialized.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
net/bluetooth/a2mp.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index 5f123c3320a7..8f918155685d 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -233,6 +233,9 @@ static int a2mp_discover_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
struct a2mp_info_req req;
found = true;
+
+ memset(&req, 0, sizeof(req));
+
req.id = cl->id;
a2mp_send(mgr, A2MP_GETINFO_REQ, __next_ident(mgr),
sizeof(req), &req);
@@ -312,6 +315,8 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb,
if (!hdev || hdev->dev_type != HCI_AMP) {
struct a2mp_info_rsp rsp;
+ memset(&rsp, 0, sizeof(rsp));
+
rsp.id = req->id;
rsp.status = A2MP_STATUS_INVALID_CTRL_ID;
@@ -355,6 +360,8 @@ static int a2mp_getinfo_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
if (!ctrl)
return -ENOMEM;
+ memset(&req, 0, sizeof(req));
+
req.id = rsp->id;
a2mp_send(mgr, A2MP_GETAMPASSOC_REQ, __next_ident(mgr), sizeof(req),
&req);
@@ -383,6 +390,8 @@ static int a2mp_getampassoc_req(struct amp_mgr *mgr, struct sk_buff *skb,
struct a2mp_amp_assoc_rsp rsp;
rsp.id = req->id;
+ memset(&rsp, 0, sizeof(rsp));
+
if (tmp) {
rsp.status = A2MP_STATUS_COLLISION_OCCURED;
amp_mgr_put(tmp);
@@ -471,7 +480,6 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
struct a2mp_cmd *hdr)
{
struct a2mp_physlink_req *req = (void *) skb->data;
-
struct a2mp_physlink_rsp rsp;
struct hci_dev *hdev;
struct hci_conn *hcon;
@@ -482,6 +490,8 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
BT_DBG("local_id %d, remote_id %d", req->local_id, req->remote_id);
+ memset(&rsp, 0, sizeof(rsp));
+
rsp.local_id = req->remote_id;
rsp.remote_id = req->local_id;
@@ -560,6 +570,8 @@ static int a2mp_discphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
BT_DBG("local_id %d remote_id %d", req->local_id, req->remote_id);
+ memset(&rsp, 0, sizeof(rsp));
+
rsp.local_id = req->remote_id;
rsp.remote_id = req->local_id;
rsp.status = A2MP_STATUS_SUCCESS;
@@ -682,6 +694,8 @@ static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
if (err) {
struct a2mp_cmd_rej rej;
+ memset(&rej, 0, sizeof(rej));
+
rej.reason = cpu_to_le16(0);
hdr = (void *) skb->data;
@@ -905,6 +919,8 @@ void a2mp_send_getinfo_rsp(struct hci_dev *hdev)
BT_DBG("%s mgr %p", hdev->name, mgr);
+ memset(&rsp, 0, sizeof(rsp));
+
rsp.id = hdev->id;
rsp.status = A2MP_STATUS_INVALID_CTRL_ID;
@@ -1002,6 +1018,8 @@ void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status)
if (!mgr)
return;
+ memset(&rsp, 0, sizeof(rsp));
+
hs_hcon = hci_conn_hash_lookup_state(hdev, AMP_LINK, BT_CONNECT);
if (!hs_hcon) {
rsp.status = A2MP_STATUS_UNABLE_START_LINK_CREATION;
@@ -1034,6 +1052,8 @@ void a2mp_discover_amp(struct l2cap_chan *chan)
mgr->bredr_chan = chan;
+ memset(&req, 0, sizeof(req));
+
req.mtu = cpu_to_le16(L2CAP_A2MP_DEFAULT_MTU);
req.ext_feat = 0;
a2mp_send(mgr, A2MP_DISCOVER_REQ, 1, sizeof(req), &req);
--
GitLab

View File

@ -1,85 +0,0 @@
From b59d638b29f0812e583b377d2c8c138b22015fdb Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Thu, 6 Aug 2020 11:17:12 -0700
Subject: [PATCH] Bluetooth: L2CAP: Fix calling sk_filter on non-socket based
channel
Only sockets will have the chan->data set to an actual sk, channels
like A2MP would have its own data which would likely cause a crash when
calling sk_filter, in order to fix this a new callback has been
introduced so channels can implement their own filtering if necessary.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
include/net/bluetooth/l2cap.h | 2 ++
net/bluetooth/l2cap_core.c | 7 ++++---
net/bluetooth/l2cap_sock.c | 14 ++++++++++++++
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 5ee3c689c863..9c50d458ee83 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -619,6 +619,8 @@ struct l2cap_ops {
struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
unsigned long hdr_len,
unsigned long len, int nb);
+ int (*filter) (struct l2cap_chan * chan,
+ struct sk_buff *skb);
};
struct l2cap_conn {
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 076b3567b670..edd0e11bf7d5 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -6623,9 +6623,10 @@ static int l2cap_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb)
goto drop;
}
- if ((chan->mode == L2CAP_MODE_ERTM ||
- chan->mode == L2CAP_MODE_STREAMING) && sk_filter(chan->data, skb))
- goto drop;
+ if (chan->ops->filter) {
+ if (chan->ops->filter(chan, skb))
+ goto drop;
+ }
if (!control->sframe) {
int err;
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index a8ba752732c9..e22e22e52120 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1463,6 +1463,19 @@ static void l2cap_sock_suspend_cb(struct l2cap_chan *chan)
sk->sk_state_change(sk);
}
+static int l2cap_sock_filter(struct l2cap_chan *chan, struct sk_buff *skb)
+{
+ struct sock *sk = chan->data;
+
+ switch (chan->mode) {
+ case L2CAP_MODE_ERTM:
+ case L2CAP_MODE_STREAMING:
+ return sk_filter(sk, skb);
+ }
+
+ return 0;
+}
+
static const struct l2cap_ops l2cap_chan_ops = {
.name = "L2CAP Socket Interface",
.new_connection = l2cap_sock_new_connection_cb,
@@ -1477,6 +1490,7 @@ static const struct l2cap_ops l2cap_chan_ops = {
.set_shutdown = l2cap_sock_set_shutdown_cb,
.get_sndtimeo = l2cap_sock_get_sndtimeo_cb,
.alloc_skb = l2cap_sock_alloc_skb_cb,
+ .filter = l2cap_sock_filter,
};
static void l2cap_sock_destruct(struct sock *sk)
--
GitLab

View File

@ -1,42 +0,0 @@
From 292adf93d3a8a5827997b7685a713fd5d7d0eefa Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Thu, 6 Aug 2020 11:17:14 -0700
Subject: [PATCH] Bluetooth: MGMT: Fix not checking if BT_HS is enabled
This checks if BT_HS is enabled relecting it on MGMT_SETTING_HS instead
of always reporting it as supported.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
net/bluetooth/mgmt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index ba24f613c0fc..bca1408f815f 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -635,7 +635,8 @@ static u32 get_supported_settings(struct hci_dev *hdev)
if (lmp_ssp_capable(hdev)) {
settings |= MGMT_SETTING_SSP;
- settings |= MGMT_SETTING_HS;
+ if (IS_ENABLED(CONFIG_BT_HS))
+ settings |= MGMT_SETTING_HS;
}
if (lmp_sc_capable(hdev))
@@ -1645,6 +1646,10 @@ static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
BT_DBG("request for %s", hdev->name);
+ if (!IS_ENABLED(CONFIG_BT_HS))
+ return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS,
+ MGMT_STATUS_NOT_SUPPORTED);
+
status = mgmt_bredr_support(hdev);
if (status)
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status);
--
GitLab

View File

@ -1,104 +0,0 @@
From 6373e372ccde29f0657d6a8b10ea58ac092ce89e Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Tue, 19 May 2020 13:25:19 -0700
Subject: [PATCH] Bluetooth: Consolidate encryption handling in hci_encrypt_cfm
This makes hci_encrypt_cfm calls hci_connect_cfm in case the connection
state is BT_CONFIG so callers don't have to check the state.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
include/net/bluetooth/hci_core.h | 20 ++++++++++++++++++--
net/bluetooth/hci_event.c | 28 +++-------------------------
2 files changed, 21 insertions(+), 27 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 4931787193c3..24bb6f447afc 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1247,10 +1247,26 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
conn->security_cfm_cb(conn, status);
}
-static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
- __u8 encrypt)
+static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status)
{
struct hci_cb *cb;
+ __u8 encrypt;
+
+ if (conn->state == BT_CONFIG) {
+ if (status)
+ conn->state = BT_CONNECTED;
+
+ hci_connect_cfm(conn, status);
+ hci_conn_drop(conn);
+ return;
+ }
+
+ if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+ encrypt = 0x00;
+ else if (test_bit(HCI_CONN_AES_CCM, &conn->flags))
+ encrypt = 0x02;
+ else
+ encrypt = 0x01;
if (conn->sec_level == BT_SECURITY_SDP)
conn->sec_level = BT_SECURITY_LOW;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index d2f9eb169ba8..057dee1d4bd3 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2475,7 +2475,7 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
&cp);
} else {
clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
- hci_encrypt_cfm(conn, ev->status, 0x00);
+ hci_encrypt_cfm(conn, ev->status);
}
}
@@ -2561,22 +2561,7 @@ static void read_enc_key_size_complete(struct hci_dev *hdev, u8 status,
conn->enc_key_size = rp->key_size;
}
- if (conn->state == BT_CONFIG) {
- conn->state = BT_CONNECTED;
- hci_connect_cfm(conn, 0);
- hci_conn_drop(conn);
- } else {
- u8 encrypt;
-
- if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
- encrypt = 0x00;
- else if (test_bit(HCI_CONN_AES_CCM, &conn->flags))
- encrypt = 0x02;
- else
- encrypt = 0x01;
-
- hci_encrypt_cfm(conn, 0, encrypt);
- }
+ hci_encrypt_cfm(conn, 0);
unlock:
hci_dev_unlock(hdev);
@@ -2673,14 +2658,7 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
}
notify:
- if (conn->state == BT_CONFIG) {
- if (!ev->status)
- conn->state = BT_CONNECTED;
-
- hci_connect_cfm(conn, ev->status);
- hci_conn_drop(conn);
- } else
- hci_encrypt_cfm(conn, ev->status, ev->encrypt);
+ hci_encrypt_cfm(conn, ev->status);
unlock:
hci_dev_unlock(hdev);
--
GitLab

View File

@ -1,148 +0,0 @@
From 3fb09d7986208e59fb881fcc353c629843f081a0 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Wed, 20 May 2020 14:20:14 -0700
Subject: [PATCH] Bluetooth: Disconnect if E0 is used for Level 4
E0 is not allowed with Level 4:
BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C page 1319:
'128-bit equivalent strength for link and encryption keys
required using FIPS approved algorithms (E0 not allowed,
SAFER+ not allowed, and P-192 not allowed; encryption key
not shortened'
SC enabled:
> HCI Event: Read Remote Extended Features (0x23) plen 13
Status: Success (0x00)
Handle: 256
Page: 1/2
Features: 0x0b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Secure Simple Pairing (Host Support)
LE Supported (Host)
Secure Connections (Host Support)
> HCI Event: Encryption Change (0x08) plen 4
Status: Success (0x00)
Handle: 256
Encryption: Enabled with AES-CCM (0x02)
SC disabled:
> HCI Event: Read Remote Extended Features (0x23) plen 13
Status: Success (0x00)
Handle: 256
Page: 1/2
Features: 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Secure Simple Pairing (Host Support)
LE Supported (Host)
> HCI Event: Encryption Change (0x08) plen 4
Status: Success (0x00)
Handle: 256
Encryption: Enabled with E0 (0x01)
[May 8 20:23] Bluetooth: hci0: Invalid security: expect AES but E0 was used
< HCI Command: Disconnect (0x01|0x0006) plen 3
Handle: 256
Reason: Authentication Failure (0x05)
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
include/net/bluetooth/hci_core.h | 10 ++++++----
net/bluetooth/hci_conn.c | 17 +++++++++++++++++
net/bluetooth/hci_event.c | 20 ++++++++------------
3 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 24bb6f447afc..da8e3e1acd85 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1268,11 +1268,13 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status)
else
encrypt = 0x01;
- if (conn->sec_level == BT_SECURITY_SDP)
- conn->sec_level = BT_SECURITY_LOW;
+ if (!status) {
+ if (conn->sec_level == BT_SECURITY_SDP)
+ conn->sec_level = BT_SECURITY_LOW;
- if (conn->pending_sec_level > conn->sec_level)
- conn->sec_level = conn->pending_sec_level;
+ if (conn->pending_sec_level > conn->sec_level)
+ conn->sec_level = conn->pending_sec_level;
+ }
mutex_lock(&hci_cb_list_lock);
list_for_each_entry(cb, &hci_cb_list, list) {
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index cc061495f653..2e6f8f0b29a7 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1161,6 +1161,23 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
return 0;
}
+ /* AES encryption is required for Level 4:
+ *
+ * BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C
+ * page 1319:
+ *
+ * 128-bit equivalent strength for link and encryption keys
+ * required using FIPS approved algorithms (E0 not allowed,
+ * SAFER+ not allowed, and P-192 not allowed; encryption key
+ * not shortened)
+ */
+ if (conn->sec_level == BT_SECURITY_FIPS &&
+ !test_bit(HCI_CONN_AES_CCM, &conn->flags)) {
+ bt_dev_err(conn->hdev,
+ "Invalid security: Missing AES-CCM usage");
+ return 0;
+ }
+
if (hci_conn_ssp_enabled(conn) &&
!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
return 0;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 057dee1d4bd3..59a76f705554 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2608,27 +2608,23 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
+ /* Check link security requirements are met */
+ if (!hci_conn_check_link_mode(conn))
+ ev->status = HCI_ERROR_AUTH_FAILURE;
+
if (ev->status && conn->state == BT_CONNECTED) {
if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING)
set_bit(HCI_CONN_AUTH_FAILURE, &conn->flags);
+ /* Notify upper layers so they can cleanup before
+ * disconnecting.
+ */
+ hci_encrypt_cfm(conn, ev->status);
hci_disconnect(conn, HCI_ERROR_AUTH_FAILURE);
hci_conn_drop(conn);
goto unlock;
}
- /* In Secure Connections Only mode, do not allow any connections
- * that are not encrypted with AES-CCM using a P-256 authenticated
- * combination key.
- */
- if (hci_dev_test_flag(hdev, HCI_SC_ONLY) &&
- (!test_bit(HCI_CONN_AES_CCM, &conn->flags) ||
- conn->key_type != HCI_LK_AUTH_COMBINATION_P256)) {
- hci_connect_cfm(conn, HCI_ERROR_AUTH_FAILURE);
- hci_conn_drop(conn);
- goto unlock;
- }
-
/* Try reading the encryption key size for encrypted ACL links */
if (!ev->status && ev->encrypt && conn->type == ACL_LINK) {
struct hci_cp_read_enc_key_size cp;
--
GitLab

View File

@ -1,22 +0,0 @@
diff -Naur linux-Switch/drivers/hid/hid-core.c linux-Switch-2/drivers/hid/hid-core.c
--- linux-Switch/drivers/hid/hid-core.c 2022-04-26 20:52:22.256557940 +0200
+++ linux-Switch-2/drivers/hid/hid-core.c 2022-04-26 20:57:55.842182237 +0200
@@ -1993,6 +1993,10 @@
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_600) },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1) },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER) },
+#if IS_ENABLED(CONFIG_HID_XPADNEO)
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x02FD) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x02E0) },
+#endif
{ HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) },
{ HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) },
{ HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) },
@@ -2128,7 +2132,6 @@
{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ZYDACRON, USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL) },
-
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) },

View File

@ -0,0 +1,107 @@
From b96c973964f84a1815633be3c7bd6b3320748b2f Mon Sep 17 00:00:00 2001
From: Ronald Brown <rbrown4014@yahoo.com>
Date: Mon, 30 Jan 2023 08:09:53 -0800
Subject: [PATCH 2/7] Retroarch: Lakka: Remove Gamemode from Lakka Builds
---
menu/cbs/menu_cbs_sublabel.c | 4 ++++
menu/menu_displaylist.c | 4 ++++
menu/menu_setting.c | 5 ++++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c
index c13741c31c..3344b0a4da 100644
--- a/menu/cbs/menu_cbs_sublabel.c
+++ b/menu/cbs/menu_cbs_sublabel.c
@@ -1160,11 +1160,13 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_discord_allow,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_cpu_profile, MENU_ENUM_SUBLABEL_SWITCH_CPU_PROFILE)
#endif
+#ifndef HAVE_LAKKA
#ifdef __linux__
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_gamemode_enable, MENU_ENUM_SUBLABEL_GAMEMODE_ENABLE_LINUX)
#else
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_gamemode_enable, MENU_ENUM_SUBLABEL_GAMEMODE_ENABLE)
#endif
+#endif /*HAVE_LAKKA*/
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_brightness_control, MENU_ENUM_SUBLABEL_BRIGHTNESS_CONTROL)
@@ -4948,9 +4950,11 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_switch_cpu_profile);
break;
#endif
+#ifndef HAVE_LAKKA
case MENU_ENUM_LABEL_GAMEMODE_ENABLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_gamemode_enable);
break;
+#endif /*HAVE_LAKKA*/
case MENU_ENUM_LABEL_BRIGHTNESS_CONTROL:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_brightness_control);
break;
diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c
index a21c200af5..f6af4a9148 100644
--- a/menu/menu_displaylist.c
+++ b/menu/menu_displaylist.c
@@ -9482,9 +9482,11 @@ unsigned menu_displaylist_build_list(
count++;
}
#endif
+#ifndef HAVE_LAKKA
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_GAMEMODE_ENABLE, PARSE_ONLY_BOOL, false) == 0)
count++;
+#endif /*HAVE_LAKKA?*/
}
break;
case DISPLAYLIST_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST:
@@ -9966,7 +9968,9 @@ unsigned menu_displaylist_build_list(
menu_displaylist_build_info_t build_list[] = {
{MENU_ENUM_LABEL_SUSTAINED_PERFORMANCE_MODE, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_CPU_PERFPOWER, PARSE_ACTION},
+#ifdef HAVE_LAKKA
{MENU_ENUM_LABEL_GAMEMODE_ENABLE, PARSE_ONLY_BOOL},
+#endif /*HAVE_LAKKA*/
};
for (i = 0; i < ARRAY_SIZE(build_list); i++)
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
index 1f024440f5..5e8e514331 100644
--- a/menu/menu_setting.c
+++ b/menu/menu_setting.c
@@ -8050,6 +8050,7 @@ static void general_write_handler(rarch_setting_t *setting)
task_queue_unset_threaded();
}
break;
+#ifndef HAVE_LAKKA
case MENU_ENUM_LABEL_GAMEMODE_ENABLE:
if (frontend_driver_has_gamemode())
{
@@ -8074,7 +8075,7 @@ static void general_write_handler(rarch_setting_t *setting)
}
}
break;
-
+#endif /*HAVE_LAKKA*/
case MENU_ENUM_LABEL_INPUT_POLL_TYPE_BEHAVIOR:
core_set_poll_type(*setting->value.target.integer);
break;
@@ -18578,6 +18579,7 @@ static bool setting_append_list(
&subgroup_info,
parent_group);
#endif
+#ifndef HAVE_LAKKA
if (frontend_driver_has_gamemode())
CONFIG_BOOL(
list, list_info,
@@ -18597,6 +18599,7 @@ static bool setting_append_list(
END_SUB_GROUP(list, list_info, parent_group);
END_GROUP(list, list_info, parent_group);
break;
+#endif /*HAVE_LAKKA*/
case SETTINGS_LIST_WIFI_MANAGEMENT:
START_GROUP(list, list_info, &group_info,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS),
--
2.25.1

View File

@ -0,0 +1,24 @@
From 901f0feb8b6b97b445b0623cd5d105544911f060 Mon Sep 17 00:00:00 2001
From: Ronald Brown <rbrown4014@yahoo.com>
Date: Mon, 30 Jan 2023 08:46:42 -0800
Subject: [PATCH 3/7] Lakka: Always show Power Management Settings menu
---
menu/menu_setting.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
index 5e8e514331..89fdda3fe9 100644
--- a/menu/menu_setting.c
+++ b/menu/menu_setting.c
@@ -10315,7 +10315,6 @@ static bool setting_append_list(
&group_info,
&subgroup_info,
parent_group);
- SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED);
CONFIG_ACTION(
list, list_info,
--
2.25.1

View File

@ -0,0 +1,479 @@
From f1898216c4aaf2a6f508ff04e88503137b627248 Mon Sep 17 00:00:00 2001
From: Ronald Brown <rbrown4014@yahoo.com>
Date: Mon, 30 Jan 2023 08:47:30 -0800
Subject: [PATCH 4/7] Lakka: Switch: Add Nintendo Switch Options List, with
first option to enable overclocking.
---
configuration.h | 3 ++
intl/msg_hash_lbl.h | 15 +++++++
intl/msg_hash_us.h | 18 ++++++++
lakka-switch.h | 21 ++++++++++
menu/cbs/menu_cbs_deferred_push.c | 6 +++
menu/cbs/menu_cbs_ok.c | 13 ++++++
menu/cbs/menu_cbs_sublabel.c | 12 ++++++
menu/cbs/menu_cbs_title.c | 6 +++
menu/menu_cbs.h | 1 +
menu/menu_displaylist.c | 23 +++++++++++
menu/menu_displaylist.h | 3 ++
menu/menu_setting.c | 68 +++++++++++++++++++++++++++++--
msg_hash.h | 7 ++++
13 files changed, 193 insertions(+), 3 deletions(-)
create mode 100644 lakka-switch.h
diff --git a/configuration.h b/configuration.h
index 3619ca7f0a..69984fed87 100644
--- a/configuration.h
+++ b/configuration.h
@@ -931,6 +931,9 @@ typedef struct settings
bool screenshots_in_content_dir;
bool systemfiles_in_content_dir;
bool ssh_enable;
+#ifdef HAVE_LAKKA_SWITCH
+ bool switch_oc;
+#endif
bool samba_enable;
bool bluetooth_enable;
bool localap_enable;
diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h
index fbc3326315..fbe296a792 100644
--- a/intl/msg_hash_lbl.h
+++ b/intl/msg_hash_lbl.h
@@ -3481,6 +3481,21 @@ MSG_HASH(
"ssh_enable"
)
#endif
+
+#ifdef HAVE_LAKKA_SWITCH
+MSG_HASH(
+ MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST,
+ "deferred_lakka_switch_options_list"
+ )
+MSG_HASH(
+ MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS,
+ "Switch_Options"
+ )
+MSG_HASH(
+ MENU_ENUM_LABEL_SWITCH_OC_ENABLE,
+ "Switch_OC_enable"
+ )
+#endif
MSG_HASH(
MENU_ENUM_LABEL_START_CORE,
"start_core"
diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h
index 85db8480fd..062b454d0a 100644
--- a/intl/msg_hash_us.h
+++ b/intl/msg_hash_us.h
@@ -14971,6 +14971,24 @@ MSG_HASH(
MENU_ENUM_LABEL_HELP_TIMEZONE,
"Displays a list of available timezones. After selecting a time zone, time and date is adjusted to the selected time zone. It assumes, that system/hardware clock is set to UTC."
)
+#ifdef HAVE_LAKKA_SWITCH
+MSG_HASH(
+ MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS,
+ "Nintendo Switch Options"
+ )
+MSG_HASH(
+ MENU_ENUM_SUBLABEL_LAKKA_SWITCH_OPTIONS,
+ "Manage Nintendo Switch Specific Options."
+ )
+MSG_HASH(
+ MENU_ENUM_LABEL_VALUE_SWITCH_OC_ENABLE,
+ "CPU Overclock"
+ )
+MSG_HASH(
+ MENU_ENUM_SUBLABEL_SWITCH_OC_ENABLE,
+ "Enable CPU Overclock frequencies"
+ )
+#endif
MSG_HASH(
MSG_LOCALAP_SWITCHING_OFF,
"Switching off Wi-Fi Access Point."
diff --git a/lakka-switch.h b/lakka-switch.h
new file mode 100644
index 0000000000..7525b22286
--- /dev/null
+++ b/lakka-switch.h
@@ -0,0 +1,21 @@
+/* RetroArch - A frontend for libretro.
+ * Copyright (C) 2023 - Gavin_Darkglider
+ *
+ * RetroArch is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Found-
+ * ation, either version 3 of the License, or (at your option) any later version.
+ *
+ * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with RetroArch.
+ * If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __RARCH_LAKKA_SWITCH_H
+#define __RARCH_LAKKA_SWITCH_H
+
+#define SWITCH_OC_TOGGLE_PATH "/sys/kernel/tegra_cpufreq/overclock"
+
+#endif
diff --git a/menu/cbs/menu_cbs_deferred_push.c b/menu/cbs/menu_cbs_deferred_push.c
index 17c53d8758..ae9fca0fd7 100644
--- a/menu/cbs/menu_cbs_deferred_push.c
+++ b/menu/cbs/menu_cbs_deferred_push.c
@@ -218,6 +218,9 @@ GENERIC_DEFERRED_PUSH(deferred_push_netplay_kick_list, DISPLAYLIST_
GENERIC_DEFERRED_PUSH(deferred_push_netplay_ban_list, DISPLAYLIST_NETPLAY_BAN_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_netplay_lobby_filters_list, DISPLAYLIST_NETPLAY_LOBBY_FILTERS_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_lakka_services_list, DISPLAYLIST_LAKKA_SERVICES_LIST)
+#ifdef HAVE_LAKKA_SWITCH
+GENERIC_DEFERRED_PUSH(deferred_push_lakka_switch_options_list, DISPLAYLIST_LAKKA_SWITCH_OPTIONS_LIST)
+#endif
GENERIC_DEFERRED_PUSH(deferred_push_user_settings_list, DISPLAYLIST_USER_SETTINGS_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_directory_settings_list, DISPLAYLIST_DIRECTORY_SETTINGS_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_privacy_settings_list, DISPLAYLIST_PRIVACY_SETTINGS_LIST)
@@ -737,6 +740,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST, deferred_push_wifi_settings_list},
{MENU_ENUM_LABEL_DEFERRED_WIFI_NETWORKS_LIST, deferred_push_wifi_networks_list},
{MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST, deferred_push_lakka_services_list},
+#ifdef HAVE_LAKKA_SWITCH
+ {MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST, deferred_push_lakka_switch_options_list},
+#endif
{MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST, deferred_push_user_settings_list},
{MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST, deferred_push_directory_settings_list},
{MENU_ENUM_LABEL_DEFERRED_PRIVACY_SETTINGS_LIST, deferred_push_privacy_settings_list},
diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c
index 6104dc6e37..668d49b8ff 100644
--- a/menu/cbs/menu_cbs_ok.c
+++ b/menu/cbs/menu_cbs_ok.c
@@ -447,6 +447,10 @@ static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl)
return MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST;
case ACTION_OK_DL_LAKKA_SERVICES_LIST:
return MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST;
+#ifdef HAVE_LAKKA_SWITCH
+ case ACTION_OK_DL_LAKKA_SWITCH_OPTIONS_LIST:
+ return MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST;
+#endif
case ACTION_OK_DL_USER_SETTINGS_LIST:
return MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST;
case ACTION_OK_DL_DIRECTORY_SETTINGS_LIST:
@@ -1662,6 +1666,9 @@ int generic_action_ok_displaylist_push(const char *path,
case ACTION_OK_DL_NETPLAY:
case ACTION_OK_DL_NETPLAY_LAN_SCAN_SETTINGS_LIST:
case ACTION_OK_DL_LAKKA_SERVICES_LIST:
+#ifdef HAVE_LAKKA_SWITCH
+ case ACTION_OK_DL_LAKKA_SWITCH_OPTIONS_LIST:
+#endif
case ACTION_OK_DL_USER_SETTINGS_LIST:
case ACTION_OK_DL_DIRECTORY_SETTINGS_LIST:
case ACTION_OK_DL_PRIVACY_SETTINGS_LIST:
@@ -5888,6 +5895,9 @@ DEFAULT_ACTION_OK_FUNC(action_ok_cheevos_appearance_list, ACTION_OK_DL_CHEEVOS_A
DEFAULT_ACTION_OK_FUNC(action_ok_cheevos_visibility_list, ACTION_OK_DL_CHEEVOS_VISIBILITY_SETTINGS_LIST)
DEFAULT_ACTION_OK_FUNC(action_ok_updater_list, ACTION_OK_DL_UPDATER_SETTINGS_LIST)
DEFAULT_ACTION_OK_FUNC(action_ok_lakka_services, ACTION_OK_DL_LAKKA_SERVICES_LIST)
+#ifdef HAVE_LAKKA_SWITCH
+DEFAULT_ACTION_OK_FUNC(action_ok_lakka_switch_options, ACTION_OK_DL_LAKKA_SWITCH_OPTIONS_LIST)
+#endif
DEFAULT_ACTION_OK_FUNC(action_ok_user_list, ACTION_OK_DL_USER_SETTINGS_LIST)
DEFAULT_ACTION_OK_FUNC(action_ok_netplay_sublist, ACTION_OK_DL_NETPLAY)
DEFAULT_ACTION_OK_FUNC(action_ok_directory_list, ACTION_OK_DL_DIRECTORY_SETTINGS_LIST)
@@ -8485,6 +8495,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_SUBSYSTEM_SETTINGS, action_ok_subsystem_list},
{MENU_ENUM_LABEL_NETWORK_SETTINGS, action_ok_network_list},
{MENU_ENUM_LABEL_LAKKA_SERVICES, action_ok_lakka_services},
+#ifdef HAVE_LAKKA_SWITCH
+ {MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS, action_ok_lakka_switch_options},
+#endif
{MENU_ENUM_LABEL_NETPLAY_SETTINGS, action_ok_netplay_sublist},
{MENU_ENUM_LABEL_USER_SETTINGS, action_ok_user_list},
{MENU_ENUM_LABEL_DIRECTORY_SETTINGS, action_ok_directory_list},
diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c
index 3344b0a4da..d3e5a46d74 100644
--- a/menu/cbs/menu_cbs_sublabel.c
+++ b/menu/cbs/menu_cbs_sublabel.c
@@ -366,6 +366,10 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_bluetooth_enable, MENU_
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_localap_enable, MENU_ENUM_SUBLABEL_LOCALAP_ENABLE )
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_timezone, MENU_ENUM_SUBLABEL_TIMEZONE)
#endif
+#ifdef HAVE_LAKKA_SWITCH
+DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_options, MENU_ENUM_SUBLABEL_LAKKA_SWITCH_OPTIONS)
+DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_oc_enable, MENU_ENUM_SUBLABEL_SWITCH_OC_ENABLE)
+#endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_user_language, MENU_ENUM_SUBLABEL_USER_LANGUAGE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_max_swapchain_images, MENU_ENUM_SUBLABEL_VIDEO_MAX_SWAPCHAIN_IMAGES)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_waitable_swapchains, MENU_ENUM_SUBLABEL_VIDEO_WAITABLE_SWAPCHAINS)
@@ -4856,6 +4860,14 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CPU_PERF_MODE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cpu_perf_mode);
break;
+#endif
+#ifdef HAVE_LAKKA_SWITCH
+ case MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS:
+ BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_switch_options);
+ break;
+ case MENU_ENUM_LABEL_SWITCH_OC_ENABLE:
+ BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_switch_oc_enable);
+ break;
#endif
case MENU_ENUM_LABEL_USER_LANGUAGE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_user_language);
diff --git a/menu/cbs/menu_cbs_title.c b/menu/cbs/menu_cbs_title.c
index b24d740949..905722736c 100644
--- a/menu/cbs/menu_cbs_title.c
+++ b/menu/cbs/menu_cbs_title.c
@@ -672,6 +672,9 @@ DEFAULT_TITLE_MACRO(action_get_netplay_lan_scan_settings_list, MENU_ENUM_LABEL_
#ifdef HAVE_LAKKA
DEFAULT_TITLE_MACRO(action_get_lakka_services_list, MENU_ENUM_LABEL_VALUE_LAKKA_SERVICES)
#endif
+#ifdef HAVE_LAKKA_SWITCH
+DEFAULT_TITLE_MACRO(action_get_lakka_switch_options_list, MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS)
+#endif
DEFAULT_TITLE_MACRO(action_get_user_settings_list, MENU_ENUM_LABEL_VALUE_USER_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_directory_settings_list, MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_privacy_settings_list, MENU_ENUM_LABEL_VALUE_PRIVACY_SETTINGS)
@@ -1031,6 +1034,9 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST, action_get_netplay_lan_scan_settings_list},
#ifdef HAVE_LAKKA
{MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST, action_get_lakka_services_list},
+#endif
+#ifdef HAVE_LAKKA_SWITCH
+ {MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST, action_get_lakka_switch_options_list},
#endif
{MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST, action_get_user_settings_list},
{MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST, action_get_directory_settings_list},
diff --git a/menu/menu_cbs.h b/menu/menu_cbs.h
index 85a5e95561..57f11cf23b 100644
--- a/menu/menu_cbs.h
+++ b/menu/menu_cbs.h
@@ -217,6 +217,7 @@ enum
ACTION_OK_DL_NETPLAY_LOBBY_FILTERS_LIST,
ACTION_OK_DL_NETPLAY_LAN_SCAN_SETTINGS_LIST,
ACTION_OK_DL_LAKKA_SERVICES_LIST,
+ ACTION_OK_DL_LAKKA_SWITCH_OPTIONS_LIST,
ACTION_OK_DL_USER_SETTINGS_LIST,
ACTION_OK_DL_DIRECTORY_SETTINGS_LIST,
ACTION_OK_DL_PRIVACY_SETTINGS_LIST,
diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c
index f6af4a9148..8544609b38 100644
--- a/menu/menu_displaylist.c
+++ b/menu/menu_displaylist.c
@@ -9099,6 +9099,23 @@ unsigned menu_displaylist_build_list(
}
}
break;
+#endif
+#ifdef HAVE_LAKKA_SWITCH
+ case DISPLAYLIST_LAKKA_SWITCH_OPTIONS_LIST:
+ {
+ menu_displaylist_build_info_t build_list[] = {
+ {MENU_ENUM_LABEL_SWITCH_OC_ENABLE, PARSE_ONLY_BOOL},
+ };
+
+ for (i = 0; i < ARRAY_SIZE(build_list); i++)
+ {
+ if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
+ build_list[i].enum_idx, build_list[i].parse_type,
+ false) == 0)
+ count++;
+ }
+ }
+ break;
#endif
case DISPLAYLIST_MENU_VIEWS_SETTINGS_LIST:
{
@@ -9854,6 +9871,9 @@ unsigned menu_displaylist_build_list(
{MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS, PARSE_ACTION, true},
#endif
{MENU_ENUM_LABEL_LAKKA_SERVICES, PARSE_ACTION, true},
+#ifdef HAVE_LAKKA_SWITCH
+ {MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS, PARSE_ACTION, true},
+#endif
{MENU_ENUM_LABEL_PLAYLIST_SETTINGS, PARSE_ACTION, true},
{MENU_ENUM_LABEL_USER_SETTINGS, PARSE_ACTION, true},
{MENU_ENUM_LABEL_DIRECTORY_SETTINGS, PARSE_ACTION, true},
@@ -13258,6 +13278,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
case DISPLAYLIST_MENU_FILE_BROWSER_SETTINGS_LIST:
case DISPLAYLIST_MENU_VIEWS_SETTINGS_LIST:
case DISPLAYLIST_LAKKA_SERVICES_LIST:
+#ifdef HAVE_LAKKA_SWITCH
+ case DISPLAYLIST_LAKKA_SWITCH_OPTIONS_LIST:
+#endif
case DISPLAYLIST_MIDI_SETTINGS_LIST:
case DISPLAYLIST_CRT_SWITCHRES_SETTINGS_LIST:
case DISPLAYLIST_VIDEO_FULLSCREEN_MODE_SETTINGS_LIST:
diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h
index af54c0cb7b..44b2f068af 100644
--- a/menu/menu_displaylist.h
+++ b/menu/menu_displaylist.h
@@ -230,6 +230,9 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_NETPLAY_LOBBY_FILTERS_LIST,
DISPLAYLIST_NETPLAY_LAN_SCAN_SETTINGS_LIST,
DISPLAYLIST_LAKKA_SERVICES_LIST,
+#ifdef HAVE_LAKKA_SWITCH
+ DISPLAYLIST_LAKKA_SWITCH_OPTIONS_LIST,
+#endif
DISPLAYLIST_USER_SETTINGS_LIST,
DISPLAYLIST_DIRECTORY_SETTINGS_LIST,
DISPLAYLIST_PRIVACY_SETTINGS_LIST,
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
index 89fdda3fe9..09af706203 100644
--- a/menu/menu_setting.c
+++ b/menu/menu_setting.c
@@ -21,7 +21,6 @@
#else
#include <unistd.h>
#endif
-
#include <libretro.h>
#include <lists/file_list.h>
#include <file/file_path.h>
@@ -98,6 +97,9 @@
#include "../performance_counters.h"
#include "../setting_list.h"
#include "../lakka.h"
+#ifdef HAVE_LAKKA_SWITCH
+#include "../lakka-switch.h"
+#endif
#include "../retroarch.h"
#include "../gfx/video_display_server.h"
#ifdef HAVE_CHEATS
@@ -311,6 +313,9 @@ enum settings_list_type
SETTINGS_LIST_CORE_UPDATER,
SETTINGS_LIST_NETPLAY,
SETTINGS_LIST_LAKKA_SERVICES,
+#ifdef HAVE_LAKKA_SWITCH
+ SETTINGS_LIST_LAKKA_SWITCH_OPTIONS,
+#endif
SETTINGS_LIST_USER,
SETTINGS_LIST_USER_ACCOUNTS,
SETTINGS_LIST_USER_ACCOUNTS_CHEEVOS,
@@ -9067,6 +9072,19 @@ static void systemd_service_toggle(const char *path, char *unit, bool enable)
}
}
+#ifdef HAVE_LAKKA_SWITCH
+static void switch_oc_enable_toggle_change_handler(rarch_setting_t *setting)
+{
+ FILE* f = fopen(SWITCH_OC_TOGGLE_PATH, "w");
+ if (*setting->value.target.boolean == true) {
+ fprintf(f, "1\n");
+ } else {
+ fprintf(f, "0\n");
+ }
+ fclose(f);
+}
+#endif
+
static void ssh_enable_toggle_change_handler(rarch_setting_t *setting)
{
systemd_service_toggle(LAKKA_SSH_PATH, (char*)"sshd.service",
@@ -10407,7 +10425,15 @@ static bool setting_append_list(
&subgroup_info,
parent_group);
#endif
-
+#ifdef HAVE_LAKKA_SWITCH
+ CONFIG_ACTION(
+ list, list_info,
+ MENU_ENUM_LABEL_LAKKA_SWITCH_OPTIONS,
+ MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS,
+ &group_info,
+ &subgroup_info,
+ parent_group);
+#endif
CONFIG_ACTION(
list, list_info,
MENU_ENUM_LABEL_PLAYLIST_SETTINGS,
@@ -21277,7 +21303,6 @@ static bool setting_append_list(
START_SUB_GROUP(list, list_info,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LAKKA_SERVICES),
&group_info, &subgroup_info, parent_group);
-
CONFIG_BOOL(
list, list_info,
&settings->bools.ssh_enable,
@@ -21366,6 +21391,40 @@ static bool setting_append_list(
#endif
}
break;
+#ifdef HAVE_LAKKA_SWITCH
+ case SETTINGS_LIST_LAKKA_SWITCH_OPTIONS:
+ {
+ START_GROUP(list, list_info, &group_info,
+ msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS),
+ parent_group);
+
+ parent_group = msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS);
+
+ START_SUB_GROUP(list, list_info,
+ msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LAKKA_SWITCH_OPTIONS),
+ &group_info, &subgroup_info, parent_group);
+
+ CONFIG_BOOL(
+ list, list_info,
+ &settings->bools.switch_oc,
+ MENU_ENUM_LABEL_SWITCH_OC_ENABLE,
+ MENU_ENUM_LABEL_VALUE_SWITCH_OC_ENABLE,
+ true,
+ MENU_ENUM_LABEL_VALUE_OFF,
+ MENU_ENUM_LABEL_VALUE_ON,
+ &group_info,
+ &subgroup_info,
+ parent_group,
+ general_write_handler,
+ general_read_handler,
+ SD_FLAG_NONE);
+ (*list)[list_info->index - 1].change_handler = switch_oc_enable_toggle_change_handler;
+
+ END_SUB_GROUP(list, list_info, parent_group);
+ END_GROUP(list, list_info, parent_group);
+ }
+ break;
+#endif
case SETTINGS_LIST_USER:
START_GROUP(list, list_info, &group_info,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USER_SETTINGS),
@@ -22578,6 +22637,9 @@ static rarch_setting_t *menu_setting_new_internal(rarch_setting_info_t *list_inf
SETTINGS_LIST_CORE_UPDATER,
SETTINGS_LIST_NETPLAY,
SETTINGS_LIST_LAKKA_SERVICES,
+#ifdef HAVE_LAKKA_SWITCH
+ SETTINGS_LIST_LAKKA_SWITCH_OPTIONS,
+#endif
SETTINGS_LIST_USER,
SETTINGS_LIST_USER_ACCOUNTS,
SETTINGS_LIST_USER_ACCOUNTS_CHEEVOS,
diff --git a/msg_hash.h b/msg_hash.h
index 88f3c85d61..861881024b 100644
--- a/msg_hash.h
+++ b/msg_hash.h
@@ -1914,6 +1914,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_DEFERRED_NETPLAY_LOBBY_FILTERS_LIST,
MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST,
+ MENU_ENUM_LABEL_DEFERRED_LAKKA_SWITCH_OPTIONS_LIST,
MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_PRIVACY_SETTINGS_LIST,
@@ -2247,6 +2248,9 @@ enum msg_hash_enums
MENU_LABEL(BLUETOOTH_ENABLE),
MENU_LABEL(LOCALAP_ENABLE),
MENU_LBL_H(TIMEZONE),
+#endif
+#ifdef HAVE_LAKKA_SWITCH
+ MENU_LABEL(SWITCH_OC_ENABLE),
#endif
MENU_LABEL(NETPLAY_DELAY_FRAMES), /* deprecated */
MENU_LABEL(NETPLAY_PUBLIC_ANNOUNCE),
@@ -3048,6 +3052,9 @@ enum msg_hash_enums
MENU_LABEL(CORE_UPDATER_SETTINGS),
MENU_LABEL(LAKKA_SERVICES),
+#ifdef HAVE_LAKKA_SWITCH
+ MENU_LABEL(LAKKA_SWITCH_OPTIONS),
+#endif
MENU_LBL_H(SHADER_APPLY_CHANGES),
MENU_LBL_H(SHADER_WATCH_FOR_CHANGES),
MENU_LABEL(VIDEO_SHADER_REMEMBER_LAST_DIR),
--
2.25.1

View File

@ -0,0 +1,106 @@
From 2a89b3e4925358c926c5e0848e149e2aa9c4a923 Mon Sep 17 00:00:00 2001
From: Ronald Brown <rbrown4014@yahoo.com>
Date: Wed, 1 Feb 2023 18:52:43 -0800
Subject: [PATCH 5/7] Sort Me, working loading from config
---
config.def.h | 4 +++-
configuration.c | 24 +++++++++++++++++++-----
menu/menu_setting.c | 2 +-
3 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/config.def.h b/config.def.h
index fc9ff578ba..fcb16ef070 100644
--- a/config.def.h
+++ b/config.def.h
@@ -176,7 +176,9 @@
#define DEFAULT_USER_LANGUAGE 0
#define DEFAULT_GAMEMODE_ENABLE true
-
+#ifdef HAVE_LAKKA_SWITCH
+#define DEFAULT_SWITCH_OC false
+#endif
#if (defined(_WIN32) && !defined(_XBOX)) || (defined(__linux) && !defined(ANDROID) && !defined(HAVE_LAKKA)) || (defined(__MACH__) && !defined(IOS)) || defined(EMSCRIPTEN)
#define DEFAULT_MOUSE_ENABLE true
#else
diff --git a/configuration.c b/configuration.c
index 665e6d61d2..202de4ff24 100644
--- a/configuration.c
+++ b/configuration.c
@@ -61,7 +61,11 @@
#include "lakka.h"
-#if defined(HAVE_LAKKA) || defined(HAVE_LIBNX)
+#ifdef HAVE_LAKKA_SWITCH
+#include "lakka-switch.h"
+#endif
+
+#ifdef HAVE_LIBNX
#include "switch_performance_profiles.h"
#endif
@@ -2069,8 +2073,12 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("ai_service_enable", &settings->bools.ai_service_enable, true, DEFAULT_AI_SERVICE_ENABLE, false);
SETTING_BOOL("ai_service_pause", &settings->bools.ai_service_pause, true, DEFAULT_AI_SERVICE_PAUSE, false);
SETTING_BOOL("wifi_enabled", &settings->bools.wifi_enabled, true, DEFAULT_WIFI_ENABLE, false);
+#ifndef HAVE_LAKKA
SETTING_BOOL("gamemode_enable", &settings->bools.gamemode_enable, true, DEFAULT_GAMEMODE_ENABLE, false);
-
+#endif
+#ifdef HAVE_LAKKA_SWITCH
+ SETTING_BOOL("switch_oc", &settings->bools.switch_oc, true, DEFAULT_SWITCH_OC, false);
+#endif
#ifdef ANDROID
SETTING_BOOL("android_input_disconnect_workaround", &settings->bools.android_input_disconnect_workaround, true, false, false);
#endif
@@ -2703,7 +2711,6 @@ void config_set_defaults(void *data)
configuration_set_bool(settings, settings->bools.localap_enable, false);
load_timezone(settings->arrays.timezone);
#endif
-
#ifdef HAVE_MENU
if (first_initialized)
configuration_set_bool(settings,
@@ -3832,7 +3839,6 @@ static bool config_load_file(global_t *global,
configuration_set_bool(settings,
settings->bools.bluetooth_enable, filestream_exists(LAKKA_BLUETOOTH_PATH));
#endif
-
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL) &&
config_get_path(conf, "savefile_directory", tmp_str, sizeof(tmp_str)))
{
@@ -3887,7 +3893,15 @@ static bool config_load_file(global_t *global,
extern void libnx_apply_overclock();
libnx_apply_overclock();
#endif
-
+#ifdef HAVE_LAKKA_SWITCH
+ FILE* f = fopen(SWITCH_OC_TOGGLE_PATH, "w");
+ if (settings->bools.switch_oc == true) {
+ fprintf(f, "1\n");
+ } else {
+ fprintf(f, "0\n");
+ }
+ fclose(f);
+#endif
frontend_driver_set_sustained_performance_mode(settings->bools.sustained_performance_mode);
recording_driver_update_streaming_url();
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
index 09af706203..91bc6f70f3 100644
--- a/menu/menu_setting.c
+++ b/menu/menu_setting.c
@@ -21409,7 +21409,7 @@ static bool setting_append_list(
&settings->bools.switch_oc,
MENU_ENUM_LABEL_SWITCH_OC_ENABLE,
MENU_ENUM_LABEL_VALUE_SWITCH_OC_ENABLE,
- true,
+ DEFAULT_SWITCH_OC,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
--
2.25.1

View File

@ -0,0 +1,218 @@
From dda90500a8492dec866cb0a8a4f2b37aad3aa3fc Mon Sep 17 00:00:00 2001
From: Ronald Brown <rbrown4014@yahoo.com>
Date: Sat, 4 Feb 2023 22:36:45 -0800
Subject: [PATCH 6/7] Lakka-Switch: Add CEC Toggle
---
config.def.h | 1 +
configuration.c | 8 ++++++++
configuration.h | 1 +
intl/msg_hash_lbl.h | 4 ++++
intl/msg_hash_us.h | 8 ++++++++
lakka-switch.h | 11 +++++++++++
menu/cbs/menu_cbs_sublabel.c | 4 ++++
menu/menu_displaylist.c | 1 +
menu/menu_setting.c | 28 ++++++++++++++++++++++++++++
msg_hash.h | 1 +
10 files changed, 67 insertions(+)
diff --git a/config.def.h b/config.def.h
index fcb16ef070..24aacf2943 100644
--- a/config.def.h
+++ b/config.def.h
@@ -178,6 +178,7 @@
#define DEFAULT_GAMEMODE_ENABLE true
#ifdef HAVE_LAKKA_SWITCH
#define DEFAULT_SWITCH_OC false
+#define DEFAULT_SWITCH_CEC true
#endif
#if (defined(_WIN32) && !defined(_XBOX)) || (defined(__linux) && !defined(ANDROID) && !defined(HAVE_LAKKA)) || (defined(__MACH__) && !defined(IOS)) || defined(EMSCRIPTEN)
#define DEFAULT_MOUSE_ENABLE true
diff --git a/configuration.c b/configuration.c
index 202de4ff24..7130d0432d 100644
--- a/configuration.c
+++ b/configuration.c
@@ -2078,6 +2078,7 @@ static struct config_bool_setting *populate_settings_bool(
#endif
#ifdef HAVE_LAKKA_SWITCH
SETTING_BOOL("switch_oc", &settings->bools.switch_oc, true, DEFAULT_SWITCH_OC, false);
+ SETTING_BOOL("switch_cec", &settings->bools.switch_cec, true, DEFAULT_SWITCH_CEC, false);
#endif
#ifdef ANDROID
SETTING_BOOL("android_input_disconnect_workaround", &settings->bools.android_input_disconnect_workaround, true, false, false);
@@ -3901,6 +3902,13 @@ static bool config_load_file(global_t *global,
fprintf(f, "0\n");
}
fclose(f);
+ if (settings->bools.switch_cec == true) {
+ FILE* f = fopen(SWITCH_CEC_TOGGLE_PATH, "w");
+ fprintf(f, "\n");
+ fclose(f);
+ } else {
+ filestream_delete(SWITCH_CEC_TOGGLE_PATH);
+ }
#endif
frontend_driver_set_sustained_performance_mode(settings->bools.sustained_performance_mode);
recording_driver_update_streaming_url();
diff --git a/configuration.h b/configuration.h
index 69984fed87..882af40a04 100644
--- a/configuration.h
+++ b/configuration.h
@@ -933,6 +933,7 @@ typedef struct settings
bool ssh_enable;
#ifdef HAVE_LAKKA_SWITCH
bool switch_oc;
+ bool switch_cec;
#endif
bool samba_enable;
bool bluetooth_enable;
diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h
index fbe296a792..1a026f1d51 100644
--- a/intl/msg_hash_lbl.h
+++ b/intl/msg_hash_lbl.h
@@ -3495,6 +3495,10 @@ MSG_HASH(
MENU_ENUM_LABEL_SWITCH_OC_ENABLE,
"Switch_OC_enable"
)
+MSG_HASH(
+ MENU_ENUM_LABEL_SWITCH_CEC_ENABLE,
+ "Switch_CEC_enable"
+ )
#endif
MSG_HASH(
MENU_ENUM_LABEL_START_CORE,
diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h
index 062b454d0a..a655217a80 100644
--- a/intl/msg_hash_us.h
+++ b/intl/msg_hash_us.h
@@ -14988,6 +14988,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_SWITCH_OC_ENABLE,
"Enable CPU Overclock frequencies"
)
+MSG_HASH(
+ MENU_ENUM_LABEL_VALUE_SWITCH_CEC_ENABLE,
+ "CEC Support"
+ )
+MSG_HASH(
+ MENU_ENUM_SUBLABEL_SWITCH_CEC_ENABLE,
+ "Enable CEC Handshaking with TV when docking"
+ )
#endif
MSG_HASH(
MSG_LOCALAP_SWITCHING_OFF,
diff --git a/lakka-switch.h b/lakka-switch.h
index 7525b22286..fe037a0da1 100644
--- a/lakka-switch.h
+++ b/lakka-switch.h
@@ -17,5 +17,16 @@
#define __RARCH_LAKKA_SWITCH_H
#define SWITCH_OC_TOGGLE_PATH "/sys/kernel/tegra_cpufreq/overclock"
+#define SWITCH_CEC_TOGGLE_PATH "/tmp/.CEC"
+#define SWITCH_GPU_PROFILE_FILE_MAX_PATH "/sys/devices/57000000.gpu/devfreq/57000000.gpu/max_freq"
+#define SWITCH_GPU_PROFILE_FILE_MIN_PATH "/sys/devices/57000000.gpu/devfreq/57000000.gpu/min_freq"
+#define SWITCH_GPU_PROFILE_FILE_GOVERNOR_PATH "/sys/devices/57000000.gpu/devfreq/57000000.gpu/governor"
+#define SWITCH_GPU_PROFILE_FILE_AVAILABLE_GOVERNORS_PATH "/sys/devices/57000000.gpu/devfreq/57000000.gpu/available_governors"
+#define SWITCH_GPU_PROFILE_FILE_AVAILABLE_FREQ_PATH "/sys/devices/57000000.gpu/devfreq/57000000.gpu/available_governors"
+#define SWITCH_R2P_ENABLED_PATH "/sys/module/pmc_r2p/parameters/enabled"
+#define SWITCH_R2P_ACTION_PATH /sys/module/pmc_r2p/parameters/action
+#define SWITCH_R2P_ENTRY_ID_PATH /sys/module/pmc_r2p/parameters/entry_id
+#define SWITCH_R2P_PARAM1_PATH /sys/module/pmc_r2p/parameters/param1
+#define SWITCH_R2P_PARAM2_PATH /sys/module/pmc_r2p/parameters/param2
#endif
diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c
index d3e5a46d74..f3a39dd519 100644
--- a/menu/cbs/menu_cbs_sublabel.c
+++ b/menu/cbs/menu_cbs_sublabel.c
@@ -369,6 +369,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_timezone, MENU_
#ifdef HAVE_LAKKA_SWITCH
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_options, MENU_ENUM_SUBLABEL_LAKKA_SWITCH_OPTIONS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_oc_enable, MENU_ENUM_SUBLABEL_SWITCH_OC_ENABLE)
+DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_cec_enable, MENU_ENUM_SUBLABEL_SWITCH_CEC_ENABLE)
#endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_user_language, MENU_ENUM_SUBLABEL_USER_LANGUAGE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_max_swapchain_images, MENU_ENUM_SUBLABEL_VIDEO_MAX_SWAPCHAIN_IMAGES)
@@ -4868,6 +4869,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_SWITCH_OC_ENABLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_switch_oc_enable);
break;
+ case MENU_ENUM_LABEL_SWITCH_CEC_ENABLE:
+ BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_switch_cec_enable);
+ break;
#endif
case MENU_ENUM_LABEL_USER_LANGUAGE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_user_language);
diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c
index 8544609b38..c23808d904 100644
--- a/menu/menu_displaylist.c
+++ b/menu/menu_displaylist.c
@@ -9105,6 +9105,7 @@ unsigned menu_displaylist_build_list(
{
menu_displaylist_build_info_t build_list[] = {
{MENU_ENUM_LABEL_SWITCH_OC_ENABLE, PARSE_ONLY_BOOL},
+ {MENU_ENUM_LABEL_SWITCH_CEC_ENABLE, PARSE_ONLY_BOOL},
};
for (i = 0; i < ARRAY_SIZE(build_list); i++)
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
index 91bc6f70f3..5a444aef90 100644
--- a/menu/menu_setting.c
+++ b/menu/menu_setting.c
@@ -9083,6 +9083,18 @@ static void switch_oc_enable_toggle_change_handler(rarch_setting_t *setting)
}
fclose(f);
}
+
+static void switch_cec_enable_toggle_change_handler(rarch_setting_t *setting)
+{
+ if (*setting->value.target.boolean == true) {
+ FILE* f = fopen(SWITCH_CEC_TOGGLE_PATH, "w");
+ fprintf(f, "\n");
+ fclose(f);
+ } else {
+ filestream_delete(SWITCH_CEC_TOGGLE_PATH);
+ }
+
+}
#endif
static void ssh_enable_toggle_change_handler(rarch_setting_t *setting)
@@ -21419,6 +21431,22 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
(*list)[list_info->index - 1].change_handler = switch_oc_enable_toggle_change_handler;
+
+ CONFIG_BOOL(
+ list, list_info,
+ &settings->bools.switch_cec,
+ MENU_ENUM_LABEL_SWITCH_CEC_ENABLE,
+ MENU_ENUM_LABEL_VALUE_SWITCH_CEC_ENABLE,
+ DEFAULT_SWITCH_CEC,
+ MENU_ENUM_LABEL_VALUE_OFF,
+ MENU_ENUM_LABEL_VALUE_ON,
+ &group_info,
+ &subgroup_info,
+ parent_group,
+ general_write_handler,
+ general_read_handler,
+ SD_FLAG_NONE);
+ (*list)[list_info->index - 1].change_handler = switch_cec_enable_toggle_change_handler;
END_SUB_GROUP(list, list_info, parent_group);
END_GROUP(list, list_info, parent_group);
diff --git a/msg_hash.h b/msg_hash.h
index 861881024b..990a0564fa 100644
--- a/msg_hash.h
+++ b/msg_hash.h
@@ -2251,6 +2251,7 @@ enum msg_hash_enums
#endif
#ifdef HAVE_LAKKA_SWITCH
MENU_LABEL(SWITCH_OC_ENABLE),
+ MENU_LABEL(SWITCH_CEC_ENABLE),
#endif
MENU_LABEL(NETPLAY_DELAY_FRAMES), /* deprecated */
MENU_LABEL(NETPLAY_PUBLIC_ANNOUNCE),
--
2.25.1

View File

@ -0,0 +1,212 @@
From f9d9bca1b0ab9cd84f436d4b8951acfbae1b4ea3 Mon Sep 17 00:00:00 2001
From: Ronald Brown <rbrown4014@yahoo.com>
Date: Sat, 25 Mar 2023 11:00:41 -0700
Subject: [PATCH] Lakka-Switch: Add Bluetooth ERTM Disable
---
config.def.h | 1 +
configuration.c | 10 ++++++++++
configuration.h | 1 +
intl/msg_hash_lbl.h | 4 ++++
intl/msg_hash_us.h | 8 ++++++++
lakka-switch.h | 2 ++
menu/cbs/menu_cbs_sublabel.c | 4 ++++
menu/menu_displaylist.c | 1 +
menu/menu_setting.c | 31 ++++++++++++++++++++++++++++++-
msg_hash.h | 1 +
10 files changed, 62 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index 24aacf2943e..dc8ce046dd2 100644
--- a/config.def.h
+++ b/config.def.h
@@ -179,6 +179,7 @@
#ifdef HAVE_LAKKA_SWITCH
#define DEFAULT_SWITCH_OC false
#define DEFAULT_SWITCH_CEC true
+#define DEFAULT_BLUETOOTH_ERTM false
#endif
#if (defined(_WIN32) && !defined(_XBOX)) || (defined(__linux) && !defined(ANDROID) && !defined(HAVE_LAKKA)) || (defined(__MACH__) && !defined(IOS)) || defined(EMSCRIPTEN)
#define DEFAULT_MOUSE_ENABLE true
diff --git a/configuration.c b/configuration.c
index 7130d0432d1..8288c5a681f 100644
--- a/configuration.c
+++ b/configuration.c
@@ -2079,6 +2079,7 @@ static struct config_bool_setting *populate_settings_bool(
#ifdef HAVE_LAKKA_SWITCH
SETTING_BOOL("switch_oc", &settings->bools.switch_oc, true, DEFAULT_SWITCH_OC, false);
SETTING_BOOL("switch_cec", &settings->bools.switch_cec, true, DEFAULT_SWITCH_CEC, false);
+ SETTING_BOOL("bluetooth_ertm_disable", &settings->bools.bluetooth_ertm_disable, true, DEFAULT_BLUETOOTH_ERTM, false);
#endif
#ifdef ANDROID
SETTING_BOOL("android_input_disconnect_workaround", &settings->bools.android_input_disconnect_workaround, true, false, false);
@@ -3909,6 +3910,15 @@ static bool config_load_file(global_t *global,
} else {
filestream_delete(SWITCH_CEC_TOGGLE_PATH);
}
+ if (settings->bools.bluetooth_ertm_disable == true) {
+ FILE* f = fopen(BLUETOOTH_ERTM_TOGGLE_PATH, "w");
+ fprintf(f, "1\n");
+ fclose(f);
+ } else {
+ FILE* f = fopen(BLUETOOTH_ERTM_TOGGLE_PATH, "w");
+ fprintf(f, "0\n");
+ fclose(f);
+ }
#endif
frontend_driver_set_sustained_performance_mode(settings->bools.sustained_performance_mode);
recording_driver_update_streaming_url();
diff --git a/configuration.h b/configuration.h
index 882af40a041..1f843d1a6be 100644
--- a/configuration.h
+++ b/configuration.h
@@ -934,6 +934,7 @@ typedef struct settings
#ifdef HAVE_LAKKA_SWITCH
bool switch_oc;
bool switch_cec;
+ bool bluetooth_ertm_disable;
#endif
bool samba_enable;
bool bluetooth_enable;
diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h
index 1a026f1d515..a62c0abb25b 100644
--- a/intl/msg_hash_lbl.h
+++ b/intl/msg_hash_lbl.h
@@ -3499,6 +3499,10 @@ MSG_HASH(
MENU_ENUM_LABEL_SWITCH_CEC_ENABLE,
"Switch_CEC_enable"
)
+MSG_HASH(
+ MENU_ENUM_LABEL_BLUETOOTH_ERTM_DISABLE,
+ "Switch_ERTM_Disable"
+ )
#endif
MSG_HASH(
MENU_ENUM_LABEL_START_CORE,
diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h
index a655217a80e..8afe3ea10e3 100644
--- a/intl/msg_hash_us.h
+++ b/intl/msg_hash_us.h
@@ -14996,6 +14996,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_SWITCH_CEC_ENABLE,
"Enable CEC Handshaking with TV when docking"
)
+MSG_HASH(
+ MENU_ENUM_LABEL_VALUE_BLUETOOTH_ERTM_DISABLE,
+ "Bluetooth ERTM Disable"
+ )
+MSG_HASH(
+ MENU_ENUM_SUBLABEL_BLUETOOTH_ERTM_DISABLE,
+ "Disable Bluetooth ERTM to fix pairing of some devices"
+ )
#endif
MSG_HASH(
MSG_LOCALAP_SWITCHING_OFF,
diff --git a/lakka-switch.h b/lakka-switch.h
index fe037a0da13..2100199a8cc 100644
--- a/lakka-switch.h
+++ b/lakka-switch.h
@@ -24,6 +24,8 @@
#define SWITCH_GPU_PROFILE_FILE_AVAILABLE_GOVERNORS_PATH "/sys/devices/57000000.gpu/devfreq/57000000.gpu/available_governors"
#define SWITCH_GPU_PROFILE_FILE_AVAILABLE_FREQ_PATH "/sys/devices/57000000.gpu/devfreq/57000000.gpu/available_governors"
+#define BLUETOOTH_ERTM_TOGGLE_PATH "/sys/module/bluetooth/parameters/disable_ertm"
+
#define SWITCH_R2P_ENABLED_PATH "/sys/module/pmc_r2p/parameters/enabled"
#define SWITCH_R2P_ACTION_PATH /sys/module/pmc_r2p/parameters/action
#define SWITCH_R2P_ENTRY_ID_PATH /sys/module/pmc_r2p/parameters/entry_id
diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c
index f3a39dd5193..27dc46ce387 100644
--- a/menu/cbs/menu_cbs_sublabel.c
+++ b/menu/cbs/menu_cbs_sublabel.c
@@ -370,6 +370,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_timezone, MENU_
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_options, MENU_ENUM_SUBLABEL_LAKKA_SWITCH_OPTIONS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_oc_enable, MENU_ENUM_SUBLABEL_SWITCH_OC_ENABLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_switch_cec_enable, MENU_ENUM_SUBLABEL_SWITCH_CEC_ENABLE)
+DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_bluetooth_ertm_disable, MENU_ENUM_SUBLABEL_BLUETOOTH_ERTM_DISABLE)
#endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_user_language, MENU_ENUM_SUBLABEL_USER_LANGUAGE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_max_swapchain_images, MENU_ENUM_SUBLABEL_VIDEO_MAX_SWAPCHAIN_IMAGES)
@@ -4872,6 +4873,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_SWITCH_CEC_ENABLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_switch_cec_enable);
break;
+ case MENU_ENUM_LABEL_BLUETOOTH_ERTM_DISABLE:
+ BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_bluetooth_ertm_disable);
+ break;
#endif
case MENU_ENUM_LABEL_USER_LANGUAGE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_user_language);
diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c
index c23808d9042..7f93b121028 100644
--- a/menu/menu_displaylist.c
+++ b/menu/menu_displaylist.c
@@ -9106,6 +9106,7 @@ unsigned menu_displaylist_build_list(
menu_displaylist_build_info_t build_list[] = {
{MENU_ENUM_LABEL_SWITCH_OC_ENABLE, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_SWITCH_CEC_ENABLE, PARSE_ONLY_BOOL},
+ {MENU_ENUM_LABEL_BLUETOOTH_ERTM_DISABLE, PARSE_ONLY_BOOL},
};
for (i = 0; i < ARRAY_SIZE(build_list); i++)
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
index 5a444aef90c..b6d2cef29c9 100644
--- a/menu/menu_setting.c
+++ b/menu/menu_setting.c
@@ -9094,6 +9094,20 @@ static void switch_cec_enable_toggle_change_handler(rarch_setting_t *setting)
filestream_delete(SWITCH_CEC_TOGGLE_PATH);
}
+}
+
+static void bluetooth_ertm_disable_toggle_change_handler(rarch_setting_t *setting)
+{
+ if (*setting->value.target.boolean == true) {
+ FILE* f = fopen(BLUETOOTH_ERTM_TOGGLE_PATH, "w");
+ fprintf(f, "1\n");
+ fclose(f);
+ } else {
+ FILE* f = fopen(BLUETOOTH_ERTM_TOGGLE_PATH, "w");
+ fprintf(f, "0\n");
+ fclose(f);
+ }
+
}
#endif
@@ -21447,7 +21461,22 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
(*list)[list_info->index - 1].change_handler = switch_cec_enable_toggle_change_handler;
-
+
+ CONFIG_BOOL(
+ list, list_info,
+ &settings->bools.bluetooth_ertm_disable,
+ MENU_ENUM_LABEL_BLUETOOTH_ERTM_DISABLE,
+ MENU_ENUM_LABEL_VALUE_BLUETOOTH_ERTM_DISABLE,
+ DEFAULT_BLUETOOTH_ERTM,
+ MENU_ENUM_LABEL_VALUE_OFF,
+ MENU_ENUM_LABEL_VALUE_ON,
+ &group_info,
+ &subgroup_info,
+ parent_group,
+ general_write_handler,
+ general_read_handler,
+ SD_FLAG_NONE);
+ (*list)[list_info->index - 1].change_handler = bluetooth_ertm_disable_toggle_change_handler;
END_SUB_GROUP(list, list_info, parent_group);
END_GROUP(list, list_info, parent_group);
}
diff --git a/msg_hash.h b/msg_hash.h
index 990a0564fa9..f5039e14ad0 100644
--- a/msg_hash.h
+++ b/msg_hash.h
@@ -2252,6 +2252,7 @@ enum msg_hash_enums
#ifdef HAVE_LAKKA_SWITCH
MENU_LABEL(SWITCH_OC_ENABLE),
MENU_LABEL(SWITCH_CEC_ENABLE),
+ MENU_LABEL(BLUETOOTH_ERTM_DISABLE),
#endif
MENU_LABEL(NETPLAY_DELAY_FRAMES), /* deprecated */
MENU_LABEL(NETPLAY_PUBLIC_ANNOUNCE),

View File

@ -106,7 +106,7 @@
LINUX="L4T"
# CEC Support
CEC_FRAMEWORK_SUPPORT="no"
CEC_FRAMEWORK_SUPPORT="yes"
# Set Distro Specific options

View File

@ -1,63 +0,0 @@
PKG_NAME="flycast"
PKG_VERSION="886188804de48a4bd9324046598e8dedfd0d2099"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/libretro/flycast"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="toolchain"
PKG_LONGDESC="Flycast is a multiplatform Sega Dreamcast emulator"
PKG_TOOLCHAIN="make"
PKG_MAKE_OPTS_TARGET="HAVE_OPENMP=0 LDFLAGS=-lrt"
if [ "${OPENGL_SUPPORT}" = "yes" ]; then
PKG_DEPENDS_TARGET+=" ${OPENGL}"
PKG_MAKE_OPTS_TARGET+=" HAVE_OIT=1"
fi
if [ "${OPENGLES_SUPPORT}" = "yes" ]; then
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
PKG_MAKE_OPTS_TARGET+=" FORCE_GLES=1"
fi
if [ "${VULKAN_SUPPORT}" = "yes" ]; then
PKG_DEPENDS_TARGET+=" ${VULKAN}"
PKG_MAKE_OPTS_TARGET+=" HAVE_VULKAN=1"
fi
case ${DEVICE:-${PROJECT}} in
RPi2)
PKG_MAKE_OPTS_TARGET+=" platform=rpi2"
;;
RPi3)
PKG_MAKE_OPTS_TARGET+=" platform=rpi3_64"
;;
RPi4*)
PKG_MAKE_OPTS_TARGET+=" platform=rpi4_64"
;;
RK3288)
PKG_MAKE_OPTS_TARGET+=" platform=RK3288"
;;
Switch)
PKG_MAKE_OPTS_TARGET+=" platform=jetson-nano"
;;
*)
if [ "${ARCH}" = "aarch64" ]; then
PKG_MAKE_OPTS_TARGET+=" platform=arm64"
elif [ "${ARCH}" = "arm" ]; then
PKG_MAKE_OPTS_TARGET+=" platform=armv-gles-neon"
fi
;;
esac
pre_make_target() {
if [ "${ARCH}" = "arm" -o "${ARCH}" = "aarch64" ]; then
PKG_MAKE_OPTS_TARGET+=" AS=${AS} CC_AS=${CC}"
else
PKG_MAKE_OPTS_TARGET+=" AS=${AS} CC_AS=${AS}"
fi
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/lib/libretro
cp -v flycast_libretro.so ${INSTALL}/usr/lib/libretro/
}

View File

@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="libcec"
PKG_VERSION="4.0.3"
PKG_SHA256="ef90d6e4cf9d5847c14d3ff21b71579e5110643f31e8574766d3fa6c89c6239c"
PKG_LICENSE="GPL"
PKG_SITE="http://libcec.pulse-eight.com/"
PKG_URL="https://github.com/Pulse-Eight/libcec/archive/libcec-${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain systemd p8-platform swig:host"
PKG_LONGDESC="libCEC is an open-source dual licensed library designed for communicating with the Pulse-Eight USB - CEC Adaptor."
PKG_CMAKE_OPTS_TARGET="-DBUILD_SHARED_LIBS=1 \
-DCMAKE_INSTALL_LIBDIR:STRING=lib \
-DCMAKE_INSTALL_LIBDIR_NOARCH:STRING=lib \
-DSKIP_PYTHON_WRAPPER=1 \
-DHAVE_IMX_API=0 \
-DHAVE_AOCEC_API=0 -DHAVE_AMLOGIC_API=0 \
-DHAVE_GIT_BIN=0 \
-DHAVE_RPI_LIB=0"
# libX11 and xrandr to read the sink's EDID, used to determine the PC's HDMI physical address
if [ "${DISPLAYSERVER}" = "x11" ]; then
PKG_DEPENDS_TARGET+=" libX11 libXrandr"
fi
if [ "${CEC_FRAMEWORK_SUPPORT}" = "yes" ]; then
PKG_CMAKE_OPTS_TARGET+=" -DHAVE_LINUX_API=1"
else
PKG_CMAKE_OPTS_TARGET+=" -DHAVE_LINUX_API=0"
fi
if [ ${PROJECT} = "L4T" ]; then
PKG_PATCH_DIRS="${PROJECT}"
fi
post_makeinstall_target() {
# Remove the Python3 demo - useless for us
rm -f ${INSTALL}/usr/bin/pyCecClient
PYTHON_DIR=${INSTALL}/usr/lib/${PKG_PYTHON_VERSION}
if [ -d ${PYTHON_DIR}/dist-packages ]; then
mv ${PYTHON_DIR}/dist-packages ${PYTHON_DIR}/site-packages
fi
}

View File

@ -934,9 +934,6 @@ download_sources_and_combine() {
patch -p1 < $PATCH_PATH/02-nvidia_drivers_actmon_add__init_annotation_to_tegra_actmon_register.patch
patch -p1 < $PATCH_PATH/03_irq_gic_drop__init_annotation_from_gic_init_fiq.patch
#Apply patch to fix glibc cross compiling.
patch -p1 < $PATCH_PATH/04-Revert-arm64-32bit-sigcontext-definition-to-uapi-signcontext.h.patch
#Create .REPO_SHA256 file
_repo_sha256 1

View File

@ -246,7 +246,7 @@ if [ "${BOOTLOADER}" = "switch-bootloader" -o "${BOOTLOADER}" = "odin-bootloader
"${INSTALL}"/usr/share/bootloader/boot/tegra210-odin.dtb --id=0x4F44494E \
"${INSTALL}"/usr/share/bootloader/boot/tegra210b01-odin.dtb --id=0x4F44494E --rev=0x00000b01 \
"${INSTALL}"/usr/share/bootloader/boot/tegra210b01-vali.dtb --id=0x56414C49 \
"${INSTALL}"/usr/share/bootloader/boot/tegra210b01-frig.dtb --id=0x46524947
"${INSTALL}"/usr/share/bootloader/boot/tegra210b01-fric.dtb --id=0x46524947
rm "${INSTALL}"/usr/share/bootloader/boot/*.dtb
echo Done!
fi
@ -268,7 +268,7 @@ cp -PR $(get_install_dir linux)/.image/${KERNEL_TARGET} ${TARGET_IMG}/${IMAGE_NA
if [ "${BOOTLOADER}" = "switch-bootloader" ]; then
echo Compress Kernel and create uimage....
gzip ${TARGET_IMG}/${IMAGE_NAME}.kernel
${TOOLCHAIN}/bin/mkimage -A arm64 -O linux -T kernel -C gzip -a 0x80200000 -e 0x80200000 -n CTCKRN-5.0.0 -d ${TARGET_IMG}/${IMAGE_NAME}.kernel.gz \
${TOOLCHAIN}/bin/mkimage -A arm64 -O linux -T kernel -C gzip -a 0x80200000 -e 0x80200000 -n ${ID: -3}KRN-${SWITCHROOT_VERSION} -d ${TARGET_IMG}/${IMAGE_NAME}.kernel.gz \
${TARGET_IMG}/${IMAGE_NAME}.kernel
rm ${TARGET_IMG}/${IMAGE_NAME}.kernel.gz
echo Done!
@ -285,7 +285,6 @@ if [ -z "${SQUASHFS_COMPRESSION_OPTION}" ]; then
SQUASHFS_COMPRESSION_OPTION="-Xcompression-level 19 -b 1048576"
fi
fi
# Create squashfs file, default to gzip if no compression configured
echo "rm -rf \"${TARGET_IMG}/${IMAGE_NAME}.system\"" >> ${FAKEROOT_SCRIPT}
echo "${TOOLCHAIN}/bin/mksquashfs \"${BUILD}/image/system\" \"${TARGET_IMG}/${IMAGE_NAME}.system\" -noappend -comp ${SQUASHFS_COMPRESSION:-gzip} ${SQUASHFS_COMPRESSION_OPTION}" >> ${FAKEROOT_SCRIPT}