From 27351820c739e37261bb209df9ec9bdb4d9751a7 Mon Sep 17 00:00:00 2001 From: Viacheslav Bocharov Date: Thu, 13 Jun 2024 10:17:52 +0300 Subject: [PATCH] JetHub D2: Fix patchset --- ...axg-add-support-for-JetHome-JetHub-D.patch | 81 ++++++++----------- ...jethub-j200-add-meson64-reset-driver.patch | 33 ++++++++ 2 files changed, 67 insertions(+), 47 deletions(-) create mode 100644 patch/kernel/archive/meson64-6.9/jethome-0005-jethub-j200-add-meson64-reset-driver.patch diff --git a/patch/kernel/archive/meson64-6.9/jethome-0004-arm64-dts-meson-axg-add-support-for-JetHome-JetHub-D.patch b/patch/kernel/archive/meson64-6.9/jethome-0004-arm64-dts-meson-axg-add-support-for-JetHome-JetHub-D.patch index c38f3e73a714..0d1c51cb30fd 100644 --- a/patch/kernel/archive/meson64-6.9/jethome-0004-arm64-dts-meson-axg-add-support-for-JetHome-JetHub-D.patch +++ b/patch/kernel/archive/meson64-6.9/jethome-0004-arm64-dts-meson-axg-add-support-for-JetHome-JetHub-D.patch @@ -1,10 +1,11 @@ -From 7ad1d0a9aa045348451287ab7538201233c64a5b Mon Sep 17 00:00:00 2001 +From 44819c568dc6156d8a15b48af4dec3f20d484408 Mon Sep 17 00:00:00 2001 From: Viacheslav Bocharov Date: Thu, 16 May 2024 15:14:08 +0300 Subject: [PATCH 2/2] arm64: dts: meson-axg: add support for JetHome JetHub D2 (j200) -JetHome Jethub D2 is a home automation controller with the following features: +JetHome Jethub D2 is a home automation controller with the following +features: - DIN Rail Mounting - Amlogic S905X3 (ARM Cortex-A55) quad-core - micro-HDMI video out @@ -23,8 +24,8 @@ JetHome Jethub D2 is a home automation controller with the following features: Signed-off-by: Viacheslav Bocharov --- arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../amlogic/meson-sm1-jethome-jethub-j200.dts | 632 ++++++++++++++++++ - 2 files changed, 633 insertions(+) + .../amlogic/meson-sm1-jethome-jethub-j200.dts | 618 ++++++++++++++++++ + 2 files changed, 619 insertions(+) create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-jethome-jethub-j200.dts diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile @@ -41,10 +42,10 @@ index 0f29517da5ec..d007b59497d4 100644 dtb-$(CONFIG_ARCH_MESON) += meson-sm1-s905d3-libretech-cc.dtb diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-jethome-jethub-j200.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-jethome-jethub-j200.dts new file mode 100644 -index 000000000000..fcffbd0e24cc +index 000000000000..c309f25374b3 --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-jethome-jethub-j200.dts -@@ -0,0 +1,632 @@ +@@ -0,0 +1,618 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2024 JetHome @@ -92,7 +93,7 @@ index 000000000000..fcffbd0e24cc + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + -+ gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>; // #TODO: check ++ gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>; + enable-active-high; + regulator-always-on; + }; @@ -109,7 +110,7 @@ index 000000000000..fcffbd0e24cc + enable-active-high; + regulator-always-on; + -+ gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_SOURCE>; // #TODO: check ++ gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_SOURCE>; + gpios-states = <0>; + + states = <3300000 0>, @@ -140,7 +141,7 @@ index 000000000000..fcffbd0e24cc + regulator-max-microvolt = <5000000>; + regulator-always-on; + vin-supply = <&main_12v>; -+ gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; // #TODO: check ++ gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; + enable-active-high; + }; + @@ -160,7 +161,6 @@ index 000000000000..fcffbd0e24cc + regulator-max-microvolt = <3300000>; + vin-supply = <&vddao_3v3>; + regulator-always-on; -+ /* FIXME: actually controlled by VDDCPU_B_EN */ + }; + + vddcpu: regulator-vddcpu { @@ -261,16 +261,6 @@ index 000000000000..fcffbd0e24cc + }; + }; + -+ meson64-reboot { -+ compatible = "meson64,reboot"; -+ sys_reset = <0x84000009>; -+ sys_poweroff = <0x84000008>; -+ -+ sd-vqen = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>; -+ sd-vqsw = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>; -+ sd-vmmc = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>; -+ }; -+ + leds { + compatible = "gpio-leds"; + @@ -278,7 +268,7 @@ index 000000000000..fcffbd0e24cc + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "activity"; ++ linux,default-trigger = "heartbeat"; + panic-indicator; + }; + @@ -295,8 +285,21 @@ index 000000000000..fcffbd0e24cc + model = "JETHUB-D2"; + }; + -+}; ++ usb-hub { ++ dr_mode = "host"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ /* USB 2.0 hub with reset gpio */ ++ hub_2_0: hub@1 { ++ compatible = "usb5e3,610"; ++ reg = <1>; ++ reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; ++ vdd-supply = <&vcc_5v>; ++ }; ++ }; + ++}; + +&arb { + status = "okay"; @@ -424,7 +427,7 @@ index 000000000000..fcffbd0e24cc + "MCU_RESET", /* GPIOAO_4 */ + "POWER_GOOD", /* GPIOAO_5 */ + "", -+ "MCU_BOOT", /* GPIOAO_7 */ ++ "GPIO_EXPANDER", /* GPIOAO_7 */ + "MCU_UART_TX", /* GPIOAO_8 */ + "MCU_UART_RX", /* GPIOAO_9 */ + "BUTTON_USR", /* GPIOAO_10 */ @@ -498,14 +501,8 @@ index 000000000000..fcffbd0e24cc + vqmmc-supply = <&flash_1v8>; +}; + -+/* -+&sd_emmc_c { -+ pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_4b_pins>, <&emmc_ds_pins>; -+ bus-width = <4>; -+}; -+ +&spifc { -+ status = "okay"; ++ status = "disabled"; + pinctrl-0 = <&nor_pins>; + pinctrl-names = "default"; + @@ -517,7 +514,6 @@ index 000000000000..fcffbd0e24cc + spi-max-frequency = <104000000>; + }; +}; -+*/ + +&tdmif_b { + status = "okay"; @@ -555,19 +551,6 @@ index 000000000000..fcffbd0e24cc + vbus-supply = <&usb_pwr_en>; +}; + -+&dwc2 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ /* USB 2.0 hub on otg port */ -+ hub_2_0: hub@1 { -+ compatible = "usb4b4,6504"; /* use 10000us timeout for reset */ -+ reg = <1>; -+ reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; -+ vdd-supply = <&vcc_5v>; -+ }; -+}; -+ +&usb2_phy0 { + phy-supply = <&vcc_5v>; +}; @@ -585,6 +568,10 @@ index 000000000000..fcffbd0e24cc + reg = <0x22>; + gpio-controller; + #gpio-cells = <2>; ++ interrupt-controller; ++ #interrupt-cells = <2>; ++ interrupt-parent = <&gpio_intc>; ++ interrupts = ; + + gpio-line-names = + "RELAY_1", "RELAY_2", @@ -597,9 +584,9 @@ index 000000000000..fcffbd0e24cc + + /* 1-wire */ + w1: onewire@18 { -+ compatible = "maxim,ds2482"; -+ reg = <0x18>; -+ }; ++ compatible = "maxim,ds2482"; ++ reg = <0x18>; ++ }; + +}; + diff --git a/patch/kernel/archive/meson64-6.9/jethome-0005-jethub-j200-add-meson64-reset-driver.patch b/patch/kernel/archive/meson64-6.9/jethome-0005-jethub-j200-add-meson64-reset-driver.patch new file mode 100644 index 000000000000..2543377a400d --- /dev/null +++ b/patch/kernel/archive/meson64-6.9/jethome-0005-jethub-j200-add-meson64-reset-driver.patch @@ -0,0 +1,33 @@ +From d2a9ccf69cfc856f873372784a46b5088dd2aada Mon Sep 17 00:00:00 2001 +From: Viacheslav Bocharov +Date: Thu, 13 Jun 2024 10:17:07 +0300 +Subject: [PATCH 3/3] add meson64-reset driver + +--- + .../boot/dts/amlogic/meson-sm1-jethome-jethub-j200.dts | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-jethome-jethub-j200.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-jethome-jethub-j200.dts +index c309f25374b3..4c84ed0db1cc 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-sm1-jethome-jethub-j200.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-sm1-jethome-jethub-j200.dts +@@ -213,6 +213,16 @@ codec { + }; + }; + ++ meson64-reboot { ++ compatible = "meson64,reboot"; ++ sys_reset = <0x84000009>; ++ sys_poweroff = <0x84000008>; ++ ++ sd-vqen = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>; ++ sd-vqsw = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>; ++ sd-vmmc = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>; ++ }; ++ + leds { + compatible = "gpio-leds"; + +-- +2.45.2 +