rockchip64: add ssv6051p wifi driver for current and edge kernel (#4269)

* Add ssv6051p wifi driver for rockchip64 current and edge kernel

 * also reorders and tidies device tree overlays for rk3318-box

* increase ssv6051 sdio bus to 50MHz in the driver
This commit is contained in:
Paolo 2022-10-12 11:22:33 +02:00 committed by GitHub
parent f2a61e9888
commit 78bbdf44d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 99377 additions and 220 deletions

View File

@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.15.64 Kernel Configuration
# Linux/arm64 5.15.72 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0"
CONFIG_CC_IS_GCC=y
@ -369,6 +369,8 @@ CONFIG_ARM64_ERRATUM_1286807=y
CONFIG_ARM64_ERRATUM_1463225=y
CONFIG_ARM64_ERRATUM_1542419=y
CONFIG_ARM64_ERRATUM_1508412=y
CONFIG_ARM64_ERRATUM_2441009=y
CONFIG_ARM64_ERRATUM_2457168=y
CONFIG_CAVIUM_ERRATUM_22375=y
CONFIG_CAVIUM_ERRATUM_23144=y
CONFIG_CAVIUM_ERRATUM_23154=y
@ -1622,7 +1624,9 @@ CONFIG_NET_NSH=m
CONFIG_HSR=m
CONFIG_NET_SWITCHDEV=y
CONFIG_NET_L3_MASTER_DEV=y
# CONFIG_QRTR is not set
CONFIG_QRTR=m
# CONFIG_QRTR_TUN is not set
CONFIG_QRTR_MHI=m
# CONFIG_NET_NCSI is not set
CONFIG_PCPU_DEV_REFCNT=y
CONFIG_RPS=y
@ -3143,6 +3147,7 @@ CONFIG_USB_NET_CH9200=m
CONFIG_USB_NET_AQC111=m
CONFIG_USB_RTL8153_ECM=m
CONFIG_WLAN=y
CONFIG_SSV6051=m
# CONFIG_WLAN_VENDOR_ADMTEK is not set
CONFIG_ATH_COMMON=m
CONFIG_WLAN_VENDOR_ATH=y
@ -3191,6 +3196,8 @@ CONFIG_ATH10K_USB=m
# CONFIG_WCN36XX is not set
CONFIG_ATH11K=m
CONFIG_ATH11K_PCI=m
# CONFIG_ATH11K_DEBUG is not set
# CONFIG_ATH11K_TRACING is not set
CONFIG_WLAN_VENDOR_ATMEL=y
CONFIG_ATMEL=m
CONFIG_PCI_ATMEL=m
@ -7610,6 +7617,7 @@ CONFIG_LITEX_SOC_CONTROLLER=m
#
# Qualcomm SoC drivers
#
CONFIG_QCOM_QMI_HELPERS=m
# end of Qualcomm SoC drivers
CONFIG_ROCKCHIP_GRF=y

View File

@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.19.9 Kernel Configuration
# Linux/arm64 5.19.14 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0"
CONFIG_CC_IS_GCC=y
@ -3232,6 +3232,7 @@ CONFIG_USB_NET_CH9200=m
CONFIG_USB_NET_AQC111=m
CONFIG_USB_RTL8153_ECM=m
CONFIG_WLAN=y
CONFIG_SSV6051=m
# CONFIG_WLAN_VENDOR_ADMTEK is not set
CONFIG_ATH_COMMON=m
CONFIG_WLAN_VENDOR_ATH=y
@ -6162,10 +6163,10 @@ CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set
# CONFIG_BOOTSPLASH is not set
# end of Console display driver support
CONFIG_LOGO=y

View File

@ -22,7 +22,7 @@ bus."
NOTE_BOARD_SELECTION="${COLOR_RED}Important:${COLOR_BLACK} select the \
board configuration looking on the markings of the board.\nThe right \
configuration solve problems with devices detection like leds,\n\
configuration solves problems with devices detection like leds,\n\
wifi, bluetooth and improve general stability\n\n"
EFUSE_PATH="/sys/bus/nvmem/devices/rockchip-efuse0/nvmem"
@ -37,6 +37,7 @@ declare -A WIFI_CHIPS
declare -A DT_EMMC_OVERLAYS
declare -A DT_LED_OVERLAYS
declare -a DT_LED_OVERLAYS_ORDER
declare -A DT_CPU_OVERLAYS
declare -A DT_WIFI_OVERLAYS
@ -69,19 +70,19 @@ WIFI_CHIPS+=(["02d0:4330"]="")
DT_EMMC_OVERLAYS+=(["rk3318-box-emmc-ddr"]="enable eMMC DDR Mode")
DT_EMMC_OVERLAYS+=(["rk3318-box-emmc-hs200"]="enable eMMC HS200 Mode")
DT_LED_OVERLAYS+=(["n/a"]="Generic/unlisted")
DT_LED_OVERLAYS+=(["rk3318-box-led-conf1"]="YX_RK3328 boards")
DT_LED_OVERLAYS+=(["rk3318-box-led-conf1"]="Generic (also YX_RK3328, RK3318_V1.x)")
DT_LED_OVERLAYS+=(["rk3318-box-led-conf4"]="Generic + wifi on sdmmc-ext")
DT_LED_OVERLAYS+=(["rk3318-box-led-conf2"]="X88_PRO_B boards")
DT_LED_OVERLAYS+=(["rk3318-box-led-conf3"]="MXQ-RK3328-D4 boards (w/ RK805)")
DT_LED_OVERLAYS_ORDER=("rk3318-box-led-conf1" "rk3318-box-led-conf4" "rk3318-box-led-conf2" "rk3318-box-led-conf3")
DT_CPU_OVERLAYS+=(["rk3318-box-cpu-hs"]="RK3318 or RK3328")
#DT_WIFI_OVERLAYS+=(["6666:1111"]="rk3318-box-wlan-esp8089")
DT_WIFI_OVERLAYS+=(["02d0:4334"]="rk3318-box-wlan-ap6334")
DT_WIFI_OVERLAYS+=(["02d0:4330"]="rk3318-box-wlan-ap6330")
DT_WIFI_ALTERNATE_SDIO="rk3318-box-wlan-ext"
KERNEL_VERSION=$(uname -r | cut -d "-" -f 1)
if [[ "$KERNEL_VERSION" < "4.5.0" ]]; then
LEGACY_KERNEL=1
@ -166,7 +167,7 @@ function get_wifi_chip_id() {
SDIO_PATH="$1"
if [ -d "$SDIO_PATH" ]; then
VENDOR=$(cut -c 3- "$SDIO_PATH/vendor")
DEVICE=$(cut -c 3- "$SDIO_PATH/device")
@ -265,7 +266,7 @@ function apply_wifi_blacklist() {
if [ -z $WIFI_MODULE ]; then
if [ -f $BLACKLIST_MODPROBE_CONF ]; then
for MODULE in "${WIFI_CHIPS[@]}"; do
sed -i "s/#blacklist $MODULE/blacklist $MODULE/g" $BLACKLIST_MODPROBE_CONF
done
@ -310,9 +311,9 @@ function select_soc() {
[[ "$SELECTION" -eq 0 ]] && SELECTION=""
[[ "$SELECTION" -eq 1 ]] && SELECTION="rk3318-box-cpu-hs"
[[ "$SELECTION" -eq 2 ]] && SELECTION="rk3318-box-cpu-hs"
echo $SELECTION
return 0
@ -345,7 +346,7 @@ function select_emmc_options() {
fi
echo $SELECTION
return 0
}
@ -354,7 +355,7 @@ function select_led_configuration() {
declare -a DIALOG_ENTRIES
for KEY in "${!DT_LED_OVERLAYS[@]}"; do
for KEY in "${DT_LED_OVERLAYS_ORDER[@]}"; do
DIALOG_ENTRIES+=($KEY "${DT_LED_OVERLAYS[$KEY]}")
done
@ -368,7 +369,7 @@ function select_led_configuration() {
if [[ "$RET" -eq 1 ]]; then
echo "Cancelled"
return 1
return 1
fi
if [[ "$RET" -ne 0 ]]; then
@ -376,10 +377,10 @@ function select_led_configuration() {
return 1
fi
[[ "$SELECTION" = "n/a" ]] && SELECTION=""
[[ "$SELECTION" = "default" ]] && SELECTION=""
echo $SELECTION
return 0
@ -411,10 +412,6 @@ FLASH_TYPE=$(get_internal_flash_type)
WIFI_PATH=$(get_sdio_device_path)
[[ -z "$WIFI_PATH" ]] && inform_wifi_alternate && DT_OVERLAYS_TO_APPLY+=($DT_WIFI_ALTERNATE_SDIO)
[[ "$WIFI_PATH" = "$SDIO2_WIFI_PATH" ]] && DT_OVERLAYS_TO_APPLY+=($DT_WIFI_ALTERNATE_SDIO)
WIFI_ID=$(get_wifi_chip_id $WIFI_PATH)
if [[ -z "$WIFI_ID" ]]; then
@ -475,7 +472,7 @@ if [[ $LEGACY_KERNEL -eq 1 ]] && [[ -n "$WIFI_ID" ]]; then
WIFI_MODULE="${WIFI_CHIPS[$WIFI_ID]}"
if [[ -n $WIFI_MODULE ]]; then
echo "$WIFI_MODULE" | grep " " > /dev/null 2>&1
if [[ $? -eq 0 ]]; then

View File

@ -22,15 +22,15 @@ index 9c07d64a1..8e9ff2ef1 100644
- rockchip-w1-gpio.dtbo
+ rockchip-w1-gpio.dtbo \
+ rockchip-rk3318-box-led-conf1.dtbo
scr-$(CONFIG_ARCH_ROCKCHIP) += \
rockchip-fixup.scr
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf1.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf1.dts
new file mode 100644
index 000000000..1f5e5b7f8
index 000000000000..4bfa2ff42f36
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf1.dts
@@ -0,0 +1,54 @@
@@ -0,0 +1,44 @@
+/dts-v1/;
+/plugin/;
+
@ -38,55 +38,43 @@ index 000000000..1f5e5b7f8
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+
+/ {
+&gpio_led {
+
+ fragment@0 {
+ target-path = "/gpio-leds";
+ __overlay__ {
+
+ working {
+ gpios = <&gpio2 RK_PC7 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "mmc2";
+ };
+
+ /*
+ * no auxiliary led on YX_RK3328 boards
+ *
+ auxiliary {
+ gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+ label = "auxiliary";
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_led_aux>;
+ };
+ */
+
+ };
+ working {
+ gpios = <&gpio2 RK_PC7 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "mmc2";
+ };
+
+ /*
+ * TODO: needs to find the GPIO for this
+ *
+ fragment@1 {
+ target = <&gpio_keys>;
+ __overlay__ {
+
+ reset {
+ gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_LOW>;
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ debounce-interval = <200>;
+ wakeup-source;
+ };
+
+ };
+ * no auxiliary led on YX_RK3328 boards
+ *
+ auxiliary {
+ gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+ label = "auxiliary";
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_led_aux>;
+ };
+ */
+
+};
--
2.25.1
+
+/*
+ * TODO: needs to find the GPIO for this
+ *
+&gpio_keys {
+
+ reset {
+ gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_LOW>;
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ debounce-interval = <200>;
+ wakeup-source;
+ };
+
+};
+*/
diff --git a/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays b/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
index d6979437a..1de0a95e8 100644
@ -95,8 +83,10 @@ index d6979437a..1de0a95e8 100644
@@ -119,3 +119,7 @@ Activates 1-Wire GPIO master
Requires an external pull-up resistor on the data pin
or enabling the internal pull-up
+### rk3318-box-led-conf1
+
+Activates led/gpio configuration for rk3318 tv box boards with signature
+YX_RK3328 and clones
--
2.25.1

View File

@ -29,18 +29,18 @@ index 1b547bea7..4172bd731 100644
@@ -124,6 +124,11 @@ or enabling the internal pull-up
Activates led/gpio configuration for rk3318 tv box boards with signature
YX_RK3328 and clones
+### rk3318-box-led-conf2
+
+Activates led/gpio configuration for rk3318 tv box boards withs signature
+X88_PRO_B and clones
+
### rk3318-box-emmc-ddr
Activates eMMC DDR capability for rk3318 tv box boards. Probably all the eMMC chips
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf2.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf2.dts
new file mode 100644
index 000000000..9a8146b9a
index 000000000000..b8ed044ee52a
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf2.dts
@@ -0,0 +1,59 @@
@ -51,55 +51,55 @@ index 000000000..9a8146b9a
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+
+/ {
+
+ fragment@0 {
+ target-path = "/gpio-leds";
+ __overlay__ {
+&gpio_led {
+
+ working {
+ gpios = <&gpio2 RK_PA6 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "mmc2";
+ };
+
+ /*
+ * no auxiliary led on X88_PRO_B boards
+ *
+ auxiliary {
+ gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+ label = "auxiliary";
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_led_aux>;
+ };
+ */
+
+ };
+ working {
+ gpios = <&gpio2 RK_PA6 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "mmc2";
+ };
+
+ fragment@1 {
+ target = <&vcc_otg_vbus>;
+ __overlay__ {
+
+ gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
+
+ };
+
+ };
+
+ fragment@2 {
+ target = <&working_led>;
+ __overlay__ {
+ rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none_2ma>;
+ };
+ };
+
+ fragment@3 {
+ target = <&io_domains>;
+ __overlay__ {
+ vccio6-supply = <&vcc_18>;
+ };
+ /*
+ * no auxiliary led on X88_PRO_B boards
+ *
+ auxiliary {
+ gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+ label = "auxiliary";
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_led_aux>;
+ };
+ */
+
+};
+
+&vcc_otg_vbus {
+ gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
+};
+
+&working_led {
+ rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none_2ma>;
+};
+
+&io_domains {
+ vccio6-supply = <&vcc_18>;
+};
+
+/*
+ * Following section enables the sdio bus on sdmmc_ext controller
+ */
+&sdio {
+ /delete-property/ mmc-pwrseq;
+ status = "disabled";
+};
+
+&sdio_ext {
+ mmc-pwrseq = <&sdio_pwrseq>;
+ status = "okay";
+};
+
+&sdmmc_ext {
+ status = "disabled";
+};
+

View File

@ -43,10 +43,10 @@ index 4172bd731..27f945d38 100644
Activates eMMC DDR capability for rk3318 tv box boards. Probably all the eMMC chips
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf3.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf3.dts
new file mode 100644
index 000000000..4641f7588
index 000000000000..6e05145a287d
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf3.dts
@@ -0,0 +1,279 @@
@@ -0,0 +1,300 @@
+/dts-v1/;
+/plugin/;
+
@ -232,14 +232,16 @@ index 000000000..4641f7588
+ pinctrl-0 = <&ir_led>;
+
+ working {
+ gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
+ default-state = "on";
+ linux,default-trigger = "default-on";
+ gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ mode = <35>;
+ };
+
+ /*
+ * These leds are described in the original dtb, but are not present on the board
+ auxiliary {
+ gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
+ gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ mode = <5>;
@ -251,6 +253,7 @@ index 000000000..4641f7588
+ default-state = "off";
+ mode = <0>;
+ };
+ */
+
+};
+
@ -326,6 +329,24 @@ index 000000000..4641f7588
+ status = "disabled";
+};
+
+/*
+ * Following section enables the sdio bus on sdmmc_ext controller
+ */
+&sdio {
+ /delete-property/ mmc-pwrseq;
+ status = "disabled";
+};
+
+&sdio_ext {
+ rockchip,default-sample-phase = <112>; // Allows ssv6051 chips to be detected at 50 MHz
+ sd-uhs-sdr50;
+ mmc-pwrseq = <&sdio_pwrseq>;
+ status = "okay";
+};
+
+&sdmmc_ext {
+ status = "disabled";
+};
--
2.30.2

View File

@ -0,0 +1,86 @@
From 9e2a9f208da921fa6e72e75d9c4b0d259f0002d9 Mon Sep 17 00:00:00 2001
From: Paolo Sabatino <paolo.sabatino@gmail.com>
Date: Sat, 8 Oct 2022 20:20:41 +0000
Subject: [PATCH] add rk3318-box-led-conf4 overlay
---
arch/arm64/boot/dts/rockchip/overlay/Makefile | 1 +
.../rockchip/overlay/README.rockchip-overlays | 4 ++
.../overlay/rockchip-rk3318-box-led-conf4.dts | 38 +++++++++++++++++++
3 files changed, 43 insertions(+)
create mode 100644 arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf4.dts
diff --git a/arch/arm64/boot/dts/rockchip/overlay/Makefile b/arch/arm64/boot/dts/rockchip/overlay/Makefile
index f11aa6d57449..340f88be014b 100644
--- a/arch/arm64/boot/dts/rockchip/overlay/Makefile
+++ b/arch/arm64/boot/dts/rockchip/overlay/Makefile
@@ -14,6 +14,7 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
rockchip-rk3318-box-led-conf1.dtbo \
rockchip-rk3318-box-led-conf2.dtbo \
rockchip-rk3318-box-led-conf3.dtbo \
+ rockchip-rk3318-box-led-conf4.dtbo \
rockchip-rk3318-box-emmc-ddr.dtbo \
rockchip-rk3318-box-wlan-ap6334.dtbo \
rockchip-rk3318-box-wlan-ext.dtbo \
diff --git a/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays b/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
index 27f945d38e24..b3121afd5a63 100644
--- a/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
+++ b/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
@@ -136,6 +136,10 @@ has an integrated PMIC (RK805). The dtbo is very important to achieve
1.3 Ghz speed for CPU and stable voltages for other parts of the
system. Also enables gpio leds and keys.
+### rk3318-box-led-conf4
+
+Generic rk3318-box configuration but with sdio chip on sdmmc-ext connector
+
### rk3318-box-emmc-ddr
Activates eMMC DDR capability for rk3318 tv box boards. Probably all the eMMC chips
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf4.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf4.dts
new file mode 100644
index 000000000000..5d60f51069d8
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf4.dts
@@ -0,0 +1,38 @@
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+
+/**
+ * Generic rk3318 board with sdio bus on sdmmc_ext connector
+ */
+
+&gpio_led {
+
+ working {
+ gpios = <&gpio2 RK_PC7 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "mmc2";
+ };
+
+};
+
+/*
+ * Following section enables the sdio bus on sdmmc_ext controller
+ */
+&sdio {
+ /delete-property/ mmc-pwrseq;
+ status = "disabled";
+};
+
+&sdio_ext {
+ rockchip,default-sample-phase = <112>;
+ sd-uhs-sdr50;
+ mmc-pwrseq = <&sdio_pwrseq>;
+ status = "okay";
+};
+
+&sdmmc_ext {
+ status = "disabled";
+};
--
2.34.1

File diff suppressed because it is too large Load Diff

View File

@ -22,15 +22,15 @@ index 9c07d64a1..8e9ff2ef1 100644
- rockchip-w1-gpio.dtbo
+ rockchip-w1-gpio.dtbo \
+ rockchip-rk3318-box-led-conf1.dtbo
scr-$(CONFIG_ARCH_ROCKCHIP) += \
rockchip-fixup.scr
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf1.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf1.dts
new file mode 100644
index 000000000..1f5e5b7f8
index 000000000000..26bfd7c634c0
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf1.dts
@@ -0,0 +1,54 @@
@@ -0,0 +1,49 @@
+/dts-v1/;
+/plugin/;
+
@ -38,55 +38,48 @@ index 000000000..1f5e5b7f8
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+
+/ {
+/**
+ * Generic rk3318 board with base common configuration.
+ * Some boards with this configuration have signature: YX_RK3318 (circular board), RK3318_V1.x
+ */
+
+ fragment@0 {
+ target-path = "/gpio-leds";
+ __overlay__ {
+&gpio_led {
+
+ working {
+ gpios = <&gpio2 RK_PC7 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "mmc2";
+ };
+
+ /*
+ * no auxiliary led on YX_RK3328 boards
+ *
+ auxiliary {
+ gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+ label = "auxiliary";
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_led_aux>;
+ };
+ */
+
+ };
+ working {
+ gpios = <&gpio2 RK_PC7 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "mmc2";
+ };
+
+ /*
+ * TODO: needs to find the GPIO for this
+ *
+ fragment@1 {
+ target = <&gpio_keys>;
+ __overlay__ {
+
+ reset {
+ gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_LOW>;
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ debounce-interval = <200>;
+ wakeup-source;
+ };
+
+ };
+ * no auxiliary led on YX_RK3328 boards
+ *
+ auxiliary {
+ gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+ label = "auxiliary";
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_led_aux>;
+ };
+ */
+
+};
--
2.25.1
+
+/*
+ * TODO: needs to find the GPIO for this
+ *
+&gpio_keys {
+
+ reset {
+ gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_LOW>;
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ debounce-interval = <200>;
+ wakeup-source;
+ };
+
+};
+*/
diff --git a/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays b/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
index d6979437a..1de0a95e8 100644
@ -95,8 +88,10 @@ index d6979437a..1de0a95e8 100644
@@ -119,3 +119,7 @@ Activates 1-Wire GPIO master
Requires an external pull-up resistor on the data pin
or enabling the internal pull-up
+### rk3318-box-led-conf1
+
+Activates led/gpio configuration for rk3318 tv box boards with signature
+YX_RK3328 and clones
--
2.25.1

View File

@ -29,18 +29,18 @@ index 1b547bea7..4172bd731 100644
@@ -124,6 +124,11 @@ or enabling the internal pull-up
Activates led/gpio configuration for rk3318 tv box boards with signature
YX_RK3328 and clones
+### rk3318-box-led-conf2
+
+Activates led/gpio configuration for rk3318 tv box boards withs signature
+X88_PRO_B and clones
+
### rk3318-box-emmc-ddr
Activates eMMC DDR capability for rk3318 tv box boards. Probably all the eMMC chips
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf2.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf2.dts
new file mode 100644
index 000000000..9a8146b9a
index 000000000000..b8ed044ee52a
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf2.dts
@@ -0,0 +1,59 @@
@ -51,55 +51,55 @@ index 000000000..9a8146b9a
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+
+/ {
+
+ fragment@0 {
+ target-path = "/gpio-leds";
+ __overlay__ {
+&gpio_led {
+
+ working {
+ gpios = <&gpio2 RK_PA6 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "mmc2";
+ };
+
+ /*
+ * no auxiliary led on X88_PRO_B boards
+ *
+ auxiliary {
+ gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+ label = "auxiliary";
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_led_aux>;
+ };
+ */
+
+ };
+ working {
+ gpios = <&gpio2 RK_PA6 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "mmc2";
+ };
+
+ fragment@1 {
+ target = <&vcc_otg_vbus>;
+ __overlay__ {
+
+ gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
+
+ };
+
+ };
+
+ fragment@2 {
+ target = <&working_led>;
+ __overlay__ {
+ rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none_2ma>;
+ };
+ };
+
+ fragment@3 {
+ target = <&io_domains>;
+ __overlay__ {
+ vccio6-supply = <&vcc_18>;
+ };
+ /*
+ * no auxiliary led on X88_PRO_B boards
+ *
+ auxiliary {
+ gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+ label = "auxiliary";
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_led_aux>;
+ };
+ */
+
+};
+
+&vcc_otg_vbus {
+ gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
+};
+
+&working_led {
+ rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none_2ma>;
+};
+
+&io_domains {
+ vccio6-supply = <&vcc_18>;
+};
+
+/*
+ * Following section enables the sdio bus on sdmmc_ext controller
+ */
+&sdio {
+ /delete-property/ mmc-pwrseq;
+ status = "disabled";
+};
+
+&sdio_ext {
+ mmc-pwrseq = <&sdio_pwrseq>;
+ status = "okay";
+};
+
+&sdmmc_ext {
+ status = "disabled";
+};
+

View File

@ -43,10 +43,10 @@ index 4172bd731..27f945d38 100644
Activates eMMC DDR capability for rk3318 tv box boards. Probably all the eMMC chips
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf3.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf3.dts
new file mode 100644
index 000000000..4641f7588
index 000000000000..6e05145a287d
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf3.dts
@@ -0,0 +1,279 @@
@@ -0,0 +1,300 @@
+/dts-v1/;
+/plugin/;
+
@ -232,14 +232,16 @@ index 000000000..4641f7588
+ pinctrl-0 = <&ir_led>;
+
+ working {
+ gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
+ default-state = "on";
+ linux,default-trigger = "default-on";
+ gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ mode = <35>;
+ };
+
+ /*
+ * These leds are described in the original dtb, but are not present on the board
+ auxiliary {
+ gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
+ gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "mmc2";
+ default-state = "off";
+ mode = <5>;
@ -251,6 +253,7 @@ index 000000000..4641f7588
+ default-state = "off";
+ mode = <0>;
+ };
+ */
+
+};
+
@ -326,6 +329,24 @@ index 000000000..4641f7588
+ status = "disabled";
+};
+
+/*
+ * Following section enables the sdio bus on sdmmc_ext controller
+ */
+&sdio {
+ /delete-property/ mmc-pwrseq;
+ status = "disabled";
+};
+
+&sdio_ext {
+ rockchip,default-sample-phase = <112>; // Allows ssv6051 chips to be detected at 50 MHz
+ sd-uhs-sdr50;
+ mmc-pwrseq = <&sdio_pwrseq>;
+ status = "okay";
+};
+
+&sdmmc_ext {
+ status = "disabled";
+};
--
2.30.2

View File

@ -0,0 +1,86 @@
From 9e2a9f208da921fa6e72e75d9c4b0d259f0002d9 Mon Sep 17 00:00:00 2001
From: Paolo Sabatino <paolo.sabatino@gmail.com>
Date: Sat, 8 Oct 2022 20:20:41 +0000
Subject: [PATCH] add rk3318-box-led-conf4 overlay
---
arch/arm64/boot/dts/rockchip/overlay/Makefile | 1 +
.../rockchip/overlay/README.rockchip-overlays | 4 ++
.../overlay/rockchip-rk3318-box-led-conf4.dts | 38 +++++++++++++++++++
3 files changed, 43 insertions(+)
create mode 100644 arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf4.dts
diff --git a/arch/arm64/boot/dts/rockchip/overlay/Makefile b/arch/arm64/boot/dts/rockchip/overlay/Makefile
index f11aa6d57449..340f88be014b 100644
--- a/arch/arm64/boot/dts/rockchip/overlay/Makefile
+++ b/arch/arm64/boot/dts/rockchip/overlay/Makefile
@@ -14,6 +14,7 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
rockchip-rk3318-box-led-conf1.dtbo \
rockchip-rk3318-box-led-conf2.dtbo \
rockchip-rk3318-box-led-conf3.dtbo \
+ rockchip-rk3318-box-led-conf4.dtbo \
rockchip-rk3318-box-emmc-ddr.dtbo \
rockchip-rk3318-box-wlan-ap6334.dtbo \
rockchip-rk3318-box-wlan-ext.dtbo \
diff --git a/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays b/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
index 27f945d38e24..b3121afd5a63 100644
--- a/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
+++ b/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
@@ -136,6 +136,10 @@ has an integrated PMIC (RK805). The dtbo is very important to achieve
1.3 Ghz speed for CPU and stable voltages for other parts of the
system. Also enables gpio leds and keys.
+### rk3318-box-led-conf4
+
+Generic rk3318-box configuration but with sdio chip on sdmmc-ext connector
+
### rk3318-box-emmc-ddr
Activates eMMC DDR capability for rk3318 tv box boards. Probably all the eMMC chips
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf4.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf4.dts
new file mode 100644
index 000000000000..5d60f51069d8
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf4.dts
@@ -0,0 +1,38 @@
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+
+/**
+ * Generic rk3318 board with sdio bus on sdmmc_ext connector
+ */
+
+&gpio_led {
+
+ working {
+ gpios = <&gpio2 RK_PC7 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "mmc2";
+ };
+
+};
+
+/*
+ * Following section enables the sdio bus on sdmmc_ext controller
+ */
+&sdio {
+ /delete-property/ mmc-pwrseq;
+ status = "disabled";
+};
+
+&sdio_ext {
+ rockchip,default-sample-phase = <112>;
+ sd-uhs-sdr50;
+ mmc-pwrseq = <&sdio_pwrseq>;
+ status = "okay";
+};
+
+&sdmmc_ext {
+ status = "disabled";
+};
--
2.34.1

File diff suppressed because it is too large Load Diff