commit
e057b89fee
39 changed files with 1478 additions and 11523 deletions
|
@ -3,7 +3,7 @@
|
||||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||||
|
|
||||||
PKG_NAME="fileman"
|
PKG_NAME="fileman"
|
||||||
PKG_VERSION="9f192b8d026568f232f6687882f519572623a992"
|
PKG_VERSION="a32294a681036cdb9d2f3707ebc3f2889705960e"
|
||||||
PKG_ARCH="any"
|
PKG_ARCH="any"
|
||||||
PKG_LICENSE="GPL"
|
PKG_LICENSE="GPL"
|
||||||
PKG_SITE="https://github.com/JustEnoughLinuxOS/fileman"
|
PKG_SITE="https://github.com/JustEnoughLinuxOS/fileman"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||||
|
|
||||||
PKG_NAME="binutils-arm-none-eabi"
|
PKG_NAME="binutils-arm-none-eabi"
|
||||||
PKG_VERSION=""
|
PKG_VERSION="$(get_pkg_version binutils)"
|
||||||
PKG_LICENSE="GPL"
|
PKG_LICENSE="GPL"
|
||||||
PKG_URL=""
|
PKG_URL=""
|
||||||
PKG_DEPENDS_HOST="toolchain:host"
|
PKG_DEPENDS_HOST="toolchain:host"
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
supafaust_audio_rate = "disabled"
|
||||||
|
supafaust_correct_aspect = "enabled"
|
||||||
|
supafaust_cx4_clock_rate = "100"
|
||||||
|
supafaust_deinterlacer = "bob_offset"
|
||||||
|
supafaust_frame_begin_vblank = "enabled"
|
||||||
|
supafaust_h_filter = "phr256blend_auto512"
|
||||||
|
supafaust_multitap = "disabled"
|
||||||
|
supafaust_pixel_format = "rgb565"
|
||||||
|
supafaust_region = "auto"
|
||||||
|
supafaust_renderer = "mt"
|
||||||
|
supafaust_run_ahead = "disabled"
|
||||||
|
supafaust_slend = "223"
|
||||||
|
supafaust_slendp = "238"
|
||||||
|
supafaust_slstart = "0"
|
||||||
|
supafaust_slstartp = "0"
|
||||||
|
supafaust_superfx_clock_rate = "100"
|
||||||
|
supafaust_superfx_icache = "disabled"
|
||||||
|
supafaust_thread_affinity_emu = "0x3"
|
||||||
|
supafaust_thread_affinity_ppu = "0xc"
|
|
@ -38,4 +38,7 @@ PKG_AUTORECONF="no"
|
||||||
makeinstall_target() {
|
makeinstall_target() {
|
||||||
mkdir -p ${INSTALL}/usr/lib/libretro
|
mkdir -p ${INSTALL}/usr/lib/libretro
|
||||||
cp ${PKG_BUILD}/mednafen_supafaust_libretro.so ${INSTALL}/usr/lib/libretro/beetle_supafaust_libretro.so
|
cp ${PKG_BUILD}/mednafen_supafaust_libretro.so ${INSTALL}/usr/lib/libretro/beetle_supafaust_libretro.so
|
||||||
|
|
||||||
|
mkdir -p ${INSTALL}/usr/config/retroarch
|
||||||
|
cp -rf ${PKG_DIR}/config/* ${INSTALL}/usr/config/retroarch/
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ PKG_REV="1"
|
||||||
PKG_ARCH="any"
|
PKG_ARCH="any"
|
||||||
PKG_SITE="https://github.com/hrydgard/ppsspp"
|
PKG_SITE="https://github.com/hrydgard/ppsspp"
|
||||||
PKG_URL="${PKG_SITE}.git"
|
PKG_URL="${PKG_SITE}.git"
|
||||||
PKG_VERSION="53cfe5285d6b7c8959dd65bb72e6a6adf7248c74"
|
PKG_VERSION="58e12acee4d7829ee675ce95f3d377c3aaa3ecc5"
|
||||||
PKG_LICENSE="GPLv2"
|
PKG_LICENSE="GPLv2"
|
||||||
PKG_DEPENDS_TARGET="toolchain ffmpeg libzip SDL2 zlib zip"
|
PKG_DEPENDS_TARGET="toolchain ffmpeg libzip SDL2 zlib zip"
|
||||||
PKG_SHORTDESC="PPSSPPDL"
|
PKG_SHORTDESC="PPSSPPDL"
|
||||||
|
|
|
@ -21,11 +21,6 @@ PKG_CONFIGURE_OPTS_TARGET=" --disable-qt \
|
||||||
--enable-alsa \
|
--enable-alsa \
|
||||||
--enable-udev \
|
--enable-udev \
|
||||||
--disable-opengl1 \
|
--disable-opengl1 \
|
||||||
--disable-opengl \
|
|
||||||
--disable-opengles \
|
|
||||||
--disable-opengles3 \
|
|
||||||
--disable-opengles3_2 \
|
|
||||||
--disable-wayland \
|
|
||||||
--disable-x11 \
|
--disable-x11 \
|
||||||
--enable-zlib \
|
--enable-zlib \
|
||||||
--enable-freetype \
|
--enable-freetype \
|
||||||
|
@ -33,6 +28,7 @@ PKG_CONFIGURE_OPTS_TARGET=" --disable-qt \
|
||||||
--disable-vg \
|
--disable-vg \
|
||||||
--disable-sdl \
|
--disable-sdl \
|
||||||
--enable-sdl2 \
|
--enable-sdl2 \
|
||||||
|
--enable-kms \
|
||||||
--disable-odroidgo2 \
|
--disable-odroidgo2 \
|
||||||
--enable-ffmpeg"
|
--enable-ffmpeg"
|
||||||
|
|
||||||
|
@ -54,27 +50,38 @@ esac
|
||||||
if [ "${DISPLAYSERVER}" = "wl" ]; then
|
if [ "${DISPLAYSERVER}" = "wl" ]; then
|
||||||
PKG_DEPENDS_TARGET+=" wayland ${WINDOWMANAGER}"
|
PKG_DEPENDS_TARGET+=" wayland ${WINDOWMANAGER}"
|
||||||
PKG_CONFIGURE_OPTS_TARGET+=" --enable-wayland"
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-wayland"
|
||||||
|
else
|
||||||
|
PKG_CONFIGURE_OPTS_TARGET+=" --disable-wayland"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! "${OPENGL}" = "no" ]; then
|
if [[ "${OPENGL_SUPPORT}" = "yes" ]] && [[ ! "${DEVICE}" = "S922X" ]]; then
|
||||||
PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd"
|
PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd"
|
||||||
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengl"
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengl"
|
||||||
else
|
else
|
||||||
PKG_CONFIGURE_OPTS_TARGET+=" --disable-opengl"
|
PKG_CONFIGURE_OPTS_TARGET+=" --disable-opengl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${OPENGLES_SUPPORT}" = yes ] && \
|
if [ "${OPENGLES_SUPPORT}" = "yes" ]; then
|
||||||
[[ ! "${ARCH}" =~ i*86|x86_64 ]]; then
|
|
||||||
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
|
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
|
||||||
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengles --enable-opengles3 --enable-opengles3_2 --enable-kms"
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengles --enable-opengles3"
|
||||||
|
case ${DEVICE} in
|
||||||
|
RK33*|RK3566|RK3588)
|
||||||
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengles3_1"
|
||||||
|
;;
|
||||||
|
AMD64|S922X)
|
||||||
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengles3_1 --enable-opengles3_2"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
PKG_CONFIGURE_OPTS_TARGET+=" --disable-opengles --disable-opengles3 --disable-opengles3_2"
|
PKG_CONFIGURE_OPTS_TARGET+=" --disable-opengles --disable-opengles3 --disable-opengles3_1 --disable-opengles3_2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${VULKAN_SUPPORT}" = "yes" ]
|
if [ "${VULKAN_SUPPORT}" = "yes" ]
|
||||||
then
|
then
|
||||||
PKG_DEPENDS_TARGET+=" vulkan-loader vulkan-headers"
|
PKG_DEPENDS_TARGET+=" vulkan-loader vulkan-headers"
|
||||||
PKG_CONFIGURE_OPTS_TARGET+=" --enable-vulkan --enable-vulkan_display"
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-vulkan --enable-vulkan_display"
|
||||||
|
else
|
||||||
|
PKG_CONFIGURE_OPTS_TARGET+=" --disable-vulkan"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pre_configure_target() {
|
pre_configure_target() {
|
||||||
|
|
20
packages/emulators/tools/virtualgamepad/package.mk
Normal file
20
packages/emulators/tools/virtualgamepad/package.mk
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||||
|
|
||||||
|
PKG_NAME="virtualgamepad"
|
||||||
|
PKG_VERSION="a6e8459"
|
||||||
|
PKG_LICENSE="GPLv2"
|
||||||
|
PKG_SITE="https://github.com/macromorgan/input-wrapper"
|
||||||
|
PKG_URL="${PKG_SITE}.git"
|
||||||
|
PKG_DEPENDS_TARGET="toolchain linux"
|
||||||
|
PKG_TOOLCHAIN="make"
|
||||||
|
|
||||||
|
makeinstall_target() {
|
||||||
|
mkdir -p ${INSTALL}/usr/bin
|
||||||
|
cp wrap ${INSTALL}/usr/bin/virtualgamepad
|
||||||
|
chmod 0755 ${INSTALL}/usr/bin/virtualgamepad
|
||||||
|
}
|
||||||
|
|
||||||
|
post_install() {
|
||||||
|
enable_service virtualgamepad.service
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Virtual Gamepad Driver
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/virtualgamepad
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -82,7 +82,8 @@ echo "BUILD ID: ${BUILD_ID:0:7} (${BUILD_BRANCH})"
|
||||||
echo "KERNEL: ${V_SYSTEM} ($(uname -m))"
|
echo "KERNEL: ${V_SYSTEM} ($(uname -m))"
|
||||||
echo "DISK SPACE:"
|
echo "DISK SPACE:"
|
||||||
echo "/storage: $(df -h /storage | awk '/dev/ {print $3"/"$2" ("$5")"}')"
|
echo "/storage: $(df -h /storage | awk '/dev/ {print $3"/"$2" ("$5")"}')"
|
||||||
echo "/storage/roms: $(df -h /storage/roms | awk '/dev/ {print $3"/"$2" ("$5")"}')"
|
echo "/storage/games-internal: $(df -h /storage/games-internal | awk '/dev/ {print $3"/"$2" ("$5")"}')"
|
||||||
|
echo "/storage/games-external: $(df -h /storage/games-external | awk '/dev/ {print $3"/"$2" ("$5")"}')"
|
||||||
|
|
||||||
if test -n "${BATT}"
|
if test -n "${BATT}"
|
||||||
then
|
then
|
||||||
|
|
|
@ -914,6 +914,23 @@ function set_saturnopts() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function set_snesopts() {
|
||||||
|
log "Set up SNES..."
|
||||||
|
if [ "${CORE}" = "beetle_supafaust" ]
|
||||||
|
then
|
||||||
|
log "Set up beetle_supafaust"
|
||||||
|
local FAUSTDIR="${RETROARCH_PATH}/config/Supafaust"
|
||||||
|
if [ ! -d "${FAUSTDIR}" ]
|
||||||
|
then
|
||||||
|
mkdir -p "${FAUSTDIR}"
|
||||||
|
fi
|
||||||
|
if [ ! -f "${FAUSTDIR}/Supafaust.opt" ]
|
||||||
|
then
|
||||||
|
cp "/usr/config/retroarch/Supafaust.opt" "${FAUSTDIR}/Supafaust.opt"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function set_dreamcastopts() {
|
function set_dreamcastopts() {
|
||||||
log "Set up Dreamcast..."
|
log "Set up Dreamcast..."
|
||||||
if [ "${CORE}" = "flycast" ]
|
if [ "${CORE}" = "flycast" ]
|
||||||
|
@ -1076,6 +1093,7 @@ set_analogsupport &
|
||||||
set_tatemode &
|
set_tatemode &
|
||||||
set_n64opts &
|
set_n64opts &
|
||||||
set_saturnopts &
|
set_saturnopts &
|
||||||
|
set_snesopts &
|
||||||
set_dreamcastopts &
|
set_dreamcastopts &
|
||||||
|
|
||||||
### Sed operations are expensive, so they are staged and executed as
|
### Sed operations are expensive, so they are staged and executed as
|
||||||
|
|
|
@ -35,15 +35,19 @@ post_makeinstall_target() {
|
||||||
rm -f ${INSTALL}/usr/config/modules/*32bit*
|
rm -f ${INSTALL}/usr/config/modules/*32bit*
|
||||||
rm -f ${INSTALL}/usr/config/modules/*Master*
|
rm -f ${INSTALL}/usr/config/modules/*Master*
|
||||||
;;
|
;;
|
||||||
*)
|
|
||||||
rm -f ${INSTALL}/usr/config/modules/Install*
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case ${DEVICE} in
|
case ${DEVICE} in
|
||||||
S922X*)
|
S922X*)
|
||||||
rm -f ${INSTALL}/usr/config/modules/*ScummVM*
|
rm -f ${INSTALL}/usr/config/modules/*ScummVM*
|
||||||
rm -f ${INSTALL}/usr/config/modules/*32bit*
|
rm -f ${INSTALL}/usr/config/modules/*32bit*
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ ! "${INSTALLER_SUPPORT}" = "yes" ] || \
|
||||||
|
[ ! "${DISPLAYSERVER}" = "wl" ]
|
||||||
|
then
|
||||||
|
rm -f ${INSTALL}/usr/config/modules/Install*
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
31
packages/tools/atf/package.mk
Normal file
31
packages/tools/atf/package.mk
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
# Copyright (C) 2018-present Team LibreELEC
|
||||||
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||||
|
|
||||||
|
PKG_NAME="atf"
|
||||||
|
PKG_VERSION="2.10.0"
|
||||||
|
PKG_SHA256="696b8e53923aac4474532da7dd681f0bd044b329732facd65aeabea3e61adca9"
|
||||||
|
PKG_ARCH="arm aarch64"
|
||||||
|
PKG_LICENSE="BSD-3c"
|
||||||
|
PKG_SITE="https://github.com/ARM-software/arm-trusted-firmware"
|
||||||
|
PKG_URL="https://github.com/ARM-software/arm-trusted-firmware/archive/v${PKG_VERSION}.tar.gz"
|
||||||
|
PKG_DEPENDS_TARGET="toolchain"
|
||||||
|
PKG_LONGDESC="ARM Trusted Firmware is a reference implementation of secure world software, including a Secure Monitor executing at Exception Level 3 and various Arm interface standards."
|
||||||
|
PKG_TOOLCHAIN="manual"
|
||||||
|
PKG_PATCH_DIRS+="${DEVICE}"
|
||||||
|
|
||||||
|
[ -n "${KERNEL_TOOLCHAIN}" ] && PKG_DEPENDS_TARGET+=" gcc-${KERNEL_TOOLCHAIN}:host"
|
||||||
|
|
||||||
|
if [ "${ATF_PLATFORM}" = "rk3399" ]; then
|
||||||
|
PKG_DEPENDS_TARGET+=" gcc-arm-none-eabi:host"
|
||||||
|
export M0_CROSS_COMPILE="${TOOLCHAIN}/bin/arm-none-eabi-"
|
||||||
|
fi
|
||||||
|
|
||||||
|
make_target() {
|
||||||
|
CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" CFLAGS="" make PLAT=${ATF_PLATFORM} bl31
|
||||||
|
}
|
||||||
|
|
||||||
|
makeinstall_target() {
|
||||||
|
mkdir -p ${INSTALL}/usr/share/bootloader
|
||||||
|
cp -a build/${ATF_PLATFORM}/release/${ATF_BL31_BINARY} ${INSTALL}/usr/share/bootloader
|
||||||
|
}
|
13
packages/tools/atf/patches/RK3399/000-atf-fix-baud.patch
Normal file
13
packages/tools/atf/patches/RK3399/000-atf-fix-baud.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/plat/rockchip/rk3399/rk3399_def.h b/plat/rockchip/rk3399/rk3399_def.h
|
||||||
|
index ba83242ebe..8d6ecfbe66 100644
|
||||||
|
--- a/plat/rockchip/rk3399/rk3399_def.h
|
||||||
|
+++ b/plat/rockchip/rk3399/rk3399_def.h
|
||||||
|
@@ -17,7 +17,7 @@
|
||||||
|
/**************************************************************************
|
||||||
|
* UART related constants
|
||||||
|
**************************************************************************/
|
||||||
|
-#define RK3399_BAUDRATE 115200
|
||||||
|
+#define RK3399_BAUDRATE 1500000
|
||||||
|
#define RK3399_UART_CLOCK 24000000
|
||||||
|
|
||||||
|
/******************************************************************************
|
|
@ -2,8 +2,8 @@
|
||||||
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
||||||
|
|
||||||
# Disklabel for System and Storage partition
|
# Disklabel for System and Storage partition
|
||||||
DISKLABEL_SYSTEM="System"
|
DISKLABEL_SYSTEM="boot"
|
||||||
DISKLABEL_STORAGE="Storage"
|
DISKLABEL_STORAGE="storage"
|
||||||
|
|
||||||
# Default size of system partition, in MB, eg. 512
|
# Default size of system partition, in MB, eg. 512
|
||||||
PARTSIZE_SYSTEM="@SYSTEM_SIZE@"
|
PARTSIZE_SYSTEM="@SYSTEM_SIZE@"
|
||||||
|
|
|
@ -29,8 +29,13 @@
|
||||||
# disable Ctrl+C - can be very dangerous
|
# disable Ctrl+C - can be very dangerous
|
||||||
trap '' 2
|
trap '' 2
|
||||||
|
|
||||||
|
# Don't execute if installer.conf doesn't exist
|
||||||
[ -f /etc/installer.conf ] && . /etc/installer.conf || exit 0
|
[ -f /etc/installer.conf ] && . /etc/installer.conf || exit 0
|
||||||
|
|
||||||
|
# Bring in OS variables.
|
||||||
|
. /etc/os-release
|
||||||
|
|
||||||
|
|
||||||
dbglg() {
|
dbglg() {
|
||||||
# Acts just like echo cmd, with automatic redirection
|
# Acts just like echo cmd, with automatic redirection
|
||||||
|
|
||||||
|
@ -158,14 +163,21 @@ do_install_quick() {
|
||||||
INSTALL_DEVICE=$(cat "$TMPDIR/device_for_install")
|
INSTALL_DEVICE=$(cat "$TMPDIR/device_for_install")
|
||||||
INSTALL_DEVICE_FULL=$(echo ${DEVICE_LIST} | sed "s|.*${INSTALL_DEVICE} \([^ ]*\).*|${INSTALL_DEVICE} \1|")
|
INSTALL_DEVICE_FULL=$(echo ${DEVICE_LIST} | sed "s|.*${INSTALL_DEVICE} \([^ ]*\).*|${INSTALL_DEVICE} \1|")
|
||||||
|
|
||||||
case ${INSTALL_DEVICE} in
|
case ${HW_ARCH} in
|
||||||
"/dev/mmcblk"*|"/dev/nvme"*)
|
arm|aarch64)
|
||||||
PART1="p1"
|
PART1="3"
|
||||||
PART2="p2"
|
PART2="4"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
PART1="1"
|
PART1="1"
|
||||||
PART2="2"
|
PART2="2"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case ${INSTALL_DEVICE} in
|
||||||
|
"/dev/mmcblk"*|"/dev/nvme"*)
|
||||||
|
PART1="p${PART1}"
|
||||||
|
PART2="p${PART2}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -204,12 +216,30 @@ do_install_quick() {
|
||||||
parted -s ${INSTALL_DEVICE} mklabel msdos >> $LOGFILE 2>&1
|
parted -s ${INSTALL_DEVICE} mklabel msdos >> $LOGFILE 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_progress_install "9" "Writing Master Boot Record on ${INSTALL_DEVICE}"
|
case ${HW_ARCH} in
|
||||||
if [ "$GPT" = "1" ]; then
|
arm|aarch64)
|
||||||
cat /usr/share/syslinux/gptmbr.bin > ${INSTALL_DEVICE}
|
parted -s "${INSTALL_DEVICE}" unit s mkpart uboot 16384 24575 >> $LOGFILE 2>&1
|
||||||
else
|
if [ -e "/usr/share/bootloader/trust.img" ]
|
||||||
cat /usr/share/syslinux/mbr.bin > ${INSTALL_DEVICE}
|
then
|
||||||
fi
|
TRUST_LABEL="trust"
|
||||||
|
elif [ -e "/usr/share/bootloader/resource.img" ]
|
||||||
|
then
|
||||||
|
TRUST_LABEL="resource"
|
||||||
|
fi
|
||||||
|
if [ -n "${TRUST_LABEL}" ]
|
||||||
|
then
|
||||||
|
parted -s "${INSTALL_DEVICE}" unit s mkpart ${TRUST_LABEL} 24576 32767 >> $LOGFILE 2>&1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
msg_progress_install "9" "Writing Master Boot Record on ${INSTALL_DEVICE}"
|
||||||
|
if [ "$GPT" = "1" ]; then
|
||||||
|
cat /usr/share/syslinux/gptmbr.bin > ${INSTALL_DEVICE}
|
||||||
|
else
|
||||||
|
cat /usr/share/syslinux/mbr.bin > ${INSTALL_DEVICE}
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
partsize_system_start=$PARTSIZE_SYSTEM_OFFSET
|
partsize_system_start=$PARTSIZE_SYSTEM_OFFSET
|
||||||
partsize_system_end=$(((PARTSIZE_SYSTEM * 1024 * 1024 / 512) + partsize_system_start - 1))
|
partsize_system_end=$(((PARTSIZE_SYSTEM * 1024 * 1024 / 512) + partsize_system_start - 1))
|
||||||
|
@ -227,13 +257,21 @@ do_install_quick() {
|
||||||
if [ "$GPT" = "1" ]; then
|
if [ "$GPT" = "1" ]; then
|
||||||
parted -s ${INSTALL_DEVICE} unit s mkpart $DISKLABEL_STORAGE ext4 -- $partsize_storage_start $partsize_storage_end >> $LOGFILE 2>&1
|
parted -s ${INSTALL_DEVICE} unit s mkpart $DISKLABEL_STORAGE ext4 -- $partsize_storage_start $partsize_storage_end >> $LOGFILE 2>&1
|
||||||
else
|
else
|
||||||
parted -s ${INSTALL_DEVICE} unit s mkpart primary ext4 -- $partsize_storage_start $partsize_storage_end >> $LOGFILE 2>&1
|
parted -s ${INSTALL_DEVICE} unit s mkpart storage ext4 -- $partsize_storage_start $partsize_storage_end >> $LOGFILE 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_progress_install "16" "Setup bootflag on partition 1 of ${INSTALL_DEVICE}"
|
msg_progress_install "16" "Setup bootflag on partition 1 of ${INSTALL_DEVICE}"
|
||||||
parted -s ${INSTALL_DEVICE} set 1 boot on >> $LOGFILE 2>&1
|
parted -s ${INSTALL_DEVICE} set 1 boot on >> $LOGFILE 2>&1
|
||||||
if [ "$GPT" = "1" ]; then
|
if [ "$GPT" = "1" ]; then
|
||||||
parted -s ${INSTALL_DEVICE} set 1 legacy_boot on >> $LOGFILE 2>&1
|
case ${HW_ARCH} in
|
||||||
|
arm|aarch64)
|
||||||
|
BOOT_PART=3
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
BOOT_PART=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
parted -s ${INSTALL_DEVICE} set ${BOOT_PART} legacy_boot on >> $LOGFILE 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_progress_install "20" "Tell the kernel we have a new partition table on ${INSTALL_DEVICE}"
|
msg_progress_install "20" "Tell the kernel we have a new partition table on ${INSTALL_DEVICE}"
|
||||||
|
@ -266,9 +304,34 @@ do_install_quick() {
|
||||||
msg_progress_install "40" "Mounting ${INSTALL_DEVICE}${PART1} to $TMPDIR/part1"
|
msg_progress_install "40" "Mounting ${INSTALL_DEVICE}${PART1} to $TMPDIR/part1"
|
||||||
mount -t vfat ${INSTALL_DEVICE}${PART1} $TMPDIR/part1 >> $LOGFILE 2>&1
|
mount -t vfat ${INSTALL_DEVICE}${PART1} $TMPDIR/part1 >> $LOGFILE 2>&1
|
||||||
|
|
||||||
# installing syslinux
|
case ${HW_ARCH} in
|
||||||
msg_progress_install "50" "Installing syslinux to $TMPDIR/part1"
|
arm|aarch64)
|
||||||
syslinux -i ${INSTALL_DEVICE}${PART1} >> $LOGFILE 2>&1
|
msg_progress_install "50" "Installing bootloader to $TMPDIR/part1"
|
||||||
|
/usr/share/bootloader/update.sh "${INSTALL_DEVICE}" "${TMPDIR}/part1" "$UUID_SYSTEM" "$UUID_STORAGE" "$SYSLINUX_PARAMETERS @EXTRA_CMDLINE@"
|
||||||
|
mount -o remount,rw $TMPDIR/part1
|
||||||
|
;;
|
||||||
|
i686|x86_64)
|
||||||
|
# installing syslinux
|
||||||
|
msg_progress_install "50" "Installing syslinux to $TMPDIR/part1"
|
||||||
|
syslinux -i ${INSTALL_DEVICE}${PART1} >> $LOGFILE 2>&1
|
||||||
|
|
||||||
|
# configuring bootloader
|
||||||
|
msg_progress_install "80" "Setup bootloader with boot label = $DISKLABEL_SYSTEM and disk label = $DISKLABEL_STORAGE"
|
||||||
|
mkdir -p $TMPDIR/part1/EFI/BOOT
|
||||||
|
cat << EOF > $TMPDIR/part1/syslinux.cfg
|
||||||
|
DEFAULT linux
|
||||||
|
PROMPT 0
|
||||||
|
|
||||||
|
LABEL linux
|
||||||
|
KERNEL /KERNEL
|
||||||
|
APPEND boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE $SYSLINUX_PARAMETERS @EXTRA_CMDLINE@
|
||||||
|
EOF
|
||||||
|
# uefi boot / hybrid mode
|
||||||
|
cp /usr/share/syslinux/bootx64.efi $TMPDIR/part1/EFI/BOOT
|
||||||
|
cp /usr/share/syslinux/ldlinux.e64 $TMPDIR/part1/EFI/BOOT
|
||||||
|
cp /usr/share/grub/bootia32.efi $TMPDIR/part1/EFI/BOOT
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# install system files
|
# install system files
|
||||||
msg_progress_install "60" "Installing Kernel"
|
msg_progress_install "60" "Installing Kernel"
|
||||||
|
@ -278,22 +341,6 @@ do_install_quick() {
|
||||||
cp "/flash/$IMAGE_SYSTEM" $TMPDIR/part1/SYSTEM >> $LOGFILE 2>&1
|
cp "/flash/$IMAGE_SYSTEM" $TMPDIR/part1/SYSTEM >> $LOGFILE 2>&1
|
||||||
sync
|
sync
|
||||||
|
|
||||||
# configuring bootloader
|
|
||||||
msg_progress_install "80" "Setup bootloader with boot label = $DISKLABEL_SYSTEM and disk label = $DISKLABEL_STORAGE"
|
|
||||||
mkdir -p $TMPDIR/part1/EFI/BOOT
|
|
||||||
cat << EOF > $TMPDIR/part1/syslinux.cfg
|
|
||||||
DEFAULT linux
|
|
||||||
PROMPT 0
|
|
||||||
|
|
||||||
LABEL linux
|
|
||||||
KERNEL /KERNEL
|
|
||||||
APPEND boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE $SYSLINUX_PARAMETERS @EXTRA_CMDLINE@
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# uefi boot / hybrid mode
|
|
||||||
cp /usr/share/syslinux/bootx64.efi $TMPDIR/part1/EFI/BOOT
|
|
||||||
cp /usr/share/syslinux/ldlinux.e64 $TMPDIR/part1/EFI/BOOT
|
|
||||||
cp /usr/share/grub/bootia32.efi $TMPDIR/part1/EFI/BOOT
|
|
||||||
sync
|
sync
|
||||||
|
|
||||||
# umount system partition, remove mountpoint
|
# umount system partition, remove mountpoint
|
||||||
|
@ -351,19 +398,36 @@ msg_progress_install() {
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt_gpt() {
|
prompt_gpt() {
|
||||||
GPT="0"
|
case ${HW_ARCH} in
|
||||||
UEFI="0"
|
arm|aarch64)
|
||||||
# Get size in GB.
|
BOOT_DEVICE=$(blkid | awk 'BEGIN {FS=":"} /'$(cat /proc/cmdline | sed -e 's~^.*disk=UUID=~~g; s~\ .*$~~g')'/ {print $1}' | sed 's~p[0-9].*$~~g')
|
||||||
# 2^41 bytes is the DOS limit (2199023255552 bytes, 2.2TB). Use GUID Partition Table.>= 2200GB
|
BOOT_LABEL="$(blkid ${BOOT_DEVICE} | grep -Eo 'PTTYPE=".*"' | sed 's~PTTYPE=~~g; s~"~~g')"
|
||||||
INSTALL_DEVICE_SIZE=$(($(cat /sys/block/${INSTALL_DEVICE#/dev/}/size)*512/1000/1000/1000))
|
case ${BOOT_LABEL} in
|
||||||
if [ "${INSTALL_DEVICE_SIZE}" -ge 2200 ] 2>/dev/null; then
|
gpt)
|
||||||
GPT="1"
|
GPT="1"
|
||||||
fi
|
;;
|
||||||
# force gpt + uefi in uefi boot mode
|
*)
|
||||||
if [ -d /sys/firmware/efi ]; then
|
GPT="0"
|
||||||
UEFI="1"
|
;;
|
||||||
GPT="1"
|
esac
|
||||||
fi
|
UEFI="0"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
GPT="0"
|
||||||
|
UEFI="0"
|
||||||
|
# Get size in GB.
|
||||||
|
# 2^41 bytes is the DOS limit (2199023255552 bytes, 2.2TB). Use GUID Partition Table.>= 2200GB
|
||||||
|
INSTALL_DEVICE_SIZE=$(($(cat /sys/block/${INSTALL_DEVICE#/dev/}/size)*512/1000/1000/1000))
|
||||||
|
if [ "${INSTALL_DEVICE_SIZE}" -ge 2200 ] 2>/dev/null; then
|
||||||
|
GPT="1"
|
||||||
|
fi
|
||||||
|
# force gpt + uefi in uefi boot mode
|
||||||
|
if [ -d /sys/firmware/efi ]; then
|
||||||
|
UEFI="1"
|
||||||
|
GPT="1"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt_backup_unpack() {
|
prompt_backup_unpack() {
|
||||||
|
@ -491,6 +555,7 @@ log_system_status >> $LOGFILE 2>&1
|
||||||
|
|
||||||
# generate the en_US.UTF-8 locale to enable line drawing
|
# generate the en_US.UTF-8 locale to enable line drawing
|
||||||
mkdir -p $TMPDIR/locale
|
mkdir -p $TMPDIR/locale
|
||||||
|
echo "Please wait, configuring en_US.UTF-8."
|
||||||
localedef -i en_US -f UTF-8 $TMPDIR/locale/en_US.UTF-8
|
localedef -i en_US -f UTF-8 $TMPDIR/locale/en_US.UTF-8
|
||||||
export LOCPATH=$TMPDIR/locale
|
export LOCPATH=$TMPDIR/locale
|
||||||
export LC_ALL=en_US.UTF-8
|
export LC_ALL=en_US.UTF-8
|
||||||
|
|
|
@ -7,7 +7,7 @@ PKG_SITE="www.jelos.org"
|
||||||
PKG_SECTION="virtual"
|
PKG_SECTION="virtual"
|
||||||
PKG_LONGDESC="Game support software metapackage."
|
PKG_LONGDESC="Game support software metapackage."
|
||||||
|
|
||||||
PKG_GAMESUPPORT="sixaxis gptokeyb jstest-sdl gamecontrollerdb sdljoytest control-gen"
|
PKG_GAMESUPPORT="sixaxis gptokeyb jstest-sdl gamecontrollerdb sdljoytest control-gen virtualgamepad"
|
||||||
|
|
||||||
PKG_DEPENDS_TARGET="${PKG_GAMESUPPORT}"
|
PKG_DEPENDS_TARGET="${PKG_GAMESUPPORT}"
|
||||||
|
|
||||||
|
|
|
@ -3,56 +3,65 @@
|
||||||
# Copyright (C) 2017-2021 Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2017-2021 Team LibreELEC (https://libreelec.tv)
|
||||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||||
|
|
||||||
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
|
if [ -z "${1}" ]
|
||||||
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
|
then
|
||||||
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
|
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
|
||||||
if [ -z "$BOOT_DISK" ]; then
|
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
|
||||||
case $BOOT_PART in
|
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
|
||||||
/dev/sd[a-z][0-9]*)
|
if [ -z "$BOOT_DISK" ]; then
|
||||||
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
|
case $BOOT_PART in
|
||||||
|
/dev/sd[a-z][0-9]*)
|
||||||
|
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
|
||||||
|
;;
|
||||||
|
/dev/mmcblk*)
|
||||||
|
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# mount $BOOT_ROOT r/w
|
||||||
|
mount -o remount,rw $BOOT_ROOT
|
||||||
|
|
||||||
|
|
||||||
|
for arg in $(cat /proc/cmdline); do
|
||||||
|
case $arg in
|
||||||
|
boot=*)
|
||||||
|
boot="${arg#*=}"
|
||||||
|
case $boot in
|
||||||
|
/dev/mmc*)
|
||||||
|
UUID_SYSTEM="$(blkid $boot | sed 's/.* UUID="//;s/".*//g')"
|
||||||
|
;;
|
||||||
|
UUID=*|LABEL=*)
|
||||||
|
UUID_SYSTEM="$(blkid | sed 's/"//g' | grep -m 1 -i " $boot " | sed 's/.* UUID=//;s/ .*//g')"
|
||||||
|
;;
|
||||||
|
FOLDER=*)
|
||||||
|
UUID_SYSTEM="$(blkid ${boot#*=} | sed 's/.* UUID="//;s/".*//g')"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
/dev/mmcblk*)
|
disk=*)
|
||||||
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
|
disk="${arg#*=}"
|
||||||
|
case $disk in
|
||||||
|
/dev/mmc*)
|
||||||
|
UUID_STORAGE="$(blkid $disk | sed 's/.* UUID="//;s/".*//g')"
|
||||||
|
;;
|
||||||
|
UUID=*|LABEL=*)
|
||||||
|
UUID_STORAGE="$(blkid | sed 's/"//g' | grep -m 1 -i " $disk " | sed 's/.* UUID=//;s/ .*//g')"
|
||||||
|
;;
|
||||||
|
FOLDER=*)
|
||||||
|
UUID_STORAGE="$(blkid ${disk#*=} | sed 's/.* UUID="//;s/".*//g')"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
done
|
||||||
|
else
|
||||||
|
BOOT_DISK="${1}"
|
||||||
|
BOOT_ROOT="${2}"
|
||||||
|
UUID_SYSTEM="${3}"
|
||||||
|
UUID_STORAGE="${4}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# mount $BOOT_ROOT r/w
|
|
||||||
mount -o remount,rw $BOOT_ROOT
|
|
||||||
|
|
||||||
for arg in $(cat /proc/cmdline); do
|
|
||||||
case $arg in
|
|
||||||
boot=*)
|
|
||||||
boot="${arg#*=}"
|
|
||||||
case $boot in
|
|
||||||
/dev/mmc*)
|
|
||||||
BOOT_UUID="$(blkid $boot | sed 's/.* UUID="//;s/".*//g')"
|
|
||||||
;;
|
|
||||||
UUID=*|LABEL=*)
|
|
||||||
BOOT_UUID="$(blkid | sed 's/"//g' | grep -m 1 -i " $boot " | sed 's/.* UUID=//;s/ .*//g')"
|
|
||||||
;;
|
|
||||||
FOLDER=*)
|
|
||||||
BOOT_UUID="$(blkid ${boot#*=} | sed 's/.* UUID="//;s/".*//g')"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
disk=*)
|
|
||||||
disk="${arg#*=}"
|
|
||||||
case $disk in
|
|
||||||
/dev/mmc*)
|
|
||||||
DISK_UUID="$(blkid $disk | sed 's/.* UUID="//;s/".*//g')"
|
|
||||||
;;
|
|
||||||
UUID=*|LABEL=*)
|
|
||||||
DISK_UUID="$(blkid | sed 's/"//g' | grep -m 1 -i " $disk " | sed 's/.* UUID=//;s/ .*//g')"
|
|
||||||
;;
|
|
||||||
FOLDER=*)
|
|
||||||
DISK_UUID="$(blkid ${disk#*=} | sed 's/.* UUID="//;s/".*//g')"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
DT_ID=$($SYSTEM_ROOT/usr/bin/dtname)
|
DT_ID=$($SYSTEM_ROOT/usr/bin/dtname)
|
||||||
|
|
||||||
if [ -n "$DT_ID" ]; then
|
if [ -n "$DT_ID" ]; then
|
||||||
|
@ -77,9 +86,13 @@ for all_dtb in $BOOT_ROOT/*.dtb; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
|
if [ -f $BOOT_ROOT/extlinux/extlinux.conf ] || [ -n "${1}" ]; then
|
||||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf ]; then
|
if [ -f $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf ]; then
|
||||||
echo "Updating extlinux.conf..."
|
echo "Updating extlinux.conf..."
|
||||||
|
if [ ! -d "${BOOT_ROOT}/extlinux" ]
|
||||||
|
then
|
||||||
|
mkdir "${BOOT_ROOT}/extlinux"
|
||||||
|
fi
|
||||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf $BOOT_ROOT/extlinux
|
cp -p $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf $BOOT_ROOT/extlinux
|
||||||
sed -e "s/@BOOT_UUID@/$BOOT_UUID/" \
|
sed -e "s/@BOOT_UUID@/$BOOT_UUID/" \
|
||||||
-e "s/@DISK_UUID@/$DISK_UUID/" \
|
-e "s/@DISK_UUID@/$DISK_UUID/" \
|
||||||
|
@ -87,7 +100,7 @@ if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f $BOOT_ROOT/boot.ini ]; then
|
if [ -f $BOOT_ROOT/boot.ini ] || [ -n "${1}" ]; then
|
||||||
if [ -f /usr/share/bootloader/boot.ini ]; then
|
if [ -f /usr/share/bootloader/boot.ini ]; then
|
||||||
echo "Updating boot.ini"
|
echo "Updating boot.ini"
|
||||||
cp -p /usr/share/bootloader/boot.ini $BOOT_ROOT/boot.ini
|
cp -p /usr/share/bootloader/boot.ini $BOOT_ROOT/boot.ini
|
||||||
|
|
|
@ -144,6 +144,9 @@
|
||||||
# swapfile size if SWAP_SUPPORT=yes in MB
|
# swapfile size if SWAP_SUPPORT=yes in MB
|
||||||
SWAPFILESIZE="384"
|
SWAPFILESIZE="384"
|
||||||
|
|
||||||
|
# Some devices have internal storage.
|
||||||
|
INSTALLER_SUPPORT="yes"
|
||||||
|
|
||||||
# cron support (yes / no)
|
# cron support (yes / no)
|
||||||
CRON_SUPPORT="no"
|
CRON_SUPPORT="no"
|
||||||
|
|
||||||
|
|
|
@ -27,12 +27,17 @@ generate_rkspi_loader() {
|
||||||
dd if=${PKG_BUILD}/u-boot.itb of=$RKSPI_LOADER seek=16384 conv=notrunc
|
dd if=${PKG_BUILD}/u-boot.itb of=$RKSPI_LOADER seek=16384 conv=notrunc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ -n "${PKG_DATAFILE}" -a -n "${PKG_LOADER}" ]; then
|
if [ -n "${PKG_DATAFILE}" -a -n "${PKG_LOADER}" ]; then
|
||||||
echo "loader: Make idbloader.img from ${PKG_DATAFILE}:${PKG_LOADER}..."
|
echo "loader: Make idbloader.img from ${PKG_DATAFILE}:${PKG_LOADER}..."
|
||||||
case "${PKG_SOC}" in
|
case "${PKG_SOC}" in
|
||||||
rk35*|rk3399)
|
rk35*)
|
||||||
tools/mkimage -n ${PKG_SOC} -T rksd -d ${PKG_DATAFILE}:${PKG_LOADER} -C bzip2 idbloader.img
|
tools/mkimage -n ${PKG_SOC} -T rksd -d ${PKG_DATAFILE}:${PKG_LOADER} -C bzip2 idbloader.img
|
||||||
;;
|
;;
|
||||||
|
rk3399)
|
||||||
|
${PKG_RKBIN}/tools/mkimage -n "${PKG_SOC}" -T rksd -d ${PKG_DATAFILE}:${PKG_LOADER} idbloader.img.rk || exit 1
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
tools/mkimage -n ${PKG_SOC} -T rksd -d "${PKG_DATAFILE}" -C bzip2 idbloader.img
|
tools/mkimage -n ${PKG_SOC} -T rksd -d "${PKG_DATAFILE}" -C bzip2 idbloader.img
|
||||||
cat "${PKG_LOADER}" >> idbloader.img
|
cat "${PKG_LOADER}" >> idbloader.img
|
||||||
|
@ -40,8 +45,12 @@ if [ -n "${PKG_DATAFILE}" -a -n "${PKG_LOADER}" ]; then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "uboot: copy idbloader.img image to ${INSTALL}/usr/share/bootloader..."
|
case "${PKG_SOC}" in
|
||||||
cp -av idbloader.img ${INSTALL}/usr/share/bootloader
|
rk35*|px30)
|
||||||
|
echo "uboot: copy idbloader.img image to ${INSTALL}/usr/share/bootloader..."
|
||||||
|
cp -av idbloader.img ${INSTALL}/usr/share/bootloader
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if [ ! -n "${PKG_LOAD_ADDR}" ]; then
|
if [ ! -n "${PKG_LOAD_ADDR}" ]; then
|
||||||
PKG_LOAD_ADDR="0x00200000"
|
PKG_LOAD_ADDR="0x00200000"
|
||||||
|
@ -53,6 +62,18 @@ case "${PKG_SOC}" in
|
||||||
cp -av u-boot.itb ${INSTALL}/usr/share/bootloader/u-boot.itb
|
cp -av u-boot.itb ${INSTALL}/usr/share/bootloader/u-boot.itb
|
||||||
generate_rkspi_loader
|
generate_rkspi_loader
|
||||||
;;
|
;;
|
||||||
|
rk3399)
|
||||||
|
PKG_ATF_INI="${PKG_RKBIN}"/RKTRUST/"${DEVICE}"TRUST.ini
|
||||||
|
echo "uboot: building ${UBOOT_FIT_IMAGE}..."
|
||||||
|
${PKG_RKBIN}/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img.rk "${PKG_LOAD_ADDR}" || exit 1
|
||||||
|
dd if=idbloader.img.rk of="${UBOOT_FIT_IMAGE}" seek=0 conv=fsync,notrunc > /dev/null 2>&1 || exit 1
|
||||||
|
dd if=uboot.img.rk of="${UBOOT_FIT_IMAGE}" seek=16320 conv=fsync,notrunc > /dev/null 2>&1 || exit 1
|
||||||
|
"${PKG_RKBIN}"/tools/trust_merger --ignore-bl32 --prepath "${PKG_RKBIN}"/ "${PKG_ATF_INI}" || exit 1
|
||||||
|
dd if=trust.img of="${UBOOT_FIT_IMAGE}" seek=24512 conv=fsync,notrunc > /dev/null 2>&1 || exit 1
|
||||||
|
|
||||||
|
echo "uboot: copy ${UBOOT_FIT_IMAGE} to ${INSTALL}/usr/share/bootloader..."
|
||||||
|
cp -av ${UBOOT_FIT_IMAGE} ${INSTALL}/usr/share/bootloader
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "uboot: build loader image uboot.img at ${PKG_LOAD_ADDR}..."
|
echo "uboot: build loader image uboot.img at ${PKG_LOAD_ADDR}..."
|
||||||
${PKG_UBOOT}/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img ${PKG_LOAD_ADDR} ||:
|
${PKG_UBOOT}/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img ${PKG_LOAD_ADDR} ||:
|
||||||
|
@ -61,7 +82,7 @@ case "${PKG_SOC}" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "${DEVICE}" in
|
case "${DEVICE}" in
|
||||||
RK33*)
|
RK3326)
|
||||||
if [ -n "${PKG_BL31}" ]; then
|
if [ -n "${PKG_BL31}" ]; then
|
||||||
echo "trust: create trust.ini..."
|
echo "trust: create trust.ini..."
|
||||||
cat >trust.ini <<EOF
|
cat >trust.ini <<EOF
|
||||||
|
|
|
@ -22,17 +22,23 @@ fi
|
||||||
|
|
||||||
case "${PKG_SOC}" in
|
case "${PKG_SOC}" in
|
||||||
rk35*)
|
rk35*)
|
||||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/u-boot.itb" ]; then
|
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/u-boot.itb" ]; then
|
||||||
echo "image: burn uboot.itb to image... (${PKG_SOC})"
|
echo "image: burn uboot.itb to image... (${PKG_SOC})"
|
||||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/u-boot.itb" of="${DISK}" bs=512 seek=16384 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
dd if="${RELEASE_DIR}/3rdparty/bootloader/u-boot.itb" of="${DISK}" bs=512 seek=16384 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||||
fi
|
fi
|
||||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/trust.img" ]; then
|
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/trust.img" ]; then
|
||||||
echo "image: burn trust.img to image..."
|
echo "image: burn trust.img to image..."
|
||||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/trust.img" of="${DISK}" bs=512 seek=24576 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
dd if="${RELEASE_DIR}/3rdparty/bootloader/trust.img" of="${DISK}" bs=512 seek=24576 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||||
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/resource.img" ]; then
|
elif [ -f "${RELEASE_DIR}/3rdparty/bootloader/resource.img" ]; then
|
||||||
echo "image: burn resource.img to image..."
|
echo "image: burn resource.img to image..."
|
||||||
dd if="${RELEASE_DIR}/3rdparty/bootloader/resource.img" of="${DISK}" bs=512 seek=24576 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
dd if="${RELEASE_DIR}/3rdparty/bootloader/resource.img" of="${DISK}" bs=512 seek=24576 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
rk3399)
|
||||||
|
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/rk3399-uboot.bin" ]; then
|
||||||
|
echo "image: burn u-boot.bin to image..."
|
||||||
|
dd if="${RELEASE_DIR}/3rdparty/bootloader/rk3399-uboot.bin" of="${DISK}" bs=512 seek=64 conv=sync,noerror,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/uboot.img" ]; then
|
if [ -f "${RELEASE_DIR}/3rdparty/bootloader/uboot.img" ]; then
|
||||||
|
|
|
@ -18,6 +18,11 @@ if [ -n "${UBOOT_CONFIG}" ]; then
|
||||||
cp -a ${KERNEL_DIR}/resource.img ${RELEASE_DIR}/3rdparty/bootloader
|
cp -a ${KERNEL_DIR}/resource.img ${RELEASE_DIR}/3rdparty/bootloader
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
rk3399)
|
||||||
|
if [ -f ${BOOTLOADER_DIR}/rk3399-uboot.bin ]; then
|
||||||
|
cp -a ${BOOTLOADER_DIR}/rk3399-uboot.bin ${RELEASE_DIR}/3rdparty/bootloader
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if [ -f ${BOOTLOADER_DIR}/uboot.img ]; then
|
if [ -f ${BOOTLOADER_DIR}/uboot.img ]; then
|
||||||
cp -a ${BOOTLOADER_DIR}/uboot.img ${RELEASE_DIR}/3rdparty/bootloader
|
cp -a ${BOOTLOADER_DIR}/uboot.img ${RELEASE_DIR}/3rdparty/bootloader
|
||||||
|
|
|
@ -3,62 +3,74 @@
|
||||||
# Copyright (C) 2017-2021 Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2017-2021 Team LibreELEC (https://libreelec.tv)
|
||||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||||
|
|
||||||
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
|
|
||||||
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
|
if [ -z "${1}" ]
|
||||||
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
|
then
|
||||||
if [ -z "$BOOT_DISK" ]; then
|
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
|
||||||
case $BOOT_PART in
|
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
|
||||||
/dev/sd[a-z][0-9]*)
|
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
|
||||||
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
|
if [ -z "$BOOT_DISK" ]; then
|
||||||
|
case $BOOT_PART in
|
||||||
|
/dev/sd[a-z][0-9]*)
|
||||||
|
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
|
||||||
|
;;
|
||||||
|
/dev/mmcblk*)
|
||||||
|
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# mount $BOOT_ROOT r/w
|
||||||
|
mount -o remount,rw $BOOT_ROOT
|
||||||
|
|
||||||
|
for arg in $(cat /proc/cmdline); do
|
||||||
|
case $arg in
|
||||||
|
boot=*)
|
||||||
|
boot="${arg#*=}"
|
||||||
|
case $boot in
|
||||||
|
/dev/mmc*)
|
||||||
|
UUID_SYSTEM="$(blkid $boot | sed 's/.* UUID="//;s/".*//g')"
|
||||||
|
;;
|
||||||
|
UUID=*|LABEL=*)
|
||||||
|
UUID_SYSTEM="$(blkid | sed 's/"//g' | grep -m 1 -i " $boot " | sed 's/.* UUID=//;s/ .*//g')"
|
||||||
|
;;
|
||||||
|
FOLDER=*)
|
||||||
|
UUID_SYSTEM="$(blkid ${boot#*=} | sed 's/.* UUID="//;s/".*//g')"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
/dev/mmcblk*)
|
disk=*)
|
||||||
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
|
disk="${arg#*=}"
|
||||||
|
case $disk in
|
||||||
|
/dev/mmc*)
|
||||||
|
UUID_STORAGE="$(blkid $disk | sed 's/.* UUID="//;s/".*//g')"
|
||||||
|
;;
|
||||||
|
UUID=*|LABEL=*)
|
||||||
|
UUID_STORAGE="$(blkid | sed 's/"//g' | grep -m 1 -i " $disk " | sed 's/.* UUID=//;s/ .*//g')"
|
||||||
|
;;
|
||||||
|
FOLDER=*)
|
||||||
|
UUID_STORAGE="$(blkid ${disk#*=} | sed 's/.* UUID="//;s/".*//g')"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
done
|
||||||
|
else
|
||||||
|
BOOT_DISK="${1}"
|
||||||
|
BOOT_ROOT="${2}"
|
||||||
|
UUID_SYSTEM="${3}"
|
||||||
|
UUID_STORAGE="${4}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# mount $BOOT_ROOT r/w
|
|
||||||
mount -o remount,rw $BOOT_ROOT
|
|
||||||
|
|
||||||
|
|
||||||
for arg in $(cat /proc/cmdline); do
|
|
||||||
case $arg in
|
|
||||||
boot=*)
|
|
||||||
boot="${arg#*=}"
|
|
||||||
case $boot in
|
|
||||||
/dev/mmc*)
|
|
||||||
UUID_SYSTEM="$(blkid $boot | sed 's/.* UUID="//;s/".*//g')"
|
|
||||||
;;
|
|
||||||
UUID=*|LABEL=*)
|
|
||||||
UUID_SYSTEM="$(blkid | sed 's/"//g' | grep -m 1 -i " $boot " | sed 's/.* UUID=//;s/ .*//g')"
|
|
||||||
;;
|
|
||||||
FOLDER=*)
|
|
||||||
UUID_SYSTEM="$(blkid ${boot#*=} | sed 's/.* UUID="//;s/".*//g')"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
disk=*)
|
|
||||||
disk="${arg#*=}"
|
|
||||||
case $disk in
|
|
||||||
/dev/mmc*)
|
|
||||||
UUID_STORAGE="$(blkid $disk | sed 's/.* UUID="//;s/".*//g')"
|
|
||||||
;;
|
|
||||||
UUID=*|LABEL=*)
|
|
||||||
UUID_STORAGE="$(blkid | sed 's/"//g' | grep -m 1 -i " $disk " | sed 's/.* UUID=//;s/ .*//g')"
|
|
||||||
;;
|
|
||||||
FOLDER=*)
|
|
||||||
UUID_STORAGE="$(blkid ${disk#*=} | sed 's/.* UUID="//;s/".*//g')"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
CONFS=$SYSTEM_ROOT/usr/share/bootloader/extlinux/*.conf
|
CONFS=$SYSTEM_ROOT/usr/share/bootloader/extlinux/*.conf
|
||||||
|
|
||||||
for all_conf in $CONFS; do
|
for all_conf in $CONFS; do
|
||||||
conf="$(basename ${all_conf})"
|
conf="$(basename ${all_conf})"
|
||||||
echo "Updating ${conf}..."
|
echo "Updating ${conf}..."
|
||||||
|
if [ ! -d "${BOOT_ROOT}/extlinux" ]
|
||||||
|
then
|
||||||
|
mkdir "${BOOT_ROOT}/extlinux"
|
||||||
|
fi
|
||||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/extlinux/${conf} $BOOT_ROOT/extlinux/${conf} &>/dev/null
|
cp -p $SYSTEM_ROOT/usr/share/bootloader/extlinux/${conf} $BOOT_ROOT/extlinux/${conf} &>/dev/null
|
||||||
sed -e "s/@UUID_SYSTEM@/${UUID_SYSTEM}/" \
|
sed -e "s/@UUID_SYSTEM@/${UUID_SYSTEM}/" \
|
||||||
-e "s/@UUID_STORAGE@/${UUID_STORAGE}/" \
|
-e "s/@UUID_STORAGE@/${UUID_STORAGE}/" \
|
||||||
|
@ -105,6 +117,11 @@ if [ -f $SYSTEM_ROOT/usr/share/bootloader/uboot.img ]; then
|
||||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/uboot.img of=$BOOT_DISK bs=512 seek=16384 conv=fsync &>/dev/null
|
dd if=$SYSTEM_ROOT/usr/share/bootloader/uboot.img of=$BOOT_DISK bs=512 seek=16384 conv=fsync &>/dev/null
|
||||||
echo "done"
|
echo "done"
|
||||||
fi
|
fi
|
||||||
|
if [ -f $SYSTEM_ROOT/usr/share/bootloader/rk3399-uboot.bin ]; then
|
||||||
|
echo -n "Updating uboot.bin... "
|
||||||
|
dd if=$SYSTEM_ROOT/usr/share/bootloader/rk3399-uboot.bin of=$BOOT_DISK bs=512 seek=64 conv=fsync &>/dev/null
|
||||||
|
echo "done"
|
||||||
|
fi
|
||||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/u-boot.itb ]; then
|
if [ -f $SYSTEM_ROOT/usr/share/bootloader/u-boot.itb ]; then
|
||||||
echo -n "Updating uboot.itb... "
|
echo -n "Updating uboot.itb... "
|
||||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot.itb of=$BOOT_DISK bs=512 seek=16384 conv=fsync &>/dev/null
|
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot.itb of=$BOOT_DISK bs=512 seek=16384 conv=fsync &>/dev/null
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -32,11 +32,13 @@
|
||||||
PARTITION_TABLE="msdos"
|
PARTITION_TABLE="msdos"
|
||||||
DEVICE_DTB=("rk3399-anbernic-rg552")
|
DEVICE_DTB=("rk3399-anbernic-rg552")
|
||||||
UBOOT_DTB="${DEVICE_DTB[0]}"
|
UBOOT_DTB="${DEVICE_DTB[0]}"
|
||||||
|
UBOOT_FIT_IMAGE="rk3399-uboot.bin"
|
||||||
UBOOT_CONFIG="evb-rk3399_defconfig"
|
UBOOT_CONFIG="evb-rk3399_defconfig"
|
||||||
PKG_SOC="rk3399"
|
PKG_SOC="rk3399"
|
||||||
|
ATF_PLATFORM="${PKG_SOC}"
|
||||||
PKG_DATAFILE="$PKG_RKBIN/bin/rk33/rk3399_ddr_933MHz_v1.30.bin"
|
PKG_DATAFILE="$PKG_RKBIN/bin/rk33/rk3399_ddr_933MHz_v1.30.bin"
|
||||||
PKG_LOADER="$PKG_RKBIN/bin/rk33/rk3399_miniloader_v1.26.bin"
|
PKG_LOADER="$PKG_RKBIN/bin/rk33/rk3399_miniloader_v1.26.bin"
|
||||||
PKG_BL31="$PKG_RKBIN/bin/rk33/rk3399_bl31_v1.36.elf"
|
ATF_BL31_BINARY="bl31/bl31.elf"
|
||||||
BOOT_INI=false
|
BOOT_INI=false
|
||||||
EXT_LINUX_CONF=true
|
EXT_LINUX_CONF=true
|
||||||
|
|
||||||
|
|
|
@ -150,6 +150,9 @@
|
||||||
# swapfile size if SWAP_SUPPORT=yes in MB
|
# swapfile size if SWAP_SUPPORT=yes in MB
|
||||||
SWAPFILESIZE="384"
|
SWAPFILESIZE="384"
|
||||||
|
|
||||||
|
# Some devices have internal storage.
|
||||||
|
INSTALLER_SUPPORT="yes"
|
||||||
|
|
||||||
# cron support (yes / no)
|
# cron support (yes / no)
|
||||||
CRON_SUPPORT="no"
|
CRON_SUPPORT="no"
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,9 @@
|
||||||
# build with swap support (yes / no)
|
# build with swap support (yes / no)
|
||||||
SWAP_SUPPORT="yes"
|
SWAP_SUPPORT="yes"
|
||||||
|
|
||||||
|
# Some devices have internal storage.
|
||||||
|
INSTALLER_SUPPORT="yes"
|
||||||
|
|
||||||
# swap support enabled per default (yes / no)
|
# swap support enabled per default (yes / no)
|
||||||
SWAP_ENABLED_DEFAULT="yes"
|
SWAP_ENABLED_DEFAULT="yes"
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,9 @@
|
||||||
# swapfile size if SWAP_SUPPORT=yes in MB
|
# swapfile size if SWAP_SUPPORT=yes in MB
|
||||||
SWAPFILESIZE="384"
|
SWAPFILESIZE="384"
|
||||||
|
|
||||||
|
# Some devices have internal storage.
|
||||||
|
INSTALLER_SUPPORT="yes"
|
||||||
|
|
||||||
# cron support (yes / no)
|
# cron support (yes / no)
|
||||||
CRON_SUPPORT="no"
|
CRON_SUPPORT="no"
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,14 @@ case ${DEVICE} in
|
||||||
PKG_GIT_CLONE_BRANCH="main"
|
PKG_GIT_CLONE_BRANCH="main"
|
||||||
;;
|
;;
|
||||||
RK356*)
|
RK356*)
|
||||||
PKG_VERSION="6.7-rc8"
|
PKG_VERSION="6.7"
|
||||||
PKG_URL="https://git.kernel.org/torvalds/t/${PKG_NAME}-${PKG_VERSION}.tar.gz"
|
PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||||
;;
|
;;
|
||||||
RK33*)
|
RK3399)
|
||||||
|
PKG_VERSION="6.7"
|
||||||
|
PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||||
|
;;
|
||||||
|
RK3326)
|
||||||
PKG_VERSION="6.1.70"
|
PKG_VERSION="6.1.70"
|
||||||
PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||||
;;
|
;;
|
||||||
|
@ -174,6 +178,7 @@ make_target() {
|
||||||
NO_GTK2=1 \
|
NO_GTK2=1 \
|
||||||
NO_LIBNUMA=1 \
|
NO_LIBNUMA=1 \
|
||||||
NO_LIBAUDIT=1 \
|
NO_LIBAUDIT=1 \
|
||||||
|
NO_LIBTRACEEVENT=1 \
|
||||||
NO_LZMA=1 \
|
NO_LZMA=1 \
|
||||||
NO_SDT=1 \
|
NO_SDT=1 \
|
||||||
NO_LIBTRACEEVENT=1 \
|
NO_LIBTRACEEVENT=1 \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/Makefile linux/arch/arm64/boot/dts/rockchip/Makefile
|
diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/Makefile linux/arch/arm64/boot/dts/rockchip/Makefile
|
||||||
--- linux.orig/arch/arm64/boot/dts/rockchip/Makefile 2024-01-02 16:20:12.766155041 +0000
|
--- linux.orig/arch/arm64/boot/dts/rockchip/Makefile 2024-01-09 14:07:11.858381650 +0000
|
||||||
+++ linux/arch/arm64/boot/dts/rockchip/Makefile 2024-01-02 21:22:52.154473211 +0000
|
+++ linux/arch/arm64/boot/dts/rockchip/Makefile 2024-01-09 18:09:58.589953944 +0000
|
||||||
@@ -21,6 +21,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-li
|
@@ -29,6 +29,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-li
|
||||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-orion-r68-meta.dtb
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-orion-r68-meta.dtb
|
||||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-px5-evb.dtb
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-px5-evb.dtb
|
||||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-r88.dtb
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-r88.dtb
|
||||||
|
@ -11,8 +11,8 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/Makefile linux/arch/arm64/boo
|
||||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-ficus.dtb
|
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-ficus.dtb
|
||||||
diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts linux/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts
|
diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts linux/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts
|
||||||
--- linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts 1970-01-01 00:00:00.000000000 +0000
|
--- linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ linux/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts 2024-01-02 22:48:46.115043990 +0000
|
+++ linux/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts 2024-01-09 18:09:58.589953944 +0000
|
||||||
@@ -0,0 +1,1329 @@
|
@@ -0,0 +1,1336 @@
|
||||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||||
+/*
|
+/*
|
||||||
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
|
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
|
||||||
|
@ -265,7 +265,7 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts lin
|
||||||
+ };
|
+ };
|
||||||
+
|
+
|
||||||
+ };
|
+ };
|
||||||
+
|
+
|
||||||
+ es8316-sound {
|
+ es8316-sound {
|
||||||
+ compatible = "simple-audio-card";
|
+ compatible = "simple-audio-card";
|
||||||
+ pinctrl-names = "default";
|
+ pinctrl-names = "default";
|
||||||
|
@ -310,7 +310,7 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts lin
|
||||||
+ hdmi-sound {
|
+ hdmi-sound {
|
||||||
+ status = "okay";
|
+ status = "okay";
|
||||||
+ };
|
+ };
|
||||||
+
|
+
|
||||||
+ fan: pwm-fan {
|
+ fan: pwm-fan {
|
||||||
+ compatible = "pwm-fan";
|
+ compatible = "pwm-fan";
|
||||||
+ pwms = <&pwm1 0 10000 1>;
|
+ pwms = <&pwm1 0 10000 1>;
|
||||||
|
@ -408,6 +408,17 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts lin
|
||||||
+ vin-supply = <&vcc12v_dcin>;
|
+ vin-supply = <&vcc12v_dcin>;
|
||||||
+ };
|
+ };
|
||||||
+
|
+
|
||||||
|
+ /* switched by pmic_sleep */
|
||||||
|
+ vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
|
||||||
|
+ compatible = "regulator-fixed";
|
||||||
|
+ regulator-name = "vcc1v8_s3";
|
||||||
|
+ regulator-always-on;
|
||||||
|
+ regulator-boot-on;
|
||||||
|
+ regulator-min-microvolt = <1800000>;
|
||||||
|
+ regulator-max-microvolt = <1800000>;
|
||||||
|
+ vin-supply = <&vcc_1v8>;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
+ vcc3v3_sys: vcc3v3-sys {
|
+ vcc3v3_sys: vcc3v3-sys {
|
||||||
+ compatible = "regulator-fixed";
|
+ compatible = "regulator-fixed";
|
||||||
+ regulator-name = "vcc3v3_sys";
|
+ regulator-name = "vcc3v3_sys";
|
||||||
|
@ -617,10 +628,6 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts lin
|
||||||
+ cpu-supply = <&vdd_cpu_b>;
|
+ cpu-supply = <&vdd_cpu_b>;
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+&saradc {
|
|
||||||
+ status = "okay";
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+&sdio0 {
|
+&sdio0 {
|
||||||
+ clock-frequency = <150000000>;
|
+ clock-frequency = <150000000>;
|
||||||
+ clock-freq-min-max = <100000 150000000>;
|
+ clock-freq-min-max = <100000 150000000>;
|
||||||
|
@ -684,7 +691,7 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts lin
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+&saradc {
|
+&saradc {
|
||||||
+ vref-supply = <&vcc_1v8>;
|
+ vref-supply = <&vcca1v8_s3>;
|
||||||
+ status = "okay";
|
+ status = "okay";
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
|
@ -1196,7 +1203,7 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts lin
|
||||||
+
|
+
|
||||||
+ btns {
|
+ btns {
|
||||||
+ btn_pins: btn-pins {
|
+ btn_pins: btn-pins {
|
||||||
+ rockchip,pins =
|
+ rockchip,pins =
|
||||||
+ <3 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>,
|
+ <3 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>,
|
||||||
+ <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>,
|
+ <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>,
|
||||||
+ <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>,
|
+ <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>,
|
||||||
|
|
|
@ -1,6 +1,52 @@
|
||||||
|
diff -rupN linux.orig/drivers/gpio/gpiolib-of.c linux/drivers/gpio/gpiolib-of.c
|
||||||
|
--- linux.orig/drivers/gpio/gpiolib-of.c 2024-01-08 18:42:48.903867377 +0000
|
||||||
|
+++ linux/drivers/gpio/gpiolib-of.c 2024-01-08 18:46:49.713063075 +0000
|
||||||
|
@@ -25,21 +25,6 @@
|
||||||
|
#include "gpiolib.h"
|
||||||
|
#include "gpiolib-of.h"
|
||||||
|
|
||||||
|
-/*
|
||||||
|
- * This is Linux-specific flags. By default controllers' and Linux' mapping
|
||||||
|
- * match, but GPIO controllers are free to translate their own flags to
|
||||||
|
- * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
|
||||||
|
- */
|
||||||
|
-enum of_gpio_flags {
|
||||||
|
- OF_GPIO_ACTIVE_LOW = 0x1,
|
||||||
|
- OF_GPIO_SINGLE_ENDED = 0x2,
|
||||||
|
- OF_GPIO_OPEN_DRAIN = 0x4,
|
||||||
|
- OF_GPIO_TRANSITORY = 0x8,
|
||||||
|
- OF_GPIO_PULL_UP = 0x10,
|
||||||
|
- OF_GPIO_PULL_DOWN = 0x20,
|
||||||
|
- OF_GPIO_PULL_DISABLE = 0x40,
|
||||||
|
-};
|
||||||
|
-
|
||||||
|
/**
|
||||||
|
* of_gpio_named_count() - Count GPIOs for a device
|
||||||
|
* @np: device node to count GPIOs for
|
||||||
|
@@ -398,6 +383,20 @@ out:
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
+int of_get_named_gpio_flags(const struct device_node *np, const char *list_name,
|
||||||
|
+ int index, enum of_gpio_flags *flags)
|
||||||
|
+{
|
||||||
|
+ struct gpio_desc *desc;
|
||||||
|
+
|
||||||
|
+ desc = of_get_named_gpiod_flags(np, list_name, index, flags);
|
||||||
|
+
|
||||||
|
+ if (IS_ERR(desc))
|
||||||
|
+ return PTR_ERR(desc);
|
||||||
|
+ else
|
||||||
|
+ return desc_to_gpio(desc);
|
||||||
|
+}
|
||||||
|
+EXPORT_SYMBOL_GPL(of_get_named_gpio_flags);
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* of_get_named_gpio() - Get a GPIO number to use with GPIO API
|
||||||
|
* @np: device node to get GPIO from
|
||||||
diff -rupN linux.orig/drivers/input/Kconfig linux/drivers/input/Kconfig
|
diff -rupN linux.orig/drivers/input/Kconfig linux/drivers/input/Kconfig
|
||||||
--- linux.orig/drivers/input/Kconfig 2023-12-15 19:18:57.320911751 +0000
|
--- linux.orig/drivers/input/Kconfig 2024-01-08 18:42:49.679884040 +0000
|
||||||
+++ linux/drivers/input/Kconfig 2023-12-15 19:20:05.987107578 +0000
|
+++ linux/drivers/input/Kconfig 2024-01-08 18:43:42.593020626 +0000
|
||||||
@@ -51,6 +51,19 @@ config INPUT_FF_MEMLESS
|
@@ -51,6 +51,19 @@ config INPUT_FF_MEMLESS
|
||||||
To compile this driver as a module, choose M here: the
|
To compile this driver as a module, choose M here: the
|
||||||
module will be called ff-memless.
|
module will be called ff-memless.
|
||||||
|
@ -22,8 +68,8 @@ diff -rupN linux.orig/drivers/input/Kconfig linux/drivers/input/Kconfig
|
||||||
tristate "Sparse keymap support library"
|
tristate "Sparse keymap support library"
|
||||||
help
|
help
|
||||||
diff -rupN linux.orig/drivers/input/Makefile linux/drivers/input/Makefile
|
diff -rupN linux.orig/drivers/input/Makefile linux/drivers/input/Makefile
|
||||||
--- linux.orig/drivers/input/Makefile 2023-12-15 19:18:57.320911751 +0000
|
--- linux.orig/drivers/input/Makefile 2024-01-08 18:42:49.679884040 +0000
|
||||||
+++ linux/drivers/input/Makefile 2023-12-15 19:20:05.987107578 +0000
|
+++ linux/drivers/input/Makefile 2024-01-08 18:43:42.593020626 +0000
|
||||||
@@ -10,6 +10,7 @@ input-core-y := input.o input-compat.o i
|
@@ -10,6 +10,7 @@ input-core-y := input.o input-compat.o i
|
||||||
input-core-y += touchscreen.o
|
input-core-y += touchscreen.o
|
||||||
|
|
||||||
|
@ -34,7 +80,7 @@ diff -rupN linux.orig/drivers/input/Makefile linux/drivers/input/Makefile
|
||||||
obj-$(CONFIG_INPUT_VIVALDIFMAP) += vivaldi-fmap.o
|
obj-$(CONFIG_INPUT_VIVALDIFMAP) += vivaldi-fmap.o
|
||||||
diff -rupN linux.orig/drivers/input/input-polldev.c linux/drivers/input/input-polldev.c
|
diff -rupN linux.orig/drivers/input/input-polldev.c linux/drivers/input/input-polldev.c
|
||||||
--- linux.orig/drivers/input/input-polldev.c 1970-01-01 00:00:00.000000000 +0000
|
--- linux.orig/drivers/input/input-polldev.c 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ linux/drivers/input/input-polldev.c 2023-12-15 19:20:05.987107578 +0000
|
+++ linux/drivers/input/input-polldev.c 2024-01-08 18:43:42.593020626 +0000
|
||||||
@@ -0,0 +1,362 @@
|
@@ -0,0 +1,362 @@
|
||||||
+// SPDX-License-Identifier: GPL-2.0-only
|
+// SPDX-License-Identifier: GPL-2.0-only
|
||||||
+/*
|
+/*
|
||||||
|
@ -399,8 +445,8 @@ diff -rupN linux.orig/drivers/input/input-polldev.c linux/drivers/input/input-po
|
||||||
+}
|
+}
|
||||||
+EXPORT_SYMBOL(input_unregister_polled_device);
|
+EXPORT_SYMBOL(input_unregister_polled_device);
|
||||||
diff -rupN linux.orig/drivers/input/joystick/Kconfig linux/drivers/input/joystick/Kconfig
|
diff -rupN linux.orig/drivers/input/joystick/Kconfig linux/drivers/input/joystick/Kconfig
|
||||||
--- linux.orig/drivers/input/joystick/Kconfig 2023-12-15 19:18:57.324911879 +0000
|
--- linux.orig/drivers/input/joystick/Kconfig 2024-01-08 18:42:49.679884040 +0000
|
||||||
+++ linux/drivers/input/joystick/Kconfig 2023-12-15 19:20:05.987107578 +0000
|
+++ linux/drivers/input/joystick/Kconfig 2024-01-08 18:43:42.593020626 +0000
|
||||||
@@ -393,6 +393,12 @@ config JOYSTICK_FSIA6B
|
@@ -393,6 +393,12 @@ config JOYSTICK_FSIA6B
|
||||||
To compile this driver as a module, choose M here: the
|
To compile this driver as a module, choose M here: the
|
||||||
module will be called fsia6b.
|
module will be called fsia6b.
|
||||||
|
@ -415,8 +461,8 @@ diff -rupN linux.orig/drivers/input/joystick/Kconfig linux/drivers/input/joystic
|
||||||
bool "N64 controller"
|
bool "N64 controller"
|
||||||
depends on MACH_NINTENDO64
|
depends on MACH_NINTENDO64
|
||||||
diff -rupN linux.orig/drivers/input/joystick/Makefile linux/drivers/input/joystick/Makefile
|
diff -rupN linux.orig/drivers/input/joystick/Makefile linux/drivers/input/joystick/Makefile
|
||||||
--- linux.orig/drivers/input/joystick/Makefile 2023-12-15 19:18:57.324911879 +0000
|
--- linux.orig/drivers/input/joystick/Makefile 2024-01-08 18:42:49.679884040 +0000
|
||||||
+++ linux/drivers/input/joystick/Makefile 2023-12-15 19:20:05.987107578 +0000
|
+++ linux/drivers/input/joystick/Makefile 2024-01-08 18:43:42.593020626 +0000
|
||||||
@@ -30,6 +30,7 @@ obj-$(CONFIG_JOYSTICK_PXRC) += pxrc.o
|
@@ -30,6 +30,7 @@ obj-$(CONFIG_JOYSTICK_PXRC) += pxrc.o
|
||||||
obj-$(CONFIG_JOYSTICK_QWIIC) += qwiic-joystick.o
|
obj-$(CONFIG_JOYSTICK_QWIIC) += qwiic-joystick.o
|
||||||
obj-$(CONFIG_JOYSTICK_SENSEHAT) += sensehat-joystick.o
|
obj-$(CONFIG_JOYSTICK_SENSEHAT) += sensehat-joystick.o
|
||||||
|
@ -427,8 +473,8 @@ diff -rupN linux.orig/drivers/input/joystick/Makefile linux/drivers/input/joysti
|
||||||
obj-$(CONFIG_JOYSTICK_STINGER) += stinger.o
|
obj-$(CONFIG_JOYSTICK_STINGER) += stinger.o
|
||||||
diff -rupN linux.orig/drivers/input/joystick/singleadcjoy.c linux/drivers/input/joystick/singleadcjoy.c
|
diff -rupN linux.orig/drivers/input/joystick/singleadcjoy.c linux/drivers/input/joystick/singleadcjoy.c
|
||||||
--- linux.orig/drivers/input/joystick/singleadcjoy.c 1970-01-01 00:00:00.000000000 +0000
|
--- linux.orig/drivers/input/joystick/singleadcjoy.c 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ linux/drivers/input/joystick/singleadcjoy.c 2023-12-15 19:36:26.739762439 +0000
|
+++ linux/drivers/input/joystick/singleadcjoy.c 2024-01-08 18:43:54.081267482 +0000
|
||||||
@@ -0,0 +1,1416 @@
|
@@ -0,0 +1,1448 @@
|
||||||
+/*----------------------------------------------------------------------------*/
|
+/*----------------------------------------------------------------------------*/
|
||||||
+
|
+
|
||||||
+/*
|
+/*
|
||||||
|
@ -1162,35 +1208,67 @@ diff -rupN linux.orig/drivers/input/joystick/singleadcjoy.c linux/drivers/input/
|
||||||
+{
|
+{
|
||||||
+ struct joypad *joypad = poll_dev->private;
|
+ struct joypad *joypad = poll_dev->private;
|
||||||
+ int nbtn;
|
+ int nbtn;
|
||||||
|
+ int mag;
|
||||||
+
|
+
|
||||||
+ for (nbtn = 0; nbtn < joypad->amux_count; nbtn++) {
|
+ /* Assumes an even number of axes and that joystick axis pairs are sequential */
|
||||||
+ struct bt_adc *adc = &joypad->adcs[nbtn];
|
+ /* e.g. left stick Y immediately follows left stick X */
|
||||||
|
+ for (nbtn = 0; nbtn < joypad->amux_count; nbtn+=2) {
|
||||||
|
+ struct bt_adc *adcx = &joypad->adcs[nbtn];
|
||||||
|
+ struct bt_adc *adcy = &joypad->adcs[nbtn + 1];
|
||||||
+
|
+
|
||||||
+ adc->value = joypad_adc_read(joypad->amux, adc);
|
+ /* Read first joystick axis */
|
||||||
+ if (!adc->value) {
|
+ adcx->value = joypad_adc_read(joypad->amux, adcx);
|
||||||
|
+ if (!adcx->value) {
|
||||||
+ //dev_err(joypad->dev, "%s : saradc channels[%d]! adc->value : %d\n",__func__, nbtn, adc->value);
|
+ //dev_err(joypad->dev, "%s : saradc channels[%d]! adc->value : %d\n",__func__, nbtn, adc->value);
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ adc->value = adc->value - adc->cal;
|
+ adcx->value = adcx->value - adcx->cal;
|
||||||
|
+
|
||||||
|
+ /* Read second joystick axis */
|
||||||
|
+ adcy->value = joypad_adc_read(joypad->amux, adcy);
|
||||||
|
+ if (!adcy->value) {
|
||||||
|
+ //dev_err(joypad->dev, "%s : saradc channels[%d]! adc->value : %d\n",__func__, nbtn, adc->value);
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ adcy->value = adcy->value - adcy->cal;
|
||||||
+
|
+
|
||||||
+ /* Joystick Deadzone check */
|
+ /* Joystick Deadzone check */
|
||||||
|
+ mag = int_sqrt((adcx->value * adcx->value) + (adcy->value * adcy->value));
|
||||||
+ if (joypad->bt_adc_deadzone) {
|
+ if (joypad->bt_adc_deadzone) {
|
||||||
+ if (abs(adc->value) < joypad->bt_adc_deadzone)
|
+ if (mag <= joypad->bt_adc_deadzone) {
|
||||||
+ adc->value = 0;
|
+ adcx->value = 0;
|
||||||
|
+ adcy->value = 0;
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ /* Assumes adcx->max == -adcx->min == adcy->max == -adcy->min */
|
||||||
|
+ /* Order of operations is critical to avoid integer overflow */
|
||||||
|
+ adcx->value = (((adcx->max * adcx->value) / mag) * (mag - joypad->bt_adc_deadzone)) / (adcx->max - joypad->bt_adc_deadzone);
|
||||||
|
+ adcy->value = (((adcy->max * adcy->value) / mag) * (mag - joypad->bt_adc_deadzone)) / (adcy->max - joypad->bt_adc_deadzone);
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* adc data tuning */
|
+ /* adc data tuning */
|
||||||
+ if (adc->tuning_n && adc->value < 0)
|
+ if (adcx->tuning_n && adcx->value < 0)
|
||||||
+ adc->value = ADC_DATA_TUNING(adc->value, adc->tuning_n);
|
+ adcx->value = ADC_DATA_TUNING(adcx->value, adcx->tuning_n);
|
||||||
+ if (adc->tuning_p && adc->value > 0)
|
+ if (adcx->tuning_p && adcx->value > 0)
|
||||||
+ adc->value = ADC_DATA_TUNING(adc->value, adc->tuning_p);
|
+ adcx->value = ADC_DATA_TUNING(adcx->value, adcx->tuning_p);
|
||||||
|
+ if (adcy->tuning_n && adcy->value < 0)
|
||||||
|
+ adcy->value = ADC_DATA_TUNING(adcy->value, adcy->tuning_n);
|
||||||
|
+ if (adcy->tuning_p && adcy->value > 0)
|
||||||
|
+ adcy->value = ADC_DATA_TUNING(adcy->value, adcy->tuning_p);
|
||||||
+
|
+
|
||||||
+ adc->value = adc->value > adc->max ? adc->max : adc->value;
|
+ /* Clamp to [min, max] */
|
||||||
+ adc->value = adc->value < adc->min ? adc->min : adc->value;
|
+ adcx->value = adcx->value > adcx->max ? adcx->max : adcx->value;
|
||||||
|
+ adcx->value = adcx->value < adcx->min ? adcx->min : adcx->value;
|
||||||
|
+ adcy->value = adcy->value > adcy->max ? adcy->max : adcy->value;
|
||||||
|
+ adcy->value = adcy->value < adcy->min ? adcy->min : adcy->value;
|
||||||
+
|
+
|
||||||
+ input_report_abs(poll_dev->input,
|
+ input_report_abs(poll_dev->input,
|
||||||
+ adc->report_type,
|
+ adcx->report_type,
|
||||||
+ adc->invert ? adc->value * (-1) : adc->value);
|
+ adcx->invert ? adcx->value * (-1) : adcx->value);
|
||||||
|
+ input_report_abs(poll_dev->input,
|
||||||
|
+ adcy->report_type,
|
||||||
|
+ adcy->invert ? adcy->value * (-1) : adcy->value);
|
||||||
+ }
|
+ }
|
||||||
+ input_sync(poll_dev->input);
|
+ input_sync(poll_dev->input);
|
||||||
+}
|
+}
|
||||||
|
@ -1847,7 +1925,7 @@ diff -rupN linux.orig/drivers/input/joystick/singleadcjoy.c linux/drivers/input/
|
||||||
+module_exit(joypad_exit);
|
+module_exit(joypad_exit);
|
||||||
diff -rupN linux.orig/include/linux/input-polldev.h linux/include/linux/input-polldev.h
|
diff -rupN linux.orig/include/linux/input-polldev.h linux/include/linux/input-polldev.h
|
||||||
--- linux.orig/include/linux/input-polldev.h 1970-01-01 00:00:00.000000000 +0000
|
--- linux.orig/include/linux/input-polldev.h 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ linux/include/linux/input-polldev.h 2023-12-15 19:20:05.987107578 +0000
|
+++ linux/include/linux/input-polldev.h 2024-01-08 18:43:42.593020626 +0000
|
||||||
@@ -0,0 +1,58 @@
|
@@ -0,0 +1,58 @@
|
||||||
+/* SPDX-License-Identifier: GPL-2.0-only */
|
+/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
+#ifndef _INPUT_POLLDEV_H
|
+#ifndef _INPUT_POLLDEV_H
|
||||||
|
@ -1907,3 +1985,65 @@ diff -rupN linux.orig/include/linux/input-polldev.h linux/include/linux/input-po
|
||||||
+void input_unregister_polled_device(struct input_polled_dev *dev);
|
+void input_unregister_polled_device(struct input_polled_dev *dev);
|
||||||
+
|
+
|
||||||
+#endif
|
+#endif
|
||||||
|
diff -rupN linux.orig/include/linux/of_gpio.h linux/include/linux/of_gpio.h
|
||||||
|
--- linux.orig/include/linux/of_gpio.h 2024-01-08 18:42:51.555924323 +0000
|
||||||
|
+++ linux/include/linux/of_gpio.h 2024-01-08 19:08:52.942972824 +0000
|
||||||
|
@@ -17,8 +17,26 @@
|
||||||
|
|
||||||
|
struct device_node;
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * This is Linux-specific flags. By default controllers' and Linux' mapping
|
||||||
|
+ * match, but GPIO controllers are free to translate their own flags to
|
||||||
|
+ * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
|
||||||
|
+ */
|
||||||
|
+enum of_gpio_flags {
|
||||||
|
+ OF_GPIO_ACTIVE_LOW = 0x1,
|
||||||
|
+ OF_GPIO_SINGLE_ENDED = 0x2,
|
||||||
|
+ OF_GPIO_OPEN_DRAIN = 0x4,
|
||||||
|
+ OF_GPIO_TRANSITORY = 0x8,
|
||||||
|
+ OF_GPIO_PULL_UP = 0x10,
|
||||||
|
+ OF_GPIO_PULL_DOWN = 0x20,
|
||||||
|
+ OF_GPIO_PULL_DISABLE = 0x40,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
#ifdef CONFIG_OF_GPIO
|
||||||
|
|
||||||
|
+extern int of_get_named_gpio_flags(const struct device_node *np,
|
||||||
|
+ const char *list_name, int index, enum of_gpio_flags *flags);
|
||||||
|
+
|
||||||
|
extern int of_get_named_gpio(const struct device_node *np,
|
||||||
|
const char *list_name, int index);
|
||||||
|
|
||||||
|
@@ -26,13 +44,30 @@ extern int of_get_named_gpio(const struc
|
||||||
|
|
||||||
|
#include <linux/errno.h>
|
||||||
|
|
||||||
|
-/* Drivers may not strictly depend on the GPIO support, so let them link. */
|
||||||
|
static inline int of_get_named_gpio(const struct device_node *np,
|
||||||
|
const char *propname, int index)
|
||||||
|
{
|
||||||
|
+ return -ENOSYS;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* Drivers may not strictly depend on the GPIO support, so let them link. */
|
||||||
|
+static inline int of_get_named_gpio_flags(const struct device_node *np,
|
||||||
|
+ const char *list_name, int index, enum of_gpio_flags *flags)
|
||||||
|
+{
|
||||||
|
+ if (flags)
|
||||||
|
+ *flags = 0;
|
||||||
|
+
|
||||||
|
return -ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_OF_GPIO */
|
||||||
|
|
||||||
|
+static inline int of_get_gpio_flags(const struct device_node *np, int index,
|
||||||
|
+ enum of_gpio_flags *flags)
|
||||||
|
+{
|
||||||
|
+ return of_get_named_gpio_flags(np, "gpios", index, flags);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+//#endif /* CONFIG_OF_GPIO */
|
||||||
|
+
|
||||||
|
#endif /* __LINUX_OF_GPIO_H */
|
||||||
|
|
|
@ -1,100 +0,0 @@
|
||||||
From c731e0b23383c8b451932331f22122afe04348bd Mon Sep 17 00:00:00 2001
|
|
||||||
From: Johnny on Flame <johnnyonflame@hotmail.com>
|
|
||||||
Date: Fri, 3 Nov 2023 04:53:33 +0000
|
|
||||||
Subject: [PATCH] Port radial thresholding from @littleguy77.
|
|
||||||
|
|
||||||
---
|
|
||||||
drivers/input/joystick/singleadcjoy.c | 64 ++++++++++++++++++++-------
|
|
||||||
1 file changed, 48 insertions(+), 16 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/drivers/input/joystick/singleadcjoy.c b/drivers/input/joystick/singleadcjoy.c
|
|
||||||
index f0a24a24a..455e11121 100644
|
|
||||||
--- a/drivers/input/joystick/singleadcjoy.c
|
|
||||||
+++ b/drivers/input/joystick/singleadcjoy.c
|
|
||||||
@@ -580,35 +580,67 @@ static void joypad_adc_check(struct input_polled_dev *poll_dev)
|
|
||||||
{
|
|
||||||
struct joypad *joypad = poll_dev->private;
|
|
||||||
int nbtn;
|
|
||||||
+ int mag;
|
|
||||||
|
|
||||||
- for (nbtn = 0; nbtn < joypad->amux_count; nbtn++) {
|
|
||||||
- struct bt_adc *adc = &joypad->adcs[nbtn];
|
|
||||||
+ /* Assumes an even number of axes and that joystick axis pairs are sequential */
|
|
||||||
+ /* e.g. left stick Y immediately follows left stick X */
|
|
||||||
+ for (nbtn = 0; nbtn < joypad->amux_count; nbtn+=2) {
|
|
||||||
+ struct bt_adc *adcx = &joypad->adcs[nbtn];
|
|
||||||
+ struct bt_adc *adcy = &joypad->adcs[nbtn + 1];
|
|
||||||
|
|
||||||
- adc->value = joypad_adc_read(joypad->amux, adc);
|
|
||||||
- if (!adc->value) {
|
|
||||||
+ /* Read first joystick axis */
|
|
||||||
+ adcx->value = joypad_adc_read(joypad->amux, adcx);
|
|
||||||
+ if (!adcx->value) {
|
|
||||||
+ //dev_err(joypad->dev, "%s : saradc channels[%d]! adc->value : %d\n",__func__, nbtn, adc->value);
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ adcx->value = adcx->value - adcx->cal;
|
|
||||||
+
|
|
||||||
+ /* Read second joystick axis */
|
|
||||||
+ adcy->value = joypad_adc_read(joypad->amux, adcy);
|
|
||||||
+ if (!adcy->value) {
|
|
||||||
//dev_err(joypad->dev, "%s : saradc channels[%d]! adc->value : %d\n",__func__, nbtn, adc->value);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
- adc->value = adc->value - adc->cal;
|
|
||||||
+ adcy->value = adcy->value - adcy->cal;
|
|
||||||
|
|
||||||
/* Joystick Deadzone check */
|
|
||||||
+ mag = int_sqrt((adcx->value * adcx->value) + (adcy->value * adcy->value));
|
|
||||||
if (joypad->bt_adc_deadzone) {
|
|
||||||
- if (abs(adc->value) < joypad->bt_adc_deadzone)
|
|
||||||
- adc->value = 0;
|
|
||||||
+ if (mag <= joypad->bt_adc_deadzone) {
|
|
||||||
+ adcx->value = 0;
|
|
||||||
+ adcy->value = 0;
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ /* Assumes adcx->max == -adcx->min == adcy->max == -adcy->min */
|
|
||||||
+ /* Order of operations is critical to avoid integer overflow */
|
|
||||||
+ adcx->value = (((adcx->max * adcx->value) / mag) * (mag - joypad->bt_adc_deadzone)) / (adcx->max - joypad->bt_adc_deadzone);
|
|
||||||
+ adcy->value = (((adcy->max * adcy->value) / mag) * (mag - joypad->bt_adc_deadzone)) / (adcy->max - joypad->bt_adc_deadzone);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* adc data tuning */
|
|
||||||
- if (adc->tuning_n && adc->value < 0)
|
|
||||||
- adc->value = ADC_DATA_TUNING(adc->value, adc->tuning_n);
|
|
||||||
- if (adc->tuning_p && adc->value > 0)
|
|
||||||
- adc->value = ADC_DATA_TUNING(adc->value, adc->tuning_p);
|
|
||||||
-
|
|
||||||
- adc->value = adc->value > adc->max ? adc->max : adc->value;
|
|
||||||
- adc->value = adc->value < adc->min ? adc->min : adc->value;
|
|
||||||
+ if (adcx->tuning_n && adcx->value < 0)
|
|
||||||
+ adcx->value = ADC_DATA_TUNING(adcx->value, adcx->tuning_n);
|
|
||||||
+ if (adcx->tuning_p && adcx->value > 0)
|
|
||||||
+ adcx->value = ADC_DATA_TUNING(adcx->value, adcx->tuning_p);
|
|
||||||
+ if (adcy->tuning_n && adcy->value < 0)
|
|
||||||
+ adcy->value = ADC_DATA_TUNING(adcy->value, adcy->tuning_n);
|
|
||||||
+ if (adcy->tuning_p && adcy->value > 0)
|
|
||||||
+ adcy->value = ADC_DATA_TUNING(adcy->value, adcy->tuning_p);
|
|
||||||
+
|
|
||||||
+ /* Clamp to [min, max] */
|
|
||||||
+ adcx->value = adcx->value > adcx->max ? adcx->max : adcx->value;
|
|
||||||
+ adcx->value = adcx->value < adcx->min ? adcx->min : adcx->value;
|
|
||||||
+ adcy->value = adcy->value > adcy->max ? adcy->max : adcy->value;
|
|
||||||
+ adcy->value = adcy->value < adcy->min ? adcy->min : adcy->value;
|
|
||||||
|
|
||||||
input_report_abs(poll_dev->input,
|
|
||||||
- adc->report_type,
|
|
||||||
- adc->invert ? adc->value * (-1) : adc->value);
|
|
||||||
+ adcx->report_type,
|
|
||||||
+ adcx->invert ? adcx->value * (-1) : adcx->value);
|
|
||||||
+ input_report_abs(poll_dev->input,
|
|
||||||
+ adcy->report_type,
|
|
||||||
+ adcy->invert ? adcy->value * (-1) : adcy->value);
|
|
||||||
}
|
|
||||||
input_sync(poll_dev->input);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
|
@ -0,0 +1,403 @@
|
||||||
|
diff -rupN linux.orig/drivers/iio/adc/rockchip_saradc.c linux/drivers/iio/adc/rockchip_saradc.c
|
||||||
|
--- linux.orig/drivers/iio/adc/rockchip_saradc.c 2024-01-09 14:07:12.430393829 +0000
|
||||||
|
+++ linux/drivers/iio/adc/rockchip_saradc.c 2024-01-09 16:30:43.561613614 +0000
|
||||||
|
@@ -4,13 +4,13 @@
|
||||||
|
* Copyright (C) 2014 ROCKCHIP, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
-#include <linux/bitfield.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/mutex.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
#include <linux/of.h>
|
||||||
|
+#include <linux/of_device.h>
|
||||||
|
#include <linux/clk.h>
|
||||||
|
#include <linux/completion.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
|
@@ -38,31 +38,10 @@
|
||||||
|
#define SARADC_TIMEOUT msecs_to_jiffies(100)
|
||||||
|
#define SARADC_MAX_CHANNELS 8
|
||||||
|
|
||||||
|
-/* v2 registers */
|
||||||
|
-#define SARADC2_CONV_CON 0x000
|
||||||
|
-#define SARADC_T_PD_SOC 0x004
|
||||||
|
-#define SARADC_T_DAS_SOC 0x00c
|
||||||
|
-#define SARADC2_END_INT_EN 0x104
|
||||||
|
-#define SARADC2_ST_CON 0x108
|
||||||
|
-#define SARADC2_STATUS 0x10c
|
||||||
|
-#define SARADC2_END_INT_ST 0x110
|
||||||
|
-#define SARADC2_DATA_BASE 0x120
|
||||||
|
-
|
||||||
|
-#define SARADC2_EN_END_INT BIT(0)
|
||||||
|
-#define SARADC2_START BIT(4)
|
||||||
|
-#define SARADC2_SINGLE_MODE BIT(5)
|
||||||
|
-
|
||||||
|
-#define SARADC2_CONV_CHANNELS GENMASK(15, 0)
|
||||||
|
-
|
||||||
|
-struct rockchip_saradc;
|
||||||
|
-
|
||||||
|
struct rockchip_saradc_data {
|
||||||
|
const struct iio_chan_spec *channels;
|
||||||
|
int num_channels;
|
||||||
|
unsigned long clk_rate;
|
||||||
|
- void (*start)(struct rockchip_saradc *info, int chn);
|
||||||
|
- int (*read)(struct rockchip_saradc *info);
|
||||||
|
- void (*power_down)(struct rockchip_saradc *info);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct rockchip_saradc {
|
||||||
|
@@ -81,81 +60,27 @@ struct rockchip_saradc {
|
||||||
|
struct notifier_block nb;
|
||||||
|
};
|
||||||
|
|
||||||
|
-static void rockchip_saradc_reset_controller(struct reset_control *reset);
|
||||||
|
-
|
||||||
|
-static void rockchip_saradc_start_v1(struct rockchip_saradc *info, int chn)
|
||||||
|
-{
|
||||||
|
- /* 8 clock periods as delay between power up and start cmd */
|
||||||
|
- writel_relaxed(8, info->regs + SARADC_DLY_PU_SOC);
|
||||||
|
- /* Select the channel to be used and trigger conversion */
|
||||||
|
- writel(SARADC_CTRL_POWER_CTRL | (chn & SARADC_CTRL_CHN_MASK) |
|
||||||
|
- SARADC_CTRL_IRQ_ENABLE, info->regs + SARADC_CTRL);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void rockchip_saradc_start_v2(struct rockchip_saradc *info, int chn)
|
||||||
|
-{
|
||||||
|
- int val;
|
||||||
|
-
|
||||||
|
- if (info->reset)
|
||||||
|
- rockchip_saradc_reset_controller(info->reset);
|
||||||
|
-
|
||||||
|
- writel_relaxed(0xc, info->regs + SARADC_T_DAS_SOC);
|
||||||
|
- writel_relaxed(0x20, info->regs + SARADC_T_PD_SOC);
|
||||||
|
- val = FIELD_PREP(SARADC2_EN_END_INT, 1);
|
||||||
|
- val |= val << 16;
|
||||||
|
- writel_relaxed(val, info->regs + SARADC2_END_INT_EN);
|
||||||
|
- val = FIELD_PREP(SARADC2_START, 1) |
|
||||||
|
- FIELD_PREP(SARADC2_SINGLE_MODE, 1) |
|
||||||
|
- FIELD_PREP(SARADC2_CONV_CHANNELS, chn);
|
||||||
|
- val |= val << 16;
|
||||||
|
- writel(val, info->regs + SARADC2_CONV_CON);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void rockchip_saradc_start(struct rockchip_saradc *info, int chn)
|
||||||
|
-{
|
||||||
|
- info->data->start(info, chn);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static int rockchip_saradc_read_v1(struct rockchip_saradc *info)
|
||||||
|
-{
|
||||||
|
- return readl_relaxed(info->regs + SARADC_DATA);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static int rockchip_saradc_read_v2(struct rockchip_saradc *info)
|
||||||
|
-{
|
||||||
|
- int offset;
|
||||||
|
-
|
||||||
|
- /* Clear irq */
|
||||||
|
- writel_relaxed(0x1, info->regs + SARADC2_END_INT_ST);
|
||||||
|
-
|
||||||
|
- offset = SARADC2_DATA_BASE + info->last_chan->channel * 0x4;
|
||||||
|
-
|
||||||
|
- return readl_relaxed(info->regs + offset);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static int rockchip_saradc_read(struct rockchip_saradc *info)
|
||||||
|
-{
|
||||||
|
- return info->data->read(info);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void rockchip_saradc_power_down_v1(struct rockchip_saradc *info)
|
||||||
|
-{
|
||||||
|
- writel_relaxed(0, info->regs + SARADC_CTRL);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
static void rockchip_saradc_power_down(struct rockchip_saradc *info)
|
||||||
|
{
|
||||||
|
- if (info->data->power_down)
|
||||||
|
- info->data->power_down(info);
|
||||||
|
+ /* Clear irq & power down adc */
|
||||||
|
+ writel_relaxed(0, info->regs + SARADC_CTRL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int rockchip_saradc_conversion(struct rockchip_saradc *info,
|
||||||
|
- struct iio_chan_spec const *chan)
|
||||||
|
+ struct iio_chan_spec const *chan)
|
||||||
|
{
|
||||||
|
reinit_completion(&info->completion);
|
||||||
|
|
||||||
|
+ /* 8 clock periods as delay between power up and start cmd */
|
||||||
|
+ writel_relaxed(8, info->regs + SARADC_DLY_PU_SOC);
|
||||||
|
+
|
||||||
|
info->last_chan = chan;
|
||||||
|
- rockchip_saradc_start(info, chan->channel);
|
||||||
|
+
|
||||||
|
+ /* Select the channel to be used and trigger conversion */
|
||||||
|
+ writel(SARADC_CTRL_POWER_CTRL
|
||||||
|
+ | (chan->channel & SARADC_CTRL_CHN_MASK)
|
||||||
|
+ | SARADC_CTRL_IRQ_ENABLE,
|
||||||
|
+ info->regs + SARADC_CTRL);
|
||||||
|
|
||||||
|
if (!wait_for_completion_timeout(&info->completion, SARADC_TIMEOUT))
|
||||||
|
return -ETIMEDOUT;
|
||||||
|
@@ -198,7 +123,7 @@ static irqreturn_t rockchip_saradc_isr(i
|
||||||
|
struct rockchip_saradc *info = dev_id;
|
||||||
|
|
||||||
|
/* Read value */
|
||||||
|
- info->last_val = rockchip_saradc_read(info);
|
||||||
|
+ info->last_val = readl_relaxed(info->regs + SARADC_DATA);
|
||||||
|
info->last_val &= GENMASK(info->last_chan->scan_type.realbits - 1, 0);
|
||||||
|
|
||||||
|
rockchip_saradc_power_down(info);
|
||||||
|
@@ -238,9 +163,6 @@ static const struct rockchip_saradc_data
|
||||||
|
.channels = rockchip_saradc_iio_channels,
|
||||||
|
.num_channels = ARRAY_SIZE(rockchip_saradc_iio_channels),
|
||||||
|
.clk_rate = 1000000,
|
||||||
|
- .start = rockchip_saradc_start_v1,
|
||||||
|
- .read = rockchip_saradc_read_v1,
|
||||||
|
- .power_down = rockchip_saradc_power_down_v1,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct iio_chan_spec rockchip_rk3066_tsadc_iio_channels[] = {
|
||||||
|
@@ -252,9 +174,6 @@ static const struct rockchip_saradc_data
|
||||||
|
.channels = rockchip_rk3066_tsadc_iio_channels,
|
||||||
|
.num_channels = ARRAY_SIZE(rockchip_rk3066_tsadc_iio_channels),
|
||||||
|
.clk_rate = 50000,
|
||||||
|
- .start = rockchip_saradc_start_v1,
|
||||||
|
- .read = rockchip_saradc_read_v1,
|
||||||
|
- .power_down = rockchip_saradc_power_down_v1,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct iio_chan_spec rockchip_rk3399_saradc_iio_channels[] = {
|
||||||
|
@@ -270,9 +189,6 @@ static const struct rockchip_saradc_data
|
||||||
|
.channels = rockchip_rk3399_saradc_iio_channels,
|
||||||
|
.num_channels = ARRAY_SIZE(rockchip_rk3399_saradc_iio_channels),
|
||||||
|
.clk_rate = 1000000,
|
||||||
|
- .start = rockchip_saradc_start_v1,
|
||||||
|
- .read = rockchip_saradc_read_v1,
|
||||||
|
- .power_down = rockchip_saradc_power_down_v1,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct iio_chan_spec rockchip_rk3568_saradc_iio_channels[] = {
|
||||||
|
@@ -290,28 +206,6 @@ static const struct rockchip_saradc_data
|
||||||
|
.channels = rockchip_rk3568_saradc_iio_channels,
|
||||||
|
.num_channels = ARRAY_SIZE(rockchip_rk3568_saradc_iio_channels),
|
||||||
|
.clk_rate = 1000000,
|
||||||
|
- .start = rockchip_saradc_start_v1,
|
||||||
|
- .read = rockchip_saradc_read_v1,
|
||||||
|
- .power_down = rockchip_saradc_power_down_v1,
|
||||||
|
-};
|
||||||
|
-
|
||||||
|
-static const struct iio_chan_spec rockchip_rk3588_saradc_iio_channels[] = {
|
||||||
|
- SARADC_CHANNEL(0, "adc0", 12),
|
||||||
|
- SARADC_CHANNEL(1, "adc1", 12),
|
||||||
|
- SARADC_CHANNEL(2, "adc2", 12),
|
||||||
|
- SARADC_CHANNEL(3, "adc3", 12),
|
||||||
|
- SARADC_CHANNEL(4, "adc4", 12),
|
||||||
|
- SARADC_CHANNEL(5, "adc5", 12),
|
||||||
|
- SARADC_CHANNEL(6, "adc6", 12),
|
||||||
|
- SARADC_CHANNEL(7, "adc7", 12),
|
||||||
|
-};
|
||||||
|
-
|
||||||
|
-static const struct rockchip_saradc_data rk3588_saradc_data = {
|
||||||
|
- .channels = rockchip_rk3588_saradc_iio_channels,
|
||||||
|
- .num_channels = ARRAY_SIZE(rockchip_rk3588_saradc_iio_channels),
|
||||||
|
- .clk_rate = 1000000,
|
||||||
|
- .start = rockchip_saradc_start_v2,
|
||||||
|
- .read = rockchip_saradc_read_v2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct of_device_id rockchip_saradc_match[] = {
|
||||||
|
@@ -327,9 +221,6 @@ static const struct of_device_id rockchi
|
||||||
|
}, {
|
||||||
|
.compatible = "rockchip,rk3568-saradc",
|
||||||
|
.data = &rk3568_saradc_data,
|
||||||
|
- }, {
|
||||||
|
- .compatible = "rockchip,rk3588-saradc",
|
||||||
|
- .data = &rk3588_saradc_data,
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
};
|
||||||
|
@@ -345,6 +236,20 @@ static void rockchip_saradc_reset_contro
|
||||||
|
reset_control_deassert(reset);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void rockchip_saradc_clk_disable(void *data)
|
||||||
|
+{
|
||||||
|
+ struct rockchip_saradc *info = data;
|
||||||
|
+
|
||||||
|
+ clk_disable_unprepare(info->clk);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void rockchip_saradc_pclk_disable(void *data)
|
||||||
|
+{
|
||||||
|
+ struct rockchip_saradc *info = data;
|
||||||
|
+
|
||||||
|
+ clk_disable_unprepare(info->pclk);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void rockchip_saradc_regulator_disable(void *data)
|
||||||
|
{
|
||||||
|
struct rockchip_saradc *info = data;
|
||||||
|
@@ -393,7 +298,8 @@ out:
|
||||||
|
}
|
||||||
|
|
||||||
|
static int rockchip_saradc_volt_notify(struct notifier_block *nb,
|
||||||
|
- unsigned long event, void *data)
|
||||||
|
+ unsigned long event,
|
||||||
|
+ void *data)
|
||||||
|
{
|
||||||
|
struct rockchip_saradc *info =
|
||||||
|
container_of(nb, struct rockchip_saradc, nb);
|
||||||
|
@@ -413,10 +319,10 @@ static void rockchip_saradc_regulator_un
|
||||||
|
|
||||||
|
static int rockchip_saradc_probe(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
- const struct rockchip_saradc_data *match_data;
|
||||||
|
struct rockchip_saradc *info = NULL;
|
||||||
|
struct device_node *np = pdev->dev.of_node;
|
||||||
|
struct iio_dev *indio_dev = NULL;
|
||||||
|
+ const struct of_device_id *match;
|
||||||
|
int ret;
|
||||||
|
int irq;
|
||||||
|
|
||||||
|
@@ -424,23 +330,25 @@ static int rockchip_saradc_probe(struct
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*info));
|
||||||
|
- if (!indio_dev)
|
||||||
|
- return dev_err_probe(&pdev->dev, -ENOMEM,
|
||||||
|
- "failed allocating iio device\n");
|
||||||
|
-
|
||||||
|
+ if (!indio_dev) {
|
||||||
|
+ dev_err(&pdev->dev, "failed allocating iio device\n");
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+ }
|
||||||
|
info = iio_priv(indio_dev);
|
||||||
|
|
||||||
|
- match_data = of_device_get_match_data(&pdev->dev);
|
||||||
|
- if (!match_data)
|
||||||
|
- return dev_err_probe(&pdev->dev, -ENODEV,
|
||||||
|
- "failed to match device\n");
|
||||||
|
+ match = of_match_device(rockchip_saradc_match, &pdev->dev);
|
||||||
|
+ if (!match) {
|
||||||
|
+ dev_err(&pdev->dev, "failed to match device\n");
|
||||||
|
+ return -ENODEV;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- info->data = match_data;
|
||||||
|
+ info->data = match->data;
|
||||||
|
|
||||||
|
/* Sanity check for possible later IP variants with more channels */
|
||||||
|
- if (info->data->num_channels > SARADC_MAX_CHANNELS)
|
||||||
|
- return dev_err_probe(&pdev->dev, -EINVAL,
|
||||||
|
- "max channels exceeded");
|
||||||
|
+ if (info->data->num_channels > SARADC_MAX_CHANNELS) {
|
||||||
|
+ dev_err(&pdev->dev, "max channels exceeded");
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
info->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||||
|
if (IS_ERR(info->regs))
|
||||||
|
@@ -466,7 +374,7 @@ static int rockchip_saradc_probe(struct
|
||||||
|
|
||||||
|
irq = platform_get_irq(pdev, 0);
|
||||||
|
if (irq < 0)
|
||||||
|
- return irq;
|
||||||
|
+ return dev_err_probe(&pdev->dev, irq, "failed to get irq\n");
|
||||||
|
|
||||||
|
ret = devm_request_irq(&pdev->dev, irq, rockchip_saradc_isr,
|
||||||
|
0, dev_name(&pdev->dev), info);
|
||||||
|
@@ -475,6 +383,16 @@ static int rockchip_saradc_probe(struct
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ info->pclk = devm_clk_get(&pdev->dev, "apb_pclk");
|
||||||
|
+ if (IS_ERR(info->pclk))
|
||||||
|
+ return dev_err_probe(&pdev->dev, PTR_ERR(info->pclk),
|
||||||
|
+ "failed to get pclk\n");
|
||||||
|
+
|
||||||
|
+ info->clk = devm_clk_get(&pdev->dev, "saradc");
|
||||||
|
+ if (IS_ERR(info->clk))
|
||||||
|
+ return dev_err_probe(&pdev->dev, PTR_ERR(info->clk),
|
||||||
|
+ "failed to get adc clock\n");
|
||||||
|
+
|
||||||
|
info->vref = devm_regulator_get(&pdev->dev, "vref");
|
||||||
|
if (IS_ERR(info->vref))
|
||||||
|
return dev_err_probe(&pdev->dev, PTR_ERR(info->vref),
|
||||||
|
@@ -488,20 +406,23 @@ static int rockchip_saradc_probe(struct
|
||||||
|
* This may become user-configurable in the future.
|
||||||
|
*/
|
||||||
|
ret = clk_set_rate(info->clk, info->data->clk_rate);
|
||||||
|
- if (ret < 0)
|
||||||
|
- return dev_err_probe(&pdev->dev, ret,
|
||||||
|
- "failed to set adc clk rate\n");
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ dev_err(&pdev->dev, "failed to set adc clk rate, %d\n", ret);
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
ret = regulator_enable(info->vref);
|
||||||
|
- if (ret < 0)
|
||||||
|
- return dev_err_probe(&pdev->dev, ret,
|
||||||
|
- "failed to enable vref regulator\n");
|
||||||
|
-
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ dev_err(&pdev->dev, "failed to enable vref regulator\n");
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
ret = devm_add_action_or_reset(&pdev->dev,
|
||||||
|
rockchip_saradc_regulator_disable, info);
|
||||||
|
- if (ret)
|
||||||
|
- return dev_err_probe(&pdev->dev, ret,
|
||||||
|
- "failed to register devm action\n");
|
||||||
|
+ if (ret) {
|
||||||
|
+ dev_err(&pdev->dev, "failed to register devm action, %d\n",
|
||||||
|
+ ret);
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
ret = regulator_get_voltage(info->vref);
|
||||||
|
if (ret < 0)
|
||||||
|
@@ -509,15 +430,31 @@ static int rockchip_saradc_probe(struct
|
||||||
|
|
||||||
|
info->uv_vref = ret;
|
||||||
|
|
||||||
|
- info->pclk = devm_clk_get_enabled(&pdev->dev, "apb_pclk");
|
||||||
|
- if (IS_ERR(info->pclk))
|
||||||
|
- return dev_err_probe(&pdev->dev, PTR_ERR(info->pclk),
|
||||||
|
- "failed to get pclk\n");
|
||||||
|
+ ret = clk_prepare_enable(info->pclk);
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ dev_err(&pdev->dev, "failed to enable pclk\n");
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
+ ret = devm_add_action_or_reset(&pdev->dev,
|
||||||
|
+ rockchip_saradc_pclk_disable, info);
|
||||||
|
+ if (ret) {
|
||||||
|
+ dev_err(&pdev->dev, "failed to register devm action, %d\n",
|
||||||
|
+ ret);
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- info->clk = devm_clk_get_enabled(&pdev->dev, "saradc");
|
||||||
|
- if (IS_ERR(info->clk))
|
||||||
|
- return dev_err_probe(&pdev->dev, PTR_ERR(info->clk),
|
||||||
|
- "failed to get adc clock\n");
|
||||||
|
+ ret = clk_prepare_enable(info->clk);
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ dev_err(&pdev->dev, "failed to enable converter clock\n");
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
+ ret = devm_add_action_or_reset(&pdev->dev,
|
||||||
|
+ rockchip_saradc_clk_disable, info);
|
||||||
|
+ if (ret) {
|
||||||
|
+ dev_err(&pdev->dev, "failed to register devm action, %d\n",
|
||||||
|
+ ret);
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
platform_set_drvdata(pdev, indio_dev);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,12 +0,0 @@
|
||||||
diff -rupN linux.orig/drivers/input/touchscreen/goodix.c linux/drivers/input/touchscreen/goodix.c
|
|
||||||
--- linux.orig/drivers/input/touchscreen/goodix.c 2024-01-02 16:20:16.170247325 +0000
|
|
||||||
+++ linux/drivers/input/touchscreen/goodix.c 2024-01-03 15:28:50.457334216 +0000
|
|
||||||
@@ -1007,6 +1007,8 @@ retry_get_irq_gpio:
|
|
||||||
|
|
||||||
/* Get the reset line GPIO pin number */
|
|
||||||
gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, ts->gpiod_rst_flags);
|
|
||||||
+ if (IS_ERR(gpiod))
|
|
||||||
+ gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, GPIOD_OUT_LOW);
|
|
||||||
if (IS_ERR(gpiod)) {
|
|
||||||
error = PTR_ERR(gpiod);
|
|
||||||
if (error != -EPROBE_DEFER)
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
diff -rupN linux.orig/drivers/gpio/gpio-rockchip.c linux/drivers/gpio/gpio-rockchip.c
|
||||||
|
--- linux.orig/drivers/gpio/gpio-rockchip.c 2023-12-22 04:23:33.879905917 +0000
|
||||||
|
+++ linux/drivers/gpio/gpio-rockchip.c 2023-12-22 05:08:03.636801366 +0000
|
||||||
|
@@ -335,13 +335,13 @@ static void rockchip_irq_demux(struct ir
|
||||||
|
unsigned long pending;
|
||||||
|
unsigned int irq;
|
||||||
|
|
||||||
|
- dev_dbg(bank->dev, "got irq for bank %s\n", bank->name);
|
||||||
|
+ //dev_dbg(bank->dev, "got irq for bank %s\n", bank->name);
|
||||||
|
|
||||||
|
chained_irq_enter(chip, desc);
|
||||||
|
|
||||||
|
pending = readl_relaxed(bank->reg_base + bank->gpio_regs->int_status);
|
||||||
|
for_each_set_bit(irq, &pending, 32) {
|
||||||
|
- dev_dbg(bank->dev, "handling irq %d\n", irq);
|
||||||
|
+ //dev_dbg(bank->dev, "handling irq %d\n", irq);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Triggering IRQ on both rising and falling edge
|
||||||
|
diff -rupN linux.orig/drivers/input/touchscreen/goodix.c linux/drivers/input/touchscreen/goodix.c
|
||||||
|
--- linux.orig/drivers/input/touchscreen/goodix.c 2023-12-22 04:23:34.199912947 +0000
|
||||||
|
+++ linux/drivers/input/touchscreen/goodix.c 2023-12-22 05:08:59.121963345 +0000
|
||||||
|
@@ -1019,7 +1019,7 @@ retry_get_irq_gpio:
|
||||||
|
default:
|
||||||
|
if (ts->gpiod_int && ts->gpiod_rst) {
|
||||||
|
ts->reset_controller_at_probe = true;
|
||||||
|
- ts->load_cfg_from_disk = true;
|
||||||
|
+ ts->load_cfg_from_disk = false;
|
||||||
|
ts->irq_pin_access_method = IRQ_PIN_ACCESS_GPIO;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,54 +0,0 @@
|
||||||
diff -rupN linux.orig/drivers/input/touchscreen/goodix.c linux/drivers/input/touchscreen/goodix.c
|
|
||||||
--- linux.orig/drivers/input/touchscreen/goodix.c 2023-12-15 19:18:57.364913158 +0000
|
|
||||||
+++ linux/drivers/input/touchscreen/goodix.c 2023-12-15 19:20:05.987107578 +0000
|
|
||||||
@@ -1037,7 +1037,7 @@ retry_get_irq_gpio:
|
|
||||||
default:
|
|
||||||
if (ts->gpiod_int && ts->gpiod_rst) {
|
|
||||||
ts->reset_controller_at_probe = true;
|
|
||||||
- ts->load_cfg_from_disk = true;
|
|
||||||
+ ts->load_cfg_from_disk = false;
|
|
||||||
ts->irq_pin_access_method = IRQ_PIN_ACCESS_GPIO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff -rupN linux.orig/drivers/gpio/gpio-rockchip.c linux/drivers/gpio/gpio-rockchip.c
|
|
||||||
--- linux.orig/drivers/gpio/gpio-rockchip.c 2023-12-15 19:18:55.020838176 +0000
|
|
||||||
+++ linux/drivers/gpio/gpio-rockchip.c 2023-12-15 19:20:05.987107578 +0000
|
|
||||||
@@ -335,13 +335,13 @@ static void rockchip_irq_demux(struct ir
|
|
||||||
unsigned long pending;
|
|
||||||
unsigned int irq;
|
|
||||||
|
|
||||||
- dev_dbg(bank->dev, "got irq for bank %s\n", bank->name);
|
|
||||||
+ //dev_dbg(bank->dev, "got irq for bank %s\n", bank->name);
|
|
||||||
|
|
||||||
chained_irq_enter(chip, desc);
|
|
||||||
|
|
||||||
pending = readl_relaxed(bank->reg_base + bank->gpio_regs->int_status);
|
|
||||||
for_each_set_bit(irq, &pending, 32) {
|
|
||||||
- dev_dbg(bank->dev, "handling irq %d\n", irq);
|
|
||||||
+ //dev_dbg(bank->dev, "handling irq %d\n", irq);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Triggering IRQ on both rising and falling edge
|
|
||||||
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
|
|
||||||
index f3964060a044..dc1ffb3a098b 100644
|
|
||||||
--- a/sound/soc/soc-pcm.c
|
|
||||||
+++ b/sound/soc/soc-pcm.c
|
|
||||||
@@ -41,9 +41,6 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd,
|
|
||||||
case -ENOTSUPP:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
- dev_err(rtd->dev,
|
|
||||||
- "ASoC: error at %s on %s: %d\n",
|
|
||||||
- func, rtd->dai_link->name, ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
@@ -2438,8 +2435,6 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
|
|
||||||
|
|
||||||
/* there is no point preparing this FE if there are no BEs */
|
|
||||||
if (list_empty(&fe->dpcm[stream].be_clients)) {
|
|
||||||
- dev_err(fe->dev, "ASoC: no backend DAIs enabled for %s\n",
|
|
||||||
- fe->dai_link->name);
|
|
||||||
ret = -EINVAL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
diff --git a/Makefile b/Makefile
|
|
||||||
index ff76e8559..3ebe059b9 100644
|
|
||||||
--- a/Makefile
|
|
||||||
+++ b/Makefile
|
|
||||||
@@ -606,6 +606,7 @@ endif
|
|
||||||
|
|
||||||
KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
|
|
||||||
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
|
|
||||||
+KBUILD_CFLAGS += $(call cc-disable-warning, enum-int-mismatch)
|
|
||||||
|
|
||||||
# turn jbsr into jsr for m68k
|
|
||||||
ifeq ($(ARCH),m68k)
|
|
Loading…
Reference in a new issue