Merge pull request #2849 from JustEnoughLinuxOS/mainline-3566
Mainline 3566
This commit is contained in:
commit
70373cb116
96 changed files with 20141 additions and 12800 deletions
1
Makefile
1
Makefile
|
@ -72,7 +72,6 @@ RK3399:
|
|||
PROJECT=Rockchip DEVICE=RK3399 ARCH=arm ./scripts/build_distro
|
||||
PROJECT=Rockchip DEVICE=RK3399 ARCH=aarch64 ./scripts/build_distro
|
||||
|
||||
|
||||
update:
|
||||
PROJECT=PC DEVICE=AMD64 ARCH=x86_64 ./scripts/update_packages
|
||||
|
||||
|
|
19
packages/apps/jelos-gamepad/package.mk
Normal file
19
packages/apps/jelos-gamepad/package.mk
Normal file
|
@ -0,0 +1,19 @@
|
|||
PKG_NAME="jelos-gamepad"
|
||||
PKG_VERSION="b1fc0fb69047011d99b54029be500280d33a8027"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_LICENSE="GPLv3"
|
||||
PKG_SITE="https://github.com/R-ARM/rinputer2"
|
||||
PKG_URL="$PKG_SITE.git"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
PKG_TOOLCHAIN="make"
|
||||
GET_HANDLER_SUPPORT="git"
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $INSTALL/usr/bin
|
||||
cp rinputer2 ${INSTALL}/usr/bin/jelos_gamepad
|
||||
chmod 0755 ${INSTALL}/usr/bin/jelos_gamepad
|
||||
}
|
||||
|
||||
post_install() {
|
||||
enable_service jelos_gamepad.service
|
||||
}
|
56
packages/apps/jelos-gamepad/patches/000-jelos-gamepad.patch
Normal file
56
packages/apps/jelos-gamepad/patches/000-jelos-gamepad.patch
Normal file
|
@ -0,0 +1,56 @@
|
|||
diff -rupN rinputer2.orig/main.c rinputer2/main.c
|
||||
--- rinputer2.orig/main.c 2023-11-23 04:47:16.344733862 +0000
|
||||
+++ rinputer2/main.c 2023-11-23 15:00:20.535535759 +0000
|
||||
@@ -240,7 +240,7 @@ int rescan_devices(struct rinputer_devic
|
||||
continue;
|
||||
|
||||
// let's not make a loop
|
||||
- if(strncmp("Rinputer", name, 8) == 0)
|
||||
+ if(strncmp("JELOS Gamepad", name, 8) == 0)
|
||||
continue;
|
||||
// ignore steam-created controllers
|
||||
// they have this name, with a digit at the end
|
||||
@@ -316,10 +316,10 @@ int main(void)
|
||||
|
||||
ioctl(outfd, UI_SET_EVBIT, EV_KEY);
|
||||
|
||||
- //ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_UP); // dpad up
|
||||
- //ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_DOWN); // dpad down
|
||||
- //ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_LEFT); // dpad left
|
||||
- //ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_RIGHT); // dpad right
|
||||
+ ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_UP); // dpad up
|
||||
+ ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_DOWN); // dpad down
|
||||
+ ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_LEFT); // dpad left
|
||||
+ ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_RIGHT); // dpad right
|
||||
|
||||
ioctl(outfd, UI_SET_KEYBIT, BTN_NORTH); // x
|
||||
ioctl(outfd, UI_SET_KEYBIT, BTN_SOUTH); // b
|
||||
@@ -332,6 +332,9 @@ int main(void)
|
||||
ioctl(outfd, UI_SET_KEYBIT, BTN_TR2); // L2
|
||||
ioctl(outfd, UI_SET_KEYBIT, BTN_TL2); // R2
|
||||
|
||||
+ ioctl(outfd, UI_SET_KEYBIT, BTN_THUMBL); // L3
|
||||
+ ioctl(outfd, UI_SET_KEYBIT, BTN_THUMBR); // R3
|
||||
+
|
||||
ioctl(outfd, UI_SET_KEYBIT, BTN_SELECT);
|
||||
ioctl(outfd, UI_SET_KEYBIT, BTN_START);
|
||||
|
||||
@@ -350,15 +353,15 @@ int main(void)
|
||||
setup_abs(outfd, ABS_RZ);
|
||||
|
||||
// dpad
|
||||
- setup_abs(outfd, ABS_HAT0X);
|
||||
- setup_abs(outfd, ABS_HAT0Y);
|
||||
+ //setup_abs(outfd, ABS_HAT0X);
|
||||
+ //setup_abs(outfd, ABS_HAT0Y);
|
||||
|
||||
// maybe we should pretend to be xbox gamepad?
|
||||
memset(&usetup, 0, sizeof(usetup));
|
||||
usetup.id.bustype = BUS_USB;
|
||||
usetup.id.vendor = 0x1234;
|
||||
usetup.id.product = 0x5678;
|
||||
- strcpy(usetup.name, "Rinputer");
|
||||
+ strcpy(usetup.name, "JELOS Gamepad");
|
||||
|
||||
ioctl(outfd, UI_DEV_SETUP, &usetup);
|
||||
ioctl(outfd, UI_DEV_CREATE);
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Ragnarok Input Daemon
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/jelos_gamepad
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -7,20 +7,11 @@ PKG_VERSION="1.2.10"
|
|||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.alsa-project.org/"
|
||||
PKG_URL="https://www.alsa-project.org/files/pub/lib/alsa-lib-${PKG_VERSION}.tar.bz2"
|
||||
PKG_DEPENDS_TARGET="toolchain alsa-topology-conf"
|
||||
PKG_DEPENDS_TARGET="toolchain alsa-ucm-conf alsa-topology-conf"
|
||||
PKG_LONGDESC="ALSA (Advanced Linux Sound Architecture) is the next generation Linux Sound API."
|
||||
PKG_TOOLCHAIN="autotools"
|
||||
PKG_BUILD_FLAGS="+pic"
|
||||
|
||||
case ${DEVICE} in
|
||||
RK356*)
|
||||
PKG_DEPENDS_TARGET+=""
|
||||
;;
|
||||
*)
|
||||
PKG_DEPENDS_TARGET+=" alsa-ucm-conf"
|
||||
;;
|
||||
esac
|
||||
|
||||
if build_with_debug; then
|
||||
PKG_ALSA_DEBUG=--with-debug
|
||||
else
|
||||
|
|
|
@ -8,7 +8,7 @@ PKG_VERSION="1.2.10"
|
|||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.alsa-project.org/"
|
||||
PKG_URL="https://www.alsa-project.org/files/pub/utils/alsa-utils-${PKG_VERSION}.tar.bz2"
|
||||
PKG_DEPENDS_TARGET="toolchain alsa-lib ncurses systemd"
|
||||
PKG_DEPENDS_TARGET="toolchain alsa-lib ncurses systemd alsa-ucm-conf"
|
||||
PKG_LONGDESC="This package includes the utilities for ALSA, like alsamixer, aplay, arecord, alsactl, iecset and speaker-test."
|
||||
PKG_TOOLCHAIN="autotools"
|
||||
|
||||
|
@ -20,10 +20,6 @@ PKG_CONFIGURE_OPTS_TARGET="--disable-alsaconf \
|
|||
--disable-nls \
|
||||
--disable-rst2man \
|
||||
--disable-xmlto"
|
||||
if [[ ! "${DEVICE}" =~ RK356 ]]
|
||||
then
|
||||
PKG_DEPENDS_TARGET+=" alsa-ucm-conf"
|
||||
fi
|
||||
|
||||
post_makeinstall_target() {
|
||||
rm -rf ${INSTALL}/lib ${INSTALL}/var
|
||||
|
|
|
@ -5,8 +5,8 @@ PKG_NAME="unzip"
|
|||
PKG_VERSION="60"
|
||||
PKG_SHA256="036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37"
|
||||
PKG_LICENSE="OSS"
|
||||
PKG_SITE="http://www.info-zip.org/pub/infozip"
|
||||
PKG_URL="http://downloads.sourceforge.net/sourceforge/infozip/${PKG_NAME}${PKG_VERSION}.tar.gz"
|
||||
PKG_SITE="http://www.info-zip.org/pub/infozip/"
|
||||
PKG_URL="https://sourceforge.net/projects/infozip/files/UnZip%206.x%20(latest)/UnZip%206.0/unzip60.tar.gz"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
PKG_LONGDESC="UnZip is an extraction utility for archives compressed in .zip format."
|
||||
PKG_TOOLCHAIN="manual"
|
||||
|
|
|
@ -11,5 +11,5 @@ PKG_LONGDESC="strace is a diagnostic, debugging and instructional userspace util
|
|||
PKG_TOOLCHAIN="autotools"
|
||||
|
||||
if [ "${TARGET_ARCH}" = x86_64 -o "${TARGET_ARCH}" = "aarch64" ]; then
|
||||
PKG_CONFIGURE_OPTS_TARGET="--enable-mpers=no"
|
||||
PKG_CONFIGURE_OPTS_TARGET="--enable-mpers=no --enable-bundled"
|
||||
fi
|
||||
|
|
|
@ -13,9 +13,6 @@ PKG_LONGDESC="The Glibc package contains the main C library."
|
|||
PKG_BUILD_FLAGS="+bfd -gold"
|
||||
|
||||
case "${DEVICE}" in
|
||||
RK356*)
|
||||
OPT_ENABLE_KERNEL=4.4.0
|
||||
;;
|
||||
RK358*)
|
||||
OPT_ENABLE_KERNEL=5.10.0
|
||||
;;
|
||||
|
|
|
@ -6,7 +6,7 @@ PKG_NAME="gmp"
|
|||
PKG_VERSION="6.3.0"
|
||||
PKG_LICENSE="LGPLv3+"
|
||||
PKG_SITE="http://gmplib.org/"
|
||||
PKG_URL="https://gmplib.org/download/gmp/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||
PKG_URL="https://ftp.gnu.org/gnu/gmp/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||
PKG_DEPENDS_HOST="ccache:host m4:host"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
PKG_LONGDESC="A library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers."
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
RK3566
|
|
@ -37,16 +37,6 @@ case ${PROJECT} in
|
|||
;;
|
||||
esac
|
||||
|
||||
case ${DEVICE} in
|
||||
RK3566*)
|
||||
PKG_DEPENDS_TARGET+=" libgo2"
|
||||
PKG_CONFIGURE_OPTS_TARGET+=" --enable-odroidgo2"
|
||||
;;
|
||||
*)
|
||||
PKG_CONFIGURE_OPTS_TARGET+=" --disable-odroidgo2"
|
||||
;;
|
||||
esac
|
||||
|
||||
case ${ARCH} in
|
||||
arm)
|
||||
PKG_CONFIGURE_OPTS_TARGET+=" --enable-neon"
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
diff -rupN retroarch.orig/gfx/drivers/oga_gfx.c retroarch/gfx/drivers/oga_gfx.c
|
||||
--- retroarch.orig/gfx/drivers/oga_gfx.c 2022-02-28 19:40:46.222185295 -0500
|
||||
+++ retroarch/gfx/drivers/oga_gfx.c 2022-02-28 19:44:14.187909576 -0500
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "../../verbosity.h"
|
||||
#include <fcntl.h>
|
||||
#include <rga/RgaApi.h>
|
||||
-#include <rga/RockchipRgaMacro.h>
|
||||
+#include <rga/drmrga.h>
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include <drm/drm_fourcc.h>
|
|
@ -1,35 +0,0 @@
|
|||
Correct DRM format on Powkiddy x55, extracted from PowKiddy x55 sources.
|
||||
diff --git a/deps/libgo2/src/display.c b/deps/libgo2/src/display.c
|
||||
index b91cf0624b..936b677fc4 100644
|
||||
--- a/deps/libgo2/src/display.c
|
||||
+++ b/deps/libgo2/src/display.c
|
||||
@@ -550,7 +550,7 @@ static uint32_t go2_rkformat_get(uint32_t drm_fourcc)
|
||||
|
||||
case DRM_FORMAT_ARGB8888:
|
||||
case DRM_FORMAT_XRGB8888:
|
||||
- return RK_FORMAT_BGRA_8888;
|
||||
+ return RK_FORMAT_RGBA_8888;
|
||||
|
||||
case DRM_FORMAT_RGB565:
|
||||
return RK_FORMAT_RGB_565;
|
||||
@@ -586,6 +586,7 @@ void go2_surface_blit(go2_surface_t* srcSurface, int srcX, int srcY, int srcWidt
|
||||
dst.rect.hstride = dstSurface->height;
|
||||
dst.rect.format = go2_rkformat_get(dstSurface->format);
|
||||
|
||||
+
|
||||
rga_info_t src = { 0 };
|
||||
src.fd = go2_surface_prime_fd(srcSurface);
|
||||
src.mmuFlag = 1;
|
||||
diff --git a/gfx/drivers_context/drm_go2_ctx.c b/gfx/drivers_context/drm_go2_ctx.c
|
||||
index b758137703..dbcb992279 100644
|
||||
--- a/gfx/drivers_context/drm_go2_ctx.c
|
||||
+++ b/gfx/drivers_context/drm_go2_ctx.c
|
||||
@@ -133,7 +133,7 @@ static void *gfx_ctx_go2_drm_init(void *video_driver)
|
||||
}
|
||||
|
||||
drm->presenter = go2_presenter_create(drm->display,
|
||||
- DRM_FORMAT_RGB565, 0xff000000, true);
|
||||
+ DRM_FORMAT_XRGB8888, 0xff000000, true);
|
||||
|
||||
return drm;
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
1900c3ea010000000100000001010000,odroidgo3_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b12,start:b13,dpleft:b10,dpdown:b9,dpright:b11,dpup:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b15,rightstick:b16,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
19009b4d4b4800000111000000020000,retrogame_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
19009b4d4b4800000111000000010000,retrogame_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
0300fcb7341200007856000000000000,JELOS Gamepad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,
|
||||
19009321b0c300000002000010000000,XU10 Gamepad,platform:Linux,x:b3,a:b2,b:b1,y:b0,back:b8,guide:b16,start:b9,dpleft:b14,dpdown:b13,dpright:b15,dpup:b12,leftshoulder:b4,lefttrigger:b7,rightshoulder:b5,righttrigger:b6,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
190014b3010000009178000000050000,r33s_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b12,dpdown:b11,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,
|
||||
1900e5914b4800007711000077010000,RGB20S Gamepad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b12,start:b13,dpleft:b10,dpdown:b9,dpright:b11,dpup:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b14,rightstick:b15,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
input_driver = "udev"
|
||||
input_device = "JELOS Gamepad"
|
||||
input_vendor_id = "1234"
|
||||
input_product_id = "5648"
|
||||
input_b_btn = "0"
|
||||
input_y_btn = "3"
|
||||
input_select_btn = "8"
|
||||
input_start_btn = "9"
|
||||
input_up_btn = "13"
|
||||
input_down_btn = "14"
|
||||
input_left_btn = "15"
|
||||
input_right_btn = "16"
|
||||
input_a_btn = "1"
|
||||
input_x_btn = "2"
|
||||
input_l_btn = "4"
|
||||
input_r_btn = "5"
|
||||
input_l2_btn = "6"
|
||||
input_r2_btn = "7"
|
||||
input_l3_btn = "11"
|
||||
input_r3_btn = "12"
|
||||
input_l_x_plus_axis = "+0"
|
||||
input_l_x_minus_axis = "-0"
|
||||
input_l_y_plus_axis = "+1"
|
||||
input_l_y_minus_axis = "-1"
|
||||
input_r_x_plus_axis = "+3"
|
||||
input_r_x_minus_axis = "-3"
|
||||
input_r_y_plus_axis = "+4"
|
||||
input_r_y_minus_axis = "-4"
|
||||
input_gun_trigger_mbtn = "1"
|
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
|
|
@ -10,11 +10,17 @@ PKG_TOOLCHAIN="meson"
|
|||
PKG_PATCH_DIRS+=" ${DEVICE}"
|
||||
|
||||
case ${DEVICE} in
|
||||
RK3588*)
|
||||
PKG_VERSION="120202c675749c5ef81ae4c8cdc30019b4de08f4"
|
||||
PKG_SITE="https://gitlab.com/panfork/mesa"
|
||||
PKG_URL="${PKG_SITE}.git"
|
||||
PKG_GIT_CLONE_BRANCH="csf"
|
||||
RK3588)
|
||||
PKG_VERSION="120202c675749c5ef81ae4c8cdc30019b4de08f4"
|
||||
PKG_SITE="https://gitlab.com/panfork/mesa"
|
||||
PKG_URL="${PKG_SITE}.git"
|
||||
PKG_GIT_CLONE_BRANCH="csf"
|
||||
;;
|
||||
RK33*|RK3566) #Using upstream dev for panfrost
|
||||
PKG_VERSION="7adc7678a88edccfbd20af2307e7f50e9ed48e47"
|
||||
PKG_SITE="https://gitlab.freedesktop.org/mesa/mesa"
|
||||
PKG_URL="${PKG_SITE}.git"
|
||||
PKG_PATCH_DIRS+=" panfrost"
|
||||
;;
|
||||
*)
|
||||
PKG_VERSION="24.0.0"
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
cat <<EOF >/storage/.config/profile.d/010-governors
|
||||
CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0")
|
||||
GPU_FREQ="/sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu"
|
||||
DMC_FREQ="/sys/devices/platform/dmc/devfreq/dmc"
|
||||
EOF
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
. /etc/profile.d/001-functions
|
||||
|
||||
MYSLEEPMODE=$(get_setting system.suspendmode)
|
||||
if [ -z "${MYSLEEPMODE}" ]
|
||||
then
|
||||
/usr/bin/suspendmode mem
|
||||
fi
|
||||
|
||||
echo s2idle >/sys/power/mem_sleep
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
#!/bin/sh
|
||||
ID=$(dmesg | grep "panel id:" | sed "s#^.*panel id: ##g")
|
||||
ID=$(dmesg | grep "panel")
|
||||
case ${ID} in
|
||||
"30 52")
|
||||
ID="v1 (${ID})"
|
||||
*newvision*)
|
||||
ID="v1"
|
||||
;;
|
||||
"38 21")
|
||||
ID="v2 (${ID})"
|
||||
*sitronix*)
|
||||
ID="v2"
|
||||
;;
|
||||
*)
|
||||
ID="Unknown"
|
||||
|
@ -15,4 +15,4 @@ esac
|
|||
if [ -n "${ID}" ]
|
||||
then
|
||||
echo "PANEL VERSION: ${ID}"
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
. /etc/profile.d/001-functions
|
||||
|
||||
MYSLEEPMODE=$(get_setting system.suspendmode)
|
||||
if [ -z "${MYSLEEPMODE}" ]
|
||||
then
|
||||
/usr/bin/suspendmode mem
|
||||
fi
|
||||
|
||||
echo s2idle >/sys/power/mem_sleep
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/sh
|
||||
ID=$(dmesg | grep "panel id:" | sed "s#^.*panel id: ##g")
|
||||
ID=$(dmesg | grep "panel")
|
||||
case ${ID} in
|
||||
"30 52")
|
||||
*newvision*)
|
||||
ID="v1"
|
||||
;;
|
||||
"38 21")
|
||||
*sitronix*)
|
||||
ID="v2"
|
||||
;;
|
||||
*)
|
||||
|
@ -15,4 +15,4 @@ esac
|
|||
if [ -n "${ID}" ]
|
||||
then
|
||||
echo "PANEL VERSION: ${ID}"
|
||||
fi
|
||||
fi
|
||||
|
|
1
packages/hardware/quirks/devices/Anbernic RG353VS
Symbolic link
1
packages/hardware/quirks/devices/Anbernic RG353VS
Symbolic link
|
@ -0,0 +1 @@
|
|||
Anbernic RG353V
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
cat <<EOF >/storage/.config/profile.d/010-governors
|
||||
CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0")
|
||||
GPU_FREQ="/sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu"
|
||||
DMC_FREQ="/sys/devices/platform/dmc/devfreq/dmc"
|
||||
EOF
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
. /etc/profile.d/001-functions
|
||||
|
||||
MYSLEEPMODE=$(get_setting system.suspendmode)
|
||||
if [ -z "${MYSLEEPMODE}" ]
|
||||
then
|
||||
/usr/bin/suspendmode mem
|
||||
fi
|
||||
|
||||
echo s2idle >/sys/power/mem_sleep
|
||||
|
14
packages/hardware/quirks/devices/Powkiddy RGB10MAX3/050-game_configs
Executable file
14
packages/hardware/quirks/devices/Powkiddy RGB10MAX3/050-game_configs
Executable file
|
@ -0,0 +1,14 @@
|
|||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2022-present JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
. /etc/profile
|
||||
|
||||
#Set up gzdoom
|
||||
if [ ! -d "/storage/.config/gzdoom/" ]; then
|
||||
cp -rf /usr/config/gzdoom /storage/.config/
|
||||
sed -i '/Joy10=/c\Joy10=togglemap;
|
||||
/Joy9=/c\Joy9=menu_main;
|
||||
/vid_defheight=/c\vid_defheight=720;
|
||||
/vid_defwidth=/c\vid_defwidth=1280' /storage/.config/gzdoom/gzdoom.ini
|
||||
fi
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
cat <<EOF >/storage/.config/profile.d/010-governors
|
||||
CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0")
|
||||
GPU_FREQ="/sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu"
|
||||
DMC_FREQ="/sys/devices/platform/dmc/devfreq/dmc"
|
||||
EOF
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
. /etc/profile.d/001-functions
|
||||
|
||||
MYSLEEPMODE=$(get_setting system.suspendmode)
|
||||
if [ -z "${MYSLEEPMODE}" ]
|
||||
then
|
||||
/usr/bin/suspendmode mem
|
||||
fi
|
||||
|
||||
echo s2idle >/sys/power/mem_sleep
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
cat <<EOF >/storage/.config/profile.d/002-audio_path
|
||||
DEVICE_PLAYBACK_PATH_SPK="HP"
|
||||
DEVICE_PLAYBACK_PATH_HP="SPK"
|
||||
DEVICE_PLAYBACK_PATH="Playback Path"
|
||||
EOF
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
cat <<EOF >/storage/.config/profile.d/010-governors
|
||||
CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0")
|
||||
GPU_FREQ="/sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu"
|
||||
DMC_FREQ="/sys/devices/platform/dmc/devfreq/dmc"
|
||||
EOF
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
cat <<EOF >/storage/.config/profile.d/002-audio_path
|
||||
DEVICE_PLAYBACK_PATH_SPK="HP"
|
||||
DEVICE_PLAYBACK_PATH_HP="SPK"
|
||||
DEVICE_PLAYBACK_PATH="Playback Path"
|
||||
EOF
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
# Workaround for no audio on wake from sleep.
|
||||
|
||||
. /etc/profile
|
||||
|
||||
DEVICE_HEADPHONE_DEV="/sys/devices/platform/rk-headset/extcon/extcon3/state"
|
||||
HEADPHONE_STATE=$(awk 'BEGIN {FS="="} /HEADPHONE/ {print $2}' ${DEVICE_HEADPHONE_DEV})
|
||||
|
||||
amixer -c 0 set "MUTE" "MUTE"
|
||||
|
||||
amixer -c 0 set "Capture MIC Path" "Main Mic"
|
||||
amixer -c 0 set "Capture MIC Path" "MIC OFF"
|
||||
|
||||
case ${HEADPHONE_STATE} in
|
||||
1)
|
||||
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
|
||||
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_HP}"
|
||||
;;
|
||||
0)
|
||||
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_HP}"
|
||||
amixer -c 0 set "Playback Path" "${DEVICE_PLAYBACK_PATH_SPK}"
|
||||
;;
|
||||
esac
|
||||
|
||||
amixer -c 0 set "MUTE" "UNMUTE"
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
||||
|
||||
cat <<EOF >/storage/.config/profile.d/001-device_config
|
||||
DEVICE_FAKE_JACKSENSE="false"
|
||||
|
|
|
@ -5,6 +5,5 @@
|
|||
cat <<EOF >/storage/.config/profile.d/010-governors
|
||||
# FREQ governors
|
||||
CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0")
|
||||
GPU_FREQ="/sys/devices/platform/ff400000.gpu/devfreq/ff400000.gpu"
|
||||
DMC_FREQ="/sys/devices/platform/dmc/devfreq/dmc"
|
||||
GPU_FREQ="$(find /sys/devices/platform/*gpu/devfreq -name '*.gpu')"
|
||||
EOF
|
|
@ -10,5 +10,3 @@ then
|
|||
/usr/bin/suspendmode mem
|
||||
fi
|
||||
|
||||
echo s2idle >/sys/power/mem_sleep
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
||||
|
||||
cat <<EOF >/storage/.config/profile.d/002-audio_path
|
||||
DEVICE_PLAYBACK_PATH_SPK="SPK"
|
||||
DEVICE_PLAYBACK_PATH_HP="HP"
|
||||
DEVICE_PLAYBACK_PATH="Playback Path"
|
||||
DEVICE_PLAYBACK_PATH="Playback Mux"
|
||||
EOF
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (C) 2022-present Fewtarius
|
||||
|
||||
cat <<EOF >/storage/.config/profile.d/050-modifiers
|
||||
DEVICE_KEY_VOLUMEDOWN=114
|
||||
|
|
8
packages/hardware/quirks/platforms/RK3566/050-volume
Executable file
8
packages/hardware/quirks/platforms/RK3566/050-volume
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
. /storage/.config/profile.d/001-device_config
|
||||
|
||||
# RK3566 devices have a master volume attached to card 0 that needs to be set to 100% on startup.
|
||||
amixer -c 1 set "Master" "100%"
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (C) 2023-present Fewtarius (https://github.com/fewtarius)
|
||||
|
||||
. /etc/profile.d/001-functions
|
||||
. /storage/.config/profile.d/010-governors
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (C) 2022-present Fewtarius
|
||||
|
||||
### Set the default device configuration
|
||||
cat <<EOF >/storage/.config/profile.d/090-ui_service
|
||||
UI_SERVICE="emustation.service"
|
||||
UI_SERVICE="weston.service"
|
||||
EOF
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
### Restore previous governors before going to sleep
|
||||
|
||||
. /etc/profile
|
||||
|
||||
### Grab the old governors.
|
||||
OLD_CPU_FREQ=$(get_setting "sleep.cpugovernor")
|
||||
if [ ! -n "${OLD_CPU_FREQ}" ]; then
|
||||
OLD_CPU_FREQ="schedutil"
|
||||
fi
|
||||
|
||||
OLD_GPU_FREQ=$(get_setting "sleep.gpugovernor")
|
||||
if [ ! -n "${OLD_GPU_FREQ}" ]; then
|
||||
OLD_GPU_FREQ="simple_ondemand"
|
||||
fi
|
||||
|
||||
# Restore old governors.
|
||||
set_cpu_gov "${OLD_CPU_FREQ}"
|
||||
set_dmc_gov "${OLD_CPU_FREQ}"
|
||||
set_gpu_gov "${OLD_GPU_FREQ}"
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
# Store current freq governors and set governors to powersave.
|
||||
|
||||
. /etc/profile
|
||||
|
||||
### Get the current cpu and gpu governor, save for when the device wakes from sleep.
|
||||
CUR_CPU_FREQ="$(cat ${CPU_FREQ}/scaling_governor)"
|
||||
CUR_GPU_FREQ="$(cat ${GPU_FREQ}/governor)"
|
||||
|
||||
set_setting sleep.cpugovernor "${CUR_CPU_FREQ}"
|
||||
set_setting sleep.gpugovernor "${CUR_GPU_FREQ}"
|
||||
|
||||
### Set all governors to powersave
|
||||
set_cpu_gov powersave
|
||||
set_dmc_gov powersave
|
||||
set_gpu_gov powersave
|
2
packages/jelos/autostart/001-wifi
Executable file
2
packages/jelos/autostart/001-wifi
Executable file
|
@ -0,0 +1,2 @@
|
|||
echo "mmc3:0001:1" > /sys/bus/sdio/drivers/rtw_8821cs/unbind
|
||||
echo "mmc3:0001:1" > /sys/bus/sdio/drivers/rtw_8821cs/bind
|
|
@ -75,6 +75,26 @@ function start_ms() {
|
|||
fi
|
||||
}
|
||||
|
||||
start_overlay() {
|
||||
if [ -e "/storage/.overlay_unsupported" ]
|
||||
then
|
||||
# If we're not using the overlay, bind mount the external storage path
|
||||
# so we don't need to change any configs.
|
||||
grep ${MOUNT_PATH} /proc/mounts >/dev/null 2>&1
|
||||
if [ ! $? = 0 ]
|
||||
then
|
||||
MOUNT_PATH="/storage/games-internal"
|
||||
fi
|
||||
log $0 "Executing bind mount of ${MOUNT_PATH} to ${OVERLAY_PATH}"
|
||||
mount --bind ${MOUNT_PATH} ${OVERLAY_PATH}
|
||||
exit 0
|
||||
else
|
||||
log $0 "Enabling overlay."
|
||||
systemctl enable storage-roms.mount >/dev/null 2>&1
|
||||
systemctl start storage-roms.mount >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ ! "${MOUNT_GAMES}" =~ [0-9] ]]
|
||||
then
|
||||
set_setting system.automount 1
|
||||
|
|
|
@ -21,3 +21,5 @@ brcm/*
|
|||
rtl_bt/*
|
||||
rtlwifi/*
|
||||
rtw*/*
|
||||
|
||||
rtl_nic/*
|
||||
|
|
|
@ -49,7 +49,7 @@ PKG_CONFIGURE_OPTS_TARGET="WPASUPPLICANT=/usr/bin/wpa_supplicant \
|
|||
if [ "$WIREGUARD_SUPPORT" = "yes" ]; then
|
||||
PKG_CONFIGURE_OPTS_TARGET+=" --enable-wireguard=builtin"
|
||||
else
|
||||
PKG_CONGIGURE_OPTS_TARGET+=" --disable-wireguard"
|
||||
PKG_CONFIGURE_OPTS_TARGET+=" --disable-wireguard"
|
||||
fi
|
||||
|
||||
PKG_MAKE_OPTS_TARGET="storagedir=/storage/.cache/connman \
|
||||
|
@ -77,13 +77,15 @@ post_makeinstall_target() {
|
|||
-e "s|^# TetheringTechnologies.*|TetheringTechnologies = wifi|g" \
|
||||
-e "s|^# AllowHostnameUpdates.*|AllowHostnameUpdates = false|g" \
|
||||
-e "s|^# PersistentTetheringMode.*|PersistentTetheringMode = true|g" \
|
||||
-e "s|^# SingleConnectedTechnology.*|SingleConnectedTechnology = true|g" \
|
||||
-e "s|^# NetworkInterfaceBlacklist = vmnet,vboxnet,virbr,ifb|NetworkInterfaceBlacklist = vmnet,vboxnet,virbr,ifb,docker,veth,zt,p2p|g"
|
||||
|
||||
mkdir -p ${INSTALL}/usr/share/connman/
|
||||
cp ${PKG_DIR}/config/settings ${INSTALL}/usr/share/connman/
|
||||
}
|
||||
|
||||
# Bounced from above
|
||||
# -e "s|^# SingleConnectedTechnology.*|SingleConnectedTechnology = true|g" \
|
||||
|
||||
post_install() {
|
||||
add_user system x 430 430 "service" "/var/run/connman" "/bin/sh"
|
||||
add_group system 430
|
||||
|
|
|
@ -11,20 +11,9 @@ PKG_LONGDESC="IP packet filter administration."
|
|||
PKG_TOOLCHAIN="autotools"
|
||||
|
||||
|
||||
case ${DEVICE} in
|
||||
RK356*)
|
||||
PKG_VERSION="1.8.3"
|
||||
PKG_EXTENSION="bz2"
|
||||
PKG_PATCH_DIRS+="4.x"
|
||||
PKG_CONFIGURE_OPTS_TARGET="--with-kernel=$(kernel_path)
|
||||
CPPFLAGS=-I${SYSROOT_PREFIX}/usr/include"
|
||||
;;
|
||||
*)
|
||||
PKG_VERSION="1.8.9"
|
||||
PKG_EXTENSION="xz"
|
||||
PKG_PATCH_DIRS+="5.x"
|
||||
;;
|
||||
esac
|
||||
PKG_VERSION="1.8.9"
|
||||
PKG_EXTENSION="xz"
|
||||
PKG_PATCH_DIRS+="5.x"
|
||||
|
||||
PKG_URL="https://www.netfilter.org/projects/iptables/files/${PKG_NAME}-${PKG_VERSION}.tar.${PKG_EXTENSION}"
|
||||
|
||||
|
|
|
@ -22,13 +22,6 @@ esac
|
|||
|
||||
PKG_URL="https://pkgs.tailscale.com/stable/tailscale_${PKG_VERSION}${TS_ARCH}.tgz"
|
||||
|
||||
# Don't wildcard (X55)
|
||||
case ${DEVICE} in
|
||||
RK3566)
|
||||
PKG_DEPENDS_TARGET+=" wireguard-linux-compat"
|
||||
;;
|
||||
esac
|
||||
|
||||
pre_unpack() {
|
||||
mkdir -p ${PKG_BUILD}
|
||||
tar --strip-components=1 -xf $SOURCES/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tgz -C ${PKG_BUILD} tailscale_${PKG_VERSION}${TS_ARCH}
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
diff -rupN wireguard-linux-compat.orig/src/compat/compat.h wireguard-linux-compat/src/compat/compat.h
|
||||
--- wireguard-linux-compat.orig/src/compat/compat.h 2022-05-12 09:47:59.423533102 +0000
|
||||
+++ wireguard-linux-compat/src/compat/compat.h 2022-05-12 09:49:46.623499934 +0000
|
||||
@@ -686,14 +686,14 @@ struct __compat_dummy_container { char d
|
||||
#define genl_dump_check_consistent(a, b) genl_dump_check_consistent(a, b, &genl_family)
|
||||
#endif
|
||||
|
||||
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && !defined(ISRHEL7)
|
||||
+/* #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && !defined(ISRHEL7)
|
||||
static inline void *skb_put_data(struct sk_buff *skb, const void *data, unsigned int len)
|
||||
{
|
||||
void *tmp = skb_put(skb, len);
|
||||
memcpy(tmp, data, len);
|
||||
return tmp;
|
||||
}
|
||||
-#endif
|
||||
+#endif */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) && !defined(ISRHEL7)
|
||||
#define napi_complete_done(n, work_done) napi_complete(n)
|
|
@ -1,50 +0,0 @@
|
|||
diff -rupN wireguard-linux-compat.orig/src/compat/compat.h wireguard-linux-compat/src/compat/compat.h
|
||||
--- wireguard-linux-compat.orig/src/compat/compat.h 2022-05-18 13:48:16.173696186 +0000
|
||||
+++ wireguard-linux-compat/src/compat/compat.h 2022-05-18 13:54:54.027438354 +0000
|
||||
@@ -414,16 +414,6 @@ static inline u64 __compat_jiffies64_to_
|
||||
}
|
||||
#define jiffies64_to_nsecs __compat_jiffies64_to_nsecs
|
||||
#endif
|
||||
-static inline u64 ktime_get_coarse_boottime_ns(void)
|
||||
-{
|
||||
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
|
||||
- return ktime_to_ns(ktime_get_boottime());
|
||||
-#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 12) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 53)
|
||||
- return ktime_to_ns(ktime_mono_to_any(ns_to_ktime(jiffies64_to_nsecs(get_jiffies_64())), TK_OFFS_BOOT));
|
||||
-#else
|
||||
- return ktime_to_ns(ktime_get_coarse_boottime());
|
||||
-#endif
|
||||
-}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
|
||||
@@ -1080,29 +1070,8 @@ static inline void skb_reset_redirect(st
|
||||
#define pre_exit exit
|
||||
#endif
|
||||
|
||||
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
|
||||
-#include <linux/skbuff.h>
|
||||
-#include <linux/ip.h>
|
||||
-#include <linux/ipv6.h>
|
||||
-static inline __be16 ip_tunnel_parse_protocol(const struct sk_buff *skb)
|
||||
-{
|
||||
- if (skb_network_header(skb) >= skb->head &&
|
||||
- (skb_network_header(skb) + sizeof(struct iphdr)) <= skb_tail_pointer(skb) &&
|
||||
- ip_hdr(skb)->version == 4)
|
||||
- return htons(ETH_P_IP);
|
||||
- if (skb_network_header(skb) >= skb->head &&
|
||||
- (skb_network_header(skb) + sizeof(struct ipv6hdr)) <= skb_tail_pointer(skb) &&
|
||||
- ipv6_hdr(skb)->version == 6)
|
||||
- return htons(ETH_P_IPV6);
|
||||
- return 0;
|
||||
-}
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || defined(ISRHEL8)
|
||||
-static const struct header_ops ip_tunnel_header_ops = { .parse_protocol = ip_tunnel_parse_protocol };
|
||||
-#else
|
||||
#define header_ops hard_header_len
|
||||
#define ip_tunnel_header_ops *(char *)0 - (char *)0
|
||||
-#endif
|
||||
-#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
|
||||
#define kfree_sensitive(a) kzfree(a)
|
|
@ -9,5 +9,5 @@ PKG_LONGDESC="rkbin: Rockchip Firmware and Tool Binaries"
|
|||
PKG_TOOLCHAIN="manual"
|
||||
PKG_PATCH_DIRS+="${DEVICE}*"
|
||||
|
||||
PKG_VERSION="3aafb4dd13a750ab226604875d7938284d4ee9f1"
|
||||
PKG_VERSION="5257e54cc6c15fef28c3b73bd95ca1b55cc8c8cd"
|
||||
PKG_URL="${PKG_SITE}.git"
|
||||
|
|
|
@ -1321,6 +1321,33 @@
|
|||
<input name="x" type="button" id="2" value="1" />
|
||||
<input name="y" type="button" id="3" value="1" />
|
||||
</inputConfig>
|
||||
<inputConfig type="joystick" deviceName="JELOS Gamepad" deviceGUID="0300fcb7341200007856000000000000">
|
||||
<input name="a" type="button" id="1" value="1" />
|
||||
<input name="b" type="button" id="0" value="1" />
|
||||
<input name="down" type="button" id="14" value="1" />
|
||||
<input name="hotkeyenable" type="button" id="8" value="1" />
|
||||
<input name="left" type="button" id="15" value="1" />
|
||||
<input name="leftanalogdown" type="axis" id="1" value="-1" />
|
||||
<input name="leftanalogleft" type="axis" id="0" value="-1" />
|
||||
<input name="leftanalogright" type="axis" id="0" value="1" />
|
||||
<input name="leftanalogup" type="axis" id="1" value="1" />
|
||||
<input name="leftshoulder" type="button" id="4" value="1" />
|
||||
<input name="leftthumb" type="button" id="11" value="1" />
|
||||
<input name="lefttrigger" type="button" id="6" value="1" />
|
||||
<input name="right" type="button" id="16" value="1" />
|
||||
<input name="rightanalogdown" type="axis" id="4" value="-1" />
|
||||
<input name="rightanalogleft" type="axis" id="3" value="-1" />
|
||||
<input name="rightanalogright" type="axis" id="3" value="1" />
|
||||
<input name="rightanalogup" type="axis" id="4" value="1" />
|
||||
<input name="rightshoulder" type="button" id="5" value="1" />
|
||||
<input name="rightthumb" type="button" id="12" value="1" />
|
||||
<input name="righttrigger" type="button" id="7" value="1" />
|
||||
<input name="select" type="button" id="8" value="1" />
|
||||
<input name="start" type="button" id="9" value="1" />
|
||||
<input name="up" type="button" id="13" value="1" />
|
||||
<input name="x" type="button" id="2" value="1" />
|
||||
<input name="y" type="button" id="3" value="1" />
|
||||
</inputConfig>
|
||||
<inputConfig type="joystick" deviceName="XU10 Gamepad" deviceGUID="19009321b0c300000002000010000000">
|
||||
<input name="a" type="button" id="2" value="1" />
|
||||
<input name="b" type="button" id="1" value="1" />
|
||||
|
|
|
@ -7,7 +7,7 @@ PKG_SITE="www.jelos.org"
|
|||
PKG_SECTION="virtual"
|
||||
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}"
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
PKG_NAME="linux"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="https://github.com/JustEnoughLinuxOS"
|
||||
PKG_DEPENDS_HOST="ccache:host rsync:host openssl:host rdfind:host"
|
||||
PKG_DEPENDS_TARGET="toolchain linux:host cpio:host kmod:host xz:host wireless-regdb keyutils util-linux binutils ncurses openssl:host ${KERNEL_EXTRA_DEPENDS_TARGET}"
|
||||
PKG_DEPENDS_HOST="ccache:host rdfind:host rsync:host openssl:host"
|
||||
PKG_DEPENDS_TARGET="toolchain rdfind:host linux:host cpio:host kmod:host xz:host wireless-regdb keyutils util-linux binutils ncurses openssl:host ${KERNEL_EXTRA_DEPENDS_TARGET}"
|
||||
PKG_DEPENDS_INIT="toolchain"
|
||||
PKG_NEED_UNPACK="${LINUX_DEPENDS} $(get_pkg_directory initramfs) $(get_pkg_variable initramfs PKG_NEED_UNPACK)"
|
||||
PKG_LONGDESC="This package builds the kernel for Amlogic devices"
|
||||
|
|
|
@ -109,8 +109,14 @@ esac
|
|||
if [ "${BOOT_INI}" == true ]
|
||||
then
|
||||
echo "boot: create boot.ini..."
|
||||
cp -f ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/boot.ini ${INSTALL}/usr/share/bootloader/boot.ini
|
||||
sed -i "s~@EXTRA_CMDLINE@~${EXTRA_CMDLINE}~g" ${INSTALL}/usr/share/bootloader/boot.ini
|
||||
if [ -e "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/boot.ini" ]
|
||||
then
|
||||
cp -f ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/boot.ini ${INSTALL}/usr/share/bootloader/boot.ini
|
||||
sed -i "s~@EXTRA_CMDLINE@~${EXTRA_CMDLINE}~g" ${INSTALL}/usr/share/bootloader/boot.ini
|
||||
else
|
||||
echo "ERROR: No boot.ini found in ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${EXT_LINUX_CONF}" == true ]
|
||||
|
|
|
@ -56,11 +56,17 @@ esac
|
|||
if [ "${BOOT_INI}" == true ]
|
||||
then
|
||||
echo "boot: create boot.ini..."
|
||||
cp -f ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/boot.ini ${LE_TMP}/boot.ini
|
||||
sed -i "s~@UUID_SYSTEM@~${UUID_SYSTEM}~g" ${LE_TMP}/boot.ini
|
||||
sed -i "s~@UUID_STORAGE@~${UUID_STORAGE}~g" ${LE_TMP}/boot.ini
|
||||
sed -i "s~@EXTRA_CMDLINE@~${EXTRA_CMDLINE}~g" ${LE_TMP}/boot.ini
|
||||
mcopy -so "${LE_TMP}/boot.ini" ::
|
||||
if [ -e "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/boot.ini" ]
|
||||
then
|
||||
cp -f ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/boot.ini ${LE_TMP}/boot.ini
|
||||
sed -i "s~@UUID_SYSTEM@~${UUID_SYSTEM}~g" ${LE_TMP}/boot.ini
|
||||
sed -i "s~@UUID_STORAGE@~${UUID_STORAGE}~g" ${LE_TMP}/boot.ini
|
||||
sed -i "s~@EXTRA_CMDLINE@~${EXTRA_CMDLINE}~g" ${LE_TMP}/boot.ini
|
||||
mcopy -so "${LE_TMP}/boot.ini" ::
|
||||
else
|
||||
echo "ERROR: No boot.ini found in ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p "${LE_TMP}/extlinux"
|
||||
|
|
|
@ -37,6 +37,10 @@ if [ -f ${INSTALL}/usr/share/bootloader/boot.ini ]; then
|
|||
cp -a ${INSTALL}/usr/share/bootloader/boot.ini ${RELEASE_DIR}/3rdparty/bootloader
|
||||
fi
|
||||
|
||||
if [ -f ${INSTALL}/usr/share/bootloader/boot.scr ]; then
|
||||
cp -a ${INSTALL}/usr/share/bootloader/boot.scr ${RELEASE_DIR}/3rdparty/bootloader
|
||||
fi
|
||||
|
||||
LINUX_DTS_DIR=$(get_build_dir linux)/arch/${TARGET_KERNEL_ARCH}/boot/dts/
|
||||
for dtb in $(find ${LINUX_DTS_DIR} -name "*.dtb") ; do
|
||||
if [ -f $dtb ]; then
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -32,39 +32,49 @@
|
|||
PARTITION_TABLE="gpt"
|
||||
UBOOT_LABEL="uboot"
|
||||
TRUST_LABEL="trust"
|
||||
DEVICE_DTB=("rk3566-evb2-lp4x-v10-linux")
|
||||
DEVICE_DTB=("rk3566-powkiddy-x55")
|
||||
UBOOT_DTB="rk3566"
|
||||
UBOOT_CONFIG="rk3568_defconfig"
|
||||
PKG_SOC="rk356x"
|
||||
PKG_DATAFILE="${PKG_RKBIN}/bin/rk35/rk3566_ddr_1056MHz_v1.16.bin"
|
||||
PKG_LOADER="${PKG_RKBIN}/bin/rk35/rk356x_spl_v1.12.bin"
|
||||
PKG_BL31="${PKG_RKBIN}/bin/rk35/rk3568_bl31_v1.42.elf"
|
||||
UBOOT_CONFIG="powkiddy-x55-rk3566_defconfig"
|
||||
PKG_SOC="rk3568"
|
||||
PKG_DATAFILE="${PKG_RKBIN}/bin/rk35/rk3566_ddr_1056MHz_v1.18.bin"
|
||||
PKG_LOADER="spl/u-boot-spl.bin"
|
||||
PKG_BL31="${PKG_RKBIN}/bin/rk35/rk3568_bl31_v1.43.elf"
|
||||
PKG_LOAD_ADDR="0x0a100000"
|
||||
BOOT_INI=false
|
||||
EXT_LINUX_CONF=true
|
||||
|
||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||
KERNEL_MAKE_EXTRACMD=" $(for DTB in "${DEVICE_DTB[@]}"; do echo -n "rockchip/${DTB}.dtb "; done)"
|
||||
KERNEL_EXTRA_DEPENDS_TARGET="zstd libcap libtraceevent"
|
||||
|
||||
# Define the CPU
|
||||
HW_CPU="Rockchip RK3566"
|
||||
|
||||
# Mali GPU family
|
||||
MALI_FAMILY="bifrost-g52"
|
||||
MALI_VERSION="g13p0"
|
||||
OPENGLES="libmali"
|
||||
VULKAN_SUPPORT="no"
|
||||
# MALI_VERSION="g2p0"
|
||||
# OPENGLES="libmali"
|
||||
VULKAN_SUPPORT=""
|
||||
|
||||
GRAPHIC_DRIVERS=""
|
||||
# OpenGL(X) implementation to use (mesa / no)
|
||||
OPENGL="mesa"
|
||||
|
||||
# OpenGL-ES implementation to use (mesa / no)
|
||||
OPENGLES="mesa"
|
||||
|
||||
GRAPHIC_DRIVERS="panfrost"
|
||||
|
||||
# Displayserver to use (weston / x11 / no)
|
||||
DISPLAYSERVER="no"
|
||||
DISPLAYSERVER="wl"
|
||||
|
||||
# Windowmanager to use (fluxbox / weston / no)
|
||||
WINDOWMANAGER="no"
|
||||
WINDOWMANAGER="weston"
|
||||
|
||||
# debug tty path
|
||||
DEBUG_TTY="/dev/ttyS2"
|
||||
|
||||
# kernel serial console
|
||||
EXTRA_CMDLINE="quiet rootwait console=ttyUSB0,1500000 fbcon=rotate:3 console=tty0 ssh consoleblank=0 systemd.show_status=0 loglevel=0 panic=20"
|
||||
EXTRA_CMDLINE="quiet rootwait earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000n8 console=tty1 ssh consoleblank=0 systemd.show_status=0 loglevel=0 panic=20"
|
||||
|
||||
# additional packages to install
|
||||
# ADDITIONAL_PACKAGES=""
|
||||
|
@ -72,13 +82,13 @@
|
|||
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware)
|
||||
# Space separated list is supported,
|
||||
# e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware"
|
||||
FIRMWARE="misc-firmware wlan-firmware RTL8821CS-firmware"
|
||||
FIRMWARE="misc-firmware"
|
||||
|
||||
# additional drivers to install:
|
||||
# for a list of additional drivers see packages/linux-drivers
|
||||
# Space separated list is supported,
|
||||
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
|
||||
# ADDITIONAL_DRIVERS="RTL8821AU RTL8821CU RTL88x2BU"
|
||||
ADDITIONAL_DRIVERS="jelos-gamepad"
|
||||
|
||||
# build and install driver addons (yes / no)
|
||||
DRIVER_ADDONS_SUPPORT="no"
|
||||
|
@ -88,9 +98,6 @@
|
|||
# Space separated list is supported,
|
||||
DRIVER_ADDONS="" #dvb-latest
|
||||
|
||||
# debug tty path
|
||||
DEBUG_TTY="/dev/ttyUSB0"
|
||||
|
||||
# build and install bluetooth support (yes / no)
|
||||
BLUETOOTH_SUPPORT="yes"
|
||||
|
||||
|
@ -109,11 +116,9 @@
|
|||
# build and install SFTP Server (yes / no)
|
||||
SFTP_SERVER="yes"
|
||||
|
||||
# build and install Simple HTTP Server (yes / no)
|
||||
SIMPLE_HTTP_SERVER="yes"
|
||||
|
||||
# build and install OpenVPN support (yes / no)
|
||||
OPENVPN_SUPPORT="no"
|
||||
WIREGUARD_SUPPORT="no"
|
||||
|
||||
# build and install ZeroTier support (yes / no)
|
||||
ZEROTIER_SUPPORT="yes"
|
||||
|
|
File diff suppressed because it is too large
Load diff
8098
projects/Rockchip/devices/RK3566/linux/linux.aarch64.old.conf
Normal file
8098
projects/Rockchip/devices/RK3566/linux/linux.aarch64.old.conf
Normal file
File diff suppressed because it is too large
Load diff
1113
projects/Rockchip/devices/RK3566/linux/linux.jelos.compact.config
Normal file
1113
projects/Rockchip/devices/RK3566/linux/linux.jelos.compact.config
Normal file
File diff suppressed because it is too large
Load diff
|
@ -31,40 +31,50 @@
|
|||
BOOTLOADER="u-boot"
|
||||
PARTITION_TABLE="gpt"
|
||||
UBOOT_LABEL="uboot"
|
||||
TRUST_LABEL="resource"
|
||||
DEVICE_DTB=("rk3566-rg353p-linux" "rk3566-rg353v-linux" "rk3566-rg353m-linux" "rk3566-rg503-linux" "rk3566-rk2023-linux" "rk3566-rgb30-linux" "rk3566-max3pro-linux")
|
||||
TRUST_LABEL="trust"
|
||||
DEVICE_DTB=("rk3566-anbernic-rg353ps" "rk3566-anbernic-rg353vs" "rk3566-anbernic-rg503" "rk3566-anbernic-rg353p" "rk3566-anbernic-rg353v" "rk3566-powkiddy-rk2023" "rk3566-powkiddy-rgb30" "rk3566-powkiddy-rgb10max3")
|
||||
UBOOT_DTB="rk3566"
|
||||
UBOOT_CONFIG="rk3568_defconfig"
|
||||
PKG_SOC="rk356x"
|
||||
PKG_DATAFILE="${PKG_RKBIN}/bin/rk35/rk3566_ddr_1056MHz_v1.16.bin"
|
||||
PKG_LOADER="${PKG_RKBIN}/bin/rk35/rk356x_spl_v1.12.bin"
|
||||
PKG_BL31="${PKG_RKBIN}/bin/rk35/rk3568_bl31_v1.42.elf"
|
||||
UBOOT_CONFIG="anbernic-rgxx3-rk3566_defconfig"
|
||||
PKG_SOC="rk3568"
|
||||
PKG_DATAFILE="${PKG_RKBIN}/bin/rk35/rk3566_ddr_1056MHz_v1.18.bin"
|
||||
PKG_LOADER="spl/u-boot-spl.bin"
|
||||
PKG_BL31="${PKG_RKBIN}/bin/rk35/rk3568_bl31_v1.43.elf"
|
||||
PKG_LOAD_ADDR="0x0a100000"
|
||||
BOOT_INI=false
|
||||
EXT_LINUX_CONF=true
|
||||
|
||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||
KERNEL_MAKE_EXTRACMD=" $(for DTB in "${DEVICE_DTB[@]}"; do echo -n "rockchip/${DTB}.dtb "; done)"
|
||||
KERNEL_EXTRA_DEPENDS_TARGET="zstd libcap libtraceevent"
|
||||
|
||||
# Define the CPU
|
||||
HW_CPU="Rockchip RK3566"
|
||||
|
||||
# Mali GPU family
|
||||
MALI_FAMILY="bifrost-g52"
|
||||
MALI_VERSION="g13p0"
|
||||
OPENGLES="libmali"
|
||||
VULKAN_SUPPORT="no"
|
||||
# MALI_VERSION="g2p0"
|
||||
# OPENGLES="libmali"
|
||||
VULKAN_SUPPORT=""
|
||||
|
||||
GRAPHIC_DRIVERS=""
|
||||
# OpenGL(X) implementation to use (mesa / no)
|
||||
OPENGL="mesa"
|
||||
|
||||
# OpenGL-ES implementation to use (mesa / no)
|
||||
OPENGLES="mesa"
|
||||
|
||||
GRAPHIC_DRIVERS="panfrost"
|
||||
|
||||
# Displayserver to use (weston / x11 / no)
|
||||
DISPLAYSERVER="no"
|
||||
DISPLAYSERVER="wl"
|
||||
|
||||
# Windowmanager to use (fluxbox / weston / no)
|
||||
WINDOWMANAGER="no"
|
||||
WINDOWMANAGER="weston"
|
||||
|
||||
# debug tty path
|
||||
DEBUG_TTY="/dev/ttyS2"
|
||||
|
||||
# kernel serial console
|
||||
EXTRA_CMDLINE="quiet rootwait console=ttyUSB0,1500000 console=tty0 ssh consoleblank=0 systemd.show_status=0 loglevel=0 panic=20 video=HDMI-A-1:1280x720@60"
|
||||
EXTRA_CMDLINE="quiet rootwait earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000n8 console=tty1 ssh consoleblank=0 systemd.show_status=0 loglevel=0 panic=20"
|
||||
|
||||
# additional packages to install
|
||||
# ADDITIONAL_PACKAGES=""
|
||||
|
@ -72,13 +82,13 @@
|
|||
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware)
|
||||
# Space separated list is supported,
|
||||
# e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware"
|
||||
FIRMWARE="misc-firmware wlan-firmware RTL8821CS-firmware RTL8723DS-firmware"
|
||||
FIRMWARE="misc-firmware"
|
||||
|
||||
# additional drivers to install:
|
||||
# for a list of additional drivers see packages/linux-drivers
|
||||
# Space separated list is supported,
|
||||
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
|
||||
ADDITIONAL_DRIVERS="RTL8821AU RTL8821CU RTL88x2BU"
|
||||
ADDITIONAL_DRIVERS="jelos-gamepad"
|
||||
|
||||
# build and install driver addons (yes / no)
|
||||
DRIVER_ADDONS_SUPPORT="no"
|
||||
|
@ -88,9 +98,6 @@
|
|||
# Space separated list is supported,
|
||||
DRIVER_ADDONS="" #dvb-latest
|
||||
|
||||
# debug tty path
|
||||
DEBUG_TTY="/dev/ttyUSB0"
|
||||
|
||||
# build and install bluetooth support (yes / no)
|
||||
BLUETOOTH_SUPPORT="yes"
|
||||
|
||||
|
@ -109,11 +116,9 @@
|
|||
# build and install SFTP Server (yes / no)
|
||||
SFTP_SERVER="yes"
|
||||
|
||||
# build and install Simple HTTP Server (yes / no)
|
||||
SIMPLE_HTTP_SERVER="yes"
|
||||
|
||||
# build and install OpenVPN support (yes / no)
|
||||
OPENVPN_SUPPORT="no"
|
||||
WIREGUARD_SUPPORT="no"
|
||||
|
||||
# build and install ZeroTier support (yes / no)
|
||||
ZEROTIER_SUPPORT="yes"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
PKG_NAME="linux"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="https://github.com/JustEnoughLinuxOS"
|
||||
PKG_DEPENDS_HOST="ccache:host rsync:host openssl:host rdfind:host"
|
||||
PKG_DEPENDS_TARGET="toolchain linux:host cpio:host kmod:host xz:host lz4:host wireless-regdb keyutils util-linux binutils ncurses openssl:host ${KERNEL_EXTRA_DEPENDS_TARGET}"
|
||||
PKG_DEPENDS_HOST="ccache:host rdfind:host rsync:host openssl:host"
|
||||
PKG_DEPENDS_TARGET="toolchain rdfind:host linux:host cpio:host kmod:host xz:host lz4:host wireless-regdb keyutils util-linux binutils ncurses openssl:host ${KERNEL_EXTRA_DEPENDS_TARGET}"
|
||||
PKG_DEPENDS_INIT="toolchain"
|
||||
PKG_NEED_UNPACK="${LINUX_DEPENDS} $(get_pkg_directory initramfs) $(get_pkg_variable initramfs PKG_NEED_UNPACK)"
|
||||
PKG_LONGDESC="This package builds the kernel for Rockchip devices"
|
||||
|
@ -23,22 +23,14 @@ case ${DEVICE} in
|
|||
GET_HANDLER_SUPPORT="git"
|
||||
PKG_GIT_CLONE_BRANCH="main"
|
||||
;;
|
||||
RK3566)
|
||||
PKG_URL="${PKG_SITE}/rk356x-kernel.git"
|
||||
PKG_VERSION="c741d56477939654bb4056be240f93d1ad1ae91e"
|
||||
GET_HANDLER_SUPPORT="git"
|
||||
PKG_GIT_CLONE_BRANCH="main"
|
||||
;;
|
||||
*X55)
|
||||
PKG_URL="${PKG_SITE}/rk3566-x55-kernel.git"
|
||||
PKG_VERSION="9e8f3703fe49d5d12bbb951e233248f5f3eb9efd"
|
||||
GET_HANDLER_SUPPORT="git"
|
||||
PKG_GIT_CLONE_BRANCH="main"
|
||||
;;
|
||||
RK3399|RK3326|RK-ARMV8-A)
|
||||
PKG_VERSION="6.7.4"
|
||||
PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||
;;
|
||||
RK356*)
|
||||
PKG_VERSION="6.8-rc3"
|
||||
PKG_URL="https://git.kernel.org/torvalds/t/${PKG_NAME}-${PKG_VERSION}.tar.gz"
|
||||
;;
|
||||
esac
|
||||
|
||||
PKG_KERNEL_CFG_FILE=$(kernel_config_path) || die
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
From c74b76bb8a4da44a9f8cf06f4aba9f3334e1a148 Mon Sep 17 00:00:00 2001
|
||||
From: Derek Basehore <dbasehore@chromium.org>
|
||||
Date: Tue, 9 Jul 2019 19:16:56 -0700
|
||||
Subject: [PATCH 1/4] drm/panel: Add helper for reading DT rotation
|
||||
|
||||
This adds a helper function for reading the rotation (panel
|
||||
orientation) from the device tree.
|
||||
|
||||
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
|
||||
---
|
||||
drivers/gpu/drm/drm_panel.c | 43 +++++++++++++++++++++++++++++++++++++
|
||||
include/drm/drm_panel.h | 9 ++++++++
|
||||
2 files changed, 52 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
|
||||
index d37b83f40..b2d8fa2c3 100644
|
||||
--- a/drivers/gpu/drm/drm_panel.c
|
||||
+++ b/drivers/gpu/drm/drm_panel.c
|
||||
@@ -168,6 +168,49 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np)
|
||||
return ERR_PTR(-EPROBE_DEFER);
|
||||
}
|
||||
EXPORT_SYMBOL(of_drm_find_panel);
|
||||
+
|
||||
+/**
|
||||
+ * of_drm_get_panel_orientation - look up the orientation of the panel through
|
||||
+ * the "rotation" binding from a device tree node
|
||||
+ * @np: device tree node of the panel
|
||||
+ * @orientation: orientation enum to be filled in
|
||||
+ *
|
||||
+ * Looks up the rotation of a panel in the device tree. The orientation of the
|
||||
+ * panel is expressed as a property name "rotation" in the device tree. The
|
||||
+ * rotation in the device tree is counter clockwise.
|
||||
+ *
|
||||
+ * Return: 0 when a valid rotation value (0, 90, 180, or 270) is read or the
|
||||
+ * rotation property doesn't exist. -EERROR otherwise.
|
||||
+ */
|
||||
+int of_drm_get_panel_orientation(const struct device_node *np,
|
||||
+ enum drm_panel_orientation *orientation)
|
||||
+{
|
||||
+ int rotation, ret;
|
||||
+
|
||||
+ ret = of_property_read_u32(np, "rotation", &rotation);
|
||||
+ if (ret == -EINVAL) {
|
||||
+ /* Don't return an error if there's no rotation property. */
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (rotation == 0)
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL;
|
||||
+ else if (rotation == 90)
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP;
|
||||
+ else if (rotation == 180)
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
|
||||
+ else if (rotation == 270)
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP;
|
||||
+ else
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL(of_drm_get_panel_orientation);
|
||||
#endif
|
||||
|
||||
int drm_panel_notifier_register(struct drm_panel *panel,
|
||||
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
|
||||
index 6aab8fefc..c58c4c19f 100644
|
||||
--- a/include/drm/drm_panel.h
|
||||
+++ b/include/drm/drm_panel.h
|
||||
@@ -53,6 +53,8 @@ struct drm_device;
|
||||
struct drm_panel;
|
||||
struct display_timing;
|
||||
|
||||
+enum drm_panel_orientation;
|
||||
+
|
||||
/**
|
||||
* @loader_protect: protect loader logo panel's power
|
||||
* struct drm_panel_funcs - perform operations on a given panel
|
||||
@@ -240,11 +242,18 @@ int drm_panel_notifier_call_chain(struct drm_panel *panel,
|
||||
|
||||
#if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
|
||||
struct drm_panel *of_drm_find_panel(const struct device_node *np);
|
||||
+int of_drm_get_panel_orientation(const struct device_node *np,
|
||||
+ enum drm_panel_orientation *orientation);
|
||||
#else
|
||||
static inline struct drm_panel *of_drm_find_panel(const struct device_node *np)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
+static inline int of_drm_get_panel_orientation(const struct device_node *np,
|
||||
+ enum drm_panel_orientation *orientation)
|
||||
+{
|
||||
+ return -ENODEV;
|
||||
+}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
From b76306d4adb2e169f8425fb417de565d555fcf22 Mon Sep 17 00:00:00 2001
|
||||
From: Derek Basehore <dbasehore@chromium.org>
|
||||
Date: Sun, 5 Jan 2020 16:51:19 +0100
|
||||
Subject: [PATCH 2/4] drm/connector: Split out orientation quirk detection (v2)
|
||||
|
||||
Not every platform needs quirk detection for panel orientation, so
|
||||
split the drm_connector_init_panel_orientation_property into two
|
||||
functions. One for platforms without the need for quirks, and the
|
||||
other for platforms that need quirks.
|
||||
|
||||
Hans de Goede (changes in v2):
|
||||
|
||||
Rename the function from drm_connector_init_panel_orientation_property
|
||||
to drm_connector_set_panel_orientation[_with_quirk] and pass in the
|
||||
panel-orientation to set.
|
||||
|
||||
Beside the rename, also make the function set the passed in value
|
||||
only once, if the value was set before (to a value other then
|
||||
DRM_MODE_PANEL_ORIENTATION_UNKNOWN) make any further set calls a no-op.
|
||||
|
||||
This change is preparation for allowing the user to override the
|
||||
panel-orientation for any connector from the kernel commandline.
|
||||
When the panel-orientation is overridden this way, then we must ignore
|
||||
the panel-orientation detection done by the driver.
|
||||
|
||||
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
|
||||
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Acked-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20200105155120.96466-1-hdegoede@redhat.com
|
||||
---
|
||||
drivers/gpu/drm/drm_connector.c | 74 ++++++++++++++++++++++++---------
|
||||
include/drm/drm_connector.h | 9 +++-
|
||||
2 files changed, 61 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
|
||||
index 8a2a1965e..77a2087bf 100644
|
||||
--- a/drivers/gpu/drm/drm_connector.c
|
||||
+++ b/drivers/gpu/drm/drm_connector.c
|
||||
@@ -996,7 +996,8 @@ static const struct drm_prop_enum_list dp_colorspaces[] = {
|
||||
* coordinates, so if userspace rotates the picture to adjust for
|
||||
* the orientation it must also apply the same transformation to the
|
||||
* touchscreen input coordinates. This property is initialized by calling
|
||||
- * drm_connector_init_panel_orientation_property().
|
||||
+ * drm_connector_set_panel_orientation() or
|
||||
+ * drm_connector_set_panel_orientation_with_quirk()
|
||||
*
|
||||
* scaling mode:
|
||||
* This property defines how a non-native mode is upscaled to the native
|
||||
@@ -1713,38 +1714,41 @@ void drm_connector_set_link_status_property(struct drm_connector *connector,
|
||||
EXPORT_SYMBOL(drm_connector_set_link_status_property);
|
||||
|
||||
/**
|
||||
- * drm_connector_init_panel_orientation_property -
|
||||
- * initialize the connecters panel_orientation property
|
||||
- * @connector: connector for which to init the panel-orientation property.
|
||||
- * @width: width in pixels of the panel, used for panel quirk detection
|
||||
- * @height: height in pixels of the panel, used for panel quirk detection
|
||||
+ * drm_connector_set_panel_orientation - sets the connecter's panel_orientation
|
||||
+ * @connector: connector for which to set the panel-orientation property.
|
||||
+ * @panel_orientation: drm_panel_orientation value to set
|
||||
+ *
|
||||
+ * This function sets the connector's panel_orientation and attaches
|
||||
+ * a "panel orientation" property to the connector.
|
||||
*
|
||||
- * This function should only be called for built-in panels, after setting
|
||||
- * connector->display_info.panel_orientation first (if known).
|
||||
+ * Calling this function on a connector where the panel_orientation has
|
||||
+ * already been set is a no-op (e.g. the orientation has been overridden with
|
||||
+ * a kernel commandline option).
|
||||
*
|
||||
- * This function will check for platform specific (e.g. DMI based) quirks
|
||||
- * overriding display_info.panel_orientation first, then if panel_orientation
|
||||
- * is not DRM_MODE_PANEL_ORIENTATION_UNKNOWN it will attach the
|
||||
- * "panel orientation" property to the connector.
|
||||
+ * It is allowed to call this function with a panel_orientation of
|
||||
+ * DRM_MODE_PANEL_ORIENTATION_UNKNOWN, in which case it is a no-op.
|
||||
*
|
||||
* Returns:
|
||||
* Zero on success, negative errno on failure.
|
||||
*/
|
||||
-int drm_connector_init_panel_orientation_property(
|
||||
- struct drm_connector *connector, int width, int height)
|
||||
+int drm_connector_set_panel_orientation(
|
||||
+ struct drm_connector *connector,
|
||||
+ enum drm_panel_orientation panel_orientation)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_display_info *info = &connector->display_info;
|
||||
struct drm_property *prop;
|
||||
- int orientation_quirk;
|
||||
|
||||
- orientation_quirk = drm_get_panel_orientation_quirk(width, height);
|
||||
- if (orientation_quirk != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
- info->panel_orientation = orientation_quirk;
|
||||
+ /* Already set? */
|
||||
+ if (info->panel_orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
+ return 0;
|
||||
|
||||
- if (info->panel_orientation == DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
+ /* Don't attach the property if the orientation is unknown */
|
||||
+ if (panel_orientation == DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
return 0;
|
||||
|
||||
+ info->panel_orientation = panel_orientation;
|
||||
+
|
||||
prop = dev->mode_config.panel_orientation_property;
|
||||
if (!prop) {
|
||||
prop = drm_property_create_enum(dev, DRM_MODE_PROP_IMMUTABLE,
|
||||
@@ -1761,7 +1765,37 @@ int drm_connector_init_panel_orientation_property(
|
||||
info->panel_orientation);
|
||||
return 0;
|
||||
}
|
||||
-EXPORT_SYMBOL(drm_connector_init_panel_orientation_property);
|
||||
+EXPORT_SYMBOL(drm_connector_set_panel_orientation);
|
||||
+
|
||||
+/**
|
||||
+ * drm_connector_set_panel_orientation_with_quirk -
|
||||
+ * set the connecter's panel_orientation after checking for quirks
|
||||
+ * @connector: connector for which to init the panel-orientation property.
|
||||
+ * @panel_orientation: drm_panel_orientation value to set
|
||||
+ * @width: width in pixels of the panel, used for panel quirk detection
|
||||
+ * @height: height in pixels of the panel, used for panel quirk detection
|
||||
+ *
|
||||
+ * Like drm_connector_set_panel_orientation(), but with a check for platform
|
||||
+ * specific (e.g. DMI based) quirks overriding the passed in panel_orientation.
|
||||
+ *
|
||||
+ * Returns:
|
||||
+ * Zero on success, negative errno on failure.
|
||||
+ */
|
||||
+int drm_connector_set_panel_orientation_with_quirk(
|
||||
+ struct drm_connector *connector,
|
||||
+ enum drm_panel_orientation panel_orientation,
|
||||
+ int width, int height)
|
||||
+{
|
||||
+ int orientation_quirk;
|
||||
+
|
||||
+ orientation_quirk = drm_get_panel_orientation_quirk(width, height);
|
||||
+ if (orientation_quirk != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
+ panel_orientation = orientation_quirk;
|
||||
+
|
||||
+ return drm_connector_set_panel_orientation(connector,
|
||||
+ panel_orientation);
|
||||
+}
|
||||
+EXPORT_SYMBOL(drm_connector_set_panel_orientation_with_quirk);
|
||||
|
||||
int drm_connector_set_obj_prop(struct drm_mode_object *obj,
|
||||
struct drm_property *property,
|
||||
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
|
||||
index 1d81bb31f..44b6c7f85 100644
|
||||
--- a/include/drm/drm_connector.h
|
||||
+++ b/include/drm/drm_connector.h
|
||||
@@ -1473,8 +1473,13 @@ int drm_connector_update_edid_property(struct drm_connector *connector,
|
||||
const struct edid *edid);
|
||||
void drm_connector_set_link_status_property(struct drm_connector *connector,
|
||||
uint64_t link_status);
|
||||
-int drm_connector_init_panel_orientation_property(
|
||||
- struct drm_connector *connector, int width, int height);
|
||||
+int drm_connector_set_panel_orientation(
|
||||
+ struct drm_connector *connector,
|
||||
+ enum drm_panel_orientation panel_orientation);
|
||||
+int drm_connector_set_panel_orientation_with_quirk(
|
||||
+ struct drm_connector *connector,
|
||||
+ enum drm_panel_orientation panel_orientation,
|
||||
+ int width, int height);
|
||||
|
||||
/**
|
||||
* struct drm_tile_group - Tile group metadata
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
From 953791baf27ea161378af5c78d8db337472507c8 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Osipenko <digetx@gmail.com>
|
||||
Date: Fri, 14 Aug 2020 00:56:09 +0300
|
||||
Subject: [PATCH 3/4] drm/panel-simple: Read panel orientation
|
||||
|
||||
The panel orientation needs to parsed from a device-tree and assigned to
|
||||
the panel's connector in order to make orientation property available to
|
||||
userspace. That's what this patch does for the panel-simple driver.
|
||||
|
||||
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
|
||||
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20200813215609.28643-5-digetx@gmail.com
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-simple.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
|
||||
index f41d4e091..f10181b93 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-simple.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-simple.c
|
||||
@@ -127,6 +127,8 @@ struct panel_simple {
|
||||
struct gpio_desc *spi_scl_gpio;
|
||||
struct gpio_desc *spi_cs_gpio;
|
||||
struct device_node *np_crtc;
|
||||
+
|
||||
+ enum drm_panel_orientation orientation;
|
||||
};
|
||||
|
||||
enum rockchip_cmd_type {
|
||||
@@ -442,6 +444,9 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
|
||||
if (panel->desc->bus_flags)
|
||||
connector->display_info.bus_flags = panel->desc->bus_flags;
|
||||
|
||||
+ /* set up connector's "panel orientation" property */
|
||||
+ drm_connector_set_panel_orientation(connector, panel->orientation);
|
||||
+
|
||||
return num;
|
||||
}
|
||||
|
||||
@@ -789,6 +794,12 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
|
||||
return -EPROBE_DEFER;
|
||||
}
|
||||
|
||||
+ err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
|
||||
+ if (err) {
|
||||
+ dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
|
||||
if (ddc) {
|
||||
panel->ddc = of_find_i2c_adapter_by_node(ddc);
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
From ad469e3890607d81f4b6ee0f8035537d76937370 Mon Sep 17 00:00:00 2001
|
||||
From: Johnny on Flame <johnnyonflame@hotmail.com>
|
||||
Date: Mon, 7 Aug 2023 20:59:28 +0000
|
||||
Subject: [PATCH 4/4] dts: Define the orientation of the Powkiddy X55 panel.
|
||||
|
||||
---
|
||||
.../boot/dts/rockchip/lcd/lcd_HX8394F_720x1280_mipi_dsi0.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/lcd/lcd_HX8394F_720x1280_mipi_dsi0.dtsi b/arch/arm64/boot/dts/rockchip/lcd/lcd_HX8394F_720x1280_mipi_dsi0.dtsi
|
||||
index 5eb492203..b3745a81b 100755
|
||||
--- a/arch/arm64/boot/dts/rockchip/lcd/lcd_HX8394F_720x1280_mipi_dsi0.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/lcd/lcd_HX8394F_720x1280_mipi_dsi0.dtsi
|
||||
@@ -16,7 +16,7 @@
|
||||
init-delay-ms = <60>;
|
||||
unprepare-delay-ms = <60>;
|
||||
disable-delay-ms = <60>;
|
||||
-
|
||||
+ rotation = <90>;
|
||||
|
||||
dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
|
||||
MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index 1c06eae06..9465e5561 100755
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -710,6 +710,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, array-compare)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overread)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, address)
|
||||
+KBUILD_CFLAGS += $(call cc-disable-warning, enum-int-mismatch)
|
||||
|
||||
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||
KBUILD_CFLAGS += -Os
|
|
@ -0,0 +1,60 @@
|
|||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts 2023-10-03 23:48:55.102040451 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rg353x.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG353P";
|
||||
+ model = "Anbernic RG353P";
|
||||
compatible = "anbernic,rg353p", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
||||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353ps.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353ps.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353ps.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353ps.dts 2023-10-03 23:49:18.163158275 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rg353x.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG353PS";
|
||||
+ model = "Anbernic RG353PS";
|
||||
compatible = "anbernic,rg353ps", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
||||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts 2023-10-03 23:49:09.254725978 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rg353x.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG353V";
|
||||
+ model = "Anbernic RG353V";
|
||||
compatible = "anbernic,rg353v", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
||||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts 2023-10-03 23:49:30.947779716 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rg353x.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG353VS";
|
||||
+ model = "Anbernic RG353VS";
|
||||
compatible = "anbernic,rg353vs", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
||||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts 2023-10-03 23:49:41.912313646 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rgxx3.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG503";
|
||||
+ model = "Anbernic RG503";
|
||||
compatible = "anbernic,rg503", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
|
@ -0,0 +1,21 @@
|
|||
diff -rupN linux-6.6-orig/drivers/power/supply/rk817_charger.c linux-6.6/drivers/power/supply/rk817_charger.c
|
||||
--- linux-6.6-orig/drivers/power/supply/rk817_charger.c 2023-10-30 02:31:08.000000000 +0000
|
||||
+++ linux-6.6/drivers/power/supply/rk817_charger.c 2023-11-22 19:43:15.957223087 +0000
|
||||
@@ -679,7 +679,7 @@ static enum power_supply_usb_type rk817_
|
||||
};
|
||||
|
||||
static const struct power_supply_desc rk817_bat_desc = {
|
||||
- .name = "rk817-battery",
|
||||
+ .name = "battery",
|
||||
.type = POWER_SUPPLY_TYPE_BATTERY,
|
||||
.properties = rk817_bat_props,
|
||||
.num_properties = ARRAY_SIZE(rk817_bat_props),
|
||||
@@ -687,7 +687,7 @@ static const struct power_supply_desc rk
|
||||
};
|
||||
|
||||
static const struct power_supply_desc rk817_chg_desc = {
|
||||
- .name = "rk817-charger",
|
||||
+ .name = "charger",
|
||||
.type = POWER_SUPPLY_TYPE_USB,
|
||||
.usb_types = rk817_usb_type,
|
||||
.num_usb_types = ARRAY_SIZE(rk817_usb_type),
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,715 @@
|
|||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: devicetree@vger.kernel.org
|
||||
Cc: linux-rockchip@lists.infradead.org, maccraft123mc@gmail.com,
|
||||
sebastian.reichel@collabora.com, heiko@sntech.de,
|
||||
conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
|
||||
robh+dt@kernel.org, Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH 0/3] Add Support for Anbernic RG351V
|
||||
Date: Mon, 20 Nov 2023 17:01:28 -0600 [thread overview]
|
||||
Message-ID: <20231120230131.57705-1-macroalpha82@gmail.com> (raw)
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Add support for the Anbernic RG351V handheld gaming console.
|
||||
|
||||
Chris Morgan (3):
|
||||
dt-bindings: arm: rockchip: Add Anbernic RG351V
|
||||
arm64: dts: rockchip: Split RG351M from Odroid Go Advance
|
||||
arm64: dts: rockchip: Add Anbernic RG351V
|
||||
|
||||
.../devicetree/bindings/arm/rockchip.yaml | 6 +-
|
||||
arch/arm64/boot/dts/rockchip/Makefile | 1 +
|
||||
.../dts/rockchip/rk3326-anbernic-rg351m.dts | 18 +-
|
||||
.../dts/rockchip/rk3326-anbernic-rg351m.dtsi | 478 ++++++++++++++++++
|
||||
.../dts/rockchip/rk3326-anbernic-rg351v.dts | 44 ++
|
||||
5 files changed, 529 insertions(+), 18 deletions(-)
|
||||
create mode 100644 arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dtsi
|
||||
create mode 100644 arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351v.dts
|
||||
|
||||
--
|
||||
2.34.1
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: devicetree@vger.kernel.org
|
||||
Cc: linux-rockchip@lists.infradead.org, maccraft123mc@gmail.com,
|
||||
sebastian.reichel@collabora.com, heiko@sntech.de,
|
||||
conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
|
||||
robh+dt@kernel.org, Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH 1/3] dt-bindings: arm: rockchip: Add Anbernic RG351V
|
||||
Date: Mon, 20 Nov 2023 17:01:29 -0600 [thread overview]
|
||||
Message-ID: <20231120230131.57705-2-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231120230131.57705-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
The Anbernic RG351V is a portable gaming console from Anbernic with the
|
||||
RK3326 SoC.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
Documentation/devicetree/bindings/arm/rockchip.yaml | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
||||
index 5f7c6c4aad8f..3786f901a1a7 100644
|
||||
--- a/Documentation/devicetree/bindings/arm/rockchip.yaml
|
||||
+++ b/Documentation/devicetree/bindings/arm/rockchip.yaml
|
||||
@@ -30,9 +30,11 @@ properties:
|
||||
- const: amarula,vyasa-rk3288
|
||||
- const: rockchip,rk3288
|
||||
|
||||
- - description: Anbernic RG351M
|
||||
+ - description: Anbernic RK3326 Handheld Gaming Console
|
||||
items:
|
||||
- - const: anbernic,rg351m
|
||||
+ - enum:
|
||||
+ - anbernic,rg351m
|
||||
+ - anbernic,rg351v
|
||||
- const: rockchip,rk3326
|
||||
|
||||
- description: Anbernic RG353P
|
||||
--
|
||||
2.34.1
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: devicetree@vger.kernel.org
|
||||
Cc: linux-rockchip@lists.infradead.org, maccraft123mc@gmail.com,
|
||||
sebastian.reichel@collabora.com, heiko@sntech.de,
|
||||
conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
|
||||
robh+dt@kernel.org, Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH 2/3] arm64: dts: rockchip: Split RG351M from Odroid Go Advance
|
||||
Date: Mon, 20 Nov 2023 17:01:30 -0600 [thread overview]
|
||||
Message-ID: <20231120230131.57705-3-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231120230131.57705-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Split the RG351M into its own DTSI file. The RG351M, unlike the Odroid
|
||||
Go Advance, has no ADC joysticks, no GPIO buttons (except for volume
|
||||
on the RG351V), a PWM vibrator that interferes with an Odroid
|
||||
regulator, and different LEDs. Split the RG351M into a DTSI file
|
||||
that can then be imported into the DTS files for the RG351M and a
|
||||
new RG351V.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
.../dts/rockchip/rk3326-anbernic-rg351m.dts | 18 +-
|
||||
.../dts/rockchip/rk3326-anbernic-rg351m.dtsi | 478 ++++++++++++++++++
|
||||
2 files changed, 480 insertions(+), 16 deletions(-)
|
||||
create mode 100644 arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dtsi
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts
|
||||
index ce318e05f0a6..f4d20f29c1b4 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts
|
||||
@@ -6,30 +6,16 @@
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
-#include "rk3326-odroid-go.dtsi"
|
||||
+#include "rk3326-anbernic-rg351m.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Anbernic RG351M";
|
||||
compatible = "anbernic,rg351m", "rockchip,rk3326";
|
||||
-
|
||||
- vibrator {
|
||||
- compatible = "pwm-vibrator";
|
||||
- pwms = <&pwm0 0 1000000 0>;
|
||||
- pwm-names = "enable";
|
||||
- };
|
||||
};
|
||||
|
||||
-/delete-node/ &builtin_gamepad;
|
||||
-/delete-node/ &vcc_host; /* conflicts with pwm vibration motor */
|
||||
-
|
||||
&internal_display {
|
||||
compatible = "elida,kd35t133";
|
||||
iovcc-supply = <&vcc_lcd>;
|
||||
+ rotation = <270>;
|
||||
vdd-supply = <&vcc_lcd>;
|
||||
};
|
||||
-
|
||||
-&pwm0 {
|
||||
- status = "okay";
|
||||
-};
|
||||
-
|
||||
-/delete-node/ &rk817_charger;
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dtsi b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dtsi
|
||||
new file mode 100644
|
||||
index 000000000000..89e64647b4fa
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dtsi
|
||||
@@ -0,0 +1,478 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+/*
|
||||
+ * Copyright (c) 2019 Hardkernel Co., Ltd
|
||||
+ * Copyright (c) 2020 Theobroma Systems Design und Consulting GmbH
|
||||
+ * Copyright (c) 2022 Maya Matuszczyk <maccraft123mc@gmail.com>
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+#include <dt-bindings/leds/common.h>
|
||||
+#include <dt-bindings/pinctrl/rockchip.h>
|
||||
+#include "rk3326.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ aliases {
|
||||
+ mmc0 = &sdmmc;
|
||||
+ };
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = "serial2:115200n8";
|
||||
+ };
|
||||
+
|
||||
+ backlight: backlight {
|
||||
+ compatible = "pwm-backlight";
|
||||
+ power-supply = <&vcc_bl>;
|
||||
+ pwms = <&pwm1 0 25000 0>;
|
||||
+ };
|
||||
+
|
||||
+ /*
|
||||
+ * LED is a tri-state. Driven high it is red, driven low it is
|
||||
+ * green, and not driven at all (pin set to input) it is amber.
|
||||
+ * Additionally, there is a 2nd LED that is not controllable
|
||||
+ * that is on (red) when plugged in to power.
|
||||
+ */
|
||||
+ gpio_led: gpio-leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&led_pin>;
|
||||
+
|
||||
+ red_green_led: led-0 {
|
||||
+ color = <LED_COLOR_ID_RED>;
|
||||
+ gpios = <&gpio2 RK_PB5 GPIO_ACTIVE_HIGH>;
|
||||
+ function = LED_FUNCTION_CHARGING;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ rk817-sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "rk817_int";
|
||||
+ simple-audio-card,format = "i2s";
|
||||
+ simple-audio-card,hp-det-gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
|
||||
+ simple-audio-card,mclk-fs = <256>;
|
||||
+ simple-audio-card,widgets =
|
||||
+ "Microphone", "Mic Jack",
|
||||
+ "Headphone", "Headphones",
|
||||
+ "Speaker", "Speaker";
|
||||
+ simple-audio-card,routing =
|
||||
+ "MICL", "Mic Jack",
|
||||
+ "Headphones", "HPOL",
|
||||
+ "Headphones", "HPOR",
|
||||
+ "Speaker", "SPKO";
|
||||
+
|
||||
+ simple-audio-card,codec {
|
||||
+ sound-dai = <&rk817>;
|
||||
+ };
|
||||
+
|
||||
+ simple-audio-card,cpu {
|
||||
+ sound-dai = <&i2s1_2ch>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vccsys: vccsys {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc3v8_sys";
|
||||
+ regulator-always-on;
|
||||
+ regulator-min-microvolt = <3800000>;
|
||||
+ regulator-max-microvolt = <3800000>;
|
||||
+ };
|
||||
+
|
||||
+ vibrator {
|
||||
+ compatible = "pwm-vibrator";
|
||||
+ pwms = <&pwm0 0 1000000 0>;
|
||||
+ pwm-names = "enable";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&cpu0 {
|
||||
+ cpu-supply = <&vdd_arm>;
|
||||
+};
|
||||
+
|
||||
+&cpu1 {
|
||||
+ cpu-supply = <&vdd_arm>;
|
||||
+};
|
||||
+
|
||||
+&cpu2 {
|
||||
+ cpu-supply = <&vdd_arm>;
|
||||
+};
|
||||
+
|
||||
+&cpu3 {
|
||||
+ cpu-supply = <&vdd_arm>;
|
||||
+};
|
||||
+
|
||||
+&cru {
|
||||
+ assigned-clocks = <&cru PLL_NPLL>,
|
||||
+ <&cru ACLK_BUS_PRE>, <&cru ACLK_PERI_PRE>,
|
||||
+ <&cru HCLK_BUS_PRE>, <&cru HCLK_PERI_PRE>,
|
||||
+ <&cru PCLK_BUS_PRE>, <&cru SCLK_GPU>;
|
||||
+
|
||||
+ assigned-clock-rates = <1188000000>,
|
||||
+ <200000000>, <200000000>,
|
||||
+ <150000000>, <150000000>,
|
||||
+ <100000000>, <200000000>;
|
||||
+};
|
||||
+
|
||||
+&display_subsystem {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&dsi {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ ports {
|
||||
+ mipi_out: port@1 {
|
||||
+ reg = <1>;
|
||||
+
|
||||
+ mipi_out_panel: endpoint {
|
||||
+ remote-endpoint = <&mipi_in_panel>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ internal_display: panel@0 {
|
||||
+ reg = <0>;
|
||||
+ backlight = <&backlight>;
|
||||
+ reset-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>;
|
||||
+
|
||||
+ port {
|
||||
+ mipi_in_panel: endpoint {
|
||||
+ remote-endpoint = <&mipi_out_panel>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&dsi_dphy {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&gpu {
|
||||
+ mali-supply = <&vdd_logic>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2c0 {
|
||||
+ clock-frequency = <400000>;
|
||||
+ i2c-scl-falling-time-ns = <16>;
|
||||
+ i2c-scl-rising-time-ns = <280>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ rk817: pmic@20 {
|
||||
+ compatible = "rockchip,rk817";
|
||||
+ reg = <0x20>;
|
||||
+ #clock-cells = <1>;
|
||||
+ clock-names = "mclk";
|
||||
+ clock-output-names = "rk808-clkout1", "xin32k";
|
||||
+ clocks = <&cru SCLK_I2S1_OUT>;
|
||||
+ interrupt-parent = <&gpio0>;
|
||||
+ interrupts = <RK_PB2 IRQ_TYPE_LEVEL_LOW>;
|
||||
+ pinctrl-0 = <&pmic_int>, <&i2s1_2ch_mclk>;
|
||||
+ pinctrl-names = "default";
|
||||
+ #sound-dai-cells = <0>;
|
||||
+ wakeup-source;
|
||||
+
|
||||
+ vcc1-supply = <&vccsys>;
|
||||
+ vcc2-supply = <&vccsys>;
|
||||
+ vcc3-supply = <&vccsys>;
|
||||
+ vcc4-supply = <&vccsys>;
|
||||
+ vcc5-supply = <&vccsys>;
|
||||
+ vcc6-supply = <&vccsys>;
|
||||
+ vcc7-supply = <&vccsys>;
|
||||
+ vcc8-supply = <&vccsys>;
|
||||
+
|
||||
+ regulators {
|
||||
+ vdd_logic: DCDC_REG1 {
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <1150000>;
|
||||
+ regulator-min-microvolt = <950000>;
|
||||
+ regulator-name = "vdd_logic";
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <950000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdd_arm: DCDC_REG2 {
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-min-microvolt = <950000>;
|
||||
+ regulator-name = "vdd_arm";
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ regulator-suspend-microvolt = <950000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_ddr: DCDC_REG3 {
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-name = "vcc_ddr";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_3v3: DCDC_REG4 {
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-name = "vcc_3v3";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ regulator-suspend-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_1v8: LDO_REG2 {
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-name = "vcc_1v8";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <1800000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdd_1v0: LDO_REG3 {
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <1000000>;
|
||||
+ regulator-min-microvolt = <1000000>;
|
||||
+ regulator-name = "vdd_1v0";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <1000000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_pmu: LDO_REG4 {
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-name = "vcc3v3_pmu";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vccio_sd: LDO_REG5 {
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-name = "vccio_sd";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_sd: LDO_REG6 {
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-name = "vcc_sd";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_bl: LDO_REG7 {
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-name = "vcc_bl";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ regulator-suspend-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_lcd: LDO_REG8 {
|
||||
+ regulator-max-microvolt = <2800000>;
|
||||
+ regulator-min-microvolt = <2800000>;
|
||||
+ regulator-name = "vcc_lcd";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ regulator-suspend-microvolt = <2800000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_wifi: LDO_REG9 {
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-name = "vcc_wifi";
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ regulator-suspend-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ usb_midu: BOOST {
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <5400000>;
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-name = "usb_midu";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ rk817_codec: codec {
|
||||
+ rockchip,mic-in-differential;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2s1_2ch {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&io_domains {
|
||||
+ vccio1-supply = <&vcc_3v3>;
|
||||
+ vccio2-supply = <&vccio_sd>;
|
||||
+ vccio3-supply = <&vcc_3v3>;
|
||||
+ vccio4-supply = <&vcc_3v3>;
|
||||
+ vccio5-supply = <&vcc_3v3>;
|
||||
+ vccio6-supply = <&vcc_3v3>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pmu_io_domains {
|
||||
+ pmuio1-supply = <&vcc3v3_pmu>;
|
||||
+ pmuio2-supply = <&vcc3v3_pmu>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pwm0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pwm1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&saradc {
|
||||
+ vref-supply = <&vcc_1v8>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sdmmc {
|
||||
+ cap-sd-highspeed;
|
||||
+ card-detect-delay = <200>;
|
||||
+ cd-gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_LOW>;
|
||||
+ sd-uhs-sdr12;
|
||||
+ sd-uhs-sdr25;
|
||||
+ sd-uhs-sdr50;
|
||||
+ sd-uhs-sdr104;
|
||||
+ vmmc-supply = <&vcc_sd>;
|
||||
+ vqmmc-supply = <&vccio_sd>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sfc {
|
||||
+ #address-cells = <1>;
|
||||
+ pinctrl-0 = <&sfc_clk &sfc_cs0 &sfc_bus2>;
|
||||
+ pinctrl-names = "default";
|
||||
+ #size-cells = <0>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ flash@0 {
|
||||
+ compatible = "jedec,spi-nor";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <108000000>;
|
||||
+ spi-rx-bus-width = <2>;
|
||||
+ spi-tx-bus-width = <1>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&tsadc {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&u2phy {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ u2phy_host: host-port {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ u2phy_otg: otg-port {
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&usb20_otg {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart2 {
|
||||
+ pinctrl-0 = <&uart2m1_xfer>;
|
||||
+ pinctrl-names = "default";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vopb {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vopb_mmu {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ headphone {
|
||||
+ hp_det: hp-det {
|
||||
+ rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ led_pin: led-pin {
|
||||
+ rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pmic {
|
||||
+ dc_det: dc-det {
|
||||
+ rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ pmic_int: pmic-int {
|
||||
+ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
+ };
|
||||
+
|
||||
+ soc_slppin_gpio: soc_slppin_gpio {
|
||||
+ rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_output_low>;
|
||||
+ };
|
||||
+
|
||||
+ soc_slppin_rst: soc_slppin_rst {
|
||||
+ rockchip,pins = <0 RK_PA4 2 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ soc_slppin_slp: soc_slppin_slp {
|
||||
+ rockchip,pins = <0 RK_PA4 1 &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: devicetree@vger.kernel.org
|
||||
Cc: linux-rockchip@lists.infradead.org, maccraft123mc@gmail.com,
|
||||
sebastian.reichel@collabora.com, heiko@sntech.de,
|
||||
conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
|
||||
robh+dt@kernel.org, Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH 3/3] arm64: dts: rockchip: Add Anbernic RG351V
|
||||
Date: Mon, 20 Nov 2023 17:01:31 -0600 [thread overview]
|
||||
Message-ID: <20231120230131.57705-4-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231120230131.57705-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Add support for the Anbernic RG351V, which is a handheld gaming console
|
||||
from Anbernic with an RK3326 SoC, a 640x480 LCD display, a single
|
||||
analog joystick with several face buttons, two USB C ports, and
|
||||
internal WiFi over USB. All hardware has been tested as working
|
||||
except for the battery, which will require further modification to the
|
||||
mainline rk817 battery driver before it can be used (the device was
|
||||
built without a shunt resistor, and as such the battery cannot
|
||||
measure current; only voltage).
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/Makefile | 1 +
|
||||
.../dts/rockchip/rk3326-anbernic-rg351v.dts | 44 +++++++++++++++++++
|
||||
2 files changed, 45 insertions(+)
|
||||
create mode 100644 arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351v.dts
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
|
||||
index a18f33bf0c0e..0ac27cf782d7 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/Makefile
|
||||
+++ b/arch/arm64/boot/dts/rockchip/Makefile
|
||||
@@ -9,6 +9,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-roc-cc.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-rock-pi-s.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3318-a95x-z2.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-anbernic-rg351m.dtb
|
||||
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-anbernic-rg351v.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go2.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go2-v11.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go3.dtb
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351v.dts b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351v.dts
|
||||
new file mode 100644
|
||||
index 000000000000..c2f9b56ca5f9
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351v.dts
|
||||
@@ -0,0 +1,44 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "rk3326-anbernic-rg351m.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Anbernic RG351V";
|
||||
+ compatible = "anbernic,rg351v", "rockchip,rk3326";
|
||||
+
|
||||
+ gpio_keys_vol: gpio-keys-vol {
|
||||
+ compatible = "gpio-keys";
|
||||
+ autorepeat;
|
||||
+
|
||||
+ button-vol-down {
|
||||
+ label = "VOLUMEDOWN";
|
||||
+ linux,code = <KEY_VOLUMEDOWN>;
|
||||
+ gpios = <&gpio2 RK_PA1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ button-vol-up {
|
||||
+ label = "VOLUMEUP";
|
||||
+ linux,code = <KEY_VOLUMEUP>;
|
||||
+ gpios = <&gpio2 RK_PA0 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&internal_display {
|
||||
+ compatible = "anbernic,rg351v-panel", "newvision,nv3051d";
|
||||
+ vdd-supply = <&vcc_lcd>;
|
||||
+};
|
||||
+
|
||||
+&io_domains {
|
||||
+ vccio1-supply = <&vccio_sd>;
|
||||
+};
|
||||
+
|
||||
+&vcc_sd {
|
||||
+ regulator-max-microvolt = <3000000>;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+};
|
||||
+
|
||||
+&vccio_sd {
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+};
|
||||
--
|
||||
2.34.1
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
|
||||
index 4a33d2e47f33..6d22628129d0 100644
|
||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
||||
@@ -2008,6 +2008,11 @@ static int rtw_chip_efuse_info_setup(struct rtw_dev *rtwdev)
|
||||
efuse->ext_pa_5g = efuse->pa_type_5g & BIT(0) ? 1 : 0;
|
||||
efuse->ext_lna_2g = efuse->lna_type_5g & BIT(3) ? 1 : 0;
|
||||
|
||||
+ if (!is_valid_ether_addr(efuse->addr)) {
|
||||
+ eth_random_addr(efuse->addr);
|
||||
+ dev_warn(rtwdev->dev, "efuse MAC invalid, using random\n");
|
||||
+ }
|
||||
+
|
||||
out_disable:
|
||||
rtw_chip_efuse_disable(rtwdev);
|
File diff suppressed because it is too large
Load diff
|
@ -1,103 +0,0 @@
|
|||
From c74b76bb8a4da44a9f8cf06f4aba9f3334e1a148 Mon Sep 17 00:00:00 2001
|
||||
From: Derek Basehore <dbasehore@chromium.org>
|
||||
Date: Tue, 9 Jul 2019 19:16:56 -0700
|
||||
Subject: [PATCH 1/4] drm/panel: Add helper for reading DT rotation
|
||||
|
||||
This adds a helper function for reading the rotation (panel
|
||||
orientation) from the device tree.
|
||||
|
||||
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
|
||||
---
|
||||
drivers/gpu/drm/drm_panel.c | 43 +++++++++++++++++++++++++++++++++++++
|
||||
include/drm/drm_panel.h | 9 ++++++++
|
||||
2 files changed, 52 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
|
||||
index d37b83f40..b2d8fa2c3 100644
|
||||
--- a/drivers/gpu/drm/drm_panel.c
|
||||
+++ b/drivers/gpu/drm/drm_panel.c
|
||||
@@ -168,6 +168,49 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np)
|
||||
return ERR_PTR(-EPROBE_DEFER);
|
||||
}
|
||||
EXPORT_SYMBOL(of_drm_find_panel);
|
||||
+
|
||||
+/**
|
||||
+ * of_drm_get_panel_orientation - look up the orientation of the panel through
|
||||
+ * the "rotation" binding from a device tree node
|
||||
+ * @np: device tree node of the panel
|
||||
+ * @orientation: orientation enum to be filled in
|
||||
+ *
|
||||
+ * Looks up the rotation of a panel in the device tree. The orientation of the
|
||||
+ * panel is expressed as a property name "rotation" in the device tree. The
|
||||
+ * rotation in the device tree is counter clockwise.
|
||||
+ *
|
||||
+ * Return: 0 when a valid rotation value (0, 90, 180, or 270) is read or the
|
||||
+ * rotation property doesn't exist. -EERROR otherwise.
|
||||
+ */
|
||||
+int of_drm_get_panel_orientation(const struct device_node *np,
|
||||
+ enum drm_panel_orientation *orientation)
|
||||
+{
|
||||
+ int rotation, ret;
|
||||
+
|
||||
+ ret = of_property_read_u32(np, "rotation", &rotation);
|
||||
+ if (ret == -EINVAL) {
|
||||
+ /* Don't return an error if there's no rotation property. */
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (rotation == 0)
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL;
|
||||
+ else if (rotation == 90)
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP;
|
||||
+ else if (rotation == 180)
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
|
||||
+ else if (rotation == 270)
|
||||
+ *orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP;
|
||||
+ else
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL(of_drm_get_panel_orientation);
|
||||
#endif
|
||||
|
||||
int drm_panel_notifier_register(struct drm_panel *panel,
|
||||
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
|
||||
index 6aab8fefc..c58c4c19f 100644
|
||||
--- a/include/drm/drm_panel.h
|
||||
+++ b/include/drm/drm_panel.h
|
||||
@@ -53,6 +53,8 @@ struct drm_device;
|
||||
struct drm_panel;
|
||||
struct display_timing;
|
||||
|
||||
+enum drm_panel_orientation;
|
||||
+
|
||||
/**
|
||||
* @loader_protect: protect loader logo panel's power
|
||||
* struct drm_panel_funcs - perform operations on a given panel
|
||||
@@ -240,11 +242,18 @@ int drm_panel_notifier_call_chain(struct drm_panel *panel,
|
||||
|
||||
#if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
|
||||
struct drm_panel *of_drm_find_panel(const struct device_node *np);
|
||||
+int of_drm_get_panel_orientation(const struct device_node *np,
|
||||
+ enum drm_panel_orientation *orientation);
|
||||
#else
|
||||
static inline struct drm_panel *of_drm_find_panel(const struct device_node *np)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
+static inline int of_drm_get_panel_orientation(const struct device_node *np,
|
||||
+ enum drm_panel_orientation *orientation)
|
||||
+{
|
||||
+ return -ENODEV;
|
||||
+}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
From b76306d4adb2e169f8425fb417de565d555fcf22 Mon Sep 17 00:00:00 2001
|
||||
From: Derek Basehore <dbasehore@chromium.org>
|
||||
Date: Sun, 5 Jan 2020 16:51:19 +0100
|
||||
Subject: [PATCH 2/4] drm/connector: Split out orientation quirk detection (v2)
|
||||
|
||||
Not every platform needs quirk detection for panel orientation, so
|
||||
split the drm_connector_init_panel_orientation_property into two
|
||||
functions. One for platforms without the need for quirks, and the
|
||||
other for platforms that need quirks.
|
||||
|
||||
Hans de Goede (changes in v2):
|
||||
|
||||
Rename the function from drm_connector_init_panel_orientation_property
|
||||
to drm_connector_set_panel_orientation[_with_quirk] and pass in the
|
||||
panel-orientation to set.
|
||||
|
||||
Beside the rename, also make the function set the passed in value
|
||||
only once, if the value was set before (to a value other then
|
||||
DRM_MODE_PANEL_ORIENTATION_UNKNOWN) make any further set calls a no-op.
|
||||
|
||||
This change is preparation for allowing the user to override the
|
||||
panel-orientation for any connector from the kernel commandline.
|
||||
When the panel-orientation is overridden this way, then we must ignore
|
||||
the panel-orientation detection done by the driver.
|
||||
|
||||
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
|
||||
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Acked-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20200105155120.96466-1-hdegoede@redhat.com
|
||||
---
|
||||
drivers/gpu/drm/drm_connector.c | 74 ++++++++++++++++++++++++---------
|
||||
include/drm/drm_connector.h | 9 +++-
|
||||
2 files changed, 61 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
|
||||
index 8a2a1965e..77a2087bf 100644
|
||||
--- a/drivers/gpu/drm/drm_connector.c
|
||||
+++ b/drivers/gpu/drm/drm_connector.c
|
||||
@@ -996,7 +996,8 @@ static const struct drm_prop_enum_list dp_colorspaces[] = {
|
||||
* coordinates, so if userspace rotates the picture to adjust for
|
||||
* the orientation it must also apply the same transformation to the
|
||||
* touchscreen input coordinates. This property is initialized by calling
|
||||
- * drm_connector_init_panel_orientation_property().
|
||||
+ * drm_connector_set_panel_orientation() or
|
||||
+ * drm_connector_set_panel_orientation_with_quirk()
|
||||
*
|
||||
* scaling mode:
|
||||
* This property defines how a non-native mode is upscaled to the native
|
||||
@@ -1713,38 +1714,41 @@ void drm_connector_set_link_status_property(struct drm_connector *connector,
|
||||
EXPORT_SYMBOL(drm_connector_set_link_status_property);
|
||||
|
||||
/**
|
||||
- * drm_connector_init_panel_orientation_property -
|
||||
- * initialize the connecters panel_orientation property
|
||||
- * @connector: connector for which to init the panel-orientation property.
|
||||
- * @width: width in pixels of the panel, used for panel quirk detection
|
||||
- * @height: height in pixels of the panel, used for panel quirk detection
|
||||
+ * drm_connector_set_panel_orientation - sets the connecter's panel_orientation
|
||||
+ * @connector: connector for which to set the panel-orientation property.
|
||||
+ * @panel_orientation: drm_panel_orientation value to set
|
||||
+ *
|
||||
+ * This function sets the connector's panel_orientation and attaches
|
||||
+ * a "panel orientation" property to the connector.
|
||||
*
|
||||
- * This function should only be called for built-in panels, after setting
|
||||
- * connector->display_info.panel_orientation first (if known).
|
||||
+ * Calling this function on a connector where the panel_orientation has
|
||||
+ * already been set is a no-op (e.g. the orientation has been overridden with
|
||||
+ * a kernel commandline option).
|
||||
*
|
||||
- * This function will check for platform specific (e.g. DMI based) quirks
|
||||
- * overriding display_info.panel_orientation first, then if panel_orientation
|
||||
- * is not DRM_MODE_PANEL_ORIENTATION_UNKNOWN it will attach the
|
||||
- * "panel orientation" property to the connector.
|
||||
+ * It is allowed to call this function with a panel_orientation of
|
||||
+ * DRM_MODE_PANEL_ORIENTATION_UNKNOWN, in which case it is a no-op.
|
||||
*
|
||||
* Returns:
|
||||
* Zero on success, negative errno on failure.
|
||||
*/
|
||||
-int drm_connector_init_panel_orientation_property(
|
||||
- struct drm_connector *connector, int width, int height)
|
||||
+int drm_connector_set_panel_orientation(
|
||||
+ struct drm_connector *connector,
|
||||
+ enum drm_panel_orientation panel_orientation)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_display_info *info = &connector->display_info;
|
||||
struct drm_property *prop;
|
||||
- int orientation_quirk;
|
||||
|
||||
- orientation_quirk = drm_get_panel_orientation_quirk(width, height);
|
||||
- if (orientation_quirk != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
- info->panel_orientation = orientation_quirk;
|
||||
+ /* Already set? */
|
||||
+ if (info->panel_orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
+ return 0;
|
||||
|
||||
- if (info->panel_orientation == DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
+ /* Don't attach the property if the orientation is unknown */
|
||||
+ if (panel_orientation == DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
return 0;
|
||||
|
||||
+ info->panel_orientation = panel_orientation;
|
||||
+
|
||||
prop = dev->mode_config.panel_orientation_property;
|
||||
if (!prop) {
|
||||
prop = drm_property_create_enum(dev, DRM_MODE_PROP_IMMUTABLE,
|
||||
@@ -1761,7 +1765,37 @@ int drm_connector_init_panel_orientation_property(
|
||||
info->panel_orientation);
|
||||
return 0;
|
||||
}
|
||||
-EXPORT_SYMBOL(drm_connector_init_panel_orientation_property);
|
||||
+EXPORT_SYMBOL(drm_connector_set_panel_orientation);
|
||||
+
|
||||
+/**
|
||||
+ * drm_connector_set_panel_orientation_with_quirk -
|
||||
+ * set the connecter's panel_orientation after checking for quirks
|
||||
+ * @connector: connector for which to init the panel-orientation property.
|
||||
+ * @panel_orientation: drm_panel_orientation value to set
|
||||
+ * @width: width in pixels of the panel, used for panel quirk detection
|
||||
+ * @height: height in pixels of the panel, used for panel quirk detection
|
||||
+ *
|
||||
+ * Like drm_connector_set_panel_orientation(), but with a check for platform
|
||||
+ * specific (e.g. DMI based) quirks overriding the passed in panel_orientation.
|
||||
+ *
|
||||
+ * Returns:
|
||||
+ * Zero on success, negative errno on failure.
|
||||
+ */
|
||||
+int drm_connector_set_panel_orientation_with_quirk(
|
||||
+ struct drm_connector *connector,
|
||||
+ enum drm_panel_orientation panel_orientation,
|
||||
+ int width, int height)
|
||||
+{
|
||||
+ int orientation_quirk;
|
||||
+
|
||||
+ orientation_quirk = drm_get_panel_orientation_quirk(width, height);
|
||||
+ if (orientation_quirk != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
|
||||
+ panel_orientation = orientation_quirk;
|
||||
+
|
||||
+ return drm_connector_set_panel_orientation(connector,
|
||||
+ panel_orientation);
|
||||
+}
|
||||
+EXPORT_SYMBOL(drm_connector_set_panel_orientation_with_quirk);
|
||||
|
||||
int drm_connector_set_obj_prop(struct drm_mode_object *obj,
|
||||
struct drm_property *property,
|
||||
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
|
||||
index 1d81bb31f..44b6c7f85 100644
|
||||
--- a/include/drm/drm_connector.h
|
||||
+++ b/include/drm/drm_connector.h
|
||||
@@ -1473,8 +1473,13 @@ int drm_connector_update_edid_property(struct drm_connector *connector,
|
||||
const struct edid *edid);
|
||||
void drm_connector_set_link_status_property(struct drm_connector *connector,
|
||||
uint64_t link_status);
|
||||
-int drm_connector_init_panel_orientation_property(
|
||||
- struct drm_connector *connector, int width, int height);
|
||||
+int drm_connector_set_panel_orientation(
|
||||
+ struct drm_connector *connector,
|
||||
+ enum drm_panel_orientation panel_orientation);
|
||||
+int drm_connector_set_panel_orientation_with_quirk(
|
||||
+ struct drm_connector *connector,
|
||||
+ enum drm_panel_orientation panel_orientation,
|
||||
+ int width, int height);
|
||||
|
||||
/**
|
||||
* struct drm_tile_group - Tile group metadata
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
From 953791baf27ea161378af5c78d8db337472507c8 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Osipenko <digetx@gmail.com>
|
||||
Date: Fri, 14 Aug 2020 00:56:09 +0300
|
||||
Subject: [PATCH 3/4] drm/panel-simple: Read panel orientation
|
||||
|
||||
The panel orientation needs to parsed from a device-tree and assigned to
|
||||
the panel's connector in order to make orientation property available to
|
||||
userspace. That's what this patch does for the panel-simple driver.
|
||||
|
||||
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
|
||||
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
||||
Link: https://patchwork.freedesktop.org/patch/msgid/20200813215609.28643-5-digetx@gmail.com
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-simple.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
|
||||
index f41d4e091..f10181b93 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-simple.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-simple.c
|
||||
@@ -127,6 +127,8 @@ struct panel_simple {
|
||||
struct gpio_desc *spi_scl_gpio;
|
||||
struct gpio_desc *spi_cs_gpio;
|
||||
struct device_node *np_crtc;
|
||||
+
|
||||
+ enum drm_panel_orientation orientation;
|
||||
};
|
||||
|
||||
enum rockchip_cmd_type {
|
||||
@@ -442,6 +444,9 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
|
||||
if (panel->desc->bus_flags)
|
||||
connector->display_info.bus_flags = panel->desc->bus_flags;
|
||||
|
||||
+ /* set up connector's "panel orientation" property */
|
||||
+ drm_connector_set_panel_orientation(connector, panel->orientation);
|
||||
+
|
||||
return num;
|
||||
}
|
||||
|
||||
@@ -789,6 +794,12 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
|
||||
return -EPROBE_DEFER;
|
||||
}
|
||||
|
||||
+ err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
|
||||
+ if (err) {
|
||||
+ dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
|
||||
if (ddc) {
|
||||
panel->ddc = of_find_i2c_adapter_by_node(ddc);
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index 60197900e..b0d6dbe83 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -710,6 +710,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, array-compare)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overread)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, address)
|
||||
+KBUILD_CFLAGS += $(call cc-disable-warning, enum-int-mismatch)
|
||||
|
||||
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||
KBUILD_CFLAGS += -Os
|
|
@ -0,0 +1,60 @@
|
|||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts 2023-10-03 23:48:55.102040451 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rg353x.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG353P";
|
||||
+ model = "Anbernic RG353P";
|
||||
compatible = "anbernic,rg353p", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
||||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353ps.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353ps.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353ps.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353ps.dts 2023-10-03 23:49:18.163158275 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rg353x.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG353PS";
|
||||
+ model = "Anbernic RG353PS";
|
||||
compatible = "anbernic,rg353ps", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
||||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts 2023-10-03 23:49:09.254725978 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rg353x.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG353V";
|
||||
+ model = "Anbernic RG353V";
|
||||
compatible = "anbernic,rg353v", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
||||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts 2023-10-03 23:49:30.947779716 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rg353x.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG353VS";
|
||||
+ model = "Anbernic RG353VS";
|
||||
compatible = "anbernic,rg353vs", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
||||
diff -rupN linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts
|
||||
--- linux-6.6-rc3.orig/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts 2023-10-03 23:48:15.144113656 +0000
|
||||
+++ linux-6.6-rc3/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts 2023-10-03 23:49:41.912313646 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "rk3566-anbernic-rgxx3.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "RG503";
|
||||
+ model = "Anbernic RG503";
|
||||
compatible = "anbernic,rg503", "rockchip,rk3566";
|
||||
|
||||
aliases {
|
|
@ -0,0 +1,21 @@
|
|||
diff -rupN linux-6.6-orig/drivers/power/supply/rk817_charger.c linux-6.6/drivers/power/supply/rk817_charger.c
|
||||
--- linux-6.6-orig/drivers/power/supply/rk817_charger.c 2023-10-30 02:31:08.000000000 +0000
|
||||
+++ linux-6.6/drivers/power/supply/rk817_charger.c 2023-11-22 19:43:15.957223087 +0000
|
||||
@@ -679,7 +679,7 @@ static enum power_supply_usb_type rk817_
|
||||
};
|
||||
|
||||
static const struct power_supply_desc rk817_bat_desc = {
|
||||
- .name = "rk817-battery",
|
||||
+ .name = "battery",
|
||||
.type = POWER_SUPPLY_TYPE_BATTERY,
|
||||
.properties = rk817_bat_props,
|
||||
.num_properties = ARRAY_SIZE(rk817_bat_props),
|
||||
@@ -687,7 +687,7 @@ static const struct power_supply_desc rk
|
||||
};
|
||||
|
||||
static const struct power_supply_desc rk817_chg_desc = {
|
||||
- .name = "rk817-charger",
|
||||
+ .name = "charger",
|
||||
.type = POWER_SUPPLY_TYPE_USB,
|
||||
.usb_types = rk817_usb_type,
|
||||
.num_usb_types = ARRAY_SIZE(rk817_usb_type),
|
|
@ -0,0 +1,32 @@
|
|||
diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
|
||||
index 94d89ffd596..923e4df1420 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
|
||||
@@ -477,18 +477,18 @@ static const struct drm_display_mode nv3051d_rgxx3_modes[] = {
|
||||
};
|
||||
|
||||
static const struct drm_display_mode nv3051d_rk2023_modes[] = {
|
||||
- {
|
||||
+ {
|
||||
.hdisplay = 640,
|
||||
- .hsync_start = 640 + 40,
|
||||
- .hsync_end = 640 + 40 + 2,
|
||||
- .htotal = 640 + 40 + 2 + 80,
|
||||
+ .hsync_start = 640 + 48,
|
||||
+ .hsync_end = 640 + 48 + 2,
|
||||
+ .htotal = 640 + 48 + 2 + 47,
|
||||
.vdisplay = 480,
|
||||
- .vsync_start = 480 + 18,
|
||||
- .vsync_end = 480 + 18 + 2,
|
||||
- .vtotal = 480 + 18 + 2 + 4,
|
||||
- .clock = 24150,
|
||||
+ .vsync_start = 480 + 2,
|
||||
+ .vsync_end = 480 + 2 + 4,
|
||||
+ .vtotal = 480 + 2 + 4 + 3,
|
||||
+ .clock = 21600,
|
||||
.flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
- },
|
||||
+ }
|
||||
};
|
||||
|
||||
static const struct nv3051d_panel_info nv3051d_rg351v_info = {
|
|
@ -0,0 +1,71 @@
|
|||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: linux-input@vger.kernel.org
|
||||
Cc: dmitry.torokhov@gmail.com, hdegoede@redhat.com,
|
||||
paul@crapouillou.net, peter.hutterer@who-t.net, svv@google.com,
|
||||
biswarupp@google.com, contact@artur-rojek.eu,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH 1/2] Input: add input_invert_abs()
|
||||
Date: Sun, 31 Dec 2023 14:56:42 -0600 [thread overview]
|
||||
Message-ID: <20231231205643.129435-2-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231231205643.129435-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Add a helper function to make it easier for a driver to invert abs
|
||||
values when needed. It is up to the driver itself to track axes that
|
||||
need to be inverted and normalize the data before it is passed on.
|
||||
|
||||
This function assumes that drivers will set the min and max values
|
||||
so that min < max and then will simply call this function each time
|
||||
the values need to be inverted.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
drivers/input/input.c | 19 +++++++++++++++++++
|
||||
include/linux/input.h | 1 +
|
||||
2 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/drivers/input/input.c b/drivers/input/input.c
|
||||
index 8c5fdb0f858a..f135aed165a1 100644
|
||||
--- a/drivers/input/input.c
|
||||
+++ b/drivers/input/input.c
|
||||
@@ -552,6 +552,25 @@ void input_copy_abs(struct input_dev *dst, unsigned int dst_axis,
|
||||
}
|
||||
EXPORT_SYMBOL(input_copy_abs);
|
||||
|
||||
+/**
|
||||
+ * input_invert_abs - Invert the abs value for an inverted axis.
|
||||
+ * @dev: Input device with absolute events
|
||||
+ * @axis: ABS_* value selecting the destination axis for the event to
|
||||
+ * invert.
|
||||
+ * @val: Value to be inverted based on min and max values of the axis.
|
||||
+ *
|
||||
+ * Return an inverted value for a given ABS axis based on its min and
|
||||
+ * max values.
|
||||
+ */
|
||||
+int input_invert_abs(struct input_dev *dev, unsigned int axis, int val)
|
||||
+{
|
||||
+ int min = dev->absinfo[axis].minimum;
|
||||
+ int max = dev->absinfo[axis].maximum;
|
||||
+
|
||||
+ return (max + min) - val;
|
||||
+}
|
||||
+EXPORT_SYMBOL(input_invert_abs);
|
||||
+
|
||||
/**
|
||||
* input_grab_device - grabs device for exclusive use
|
||||
* @handle: input handle that wants to own the device
|
||||
diff --git a/include/linux/input.h b/include/linux/input.h
|
||||
index de6503c0edb8..deb5f8bb0ec7 100644
|
||||
--- a/include/linux/input.h
|
||||
+++ b/include/linux/input.h
|
||||
@@ -477,6 +477,7 @@ void input_set_abs_params(struct input_dev *dev, unsigned int axis,
|
||||
int min, int max, int fuzz, int flat);
|
||||
void input_copy_abs(struct input_dev *dst, unsigned int dst_axis,
|
||||
const struct input_dev *src, unsigned int src_axis);
|
||||
+int input_invert_abs(struct input_dev *dev, unsigned int axis, int val);
|
||||
|
||||
#define INPUT_GENERATE_ABS_ACCESSORS(_suffix, _item) \
|
||||
static inline int input_abs_get_##_suffix(struct input_dev *dev, \
|
||||
--
|
||||
2.34.1
|
|
@ -0,0 +1,77 @@
|
|||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: linux-input@vger.kernel.org
|
||||
Cc: dmitry.torokhov@gmail.com, hdegoede@redhat.com,
|
||||
paul@crapouillou.net, peter.hutterer@who-t.net, svv@google.com,
|
||||
biswarupp@google.com, contact@artur-rojek.eu,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH 2/2] Input: adc-joystick: Handle inverted axes
|
||||
Date: Sun, 31 Dec 2023 14:56:43 -0600 [thread overview]
|
||||
Message-ID: <20231231205643.129435-3-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231231205643.129435-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
When one or more axes are inverted, (where min > max), normalize the
|
||||
data so that min < max and call a helper function to invert the
|
||||
values reported to the input stack.
|
||||
|
||||
This ensures we can continue defining the device correctly in the
|
||||
device tree while not breaking downstream assumptions that min is
|
||||
always less than max.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
drivers/input/joystick/adc-joystick.c | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/input/joystick/adc-joystick.c b/drivers/input/joystick/adc-joystick.c
|
||||
index c0deff5d4282..4e8d446987b6 100644
|
||||
--- a/drivers/input/joystick/adc-joystick.c
|
||||
+++ b/drivers/input/joystick/adc-joystick.c
|
||||
@@ -18,6 +18,7 @@ struct adc_joystick_axis {
|
||||
s32 range[2];
|
||||
s32 fuzz;
|
||||
s32 flat;
|
||||
+ bool inverted;
|
||||
};
|
||||
|
||||
struct adc_joystick {
|
||||
@@ -38,6 +39,8 @@ static void adc_joystick_poll(struct input_dev *input)
|
||||
ret = iio_read_channel_raw(&joy->chans[i], &val);
|
||||
if (ret < 0)
|
||||
return;
|
||||
+ if (joy->axes[i].inverted)
|
||||
+ val = input_invert_abs(input, i, val);
|
||||
input_report_abs(input, joy->axes[i].code, val);
|
||||
}
|
||||
input_sync(input);
|
||||
@@ -86,6 +89,8 @@ static int adc_joystick_handle(const void *data, void *private)
|
||||
val = sign_extend32(val, msb);
|
||||
else
|
||||
val &= GENMASK(msb, 0);
|
||||
+ if (joy->axes[i].inverted)
|
||||
+ val = input_invert_abs(joy->input, i, val);
|
||||
input_report_abs(joy->input, joy->axes[i].code, val);
|
||||
}
|
||||
|
||||
@@ -168,11 +173,17 @@ static int adc_joystick_set_axes(struct device *dev, struct adc_joystick *joy)
|
||||
goto err_fwnode_put;
|
||||
}
|
||||
|
||||
+ if (axes[i].range[0] > axes[i].range[1]) {
|
||||
+ dev_dbg(dev, "abs-axis %d inverted\n", i);
|
||||
+ axes[i].inverted = 1;
|
||||
+ }
|
||||
+
|
||||
fwnode_property_read_u32(child, "abs-fuzz", &axes[i].fuzz);
|
||||
fwnode_property_read_u32(child, "abs-flat", &axes[i].flat);
|
||||
|
||||
input_set_abs_params(joy->input, axes[i].code,
|
||||
- axes[i].range[0], axes[i].range[1],
|
||||
+ min_array(axes[i].range, 2),
|
||||
+ max_array(axes[i].range, 2),
|
||||
axes[i].fuzz, axes[i].flat);
|
||||
input_set_capability(joy->input, EV_ABS, axes[i].code);
|
||||
}
|
||||
--
|
||||
2.34.1
|
|
@ -0,0 +1,261 @@
|
|||
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
|
||||
index b7371afb6227..2ee31fc6bd8e 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/Makefile
|
||||
+++ b/arch/arm64/boot/dts/rockchip/Makefile
|
||||
@@ -79,6 +79,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg503.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.1.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.2.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-powkiddy-rgb30.dtb
|
||||
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-powkiddy-rgb10max3.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-powkiddy-rk2023.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-quartz64-a.dtb
|
||||
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-quartz64-b.dtb
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-powkiddy-rgb10max3.dts b/arch/arm64/boot/dts/rockchip/rk3566-powkiddy-rgb10max3.dts
|
||||
new file mode 100644
|
||||
index 000000000000..26884dfda818
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3566-powkiddy-rgb10max3.dts
|
||||
@@ -0,0 +1,40 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+
|
||||
+/dts-v1/;
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+#include <dt-bindings/pinctrl/rockchip.h>
|
||||
+#include "rk3566-powkiddy-rk2023.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Powkiddy RGB10MAX3";
|
||||
+ compatible = "powkiddy,rgb10max3", "rockchip,rk3566";
|
||||
+};
|
||||
+
|
||||
+&cru {
|
||||
+ assigned-clocks = <&pmucru CLK_RTC_32K>, <&cru PLL_GPLL>,
|
||||
+ <&pmucru PLL_PPLL>, <&cru PLL_VPLL>;
|
||||
+ assigned-clock-rates = <32768>, <1200000000>,
|
||||
+ <200000000>, <292500000>;
|
||||
+};
|
||||
+
|
||||
+&dsi0 {
|
||||
+ panel: panel@0 {
|
||||
+ compatible = "powkiddy,rgb10max3-panel";
|
||||
+ reg = <0>;
|
||||
+ backlight = <&backlight>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&lcd_rst>;
|
||||
+ reset-gpios = <&gpio4 RK_PA0 GPIO_ACTIVE_LOW>;
|
||||
+ vcc-supply = <&vcc3v3_lcd0_n>;
|
||||
+ iovcc-supply = <&vcc3v3_lcd0_n>;
|
||||
+ rotation = <270>;
|
||||
+
|
||||
+ port {
|
||||
+ mipi_in_panel: endpoint {
|
||||
+ remote-endpoint = <&mipi_out_panel>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
index b55bafd1a8be..e8d1730241b4 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
@@ -58,7 +58,7 @@ struct st7703 {
|
||||
struct gpio_desc *reset_gpio;
|
||||
struct regulator *vcc;
|
||||
struct regulator *iovcc;
|
||||
- bool prepared;
|
||||
+ enum drm_panel_orientation orientation;
|
||||
|
||||
struct dentry *debugfs;
|
||||
const struct st7703_panel_desc *desc;
|
||||
@@ -493,6 +493,76 @@ static int rgb30panel_init_sequence(struct st7703 *ctx)
|
||||
0x13, 0x15, 0x14, 0x15, 0x10, 0x17, 0x00, 0x0a,
|
||||
0x0f, 0x29, 0x3b, 0x3f, 0x42, 0x39, 0x06, 0x0d,
|
||||
0x10, 0x13, 0x15, 0x14, 0x15, 0x10, 0x17);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int rgb10max3_init_sequence(struct st7703 *ctx)
|
||||
+{
|
||||
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
+
|
||||
+ /*
|
||||
+ * Init sequence was supplied by the panel vendor.
|
||||
+ */
|
||||
+
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETEXTC, 0xf1, 0x12, 0x83);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETAPID, 0x00, 0x00, 0x00,
|
||||
+ 0xda, 0x80);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETDISP, 0xc8, 0x02, 0x30);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETRGBIF, 0x10, 0x10, 0x28,
|
||||
+ 0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x04, 0x04);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x78, 0x78);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22, 0xf0,
|
||||
+ 0x63);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05, 0xf9,
|
||||
+ 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x44, 0x25, 0x00, 0x90, 0x0a, 0x00,
|
||||
+ 0x00, 0x01, 0x4f, 0x01, 0x00, 0x00, 0x37);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVDC, 0x47);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_BF, 0x02, 0x11, 0x00);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETSCR, 0x73, 0x73, 0x50, 0x50,
|
||||
+ 0x00, 0x00, 0x12, 0x70, 0x00);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER, 0x25, 0x00, 0x32,
|
||||
+ 0x32, 0x77, 0xe1, 0xff, 0xff, 0xcc, 0xcc, 0x77,
|
||||
+ 0x77);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETECO, 0x82, 0x00, 0xbf, 0xff,
|
||||
+ 0x00, 0xff);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETIO, 0xb8, 0x00, 0x0a, 0x00,
|
||||
+ 0x00, 0x00);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCABC, 0x10, 0x40, 0x1e,
|
||||
+ 0x02);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0b);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETGAMMA, 0x00, 0x04, 0x07,
|
||||
+ 0x2a, 0x39, 0x3f, 0x36, 0x31, 0x06, 0x0b, 0x0e,
|
||||
+ 0x12, 0x14, 0x12, 0x13, 0x0f, 0x17, 0x00, 0x04,
|
||||
+ 0x07, 0x2a, 0x39, 0x3f, 0x36, 0x31, 0x06, 0x0b,
|
||||
+ 0x0e, 0x12, 0x14, 0x12, 0x13, 0x0f, 0x17);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETEQ, 0x03, 0x03, 0x03, 0x03,
|
||||
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff, 0x80,
|
||||
+ 0xc0, 0x10);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP1, 0xc8, 0x10, 0x08, 0x00,
|
||||
+ 0x00, 0x41, 0xf8, 0x12, 0x31, 0x23, 0x37, 0x86,
|
||||
+ 0x11, 0xc8, 0x37, 0x2a, 0x00, 0x00, 0x0c, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||
+ 0x88, 0x20, 0x46, 0x02, 0x88, 0x88, 0x88, 0x88,
|
||||
+ 0x88, 0x88, 0xff, 0x88, 0x31, 0x57, 0x13, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0xff, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP2, 0x00, 0x1a, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x8f, 0x13, 0x31, 0x75, 0x88, 0x88, 0x88, 0x88,
|
||||
+ 0x88, 0x88, 0xf8, 0x8f, 0x02, 0x20, 0x64, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0xf8, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00);
|
||||
+ mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_EF, 0xff, 0xff, 0x01);
|
||||
+
|
||||
+
|
||||
+
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -512,6 +582,21 @@ static const struct drm_display_mode rgb30panel_mode = {
|
||||
.height_mm = 76,
|
||||
};
|
||||
|
||||
+static const struct drm_display_mode rgb10max3panel_mode = {
|
||||
+ .hdisplay = 720,
|
||||
+ .hsync_start = 720 + 60,
|
||||
+ .hsync_end = 720 + 60 + 10,
|
||||
+ .htotal = 720 + 60 + 10 + 20,
|
||||
+ .vdisplay = 1280,
|
||||
+ .vsync_start = 1280 + 16,
|
||||
+ .vsync_end = 1280 + 16 + 4,
|
||||
+ .vtotal = 1280 + 16 + 4 + 14,
|
||||
+ .clock = 60000,
|
||||
+ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
+ .width_mm = 63,
|
||||
+ .height_mm = 111,
|
||||
+};
|
||||
+
|
||||
static const struct st7703_panel_desc rgb30panel_desc = {
|
||||
.mode = &rgb30panel_mode,
|
||||
.lanes = 4,
|
||||
@@ -521,6 +606,15 @@ static const struct st7703_panel_desc rgb30panel_desc = {
|
||||
.init_sequence = rgb30panel_init_sequence,
|
||||
};
|
||||
|
||||
+static const struct st7703_panel_desc rgb10max3panel_desc = {
|
||||
+ .mode = &rgb10max3panel_mode,
|
||||
+ .lanes = 4,
|
||||
+ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
|
||||
+ MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_LPM,
|
||||
+ .format = MIPI_DSI_FMT_RGB888,
|
||||
+ .init_sequence = rgb10max3_init_sequence,
|
||||
+};
|
||||
+
|
||||
static int st7703_enable(struct drm_panel *panel)
|
||||
{
|
||||
struct st7703 *ctx = panel_to_st7703(panel);
|
||||
@@ -575,13 +669,9 @@ static int st7703_unprepare(struct drm_panel *panel)
|
||||
{
|
||||
struct st7703 *ctx = panel_to_st7703(panel);
|
||||
|
||||
- if (!ctx->prepared)
|
||||
- return 0;
|
||||
-
|
||||
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
regulator_disable(ctx->iovcc);
|
||||
regulator_disable(ctx->vcc);
|
||||
- ctx->prepared = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -591,9 +681,6 @@ static int st7703_prepare(struct drm_panel *panel)
|
||||
struct st7703 *ctx = panel_to_st7703(panel);
|
||||
int ret;
|
||||
|
||||
- if (ctx->prepared)
|
||||
- return 0;
|
||||
-
|
||||
dev_dbg(ctx->dev, "Resetting the panel\n");
|
||||
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
|
||||
@@ -616,8 +703,6 @@ static int st7703_prepare(struct drm_panel *panel)
|
||||
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
|
||||
usleep_range(15000, 20000);
|
||||
|
||||
- ctx->prepared = true;
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -653,12 +738,20 @@ static int st7703_get_modes(struct drm_panel *panel,
|
||||
return 1;
|
||||
}
|
||||
|
||||
+static enum drm_panel_orientation st7703_get_orientation(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct st7703 *ctx = panel_to_st7703(panel);
|
||||
+
|
||||
+ return ctx->orientation;
|
||||
+}
|
||||
+
|
||||
static const struct drm_panel_funcs st7703_drm_funcs = {
|
||||
.disable = st7703_disable,
|
||||
.unprepare = st7703_unprepare,
|
||||
.prepare = st7703_prepare,
|
||||
.enable = st7703_enable,
|
||||
.get_modes = st7703_get_modes,
|
||||
+ .get_orientation = st7703_get_orientation,
|
||||
};
|
||||
|
||||
static int allpixelson_set(void *data, u64 val)
|
||||
@@ -709,6 +802,12 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
|
||||
if (IS_ERR(ctx->reset_gpio))
|
||||
return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "Failed to get reset gpio\n");
|
||||
|
||||
+ ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
mipi_dsi_set_drvdata(dsi, ctx);
|
||||
|
||||
ctx->dev = dev;
|
||||
@@ -785,6 +884,7 @@ static void st7703_remove(struct mipi_dsi_device *dsi)
|
||||
static const struct of_device_id st7703_of_match[] = {
|
||||
{ .compatible = "anbernic,rg353v-panel-v2", .data = &rg353v2_desc },
|
||||
{ .compatible = "powkiddy,rgb30-panel", .data = &rgb30panel_desc },
|
||||
+ { .compatible = "powkiddy,rgb10max3-panel", .data = &rgb10max3panel_desc },
|
||||
{ .compatible = "rocktech,jh057n00900", .data = &jh057n00900_panel_desc },
|
||||
{ .compatible = "xingbangda,xbd599", .data = &xbd599_desc },
|
||||
{ /* sentinel */ }
|
|
@ -7,7 +7,7 @@ PKG_NAME="u-boot"
|
|||
PKG_ARCH="arm aarch64"
|
||||
PKG_SITE="https://github.com/JustEnoughLinuxOS"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_DEPENDS_TARGET="toolchain swig:host rkbin glibc pyelftools:host"
|
||||
PKG_DEPENDS_TARGET="toolchain Python3 swig:host rkbin glibc pyelftools:host"
|
||||
PKG_LONGDESC="Rockchip U-Boot is a bootloader for embedded systems."
|
||||
PKG_PATCH_DIRS+="${DEVICE}"
|
||||
|
||||
|
@ -18,8 +18,9 @@ case ${DEVICE} in
|
|||
PKG_GIT_CLONE_BRANCH="v2017.09-rk3588"
|
||||
;;
|
||||
RK356*)
|
||||
PKG_URL="${PKG_SITE}/rk356x-uboot.git"
|
||||
PKG_VERSION="97c658238f7ccd436fbdede451bfd7488514a5c8"
|
||||
PKG_URL="https://github.com/u-boot/u-boot.git"
|
||||
PKG_VERSION="27089f1e4d11fd7e0619097b59258d0428cde2ac"
|
||||
PKG_GIT_CLONE_BRANCH="master"
|
||||
;;
|
||||
RK3399)
|
||||
PKG_DEPENDS_TARGET+=" atf openssl:host"
|
||||
|
@ -51,7 +52,8 @@ post_patch() {
|
|||
}
|
||||
|
||||
make_target() {
|
||||
setup_pkg_config_host
|
||||
export PKG_RKBIN="$(get_build_dir rkbin)"
|
||||
setup_pkg_config_host
|
||||
. ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/options
|
||||
if [ -z "${UBOOT_CONFIG}" ]; then
|
||||
echo "UBOOT_CONFIG must be set to build an image"
|
||||
|
@ -69,13 +71,26 @@ setup_pkg_config_host
|
|||
then
|
||||
PKG_LOADER="$(get_build_dir rkbin)/${PKG_LOADER}"
|
||||
fi
|
||||
if [[ "${PKG_SOC}" =~ "rk35" ]]
|
||||
if [[ "${PKG_SOC}" =~ "rk3568" ]]
|
||||
then
|
||||
# rk3566 device
|
||||
echo "Building for GPT (${UBOOT_DTB})..."
|
||||
echo "toolchain (${TOOLCHAIN})"
|
||||
export BL31="${PKG_BL31}"
|
||||
export ROCKCHIP_TPL="${PKG_DATAFILE}"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make mrproper
|
||||
echo "begin make"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="--lssl -lcrypto" ARCH=arm64 make ${UBOOT_CONFIG} ${PKG_LOADER} u-boot.dtb u-boot.img tools HOSTCC="${HOST_CC}" HOSTLDFLAGS="-L${TOOLCHAIN}/lib" HOSTCFLAGS="-I${TOOLCHAIN}/include"
|
||||
echo "end make"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 _python_sysroot="${TOOLCHAIN}" _python_prefix=/ _python_exec_prefix=/ make HOSTCC="${HOST_CC}" HOSTLDFLAGS="-L${TOOLCHAIN}/lib" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTSTRIP="true" CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
|
||||
elif [[ "${PKG_SOC}" =~ "rk3588" ]]
|
||||
then
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make mrproper
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make ${UBOOT_CONFIG} BL31=${PKG_BL31} ${PKG_LOADER} u-boot.dtb u-boot.itb CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
|
||||
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 _python_sysroot="${TOOLCHAIN}" _python_prefix=/ _python_exec_prefix=/ make HOSTCC="${HOST_CC}" HOSTLDFLAGS="-L${TOOLCHAIN}/lib" HOSTSTRIP="true" CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
|
||||
else
|
||||
echo "Building for MBR (${UBOOT_DTB})..."
|
||||
else
|
||||
# rk3326 and rk3399 devices
|
||||
echo "Building for MBR (${UBOOT_DTB})..."
|
||||
if [[ "${ATF_PLATFORM}" =~ "rk3399" ]]; then
|
||||
export BL31="$(get_build_dir atf)/.install_pkg/usr/share/bootloader/bl31.elf"
|
||||
fi
|
||||
|
|
|
@ -1,219 +0,0 @@
|
|||
diff --git a/arch/arm/dts/rk3568-evb.dts b/arch/arm/dts/rk3568-evb.dts
|
||||
index 950bc3a..f893a9a 100644
|
||||
--- a/arch/arm/dts/rk3568-evb.dts
|
||||
+++ b/arch/arm/dts/rk3568-evb.dts
|
||||
@@ -28,30 +28,77 @@
|
||||
press-threshold-microvolt = <9>;
|
||||
};
|
||||
};
|
||||
- leds: gpio-leds {
|
||||
+ /*leds: gpio-leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 =<&leds_gpio>;
|
||||
|
||||
led@1 {
|
||||
- gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
|
||||
+ gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
|
||||
label = "battery_full";
|
||||
default-state="on";
|
||||
retain-state-suspended;
|
||||
};
|
||||
|
||||
led@2 {
|
||||
- gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>;
|
||||
+ gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
|
||||
label = "battery_charging";
|
||||
retain-state-suspended;
|
||||
};
|
||||
|
||||
led@3 {
|
||||
- gpios = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
|
||||
+ gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_HIGH>;
|
||||
label = "low_power";
|
||||
default-state="off";
|
||||
retain-state-suspended;
|
||||
};
|
||||
+ };*/
|
||||
+};
|
||||
+
|
||||
+&i2c0 {
|
||||
+ rk817: pmic@20 {
|
||||
+ battery {
|
||||
+ compatible = "rk817,battery";
|
||||
+ ocv_table = <3400 3553 3621 3688 3735 3768 3801
|
||||
+ 3826 3843 3857 3878 3904 3934 3972
|
||||
+ 4006 4020 4030 4044 4059 4083 4138>;
|
||||
+ design_capacity = <3527>;
|
||||
+ design_qmax = <3880>;
|
||||
+ bat_res = <91>;
|
||||
+ sleep_enter_current = <150>;
|
||||
+ sleep_exit_current = <180>;
|
||||
+ sleep_filter_current = <100>;
|
||||
+ power_off_thresd = <3350>;
|
||||
+ zero_algorithm_vol = <3300>;
|
||||
+ max_soc_offset = <60>;
|
||||
+ monitor_sec = <5>;
|
||||
+ sample_res = <10>;
|
||||
+ virtual_power = <0>;
|
||||
+ // dc_det_gpio = <&gpio4 RK_PC4 GPIO_ACTIVE_HIGH>;//uboot使用
|
||||
+ charge_red_gpio = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;//充电指示灯 红
|
||||
+ charge_green_gpio = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;//充电指示灯 绿
|
||||
+ charge_yellow_gpio = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;//充电指示灯 黄
|
||||
+ };
|
||||
+
|
||||
+ charger {
|
||||
+ compatible = "rk817,charger";
|
||||
+ min_input_voltage = <4500>;
|
||||
+ max_input_current = <2000>;
|
||||
+ max_chrg_current = <2000>;
|
||||
+ max_chrg_voltage = <4300>;
|
||||
+ chrg_term_mode = <0>;
|
||||
+ chrg_finish_cur = <300>;
|
||||
+ virtual_power = <0>;
|
||||
+ dc_det_adc = <0>;
|
||||
+ // dc_det_gpio = <&gpio4 RK_PC4 GPIO_ACTIVE_HIGH>;
|
||||
+ charge_red_gpio = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;//充电指示灯 红
|
||||
+ charge_green_gpio = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;//充电指示灯 绿
|
||||
+ charge_yellow_gpio = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;//充电指示灯 黄
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&charge_led_gpio>;
|
||||
+ extcon = <&usb2phy0>;
|
||||
+ gate_function_disable = <1>;
|
||||
+ };
|
||||
};
|
||||
};
|
||||
|
||||
@@ -131,12 +178,20 @@
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
- gpio-leds {
|
||||
+ /*gpio-leds {
|
||||
leds_gpio: leds-gpio {
|
||||
rockchip,pins =
|
||||
- <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>,
|
||||
- <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>,
|
||||
- <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>,
|
||||
+ <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>,
|
||||
+ <4 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
- };
|
||||
+ };*/
|
||||
+ led {
|
||||
+ charge_led_gpio:charge-led-gpio{
|
||||
+ rockchip,pins = <4 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>,
|
||||
+ <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>,
|
||||
+ <4 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ };
|
||||
};
|
||||
diff --git a/drivers/power/fuel_gauge/fg_rk817.c b/drivers/power/fuel_gauge/fg_rk817.c
|
||||
index b5abb72..f54188c 100644
|
||||
--- a/drivers/power/fuel_gauge/fg_rk817.c
|
||||
+++ b/drivers/power/fuel_gauge/fg_rk817.c
|
||||
@@ -256,6 +256,10 @@ struct rk817_battery_device {
|
||||
u32 bat_res_up;
|
||||
u32 bat_res_down;
|
||||
u32 variant;
|
||||
+ struct gpio_desc dc_det_gpio;
|
||||
+ struct gpio_desc charge_red_gpio;
|
||||
+ struct gpio_desc charge_green_gpio;
|
||||
+ struct gpio_desc charge_yellow_gpio;
|
||||
};
|
||||
|
||||
static u32 interpolate(int value, u32 *table, int size)
|
||||
@@ -948,15 +952,27 @@ static int rk817_bat_update_get_current(struct udevice *dev)
|
||||
return VIRTUAL_POWER_CUR;
|
||||
}
|
||||
|
||||
+static int get_dc_statue(struct rk817_battery_device *battery)
|
||||
+{
|
||||
+
|
||||
+// printf("%s.... dc status = %d \n",__func__,dm_gpio_get_value(&battery->dc_det_gpio));
|
||||
+ if (dm_gpio_get_value(&battery->dc_det_gpio))
|
||||
+ return true;
|
||||
+ else
|
||||
+ return false;
|
||||
+}
|
||||
static int rk817_bat_dwc_otg_check_dpdm(struct rk817_battery_device *battery)
|
||||
{
|
||||
if (battery->variant == RK809_ID) {
|
||||
+ // printf("%s.... rk809 \n",__func__);
|
||||
if (rk817_bat_read(battery, PMIC_SYS_STS) & PLUG_IN_STS)
|
||||
return AC_CHARGER;
|
||||
else
|
||||
return NO_CHARGER;
|
||||
} else {
|
||||
+ // printf("%s.... rk817 \n",__func__);
|
||||
return rockchip_chg_get_type();
|
||||
+ // return get_dc_statue(battery);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1186,6 +1202,23 @@ static void rk817_bat_smooth_charge(struct rk817_battery_device *battery)
|
||||
else if (battery->dsoc < 0)
|
||||
battery->dsoc = 0;
|
||||
|
||||
+ //黄灯
|
||||
+ if (get_dc_statue(battery)){
|
||||
+ dm_gpio_set_value(&battery->charge_yellow_gpio,1);
|
||||
+ if (battery->dsoc == 100)
|
||||
+ dm_gpio_set_value(&battery->charge_yellow_gpio,0);
|
||||
+ }else
|
||||
+ dm_gpio_set_value(&battery->charge_yellow_gpio,0);
|
||||
+
|
||||
+ //红绿
|
||||
+ if (battery->dsoc >= 15){
|
||||
+ dm_gpio_set_value(&battery->charge_green_gpio,1); //电量足
|
||||
+ dm_gpio_set_value(&battery->charge_red_gpio,0);
|
||||
+ }else{
|
||||
+ dm_gpio_set_value(&battery->charge_green_gpio,0); //电量不足
|
||||
+ dm_gpio_set_value(&battery->charge_red_gpio,1);
|
||||
+ }
|
||||
+
|
||||
rk817_bat_save_dsoc(battery, battery->dsoc);
|
||||
rk817_bat_save_cap(battery, battery->remain_cap / 1000);
|
||||
out:
|
||||
@@ -1319,6 +1352,39 @@ static int rk817_fg_ofdata_to_platdata(struct udevice *dev)
|
||||
battery->res_div = (value == SAMPLE_RES_20mR) ?
|
||||
SAMPLE_RES_DIV2 : SAMPLE_RES_DIV1;
|
||||
|
||||
+ value = gpio_request_by_name_nodev(dev_ofnode(dev), "dc_det_gpio",
|
||||
+ 0, &battery->dc_det_gpio,GPIOD_IS_IN);
|
||||
+ if (!value) {
|
||||
+ printf("DC is valid\n");
|
||||
+ } else {
|
||||
+ printf("DC is invalid\n");
|
||||
+ }
|
||||
+
|
||||
+ value = gpio_request_by_name_nodev(dev_ofnode(dev), "charge_red_gpio",
|
||||
+ 0, &battery->charge_red_gpio,GPIOD_IS_OUT);
|
||||
+ if (!value) {
|
||||
+ printf("charge_red_gpio is valid\n");
|
||||
+ } else {
|
||||
+ printf("charge_red_gpio is invalid\n");
|
||||
+ }
|
||||
+
|
||||
+ value = gpio_request_by_name_nodev(dev_ofnode(dev), "charge_green_gpio",
|
||||
+ 0, &battery->charge_green_gpio,GPIOD_IS_OUT);
|
||||
+ if (!value) {
|
||||
+ printf("charge_green_gpio is valid\n");
|
||||
+ } else {
|
||||
+ printf("charge_green_gpio is invalid\n");
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ value = gpio_request_by_name_nodev(dev_ofnode(dev), "charge_yellow_gpio",
|
||||
+ 0, &battery->charge_yellow_gpio,GPIOD_IS_OUT);
|
||||
+ if (!value) {
|
||||
+ printf("charge_yellow_gpio is valid\n");
|
||||
+ } else {
|
||||
+ printf("charge_yellow_gpio is invalid\n");
|
||||
+ }
|
||||
+
|
||||
DBG("OCV Value:");
|
||||
for (i = 0; i < battery->ocv_size; i++)
|
||||
DBG("%d ", battery->ocv_table[i]);
|
|
@ -0,0 +1,919 @@
|
|||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 0/7] Add Additional Boards and Features to RGxx3
|
||||
Date: Mon, 11 Dec 2023 17:21:18 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-1-macroalpha82@gmail.com> (raw)
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
The RGxx3 is a pseudo-device for U-Boot that works for every Anbernic
|
||||
RGxx3 series device on the market. Add support for another series of
|
||||
very similar devices from Powkiddy.
|
||||
|
||||
Changes since V2:
|
||||
- Modify the mach-rockchip level rockchip_dnl_key_pressed() so that
|
||||
we can also call it in SPL mode and eliminate the board specific
|
||||
function. This requires adding ADC support to SPL. Additionally,
|
||||
I had to change the regulator for the saradc to a fixed regulator
|
||||
and add GPIO and regulator support to SPL.
|
||||
- Move the board specific board_rng_seed to the mach-rockchip level
|
||||
board file so that other rockchip boards with a hardware RNG can
|
||||
benefit. This should only be called if both the Rockchip
|
||||
hardware RNG as well as the rng seed functions are enabled.
|
||||
- Add two new boards (the RG-ARC-D and RG-ARC-S). I removed the
|
||||
previous code review due to the extensive changes made.
|
||||
|
||||
Changes since V1:
|
||||
- Update verbiage around function button to say "recovery" mode
|
||||
instead of calling it "maskrom" mode, which has a specific
|
||||
meaning. Also note that recovery function was done in a board
|
||||
specific manner to ensure it can run early.
|
||||
- Update board level documentation for the RGxx3.
|
||||
|
||||
Chris Morgan (7):
|
||||
board: rockchip: Refactor panel auto-detect code
|
||||
spl: Add Kconfig options for ADC
|
||||
rockchip: boot_mode: Allow rockchip_dnl_key_pressed() in SPL
|
||||
board: rockchip: Add Recovery Button for Anbernic RGxx3
|
||||
rockchip: board: Add board_rng_seed() for all Rockchip devices
|
||||
board: rockchip: Add support for new boards to RGxx3
|
||||
doc: board: anbernic: Update rgxx3 to add new boards
|
||||
|
||||
.../arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi | 11 +
|
||||
arch/arm/mach-rockchip/Makefile | 4 +-
|
||||
arch/arm/mach-rockchip/board.c | 32 +++
|
||||
arch/arm/mach-rockchip/boot_mode.c | 11 +-
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 194 +++++++++++-------
|
||||
common/spl/Kconfig | 7 +
|
||||
configs/anbernic-rgxx3-rk3566_defconfig | 16 +-
|
||||
doc/board/anbernic/rgxx3.rst | 20 +-
|
||||
drivers/Makefile | 1 +
|
||||
drivers/adc/Makefile | 2 +-
|
||||
include/configs/anbernic-rgxx3-rk3566.h | 2 +
|
||||
11 files changed, 210 insertions(+), 90 deletions(-)
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 1/7] board: rockchip: Refactor panel auto-detect code
|
||||
Date: Mon, 11 Dec 2023 17:21:19 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-2-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Make the inability to detect a panel using the auto detection code not
|
||||
fail the entire boot process. This means that if the panel ID cannot
|
||||
be read we don't set an environment variable for the panel, and if an
|
||||
environment variable for the panel is not set we don't attempt to
|
||||
update the compatible string. Changes to the code also ensure that
|
||||
when there are multiple compatible strings required for the panel
|
||||
we use them both, which solves some issues that will pop up soon
|
||||
for the Linux driver.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 115 +++++++++++++--------
|
||||
1 file changed, 74 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 3f1a42d184..3d0c614623 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -40,6 +40,7 @@ struct rg3xx_model {
|
||||
const char *board;
|
||||
const char *board_name;
|
||||
const char *fdtfile;
|
||||
+ const bool detect_panel;
|
||||
};
|
||||
|
||||
enum rgxx3_device_id {
|
||||
@@ -54,52 +55,67 @@ enum rgxx3_device_id {
|
||||
|
||||
static const struct rg3xx_model rg3xx_model_details[] = {
|
||||
[RG353M] = {
|
||||
- 517, /* Observed average from device */
|
||||
- "rk3566-anbernic-rg353m",
|
||||
- "RG353M",
|
||||
- DTB_DIR "rk3566-anbernic-rg353p.dtb", /* Identical devices */
|
||||
+ .adc_value = 517, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg353m",
|
||||
+ .board_name = "RG353M",
|
||||
+ /* Device is identical to RG353P. */
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353p.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
[RG353P] = {
|
||||
- 860, /* Documented value of 860 */
|
||||
- "rk3566-anbernic-rg353p",
|
||||
- "RG353P",
|
||||
- DTB_DIR "rk3566-anbernic-rg353p.dtb",
|
||||
+ .adc_value = 860, /* Documented value of 860 */
|
||||
+ .board = "rk3566-anbernic-rg353p",
|
||||
+ .board_name = "RG353P",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353p.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
[RG353V] = {
|
||||
- 695, /* Observed average from device */
|
||||
- "rk3566-anbernic-rg353v",
|
||||
- "RG353V",
|
||||
- DTB_DIR "rk3566-anbernic-rg353v.dtb",
|
||||
+ .adc_value = 695, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg353v",
|
||||
+ .board_name = "RG353V",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353v.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
[RG503] = {
|
||||
- 1023, /* Observed average from device */
|
||||
- "rk3566-anbernic-rg503",
|
||||
- "RG503",
|
||||
- DTB_DIR "rk3566-anbernic-rg503.dtb",
|
||||
+ .adc_value = 1023, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg503",
|
||||
+ .board_name = "RG503",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg503.dtb",
|
||||
+ .detect_panel = 0,
|
||||
},
|
||||
/* Devices with duplicate ADC value */
|
||||
[RG353PS] = {
|
||||
- 860, /* Observed average from device */
|
||||
- "rk3566-anbernic-rg353ps",
|
||||
- "RG353PS",
|
||||
- DTB_DIR "rk3566-anbernic-rg353ps.dtb",
|
||||
+ .adc_value = 860, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg353ps",
|
||||
+ .board_name = "RG353PS",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353ps.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
[RG353VS] = {
|
||||
- 695, /* Gathered from second hand information */
|
||||
- "rk3566-anbernic-rg353vs",
|
||||
- "RG353VS",
|
||||
- DTB_DIR "rk3566-anbernic-rg353vs.dtb",
|
||||
+ .adc_value = 695, /* Gathered from second hand information */
|
||||
+ .board = "rk3566-anbernic-rg353vs",
|
||||
+ .board_name = "RG353VS",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353vs.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
};
|
||||
|
||||
struct rg353_panel {
|
||||
const u16 id;
|
||||
- const char *panel_compat;
|
||||
+ const char *panel_compat[2];
|
||||
};
|
||||
|
||||
static const struct rg353_panel rg353_panel_details[] = {
|
||||
- { .id = 0x3052, .panel_compat = "newvision,nv3051d"},
|
||||
- { .id = 0x3821, .panel_compat = "anbernic,rg353v-panel-v2"},
|
||||
+ {
|
||||
+ .id = 0x3052,
|
||||
+ .panel_compat[0] = "anbernic,rg353p-panel",
|
||||
+ .panel_compat[1] = "newvision,nv3051d",
|
||||
+ },
|
||||
+ {
|
||||
+ .id = 0x3821,
|
||||
+ .panel_compat[0] = "anbernic,rg353v-panel-v2",
|
||||
+ .panel_compat[1] = NULL,
|
||||
+ },
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -298,11 +314,10 @@ int rgxx3_detect_display(void)
|
||||
if (!panel) {
|
||||
printf("Unable to identify panel_id %x\n",
|
||||
(panel_id[0] << 8) | panel_id[1]);
|
||||
- env_set("panel", "unknown");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- env_set("panel", panel->panel_compat);
|
||||
+ env_set("panel", panel->panel_compat[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -367,13 +382,14 @@ int rgxx3_detect_device(void)
|
||||
rg3xx_model_details[board_id].board_name);
|
||||
env_set("fdtfile", rg3xx_model_details[board_id].fdtfile);
|
||||
|
||||
- /* Detect the panel type for any device that isn't a 503. */
|
||||
- if (board_id == RG503)
|
||||
+ /* Skip panel detection for when it is not needed. */
|
||||
+ if (!rg3xx_model_details[board_id].detect_panel)
|
||||
return 0;
|
||||
|
||||
+ /* Warn but don't fail for errors in auto-detection of the panel. */
|
||||
ret = rgxx3_detect_display();
|
||||
if (ret)
|
||||
- return ret;
|
||||
+ printf("Failed to detect panel type\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -400,7 +416,8 @@ int rk_board_late_init(void)
|
||||
|
||||
int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
- int node, ret;
|
||||
+ const struct rg353_panel *panel = NULL;
|
||||
+ int node, ret, i;
|
||||
char *env;
|
||||
|
||||
/* No fixups necessary for the RG503 */
|
||||
@@ -414,6 +431,12 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
rg3xx_model_details[RG353M].board_name,
|
||||
sizeof(rg3xx_model_details[RG353M].board_name));
|
||||
|
||||
+ env = env_get("panel");
|
||||
+ if (!env) {
|
||||
+ printf("Can't get panel env\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Check if the environment variable doesn't equal the panel.
|
||||
* If it doesn't, update the devicetree to the correct panel.
|
||||
@@ -424,12 +447,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
- env = env_get("panel");
|
||||
- if (!env) {
|
||||
- printf("Can't get panel env\n");
|
||||
- return -ENODEV;
|
||||
- }
|
||||
-
|
||||
ret = fdt_node_check_compatible(blob, node, env);
|
||||
if (ret < 0)
|
||||
return -ENODEV;
|
||||
@@ -438,8 +455,24 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
if (!ret)
|
||||
return 0;
|
||||
|
||||
- do_fixup_by_path_string(blob, "/dsi@fe060000/panel@0",
|
||||
- "compatible", env);
|
||||
+ /* Panels don't match, search by first compatible value. */
|
||||
+ for (i = 0; i < ARRAY_SIZE(rg353_panel_details); i++) {
|
||||
+ if (!strcmp(env, rg353_panel_details[i].panel_compat[0])) {
|
||||
+ panel = &rg353_panel_details[i];
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!panel) {
|
||||
+ printf("Unable to identify panel by compat string\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* Set the compatible with the auto-detected values */
|
||||
+ fdt_setprop_string(blob, node, "compatible", panel->panel_compat[0]);
|
||||
+ if (panel->panel_compat[1])
|
||||
+ fdt_appendprop_string(blob, node, "compatible",
|
||||
+ panel->panel_compat[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 2/7] spl: Add Kconfig options for ADC
|
||||
Date: Mon, 11 Dec 2023 17:21:20 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-3-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Add kconfig options to enable ADC in SPL
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
common/spl/Kconfig | 7 +++++++
|
||||
drivers/Makefile | 1 +
|
||||
drivers/adc/Makefile | 2 +-
|
||||
3 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
|
||||
index c521b02f4a..ada9dcea5c 100644
|
||||
--- a/common/spl/Kconfig
|
||||
+++ b/common/spl/Kconfig
|
||||
@@ -579,6 +579,13 @@ config SPL_FIT_IMAGE_TINY
|
||||
ensure this information is available to the next image
|
||||
invoked).
|
||||
|
||||
+config SPL_ADC
|
||||
+ bool "Support ADC drivers"
|
||||
+ help
|
||||
+ Enable ADC drivers in SPL. These drivers can allow the reading of
|
||||
+ analog values from one or more channels. Enable this option to
|
||||
+ build the drivers in drivers/adc as part of an SPL build.
|
||||
+
|
||||
config SPL_CACHE
|
||||
bool "Support CACHE drivers"
|
||||
help
|
||||
diff --git a/drivers/Makefile b/drivers/Makefile
|
||||
index bf73b7718c..81ba2c534e 100644
|
||||
--- a/drivers/Makefile
|
||||
+++ b/drivers/Makefile
|
||||
@@ -1,5 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
+obj-$(CONFIG_$(SPL_)ADC) += adc/
|
||||
obj-$(CONFIG_$(SPL_TPL_)BIOSEMU) += bios_emulator/
|
||||
obj-$(CONFIG_$(SPL_TPL_)BLK) += block/
|
||||
obj-$(CONFIG_$(SPL_TPL_)BOOTCOUNT_LIMIT) += bootcount/
|
||||
diff --git a/drivers/adc/Makefile b/drivers/adc/Makefile
|
||||
index 5336c82097..9eb07769b0 100644
|
||||
--- a/drivers/adc/Makefile
|
||||
+++ b/drivers/adc/Makefile
|
||||
@@ -4,7 +4,7 @@
|
||||
# Przemyslaw Marczak <p.marczak@samsung.com>
|
||||
#
|
||||
|
||||
-obj-$(CONFIG_ADC) += adc-uclass.o
|
||||
+obj-$(CONFIG_$(SPL_)ADC) += adc-uclass.o
|
||||
obj-$(CONFIG_ADC_EXYNOS) += exynos-adc.o
|
||||
obj-$(CONFIG_ADC_SANDBOX) += sandbox.o
|
||||
obj-$(CONFIG_SARADC_ROCKCHIP) += rockchip-saradc.o
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 3/7] rockchip: boot_mode: Allow rockchip_dnl_key_pressed() in SPL
|
||||
Date: Mon, 11 Dec 2023 17:21:21 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-4-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Update the rockchip_dnl_key_pressed() so that it can run in
|
||||
SPL. Also change the ADC channel to a define that can be
|
||||
overridden by a board specific option.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
arch/arm/mach-rockchip/Makefile | 4 ++--
|
||||
arch/arm/mach-rockchip/boot_mode.c | 11 ++++++++++-
|
||||
2 files changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
|
||||
index 1dc92066bb..ff089ae949 100644
|
||||
--- a/arch/arm/mach-rockchip/Makefile
|
||||
+++ b/arch/arm/mach-rockchip/Makefile
|
||||
@@ -15,13 +15,13 @@ obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o
|
||||
|
||||
obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
|
||||
|
||||
-ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
|
||||
-
|
||||
# Always include boot_mode.o, as we bypass it (i.e. turn it off)
|
||||
# inside of boot_mode.c when CONFIG_ROCKCHIP_BOOT_MODE_REG is 0. This way,
|
||||
# we can have the preprocessor correctly recognise both 0x0 and 0
|
||||
# meaning "turn it off".
|
||||
obj-y += boot_mode.o
|
||||
+
|
||||
+ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
|
||||
obj-$(CONFIG_ROCKCHIP_COMMON_BOARD) += board.o
|
||||
obj-$(CONFIG_MISC_INIT_R) += misc.o
|
||||
endif
|
||||
diff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c
|
||||
index eb8f65ae4e..d2308768be 100644
|
||||
--- a/arch/arm/mach-rockchip/boot_mode.c
|
||||
+++ b/arch/arm/mach-rockchip/boot_mode.c
|
||||
@@ -38,6 +38,10 @@ void set_back_to_bootrom_dnl_flag(void)
|
||||
#define KEY_DOWN_MIN_VAL 0
|
||||
#define KEY_DOWN_MAX_VAL 30
|
||||
|
||||
+#ifndef RK_DNL_ADC_CHAN
|
||||
+#define RK_DNL_ADC_CHAN 1
|
||||
+#endif
|
||||
+
|
||||
__weak int rockchip_dnl_key_pressed(void)
|
||||
{
|
||||
unsigned int val;
|
||||
@@ -52,7 +56,8 @@ __weak int rockchip_dnl_key_pressed(void)
|
||||
ret = -ENODEV;
|
||||
uclass_foreach_dev(dev, uc) {
|
||||
if (!strncmp(dev->name, "saradc", 6)) {
|
||||
- ret = adc_channel_single_shot(dev->name, 1, &val);
|
||||
+ ret = adc_channel_single_shot(dev->name,
|
||||
+ RK_DNL_ADC_CHAN, &val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -73,11 +78,13 @@ __weak int rockchip_dnl_key_pressed(void)
|
||||
|
||||
void rockchip_dnl_mode_check(void)
|
||||
{
|
||||
+#if CONFIG_IS_ENABLED(ADC)
|
||||
if (rockchip_dnl_key_pressed()) {
|
||||
printf("download key pressed, entering download mode...");
|
||||
set_back_to_bootrom_dnl_flag();
|
||||
do_reset(NULL, 0, 0, NULL);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
int setup_boot_mode(void)
|
||||
@@ -90,6 +97,7 @@ int setup_boot_mode(void)
|
||||
boot_mode = readl(reg);
|
||||
debug("%s: boot mode 0x%08x\n", __func__, boot_mode);
|
||||
|
||||
+#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)
|
||||
/* Clear boot mode */
|
||||
writel(BOOT_NORMAL, reg);
|
||||
|
||||
@@ -103,6 +111,7 @@ int setup_boot_mode(void)
|
||||
env_set("preboot", "setenv preboot; ums mmc 0");
|
||||
break;
|
||||
}
|
||||
+#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 4/7] board: rockchip: Add Recovery Button for Anbernic RGxx3
|
||||
Date: Mon, 11 Dec 2023 17:21:22 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-5-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Add support for users to enter recovery mode by holding the function
|
||||
button when they power up the device.
|
||||
|
||||
Since the device has soldered eMMC and sometimes does not expose a clk
|
||||
pin on the mainboard there is a small chance that a user who flashes a
|
||||
bad bootloader may not be able to recover if the headers themselves
|
||||
are valid. As a result this check is done during spl_early_init() to
|
||||
ensure that it runs as early as possible, and it does so by directly
|
||||
manipulating the ADC hardware in lieu of loading the ADC driver.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi | 11 +++++++++++
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 6 +++++-
|
||||
configs/anbernic-rgxx3-rk3566_defconfig | 16 ++++++++++++----
|
||||
include/configs/anbernic-rgxx3-rk3566.h | 2 ++
|
||||
4 files changed, 30 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi b/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
|
||||
index f986e1941e..e3ab196d22 100644
|
||||
--- a/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
|
||||
@@ -76,6 +76,12 @@
|
||||
/delete-property/ clock-names;
|
||||
};
|
||||
|
||||
+&saradc {
|
||||
+ bootph-all;
|
||||
+ vref-supply = <&vcc_sys>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&sdhci {
|
||||
pinctrl-0 = <&emmc_bus8>, <&emmc_clk>, <&emmc_cmd>,
|
||||
<&emmc_datastrobe>, <&emmc_rstnout>;
|
||||
@@ -94,3 +100,8 @@
|
||||
bootph-all;
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&vcc_sys {
|
||||
+ bootph-all;
|
||||
+ status = "okay";
|
||||
+};
|
||||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 3d0c614623..45854709f5 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <abuf.h>
|
||||
#include <adc.h>
|
||||
+#include <asm/arch-rockchip/boot_mode.h>
|
||||
#include <asm/io.h>
|
||||
#include <display.h>
|
||||
#include <dm.h>
|
||||
@@ -119,11 +120,14 @@ static const struct rg353_panel rg353_panel_details[] = {
|
||||
};
|
||||
|
||||
/*
|
||||
- * Start LED very early so user knows device is on. Set color
|
||||
+ * Check if rockchip_dnl button is pressed and reboot into rockusb if
|
||||
+ * true. Start LED very early so user knows device is on. Set color
|
||||
* to red.
|
||||
*/
|
||||
void spl_board_init(void)
|
||||
{
|
||||
+ setup_boot_mode();
|
||||
+
|
||||
/* Set GPIO0_C5, GPIO0_C6, and GPIO0_C7 to output. */
|
||||
writel(GPIO_WRITEMASK(GPIO_C7 | GPIO_C6 | GPIO_C5) | \
|
||||
(GPIO_C7 | GPIO_C6 | GPIO_C5),
|
||||
diff --git a/configs/anbernic-rgxx3-rk3566_defconfig b/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
index ed6643d9d4..4e72f75815 100644
|
||||
--- a/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
+++ b/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
@@ -3,6 +3,7 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
|
||||
CONFIG_COUNTER_FREQUENCY=24000000
|
||||
CONFIG_ARCH_ROCKCHIP=y
|
||||
CONFIG_TEXT_BASE=0x00a00000
|
||||
+CONFIG_SPL_GPIO=y
|
||||
CONFIG_SPL_LIBCOMMON_SUPPORT=y
|
||||
CONFIG_SPL_LIBGENERIC_SUPPORT=y
|
||||
CONFIG_NR_DRAM_BANKS=2
|
||||
@@ -24,7 +25,9 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
|
||||
CONFIG_DEBUG_UART=y
|
||||
CONFIG_FIT=y
|
||||
CONFIG_FIT_VERBOSE=y
|
||||
+CONFIG_SPL_FIT_SIGNATURE=y
|
||||
CONFIG_SPL_LOAD_FIT=y
|
||||
+CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_OF_STDOUT_VIA_ALIAS=y
|
||||
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-anbernic-rgxx3.dtb"
|
||||
@@ -32,7 +35,7 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-anbernic-rgxx3.dtb"
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
CONFIG_BOARD_RNG_SEED=y
|
||||
-CONFIG_SPL_MAX_SIZE=0x20000
|
||||
+CONFIG_SPL_MAX_SIZE=0x40000
|
||||
CONFIG_SPL_PAD_TO=0x7f8000
|
||||
CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
|
||||
CONFIG_SPL_BSS_START_ADDR=0x4000000
|
||||
@@ -41,6 +44,8 @@ CONFIG_SPL_BOARD_INIT=y
|
||||
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
|
||||
CONFIG_SPL_STACK_R=y
|
||||
+CONFIG_SPL_ADC=y
|
||||
+CONFIG_SPL_POWER=y
|
||||
CONFIG_SPL_ATF=y
|
||||
CONFIG_CMD_PWM=y
|
||||
CONFIG_CMD_GPT=y
|
||||
@@ -50,8 +55,10 @@ CONFIG_CMD_MMC=y
|
||||
# CONFIG_SPL_DOS_PARTITION is not set
|
||||
CONFIG_SPL_OF_CONTROL=y
|
||||
CONFIG_OF_LIVE=y
|
||||
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
# CONFIG_NET is not set
|
||||
+CONFIG_SPL_DM_SEQ_ALIAS=y
|
||||
CONFIG_SPL_REGMAP=y
|
||||
CONFIG_SPL_SYSCON=y
|
||||
CONFIG_SPL_CLK=y
|
||||
@@ -67,13 +74,13 @@ CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y
|
||||
+CONFIG_SPL_PINCTRL=y
|
||||
CONFIG_DM_PMIC=y
|
||||
CONFIG_DM_PMIC_FAN53555=y
|
||||
CONFIG_PMIC_RK8XX=y
|
||||
-CONFIG_REGULATOR_PWM=y
|
||||
-CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_SPL_DM_REGULATOR=y
|
||||
+CONFIG_SPL_DM_REGULATOR_FIXED=y
|
||||
CONFIG_REGULATOR_RK8XX=y
|
||||
-CONFIG_DM_REGULATOR_SCMI=y
|
||||
CONFIG_PWM_ROCKCHIP=y
|
||||
CONFIG_SPL_RAM=y
|
||||
# CONFIG_RAM_ROCKCHIP_DEBUG is not set
|
||||
@@ -89,5 +96,6 @@ CONFIG_VIDEO_ROCKCHIP=y
|
||||
CONFIG_DISPLAY_ROCKCHIP_DW_MIPI=y
|
||||
CONFIG_VIDEO_BRIDGE=y
|
||||
CONFIG_REGEX=y
|
||||
+# CONFIG_RSA is not set
|
||||
CONFIG_ERRNO_STR=y
|
||||
# CONFIG_EFI_LOADER is not set
|
||||
diff --git a/include/configs/anbernic-rgxx3-rk3566.h b/include/configs/anbernic-rgxx3-rk3566.h
|
||||
index 3c4ea4e7d8..2aaac55c06 100644
|
||||
--- a/include/configs/anbernic-rgxx3-rk3566.h
|
||||
+++ b/include/configs/anbernic-rgxx3-rk3566.h
|
||||
@@ -9,4 +9,6 @@
|
||||
"stdout=serial,vidconsole\0" \
|
||||
"stderr=serial,vidconsole\0"
|
||||
|
||||
+#define RK_DNL_ADC_CHAN 0
|
||||
+
|
||||
#endif
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 5/7] rockchip: board: Add board_rng_seed() for all Rockchip devices
|
||||
Date: Mon, 11 Dec 2023 17:21:23 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-6-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Allow all rockchip devices to use the hardware RNG to seed Linux
|
||||
RNG.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
arch/arm/mach-rockchip/board.c | 32 ++++++++++++++++++++++
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 29 --------------------
|
||||
2 files changed, 32 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
|
||||
index 57f08e0be0..77145524ea 100644
|
||||
--- a/arch/arm/mach-rockchip/board.c
|
||||
+++ b/arch/arm/mach-rockchip/board.c
|
||||
@@ -348,3 +348,35 @@ __weak int misc_init_r(void)
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
+
|
||||
+#if IS_ENABLED(CONFIG_BOARD_RNG_SEED) && IS_ENABLED(CONFIG_RNG_ROCKCHIP)
|
||||
+#include <rng.h>
|
||||
+
|
||||
+/* Use hardware rng to seed Linux random. */
|
||||
+__weak int board_rng_seed(struct abuf *buf)
|
||||
+{
|
||||
+ struct udevice *dev;
|
||||
+ size_t len = 0x8;
|
||||
+ u64 *data;
|
||||
+
|
||||
+ data = malloc(len);
|
||||
+ if (!data) {
|
||||
+ printf("Out of memory\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ if (uclass_get_device(UCLASS_RNG, 0, &dev) || !dev) {
|
||||
+ printf("No RNG device\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ if (dm_rng_read(dev, data, len)) {
|
||||
+ printf("Reading RNG failed\n");
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+
|
||||
+ abuf_init_set(buf, data, len);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 45854709f5..7bef5a53f0 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <mmc.h>
|
||||
#include <panel.h>
|
||||
#include <pwm.h>
|
||||
-#include <rng.h>
|
||||
#include <stdlib.h>
|
||||
#include <video_bridge.h>
|
||||
|
||||
@@ -137,34 +136,6 @@ void spl_board_init(void)
|
||||
(GPIO0_BASE + GPIO_SWPORT_DR_H));
|
||||
}
|
||||
|
||||
-/* Use hardware rng to seed Linux random. */
|
||||
-int board_rng_seed(struct abuf *buf)
|
||||
-{
|
||||
- struct udevice *dev;
|
||||
- size_t len = 0x8;
|
||||
- u64 *data;
|
||||
-
|
||||
- data = malloc(len);
|
||||
- if (!data) {
|
||||
- printf("Out of memory\n");
|
||||
- return -ENOMEM;
|
||||
- }
|
||||
-
|
||||
- if (uclass_get_device(UCLASS_RNG, 0, &dev) || !dev) {
|
||||
- printf("No RNG device\n");
|
||||
- return -ENODEV;
|
||||
- }
|
||||
-
|
||||
- if (dm_rng_read(dev, data, len)) {
|
||||
- printf("Reading RNG failed\n");
|
||||
- return -EIO;
|
||||
- }
|
||||
-
|
||||
- abuf_init_set(buf, data, len);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
/*
|
||||
* Buzz the buzzer so the user knows something is going on. Make it
|
||||
* optional in case PWM is disabled.
|
||||
--
|
||||
2.34.1
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 6/7] board: rockchip: Add support for new boards to RGxx3
|
||||
Date: Mon, 11 Dec 2023 17:21:24 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-7-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Add support for the Anbernic RG-ARC-D, Anbernic RG-ARC-S, Powkiddy
|
||||
RK2023, and Powkiddy RGB30 to the Anbernic RGxx3. While the Powkiddy
|
||||
devices are manufactured by Powkiddy instead of Anbernic,
|
||||
the hardware is so similar they can all use the same bootloader.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 44 +++++++++++++++++++---
|
||||
1 file changed, 39 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 7bef5a53f0..2445663d43 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -48,9 +48,13 @@ enum rgxx3_device_id {
|
||||
RG353P,
|
||||
RG353V,
|
||||
RG503,
|
||||
+ RGB30,
|
||||
+ RK2023,
|
||||
+ RGARCD,
|
||||
/* Devices with duplicate ADC value */
|
||||
RG353PS,
|
||||
RG353VS,
|
||||
+ RGARCS,
|
||||
};
|
||||
|
||||
static const struct rg3xx_model rg3xx_model_details[] = {
|
||||
@@ -83,6 +87,27 @@ static const struct rg3xx_model rg3xx_model_details[] = {
|
||||
.fdtfile = DTB_DIR "rk3566-anbernic-rg503.dtb",
|
||||
.detect_panel = 0,
|
||||
},
|
||||
+ [RGB30] = {
|
||||
+ .adc_value = 383, /* Gathered from second hand information */
|
||||
+ .board = "rk3566-powkiddy-rgb30",
|
||||
+ .board_name = "RGB30",
|
||||
+ .fdtfile = DTB_DIR "rk3566-powkiddy-rgb30.dtb",
|
||||
+ .detect_panel = 0,
|
||||
+ },
|
||||
+ [RK2023] = {
|
||||
+ .adc_value = 635, /* Observed average from device */
|
||||
+ .board = "rk3566-powkiddy-rk2023",
|
||||
+ .board_name = "RK2023",
|
||||
+ .fdtfile = DTB_DIR "rk3566-powkiddy-rk2023.dtb",
|
||||
+ .detect_panel = 0,
|
||||
+ },
|
||||
+ [RGARCD] = {
|
||||
+ .adc_value = 183, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg-arc-d",
|
||||
+ .board_name = "Anbernic RG ARC-D",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg-arc-d.dtb",
|
||||
+ .detect_panel = 0,
|
||||
+ },
|
||||
/* Devices with duplicate ADC value */
|
||||
[RG353PS] = {
|
||||
.adc_value = 860, /* Observed average from device */
|
||||
@@ -98,6 +123,13 @@ static const struct rg3xx_model rg3xx_model_details[] = {
|
||||
.fdtfile = DTB_DIR "rk3566-anbernic-rg353vs.dtb",
|
||||
.detect_panel = 1,
|
||||
},
|
||||
+ [RGARCS] = {
|
||||
+ .adc_value = 183, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg-arc-s",
|
||||
+ .board_name = "Anbernic RG ARC-S",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg-arc-s.dtb",
|
||||
+ .detect_panel = 0,
|
||||
+ },
|
||||
};
|
||||
|
||||
struct rg353_panel {
|
||||
@@ -332,19 +364,21 @@ int rgxx3_detect_device(void)
|
||||
}
|
||||
|
||||
/*
|
||||
- * Try to access the eMMC on an RG353V or RG353P. If it's
|
||||
- * missing, it's an RG353VS or RG353PS. Note we could also
|
||||
- * check for a touchscreen at 0x1a on i2c2.
|
||||
+ * Try to access the eMMC on an RG353V, RG353P, or RG Arc D.
|
||||
+ * If it's missing, it's an RG353VS, RG353PS, or RG Arc S.
|
||||
+ * Note we could also check for a touchscreen at 0x1a on i2c2.
|
||||
*/
|
||||
- if (board_id == RG353V || board_id == RG353P) {
|
||||
+ if (board_id == RG353V || board_id == RG353P || board_id == RGARCD) {
|
||||
mmc = find_mmc_device(0);
|
||||
if (mmc) {
|
||||
ret = mmc_init(mmc);
|
||||
if (ret) {
|
||||
if (board_id == RG353V)
|
||||
board_id = RG353VS;
|
||||
- else
|
||||
+ if (board_id == RG353P)
|
||||
board_id = RG353PS;
|
||||
+ else
|
||||
+ board_id = RGARCS;
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 7/7] doc: board: anbernic: Update rgxx3 to add new boards
|
||||
Date: Mon, 11 Dec 2023 17:21:25 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-8-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Update the RGxx3 documentation to note that it now supports the
|
||||
RG-ARC-D, RG-ARC-S, Powkiddy RK2023, and Powkiddy RGB30. Also update
|
||||
verbiage around panel detection to note that it is no longer hard coded
|
||||
to the RG503.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
doc/board/anbernic/rgxx3.rst | 20 ++++++++++++++------
|
||||
1 file changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/doc/board/anbernic/rgxx3.rst b/doc/board/anbernic/rgxx3.rst
|
||||
index 7d1beb423c..d159ed2f76 100644
|
||||
--- a/doc/board/anbernic/rgxx3.rst
|
||||
+++ b/doc/board/anbernic/rgxx3.rst
|
||||
@@ -5,6 +5,8 @@ U-Boot for Anbernic RGxx3 Devices
|
||||
|
||||
This allows U-Boot to boot the following Anbernic devices:
|
||||
|
||||
+ - Anbernic RG-ARC-D
|
||||
+ - Anbernic RG-ARC-S
|
||||
- Anbernic RG353M
|
||||
- Anbernic RG353P
|
||||
- Anbernic RG353PS
|
||||
@@ -12,18 +14,24 @@ This allows U-Boot to boot the following Anbernic devices:
|
||||
- Anbernic RG353VS
|
||||
- Anbernic RG503
|
||||
|
||||
+Additionally, the following very similar non-Anbernic devices are also
|
||||
+supported:
|
||||
+
|
||||
+ - Powkiddy RGB30
|
||||
+ - Powkiddy RK2023
|
||||
+
|
||||
The correct device is detected automatically by comparing ADC values
|
||||
from ADC channel 1. In the event of an RG353V or RG353P, an attempt
|
||||
is then made to probe for an eMMC and if it fails the device is assumed
|
||||
to be an RG353VS or RG353PS. Based on the detected device, the
|
||||
environment variables "board", "board_name", and "fdtfile" are set to
|
||||
the correct values corresponding to the board which can be read by a
|
||||
-boot script to boot with the correct device tree. If the board detected
|
||||
-is not of type RG503 (which currently has only 1 panel revision) a
|
||||
-panel detect is then performed by probing a "dummy" display on the DSI
|
||||
-bus and then querying the display ID. The display ID is then compared
|
||||
-to a table to get the known compatible string for use in Linux, and
|
||||
-this string is saved as an environment variable of "panel".
|
||||
+boot script to boot with the correct device tree. If a board is defined
|
||||
+as requiring panel detection, a panel detect is then performed by
|
||||
+probing a "dummy" display on the DSI bus and then querying the display
|
||||
+ID. The display ID is then compared to a table to get the known
|
||||
+compatible string for use in Linux, and this string is saved as an
|
||||
+environment variable of "panel".
|
||||
|
||||
FDT fixups are performed in the event of an RG353M to change the device
|
||||
name, or in the event the panel detected does not match the devicetree.
|
||||
--
|
||||
2.34.1
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,35 @@
|
|||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 2445663d4..194605ff0 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#define GPIO_WRITEMASK(bits) ((bits) << 16)
|
||||
|
||||
-#define DTB_DIR "rockchip/"
|
||||
+#define DTB_DIR ""
|
||||
|
||||
struct rg3xx_model {
|
||||
const u16 adc_value;
|
||||
@@ -375,7 +375,7 @@ int rgxx3_detect_device(void)
|
||||
if (ret) {
|
||||
if (board_id == RG353V)
|
||||
board_id = RG353VS;
|
||||
- if (board_id == RG353P)
|
||||
+ else if (board_id == RG353P)
|
||||
board_id = RG353PS;
|
||||
else
|
||||
board_id = RGARCS;
|
||||
diff --git a/configs/anbernic-rgxx3-rk3566_defconfig b/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
index 4e72f7581..27911cc9f 100644
|
||||
--- a/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
+++ b/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
@@ -30,7 +30,7 @@ CONFIG_SPL_LOAD_FIT=y
|
||||
CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_OF_STDOUT_VIA_ALIAS=y
|
||||
-CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-anbernic-rgxx3.dtb"
|
||||
+CONFIG_DEFAULT_FDT_FILE="rk3566-anbernic-rgxx3.dtb"
|
||||
# CONFIG_CONSOLE_MUX is not set
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
CONFIG_DISPLAY_BOARDINFO_LATE=y
|
|
@ -0,0 +1,919 @@
|
|||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 0/7] Add Additional Boards and Features to RGxx3
|
||||
Date: Mon, 11 Dec 2023 17:21:18 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-1-macroalpha82@gmail.com> (raw)
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
The RGxx3 is a pseudo-device for U-Boot that works for every Anbernic
|
||||
RGxx3 series device on the market. Add support for another series of
|
||||
very similar devices from Powkiddy.
|
||||
|
||||
Changes since V2:
|
||||
- Modify the mach-rockchip level rockchip_dnl_key_pressed() so that
|
||||
we can also call it in SPL mode and eliminate the board specific
|
||||
function. This requires adding ADC support to SPL. Additionally,
|
||||
I had to change the regulator for the saradc to a fixed regulator
|
||||
and add GPIO and regulator support to SPL.
|
||||
- Move the board specific board_rng_seed to the mach-rockchip level
|
||||
board file so that other rockchip boards with a hardware RNG can
|
||||
benefit. This should only be called if both the Rockchip
|
||||
hardware RNG as well as the rng seed functions are enabled.
|
||||
- Add two new boards (the RG-ARC-D and RG-ARC-S). I removed the
|
||||
previous code review due to the extensive changes made.
|
||||
|
||||
Changes since V1:
|
||||
- Update verbiage around function button to say "recovery" mode
|
||||
instead of calling it "maskrom" mode, which has a specific
|
||||
meaning. Also note that recovery function was done in a board
|
||||
specific manner to ensure it can run early.
|
||||
- Update board level documentation for the RGxx3.
|
||||
|
||||
Chris Morgan (7):
|
||||
board: rockchip: Refactor panel auto-detect code
|
||||
spl: Add Kconfig options for ADC
|
||||
rockchip: boot_mode: Allow rockchip_dnl_key_pressed() in SPL
|
||||
board: rockchip: Add Recovery Button for Anbernic RGxx3
|
||||
rockchip: board: Add board_rng_seed() for all Rockchip devices
|
||||
board: rockchip: Add support for new boards to RGxx3
|
||||
doc: board: anbernic: Update rgxx3 to add new boards
|
||||
|
||||
.../arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi | 11 +
|
||||
arch/arm/mach-rockchip/Makefile | 4 +-
|
||||
arch/arm/mach-rockchip/board.c | 32 +++
|
||||
arch/arm/mach-rockchip/boot_mode.c | 11 +-
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 194 +++++++++++-------
|
||||
common/spl/Kconfig | 7 +
|
||||
configs/anbernic-rgxx3-rk3566_defconfig | 16 +-
|
||||
doc/board/anbernic/rgxx3.rst | 20 +-
|
||||
drivers/Makefile | 1 +
|
||||
drivers/adc/Makefile | 2 +-
|
||||
include/configs/anbernic-rgxx3-rk3566.h | 2 +
|
||||
11 files changed, 210 insertions(+), 90 deletions(-)
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 1/7] board: rockchip: Refactor panel auto-detect code
|
||||
Date: Mon, 11 Dec 2023 17:21:19 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-2-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Make the inability to detect a panel using the auto detection code not
|
||||
fail the entire boot process. This means that if the panel ID cannot
|
||||
be read we don't set an environment variable for the panel, and if an
|
||||
environment variable for the panel is not set we don't attempt to
|
||||
update the compatible string. Changes to the code also ensure that
|
||||
when there are multiple compatible strings required for the panel
|
||||
we use them both, which solves some issues that will pop up soon
|
||||
for the Linux driver.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 115 +++++++++++++--------
|
||||
1 file changed, 74 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 3f1a42d184..3d0c614623 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -40,6 +40,7 @@ struct rg3xx_model {
|
||||
const char *board;
|
||||
const char *board_name;
|
||||
const char *fdtfile;
|
||||
+ const bool detect_panel;
|
||||
};
|
||||
|
||||
enum rgxx3_device_id {
|
||||
@@ -54,52 +55,67 @@ enum rgxx3_device_id {
|
||||
|
||||
static const struct rg3xx_model rg3xx_model_details[] = {
|
||||
[RG353M] = {
|
||||
- 517, /* Observed average from device */
|
||||
- "rk3566-anbernic-rg353m",
|
||||
- "RG353M",
|
||||
- DTB_DIR "rk3566-anbernic-rg353p.dtb", /* Identical devices */
|
||||
+ .adc_value = 517, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg353m",
|
||||
+ .board_name = "RG353M",
|
||||
+ /* Device is identical to RG353P. */
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353p.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
[RG353P] = {
|
||||
- 860, /* Documented value of 860 */
|
||||
- "rk3566-anbernic-rg353p",
|
||||
- "RG353P",
|
||||
- DTB_DIR "rk3566-anbernic-rg353p.dtb",
|
||||
+ .adc_value = 860, /* Documented value of 860 */
|
||||
+ .board = "rk3566-anbernic-rg353p",
|
||||
+ .board_name = "RG353P",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353p.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
[RG353V] = {
|
||||
- 695, /* Observed average from device */
|
||||
- "rk3566-anbernic-rg353v",
|
||||
- "RG353V",
|
||||
- DTB_DIR "rk3566-anbernic-rg353v.dtb",
|
||||
+ .adc_value = 695, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg353v",
|
||||
+ .board_name = "RG353V",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353v.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
[RG503] = {
|
||||
- 1023, /* Observed average from device */
|
||||
- "rk3566-anbernic-rg503",
|
||||
- "RG503",
|
||||
- DTB_DIR "rk3566-anbernic-rg503.dtb",
|
||||
+ .adc_value = 1023, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg503",
|
||||
+ .board_name = "RG503",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg503.dtb",
|
||||
+ .detect_panel = 0,
|
||||
},
|
||||
/* Devices with duplicate ADC value */
|
||||
[RG353PS] = {
|
||||
- 860, /* Observed average from device */
|
||||
- "rk3566-anbernic-rg353ps",
|
||||
- "RG353PS",
|
||||
- DTB_DIR "rk3566-anbernic-rg353ps.dtb",
|
||||
+ .adc_value = 860, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg353ps",
|
||||
+ .board_name = "RG353PS",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353ps.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
[RG353VS] = {
|
||||
- 695, /* Gathered from second hand information */
|
||||
- "rk3566-anbernic-rg353vs",
|
||||
- "RG353VS",
|
||||
- DTB_DIR "rk3566-anbernic-rg353vs.dtb",
|
||||
+ .adc_value = 695, /* Gathered from second hand information */
|
||||
+ .board = "rk3566-anbernic-rg353vs",
|
||||
+ .board_name = "RG353VS",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg353vs.dtb",
|
||||
+ .detect_panel = 1,
|
||||
},
|
||||
};
|
||||
|
||||
struct rg353_panel {
|
||||
const u16 id;
|
||||
- const char *panel_compat;
|
||||
+ const char *panel_compat[2];
|
||||
};
|
||||
|
||||
static const struct rg353_panel rg353_panel_details[] = {
|
||||
- { .id = 0x3052, .panel_compat = "newvision,nv3051d"},
|
||||
- { .id = 0x3821, .panel_compat = "anbernic,rg353v-panel-v2"},
|
||||
+ {
|
||||
+ .id = 0x3052,
|
||||
+ .panel_compat[0] = "anbernic,rg353p-panel",
|
||||
+ .panel_compat[1] = "newvision,nv3051d",
|
||||
+ },
|
||||
+ {
|
||||
+ .id = 0x3821,
|
||||
+ .panel_compat[0] = "anbernic,rg353v-panel-v2",
|
||||
+ .panel_compat[1] = NULL,
|
||||
+ },
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -298,11 +314,10 @@ int rgxx3_detect_display(void)
|
||||
if (!panel) {
|
||||
printf("Unable to identify panel_id %x\n",
|
||||
(panel_id[0] << 8) | panel_id[1]);
|
||||
- env_set("panel", "unknown");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- env_set("panel", panel->panel_compat);
|
||||
+ env_set("panel", panel->panel_compat[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -367,13 +382,14 @@ int rgxx3_detect_device(void)
|
||||
rg3xx_model_details[board_id].board_name);
|
||||
env_set("fdtfile", rg3xx_model_details[board_id].fdtfile);
|
||||
|
||||
- /* Detect the panel type for any device that isn't a 503. */
|
||||
- if (board_id == RG503)
|
||||
+ /* Skip panel detection for when it is not needed. */
|
||||
+ if (!rg3xx_model_details[board_id].detect_panel)
|
||||
return 0;
|
||||
|
||||
+ /* Warn but don't fail for errors in auto-detection of the panel. */
|
||||
ret = rgxx3_detect_display();
|
||||
if (ret)
|
||||
- return ret;
|
||||
+ printf("Failed to detect panel type\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -400,7 +416,8 @@ int rk_board_late_init(void)
|
||||
|
||||
int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
- int node, ret;
|
||||
+ const struct rg353_panel *panel = NULL;
|
||||
+ int node, ret, i;
|
||||
char *env;
|
||||
|
||||
/* No fixups necessary for the RG503 */
|
||||
@@ -414,6 +431,12 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
rg3xx_model_details[RG353M].board_name,
|
||||
sizeof(rg3xx_model_details[RG353M].board_name));
|
||||
|
||||
+ env = env_get("panel");
|
||||
+ if (!env) {
|
||||
+ printf("Can't get panel env\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Check if the environment variable doesn't equal the panel.
|
||||
* If it doesn't, update the devicetree to the correct panel.
|
||||
@@ -424,12 +447,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
- env = env_get("panel");
|
||||
- if (!env) {
|
||||
- printf("Can't get panel env\n");
|
||||
- return -ENODEV;
|
||||
- }
|
||||
-
|
||||
ret = fdt_node_check_compatible(blob, node, env);
|
||||
if (ret < 0)
|
||||
return -ENODEV;
|
||||
@@ -438,8 +455,24 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
if (!ret)
|
||||
return 0;
|
||||
|
||||
- do_fixup_by_path_string(blob, "/dsi@fe060000/panel@0",
|
||||
- "compatible", env);
|
||||
+ /* Panels don't match, search by first compatible value. */
|
||||
+ for (i = 0; i < ARRAY_SIZE(rg353_panel_details); i++) {
|
||||
+ if (!strcmp(env, rg353_panel_details[i].panel_compat[0])) {
|
||||
+ panel = &rg353_panel_details[i];
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!panel) {
|
||||
+ printf("Unable to identify panel by compat string\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ /* Set the compatible with the auto-detected values */
|
||||
+ fdt_setprop_string(blob, node, "compatible", panel->panel_compat[0]);
|
||||
+ if (panel->panel_compat[1])
|
||||
+ fdt_appendprop_string(blob, node, "compatible",
|
||||
+ panel->panel_compat[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 2/7] spl: Add Kconfig options for ADC
|
||||
Date: Mon, 11 Dec 2023 17:21:20 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-3-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Add kconfig options to enable ADC in SPL
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
common/spl/Kconfig | 7 +++++++
|
||||
drivers/Makefile | 1 +
|
||||
drivers/adc/Makefile | 2 +-
|
||||
3 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
|
||||
index c521b02f4a..ada9dcea5c 100644
|
||||
--- a/common/spl/Kconfig
|
||||
+++ b/common/spl/Kconfig
|
||||
@@ -579,6 +579,13 @@ config SPL_FIT_IMAGE_TINY
|
||||
ensure this information is available to the next image
|
||||
invoked).
|
||||
|
||||
+config SPL_ADC
|
||||
+ bool "Support ADC drivers"
|
||||
+ help
|
||||
+ Enable ADC drivers in SPL. These drivers can allow the reading of
|
||||
+ analog values from one or more channels. Enable this option to
|
||||
+ build the drivers in drivers/adc as part of an SPL build.
|
||||
+
|
||||
config SPL_CACHE
|
||||
bool "Support CACHE drivers"
|
||||
help
|
||||
diff --git a/drivers/Makefile b/drivers/Makefile
|
||||
index bf73b7718c..81ba2c534e 100644
|
||||
--- a/drivers/Makefile
|
||||
+++ b/drivers/Makefile
|
||||
@@ -1,5 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
+obj-$(CONFIG_$(SPL_)ADC) += adc/
|
||||
obj-$(CONFIG_$(SPL_TPL_)BIOSEMU) += bios_emulator/
|
||||
obj-$(CONFIG_$(SPL_TPL_)BLK) += block/
|
||||
obj-$(CONFIG_$(SPL_TPL_)BOOTCOUNT_LIMIT) += bootcount/
|
||||
diff --git a/drivers/adc/Makefile b/drivers/adc/Makefile
|
||||
index 5336c82097..9eb07769b0 100644
|
||||
--- a/drivers/adc/Makefile
|
||||
+++ b/drivers/adc/Makefile
|
||||
@@ -4,7 +4,7 @@
|
||||
# Przemyslaw Marczak <p.marczak@samsung.com>
|
||||
#
|
||||
|
||||
-obj-$(CONFIG_ADC) += adc-uclass.o
|
||||
+obj-$(CONFIG_$(SPL_)ADC) += adc-uclass.o
|
||||
obj-$(CONFIG_ADC_EXYNOS) += exynos-adc.o
|
||||
obj-$(CONFIG_ADC_SANDBOX) += sandbox.o
|
||||
obj-$(CONFIG_SARADC_ROCKCHIP) += rockchip-saradc.o
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 3/7] rockchip: boot_mode: Allow rockchip_dnl_key_pressed() in SPL
|
||||
Date: Mon, 11 Dec 2023 17:21:21 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-4-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Update the rockchip_dnl_key_pressed() so that it can run in
|
||||
SPL. Also change the ADC channel to a define that can be
|
||||
overridden by a board specific option.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
arch/arm/mach-rockchip/Makefile | 4 ++--
|
||||
arch/arm/mach-rockchip/boot_mode.c | 11 ++++++++++-
|
||||
2 files changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
|
||||
index 1dc92066bb..ff089ae949 100644
|
||||
--- a/arch/arm/mach-rockchip/Makefile
|
||||
+++ b/arch/arm/mach-rockchip/Makefile
|
||||
@@ -15,13 +15,13 @@ obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o
|
||||
|
||||
obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
|
||||
|
||||
-ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
|
||||
-
|
||||
# Always include boot_mode.o, as we bypass it (i.e. turn it off)
|
||||
# inside of boot_mode.c when CONFIG_ROCKCHIP_BOOT_MODE_REG is 0. This way,
|
||||
# we can have the preprocessor correctly recognise both 0x0 and 0
|
||||
# meaning "turn it off".
|
||||
obj-y += boot_mode.o
|
||||
+
|
||||
+ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
|
||||
obj-$(CONFIG_ROCKCHIP_COMMON_BOARD) += board.o
|
||||
obj-$(CONFIG_MISC_INIT_R) += misc.o
|
||||
endif
|
||||
diff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c
|
||||
index eb8f65ae4e..d2308768be 100644
|
||||
--- a/arch/arm/mach-rockchip/boot_mode.c
|
||||
+++ b/arch/arm/mach-rockchip/boot_mode.c
|
||||
@@ -38,6 +38,10 @@ void set_back_to_bootrom_dnl_flag(void)
|
||||
#define KEY_DOWN_MIN_VAL 0
|
||||
#define KEY_DOWN_MAX_VAL 30
|
||||
|
||||
+#ifndef RK_DNL_ADC_CHAN
|
||||
+#define RK_DNL_ADC_CHAN 1
|
||||
+#endif
|
||||
+
|
||||
__weak int rockchip_dnl_key_pressed(void)
|
||||
{
|
||||
unsigned int val;
|
||||
@@ -52,7 +56,8 @@ __weak int rockchip_dnl_key_pressed(void)
|
||||
ret = -ENODEV;
|
||||
uclass_foreach_dev(dev, uc) {
|
||||
if (!strncmp(dev->name, "saradc", 6)) {
|
||||
- ret = adc_channel_single_shot(dev->name, 1, &val);
|
||||
+ ret = adc_channel_single_shot(dev->name,
|
||||
+ RK_DNL_ADC_CHAN, &val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -73,11 +78,13 @@ __weak int rockchip_dnl_key_pressed(void)
|
||||
|
||||
void rockchip_dnl_mode_check(void)
|
||||
{
|
||||
+#if CONFIG_IS_ENABLED(ADC)
|
||||
if (rockchip_dnl_key_pressed()) {
|
||||
printf("download key pressed, entering download mode...");
|
||||
set_back_to_bootrom_dnl_flag();
|
||||
do_reset(NULL, 0, 0, NULL);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
int setup_boot_mode(void)
|
||||
@@ -90,6 +97,7 @@ int setup_boot_mode(void)
|
||||
boot_mode = readl(reg);
|
||||
debug("%s: boot mode 0x%08x\n", __func__, boot_mode);
|
||||
|
||||
+#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)
|
||||
/* Clear boot mode */
|
||||
writel(BOOT_NORMAL, reg);
|
||||
|
||||
@@ -103,6 +111,7 @@ int setup_boot_mode(void)
|
||||
env_set("preboot", "setenv preboot; ums mmc 0");
|
||||
break;
|
||||
}
|
||||
+#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 4/7] board: rockchip: Add Recovery Button for Anbernic RGxx3
|
||||
Date: Mon, 11 Dec 2023 17:21:22 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-5-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Add support for users to enter recovery mode by holding the function
|
||||
button when they power up the device.
|
||||
|
||||
Since the device has soldered eMMC and sometimes does not expose a clk
|
||||
pin on the mainboard there is a small chance that a user who flashes a
|
||||
bad bootloader may not be able to recover if the headers themselves
|
||||
are valid. As a result this check is done during spl_early_init() to
|
||||
ensure that it runs as early as possible, and it does so by directly
|
||||
manipulating the ADC hardware in lieu of loading the ADC driver.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi | 11 +++++++++++
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 6 +++++-
|
||||
configs/anbernic-rgxx3-rk3566_defconfig | 16 ++++++++++++----
|
||||
include/configs/anbernic-rgxx3-rk3566.h | 2 ++
|
||||
4 files changed, 30 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi b/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
|
||||
index f986e1941e..e3ab196d22 100644
|
||||
--- a/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
|
||||
@@ -76,6 +76,12 @@
|
||||
/delete-property/ clock-names;
|
||||
};
|
||||
|
||||
+&saradc {
|
||||
+ bootph-all;
|
||||
+ vref-supply = <&vcc_sys>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&sdhci {
|
||||
pinctrl-0 = <&emmc_bus8>, <&emmc_clk>, <&emmc_cmd>,
|
||||
<&emmc_datastrobe>, <&emmc_rstnout>;
|
||||
@@ -94,3 +100,8 @@
|
||||
bootph-all;
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&vcc_sys {
|
||||
+ bootph-all;
|
||||
+ status = "okay";
|
||||
+};
|
||||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 3d0c614623..45854709f5 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <abuf.h>
|
||||
#include <adc.h>
|
||||
+#include <asm/arch-rockchip/boot_mode.h>
|
||||
#include <asm/io.h>
|
||||
#include <display.h>
|
||||
#include <dm.h>
|
||||
@@ -119,11 +120,14 @@ static const struct rg353_panel rg353_panel_details[] = {
|
||||
};
|
||||
|
||||
/*
|
||||
- * Start LED very early so user knows device is on. Set color
|
||||
+ * Check if rockchip_dnl button is pressed and reboot into rockusb if
|
||||
+ * true. Start LED very early so user knows device is on. Set color
|
||||
* to red.
|
||||
*/
|
||||
void spl_board_init(void)
|
||||
{
|
||||
+ setup_boot_mode();
|
||||
+
|
||||
/* Set GPIO0_C5, GPIO0_C6, and GPIO0_C7 to output. */
|
||||
writel(GPIO_WRITEMASK(GPIO_C7 | GPIO_C6 | GPIO_C5) | \
|
||||
(GPIO_C7 | GPIO_C6 | GPIO_C5),
|
||||
diff --git a/configs/anbernic-rgxx3-rk3566_defconfig b/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
index ed6643d9d4..4e72f75815 100644
|
||||
--- a/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
+++ b/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
@@ -3,6 +3,7 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
|
||||
CONFIG_COUNTER_FREQUENCY=24000000
|
||||
CONFIG_ARCH_ROCKCHIP=y
|
||||
CONFIG_TEXT_BASE=0x00a00000
|
||||
+CONFIG_SPL_GPIO=y
|
||||
CONFIG_SPL_LIBCOMMON_SUPPORT=y
|
||||
CONFIG_SPL_LIBGENERIC_SUPPORT=y
|
||||
CONFIG_NR_DRAM_BANKS=2
|
||||
@@ -24,7 +25,9 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
|
||||
CONFIG_DEBUG_UART=y
|
||||
CONFIG_FIT=y
|
||||
CONFIG_FIT_VERBOSE=y
|
||||
+CONFIG_SPL_FIT_SIGNATURE=y
|
||||
CONFIG_SPL_LOAD_FIT=y
|
||||
+CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_OF_STDOUT_VIA_ALIAS=y
|
||||
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-anbernic-rgxx3.dtb"
|
||||
@@ -32,7 +35,7 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-anbernic-rgxx3.dtb"
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
CONFIG_BOARD_RNG_SEED=y
|
||||
-CONFIG_SPL_MAX_SIZE=0x20000
|
||||
+CONFIG_SPL_MAX_SIZE=0x40000
|
||||
CONFIG_SPL_PAD_TO=0x7f8000
|
||||
CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
|
||||
CONFIG_SPL_BSS_START_ADDR=0x4000000
|
||||
@@ -41,6 +44,8 @@ CONFIG_SPL_BOARD_INIT=y
|
||||
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
|
||||
CONFIG_SPL_STACK_R=y
|
||||
+CONFIG_SPL_ADC=y
|
||||
+CONFIG_SPL_POWER=y
|
||||
CONFIG_SPL_ATF=y
|
||||
CONFIG_CMD_PWM=y
|
||||
CONFIG_CMD_GPT=y
|
||||
@@ -50,8 +55,10 @@ CONFIG_CMD_MMC=y
|
||||
# CONFIG_SPL_DOS_PARTITION is not set
|
||||
CONFIG_SPL_OF_CONTROL=y
|
||||
CONFIG_OF_LIVE=y
|
||||
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
# CONFIG_NET is not set
|
||||
+CONFIG_SPL_DM_SEQ_ALIAS=y
|
||||
CONFIG_SPL_REGMAP=y
|
||||
CONFIG_SPL_SYSCON=y
|
||||
CONFIG_SPL_CLK=y
|
||||
@@ -67,13 +74,13 @@ CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y
|
||||
+CONFIG_SPL_PINCTRL=y
|
||||
CONFIG_DM_PMIC=y
|
||||
CONFIG_DM_PMIC_FAN53555=y
|
||||
CONFIG_PMIC_RK8XX=y
|
||||
-CONFIG_REGULATOR_PWM=y
|
||||
-CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_SPL_DM_REGULATOR=y
|
||||
+CONFIG_SPL_DM_REGULATOR_FIXED=y
|
||||
CONFIG_REGULATOR_RK8XX=y
|
||||
-CONFIG_DM_REGULATOR_SCMI=y
|
||||
CONFIG_PWM_ROCKCHIP=y
|
||||
CONFIG_SPL_RAM=y
|
||||
# CONFIG_RAM_ROCKCHIP_DEBUG is not set
|
||||
@@ -89,5 +96,6 @@ CONFIG_VIDEO_ROCKCHIP=y
|
||||
CONFIG_DISPLAY_ROCKCHIP_DW_MIPI=y
|
||||
CONFIG_VIDEO_BRIDGE=y
|
||||
CONFIG_REGEX=y
|
||||
+# CONFIG_RSA is not set
|
||||
CONFIG_ERRNO_STR=y
|
||||
# CONFIG_EFI_LOADER is not set
|
||||
diff --git a/include/configs/anbernic-rgxx3-rk3566.h b/include/configs/anbernic-rgxx3-rk3566.h
|
||||
index 3c4ea4e7d8..2aaac55c06 100644
|
||||
--- a/include/configs/anbernic-rgxx3-rk3566.h
|
||||
+++ b/include/configs/anbernic-rgxx3-rk3566.h
|
||||
@@ -9,4 +9,6 @@
|
||||
"stdout=serial,vidconsole\0" \
|
||||
"stderr=serial,vidconsole\0"
|
||||
|
||||
+#define RK_DNL_ADC_CHAN 0
|
||||
+
|
||||
#endif
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 5/7] rockchip: board: Add board_rng_seed() for all Rockchip devices
|
||||
Date: Mon, 11 Dec 2023 17:21:23 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-6-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Allow all rockchip devices to use the hardware RNG to seed Linux
|
||||
RNG.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
arch/arm/mach-rockchip/board.c | 32 ++++++++++++++++++++++
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 29 --------------------
|
||||
2 files changed, 32 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
|
||||
index 57f08e0be0..77145524ea 100644
|
||||
--- a/arch/arm/mach-rockchip/board.c
|
||||
+++ b/arch/arm/mach-rockchip/board.c
|
||||
@@ -348,3 +348,35 @@ __weak int misc_init_r(void)
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
+
|
||||
+#if IS_ENABLED(CONFIG_BOARD_RNG_SEED) && IS_ENABLED(CONFIG_RNG_ROCKCHIP)
|
||||
+#include <rng.h>
|
||||
+
|
||||
+/* Use hardware rng to seed Linux random. */
|
||||
+__weak int board_rng_seed(struct abuf *buf)
|
||||
+{
|
||||
+ struct udevice *dev;
|
||||
+ size_t len = 0x8;
|
||||
+ u64 *data;
|
||||
+
|
||||
+ data = malloc(len);
|
||||
+ if (!data) {
|
||||
+ printf("Out of memory\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ if (uclass_get_device(UCLASS_RNG, 0, &dev) || !dev) {
|
||||
+ printf("No RNG device\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ if (dm_rng_read(dev, data, len)) {
|
||||
+ printf("Reading RNG failed\n");
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+
|
||||
+ abuf_init_set(buf, data, len);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 45854709f5..7bef5a53f0 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <mmc.h>
|
||||
#include <panel.h>
|
||||
#include <pwm.h>
|
||||
-#include <rng.h>
|
||||
#include <stdlib.h>
|
||||
#include <video_bridge.h>
|
||||
|
||||
@@ -137,34 +136,6 @@ void spl_board_init(void)
|
||||
(GPIO0_BASE + GPIO_SWPORT_DR_H));
|
||||
}
|
||||
|
||||
-/* Use hardware rng to seed Linux random. */
|
||||
-int board_rng_seed(struct abuf *buf)
|
||||
-{
|
||||
- struct udevice *dev;
|
||||
- size_t len = 0x8;
|
||||
- u64 *data;
|
||||
-
|
||||
- data = malloc(len);
|
||||
- if (!data) {
|
||||
- printf("Out of memory\n");
|
||||
- return -ENOMEM;
|
||||
- }
|
||||
-
|
||||
- if (uclass_get_device(UCLASS_RNG, 0, &dev) || !dev) {
|
||||
- printf("No RNG device\n");
|
||||
- return -ENODEV;
|
||||
- }
|
||||
-
|
||||
- if (dm_rng_read(dev, data, len)) {
|
||||
- printf("Reading RNG failed\n");
|
||||
- return -EIO;
|
||||
- }
|
||||
-
|
||||
- abuf_init_set(buf, data, len);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
/*
|
||||
* Buzz the buzzer so the user knows something is going on. Make it
|
||||
* optional in case PWM is disabled.
|
||||
--
|
||||
2.34.1
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 6/7] board: rockchip: Add support for new boards to RGxx3
|
||||
Date: Mon, 11 Dec 2023 17:21:24 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-7-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Add support for the Anbernic RG-ARC-D, Anbernic RG-ARC-S, Powkiddy
|
||||
RK2023, and Powkiddy RGB30 to the Anbernic RGxx3. While the Powkiddy
|
||||
devices are manufactured by Powkiddy instead of Anbernic,
|
||||
the hardware is so similar they can all use the same bootloader.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 44 +++++++++++++++++++---
|
||||
1 file changed, 39 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 7bef5a53f0..2445663d43 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -48,9 +48,13 @@ enum rgxx3_device_id {
|
||||
RG353P,
|
||||
RG353V,
|
||||
RG503,
|
||||
+ RGB30,
|
||||
+ RK2023,
|
||||
+ RGARCD,
|
||||
/* Devices with duplicate ADC value */
|
||||
RG353PS,
|
||||
RG353VS,
|
||||
+ RGARCS,
|
||||
};
|
||||
|
||||
static const struct rg3xx_model rg3xx_model_details[] = {
|
||||
@@ -83,6 +87,27 @@ static const struct rg3xx_model rg3xx_model_details[] = {
|
||||
.fdtfile = DTB_DIR "rk3566-anbernic-rg503.dtb",
|
||||
.detect_panel = 0,
|
||||
},
|
||||
+ [RGB30] = {
|
||||
+ .adc_value = 383, /* Gathered from second hand information */
|
||||
+ .board = "rk3566-powkiddy-rgb30",
|
||||
+ .board_name = "RGB30",
|
||||
+ .fdtfile = DTB_DIR "rk3566-powkiddy-rgb30.dtb",
|
||||
+ .detect_panel = 0,
|
||||
+ },
|
||||
+ [RK2023] = {
|
||||
+ .adc_value = 635, /* Observed average from device */
|
||||
+ .board = "rk3566-powkiddy-rk2023",
|
||||
+ .board_name = "RK2023",
|
||||
+ .fdtfile = DTB_DIR "rk3566-powkiddy-rk2023.dtb",
|
||||
+ .detect_panel = 0,
|
||||
+ },
|
||||
+ [RGARCD] = {
|
||||
+ .adc_value = 183, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg-arc-d",
|
||||
+ .board_name = "Anbernic RG ARC-D",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg-arc-d.dtb",
|
||||
+ .detect_panel = 0,
|
||||
+ },
|
||||
/* Devices with duplicate ADC value */
|
||||
[RG353PS] = {
|
||||
.adc_value = 860, /* Observed average from device */
|
||||
@@ -98,6 +123,13 @@ static const struct rg3xx_model rg3xx_model_details[] = {
|
||||
.fdtfile = DTB_DIR "rk3566-anbernic-rg353vs.dtb",
|
||||
.detect_panel = 1,
|
||||
},
|
||||
+ [RGARCS] = {
|
||||
+ .adc_value = 183, /* Observed average from device */
|
||||
+ .board = "rk3566-anbernic-rg-arc-s",
|
||||
+ .board_name = "Anbernic RG ARC-S",
|
||||
+ .fdtfile = DTB_DIR "rk3566-anbernic-rg-arc-s.dtb",
|
||||
+ .detect_panel = 0,
|
||||
+ },
|
||||
};
|
||||
|
||||
struct rg353_panel {
|
||||
@@ -332,19 +364,21 @@ int rgxx3_detect_device(void)
|
||||
}
|
||||
|
||||
/*
|
||||
- * Try to access the eMMC on an RG353V or RG353P. If it's
|
||||
- * missing, it's an RG353VS or RG353PS. Note we could also
|
||||
- * check for a touchscreen at 0x1a on i2c2.
|
||||
+ * Try to access the eMMC on an RG353V, RG353P, or RG Arc D.
|
||||
+ * If it's missing, it's an RG353VS, RG353PS, or RG Arc S.
|
||||
+ * Note we could also check for a touchscreen at 0x1a on i2c2.
|
||||
*/
|
||||
- if (board_id == RG353V || board_id == RG353P) {
|
||||
+ if (board_id == RG353V || board_id == RG353P || board_id == RGARCD) {
|
||||
mmc = find_mmc_device(0);
|
||||
if (mmc) {
|
||||
ret = mmc_init(mmc);
|
||||
if (ret) {
|
||||
if (board_id == RG353V)
|
||||
board_id = RG353VS;
|
||||
- else
|
||||
+ if (board_id == RG353P)
|
||||
board_id = RG353PS;
|
||||
+ else
|
||||
+ board_id = RGARCS;
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From: Chris Morgan <macroalpha82@gmail.com>
|
||||
To: u-boot@lists.denx.de
|
||||
Cc: andre.przywara@arm.com, kever.yang@rock-chips.com,
|
||||
philipp.tomsich@vrull.eu, sjg@chromium.org,
|
||||
Chris Morgan <macromorgan@hotmail.com>
|
||||
Subject: [PATCH V3 7/7] doc: board: anbernic: Update rgxx3 to add new boards
|
||||
Date: Mon, 11 Dec 2023 17:21:25 -0600 [thread overview]
|
||||
Message-ID: <20231211232125.171438-8-macroalpha82@gmail.com> (raw)
|
||||
In-Reply-To: <20231211232125.171438-1-macroalpha82@gmail.com>
|
||||
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
|
||||
Update the RGxx3 documentation to note that it now supports the
|
||||
RG-ARC-D, RG-ARC-S, Powkiddy RK2023, and Powkiddy RGB30. Also update
|
||||
verbiage around panel detection to note that it is no longer hard coded
|
||||
to the RG503.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
---
|
||||
doc/board/anbernic/rgxx3.rst | 20 ++++++++++++++------
|
||||
1 file changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/doc/board/anbernic/rgxx3.rst b/doc/board/anbernic/rgxx3.rst
|
||||
index 7d1beb423c..d159ed2f76 100644
|
||||
--- a/doc/board/anbernic/rgxx3.rst
|
||||
+++ b/doc/board/anbernic/rgxx3.rst
|
||||
@@ -5,6 +5,8 @@ U-Boot for Anbernic RGxx3 Devices
|
||||
|
||||
This allows U-Boot to boot the following Anbernic devices:
|
||||
|
||||
+ - Anbernic RG-ARC-D
|
||||
+ - Anbernic RG-ARC-S
|
||||
- Anbernic RG353M
|
||||
- Anbernic RG353P
|
||||
- Anbernic RG353PS
|
||||
@@ -12,18 +14,24 @@ This allows U-Boot to boot the following Anbernic devices:
|
||||
- Anbernic RG353VS
|
||||
- Anbernic RG503
|
||||
|
||||
+Additionally, the following very similar non-Anbernic devices are also
|
||||
+supported:
|
||||
+
|
||||
+ - Powkiddy RGB30
|
||||
+ - Powkiddy RK2023
|
||||
+
|
||||
The correct device is detected automatically by comparing ADC values
|
||||
from ADC channel 1. In the event of an RG353V or RG353P, an attempt
|
||||
is then made to probe for an eMMC and if it fails the device is assumed
|
||||
to be an RG353VS or RG353PS. Based on the detected device, the
|
||||
environment variables "board", "board_name", and "fdtfile" are set to
|
||||
the correct values corresponding to the board which can be read by a
|
||||
-boot script to boot with the correct device tree. If the board detected
|
||||
-is not of type RG503 (which currently has only 1 panel revision) a
|
||||
-panel detect is then performed by probing a "dummy" display on the DSI
|
||||
-bus and then querying the display ID. The display ID is then compared
|
||||
-to a table to get the known compatible string for use in Linux, and
|
||||
-this string is saved as an environment variable of "panel".
|
||||
+boot script to boot with the correct device tree. If a board is defined
|
||||
+as requiring panel detection, a panel detect is then performed by
|
||||
+probing a "dummy" display on the DSI bus and then querying the display
|
||||
+ID. The display ID is then compared to a table to get the known
|
||||
+compatible string for use in Linux, and this string is saved as an
|
||||
+environment variable of "panel".
|
||||
|
||||
FDT fixups are performed in the event of an RG353M to change the device
|
||||
name, or in the event the panel detected does not match the devicetree.
|
||||
--
|
||||
2.34.1
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,35 @@
|
|||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 2445663d4..194605ff0 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#define GPIO_WRITEMASK(bits) ((bits) << 16)
|
||||
|
||||
-#define DTB_DIR "rockchip/"
|
||||
+#define DTB_DIR ""
|
||||
|
||||
struct rg3xx_model {
|
||||
const u16 adc_value;
|
||||
@@ -375,7 +375,7 @@ int rgxx3_detect_device(void)
|
||||
if (ret) {
|
||||
if (board_id == RG353V)
|
||||
board_id = RG353VS;
|
||||
- if (board_id == RG353P)
|
||||
+ else if (board_id == RG353P)
|
||||
board_id = RG353PS;
|
||||
else
|
||||
board_id = RGARCS;
|
||||
diff --git a/configs/anbernic-rgxx3-rk3566_defconfig b/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
index 4e72f7581..27911cc9f 100644
|
||||
--- a/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
+++ b/configs/anbernic-rgxx3-rk3566_defconfig
|
||||
@@ -30,7 +30,7 @@ CONFIG_SPL_LOAD_FIT=y
|
||||
CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_OF_STDOUT_VIA_ALIAS=y
|
||||
-CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-anbernic-rgxx3.dtb"
|
||||
+CONFIG_DEFAULT_FDT_FILE="rk3566-anbernic-rgxx3.dtb"
|
||||
# CONFIG_CONSOLE_MUX is not set
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
CONFIG_DISPLAY_BOARDINFO_LATE=y
|
|
@ -0,0 +1,26 @@
|
|||
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
index 194605ff06..ee498631ba 100644
|
||||
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
|
||||
@@ -49,6 +49,7 @@ enum rgxx3_device_id {
|
||||
RG353V,
|
||||
RG503,
|
||||
RGB30,
|
||||
+ RGB10MAX3,
|
||||
RK2023,
|
||||
RGARCD,
|
||||
/* Devices with duplicate ADC value */
|
||||
@@ -94,6 +95,13 @@ static const struct rg3xx_model rg3xx_model_details[] = {
|
||||
.fdtfile = DTB_DIR "rk3566-powkiddy-rgb30.dtb",
|
||||
.detect_panel = 0,
|
||||
},
|
||||
+ [RGB10MAX3] = {
|
||||
+ .adc_value = 765, /* Observed average from device */
|
||||
+ .board = "rk3566-powkiddy-rgb10max3",
|
||||
+ .board_name = "RGB10MAX3",
|
||||
+ .fdtfile = DTB_DIR "rk3566-powkiddy-rgb10max3.dtb",
|
||||
+ .detect_panel = 0,
|
||||
+ },
|
||||
[RK2023] = {
|
||||
.adc_value = 635, /* Observed average from device */
|
||||
.board = "rk3566-powkiddy-rk2023",
|
Loading…
Reference in a new issue