From d8cc314662b77365ac6fdf5222462aea171602ad Mon Sep 17 00:00:00 2001 From: nagumii Date: Sat, 8 Feb 2025 04:02:06 +0200 Subject: [PATCH 1/6] License button should only show for installed packages --- .../out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh index 2d28b36..9bdaeab 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh @@ -88,6 +88,7 @@ package_menu() { echo "Loading package menu..." # for each line, check if it's supported by the package, display it if the current install state of the package is appropriate (example: don't display "install" if the package is already installed, don't display "stop service" for a package with no services) service_state=$(femto-utils.sh -C "$($package_dir/$1.sh -E)") + license_button="" if $package_dir/$1.sh -O | grep -q 'G' && $package_dir/$1.sh -I; then license_button="--help-button --help-label License"; fi menu_list="\ $(if $package_dir/$1.sh -O | grep -q 'l' && $package_dir/$1.sh -I; then echo "Run software x"; fi) \ From bad1ddc204768b775d94491101393ad31926be31 Mon Sep 17 00:00:00 2001 From: Ruledo Date: Fri, 7 Feb 2025 20:26:41 -0800 Subject: [PATCH 2/6] time-monitor service to restart meshtasticd Currently set to detect a 1 week change in time. --- environment-setup/femtofox.chroot | 1 + .../etc/systemd/system/time-monitor.service | 12 ++++ .../usr/local/bin/time_change.sh | 58 +++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/systemd/system/time-monitor.service create mode 100755 foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/time_change.sh diff --git a/environment-setup/femtofox.chroot b/environment-setup/femtofox.chroot index 3acbe42..c4342c9 100644 --- a/environment-setup/femtofox.chroot +++ b/environment-setup/femtofox.chroot @@ -61,6 +61,7 @@ systemctl enable femto-runonce.service systemctl enable femto-usb-config-tool.service systemctl enable femto-boot-complete.service systemctl enable wifi-mesh-control +systemctl enable time-monitor systemctl disable apt-daily.timer systemctl disable unattended-upgrades diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/systemd/system/time-monitor.service b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/systemd/system/time-monitor.service new file mode 100644 index 0000000..5ffa753 --- /dev/null +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/systemd/system/time-monitor.service @@ -0,0 +1,12 @@ +[Unit] +Description=Monitor time changes and restart meshtasticd +After=network.target + +[Service] +ExecStart=/usr/local/bin/time_monitor.sh +Restart=always +User=root + +[Install] +WantedBy=multi-user.target + diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/time_change.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/time_change.sh new file mode 100755 index 0000000..c07fb34 --- /dev/null +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/time_change.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +THRESHOLD=$((7 * 24 * 60 * 60)) # 1 week in seconds +LOGFILE="/var/log/time_change.log" +LAST_TIME_FILE="/tmp/last_time" + +# Function to check time jump +check_time_jump() { + NEW_TIME=$(date +%s) + + if [ -f "$LAST_TIME_FILE" ]; then + OLD_TIME=$(cat "$LAST_TIME_FILE") + else + OLD_TIME=$NEW_TIME + fi + + TIME_DIFF=$((NEW_TIME - OLD_TIME)) + + if [ "${TIME_DIFF#-}" -ge "$THRESHOLD" ]; then + echo "$(date) - Large time change detected ($TIME_DIFF seconds), restarting meshtasticd" | tee -a "$LOGFILE" + systemctl restart meshtasticd + fi + + echo "$NEW_TIME" > "$LAST_TIME_FILE" +} + +# Monitor chronyd logs for time jumps (background) +( + journalctl -fu chronyd --no-pager | while read -r line; do + if echo "$line" | grep -q "Forward time jump detected"; then + echo "$(date) - Detected time change via chronyd logs" | tee -a "$LOGFILE" + check_time_jump + fi + done +) & + +# Monitor /etc/adjtime for manual or RTC-based time changes (background) +( + while true; do + if find /etc/adjtime -mmin -1 | grep -q .; then + echo "$(date) - Time change detected via /etc/adjtime modification" | tee -a "$LOGFILE" + check_time_jump + fi + sleep 5 + done +) & + +# Fallback: Compare timestamps every 5 seconds (if other methods fail) +( + while true; do + check_time_jump + sleep 5 + done +) & + +# Keep script running +wait + From 3b520405ff55a8943d9045902f57b38e90afd815 Mon Sep 17 00:00:00 2001 From: nagumii Date: Sat, 8 Feb 2025 18:00:13 +0200 Subject: [PATCH 3/6] Fix femto-utils.sh help text --- .../out/rootfs_uclibc_rv1106/usr/local/bin/femto-utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-utils.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-utils.sh index 4fa2b0e..cc4e043 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-utils.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-utils.sh @@ -256,7 +256,7 @@ replace_colors() { while getopts ":harsl:ipcnoSEC:R:" opt; do case ${opt} in h) # Option -h (help) - echo -e $help + echo -e "$help" ;; a) # Option -a (ACT LED enable/disable/check) act_led $2 From b543a118981f2affa59883cbf90e2e7476f63a19 Mon Sep 17 00:00:00 2001 From: nagumii Date: Sat, 8 Feb 2025 19:05:19 +0200 Subject: [PATCH 4/6] Improve service state utility in femto-utils.sh --- .../usr/local/bin/femto-config | 18 ++--- .../usr/local/bin/femto-software.sh | 4 +- .../usr/local/bin/femto-utils.sh | 77 ++++++------------- 3 files changed, 34 insertions(+), 65 deletions(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config index 8636be1..477a6c1 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config @@ -549,13 +549,13 @@ meshtastic_settings() { local service_state="$(femto-utils.sh -R "$(femto-utils.sh -C "meshtasticd")")" choice=$(dialog --no-collapse --colors --cancel-label "Back" --title "Meshtasticd Service" --default-item "$choice" --menu "Meshtasticd service is $service_state$(femto-meshtasticd-config.sh -k | grep -q 'simulated' && echo '\n\Z1Using simulated radio\Zn')" 17 52 5 \ "View detailed service status" "x" \ - " " " " \ - $(if echo "$service_state" | grep -q 'enabled'; then echo "Start/restart service x"; fi) \ - $(if echo "$service_state" | grep -q 'enabled and running'; then echo "Stop service x"; fi) \ - $(if echo "$service_state" | grep -q 'enabled'; then echo "   "; fi) \ + " " "" \ + "Start/restart service" "x" \ + $(if ! echo "$service_state" | grep -q 'not running'; then echo "Stop service x"; fi) \ + " " "" \ $(if echo "$service_state" | grep -q 'disabled'; then echo "Enable service x"; fi) \ $(if echo "$service_state" | grep -q 'enabled'; then echo "Disable service x"; fi) \ - " " " " \ + " " "" \ "Back to previous menu" "x" 3>&1 1>&2 2>&3) [ $? -eq 1 ] && break # Exit the loop if the user selects "Cancel" or closes the dialog case $choice in @@ -567,14 +567,14 @@ meshtastic_settings() { dialog --no-collapse --title "$title" --yesno "Start/restart Meshtasticd service?" 6 45 if [ $? -eq 0 ]; then #unless cancel/no femto-meshtasticd-config.sh -s - dialog --no-collapse --msgbox "Meshtasticd service started/restarted." 6 45 + dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl restart meshtasticd\Zn\` command to system.\n\nMeshtasticd should be running." 9 50 fi ;; "Stop service") - dialog --no-collapse --colors --title "$title" --yesno "Stop Meshtasticd service?\n\nThis will take the node \Zu\Z1OFFLINE\Zn.\n\nMeshtasticd will automatically restart on boot if not disabled." 11 50 + dialog --no-collapse --colors --title "$title" --yesno "Stop Meshtasticd service?\n\nThis will take the node \Zu\Z1OFFLINE\Zn.\n\nMeshtasticd will automatically restart on boot service if enabled." 11 50 if [ $? -eq 0 ]; then #unless cancel/no femto-meshtasticd-config.sh -t - dialog --no-collapse --msgbox "Meshtasticd service stopped." 6 45 + dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl stop meshtasticd\Zn\` command to system.\n\nMeshtasticd should be stopped." 9 50 fi ;; "Enable service") @@ -588,7 +588,7 @@ meshtastic_settings() { dialog --no-collapse --colors --title "$title" --yesno "Disable Meshtasticd service?\n\nThis will take the node \Zu\Z1OFFLINE\Zn and will not restart!" 9 50 if [ $? -eq 0 ]; then #unless cancel/no femto-meshtasticd-config.sh -M "disable" - dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl disable meshtasticd\Zn\` and \`\Zusystemctl stop meshtasticd\Zn\` commands to system.\n\nMeshtasticd is disabled and stopped." 10 50 + dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl disable meshtasticd\Zn\` and \`\Zusystemctl stop meshtasticd\Zn\` commands to system.\n\nMeshtasticd should be disabled and stopped." 10 50 fi ;; "Back to previous menu") break ;; diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh index 9bdaeab..4bcd1fb 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh @@ -98,8 +98,8 @@ package_menu() { $(if $package_dir/$1.sh -O | grep -q 'g' && $package_dir/$1.sh -I; then echo "Upgrade x"; fi) \ $(if $package_dir/$1.sh -O | grep -q 'e' && $package_dir/$1.sh -I && [[ ! $service_state =~ "enabled" ]]; then echo "Enable service x"; fi) \ $(if $package_dir/$1.sh -O | grep -q 'e' && $package_dir/$1.sh -I && [[ ! $service_state =~ "disabled" ]]; then echo "Disable service x"; fi) \ - $(if $package_dir/$1.sh -O | grep -q 'e' && $package_dir/$1.sh -I && [[ ! $service_state =~ "not running" ]] && [[ ! $service_state =~ "disabled" ]]; then echo "Stop service x"; fi) \ - $(if $package_dir/$1.sh -O | grep -q 'e' && $package_dir/$1.sh -I && [[ $service_state =~ "enabled" ]]; then echo "Start/restart service x"; fi) \ + $(if $package_dir/$1.sh -O | grep -q 'e' && $package_dir/$1.sh -I && [[ ! $service_state =~ "not running" ]]; then echo "Stop service x"; fi) \ + $(if $package_dir/$1.sh -O | grep -q 'e' && $package_dir/$1.sh -I; then echo "Start/restart service x"; fi) \ $(if $package_dir/$1.sh -O | grep -q 'S' && $package_dir/$1.sh -I; then echo "Detailed service status x"; fi)" menu_count=$(( $(echo "$menu_list" | grep -o " x" | wc -l) $(if $package_dir/$1.sh -O | grep -q 'e' && $package_dir/$1.sh -I; then echo "+1"; fi) )) # count the number of menu items by counting how many times " x" shows up, +1 if there's a service. This is a stupid way to do this, but because each menu item only contains one space (the rest being space-sized invisible chars) it works. It's late at night, OKAY?! choice=$(dialog --no-collapse --colors --title "$($package_dir/$1.sh -N)" --cancel-label "Back" --default-item "$choice" $license_button --menu "$(if $package_dir/$1.sh -O | grep -q 'S' && $package_dir/$1.sh -I; then echo "Service status: $(femto-utils.sh -R "$service_state")"; fi)" $(( menu_count + 9 )) 45 $(( menu_count + 3 )) \ diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-utils.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-utils.sh index cc4e043..33b1cf0 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-utils.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-utils.sh @@ -214,45 +214,11 @@ replace_colors() { input="${input//$(echo -e '\033[0;37m')/\\Z7}" # white input="${input//$(echo -e '\033[7m')/\\Zr}" # invert input="${input//$(echo -e '\033[4m')/\\Zu}" # underline - input="${input//$(echo -e '\033[0m')/\\Zn}" # reset + input="${input//$(echo -e '\e[39m')/\\Z0}" # reset colors not underline + input="${input//$(echo -e '\033[0m')/\\Zn}" # reset all echo "$input" } -# this has been moved to /usr/local/bin/packages/ttyd.sh under the aegis of femto_software.sh -# ttyd() { -# if [ "$1" = "disable" ]; then -# systemctl disable ttyd -# systemctl stop ttyd -# echo "Disabled ttyd service." -# exit 0 -# elif [ "$1" = "enable" ]; then -# systemctl enable ttyd -# echo "Enabled ttyd service." -# systemctl start ttyd -# exit 0 -# elif [ "$1" = "check" ]; then -# if systemctl is-enabled ttyd &>/dev/null; then -# if echo "$(systemctl status ttyd)" | grep -q "active (running)"; then -# echo -e "\033[4m\033[0;34menabled and running\033[0m" -# elif echo "$(systemctl status ttyd)" | grep -q "inactive (dead)"; then -# echo -e "\033[4m\033[0;31menabled but not running\033[0m" -# exit 1 -# else -# echo "unknown" -# fi -# else -# echo -e "\033[4m\033[0;31mdisabled\033[0m" -# exit 1 -# fi -# elif [ "$1" = "start" ]; then -# echo "Starting/restarting ttyd service..." -# systemctl restart ttyd -# elif [ "$1" = "stop" ]; then -# echo "Stopping ttyd service..." -# systemctl stop ttyd -# fi -# } - while getopts ":harsl:ipcnoSEC:R:" opt; do case ${opt} in h) # Option -h (help) @@ -289,26 +255,29 @@ while getopts ":harsl:ipcnoSEC:R:" opt; do ;; C) # Option -C (Check service) if systemctl is-enabled $OPTARG &>/dev/null; then - if echo "$(systemctl status $OPTARG)" | grep -q "active (running)"; then - echo -e "\033[4m\033[0;34menabled and running\033[0m" - exit 0 - elif echo "$(systemctl status $OPTARG)" | grep -q "inactive (dead)"; then - echo -e "\033[4m\033[0;31menabled but not running\033[0m" - exit 1 - elif echo "$(systemctl status $OPTARG)" | grep -q "failed"; then - echo -e "\033[4m\033[0;31menabled but failed\033[0m" - exit 1 - elif echo "$(systemctl status $OPTARG)" | grep -q "activating"; then - echo -e "\033[4m\033[0;31menabled, activating\033[0m" - exit 2 - else - echo "unknown" - exit 2 - fi + state="\033[0;34m\033[4menabled\e[39m, " else - echo -e "\033[4m\033[0;31mdisabled\033[0m" - exit 1 + state="\033[0;31m\033[4mdisabled\e[39m, " + exit_state=1 fi + if echo "$(systemctl status $OPTARG)" | grep -q "active (running)"; then + state+="\033[0;34mrunning\e[0m" + exit_state=0 + elif echo "$(systemctl status $OPTARG)" | grep -q "inactive (dead)"; then + state+="\033[0;31mnot running\e[0m" + exit_state=1 + elif echo "$(systemctl status $OPTARG)" | grep -q "failed"; then + state+="\033[0;31mfailed\e[0m" + exit_state=1 + elif echo "$(systemctl status $OPTARG)" | grep -q "activating"; then + state+="activating\e[0m" + exit_state=2 + else + state+="unknown\e[0m" + exit_state=2 + fi + echo -e "$state" + exit $exit_state ;; R) replace_colors "$OPTARG" From a99539977414f61372459d77815944a257091c40 Mon Sep 17 00:00:00 2001 From: noon92 <40807970+noon92@users.noreply.github.com> Date: Sun, 9 Feb 2025 00:26:55 +0200 Subject: [PATCH 5/6] Revert "Update new_working from OSC" --- environment-setup/femtofox.chroot | 1 - .../etc/systemd/system/time-monitor.service | 12 - .../usr/local/bin/time_change.sh | 58 -- .../dts/rv1106-luckfox-pico-ultra-ipc.dtsi | 538 ------------------ 4 files changed, 609 deletions(-) delete mode 100644 foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/systemd/system/time-monitor.service delete mode 100755 foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/time_change.sh delete mode 100644 foxbuntu/sysdrv/source/kernel/arch/arm/boot/dts/rv1106-luckfox-pico-ultra-ipc.dtsi diff --git a/environment-setup/femtofox.chroot b/environment-setup/femtofox.chroot index c4342c9..3acbe42 100644 --- a/environment-setup/femtofox.chroot +++ b/environment-setup/femtofox.chroot @@ -61,7 +61,6 @@ systemctl enable femto-runonce.service systemctl enable femto-usb-config-tool.service systemctl enable femto-boot-complete.service systemctl enable wifi-mesh-control -systemctl enable time-monitor systemctl disable apt-daily.timer systemctl disable unattended-upgrades diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/systemd/system/time-monitor.service b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/systemd/system/time-monitor.service deleted file mode 100644 index 5ffa753..0000000 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/systemd/system/time-monitor.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Monitor time changes and restart meshtasticd -After=network.target - -[Service] -ExecStart=/usr/local/bin/time_monitor.sh -Restart=always -User=root - -[Install] -WantedBy=multi-user.target - diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/time_change.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/time_change.sh deleted file mode 100755 index c07fb34..0000000 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/time_change.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -THRESHOLD=$((7 * 24 * 60 * 60)) # 1 week in seconds -LOGFILE="/var/log/time_change.log" -LAST_TIME_FILE="/tmp/last_time" - -# Function to check time jump -check_time_jump() { - NEW_TIME=$(date +%s) - - if [ -f "$LAST_TIME_FILE" ]; then - OLD_TIME=$(cat "$LAST_TIME_FILE") - else - OLD_TIME=$NEW_TIME - fi - - TIME_DIFF=$((NEW_TIME - OLD_TIME)) - - if [ "${TIME_DIFF#-}" -ge "$THRESHOLD" ]; then - echo "$(date) - Large time change detected ($TIME_DIFF seconds), restarting meshtasticd" | tee -a "$LOGFILE" - systemctl restart meshtasticd - fi - - echo "$NEW_TIME" > "$LAST_TIME_FILE" -} - -# Monitor chronyd logs for time jumps (background) -( - journalctl -fu chronyd --no-pager | while read -r line; do - if echo "$line" | grep -q "Forward time jump detected"; then - echo "$(date) - Detected time change via chronyd logs" | tee -a "$LOGFILE" - check_time_jump - fi - done -) & - -# Monitor /etc/adjtime for manual or RTC-based time changes (background) -( - while true; do - if find /etc/adjtime -mmin -1 | grep -q .; then - echo "$(date) - Time change detected via /etc/adjtime modification" | tee -a "$LOGFILE" - check_time_jump - fi - sleep 5 - done -) & - -# Fallback: Compare timestamps every 5 seconds (if other methods fail) -( - while true; do - check_time_jump - sleep 5 - done -) & - -# Keep script running -wait - diff --git a/foxbuntu/sysdrv/source/kernel/arch/arm/boot/dts/rv1106-luckfox-pico-ultra-ipc.dtsi b/foxbuntu/sysdrv/source/kernel/arch/arm/boot/dts/rv1106-luckfox-pico-ultra-ipc.dtsi deleted file mode 100644 index 4e90c76..0000000 --- a/foxbuntu/sysdrv/source/kernel/arch/arm/boot/dts/rv1106-luckfox-pico-ultra-ipc.dtsi +++ /dev/null @@ -1,538 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -/* - * Copyright (c) 2022 Rockchip Electronics Co., Ltd. - */ - -#include "rv1106-evb.dtsi" -#include -#include - -/ { - chosen { - bootargs = "earlycon=uart8250,mmio32,0xff4c0000 console=ttyFIQ0 root=/dev/mmcblk0p7 rootwait snd_soc_core.prealloc_buffer_size_kbytes=16 coherent_pool=0"; - }; - - backlight: backlight { - status = "okay"; - compatible = "pwm-backlight"; - pwms = <&pwm1 0 100000 50000>; - brightness-levels = < - 0 1 2 3 4 5 6 7 - 8 9 10 11 12 13 14 15 - 16 17 18 19 20 21 22 23 - 24 25 26 27 28 29 30 31 - 32 33 34 35 36 37 38 39 - 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 - 56 57 58 59 60 61 62 63 - 64 65 66 67 68 69 70 71 - 72 73 74 75 76 77 78 79 - 80 81 82 83 84 85 86 87 - 88 89 90 91 92 93 94 95 - 96 97 98 99 100 101 102 103 - 104 105 106 107 108 109 110 111 - 112 113 114 115 116 117 118 119 - 120 121 122 123 124 125 126 127 - 128 129 130 131 132 133 134 135 - 136 137 138 139 140 141 142 143 - 144 145 146 147 148 149 150 151 - 152 153 154 155 156 157 158 159 - 160 161 162 163 164 165 166 167 - 168 169 170 171 172 173 174 175 - 176 177 178 179 180 181 182 183 - 184 185 186 187 188 189 190 191 - 192 193 194 195 196 197 198 199 - 200 201 202 203 204 205 206 207 - 208 209 210 211 212 213 214 215 - 216 217 218 219 220 221 222 223 - 224 225 226 227 228 229 230 231 - 232 233 234 235 236 237 238 239 - 240 241 242 243 244 245 246 247 - 248 249 250 251 252 253 254 255>; - default-brightness-level = <255>; - }; - - panel: panel { - compatible = "simple-panel"; - backlight = <&backlight>; - - reset-gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>; - reset-delay-ms = <200>; - status = "okay"; - - bus-format = ; - width-mm = <85>; - height-mm = <85>; - - display-timings { - native-mode = <&timing0>; - - timing0: timing0 { - clock-frequency = <30000000>; - hactive = <720>; - vactive = <720>; - hback-porch = <44>; - hfront-porch = <46>; - vback-porch = <18>; - vfront-porch = <16>; - hsync-len = <2>; - vsync-len = <2>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <0>; - pixelclk-active = <0>; - }; - }; - - port { - panel_in_rgb: endpoint { - remote-endpoint = <&rgb_out_panel>; - }; - }; - }; - - reserved_memory: reserved-memory { - status = "okay"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - drm_logo: drm-logo@00000000 { - compatible = "rockchip,drm-logo"; - reg = <0x0 0x0>; - }; - linux,cma { - status = "okay"; - compatible = "shared-dma-pool"; - inactive; - reusable; - size = <0xA00000>; //10M - linux,cma-default; - }; - mmc_ecsd: mmc@3f000 { - reg = <0x3f000 0x00001000>; - }; - }; - - acodec_sound: acodec-sound { - compatible = "simple-audio-card"; - simple-audio-card,name = "rv1106-acodec"; - simple-audio-card,format = "i2s"; - simple-audio-card,mclk-fs = <256>; - simple-audio-card,cpu { - sound-dai = <&i2s0_8ch>; - }; - simple-audio-card,codec { - sound-dai = <&acodec>; - }; - }; - - dsm_sound: dsm-sound { - status = "disabled"; - compatible = "simple-audio-card"; - simple-audio-card,format = "i2s"; - simple-audio-card,mclk-fs = <256>; - simple-audio-card,name = "rockchip,dsm-sound"; - simple-audio-card,bitclock-master = <&sndcodec>; - simple-audio-card,frame-master = <&sndcodec>; - sndcpu: simple-audio-card,cpu { - sound-dai = <&i2s0_8ch>; - }; - sndcodec: simple-audio-card,codec { - sound-dai = <&dsm>; - }; - }; - - vcc_1v8: vcc-1v8 { - compatible = "regulator-fixed"; - regulator-name = "vcc_1v8"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - }; - - vcc_3v3: vcc-3v3 { - compatible = "regulator-fixed"; - regulator-name = "vcc_3v3"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - }; - - vdd_arm: vdd-arm { - compatible = "regulator-fixed"; - regulator-name = "vdd_arm"; - regulator-min-microvolt = <800000>; - regulator-max-microvolt = <1000000>; - regulator-init-microvolt = <900000>; - regulator-always-on; - regulator-boot-on; - }; - - leds: leds { - compatible = "gpio-leds"; - work_led: work{ - gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "activity"; - default-state = "on"; - }; - }; -}; - -/***************************** audio ********************************/ -&i2s0_8ch { - #sound-dai-cells = <0>; - status = "okay"; -}; - -&acodec { - #sound-dai-cells = <0>; - pa-ctl-gpios = <&gpio3 RK_PD3 GPIO_ACTIVE_HIGH>; - status = "okay"; -}; - -/************************* FIQ_DUBUGGER ****************************/ -&fiq_debugger { - rockchip,irq-mode-enable = <1>; - status = "okay"; -}; - -/***************************** USB *********************************/ -&u2phy { - status = "okay"; -}; - -&u2phy_otg { - status = "okay"; -}; - -&usbdrd { - status = "okay"; -}; - -&usbdrd_dwc3 { - extcon = <&u2phy>; - status = "okay"; -}; - -/***************************** DSM *********************************/ -&dsm { - status = "disabled"; -}; - -&cpu0 { - cpu-supply = <&vdd_arm>; -}; - -/*************************** CSI *********************************/ -&csi2_dphy_hw { - status = "okay"; -}; - -&csi2_dphy0 { - status = "okay"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - #address-cells = <1>; - #size-cells = <0>; - - csi_dphy_input0: endpoint@0 { - reg = <0>; - remote-endpoint = <&sc3336_out>; - data-lanes = <1 2>; - }; - - }; - - port@1 { - reg = <1>; - #address-cells = <1>; - #size-cells = <0>; - - csi_dphy_output: endpoint@0 { - reg = <0>; - remote-endpoint = <&mipi_csi2_input>; - }; - }; - }; -}; - -&i2c4 { - status = "okay"; - clock-frequency = <400000>; - pinctrl-names = "default"; - // pinctrl-0 = <&i2c4m2_xfer>; - - sc3336: sc3336@30 { - compatible = "smartsens,sc3336"; - status = "okay"; - reg = <0x30>; - clocks = <&cru MCLK_REF_MIPI0>; - clock-names = "xvclk"; - reset-gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&mipi_refclk_out0>; - rockchip,camera-module-index = <0>; - rockchip,camera-module-facing = "back"; - rockchip,camera-module-name = "CMK-OT2119-PC1"; - rockchip,camera-module-lens-name = "30IRC-F16"; - port { - sc3336_out: endpoint { - remote-endpoint = <&csi_dphy_input0>; - data-lanes = <1 2>; - }; - }; - }; -}; - -&mipi0_csi2 { - status = "okay"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - #address-cells = <1>; - #size-cells = <0>; - - mipi_csi2_input: endpoint@1 { - reg = <1>; - remote-endpoint = <&csi_dphy_output>; - }; - }; - - port@1 { - reg = <1>; - #address-cells = <1>; - #size-cells = <0>; - - mipi_csi2_output: endpoint@0 { - reg = <0>; - remote-endpoint = <&cif_mipi_in>; - }; - }; - }; -}; - -&rkcif { - status = "okay"; -}; - -&rkcif_mipi_lvds { - status = "okay"; - - pinctrl-names = "default"; - pinctrl-0 = <&mipi_pins>; - port { - /* MIPI CSI-2 endpoint */ - cif_mipi_in: endpoint { - remote-endpoint = <&mipi_csi2_output>; - }; - }; -}; - -&rkcif_mipi_lvds_sditf { - status = "okay"; - - port { - /* MIPI CSI-2 endpoint */ - mipi_lvds_sditf: endpoint { - remote-endpoint = <&isp_in>; - }; - }; -}; - -&rkisp { - status = "okay"; -}; - -&rkisp_vir0 { - status = "okay"; - - port@0 { - isp_in: endpoint { - remote-endpoint = <&mipi_lvds_sditf>; - }; - }; -}; - -/***************************** ADC ********************************/ -&saradc { - status = "okay"; - vref-supply = <&vcc_1v8>; -}; - -&tsadc { - status = "okay"; -}; - -/**************************** LCD/TP ******************************/ -&pwm1 { - status = "okay"; - pinctrl-names = "active"; - pinctrl-0 = <&pwm1m2_pins>; -}; - -&display_subsystem { - status = "okay"; - logo-memory-region = <&drm_logo>; -}; - -&rgb { - status = "disabled"; - pinctrl-names = "default"; - pinctrl-0 = <&lcd_pins>; - - ports { - rgb_out: port@1 { - reg = <1>; - #address-cells = <1>; - #size-cells = <0>; - - rgb_out_panel: endpoint@0 { - reg = <0>; - remote-endpoint = <&panel_in_rgb>; - }; - }; - }; -}; - -&rgb_in_vop { - status = "okay"; -}; - -&route_rgb { - status = "disabled"; -}; - -&vop { - status = "okay"; -}; - -&i2c3 { - clock-frequency = <100000>; - GT911:touchscreen { - compatible = "goodix,gt911"; - reg = <0x14>; - - interrupt-parent = <&gpio0>; - interrupts = ; - - reset-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>; - pinctrl-names = "default"; - }; -}; - -/**************************** PINCTRL ******************************/ -// SPI -&spi0 { - pinctrl-0 = <&spi0m0_clk &spi0m0_miso &spi0m0_mosi &spi0m0_cs0>; - #address-cells = <1>; - #size-cells = <0>; - spidev@0 { - compatible = "rockchip,spidev"; - spi-max-frequency = <50000000>; - reg = <0>; - }; -}; - -// I2C -&i2c1 { - pinctrl-0 = <&i2c1m1_xfer>; -}; -&i2c2 { - pinctrl-0 = <&i2c2m0_xfer>; -}; -&i2c3 { - pinctrl-0 = <&i2c3m0_xfer &i2c3m1_xfer &i2c3m2_xfer &tp_rst &tp_irq>; -}; -&i2c4 { - pinctrl-0 = <&i2c4m0_xfer &i2c4m1_xfer &i2c4m2_xfer>; -}; - -// UART -&uart0 { - pinctrl-0 = <&uart0m0_xfer &uart0m1_xfer>; -}; -&uart1 { - pinctrl-0 = <&uart1m1_xfer>; -}; -&uart3 { - pinctrl-0 = <&uart3m0_xfer &uart3m1_xfer>; -}; -&uart4 { - pinctrl-0 = <&uart4m0_xfer>; -}; -&uart5 { - pinctrl-0 = <&uart5m1_xfer>; -}; - -// PWM -&pwm0 { - pinctrl-0 = <&pwm0m1_pins>; -}; -&pwm2 { - pinctrl-0 = <&pwm2m1_pins &pwm2m2_pins>; -}; -&pwm3 { - pinctrl-0 = <&pwm3m2_pins>; -}; -&pwm4 { - pinctrl-0 = <&pwm4m0_pins &pwm4m1_pins &pwm4m2_pins>; -}; -&pwm5 { - pinctrl-0 = <&pwm5m1_pins &pwm5m2_pins>; -}; -&pwm6 { - pinctrl-0 = <&pwm6m1_pins &pwm6m2_pins>; -}; -&pwm7 { - pinctrl-0 = <&pwm7m0_pins &pwm7m1_pins>; -}; -&pwm8 { - pinctrl-0 = <&pwm8m1_pins>; -}; -&pwm9 { - pinctrl-0 = <&pwm9m1_pins>; -}; -&pwm10 { - pinctrl-0 = <&pwm10m1_pins &pwm10m2_pins>; -}; -&pwm11 { - pinctrl-0 = <&pwm11m1_pins &pwm11m2_pins>; -}; - -&pinctrl { - spi0 { - spi0m0_clk: spi0m0-clk { - rockchip,pins = <1 RK_PC1 4 &pcfg_pull_none>; - }; - spi0m0_mosi: spi0m0-mosi { - rockchip,pins = <1 RK_PC2 6 &pcfg_pull_none>; - }; - spi0m0_miso: spi0m0-miso { - rockchip,pins = <1 RK_PC3 6 &pcfg_pull_none>; - }; - spi0m0_cs0: spi0m0-cs0 { - rockchip,pins = <1 RK_PC0 4 &pcfg_pull_none>; - }; - }; - - touchscreen { - tp_rst:tp-rst { - rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>; - }; - - tp_irq:tp-irq { - rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; - }; - }; -}; From 99dcac2b66e52ed7dfeef1469a307230e3f43b55 Mon Sep 17 00:00:00 2001 From: nagumii Date: Sun, 9 Feb 2025 00:33:22 +0200 Subject: [PATCH 6/6] Create rv1106-luckfox-pico-ultra-ipc.dtsi --- .../dts/rv1106-luckfox-pico-ultra-ipc.dtsi | 538 ++++++++++++++++++ 1 file changed, 538 insertions(+) create mode 100644 foxbuntu/sysdrv/source/kernel/arch/arm/boot/dts/rv1106-luckfox-pico-ultra-ipc.dtsi diff --git a/foxbuntu/sysdrv/source/kernel/arch/arm/boot/dts/rv1106-luckfox-pico-ultra-ipc.dtsi b/foxbuntu/sysdrv/source/kernel/arch/arm/boot/dts/rv1106-luckfox-pico-ultra-ipc.dtsi new file mode 100644 index 0000000..4e90c76 --- /dev/null +++ b/foxbuntu/sysdrv/source/kernel/arch/arm/boot/dts/rv1106-luckfox-pico-ultra-ipc.dtsi @@ -0,0 +1,538 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2022 Rockchip Electronics Co., Ltd. + */ + +#include "rv1106-evb.dtsi" +#include +#include + +/ { + chosen { + bootargs = "earlycon=uart8250,mmio32,0xff4c0000 console=ttyFIQ0 root=/dev/mmcblk0p7 rootwait snd_soc_core.prealloc_buffer_size_kbytes=16 coherent_pool=0"; + }; + + backlight: backlight { + status = "okay"; + compatible = "pwm-backlight"; + pwms = <&pwm1 0 100000 50000>; + brightness-levels = < + 0 1 2 3 4 5 6 7 + 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 + 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 + 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 + 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 + 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 + 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 + 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 + 120 121 122 123 124 125 126 127 + 128 129 130 131 132 133 134 135 + 136 137 138 139 140 141 142 143 + 144 145 146 147 148 149 150 151 + 152 153 154 155 156 157 158 159 + 160 161 162 163 164 165 166 167 + 168 169 170 171 172 173 174 175 + 176 177 178 179 180 181 182 183 + 184 185 186 187 188 189 190 191 + 192 193 194 195 196 197 198 199 + 200 201 202 203 204 205 206 207 + 208 209 210 211 212 213 214 215 + 216 217 218 219 220 221 222 223 + 224 225 226 227 228 229 230 231 + 232 233 234 235 236 237 238 239 + 240 241 242 243 244 245 246 247 + 248 249 250 251 252 253 254 255>; + default-brightness-level = <255>; + }; + + panel: panel { + compatible = "simple-panel"; + backlight = <&backlight>; + + reset-gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>; + reset-delay-ms = <200>; + status = "okay"; + + bus-format = ; + width-mm = <85>; + height-mm = <85>; + + display-timings { + native-mode = <&timing0>; + + timing0: timing0 { + clock-frequency = <30000000>; + hactive = <720>; + vactive = <720>; + hback-porch = <44>; + hfront-porch = <46>; + vback-porch = <18>; + vfront-porch = <16>; + hsync-len = <2>; + vsync-len = <2>; + hsync-active = <0>; + vsync-active = <0>; + de-active = <0>; + pixelclk-active = <0>; + }; + }; + + port { + panel_in_rgb: endpoint { + remote-endpoint = <&rgb_out_panel>; + }; + }; + }; + + reserved_memory: reserved-memory { + status = "okay"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + drm_logo: drm-logo@00000000 { + compatible = "rockchip,drm-logo"; + reg = <0x0 0x0>; + }; + linux,cma { + status = "okay"; + compatible = "shared-dma-pool"; + inactive; + reusable; + size = <0xA00000>; //10M + linux,cma-default; + }; + mmc_ecsd: mmc@3f000 { + reg = <0x3f000 0x00001000>; + }; + }; + + acodec_sound: acodec-sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "rv1106-acodec"; + simple-audio-card,format = "i2s"; + simple-audio-card,mclk-fs = <256>; + simple-audio-card,cpu { + sound-dai = <&i2s0_8ch>; + }; + simple-audio-card,codec { + sound-dai = <&acodec>; + }; + }; + + dsm_sound: dsm-sound { + status = "disabled"; + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + simple-audio-card,mclk-fs = <256>; + simple-audio-card,name = "rockchip,dsm-sound"; + simple-audio-card,bitclock-master = <&sndcodec>; + simple-audio-card,frame-master = <&sndcodec>; + sndcpu: simple-audio-card,cpu { + sound-dai = <&i2s0_8ch>; + }; + sndcodec: simple-audio-card,codec { + sound-dai = <&dsm>; + }; + }; + + vcc_1v8: vcc-1v8 { + compatible = "regulator-fixed"; + regulator-name = "vcc_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + vcc_3v3: vcc-3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc_3v3"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + vdd_arm: vdd-arm { + compatible = "regulator-fixed"; + regulator-name = "vdd_arm"; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1000000>; + regulator-init-microvolt = <900000>; + regulator-always-on; + regulator-boot-on; + }; + + leds: leds { + compatible = "gpio-leds"; + work_led: work{ + gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "activity"; + default-state = "on"; + }; + }; +}; + +/***************************** audio ********************************/ +&i2s0_8ch { + #sound-dai-cells = <0>; + status = "okay"; +}; + +&acodec { + #sound-dai-cells = <0>; + pa-ctl-gpios = <&gpio3 RK_PD3 GPIO_ACTIVE_HIGH>; + status = "okay"; +}; + +/************************* FIQ_DUBUGGER ****************************/ +&fiq_debugger { + rockchip,irq-mode-enable = <1>; + status = "okay"; +}; + +/***************************** USB *********************************/ +&u2phy { + status = "okay"; +}; + +&u2phy_otg { + status = "okay"; +}; + +&usbdrd { + status = "okay"; +}; + +&usbdrd_dwc3 { + extcon = <&u2phy>; + status = "okay"; +}; + +/***************************** DSM *********************************/ +&dsm { + status = "disabled"; +}; + +&cpu0 { + cpu-supply = <&vdd_arm>; +}; + +/*************************** CSI *********************************/ +&csi2_dphy_hw { + status = "okay"; +}; + +&csi2_dphy0 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + csi_dphy_input0: endpoint@0 { + reg = <0>; + remote-endpoint = <&sc3336_out>; + data-lanes = <1 2>; + }; + + }; + + port@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + csi_dphy_output: endpoint@0 { + reg = <0>; + remote-endpoint = <&mipi_csi2_input>; + }; + }; + }; +}; + +&i2c4 { + status = "okay"; + clock-frequency = <400000>; + pinctrl-names = "default"; + // pinctrl-0 = <&i2c4m2_xfer>; + + sc3336: sc3336@30 { + compatible = "smartsens,sc3336"; + status = "okay"; + reg = <0x30>; + clocks = <&cru MCLK_REF_MIPI0>; + clock-names = "xvclk"; + reset-gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&mipi_refclk_out0>; + rockchip,camera-module-index = <0>; + rockchip,camera-module-facing = "back"; + rockchip,camera-module-name = "CMK-OT2119-PC1"; + rockchip,camera-module-lens-name = "30IRC-F16"; + port { + sc3336_out: endpoint { + remote-endpoint = <&csi_dphy_input0>; + data-lanes = <1 2>; + }; + }; + }; +}; + +&mipi0_csi2 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + mipi_csi2_input: endpoint@1 { + reg = <1>; + remote-endpoint = <&csi_dphy_output>; + }; + }; + + port@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + mipi_csi2_output: endpoint@0 { + reg = <0>; + remote-endpoint = <&cif_mipi_in>; + }; + }; + }; +}; + +&rkcif { + status = "okay"; +}; + +&rkcif_mipi_lvds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&mipi_pins>; + port { + /* MIPI CSI-2 endpoint */ + cif_mipi_in: endpoint { + remote-endpoint = <&mipi_csi2_output>; + }; + }; +}; + +&rkcif_mipi_lvds_sditf { + status = "okay"; + + port { + /* MIPI CSI-2 endpoint */ + mipi_lvds_sditf: endpoint { + remote-endpoint = <&isp_in>; + }; + }; +}; + +&rkisp { + status = "okay"; +}; + +&rkisp_vir0 { + status = "okay"; + + port@0 { + isp_in: endpoint { + remote-endpoint = <&mipi_lvds_sditf>; + }; + }; +}; + +/***************************** ADC ********************************/ +&saradc { + status = "okay"; + vref-supply = <&vcc_1v8>; +}; + +&tsadc { + status = "okay"; +}; + +/**************************** LCD/TP ******************************/ +&pwm1 { + status = "okay"; + pinctrl-names = "active"; + pinctrl-0 = <&pwm1m2_pins>; +}; + +&display_subsystem { + status = "okay"; + logo-memory-region = <&drm_logo>; +}; + +&rgb { + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <&lcd_pins>; + + ports { + rgb_out: port@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + rgb_out_panel: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_in_rgb>; + }; + }; + }; +}; + +&rgb_in_vop { + status = "okay"; +}; + +&route_rgb { + status = "disabled"; +}; + +&vop { + status = "okay"; +}; + +&i2c3 { + clock-frequency = <100000>; + GT911:touchscreen { + compatible = "goodix,gt911"; + reg = <0x14>; + + interrupt-parent = <&gpio0>; + interrupts = ; + + reset-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + }; +}; + +/**************************** PINCTRL ******************************/ +// SPI +&spi0 { + pinctrl-0 = <&spi0m0_clk &spi0m0_miso &spi0m0_mosi &spi0m0_cs0>; + #address-cells = <1>; + #size-cells = <0>; + spidev@0 { + compatible = "rockchip,spidev"; + spi-max-frequency = <50000000>; + reg = <0>; + }; +}; + +// I2C +&i2c1 { + pinctrl-0 = <&i2c1m1_xfer>; +}; +&i2c2 { + pinctrl-0 = <&i2c2m0_xfer>; +}; +&i2c3 { + pinctrl-0 = <&i2c3m0_xfer &i2c3m1_xfer &i2c3m2_xfer &tp_rst &tp_irq>; +}; +&i2c4 { + pinctrl-0 = <&i2c4m0_xfer &i2c4m1_xfer &i2c4m2_xfer>; +}; + +// UART +&uart0 { + pinctrl-0 = <&uart0m0_xfer &uart0m1_xfer>; +}; +&uart1 { + pinctrl-0 = <&uart1m1_xfer>; +}; +&uart3 { + pinctrl-0 = <&uart3m0_xfer &uart3m1_xfer>; +}; +&uart4 { + pinctrl-0 = <&uart4m0_xfer>; +}; +&uart5 { + pinctrl-0 = <&uart5m1_xfer>; +}; + +// PWM +&pwm0 { + pinctrl-0 = <&pwm0m1_pins>; +}; +&pwm2 { + pinctrl-0 = <&pwm2m1_pins &pwm2m2_pins>; +}; +&pwm3 { + pinctrl-0 = <&pwm3m2_pins>; +}; +&pwm4 { + pinctrl-0 = <&pwm4m0_pins &pwm4m1_pins &pwm4m2_pins>; +}; +&pwm5 { + pinctrl-0 = <&pwm5m1_pins &pwm5m2_pins>; +}; +&pwm6 { + pinctrl-0 = <&pwm6m1_pins &pwm6m2_pins>; +}; +&pwm7 { + pinctrl-0 = <&pwm7m0_pins &pwm7m1_pins>; +}; +&pwm8 { + pinctrl-0 = <&pwm8m1_pins>; +}; +&pwm9 { + pinctrl-0 = <&pwm9m1_pins>; +}; +&pwm10 { + pinctrl-0 = <&pwm10m1_pins &pwm10m2_pins>; +}; +&pwm11 { + pinctrl-0 = <&pwm11m1_pins &pwm11m2_pins>; +}; + +&pinctrl { + spi0 { + spi0m0_clk: spi0m0-clk { + rockchip,pins = <1 RK_PC1 4 &pcfg_pull_none>; + }; + spi0m0_mosi: spi0m0-mosi { + rockchip,pins = <1 RK_PC2 6 &pcfg_pull_none>; + }; + spi0m0_miso: spi0m0-miso { + rockchip,pins = <1 RK_PC3 6 &pcfg_pull_none>; + }; + spi0m0_cs0: spi0m0-cs0 { + rockchip,pins = <1 RK_PC0 4 &pcfg_pull_none>; + }; + }; + + touchscreen { + tp_rst:tp-rst { + rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + tp_irq:tp-irq { + rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +};