From ecd317d8f4670f249e37ca6141d64701c646350e Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Wed, 10 Feb 2021 12:20:21 +0800 Subject: [PATCH 01/34] sunxi: backport h5 cpufreq support from upstream linux --- ...-arm64-dts-allwinner-h5-Add-PMU-node.patch | 66 ++++++++++ ...v-Add-allwinner-sun50i-h5-compatible.patch | 21 ---- ...-allwinner-h5-Add-clock-to-CPU-cores.patch | 56 +++++++++ ...4-dts-allwinner-h5-Add-CPU-OPP-table.patch | 113 ++++++++++++++++++ ...nxi-h5-add-support-for-nanopi-r1s-h5.patch | 3 +- ...ARM-dts-sun8i-h3-Add-clock-frequency.patch | 48 -------- ...64-dts-sun50i-h5-Add-clock-frequency.patch | 30 ----- ...-h5-Move-CPU-OPP-table-to-dtsi-share.patch | 82 ------------- ...nxi-h3-h5-Add-more-CPU-OPP-for-H3-H5.patch | 54 --------- ...un50i-h5-Enable-cpufreq-dt-on-H5-CPU.patch | 50 -------- 10 files changed, 237 insertions(+), 286 deletions(-) create mode 100644 target/linux/sunxi/patches-4.19/023-arm64-dts-allwinner-h5-Add-PMU-node.patch delete mode 100644 target/linux/sunxi/patches-4.19/023-cpufreq-dt-platdev-Add-allwinner-sun50i-h5-compatible.patch create mode 100644 target/linux/sunxi/patches-4.19/024-arm64-dts-allwinner-h5-Add-clock-to-CPU-cores.patch create mode 100644 target/linux/sunxi/patches-4.19/025-arm64-dts-allwinner-h5-Add-CPU-OPP-table.patch delete mode 100644 target/linux/sunxi/patches-4.19/321-ARM-dts-sun8i-h3-Add-clock-frequency.patch delete mode 100644 target/linux/sunxi/patches-4.19/322-arm64-dts-sun50i-h5-Add-clock-frequency.patch delete mode 100644 target/linux/sunxi/patches-4.19/323-arm-dts-sunxi-h3-h5-Move-CPU-OPP-table-to-dtsi-share.patch delete mode 100644 target/linux/sunxi/patches-4.19/324-arm-dts-sunxi-h3-h5-Add-more-CPU-OPP-for-H3-H5.patch delete mode 100644 target/linux/sunxi/patches-4.19/325-arm64-dts-sun50i-h5-Enable-cpufreq-dt-on-H5-CPU.patch diff --git a/target/linux/sunxi/patches-4.19/023-arm64-dts-allwinner-h5-Add-PMU-node.patch b/target/linux/sunxi/patches-4.19/023-arm64-dts-allwinner-h5-Add-PMU-node.patch new file mode 100644 index 0000000000..8edeae2af5 --- /dev/null +++ b/target/linux/sunxi/patches-4.19/023-arm64-dts-allwinner-h5-Add-PMU-node.patch @@ -0,0 +1,66 @@ +From c35a516a46187c8eeb7a56c64505ec6f7e22a0c7 Mon Sep 17 00:00:00 2001 +From: Andre Przywara +Date: Thu, 21 Nov 2019 01:18:34 +0000 +Subject: [PATCH] arm64: dts: allwinner: H5: Add PMU node + +Add the Performance Monitoring Unit (PMU) device tree node to the H5 +.dtsi, which tells DT users which interrupts are triggered by PMU +overflow events on each core. +As with the A64, the interrupt numbers from the manual were wrong (off +by 4), the actual SPI IDs have been gathered in U-Boot, and were +verified with perf in Linux. + +Tested with perf record and taskset on an OrangePi PC2. + +Signed-off-by: Andre Przywara +Signed-off-by: Maxime Ripard +--- + arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi +index e92c4de5bf3b4..7c775a918a4e7 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi +@@ -54,21 +54,21 @@ + enable-method = "psci"; + }; + +- cpu@1 { ++ cpu1: cpu@1 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <1>; + enable-method = "psci"; + }; + +- cpu@2 { ++ cpu2: cpu@2 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <2>; + enable-method = "psci"; + }; + +- cpu@3 { ++ cpu3: cpu@3 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <3>; +@@ -76,6 +76,16 @@ + }; + }; + ++ pmu { ++ compatible = "arm,cortex-a53-pmu", ++ "arm,armv8-pmuv3"; ++ interrupts = , ++ , ++ , ++ ; ++ interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; ++ }; ++ + psci { + compatible = "arm,psci-0.2"; + method = "smc"; diff --git a/target/linux/sunxi/patches-4.19/023-cpufreq-dt-platdev-Add-allwinner-sun50i-h5-compatible.patch b/target/linux/sunxi/patches-4.19/023-cpufreq-dt-platdev-Add-allwinner-sun50i-h5-compatible.patch deleted file mode 100644 index 7db08fc011..0000000000 --- a/target/linux/sunxi/patches-4.19/023-cpufreq-dt-platdev-Add-allwinner-sun50i-h5-compatible.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 1d78fb6bf60b011bd60ebc9d6ef9499f91c29267 Mon Sep 17 00:00:00 2001 -From: Ondrej Jirman -Date: Thu, 30 Mar 2017 12:58:43 +0200 -Subject: [PATCH 08/82] cpufreq: dt-platdev: Add allwinner,sun50i-h5 compatible - ---- - drivers/cpufreq/cpufreq-dt-platdev.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c -index fe14c57de6ca..afb511aa5050 100644 ---- a/drivers/cpufreq/cpufreq-dt-platdev.c -+++ b/drivers/cpufreq/cpufreq-dt-platdev.c -@@ -29,6 +29,7 @@ static const struct of_device_id whitelist[] __initconst = { - { .compatible = "allwinner,sun8i-a23", }, - { .compatible = "allwinner,sun8i-a83t", }, - { .compatible = "allwinner,sun8i-h3", }, -+ { .compatible = "allwinner,sun50i-h5", }, - - { .compatible = "apm,xgene-shadowcat", }, - diff --git a/target/linux/sunxi/patches-4.19/024-arm64-dts-allwinner-h5-Add-clock-to-CPU-cores.patch b/target/linux/sunxi/patches-4.19/024-arm64-dts-allwinner-h5-Add-clock-to-CPU-cores.patch new file mode 100644 index 0000000000..4a16442673 --- /dev/null +++ b/target/linux/sunxi/patches-4.19/024-arm64-dts-allwinner-h5-Add-clock-to-CPU-cores.patch @@ -0,0 +1,56 @@ +From 5fa21c1354c93cb9fe8239545b17eee46e39dd69 Mon Sep 17 00:00:00 2001 +From: Chen-Yu Tsai +Date: Sat, 18 Jul 2020 00:00:49 +0800 +Subject: [PATCH] arm64: dts: allwinner: h5: Add clock to CPU cores + +The ARM CPU cores are fed by the CPU clock from the CCU. Add a +reference to the clock for each CPU core, along with the clock +transition latency. + +Signed-off-by: Chen-Yu Tsai +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20200717160053.31191-5-wens@kernel.org +--- + arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi +index 4462a68c06815..09523f6011c5e 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi +@@ -52,6 +52,8 @@ + device_type = "cpu"; + reg = <0>; + enable-method = "psci"; ++ clocks = <&ccu CLK_CPUX>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + cpu1: cpu@1 { +@@ -59,6 +61,8 @@ + device_type = "cpu"; + reg = <1>; + enable-method = "psci"; ++ clocks = <&ccu CLK_CPUX>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + cpu2: cpu@2 { +@@ -66,6 +70,8 @@ + device_type = "cpu"; + reg = <2>; + enable-method = "psci"; ++ clocks = <&ccu CLK_CPUX>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + cpu3: cpu@3 { +@@ -73,6 +79,8 @@ + device_type = "cpu"; + reg = <3>; + enable-method = "psci"; ++ clocks = <&ccu CLK_CPUX>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ + }; + }; + diff --git a/target/linux/sunxi/patches-4.19/025-arm64-dts-allwinner-h5-Add-CPU-OPP-table.patch b/target/linux/sunxi/patches-4.19/025-arm64-dts-allwinner-h5-Add-CPU-OPP-table.patch new file mode 100644 index 0000000000..25292f438d --- /dev/null +++ b/target/linux/sunxi/patches-4.19/025-arm64-dts-allwinner-h5-Add-CPU-OPP-table.patch @@ -0,0 +1,113 @@ +From 7240598ba4e6c477c6809dc019505cf366fdb7c0 Mon Sep 17 00:00:00 2001 +From: Chen-Yu Tsai +Date: Sat, 18 Jul 2020 00:00:51 +0800 +Subject: [PATCH] arm64: dts: allwinner: h5: Add CPU Operating Performance + Points table + +Add an OPP (Operating Performance Points) table for the CPU cores for +boards to include to DVFS (Dynamic Voltage & Frequency Scaling) on the +H5. The table originates from Armbian, but the maximum voltage is raised +slightly to account for boards using slightly higher voltages. + +The table and tie in to the CPU cores are put in a separate dtsi file +that board files can include to opt in. Or they can define their own +tables if the standard one does not fit. + +This has been tested on the Libre Computer ALL-H3-CC-H5 and the Bananapi +M2+ v1.2 H5, both with adequate cooling. The former has a fixed 1.2V +regulator, while the latter has a GPIO controlled regulator switchable +between 1.1V and 1.3V. + +Signed-off-by: Chen-Yu Tsai +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20200717160053.31191-7-wens@kernel.org +--- + .../boot/dts/allwinner/sun50i-h5-cpu-opp.dtsi | 79 +++++++++++++++++++ + 1 file changed, 79 insertions(+) + create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h5-cpu-opp.dtsi + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-cpu-opp.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5-cpu-opp.dtsi +new file mode 100644 +index 0000000000000..b2657201957eb +--- /dev/null ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-cpu-opp.dtsi +@@ -0,0 +1,79 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++// Copyright (C) 2020 Chen-Yu Tsai ++ ++/ { ++ cpu_opp_table: cpu-opp-table { ++ compatible = "operating-points-v2"; ++ opp-shared; ++ ++ opp-408000000 { ++ opp-hz = /bits/ 64 <408000000>; ++ opp-microvolt = <1000000 1000000 1310000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ }; ++ ++ opp-648000000 { ++ opp-hz = /bits/ 64 <648000000>; ++ opp-microvolt = <1040000 1040000 1310000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ }; ++ ++ opp-816000000 { ++ opp-hz = /bits/ 64 <816000000>; ++ opp-microvolt = <1080000 1080000 1310000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ }; ++ ++ opp-912000000 { ++ opp-hz = /bits/ 64 <912000000>; ++ opp-microvolt = <1120000 1120000 1310000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ }; ++ ++ opp-960000000 { ++ opp-hz = /bits/ 64 <960000000>; ++ opp-microvolt = <1160000 1160000 1310000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ }; ++ ++ opp-1008000000 { ++ opp-hz = /bits/ 64 <1008000000>; ++ opp-microvolt = <1200000 1200000 1310000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ }; ++ ++ opp-1056000000 { ++ opp-hz = /bits/ 64 <1056000000>; ++ opp-microvolt = <1240000 1240000 1310000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ }; ++ ++ opp-1104000000 { ++ opp-hz = /bits/ 64 <1104000000>; ++ opp-microvolt = <1260000 1260000 1310000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ }; ++ ++ opp-1152000000 { ++ opp-hz = /bits/ 64 <1152000000>; ++ opp-microvolt = <1300000 1300000 1310000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ }; ++ }; ++}; ++ ++&cpu0 { ++ operating-points-v2 = <&cpu_opp_table>; ++}; ++ ++&cpu1 { ++ operating-points-v2 = <&cpu_opp_table>; ++}; ++ ++&cpu2 { ++ operating-points-v2 = <&cpu_opp_table>; ++}; ++ ++&cpu3 { ++ operating-points-v2 = <&cpu_opp_table>; ++}; diff --git a/target/linux/sunxi/patches-4.19/103-sunxi-h5-add-support-for-nanopi-r1s-h5.patch b/target/linux/sunxi/patches-4.19/103-sunxi-h5-add-support-for-nanopi-r1s-h5.patch index c89c040605..a0e1774865 100644 --- a/target/linux/sunxi/patches-4.19/103-sunxi-h5-add-support-for-nanopi-r1s-h5.patch +++ b/target/linux/sunxi/patches-4.19/103-sunxi-h5-add-support-for-nanopi-r1s-h5.patch @@ -10,7 +10,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts -@@ -0,0 +1,216 @@ +@@ -0,0 +1,217 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (C) 2021 AmadeusGhost @@ -21,6 +21,7 @@ + +/dts-v1/; +#include "sun50i-h5.dtsi" ++#include "sun50i-h5-cpu-opp.dtsi" + +#include +#include diff --git a/target/linux/sunxi/patches-4.19/321-ARM-dts-sun8i-h3-Add-clock-frequency.patch b/target/linux/sunxi/patches-4.19/321-ARM-dts-sun8i-h3-Add-clock-frequency.patch deleted file mode 100644 index 66727a193b..0000000000 --- a/target/linux/sunxi/patches-4.19/321-ARM-dts-sun8i-h3-Add-clock-frequency.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0d1194aaf2b2ebc571cf01d2353d252c12146d2e Mon Sep 17 00:00:00 2001 -From: Ondrej Jirman -Date: Mon, 27 Jun 2016 16:08:26 +0200 -Subject: [PATCH 10/82] ARM: dts: sun8i-h3: Add clock-frequency - -To avoid error messages during boot. - -Signed-off-by: Ondrej Jirman ---- - arch/arm/boot/dts/sun8i-h3.dtsi | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi -index f0096074a467..cb19ff797606 100644 ---- a/arch/arm/boot/dts/sun8i-h3.dtsi -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -78,6 +78,7 @@ - clock-names = "cpu"; - operating-points-v2 = <&cpu0_opp_table>; - #cooling-cells = <2>; -+ clock-frequency = <1200000000>; - }; - - cpu1: cpu@1 { -@@ -88,6 +89,7 @@ - clock-names = "cpu"; - operating-points-v2 = <&cpu0_opp_table>; - #cooling-cells = <2>; -+ clock-frequency = <1200000000>; - }; - - cpu2: cpu@2 { -@@ -98,6 +100,7 @@ - clock-names = "cpu"; - operating-points-v2 = <&cpu0_opp_table>; - #cooling-cells = <2>; -+ clock-frequency = <1200000000>; - }; - - cpu3: cpu@3 { -@@ -108,6 +111,7 @@ - clock-names = "cpu"; - operating-points-v2 = <&cpu0_opp_table>; - #cooling-cells = <2>; -+ clock-frequency = <1200000000>; - }; - }; - diff --git a/target/linux/sunxi/patches-4.19/322-arm64-dts-sun50i-h5-Add-clock-frequency.patch b/target/linux/sunxi/patches-4.19/322-arm64-dts-sun50i-h5-Add-clock-frequency.patch deleted file mode 100644 index d764400af5..0000000000 --- a/target/linux/sunxi/patches-4.19/322-arm64-dts-sun50i-h5-Add-clock-frequency.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 6328da39df61f962190870089aaa171a7f8aab2c Mon Sep 17 00:00:00 2001 -From: Ondrej Jirman -Date: Thu, 30 Mar 2017 13:04:25 +0200 -Subject: [PATCH 11/82] arm64: dts: sun50i-h5: Add clock-frequency - -To avoid error messages during boot. - -Signed-off-by: Ondrej Jirman ---- - arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -index 62d646baac3c..4452ab873dec 100644 ---- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -@@ -76,6 +76,13 @@ - }; - }; - -+ reg_cpu_fallback: reg_cpu_fallback { -+ compatible = "regulator-fixed"; -+ regulator-name = "vdd-cpux-dummy"; -+ regulator-min-microvolt = <1100000>; -+ regulator-max-microvolt = <1100000>; -+ }; -+ - psci { - compatible = "arm,psci-0.2"; - method = "smc"; diff --git a/target/linux/sunxi/patches-4.19/323-arm-dts-sunxi-h3-h5-Move-CPU-OPP-table-to-dtsi-share.patch b/target/linux/sunxi/patches-4.19/323-arm-dts-sunxi-h3-h5-Move-CPU-OPP-table-to-dtsi-share.patch deleted file mode 100644 index a00018da29..0000000000 --- a/target/linux/sunxi/patches-4.19/323-arm-dts-sunxi-h3-h5-Move-CPU-OPP-table-to-dtsi-share.patch +++ /dev/null @@ -1,82 +0,0 @@ -From d4028daf51824eb792fb3c9cc77553ff1edc5d68 Mon Sep 17 00:00:00 2001 -From: Ondrej Jirman -Date: Mon, 14 May 2018 00:56:50 +0200 -Subject: [PATCH 12/82] ARM: dts: sunxi-h3-h5: Move CPU OPP table to dtsi - shared by H3/H5 - -It is identical for H3 and H5, so it better live there. - -Signed-off-by: Ondrej Jirman ---- - arch/arm/boot/dts/sun8i-h3.dtsi | 23 ----------------------- - arch/arm/boot/dts/sunxi-h3-h5.dtsi | 23 +++++++++++++++++++++++ - 2 files changed, 23 insertions(+), 23 deletions(-) - -diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi -index cb19ff797606..261ca0356358 100644 ---- a/arch/arm/boot/dts/sun8i-h3.dtsi -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -43,29 +43,6 @@ - #include "sunxi-h3-h5.dtsi" - - / { -- cpu0_opp_table: opp_table0 { -- compatible = "operating-points-v2"; -- opp-shared; -- -- opp-648000000 { -- opp-hz = /bits/ 64 <648000000>; -- opp-microvolt = <1040000 1040000 1300000>; -- clock-latency-ns = <244144>; /* 8 32k periods */ -- }; -- -- opp-816000000 { -- opp-hz = /bits/ 64 <816000000>; -- opp-microvolt = <1100000 1100000 1300000>; -- clock-latency-ns = <244144>; /* 8 32k periods */ -- }; -- -- opp-1008000000 { -- opp-hz = /bits/ 64 <1008000000>; -- opp-microvolt = <1200000 1200000 1300000>; -- clock-latency-ns = <244144>; /* 8 32k periods */ -- }; -- }; -- - cpus { - #address-cells = <1>; - #size-cells = <0>; -diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -index 13fe5e316136..539b69fecbe9 100644 ---- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi -+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -@@ -105,6 +105,29 @@ - }; - }; - -+ cpu0_opp_table: opp_table0 { -+ compatible = "operating-points-v2"; -+ opp-shared; -+ -+ opp@648000000 { -+ opp-hz = /bits/ 64 <648000000>; -+ opp-microvolt = <1040000 1040000 1300000>; -+ clock-latency-ns = <244144>; /* 8 32k periods */ -+ }; -+ -+ opp@816000000 { -+ opp-hz = /bits/ 64 <816000000>; -+ opp-microvolt = <1100000 1100000 1300000>; -+ clock-latency-ns = <244144>; /* 8 32k periods */ -+ }; -+ -+ opp@1008000000 { -+ opp-hz = /bits/ 64 <1008000000>; -+ opp-microvolt = <1200000 1200000 1300000>; -+ clock-latency-ns = <244144>; /* 8 32k periods */ -+ }; -+ }; -+ - de: display-engine { - compatible = "allwinner,sun8i-h3-display-engine"; - allwinner,pipelines = <&mixer0>; diff --git a/target/linux/sunxi/patches-4.19/324-arm-dts-sunxi-h3-h5-Add-more-CPU-OPP-for-H3-H5.patch b/target/linux/sunxi/patches-4.19/324-arm-dts-sunxi-h3-h5-Add-more-CPU-OPP-for-H3-H5.patch deleted file mode 100644 index 4b37c934e0..0000000000 --- a/target/linux/sunxi/patches-4.19/324-arm-dts-sunxi-h3-h5-Add-more-CPU-OPP-for-H3-H5.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 9e05f3d014b05df39a55dfd6a08d4bd18a301307 Mon Sep 17 00:00:00 2001 -From: Ondrej Jirman -Date: Mon, 14 May 2018 01:13:01 +0200 -Subject: [PATCH 13/82] ARM: dts: sunxi-h3-h5: Add more CPU OPP for H3/H5 - -These OPPs can be used with better cooling and/or thermal regulation. - -Signed-off-by: Ondrej Jirman ---- - arch/arm/boot/dts/sunxi-h3-h5.dtsi | 78 ++++++++++++++++++++++++++++++ - 1 file changed, 78 insertions(+) - -diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -index 539b69fecbe9..f47c22b622f9 100644 ---- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi -+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -@@ -109,6 +109,24 @@ - compatible = "operating-points-v2"; - opp-shared; - -+ opp@120000000 { -+ opp-hz = /bits/ 64 <120000000>; -+ opp-microvolt = <1040000 1040000 1300000>; -+ clock-latency-ns = <244144>; /* 8 32k periods */ -+ }; -+ -+ opp@240000000 { -+ opp-hz = /bits/ 64 <240000000>; -+ opp-microvolt = <1040000 1040000 1300000>; -+ clock-latency-ns = <244144>; /* 8 32k periods */ -+ }; -+ -+ opp@480000000 { -+ opp-hz = /bits/ 64 <480000000>; -+ opp-microvolt = <1040000 1040000 1300000>; -+ clock-latency-ns = <244144>; /* 8 32k periods */ -+ }; -+ - opp@648000000 { - opp-hz = /bits/ 64 <648000000>; - opp-microvolt = <1040000 1040000 1300000>; -@@ -121,6 +139,12 @@ - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - -+ opp@960000000 { -+ opp-hz = /bits/ 64 <960000000>; -+ opp-microvolt = <1200000 1200000 1300000>; -+ clock-latency-ns = <244144>; /* 8 32k periods */ -+ }; -+ - opp@1008000000 { - opp-hz = /bits/ 64 <1008000000>; - opp-microvolt = <1200000 1200000 1300000>; diff --git a/target/linux/sunxi/patches-4.19/325-arm64-dts-sun50i-h5-Enable-cpufreq-dt-on-H5-CPU.patch b/target/linux/sunxi/patches-4.19/325-arm64-dts-sun50i-h5-Enable-cpufreq-dt-on-H5-CPU.patch deleted file mode 100644 index d494753f6c..0000000000 --- a/target/linux/sunxi/patches-4.19/325-arm64-dts-sun50i-h5-Enable-cpufreq-dt-on-H5-CPU.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 25be6ff78bebfd869a3be0017715f101bd75bb64 Mon Sep 17 00:00:00 2001 -From: Ondrej Jirman -Date: Mon, 14 May 2018 01:19:06 +0200 -Subject: [PATCH 15/82] arm64: dts: sun50i-h5: Enable cpufreq-dt on H5 CPU - -Uses OPPs shared with H3. - -Signed-off-by: Ondrej Jirman ---- - arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -index 60fc84a1fb44..acd90f390e88 100644 ---- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -@@ -52,6 +52,9 @@ - device_type = "cpu"; - reg = <0>; - enable-method = "psci"; -+ clocks = <&ccu CLK_CPUX>; -+ clock-names = "cpu"; -+ operating-points-v2 = <&cpu0_opp_table>; - }; - - cpu@1 { -@@ -59,6 +62,7 @@ - device_type = "cpu"; - reg = <1>; - enable-method = "psci"; -+ operating-points-v2 = <&cpu0_opp_table>; - }; - - cpu@2 { -@@ -66,6 +70,7 @@ - device_type = "cpu"; - reg = <2>; - enable-method = "psci"; -+ operating-points-v2 = <&cpu0_opp_table>; - }; - - cpu@3 { -@@ -73,6 +78,7 @@ - device_type = "cpu"; - reg = <3>; - enable-method = "psci"; -+ operating-points-v2 = <&cpu0_opp_table>; - }; - }; - From 7ed8a3dc50bdbfda584c60a35caa5e7ac0c13152 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Wed, 10 Feb 2021 19:36:33 +0800 Subject: [PATCH 02/34] kernel: bump to 4.9.257, 4.14.221, 4.19.175 Resolve conflicted: - layerscape/patches-4.14/302-dts-support-layerscape.patch Refreshed all patches. Signed-off-by: CN_SZTL --- include/kernel-version.mk | 12 ++++----- ...ption-fix-dwm-158-3g-modem-interface.patch | 2 +- .../hack-4.14/207-disable-modorder.patch | 4 +-- .../661-use_fq_codel_by_default.patch | 2 +- .../generic/hack-4.14/930-crashlog.patch | 2 +- .../998-usb-serial-option-add-u9300.patch | 4 +-- .../hack-4.19/207-disable-modorder.patch | 4 +-- .../generic/hack-4.19/930-crashlog.patch | 6 ++--- .../998-usb-serial-option-add-u9300.patch | 4 +-- .../hack-4.9/207-disable-modorder.patch | 4 +-- .../661-use_fq_codel_by_default.patch | 2 +- .../linux/generic/hack-4.9/930-crashlog.patch | 2 +- .../202-core-linux-support-layerscape.patch | 26 +++++++++---------- .../302-dts-support-layerscape.patch | 9 ------- .../807-usb-support-layerscape.patch | 4 +-- ...nxi-h5-add-support-for-nanopi-r1s-h5.patch | 2 +- 16 files changed, 40 insertions(+), 49 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 99c7adc79c..271d68ca12 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,13 +6,13 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-4.9 = .255 -LINUX_VERSION-4.14 = .219 -LINUX_VERSION-4.19 = .173 +LINUX_VERSION-4.9 = .257 +LINUX_VERSION-4.14 = .221 +LINUX_VERSION-4.19 = .175 -LINUX_KERNEL_HASH-4.9.255 = afdf2d03c920f6b12f4e207ab18e45fbe2d7f4a61c066eff0d9916fc5d00c118 -LINUX_KERNEL_HASH-4.14.219 = 75eecaa731c091fcf3bc2ec914b01d299a447d78041cb66a11a2ab169eb801dd -LINUX_KERNEL_HASH-4.19.173 = d2fdd236e6f31aa8e939f4a686c95417d8571bde3d091fc6a2535937c144195f +LINUX_KERNEL_HASH-4.9.257 = 95e780fffc81de8217a31a3e6e212b69643f5344e9ba0dabaa6e426126f6d64f +LINUX_KERNEL_HASH-4.14.221 = ce2254075ff4846f13380c1cf4bec1e351e5996a7dd109c200e222e49fd2c7e9 +LINUX_KERNEL_HASH-4.19.175 = ccee4b84ff2b16ad438e013bd211efea12f14e69f7cadb0e095fc89c781b2b25 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch index a66f628e3c..b29884433b 100644 --- a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch +++ b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch @@ -30,7 +30,7 @@ Signed-off-by: Johan Hovold --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -2017,7 +2017,8 @@ static const struct usb_device_id option +@@ -2023,7 +2023,8 @@ static const struct usb_device_id option { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d01, 0xff) }, /* D-Link DWM-156 (variant) */ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d02, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d03, 0xff) }, diff --git a/target/linux/generic/hack-4.14/207-disable-modorder.patch b/target/linux/generic/hack-4.14/207-disable-modorder.patch index 0cfb4d33ec..2b06be7b1d 100644 --- a/target/linux/generic/hack-4.14/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.14/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1260,7 +1260,6 @@ endif +@@ -1254,7 +1254,6 @@ endif PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1289,7 +1288,6 @@ _modinst_: +@@ -1283,7 +1282,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch index 352572c7b1..5c43dae661 100644 --- a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -2031,7 +2031,7 @@ static int __init pktsched_init(void) +@@ -2032,7 +2032,7 @@ static int __init pktsched_init(void) return err; } diff --git a/target/linux/generic/hack-4.14/930-crashlog.patch b/target/linux/generic/hack-4.14/930-crashlog.patch index 2da51fb406..3100d1fc08 100644 --- a/target/linux/generic/hack-4.14/930-crashlog.patch +++ b/target/linux/generic/hack-4.14/930-crashlog.patch @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau depends on BROKEN || !FRV --- a/kernel/Makefile +++ b/kernel/Makefile -@@ -110,6 +110,7 @@ obj-$(CONFIG_CONTEXT_TRACKING) += contex +@@ -109,6 +109,7 @@ obj-$(CONFIG_CONTEXT_TRACKING) += contex obj-$(CONFIG_TORTURE_TEST) += torture.o obj-$(CONFIG_HAS_IOMEM) += memremap.o diff --git a/target/linux/generic/hack-4.14/998-usb-serial-option-add-u9300.patch b/target/linux/generic/hack-4.14/998-usb-serial-option-add-u9300.patch index ca64218ad9..8fb75f21d5 100644 --- a/target/linux/generic/hack-4.14/998-usb-serial-option-add-u9300.patch +++ b/target/linux/generic/hack-4.14/998-usb-serial-option-add-u9300.patch @@ -18,7 +18,7 @@ /* 4G Systems products */ /* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick * -@@ -581,6 +582,16 @@ static void option_instat_callback(struc +@@ -583,6 +584,16 @@ static void option_instat_callback(struc /* Device needs ZLP */ #define ZLP BIT(17) @@ -35,7 +35,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, -@@ -615,6 +626,8 @@ static const struct usb_device_id option +@@ -617,6 +628,8 @@ static const struct usb_device_id option { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) }, { USB_DEVICE(QUANTA_VENDOR_ID, 0xea42), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/hack-4.19/207-disable-modorder.patch b/target/linux/generic/hack-4.19/207-disable-modorder.patch index 82c953369c..6b18407f41 100644 --- a/target/linux/generic/hack-4.19/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.19/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1263,7 +1263,6 @@ endif +@@ -1257,7 +1257,6 @@ endif PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1292,7 +1291,6 @@ _modinst_: +@@ -1286,7 +1285,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.19/930-crashlog.patch b/target/linux/generic/hack-4.19/930-crashlog.patch index 56367e2565..459fc072f6 100644 --- a/target/linux/generic/hack-4.19/930-crashlog.patch +++ b/target/linux/generic/hack-4.19/930-crashlog.patch @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau help --- a/kernel/Makefile +++ b/kernel/Makefile -@@ -114,6 +114,7 @@ obj-$(CONFIG_TORTURE_TEST) += torture.o +@@ -113,6 +113,7 @@ obj-$(CONFIG_TORTURE_TEST) += torture.o obj-$(CONFIG_HAS_IOMEM) += iomem.o obj-$(CONFIG_ZONE_DEVICE) += memremap.o obj-$(CONFIG_RSEQ) += rseq.o @@ -318,7 +318,7 @@ Signed-off-by: Felix Fietkau #include #include -@@ -547,6 +548,8 @@ static void __init_memblock memblock_ins +@@ -510,6 +511,8 @@ static void __init_memblock memblock_ins memblock_set_region_node(rgn, nid); type->cnt++; type->total_size += size; @@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau } /** -@@ -586,6 +589,8 @@ int __init_memblock memblock_add_range(s +@@ -549,6 +552,8 @@ int __init_memblock memblock_add_range(s type->regions[0].flags = flags; memblock_set_region_node(&type->regions[0], nid); type->total_size = size; diff --git a/target/linux/generic/hack-4.19/998-usb-serial-option-add-u9300.patch b/target/linux/generic/hack-4.19/998-usb-serial-option-add-u9300.patch index 3c93dbf53d..17dc6f5119 100644 --- a/target/linux/generic/hack-4.19/998-usb-serial-option-add-u9300.patch +++ b/target/linux/generic/hack-4.19/998-usb-serial-option-add-u9300.patch @@ -18,7 +18,7 @@ /* 4G Systems products */ /* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick * -@@ -578,6 +579,16 @@ static void option_instat_callback(struc +@@ -580,6 +581,16 @@ static void option_instat_callback(struc /* Device needs ZLP */ #define ZLP BIT(17) @@ -35,7 +35,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, -@@ -612,6 +623,8 @@ static const struct usb_device_id option +@@ -614,6 +625,8 @@ static const struct usb_device_id option { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) }, { USB_DEVICE(QUANTA_VENDOR_ID, 0xea42), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch index 5d7dbf1f06..cef8a5af3d 100644 --- a/target/linux/generic/hack-4.9/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1248,7 +1248,6 @@ endif +@@ -1242,7 +1242,6 @@ endif PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1278,7 +1277,6 @@ _modinst_: +@@ -1272,7 +1271,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch index 63735025ff..cfa769d0d9 100644 --- a/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -1977,7 +1977,7 @@ static int __init pktsched_init(void) +@@ -1978,7 +1978,7 @@ static int __init pktsched_init(void) return err; } diff --git a/target/linux/generic/hack-4.9/930-crashlog.patch b/target/linux/generic/hack-4.9/930-crashlog.patch index 1ce075c92f..f864073493 100644 --- a/target/linux/generic/hack-4.9/930-crashlog.patch +++ b/target/linux/generic/hack-4.9/930-crashlog.patch @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau depends on BROKEN || !FRV --- a/kernel/Makefile +++ b/kernel/Makefile -@@ -111,6 +111,7 @@ obj-$(CONFIG_TORTURE_TEST) += torture.o +@@ -110,6 +110,7 @@ obj-$(CONFIG_TORTURE_TEST) += torture.o obj-$(CONFIG_MEMBARRIER) += membarrier.o obj-$(CONFIG_HAS_IOMEM) += memremap.o diff --git a/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch b/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch index 27e9e2ba39..90ef63c1f3 100644 --- a/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch @@ -62,7 +62,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/base/core.c +++ b/drivers/base/core.c -@@ -162,10 +162,10 @@ static int device_reorder_to_tail(struct +@@ -177,10 +177,10 @@ static int device_reorder_to_tail(struct * of the link. If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be * ignored. * @@ -77,7 +77,7 @@ Signed-off-by: Yangbo Lu * * A side effect of the link creation is re-ordering of dpm_list and the * devices_kset list by moving the consumer device and all devices depending -@@ -183,7 +183,8 @@ struct device_link *device_link_add(stru +@@ -198,7 +198,8 @@ struct device_link *device_link_add(stru bool rpm_put_supplier = false; if (!consumer || !supplier || @@ -87,7 +87,7 @@ Signed-off-by: Yangbo Lu return NULL; if (flags & DL_FLAG_PM_RUNTIME && flags & DL_FLAG_RPM_ACTIVE) { -@@ -209,8 +210,10 @@ struct device_link *device_link_add(stru +@@ -224,8 +225,10 @@ struct device_link *device_link_add(stru } list_for_each_entry(link, &supplier->links.consumers, s_node) @@ -99,7 +99,7 @@ Signed-off-by: Yangbo Lu link = kzalloc(sizeof(*link), GFP_KERNEL); if (!link) -@@ -237,6 +240,7 @@ struct device_link *device_link_add(stru +@@ -252,6 +255,7 @@ struct device_link *device_link_add(stru link->consumer = consumer; INIT_LIST_HEAD(&link->c_node); link->flags = flags; @@ -107,7 +107,7 @@ Signed-off-by: Yangbo Lu /* Determine the initial link state. */ if (flags & DL_FLAG_STATELESS) { -@@ -311,8 +315,10 @@ static void __device_link_free_srcu(stru +@@ -326,8 +330,10 @@ static void __device_link_free_srcu(stru device_link_free(container_of(rhead, struct device_link, rcu_head)); } @@ -119,7 +119,7 @@ Signed-off-by: Yangbo Lu dev_info(link->consumer, "Dropping the link to %s\n", dev_name(link->supplier)); -@@ -324,8 +330,10 @@ static void __device_link_del(struct dev +@@ -339,8 +345,10 @@ static void __device_link_del(struct dev call_srcu(&device_links_srcu, &link->rcu_head, __device_link_free_srcu); } #else /* !CONFIG_SRCU */ @@ -131,7 +131,7 @@ Signed-off-by: Yangbo Lu dev_info(link->consumer, "Dropping the link to %s\n", dev_name(link->supplier)); -@@ -343,18 +351,50 @@ static void __device_link_del(struct dev +@@ -358,18 +366,50 @@ static void __device_link_del(struct dev * @link: Device link to delete. * * The caller must ensure proper synchronization of this function with runtime @@ -184,7 +184,7 @@ Signed-off-by: Yangbo Lu static void device_links_missing_supplier(struct device *dev) { struct device_link *link; -@@ -462,8 +502,8 @@ static void __device_links_no_driver(str +@@ -477,8 +517,8 @@ static void __device_links_no_driver(str if (link->flags & DL_FLAG_STATELESS) continue; @@ -195,7 +195,7 @@ Signed-off-by: Yangbo Lu else if (link->status != DL_STATE_SUPPLIER_UNBIND) WRITE_ONCE(link->status, DL_STATE_AVAILABLE); } -@@ -498,8 +538,18 @@ void device_links_driver_cleanup(struct +@@ -513,8 +553,18 @@ void device_links_driver_cleanup(struct if (link->flags & DL_FLAG_STATELESS) continue; @@ -215,7 +215,7 @@ Signed-off-by: Yangbo Lu WRITE_ONCE(link->status, DL_STATE_DORMANT); } -@@ -616,13 +666,13 @@ static void device_links_purge(struct de +@@ -631,13 +681,13 @@ static void device_links_purge(struct de list_for_each_entry_safe_reverse(link, ln, &dev->links.suppliers, c_node) { WARN_ON(link->status == DL_STATE_ACTIVE); @@ -231,7 +231,7 @@ Signed-off-by: Yangbo Lu } device_links_write_unlock(); -@@ -1044,6 +1094,34 @@ static ssize_t online_store(struct devic +@@ -1059,6 +1109,34 @@ static ssize_t online_store(struct devic } static DEVICE_ATTR_RW(online); @@ -266,7 +266,7 @@ Signed-off-by: Yangbo Lu int device_add_groups(struct device *dev, const struct attribute_group **groups) { return sysfs_create_groups(&dev->kobj, groups); -@@ -1215,8 +1293,20 @@ static int device_add_attrs(struct devic +@@ -1230,8 +1308,20 @@ static int device_add_attrs(struct devic goto err_remove_dev_groups; } @@ -287,7 +287,7 @@ Signed-off-by: Yangbo Lu err_remove_dev_groups: device_remove_groups(dev, dev->groups); err_remove_type_groups: -@@ -1234,6 +1324,8 @@ static void device_remove_attrs(struct d +@@ -1249,6 +1339,8 @@ static void device_remove_attrs(struct d struct class *class = dev->class; const struct device_type *type = dev->type; diff --git a/target/linux/layerscape/patches-4.14/302-dts-support-layerscape.patch b/target/linux/layerscape/patches-4.14/302-dts-support-layerscape.patch index 919bb30cfc..6723627785 100644 --- a/target/linux/layerscape/patches-4.14/302-dts-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/302-dts-support-layerscape.patch @@ -4662,15 +4662,6 @@ Signed-off-by: Zhao Qiang scfg: scfg@1570000 { compatible = "fsl,ls1046a-scfg", "syscon"; reg = <0x0 0x1570000 0x0 0x10000>; -@@ -304,7 +311,7 @@ - - dcfg: dcfg@1ee0000 { - compatible = "fsl,ls1046a-dcfg", "syscon"; -- reg = <0x0 0x1ee0000 0x0 0x10000>; -+ reg = <0x0 0x1ee0000 0x0 0x1000>; - big-endian; - }; - @@ -362,36 +369,7 @@ #thermal-sensor-cells = <1>; }; diff --git a/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch index f140edea70..5405e7e8b8 100644 --- a/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch @@ -1289,7 +1289,7 @@ Signed-off-by: Zhao Chenhui xhci->quirks |= XHCI_BROKEN_PORT_PED; --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c -@@ -1978,10 +1978,12 @@ static int finish_td(struct xhci_hcd *xh +@@ -1983,10 +1983,12 @@ static int finish_td(struct xhci_hcd *xh union xhci_trb *ep_trb, struct xhci_transfer_event *event, struct xhci_virt_ep *ep, int *status) { @@ -1302,7 +1302,7 @@ Signed-off-by: Zhao Chenhui u32 trb_comp_code; int ep_index; -@@ -2004,14 +2006,30 @@ static int finish_td(struct xhci_hcd *xh +@@ -2009,14 +2011,30 @@ static int finish_td(struct xhci_hcd *xh if (trb_comp_code == COMP_STALL_ERROR || xhci_requires_manual_halt_cleanup(xhci, ep_ctx, trb_comp_code)) { diff --git a/target/linux/sunxi/patches-4.19/103-sunxi-h5-add-support-for-nanopi-r1s-h5.patch b/target/linux/sunxi/patches-4.19/103-sunxi-h5-add-support-for-nanopi-r1s-h5.patch index a0e1774865..d624240d9a 100644 --- a/target/linux/sunxi/patches-4.19/103-sunxi-h5-add-support-for-nanopi-r1s-h5.patch +++ b/target/linux/sunxi/patches-4.19/103-sunxi-h5-add-support-for-nanopi-r1s-h5.patch @@ -1,6 +1,6 @@ --- a/arch/arm64/boot/dts/allwinner/Makefile +++ b/arch/arm64/boot/dts/allwinner/Makefile -@@ -11,6 +11,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-or +@@ -11,6 +11,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-t dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-libretech-all-h3-cc.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb From 4ea42dafa2248cb9e5d10dfe11ba8e0c19d4fe8d Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 13 Feb 2021 16:36:34 +0800 Subject: [PATCH 03/34] chinadns-ng: bump to latest git HEAD Signed-off-by: CN_SZTL --- package/ctcgfw/chinadns-ng/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/ctcgfw/chinadns-ng/Makefile b/package/ctcgfw/chinadns-ng/Makefile index 5b42212b80..f470a2f484 100644 --- a/package/ctcgfw/chinadns-ng/Makefile +++ b/package/ctcgfw/chinadns-ng/Makefile @@ -9,16 +9,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=chinadns-ng -PKG_VERSION:=1.0-beta.23 +PKG_VERSION:=1.0-beta.24 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/zfl9/chinadns-ng.git -PKG_SOURCE_DATE:=2019-08-30 -PKG_SOURCE_VERSION:=748a043dd7fb7ec71efbb7306f9dd21db5ce560f -PKG_MIRROR_HASH:=c36b8f45e332f95279c67e3c367c5dd92edacd47759ab7be1ab52c325a21821b +PKG_SOURCE_DATE:=2021-02-11 +PKG_SOURCE_VERSION:=df3bb7c6310df9b3c0f874b7a0c38ea5ce0996cb +PKG_MIRROR_HASH:=4b0a159e1ecd81392a67b31528b0430afa991bfceef5dd60d2d843edfccb6b12 -PKG_LICENSE:=GPLv3 +PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=pexcn From df3d3d9fa06a80947e11eef4fe7d4b82517428f4 Mon Sep 17 00:00:00 2001 From: xiaorouji <60100640+xiaorouji@users.noreply.github.com> Date: Wed, 10 Feb 2021 00:52:25 +0800 Subject: [PATCH 04/34] luci-app-passwall: bump to 4-15 Co-authored-by: ShanStone <31815718+ShanStone@users.noreply.github.com> Co-authored-by: Jingye-Xia <70971515+Jingye-Xia@users.noreply.github.com> Signed-off-by: CN_SZTL --- package/lienol/luci-app-passwall/Makefile | 5 +- .../luasrc/model/cbi/passwall/api/api.lua | 18 + .../model/cbi/passwall/api/gen_xray.lua | 223 +- .../model/cbi/passwall/client/auto_switch.lua | 9 +- .../model/cbi/passwall/client/global.lua | 21 +- .../model/cbi/passwall/client/node_config.lua | 20 +- .../luasrc/model/cbi/passwall/client/rule.lua | 4 + .../model/cbi/passwall/client/shunt_rules.lua | 2 +- .../view/passwall/rule/rule_version.htm | 10 + .../luci-app-passwall/po/zh-cn/passwall.po | 3 + .../root/etc/config/passwall | 15 + .../root/usr/share/passwall/app.sh | 4 +- .../root/usr/share/passwall/iptables.sh | 53 +- .../root/usr/share/passwall/rule_update.lua | 517 +- .../root/usr/share/passwall/rules/chnlist | 375 +- .../root/usr/share/passwall/rules/chnroute | 1 + .../root/usr/share/passwall/rules/chnroute6 | 1 + .../usr/share/passwall/rules/gfwlist.conf | 4454 +++++++++-------- 18 files changed, 2926 insertions(+), 2809 deletions(-) diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile index 81dbc80417..ec7eb8fd24 100644 --- a/package/lienol/luci-app-passwall/Makefile +++ b/package/lienol/luci-app-passwall/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=4 -PKG_RELEASE:=14 -PKG_DATE:=20210209 +PKG_RELEASE:=15 +PKG_DATE:=20210213 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) @@ -101,6 +101,7 @@ define Package/$(PKG_NAME) +PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR:shadowsocksr-libev-ssr-local \ +PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-ssr-server \ +PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray-core \ + +PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray-geodata \ +PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Plus:trojan-plus \ +PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_GO:trojan-go \ +PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy:naiveproxy \ diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua index 593c9cdf64..4b044ef385 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua @@ -162,6 +162,24 @@ function is_finded(e) return luci.sys.exec('type -t -p "/bin/%s" -p "%s" "%s"' % {e, get_customed_path(e), e}) ~= "" and true or false end + +function clone(org) + local function copy(org, res) + for k,v in pairs(org) do + if type(v) ~= "table" then + res[k] = v; + else + res[k] = {}; + copy(v, res[k]) + end + end + end + + local res = {} + copy(org, res) + return res +end + function get_xray_path() local path = uci_get_type("global_app", "xray_file") return path diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua index 2c124ab5f4..6052b597d9 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua @@ -25,7 +25,7 @@ local new_port local ucursor = require"luci.model.uci".cursor() local sys = require "luci.sys" local json = require "luci.jsonc" -local appname = "passwall" +local appname = api.appname local dns = nil local inbounds = {} local outbounds = {} @@ -40,31 +40,48 @@ local function get_new_port() return new_port end -function gen_outbound(node, tag, relay_port) +function gen_outbound(node, tag, is_proxy) local result = nil - if node then + if node and node ~= "nil" then local node_id = node[".name"] if tag == nil then tag = node_id end + + if is_proxy and is_proxy == "1" then + new_port = get_new_port() + table.insert(inbounds, { + tag = "proxy_" .. tag, + listen = "127.0.0.1", + port = new_port, + protocol = "dokodemo-door", + settings = {network = "tcp,udp", address = node.address, port = tonumber(node.port)} + }) + if node.tls_serverName == nil then + node.tls_serverName = node.address + end + node.address = "127.0.0.1" + node.port = new_port + end + if node.type ~= "Xray" and node.type ~= "V2ray" then if node.type == "Socks" then node.protocol = "socks" node.transport = "tcp" else local node_type = proto or "socks" + local relay_port = node.port new_port = get_new_port() node.port = new_port - sys.call(string.format('/usr/share/%s/app.sh run_socks "%s" "%s" "%s" "%s" "%s" "%s" "%s" "%s"> /dev/null', - appname, - new_port, - node_id, - "127.0.0.1", - new_port, - string.format("/var/etc/%s/v2_%s_%s.json", appname, node_type, node_id), - "0", - "nil", - relay_port and tostring(relay_port) or "" + sys.call(string.format('/usr/share/%s/app.sh run_socks "%s" "%s" "%s" "%s" "%s" "%s" "%s" "%s"> /dev/null', appname, + new_port, --flag + node_id, --node + "127.0.0.1", --bind + new_port, --socks port + string.format("/var/etc/%s/v2_%s_%s_%s.json", appname, node_type, node_id, new_port), --config file + "0", --http port + "nil", -- http config file + (is_proxy and is_proxy == "1" and relay_port) and tostring(relay_port) or "" --relay port ) ) node.protocol = "socks" @@ -86,6 +103,8 @@ function gen_outbound(node, tag, relay_port) end result = { + _flag_tag = node_id, + _flag_is_proxy = (is_proxy and is_proxy == "1") and "1" or "0", tag = tag, protocol = node.protocol, mux = (node.stream_security ~= "xtls") and { @@ -222,11 +241,80 @@ if node_section then end end + local up_trust_doh = ucursor:get(appname, "@global[0]", "up_trust_doh") + if up_trust_doh then + local t = {} + string.gsub(up_trust_doh, '[^' .. "," .. ']+', function (w) + table.insert(t, w) + end) + if #t > 1 then + local host = sys.exec("echo -n $(echo " .. t[1] .. " | sed 's/https:\\/\\///g' | awk -F ':' '{print $1}' | awk -F '/' '{print $1}')") + dns = { + hosts = { + [host] = t[2] + } + } + end + end + if node.protocol == "_shunt" then local rules = {} + + local default_node_id = node.default_node or "_direct" + local outboundTag + if default_node_id == "_direct" then + outboundTag = "direct" + elseif default_node_id == "_blackhole" then + outboundTag = "blackhole" + else + local default_node = ucursor:get_all(appname, default_node_id) + local main_node_id = node.main_node or "nil" + if main_node_id ~= "nil" then + if main_node_id == default_node_id then + else + new_port = get_new_port() + table.insert(inbounds, { + tag = "proxy_default", + listen = "127.0.0.1", + port = new_port, + protocol = "dokodemo-door", + settings = {network = "tcp,udp", address = default_node.address, port = tonumber(default_node.port)} + }) + if default_node.tls_serverName == nil then + default_node.tls_serverName = default_node.address + end + default_node.address = "127.0.0.1" + default_node.port = new_port + local node = ucursor:get_all(appname, main_node_id) + local outbound = gen_outbound(node, "main") + if outbound then + table.insert(outbounds, outbound) + table.insert(rules, 1, { + type = "field", + inboundTag = {"proxy_default"}, + outboundTag = "main" + }) + end + end + end + local default_outbound = gen_outbound(default_node, "default") + if default_outbound then + table.insert(outbounds, default_outbound) + outboundTag = "default" + end + end + if outboundTag then + table.insert(rules, { + type = "field", + outboundTag = outboundTag, + network = network + }) + end + ucursor:foreach(appname, "shunt_rules", function(e) local name = e[".name"] local _node_id = node[name] or "nil" + local is_proxy = node[name .. "_proxy"] or "0" local outboundTag if _node_id == "_direct" then outboundTag = "direct" @@ -234,36 +322,31 @@ if node_section then outboundTag = "blackhole" else if _node_id ~= "nil" then - local _node = ucursor:get_all(appname, _node_id) - local is_proxy = node[name .. "_proxy"] - local relay_port - if is_proxy and is_proxy == "1" then - new_port = get_new_port() - relay_port = new_port - table.insert(inbounds, { - tag = "proxy_" .. name, - listen = "127.0.0.1", - port = new_port, - protocol = "dokodemo-door", - settings = {network = "tcp,udp", address = _node.address, port = tonumber(_node.port)} - }) - if _node.tls_serverName == nil then - _node.tls_serverName = _node.address + local has_outbound + for index, value in ipairs(outbounds) do + if value["_flag_tag"] == _node_id and value["_flag_is_proxy"] == is_proxy then + has_outbound = api.clone(value) + break end - _node.address = "127.0.0.1" - _node.port = new_port end - local _outbound = gen_outbound(_node, name, relay_port) - if _outbound then - table.insert(outbounds, _outbound) - if is_proxy and is_proxy == "1" then - table.insert(rules, { - type = "field", - inboundTag = {"proxy_" .. name}, - outboundTag = "default" - }) - end + if has_outbound then + has_outbound["tag"] = name + table.insert(outbounds, has_outbound) outboundTag = name + else + local _node = ucursor:get_all(appname, _node_id) + local _outbound = gen_outbound(_node, name, is_proxy) + if _outbound then + if is_proxy == "1" then + table.insert(rules, 1, { + type = "field", + inboundTag = {"proxy_" .. name}, + outboundTag = "default" + }) + end + table.insert(outbounds, _outbound) + outboundTag = name + end end end end @@ -292,59 +375,10 @@ if node_section then end end end) - - local default_node_id = node.default_node or nil - if default_node_id and default_node_id ~= "nil" then - local default_node = ucursor:get_all(appname, default_node_id) - if "1" == node.default_proxy then - local node_id = node.main_node or nil - if node_id and node_id ~= "nil" then - if node_id == default_node_id then - else - new_port = get_new_port() - table.insert(inbounds, { - tag = "proxy_default", - listen = "127.0.0.1", - port = new_port, - protocol = "dokodemo-door", - settings = {network = "tcp,udp", address = default_node.address, port = tonumber(default_node.port)} - }) - if default_node.tls_serverName == nil then - default_node.tls_serverName = default_node.address - end - default_node.address = "127.0.0.1" - default_node.port = new_port - local node = ucursor:get_all(appname, node_id) - local outbound = gen_outbound(node, "main") - if outbound then - table.insert(outbounds, outbound) - local rule = { - type = "field", - inboundTag = {"proxy_default"}, - outboundTag = "main" - } - table.insert(rules, rule) - end - end - end - end - local default_outbound = gen_outbound(default_node, "default") - if default_outbound then - table.insert(outbounds, default_outbound) - local rule = { - type = "field", - outboundTag = "default", - network = network - } - table.insert(rules, rule) - end - end - routing = { domainStrategy = node.domainStrategy or "AsIs", rules = rules } - elseif node.protocol == "_balancing" then if node.balancing_node then local nodes = node.balancing_node @@ -456,7 +490,14 @@ if inbounds or outbounds then table.insert(outbounds, { protocol = "freedom", tag = "direct", - settings = {domainStrategy = "UseIPv4"} + settings = { + domainStrategy = "UseIPv4" + }, + streamSettings = { + sockopt = { + mark = 255 + } + } }) table.insert(outbounds, { protocol = "blackhole", @@ -465,7 +506,7 @@ if inbounds or outbounds then local xray = { log = { - -- error = string.format("/var/etc/passwall/%s.log", node[".name"]), + -- error = string.format("/var/etc/%s/%s.log", appname, node[".name"]), loglevel = loglevel }, -- DNS diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/auto_switch.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/auto_switch.lua index ab048d5eeb..3161695663 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/auto_switch.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/auto_switch.lua @@ -3,10 +3,7 @@ local appname = api.appname local nodes_table = {} for k, e in ipairs(api.get_valid_nodes()) do - nodes_table[#nodes_table + 1] = { - id = e[".name"], - remarks = e.remarks_name - } + nodes_table[#nodes_table + 1] = e end m = Map(appname) @@ -26,7 +23,9 @@ o.default = "1" o = s:option(DynamicList, "tcp_node", "TCP " .. translate("List of backup nodes")) for k, v in pairs(nodes_table) do - o:value(v.id, v.remarks) + if v.node_type == "normal" then + o:value(v.id, v.remarks_name) + end end o = s:option(Flag, "restore_switch", "TCP " .. translate("Restore Switch"), translate("When detects main node is available, switch back to the main node.")) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua index 299a324956..3e7b721cbf 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -120,11 +120,11 @@ if has_xray and #nodes_table > 0 then local id = e[".name"] o = s:taboption("Main", ListValue, v.id .. "." .. id .. "_node", string.format('* %s', api.url("shunt_rules", id), translate(e.remarks))) o:depends("tcp_node", v.id) - o:value("nil", translate("Close")) + o:value("nil", translate("Default")) o:value("_direct", translate("Direct Connection")) o:value("_blackhole", translate("Blackhole")) - for k, v in pairs(normal_list) do - o:value(v.id, v.remarks_name) + for k1, v1 in pairs(normal_list) do + o:value(v1.id, v1.remarks_name) end o.cfgvalue = function(self, section) return m:get(v.id, id) or "nil" @@ -137,9 +137,10 @@ if has_xray and #nodes_table > 0 then local id = "default_node" o = s:taboption("Main", ListValue, v.id .. "." .. id, "* " .. translate("Default")) o:depends("tcp_node", v.id) - o:value("nil", translate("Close")) - for k, v in pairs(normal_list) do - o:value(v.id, v.remarks_name) + o:value("_direct", translate("Direct Connection")) + o:value("_blackhole", translate("Blackhole")) + for k1, v1 in pairs(normal_list) do + o:value(v1.id, v1.remarks_name) end o.cfgvalue = function(self, section) return m:get(v.id, id) or "nil" @@ -152,8 +153,8 @@ if has_xray and #nodes_table > 0 then o = s:taboption("Main", ListValue, v.id .. "." .. id, "* " .. translate("Default") .. translate("Preproxy")) o:depends("tcp_node", v.id) o:value("nil", translate("Close")) - for k, v in pairs(normal_list) do - o:value(v.id, v.remarks_name) + for k1, v1 in pairs(normal_list) do + o:value(v1.id, v1.remarks_name) end o.cfgvalue = function(self, section) return m:get(v.id, id) or "nil" @@ -274,7 +275,9 @@ o:depends({dns_mode = "pdnsd"}) o = s:taboption("DNS", Button, "clear_ipset", translate("Clear IPSET"), translate("Try this feature if the rule modification does not take effect.")) o.inputstyle = "remove" function o.write(e, e) - luci.sys.call("/etc/init.d/" .. appname .. " stop && /usr/share/" .. appname .. "/iptables.sh flush_ipset && /etc/init.d/" .. appname .. " restart") + luci.sys.call("/etc/init.d/" .. appname .. " stop") + luci.sys.call("/usr/share/" .. appname .. "/iptables.sh flush_ipset") + luci.sys.call("/etc/init.d/" .. appname .. " restart") end s:tab("Proxy", translate("Mode")) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua index 4f3c4b6f51..b8c933e995 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/node_config.lua @@ -129,7 +129,7 @@ balancing_node:depends("protocol", "_balancing") -- 分流 uci:foreach(appname, "shunt_rules", function(e) o = s:option(ListValue, e[".name"], string.format('* %s', api.url("shunt_rules", e[".name"]), translate(e.remarks))) - o:value("nil", translate("Close")) + o:value("nil", translate("Default")) o:value("_direct", translate("Direct Connection")) o:value("_blackhole", translate("Blackhole")) o:depends("protocol", "_shunt") @@ -153,17 +153,19 @@ end shunt_tips:depends("protocol", "_shunt") default_node = s:option(ListValue, "default_node", translate("Default") .. " " .. translate("Node")) -default_node:value("nil", translate("Close")) +default_node:value("_direct", translate("Direct Connection")) +default_node:value("_blackhole", translate("Blackhole")) for k, v in pairs(nodes_table) do default_node:value(v.id, v.remarks) end default_node:depends("protocol", "_shunt") -default_proxy = s:option(Flag, "default_proxy", translate("Default") .. translate("Node") .. translate("Preproxy"), translate("Use the under node for the transit.")) -default_proxy.default = 0 -default_proxy:depends("protocol", "_shunt") - -o = s:option(ListValue, "main_node", " ") -for k, v in pairs(nodes_table) do o:value(v.id, v.remarks) end -o:depends("default_proxy", "1") +if #nodes_table > 0 then + o = s:option(ListValue, "main_node", translate("Default") .. " " .. translate("Node") .. translate("Preproxy"), translate("Use this node proxy to forward the default node.")) + o:value("nil", translate("Close")) + for k, v in pairs(nodes_table) do + o:value(v.id, v.remarks) + o:depends("default_node", v.id) + end +end domainStrategy = s:option(ListValue, "domainStrategy", translate("Domain Strategy")) domainStrategy:value("AsIs") diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua index 5025bf5853..de2e63faa6 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/rule.lua @@ -28,6 +28,9 @@ o = s:option(Value, "chnroute6_url", translate("China IPv6s(chnroute6) Update UR o:value("https://ispip.clang.cn/all_cn_ipv6.txt", translate("Clang.CN.IPv6")) o.default = "https://ispip.clang.cn/all_cn_ipv6.txt" +----chnlist URL +o = s:option(DynamicList, "chnlist_url", translate("China List(Chnlist) Update URL")) + s:append(Template(appname .. "/rule/rule_version")) ---- Auto Update @@ -57,6 +60,7 @@ s = m:section(TypedSection, "shunt_rules", "Xray" .. translate("Shunt") .. trans s.template = "cbi/tblsection" s.anonymous = false s.addremove = true +s.sortable = true s.extedit = api.url("shunt_rules", "%s") function s.create(e, t) TypedSection.create(e, t) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua index 4ddc363eda..94814bf8b9 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua @@ -57,7 +57,7 @@ ip_list.validate = function(self, value) if ipmask:find("geoip:") and ipmask:find("geoip:") == 1 then elseif ipmask:find("ext:") and ipmask:find("ext:") == 1 then else - if not datatypes.ipmask4(ipmask) then + if not (datatypes.ipmask4(ipmask) or datatypes.ipmask6(ipmask)) then return nil, ipmask .. " " .. translate("Not valid IP format, please re-enter!") end end diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm index 4d8d9ba62a..f6cea0bfdd 100644 --- a/package/lienol/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm +++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm @@ -5,6 +5,8 @@ local gfwlist_update = api.uci_get_type("global_rules", "gfwlist_update", "1") = local chnroute_update = api.uci_get_type("global_rules", "chnroute_update", "1") == "1" and "checked='checked'" or "" local chnroute6_update = api.uci_get_type("global_rules", "chnroute6_update", "1") == "1" and "checked='checked'" or "" local chnlist_update = api.uci_get_type("global_rules", "chnlist_update", "1") == "1" and "checked='checked'" or "" +local geoip_update = api.uci_get_type("global_rules", "geoip_update", "1") == "1" and "checked='checked'" or "" +local geosite_update = api.uci_get_type("global_rules", "geosite_update", "1") == "1" and "checked='checked'" or "" -%> diff --git a/package/ctcgfw/luci-theme-argonv3/luasrc/view/themes/argon/header_login.htm b/package/ctcgfw/luci-theme-argonv3/luasrc/view/themes/argon/header_login.htm index 762332b591..6a83d8d621 100644 --- a/package/ctcgfw/luci-theme-argonv3/luasrc/view/themes/argon/header_login.htm +++ b/package/ctcgfw/luci-theme-argonv3/luasrc/view/themes/argon/header_login.htm @@ -32,7 +32,6 @@ local uci = require 'luci.model.uci'.cursor() local boardinfo = util.ubus("system", "board") - local request = disp.context.path local request2 = disp.context.request @@ -52,7 +51,6 @@ math.randomseed(tonumber(tostring(os.time()):reverse():sub(1, 9))) -- Custom settings - local mode = 'normal' local dark_css = fs.readfile('/www/luci-static/argon/css/dark.css') local bar_color = '#5e72e4' diff --git a/package/ctcgfw/luci-theme-argonv3/luasrc/view/themes/argon/sysauth.htm b/package/ctcgfw/luci-theme-argonv3/luasrc/view/themes/argon/sysauth.htm index f5f5ce57ce..e194b3c2b9 100644 --- a/package/ctcgfw/luci-theme-argonv3/luasrc/view/themes/argon/sysauth.htm +++ b/package/ctcgfw/luci-theme-argonv3/luasrc/view/themes/argon/sysauth.htm @@ -82,25 +82,23 @@ } }) - <% else %> -
0 and currentBg["type"] ~= "mp4") then + bg_url = currentBg.url + end %> - style="background-image:url(<%=bg_url%>)" - <% elseif (bgcount > 0 and currentBg["type"] ~= "mp4") then %> - style="background-image:url(<%=currentBg.url%>)" - <% end %> - >
- +
<% end %>