From c87f39075717bc1ed5696f2ce4fcaf69a59a9e64 Mon Sep 17 00:00:00 2001
From: David Williams <david@davidthings.com>
Date: Wed, 18 Oct 2023 18:49:42 -0700
Subject: [PATCH] - kernel config to stop GPIO messages - kernel config to 
 enable FAT file access - autostart unbind wireless mod and rebind - helpful
 kernel commands - log-level, uart output, nopkmute, console -> screen

---
 packages/jelos/autostart/001-wifi                           | 2 ++
 packages/network/connman/package.mk                         | 6 ++++--
 .../Rockchip/devices/RK3566-ML/linux/linux.aarch64.conf     | 4 ++--
 projects/Rockchip/devices/RK3566-ML/options                 | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)
 create mode 100755 packages/jelos/autostart/001-wifi

diff --git a/packages/jelos/autostart/001-wifi b/packages/jelos/autostart/001-wifi
new file mode 100755
index 000000000..a61b8c0bc
--- /dev/null
+++ b/packages/jelos/autostart/001-wifi
@@ -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
\ No newline at end of file
diff --git a/packages/network/connman/package.mk b/packages/network/connman/package.mk
index 7a8a7a0f1..f036b78c1 100644
--- a/packages/network/connman/package.mk
+++ b/packages/network/connman/package.mk
@@ -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
diff --git a/projects/Rockchip/devices/RK3566-ML/linux/linux.aarch64.conf b/projects/Rockchip/devices/RK3566-ML/linux/linux.aarch64.conf
index f5704f89d..695ec8339 100644
--- a/projects/Rockchip/devices/RK3566-ML/linux/linux.aarch64.conf
+++ b/projects/Rockchip/devices/RK3566-ML/linux/linux.aarch64.conf
@@ -3325,7 +3325,7 @@ CONFIG_GPIOLIB=y
 CONFIG_GPIOLIB_FASTPATH_LIMIT=512
 CONFIG_OF_GPIO=y
 CONFIG_GPIOLIB_IRQCHIP=y
-CONFIG_DEBUG_GPIO=y
+# CONFIG_DEBUG_GPIO is not set
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_CDEV=y
 CONFIG_GPIO_CDEV_V1=y
@@ -7211,7 +7211,7 @@ CONFIG_FSNOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_FANOTIFY is not set
 # CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS_FS=y
 CONFIG_FUSE_FS=y
 # CONFIG_CUSE is not set
 # CONFIG_VIRTIO_FS is not set
diff --git a/projects/Rockchip/devices/RK3566-ML/options b/projects/Rockchip/devices/RK3566-ML/options
index 8cbc4f43c..a33fb8c45 100644
--- a/projects/Rockchip/devices/RK3566-ML/options
+++ b/projects/Rockchip/devices/RK3566-ML/options
@@ -75,7 +75,7 @@
 
   # kernel serial console
     #EXTRA_CMDLINE="quiet rootwait earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000n8 console=tty0 ssh consoleblank=0 systemd.show_status=0 loglevel=0 panic=20 initcall_blacklist=uvc_init log_buf_len=1M"
-    EXTRA_CMDLINE="quiet rootwait console=ttyS2,1500000n8 console=tty0 ssh consoleblank=0 systemd.show_status=0 loglevel=0 panic=20"
+    EXTRA_CMDLINE="rootwait earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000n8 console=tty1 ssh consoleblank=0 systemd.show_status=0 loglevel=8 panic=20 nopkmute"
 
   # additional packages to install
   #  ADDITIONAL_PACKAGES=""