diff --git a/include/kernel-6.6 b/include/kernel-6.6 index ee524ccdd65d43..6f72804b870d7e 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .54 -LINUX_KERNEL_HASH-6.6.54 = 5fae869d6a24055c16ffc2d92669e3fb2b258e34d36c850bb8cf9def417ecfa0 +LINUX_VERSION-6.6 = .56 +LINUX_KERNEL_HASH-6.6.56 = f74812f78e88992c416434cb107639e13a551dbaff36bb90d6346ab16ab71a95 diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index a4d81a94e13012..dd22ac390e128b 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -5,9 +5,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2024.07 +PKG_VERSION:=2024.10 PKG_RELEASE:=1 -PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f +PKG_HASH:=b28daf4ac17e43156363078bf510297584137f6df50fced9b12df34f61a92fb0 PKG_MAINTAINER:=Sarah Maedel diff --git a/package/boot/uboot-rockchip/patches/000-v2024.10-rc1-backport-upstream-dts-sync.patch b/package/boot/uboot-rockchip/patches/000-v2024.10-rc1-backport-upstream-dts-sync.patch deleted file mode 100644 index afe651afc80f53..00000000000000 --- a/package/boot/uboot-rockchip/patches/000-v2024.10-rc1-backport-upstream-dts-sync.patch +++ /dev/null @@ -1,3687 +0,0 @@ -From 6bb92fcf7d2fea2314d616e5e2391a8bf2b0fdfa Mon Sep 17 00:00:00 2001 -From: Tom Rini -Date: Mon, 20 May 2024 09:54:58 -0600 -Subject: [PATCH] Squashed 'dts/upstream/' changes from - b35b9bd1d4ee..7e08733c96c8 ---- - .../src/arm64/rockchip/rk3588s-nanopi-r6c.dts | 14 + - .../src/arm64/rockchip/rk3588s-nanopi-r6s.dts | 764 ++++++++++++++++++ - 2 files changed, 778 insertions(+) - create mode 100644 dts/upstream/src/arm64/rockchip/rk3588s-nanopi-r6c.dts - create mode 100644 dts/upstream/src/arm64/rockchip/rk3588s-nanopi-r6s.dts - ---- /dev/null -+++ b/dts/upstream/src/arm64/rockchip/rk3588-armsom-sige7.dts -@@ -0,0 +1,691 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/dts-v1/; -+ -+#include -+#include -+#include "rk3588.dtsi" -+ -+/ { -+ model = "ArmSoM Sige7"; -+ compatible = "armsom,sige7", "rockchip,rk3588"; -+ -+ aliases { -+ mmc0 = &sdhci; -+ mmc1 = &sdmmc; -+ }; -+ -+ chosen { -+ stdout-path = "serial2:1500000n8"; -+ }; -+ -+ analog-sound { -+ compatible = "audio-graph-card"; -+ dais = <&i2s0_8ch_p0>; -+ label = "rk3588-es8316"; -+ hp-det-gpio = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&hp_detect>; -+ routing = "MIC2", "Mic Jack", -+ "Headphones", "HPOL", -+ "Headphones", "HPOR"; -+ widgets = "Microphone", "Mic Jack", -+ "Headphone", "Headphones"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_rgb_g>; -+ -+ led_green: led-0 { -+ color = ; -+ function = LED_FUNCTION_STATUS; -+ gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ }; -+ -+ led_red: led-1 { -+ color = ; -+ function = LED_FUNCTION_STATUS; -+ gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "none"; -+ }; -+ }; -+ -+ fan: pwm-fan { -+ compatible = "pwm-fan"; -+ cooling-levels = <0 95 145 195 255>; -+ fan-supply = <&vcc5v0_sys>; -+ pwms = <&pwm1 0 50000 0>; -+ #cooling-cells = <2>; -+ }; -+ -+ vcc3v3_pcie2x1l2: vcc3v3-pcie2x1l2-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3_pcie2x1l2"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ startup-delay-us = <5000>; -+ vin-supply = <&vcc_3v3_s3>; -+ }; -+ -+ vcc3v3_pcie30: vcc3v3-pcie30-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_HIGH>; -+ regulator-name = "vcc3v3_pcie30"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ startup-delay-us = <5000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc5v0_host: vcc5v0-host-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc5v0_host"; -+ regulator-boot-on; -+ regulator-always-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ enable-active-high; -+ gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v0_host_en>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc5v0_sys: vcc5v0-sys-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc5v0_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ }; -+ -+ vcc_1v1_nldo_s3: vcc-1v1-nldo-s3-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_1v1_nldo_s3"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1100000>; -+ regulator-max-microvolt = <1100000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+}; -+ -+&combphy0_ps { -+ status = "okay"; -+}; -+ -+&combphy1_ps { -+ status = "okay"; -+}; -+ -+&combphy2_psu { -+ status = "okay"; -+}; -+ -+&cpu_b0 { -+ cpu-supply = <&vdd_cpu_big0_s0>; -+}; -+ -+&cpu_b1 { -+ cpu-supply = <&vdd_cpu_big0_s0>; -+}; -+ -+&cpu_b2 { -+ cpu-supply = <&vdd_cpu_big1_s0>; -+}; -+ -+&cpu_b3 { -+ cpu-supply = <&vdd_cpu_big1_s0>; -+}; -+ -+&cpu_l0 { -+ cpu-supply = <&vdd_cpu_lit_s0>; -+}; -+ -+&cpu_l1 { -+ cpu-supply = <&vdd_cpu_lit_s0>; -+}; -+ -+&cpu_l2 { -+ cpu-supply = <&vdd_cpu_lit_s0>; -+}; -+ -+&cpu_l3 { -+ cpu-supply = <&vdd_cpu_lit_s0>; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0m2_xfer>; -+ status = "okay"; -+ -+ vdd_cpu_big0_s0: regulator@42 { -+ compatible = "rockchip,rk8602"; -+ reg = <0x42>; -+ fcs,suspend-voltage-selector = <1>; -+ regulator-name = "vdd_cpu_big0_s0"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <1050000>; -+ regulator-ramp-delay = <2300>; -+ vin-supply = <&vcc5v0_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_cpu_big1_s0: regulator@43 { -+ compatible = "rockchip,rk8603", "rockchip,rk8602"; -+ reg = <0x43>; -+ fcs,suspend-voltage-selector = <1>; -+ regulator-name = "vdd_cpu_big1_s0"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <1050000>; -+ regulator-ramp-delay = <2300>; -+ vin-supply = <&vcc5v0_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+}; -+ -+&i2c6 { -+ status = "okay"; -+ -+ hym8563: rtc@51 { -+ compatible = "haoyu,hym8563"; -+ reg = <0x51>; -+ interrupt-parent = <&gpio0>; -+ interrupts = ; -+ #clock-cells = <0>; -+ clock-output-names = "hym8563"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&hym8563_int>; -+ wakeup-source; -+ }; -+}; -+ -+&i2c7 { -+ status = "okay"; -+ -+ es8316: audio-codec@11 { -+ compatible = "everest,es8316"; -+ reg = <0x11>; -+ assigned-clocks = <&cru I2S0_8CH_MCLKOUT>; -+ assigned-clock-rates = <12288000>; -+ clocks = <&cru I2S0_8CH_MCLKOUT>; -+ clock-names = "mclk"; -+ #sound-dai-cells = <0>; -+ -+ port { -+ es8316_p0_0: endpoint { -+ remote-endpoint = <&i2s0_8ch_p0_0>; -+ }; -+ }; -+ }; -+}; -+ -+&i2s0_8ch { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2s0_lrck -+ &i2s0_mclk -+ &i2s0_sclk -+ &i2s0_sdi0 -+ &i2s0_sdo0>; -+ status = "okay"; -+ -+ i2s0_8ch_p0: port { -+ i2s0_8ch_p0_0: endpoint { -+ dai-format = "i2s"; -+ mclk-fs = <256>; -+ remote-endpoint = <&es8316_p0_0>; -+ }; -+ }; -+}; -+ -+/* phy1 - right ethernet port */ -+&pcie2x1l0 { -+ reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+/* phy2 - WiFi */ -+&pcie2x1l1 { -+ reset-gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+/* phy0 - left ethernet port */ -+&pcie2x1l2 { -+ reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+&pcie30phy { -+ status = "okay"; -+}; -+ -+&pcie3x4 { -+ reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; -+ vpcie3v3-supply = <&vcc3v3_pcie30>; -+ status = "okay"; -+}; -+ -+&pinctrl { -+ hym8563 { -+ hym8563_int: hym8563-int { -+ rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ leds { -+ led_rgb_g: led-rgb-g { -+ rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ led_rgb_r: led-rgb-r { -+ rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ sound { -+ hp_detect: hp-detect { -+ rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ usb { -+ vcc5v0_host_en: vcc5v0-host-en { -+ rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+}; -+ -+&pwm1 { -+ status = "okay"; -+}; -+ -+&saradc { -+ vref-supply = <&avcc_1v8_s0>; -+ status = "okay"; -+}; -+ -+&sdhci { -+ bus-width = <8>; -+ no-sdio; -+ no-sd; -+ non-removable; -+ mmc-hs200-1_8v; -+ status = "okay"; -+}; -+ -+&sdmmc { -+ bus-width = <4>; -+ cap-mmc-highspeed; -+ cap-sd-highspeed; -+ disable-wp; -+ max-frequency = <200000000>; -+ no-sdio; -+ no-mmc; -+ sd-uhs-sdr104; -+ vmmc-supply = <&vcc_3v3_s3>; -+ vqmmc-supply = <&vccio_sd_s0>; -+ status = "okay"; -+}; -+ -+&spi2 { -+ assigned-clocks = <&cru CLK_SPI2>; -+ assigned-clock-rates = <200000000>; -+ num-cs = <1>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>; -+ status = "okay"; -+ -+ pmic@0 { -+ compatible = "rockchip,rk806"; -+ spi-max-frequency = <1000000>; -+ reg = <0x0>; -+ -+ interrupt-parent = <&gpio0>; -+ interrupts = <7 IRQ_TYPE_LEVEL_LOW>; -+ -+ gpio-controller; -+ #gpio-cells = <2>; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>, -+ <&rk806_dvs2_null>, <&rk806_dvs3_null>; -+ -+ system-power-controller; -+ -+ vcc1-supply = <&vcc5v0_sys>; -+ vcc2-supply = <&vcc5v0_sys>; -+ vcc3-supply = <&vcc5v0_sys>; -+ vcc4-supply = <&vcc5v0_sys>; -+ vcc5-supply = <&vcc5v0_sys>; -+ vcc6-supply = <&vcc5v0_sys>; -+ vcc7-supply = <&vcc5v0_sys>; -+ vcc8-supply = <&vcc5v0_sys>; -+ vcc9-supply = <&vcc5v0_sys>; -+ vcc10-supply = <&vcc5v0_sys>; -+ vcc11-supply = <&vcc_2v0_pldo_s3>; -+ vcc12-supply = <&vcc5v0_sys>; -+ vcc13-supply = <&vcc_1v1_nldo_s3>; -+ vcc14-supply = <&vcc_1v1_nldo_s3>; -+ vcca-supply = <&vcc5v0_sys>; -+ -+ rk806_dvs1_null: dvs1-null-pins { -+ pins = "gpio_pwrctrl1"; -+ function = "pin_fun0"; -+ }; -+ -+ rk806_dvs2_null: dvs2-null-pins { -+ pins = "gpio_pwrctrl2"; -+ function = "pin_fun0"; -+ }; -+ -+ rk806_dvs3_null: dvs3-null-pins { -+ pins = "gpio_pwrctrl3"; -+ function = "pin_fun0"; -+ }; -+ -+ regulators { -+ vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <950000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_gpu_s0"; -+ regulator-enable-ramp-delay = <400>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <950000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_cpu_lit_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_log_s0: dcdc-reg3 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <675000>; -+ regulator-max-microvolt = <750000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_log_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <750000>; -+ }; -+ }; -+ -+ vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <950000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_vdenc_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_ddr_s0: dcdc-reg5 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <675000>; -+ regulator-max-microvolt = <900000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_ddr_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <850000>; -+ }; -+ }; -+ -+ vdd2_ddr_s3: dcdc-reg6 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-name = "vdd2_ddr_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ vcc_2v0_pldo_s3: dcdc-reg7 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <2000000>; -+ regulator-max-microvolt = <2000000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_2v0_pldo_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <2000000>; -+ }; -+ }; -+ -+ vcc_3v3_s3: dcdc-reg8 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc_3v3_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ vddq_ddr_s0: dcdc-reg9 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-name = "vddq_ddr_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_1v8_s3: dcdc-reg10 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "vcc_1v8_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ avcc_1v8_s0: pldo-reg1 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "avcc_1v8_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_1v8_s0: pldo-reg2 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "vcc_1v8_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ avdd_1v2_s0: pldo-reg3 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1200000>; -+ regulator-max-microvolt = <1200000>; -+ regulator-name = "avdd_1v2_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_3v3_s0: pldo-reg4 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vcc_3v3_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vccio_sd_s0: pldo-reg5 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vccio_sd_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ pldo6_s3: pldo-reg6 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "pldo6_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vdd_0v75_s3: nldo-reg1 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <750000>; -+ regulator-name = "vdd_0v75_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <750000>; -+ }; -+ }; -+ -+ vdd_ddr_pll_s0: nldo-reg2 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <850000>; -+ regulator-max-microvolt = <850000>; -+ regulator-name = "vdd_ddr_pll_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <850000>; -+ }; -+ }; -+ -+ avdd_0v75_s0: nldo-reg3 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <750000>; -+ regulator-name = "avdd_0v75_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_0v85_s0: nldo-reg4 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <850000>; -+ regulator-max-microvolt = <850000>; -+ regulator-name = "vdd_0v85_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_0v75_s0: nldo-reg5 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <750000>; -+ regulator-name = "vdd_0v75_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ }; -+ }; -+}; -+ -+&u2phy3 { -+ status = "okay"; -+}; -+ -+&u2phy3_host { -+ phy-supply = <&vcc5v0_host>; -+ status = "okay"; -+}; -+ -+&uart2 { -+ pinctrl-0 = <&uart2m0_xfer>; -+ status = "okay"; -+}; -+ -+&usb_host1_ehci { -+ status = "okay"; -+}; -+ -+&usb_host1_ohci { -+ status = "okay"; -+}; ---- /dev/null -+++ b/dts/upstream/src/arm64/rockchip/rk3588s-nanopi-r6c.dts -@@ -0,0 +1,14 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/dts-v1/; -+ -+#include "rk3588s-nanopi-r6s.dts" -+ -+/ { -+ model = "FriendlyElec NanoPi R6C"; -+ compatible = "friendlyarm,nanopi-r6c", "rockchip,rk3588s"; -+}; -+ -+&lan2_led { -+ label = "user_led"; -+}; ---- /dev/null -+++ b/dts/upstream/src/arm64/rockchip/rk3588s-nanopi-r6s.dts -@@ -0,0 +1,764 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/dts-v1/; -+ -+#include -+#include -+#include -+#include "rk3588s.dtsi" -+ -+/ { -+ model = "FriendlyElec NanoPi R6S"; -+ compatible = "friendlyarm,nanopi-r6s", "rockchip,rk3588s"; -+ -+ aliases { -+ ethernet0 = &gmac1; -+ mmc0 = &sdmmc; -+ mmc1 = &sdhci; -+ }; -+ -+ chosen { -+ stdout-path = "serial2:1500000n8"; -+ }; -+ -+ adc-keys { -+ compatible = "adc-keys"; -+ io-channels = <&saradc 0>; -+ io-channel-names = "buttons"; -+ keyup-threshold-microvolt = <1800000>; -+ poll-interval = <100>; -+ -+ button-maskrom { -+ label = "Maskrom"; -+ linux,code = ; -+ press-threshold-microvolt = <1800>; -+ }; -+ }; -+ -+ gpio-keys { -+ compatible = "gpio-keys"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&key1_pin>; -+ -+ button-user { -+ label = "User"; -+ linux,code = ; -+ gpios = <&gpio1 RK_PC0 GPIO_ACTIVE_LOW>; -+ debounce-interval = <50>; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ sys_led: led-0 { -+ label = "sys_led"; -+ gpios = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sys_led_pin>; -+ }; -+ -+ wan_led: led-1 { -+ label = "wan_led"; -+ gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&wan_led_pin>; -+ }; -+ -+ lan1_led: led-2 { -+ label = "lan1_led"; -+ gpios = <&gpio1 RK_PC3 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&lan1_led_pin>; -+ }; -+ -+ lan2_led: led-3 { -+ label = "lan2_led"; -+ gpios = <&gpio1 RK_PC4 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&lan2_led_pin>; -+ }; -+ }; -+ -+ vcc5v0_sys: vcc5v0-sys-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc5v0_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ }; -+ -+ vcc_1v1_nldo_s3: vcc-1v1-nldo-s3-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_1v1_nldo_s3"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1100000>; -+ regulator-max-microvolt = <1100000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc_3v3_s0: vcc-3v3-s0-regulator { -+ compatible = "regulator-fixed"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc_3v3_s0"; -+ vin-supply = <&vcc_3v3_s3>; -+ }; -+ -+ vcc_3v3_sd_s0: vcc-3v3-sd-s0-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sd_s0_pwr>; -+ regulator-name = "vcc_3v3_sd_s0"; -+ regulator-boot-on; -+ regulator-max-microvolt = <3000000>; -+ regulator-min-microvolt = <3000000>; -+ vin-supply = <&vcc_3v3_s3>; -+ }; -+ -+ vcc_3v3_pcie20: vcc3v3-pcie20-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_3v3_pcie20"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc_3v3_s3>; -+ }; -+ -+ vcc5v0_usb: vcc5v0-usb-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc5v0_usb"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc5v0_usb_otg0: vcc5v0-usb-otg0-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpios = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&typec5v_pwren>; -+ regulator-name = "vcc5v0_usb_otg0"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_usb>; -+ }; -+ -+ vcc5v0_host_20: vcc5v0-host-20-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpios = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v0_host20_en>; -+ regulator-name = "vcc5v0_host_20"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_usb>; -+ }; -+}; -+ -+&combphy0_ps { -+ status = "okay"; -+}; -+ -+&combphy2_psu { -+ status = "okay"; -+}; -+ -+&cpu_b0 { -+ cpu-supply = <&vdd_cpu_big0_s0>; -+}; -+ -+&cpu_b1 { -+ cpu-supply = <&vdd_cpu_big0_s0>; -+}; -+ -+&cpu_b2 { -+ cpu-supply = <&vdd_cpu_big1_s0>; -+}; -+ -+&cpu_b3 { -+ cpu-supply = <&vdd_cpu_big1_s0>; -+}; -+ -+&cpu_l0 { -+ cpu-supply = <&vdd_cpu_lit_s0>; -+}; -+ -+&cpu_l1 { -+ cpu-supply = <&vdd_cpu_lit_s0>; -+}; -+ -+&cpu_l2 { -+ cpu-supply = <&vdd_cpu_lit_s0>; -+}; -+ -+&cpu_l3 { -+ cpu-supply = <&vdd_cpu_lit_s0>; -+}; -+ -+&gmac1 { -+ clock_in_out = "output"; -+ phy-handle = <&rgmii_phy1>; -+ phy-mode = "rgmii-rxid"; -+ pinctrl-0 = <&gmac1_miim -+ &gmac1_tx_bus2 -+ &gmac1_rx_bus2 -+ &gmac1_rgmii_clk -+ &gmac1_rgmii_bus>; -+ pinctrl-names = "default"; -+ tx_delay = <0x42>; -+ status = "okay"; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0m2_xfer>; -+ status = "okay"; -+ -+ vdd_cpu_big0_s0: regulator@42 { -+ compatible = "rockchip,rk8602"; -+ reg = <0x42>; -+ fcs,suspend-voltage-selector = <1>; -+ regulator-name = "vdd_cpu_big0_s0"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <1050000>; -+ regulator-ramp-delay = <2300>; -+ vin-supply = <&vcc5v0_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_cpu_big1_s0: regulator@43 { -+ compatible = "rockchip,rk8603", "rockchip,rk8602"; -+ reg = <0x43>; -+ fcs,suspend-voltage-selector = <1>; -+ regulator-name = "vdd_cpu_big1_s0"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <1050000>; -+ regulator-ramp-delay = <2300>; -+ vin-supply = <&vcc5v0_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+}; -+ -+&i2c2 { -+ status = "okay"; -+ -+ vdd_npu_s0: regulator@42 { -+ compatible = "rockchip,rk8602"; -+ reg = <0x42>; -+ fcs,suspend-voltage-selector = <1>; -+ regulator-name = "vdd_npu_s0"; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <950000>; -+ regulator-ramp-delay = <2300>; -+ regulator-boot-on; -+ regulator-always-on; -+ vin-supply = <&vcc5v0_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+}; -+ -+&i2c6 { -+ clock-frequency = <200000>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c6m0_xfer>; -+ status = "okay"; -+ -+ hym8563: rtc@51 { -+ compatible = "haoyu,hym8563"; -+ reg = <0x51>; -+ #clock-cells = <0>; -+ clock-output-names = "hym8563"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&rtc_int>; -+ interrupt-parent = <&gpio0>; -+ interrupts = ; -+ wakeup-source; -+ }; -+}; -+ -+&mdio1 { -+ rgmii_phy1: ethernet-phy@1 { -+ compatible = "ethernet-phy-id001c.c916"; -+ reg = <0x1>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&rtl8211f_rst>; -+ reset-assert-us = <20000>; -+ reset-deassert-us = <100000>; -+ reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&pcie2x1l1 { -+ reset-gpios = <&gpio1 RK_PA7 GPIO_ACTIVE_HIGH>; -+ vpcie3v3-supply = <&vcc_3v3_pcie20>; -+ status = "okay"; -+}; -+ -+&pcie2x1l2 { -+ reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>; -+ vpcie3v3-supply = <&vcc_3v3_pcie20>; -+ status = "okay"; -+}; -+ -+&pinctrl { -+ gpio-key { -+ key1_pin: key1-pin { -+ rockchip,pins = <1 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ gpio-leds { -+ sys_led_pin: sys-led-pin { -+ rockchip,pins = -+ <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ wan_led_pin: wan-led-pin { -+ rockchip,pins = -+ <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ lan1_led_pin: lan1-led-pin { -+ rockchip,pins = -+ <1 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ lan2_led_pin: lan2-led-pin { -+ rockchip,pins = -+ <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ hym8563 { -+ rtc_int: rtc-int { -+ rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ sdmmc { -+ sd_s0_pwr: sd-s0-pwr { -+ rockchip,pins = <4 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ usb { -+ typec5v_pwren: typec5v-pwren { -+ rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ vcc5v0_host20_en: vcc5v0-host20-en { -+ rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ rtl8211f { -+ rtl8211f_rst: rtl8211f-rst { -+ rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+}; -+ -+&saradc { -+ vref-supply = <&avcc_1v8_s0>; -+ status = "okay"; -+}; -+ -+&sdhci { -+ bus-width = <8>; -+ no-sdio; -+ no-sd; -+ non-removable; -+ mmc-hs200-1_8v; -+ status = "okay"; -+}; -+ -+&sdmmc { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ disable-wp; -+ max-frequency = <150000000>; -+ no-mmc; -+ no-sdio; -+ sd-uhs-sdr104; -+ vmmc-supply = <&vcc_3v3_sd_s0>; -+ vqmmc-supply = <&vccio_sd_s0>; -+ status = "okay"; -+}; -+ -+&spi2 { -+ status = "okay"; -+ assigned-clocks = <&cru CLK_SPI2>; -+ assigned-clock-rates = <200000000>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>; -+ num-cs = <1>; -+ -+ pmic@0 { -+ compatible = "rockchip,rk806"; -+ spi-max-frequency = <1000000>; -+ reg = <0x0>; -+ -+ interrupt-parent = <&gpio0>; -+ interrupts = <7 IRQ_TYPE_LEVEL_LOW>; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>, -+ <&rk806_dvs2_null>, <&rk806_dvs3_null>; -+ -+ system-power-controller; -+ -+ vcc1-supply = <&vcc5v0_sys>; -+ vcc2-supply = <&vcc5v0_sys>; -+ vcc3-supply = <&vcc5v0_sys>; -+ vcc4-supply = <&vcc5v0_sys>; -+ vcc5-supply = <&vcc5v0_sys>; -+ vcc6-supply = <&vcc5v0_sys>; -+ vcc7-supply = <&vcc5v0_sys>; -+ vcc8-supply = <&vcc5v0_sys>; -+ vcc9-supply = <&vcc5v0_sys>; -+ vcc10-supply = <&vcc5v0_sys>; -+ vcc11-supply = <&vcc_2v0_pldo_s3>; -+ vcc12-supply = <&vcc5v0_sys>; -+ vcc13-supply = <&vcc_1v1_nldo_s3>; -+ vcc14-supply = <&vcc_1v1_nldo_s3>; -+ vcca-supply = <&vcc5v0_sys>; -+ -+ gpio-controller; -+ #gpio-cells = <2>; -+ -+ rk806_dvs1_null: dvs1-null-pins { -+ pins = "gpio_pwrctrl1"; -+ function = "pin_fun0"; -+ }; -+ -+ rk806_dvs2_null: dvs2-null-pins { -+ pins = "gpio_pwrctrl2"; -+ function = "pin_fun0"; -+ }; -+ -+ rk806_dvs3_null: dvs3-null-pins { -+ pins = "gpio_pwrctrl3"; -+ function = "pin_fun0"; -+ }; -+ -+ regulators { -+ vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 { -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <950000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_gpu_s0"; -+ regulator-enable-ramp-delay = <400>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <950000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_cpu_lit_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_log_s0: dcdc-reg3 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <675000>; -+ regulator-max-microvolt = <750000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_log_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <750000>; -+ }; -+ }; -+ -+ vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <550000>; -+ regulator-max-microvolt = <950000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_vdenc_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_ddr_s0: dcdc-reg5 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <675000>; -+ regulator-max-microvolt = <900000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_ddr_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <850000>; -+ }; -+ }; -+ -+ vdd2_ddr_s3: dcdc-reg6 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-name = "vdd2_ddr_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ vcc_2v0_pldo_s3: dcdc-reg7 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <2000000>; -+ regulator-max-microvolt = <2000000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vdd_2v0_pldo_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <2000000>; -+ }; -+ }; -+ -+ vcc_3v3_s3: dcdc-reg8 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc_3v3_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ vddq_ddr_s0: dcdc-reg9 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-name = "vddq_ddr_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_1v8_s3: dcdc-reg10 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "vcc_1v8_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ avcc_1v8_s0: pldo-reg1 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "avcc_1v8_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vcc_1v8_s0: pldo-reg2 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "vcc_1v8_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ avdd_1v2_s0: pldo-reg3 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1200000>; -+ regulator-max-microvolt = <1200000>; -+ regulator-name = "avdd_1v2_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ avcc_3v3_s0: pldo-reg4 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "avcc_3v3_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vccio_sd_s0: pldo-reg5 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-ramp-delay = <12500>; -+ regulator-name = "vccio_sd_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ pldo6_s3: pldo-reg6 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "pldo6_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vdd_0v75_s3: nldo-reg1 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <750000>; -+ regulator-name = "vdd_0v75_s3"; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <750000>; -+ }; -+ }; -+ -+ avdd_ddr_pll_s0: nldo-reg2 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <850000>; -+ regulator-max-microvolt = <850000>; -+ regulator-name = "avdd_ddr_pll_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <850000>; -+ }; -+ }; -+ -+ avdd_0v75_s0: nldo-reg3 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <750000>; -+ regulator-name = "avdd_0v75_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ avdd_0v85_s0: nldo-reg4 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <850000>; -+ regulator-max-microvolt = <850000>; -+ regulator-name = "avdd_0v85_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_0v75_s0: nldo-reg5 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <750000>; -+ regulator-name = "vdd_0v75_s0"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ }; -+ }; -+}; -+ -+&tsadc { -+ status = "okay"; -+}; -+ -+&u2phy2 { -+ status = "okay"; -+}; -+ -+&u2phy2_host { -+ phy-supply = <&vcc5v0_host_20>; -+ status = "okay"; -+}; -+ -+&uart2 { -+ pinctrl-0 = <&uart2m0_xfer>; -+ status = "okay"; -+}; -+ -+&usb_host0_ehci { -+ status = "okay"; -+}; -+ -+&usb_host0_ohci { -+ status = "okay"; -+}; ---- /dev/null -+++ b/dts/upstream/src/arm64/rockchip/rk3566-rock-3c.dts -@@ -0,0 +1,726 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/dts-v1/; -+#include -+#include -+#include -+#include -+#include "rk3566.dtsi" -+ -+/ { -+ model = "Radxa ROCK 3C"; -+ compatible = "radxa,rock-3c", "rockchip,rk3566"; -+ -+ aliases { -+ ethernet0 = &gmac1; -+ mmc0 = &sdhci; -+ mmc1 = &sdmmc0; -+ mmc2 = &sdmmc1; -+ }; -+ -+ chosen: chosen { -+ stdout-path = "serial2:1500000n8"; -+ }; -+ -+ gmac1_clkin: external-gmac1-clock { -+ compatible = "fixed-clock"; -+ clock-frequency = <125000000>; -+ clock-output-names = "gmac1_clkin"; -+ #clock-cells = <0>; -+ }; -+ -+ hdmi-con { -+ compatible = "hdmi-connector"; -+ type = "a"; -+ -+ port { -+ hdmi_con_in: endpoint { -+ remote-endpoint = <&hdmi_out_con>; -+ }; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ led-0 { -+ gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; -+ function = LED_FUNCTION_HEARTBEAT; -+ color = ; -+ linux,default-trigger = "heartbeat"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&user_led2>; -+ }; -+ }; -+ -+ sdio_pwrseq: sdio-pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ clocks = <&rk809 1>; -+ clock-names = "ext_clock"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&wifi_reg_on_h>; -+ post-power-on-delay-ms = <100>; -+ power-off-delay-us = <5000000>; -+ reset-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_LOW>; -+ }; -+ -+ vcc5v_dcin: vcc5v-dcin-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc5v_dcin"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ }; -+ -+ vcc3v3_pcie: vcc3v3-pcie-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pcie_pwr_en>; -+ regulator-name = "vcc3v3_pcie"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc3v3_sys>; -+ }; -+ -+ vcc3v3_sys: vcc3v3-sys-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc5v0_sys: vcc5v0-sys-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc5v0_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v_dcin>; -+ }; -+ -+ vcc5v0_usb30_host: vcc5v0-usb30-host-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v0_usb30_host_en>; -+ regulator-name = "vcc5v0_usb30_host"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc5v0_usb_otg: vcc5v0-usb-otg-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v0_usb_otg_en>; -+ regulator-name = "vcc5v0_usb_otg"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc_cam: vcc-cam-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc_cam_en>; -+ regulator-name = "vcc_cam"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc3v3_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_mipi: vcc-mipi-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc_mipi_en>; -+ regulator-name = "vcc_mipi"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc3v3_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+}; -+ -+&combphy1 { -+ status = "okay"; -+}; -+ -+&combphy2 { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&cpu1 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&cpu2 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&cpu3 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&gmac1 { -+ assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>; -+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&gmac1_clkin>; -+ clock_in_out = "input"; -+ phy-handle = <&rgmii_phy1>; -+ phy-mode = "rgmii-id"; -+ phy-supply = <&vcc_3v3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac1m1_miim -+ &gmac1m1_tx_bus2 -+ &gmac1m1_rx_bus2 -+ &gmac1m1_rgmii_clk -+ &gmac1m1_rgmii_bus -+ &gmac1m1_clkinout>; -+ status = "okay"; -+}; -+ -+&gpu { -+ mali-supply = <&vdd_gpu>; -+ status = "okay"; -+}; -+ -+&hdmi { -+ avdd-0v9-supply = <&vdda0v9_image>; -+ avdd-1v8-supply = <&vcca1v8_image>; -+ status = "okay"; -+}; -+ -+&hdmi_in { -+ hdmi_in_vp0: endpoint { -+ remote-endpoint = <&vp0_out_hdmi>; -+ }; -+}; -+ -+&hdmi_out { -+ hdmi_out_con: endpoint { -+ remote-endpoint = <&hdmi_con_in>; -+ }; -+}; -+ -+&hdmi_sound { -+ status = "okay"; -+}; -+ -+&i2c0 { -+ status = "okay"; -+ -+ vdd_cpu: regulator@1c { -+ compatible = "tcs,tcs4525"; -+ reg = <0x1c>; -+ fcs,suspend-voltage-selector = <1>; -+ regulator-name = "vdd_cpu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <800000>; -+ regulator-max-microvolt = <1150000>; -+ regulator-ramp-delay = <2300>; -+ vin-supply = <&vcc5v0_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ rk809: pmic@20 { -+ compatible = "rockchip,rk809"; -+ reg = <0x20>; -+ interrupt-parent = <&gpio0>; -+ interrupts = ; -+ clock-output-names = "rk808-clkout1", "rk808-clkout2"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pmic_int_l>, <&i2s1m0_mclk>; -+ system-power-controller; -+ vcc1-supply = <&vcc3v3_sys>; -+ vcc2-supply = <&vcc3v3_sys>; -+ vcc3-supply = <&vcc3v3_sys>; -+ vcc4-supply = <&vcc3v3_sys>; -+ vcc5-supply = <&vcc3v3_sys>; -+ vcc6-supply = <&vcc3v3_sys>; -+ vcc7-supply = <&vcc3v3_sys>; -+ vcc8-supply = <&vcc3v3_sys>; -+ vcc9-supply = <&vcc3v3_sys>; -+ wakeup-source; -+ #clock-cells = <1>; -+ -+ regulators { -+ vdd_logic: DCDC_REG1 { -+ regulator-name = "vdd_logic"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <900000>; -+ }; -+ }; -+ -+ vdd_gpu: DCDC_REG2 { -+ regulator-name = "vdd_gpu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <900000>; -+ }; -+ }; -+ -+ vcc_ddr: DCDC_REG3 { -+ regulator-name = "vcc_ddr"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ vdd_npu: DCDC_REG4 { -+ regulator-name = "vdd_npu"; -+ regulator-initial-mode = <0x2>; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_1v8: DCDC_REG5 { -+ regulator-name = "vcc_1v8"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdda0v9_image: LDO_REG1 { -+ regulator-name = "vdda0v9_image"; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdda_0v9: LDO_REG2 { -+ regulator-name = "vdda_0v9"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdda0v9_pmu: LDO_REG3 { -+ regulator-name = "vdda0v9_pmu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <900000>; -+ }; -+ }; -+ -+ vccio_acodec: LDO_REG4 { -+ regulator-name = "vccio_acodec"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vccio_sd: LDO_REG5 { -+ regulator-name = "vccio_sd"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc3v3_pmu: LDO_REG6 { -+ regulator-name = "vcc3v3_pmu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ vcca_1v8: LDO_REG7 { -+ regulator-name = "vcca_1v8"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcca1v8_pmu: LDO_REG8 { -+ regulator-name = "vcca1v8_pmu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vcca1v8_image: LDO_REG9 { -+ regulator-name = "vcca1v8_image"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_3v3: SWITCH_REG1 { -+ regulator-name = "vcc_3v3"; -+ regulator-always-on; -+ regulator-boot-on; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc3v3_sd: SWITCH_REG2 { -+ regulator-name = "vcc3v3_sd"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ }; -+ }; -+ -+ eeprom: eeprom@50 { -+ compatible = "belling,bl24c16a", "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; -+}; -+ -+&i2s0_8ch { -+ status = "okay"; -+}; -+ -+&i2s1_8ch { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2s1m0_sclktx &i2s1m0_lrcktx &i2s1m0_sdi0 &i2s1m0_sdo0>; -+ rockchip,trcm-sync-tx-only; -+ status = "okay"; -+}; -+ -+&mdio1 { -+ rgmii_phy1: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <0x1>; -+ reset-assert-us = <20000>; -+ reset-deassert-us = <100000>; -+ reset-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&pcie2x1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pcie_reset_h>; -+ reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; -+ vpcie3v3-supply = <&vcc3v3_pcie>; -+ status = "okay"; -+}; -+ -+&pinctrl { -+ bluetooth { -+ bt_reg_on_h: bt-reg-on-h { -+ rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ bt_wake_host_h: bt-wake-host-h { -+ rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ bt_host_wake_h: bt-host-wake-h { -+ rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ cam { -+ vcc_cam_en: vcc_cam_en { -+ rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ display { -+ vcc_mipi_en: vcc_mipi_en { -+ rockchip,pins = <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ leds { -+ user_led2: user-led2 { -+ rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ pcie { -+ pcie_pwr_en: pcie-pwr-en { -+ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ pcie_reset_h: pcie-reset-h { -+ rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ pmic { -+ pmic_int_l: pmic-int-l { -+ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ usb { -+ vcc5v0_usb30_host_en: vcc5v0-usb30-host-en { -+ rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ vcc5v0_usb_otg_en: vcc5v0-usb-otg-en { -+ rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ wifi { -+ wifi_host_wake_h: wifi-host-wake-h { -+ rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ wifi_reg_on_h: wifi-reg-on-h { -+ rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+}; -+ -+&pmu_io_domains { -+ pmuio1-supply = <&vcc3v3_pmu>; -+ pmuio2-supply = <&vcca1v8_pmu>; -+ vccio1-supply = <&vccio_acodec>; -+ vccio2-supply = <&vcc_1v8>; -+ vccio3-supply = <&vccio_sd>; -+ vccio4-supply = <&vcca1v8_pmu>; -+ vccio5-supply = <&vcc_3v3>; -+ vccio6-supply = <&vcc_3v3>; -+ vccio7-supply = <&vcc_3v3>; -+ status = "okay"; -+}; -+ -+&saradc { -+ vref-supply = <&vcca_1v8>; -+ status = "okay"; -+}; -+ -+&sdhci { -+ bus-width = <8>; -+ max-frequency = <200000000>; -+ mmc-hs200-1_8v; -+ non-removable; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>; -+ vmmc-supply = <&vcc_3v3>; -+ vqmmc-supply = <&vcc_1v8>; -+ status = "okay"; -+}; -+ -+&sdmmc0 { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ disable-wp; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; -+ sd-uhs-sdr50; -+ vmmc-supply = <&vcc3v3_sys>; -+ vqmmc-supply = <&vccio_sd>; -+ status = "okay"; -+}; -+ -+&sdmmc1 { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ cap-sdio-irq; -+ keep-power-in-suspend; -+ mmc-pwrseq = <&sdio_pwrseq>; -+ non-removable; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_clk &sdmmc1_cmd>; -+ sd-uhs-sdr104; -+ vmmc-supply = <&vcc3v3_sys>; -+ vqmmc-supply = <&vcca1v8_pmu>; -+ status = "okay"; -+}; -+ -+&sfc { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ flash@0 { -+ compatible = "jedec,spi-nor"; -+ reg = <0x0>; -+ spi-max-frequency = <104000000>; -+ spi-rx-bus-width = <4>; -+ spi-tx-bus-width = <1>; -+ }; -+}; -+ -+&tsadc { -+ rockchip,hw-tshut-mode = <1>; -+ rockchip,hw-tshut-polarity = <0>; -+ status = "okay"; -+}; -+ -+&uart1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart1m0_ctsn &uart1m0_rtsn &uart1m0_xfer>; -+ status = "okay"; -+}; -+ -+&uart2 { -+ status = "okay"; -+}; -+ -+&usb_host0_ehci { -+ status = "okay"; -+}; -+ -+&usb_host0_ohci { -+ status = "okay"; -+}; -+ -+&usb_host0_xhci { -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ -+&usb_host1_ehci { -+ status = "okay"; -+}; -+ -+&usb_host1_ohci { -+ status = "okay"; -+}; -+ -+&usb_host1_xhci { -+ status = "okay"; -+}; -+ -+&usb2phy0 { -+ status = "okay"; -+}; -+ -+&usb2phy0_host { -+ phy-supply = <&vcc5v0_usb30_host>; -+ status = "okay"; -+}; -+ -+&usb2phy0_otg { -+ phy-supply = <&vcc5v0_usb_otg>; -+ status = "okay"; -+}; -+ -+&usb2phy1 { -+ status = "okay"; -+}; -+ -+&usb2phy1_host { -+ phy-supply = <&vcc5v0_usb30_host>; -+ status = "okay"; -+}; -+ -+&usb2phy1_otg { -+ phy-supply = <&vcc5v0_usb30_host>; -+ status = "okay"; -+}; -+ -+&vop { -+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; -+ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; -+ status = "okay"; -+}; -+ -+&vop_mmu { -+ status = "okay"; -+}; -+ -+&vp0 { -+ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { -+ reg = ; -+ remote-endpoint = <&hdmi_in_vp0>; -+ }; -+}; ---- /dev/null -+++ b/dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3.dtsi -@@ -0,0 +1,531 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+#include -+#include -+#include -+#include "rk3566.dtsi" -+ -+/ { -+ chosen { -+ stdout-path = "serial2:1500000n8"; -+ }; -+ -+ hdmi-con { -+ compatible = "hdmi-connector"; -+ type = "d"; -+ -+ port { -+ hdmi_con_in: endpoint { -+ remote-endpoint = <&hdmi_out_con>; -+ }; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&user_led2>; -+ -+ led-green { -+ color = ; -+ default-state = "on"; -+ function = LED_FUNCTION_HEARTBEAT; -+ gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ }; -+ }; -+ -+ vcc_1v8: regulator-1v8-vcc { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_1v8"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ vin-supply = <&vcc_1v8_p>; -+ }; -+ -+ vcca_1v8: regulator-1v8-vcca { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcca_1v8"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ vin-supply = <&vcc_1v8_p>; -+ }; -+ -+ vcca1v8_image: regulator-1v8-vcca-image { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcca1v8_image"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ vin-supply = <&vcc_1v8_p>; -+ }; -+ -+ vcc_3v3: regulator-3v3-vcc { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_3v3"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc3v3_sys>; -+ }; -+ -+ vcc_sys: regulator-5v0-vcc-sys { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ }; -+}; -+ -+&combphy1 { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&cpu1 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&cpu2 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&cpu3 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&gpio0 { -+ gpio-line-names = -+ /* GPIO0_A0 - A7 */ -+ "", "", "", "", "", "", "", "", -+ /* GPIO0_B0 - B7 */ -+ "", "", "", "", "", "", "", "", -+ /* GPIO0_C0 - C7 */ -+ "", "", "", "", "", "", "", "", -+ /* GPIO0_D0 - D7 */ -+ "pin-10 [GPIO0_D0]", "pin-08 [GPIO0_D1]", "", -+ "", "", "", "", ""; -+}; -+ -+&gpio1 { -+ gpio-line-names = -+ /* GPIO1_A0 - A7 */ -+ "pin-03 [GPIO1_A0]", "pin-05 [GPIO1_A1]", "", -+ "", "pin-37 [GPIO1_A4]", "", -+ "", "", -+ /* GPIO1_B0 - B7 */ -+ "", "", "", "", "", "", "", "", -+ /* GPIO1_C0 - C7 */ -+ "", "", "", "", "", "", "", "", -+ /* GPIO1_D0 - D7 */ -+ "", "", "", "", "", "", "", ""; -+}; -+ -+&gpio2 { -+ gpio-line-names = -+ /* GPIO2_A0 - A7 */ -+ "", "", "", "", "", "", "", "", -+ /* GPIO2_B0 - B7 */ -+ "", "", "", "", "", "", "", "", -+ /* GPIO2_C0 - C7 */ -+ "", "", "", "", "", "", "", "", -+ /* GPIO2_D0 - D7 */ -+ "", "", "", "", "", "", "", ""; -+}; -+ -+&gpio3 { -+ gpio-line-names = -+ /* GPIO3_A0 - A7 */ -+ "", "pin-11 [GPIO3_A1]", "pin-13 [GPIO3_A2]", -+ "pin-12 [GPIO3_A3]", "pin-35 [GPIO3_A4]", "pin-40 [GPIO3_A5]", -+ "pin-38 [GPIO3_A6]", "pin-36 [GPIO3_A7]", -+ /* GPIO3_B0 - B7 */ -+ "pin-15 [GPIO3_B0]", "pin-16 [GPIO3_B1]", "pin-18 [GPIO3_B2]", -+ "pin-29 [GPIO3_B3]", "pin-31 [GPIO3_B4]", "", -+ "", "", -+ /* GPIO3_C0 - C7 */ -+ "", "pin-22 [GPIO3_C1]", "pin-32 [GPIO3_C2]", -+ "pin-33 [GPIO3_C3]", "pin-07 [GPIO3_C4]", "", -+ "", "", -+ /* GPIO3_D0 - D7 */ -+ "", "", "", "", "", "", "", ""; -+}; -+ -+&gpio4 { -+ gpio-line-names = -+ /* GPIO4_A0 - A7 */ -+ "", "", "", "", "", "", "", "", -+ /* GPIO4_B0 - B7 */ -+ "", "", "pin-27 [GPIO4_B2]", -+ "pin-28 [GPIO4_B3]", "", "", "", "", -+ /* GPIO4_C0 - C7 */ -+ "", "", "pin-23 [GPIO4_C2]", -+ "pin-19 [GPIO4_C3]", "", "pin-21 [GPIO4_C5]", -+ "pin-24 [GPIO4_C6]", "", -+ /* GPIO4_D0 - D7 */ -+ "", "", "", "", "", "", "", ""; -+}; -+ -+&gpu { -+ mali-supply = <&vdd_gpu_npu>; -+ status = "okay"; -+}; -+ -+&hdmi { -+ avdd-0v9-supply = <&vdda_0v9>; -+ avdd-1v8-supply = <&vcca1v8_image>; -+ status = "okay"; -+}; -+ -+&hdmi_in { -+ hdmi_in_vp0: endpoint { -+ remote-endpoint = <&vp0_out_hdmi>; -+ }; -+}; -+ -+&hdmi_out { -+ hdmi_out_con: endpoint { -+ remote-endpoint = <&hdmi_con_in>; -+ }; -+}; -+ -+&hdmi_sound { -+ status = "okay"; -+}; -+ -+&i2c0 { -+ status = "okay"; -+ -+ rk817: pmic@20 { -+ compatible = "rockchip,rk817"; -+ reg = <0x20>; -+ #clock-cells = <1>; -+ clock-output-names = "rk817-clkout1", "rk817-clkout2"; -+ interrupt-parent = <&gpio0>; -+ interrupts = ; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pmic_int_l>; -+ system-power-controller; -+ wakeup-source; -+ -+ vcc1-supply = <&vcc_sys>; -+ vcc2-supply = <&vcc_sys>; -+ vcc3-supply = <&vcc_sys>; -+ vcc4-supply = <&vcc_sys>; -+ vcc5-supply = <&vcc_sys>; -+ vcc6-supply = <&vcc_sys>; -+ vcc7-supply = <&vcc_sys>; -+ vcc8-supply = <&vcc_sys>; -+ vcc9-supply = <&vcc5v_midu>; -+ -+ regulators { -+ vdd_logic: DCDC_REG1 { -+ regulator-name = "vdd_logic"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <900000>; -+ }; -+ }; -+ -+ vdd_gpu_npu: DCDC_REG2 { -+ regulator-name = "vdd_gpu_npu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_ddr: DCDC_REG3 { -+ regulator-name = "vcc_ddr"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ vcc3v3_sys: DCDC_REG4 { -+ regulator-name = "vcc3v3_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ vcca1v8_pmu: LDO_REG1 { -+ regulator-name = "vcca1v8_pmu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vdda_0v9: LDO_REG2 { -+ regulator-name = "vdda_0v9"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdda0v9_pmu: LDO_REG3 { -+ regulator-name = "vdda0v9_pmu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <900000>; -+ }; -+ }; -+ -+ vccio_acodec: LDO_REG4 { -+ regulator-name = "vccio_acodec"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vccio_sd: LDO_REG5 { -+ regulator-name = "vccio_sd"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc3v3_pmu: LDO_REG6 { -+ regulator-name = "vcc3v3_pmu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ vcc_1v8_p: LDO_REG7 { -+ regulator-name = "vcc_1v8_p"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc1v8_dvp: LDO_REG8 { -+ regulator-name = "vcc1v8_dvp"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc2v8_dvp: LDO_REG9 { -+ regulator-name = "vcc2v8_dvp"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc5v_midu: BOOST { -+ regulator-name = "vcc5v_midu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vbus: OTG_SWITCH { -+ regulator-name = "vbus"; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ }; -+ }; -+ -+ vdd_cpu: regulator@40 { -+ compatible = "rockchip,rk8600"; -+ reg = <0x40>; -+ fcs,suspend-voltage-selector = <1>; -+ regulator-name = "vdd_cpu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <712500>; -+ regulator-max-microvolt = <1390000>; -+ regulator-ramp-delay = <2300>; -+ vin-supply = <&vcc_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+}; -+ -+&i2s0_8ch { -+ status = "okay"; -+}; -+ -+&pinctrl { -+ leds { -+ user_led2: user-led2 { -+ rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ pmic { -+ pmic_int_l: pmic-int-l { -+ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+}; -+ -+&pmu_io_domains { -+ pmuio1-supply = <&vcc3v3_pmu>; -+ pmuio2-supply = <&vcca1v8_pmu>; -+ vccio1-supply = <&vccio_acodec>; -+ vccio2-supply = <&vcc_1v8>; -+ vccio3-supply = <&vccio_sd>; -+ vccio4-supply = <&vcc_1v8>; -+ vccio5-supply = <&vcc_3v3>; -+ vccio6-supply = <&vcc_3v3>; -+ vccio7-supply = <&vcc_3v3>; -+ status = "okay"; -+}; -+ -+&saradc { -+ vref-supply = <&vcca_1v8>; -+ status = "okay"; -+}; -+ -+&sdmmc0 { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ disable-wp; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; -+ vmmc-supply = <&vcc3v3_sys>; -+ vqmmc-supply = <&vccio_sd>; -+ status = "okay"; -+}; -+ -+&tsadc { -+ rockchip,hw-tshut-mode = <1>; -+ rockchip,hw-tshut-polarity = <0>; -+ status = "okay"; -+}; -+ -+&uart2 { -+ status = "okay"; -+}; -+ -+&usb_host0_xhci { -+ dr_mode = "peripheral"; -+ status = "okay"; -+}; -+ -+&usb_host1_xhci { -+ status = "okay"; -+}; -+ -+&usb2phy0 { -+ status = "okay"; -+}; -+ -+&usb2phy0_host { -+ status = "okay"; -+}; -+ -+&usb2phy0_otg { -+ status = "okay"; -+}; -+ -+&vop { -+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; -+ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; -+ status = "okay"; -+}; -+ -+&vop_mmu { -+ status = "okay"; -+}; -+ -+&vp0 { -+ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { -+ reg = ; -+ remote-endpoint = <&hdmi_in_vp0>; -+ }; -+}; ---- /dev/null -+++ b/dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3e.dts -@@ -0,0 +1,52 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/dts-v1/; -+ -+#include "rk3566-radxa-zero-3.dtsi" -+ -+/ { -+ model = "Radxa ZERO 3E"; -+ compatible = "radxa,zero-3e", "rockchip,rk3566"; -+ -+ aliases { -+ ethernet0 = &gmac1; -+ mmc0 = &sdmmc0; -+ }; -+}; -+ -+&gmac1 { -+ assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>; -+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>; -+ clock_in_out = "input"; -+ phy-handle = <&rgmii_phy1>; -+ phy-mode = "rgmii-id"; -+ phy-supply = <&vcc_3v3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac1m1_miim -+ &gmac1m1_tx_bus2 -+ &gmac1m1_rx_bus2 -+ &gmac1m1_rgmii_clk -+ &gmac1m1_rgmii_bus -+ &gmac1m1_clkinout>; -+ status = "okay"; -+}; -+ -+&mdio1 { -+ rgmii_phy1: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac1_rstn>; -+ reset-assert-us = <20000>; -+ reset-deassert-us = <50000>; -+ reset-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&pinctrl { -+ gmac1 { -+ gmac1_rstn: gmac1-rstn { -+ rockchip,pins = <3 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+}; ---- /dev/null -+++ b/dts/upstream/src/arm64/rockchip/rk3566-radxa-zero-3w.dts -@@ -0,0 +1,92 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/dts-v1/; -+ -+#include "rk3566-radxa-zero-3.dtsi" -+ -+/ { -+ model = "Radxa ZERO 3W"; -+ compatible = "radxa,zero-3w", "rockchip,rk3566"; -+ -+ aliases { -+ mmc0 = &sdhci; -+ mmc1 = &sdmmc0; -+ mmc2 = &sdmmc1; -+ }; -+ -+ sdio_pwrseq: sdio-pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ clocks = <&rk817 1>; -+ clock-names = "ext_clock"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&wifi_reg_on_h>; -+ post-power-on-delay-ms = <100>; -+ power-off-delay-us = <5000000>; -+ reset-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&pinctrl { -+ bluetooth { -+ bt_reg_on_h: bt-reg-on-h { -+ rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ bt_wake_host_h: bt-wake-host-h { -+ rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ host_wake_bt_h: host-wake-bt-h { -+ rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ wifi { -+ wifi_reg_on_h: wifi-reg-on-h { -+ rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ wifi_wake_host_h: wifi-wake-host-h { -+ rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+}; -+ -+&sdhci { -+ bus-width = <8>; -+ cap-mmc-highspeed; -+ max-frequency = <200000000>; -+ mmc-hs200-1_8v; -+ no-sd; -+ no-sdio; -+ non-removable; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>; -+ vmmc-supply = <&vcc_3v3>; -+ vqmmc-supply = <&vcc_1v8>; -+ status = "okay"; -+}; -+ -+&sdmmc1 { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ cap-sdio-irq; -+ keep-power-in-suspend; -+ mmc-pwrseq = <&sdio_pwrseq>; -+ no-mmc; -+ no-sd; -+ non-removable; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_clk &sdmmc1_cmd>; -+ sd-uhs-sdr104; -+ vmmc-supply = <&vcc_3v3>; -+ vqmmc-supply = <&vcc_1v8>; -+ status = "okay"; -+}; -+ -+&uart1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>; -+ uart-has-rtscts; -+ status = "okay"; -+}; ---- /dev/null -+++ b/dts/upstream/src/arm64/rockchip/rk3568-rock-3b.dts -@@ -0,0 +1,781 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/dts-v1/; -+ -+#include -+#include -+#include -+#include -+#include "rk3568.dtsi" -+ -+/ { -+ model = "Radxa ROCK 3B"; -+ compatible = "radxa,rock-3b", "rockchip,rk3568"; -+ -+ aliases { -+ ethernet0 = &gmac0; -+ ethernet1 = &gmac1; -+ mmc0 = &sdhci; -+ mmc1 = &sdmmc0; -+ mmc2 = &sdmmc2; -+ }; -+ -+ chosen { -+ stdout-path = "serial2:1500000n8"; -+ }; -+ -+ hdmi-con { -+ compatible = "hdmi-connector"; -+ type = "a"; -+ -+ port { -+ hdmi_con_in: endpoint { -+ remote-endpoint = <&hdmi_out_con>; -+ }; -+ }; -+ }; -+ -+ ir-receiver { -+ compatible = "gpio-ir-receiver"; -+ gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_LOW>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm3_ir>; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led>; -+ -+ led-0 { -+ color = ; -+ default-state = "on"; -+ function = LED_FUNCTION_HEARTBEAT; -+ gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ }; -+ }; -+ -+ /* pi6c pcie clock generator */ -+ vcc3v3_pi6c_03: regulator-3v3-vcc-pi6c-03 { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pcie_pwren_h>; -+ regulator-name = "vcc3v3_pi6c_03"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ startup-delay-us = <10000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc3v3_sys: regulator-3v3-vcc-sys { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc3v3_sys2: regulator-3v3-vcc-sys2 { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3_sys2"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc5v0_sys: regulator-5v0-vcc-sys { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc5v0_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ }; -+ -+ vcc5v0_usb_host: regulator-5v0-vcc-usb-host { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb_host_pwren_h>; -+ regulator-name = "vcc5v0_usb_host"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc5v0_usb_otg: regulator-5v0-vcc-usb-otg { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb_otg_pwren_h>; -+ regulator-name = "vcc5v0_usb_otg"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ sdio_pwrseq: sdio-pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ clocks = <&rk809 1>; -+ clock-names = "ext_clock"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&wifi_reg_on_h>; -+ post-power-on-delay-ms = <100>; -+ power-off-delay-us = <5000000>; -+ reset-gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_LOW>; -+ }; -+ -+ sound { -+ compatible = "simple-audio-card"; -+ simple-audio-card,format = "i2s"; -+ simple-audio-card,name = "Analog RK809"; -+ simple-audio-card,mclk-fs = <256>; -+ -+ simple-audio-card,cpu { -+ sound-dai = <&i2s1_8ch>; -+ }; -+ -+ simple-audio-card,codec { -+ sound-dai = <&rk809>; -+ }; -+ }; -+}; -+ -+&combphy0 { -+ status = "okay"; -+}; -+ -+&combphy1 { -+ status = "okay"; -+}; -+ -+&combphy2 { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&cpu1 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&cpu2 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&cpu3 { -+ cpu-supply = <&vdd_cpu>; -+}; -+ -+&gmac0 { -+ assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>; -+ assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>; -+ clock_in_out = "input"; -+ phy-handle = <&rgmii_phy0>; -+ phy-mode = "rgmii-id"; -+ phy-supply = <&vcc_3v3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac0_miim -+ &gmac0_tx_bus2 -+ &gmac0_rx_bus2 -+ &gmac0_rgmii_clk -+ &gmac0_rgmii_bus -+ &gmac0_clkinout>; -+ status = "okay"; -+}; -+ -+&gmac1 { -+ assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>; -+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>; -+ clock_in_out = "input"; -+ phy-handle = <&rgmii_phy1>; -+ phy-mode = "rgmii-id"; -+ phy-supply = <&vcc_3v3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac1m1_miim -+ &gmac1m1_tx_bus2 -+ &gmac1m1_rx_bus2 -+ &gmac1m1_rgmii_clk -+ &gmac1m1_rgmii_bus -+ &gmac1m1_clkinout>; -+ status = "okay"; -+}; -+ -+&gpu { -+ mali-supply = <&vdd_gpu>; -+ status = "okay"; -+}; -+ -+&hdmi { -+ avdd-0v9-supply = <&vdda0v9_image>; -+ avdd-1v8-supply = <&vcca1v8_image>; -+ status = "okay"; -+}; -+ -+&hdmi_in { -+ hdmi_in_vp0: endpoint { -+ remote-endpoint = <&vp0_out_hdmi>; -+ }; -+}; -+ -+&hdmi_out { -+ hdmi_out_con: endpoint { -+ remote-endpoint = <&hdmi_con_in>; -+ }; -+}; -+ -+&hdmi_sound { -+ status = "okay"; -+}; -+ -+&i2c0 { -+ status = "okay"; -+ -+ vdd_cpu: regulator@1c { -+ compatible = "tcs,tcs4525"; -+ reg = <0x1c>; -+ fcs,suspend-voltage-selector = <1>; -+ regulator-name = "vdd_cpu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <800000>; -+ regulator-max-microvolt = <1150000>; -+ regulator-ramp-delay = <2300>; -+ vin-supply = <&vcc5v0_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ rk809: pmic@20 { -+ compatible = "rockchip,rk809"; -+ reg = <0x20>; -+ assigned-clocks = <&cru I2S1_MCLKOUT_TX>; -+ assigned-clock-parents = <&cru CLK_I2S1_8CH_TX>; -+ #clock-cells = <1>; -+ clocks = <&cru I2S1_MCLKOUT_TX>; -+ clock-names = "mclk"; -+ clock-output-names = "rk809-clkout1", "rk809-clkout2"; -+ interrupt-parent = <&gpio0>; -+ interrupts = ; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pmic_int_l>, <&i2s1m0_mclk>; -+ #sound-dai-cells = <0>; -+ system-power-controller; -+ wakeup-source; -+ -+ vcc1-supply = <&vcc3v3_sys>; -+ vcc2-supply = <&vcc3v3_sys>; -+ vcc3-supply = <&vcc3v3_sys>; -+ vcc4-supply = <&vcc3v3_sys>; -+ vcc5-supply = <&vcc3v3_sys>; -+ vcc6-supply = <&vcc3v3_sys>; -+ vcc7-supply = <&vcc3v3_sys>; -+ vcc8-supply = <&vcc3v3_sys>; -+ vcc9-supply = <&vcc3v3_sys>; -+ -+ regulators { -+ vdd_logic: DCDC_REG1 { -+ regulator-name = "vdd_logic"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_gpu: DCDC_REG2 { -+ regulator-name = "vdd_gpu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_ddr: DCDC_REG3 { -+ regulator-name = "vcc_ddr"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-initial-mode = <0x2>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ vdd_npu: DCDC_REG4 { -+ regulator-name = "vdd_npu"; -+ regulator-initial-mode = <0x2>; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_1v8: DCDC_REG5 { -+ regulator-name = "vcc_1v8"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdda0v9_image: LDO_REG1 { -+ regulator-name = "vdda0v9_image"; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdda_0v9: LDO_REG2 { -+ regulator-name = "vdda_0v9"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdda0v9_pmu: LDO_REG3 { -+ regulator-name = "vdda0v9_pmu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <900000>; -+ }; -+ }; -+ -+ vccio_acodec: LDO_REG4 { -+ regulator-name = "vccio_acodec"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vccio_sd: LDO_REG5 { -+ regulator-name = "vccio_sd"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc3v3_pmu: LDO_REG6 { -+ regulator-name = "vcc3v3_pmu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ vcca_1v8: LDO_REG7 { -+ regulator-name = "vcca_1v8"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcca1v8_pmu: LDO_REG8 { -+ regulator-name = "vcca1v8_pmu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vcca1v8_image: LDO_REG9 { -+ regulator-name = "vcca1v8_image"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_3v3: SWITCH_REG1 { -+ regulator-name = "vcc_3v3"; -+ regulator-always-on; -+ regulator-boot-on; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc3v3_sd: SWITCH_REG2 { -+ regulator-name = "vcc3v3_sd"; -+ regulator-always-on; -+ regulator-boot-on; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ }; -+ }; -+}; -+ -+&i2c5 { -+ status = "okay"; -+ -+ hym8563: rtc@51 { -+ compatible = "haoyu,hym8563"; -+ reg = <0x51>; -+ interrupt-parent = <&gpio0>; -+ interrupts = ; -+ #clock-cells = <0>; -+ clock-output-names = "rtcic_32kout"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&rtcic_int_l>; -+ wakeup-source; -+ }; -+}; -+ -+&i2s0_8ch { -+ status = "okay"; -+}; -+ -+&i2s1_8ch { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2s1m0_sclktx -+ &i2s1m0_lrcktx -+ &i2s1m0_sdi0 -+ &i2s1m0_sdo0>; -+ rockchip,trcm-sync-tx-only; -+ status = "okay"; -+}; -+ -+&mdio0 { -+ rgmii_phy0: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ reset-assert-us = <20000>; -+ reset-deassert-us = <50000>; -+ reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&mdio1 { -+ rgmii_phy1: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ reset-assert-us = <20000>; -+ reset-deassert-us = <50000>; -+ reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&pcie2x1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pcie20m1_pins>; -+ reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>; -+ vpcie3v3-supply = <&vcc3v3_sys2>; -+ status = "okay"; -+}; -+ -+&pcie30phy { -+ status = "okay"; -+}; -+ -+&pcie3x2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pcie30x2m1_pins>; -+ reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+&pinctrl { -+ bluetooth { -+ bt_reg_on_h: bt-reg-on-h { -+ rockchip,pins = <4 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ bt_wake_host_h: bt-wake-host-h { -+ rockchip,pins = <4 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ host_wake_bt_h: host-wake-bt-h { -+ rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ ir-receiver { -+ pwm3_ir: pwm3-ir { -+ rockchip,pins = <0 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ leds { -+ led: led { -+ rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ pcie { -+ pcie_pwren_h: pcie-pwren-h { -+ rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ pcie20 { -+ pcie20m1_pins: pcie20m1-pins { -+ rockchip,pins = -+ <2 RK_PD0 4 &pcfg_pull_none>, -+ <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>, -+ <2 RK_PD1 4 &pcfg_pull_none>; -+ }; -+ }; -+ -+ pcie30x2 { -+ pcie30x2m1_pins: pcie30x2m1-pins { -+ rockchip,pins = -+ <2 RK_PD4 4 &pcfg_pull_none>, -+ <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>, -+ <2 RK_PD5 4 &pcfg_pull_none>; -+ }; -+ }; -+ -+ pmic { -+ pmic_int_l: pmic-int-l { -+ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ rtc { -+ rtcic_int_l: rtcic-int-l { -+ rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ usb { -+ usb_host_pwren_h: usb-host-pwren-h { -+ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ usb_otg_pwren_h: usb-otg-pwren-h { -+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ wifi { -+ wifi_reg_on_h: wifi-reg-on-h { -+ rockchip,pins = <3 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ wifi_wake_host_h: wifi-wake-host-h { -+ rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+}; -+ -+&pmu_io_domains { -+ pmuio1-supply = <&vcc3v3_pmu>; -+ pmuio2-supply = <&vcc3v3_pmu>; -+ vccio1-supply = <&vccio_acodec>; -+ vccio2-supply = <&vcc_1v8>; -+ vccio3-supply = <&vccio_sd>; -+ vccio4-supply = <&vcc_1v8>; -+ vccio5-supply = <&vcc_3v3>; -+ vccio6-supply = <&vcc_1v8>; -+ vccio7-supply = <&vcc_3v3>; -+ status = "okay"; -+}; -+ -+&saradc { -+ vref-supply = <&vcca_1v8>; -+ status = "okay"; -+}; -+ -+&sdhci { -+ bus-width = <8>; -+ cap-mmc-highspeed; -+ max-frequency = <200000000>; -+ mmc-hs200-1_8v; -+ non-removable; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>; -+ vmmc-supply = <&vcc_3v3>; -+ vqmmc-supply = <&vcc_1v8>; -+ status = "okay"; -+}; -+ -+&sdmmc0 { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ disable-wp; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; -+ vmmc-supply = <&vcc3v3_sd>; -+ vqmmc-supply = <&vccio_sd>; -+ status = "okay"; -+}; -+ -+&sdmmc2 { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ cap-sdio-irq; -+ keep-power-in-suspend; -+ mmc-pwrseq = <&sdio_pwrseq>; -+ non-removable; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc2m0_bus4 &sdmmc2m0_clk &sdmmc2m0_cmd>; -+ sd-uhs-sdr104; -+ vmmc-supply = <&vcc3v3_sys2>; -+ vqmmc-supply = <&vcc_1v8>; -+ status = "disabled"; -+}; -+ -+&sfc { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ flash@0 { -+ compatible = "jedec,spi-nor"; -+ reg = <0>; -+ spi-max-frequency = <104000000>; -+ spi-rx-bus-width = <4>; -+ spi-tx-bus-width = <1>; -+ }; -+}; -+ -+&tsadc { -+ rockchip,hw-tshut-mode = <1>; -+ rockchip,hw-tshut-polarity = <0>; -+ status = "okay"; -+}; -+ -+&uart2 { -+ status = "okay"; -+}; -+ -+&uart8 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart8m0_xfer &uart8m0_ctsn &uart8m0_rtsn>; -+ uart-has-rtscts; -+ status = "disabled"; -+}; -+ -+&usb_host0_ehci { -+ status = "okay"; -+}; -+ -+&usb_host0_ohci { -+ status = "okay"; -+}; -+ -+&usb_host0_xhci { -+ extcon = <&usb2phy0>; -+ status = "okay"; -+}; -+ -+&usb_host1_xhci { -+ status = "okay"; -+}; -+ -+&usb2phy0 { -+ status = "okay"; -+}; -+ -+&usb2phy0_host { -+ phy-supply = <&vcc5v0_usb_host>; -+ status = "okay"; -+}; -+ -+&usb2phy0_otg { -+ phy-supply = <&vcc5v0_usb_otg>; -+ status = "okay"; -+}; -+ -+&usb2phy1 { -+ status = "okay"; -+}; -+ -+&usb2phy1_otg { -+ phy-supply = <&vcc5v0_usb_host>; -+ status = "okay"; -+}; -+ -+&vop { -+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; -+ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; -+ status = "okay"; -+}; -+ -+&vop_mmu { -+ status = "okay"; -+}; -+ -+&vp0 { -+ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { -+ reg = ; -+ remote-endpoint = <&hdmi_in_vp0>; -+ }; -+}; diff --git a/package/boot/uboot-rockchip/patches/001-v2024.10-rc3-rockchip-add-support-for-Radxa-ROCK-Pi-E-v3.0.patch b/package/boot/uboot-rockchip/patches/001-v2024.10-rc3-rockchip-add-support-for-Radxa-ROCK-Pi-E-v3.0.patch deleted file mode 100644 index 515e07c3f87b8a..00000000000000 --- a/package/boot/uboot-rockchip/patches/001-v2024.10-rc3-rockchip-add-support-for-Radxa-ROCK-Pi-E-v3.0.patch +++ /dev/null @@ -1,248 +0,0 @@ -From 8ca5e0e4d6ed084d2321584e8cdc8105c60b9aa1 Mon Sep 17 00:00:00 2001 -From: FUKAUMI Naoki -Date: Tue, 25 Jun 2024 05:45:29 +0900 -Subject: [PATCH] rockchip: add support for Radxa ROCK Pi E v3.0 - -ROCK Pi E v3.0 uses DDR4 SDRAM instead of DDR3 SDRAM used in v1.2x. - -prepare new rk3328-rock-pi-e-v3.dts in u-boot which just includes -upstream rk3328-rock-pi-e.dts. - -defconfig still uses - CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-rock-pi-e.dtb" - -because v3.0 and prior are compatible. - -Suggested-by: Jonas Karlman -Signed-off-by: FUKAUMI Naoki -Reviewed-by: Kever Yang ---- - ...dtsi => rk3328-rock-pi-e-base-u-boot.dtsi} | 1 - - arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi | 47 +-------- - arch/arm/dts/rk3328-rock-pi-e-v3-u-boot.dtsi | 4 + - arch/arm/dts/rk3328-rock-pi-e-v3.dts | 4 + - board/rockchip/evb_rk3328/MAINTAINERS | 4 +- - configs/rock-pi-e-v3-rk3328_defconfig | 97 +++++++++++++++++++ - 6 files changed, 111 insertions(+), 46 deletions(-) - copy arch/arm/dts/{rk3328-rock-pi-e-u-boot.dtsi => rk3328-rock-pi-e-base-u-boot.dtsi} (94%) - rewrite arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi (88%) - create mode 100644 arch/arm/dts/rk3328-rock-pi-e-v3-u-boot.dtsi - create mode 100644 arch/arm/dts/rk3328-rock-pi-e-v3.dts - create mode 100644 configs/rock-pi-e-v3-rk3328_defconfig - ---- a/arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi -+++ b/arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi -@@ -1,43 +1,4 @@ - // SPDX-License-Identifier: GPL-2.0+ --/* -- * (C) Copyright 2020 Radxa -- */ - --#include "rk3328-u-boot.dtsi" -+#include "rk3328-rock-pi-e-base-u-boot.dtsi" - #include "rk3328-sdram-ddr3-666.dtsi" -- --/ { -- smbios { -- compatible = "u-boot,sysinfo-smbios"; -- -- smbios { -- system { -- manufacturer = "radxa"; -- product = "rock-pi-e_rk3328"; -- }; -- -- baseboard { -- manufacturer = "radxa"; -- product = "rock-pi-e_rk3328"; -- }; -- -- chassis { -- manufacturer = "radxa"; -- product = "rock-pi-e_rk3328"; -- }; -- }; -- }; --}; -- --&u2phy_host { -- phy-supply = <&vcc_host_5v>; --}; -- --&vcc_host_5v { -- /delete-property/ regulator-always-on; -- /delete-property/ regulator-boot-on; --}; -- --&vcc_sd { -- bootph-pre-ram; --}; ---- /dev/null -+++ b/arch/arm/dts/rk3328-rock-pi-e-base-u-boot.dtsi -@@ -0,0 +1,42 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+/* -+ * (C) Copyright 2020 Radxa -+ */ -+ -+#include "rk3328-u-boot.dtsi" -+ -+/ { -+ smbios { -+ compatible = "u-boot,sysinfo-smbios"; -+ -+ smbios { -+ system { -+ manufacturer = "radxa"; -+ product = "rock-pi-e_rk3328"; -+ }; -+ -+ baseboard { -+ manufacturer = "radxa"; -+ product = "rock-pi-e_rk3328"; -+ }; -+ -+ chassis { -+ manufacturer = "radxa"; -+ product = "rock-pi-e_rk3328"; -+ }; -+ }; -+ }; -+}; -+ -+&u2phy_host { -+ phy-supply = <&vcc_host_5v>; -+}; -+ -+&vcc_host_5v { -+ /delete-property/ regulator-always-on; -+ /delete-property/ regulator-boot-on; -+}; -+ -+&vcc_sd { -+ bootph-pre-ram; -+}; ---- /dev/null -+++ b/arch/arm/dts/rk3328-rock-pi-e-v3-u-boot.dtsi -@@ -0,0 +1,4 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+ -+#include "rk3328-rock-pi-e-base-u-boot.dtsi" -+#include "rk3328-sdram-ddr4-666.dtsi" ---- /dev/null -+++ b/arch/arm/dts/rk3328-rock-pi-e-v3.dts -@@ -0,0 +1,4 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/dts-v1/; -+#include "rk3328-rock-pi-e.dts" ---- a/board/rockchip/evb_rk3328/MAINTAINERS -+++ b/board/rockchip/evb_rk3328/MAINTAINERS -@@ -64,5 +64,5 @@ M: Banglang Huang - S: Maintained - F: configs/rock-pi-e-rk3328_defconfig --F: arch/arm/dts/rk3328-rock-pi-e.dts --F: arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi -+F: configs/rock-pi-e-v3-rk3328_defconfig -+F: arch/arm/dts/rk3328-rock-pi-e* ---- /dev/null -+++ b/configs/rock-pi-e-v3-rk3328_defconfig -@@ -0,0 +1,97 @@ -+CONFIG_ARM=y -+CONFIG_SKIP_LOWLEVEL_INIT=y -+CONFIG_COUNTER_FREQUENCY=24000000 -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_SPL_GPIO=y -+CONFIG_NR_DRAM_BANKS=1 -+CONFIG_SF_DEFAULT_SPEED=20000000 -+CONFIG_ENV_OFFSET=0x3F8000 -+CONFIG_DEFAULT_DEVICE_TREE="rk3328-rock-pi-e-v3" -+CONFIG_DM_RESET=y -+CONFIG_ROCKCHIP_RK3328=y -+CONFIG_DEBUG_UART_BASE=0xFF130000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SYS_LOAD_ADDR=0x800800 -+CONFIG_DEBUG_UART=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_SPL_FIT_SIGNATURE=y -+CONFIG_SPL_LOAD_FIT=y -+CONFIG_LEGACY_IMAGE_FORMAT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-rock-pi-e.dtb" -+# CONFIG_DISPLAY_CPUINFO is not set -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_SPL_MAX_SIZE=0x40000 -+CONFIG_SPL_PAD_TO=0x7f8000 -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_SPL_POWER=y -+CONFIG_SPL_ATF=y -+CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_USB=y -+CONFIG_CMD_TIME=y -+CONFIG_CMD_REGULATOR=y -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_TPL_OF_CONTROL=y -+# CONFIG_OF_UPSTREAM is not set -+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_TPL_OF_PLATDATA=y -+CONFIG_ENV_IS_IN_MMC=y -+CONFIG_SYS_RELOC_GD_ENV_ADDR=y -+CONFIG_SYS_MMC_ENV_DEV=1 -+CONFIG_TPL_DM=y -+CONFIG_SPL_DM_SEQ_ALIAS=y -+CONFIG_REGMAP=y -+CONFIG_SPL_REGMAP=y -+CONFIG_TPL_REGMAP=y -+CONFIG_SYSCON=y -+CONFIG_SPL_SYSCON=y -+CONFIG_TPL_SYSCON=y -+CONFIG_CLK=y -+CONFIG_SPL_CLK=y -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_PHY_REALTEK=y -+CONFIG_DM_MDIO=y -+CONFIG_DM_ETH_PHY=y -+CONFIG_PHY_GIGE=y -+CONFIG_ETH_DESIGNWARE=y -+CONFIG_GMAC_ROCKCHIP=y -+CONFIG_PHY_ROCKCHIP_INNO_USB2=y -+CONFIG_PINCTRL=y -+CONFIG_SPL_PINCTRL=y -+CONFIG_DM_PMIC=y -+CONFIG_PMIC_RK8XX=y -+CONFIG_SPL_DM_REGULATOR=y -+CONFIG_DM_REGULATOR_FIXED=y -+CONFIG_SPL_DM_REGULATOR_FIXED=y -+CONFIG_REGULATOR_RK8XX=y -+CONFIG_PWM_ROCKCHIP=y -+CONFIG_RAM=y -+CONFIG_SPL_RAM=y -+CONFIG_TPL_RAM=y -+CONFIG_DM_RNG=y -+CONFIG_RNG_ROCKCHIP=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_SYS_NS16550_MEM32=y -+CONFIG_SYSINFO=y -+CONFIG_SYSINFO_SMBIOS=y -+CONFIG_SYSRESET=y -+# CONFIG_TPL_SYSRESET is not set -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_OHCI_HCD=y -+CONFIG_USB_OHCI_GENERIC=y -+CONFIG_USB_DWC3=y -+CONFIG_USB_DWC3_GENERIC=y -+CONFIG_SPL_TINY_MEMSET=y -+CONFIG_TPL_TINY_MEMSET=y -+CONFIG_ERRNO_STR=y diff --git a/package/boot/uboot-rockchip/patches/002-v2024.10-rc3-board-rockchip-add-Radxa-ROCK-3-Model-C.patch b/package/boot/uboot-rockchip/patches/002-v2024.10-rc3-board-rockchip-add-Radxa-ROCK-3-Model-C.patch deleted file mode 100644 index 22ced545fee379..00000000000000 --- a/package/boot/uboot-rockchip/patches/002-v2024.10-rc3-board-rockchip-add-Radxa-ROCK-3-Model-C.patch +++ /dev/null @@ -1,178 +0,0 @@ -From e6e82ce24d4e9d20c232db2a95b2d10faf8f2bcf Mon Sep 17 00:00:00 2001 -From: Maxim Moskalets -Date: Thu, 8 Aug 2024 22:37:10 +0300 -Subject: [PATCH] board: rockchip: add Radxa ROCK 3 Model C - -Based on rock-3a-rk3568_defconfig. -Tested on v1.31 revision. - -Board Specifications: -- Rockchip RK3566 -- 1/2/4GB LPDDR4 2112MT/s -- eMMC socket -- uSD card slot -- M.2 2230 Connector -- GbE LAN with POE -- 3.5mm jack with mic -- HDMI 2.0, MIPI DSI/CSI -- USB 3.0 Host, USB 2.0 Host/OTG -- 40-pin GPIO expansion ports - -Signed-off-by: Maxim Moskalets -Suggested-by: Jonas Karlman -Reviewed-by: Jonas Karlman -Tested-by: FUKAUMI Naoki -Reviewed-by: Kever Yang ---- - arch/arm/dts/rk3566-rock-3c-u-boot.dtsi | 18 +++++ - board/rockchip/evb_rk3568/MAINTAINERS | 7 ++ - configs/rock-3c-rk3566_defconfig | 97 +++++++++++++++++++++++++ - doc/board/rockchip/rockchip.rst | 1 + - 4 files changed, 123 insertions(+) - create mode 100644 arch/arm/dts/rk3566-rock-3c-u-boot.dtsi - create mode 100644 configs/rock-3c-rk3566_defconfig - ---- /dev/null -+++ b/arch/arm/dts/rk3566-rock-3c-u-boot.dtsi -@@ -0,0 +1,18 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+#include "rk356x-u-boot.dtsi" -+ -+&sfc { -+ flash@0 { -+ bootph-pre-ram; -+ bootph-some-ram; -+ }; -+}; -+ -+/ { -+ leds { -+ led-0 { -+ default-state = "on"; -+ }; -+ }; -+}; ---- a/board/rockchip/evb_rk3568/MAINTAINERS -+++ b/board/rockchip/evb_rk3568/MAINTAINERS -@@ -69,3 +69,10 @@ S: Maintained - F: configs/rock-3a-rk3568_defconfig - F: arch/arm/dts/rk3568-rock-3a.dts - F: arch/arm/dts/rk3568-rock-3a-u-boot.dtsi -+ -+ROCK-3C -+M: Jonas Karlman -+M: Maxim Moskalets -+S: Maintained -+F: arch/arm/dts/rk3566-rock-3c-u-boot.dtsi -+F: configs/rock-3c-rk3566_defconfig ---- /dev/null -+++ b/configs/rock-3c-rk3566_defconfig -@@ -0,0 +1,97 @@ -+CONFIG_ARM=y -+CONFIG_SKIP_LOWLEVEL_INIT=y -+CONFIG_COUNTER_FREQUENCY=24000000 -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_SF_DEFAULT_SPEED=24000000 -+CONFIG_SF_DEFAULT_MODE=0x2000 -+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3566-rock-3c" -+CONFIG_ROCKCHIP_RK3568=y -+CONFIG_ROCKCHIP_SPI_IMAGE=y -+CONFIG_SPL_SERIAL=y -+CONFIG_DEBUG_UART_BASE=0xFE660000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SPL_SPI_FLASH_SUPPORT=y -+CONFIG_SPL_SPI=y -+CONFIG_SYS_LOAD_ADDR=0xc00800 -+CONFIG_PCI=y -+CONFIG_DEBUG_UART=y -+CONFIG_AHCI=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_SPL_FIT_SIGNATURE=y -+CONFIG_SPL_LOAD_FIT=y -+CONFIG_LEGACY_IMAGE_FORMAT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-rock-3c.dtb" -+# CONFIG_DISPLAY_CPUINFO is not set -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_SPL_MAX_SIZE=0x40000 -+CONFIG_SPL_PAD_TO=0x7f8000 -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_SPL_SPI_LOAD=y -+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000 -+CONFIG_SPL_ATF=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_I2C=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_PCI=y -+CONFIG_CMD_POWEROFF=y -+CONFIG_CMD_USB=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_PMIC=y -+CONFIG_CMD_REGULATOR=y -+# CONFIG_SPL_DOS_PARTITION is not set -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_OF_LIVE=y -+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_SYS_RELOC_GD_ENV_ADDR=y -+CONFIG_SPL_DM_SEQ_ALIAS=y -+CONFIG_SPL_REGMAP=y -+CONFIG_SPL_SYSCON=y -+CONFIG_SCSI_AHCI=y -+CONFIG_AHCI_PCI=y -+CONFIG_SPL_CLK=y -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_LED=y -+CONFIG_LED_GPIO=y -+CONFIG_MISC=y -+CONFIG_SUPPORT_EMMC_RPMB=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_SDMA=y -+CONFIG_MMC_SDHCI_ROCKCHIP=y -+CONFIG_SF_DEFAULT_BUS=4 -+CONFIG_SPI_FLASH_SFDP_SUPPORT=y -+CONFIG_SPI_FLASH_GIGADEVICE=y -+CONFIG_SPI_FLASH_MACRONIX=y -+CONFIG_SPI_FLASH_WINBOND=y -+CONFIG_SPI_FLASH_XTX=y -+CONFIG_PHY_REALTEK=y -+CONFIG_DWC_ETH_QOS=y -+CONFIG_DWC_ETH_QOS_ROCKCHIP=y -+CONFIG_NVME_PCI=y -+CONFIG_PCIE_DW_ROCKCHIP=y -+CONFIG_PHY_ROCKCHIP_INNO_USB2=y -+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y -+CONFIG_SPL_PINCTRL=y -+CONFIG_DM_PMIC=y -+CONFIG_PMIC_RK8XX=y -+CONFIG_REGULATOR_RK8XX=y -+CONFIG_SPL_RAM=y -+CONFIG_SCSI=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_SYS_NS16550_MEM32=y -+CONFIG_ROCKCHIP_SFC=y -+CONFIG_SYSRESET=y -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_OHCI_HCD=y -+CONFIG_USB_OHCI_GENERIC=y -+CONFIG_USB_DWC3=y -+CONFIG_USB_DWC3_GENERIC=y -+CONFIG_ERRNO_STR=y ---- a/doc/board/rockchip/rockchip.rst -+++ b/doc/board/rockchip/rockchip.rst -@@ -106,6 +106,7 @@ List of mainline supported Rockchip boar - - Pine64 SOQuartz on Model A (soquartz-model-a-rk3566) - - Powkiddy X55 (powkiddy-x55-rk3566) - - Radxa CM3 IO Board (radxa-cm3-io-rk3566) -+ - Radxa ROCK 3C (rock-3c-rk3566) - - * rk3568 - - Rockchip Evb-RK3568 (evb-rk3568) diff --git a/package/boot/uboot-rockchip/patches/003-v2024.10-rc3-dm-adc-Add-SPL_ADC-Kconfig-symbol-for-use-of-ADC-in-.patch b/package/boot/uboot-rockchip/patches/003-v2024.10-rc3-dm-adc-Add-SPL_ADC-Kconfig-symbol-for-use-of-ADC-in-.patch deleted file mode 100644 index c62c3789806962..00000000000000 --- a/package/boot/uboot-rockchip/patches/003-v2024.10-rc3-dm-adc-Add-SPL_ADC-Kconfig-symbol-for-use-of-ADC-in-.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 232af1e58a977f3857074d3aba3709c860bd8058 Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Fri, 2 Aug 2024 22:12:22 +0000 -Subject: [PATCH] dm: adc: Add SPL_ADC Kconfig symbol for use of ADC in SPL - -What model of Radxa ZERO 3W/3E board can be identified using ADC at -runtime, add a Kconfig symbol to allow use of ADC in SPL. - -This will be used to identify board model in SPL to allow loading -correct FIT configuration and FDT for U-Boot proper at SPL phase. - -Signed-off-by: Jonas Karlman -Reviewed-by: Kever Yang ---- - drivers/Makefile | 2 +- - drivers/adc/Kconfig | 5 +++++ - drivers/adc/Makefile | 2 +- - 3 files changed, 7 insertions(+), 2 deletions(-) - ---- a/drivers/Makefile -+++ b/drivers/Makefile -@@ -1,5 +1,6 @@ - # SPDX-License-Identifier: GPL-2.0+ - -+obj-$(CONFIG_$(SPL_TPL_)ADC) += adc/ - obj-$(CONFIG_$(SPL_TPL_)BIOSEMU) += bios_emulator/ - obj-$(CONFIG_$(SPL_TPL_)BLK) += block/ - obj-$(CONFIG_$(SPL_TPL_)BOOTCOUNT_LIMIT) += bootcount/ -@@ -81,7 +82,6 @@ endif - - ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) - --obj-y += adc/ - obj-y += ata/ - obj-$(CONFIG_DM_DEMO) += demo/ - obj-y += block/ ---- a/drivers/adc/Kconfig -+++ b/drivers/adc/Kconfig -@@ -1,5 +1,6 @@ - config ADC - bool "Enable ADC drivers using Driver Model" -+ depends on DM - help - This enables ADC API for drivers, which allows driving ADC features - by single and multi-channel methods for: -@@ -11,6 +12,10 @@ config ADC - - support supply's phandle with auto-enable - - supply polarity setting in fdt - -+config SPL_ADC -+ bool "Enable ADC drivers using Driver Model in SPL" -+ depends on SPL_DM -+ - config ADC_EXYNOS - bool "Enable Exynos 54xx ADC driver" - depends on ADC ---- a/drivers/adc/Makefile -+++ b/drivers/adc/Makefile -@@ -4,7 +4,7 @@ - # Przemyslaw Marczak - # - --obj-$(CONFIG_ADC) += adc-uclass.o -+obj-$(CONFIG_$(SPL_TPL_)ADC) += adc-uclass.o - obj-$(CONFIG_ADC_EXYNOS) += exynos-adc.o - obj-$(CONFIG_ADC_SANDBOX) += sandbox.o - obj-$(CONFIG_SARADC_ROCKCHIP) += rockchip-saradc.o diff --git a/package/boot/uboot-rockchip/patches/004-v2024.10-rc3-board-rockchip-Add-Radxa-ZERO-3W-3E.patch b/package/boot/uboot-rockchip/patches/004-v2024.10-rc3-board-rockchip-Add-Radxa-ZERO-3W-3E.patch deleted file mode 100644 index cbd69958748fb6..00000000000000 --- a/package/boot/uboot-rockchip/patches/004-v2024.10-rc3-board-rockchip-Add-Radxa-ZERO-3W-3E.patch +++ /dev/null @@ -1,295 +0,0 @@ -From 5d199ad9a6bb43dbf43efe45ec37002c4ae305a0 Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Fri, 2 Aug 2024 22:12:23 +0000 -Subject: [PATCH] board: rockchip: Add Radxa ZERO 3W/3E - -The Radxa ZERO 3W/3E is an ultra-small, high-performance single board -computer based on the Rockchip RK3566, with a compact form factor and -rich interfaces. - -Implement rk_board_late_init() to set correct fdtfile env var and -board_fit_config_name_match() to load correct FIT config based on what -board is detected at runtime so a single board target can be used for -both board models. - -Features tested on a ZERO 3W 8GB v1.11: -- SD-card boot -- eMMC boot -- USB gadget -- USB host - -Features tested on a ZERO 3E 4GB v1.2: -- SD-card boot -- Ethernet -- USB gadget -- USB host - -Signed-off-by: Jonas Karlman -Tested-by: FUKAUMI Naoki -Reviewed-by: Kever Yang ---- - arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi | 15 ++++ - arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi | 15 ++++ - arch/arm/mach-rockchip/rk3568/Kconfig | 6 ++ - board/radxa/zero3-rk3566/Kconfig | 12 +++ - board/radxa/zero3-rk3566/MAINTAINERS | 6 ++ - board/radxa/zero3-rk3566/Makefile | 3 + - board/radxa/zero3-rk3566/zero3-rk3566.c | 59 +++++++++++++ - configs/radxa-zero-3-rk3566_defconfig | 85 +++++++++++++++++++ - doc/board/rockchip/rockchip.rst | 1 + - 9 files changed, 202 insertions(+) - create mode 100644 arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi - create mode 100644 arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi - create mode 100644 board/radxa/zero3-rk3566/Kconfig - create mode 100644 board/radxa/zero3-rk3566/MAINTAINERS - create mode 100644 board/radxa/zero3-rk3566/Makefile - create mode 100644 board/radxa/zero3-rk3566/zero3-rk3566.c - create mode 100644 configs/radxa-zero-3-rk3566_defconfig - ---- /dev/null -+++ b/arch/arm/dts/rk3566-radxa-zero-3e-u-boot.dtsi -@@ -0,0 +1,15 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+#include "rk356x-u-boot.dtsi" -+ -+&saradc { -+ bootph-pre-ram; -+}; -+ -+&usb_host0_xhci { -+ dr_mode = "otg"; -+}; -+ -+&vcca_1v8 { -+ bootph-pre-ram; -+}; ---- /dev/null -+++ b/arch/arm/dts/rk3566-radxa-zero-3w-u-boot.dtsi -@@ -0,0 +1,15 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+#include "rk356x-u-boot.dtsi" -+ -+&saradc { -+ bootph-pre-ram; -+}; -+ -+&usb_host0_xhci { -+ dr_mode = "otg"; -+}; -+ -+&vcca_1v8 { -+ bootph-pre-ram; -+}; ---- a/arch/arm/mach-rockchip/rk3568/Kconfig -+++ b/arch/arm/mach-rockchip/rk3568/Kconfig -@@ -32,6 +32,11 @@ config TARGET_QUARTZ64_RK3566 - help - Pine64 Quartz64 single board computer with a RK3566 SoC. - -+config TARGET_RADXA_ZERO_3_RK3566 -+ bool "Radxa ZERO 3W/3E" -+ help -+ Radxa ZERO 3W/3E single board computers with a RK3566 SoC. -+ - endchoice - - config ROCKCHIP_BOOT_MODE_REG -@@ -54,5 +59,6 @@ source "board/anbernic/rgxx3_rk3566/Kcon - source "board/hardkernel/odroid_m1/Kconfig" - source "board/pine64/quartz64_rk3566/Kconfig" - source "board/powkiddy/x55/Kconfig" -+source "board/radxa/zero3-rk3566/Kconfig" - - endif ---- /dev/null -+++ b/board/radxa/zero3-rk3566/Kconfig -@@ -0,0 +1,12 @@ -+if TARGET_RADXA_ZERO_3_RK3566 -+ -+config SYS_BOARD -+ default "zero3-rk3566" -+ -+config SYS_VENDOR -+ default "radxa" -+ -+config SYS_CONFIG_NAME -+ default "evb_rk3568" -+ -+endif ---- /dev/null -+++ b/board/radxa/zero3-rk3566/MAINTAINERS -@@ -0,0 +1,6 @@ -+RADXA-ZERO-3-RK3566 -+M: Jonas Karlman -+S: Maintained -+F: board/radxa/zero3-rk3566 -+F: configs/radxa-zero-3-rk3566_defconfig -+F: arch/arm/dts/rk3566-radxa-zero-3* ---- /dev/null -+++ b/board/radxa/zero3-rk3566/Makefile -@@ -0,0 +1,3 @@ -+# SPDX-License-Identifier: GPL-2.0+ -+ -+obj-y += zero3-rk3566.o ---- /dev/null -+++ b/board/radxa/zero3-rk3566/zero3-rk3566.c -@@ -0,0 +1,59 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+ -+#include -+#include -+#include -+#include -+ -+#define HW_ID_CHANNEL 1 -+ -+struct board_model { -+ unsigned int low; -+ unsigned int high; -+ const char *fdtfile; -+}; -+ -+static const struct board_model board_models[] = { -+ { 230, 270, "rockchip/rk3566-radxa-zero-3w.dtb" }, -+ { 400, 450, "rockchip/rk3566-radxa-zero-3e.dtb" }, -+}; -+ -+static const struct board_model *get_board_model(void) -+{ -+ unsigned int val; -+ int i, ret; -+ -+ ret = adc_channel_single_shot("saradc@fe720000", HW_ID_CHANNEL, &val); -+ if (ret) -+ return NULL; -+ -+ for (i = 0; i < ARRAY_SIZE(board_models); i++) { -+ unsigned int min = board_models[i].low; -+ unsigned int max = board_models[i].high; -+ -+ if (min <= val && val <= max) -+ return &board_models[i]; -+ } -+ -+ return NULL; -+} -+ -+int rk_board_late_init(void) -+{ -+ const struct board_model *model = get_board_model(); -+ -+ if (model) -+ env_set("fdtfile", model->fdtfile); -+ -+ return 0; -+} -+ -+int board_fit_config_name_match(const char *name) -+{ -+ const struct board_model *model = get_board_model(); -+ -+ if (model && !strcmp(name, model->fdtfile)) -+ return 0; -+ -+ return -EINVAL; -+} ---- /dev/null -+++ b/configs/radxa-zero-3-rk3566_defconfig -@@ -0,0 +1,85 @@ -+CONFIG_ARM=y -+CONFIG_SKIP_LOWLEVEL_INIT=y -+CONFIG_COUNTER_FREQUENCY=24000000 -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_SPL_GPIO=y -+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3566-radxa-zero-3w" -+CONFIG_ROCKCHIP_RK3568=y -+CONFIG_SPL_SERIAL=y -+CONFIG_TARGET_RADXA_ZERO_3_RK3566=y -+CONFIG_DEBUG_UART_BASE=0xFE660000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SYS_LOAD_ADDR=0xc00800 -+CONFIG_DEBUG_UART=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_SPL_FIT_SIGNATURE=y -+CONFIG_SPL_LOAD_FIT=y -+CONFIG_LEGACY_IMAGE_FORMAT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-radxa-zero-3w.dtb" -+# CONFIG_DISPLAY_CPUINFO is not set -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_SPL_MAX_SIZE=0x40000 -+CONFIG_SPL_PAD_TO=0x7f8000 -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_SPL_POWER=y -+CONFIG_SPL_ATF=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_I2C=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_USB=y -+CONFIG_CMD_ROCKUSB=y -+CONFIG_CMD_USB_MASS_STORAGE=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_PMIC=y -+CONFIG_CMD_REGULATOR=y -+# CONFIG_SPL_DOS_PARTITION is not set -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_OF_LIVE=y -+CONFIG_OF_LIST="rockchip/rk3566-radxa-zero-3w rockchip/rk3566-radxa-zero-3e" -+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_SYS_RELOC_GD_ENV_ADDR=y -+CONFIG_SPL_DM_SEQ_ALIAS=y -+CONFIG_SPL_REGMAP=y -+CONFIG_SPL_SYSCON=y -+CONFIG_SPL_ADC=y -+CONFIG_SPL_CLK=y -+# CONFIG_USB_FUNCTION_FASTBOOT is not set -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_LED=y -+CONFIG_LED_GPIO=y -+CONFIG_MISC=y -+CONFIG_SUPPORT_EMMC_RPMB=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_SDMA=y -+CONFIG_MMC_SDHCI_ROCKCHIP=y -+CONFIG_PHY_REALTEK=y -+CONFIG_DWC_ETH_QOS=y -+CONFIG_DWC_ETH_QOS_ROCKCHIP=y -+CONFIG_PHY_ROCKCHIP_INNO_USB2=y -+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y -+CONFIG_SPL_PINCTRL=y -+CONFIG_DM_PMIC=y -+CONFIG_DM_PMIC_FAN53555=y -+CONFIG_PMIC_RK8XX=y -+CONFIG_SPL_DM_REGULATOR=y -+CONFIG_SPL_DM_REGULATOR_FIXED=y -+CONFIG_REGULATOR_RK8XX=y -+CONFIG_SPL_RAM=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_SYS_NS16550_MEM32=y -+CONFIG_SYSRESET=y -+CONFIG_SYSRESET_PSCI=y -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_DWC3=y -+CONFIG_USB_DWC3_GENERIC=y -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_DOWNLOAD=y -+CONFIG_USB_FUNCTION_ROCKUSB=y -+CONFIG_ERRNO_STR=y ---- a/doc/board/rockchip/rockchip.rst -+++ b/doc/board/rockchip/rockchip.rst -@@ -107,6 +107,7 @@ List of mainline supported Rockchip boar - - Powkiddy X55 (powkiddy-x55-rk3566) - - Radxa CM3 IO Board (radxa-cm3-io-rk3566) - - Radxa ROCK 3C (rock-3c-rk3566) -+ - Radxa ZERO 3W/3E (radxa-zero-3-rk3566) - - * rk3568 - - Rockchip Evb-RK3568 (evb-rk3568) diff --git a/package/boot/uboot-rockchip/patches/005-v2024.10-rc3-board-rockchip-Add-Radxa-ROCK-3B.patch b/package/boot/uboot-rockchip/patches/005-v2024.10-rc3-board-rockchip-Add-Radxa-ROCK-3B.patch deleted file mode 100644 index 0fe8bfd52d4649..00000000000000 --- a/package/boot/uboot-rockchip/patches/005-v2024.10-rc3-board-rockchip-Add-Radxa-ROCK-3B.patch +++ /dev/null @@ -1,179 +0,0 @@ -From e20d57ae7e0c28f2d770a7d18c1501d332e8766a Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Wed, 31 Jul 2024 07:28:54 +0000 -Subject: [PATCH] board: rockchip: Add Radxa ROCK 3B - -The Radxa ROCK 3B is a single-board computer based on the Pico-ITX form -factor (100mm x 75mm). Two versions of the ROCK 3B exists, a community -version based on the RK3568 SoC and an industrial version based on the -RK3568J SoC. - -Features tested on ROCK 3B 8GB v1.51 (both variants): -- SD-card boot -- eMMC boot -- SPI Flash boot -- Ethernet -- PCIe/NVMe -- USB gadget -- USB host - -Signed-off-by: Jonas Karlman -Tested-by: FUKAUMI Naoki -Reviewed-by: Kever Yang ---- - arch/arm/dts/rk3568-rock-3b-u-boot.dtsi | 15 ++++ - board/rockchip/evb_rk3568/MAINTAINERS | 6 ++ - configs/rock-3b-rk3568_defconfig | 100 ++++++++++++++++++++++++ - doc/board/rockchip/rockchip.rst | 3 +- - 4 files changed, 123 insertions(+), 1 deletion(-) - create mode 100644 arch/arm/dts/rk3568-rock-3b-u-boot.dtsi - create mode 100644 configs/rock-3b-rk3568_defconfig - ---- /dev/null -+++ b/arch/arm/dts/rk3568-rock-3b-u-boot.dtsi -@@ -0,0 +1,15 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+#include "rk356x-u-boot.dtsi" -+ -+&sdhci { -+ mmc-hs400-1_8v; -+ mmc-hs400-enhanced-strobe; -+}; -+ -+&sfc { -+ flash@0 { -+ bootph-pre-ram; -+ bootph-some-ram; -+ }; -+}; ---- a/board/rockchip/evb_rk3568/MAINTAINERS -+++ b/board/rockchip/evb_rk3568/MAINTAINERS -@@ -70,6 +70,12 @@ F: configs/rock-3a-rk3568_defconfig - F: arch/arm/dts/rk3568-rock-3a.dts - F: arch/arm/dts/rk3568-rock-3a-u-boot.dtsi - -+ROCK-3B -+M: Jonas Karlman -+S: Maintained -+F: configs/rock-3b-rk3568_defconfig -+F: arch/arm/dts/rk3568-rock-3b* -+ - ROCK-3C - M: Jonas Karlman - M: Maxim Moskalets ---- /dev/null -+++ b/configs/rock-3b-rk3568_defconfig -@@ -0,0 +1,100 @@ -+CONFIG_ARM=y -+CONFIG_SKIP_LOWLEVEL_INIT=y -+CONFIG_COUNTER_FREQUENCY=24000000 -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_SF_DEFAULT_SPEED=24000000 -+CONFIG_SF_DEFAULT_MODE=0x2000 -+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3568-rock-3b" -+CONFIG_ROCKCHIP_RK3568=y -+CONFIG_ROCKCHIP_SPI_IMAGE=y -+CONFIG_SPL_SERIAL=y -+CONFIG_DEBUG_UART_BASE=0xFE660000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SPL_SPI_FLASH_SUPPORT=y -+CONFIG_SPL_SPI=y -+CONFIG_SYS_LOAD_ADDR=0xc00800 -+CONFIG_PCI=y -+CONFIG_DEBUG_UART=y -+CONFIG_AHCI=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_SPL_FIT_SIGNATURE=y -+CONFIG_SPL_LOAD_FIT=y -+CONFIG_LEGACY_IMAGE_FORMAT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-rock-3b.dtb" -+# CONFIG_DISPLAY_CPUINFO is not set -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_SPL_MAX_SIZE=0x40000 -+CONFIG_SPL_PAD_TO=0x7f8000 -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_SPL_SPI_LOAD=y -+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000 -+CONFIG_SPL_ATF=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_I2C=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_PCI=y -+CONFIG_CMD_POWEROFF=y -+CONFIG_CMD_USB=y -+CONFIG_CMD_ROCKUSB=y -+CONFIG_CMD_USB_MASS_STORAGE=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_PMIC=y -+CONFIG_CMD_REGULATOR=y -+# CONFIG_SPL_DOS_PARTITION is not set -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_OF_LIVE=y -+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_SYS_RELOC_GD_ENV_ADDR=y -+CONFIG_SPL_DM_SEQ_ALIAS=y -+CONFIG_SPL_REGMAP=y -+CONFIG_SPL_SYSCON=y -+CONFIG_SCSI_AHCI=y -+CONFIG_AHCI_PCI=y -+CONFIG_SPL_CLK=y -+# CONFIG_USB_FUNCTION_FASTBOOT is not set -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_LED=y -+CONFIG_LED_GPIO=y -+CONFIG_MISC=y -+CONFIG_SUPPORT_EMMC_RPMB=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_SDMA=y -+CONFIG_MMC_SDHCI_ROCKCHIP=y -+CONFIG_SF_DEFAULT_BUS=4 -+CONFIG_SPI_FLASH_SFDP_SUPPORT=y -+CONFIG_SPI_FLASH_MACRONIX=y -+CONFIG_SPI_FLASH_XTX=y -+CONFIG_PHY_REALTEK=y -+CONFIG_DWC_ETH_QOS=y -+CONFIG_DWC_ETH_QOS_ROCKCHIP=y -+CONFIG_NVME_PCI=y -+CONFIG_PCIE_DW_ROCKCHIP=y -+CONFIG_PHY_ROCKCHIP_INNO_USB2=y -+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y -+CONFIG_SPL_PINCTRL=y -+CONFIG_DM_PMIC=y -+CONFIG_DM_PMIC_FAN53555=y -+CONFIG_PMIC_RK8XX=y -+CONFIG_REGULATOR_RK8XX=y -+CONFIG_SPL_RAM=y -+CONFIG_SCSI=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_SYS_NS16550_MEM32=y -+CONFIG_ROCKCHIP_SFC=y -+CONFIG_SYSRESET=y -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_DWC3=y -+CONFIG_USB_DWC3_GENERIC=y -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_DOWNLOAD=y -+CONFIG_USB_FUNCTION_ROCKUSB=y -+CONFIG_ERRNO_STR=y ---- a/doc/board/rockchip/rockchip.rst -+++ b/doc/board/rockchip/rockchip.rst -@@ -118,7 +118,8 @@ List of mainline supported Rockchip boar - - Generic RK3566/RK3568 (generic-rk3568) - - Hardkernel ODROID-M1 (odroid-m1-rk3568) - - Radxa E25 Carrier Board (radxa-e25-rk3568) -- - Radxa ROCK 3 Model A (rock-3a-rk3568) -+ - Radxa ROCK 3A (rock-3a-rk3568) -+ - Radxa ROCK 3B (rock-3b-rk3568) - - * rk3588 - - Rockchip EVB (evb-rk3588) diff --git a/package/boot/uboot-rockchip/patches/010-v2024.10-rc3-arm64-dts-rockchip-correct-the-model-name-for-Radxa-.patch b/package/boot/uboot-rockchip/patches/010-v2024.10-rc3-arm64-dts-rockchip-correct-the-model-name-for-Radxa-.patch deleted file mode 100644 index 6bf47e2a5b6f98..00000000000000 --- a/package/boot/uboot-rockchip/patches/010-v2024.10-rc3-arm64-dts-rockchip-correct-the-model-name-for-Radxa-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 626a479873b6a680b3227c4852bde4a1f2c17fdf Mon Sep 17 00:00:00 2001 -From: Chukun Pan -Date: Fri, 19 Apr 2024 18:30:19 +0800 -Subject: [PATCH 1/3] arm64: dts: rockchip: correct the model name for Radxa - ROCK 3A - -According to https://radxa.com/products/rock3/3a, -the name of this board should be "Radxa ROCK 3A". - -Suggested-by: FUKAUMI Naoki -Signed-off-by: Chukun Pan -Reviewed-by: Dragan Simic -Link: https://lore.kernel.org/r/20240419103019.992586-3-amadeus@jmu.edu.cn -Signed-off-by: Heiko Stuebner ---- - arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/dts/upstream/src/arm64/rockchip/rk3568-rock-3a.dts -+++ b/dts/upstream/src/arm64/rockchip/rk3568-rock-3a.dts -@@ -8,7 +8,7 @@ - #include "rk3568.dtsi" - - / { -- model = "Radxa ROCK3 Model A"; -+ model = "Radxa ROCK 3A"; - compatible = "radxa,rock3a", "rockchip,rk3568"; - - aliases { diff --git a/package/boot/uboot-rockchip/patches/011-v2024.10-rc3-arm64-dts-rockchip-Correct-the-model-names-for-Radxa.patch b/package/boot/uboot-rockchip/patches/011-v2024.10-rc3-arm64-dts-rockchip-Correct-the-model-names-for-Radxa.patch deleted file mode 100644 index 82918e38991d3d..00000000000000 --- a/package/boot/uboot-rockchip/patches/011-v2024.10-rc3-arm64-dts-rockchip-Correct-the-model-names-for-Radxa.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 45e831033f7a00a14f64afa1e34c476a9ff0f9f0 Mon Sep 17 00:00:00 2001 -From: Dragan Simic -Date: Thu, 18 Apr 2024 18:26:20 +0200 -Subject: [PATCH] arm64: dts: rockchip: Correct the model names for Radxa ROCK - 5 boards - -Correct the descriptions of a few Radxa boards, according to the up-to-date -documentation from Radxa and the detailed explanation from Naoki. [1] To sum -it up, the short naming, as specified by Radxa, is preferred. - -[1] https://lore.kernel.org/linux-rockchip/B26C732A4DCEA9B3+282b8775-601b-4d4a-a513-4924b7940076@radxa.com/ - -Suggested-by: FUKAUMI Naoki -Signed-off-by: Dragan Simic -Link: https://lore.kernel.org/r/6931289a252dc2d6c7bfd2388835c5e98ba0d8c9.1713457260.git.dsimic@manjaro.org -Signed-off-by: Heiko Stuebner ---- - arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts | 2 +- - arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/dts/upstream/src/arm64/rockchip/rk3588-rock-5b.dts -+++ b/dts/upstream/src/arm64/rockchip/rk3588-rock-5b.dts -@@ -7,7 +7,7 @@ - #include "rk3588.dtsi" - - / { -- model = "Radxa ROCK 5 Model B"; -+ model = "Radxa ROCK 5B"; - compatible = "radxa,rock-5b", "rockchip,rk3588"; - - aliases { ---- a/dts/upstream/src/arm64/rockchip/rk3588s-rock-5a.dts -+++ b/dts/upstream/src/arm64/rockchip/rk3588s-rock-5a.dts -@@ -8,7 +8,7 @@ - #include "rk3588s.dtsi" - - / { -- model = "Radxa ROCK 5 Model A"; -+ model = "Radxa ROCK 5A"; - compatible = "radxa,rock-5a", "rockchip,rk3588s"; - - aliases { diff --git a/package/boot/uboot-rockchip/patches/106-v2024.10-rc1-board-rockchip-Add-FriendlyElec-NanoPi-R6S.patch b/package/boot/uboot-rockchip/patches/106-v2024.10-rc1-board-rockchip-Add-FriendlyElec-NanoPi-R6S.patch deleted file mode 100644 index 68958d87c940fd..00000000000000 --- a/package/boot/uboot-rockchip/patches/106-v2024.10-rc1-board-rockchip-Add-FriendlyElec-NanoPi-R6S.patch +++ /dev/null @@ -1,193 +0,0 @@ -From 7db9ff164813afb343024d37731ab797ed7f507e Mon Sep 17 00:00:00 2001 -From: Sebastian Kropatsch -Date: Thu, 11 Jul 2024 12:15:18 +0200 -Subject: [PATCH] board: rockchip: Add FriendlyElec NanoPi R6S - -The NanoPi R6S is a SBC by FriendlyElec based on the Rockchip RK3588s. -It comes with 4GB or 8GB of RAM, a microSD card slot, 32GB eMMC storage, -one RTL8211F 1GbE and two RTL8125 2.5GbE Ethernet ports, one USB 2.0 -Type-A and one USB 3.0 Type-A port, a HDMI port, a 12-pin GPIO FPC -connector, a fan connector, IR receiver as well as some buttons and LEDs. - -Add initial support for this board using the upstream devicetree sources. - -Kernel commit: -f1b11f43b3e9 ("arm64: dts: rockchip: Add support for NanoPi R6S") - -Reviewed-by: Kever Yang -Signed-off-by: Sebastian Kropatsch ---- - arch/arm/dts/rk3588s-nanopi-r6s-u-boot.dtsi | 3 + - arch/arm/mach-rockchip/rk3588/Kconfig | 13 +++ - board/friendlyelec/nanopi-r6s-rk3588s/Kconfig | 12 +++ - .../nanopi-r6s-rk3588s/MAINTAINERS | 7 ++ - configs/nanopi-r6s-rk3588s_defconfig | 82 +++++++++++++++++++ - doc/board/rockchip/rockchip.rst | 1 + - include/configs/nanopi-r6s-rk3588s.h | 12 +++ - 7 files changed, 130 insertions(+) - create mode 100644 arch/arm/dts/rk3588s-nanopi-r6s-u-boot.dtsi - create mode 100644 board/friendlyelec/nanopi-r6s-rk3588s/Kconfig - create mode 100644 board/friendlyelec/nanopi-r6s-rk3588s/MAINTAINERS - create mode 100644 configs/nanopi-r6s-rk3588s_defconfig - create mode 100644 include/configs/nanopi-r6s-rk3588s.h - ---- /dev/null -+++ b/arch/arm/dts/rk3588s-nanopi-r6s-u-boot.dtsi -@@ -0,0 +1,3 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+#include "rk3588s-u-boot.dtsi" ---- a/arch/arm/mach-rockchip/rk3588/Kconfig -+++ b/arch/arm/mach-rockchip/rk3588/Kconfig -@@ -78,6 +78,18 @@ config TARGET_NANOPCT6_RK3588 - Power: 5.5*2.1mm DC Jack, 12VDC input - Dimensions: 110x80x1.6mm (without case) / 86x114.5x30mm (with case) - -+config TARGET_NANOPI_R6S_RK3588S -+ bool "FriendlyElec NanoPi R6S" -+ select BOARD_LATE_INIT -+ help -+ The NanoPi R6S is a SBC by FriendlyElec based on the Rockchip -+ RK3588s. -+ It comes with 4GB or 8GB of RAM, a microSD card slot, 32GB eMMC -+ storage, one RTL8211F 1GbE and two RTL8125 2.5GbE Ethernet ports, -+ one USB 2.0 Type-A and one USB 3.0 Type-A port, a HDMI port, a -+ 12-pin GPIO FPC connector, a fan connector, IR receiver as well -+ as some buttons and LEDs. -+ - config TARGET_NOVA_RK3588 - bool "Indiedroid Nova RK3588" - select BOARD_LATE_INIT -@@ -232,6 +244,7 @@ config TEXT_BASE - - source "board/edgeble/neural-compute-module-6/Kconfig" - source "board/friendlyelec/nanopc-t6-rk3588/Kconfig" -+source "board/friendlyelec/nanopi-r6s-rk3588s/Kconfig" - source "board/indiedroid/nova/Kconfig" - source "board/pine64/quartzpro64-rk3588/Kconfig" - source "board/turing/turing-rk1-rk3588/Kconfig" ---- /dev/null -+++ b/board/friendlyelec/nanopi-r6s-rk3588s/Kconfig -@@ -0,0 +1,12 @@ -+if TARGET_NANOPI_R6S_RK3588S -+ -+config SYS_BOARD -+ default "nanopi-r6s-rk3588s" -+ -+config SYS_VENDOR -+ default "friendlyelec" -+ -+config SYS_CONFIG_NAME -+ default "nanopi-r6s-rk3588s" -+ -+endif ---- /dev/null -+++ b/board/friendlyelec/nanopi-r6s-rk3588s/MAINTAINERS -@@ -0,0 +1,7 @@ -+NANOPI-R6S -+M: Sebastian Kropatsch -+S: Maintained -+F: arch/arm/dts/rk3588s-nanopi-r6s-u-boot.dtsi -+F: board/friendlyelec/nanopi-r6s-rk3588s -+F: configs/nanopi-r6s-rk3588s_defconfig -+F: include/configs/nanopi-r6s-rk3588s.h ---- /dev/null -+++ b/configs/nanopi-r6s-rk3588s_defconfig -@@ -0,0 +1,82 @@ -+CONFIG_ARM=y -+CONFIG_SKIP_LOWLEVEL_INIT=y -+CONFIG_SYS_HAS_NONCACHED_MEMORY=y -+CONFIG_COUNTER_FREQUENCY=24000000 -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3588s-nanopi-r6s" -+CONFIG_ROCKCHIP_RK3588=y -+CONFIG_SPL_SERIAL=y -+CONFIG_TARGET_NANOPI_R6S_RK3588S=y -+CONFIG_DEBUG_UART_BASE=0xFEB50000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SYS_LOAD_ADDR=0xc00800 -+CONFIG_PCI=y -+CONFIG_DEBUG_UART=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_SPL_FIT_SIGNATURE=y -+CONFIG_SPL_LOAD_FIT=y -+CONFIG_LEGACY_IMAGE_FORMAT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588s-nanopi-r6s.dtb" -+# CONFIG_DISPLAY_CPUINFO is not set -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_SPL_MAX_SIZE=0x40000 -+CONFIG_SPL_PAD_TO=0x7f8000 -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_SPL_ATF=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_PWM=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_I2C=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_PCI=y -+CONFIG_CMD_USB=y -+CONFIG_CMD_ROCKUSB=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_REGULATOR=y -+# CONFIG_SPL_DOS_PARTITION is not set -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_OF_LIVE=y -+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_SPL_DM_SEQ_ALIAS=y -+CONFIG_SPL_REGMAP=y -+CONFIG_SPL_SYSCON=y -+CONFIG_SPL_CLK=y -+# CONFIG_USB_FUNCTION_FASTBOOT is not set -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_MISC=y -+CONFIG_SUPPORT_EMMC_RPMB=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_SDMA=y -+CONFIG_MMC_SDHCI_ROCKCHIP=y -+# CONFIG_SPI_FLASH is not set -+CONFIG_PHY_REALTEK=y -+CONFIG_DWC_ETH_QOS=y -+CONFIG_DWC_ETH_QOS_ROCKCHIP=y -+CONFIG_RTL8169=y -+CONFIG_PCIE_DW_ROCKCHIP=y -+CONFIG_PHY_ROCKCHIP_INNO_USB2=y -+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y -+CONFIG_PHY_ROCKCHIP_USBDP=y -+CONFIG_SPL_PINCTRL=y -+CONFIG_PWM_ROCKCHIP=y -+CONFIG_SPL_RAM=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_SYS_NS16550_MEM32=y -+CONFIG_SYSRESET=y -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_OHCI_HCD=y -+CONFIG_USB_OHCI_GENERIC=y -+CONFIG_USB_DWC3=y -+CONFIG_USB_DWC3_GENERIC=y -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_DOWNLOAD=y -+CONFIG_USB_FUNCTION_ROCKUSB=y -+CONFIG_ERRNO_STR=y ---- /dev/null -+++ b/include/configs/nanopi-r6s-rk3588s.h -@@ -0,0 +1,12 @@ -+/* SPDX-License-Identifier: GPL-2.0+ */ -+ -+#ifndef __NANOPI_R6S_RK3588S_H -+#define __NANOPI_R6S_RK3588S_H -+ -+#define ROCKCHIP_DEVICE_SETTINGS \ -+ "stdout=serial,vidconsole\0" \ -+ "stderr=serial,vidconsole\0" -+ -+#include -+ -+#endif /* __NANOPI_R6S_RK3588S_H */ diff --git a/package/boot/uboot-rockchip/patches/107-v2024.10-rc1-board-rockchip-Add-FriendlyElec-NanoPi-R6C.patch b/package/boot/uboot-rockchip/patches/107-v2024.10-rc1-board-rockchip-Add-FriendlyElec-NanoPi-R6C.patch deleted file mode 100644 index ba00a5c9dee0e6..00000000000000 --- a/package/boot/uboot-rockchip/patches/107-v2024.10-rc1-board-rockchip-Add-FriendlyElec-NanoPi-R6C.patch +++ /dev/null @@ -1,213 +0,0 @@ -From f59d40aa5598063396164b3248f0f8ed6591e3db Mon Sep 17 00:00:00 2001 -From: Sebastian Kropatsch -Date: Thu, 11 Jul 2024 12:15:17 +0200 -Subject: [PATCH] board: rockchip: Add FriendlyElec NanoPi R6C - -The NanoPi R6C is a SBC by FriendlyElec based on the Rockchip RK3588s. -It comes with 4GB or 8GB of RAM, a microSD card slot, optional 32GB eMMC -storage, one M.2 M-Key connector, one RTL8211F 1GbE and one RTL8125 -2.5GbE Ethernet port, one USB 2.0 Type-A and one USB 3.0 Type-A port, a -HDMI port, a 30-pin GPIO header as well as multiple buttons and LEDs. - -Add initial support for this board using the upstream devicetree sources. - -Tested in U-Boot proper: -- Booting from eMMC works -- 1GbE Ethernet works using the eth_eqos driver (tested by ping) -- 2.5GbE Ethernet works using the eth_rtl8169 driver (tested by ping), - but the status LEDs on this specific port currently aren't working -- NVMe SSD in M.2 socket does get recognized (tested with `nvme scan` - followed by `nvme details`) - -Kernel commit: -d5f1d7437451 ("arm64: dts: rockchip: Add support for NanoPi R6C") - -Reviewed-by: Quentin Schulz -Reviewed-by: Kever Yang -Signed-off-by: Sebastian Kropatsch ---- - arch/arm/dts/rk3588s-nanopi-r6c-u-boot.dtsi | 3 + - arch/arm/mach-rockchip/rk3588/Kconfig | 13 +++ - board/friendlyelec/nanopi-r6c-rk3588s/Kconfig | 12 +++ - .../nanopi-r6c-rk3588s/MAINTAINERS | 7 ++ - configs/nanopi-r6c-rk3588s_defconfig | 83 +++++++++++++++++++ - doc/board/rockchip/rockchip.rst | 1 + - include/configs/nanopi-r6c-rk3588s.h | 12 +++ - 7 files changed, 131 insertions(+) - create mode 100644 arch/arm/dts/rk3588s-nanopi-r6c-u-boot.dtsi - create mode 100644 board/friendlyelec/nanopi-r6c-rk3588s/Kconfig - create mode 100644 board/friendlyelec/nanopi-r6c-rk3588s/MAINTAINERS - create mode 100644 configs/nanopi-r6c-rk3588s_defconfig - create mode 100644 include/configs/nanopi-r6c-rk3588s.h - ---- /dev/null -+++ b/arch/arm/dts/rk3588s-nanopi-r6c-u-boot.dtsi -@@ -0,0 +1,3 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+#include "rk3588s-u-boot.dtsi" ---- a/arch/arm/mach-rockchip/rk3588/Kconfig -+++ b/arch/arm/mach-rockchip/rk3588/Kconfig -@@ -90,6 +90,18 @@ config TARGET_NANOPI_R6S_RK3588S - 12-pin GPIO FPC connector, a fan connector, IR receiver as well - as some buttons and LEDs. - -+config TARGET_NANOPI_R6C_RK3588S -+ bool "FriendlyElec NanoPi R6C" -+ select BOARD_LATE_INIT -+ help -+ The NanoPi R6C is a SBC by FriendlyElec based on the Rockchip -+ RK3588s. -+ It comes with 4GB or 8GB of RAM, a microSD card slot, optional 32GB -+ eMMC storage, one M.2 M-Key connector, one RTL8211F 1GbE and one -+ RTL8125 2.5GbE Ethernet port, one USB 2.0 Type-A and one USB 3.0 -+ Type-A port, a HDMI port, a 30-pin GPIO header as well as some -+ buttons and LEDs. -+ - config TARGET_NOVA_RK3588 - bool "Indiedroid Nova RK3588" - select BOARD_LATE_INIT -@@ -245,6 +257,7 @@ config TEXT_BASE - source "board/edgeble/neural-compute-module-6/Kconfig" - source "board/friendlyelec/nanopc-t6-rk3588/Kconfig" - source "board/friendlyelec/nanopi-r6s-rk3588s/Kconfig" -+source "board/friendlyelec/nanopi-r6c-rk3588s/Kconfig" - source "board/indiedroid/nova/Kconfig" - source "board/pine64/quartzpro64-rk3588/Kconfig" - source "board/turing/turing-rk1-rk3588/Kconfig" ---- /dev/null -+++ b/board/friendlyelec/nanopi-r6c-rk3588s/Kconfig -@@ -0,0 +1,12 @@ -+if TARGET_NANOPI_R6C_RK3588S -+ -+config SYS_BOARD -+ default "nanopi-r6c-rk3588s" -+ -+config SYS_VENDOR -+ default "friendlyelec" -+ -+config SYS_CONFIG_NAME -+ default "nanopi-r6c-rk3588s" -+ -+endif ---- /dev/null -+++ b/board/friendlyelec/nanopi-r6c-rk3588s/MAINTAINERS -@@ -0,0 +1,7 @@ -+NANOPI-R6C -+M: Sebastian Kropatsch -+S: Maintained -+F: arch/arm/dts/rk3588s-nanopi-r6c-u-boot.dtsi -+F: board/friendlyelec/nanopi-r6c-rk3588s -+F: configs/nanopi-r6c-rk3588s_defconfig -+F: include/configs/nanopi-r6c-rk3588s.h ---- /dev/null -+++ b/configs/nanopi-r6c-rk3588s_defconfig -@@ -0,0 +1,83 @@ -+CONFIG_ARM=y -+CONFIG_SKIP_LOWLEVEL_INIT=y -+CONFIG_SYS_HAS_NONCACHED_MEMORY=y -+CONFIG_COUNTER_FREQUENCY=24000000 -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3588s-nanopi-r6c" -+CONFIG_ROCKCHIP_RK3588=y -+CONFIG_SPL_SERIAL=y -+CONFIG_TARGET_NANOPI_R6C_RK3588S=y -+CONFIG_DEBUG_UART_BASE=0xFEB50000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SYS_LOAD_ADDR=0xc00800 -+CONFIG_PCI=y -+CONFIG_DEBUG_UART=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_SPL_FIT_SIGNATURE=y -+CONFIG_SPL_LOAD_FIT=y -+CONFIG_LEGACY_IMAGE_FORMAT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588s-nanopi-r6c.dtb" -+# CONFIG_DISPLAY_CPUINFO is not set -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_SPL_MAX_SIZE=0x40000 -+CONFIG_SPL_PAD_TO=0x7f8000 -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_SPL_ATF=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_PWM=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_I2C=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_PCI=y -+CONFIG_CMD_USB=y -+CONFIG_CMD_ROCKUSB=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_REGULATOR=y -+# CONFIG_SPL_DOS_PARTITION is not set -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_OF_LIVE=y -+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_SPL_DM_SEQ_ALIAS=y -+CONFIG_SPL_REGMAP=y -+CONFIG_SPL_SYSCON=y -+CONFIG_SPL_CLK=y -+# CONFIG_USB_FUNCTION_FASTBOOT is not set -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_MISC=y -+CONFIG_SUPPORT_EMMC_RPMB=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_SDMA=y -+CONFIG_MMC_SDHCI_ROCKCHIP=y -+# CONFIG_SPI_FLASH is not set -+CONFIG_PHY_REALTEK=y -+CONFIG_DWC_ETH_QOS=y -+CONFIG_DWC_ETH_QOS_ROCKCHIP=y -+CONFIG_RTL8169=y -+CONFIG_NVME_PCI=y -+CONFIG_PCIE_DW_ROCKCHIP=y -+CONFIG_PHY_ROCKCHIP_INNO_USB2=y -+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y -+CONFIG_PHY_ROCKCHIP_USBDP=y -+CONFIG_SPL_PINCTRL=y -+CONFIG_PWM_ROCKCHIP=y -+CONFIG_SPL_RAM=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_SYS_NS16550_MEM32=y -+CONFIG_SYSRESET=y -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_OHCI_HCD=y -+CONFIG_USB_OHCI_GENERIC=y -+CONFIG_USB_DWC3=y -+CONFIG_USB_DWC3_GENERIC=y -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_DOWNLOAD=y -+CONFIG_USB_FUNCTION_ROCKUSB=y -+CONFIG_ERRNO_STR=y ---- a/doc/board/rockchip/rockchip.rst -+++ b/doc/board/rockchip/rockchip.rst -@@ -126,6 +126,7 @@ List of mainline supported Rockchip boar - - Edgeble Neural Compute Module 6A SoM - Neu6a (neu6a-io-rk3588) - - Edgeble Neural Compute Module 6B SoM - Neu6b (neu6b-io-rk3588) - - FriendlyElec NanoPC-T6 (nanopc-t6-rk3588) -+ - FriendlyElec NanoPi R6C (nanopi-r6c-rk3588s) - - Generic RK3588S/RK3588 (generic-rk3588) - - Indiedroid Nova (nova-rk3588s) - - Pine64 QuartzPro64 (quartzpro64-rk3588) ---- /dev/null -+++ b/include/configs/nanopi-r6c-rk3588s.h -@@ -0,0 +1,12 @@ -+/* SPDX-License-Identifier: GPL-2.0+ */ -+ -+#ifndef __NANOPI_R6C_RK3588S_H -+#define __NANOPI_R6C_RK3588S_H -+ -+#define ROCKCHIP_DEVICE_SETTINGS \ -+ "stdout=serial,vidconsole\0" \ -+ "stderr=serial,vidconsole\0" -+ -+#include -+ -+#endif /* __NANOPI_R6C_RK3588S_H */ diff --git a/package/boot/uboot-rockchip/patches/108-v2024.10-rc1-board-rockchip-add-ArmSoM-Sige7-Rk3588-board.patch b/package/boot/uboot-rockchip/patches/108-v2024.10-rc1-board-rockchip-add-ArmSoM-Sige7-Rk3588-board.patch deleted file mode 100644 index 7fa4d679e48191..00000000000000 --- a/package/boot/uboot-rockchip/patches/108-v2024.10-rc1-board-rockchip-add-ArmSoM-Sige7-Rk3588-board.patch +++ /dev/null @@ -1,257 +0,0 @@ -From 40b573e4f6ed629eab54633f8836a2be5e5aa75a Mon Sep 17 00:00:00 2001 -From: Jianfeng Liu -Date: Wed, 29 May 2024 01:04:06 +0800 -Subject: [PATCH] board: rockchip: add ArmSoM Sige7 Rk3588 board - -ArmSoM Sige7 is a Rockchip RK3588 based SBC (Single Board Computer) by -ArmSoM. - -There are two variants depending on the DRAM size : 8G and 16G. - -Specification: - - Rockchip Rk3588 SoC - 4x ARM Cortex-A76, 4x ARM Cortex-A55 - 8/16GB memory LPDDR4x - Mali G610MC4 GPU - 2x MIPI CSI 2 multiple lanes connector - 64GB/128GB on board eMMC - uSD slot - 1x USB 2.0 Type-A, 1x USB 3.0 Type-A, 1x USB 3.0 Type-C - 1x HDMI 2.1 output - 2x 2.5 Gbps Ethernet port - 40-pin IO header including UART, SPI and I2C - USB PD over USB Type-C - Size: 92mm x 62mm - -Kernel commit: -81c828a67c78 (arm64: dts: rockchip: Add ArmSom Sige7 board) - -Signed-off-by: Jianfeng Liu -Reviewed-by: Kever Yang ---- - MAINTAINERS | 1 + - arch/arm/dts/rk3588-armsom-sige7-u-boot.dtsi | 6 ++ - arch/arm/mach-rockchip/rk3588/Kconfig | 26 ++++++ - board/armsom/sige7-rk3588/Kconfig | 12 +++ - board/armsom/sige7-rk3588/MAINTAINERS | 7 ++ - configs/sige7-rk3588_defconfig | 93 ++++++++++++++++++++ - doc/board/rockchip/rockchip.rst | 1 + - include/configs/sige7-rk3588.h | 15 ++++ - 8 files changed, 161 insertions(+) - create mode 100644 arch/arm/dts/rk3588-armsom-sige7-u-boot.dtsi - create mode 100644 board/armsom/sige7-rk3588/Kconfig - create mode 100644 board/armsom/sige7-rk3588/MAINTAINERS - create mode 100644 configs/sige7-rk3588_defconfig - create mode 100644 include/configs/sige7-rk3588.h - ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -533,6 +533,7 @@ F: arch/arm/include/asm/arch-rockchip/ - F: arch/arm/mach-rockchip/ - F: board/amarula/vyasa-rk3288/ - F: board/anbernic/rgxx3_rk3566/ -+F: board/armsom/sige7-rk3588/ - F: board/chipspark/popmetal_rk3288 - F: board/engicam/px30_core/ - F: board/firefly/ ---- /dev/null -+++ b/arch/arm/dts/rk3588-armsom-sige7-u-boot.dtsi -@@ -0,0 +1,6 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2024 ArmSoM Technology Co., Ltd. -+ */ -+ -+#include "rk3588-u-boot.dtsi" ---- a/arch/arm/mach-rockchip/rk3588/Kconfig -+++ b/arch/arm/mach-rockchip/rk3588/Kconfig -@@ -185,6 +185,31 @@ config TARGET_ROCK5B_RK3588 - USB PD over USB Type-C - Size: 100mm x 72mm (Pico-ITX form factor) - -+config TARGET_SIGE7_RK3588 -+ bool "ArmSoM Sige7 RK3588 board" -+ select BOARD_LATE_INIT -+ help -+ ArmSoM Sige7 is a Rockchip RK3588 based SBC (Single Board Computer) -+ by ArmSoM. -+ -+ There are two variants depending on the DRAM size : 8G and 16G. -+ -+ Specification: -+ -+ Rockchip Rk3588 SoC -+ 4x ARM Cortex-A76, 4x ARM Cortex-A55 -+ 8/16GB memory LPDDR4x -+ Mali G610MC4 GPU -+ 2x MIPI CSI 2 multiple lanes connector -+ 64GB/128GB on board eMMC -+ uSD slot -+ 1x USB 2.0 Type-A, 1x USB 3.0 Type-A, 1x USB 3.0 Type-C -+ 1x HDMI 2.1 output -+ 2x 2.5 Gbps Ethernet port -+ 40-pin IO header including UART, SPI and I2C -+ USB PD over USB Type-C -+ Size: 92mm x 62mm -+ - config TARGET_QUARTZPRO64_RK3588 - bool "Pine64 QuartzPro64 RK3588 board" - select BOARD_LATE_INIT -@@ -254,6 +279,7 @@ config ROCKCHIP_COMMON_STACK_ADDR - config TEXT_BASE - default 0x00a00000 - -+source "board/armsom/sige7-rk3588/Kconfig" - source "board/edgeble/neural-compute-module-6/Kconfig" - source "board/friendlyelec/nanopc-t6-rk3588/Kconfig" - source "board/friendlyelec/nanopi-r6s-rk3588s/Kconfig" ---- /dev/null -+++ b/board/armsom/sige7-rk3588/Kconfig -@@ -0,0 +1,12 @@ -+if TARGET_SIGE7_RK3588 -+ -+config SYS_BOARD -+ default "sige7-rk3588" -+ -+config SYS_VENDOR -+ default "armsom" -+ -+config SYS_CONFIG_NAME -+ default "sige7-rk3588" -+ -+endif ---- /dev/null -+++ b/board/armsom/sige7-rk3588/MAINTAINERS -@@ -0,0 +1,7 @@ -+SIGE7-RK3588 -+M: Jianfeng Liu -+S: Maintained -+F: board/armsom/sige7-rk3588 -+F: include/configs/sige7-rk3588.h -+F: configs/sige7-rk3588_defconfig -+F: arch/arm/dts/rk3588-armsom-sige7* ---- /dev/null -+++ b/configs/sige7-rk3588_defconfig -@@ -0,0 +1,93 @@ -+CONFIG_ARM=y -+CONFIG_SKIP_LOWLEVEL_INIT=y -+CONFIG_SYS_HAS_NONCACHED_MEMORY=y -+CONFIG_COUNTER_FREQUENCY=24000000 -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3588-armsom-sige7" -+CONFIG_ROCKCHIP_RK3588=y -+CONFIG_SPL_SERIAL=y -+CONFIG_TARGET_SIGE7_RK3588=y -+CONFIG_DEBUG_UART_BASE=0xFEB50000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SPL_SPI=y -+CONFIG_SYS_LOAD_ADDR=0xc00800 -+CONFIG_PCI=y -+CONFIG_DEBUG_UART=y -+CONFIG_AHCI=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_SPL_FIT_SIGNATURE=y -+CONFIG_SPL_LOAD_FIT=y -+CONFIG_LEGACY_IMAGE_FORMAT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-armsom-sige7.dtb" -+# CONFIG_DISPLAY_CPUINFO is not set -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_SPL_MAX_SIZE=0x40000 -+CONFIG_SPL_PAD_TO=0x7f8000 -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_SPL_ATF=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_I2C=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_PCI=y -+CONFIG_CMD_USB=y -+CONFIG_CMD_ROCKUSB=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_REGULATOR=y -+# CONFIG_SPL_DOS_PARTITION is not set -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_OF_LIVE=y -+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_SPL_DM_SEQ_ALIAS=y -+CONFIG_SPL_REGMAP=y -+CONFIG_SPL_SYSCON=y -+CONFIG_AHCI_PCI=y -+CONFIG_DWC_AHCI=y -+CONFIG_SPL_CLK=y -+# CONFIG_USB_FUNCTION_FASTBOOT is not set -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_MISC=y -+CONFIG_SUPPORT_EMMC_RPMB=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_SDMA=y -+CONFIG_MMC_SDHCI_ROCKCHIP=y -+CONFIG_PHYLIB=y -+CONFIG_RTL8169=y -+CONFIG_NVME_PCI=y -+CONFIG_PCIE_DW_ROCKCHIP=y -+CONFIG_PHY_ROCKCHIP_INNO_USB2=y -+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y -+CONFIG_PHY_ROCKCHIP_USBDP=y -+CONFIG_SPL_PINCTRL=y -+CONFIG_PWM_ROCKCHIP=y -+CONFIG_SPL_RAM=y -+CONFIG_SCSI=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_SYS_NS16550_MEM32=y -+CONFIG_SYSRESET=y -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_OHCI_HCD=y -+CONFIG_USB_OHCI_GENERIC=y -+CONFIG_USB_DWC3=y -+CONFIG_USB_DWC3_GENERIC=y -+CONFIG_SPL_USB_DWC3_GENERIC=y -+CONFIG_USB_HOST_ETHER=y -+CONFIG_USB_ETHER_ASIX=y -+CONFIG_USB_ETHER_ASIX88179=y -+CONFIG_USB_ETHER_LAN75XX=y -+CONFIG_USB_ETHER_LAN78XX=y -+CONFIG_USB_ETHER_MCS7830=y -+CONFIG_USB_ETHER_RTL8152=y -+CONFIG_USB_ETHER_SMSC95XX=y -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_DOWNLOAD=y -+CONFIG_USB_FUNCTION_ROCKUSB=y -+CONFIG_ERRNO_STR=y ---- a/doc/board/rockchip/rockchip.rst -+++ b/doc/board/rockchip/rockchip.rst -@@ -122,6 +122,7 @@ List of mainline supported Rockchip boar - - Radxa ROCK 3B (rock-3b-rk3568) - - * rk3588 -+ - ArmSoM Sige7 (sige7-rk3588) - - Rockchip EVB (evb-rk3588) - - Edgeble Neural Compute Module 6A SoM - Neu6a (neu6a-io-rk3588) - - Edgeble Neural Compute Module 6B SoM - Neu6b (neu6b-io-rk3588) ---- /dev/null -+++ b/include/configs/sige7-rk3588.h -@@ -0,0 +1,15 @@ -+/* SPDX-License-Identifier: GPL-2.0+ */ -+/* -+ * Copyright (c) 2024 ArmSoM Technology Co., Ltd. -+ */ -+ -+#ifndef __SIGE7_RK3588_H -+#define __SIGE7_RK3588_H -+ -+#define ROCKCHIP_DEVICE_SETTINGS \ -+ "stdout=serial,vidconsole\0" \ -+ "stderr=serial,vidconsole\0" -+ -+#include -+ -+#endif /* __SIGE7_RK3588_H */ diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 957159201c5b2d..73f34d8edadf18 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-10-10 -PKG_SOURCE_VERSION:=6a1199463fc8f7758c32122613288ed95c09e3bd -PKG_MIRROR_HASH:=4b42a586e098c1dc5970fbd3190ac2faf67992c7357161a3ef3040817a8ed8d6 +PKG_SOURCE_DATE:=2024-10-11.1 +PKG_SOURCE_VERSION:=ecca0e77b4bce629ec1f79d83bbd14a68f919188 +PKG_MIRROR_HASH:=770823f282c76532567a651bb020208c3ddd5a728c656fcde43129fc95edf538 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 649b7ccd85bdb4..771d7dadafd119 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2024-09-21 -PKG_SOURCE_VERSION:=24f9a93a9559c93cf1e794fdfcd87a38d27a8e0e -PKG_MIRROR_HASH:=a3baa049b86f65cf9709d57bb5a9ea7a5b7405f63c77e2bd641fe9b59865838c +PKG_SOURCE_DATE:=2024-10-06 +PKG_SOURCE_VERSION:=3c6265fdbd02ebd35fa3e7a58d6dfeed081a09d7 +PKG_MIRROR_HASH:=00b01243b99995dc52a047e5663cf5c7732f8defd6b726f73ac15e142b02b4fa PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 6d5db5c7040582..5f1ebd4e7d1bb7 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -9,28 +9,38 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp -PKG_RELEASE:=6 +PKG_VERSION:=2.5.1 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/paulusmack/ppp -PKG_SOURCE_DATE:=2021-01-04 -PKG_SOURCE_VERSION:=4fb319056f168bb8379865b91b4fd3e1ada73f1e -PKG_MIRROR_HASH:=58b415e17bdcac81bb9594a1b2ba65ec90598817850d22e98c1690e8ed0cd3d8 +PKG_SOURCE_URL:=https://github.com/ppp-project/ppp +PKG_SOURCE_DATE:=2024-09-18 +PKG_SOURCE_VERSION:=d5aeec65752d4a9b3bb46771d0b221c4a4a6539e +PKG_MIRROR_HASH:=b98125933d8160ff3476b053414e787e65a94948c0ecee53f6261cd403ff4b03 + PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-4-Clause PKG_CPE_ID:=cpe:/a:samba:ppp -PKG_RELEASE_VERSION:=2.4.9 -PKG_VERSION:=$(PKG_RELEASE_VERSION)_git$(subst -,,$(PKG_SOURCE_DATE)) - -PKG_BUILD_DEPENDS:=libpcap - PKG_ASLR_PIE_REGULAR:=1 +PKG_BUILD_DEPENDS:=libpcap PKG_BUILD_FLAGS:=gc-sections lto PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk +CONFIGURE_VARS += \ + enable_eaptls=no \ + enable_microsoft_extensions=yes \ + enable_peap=no + +CONFIGURE_ARGS += \ + with_openssl=no \ + with_pam=no \ + with_pcap=no \ + with_srp=no \ + with_static_pcap=yes define Package/ppp/Default SECTION:=net @@ -174,51 +184,23 @@ This tool performs the same discovery process as pppoe, but does not initiate a session. Can be useful to debug pppoe. endef - -define Build/Configure -$(call Build/Configure/Default,, \ - UNAME_S="Linux" \ - UNAME_R="$(LINUX_VERSION)" \ - UNAME_M="$(ARCH)" \ -) - mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux - $(CP) \ - $(LINUX_DIR)/include/linux/compiler.h \ - $(LINUX_DIR)/include/$(LINUX_UAPI_DIR)linux/atm*.h \ - $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/ - - # Kernel 4.14.9+ only, ignore the exit status of cp in case the file - # doesn't exits - -$(CP) $(LINUX_DIR)/include/linux/compiler_types.h \ - $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/ -endef - -MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \ - PRECOMPILED_FILTER=1 \ - STAGING_DIR="$(STAGING_DIR)" - ifeq ($(BUILD_VARIANT),multilink) - MAKE_FLAGS += HAVE_MULTILINK=y -else - MAKE_FLAGS += HAVE_MULTILINK= -endif - -ifdef CONFIG_USE_MUSL - MAKE_FLAGS += USE_LIBUTIL= + CONFIGURE_VARS += \ + enable_multilink=yes endif define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/include/pppd $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/pppd $(1)/usr/include/ endef define Package/ppp/script_install endef define Package/ppp/install - $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) + $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION) $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pppd $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/ppp $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/ $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/ @@ -233,21 +215,21 @@ endef Package/ppp-multilink/install=$(Package/ppp/install) define Package/ppp-mod-pppoa/install - $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pppoatm.so \ - $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/ + $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION) + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/pppoatm.so \ + $(1)/usr/lib/pppd/$(PKG_VERSION)/ endef define Package/ppp-mod-pppoe/install - $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pppoe.so \ - $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/ + $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION) + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/pppoe.so \ + $(1)/usr/lib/pppd/$(PKG_VERSION)/ endef define Package/ppp-mod-radius/install - $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/radius.so \ - $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/ + $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION) + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/radius.so \ + $(1)/usr/lib/pppd/$(PKG_VERSION)/ $(INSTALL_DIR) $(1)/etc/ppp $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/ $(INSTALL_DIR) $(1)/etc/ppp/radius @@ -258,43 +240,43 @@ define Package/ppp-mod-radius/install endef define Package/ppp-mod-pppol2tp/install - $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pppol2tp.so \ - $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/ + $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION) + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/pppol2tp.so \ + $(1)/usr/lib/pppd/$(PKG_VERSION)/ endef define Package/ppp-mod-pptp/install - $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pptp.so \ - $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/ + $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION) + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/pptp.so \ + $(1)/usr/lib/pppd/$(PKG_VERSION)/ $(INSTALL_DIR) $(1)/etc/ppp $(INSTALL_DATA) ./files/etc/ppp/options.pptp $(1)/etc/ppp/ endef define Package/ppp-mod-passwordfd/install - $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/passwordfd.so \ - $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/ + $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION) + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/passwordfd.so \ + $(1)/usr/lib/pppd/$(PKG_VERSION)/ endef define Package/chat/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/chat $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chat $(1)/usr/sbin/ endef define Package/pppdump/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppdump $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pppdump $(1)/usr/sbin/ endef define Package/pppstats/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pppstats $(1)/usr/sbin/ endef define Package/pppoe-discovery/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppoe-discovery $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-discovery $(1)/usr/sbin/ endef $(eval $(call BuildPackage,ppp)) diff --git a/package/network/services/ppp/patches/010-use_target_for_configure.patch b/package/network/services/ppp/patches/010-use_target_for_configure.patch deleted file mode 100644 index 9e8618f83ced46..00000000000000 --- a/package/network/services/ppp/patches/010-use_target_for_configure.patch +++ /dev/null @@ -1,24 +0,0 @@ -configure: Allow overriding uname results - -In a cross compile setting it makes no sense to rely on the "uname" values -reported by the build host system. This patch allows overriding the -"uname -r", "uname -s" and "uname -m" results with the "UNAME_R", "UNAME_S" -and "UNAME_M" environment variables. - -Signed-off-by: Jo-Philipp Wich - ---- a/configure -+++ b/configure -@@ -10,9 +10,9 @@ CROSS_COMPILE= - CC=cc - CFLAGS= - --system=`uname -s` --release=`uname -r` --arch=`uname -m` -+system=${UNAME_S:-`uname -s`} -+release=${UNAME_R:-`uname -r`} -+arch=${UNAME_M:-`uname -m`} - state="unknown" - - case $system in diff --git a/package/network/services/ppp/patches/101-pppd-crypto-fix-build-without-openssl.patch b/package/network/services/ppp/patches/101-pppd-crypto-fix-build-without-openssl.patch new file mode 100644 index 00000000000000..eb243694ec7127 --- /dev/null +++ b/package/network/services/ppp/patches/101-pppd-crypto-fix-build-without-openssl.patch @@ -0,0 +1,45 @@ +From: Shiji Yang +Date: Fri, 4 Oct 2024 12:19:42 +0000 +Subject: [PATCH] pppd/crypto: fix build without openssl + +Compile openssl relevant code only when PPP_WITH_OPENSSL is defined. + +Signed-off-by: Shiji Yang +--- + pppd/crypto.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/pppd/crypto.c ++++ b/pppd/crypto.c +@@ -199,6 +199,7 @@ int PPP_crypto_init() + { + int retval = 0; + ++#ifdef PPP_WITH_OPENSSL + #if OPENSSL_VERSION_NUMBER >= 0x30000000L + g_crypto_ctx.legacy = OSSL_PROVIDER_load(NULL, "legacy"); + if (g_crypto_ctx.legacy == NULL) +@@ -214,6 +215,7 @@ int PPP_crypto_init() + goto done; + } + #endif ++#endif + + retval = 1; + +@@ -224,6 +226,7 @@ done: + + int PPP_crypto_deinit() + { ++#ifdef PPP_WITH_OPENSSL + #if OPENSSL_VERSION_NUMBER >= 0x30000000L + if (g_crypto_ctx.legacy) { + OSSL_PROVIDER_unload(g_crypto_ctx.legacy); +@@ -239,6 +242,7 @@ int PPP_crypto_deinit() + #if OPENSSL_VERSION_NUMBER < 0x10100000L + ERR_free_strings(); + #endif ++#endif + return 1; + } + diff --git a/package/network/services/ppp/patches/102-pppd-make-pid-directory-before-create-the-pid-file.patch b/package/network/services/ppp/patches/102-pppd-make-pid-directory-before-create-the-pid-file.patch new file mode 100644 index 00000000000000..69e68cdff409c2 --- /dev/null +++ b/package/network/services/ppp/patches/102-pppd-make-pid-directory-before-create-the-pid-file.patch @@ -0,0 +1,27 @@ +From: Shiji Yang +Date: Fri, 4 Oct 2024 14:02:14 +0000 +Subject: [PATCH] pppd: make pid directory before create the pid file + +If multilink feature is not enabled, the '/var/run/pppd' directory +won't be created before adding pid file. + +Fixes error message: +'Failed to create pid file /var/run/pppd/pppoe-wan.pid: No such file or directory' + +Signed-off-by: Shiji Yang +--- + pppd/main.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/pppd/main.c ++++ b/pppd/main.c +@@ -921,6 +921,9 @@ create_pidfile(int pid) + { + FILE *pidfile; + ++#ifndef PPP_WITH_TDB ++ mkdir_recursive(PPP_PATH_VARRUN); ++#endif + slprintf(pidfilename, sizeof(pidfilename), "%s/%s.pid", + PPP_PATH_VARRUN, ifname); + if ((pidfile = fopen(pidfilename, "w")) != NULL) { diff --git a/package/network/services/ppp/patches/103-pppd-crypto-fix-gcc-14-build.patch b/package/network/services/ppp/patches/103-pppd-crypto-fix-gcc-14-build.patch new file mode 100644 index 00000000000000..3a76deb0427e2e --- /dev/null +++ b/package/network/services/ppp/patches/103-pppd-crypto-fix-gcc-14-build.patch @@ -0,0 +1,42 @@ +From: Tan Zien +Date: Tue, 1 Oct 2024 10:38:45 +0800 +Subject: [PATCH] pppd/crypto: fix gcc 14 build + +fix this: + +crypto.c: In function 'PPP_crypto_error': +crypto.c:178:11: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration] + 178 | off = vsnprintf(buf, len, fmt, args); + | ^~~~~~~~~ +crypto.c:41:1: note: include '' or provide a declaration of 'vsnprintf' + 40 | #include "crypto-priv.h" + +++ |+#include + 41 | +crypto.c:178:26: warning: 'vsnprintf' argument 2 type is 'int' where 'long unsigned int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch] + 178 | off = vsnprintf(buf, len, fmt, args); + | ^~~ +: note: built-in 'vsnprintf' declared here + +Signed-off-by: Tan Zien +--- + pppd/crypto.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/pppd/crypto.c ++++ b/pppd/crypto.c +@@ -34,6 +34,7 @@ + + #include + #include ++#include + + #include "pppd.h" + #include "crypto.h" +@@ -247,7 +248,6 @@ int PPP_crypto_deinit() + } + + #ifdef UNIT_TEST +-#include + + int debug; + int error_count; diff --git a/package/network/services/ppp/patches/105-debian_demand.patch b/package/network/services/ppp/patches/105-debian_demand.patch index ff66aa8ea5a090..10ce13b25355f4 100644 --- a/package/network/services/ppp/patches/105-debian_demand.patch +++ b/package/network/services/ppp/patches/105-debian_demand.patch @@ -1,6 +1,6 @@ --- a/pppd/demand.c +++ b/pppd/demand.c -@@ -36,6 +36,8 @@ +@@ -40,6 +40,8 @@ #include #include #include @@ -9,16 +9,16 @@ #include #include #include -@@ -43,6 +45,8 @@ +@@ -47,6 +49,8 @@ #include #include #include +#include +#include - #ifdef PPP_FILTER + #ifdef PPP_WITH_FILTER #include #endif -@@ -218,6 +222,14 @@ loop_chars(unsigned char *p, int n) +@@ -223,6 +227,14 @@ loop_chars(unsigned char *p, int n) int c, rv; rv = 0; @@ -33,7 +33,7 @@ for (; n > 0; --n) { c = *p++; if (c == PPP_FLAG) { -@@ -294,16 +306,100 @@ loop_frame(unsigned char *frame, int len +@@ -299,16 +311,100 @@ loop_frame(unsigned char *frame, int len * loopback, now that the real serial link is up. */ void @@ -137,7 +137,7 @@ } else { --- a/pppd/ipcp.c +++ b/pppd/ipcp.c -@@ -1850,7 +1850,7 @@ ipcp_up(fsm *f) +@@ -1915,7 +1915,7 @@ ipcp_up(fsm *f) proxy_arp_set[f->unit] = 1; } @@ -148,7 +148,7 @@ } else { --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c -@@ -1253,7 +1253,7 @@ ipv6cp_up(fsm *f) +@@ -1338,7 +1338,7 @@ ipv6cp_up(fsm *f) if (sif6defaultroute(f->unit, go->ourid, ho->hisid)) default_route_set[f->unit] = 1; } @@ -157,14 +157,14 @@ sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); } else { ---- a/pppd/pppd.h -+++ b/pppd/pppd.h -@@ -598,7 +598,7 @@ void demand_conf(void); /* config interf +--- a/pppd/pppd-private.h ++++ b/pppd/pppd-private.h +@@ -368,7 +368,7 @@ void demand_conf(void); /* config interf void demand_block(void); /* set all NPs to queue up packets */ void demand_unblock(void); /* set all NPs to pass packets */ void demand_discard(void); /* set all NPs to discard packets */ -void demand_rexmit(int); /* retransmit saved frames for an NP */ -+void demand_rexmit(int, u_int32_t); /* retransmit saved frames for an NP*/ ++void demand_rexmit(int, u_int32_t); /* retransmit saved frames for an NP */ int loop_chars(unsigned char *, int); /* process chars from loopback */ int loop_frame(unsigned char *, int); /* should we bring link up? */ diff --git a/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch b/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch deleted file mode 100644 index 11e8d81f43178a..00000000000000 --- a/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch +++ /dev/null @@ -1,95 +0,0 @@ -pppd: Allow specifying ipv6-up and ipv6-down scripts - -This patch implements the "ipv6-up-script" and "ipv6-down-script" options -which allow to specify the path of the ipv6-up and ipv6-down scripts to call. - -These options default to _PATH_IPV6UP and _PATH_IPV6DOWN to retain the -existing behaviour. - -The patch originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/main.c -+++ b/pppd/main.c -@@ -295,6 +295,8 @@ main(int argc, char *argv[]) - - strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup)); - strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown)); -+ strlcpy(path_ipv6up, _PATH_IPV6UP, sizeof(path_ipv6up)); -+ strlcpy(path_ipv6down, _PATH_IPV6DOWN, sizeof(path_ipv6down)); - - link_stats_valid = 0; - new_phase(PHASE_INITIALIZE); ---- a/pppd/options.c -+++ b/pppd/options.c -@@ -118,6 +118,8 @@ int req_unit = -1; /* requested interfa - char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ - char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */ - char req_ifname[MAXIFNAMELEN]; /* requested interface name */ -+char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */ -+char path_ipv6down[MAXPATHLEN];/* pathname of ipv6-down script */ - bool multilink = 0; /* Enable multilink operation */ - char *bundle_name = NULL; /* bundle name for multilink */ - bool dump_options; /* print out option values */ -@@ -324,6 +326,13 @@ option_t general_options[] = { - "Set pathname of ip-down script", - OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, - -+ { "ipv6-up-script", o_string, path_ipv6up, -+ "Set pathname of ipv6-up script", -+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, -+ { "ipv6-down-script", o_string, path_ipv6down, -+ "Set pathname of ipv6-down script", -+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, -+ - #ifdef HAVE_MULTILINK - { "multilink", o_bool, &multilink, - "Enable multilink operation", OPT_PRIO | 1 }, ---- a/pppd/ipv6cp.c -+++ b/pppd/ipv6cp.c -@@ -1295,7 +1295,7 @@ ipv6cp_up(fsm *f) - */ - if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_up; -- ipv6cp_script(_PATH_IPV6UP); -+ ipv6cp_script(path_ipv6up); - } - } - -@@ -1346,7 +1346,7 @@ ipv6cp_down(fsm *f) - /* Execute the ipv6-down script */ - if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_down; -- ipv6cp_script(_PATH_IPV6DOWN); -+ ipv6cp_script(path_ipv6down); - } - } - -@@ -1384,13 +1384,13 @@ ipv6cp_script_done(void *arg) - case s_up: - if (ipv6cp_fsm[0].state != OPENED) { - ipv6cp_script_state = s_down; -- ipv6cp_script(_PATH_IPV6DOWN); -+ ipv6cp_script(path_ipv6down); - } - break; - case s_down: - if (ipv6cp_fsm[0].state == OPENED) { - ipv6cp_script_state = s_up; -- ipv6cp_script(_PATH_IPV6UP); -+ ipv6cp_script(path_ipv6up); - } - break; - } ---- a/pppd/pppd.h -+++ b/pppd/pppd.h -@@ -328,6 +328,8 @@ extern int req_unit; /* interface unit n - extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ - extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ - extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */ -+extern char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */ -+extern char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */ - extern bool multilink; /* enable multilink operation */ - extern bool noendpoint; /* don't send or accept endpt. discrim. */ - extern char *bundle_name; /* bundle name for multilink */ diff --git a/package/network/services/ppp/patches/133-fix_sha1_include.patch b/package/network/services/ppp/patches/133-fix_sha1_include.patch deleted file mode 100644 index 357d9514418a33..00000000000000 --- a/package/network/services/ppp/patches/133-fix_sha1_include.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/pppd/sha1.c -+++ b/pppd/sha1.c -@@ -19,7 +19,7 @@ - #include - #include - #include /* htonl() */ --#include -+#include "pppd.h" - #include "sha1.h" - - static void diff --git a/package/network/services/ppp/patches/140-pppd-Fix-compilation-with-older-glibc-or-kernel-head.patch b/package/network/services/ppp/patches/140-pppd-Fix-compilation-with-older-glibc-or-kernel-head.patch deleted file mode 100644 index 154ac7270bf311..00000000000000 --- a/package/network/services/ppp/patches/140-pppd-Fix-compilation-with-older-glibc-or-kernel-head.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 98ec18f098e5ef68e3a8cc6954fcaf5a7fb8b7be Mon Sep 17 00:00:00 2001 -From: pali <7141871+pali@users.noreply.github.com> -Date: Mon, 15 Feb 2021 07:54:01 +0100 -Subject: [PATCH] pppd: Fix compilation with older glibc or kernel headers - (#248) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -glibc versions prior to 2.24 do not define SOL_NETLINK and linux kernel -versions prior to 4.3 do not define NETLINK_CAP_ACK. So add fallback -definitions for these macros into pppd/sys-linux.c file. - -Also extend description why we call SOL_NETLINK/NETLINK_CAP_ACK option. - -Signed-off-by: Pali Rohár ---- - pppd/sys-linux.c | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -125,6 +125,14 @@ - #include - #include - #include -+/* glibc versions prior to 2.24 do not define SOL_NETLINK */ -+#ifndef SOL_NETLINK -+#define SOL_NETLINK 270 -+#endif -+/* linux kernel versions prior to 4.3 do not define/support NETLINK_CAP_ACK */ -+#ifndef NETLINK_CAP_ACK -+#define NETLINK_CAP_ACK 10 -+#endif - #endif - - #include "pppd.h" -@@ -2843,7 +2851,15 @@ static int append_peer_ipv6_address(unsi - if (fd < 0) - return 0; - -- /* do not ask for error message content */ -+ /* -+ * Tell kernel to not send to us payload of acknowledgment error message. -+ * NETLINK_CAP_ACK option is supported since Linux kernel version 4.3 and -+ * older kernel versions always send full payload in acknowledgment netlink -+ * message. We ignore payload of this message as we need only error code, -+ * to check if our set remote peer address request succeeded or failed. -+ * So ignore return value from the following setsockopt() call as setting -+ * option NETLINK_CAP_ACK means for us just a kernel hint / optimization. -+ */ - one = 1; - setsockopt(fd, SOL_NETLINK, NETLINK_CAP_ACK, &one, sizeof(one)); - diff --git a/package/network/services/ppp/patches/141-Expand-byte-count-statistics-to-64-bits-298.patch b/package/network/services/ppp/patches/141-Expand-byte-count-statistics-to-64-bits-298.patch deleted file mode 100644 index e4de5c0aa21534..00000000000000 --- a/package/network/services/ppp/patches/141-Expand-byte-count-statistics-to-64-bits-298.patch +++ /dev/null @@ -1,518 +0,0 @@ -From 81ad945630120cc1c27c8bb00503be42b76ff202 Mon Sep 17 00:00:00 2001 -From: Jaco Kroon -Date: Thu, 13 Jan 2022 08:38:04 +0200 -Subject: [PATCH] Expand byte count statistics to 64 bits (#298) - -* Add Gigawords to radius packets where applicable. - -IMPORTANT NOTE: The ioctl() only supports 32-bit counters. In order t -obtain 64-bit counters, these are now pulled in from sysfs (it's assumed -to be mounted on /sys which I'm assuming is standard). - -It is unknown whether sysfs will be available everywhere, as such, keep -the ioctl() method in place, but attempt to detect wrap-overs. - -If the sysfs mechanism fails, fail back to the ioctl(). - -Given maximum data rates, the intervals between calling this needs to be -such that no more than 4GB (2^32) bytes are sent or received in any -given interval. Mostly important for radius plugin where data -accounting may be in effect. - -Towards this, a timer interval on 25 seconds is set to force a ioctl() -poll irrespective of the rate of stats update calls. This may be -important for especially radius that needs to provide interim-update -intervals, if the interim updates is too long and the counters could -wrap-over twice in a single interval. At 25 seconds we should detect -all wraps up to an effective data rate of 1.37Gbps, which for my -purposes is adequate. - -Possible downsides, 4 files are opened, read and closed every time -statistics is requested. This results in 12 system calls every single -time statistics is required, compared to 1 for the ioctl. Efficiency is -unknown, but as a rule of thumb fewer system calls are better, this is -however not a critical path in my opinion, so should not be a problem. -If required I can run a few benchmarks using gettimeofday() to measure -actual impact. - -Signed-off-by: Jaco Kroon - -* Use netlink if possible to obtain 64-bit stats. - -This uses two system calls per round. - -This should be preferred where available. It seems the RTM_GETSTATS was -only added from 2016 some point (4.7.0 as per pali), which is in my -opinion old, but given experience with certain embedded systems does -need to be supported. - -Signed-off-by: Jaco Kroon - -Co-authored-by: Jaco Kroon ---- - pppd/main.c | 5 +- - pppd/plugins/radius/etc/dictionary | 2 + - pppd/plugins/radius/radius.c | 28 ++- - pppd/plugins/radius/radiusclient.h | 2 + - pppd/pppd.h | 9 +- - pppd/sys-linux.c | 281 ++++++++++++++++++++++++++++- - 6 files changed, 313 insertions(+), 14 deletions(-) - ---- a/pppd/main.c -+++ b/pppd/main.c -@@ -87,6 +87,7 @@ - #include - #include - #include -+#include - - #include "pppd.h" - #include "magic.h" -@@ -1230,9 +1231,9 @@ update_link_stats(int u) - - slprintf(numbuf, sizeof(numbuf), "%u", link_connect_time); - script_setenv("CONNECT_TIME", numbuf, 0); -- slprintf(numbuf, sizeof(numbuf), "%u", link_stats.bytes_out); -+ snprintf(numbuf, sizeof(numbuf), "%" PRIu64, link_stats.bytes_out); - script_setenv("BYTES_SENT", numbuf, 0); -- slprintf(numbuf, sizeof(numbuf), "%u", link_stats.bytes_in); -+ snprintf(numbuf, sizeof(numbuf), "%" PRIu64, link_stats.bytes_in); - script_setenv("BYTES_RCVD", numbuf, 0); - } - ---- a/pppd/plugins/radius/etc/dictionary -+++ b/pppd/plugins/radius/etc/dictionary -@@ -82,6 +82,8 @@ ATTRIBUTE Acct-Session-Time 46 integer - ATTRIBUTE Acct-Input-Packets 47 integer - ATTRIBUTE Acct-Output-Packets 48 integer - ATTRIBUTE Acct-Terminate-Cause 49 integer -+ATTRIBUTE Acct-Input-Gigawords 52 integer -+ATTRIBUTE Acct-Output-Gigawords 53 integer - ATTRIBUTE Chap-Challenge 60 string - ATTRIBUTE NAS-Port-Type 61 integer - ATTRIBUTE Port-Limit 62 integer ---- a/pppd/plugins/radius/radius.c -+++ b/pppd/plugins/radius/radius.c -@@ -1020,12 +1020,22 @@ radius_acct_stop(void) - av_type = link_connect_time; - rc_avpair_add(&send, PW_ACCT_SESSION_TIME, &av_type, 0, VENDOR_NONE); - -- av_type = link_stats.bytes_out; -+ av_type = link_stats.bytes_out & 0xFFFFFFFF; - rc_avpair_add(&send, PW_ACCT_OUTPUT_OCTETS, &av_type, 0, VENDOR_NONE); - -- av_type = link_stats.bytes_in; -+ if (link_stats.bytes_out > 0xFFFFFFFF) { -+ av_type = link_stats.bytes_out >> 32; -+ rc_avpair_add(&send, PW_ACCT_OUTPUT_GIGAWORDS, &av_type, 0, VENDOR_NONE); -+ } -+ -+ av_type = link_stats.bytes_in & 0xFFFFFFFF; - rc_avpair_add(&send, PW_ACCT_INPUT_OCTETS, &av_type, 0, VENDOR_NONE); - -+ if (link_stats.bytes_in > 0xFFFFFFFF) { -+ av_type = link_stats.bytes_in >> 32; -+ rc_avpair_add(&send, PW_ACCT_INPUT_GIGAWORDS, &av_type, 0, VENDOR_NONE); -+ } -+ - av_type = link_stats.pkts_out; - rc_avpair_add(&send, PW_ACCT_OUTPUT_PACKETS, &av_type, 0, VENDOR_NONE); - -@@ -1172,12 +1182,22 @@ radius_acct_interim(void *ignored) - av_type = link_connect_time; - rc_avpair_add(&send, PW_ACCT_SESSION_TIME, &av_type, 0, VENDOR_NONE); - -- av_type = link_stats.bytes_out; -+ av_type = link_stats.bytes_out & 0xFFFFFFFF; - rc_avpair_add(&send, PW_ACCT_OUTPUT_OCTETS, &av_type, 0, VENDOR_NONE); - -- av_type = link_stats.bytes_in; -+ if (link_stats.bytes_out > 0xFFFFFFFF) { -+ av_type = link_stats.bytes_out >> 32; -+ rc_avpair_add(&send, PW_ACCT_OUTPUT_GIGAWORDS, &av_type, 0, VENDOR_NONE); -+ } -+ -+ av_type = link_stats.bytes_in & 0xFFFFFFFF; - rc_avpair_add(&send, PW_ACCT_INPUT_OCTETS, &av_type, 0, VENDOR_NONE); - -+ if (link_stats.bytes_in > 0xFFFFFFFF) { -+ av_type = link_stats.bytes_in >> 32; -+ rc_avpair_add(&send, PW_ACCT_INPUT_GIGAWORDS, &av_type, 0, VENDOR_NONE); -+ } -+ - av_type = link_stats.pkts_out; - rc_avpair_add(&send, PW_ACCT_OUTPUT_PACKETS, &av_type, 0, VENDOR_NONE); - ---- a/pppd/plugins/radius/radiusclient.h -+++ b/pppd/plugins/radius/radiusclient.h -@@ -184,6 +184,8 @@ typedef struct pw_auth_hdr - #define PW_ACCT_LINK_COUNT 51 /* integer */ - - /* From RFC 2869 */ -+#define PW_ACCT_INPUT_GIGAWORDS 52 /* integer */ -+#define PW_ACCT_OUTPUT_GIGAWORDS 53 /* integer */ - #define PW_ACCT_INTERIM_INTERVAL 85 /* integer */ - - /* Merit Experimental Extensions */ ---- a/pppd/pppd.h -+++ b/pppd/pppd.h -@@ -53,6 +53,7 @@ - #include /* for encrypt */ - #include /* for setkey */ - #include -+#include - #include /* for NGROUPS_MAX */ - #include /* for MAXPATHLEN and BSD4_4, if defined */ - #include /* for u_int32_t, if defined */ -@@ -173,8 +174,8 @@ struct permitted_ip { - * pppd needs. - */ - struct pppd_stats { -- unsigned int bytes_in; -- unsigned int bytes_out; -+ uint64_t bytes_in; -+ uint64_t bytes_out; - unsigned int pkts_in; - unsigned int pkts_out; - }; -@@ -347,7 +348,7 @@ extern char *max_tls_version; - extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ - extern int maxoctets_dir; /* Direction : - 0 - in+out (default) -- 1 - in -+ 1 - in - 2 - out - 3 - max(in,out) */ - extern int maxoctets_timeout; /* Timeout for check of octets limit */ -@@ -356,7 +357,7 @@ extern int maxoctets_timeout; /* - #define PPP_OCTETS_DIRECTION_OUT 2 - #define PPP_OCTETS_DIRECTION_MAXOVERAL 3 - /* same as previos, but little different on RADIUS side */ --#define PPP_OCTETS_DIRECTION_MAXSESSION 4 -+#define PPP_OCTETS_DIRECTION_MAXSESSION 4 - #endif - - #ifdef PPP_FILTER ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -79,6 +79,7 @@ - #include - - #include -+#include - #include - #include - #include -@@ -92,6 +93,7 @@ - #include - #include - #include -+#include - - /* This is in netdevice.h. However, this compile will fail miserably if - you attempt to include netdevice.h because it has so many references -@@ -121,9 +123,19 @@ - #include - #include - --#ifdef INET6 - #include - #include -+#include -+/* Attempt at retaining compile-support with older than 4.7 kernels, or kernels -+ * where RTM_NEWSTATS isn't defined for whatever reason. -+ */ -+#ifndef RTM_NEWSTATS -+#define RTM_NEWSTATS 92 -+#define RTM_GETSTATS 94 -+#define IFLA_STATS_LINK_64 1 -+#endif -+ -+#ifdef INET6 - #include - /* glibc versions prior to 2.24 do not define SOL_NETLINK */ - #ifndef SOL_NETLINK -@@ -1407,11 +1419,17 @@ get_idle_time(int u, struct ppp_idle *ip - - /******************************************************************** - * -- * get_ppp_stats - return statistics for the link. -+ * get_ppp_stats_iocl - return statistics for the link, using the ioctl() method, -+ * this only supports 32-bit counters, so need to count the wraps. - */ --int --get_ppp_stats(int u, struct pppd_stats *stats) -+static int -+get_ppp_stats_ioctl(int u, struct pppd_stats *stats) - { -+ static u_int32_t previbytes = 0; -+ static u_int32_t prevobytes = 0; -+ static u_int32_t iwraps = 0; -+ static u_int32_t owraps = 0; -+ - struct ifpppstatsreq req; - - memset (&req, 0, sizeof (req)); -@@ -1426,7 +1444,262 @@ get_ppp_stats(int u, struct pppd_stats * - stats->bytes_out = req.stats.p.ppp_obytes; - stats->pkts_in = req.stats.p.ppp_ipackets; - stats->pkts_out = req.stats.p.ppp_opackets; -+ -+ if (stats->bytes_in < previbytes) -+ ++iwraps; -+ if (stats->bytes_out < prevobytes) -+ ++owraps; -+ -+ previbytes = stats->bytes_in; -+ prevobytes = stats->bytes_out; -+ -+ stats->bytes_in += (uint64_t)iwraps << 32; -+ stats->bytes_out += (uint64_t)owraps << 32; -+ -+ return 1; -+} -+ -+/******************************************************************** -+ * get_ppp_stats_rtnetlink - return statistics for the link, using rtnetlink -+ * This provides native 64-bit counters. -+ */ -+static int -+get_ppp_stats_rtnetlink(int u, struct pppd_stats *stats) -+{ -+ static int rtnl_fd = -1; -+ -+ struct sockaddr_nl nladdr; -+ struct { -+ struct nlmsghdr nlh; -+ struct if_stats_msg ifsm; -+ } nlreq; -+ struct nlresp { -+ struct nlmsghdr nlh; -+ union { -+ struct { -+ struct nlmsgerr nlerr; -+ char __end_err[0]; -+ }; -+ struct { -+ struct rtmsg rth; -+ struct { -+ /* We only case about these first fields from rtnl_link_stats64 */ -+ uint64_t rx_packets; -+ uint64_t tx_packets; -+ uint64_t rx_bytes; -+ uint64_t tx_bytes; -+ } stats; -+ char __end_stats[0]; -+ }; -+ }; -+ } nlresp; -+ ssize_t nlresplen; -+ struct iovec iov; -+ struct msghdr msg; -+ -+ memset(&nladdr, 0, sizeof(nladdr)); -+ nladdr.nl_family = AF_NETLINK; -+ -+ if (rtnl_fd < 0) { -+ rtnl_fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); -+ if (rtnl_fd < 0) { -+ error("get_ppp_stats_rtnetlink: error creating NETLINK socket: %m (line %d)", __LINE__); -+ return 0; -+ } -+ -+ if (bind(rtnl_fd, (struct sockaddr *)&nladdr, sizeof(nladdr)) < 0) { -+ error("get_ppp_stats_rtnetlink: bind(AF_NETLINK): %m (line %d)", __LINE__); -+ goto err; -+ } -+ } -+ -+ memset(&nlreq, 0, sizeof(nlreq)); -+ nlreq.nlh.nlmsg_len = sizeof(nlreq); -+ nlreq.nlh.nlmsg_type = RTM_GETSTATS; -+ nlreq.nlh.nlmsg_flags = NLM_F_REQUEST; -+ -+ nlreq.ifsm.ifindex = if_nametoindex(ifname); -+ nlreq.ifsm.filter_mask = IFLA_STATS_LINK_64; -+ -+ memset(&iov, 0, sizeof(iov)); -+ iov.iov_base = &nlreq; -+ iov.iov_len = sizeof(nlreq); -+ -+ memset(&msg, 0, sizeof(msg)); -+ msg.msg_name = &nladdr; -+ msg.msg_namelen = sizeof(nladdr); -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ -+ if (sendmsg(rtnl_fd, &msg, 0) < 0) { -+ error("get_ppp_stats_rtnetlink: sendmsg(RTM_GETSTATS): %m (line %d)", __LINE__); -+ goto err; -+ } -+ -+ /* We just need to repoint to IOV ... everything else stays the same */ -+ iov.iov_base = &nlresp; -+ iov.iov_len = sizeof(nlresp); -+ -+ nlresplen = recvmsg(rtnl_fd, &msg, 0); -+ -+ if (nlresplen < 0) { -+ error("get_ppp_stats_rtnetlink: recvmsg(RTM_GETSTATS): %m (line %d)", __LINE__); -+ goto err; -+ } -+ -+ if (nlresplen < sizeof(nlresp.nlh)) { -+ error("get_ppp_stats_rtnetlink: Netlink response message was incomplete (line %d)", __LINE__); -+ goto err; -+ } -+ -+ if (nlresp.nlh.nlmsg_type == NLMSG_ERROR) { -+ if (nlresplen < offsetof(struct nlresp, __end_err)) { -+ if (kernel_version >= KVERSION(4,7,0)) -+ error("get_ppp_stats_rtnetlink: Netlink responded with error: %s (line %d)", strerror(-nlresp.nlerr.error), __LINE__); -+ } else { -+ error("get_ppp_stats_rtnetlink: Netlink responded with an error message, but the nlmsgerr structure is incomplete (line %d).", -+ __LINE__); -+ } -+ goto err; -+ } -+ -+ if (nlresp.nlh.nlmsg_type != RTM_NEWSTATS) { -+ error("get_ppp_stats_rtnetlink: Expected RTM_NEWSTATS response, found something else (mlmsg_type %d, line %d)", -+ nlresp.nlh.nlmsg_type, __LINE__); -+ goto err; -+ } -+ -+ if (nlresplen < offsetof(struct nlresp, __end_stats)) { -+ error("get_ppp_stats_rtnetlink: Obtained an insufficiently sized rtnl_link_stats64 struct from the kernel (line %d).", __LINE__); -+ goto err; -+ } -+ -+ stats->bytes_in = nlresp.stats.rx_bytes; -+ stats->bytes_out = nlresp.stats.tx_bytes; -+ stats->pkts_in = nlresp.stats.rx_packets; -+ stats->pkts_out = nlresp.stats.tx_packets; -+ - return 1; -+err: -+ close(rtnl_fd); -+ rtnl_fd = -1; -+ return 0; -+} -+ -+/******************************************************************** -+ * get_ppp_stats_sysfs - return statistics for the link, using the files in sysfs, -+ * this provides native 64-bit counters. -+ */ -+static int -+get_ppp_stats_sysfs(int u, struct pppd_stats *stats) -+{ -+ char fname[PATH_MAX+1]; -+ char buf[21], *err; /* 2^64 < 10^20 */ -+ int blen, fd, rlen; -+ unsigned long long val; -+ -+ struct { -+ const char* fname; -+ void* ptr; -+ unsigned size; -+ } slist[] = { -+#define statfield(fn, field) { .fname = #fn, .ptr = &stats->field, .size = sizeof(stats->field) } -+ statfield(rx_bytes, bytes_in), -+ statfield(tx_bytes, bytes_out), -+ statfield(rx_packets, pkts_in), -+ statfield(tx_packets, pkts_out), -+#undef statfield -+ }; -+ -+ blen = snprintf(fname, sizeof(fname), "/sys/class/net/%s/statistics/", ifname); -+ if (blen >= sizeof(fname)) -+ return 0; /* ifname max 15, so this should be impossible */ -+ -+ for (int i = 0; i < sizeof(slist) / sizeof(*slist); ++i) { -+ if (snprintf(fname + blen, sizeof(fname) - blen, "%s", slist[i].fname) >= sizeof(fname) - blen) { -+ fname[blen] = 0; -+ error("sysfs stats: filename %s/%s overflowed PATH_MAX", fname, slist[i].fname); -+ return 0; -+ } -+ -+ fd = open(fname, O_RDONLY); -+ if (fd < 0) { -+ error("%s: %m", fname); -+ return 0; -+ } -+ -+ rlen = read(fd, buf, sizeof(buf) - 1); -+ close(fd); -+ if (rlen < 0) { -+ error("%s: %m", fname); -+ return 0; -+ } -+ /* trim trailing \n if present */ -+ while (rlen > 0 && buf[rlen-1] == '\n') -+ rlen--; -+ buf[rlen] = 0; -+ -+ errno = 0; -+ val = strtoull(buf, &err, 10); -+ if (*buf < '0' || *buf > '9' || errno != 0 || *err) { -+ error("string to number conversion error converting %s (from %s) for remaining string %s%s%s", -+ buf, fname, err, errno ? ": " : "", errno ? strerror(errno) : ""); -+ return 0; -+ } -+ switch (slist[i].size) { -+#define stattype(type) case sizeof(type): *(type*)slist[i].ptr = (type)val; break -+ stattype(uint64_t); -+ stattype(uint32_t); -+ stattype(uint16_t); -+ stattype(uint8_t); -+#undef stattype -+ default: -+ error("Don't know how to store stats for %s of size %u", slist[i].fname, slist[i].size); -+ return 0; -+ } -+ } -+ -+ return 1; -+} -+ -+/******************************************************************** -+ * Periodic timer function to be used to keep stats up to date in case of ioctl -+ * polling. -+ * -+ * Given the 25s interval this should be fine up to data rates of 1.37Gbps. -+ * If you do change the timer, remember to also bring the get_ppp_stats (which -+ * sets up the initial trigger) as well. -+ */ -+static void -+ppp_stats_poller(void* u) -+{ -+ struct pppd_stats dummy; -+ get_ppp_stats_ioctl((long)u, &dummy); -+ TIMEOUT(ppp_stats_poller, u, 25); -+} -+ -+/******************************************************************** -+ * get_ppp_stats - return statistics for the link. -+ */ -+int get_ppp_stats(int u, struct pppd_stats *stats) -+{ -+ static int (*func)(int, struct pppd_stats*) = NULL; -+ -+ if (!func) { -+ if (get_ppp_stats_rtnetlink(u, stats)) { -+ func = get_ppp_stats_rtnetlink; -+ return 1; -+ } -+ if (get_ppp_stats_sysfs(u, stats)) { -+ func = get_ppp_stats_sysfs; -+ return 1; -+ } -+ warn("statistics falling back to ioctl which only supports 32-bit counters"); -+ func = get_ppp_stats_ioctl; -+ TIMEOUT(ppp_stats_poller, (void*)(long)u, 25); -+ } -+ -+ return func(u, stats); - } - - /******************************************************************** diff --git a/package/network/services/ppp/patches/142-pppd-Add-support-for-registering-ppp-interface-via-L.patch b/package/network/services/ppp/patches/142-pppd-Add-support-for-registering-ppp-interface-via-L.patch deleted file mode 100644 index 9987d3dce9d15e..00000000000000 --- a/package/network/services/ppp/patches/142-pppd-Add-support-for-registering-ppp-interface-via-L.patch +++ /dev/null @@ -1,299 +0,0 @@ -From 4a54e34cf5629f9fed61f0b7d69ee3ba4d874bc6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Sat, 9 Jul 2022 13:40:24 +0200 -Subject: [PATCH] pppd: Add support for registering ppp interface via Linux - rtnetlink API -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -pppd currently creates ppp network interface via PPPIOCNEWUNIT ioctl API. -This API creates a new ppp network interface named "ppp". If user -supply option "ifname" with custom network name then pppd calls SIOCSIFNAME -ioctl to rename "ppp" to custom name immediately after successful -PPPIOCNEWUNIT ioctl call. If custom name is already registered then -SIOCSIFNAME ioctl fails and pppd close current channel (which destroy also -network interface). - -This has side effect that in the first few miliseconds interface has -different name as what user supplied. - -Tools like systemd, udev or NetworkManager are trying to query -interface attributes based on interface name immediately when new -network interface is created. - -But if interface is renamed immediately after creation then these tools -fails. For example when running pppd with option "ifname ppp-wan" following -error is reported by systemd / udev into dmesg log: - - [ 35.718732] PPP generic driver version 2.4.2 - [ 35.793914] NET: Registered protocol family 24 - [ 35.889924] systemd-udevd[1852]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. - [ 35.901450] ppp-wan: renamed from ppp0 - [ 35.930332] systemd-udevd[1852]: link_config: could not get ethtool features for ppp0 - [ 35.939473] systemd-udevd[1852]: Could not set offload features of ppp0: No such device - -There is an easy way to fix this issue: Use new rtnetlink API. - -Via rtnetlink API it is possible to create ppp network interface with -custom ifname atomically. Just it is not possible to specify custom ppp -unit id. - -So use new rtnetlink API when user requested custom ifname without custom -ppp unit id. This will avoid system issues with interface renaming as ppp -interface is directly registered with specified final name. - -This has also advantage that if requested interface name already exists -then pppd fail during registering of networking interface and not during -renaming network interface which happens after successful registration. - -If user supply custom ppp unit id then it is required to use old ioctl API -as currently it is the only API which allows specifying ppp unit id. - -When user does not specify custom ifname stay also with old ioctl API. -There is currently a bug in kernel which cause that when empty interface is -specified in rtnetlink message for creating ppp interface then kernel -creates ppp interface but with pseudo-random name, not derived from ppp -unit id. And therefore it is not possible to retrieve what is the name of -newly created network interface. So when user does not specify interface -name via "ifname" option (which means that want from kernel to choose some -"free" interface name) it is needed to use old ioctl API which do it -correctly for now. - -Signed-off-by: Pali Rohár ---- - pppd/sys-linux.c | 194 ++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 192 insertions(+), 2 deletions(-) - ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -126,6 +126,11 @@ - #include - #include - #include -+ -+#ifdef INET6 -+#include -+#endif -+ - /* Attempt at retaining compile-support with older than 4.7 kernels, or kernels - * where RTM_NEWSTATS isn't defined for whatever reason. - */ -@@ -135,16 +140,20 @@ - #define IFLA_STATS_LINK_64 1 - #endif - --#ifdef INET6 --#include - /* glibc versions prior to 2.24 do not define SOL_NETLINK */ - #ifndef SOL_NETLINK - #define SOL_NETLINK 270 - #endif -+ - /* linux kernel versions prior to 4.3 do not define/support NETLINK_CAP_ACK */ - #ifndef NETLINK_CAP_ACK - #define NETLINK_CAP_ACK 10 - #endif -+ -+/* linux kernel versions prior to 4.7 do not define/support IFLA_PPP_DEV_FD */ -+#ifndef IFLA_PPP_MAX -+/* IFLA_PPP_DEV_FD is declared as enum when IFLA_PPP_MAX is defined */ -+#define IFLA_PPP_DEV_FD 1 - #endif - - #include "pppd.h" -@@ -657,6 +666,160 @@ void generic_disestablish_ppp(int dev_fd - } - - /* -+ * make_ppp_unit_rtnetlink - register a new ppp network interface for ppp_dev_fd -+ * with specified req_ifname via rtnetlink. Interface name req_ifname must not -+ * be empty. Custom ppp unit id req_unit is ignored and kernel choose some free. -+ */ -+static int make_ppp_unit_rtnetlink(void) -+{ -+ struct { -+ struct nlmsghdr nlh; -+ struct ifinfomsg ifm; -+ struct { -+ struct rtattr rta; -+ char ifname[IFNAMSIZ]; -+ } ifn; -+ struct { -+ struct rtattr rta; -+ struct { -+ struct rtattr rta; -+ char ifkind[sizeof("ppp")]; -+ } ifik; -+ struct { -+ struct rtattr rta; -+ struct { -+ struct rtattr rta; -+ union { -+ int ppp_dev_fd; -+ } ppp; -+ } ifdata[1]; -+ } ifid; -+ } ifli; -+ } nlreq; -+ struct { -+ struct nlmsghdr nlh; -+ struct nlmsgerr nlerr; -+ } nlresp; -+ struct sockaddr_nl nladdr; -+ struct iovec iov; -+ struct msghdr msg; -+ ssize_t nlresplen; -+ int one; -+ int fd; -+ -+ fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); -+ if (fd < 0) { -+ error("make_ppp_unit_rtnetlink: socket(NETLINK_ROUTE): %m (line %d)", __LINE__); -+ return 0; -+ } -+ -+ /* Tell kernel to not send to us payload of acknowledgment error message. */ -+ one = 1; -+ setsockopt(fd, SOL_NETLINK, NETLINK_CAP_ACK, &one, sizeof(one)); -+ -+ memset(&nladdr, 0, sizeof(nladdr)); -+ nladdr.nl_family = AF_NETLINK; -+ -+ if (bind(fd, (struct sockaddr *)&nladdr, sizeof(nladdr)) < 0) { -+ error("make_ppp_unit_rtnetlink: bind(AF_NETLINK): %m (line %d)", __LINE__); -+ close(fd); -+ return 0; -+ } -+ -+ memset(&nlreq, 0, sizeof(nlreq)); -+ nlreq.nlh.nlmsg_len = sizeof(nlreq); -+ nlreq.nlh.nlmsg_type = RTM_NEWLINK; -+ nlreq.nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_EXCL | NLM_F_CREATE; -+ nlreq.ifm.ifi_family = AF_UNSPEC; -+ nlreq.ifm.ifi_type = ARPHRD_NETROM; -+ nlreq.ifn.rta.rta_len = sizeof(nlreq.ifn); -+ nlreq.ifn.rta.rta_type = IFLA_IFNAME; -+ strlcpy(nlreq.ifn.ifname, req_ifname, sizeof(nlreq.ifn.ifname)); -+ nlreq.ifli.rta.rta_len = sizeof(nlreq.ifli); -+ nlreq.ifli.rta.rta_type = IFLA_LINKINFO; -+ nlreq.ifli.ifik.rta.rta_len = sizeof(nlreq.ifli.ifik); -+ nlreq.ifli.ifik.rta.rta_type = IFLA_INFO_KIND; -+ strcpy(nlreq.ifli.ifik.ifkind, "ppp"); -+ nlreq.ifli.ifid.rta.rta_len = sizeof(nlreq.ifli.ifid); -+ nlreq.ifli.ifid.rta.rta_type = IFLA_INFO_DATA; -+ nlreq.ifli.ifid.ifdata[0].rta.rta_len = sizeof(nlreq.ifli.ifid.ifdata[0]); -+ nlreq.ifli.ifid.ifdata[0].rta.rta_type = IFLA_PPP_DEV_FD; -+ nlreq.ifli.ifid.ifdata[0].ppp.ppp_dev_fd = ppp_dev_fd; -+ -+ memset(&nladdr, 0, sizeof(nladdr)); -+ nladdr.nl_family = AF_NETLINK; -+ -+ memset(&iov, 0, sizeof(iov)); -+ iov.iov_base = &nlreq; -+ iov.iov_len = sizeof(nlreq); -+ -+ memset(&msg, 0, sizeof(msg)); -+ msg.msg_name = &nladdr; -+ msg.msg_namelen = sizeof(nladdr); -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ -+ if (sendmsg(fd, &msg, 0) < 0) { -+ error("make_ppp_unit_rtnetlink: sendmsg(RTM_NEWLINK/NLM_F_CREATE): %m (line %d)", __LINE__); -+ close(fd); -+ return 0; -+ } -+ -+ memset(&iov, 0, sizeof(iov)); -+ iov.iov_base = &nlresp; -+ iov.iov_len = sizeof(nlresp); -+ -+ memset(&msg, 0, sizeof(msg)); -+ msg.msg_name = &nladdr; -+ msg.msg_namelen = sizeof(nladdr); -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ -+ nlresplen = recvmsg(fd, &msg, 0); -+ -+ if (nlresplen < 0) { -+ error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): %m (line %d)", __LINE__); -+ close(fd); -+ return 0; -+ } -+ -+ close(fd); -+ -+ if (nladdr.nl_family != AF_NETLINK) { -+ error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): Not a netlink packet (line %d)", __LINE__); -+ return 0; -+ } -+ -+ if ((size_t)nlresplen < sizeof(nlresp) || nlresp.nlh.nlmsg_len < sizeof(nlresp)) { -+ error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): Acknowledgment netlink packet too short (line %d)", __LINE__); -+ return 0; -+ } -+ -+ /* acknowledgment packet for NLM_F_ACK is NLMSG_ERROR */ -+ if (nlresp.nlh.nlmsg_type != NLMSG_ERROR) { -+ error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): Not an acknowledgment netlink packet (line %d)", __LINE__); -+ return 0; -+ } -+ -+ /* error == 0 indicates success, negative value is errno code */ -+ if (nlresp.nlerr.error != 0) { -+ /* -+ * Linux kernel versions prior to 4.7 do not support creating ppp -+ * interfaces via rtnetlink API and therefore error response is -+ * expected. On older kernel versions do not show this error message. -+ * When error is different than EEXIST then pppd tries to fallback to -+ * the old ioctl method. -+ */ -+ errno = (nlresp.nlerr.error < 0) ? -nlresp.nlerr.error : EINVAL; -+ if (kernel_version >= KVERSION(4,7,0)) -+ error("Couldn't create ppp interface %s: %m", req_ifname); -+ return 0; -+ } -+ -+ return 1; -+} -+ -+/* - * make_ppp_unit - make a new ppp unit for ppp_dev_fd. - * Assumes new_style_driver. - */ -@@ -676,6 +839,33 @@ static int make_ppp_unit(void) - || fcntl(ppp_dev_fd, F_SETFL, flags | O_NONBLOCK) == -1) - warn("Couldn't set /dev/ppp to nonblock: %m"); - -+ /* -+ * Via rtnetlink it is possible to create ppp network interface with -+ * custom ifname atomically. But it is not possible to specify custom -+ * ppp unit id. -+ * -+ * Tools like systemd, udev or NetworkManager are trying to query -+ * interface attributes based on interface name immediately when new -+ * network interface is created. And therefore immediate interface -+ * renaming is causing issues. -+ * -+ * So use rtnetlink API only when user requested custom ifname. It will -+ * avoid system issues with interface renaming. -+ */ -+ if (req_unit == -1 && req_ifname[0] != '\0' && kernel_version >= KVERSION(2,1,16)) { -+ if (make_ppp_unit_rtnetlink()) { -+ if (ioctl(ppp_dev_fd, PPPIOCGUNIT, &ifunit)) -+ fatal("Couldn't retrieve PPP unit id: %m"); -+ return 0; -+ } -+ /* -+ * If interface with requested name already exist return error -+ * otherwise fallback to old ioctl method. -+ */ -+ if (errno == EEXIST) -+ return -1; -+ } -+ - ifunit = req_unit; - x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit); - if (x < 0 && req_unit >= 0 && errno == EEXIST) { diff --git a/package/network/services/ppp/patches/143-pppd-Workaround-for-generating-ppp-unit-id-on-Linux-.patch b/package/network/services/ppp/patches/143-pppd-Workaround-for-generating-ppp-unit-id-on-Linux-.patch deleted file mode 100644 index abe559e0748acc..00000000000000 --- a/package/network/services/ppp/patches/143-pppd-Workaround-for-generating-ppp-unit-id-on-Linux-.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 44609bfc974bdafc0316d069aabf5e2903efa805 Mon Sep 17 00:00:00 2001 -From: pali <7141871+pali@users.noreply.github.com> -Date: Tue, 9 Aug 2022 11:20:15 +0200 -Subject: [PATCH] pppd: Workaround for generating ppp unit id on Linux (#355) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Linux kernel has nasty bug / feature. If PPPIOCNEWUNIT is called with -negative ppp unit id (which is default option when command line argument -"unit" is not specified; and tells kernel to choose some free ppp unit id) -and the lowest unused/free ppp unit id is present in some existing network -interface name prefixed by "ppp" string then this PPPIOCNEWUNIT ioctl -fails. In this case kernel is basically unable to create a new ppp -interface via PPPIOCNEWUNIT ioctl when user does not specify some unused -and non-conflicted unit id. - -Linux kernel should be fixed to choose usable ppp unit id when was -requested via PPPIOCNEWUNIT parameter -1. - -Until this happens, add a workaround for pppd to help choosing some random -ppp unit id when kernel returns this error. - -Simple test case (run on system when there is no ppp interface): - - sudo ./pppd ifname ppp1 nodefaultroute noauth nolock local nodetach pty "./pppd nodefaultroute noauth nolock local nodetach notty" - -Second pppd process without this patch prints into syslog following error: - - pppd 2.4.10-dev started by pali, uid 0 - Couldn't create new ppp unit: File exists - Exit. - -With this patch it falls back to random ppp unit id and succeeds: - - pppd 2.4.10-dev started by pali, uid 0 - Using interface ppp1361 - Connect: ppp1361 <--> /dev/pts/14 - ... - -Signed-off-by: Pali Rohár ---- - pppd/sys-linux.c | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -873,6 +873,11 @@ static int make_ppp_unit(void) - ifunit = -1; - x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit); - } -+ if (x < 0 && errno == EEXIST) { -+ srand(time(NULL) * getpid()); -+ ifunit = rand() % 10000; -+ x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit); -+ } - if (x < 0) - error("Couldn't create new ppp unit: %m"); - diff --git a/package/network/services/ppp/patches/144-pppd-Retry-registering-interface-when-on-rtnetlink-E.patch b/package/network/services/ppp/patches/144-pppd-Retry-registering-interface-when-on-rtnetlink-E.patch deleted file mode 100644 index 26c1e34683acb4..00000000000000 --- a/package/network/services/ppp/patches/144-pppd-Retry-registering-interface-when-on-rtnetlink-E.patch +++ /dev/null @@ -1,218 +0,0 @@ -From 089687fbcc6524809ae9f4b2f8145fe3c2a91147 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Sat, 7 Aug 2021 19:48:01 +0200 -Subject: [PATCH] pppd: Retry registering interface when on rtnetlink -EBUSY - error -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Due to workaround in kernel module ppp_generic.ko in function -ppp_nl_newlink(), kernel may return -EBUSY error to prevent possible -mutex deadlock. In this case userspace needs to retry its request. - -Proper way would be to fix kernel module to order requests and mutex -locking, so prevent deadlock in kernel and so never return this error to -userspace. Until it happens we need retry code in userspace. - -Signed-off-by: Pali Rohár -[ backport to ppp 2.4.9 ] -Signed-off-by: Christian Marangi ---- - pppd/sys-linux.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -707,99 +707,101 @@ static int make_ppp_unit_rtnetlink(void) - int one; - int fd; - -- fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); -- if (fd < 0) { -- error("make_ppp_unit_rtnetlink: socket(NETLINK_ROUTE): %m (line %d)", __LINE__); -- return 0; -- } -- -- /* Tell kernel to not send to us payload of acknowledgment error message. */ -- one = 1; -- setsockopt(fd, SOL_NETLINK, NETLINK_CAP_ACK, &one, sizeof(one)); -+ do { -+ fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); -+ if (fd < 0) { -+ error("make_ppp_unit_rtnetlink: socket(NETLINK_ROUTE): %m (line %d)", __LINE__); -+ return 0; -+ } -+ -+ /* Tell kernel to not send to us payload of acknowledgment error message. */ -+ one = 1; -+ setsockopt(fd, SOL_NETLINK, NETLINK_CAP_ACK, &one, sizeof(one)); -+ -+ memset(&nladdr, 0, sizeof(nladdr)); -+ nladdr.nl_family = AF_NETLINK; -+ -+ if (bind(fd, (struct sockaddr *)&nladdr, sizeof(nladdr)) < 0) { -+ error("make_ppp_unit_rtnetlink: bind(AF_NETLINK): %m (line %d)", __LINE__); -+ close(fd); -+ return 0; -+ } -+ -+ memset(&nlreq, 0, sizeof(nlreq)); -+ nlreq.nlh.nlmsg_len = sizeof(nlreq); -+ nlreq.nlh.nlmsg_type = RTM_NEWLINK; -+ nlreq.nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_EXCL | NLM_F_CREATE; -+ nlreq.ifm.ifi_family = AF_UNSPEC; -+ nlreq.ifm.ifi_type = ARPHRD_NETROM; -+ nlreq.ifn.rta.rta_len = sizeof(nlreq.ifn); -+ nlreq.ifn.rta.rta_type = IFLA_IFNAME; -+ strlcpy(nlreq.ifn.ifname, req_ifname, sizeof(nlreq.ifn.ifname)); -+ nlreq.ifli.rta.rta_len = sizeof(nlreq.ifli); -+ nlreq.ifli.rta.rta_type = IFLA_LINKINFO; -+ nlreq.ifli.ifik.rta.rta_len = sizeof(nlreq.ifli.ifik); -+ nlreq.ifli.ifik.rta.rta_type = IFLA_INFO_KIND; -+ strcpy(nlreq.ifli.ifik.ifkind, "ppp"); -+ nlreq.ifli.ifid.rta.rta_len = sizeof(nlreq.ifli.ifid); -+ nlreq.ifli.ifid.rta.rta_type = IFLA_INFO_DATA; -+ nlreq.ifli.ifid.ifdata[0].rta.rta_len = sizeof(nlreq.ifli.ifid.ifdata[0]); -+ nlreq.ifli.ifid.ifdata[0].rta.rta_type = IFLA_PPP_DEV_FD; -+ nlreq.ifli.ifid.ifdata[0].ppp.ppp_dev_fd = ppp_dev_fd; -+ -+ memset(&nladdr, 0, sizeof(nladdr)); -+ nladdr.nl_family = AF_NETLINK; -+ -+ memset(&iov, 0, sizeof(iov)); -+ iov.iov_base = &nlreq; -+ iov.iov_len = sizeof(nlreq); -+ -+ memset(&msg, 0, sizeof(msg)); -+ msg.msg_name = &nladdr; -+ msg.msg_namelen = sizeof(nladdr); -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ -+ if (sendmsg(fd, &msg, 0) < 0) { -+ error("make_ppp_unit_rtnetlink: sendmsg(RTM_NEWLINK/NLM_F_CREATE): %m (line %d)", __LINE__); -+ close(fd); -+ return 0; -+ } -+ -+ memset(&iov, 0, sizeof(iov)); -+ iov.iov_base = &nlresp; -+ iov.iov_len = sizeof(nlresp); -+ -+ memset(&msg, 0, sizeof(msg)); -+ msg.msg_name = &nladdr; -+ msg.msg_namelen = sizeof(nladdr); -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ -+ nlresplen = recvmsg(fd, &msg, 0); -+ -+ if (nlresplen < 0) { -+ error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): %m (line %d)", __LINE__); -+ close(fd); -+ return 0; -+ } - -- memset(&nladdr, 0, sizeof(nladdr)); -- nladdr.nl_family = AF_NETLINK; -- -- if (bind(fd, (struct sockaddr *)&nladdr, sizeof(nladdr)) < 0) { -- error("make_ppp_unit_rtnetlink: bind(AF_NETLINK): %m (line %d)", __LINE__); - close(fd); -- return 0; -- } -- -- memset(&nlreq, 0, sizeof(nlreq)); -- nlreq.nlh.nlmsg_len = sizeof(nlreq); -- nlreq.nlh.nlmsg_type = RTM_NEWLINK; -- nlreq.nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_EXCL | NLM_F_CREATE; -- nlreq.ifm.ifi_family = AF_UNSPEC; -- nlreq.ifm.ifi_type = ARPHRD_NETROM; -- nlreq.ifn.rta.rta_len = sizeof(nlreq.ifn); -- nlreq.ifn.rta.rta_type = IFLA_IFNAME; -- strlcpy(nlreq.ifn.ifname, req_ifname, sizeof(nlreq.ifn.ifname)); -- nlreq.ifli.rta.rta_len = sizeof(nlreq.ifli); -- nlreq.ifli.rta.rta_type = IFLA_LINKINFO; -- nlreq.ifli.ifik.rta.rta_len = sizeof(nlreq.ifli.ifik); -- nlreq.ifli.ifik.rta.rta_type = IFLA_INFO_KIND; -- strcpy(nlreq.ifli.ifik.ifkind, "ppp"); -- nlreq.ifli.ifid.rta.rta_len = sizeof(nlreq.ifli.ifid); -- nlreq.ifli.ifid.rta.rta_type = IFLA_INFO_DATA; -- nlreq.ifli.ifid.ifdata[0].rta.rta_len = sizeof(nlreq.ifli.ifid.ifdata[0]); -- nlreq.ifli.ifid.ifdata[0].rta.rta_type = IFLA_PPP_DEV_FD; -- nlreq.ifli.ifid.ifdata[0].ppp.ppp_dev_fd = ppp_dev_fd; -- -- memset(&nladdr, 0, sizeof(nladdr)); -- nladdr.nl_family = AF_NETLINK; -- -- memset(&iov, 0, sizeof(iov)); -- iov.iov_base = &nlreq; -- iov.iov_len = sizeof(nlreq); -- -- memset(&msg, 0, sizeof(msg)); -- msg.msg_name = &nladdr; -- msg.msg_namelen = sizeof(nladdr); -- msg.msg_iov = &iov; -- msg.msg_iovlen = 1; -- -- if (sendmsg(fd, &msg, 0) < 0) { -- error("make_ppp_unit_rtnetlink: sendmsg(RTM_NEWLINK/NLM_F_CREATE): %m (line %d)", __LINE__); -- close(fd); -- return 0; -- } -- -- memset(&iov, 0, sizeof(iov)); -- iov.iov_base = &nlresp; -- iov.iov_len = sizeof(nlresp); -- -- memset(&msg, 0, sizeof(msg)); -- msg.msg_name = &nladdr; -- msg.msg_namelen = sizeof(nladdr); -- msg.msg_iov = &iov; -- msg.msg_iovlen = 1; -- -- nlresplen = recvmsg(fd, &msg, 0); -- -- if (nlresplen < 0) { -- error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): %m (line %d)", __LINE__); -- close(fd); -- return 0; -- } -- -- close(fd); - -- if (nladdr.nl_family != AF_NETLINK) { -- error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): Not a netlink packet (line %d)", __LINE__); -- return 0; -- } -- -- if ((size_t)nlresplen < sizeof(nlresp) || nlresp.nlh.nlmsg_len < sizeof(nlresp)) { -- error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): Acknowledgment netlink packet too short (line %d)", __LINE__); -- return 0; -- } -- -- /* acknowledgment packet for NLM_F_ACK is NLMSG_ERROR */ -- if (nlresp.nlh.nlmsg_type != NLMSG_ERROR) { -- error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): Not an acknowledgment netlink packet (line %d)", __LINE__); -- return 0; -- } -+ if (nladdr.nl_family != AF_NETLINK) { -+ error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): Not a netlink packet (line %d)", __LINE__); -+ return 0; -+ } -+ -+ if ((size_t)nlresplen < sizeof(nlresp) || nlresp.nlh.nlmsg_len < sizeof(nlresp)) { -+ error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): Acknowledgment netlink packet too short (line %d)", __LINE__); -+ return 0; -+ } -+ -+ /* acknowledgment packet for NLM_F_ACK is NLMSG_ERROR */ -+ if (nlresp.nlh.nlmsg_type != NLMSG_ERROR) { -+ error("make_ppp_unit_rtnetlink: recvmsg(NLM_F_ACK): Not an acknowledgment netlink packet (line %d)", __LINE__); -+ return 0; -+ } -+ } while (nlresp.nlerr.error == -EBUSY); - - /* error == 0 indicates success, negative value is errno code */ - if (nlresp.nlerr.error != 0) { diff --git a/package/network/services/ppp/patches/200-makefile.patch b/package/network/services/ppp/patches/200-makefile.patch deleted file mode 100644 index d0b9a9a99bdb72..00000000000000 --- a/package/network/services/ppp/patches/200-makefile.patch +++ /dev/null @@ -1,56 +0,0 @@ -pppd: tune Linux config defaults for OpenWrt - -This patch adjusts a number defaults to properly match the OpenWrt environment. -It is not intended for upstream. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/Makefile.linux -+++ b/pppd/Makefile.linux -@@ -49,7 +49,7 @@ MPPE=y - # Uncomment the next line to include support for PPP packet filtering. - # This requires that the libpcap library and headers be installed - # and that the kernel driver support PPP packet filtering. --FILTER=y -+#FILTER=y - - # Uncomment the next line to enable multilink PPP (enabled by default) - # Linux distributions: Please leave multilink ENABLED in your builds -@@ -59,7 +59,7 @@ HAVE_MULTILINK=y - # Uncomment the next line to enable the TDB database (enabled by default.) - # If you enable multilink, then TDB is automatically enabled also. - # Linux distributions: Please leave TDB ENABLED in your builds. --USE_TDB=y -+#USE_TDB=y - - # Uncomment the next line to enable Type=notify services in systemd - # If enabled, and the user sets the up_sdnotify option, then -@@ -85,13 +85,13 @@ USE_LIBUTIL=y - endif - - # Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto) --USE_EAPTLS=y -+#USE_EAPTLS=y - - MAXOCTETS=y - - INCLUDE_DIRS= -I../include - --COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe -+COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP -pipe - - CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"' - -@@ -143,10 +143,10 @@ CFLAGS += -DHAS_SHADOW - #LIBS += -lshadow $(LIBS) - endif - --ifeq ($(shell echo '\#include ' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes) -+#ifeq ($(shell echo '\#include ' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes) - CFLAGS += -DHAVE_CRYPT_H=1 - LIBS += -lcrypt --endif -+#endif - - ifdef USE_LIBUTIL - CFLAGS += -DHAVE_LOGWTMP=1 diff --git a/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch b/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch deleted file mode 100644 index 3c30517e42ffd1..00000000000000 --- a/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch +++ /dev/null @@ -1,1518 +0,0 @@ -pppd: add support for MPPE and MPPC encryption and compression protocols - -This is a forward ported version of ppp-2.4.3-mppe-mppc-1.1.patch.gz found on -http://mppe-mppc.alphacron.de/ . - -Signed-off-by: Jo-Philipp Wich - ---- a/include/linux/ppp-comp.h -+++ b/include/linux/ppp-comp.h -@@ -36,7 +36,7 @@ - */ - - /* -- * ==FILEVERSION 20020319== -+ * ==FILEVERSION 20020715== - * - * NOTE TO MAINTAINERS: - * If you modify this file at all, please set the above date. -@@ -201,6 +201,33 @@ struct compressor { - #define CI_MPPE 18 /* config option for MPPE */ - #define CILEN_MPPE 6 /* length of config option */ - -+/* MPPE/MPPC definitions by J.D.*/ -+#define MPPE_STATELESS MPPE_H_BIT /* configuration bit H */ -+#define MPPE_40BIT MPPE_L_BIT /* configuration bit L */ -+#define MPPE_56BIT MPPE_M_BIT /* configuration bit M */ -+#define MPPE_128BIT MPPE_S_BIT /* configuration bit S */ -+#define MPPE_MPPC MPPE_C_BIT /* configuration bit C */ -+ -+/* -+ * Definitions for Stac LZS. -+ */ -+ -+#define CI_LZS 17 /* config option for Stac LZS */ -+#define CILEN_LZS 5 /* length of config option */ -+ -+#define LZS_OVHD 4 /* max. LZS overhead */ -+#define LZS_HIST_LEN 2048 /* LZS history size */ -+#define LZS_MAX_CCOUNT 0x0FFF /* max. coherency counter value */ -+ -+#define LZS_MODE_NONE 0 -+#define LZS_MODE_LCB 1 -+#define LZS_MODE_CRC 2 -+#define LZS_MODE_SEQ 3 -+#define LZS_MODE_EXT 4 -+ -+#define LZS_EXT_BIT_FLUSHED 0x80 /* bit A */ -+#define LZS_EXT_BIT_COMP 0x20 /* bit C */ -+ - /* - * Definitions for other, as yet unsupported, compression methods. - */ ---- a/include/net/ppp-comp.h -+++ b/include/net/ppp-comp.h -@@ -168,6 +168,33 @@ struct compressor { - #define CI_MPPE 18 /* config option for MPPE */ - #define CILEN_MPPE 6 /* length of config option */ - -+/* MPPE/MPPC definitions by J.D.*/ -+#define MPPE_STATELESS MPPE_H_BIT /* configuration bit H */ -+#define MPPE_40BIT MPPE_L_BIT /* configuration bit L */ -+#define MPPE_56BIT MPPE_M_BIT /* configuration bit M */ -+#define MPPE_128BIT MPPE_S_BIT /* configuration bit S */ -+#define MPPE_MPPC MPPE_C_BIT /* configuration bit C */ -+ -+/* -+ * Definitions for Stac LZS. -+ */ -+ -+#define CI_LZS 17 /* config option for Stac LZS */ -+#define CILEN_LZS 5 /* length of config option */ -+ -+#define LZS_OVHD 4 /* max. LZS overhead */ -+#define LZS_HIST_LEN 2048 /* LZS history size */ -+#define LZS_MAX_CCOUNT 0x0FFF /* max. coherency counter value */ -+ -+#define LZS_MODE_NONE 0 -+#define LZS_MODE_LCB 1 -+#define LZS_MODE_CRC 2 -+#define LZS_MODE_SEQ 3 -+#define LZS_MODE_EXT 4 -+ -+#define LZS_EXT_BIT_FLUSHED 0x80 /* bit A */ -+#define LZS_EXT_BIT_COMP 0x20 /* bit C */ -+ - /* - * Definitions for other, as yet unsupported, compression methods. - */ ---- a/pppd/ccp.c -+++ b/pppd/ccp.c -@@ -61,12 +61,10 @@ static int setdeflate (char **); - static char bsd_value[8]; - static char deflate_value[8]; - --/* -- * Option variables. -- */ - #ifdef MPPE --bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ --#endif -+static int setmppe(char **); -+static int setnomppe(void); -+#endif /* MPPE */ - - static option_t ccp_option_list[] = { - { "noccp", o_bool, &ccp_protent.enabled_flag, -@@ -107,54 +105,36 @@ static option_t ccp_option_list[] = { - "don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR, - &ccp_allowoptions[0].predictor_1 }, - -+ { "lzs", o_bool, &ccp_wantoptions[0].lzs, -+ "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_PRIO }, -+ { "+lzs", o_bool, &ccp_wantoptions[0].lzs, -+ "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_ALIAS | OPT_PRIO }, -+ { "nolzs", o_bool, &ccp_wantoptions[0].lzs, -+ "don't allow Stac LZS", OPT_PRIOSUB | OPT_A2CLR, -+ &ccp_allowoptions[0].lzs }, -+ { "-lzs", o_bool, &ccp_wantoptions[0].lzs, -+ "don't allow Stac LZS", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR, -+ &ccp_allowoptions[0].lzs }, -+ - #ifdef MPPE -- /* MPPE options are symmetrical ... we only set wantoptions here */ -- { "require-mppe", o_bool, &ccp_wantoptions[0].mppe, -- "require MPPE encryption", -- OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 }, -- { "+mppe", o_bool, &ccp_wantoptions[0].mppe, -- "require MPPE encryption", -- OPT_ALIAS | OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 }, -- { "nomppe", o_bool, &ccp_wantoptions[0].mppe, -- "don't allow MPPE encryption", OPT_PRIO }, -- { "-mppe", o_bool, &ccp_wantoptions[0].mppe, -- "don't allow MPPE encryption", OPT_ALIAS | OPT_PRIO }, -- -- /* We use ccp_allowoptions[0].mppe as a junk var ... it is reset later */ -- { "require-mppe-40", o_bool, &ccp_allowoptions[0].mppe, -- "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40, -- &ccp_wantoptions[0].mppe }, -- { "+mppe-40", o_bool, &ccp_allowoptions[0].mppe, -- "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40, -- &ccp_wantoptions[0].mppe }, -- { "nomppe-40", o_bool, &ccp_allowoptions[0].mppe, -- "don't allow MPPE 40-bit encryption", -- OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40, &ccp_wantoptions[0].mppe }, -- { "-mppe-40", o_bool, &ccp_allowoptions[0].mppe, -- "don't allow MPPE 40-bit encryption", -- OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40, -- &ccp_wantoptions[0].mppe }, -- -- { "require-mppe-128", o_bool, &ccp_allowoptions[0].mppe, -- "require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128, -- &ccp_wantoptions[0].mppe }, -- { "+mppe-128", o_bool, &ccp_allowoptions[0].mppe, -- "require MPPE 128-bit encryption", -- OPT_ALIAS | OPT_PRIO | OPT_A2OR | MPPE_OPT_128, -- &ccp_wantoptions[0].mppe }, -- { "nomppe-128", o_bool, &ccp_allowoptions[0].mppe, -- "don't allow MPPE 128-bit encryption", -- OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128, &ccp_wantoptions[0].mppe }, -- { "-mppe-128", o_bool, &ccp_allowoptions[0].mppe, -- "don't allow MPPE 128-bit encryption", -- OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128, -- &ccp_wantoptions[0].mppe }, -- -- /* strange one; we always request stateless, but will we allow stateful? */ -- { "mppe-stateful", o_bool, &refuse_mppe_stateful, -- "allow MPPE stateful mode", OPT_PRIO }, -- { "nomppe-stateful", o_bool, &refuse_mppe_stateful, -- "disallow MPPE stateful mode", OPT_PRIO | 1 }, -+ { "mppc", o_bool, &ccp_wantoptions[0].mppc, -+ "request MPPC compression", 1, &ccp_allowoptions[0].mppc }, -+ { "+mppc", o_bool, &ccp_wantoptions[0].mppc, -+ "request MPPC compression", 1, &ccp_allowoptions[0].mppc, OPT_ALIAS }, -+ { "nomppc", o_bool, &ccp_wantoptions[0].mppc, -+ "don't allow MPPC compression", OPT_PRIOSUB | OPT_A2CLR, -+ &ccp_allowoptions[0].mppc }, -+ { "-mppc", o_bool, &ccp_wantoptions[0].mppc, -+ "don't allow MPPC compression", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR, -+ &ccp_allowoptions[0].mppc }, -+ { "mppe", o_special, (void *)setmppe, -+ "request MPPE encryption" }, -+ { "+mppe", o_special, (void *)setmppe, -+ "request MPPE encryption" }, -+ { "nomppe", o_special_noarg, (void *)setnomppe, -+ "don't allow MPPE encryption" }, -+ { "-mppe", o_special_noarg, (void *)setnomppe, -+ "don't allow MPPE encryption" }, - #endif /* MPPE */ - - { NULL } -@@ -240,7 +220,7 @@ static fsm_callbacks ccp_callbacks = { - */ - #define ANY_COMPRESS(opt) ((opt).deflate || (opt).bsd_compress \ - || (opt).predictor_1 || (opt).predictor_2 \ -- || (opt).mppe) -+ || (opt).lzs || (opt).mppc || (opt).mppe) - - /* - * Local state (mainly for handling reset-reqs and reset-acks). -@@ -341,6 +321,100 @@ setdeflate(char **argv) - return 1; - } - -+#ifdef MPPE -+/* -+ * Functions called from config options -+ */ -+/* -+ MPPE suboptions: -+ required - require MPPE; disconnect if peer doesn't support it -+ stateless - use stateless mode -+ no40 - disable 40 bit keys -+ no56 - disable 56 bit keys -+ no128 - disable 128 bit keys -+*/ -+int setmppe(char **argv) -+{ -+ int i; -+ char *str, cmdbuf[16]; -+ -+ ccp_allowoptions[0].mppe = 1; -+ ccp_allowoptions[0].mppe_40 = 1; -+ ccp_allowoptions[0].mppe_56 = 1; -+ ccp_allowoptions[0].mppe_128 = 1; -+ ccp_allowoptions[0].mppe_stateless = 0; -+ ccp_wantoptions[0].mppe = 0; -+ -+ str = *argv; -+ -+ while (1) { -+ i = 0; -+ memset(cmdbuf, '\0', 16); -+ while ((i < 16) && (*str != ',') && (*str != '\0')) -+ cmdbuf[i++] = *str++; -+ cmdbuf[i] = '\0'; -+ if (!strncasecmp(cmdbuf, "no40", strlen("no40"))) { -+ ccp_allowoptions[0].mppe_40 = 0; -+ goto next_param; -+ } else if (!strncasecmp(cmdbuf, "no56", strlen("no56"))) { -+ ccp_allowoptions[0].mppe_56 = 0; -+ goto next_param; -+ } else if (!strncasecmp(cmdbuf, "no128", strlen("no128"))) { -+ ccp_allowoptions[0].mppe_128 = 0; -+ goto next_param; -+ } else if (!strncasecmp(cmdbuf, "stateless", strlen("stateless"))) { -+ ccp_allowoptions[0].mppe_stateless = 1; -+ goto next_param; -+ } else if (!strncasecmp(cmdbuf, "required", strlen("required"))) { -+ ccp_wantoptions[0].mppe = 1; -+ goto next_param; -+ } else { -+ option_error("invalid parameter '%s' for mppe option", cmdbuf); -+ return 0; -+ } -+ -+ next_param: -+ if (*str == ',') { -+ str++; -+ continue; -+ } -+ if (*str == '\0') { -+ if (!(ccp_allowoptions[0].mppe_40 || ccp_allowoptions[0].mppe_56 || -+ ccp_allowoptions[0].mppe_128)) { -+ if (ccp_wantoptions[0].mppe == 1) { -+ option_error("You require MPPE but you have switched off " -+ "all encryption key lengths."); -+ return 0; -+ } -+ ccp_wantoptions[0].mppe = ccp_allowoptions[0].mppe = 0; -+ ccp_wantoptions[0].mppe_stateless = -+ ccp_allowoptions[0].mppe_stateless = 0; -+ } else { -+ ccp_allowoptions[0].mppe = 1; -+ ccp_wantoptions[0].mppe_stateless = -+ ccp_allowoptions[0].mppe_stateless; -+ if (ccp_wantoptions[0].mppe == 1) { -+ ccp_wantoptions[0].mppe_40 = ccp_allowoptions[0].mppe_40; -+ ccp_wantoptions[0].mppe_56 = ccp_allowoptions[0].mppe_56; -+ ccp_wantoptions[0].mppe_128 = ccp_allowoptions[0].mppe_128; -+ } -+ } -+ return 1; -+ } -+ } -+} -+ -+int setnomppe(void) -+{ -+ ccp_wantoptions[0].mppe = ccp_allowoptions[0].mppe = 0; -+ ccp_wantoptions[0].mppe_40 = ccp_allowoptions[0].mppe_40 = 0; -+ ccp_wantoptions[0].mppe_56 = ccp_allowoptions[0].mppe_56 = 0; -+ ccp_wantoptions[0].mppe_128 = ccp_allowoptions[0].mppe_128 = 0; -+ ccp_wantoptions[0].mppe_stateless = ccp_allowoptions[0].mppe_stateless = 0; -+ return 1; -+} -+#endif /* MPPE */ -+ - /* - * ccp_init - initialize CCP. - */ -@@ -374,6 +448,30 @@ ccp_init(int unit) - ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS; - - ccp_allowoptions[0].predictor_1 = 1; -+ -+ ccp_wantoptions[0].lzs = 0; /* Stac LZS - will be enabled in the future */ -+ ccp_wantoptions[0].lzs_mode = LZS_MODE_SEQ; -+ ccp_wantoptions[0].lzs_hists = 1; -+ ccp_allowoptions[0].lzs = 0; /* Stac LZS - will be enabled in the future */ -+ ccp_allowoptions[0].lzs_mode = LZS_MODE_SEQ; -+ ccp_allowoptions[0].lzs_hists = 1; -+ -+#ifdef MPPE -+ /* by default allow and request MPPC... */ -+ ccp_wantoptions[0].mppc = ccp_allowoptions[0].mppc = 1; -+ -+ /* ... and allow but don't request MPPE */ -+ ccp_allowoptions[0].mppe = 1; -+ ccp_allowoptions[0].mppe_40 = 1; -+ ccp_allowoptions[0].mppe_56 = 1; -+ ccp_allowoptions[0].mppe_128 = 1; -+ ccp_allowoptions[0].mppe_stateless = 1; -+ ccp_wantoptions[0].mppe = 0; -+ ccp_wantoptions[0].mppe_40 = 0; -+ ccp_wantoptions[0].mppe_56 = 0; -+ ccp_wantoptions[0].mppe_128 = 0; -+ ccp_wantoptions[0].mppe_stateless = 0; -+#endif /* MPPE */ - } - - /* -@@ -443,11 +541,11 @@ ccp_input(int unit, u_char *p, int len) - if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) { - notice("Compression disabled by peer."); - #ifdef MPPE -- if (ccp_gotoptions[unit].mppe) { -+ if (ccp_wantoptions[unit].mppe) { - error("MPPE disabled, closing LCP"); - lcp_close(unit, "MPPE disabled by peer"); - } --#endif -+#endif /* MPPE */ - } - - /* -@@ -471,6 +569,15 @@ ccp_extcode(fsm *f, int code, int id, u_ - break; - /* send a reset-ack, which the transmitter will see and - reset its compression state. */ -+ -+ /* In case of MPPE/MPPC or LZS we shouldn't send CCP_RESETACK, -+ but we do it in order to reset compressor; CCP_RESETACK is -+ then silently discarded. See functions ppp_send_frame and -+ ppp_ccp_peek in ppp_generic.c (Linux only !!!). All the -+ confusion is caused by the fact that CCP code is splited -+ into two parts - one part is handled by pppd, the other one -+ is handled by kernel. */ -+ - fsm_sdata(f, CCP_RESETACK, id, NULL, 0); - break; - -@@ -498,12 +605,11 @@ ccp_protrej(int unit) - fsm_lowerdown(&ccp_fsm[unit]); - - #ifdef MPPE -- if (ccp_gotoptions[unit].mppe) { -+ if (ccp_wantoptions[unit].mppe) { - error("MPPE required but peer negotiation failed"); - lcp_close(unit, "MPPE required but peer negotiation failed"); - } --#endif -- -+#endif /* MPPE */ - } - - /* -@@ -519,7 +625,7 @@ ccp_resetci(fsm *f) - all_rejected[f->unit] = 0; - - #ifdef MPPE -- if (go->mppe) { -+ if (go->mppe || go->mppc) { - ccp_options *ao = &ccp_allowoptions[f->unit]; - int auth_mschap_bits = auth_done[f->unit]; - #ifdef USE_EAPTLS -@@ -536,95 +642,124 @@ ccp_resetci(fsm *f) - * NB: If MPPE is required, all other compression opts are invalid. - * So, we return right away if we can't do it. - */ -- -- /* Leave only the mschap auth bits set */ -- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | -- CHAP_MS2_WITHPEER | CHAP_MS2_PEER); -- /* Count the mschap auths */ -- auth_mschap_bits >>= CHAP_MS_SHIFT; -- numbits = 0; -- do { -- numbits += auth_mschap_bits & 1; -- auth_mschap_bits >>= 1; -- } while (auth_mschap_bits); -- if (numbits > 1) { -- error("MPPE required, but auth done in both directions."); -- lcp_close(f->unit, "MPPE required but not available"); -- return; -- } -+ if (ccp_wantoptions[f->unit].mppe) { -+ /* Leave only the mschap auth bits set */ -+ auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | -+ CHAP_MS2_WITHPEER | CHAP_MS2_PEER); -+ /* Count the mschap auths */ -+ auth_mschap_bits >>= CHAP_MS_SHIFT; -+ numbits = 0; -+ do { -+ numbits += auth_mschap_bits & 1; -+ auth_mschap_bits >>= 1; -+ } while (auth_mschap_bits); -+ if (numbits > 1) { -+ error("MPPE required, but auth done in both directions."); -+ lcp_close(f->unit, "MPPE required but not available"); -+ return; -+ } - - #ifdef USE_EAPTLS -- /* -- * MPPE is also possible in combination with EAP-TLS. -- * It is not possible to detect if we're doing EAP or EAP-TLS -- * at this stage, hence we accept all forms of EAP. If TLS is -- * not used then the MPPE keys will not be derived anyway. -- */ -- /* Leave only the eap auth bits set */ -- auth_eap_bits &= (EAP_WITHPEER | EAP_PEER ); -+ /* -+ * MPPE is also possible in combination with EAP-TLS. -+ * It is not possible to detect if we're doing EAP or EAP-TLS -+ * at this stage, hence we accept all forms of EAP. If TLS is -+ * not used then the MPPE keys will not be derived anyway. -+ */ -+ /* Leave only the eap auth bits set */ -+ auth_eap_bits &= (EAP_WITHPEER | EAP_PEER ); - -- if ((numbits == 0) && (auth_eap_bits == 0)) { -- error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed."); -+ if ((numbits == 0) && (auth_eap_bits == 0)) { -+ error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed."); - #else -- if (!numbits) { -- error("MPPE required, but MS-CHAP[v2] auth not performed."); -+ if (!numbits) { -+ error("MPPE required, but MS-CHAP[v2] auth not performed."); - #endif -- lcp_close(f->unit, "MPPE required but not available"); -- return; -- } -+ lcp_close(f->unit, "MPPE required but not available"); -+ return; -+ } - -- /* A plugin (eg radius) may not have obtained key material. */ -- if (!mppe_keys_set) { -- error("MPPE required, but keys are not available. " -- "Possible plugin problem?"); -- lcp_close(f->unit, "MPPE required but not available"); -- return; -- } -- -- /* LM auth not supported for MPPE */ -- if (auth_done[f->unit] & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { -- /* This might be noise */ -- if (go->mppe & MPPE_OPT_40) { -- notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); -- go->mppe &= ~MPPE_OPT_40; -- ccp_wantoptions[f->unit].mppe &= ~MPPE_OPT_40; -+ /* A plugin (eg radius) may not have obtained key material. */ -+ if (!mppe_keys_set) { -+ error("MPPE required, but keys are not available. " -+ "Possible plugin problem?"); -+ lcp_close(f->unit, "MPPE required but not available"); -+ return; - } - } - -- /* Last check: can we actually negotiate something? */ -- if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { -- /* Could be misconfig, could be 40-bit disabled above. */ -- error("MPPE required, but both 40-bit and 128-bit disabled."); -- lcp_close(f->unit, "MPPE required but not available"); -- return; -+ /* -+ * Check whether the kernel knows about the various -+ * compression methods we might request. Key material -+ * unimportant here. -+ */ -+ if (go->mppc) { -+ opt_buf[0] = CI_MPPE; -+ opt_buf[1] = CILEN_MPPE; -+ opt_buf[2] = 0; -+ opt_buf[3] = 0; -+ opt_buf[4] = 0; -+ opt_buf[5] = MPPE_MPPC; -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 0) <= 0) -+ go->mppc = 0; -+ } -+ if (go->mppe_40) { -+ opt_buf[0] = CI_MPPE; -+ opt_buf[1] = CILEN_MPPE; -+ opt_buf[2] = MPPE_STATELESS; -+ opt_buf[3] = 0; -+ opt_buf[4] = 0; -+ opt_buf[5] = MPPE_40BIT; -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0) -+ go->mppe_40 = 0; -+ } -+ if (go->mppe_56) { -+ opt_buf[0] = CI_MPPE; -+ opt_buf[1] = CILEN_MPPE; -+ opt_buf[2] = MPPE_STATELESS; -+ opt_buf[3] = 0; -+ opt_buf[4] = 0; -+ opt_buf[5] = MPPE_56BIT; -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0) -+ go->mppe_56 = 0; -+ } -+ if (go->mppe_128) { -+ opt_buf[0] = CI_MPPE; -+ opt_buf[1] = CILEN_MPPE; -+ opt_buf[2] = MPPE_STATELESS; -+ opt_buf[3] = 0; -+ opt_buf[4] = 0; -+ opt_buf[5] = MPPE_128BIT; -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0) -+ go->mppe_128 = 0; -+ } -+ if (!go->mppe_40 && !go->mppe_56 && !go->mppe_128) { -+ if (ccp_wantoptions[f->unit].mppe) { -+ error("MPPE required, but kernel has no support."); -+ lcp_close(f->unit, "MPPE required but not available"); -+ } -+ go->mppe = go->mppe_stateless = 0; -+ } else { -+ /* MPPE is not compatible with other compression types */ -+ if (ccp_wantoptions[f->unit].mppe) { -+ ao->bsd_compress = go->bsd_compress = 0; -+ ao->predictor_1 = go->predictor_1 = 0; -+ ao->predictor_2 = go->predictor_2 = 0; -+ ao->deflate = go->deflate = 0; -+ ao->lzs = go->lzs = 0; -+ } - } -- -- /* sync options */ -- ao->mppe = go->mppe; -- /* MPPE is not compatible with other compression types */ -- ao->bsd_compress = go->bsd_compress = 0; -- ao->predictor_1 = go->predictor_1 = 0; -- ao->predictor_2 = go->predictor_2 = 0; -- ao->deflate = go->deflate = 0; - } - #endif /* MPPE */ -- -- /* -- * Check whether the kernel knows about the various -- * compression methods we might request. -- */ --#ifdef MPPE -- if (go->mppe) { -- opt_buf[0] = CI_MPPE; -- opt_buf[1] = CILEN_MPPE; -- MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); -- /* Key material unimportant here. */ -- if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0) { -- error("MPPE required, but kernel has no support."); -- lcp_close(f->unit, "MPPE required but not available"); -- } -+ if (go->lzs) { -+ opt_buf[0] = CI_LZS; -+ opt_buf[1] = CILEN_LZS; -+ opt_buf[2] = go->lzs_hists >> 8; -+ opt_buf[3] = go->lzs_hists & 0xff; -+ opt_buf[4] = LZS_MODE_SEQ; -+ if (ccp_test(f->unit, opt_buf, CILEN_LZS, 0) <= 0) -+ go->lzs = 0; - } --#endif - if (go->bsd_compress) { - opt_buf[0] = CI_BSD_COMPRESS; - opt_buf[1] = CILEN_BSD_COMPRESS; -@@ -679,7 +814,8 @@ static int - + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) - + (go->predictor_1? CILEN_PREDICTOR_1: 0) - + (go->predictor_2? CILEN_PREDICTOR_2: 0) -- + (go->mppe? CILEN_MPPE: 0); -+ + (go->lzs? CILEN_LZS: 0) -+ + ((go->mppe || go->mppc)? CILEN_MPPE: 0); - } - - /* -@@ -690,6 +826,8 @@ static void - { - int res; - ccp_options *go = &ccp_gotoptions[f->unit]; -+ ccp_options *ao = &ccp_allowoptions[f->unit]; -+ ccp_options *wo = &ccp_wantoptions[f->unit]; - u_char *p0 = p; - - /* -@@ -698,22 +836,43 @@ static void - * in case it gets Acked. - */ - #ifdef MPPE -- if (go->mppe) { -+ if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) { - u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN]; - -- p[0] = opt_buf[0] = CI_MPPE; -- p[1] = opt_buf[1] = CILEN_MPPE; -- MPPE_OPTS_TO_CI(go->mppe, &p[2]); -- MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); -+ p[0] = CI_MPPE; -+ p[1] = CILEN_MPPE; -+ p[2] = (go->mppe_stateless ? MPPE_STATELESS : 0); -+ p[3] = 0; -+ p[4] = 0; -+ p[5] = (go->mppe_40 ? MPPE_40BIT : 0) | (go->mppe_56 ? MPPE_56BIT : 0) | -+ (go->mppe_128 ? MPPE_128BIT : 0) | (go->mppc ? MPPE_MPPC : 0); -+ -+ BCOPY(p, opt_buf, CILEN_MPPE); - BCOPY(mppe_recv_key, &opt_buf[CILEN_MPPE], MPPE_MAX_KEY_LEN); - res = ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0); -- if (res > 0) -+ if (res > 0) { - p += CILEN_MPPE; -- else -+ } else { - /* This shouldn't happen, we've already tested it! */ -- lcp_close(f->unit, "MPPE required but not available in kernel"); -+ go->mppe = go->mppe_40 = go->mppe_56 = go->mppe_128 = -+ go->mppe_stateless = go->mppc = 0; -+ if (ccp_wantoptions[f->unit].mppe) -+ lcp_close(f->unit, "MPPE required but not available in kernel"); -+ } -+ } -+#endif /* MPPE */ -+ if (go->lzs) { -+ p[0] = CI_LZS; -+ p[1] = CILEN_LZS; -+ p[2] = go->lzs_hists >> 8; -+ p[3] = go->lzs_hists & 0xff; -+ p[4] = LZS_MODE_SEQ; -+ res = ccp_test(f->unit, p, CILEN_LZS, 0); -+ if (res > 0) { -+ p += CILEN_LZS; -+ } else -+ go->lzs = 0; - } --#endif - if (go->deflate) { - p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT; - p[1] = CILEN_DEFLATE; -@@ -799,30 +958,50 @@ static void - - /* - * ccp_ackci - process a received configure-ack, and return -- * 1 iff the packet was OK. -+ * 1 if the packet was OK. - */ - static int - ccp_ackci(fsm *f, u_char *p, int len) - { - ccp_options *go = &ccp_gotoptions[f->unit]; -+ ccp_options *ao = &ccp_allowoptions[f->unit]; -+ ccp_options *wo = &ccp_wantoptions[f->unit]; - u_char *p0 = p; - - #ifdef MPPE -- if (go->mppe) { -- u_char opt_buf[CILEN_MPPE]; -- -- opt_buf[0] = CI_MPPE; -- opt_buf[1] = CILEN_MPPE; -- MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); -- if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) -+ if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) { -+ if (len < CILEN_MPPE -+ || p[1] != CILEN_MPPE || p[0] != CI_MPPE -+ || p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0) -+ || p[3] != 0 -+ || p[4] != 0 -+ || (p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) | -+ (go->mppc ? MPPE_MPPC : 0)) -+ && p[5] != ((go->mppe_56 ? MPPE_56BIT : 0) | -+ (go->mppc ? MPPE_MPPC : 0)) -+ && p[5] != ((go->mppe_128 ? MPPE_128BIT : 0) | -+ (go->mppc ? MPPE_MPPC : 0)))) - return 0; -+ if (go->mppe_40 || go->mppe_56 || go->mppe_128) -+ go->mppe = 1; - p += CILEN_MPPE; - len -= CILEN_MPPE; -+ /* Cope with first/fast ack */ -+ if (p == p0 && len == 0) -+ return 1; -+ } -+#endif /* MPPE */ -+ if (go->lzs) { -+ if (len < CILEN_LZS || p[0] != CI_LZS || p[1] != CILEN_LZS -+ || p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff) -+ || p[4] != LZS_MODE_SEQ) -+ return 0; -+ p += CILEN_LZS; -+ len -= CILEN_LZS; - /* XXX Cope with first/fast ack */ -- if (len == 0) -+ if (p == p0 && len == 0) - return 1; - } --#endif - if (go->deflate) { - if (len < CILEN_DEFLATE - || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) -@@ -891,6 +1070,8 @@ static int - ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) - { - ccp_options *go = &ccp_gotoptions[f->unit]; -+ ccp_options *ao = &ccp_allowoptions[f->unit]; -+ ccp_options *wo = &ccp_wantoptions[f->unit]; - ccp_options no; /* options we've seen already */ - ccp_options try; /* options to ask for next time */ - -@@ -898,28 +1079,100 @@ static int - try = *go; - - #ifdef MPPE -- if (go->mppe && len >= CILEN_MPPE -- && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { -- no.mppe = 1; -- /* -- * Peer wants us to use a different strength or other setting. -- * Fail if we aren't willing to use his suggestion. -- */ -- MPPE_CI_TO_OPTS(&p[2], try.mppe); -- if ((try.mppe & MPPE_OPT_STATEFUL) && refuse_mppe_stateful) { -- error("Refusing MPPE stateful mode offered by peer"); -- try.mppe = 0; -- } else if (((go->mppe | MPPE_OPT_STATEFUL) & try.mppe) != try.mppe) { -- /* Peer must have set options we didn't request (suggest) */ -- try.mppe = 0; -- } -+ if ((go->mppe || go->mppc || (!wo->mppe && ao->mppe)) && -+ len >= CILEN_MPPE && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { - -- if (!try.mppe) { -- error("MPPE required but peer negotiation failed"); -- lcp_close(f->unit, "MPPE required but peer negotiation failed"); -+ if (go->mppc) { -+ no.mppc = 1; -+ if (!(p[5] & MPPE_MPPC)) -+ try.mppc = 0; -+ } -+ -+ if (go->mppe) -+ no.mppe = 1; -+ if (go->mppe_40) -+ no.mppe_40 = 1; -+ if (go->mppe_56) -+ no.mppe_56 = 1; -+ if (go->mppe_128) -+ no.mppe_128 = 1; -+ if (go->mppe_stateless) -+ no.mppe_stateless = 1; -+ -+ if (ao->mppe_40) { -+ if ((p[5] & MPPE_40BIT)) -+ try.mppe_40 = 1; -+ else -+ try.mppe_40 = (p[5] == 0) ? 1 : 0; -+ } -+ if (ao->mppe_56) { -+ if ((p[5] & MPPE_56BIT)) -+ try.mppe_56 = 1; -+ else -+ try.mppe_56 = (p[5] == 0) ? 1 : 0; -+ } -+ if (ao->mppe_128) { -+ if ((p[5] & MPPE_128BIT)) -+ try.mppe_128 = 1; -+ else -+ try.mppe_128 = (p[5] == 0) ? 1 : 0; -+ } -+ -+ if (ao->mppe_stateless) { -+ if ((p[2] & MPPE_STATELESS) || wo->mppe_stateless) -+ try.mppe_stateless = 1; -+ else -+ try.mppe_stateless = 0; -+ } -+ -+ if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128) { -+ try.mppe = try.mppe_stateless = 0; -+ if (wo->mppe) { -+ /* we require encryption, but peer doesn't support it -+ so we close connection */ -+ wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 = -+ wo->mppe_56 = wo->mppe_128 = 0; -+ lcp_close(f->unit, "MPPE required but cannot negotiate MPPE " -+ "key length"); -+ } -+ } -+ if (wo->mppe && (wo->mppe_40 != try.mppe_40) && -+ (wo->mppe_56 != try.mppe_56) && (wo->mppe_128 != try.mppe_128)) { -+ /* cannot negotiate key length */ -+ wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 = -+ wo->mppe_56 = wo->mppe_128 = 0; -+ lcp_close(f->unit, "Cannot negotiate MPPE key length"); - } -+ if (try.mppe_40 && try.mppe_56 && try.mppe_128) -+ try.mppe_40 = try.mppe_56 = 0; -+ else -+ if (try.mppe_56 && try.mppe_128) -+ try.mppe_56 = 0; -+ else -+ if (try.mppe_40 && try.mppe_128) -+ try.mppe_40 = 0; -+ else -+ if (try.mppe_40 && try.mppe_56) -+ try.mppe_40 = 0; -+ -+ p += CILEN_MPPE; -+ len -= CILEN_MPPE; - } - #endif /* MPPE */ -+ -+ if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) { -+ no.lzs = 1; -+ if (((p[2]<<8)|p[3]) > 1 || (p[4] != LZS_MODE_SEQ && -+ p[4] != LZS_MODE_EXT)) -+ try.lzs = 0; -+ else { -+ try.lzs_mode = p[4]; -+ try.lzs_hists = (p[2] << 8) | p[3]; -+ } -+ p += CILEN_LZS; -+ len -= CILEN_LZS; -+ } -+ - if (go->deflate && len >= CILEN_DEFLATE - && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - && p[1] == CILEN_DEFLATE) { -@@ -989,14 +1242,50 @@ ccp_rejci(fsm *f, u_char *p, int len) - return -1; - - #ifdef MPPE -- if (go->mppe && len >= CILEN_MPPE -+ if ((go->mppe || go->mppc) && len >= CILEN_MPPE - && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { -- error("MPPE required but peer refused"); -- lcp_close(f->unit, "MPPE required but peer refused"); -+ ccp_options *wo = &ccp_wantoptions[f->unit]; -+ if (p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0) || -+ p[3] != 0 || -+ p[4] != 0 || -+ p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) | -+ (go->mppe_56 ? MPPE_56BIT : 0) | -+ (go->mppe_128 ? MPPE_128BIT : 0) | -+ (go->mppc ? MPPE_MPPC : 0))) -+ return 0; -+ if (go->mppc) -+ try.mppc = 0; -+ if (go->mppe) { -+ try.mppe = 0; -+ if (go->mppe_40) -+ try.mppe_40 = 0; -+ if (go->mppe_56) -+ try.mppe_56 = 0; -+ if (go->mppe_128) -+ try.mppe_128 = 0; -+ if (go->mppe_stateless) -+ try.mppe_stateless = 0; -+ if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128) -+ try.mppe = try.mppe_stateless = 0; -+ if (wo->mppe) { /* we want MPPE but cannot negotiate key length */ -+ wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 = -+ wo->mppe_56 = wo->mppe_128 = 0; -+ lcp_close(f->unit, "MPPE required but cannot negotiate MPPE " -+ "key length"); -+ } -+ } - p += CILEN_MPPE; - len -= CILEN_MPPE; - } --#endif -+#endif /* MPPE */ -+ if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) { -+ if (p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff) -+ || p[4] != go->lzs_mode) -+ return 0; -+ try.lzs = 0; -+ p += CILEN_LZS; -+ len -= CILEN_LZS; -+ } - if (go->deflate_correct && len >= CILEN_DEFLATE - && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) -@@ -1056,14 +1345,15 @@ static int - ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) - { - int ret, newret, res; -- u_char *p0, *retp; -+ u_char *p0, *retp, p2, p5; - int len, clen, type, nb; - ccp_options *ho = &ccp_hisoptions[f->unit]; - ccp_options *ao = &ccp_allowoptions[f->unit]; -+ ccp_options *wo = &ccp_wantoptions[f->unit]; - #ifdef MPPE -- bool rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ -- /* CI_MPPE, or due to other options? */ --#endif -+ u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN]; -+/* int mtu; */ -+#endif /* MPPE */ - - ret = CONFACK; - retp = p0 = p; -@@ -1086,106 +1376,302 @@ ccp_reqci(fsm *f, u_char *p, int *lenp, - switch (type) { - #ifdef MPPE - case CI_MPPE: -- if (!ao->mppe || clen != CILEN_MPPE) { -+ if ((!ao->mppc && !ao->mppe) || clen != CILEN_MPPE) { - newret = CONFREJ; - break; - } -- MPPE_CI_TO_OPTS(&p[2], ho->mppe); -- -- /* Nak if anything unsupported or unknown are set. */ -- if (ho->mppe & MPPE_OPT_UNSUPPORTED) { -+ p2 = p[2]; -+ p5 = p[5]; -+ /* not sure what they want, tell 'em what we got */ -+ if (((p[2] & ~MPPE_STATELESS) != 0 || p[3] != 0 || p[4] != 0 || -+ (p[5] & ~(MPPE_40BIT | MPPE_56BIT | MPPE_128BIT | -+ MPPE_MPPC)) != 0 || p[5] == 0) || -+ (p[2] == 0 && p[3] == 0 && p[4] == 0 && p[5] == 0)) { - newret = CONFNAK; -- ho->mppe &= ~MPPE_OPT_UNSUPPORTED; -- } -- if (ho->mppe & MPPE_OPT_UNKNOWN) { -- newret = CONFNAK; -- ho->mppe &= ~MPPE_OPT_UNKNOWN; -- } -- -- /* Check state opt */ -- if (ho->mppe & MPPE_OPT_STATEFUL) { -- /* -- * We can Nak and request stateless, but it's a -- * lot easier to just assume the peer will request -- * it if he can do it; stateful mode is bad over -- * the Internet -- which is where we expect MPPE. -- */ -- if (refuse_mppe_stateful) { -- error("Refusing MPPE stateful mode offered by peer"); -- newret = CONFREJ; -- break; -+ p[2] = (wo->mppe_stateless ? MPPE_STATELESS : 0); -+ p[3] = 0; -+ p[4] = 0; -+ p[5] = (wo->mppe_40 ? MPPE_40BIT : 0) | -+ (wo->mppe_56 ? MPPE_56BIT : 0) | -+ (wo->mppe_128 ? MPPE_128BIT : 0) | -+ (wo->mppc ? MPPE_MPPC : 0); -+ break; -+ } -+ -+ if ((p[5] & MPPE_MPPC)) { -+ if (ao->mppc) { -+ ho->mppc = 1; -+ BCOPY(p, opt_buf, CILEN_MPPE); -+ opt_buf[2] = opt_buf[3] = opt_buf[4] = 0; -+ opt_buf[5] = MPPE_MPPC; -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 1) <= 0) { -+ ho->mppc = 0; -+ p[5] &= ~MPPE_MPPC; -+ newret = CONFNAK; -+ } -+ } else { -+ newret = CONFREJ; -+ if (wo->mppe || ao->mppe) { -+ p[5] &= ~MPPE_MPPC; -+ newret = CONFNAK; -+ } - } - } -- -- /* Find out which of {S,L} are set. */ -- if ((ho->mppe & MPPE_OPT_128) -- && (ho->mppe & MPPE_OPT_40)) { -- /* Both are set, negotiate the strongest. */ -- newret = CONFNAK; -- if (ao->mppe & MPPE_OPT_128) -- ho->mppe &= ~MPPE_OPT_40; -- else if (ao->mppe & MPPE_OPT_40) -- ho->mppe &= ~MPPE_OPT_128; -- else { -- newret = CONFREJ; -- break; -- } -- } else if (ho->mppe & MPPE_OPT_128) { -- if (!(ao->mppe & MPPE_OPT_128)) { -- newret = CONFREJ; -- break; -- } -- } else if (ho->mppe & MPPE_OPT_40) { -- if (!(ao->mppe & MPPE_OPT_40)) { -- newret = CONFREJ; -- break; -- } -+ if (ao->mppe) -+ ho->mppe = 1; -+ -+ if ((p[2] & MPPE_STATELESS)) { -+ if (ao->mppe_stateless) { -+ if (wo->mppe_stateless) -+ ho->mppe_stateless = 1; -+ else { -+ newret = CONFNAK; -+ if (!dont_nak) -+ p[2] &= ~MPPE_STATELESS; -+ } -+ } else { -+ newret = CONFNAK; -+ if (!dont_nak) -+ p[2] &= ~MPPE_STATELESS; -+ } -+ } else { -+ if (wo->mppe_stateless && !dont_nak) { -+ wo->mppe_stateless = 0; -+ newret = CONFNAK; -+ p[2] |= MPPE_STATELESS; -+ } -+ } -+ -+ if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT|MPPE_128BIT)) { -+ newret = CONFNAK; -+ if (ao->mppe_128) { -+ ho->mppe_128 = 1; -+ p[5] &= ~(MPPE_40BIT|MPPE_56BIT); -+ BCOPY(p, opt_buf, CILEN_MPPE); -+ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE], -+ MPPE_MAX_KEY_LEN); -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + -+ MPPE_MAX_KEY_LEN, 1) <= 0) { -+ ho->mppe_128 = 0; -+ p[5] |= (MPPE_40BIT|MPPE_56BIT); -+ p[5] &= ~MPPE_128BIT; -+ goto check_mppe_56_40; -+ } -+ goto check_mppe; -+ } -+ p[5] &= ~MPPE_128BIT; -+ goto check_mppe_56_40; -+ } -+ if ((p[5] & ~MPPE_MPPC) == (MPPE_56BIT|MPPE_128BIT)) { -+ newret = CONFNAK; -+ if (ao->mppe_128) { -+ ho->mppe_128 = 1; -+ p[5] &= ~MPPE_56BIT; -+ BCOPY(p, opt_buf, CILEN_MPPE); -+ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE], -+ MPPE_MAX_KEY_LEN); -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + -+ MPPE_MAX_KEY_LEN, 1) <= 0) { -+ ho->mppe_128 = 0; -+ p[5] |= MPPE_56BIT; -+ p[5] &= ~MPPE_128BIT; -+ goto check_mppe_56; -+ } -+ goto check_mppe; -+ } -+ p[5] &= ~MPPE_128BIT; -+ goto check_mppe_56; -+ } -+ if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_128BIT)) { -+ newret = CONFNAK; -+ if (ao->mppe_128) { -+ ho->mppe_128 = 1; -+ p[5] &= ~MPPE_40BIT; -+ BCOPY(p, opt_buf, CILEN_MPPE); -+ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE], -+ MPPE_MAX_KEY_LEN); -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + -+ MPPE_MAX_KEY_LEN, 1) <= 0) { -+ ho->mppe_128 = 0; -+ p[5] |= MPPE_40BIT; -+ p[5] &= ~MPPE_128BIT; -+ goto check_mppe_40; -+ } -+ goto check_mppe; -+ } -+ p[5] &= ~MPPE_128BIT; -+ goto check_mppe_40; -+ } -+ if ((p[5] & ~MPPE_MPPC) == MPPE_128BIT) { -+ if (ao->mppe_128) { -+ ho->mppe_128 = 1; -+ BCOPY(p, opt_buf, CILEN_MPPE); -+ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE], -+ MPPE_MAX_KEY_LEN); -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + -+ MPPE_MAX_KEY_LEN, 1) <= 0) { -+ ho->mppe_128 = 0; -+ p[5] &= ~MPPE_128BIT; -+ newret = CONFNAK; -+ } -+ goto check_mppe; -+ } -+ p[5] &= ~MPPE_128BIT; -+ newret = CONFNAK; -+ goto check_mppe; -+ } -+ check_mppe_56_40: -+ if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT)) { -+ newret = CONFNAK; -+ if (ao->mppe_56) { -+ ho->mppe_56 = 1; -+ p[5] &= ~MPPE_40BIT; -+ BCOPY(p, opt_buf, CILEN_MPPE); -+ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE], -+ MPPE_MAX_KEY_LEN); -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + -+ MPPE_MAX_KEY_LEN, 1) <= 0) { -+ ho->mppe_56 = 0; -+ p[5] |= MPPE_40BIT; -+ p[5] &= ~MPPE_56BIT; -+ newret = CONFNAK; -+ goto check_mppe_40; -+ } -+ goto check_mppe; -+ } -+ p[5] &= ~MPPE_56BIT; -+ goto check_mppe_40; -+ } -+ check_mppe_56: -+ if ((p[5] & ~MPPE_MPPC) == MPPE_56BIT) { -+ if (ao->mppe_56) { -+ ho->mppe_56 = 1; -+ BCOPY(p, opt_buf, CILEN_MPPE); -+ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE], -+ MPPE_MAX_KEY_LEN); -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + -+ MPPE_MAX_KEY_LEN, 1) <= 0) { -+ ho->mppe_56 = 0; -+ p[5] &= ~MPPE_56BIT; -+ newret = CONFNAK; -+ } -+ goto check_mppe; -+ } -+ p[5] &= ~MPPE_56BIT; -+ newret = CONFNAK; -+ goto check_mppe; -+ } -+ check_mppe_40: -+ if ((p[5] & ~MPPE_MPPC) == MPPE_40BIT) { -+ if (ao->mppe_40) { -+ ho->mppe_40 = 1; -+ BCOPY(p, opt_buf, CILEN_MPPE); -+ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE], -+ MPPE_MAX_KEY_LEN); -+ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + -+ MPPE_MAX_KEY_LEN, 1) <= 0) { -+ ho->mppe_40 = 0; -+ p[5] &= ~MPPE_40BIT; -+ newret = CONFNAK; -+ } -+ goto check_mppe; -+ } -+ p[5] &= ~MPPE_40BIT; -+ } -+ -+ check_mppe: -+ if (!ho->mppe_40 && !ho->mppe_56 && !ho->mppe_128) { -+ if (wo->mppe_40 || wo->mppe_56 || wo->mppe_128) { -+ newret = CONFNAK; -+ p[2] |= (wo->mppe_stateless ? MPPE_STATELESS : 0); -+ p[5] |= (wo->mppe_40 ? MPPE_40BIT : 0) | -+ (wo->mppe_56 ? MPPE_56BIT : 0) | -+ (wo->mppe_128 ? MPPE_128BIT : 0) | -+ (wo->mppc ? MPPE_MPPC : 0); -+ } else { -+ ho->mppe = ho->mppe_stateless = 0; -+ } - } else { -- /* Neither are set. */ -- /* We cannot accept this. */ -- newret = CONFNAK; -- /* Give the peer our idea of what can be used, -- so it can choose and confirm */ -- ho->mppe = ao->mppe; -- } -- -- /* rebuild the opts */ -- MPPE_OPTS_TO_CI(ho->mppe, &p[2]); -- if (newret == CONFACK) { -- u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN]; -- int mtu; -- -- BCOPY(p, opt_buf, CILEN_MPPE); -- BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE], -- MPPE_MAX_KEY_LEN); -- if (ccp_test(f->unit, opt_buf, -- CILEN_MPPE + MPPE_MAX_KEY_LEN, 1) <= 0) { -- /* This shouldn't happen, we've already tested it! */ -- error("MPPE required, but kernel has no support."); -- lcp_close(f->unit, "MPPE required but not available"); -- newret = CONFREJ; -- break; -- } -- /* -- * We need to decrease the interface MTU by MPPE_PAD -- * because MPPE frames **grow**. The kernel [must] -- * allocate MPPE_PAD extra bytes in xmit buffers. -- */ -- mtu = netif_get_mtu(f->unit); -- if (mtu) -- netif_set_mtu(f->unit, mtu - MPPE_PAD); -- else -- newret = CONFREJ; -- } -- -- /* -- * We have accepted MPPE or are willing to negotiate -- * MPPE parameters. A CONFREJ is due to subsequent -- * (non-MPPE) processing. -- */ -- rej_for_ci_mppe = 0; -- break; --#endif /* MPPE */ -+ /* MPPE is not compatible with other compression types */ -+ if (wo->mppe) { -+ ao->bsd_compress = 0; -+ ao->predictor_1 = 0; -+ ao->predictor_2 = 0; -+ ao->deflate = 0; -+ ao->lzs = 0; -+ } -+ } -+ if ((!ho->mppc || !ao->mppc) && !ho->mppe) { -+ p[2] = p2; -+ p[5] = p5; -+ newret = CONFREJ; -+ break; -+ } -+ -+ /* -+ * I have commented the code below because according to RFC1547 -+ * MTU is only information for higher level protocols about -+ * "the maximum allowable length for a packet (q.v.) transmitted -+ * over a point-to-point link without incurring network layer -+ * fragmentation." Of course a PPP implementation should be able -+ * to handle overhead added by MPPE - in our case apropriate code -+ * is located in drivers/net/ppp_generic.c in the kernel sources. -+ * -+ * According to RFC1661: -+ * - when negotiated MRU is less than 1500 octets, a PPP -+ * implementation must still be able to receive at least 1500 -+ * octets, -+ * - when PFC is negotiated, a PPP implementation is still -+ * required to receive frames with uncompressed protocol field. -+ * -+ * So why not to handle MPPE overhead without changing MTU value? -+ * I am sure that RFC3078, unfortunately silently, assumes that. -+ */ -+ -+ /* -+ * We need to decrease the interface MTU by MPPE_PAD -+ * because MPPE frames **grow**. The kernel [must] -+ * allocate MPPE_PAD extra bytes in xmit buffers. -+ */ -+ /* -+ mtu = netif_get_mtu(f->unit); -+ if (mtu) { -+ netif_set_mtu(f->unit, mtu - MPPE_PAD); -+ } else { -+ newret = CONFREJ; -+ if (ccp_wantoptions[f->unit].mppe) { -+ error("Cannot adjust MTU needed by MPPE."); -+ lcp_close(f->unit, "Cannot adjust MTU needed by MPPE."); -+ } -+ } -+ */ -+ break; -+ #endif /* MPPE */ -+ -+ case CI_LZS: -+ if (!ao->lzs || clen != CILEN_LZS) { -+ newret = CONFREJ; -+ break; -+ } -+ -+ ho->lzs = 1; -+ ho->lzs_hists = (p[2] << 8) | p[3]; -+ ho->lzs_mode = p[4]; -+ if ((ho->lzs_hists != ao->lzs_hists) || -+ (ho->lzs_mode != ao->lzs_mode)) { -+ newret = CONFNAK; -+ if (!dont_nak) { -+ p[2] = ao->lzs_hists >> 8; -+ p[3] = ao->lzs_hists & 0xff; -+ p[4] = ao->lzs_mode; -+ } else -+ break; -+ } -+ -+ if (p == p0 && ccp_test(f->unit, p, CILEN_LZS, 1) <= 0) { -+ newret = CONFREJ; -+ } -+ break; - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (!ao->deflate || clen != CILEN_DEFLATE -@@ -1327,12 +1813,6 @@ ccp_reqci(fsm *f, u_char *p, int *lenp, - else - *lenp = retp - p0; - } --#ifdef MPPE -- if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) { -- error("MPPE required but peer negotiation failed"); -- lcp_close(f->unit, "MPPE required but peer negotiation failed"); -- } --#endif - return ret; - } - -@@ -1353,24 +1833,35 @@ method_name(ccp_options *opt, ccp_option - char *p = result; - char *q = result + sizeof(result); /* 1 past result */ - -- slprintf(p, q - p, "MPPE "); -- p += 5; -- if (opt->mppe & MPPE_OPT_128) { -- slprintf(p, q - p, "128-bit "); -- p += 8; -- } -- if (opt->mppe & MPPE_OPT_40) { -- slprintf(p, q - p, "40-bit "); -- p += 7; -- } -- if (opt->mppe & MPPE_OPT_STATEFUL) -- slprintf(p, q - p, "stateful"); -- else -- slprintf(p, q - p, "stateless"); -- -+ if (opt->mppe) { -+ if (opt->mppc) { -+ slprintf(p, q - p, "MPPC/MPPE "); -+ p += 10; -+ } else { -+ slprintf(p, q - p, "MPPE "); -+ p += 5; -+ } -+ if (opt->mppe_128) { -+ slprintf(p, q - p, "128-bit "); -+ p += 8; -+ } else if (opt->mppe_56) { -+ slprintf(p, q - p, "56-bit "); -+ p += 7; -+ } else if (opt->mppe_40) { -+ slprintf(p, q - p, "40-bit "); -+ p += 7; -+ } -+ if (opt->mppe_stateless) -+ slprintf(p, q - p, "stateless"); -+ else -+ slprintf(p, q - p, "stateful"); -+ } else if (opt->mppc) -+ slprintf(p, q - p, "MPPC"); - break; - } --#endif -+#endif /* MPPE */ -+ case CI_LZS: -+ return "Stac LZS"; - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) -@@ -1425,12 +1916,12 @@ ccp_up(fsm *f) - } else if (ANY_COMPRESS(*ho)) - notice("%s transmit compression enabled", method_name(ho, NULL)); - #ifdef MPPE -- if (go->mppe) { -+ if (go->mppe || go->mppc) { - BZERO(mppe_recv_key, MPPE_MAX_KEY_LEN); - BZERO(mppe_send_key, MPPE_MAX_KEY_LEN); - continue_networks(f->unit); /* Bring up IP et al */ - } --#endif -+#endif /* MPPE */ - } - - /* -@@ -1452,7 +1943,7 @@ ccp_down(fsm *f) - lcp_close(f->unit, "MPPE disabled"); - } - } --#endif -+#endif /* MPPE */ - } - - /* -@@ -1509,24 +2000,28 @@ ccp_printpkt(u_char *p, int plen, - #ifdef MPPE - case CI_MPPE: - if (optlen >= CILEN_MPPE) { -- u_char mppe_opts; -- -- MPPE_CI_TO_OPTS(&p[2], mppe_opts); -- printer(arg, "mppe %s %s %s %s %s %s%s", -- (p[2] & MPPE_H_BIT)? "+H": "-H", -- (p[5] & MPPE_M_BIT)? "+M": "-M", -- (p[5] & MPPE_S_BIT)? "+S": "-S", -- (p[5] & MPPE_L_BIT)? "+L": "-L", -+ printer(arg, "mppe %s %s %s %s %s %s", -+ (p[2] & MPPE_STATELESS)? "+H": "-H", -+ (p[5] & MPPE_56BIT)? "+M": "-M", -+ (p[5] & MPPE_128BIT)? "+S": "-S", -+ (p[5] & MPPE_40BIT)? "+L": "-L", - (p[5] & MPPE_D_BIT)? "+D": "-D", -- (p[5] & MPPE_C_BIT)? "+C": "-C", -- (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); -- if (mppe_opts & MPPE_OPT_UNKNOWN) -+ (p[5] & MPPE_MPPC)? "+C": "-C"); -+ if ((p[5] & ~(MPPE_56BIT | MPPE_128BIT | MPPE_40BIT | -+ MPPE_D_BIT | MPPE_MPPC)) || -+ (p[2] & ~MPPE_STATELESS)) - printer(arg, " (%.2x %.2x %.2x %.2x)", - p[2], p[3], p[4], p[5]); - p += CILEN_MPPE; - } - break; --#endif -+#endif /* MPPE */ -+ case CI_LZS: -+ if (optlen >= CILEN_LZS) { -+ printer(arg, "lzs %.2x %.2x %.2x", p[2], p[3], p[4]); -+ p += CILEN_LZS; -+ } -+ break; - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (optlen >= CILEN_DEFLATE) { -@@ -1609,6 +2104,7 @@ ccp_datainput(int unit, u_char *pkt, int - error("Lost compression sync: disabling compression"); - ccp_close(unit, "Lost compression sync"); - #ifdef MPPE -+ /* My module dosn't need this. J.D., 2003-07-06 */ - /* - * If we were doing MPPE, we must also take the link down. - */ -@@ -1616,9 +2112,18 @@ ccp_datainput(int unit, u_char *pkt, int - error("Too many MPPE errors, closing LCP"); - lcp_close(unit, "Too many MPPE errors"); - } --#endif -+#endif /* MPPE */ - } else { - /* -+ * When LZS or MPPE/MPPC is negotiated we just send CCP_RESETREQ -+ * and don't wait for CCP_RESETACK -+ */ -+ if ((ccp_gotoptions[f->unit].method == CI_LZS) || -+ (ccp_gotoptions[f->unit].method == CI_MPPE)) { -+ fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); -+ return; -+ } -+ /* - * Send a reset-request to reset the peer's compressor. - * We don't do that if we are still waiting for an - * acknowledgement to a previous reset-request. ---- a/pppd/ccp.h -+++ b/pppd/ccp.h -@@ -37,9 +37,17 @@ typedef struct ccp_options { - bool predictor_2; /* do Predictor-2? */ - bool deflate_correct; /* use correct code for deflate? */ - bool deflate_draft; /* use draft RFC code for deflate? */ -+ bool lzs; /* do Stac LZS? */ -+ bool mppc; /* do MPPC? */ - u_char mppe; /* MPPE bitfield */ -+ bool mppe_40; /* allow 40 bit encryption? */ -+ bool mppe_56; /* allow 56 bit encryption? */ -+ bool mppe_128; /* allow 128 bit encryption? */ -+ bool mppe_stateless; /* allow stateless encryption */ - u_short bsd_bits; /* # bits/code for BSD Compress */ - u_short deflate_size; /* lg(window size) for Deflate */ -+ u_short lzs_mode; /* LZS check mode */ -+ u_short lzs_hists; /* number of LZS histories */ - short method; /* code for chosen compression method */ - } ccp_options; - ---- a/pppd/chap_ms.c -+++ b/pppd/chap_ms.c -@@ -964,13 +964,17 @@ set_mppe_enc_types(int policy, int types - /* - * Disable undesirable encryption types. Note that we don't ENABLE - * any encryption types, to avoid overriding manual configuration. -+ * -+ * It seems that 56 bit keys are unsupported in MS-RADIUS (see RFC 2548) - */ - switch(types) { - case MPPE_ENC_TYPES_RC4_40: -- ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ -+ ccp_wantoptions[0].mppe_128 = 0; /* disable 128-bit */ -+ ccp_wantoptions[0].mppe_56 = 0; /* disable 56-bit */ - break; - case MPPE_ENC_TYPES_RC4_128: -- ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ -+ ccp_wantoptions[0].mppe_56 = 0; /* disable 56-bit */ -+ ccp_wantoptions[0].mppe_40 = 0; /* disable 40-bit */ - break; - default: - break; diff --git a/package/network/services/ppp/patches/203-opt_flags.patch b/package/network/services/ppp/patches/203-opt_flags.patch deleted file mode 100644 index 705959e7ba2edb..00000000000000 --- a/package/network/services/ppp/patches/203-opt_flags.patch +++ /dev/null @@ -1,38 +0,0 @@ -build: Move optimization flags into a separate variable - -Isolate optimization related compiler flags from CFLAGS and move them into a -separate COPTS variable so that it is easier to override optimizations from -the environment. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/plugins/radius/Makefile.linux -+++ b/pppd/plugins/radius/Makefile.linux -@@ -47,13 +47,13 @@ install: all - $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR) - - radius.so: radius.o libradiusclient.a -- $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a -+ $(CC) $(LDFLAGS) -fPIC -o radius.so -shared radius.o libradiusclient.a - - radattr.so: radattr.o -- $(CC) $(LDFLAGS) -o radattr.so -shared radattr.o -+ $(CC) $(LDFLAGS) -fPIC -o radattr.so -shared radattr.o - - radrealms.so: radrealms.o -- $(CC) $(LDFLAGS) -o radrealms.so -shared radrealms.o -+ $(CC) $(LDFLAGS) -fPIC -o radrealms.so -shared radrealms.o - - CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \ - clientid.o sendserver.o lock.o util.o md5.o ---- a/pppd/plugins/pppoe/Makefile.linux -+++ b/pppd/plugins/pppoe/Makefile.linux -@@ -38,7 +38,7 @@ debug.o: debug.c - $(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c - - pppoe.so: plugin.o discovery.o if.o common.o -- $(CC) $(LDFLAGS) -o pppoe.so -shared plugin.o discovery.o if.o common.o -+ $(CC) $(LDFLAGS) -fPIC -o pppoe.so -shared plugin.o discovery.o if.o common.o - - install: all - $(INSTALL) -d -m 755 $(LIBDIR) diff --git a/package/network/services/ppp/patches/204-radius_config.patch b/package/network/services/ppp/patches/204-radius_config.patch index 2f30b9d3dcd367..3f6db59b710f24 100644 --- a/package/network/services/ppp/patches/204-radius_config.patch +++ b/package/network/services/ppp/patches/204-radius_config.patch @@ -1,6 +1,6 @@ --- a/pppd/plugins/radius/config.c +++ b/pppd/plugins/radius/config.c -@@ -371,31 +371,37 @@ static int test_config(char *filename) +@@ -381,31 +381,37 @@ static int test_config(char *filename) } #endif diff --git a/package/network/services/ppp/patches/205-no_exponential_timeout.patch b/package/network/services/ppp/patches/205-no_exponential_timeout.patch deleted file mode 100644 index b08c2eff891c95..00000000000000 --- a/package/network/services/ppp/patches/205-no_exponential_timeout.patch +++ /dev/null @@ -1,29 +0,0 @@ -pppd: Don't use exponential timeout in discovery phase - -This patch removes the exponential timeout increase between PADO or PADS -discovery attempts. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/plugins/pppoe/discovery.c -+++ b/pppd/plugins/pppoe/discovery.c -@@ -632,7 +632,9 @@ discovery(PPPoEConnection *conn) - conn->discoveryState = STATE_SENT_PADI; - waitForPADO(conn, timeout); - -+#if 0 - timeout *= 2; -+#endif - } while (conn->discoveryState == STATE_SENT_PADI); - - timeout = conn->discoveryTimeout; -@@ -647,7 +649,9 @@ discovery(PPPoEConnection *conn) - sendPADR(conn); - conn->discoveryState = STATE_SENT_PADR; - waitForPADS(conn, timeout); -+#if 0 - timeout *= 2; -+#endif - } while (conn->discoveryState == STATE_SENT_PADR); - - if (!conn->seenMaxPayload) { diff --git a/package/network/services/ppp/patches/207-lcp_mtu_max.patch b/package/network/services/ppp/patches/207-lcp_mtu_max.patch index 522576c6272e0f..3ca0534f3604dc 100644 --- a/package/network/services/ppp/patches/207-lcp_mtu_max.patch +++ b/package/network/services/ppp/patches/207-lcp_mtu_max.patch @@ -8,18 +8,18 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/lcp.c +++ b/pppd/lcp.c -@@ -1862,12 +1862,12 @@ lcp_up(fsm *f) +@@ -1888,12 +1888,12 @@ lcp_up(fsm *f) * the interface MTU is set to the lowest of that, the * MTU we want to use, and our link MRU. */ - mtu = ho->neg_mru? ho->mru: PPP_MRU; + mtu = MIN(ho->neg_mru? ho->mru: PPP_MRU, ao->mru); mru = go->neg_mru? MAX(wo->mru, go->mru): PPP_MRU; - #ifdef HAVE_MULTILINK + #ifdef PPP_WITH_MULTILINK if (!(multilink && go->neg_mrru && ho->neg_mrru)) - #endif /* HAVE_MULTILINK */ -- netif_set_mtu(f->unit, MIN(MIN(mtu, mru), ao->mru)); -+ netif_set_mtu(f->unit, MIN(mtu, mru)); + #endif /* PPP_WITH_MULTILINK */ +- ppp_set_mtu(f->unit, MIN(MIN(mtu, mru), ao->mru)); ++ ppp_set_mtu(f->unit, MIN(mtu, mru)); ppp_send_config(f->unit, mtu, (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), ho->neg_pcompression, ho->neg_accompression); diff --git a/package/network/services/ppp/patches/208-fix_status_code.patch b/package/network/services/ppp/patches/208-fix_status_code.patch index 1d991e79490052..10cd94537421ae 100644 --- a/package/network/services/ppp/patches/208-fix_status_code.patch +++ b/package/network/services/ppp/patches/208-fix_status_code.patch @@ -12,13 +12,13 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -1035,7 +1035,8 @@ get_input(void) +@@ -1152,7 +1152,8 @@ get_input(void) } notice("Modem hangup"); hungup = 1; -- status = EXIT_HANGUP; -+ if (status == EXIT_OK) -+ status = EXIT_HANGUP; +- code = EXIT_HANGUP; ++ if (code == EXIT_OK) ++ code = EXIT_HANGUP; lcp_lowerdown(0); /* serial link is no longer available */ link_terminated(0); return; diff --git a/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch b/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch deleted file mode 100644 index 87e340b3f112f6..00000000000000 --- a/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch +++ /dev/null @@ -1,20 +0,0 @@ -build: Add required CFLAGS for libpcap - -This patch adds some flags to required to properly link libpcap within the -OpenWrt environment. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/Makefile.linux -+++ b/pppd/Makefile.linux -@@ -210,8 +210,8 @@ LIBS += -ldl - endif - - ifdef FILTER --LIBS += -lpcap --CFLAGS += -DPPP_FILTER -+LIBS += -lpcap -L$(STAGING_DIR)/usr/lib -+CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include - endif - - ifdef HAVE_INET6 diff --git a/package/network/services/ppp/patches/310-precompile_filter.patch b/package/network/services/ppp/patches/310-precompile_filter.patch index ca91d153e9bd6a..ad0dd03de8e1ea 100644 --- a/package/network/services/ppp/patches/310-precompile_filter.patch +++ b/package/network/services/ppp/patches/310-precompile_filter.patch @@ -11,62 +11,70 @@ packets which are treated as active. Signed-off-by: Jo-Philipp Wich ---- a/pppd/Makefile.linux -+++ b/pppd/Makefile.linux -@@ -51,6 +51,9 @@ MPPE=y - # and that the kernel driver support PPP packet filtering. - #FILTER=y +--- a/configure.ac ++++ b/configure.ac +@@ -306,6 +306,9 @@ AM_CONDITIONAL(PPP_WITH_PAM, test "x${wi + # With libpcap support, activate pppd on network activity + AX_CHECK_PCAP -+# Support for precompiled filters -+PRECOMPILED_FILTER=y ++# internal statically linked pcap ++AM_CONDITIONAL(PPP_WITH_PRECOMPILED_FILTER, test "x${with_static_pcap}" = "xyes") + - # Uncomment the next line to enable multilink PPP (enabled by default) - # Linux distributions: Please leave multilink ENABLED in your builds - # of pppd! -@@ -214,6 +217,14 @@ LIBS += -lpcap -L$(STAGING_DIR)/usr/l - CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include + # + # SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter + AM_CONDITIONAL([PPP_WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ]) +@@ -359,6 +362,7 @@ $PACKAGE_NAME version $PACKAGE_VERSION + With libatm..........: ${with_atm:-no} + With libpam..........: ${with_pam:-no} + With libpcap.........: ${with_pcap:-no} ++ With static libpcap..: ${with_static_pcap:-no} + With libsrp..........: ${with_srp:-no} + C Compiler...........: $CC $CFLAGS + Linker...............: $LD $LDFLAGS $LIBS +--- a/pppd/Makefile.am ++++ b/pppd/Makefile.am +@@ -138,6 +138,12 @@ pppd_LDFLAGS += $(PCAP_LDFLAGS) + pppd_LIBS += $(PCAP_LIBS) endif -+ifdef PRECOMPILED_FILTER -+PPPDSRCS += pcap_pcc.c -+HEADERS += pcap_pcc.h -+PPPDOBJS += pcap_pcc.o -+LIBS += $(STAGING_DIR)/usr/lib/libpcap.a -+CFLAGS += -DPPP_FILTER -DPPP_PRECOMPILED_FILTER -I$(STAGING_DIR)/usr/include ++if PPP_WITH_PRECOMPILED_FILTER ++pppd_SOURCES += pcap_pcc.c ++pppd_include_HEADERS += pcap_pcc.h ++pppd_LIBS += $(STAGING_DIR)/usr/lib/libpcap.a +endif + - ifdef HAVE_INET6 - PPPDSRCS += ipv6cp.c eui64.c - HEADERS += ipv6cp.h eui64.h + if PPP_WITH_PLUGINS + pppd_CPPFLAGS += -DPPPD_PLUGIN_DIR='"@PPPD_PLUGIN_DIR@"' + pppd_LIBS += -ldl --- a/pppd/options.c +++ b/pppd/options.c -@@ -56,6 +56,7 @@ +@@ -62,6 +62,7 @@ - #ifdef PPP_FILTER + #ifdef PPP_WITH_FILTER #include +#include /* * There have been 3 or 4 different names for this in libpcap CVS, but * this seems to be what they have settled on... -@@ -168,6 +169,13 @@ static int setlogfile(char **); +@@ -182,6 +183,13 @@ static int setlogfile(char **); static int loadplugin(char **); #endif -+#ifdef PPP_PRECOMPILED_FILTER ++#ifdef PPP_WITH_PRECOMPILED_FILTER +#include "pcap_pcc.h" +static int setprecompiledpassfilter(char **); +static int setprecompiledactivefilter(char **); -+#undef PPP_FILTER ++#undef PPP_WITH_FILTER +#endif + - #ifdef PPP_FILTER + #ifdef PPP_WITH_FILTER static int setpassfilter(char **); static int setactivefilter(char **); -@@ -360,6 +368,14 @@ option_t general_options[] = { +@@ -391,6 +399,14 @@ struct option general_options[] = { "set filter for active pkts", OPT_PRIO }, #endif -+#ifdef PPP_PRECOMPILED_FILTER ++#ifdef PPP_WITH_PRECOMPILED_FILTER + { "precompiled-pass-filter", 1, setprecompiledpassfilter, + "set precompiled filter for packets to pass", OPT_PRIO }, + @@ -74,14 +82,14 @@ Signed-off-by: Jo-Philipp Wich + "set precompiled filter for active pkts", OPT_PRIO }, +#endif + - #ifdef MAXOCTETS { "maxoctets", o_int, &maxoctets, "Set connection traffic limit", -@@ -1468,6 +1484,27 @@ callfile(char **argv) + OPT_PRIO | OPT_LLIMIT | OPT_NOINCR | OPT_ZEROINF }, +@@ -1666,6 +1682,27 @@ callfile(char **argv) return ok; } -+#ifdef PPP_PRECOMPILED_FILTER ++#ifdef PPP_WITH_PRECOMPILED_FILTER +/* + * setprecompiledpassfilter - Set the pass filter for packets using a + * precompiled expression @@ -102,18 +110,19 @@ Signed-off-by: Jo-Philipp Wich +} +#endif + - #ifdef PPP_FILTER + #ifdef PPP_WITH_FILTER /* * setpassfilter - Set the pass filter for packets --- /dev/null +++ b/pppd/pcap_pcc.c -@@ -0,0 +1,74 @@ +@@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include +#include ++#include "options.h" +#include "pppd.h" + +int pcap_pre_compiled (char * fname, struct bpf_program *p) @@ -123,7 +132,7 @@ Signed-off-by: Jo-Philipp Wich + FILE *f = fopen (fname, "r"); + if (!f) + { -+ option_error("error opening precompiled active-filter '%s': %s", ++ ppp_option_error("error opening precompiled active-filter '%s': %s", + fname, strerror (errno)); + return 0; + } @@ -167,18 +176,18 @@ Signed-off-by: Jo-Philipp Wich + } + if (size != index) + { -+ option_error("error in precompiled active-filter," -+ " expected %d expressions, got %dn", -+ size, index); ++ ppp_option_error("error in precompiled active-filter," ++ " expected %d expressions, got %dn", ++ size, index); + ret = 0; + } + fclose(f); + return ret; + +err: -+ option_error("error in precompiled active-filter" -+ " expression line %s:%d (wrong size)\n", -+ fname, line); ++ ppp_option_error("error in precompiled active-filter" ++ " expression line %s:%d (wrong size)\n", ++ fname, line); + fclose (f); + return 0; +} diff --git a/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch b/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch index 0ae84ae1ed9adc..a761ca650d6cb0 100644 --- a/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch +++ b/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch @@ -8,15 +8,15 @@ Signed-off-by: George Kashperko 2 files changed, 53 insertions(+), 14 deletions(-) --- a/pppd/multilink.c +++ b/pppd/multilink.c -@@ -35,6 +35,7 @@ +@@ -40,6 +40,7 @@ #include #include #include +#include - #include "pppd.h" + #include "pppd-private.h" #include "fsm.h" -@@ -56,7 +57,8 @@ static void iterate_bundle_links(void (* +@@ -62,7 +63,8 @@ static void iterate_bundle_links(void (* static int get_default_epdisc(struct epdisc *); static int parse_num(char *str, const char *key, int *valp); @@ -26,7 +26,7 @@ Signed-off-by: George Kashperko #define set_ip_epdisc(ep, addr) do { \ ep->length = 4; \ -@@ -197,35 +199,38 @@ mp_join_bundle(void) +@@ -215,35 +217,38 @@ mp_join_bundle(void) key.dptr = bundle_id; key.dsize = p - bundle_id; pid = tdb_fetch(pppdb, key); @@ -61,7 +61,7 @@ Signed-off-by: George Kashperko - if (bundle_attach(unit)) { + if (unit >= 0 && bundle_attach(unit)) { set_ifunit(0); - script_setenv("BUNDLE", bundle_id + 7, 0); + ppp_script_setenv("BUNDLE", bundle_id + 7, 0); make_bundle_links(1); unlock_db(); - info("Link attached to %s", ifname); @@ -73,7 +73,7 @@ Signed-off-by: George Kashperko } /* we have to make a new bundle */ -@@ -405,20 +410,39 @@ parse_num(char *str, const char *key, in +@@ -423,20 +428,39 @@ parse_num(char *str, const char *key, in return 0; } @@ -119,7 +119,7 @@ Signed-off-by: George Kashperko && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -923,6 +923,16 @@ void cfg_bundle(int mrru, int mtru, int +@@ -984,6 +984,16 @@ void cfg_bundle(int mrru, int mtru, int add_fd(ppp_dev_fd); } @@ -129,14 +129,14 @@ Signed-off-by: George Kashperko +#ifdef USE_TDB + char tmp[11]; + slprintf(tmp, sizeof(tmp), "%d", ifunit); -+ script_setenv("IFUNIT", tmp, 0); ++ ppp_script_setenv("IFUNIT", tmp, 0); +#endif +} + /* * make_new_bundle - create a new PPP unit (i.e. a bundle) * and connect our channel to it. This should only get called -@@ -941,6 +951,8 @@ void make_new_bundle(int mrru, int mtru, +@@ -1002,6 +1012,8 @@ void make_new_bundle(int mrru, int mtru, /* set the mrru and flags */ cfg_bundle(mrru, mtru, rssn, tssn); diff --git a/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch b/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch deleted file mode 100644 index 3d2a815dbd9bf3..00000000000000 --- a/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch +++ /dev/null @@ -1,22 +0,0 @@ -pppd: Retain foreign default routes on Linux - -On Linux, when pppd attempts to delete its default route it does not fill -the rt_dev field of the struct rtentry used to match the system default route. -As a consequence, pppd happily deletes any default route even if it belongs -to another interface. - -This patch makes pppd fill out the rt_dev field so that only own default -routes are ever matched. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -2248,6 +2248,7 @@ int cifdefaultroute (int unit, u_int32_t - SIN_ADDR(rt.rt_genmask) = 0L; - } - -+ rt.rt_dev = ifname; - rt.rt_flags = RTF_UP; - if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) { - if (still_ppp()) { diff --git a/package/network/services/ppp/patches/340-populate_default_gateway.patch b/package/network/services/ppp/patches/340-populate_default_gateway.patch index 64d03fb5c474b0..f3279713469d38 100644 --- a/package/network/services/ppp/patches/340-populate_default_gateway.patch +++ b/package/network/services/ppp/patches/340-populate_default_gateway.patch @@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -2198,6 +2198,9 @@ int sifdefaultroute (int unit, u_int32_t +@@ -2251,6 +2251,9 @@ int sifdefaultroute (int unit, u_int32_t memset (&rt, 0, sizeof (rt)); SET_SA_FAMILY (rt.rt_dst, AF_INET); @@ -23,7 +23,7 @@ Signed-off-by: Jo-Philipp Wich rt.rt_dev = ifname; rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */ -@@ -2206,7 +2209,7 @@ int sifdefaultroute (int unit, u_int32_t +@@ -2259,7 +2262,7 @@ int sifdefaultroute (int unit, u_int32_t SIN_ADDR(rt.rt_genmask) = 0L; } diff --git a/package/network/services/ppp/patches/400-simplify_kernel_checks.patch b/package/network/services/ppp/patches/400-simplify_kernel_checks.patch index 9d0ea9a0b84d16..137937c2448de0 100644 --- a/package/network/services/ppp/patches/400-simplify_kernel_checks.patch +++ b/package/network/services/ppp/patches/400-simplify_kernel_checks.patch @@ -10,7 +10,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -235,7 +235,7 @@ static int driver_is_old = 0; +@@ -231,7 +231,7 @@ static int driver_is_old = 0; static int restore_term = 0; /* 1 => we've munged the terminal */ static struct termios inittermios; /* Initial TTY termios */ @@ -19,7 +19,7 @@ Signed-off-by: Jo-Philipp Wich static char loop_name[20]; static unsigned char inbuf[512]; /* buffer for chars read from loopback */ -@@ -254,8 +254,8 @@ static int looped; /* 1 if using loop +@@ -250,8 +250,8 @@ static int looped; /* 1 if using loop static int link_mtu; /* mtu for the link (not bundle) */ static struct utsname utsname; /* for the kernel version */ @@ -29,7 +29,7 @@ Signed-off-by: Jo-Philipp Wich #define MAX_IFS 100 -@@ -1933,11 +1933,12 @@ int ccp_fatal_error (int unit) +@@ -1970,11 +1970,12 @@ int ccp_fatal_error (int unit) * * path_to_procfs - find the path to the proc file system mount point */ @@ -44,7 +44,7 @@ Signed-off-by: Jo-Philipp Wich struct mntent *mntent; FILE *fp; -@@ -1959,6 +1960,7 @@ static char *path_to_procfs(const char * +@@ -1996,6 +1997,7 @@ static char *path_to_procfs(const char * fclose (fp); } } @@ -52,7 +52,7 @@ Signed-off-by: Jo-Philipp Wich strlcpy(proc_path + proc_path_len, tail, sizeof(proc_path) - proc_path_len); -@@ -2843,15 +2845,19 @@ int ppp_available(void) +@@ -2895,15 +2897,19 @@ int ppp_check_kernel_support(void) int my_version, my_modification, my_patch; int osmaj, osmin, ospatch; @@ -72,7 +72,7 @@ Signed-off-by: Jo-Philipp Wich /* XXX should get from driver */ driver_version = 2; -@@ -2911,6 +2917,7 @@ int ppp_available(void) +@@ -2963,6 +2969,7 @@ int ppp_check_kernel_support(void) if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP)) ok = 0; @@ -80,7 +80,7 @@ Signed-off-by: Jo-Philipp Wich /* * This is the PPP device. Validate the version of the driver at this -@@ -3592,6 +3599,7 @@ get_pty(int *master_fdp, int *slave_fdp, +@@ -3577,6 +3584,7 @@ get_pty(int *master_fdp, int *slave_fdp, } #endif /* TIOCGPTN */ @@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich if (sfd < 0) { /* the old way - scan through the pty name space */ for (i = 0; i < 64; ++i) { -@@ -3610,6 +3618,7 @@ get_pty(int *master_fdp, int *slave_fdp, +@@ -3601,6 +3609,7 @@ get_pty(int *master_fdp, int *slave_fdp, } } } @@ -98,26 +98,26 @@ Signed-off-by: Jo-Philipp Wich return 0; --- a/pppd/plugins/pppoatm/pppoatm.c +++ b/pppd/plugins/pppoatm/pppoatm.c -@@ -171,14 +171,6 @@ static void disconnect_pppoatm(void) +@@ -179,14 +179,6 @@ static void disconnect_pppoatm(void) void plugin_init(void) { -#ifdef linux - extern int new_style_driver; /* From sys-linux.c */ -- if (!ppp_available() && !new_style_driver) +- if (!ppp_check_kernel_support() && !new_style_driver) - fatal("Kernel doesn't support ppp_generic - " - "needed for PPPoATM"); -#else - fatal("No PPPoATM support on this OS"); -#endif - add_options(pppoa_options); + ppp_add_options(pppoa_options); } --- a/pppd/plugins/pppoe/plugin.c +++ b/pppd/plugins/pppoe/plugin.c -@@ -58,9 +58,6 @@ static char const RCSID[] = +@@ -57,9 +57,6 @@ static char const RCSID[] = - char pppd_version[] = VERSION; + char pppd_version[] = PPPD_VERSION; -/* From sys-linux.c in pppd -- MUST FIX THIS! */ -extern int new_style_driver; @@ -125,30 +125,30 @@ Signed-off-by: Jo-Philipp Wich char *pppd_pppoe_service = NULL; static char *acName = NULL; static char *existingSession = NULL; -@@ -407,10 +404,6 @@ PPPoEDevnameHook(char *cmd, char **argv, +@@ -421,10 +418,6 @@ PPPoEDevnameHook(char *cmd, char **argv, void plugin_init(void) { -- if (!ppp_available() && !new_style_driver) { +- if (!ppp_check_kernel_support() && !new_style_driver) { - fatal("Linux kernel does not support PPPoE -- are you running 2.4.x?"); - } - - add_options(Options); + ppp_add_options(Options); - info("PPPoE plugin from pppd %s", VERSION); + info("PPPoE plugin from pppd %s", PPPD_VERSION); --- a/pppd/plugins/pppol2tp/pppol2tp.c +++ b/pppd/plugins/pppol2tp/pppol2tp.c -@@ -490,12 +490,7 @@ static void pppol2tp_cleanup(void) +@@ -500,12 +500,7 @@ static void pppol2tp_cleanup(void) void plugin_init(void) { -#if defined(__linux__) - extern int new_style_driver; /* From sys-linux.c */ -- if (!ppp_available() && !new_style_driver) +- if (!ppp_check_kernel_support() && !new_style_driver) - fatal("Kernel doesn't support ppp_generic - " - "needed for PPPoL2TP"); -#else +#if !defined(__linux__) fatal("No PPPoL2TP support on this OS"); #endif - add_options(pppol2tp_options); + ppp_add_options(pppol2tp_options); diff --git a/package/network/services/ppp/patches/401-no_record_file.patch b/package/network/services/ppp/patches/401-no_record_file.patch index 0304f36fe2bbda..5ef1a178d704aa 100644 --- a/package/network/services/ppp/patches/401-no_record_file.patch +++ b/package/network/services/ppp/patches/401-no_record_file.patch @@ -5,19 +5,19 @@ information to the permanent storage, therfore remove this option. Signed-off-by: Jo-Philipp Wich ---- a/pppd/pppd.h -+++ b/pppd/pppd.h -@@ -318,7 +318,6 @@ extern int holdoff; /* Dead time before +--- a/pppd/pppd-private.h ++++ b/pppd/pppd-private.h +@@ -187,7 +187,6 @@ extern int holdoff; /* Dead time before extern bool holdoff_specified; /* true if user gave a holdoff value */ extern bool notty; /* Stdin/out is not a tty */ extern char *pty_socket; /* Socket to connect to pty */ -extern char *record_file; /* File to record chars sent/received */ - extern bool sync_serial; /* Device is synchronous serial device */ extern int maxfail; /* Max # of unsuccessful connection attempts */ - extern char linkname[MAXPATHLEN]; /* logical name for link */ + extern char linkname[]; /* logical name for link */ + extern bool tune_kernel; /* May alter kernel settings as necessary */ --- a/pppd/tty.c +++ b/pppd/tty.c -@@ -143,7 +143,7 @@ char *disconnect_script = NULL; /* Scrip +@@ -150,7 +150,7 @@ char *disconnect_script = NULL; /* Scrip char *welcomer = NULL; /* Script to run after phys link estab. */ char *ptycommand = NULL; /* Command to run on other side of pty */ bool notty = 0; /* Stdin/out is not a tty */ @@ -26,7 +26,7 @@ Signed-off-by: Jo-Philipp Wich int max_data_rate; /* max bytes/sec through charshunt */ bool sync_serial = 0; /* Device is synchronous serial device */ char *pty_socket = NULL; /* Socket to connect to pty */ -@@ -199,8 +199,10 @@ option_t tty_options[] = { +@@ -206,8 +206,10 @@ static struct option tty_options[] = { "Send and receive over socket, arg is host:port", OPT_PRIO | OPT_DEVNAM }, diff --git a/package/network/services/ppp/patches/403-no_wtmp.patch b/package/network/services/ppp/patches/403-no_wtmp.patch deleted file mode 100644 index 90c2a8208a5543..00000000000000 --- a/package/network/services/ppp/patches/403-no_wtmp.patch +++ /dev/null @@ -1,25 +0,0 @@ -pppd: Disable wtmp support - -Many uClibc based environments lack wtmp and utmp support, therfore remove -the code updating the wtmp information. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -2981,6 +2981,7 @@ int ppp_available(void) - - void logwtmp (const char *line, const char *name, const char *host) - { -+#if 0 - struct utmp ut, *utp; - pid_t mypid = getpid(); - #if __GLIBC__ < 2 -@@ -3046,6 +3047,7 @@ void logwtmp (const char *line, const ch - close (wtmp); - } - #endif -+#endif - } - #endif /* HAVE_LOGWTMP */ - diff --git a/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch b/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch index 8bed425a5b3c33..6b2d15ed256f91 100644 --- a/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch +++ b/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -867,14 +867,17 @@ struct protocol_list { +@@ -984,14 +984,17 @@ struct protocol_list { const char *name; } protocol_list[] = { { 0x21, "IP" }, @@ -25,7 +25,7 @@ Signed-off-by: Jo-Philipp Wich { 0x33, "Stream Protocol ST-II" }, { 0x35, "Banyan Vines" }, { 0x39, "AppleTalk EDDP" }, -@@ -888,8 +891,11 @@ struct protocol_list { +@@ -1005,8 +1008,11 @@ struct protocol_list { { 0x49, "Serial Data Transport Protocol (PPP-SDTP)" }, { 0x4b, "SNA over 802.2" }, { 0x4d, "SNA" }, @@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich { 0x53, "Encryption" }, { 0x55, "Individual Link Encryption" }, { 0x57, "IPv6" }, -@@ -900,12 +906,15 @@ struct protocol_list { +@@ -1017,12 +1023,15 @@ struct protocol_list { { 0x65, "RTP IPHC Compressed non-TCP" }, { 0x67, "RTP IPHC Compressed UDP 8" }, { 0x69, "RTP IPHC Compressed RTP 8" }, @@ -53,7 +53,7 @@ Signed-off-by: Jo-Philipp Wich { 0x0203, "IBM Source Routing BPDU" }, { 0x0205, "DEC LANBridge100 Spanning Tree" }, { 0x0207, "Cisco Discovery Protocol" }, -@@ -917,15 +926,19 @@ struct protocol_list { +@@ -1034,15 +1043,19 @@ struct protocol_list { { 0x0231, "Luxcom" }, { 0x0233, "Sigma Network Systems" }, { 0x0235, "Apple Client Server Protocol" }, @@ -73,7 +73,7 @@ Signed-off-by: Jo-Philipp Wich { 0x4001, "Cray Communications Control Protocol" }, { 0x4003, "CDPD Mobile Network Registration Protocol" }, { 0x4005, "Expand accelerator protocol" }, -@@ -936,8 +949,10 @@ struct protocol_list { +@@ -1053,8 +1066,10 @@ struct protocol_list { { 0x4023, "RefTek Protocol" }, { 0x4025, "Fibre Channel" }, { 0x4027, "EMIT Protocols" }, @@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich { 0x8023, "OSI Network Layer Control Protocol" }, { 0x8025, "Xerox NS IDP Control Protocol" }, { 0x8027, "DECnet Phase IV Control Protocol" }, -@@ -946,7 +961,9 @@ struct protocol_list { +@@ -1063,7 +1078,9 @@ struct protocol_list { { 0x8031, "Bridging NCP" }, { 0x8033, "Stream Protocol Control Protocol" }, { 0x8035, "Banyan Vines Control Protocol" }, @@ -94,7 +94,7 @@ Signed-off-by: Jo-Philipp Wich { 0x803f, "NETBIOS Framing Control Protocol" }, { 0x8041, "Cisco Systems Control Protocol" }, { 0x8043, "Ascom Timeplex" }, -@@ -955,18 +972,24 @@ struct protocol_list { +@@ -1072,18 +1089,24 @@ struct protocol_list { { 0x8049, "Serial Data Control Protocol (PPP-SDCP)" }, { 0x804b, "SNA over 802.2 Control Protocol" }, { 0x804d, "SNA Control Protocol" }, @@ -119,7 +119,7 @@ Signed-off-by: Jo-Philipp Wich { 0x8207, "Cisco Discovery Protocol Control" }, { 0x8209, "Netcs Twin Routing" }, { 0x820b, "STP - Control Protocol" }, -@@ -975,24 +998,29 @@ struct protocol_list { +@@ -1092,24 +1115,29 @@ struct protocol_list { { 0x8281, "MPLSCP" }, { 0x8285, "IEEE p1284.4 standard - Protocol Control" }, { 0x8287, "ETSI TETRA TNP1 Control Protocol" }, diff --git a/package/network/services/ppp/patches/405-no_multilink_option.patch b/package/network/services/ppp/patches/405-no_multilink_option.patch index a34ec57b0a9eec..654bebd56920c7 100644 --- a/package/network/services/ppp/patches/405-no_multilink_option.patch +++ b/package/network/services/ppp/patches/405-no_multilink_option.patch @@ -9,7 +9,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/options.c +++ b/pppd/options.c -@@ -348,13 +348,14 @@ option_t general_options[] = { +@@ -379,13 +379,14 @@ struct option general_options[] = { "Enable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 1 }, { "nomultilink", o_bool, &multilink, "Disable multilink operation", OPT_PRIOSUB | 0 }, @@ -18,11 +18,11 @@ Signed-off-by: Jo-Philipp Wich { "bundle", o_string, &bundle_name, "Bundle name for multilink", OPT_PRIO }, - #endif /* HAVE_MULTILINK */ + #endif /* PPP_WITH_MULTILINK */ + { "nomp", o_bool, &multilink, + "Disable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 0 }, + - #ifdef PLUGIN + #ifdef PPP_WITH_PLUGINS { "plugin", o_special, (void *)loadplugin, "Load a plug-in module into pppd", OPT_PRIV | OPT_A2LIST }, diff --git a/package/network/services/ppp/patches/500-add-pptp-plugin.patch b/package/network/services/ppp/patches/500-add-pptp-plugin.patch index 96f4bcaf702d27..4b66cd216572df 100644 --- a/package/network/services/ppp/patches/500-add-pptp-plugin.patch +++ b/package/network/services/ppp/patches/500-add-pptp-plugin.patch @@ -1,59 +1,43 @@ ---- a/configure -+++ b/configure -@@ -133,7 +133,7 @@ if [ -d "$ksrc" ]; then - mkmkf $ksrc/Makedefs$compiletype Makedefs.com - for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/pppoe \ - pppd/plugins/radius pppd/plugins/pppoatm \ -- pppd/plugins/pppol2tp; do -+ pppd/plugins/pppol2tp pppd/plugins/pptp ; do - mkmkf $dir/Makefile.$makext $dir/Makefile - done - if [ -f $ksrc/Makefile.$makext$archvariant ]; then ---- a/pppd/plugins/Makefile.linux -+++ b/pppd/plugins/Makefile.linux -@@ -14,7 +14,7 @@ INSTALL = install - # EAP-TLS - CFLAGS += -DUSE_EAPTLS=1 +--- a/configure.ac ++++ b/configure.ac +@@ -344,6 +344,7 @@ AC_CONFIG_FILES([ + pppd/plugins/pppoatm/Makefile + pppd/plugins/pppol2tp/Makefile + pppd/plugins/radius/Makefile ++ pppd/plugins/pptp/Makefile + pppdump/Makefile + pppstats/Makefile + scripts/Makefile +--- a/pppd/plugins/Makefile.am ++++ b/pppd/plugins/Makefile.am +@@ -21,5 +21,5 @@ winbind_la_LDFLAGS = $(PLUGIN_LDFLAGS) + winbind_la_SOURCES = winbind.c --SUBDIRS := pppoe pppoatm pppol2tp -+SUBDIRS := pppoe pppoatm pppol2tp pptp - # Uncomment the next line to include the radius authentication plugin - SUBDIRS += radius - PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so + if !SUNOS +-SUBDIRS = pppoe pppoatm pppol2tp radius ++SUBDIRS = pppoe pppoatm pppol2tp radius pptp + endif --- /dev/null -+++ b/pppd/plugins/pptp/Makefile.linux -@@ -0,0 +1,31 @@ -+# -+# This program may be distributed according to the terms of the GNU -+# General Public License, version 2 or (at your option) any later version. -+# -+# $Id: Makefile.linux,v 1.9 2012/05/04 21:48:00 dgolle Exp $ -+#*********************************************************************** -+ -+DESTDIR = $(INSTROOT)@DESTDIR@ -+LIBDIR = $(DESTDIR)/lib/pppd/$(PPPDVERSION) -+ -+PPPDVERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h) -+ -+INSTALL = install -+ -+COPTS=-O2 -g -+CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC -DPPPD_VERSION=\"$(PPPDVERSION)\" -+all: pptp.so -+ -+%.o: %.c -+ $(CC) $(CFLAGS) -c -o $@ $< -+ -+pptp.so: dirutil.o orckit_quirks.o pptp.o pptp_callmgr.o pptp_ctrl.o pptp_quirks.o util.o vector.o -+ $(CC) -o pptp.so -shared dirutil.o orckit_quirks.o pptp.o pptp_callmgr.o pptp_ctrl.o pptp_quirks.o util.o vector.o -+ -+install: all -+ $(INSTALL) -d -m 755 $(LIBDIR) -+ $(INSTALL) -c -m 4550 pptp.so $(LIBDIR) -+ -+clean: -+ rm -f *.o *.so -+ ++++ b/pppd/plugins/pptp/Makefile.am +@@ -0,0 +1,18 @@ ++pppd_plugin_LTLIBRARIES = pptp.la ++pppd_plugindir = $(PPPD_PLUGIN_DIR) ++ ++noinst_HEADERS = \ ++ dirutil.h \ ++ orckit_quirks.h \ ++ pptp_callmgr.h \ ++ pptp_ctrl.h \ ++ pptp_msg.h \ ++ pptp_options.h \ ++ pptp_quirks.h \ ++ util.h \ ++ vector.h ++ ++pptp_la_CPPFLAGS = -I${top_srcdir} -DSYSCONFDIR=\"${sysconfdir}\" -DPLUGIN ++pptp_la_LDFLAGS = -fPIC -module -avoid-version ++pptp_la_SOURCES = dirutil.c orckit_quirks.c pptp.c pptp_callmgr.c pptp_ctrl.c \ ++ pptp_quirks.c util.c vector.c --- /dev/null +++ b/pppd/plugins/pptp/dirutil.c @@ -0,0 +1,68 @@ @@ -334,7 +318,7 @@ +xeb xeb@mail.ru --- /dev/null +++ b/pppd/plugins/pptp/pptp.c -@@ -0,0 +1,323 @@ +@@ -0,0 +1,325 @@ +/*************************************************************************** + * Copyright (C) 2006 by Kozlov D. * + * some cleanup done (C) 2012 by Daniel Golle * @@ -377,6 +361,8 @@ +#include + +#include "pppd.h" ++#include "pppd-private.h" ++#include "options.h" +#include "fsm.h" +#include "lcp.h" +#include "ipcp.h" @@ -385,7 +371,7 @@ + +#include "pptp_callmgr.h" +#include -+#include ++#include +#include + +#include @@ -437,8 +423,8 @@ + check_options: NULL, + connect: &pptp_connect, + disconnect: &pptp_disconnect, -+ establish_ppp: &generic_establish_ppp, -+ disestablish_ppp: &generic_disestablish_ppp, ++ establish_ppp: &ppp_generic_establish, ++ disestablish_ppp: &ppp_generic_disestablish, + close: NULL, + cleanup: NULL +}; @@ -446,7 +432,7 @@ +static int pptp_start_server(void) +{ + pptp_fd=pptp_sock; -+ sprintf(ppp_devnam,"pptp (%s)",pptp_client); ++ sprintf(ppp_devname,"pptp (%s)",pptp_client); + + return pptp_fd; +} @@ -527,7 +513,7 @@ + return -1; + } + -+ sprintf(ppp_devnam,"pptp (%s)",pptp_server); ++ sprintf(ppp_devname,"pptp (%s)",pptp_server); + + return pptp_fd; +} @@ -651,7 +637,7 @@ + +void plugin_init(void) +{ -+ add_options(Options); ++ ppp_add_options(Options); + + info("PPTP plugin version %s", PPTP_VERSION); + diff --git a/package/network/services/ppp/patches/510-pptp_compile_fix.patch b/package/network/services/ppp/patches/510-pptp_compile_fix.patch deleted file mode 100644 index 04bb620e76e823..00000000000000 --- a/package/network/services/ppp/patches/510-pptp_compile_fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/pppd/plugins/pptp/pptp.c -+++ b/pppd/plugins/pptp/pptp.c -@@ -48,7 +48,7 @@ - - #include "pptp_callmgr.h" - #include --#include -+#include - #include - - #include diff --git a/package/network/services/ppp/patches/511-pptp_cflags.patch b/package/network/services/ppp/patches/511-pptp_cflags.patch deleted file mode 100644 index 548bf41c1f4177..00000000000000 --- a/package/network/services/ppp/patches/511-pptp_cflags.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/pppd/plugins/pptp/Makefile.linux -+++ b/pppd/plugins/pptp/Makefile.linux -@@ -20,7 +20,7 @@ all: pptp.so - $(CC) $(CFLAGS) -c -o $@ $< - - pptp.so: dirutil.o orckit_quirks.o pptp.o pptp_callmgr.o pptp_ctrl.o pptp_quirks.o util.o vector.o -- $(CC) -o pptp.so -shared dirutil.o orckit_quirks.o pptp.o pptp_callmgr.o pptp_ctrl.o pptp_quirks.o util.o vector.o -+ $(CC) -fPIC -o pptp.so -shared dirutil.o orckit_quirks.o pptp.o pptp_callmgr.o pptp_ctrl.o pptp_quirks.o util.o vector.o - - install: all - $(INSTALL) -d -m 755 $(LIBDIR) diff --git a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch b/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch deleted file mode 100644 index dc18156a0429fb..00000000000000 --- a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 831dca008699d485f2c8e91749657ef2d0b06166 Mon Sep 17 00:00:00 2001 -From: Martin Schiller -Date: Thu, 6 Dec 2018 08:43:17 +0100 -Subject: [PATCH] Revert "pppd: Use openssl for the DES instead of the libcrypt - / glibc" - -For musl and glibc2.27 we can keep linking to crypt; however if we -switch to glibc 2.28 we will have to link to one of the SSL libraries. - -This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. ---- - pppd/Makefile.linux | 7 +++---- - pppd/pppcrypt.c | 18 +++++++++--------- - 2 files changed, 12 insertions(+), 13 deletions(-) - ---- a/pppd/Makefile.linux -+++ b/pppd/Makefile.linux -@@ -36,10 +36,10 @@ endif - - LIBS = -lrt - --# Uncomment the next line to include support for Microsoft's -+# Uncomment the next 2 lines to include support for Microsoft's - # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux. - CHAPMS=y --#USE_CRYPT=y -+USE_CRYPT=y - # Don't use MSLANMAN unless you really know what you're doing. - #MSLANMAN=y - # Uncomment the next line to include support for MPPE. CHAPMS (above) must -@@ -158,8 +158,7 @@ endif - - ifdef NEEDDES - ifndef USE_CRYPT --CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl --NEEDCRYPTOLIB = y -+LIBS += -ldes $(LIBS) - else - CFLAGS += -DUSE_CRYPT=1 - endif ---- a/pppd/pppcrypt.c -+++ b/pppd/pppcrypt.c -@@ -62,7 +62,7 @@ MakeKey(u_char *key, u_char *des_key) - des_key[7] = Get7Bits(key, 49); - - #ifndef USE_CRYPT -- DES_set_odd_parity((DES_cblock *)des_key); -+ des_set_odd_parity((des_cblock *)des_key); - #endif - } - -@@ -147,30 +147,30 @@ DesDecrypt(u_char *cipher, u_char *clear - } - - #else /* USE_CRYPT */ --static DES_key_schedule key_schedule; -+static des_key_schedule key_schedule; - - bool - DesSetkey(u_char *key) - { -- DES_cblock des_key; -+ des_cblock des_key; - MakeKey(key, des_key); -- DES_set_key(&des_key, &key_schedule); -+ des_set_key(&des_key, key_schedule); - return (1); - } - - bool - DesEncrypt(u_char *clear, u_char *cipher) - { -- DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher, -- &key_schedule, 1); -+ des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, -+ key_schedule, 1); - return (1); - } - - bool - DesDecrypt(u_char *cipher, u_char *clear) - { -- DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear, -- &key_schedule, 0); -+ des_ecb_encrypt((des_cblock *)cipher, (des_cblock *)clear, -+ key_schedule, 0); - return (1); - } - diff --git a/package/network/services/ppp/patches/610-pppd_compile_fix.patch b/package/network/services/ppp/patches/610-pppd_compile_fix.patch deleted file mode 100644 index 4f66e5d71f0346..00000000000000 --- a/package/network/services/ppp/patches/610-pppd_compile_fix.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/pppd/Makefile.linux -+++ b/pppd/Makefile.linux -@@ -49,7 +49,8 @@ MPPE=y - # Uncomment the next line to include support for PPP packet filtering. - # This requires that the libpcap library and headers be installed - # and that the kernel driver support PPP packet filtering. --#FILTER=y -+# libpcap statically linked in OpenWRT, hence disabled here. -+FILTER= - - # Support for precompiled filters - PRECOMPILED_FILTER=y diff --git a/package/system/openwrt-keyring/Makefile b/package/system/openwrt-keyring/Makefile index d8b15d46e47c74..9344ec321d93b3 100644 --- a/package/system/openwrt-keyring/Makefile +++ b/package/system/openwrt-keyring/Makefile @@ -3,13 +3,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openwrt-keyring -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/keyring.git -PKG_SOURCE_DATE:=2022-03-25 -PKG_SOURCE_VERSION:=62471e693b4f9f19dd88afa6827fc3a2cf121d9a -PKG_MIRROR_HASH:=dbc6cf709f702f92f6aabcd9f981a14901ec61c9b340bd506986f8b438503632 +PKG_SOURCE_DATE:=2024-09-28 +PKG_SOURCE_VERSION:=3c066ce24e80d8f537d582406930d60c7cafb251 +PKG_MIRROR_HASH:=27a52fd164d38cc57d052e0e04c95ac941ce90be6231c2eb85dcbbde9d3b916e PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0 @@ -30,10 +30,17 @@ endef Build/Compile= +ifneq ($(CONFIG_USE_APK),) +define Package/openwrt-keyring/install + $(INSTALL_DIR) $(1)/etc/apk/keys/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/apk/*.pem $(1)/etc/apk/keys/ +endef +else define Package/openwrt-keyring/install $(INSTALL_DIR) $(1)/etc/opkg/keys/ # Public usign key for unattended snapshot builds $(INSTALL_DATA) $(PKG_BUILD_DIR)/usign/b5043e70f9a75cde $(1)/etc/opkg/keys/ endef +endif $(eval $(call BuildPackage,openwrt-keyring)) diff --git a/scripts/belkin-header.py b/scripts/belkin-header.py index 4dc3d2652e8b58..f62d55cab7c6dd 100755 --- a/scripts/belkin-header.py +++ b/scripts/belkin-header.py @@ -35,7 +35,7 @@ MODULE = "IMG" def xcrc32(buf): - return (0xffffffff - zlib.crc32(buf, 0xffffffff)).to_bytes(4, 'big') + return (0xffffffff - zlib.crc32(buf, 0xffffffff)).to_bytes(4, byteorder='big') def encode_model(model): map = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-" @@ -63,12 +63,12 @@ def create_header(buf, belkin_header, belkin_model): head[0:4] = int(belkin_header, 0).to_bytes(4, 'big') head[8:12] = int(time.time()).to_bytes(4, 'big') - head[12:16] = len(buf).to_bytes(4, 'big') + head[12:16] = len(buf).to_bytes(4, byteorder='big') head[24:28] = xcrc32(buf) - head[28:29] = VERSION1.to_bytes(1) - head[29:30] = VERSION2.to_bytes(1) - head[30:31] = VERSION3.to_bytes(1) - head[31:32] = VERSION4.to_bytes(1) + head[28:29] = VERSION1.to_bytes(1, byteorder='big') + head[29:30] = VERSION2.to_bytes(1, byteorder='big') + head[30:31] = VERSION3.to_bytes(1, byteorder='big') + head[31:32] = VERSION4.to_bytes(1, byteorder='big') head[16:16 + len(COMPANY)] = bytes(COMPANY,'ascii') mod = MODULE + "-{:1d}.{:02d}.{:02d}.{:02d}".format(VERSION1, VERSION2, VERSION3, VERSION4) diff --git a/target/linux/bcm27xx/patches-6.6/950-0086-Main-bcm2708-bcm2709-linux-port.patch b/target/linux/bcm27xx/patches-6.6/950-0086-Main-bcm2708-bcm2709-linux-port.patch index 22e182ba482511..ad005dc2e15fa8 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0086-Main-bcm2708-bcm2709-linux-port.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0086-Main-bcm2708-bcm2709-linux-port.patch @@ -125,10 +125,10 @@ board_bcm2835: Remove coherent dma pool increase - API has gone - ret = devm_request_irq(dev, irq_of_parse_and_map(dev->of_node, 0), + ret = devm_request_irq(dev, platform_get_irq(pdev, 0), - bcm2835_mbox_irq, 0, dev_name(dev), mbox); + bcm2835_mbox_irq, IRQF_NO_SUSPEND, dev_name(dev), + mbox); if (ret) { - dev_err(dev, "Failed to register a mailbox IRQ handler: %d\n", -@@ -192,7 +195,18 @@ static struct platform_driver bcm2835_mb +@@ -193,7 +196,18 @@ static struct platform_driver bcm2835_mb }, .probe = bcm2835_mbox_probe, }; diff --git a/target/linux/bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch b/target/linux/bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch index 48baa904039e33..aebb491f32af30 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch @@ -285,7 +285,7 @@ Signed-off-by: Phil Elwell static inline int mmc_blk_part_switch(struct mmc_card *card, unsigned int part_type); static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, -@@ -3016,6 +3023,8 @@ static int mmc_blk_probe(struct mmc_card +@@ -3066,6 +3073,8 @@ static int mmc_blk_probe(struct mmc_card { struct mmc_blk_data *md; int ret = 0; @@ -294,7 +294,7 @@ Signed-off-by: Phil Elwell /* * Check that the card supports the command class(es) we need. -@@ -3023,7 +3032,16 @@ static int mmc_blk_probe(struct mmc_card +@@ -3073,7 +3082,16 @@ static int mmc_blk_probe(struct mmc_card if (!(card->csd.cmdclass & CCC_BLOCK_READ)) return -ENODEV; @@ -312,7 +312,7 @@ Signed-off-by: Phil Elwell card->complete_wq = alloc_workqueue("mmc_complete", WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); -@@ -3038,6 +3056,17 @@ static int mmc_blk_probe(struct mmc_card +@@ -3088,6 +3106,17 @@ static int mmc_blk_probe(struct mmc_card goto out_free; } diff --git a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch index b35df5a3813a4a..8685508ddf6af7 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch @@ -17565,7 +17565,7 @@ Signed-off-by: Phil Elwell } --- a/sound/usb/card.c +++ b/sound/usb/card.c -@@ -857,8 +857,14 @@ static int usb_audio_probe(struct usb_in +@@ -863,8 +863,14 @@ static int usb_audio_probe(struct usb_in if (ignore_ctl_error) chip->quirk_flags |= QUIRK_FLAG_IGNORE_CTL_ERROR; @@ -17583,7 +17583,7 @@ Signed-off-by: Phil Elwell * For devices with more than one control interface, we assume the --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -2191,6 +2191,8 @@ static const struct usb_audio_quirk_flag +@@ -2195,6 +2195,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */ QUIRK_FLAG_ALIGN_TRANSFER), diff --git a/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index b102bc33fc466d..8a04903f7d3b8a 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1409,6 +1412,9 @@ +@@ -1394,6 +1397,9 @@ #define USB_VENDOR_ID_XIAOMI 0x2717 #define USB_DEVICE_ID_MI_SILENT_MOUSE 0x5014 diff --git a/target/linux/bcm27xx/patches-6.6/950-0535-i2c-designware-Add-SMBUS-quick-command-support.patch b/target/linux/bcm27xx/patches-6.6/950-0535-i2c-designware-Add-SMBUS-quick-command-support.patch index 329b8375735d46..ed57365598ae6a 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0535-i2c-designware-Add-SMBUS-quick-command-support.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0535-i2c-designware-Add-SMBUS-quick-command-support.patch @@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell --- a/drivers/i2c/busses/i2c-designware-core.h +++ b/drivers/i2c/busses/i2c-designware-core.h -@@ -122,7 +122,9 @@ +@@ -123,7 +123,9 @@ #define DW_IC_ERR_TX_ABRT 0x1 @@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell regmap_update_bits(dev->map, DW_IC_CON, DW_IC_CON_10BITADDR_MASTER, ic_con); -@@ -472,6 +476,14 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) +@@ -500,6 +504,14 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) regmap_read(dev->map, DW_IC_RXFLR, &flr); rx_limit = dev->rx_fifo_depth - flr; @@ -55,7 +55,7 @@ Signed-off-by: Phil Elwell while (buf_len > 0 && tx_limit > 0 && rx_limit > 0) { u32 cmd = 0; -@@ -743,7 +755,7 @@ static const struct i2c_algorithm i2c_dw +@@ -781,7 +793,7 @@ static const struct i2c_algorithm i2c_dw }; static const struct i2c_adapter_quirks i2c_dw_quirks = { @@ -64,7 +64,7 @@ Signed-off-by: Phil Elwell }; static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev) -@@ -876,7 +888,8 @@ void i2c_dw_configure_master(struct dw_i +@@ -914,7 +926,8 @@ void i2c_dw_configure_master(struct dw_i { struct i2c_timings *t = &dev->timings; diff --git a/target/linux/bcm27xx/patches-6.6/950-0864-i2c-designware-Support-non-standard-bus-speeds.patch b/target/linux/bcm27xx/patches-6.6/950-0864-i2c-designware-Support-non-standard-bus-speeds.patch index 6bc3ca65d4eb7c..0e1cd5bf2a164d 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0864-i2c-designware-Support-non-standard-bus-speeds.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0864-i2c-designware-Support-non-standard-bus-speeds.patch @@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell --- a/drivers/i2c/busses/i2c-designware-core.h +++ b/drivers/i2c/busses/i2c-designware-core.h -@@ -291,6 +291,7 @@ struct dw_i2c_dev { +@@ -292,6 +292,7 @@ struct dw_i2c_dev { u16 fp_lcnt; u16 hs_hcnt; u16 hs_lcnt; diff --git a/target/linux/bcm27xx/patches-6.6/950-0998-i2c-designware-Add-support-for-bus-clear-feature.patch b/target/linux/bcm27xx/patches-6.6/950-0998-i2c-designware-Add-support-for-bus-clear-feature.patch index 15bce96265a2eb..5eb4bcc5d2a9de 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0998-i2c-designware-Add-support-for-bus-clear-feature.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0998-i2c-designware-Add-support-for-bus-clear-feature.patch @@ -33,7 +33,7 @@ Signed-off-by: Phil Elwell }; static int dw_reg_read(void *context, unsigned int reg, unsigned int *val) -@@ -593,8 +595,16 @@ int i2c_dw_wait_bus_not_busy(struct dw_i +@@ -607,8 +609,16 @@ int i2c_dw_wait_bus_not_busy(struct dw_i int i2c_dw_handle_tx_abort(struct dw_i2c_dev *dev) { unsigned long abort_source = dev->abort_source; @@ -50,7 +50,7 @@ Signed-off-by: Phil Elwell if (abort_source & DW_IC_TX_ABRT_NOACK) { for_each_set_bit(i, &abort_source, ARRAY_SIZE(abort_sources)) dev_dbg(dev->dev, -@@ -609,6 +619,8 @@ int i2c_dw_handle_tx_abort(struct dw_i2c +@@ -623,6 +633,8 @@ int i2c_dw_handle_tx_abort(struct dw_i2c return -EAGAIN; else if (abort_source & DW_IC_TX_ABRT_GCALL_READ) return -EINVAL; /* wrong msgs[] data */ @@ -74,11 +74,9 @@ Signed-off-by: Phil Elwell #define DW_IC_COMP_TYPE 0xfc #define DW_IC_COMP_TYPE_VALUE 0x44570140 /* "DW" + 0x0140 */ -@@ -109,13 +112,16 @@ - DW_IC_INTR_RX_UNDER | \ - DW_IC_INTR_RD_REQ) +@@ -111,12 +114,14 @@ -+#define DW_IC_ENABLE_ENABLE BIT(0) + #define DW_IC_ENABLE_ENABLE BIT(0) #define DW_IC_ENABLE_ABORT BIT(1) +#define DW_IC_ENABLE_BUS_RECOVERY BIT(3) @@ -91,7 +89,7 @@ Signed-off-by: Phil Elwell #define DW_IC_SDA_HOLD_RX_SHIFT 16 #define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, 16) -@@ -163,6 +169,7 @@ +@@ -164,6 +169,7 @@ #define ABRT_SLAVE_FLUSH_TXFIFO 13 #define ABRT_SLAVE_ARBLOST 14 #define ABRT_SLAVE_RD_INTX 15 @@ -99,7 +97,7 @@ Signed-off-by: Phil Elwell #define DW_IC_TX_ABRT_7B_ADDR_NOACK BIT(ABRT_7B_ADDR_NOACK) #define DW_IC_TX_ABRT_10ADDR1_NOACK BIT(ABRT_10ADDR1_NOACK) -@@ -178,6 +185,7 @@ +@@ -179,6 +185,7 @@ #define DW_IC_RX_ABRT_SLAVE_RD_INTX BIT(ABRT_SLAVE_RD_INTX) #define DW_IC_RX_ABRT_SLAVE_ARBLOST BIT(ABRT_SLAVE_ARBLOST) #define DW_IC_RX_ABRT_SLAVE_FLUSH_TXFIFO BIT(ABRT_SLAVE_FLUSH_TXFIFO) @@ -135,7 +133,7 @@ Signed-off-by: Phil Elwell /* Write SDA hold time if supported */ if (dev->sda_hold_time) regmap_write(dev->map, DW_IC_SDA_HOLD, dev->sda_hold_time); -@@ -1033,6 +1045,7 @@ int i2c_dw_probe_master(struct dw_i2c_de +@@ -1071,6 +1083,7 @@ int i2c_dw_probe_master(struct dw_i2c_de struct i2c_adapter *adap = &dev->adapter; unsigned long irq_flags; unsigned int ic_con; @@ -143,7 +141,7 @@ Signed-off-by: Phil Elwell int ret; init_completion(&dev->cmd_complete); -@@ -1068,7 +1081,11 @@ int i2c_dw_probe_master(struct dw_i2c_de +@@ -1106,7 +1119,11 @@ int i2c_dw_probe_master(struct dw_i2c_de if (ret) return ret; diff --git a/target/linux/generic/backport-6.6/410-v6.13-01-block-add-support-for-defining-read-only-partitions.patch b/target/linux/generic/backport-6.6/410-v6.13-01-block-add-support-for-defining-read-only-partitions.patch new file mode 100644 index 00000000000000..fabf16a2e63135 --- /dev/null +++ b/target/linux/generic/backport-6.6/410-v6.13-01-block-add-support-for-defining-read-only-partitions.patch @@ -0,0 +1,53 @@ +From 03cb793b26834ddca170ba87057c8f883772dd45 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Thu, 3 Oct 2024 00:11:41 +0200 +Subject: [PATCH 1/5] block: add support for defining read-only partitions + +Add support for defining read-only partitions and complete support for +it in the cmdline partition parser as the additional "ro" after a +partition is scanned but never actually applied. + +Signed-off-by: Christian Marangi +Reviewed-by: Christoph Hellwig +Link: https://lore.kernel.org/r/20241002221306.4403-2-ansuelsmth@gmail.com +Signed-off-by: Jens Axboe +--- + block/blk.h | 1 + + block/partitions/cmdline.c | 3 +++ + block/partitions/core.c | 3 +++ + 3 files changed, 7 insertions(+) + +--- a/block/blk.h ++++ b/block/blk.h +@@ -424,6 +424,7 @@ void blk_free_ext_minor(unsigned int min + #define ADDPART_FLAG_NONE 0 + #define ADDPART_FLAG_RAID 1 + #define ADDPART_FLAG_WHOLEDISK 2 ++#define ADDPART_FLAG_READONLY 4 + int bdev_add_partition(struct gendisk *disk, int partno, sector_t start, + sector_t length); + int bdev_del_partition(struct gendisk *disk, int partno); +--- a/block/partitions/cmdline.c ++++ b/block/partitions/cmdline.c +@@ -237,6 +237,9 @@ static int add_part(int slot, struct cmd + put_partition(state, slot, subpart->from >> 9, + subpart->size >> 9); + ++ if (subpart->flags & PF_RDONLY) ++ state->parts[slot].flags |= ADDPART_FLAG_READONLY; ++ + info = &state->parts[slot].info; + + strscpy(info->volname, subpart->name, sizeof(info->volname)); +--- a/block/partitions/core.c ++++ b/block/partitions/core.c +@@ -392,6 +392,9 @@ static struct block_device *add_partitio + goto out_del; + } + ++ if (flags & ADDPART_FLAG_READONLY) ++ bdev->bd_read_only = true; ++ + /* everything is up and running, commence */ + err = xa_insert(&disk->part_tbl, partno, bdev, GFP_KERNEL); + if (err) diff --git a/target/linux/generic/backport-6.6/410-v6.13-03-block-introduce-add_disk_fwnode.patch b/target/linux/generic/backport-6.6/410-v6.13-03-block-introduce-add_disk_fwnode.patch new file mode 100644 index 00000000000000..41b51ab215c089 --- /dev/null +++ b/target/linux/generic/backport-6.6/410-v6.13-03-block-introduce-add_disk_fwnode.patch @@ -0,0 +1,94 @@ +From e5f587242b6072ffab4f4a084a459a59f3035873 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Thu, 3 Oct 2024 00:11:43 +0200 +Subject: [PATCH 3/5] block: introduce add_disk_fwnode() + +Introduce add_disk_fwnode() as a replacement of device_add_disk() that +permits to pass and attach a fwnode to disk dev. + +This variant can be useful for eMMC that might have the partition table +for the disk defined in DT. A parser can later make use of the attached +fwnode to parse the related table and init the hardcoded partition for +the disk. + +device_add_disk() is converted to a simple wrapper of add_disk_fwnode() +with the fwnode entry set as NULL. + +Signed-off-by: Christian Marangi +Reviewed-by: Christoph Hellwig +Link: https://lore.kernel.org/r/20241002221306.4403-4-ansuelsmth@gmail.com +Signed-off-by: Jens Axboe +--- + block/genhd.c | 28 ++++++++++++++++++++++++---- + include/linux/blkdev.h | 3 +++ + 2 files changed, 27 insertions(+), 4 deletions(-) + +--- a/block/genhd.c ++++ b/block/genhd.c +@@ -383,16 +383,18 @@ int disk_scan_partitions(struct gendisk + } + + /** +- * device_add_disk - add disk information to kernel list ++ * add_disk_fwnode - add disk information to kernel list with fwnode + * @parent: parent device for the disk + * @disk: per-device partitioning information + * @groups: Additional per-device sysfs groups ++ * @fwnode: attached disk fwnode + * + * This function registers the partitioning information in @disk +- * with the kernel. ++ * with the kernel. Also attach a fwnode to the disk device. + */ +-int __must_check device_add_disk(struct device *parent, struct gendisk *disk, +- const struct attribute_group **groups) ++int __must_check add_disk_fwnode(struct device *parent, struct gendisk *disk, ++ const struct attribute_group **groups, ++ struct fwnode_handle *fwnode) + + { + struct device *ddev = disk_to_dev(disk); +@@ -451,6 +453,8 @@ int __must_check device_add_disk(struct + ddev->parent = parent; + ddev->groups = groups; + dev_set_name(ddev, "%s", disk->disk_name); ++ if (fwnode) ++ device_set_node(ddev, fwnode); + if (!(disk->flags & GENHD_FL_HIDDEN)) + ddev->devt = MKDEV(disk->major, disk->first_minor); + ret = device_add(ddev); +@@ -552,6 +556,22 @@ out_exit_elevator: + elevator_exit(disk->queue); + return ret; + } ++EXPORT_SYMBOL_GPL(add_disk_fwnode); ++ ++/** ++ * device_add_disk - add disk information to kernel list ++ * @parent: parent device for the disk ++ * @disk: per-device partitioning information ++ * @groups: Additional per-device sysfs groups ++ * ++ * This function registers the partitioning information in @disk ++ * with the kernel. ++ */ ++int __must_check device_add_disk(struct device *parent, struct gendisk *disk, ++ const struct attribute_group **groups) ++{ ++ return add_disk_fwnode(parent, disk, groups, NULL); ++} + EXPORT_SYMBOL(device_add_disk); + + static void blk_report_disk_dead(struct gendisk *disk, bool surprise) +--- a/include/linux/blkdev.h ++++ b/include/linux/blkdev.h +@@ -741,6 +741,9 @@ static inline unsigned int blk_queue_dep + #define for_each_bio(_bio) \ + for (; _bio; _bio = _bio->bi_next) + ++int __must_check add_disk_fwnode(struct device *parent, struct gendisk *disk, ++ const struct attribute_group **groups, ++ struct fwnode_handle *fwnode); + int __must_check device_add_disk(struct device *parent, struct gendisk *disk, + const struct attribute_group **groups); + static inline int __must_check add_disk(struct gendisk *disk) diff --git a/target/linux/generic/backport-6.6/410-v6.13-04-mmc-block-attach-partitions-fwnode-if-found-in-mmc-c.patch b/target/linux/generic/backport-6.6/410-v6.13-04-mmc-block-attach-partitions-fwnode-if-found-in-mmc-c.patch new file mode 100644 index 00000000000000..cf0d18cf06344d --- /dev/null +++ b/target/linux/generic/backport-6.6/410-v6.13-04-mmc-block-attach-partitions-fwnode-if-found-in-mmc-c.patch @@ -0,0 +1,104 @@ +From 45ff6c340ddfc2dade74d5b7a8962c778ab7042c Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Thu, 3 Oct 2024 00:11:44 +0200 +Subject: [PATCH 4/5] mmc: block: attach partitions fwnode if found in mmc-card + +Attach partitions fwnode if found in mmc-card and register disk with it. + +This permits block partition to reference the node and register a +partition table defined in DT for the special case for embedded device +that doesn't have a partition table flashed but have an hardcoded +partition table passed from the system. + +JEDEC BOOT partition boot0/boot1 are supported but in DT we refer with +the JEDEC name of boot1 and boot2 to better adhere to documentation. + +Also JEDEC GP partition gp0/1/2/3 are supported but in DT we refer with +the JEDEC name of gp1/2/3/4 to better adhere to documentration. + +Signed-off-by: Christian Marangi +Reviewed-by: Linus Walleij +Link: https://lore.kernel.org/r/20241002221306.4403-5-ansuelsmth@gmail.com +Signed-off-by: Jens Axboe +--- + drivers/mmc/core/block.c | 55 +++++++++++++++++++++++++++++++++++++++- + 1 file changed, 54 insertions(+), 1 deletion(-) + +--- a/drivers/mmc/core/block.c ++++ b/drivers/mmc/core/block.c +@@ -2455,6 +2455,56 @@ static inline int mmc_blk_readonly(struc + !(card->csd.cmdclass & CCC_BLOCK_WRITE); + } + ++/* ++ * Search for a declared partitions node for the disk in mmc-card related node. ++ * ++ * This is to permit support for partition table defined in DT in special case ++ * where a partition table is not written in the disk and is expected to be ++ * passed from the running system. ++ * ++ * For the user disk, "partitions" node is searched. ++ * For the special HW disk, "partitions-" node with the appended name is used ++ * following this conversion table (to adhere to JEDEC naming) ++ * - boot0 -> partitions-boot1 ++ * - boot1 -> partitions-boot2 ++ * - gp0 -> partitions-gp1 ++ * - gp1 -> partitions-gp2 ++ * - gp2 -> partitions-gp3 ++ * - gp3 -> partitions-gp4 ++ */ ++static struct fwnode_handle *mmc_blk_get_partitions_node(struct device *mmc_dev, ++ const char *subname) ++{ ++ const char *node_name = "partitions"; ++ ++ if (subname) { ++ mmc_dev = mmc_dev->parent; ++ ++ /* ++ * Check if we are allocating a BOOT disk boot0/1 disk. ++ * In DT we use the JEDEC naming boot1/2. ++ */ ++ if (!strcmp(subname, "boot0")) ++ node_name = "partitions-boot1"; ++ if (!strcmp(subname, "boot1")) ++ node_name = "partitions-boot2"; ++ /* ++ * Check if we are allocating a GP disk gp0/1/2/3 disk. ++ * In DT we use the JEDEC naming gp1/2/3/4. ++ */ ++ if (!strcmp(subname, "gp0")) ++ node_name = "partitions-gp1"; ++ if (!strcmp(subname, "gp1")) ++ node_name = "partitions-gp2"; ++ if (!strcmp(subname, "gp2")) ++ node_name = "partitions-gp3"; ++ if (!strcmp(subname, "gp3")) ++ node_name = "partitions-gp4"; ++ } ++ ++ return device_get_named_child_node(mmc_dev, node_name); ++} ++ + static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, + struct device *parent, + sector_t size, +@@ -2463,6 +2513,7 @@ static struct mmc_blk_data *mmc_blk_allo + int area_type, + unsigned int part_type) + { ++ struct fwnode_handle *disk_fwnode; + struct mmc_blk_data *md; + int devidx, ret; + char cap_str[10]; +@@ -2568,7 +2619,9 @@ static struct mmc_blk_data *mmc_blk_allo + /* used in ->open, must be set before add_disk: */ + if (area_type == MMC_BLK_DATA_AREA_MAIN) + dev_set_drvdata(&card->dev, md); +- ret = device_add_disk(md->parent, md->disk, mmc_disk_attr_groups); ++ disk_fwnode = mmc_blk_get_partitions_node(parent, subname); ++ ret = add_disk_fwnode(md->parent, md->disk, mmc_disk_attr_groups, ++ disk_fwnode); + if (ret) + goto err_put_disk; + return md; diff --git a/target/linux/generic/backport-6.6/410-v6.13-05-block-add-support-for-partition-table-defined-in-OF.patch b/target/linux/generic/backport-6.6/410-v6.13-05-block-add-support-for-partition-table-defined-in-OF.patch new file mode 100644 index 00000000000000..d260be168cd5bd --- /dev/null +++ b/target/linux/generic/backport-6.6/410-v6.13-05-block-add-support-for-partition-table-defined-in-OF.patch @@ -0,0 +1,200 @@ +From 884555b557e5e6d41c866e2cd8d7b32f50ec974b Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Thu, 3 Oct 2024 00:11:45 +0200 +Subject: [PATCH 5/5] block: add support for partition table defined in OF + +Add support for partition table defined in Device Tree. Similar to how +it's done with MTD, add support for defining a fixed partition table in +device tree. + +A common scenario for this is fixed block (eMMC) embedded devices that +have no MBR or GPT partition table to save storage space. Bootloader +access the block device with absolute address of data. + +This is to complete the functionality with an equivalent implementation +with providing partition table with bootargs, for case where the booargs +can't be modified and tweaking the Device Tree is the only solution to +have an usabe partition table. + +The implementation follow the fixed-partitions parser used on MTD +devices where a "partitions" node is expected to be declared with +"fixed-partitions" compatible in the OF node of the disk device +(mmc-card for eMMC for example) and each child node declare a label +and a reg with offset and size. If label is not declared, the node name +is used as fallback. Eventually is also possible to declare the read-only +property to flag the partition as read-only. + +Signed-off-by: Christian Marangi +Reviewed-by: Christoph Hellwig +Link: https://lore.kernel.org/r/20241002221306.4403-6-ansuelsmth@gmail.com +Signed-off-by: Jens Axboe +--- + block/partitions/Kconfig | 9 ++++ + block/partitions/Makefile | 1 + + block/partitions/check.h | 1 + + block/partitions/core.c | 3 ++ + block/partitions/of.c | 110 ++++++++++++++++++++++++++++++++++++++ + 5 files changed, 124 insertions(+) + create mode 100644 block/partitions/of.c + +--- a/block/partitions/Kconfig ++++ b/block/partitions/Kconfig +@@ -270,4 +270,13 @@ config CMDLINE_PARTITION + Say Y here if you want to read the partition table from bootargs. + The format for the command line is just like mtdparts. + ++config OF_PARTITION ++ bool "Device Tree partition support" if PARTITION_ADVANCED ++ depends on OF ++ help ++ Say Y here if you want to enable support for partition table ++ defined in Device Tree. (mainly for eMMC) ++ The format for the device tree node is just like MTD fixed-partition ++ schema. ++ + endmenu +--- a/block/partitions/Makefile ++++ b/block/partitions/Makefile +@@ -12,6 +12,7 @@ obj-$(CONFIG_CMDLINE_PARTITION) += cmdli + obj-$(CONFIG_MAC_PARTITION) += mac.o + obj-$(CONFIG_LDM_PARTITION) += ldm.o + obj-$(CONFIG_MSDOS_PARTITION) += msdos.o ++obj-$(CONFIG_OF_PARTITION) += of.o + obj-$(CONFIG_OSF_PARTITION) += osf.o + obj-$(CONFIG_SGI_PARTITION) += sgi.o + obj-$(CONFIG_SUN_PARTITION) += sun.o +--- a/block/partitions/check.h ++++ b/block/partitions/check.h +@@ -62,6 +62,7 @@ int karma_partition(struct parsed_partit + int ldm_partition(struct parsed_partitions *state); + int mac_partition(struct parsed_partitions *state); + int msdos_partition(struct parsed_partitions *state); ++int of_partition(struct parsed_partitions *state); + int osf_partition(struct parsed_partitions *state); + int sgi_partition(struct parsed_partitions *state); + int sun_partition(struct parsed_partitions *state); +--- a/block/partitions/core.c ++++ b/block/partitions/core.c +@@ -43,6 +43,9 @@ static int (*const check_part[])(struct + #ifdef CONFIG_CMDLINE_PARTITION + cmdline_partition, + #endif ++#ifdef CONFIG_OF_PARTITION ++ of_partition, /* cmdline have priority to OF */ ++#endif + #ifdef CONFIG_EFI_PARTITION + efi_partition, /* this must come before msdos */ + #endif +--- /dev/null ++++ b/block/partitions/of.c +@@ -0,0 +1,110 @@ ++// SPDX-License-Identifier: GPL-2.0 ++ ++#include ++#include ++#include ++#include ++#include "check.h" ++ ++static int validate_of_partition(struct device_node *np, int slot) ++{ ++ u64 offset, size; ++ int len; ++ ++ const __be32 *reg = of_get_property(np, "reg", &len); ++ int a_cells = of_n_addr_cells(np); ++ int s_cells = of_n_size_cells(np); ++ ++ /* Make sure reg len match the expected addr and size cells */ ++ if (len / sizeof(*reg) != a_cells + s_cells) ++ return -EINVAL; ++ ++ /* Validate offset conversion from bytes to sectors */ ++ offset = of_read_number(reg, a_cells); ++ if (offset % SECTOR_SIZE) ++ return -EINVAL; ++ ++ /* Validate size conversion from bytes to sectors */ ++ size = of_read_number(reg + a_cells, s_cells); ++ if (!size || size % SECTOR_SIZE) ++ return -EINVAL; ++ ++ return 0; ++} ++ ++static void add_of_partition(struct parsed_partitions *state, int slot, ++ struct device_node *np) ++{ ++ struct partition_meta_info *info; ++ char tmp[sizeof(info->volname) + 4]; ++ const char *partname; ++ int len; ++ ++ const __be32 *reg = of_get_property(np, "reg", &len); ++ int a_cells = of_n_addr_cells(np); ++ int s_cells = of_n_size_cells(np); ++ ++ /* Convert bytes to sector size */ ++ u64 offset = of_read_number(reg, a_cells) / SECTOR_SIZE; ++ u64 size = of_read_number(reg + a_cells, s_cells) / SECTOR_SIZE; ++ ++ put_partition(state, slot, offset, size); ++ ++ if (of_property_read_bool(np, "read-only")) ++ state->parts[slot].flags |= ADDPART_FLAG_READONLY; ++ ++ /* ++ * Follow MTD label logic, search for label property, ++ * fallback to node name if not found. ++ */ ++ info = &state->parts[slot].info; ++ partname = of_get_property(np, "label", &len); ++ if (!partname) ++ partname = of_get_property(np, "name", &len); ++ strscpy(info->volname, partname, sizeof(info->volname)); ++ ++ snprintf(tmp, sizeof(tmp), "(%s)", info->volname); ++ strlcat(state->pp_buf, tmp, PAGE_SIZE); ++} ++ ++int of_partition(struct parsed_partitions *state) ++{ ++ struct device *ddev = disk_to_dev(state->disk); ++ struct device_node *np; ++ int slot; ++ ++ struct device_node *partitions_np = of_node_get(ddev->of_node); ++ ++ if (!partitions_np || ++ !of_device_is_compatible(partitions_np, "fixed-partitions")) ++ return 0; ++ ++ slot = 1; ++ /* Validate parition offset and size */ ++ for_each_child_of_node(partitions_np, np) { ++ if (validate_of_partition(np, slot)) { ++ of_node_put(np); ++ of_node_put(partitions_np); ++ ++ return -1; ++ } ++ ++ slot++; ++ } ++ ++ slot = 1; ++ for_each_child_of_node(partitions_np, np) { ++ if (slot >= state->limit) { ++ of_node_put(np); ++ break; ++ } ++ ++ add_of_partition(state, slot, np); ++ ++ slot++; ++ } ++ ++ strlcat(state->pp_buf, "\n", PAGE_SIZE); ++ ++ return 1; ++} diff --git a/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch b/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch index ef7963b60133bf..3f75dffde71999 100644 --- a/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch +++ b/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch @@ -32,7 +32,7 @@ Signed-off-by: Paolo Abeni --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4473,13 +4473,7 @@ static inline void ____napi_schedule(str +@@ -4477,13 +4477,7 @@ static inline void ____napi_schedule(str */ thread = READ_ONCE(napi->thread); if (thread) { @@ -47,7 +47,7 @@ Signed-off-by: Paolo Abeni wake_up_process(thread); return; } -@@ -6635,8 +6629,6 @@ static int napi_poll(struct napi_struct +@@ -6639,8 +6633,6 @@ static int napi_poll(struct napi_struct static int napi_thread_wait(struct napi_struct *napi) { @@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { -@@ -6645,15 +6637,13 @@ static int napi_thread_wait(struct napi_ +@@ -6649,15 +6641,13 @@ static int napi_thread_wait(struct napi_ * Testing SCHED bit is not enough because SCHED bit might be * set by some other busy poll thread or by napi_disable(). */ diff --git a/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch b/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch index 40e6514264cf2a..b343a3f9642a22 100644 --- a/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch +++ b/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch @@ -108,7 +108,7 @@ Signed-off-by: Paolo Abeni static inline void rps_lock_irqsave(struct softnet_data *sd, unsigned long *flags) { -@@ -4441,6 +4467,7 @@ EXPORT_SYMBOL(__dev_direct_xmit); +@@ -4445,6 +4471,7 @@ EXPORT_SYMBOL(__dev_direct_xmit); /************************************************************************* * Receiver routines *************************************************************************/ @@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni int netdev_max_backlog __read_mostly = 1000; EXPORT_SYMBOL(netdev_max_backlog); -@@ -4473,12 +4500,16 @@ static inline void ____napi_schedule(str +@@ -4477,12 +4504,16 @@ static inline void ____napi_schedule(str */ thread = READ_ONCE(napi->thread); if (thread) { @@ -133,7 +133,7 @@ Signed-off-by: Paolo Abeni list_add_tail(&napi->poll_list, &sd->poll_list); WRITE_ONCE(napi->list_owner, smp_processor_id()); /* If not called from net_rx_action() -@@ -4724,6 +4755,11 @@ static void napi_schedule_rps(struct sof +@@ -4728,6 +4759,11 @@ static void napi_schedule_rps(struct sof #ifdef CONFIG_RPS if (sd != mysd) { @@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni sd->rps_ipi_next = mysd->rps_ipi_list; mysd->rps_ipi_list = sd; -@@ -5947,7 +5983,7 @@ static void net_rps_action_and_irq_enabl +@@ -5951,7 +5987,7 @@ static void net_rps_action_and_irq_enabl #ifdef CONFIG_RPS struct softnet_data *remsd = sd->rps_ipi_list; @@ -154,7 +154,7 @@ Signed-off-by: Paolo Abeni sd->rps_ipi_list = NULL; local_irq_enable(); -@@ -5962,7 +5998,7 @@ static void net_rps_action_and_irq_enabl +@@ -5966,7 +6002,7 @@ static void net_rps_action_and_irq_enabl static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) { #ifdef CONFIG_RPS @@ -163,7 +163,7 @@ Signed-off-by: Paolo Abeni #else return false; #endif -@@ -6006,7 +6042,7 @@ static int process_backlog(struct napi_s +@@ -6010,7 +6046,7 @@ static int process_backlog(struct napi_s * We can use a plain write instead of clear_bit(), * and we dont need an smp_mb() memory barrier. */ @@ -172,7 +172,7 @@ Signed-off-by: Paolo Abeni again = false; } else { skb_queue_splice_tail_init(&sd->input_pkt_queue, -@@ -6672,43 +6708,48 @@ static void skb_defer_free_flush(struct +@@ -6676,43 +6712,48 @@ static void skb_defer_free_flush(struct } } @@ -250,7 +250,7 @@ Signed-off-by: Paolo Abeni return 0; } -@@ -11289,7 +11330,7 @@ static int dev_cpu_dead(unsigned int old +@@ -11293,7 +11334,7 @@ static int dev_cpu_dead(unsigned int old list_del_init(&napi->poll_list); if (napi->poll == process_backlog) @@ -259,7 +259,7 @@ Signed-off-by: Paolo Abeni else ____napi_schedule(sd, napi); } -@@ -11297,12 +11338,14 @@ static int dev_cpu_dead(unsigned int old +@@ -11301,12 +11342,14 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -278,7 +278,7 @@ Signed-off-by: Paolo Abeni /* Process offline CPU's input_pkt_queue */ while ((skb = __skb_dequeue(&oldsd->process_queue))) { -@@ -11565,6 +11608,38 @@ static struct pernet_operations __net_in +@@ -11569,6 +11612,38 @@ static struct pernet_operations __net_in * */ @@ -317,7 +317,7 @@ Signed-off-by: Paolo Abeni /* * This is called single threaded during boot, so no need * to take the rtnl semaphore. -@@ -11615,7 +11690,10 @@ static int __init net_dev_init(void) +@@ -11619,7 +11694,10 @@ static int __init net_dev_init(void) init_gro_hash(&sd->backlog); sd->backlog.poll = process_backlog; sd->backlog.weight = weight_p; diff --git a/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch b/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch index 6a9c113124e869..3b1a64e4c64f46 100644 --- a/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch +++ b/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch @@ -82,7 +82,7 @@ Signed-off-by: Paolo Abeni spin_unlock_irq(&sd->input_pkt_queue.lock); else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) local_irq_enable(); -@@ -4774,6 +4774,23 @@ static void napi_schedule_rps(struct sof +@@ -4778,6 +4778,23 @@ static void napi_schedule_rps(struct sof __napi_schedule_irqoff(&mysd->backlog); } diff --git a/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch b/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch index 801067287b3c58..dab96763fc292f 100644 --- a/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch +++ b/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch @@ -67,7 +67,7 @@ Signed-off-by: Paolo Abeni { if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) spin_unlock_irq(&sd->input_pkt_queue.lock); -@@ -4779,12 +4779,12 @@ void kick_defer_list_purge(struct softne +@@ -4783,12 +4783,12 @@ void kick_defer_list_purge(struct softne unsigned long flags; if (use_backlog_threads()) { @@ -82,7 +82,7 @@ Signed-off-by: Paolo Abeni } else if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) { smp_call_function_single_async(cpu, &sd->defer_csd); -@@ -4846,7 +4846,7 @@ static int enqueue_to_backlog(struct sk_ +@@ -4850,7 +4850,7 @@ static int enqueue_to_backlog(struct sk_ reason = SKB_DROP_REASON_NOT_SPECIFIED; sd = &per_cpu(softnet_data, cpu); @@ -91,7 +91,7 @@ Signed-off-by: Paolo Abeni if (!netif_running(skb->dev)) goto drop; qlen = skb_queue_len(&sd->input_pkt_queue); -@@ -4855,7 +4855,7 @@ static int enqueue_to_backlog(struct sk_ +@@ -4859,7 +4859,7 @@ static int enqueue_to_backlog(struct sk_ enqueue: __skb_queue_tail(&sd->input_pkt_queue, skb); input_queue_tail_incr_save(sd, qtail); @@ -100,7 +100,7 @@ Signed-off-by: Paolo Abeni return NET_RX_SUCCESS; } -@@ -4870,7 +4870,7 @@ enqueue: +@@ -4874,7 +4874,7 @@ enqueue: drop: sd->dropped++; @@ -109,7 +109,7 @@ Signed-off-by: Paolo Abeni dev_core_stats_rx_dropped_inc(skb->dev); kfree_skb_reason(skb, reason); -@@ -5901,7 +5901,7 @@ static void flush_backlog(struct work_st +@@ -5905,7 +5905,7 @@ static void flush_backlog(struct work_st local_bh_disable(); sd = this_cpu_ptr(&softnet_data); @@ -118,7 +118,7 @@ Signed-off-by: Paolo Abeni skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->input_pkt_queue); -@@ -5909,7 +5909,7 @@ static void flush_backlog(struct work_st +@@ -5913,7 +5913,7 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { -@@ -5927,14 +5927,14 @@ static bool flush_required(int cpu) +@@ -5931,14 +5931,14 @@ static bool flush_required(int cpu) struct softnet_data *sd = &per_cpu(softnet_data, cpu); bool do_flush; @@ -144,7 +144,7 @@ Signed-off-by: Paolo Abeni return do_flush; #endif -@@ -6049,7 +6049,7 @@ static int process_backlog(struct napi_s +@@ -6053,7 +6053,7 @@ static int process_backlog(struct napi_s } @@ -153,7 +153,7 @@ Signed-off-by: Paolo Abeni if (skb_queue_empty(&sd->input_pkt_queue)) { /* * Inline a custom version of __napi_complete(). -@@ -6065,7 +6065,7 @@ static int process_backlog(struct napi_s +@@ -6069,7 +6069,7 @@ static int process_backlog(struct napi_s skb_queue_splice_tail_init(&sd->input_pkt_queue, &sd->process_queue); } diff --git a/target/linux/generic/backport-6.6/611-01-v6.11-udp-Allow-GSO-transmit-from-devices-with-no-checksum.patch b/target/linux/generic/backport-6.6/611-01-v6.11-udp-Allow-GSO-transmit-from-devices-with-no-checksum.patch index 4a71d1203a95c4..2f03074bc9ac8f 100644 --- a/target/linux/generic/backport-6.6/611-01-v6.11-udp-Allow-GSO-transmit-from-devices-with-no-checksum.patch +++ b/target/linux/generic/backport-6.6/611-01-v6.11-udp-Allow-GSO-transmit-from-devices-with-no-checksum.patch @@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski } --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c -@@ -362,6 +362,14 @@ struct sk_buff *__udp_gso_segment(struct +@@ -380,6 +380,14 @@ struct sk_buff *__udp_gso_segment(struct else uh->check = gso_make_checksum(seg, ~check) ? : CSUM_MANGLED_0; diff --git a/target/linux/generic/backport-6.6/611-02-v6.11-net-Make-USO-depend-on-CSUM-offload.patch b/target/linux/generic/backport-6.6/611-02-v6.11-net-Make-USO-depend-on-CSUM-offload.patch index 8eecb063049380..30758f180f3e95 100644 --- a/target/linux/generic/backport-6.6/611-02-v6.11-net-Make-USO-depend-on-CSUM-offload.patch +++ b/target/linux/generic/backport-6.6/611-02-v6.11-net-Make-USO-depend-on-CSUM-offload.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -9751,6 +9751,15 @@ static void netdev_sync_lower_features(s +@@ -9755,6 +9755,15 @@ static void netdev_sync_lower_features(s } } @@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski static netdev_features_t netdev_fix_features(struct net_device *dev, netdev_features_t features) { -@@ -9832,15 +9841,9 @@ static netdev_features_t netdev_fix_feat +@@ -9836,15 +9845,9 @@ static netdev_features_t netdev_fix_feat features &= ~NETIF_F_LRO; } @@ -55,7 +55,7 @@ Signed-off-by: Jakub Kicinski } if ((features & NETIF_F_HW_TLS_RX) && !(features & NETIF_F_RXCSUM)) { -@@ -9848,6 +9851,11 @@ static netdev_features_t netdev_fix_feat +@@ -9852,6 +9855,11 @@ static netdev_features_t netdev_fix_feat features &= ~NETIF_F_HW_TLS_RX; } diff --git a/target/linux/generic/backport-6.6/612-v6.9-net-get-stats64-if-device-if-driver-is-configured.patch b/target/linux/generic/backport-6.6/612-v6.9-net-get-stats64-if-device-if-driver-is-configured.patch index 871154ecf89785..2db89c5a05a3dd 100644 --- a/target/linux/generic/backport-6.6/612-v6.9-net-get-stats64-if-device-if-driver-is-configured.patch +++ b/target/linux/generic/backport-6.6/612-v6.9-net-get-stats64-if-device-if-driver-is-configured.patch @@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -10658,6 +10658,8 @@ struct rtnl_link_stats64 *dev_get_stats( +@@ -10662,6 +10662,8 @@ struct rtnl_link_stats64 *dev_get_stats( ops->ndo_get_stats64(dev, storage); } else if (ops->ndo_get_stats) { netdev_stats_to_stats64(storage, ops->ndo_get_stats(dev)); diff --git a/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch b/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch index 6449cd6a3a19e1..838bd03c8c55ef 100644 --- a/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch +++ b/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch @@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni /** --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6602,7 +6602,7 @@ static int __napi_poll(struct napi_struc +@@ -6606,7 +6606,7 @@ static int __napi_poll(struct napi_struc * accidentally calling ->poll() when NAPI is not scheduled. */ work = 0; diff --git a/target/linux/generic/backport-6.6/780-01-v6.8-r8169-improve-RTL8411b-phy-down-fixup.patch b/target/linux/generic/backport-6.6/780-01-v6.8-r8169-improve-RTL8411b-phy-down-fixup.patch index 9a17fe4f78e625..b44627ea299435 100644 --- a/target/linux/generic/backport-6.6/780-01-v6.8-r8169-improve-RTL8411b-phy-down-fixup.patch +++ b/target/linux/generic/backport-6.6/780-01-v6.8-r8169-improve-RTL8411b-phy-down-fixup.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -3129,6 +3129,33 @@ static void rtl_hw_start_8168g_2(struct +@@ -3156,6 +3156,33 @@ static void rtl_hw_start_8168g_2(struct rtl_ephy_init(tp, e_info_8168g_2); } @@ -52,7 +52,7 @@ Signed-off-by: David S. Miller static void rtl_hw_start_8411_2(struct rtl8169_private *tp) { static const struct ephy_info e_info_8411_2[] = { -@@ -3162,117 +3189,7 @@ static void rtl_hw_start_8411_2(struct r +@@ -3189,117 +3216,7 @@ static void rtl_hw_start_8411_2(struct r mdelay(3); r8168_mac_ocp_write(tp, 0xFC26, 0x0000); diff --git a/target/linux/generic/backport-6.6/780-03-v6.8-r8169-remove-multicast-filter-limit.patch b/target/linux/generic/backport-6.6/780-03-v6.8-r8169-remove-multicast-filter-limit.patch index 4186e14e17134d..ad36db13725ecc 100644 --- a/target/linux/generic/backport-6.6/780-03-v6.8-r8169-remove-multicast-filter-limit.patch +++ b/target/linux/generic/backport-6.6/780-03-v6.8-r8169-remove-multicast-filter-limit.patch @@ -35,7 +35,7 @@ Signed-off-by: Jakub Kicinski #define TX_DMA_BURST 7 /* Maximum PCI burst, '7' is unlimited */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ -@@ -2626,8 +2622,7 @@ static void rtl_set_rx_mode(struct net_d +@@ -2653,8 +2649,7 @@ static void rtl_set_rx_mode(struct net_d rx_mode |= AcceptAllPhys; } else if (!(dev->flags & IFF_MULTICAST)) { rx_mode &= ~AcceptMulticast; diff --git a/target/linux/generic/backport-6.6/780-04-v6.8-r8169-improve-handling-task-scheduling.patch b/target/linux/generic/backport-6.6/780-04-v6.8-r8169-improve-handling-task-scheduling.patch index a809e8213aa16c..f020284cc80a43 100644 --- a/target/linux/generic/backport-6.6/780-04-v6.8-r8169-improve-handling-task-scheduling.patch +++ b/target/linux/generic/backport-6.6/780-04-v6.8-r8169-improve-handling-task-scheduling.patch @@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -2252,6 +2252,9 @@ u16 rtl8168h_2_get_adc_bias_ioffset(stru +@@ -2279,6 +2279,9 @@ u16 rtl8168h_2_get_adc_bias_ioffset(stru static void rtl_schedule_task(struct rtl8169_private *tp, enum rtl_flag flag) { @@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski set_bit(flag, tp->wk.flags); schedule_work(&tp->wk.work); } -@@ -4491,8 +4494,7 @@ static void rtl_task(struct work_struct +@@ -4518,8 +4521,7 @@ static void rtl_task(struct work_struct rtnl_lock(); diff --git a/target/linux/generic/backport-6.6/780-05-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch b/target/linux/generic/backport-6.6/780-05-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch index 7a5d5a66a12360..95245b9a54ce60 100644 --- a/target/linux/generic/backport-6.6/780-05-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch +++ b/target/linux/generic/backport-6.6/780-05-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch @@ -225,7 +225,7 @@ Signed-off-by: David S. Miller LED_FREQ = 0x1a, EEE_LED = 0x1b, ERIDR = 0x70, -@@ -616,6 +617,7 @@ struct rtl8169_private { +@@ -643,6 +644,7 @@ struct rtl8169_private { raw_spinlock_t config25_lock; raw_spinlock_t mac_ocp_lock; @@ -233,7 +233,7 @@ Signed-off-by: David S. Miller raw_spinlock_t cfg9346_usage_lock; int cfg9346_usage_count; -@@ -788,6 +790,62 @@ static const struct rtl_cond name = { +@@ -815,6 +817,62 @@ static const struct rtl_cond name = { \ static bool name ## _check(struct rtl8169_private *tp) @@ -296,7 +296,7 @@ Signed-off-by: David S. Miller static void r8168fp_adjust_ocp_cmd(struct rtl8169_private *tp, u32 *cmd, int type) { /* based on RTL8168FP_OOBMAC_BASE in vendor driver */ -@@ -5168,6 +5226,7 @@ static int rtl_init_one(struct pci_dev * +@@ -5195,6 +5253,7 @@ static int rtl_init_one(struct pci_dev * raw_spin_lock_init(&tp->cfg9346_usage_lock); raw_spin_lock_init(&tp->config25_lock); raw_spin_lock_init(&tp->mac_ocp_lock); @@ -304,7 +304,7 @@ Signed-off-by: David S. Miller dev->tstats = devm_netdev_alloc_pcpu_stats(&pdev->dev, struct pcpu_sw_netstats); -@@ -5324,6 +5383,12 @@ static int rtl_init_one(struct pci_dev * +@@ -5351,6 +5410,12 @@ static int rtl_init_one(struct pci_dev * if (rc) return rc; diff --git a/target/linux/generic/backport-6.6/780-06-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch b/target/linux/generic/backport-6.6/780-06-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch index 67f215cadfb1e2..819a611cb3f26d 100644 --- a/target/linux/generic/backport-6.6/780-06-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch +++ b/target/linux/generic/backport-6.6/780-06-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch @@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski obj-$(CONFIG_R8169) += r8169.o --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -5383,11 +5383,10 @@ static int rtl_init_one(struct pci_dev * +@@ -5410,11 +5410,10 @@ static int rtl_init_one(struct pci_dev * if (rc) return rc; diff --git a/target/linux/generic/backport-6.6/780-07-v6.9-r8169-simplify-EEE-handling.patch b/target/linux/generic/backport-6.6/780-07-v6.9-r8169-simplify-EEE-handling.patch index bdd33305805816..d3a26303ef0e57 100644 --- a/target/linux/generic/backport-6.6/780-07-v6.9-r8169-simplify-EEE-handling.patch +++ b/target/linux/generic/backport-6.6/780-07-v6.9-r8169-simplify-EEE-handling.patch @@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -629,7 +629,6 @@ struct rtl8169_private { +@@ -656,7 +656,6 @@ struct rtl8169_private { struct rtl8169_counters *counters; struct rtl8169_tc_offsets tc_offset; u32 saved_wolopts; @@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski const char *fw_name; struct rtl_fw *rtl_fw; -@@ -2010,17 +2009,11 @@ static int rtl8169_get_eee(struct net_de +@@ -2037,17 +2036,11 @@ static int rtl8169_get_eee(struct net_de static int rtl8169_set_eee(struct net_device *dev, struct ethtool_eee *data) { struct rtl8169_private *tp = netdev_priv(dev); @@ -43,7 +43,7 @@ Signed-off-by: Jakub Kicinski } static void rtl8169_get_ringparam(struct net_device *dev, -@@ -2085,21 +2078,6 @@ static const struct ethtool_ops rtl8169_ +@@ -2112,21 +2105,6 @@ static const struct ethtool_ops rtl8169_ .set_pauseparam = rtl8169_set_pauseparam, }; @@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski static enum mac_version rtl8169_get_mac_version(u16 xid, bool gmii) { /* -@@ -2336,9 +2314,6 @@ static void rtl8169_init_phy(struct rtl8 +@@ -2363,9 +2341,6 @@ static void rtl8169_init_phy(struct rtl8 /* We may have called phy_speed_down before */ phy_speed_up(tp->phydev); @@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski genphy_soft_reset(tp->phydev); } -@@ -5085,7 +5060,9 @@ static int r8169_mdio_register(struct rt +@@ -5112,7 +5087,9 @@ static int r8169_mdio_register(struct rt } tp->phydev->mac_managed_pm = true; @@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski phy_support_asym_pause(tp->phydev); /* PHY will be woken up in rtl_open() */ -@@ -5220,7 +5197,6 @@ static int rtl_init_one(struct pci_dev * +@@ -5247,7 +5224,6 @@ static int rtl_init_one(struct pci_dev * tp->dev = dev; tp->pci_dev = pdev; tp->supports_gmii = ent->driver_data == RTL_CFG_NO_GBIT ? 0 : 1; diff --git a/target/linux/generic/backport-6.6/780-08-v6.9-r8169-add-support-for-RTL8126A.patch b/target/linux/generic/backport-6.6/780-08-v6.9-r8169-add-support-for-RTL8126A.patch index 63f135e3935395..6dfaa904a175e3 100644 --- a/target/linux/generic/backport-6.6/780-08-v6.9-r8169-add-support-for-RTL8126A.patch +++ b/target/linux/generic/backport-6.6/780-08-v6.9-r8169-add-support-for-RTL8126A.patch @@ -65,7 +65,7 @@ Signed-off-by: David S. Miller TxPoll_8125 = 0x90, MAC0_BKP = 0x19e0, EEE_TXIDLE_TIMER_8125 = 0x6048, -@@ -1139,7 +1146,7 @@ static void rtl_writephy(struct rtl8169_ +@@ -1166,7 +1173,7 @@ static void rtl_writephy(struct rtl8169_ case RTL_GIGA_MAC_VER_31: r8168dp_2_mdio_write(tp, location, val); break; @@ -74,7 +74,7 @@ Signed-off-by: David S. Miller r8168g_mdio_write(tp, location, val); break; default: -@@ -1154,7 +1161,7 @@ static int rtl_readphy(struct rtl8169_pr +@@ -1181,7 +1188,7 @@ static int rtl_readphy(struct rtl8169_pr case RTL_GIGA_MAC_VER_28: case RTL_GIGA_MAC_VER_31: return r8168dp_2_mdio_read(tp, location); @@ -83,7 +83,7 @@ Signed-off-by: David S. Miller return r8168g_mdio_read(tp, location); default: return r8169_mdio_read(tp, location); -@@ -1363,7 +1370,7 @@ static void rtl_set_d3_pll_down(struct r +@@ -1390,7 +1397,7 @@ static void rtl_set_d3_pll_down(struct r case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: case RTL_GIGA_MAC_VER_29 ... RTL_GIGA_MAC_VER_30: case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_37: @@ -92,7 +92,7 @@ Signed-off-by: David S. Miller if (enable) RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~D3_NO_PLL_DOWN); else -@@ -1530,7 +1537,7 @@ static void __rtl8169_set_wol(struct rtl +@@ -1557,7 +1564,7 @@ static void __rtl8169_set_wol(struct rtl break; case RTL_GIGA_MAC_VER_34: case RTL_GIGA_MAC_VER_37: @@ -101,7 +101,7 @@ Signed-off-by: David S. Miller if (wolopts) rtl_mod_config2(tp, 0, PME_SIGNAL); else -@@ -2096,6 +2103,9 @@ static enum mac_version rtl8169_get_mac_ +@@ -2123,6 +2130,9 @@ static enum mac_version rtl8169_get_mac_ u16 val; enum mac_version ver; } mac_info[] = { @@ -111,7 +111,7 @@ Signed-off-by: David S. Miller /* 8125B family. */ { 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 }, -@@ -2366,6 +2376,7 @@ static void rtl_init_rxcfg(struct rtl816 +@@ -2393,6 +2403,7 @@ static void rtl_init_rxcfg(struct rtl816 RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST); break; case RTL_GIGA_MAC_VER_63: @@ -119,7 +119,7 @@ Signed-off-by: David S. Miller RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST | RX_PAUSE_SLOT_ON); break; -@@ -2552,7 +2563,7 @@ static void rtl_wait_txrx_fifo_empty(str +@@ -2579,7 +2590,7 @@ static void rtl_wait_txrx_fifo_empty(str case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_61: rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42); break; @@ -128,7 +128,7 @@ Signed-off-by: David S. Miller RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq); rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42); rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond_2, 100, 42); -@@ -2795,7 +2806,7 @@ static void rtl_enable_exit_l1(struct rt +@@ -2822,7 +2833,7 @@ static void rtl_enable_exit_l1(struct rt case RTL_GIGA_MAC_VER_37 ... RTL_GIGA_MAC_VER_38: rtl_eri_set_bits(tp, 0xd4, 0x0c00); break; @@ -137,7 +137,7 @@ Signed-off-by: David S. Miller r8168_mac_ocp_modify(tp, 0xc0ac, 0, 0x1f80); break; default: -@@ -2809,7 +2820,7 @@ static void rtl_disable_exit_l1(struct r +@@ -2836,7 +2847,7 @@ static void rtl_disable_exit_l1(struct r case RTL_GIGA_MAC_VER_34 ... RTL_GIGA_MAC_VER_38: rtl_eri_clear_bits(tp, 0xd4, 0x1f00); break; @@ -146,7 +146,7 @@ Signed-off-by: David S. Miller r8168_mac_ocp_modify(tp, 0xc0ac, 0x1f80, 0); break; default: -@@ -2819,6 +2830,8 @@ static void rtl_disable_exit_l1(struct r +@@ -2846,6 +2857,8 @@ static void rtl_disable_exit_l1(struct r static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable) { @@ -155,7 +155,7 @@ Signed-off-by: David S. Miller if (tp->mac_version < RTL_GIGA_MAC_VER_32) return; -@@ -2832,11 +2845,19 @@ static void rtl_hw_aspm_clkreq_enable(st +@@ -2859,11 +2872,19 @@ static void rtl_hw_aspm_clkreq_enable(st return; rtl_mod_config5(tp, 0, ASPM_en); @@ -177,7 +177,7 @@ Signed-off-by: David S. Miller /* reset ephy tx/rx disable timer */ r8168_mac_ocp_modify(tp, 0xe094, 0xff00, 0); /* chip can trigger L1.2 */ -@@ -2848,14 +2869,22 @@ static void rtl_hw_aspm_clkreq_enable(st +@@ -2875,14 +2896,22 @@ static void rtl_hw_aspm_clkreq_enable(st } else { switch (tp->mac_version) { case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48: @@ -202,7 +202,7 @@ Signed-off-by: David S. Miller rtl_mod_config5(tp, ASPM_en, 0); } } -@@ -3568,10 +3597,15 @@ static void rtl_hw_start_8125_common(str +@@ -3595,10 +3624,15 @@ static void rtl_hw_start_8125_common(str /* disable new tx descriptor format */ r8168_mac_ocp_modify(tp, 0xeb58, 0x0001, 0x0000); @@ -220,7 +220,7 @@ Signed-off-by: David S. Miller if (tp->mac_version == RTL_GIGA_MAC_VER_63) r8168_mac_ocp_modify(tp, 0xe63e, 0x0c30, 0x0000); -@@ -3584,6 +3618,10 @@ static void rtl_hw_start_8125_common(str +@@ -3611,6 +3645,10 @@ static void rtl_hw_start_8125_common(str r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030); r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000); r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001); @@ -231,7 +231,7 @@ Signed-off-by: David S. Miller r8168_mac_ocp_modify(tp, 0xe0c0, 0x4f0f, 0x4403); r8168_mac_ocp_modify(tp, 0xe052, 0x0080, 0x0068); r8168_mac_ocp_modify(tp, 0xd430, 0x0fff, 0x047f); -@@ -3598,10 +3636,10 @@ static void rtl_hw_start_8125_common(str +@@ -3625,10 +3663,10 @@ static void rtl_hw_start_8125_common(str rtl_loop_wait_low(tp, &rtl_mac_ocp_e00e_cond, 1000, 10); @@ -245,7 +245,7 @@ Signed-off-by: David S. Miller rtl_disable_rxdvgate(tp); } -@@ -3645,6 +3683,12 @@ static void rtl_hw_start_8125b(struct rt +@@ -3672,6 +3710,12 @@ static void rtl_hw_start_8125b(struct rt rtl_hw_start_8125_common(tp); } @@ -258,7 +258,7 @@ Signed-off-by: David S. Miller static void rtl_hw_config(struct rtl8169_private *tp) { static const rtl_generic_fct hw_configs[] = { -@@ -3687,6 +3731,7 @@ static void rtl_hw_config(struct rtl8169 +@@ -3714,6 +3758,7 @@ static void rtl_hw_config(struct rtl8169 [RTL_GIGA_MAC_VER_53] = rtl_hw_start_8117, [RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2, [RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b, @@ -266,7 +266,7 @@ Signed-off-by: David S. Miller }; if (hw_configs[tp->mac_version]) -@@ -3697,9 +3742,23 @@ static void rtl_hw_start_8125(struct rtl +@@ -3724,9 +3769,23 @@ static void rtl_hw_start_8125(struct rtl { int i; @@ -292,7 +292,7 @@ Signed-off-by: David S. Miller rtl_hw_config(tp); } -@@ -3777,8 +3836,7 @@ static int rtl8169_change_mtu(struct net +@@ -3804,8 +3863,7 @@ static int rtl8169_change_mtu(struct net rtl_jumbo_config(tp); switch (tp->mac_version) { @@ -302,7 +302,7 @@ Signed-off-by: David S. Miller rtl8125_set_eee_txidle_timer(tp); break; default: -@@ -3927,7 +3985,7 @@ static void rtl8169_cleanup(struct rtl81 +@@ -3954,7 +4012,7 @@ static void rtl8169_cleanup(struct rtl81 RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq); rtl_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666); break; @@ -311,7 +311,7 @@ Signed-off-by: David S. Miller rtl_enable_rxdvgate(tp); fsleep(2000); break; -@@ -4078,8 +4136,7 @@ static unsigned int rtl_quirk_packet_pad +@@ -4105,8 +4163,7 @@ static unsigned int rtl_quirk_packet_pad switch (tp->mac_version) { case RTL_GIGA_MAC_VER_34: @@ -321,7 +321,7 @@ Signed-off-by: David S. Miller padto = max_t(unsigned int, padto, ETH_ZLEN); break; default: -@@ -5112,7 +5169,7 @@ static void rtl_hw_initialize(struct rtl +@@ -5139,7 +5196,7 @@ static void rtl_hw_initialize(struct rtl case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48: rtl_hw_init_8168g(tp); break; diff --git a/target/linux/generic/backport-6.6/780-10-v6.9-r8169-simplify-code-by-using-core-provided-pcpu-stat.patch b/target/linux/generic/backport-6.6/780-10-v6.9-r8169-simplify-code-by-using-core-provided-pcpu-stat.patch index 510123767a9e83..0288dcb11e7aef 100644 --- a/target/linux/generic/backport-6.6/780-10-v6.9-r8169-simplify-code-by-using-core-provided-pcpu-stat.patch +++ b/target/linux/generic/backport-6.6/780-10-v6.9-r8169-simplify-code-by-using-core-provided-pcpu-stat.patch @@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -5261,11 +5261,6 @@ static int rtl_init_one(struct pci_dev * +@@ -5288,11 +5288,6 @@ static int rtl_init_one(struct pci_dev * raw_spin_lock_init(&tp->mac_ocp_lock); mutex_init(&tp->led_lock); @@ -28,7 +28,7 @@ Signed-off-by: Paolo Abeni /* Get the *optional* external "ether_clk" used on some boards */ tp->clk = devm_clk_get_optional_enabled(&pdev->dev, "ether_clk"); if (IS_ERR(tp->clk)) -@@ -5380,6 +5375,8 @@ static int rtl_init_one(struct pci_dev * +@@ -5407,6 +5402,8 @@ static int rtl_init_one(struct pci_dev * dev->hw_features |= NETIF_F_RXALL; dev->hw_features |= NETIF_F_RXFCS; diff --git a/target/linux/generic/backport-6.6/780-11-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch b/target/linux/generic/backport-6.6/780-11-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch index 2059551b507264..449aa11591a1d0 100644 --- a/target/linux/generic/backport-6.6/780-11-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch +++ b/target/linux/generic/backport-6.6/780-11-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch @@ -173,7 +173,7 @@ Signed-off-by: Jakub Kicinski #define RX_VLAN_INNER_8125 BIT(22) #define RX_VLAN_OUTER_8125 BIT(23) #define RX_VLAN_8125 (RX_VLAN_INNER_8125 | RX_VLAN_OUTER_8125) -@@ -830,6 +836,51 @@ int rtl8168_get_led_mode(struct rtl8169_ +@@ -857,6 +863,51 @@ int rtl8168_get_led_mode(struct rtl8169_ return ret; } @@ -225,7 +225,7 @@ Signed-off-by: Jakub Kicinski void r8169_get_led_name(struct rtl8169_private *tp, int idx, char *buf, int buf_len) { -@@ -5413,10 +5464,12 @@ static int rtl_init_one(struct pci_dev * +@@ -5440,10 +5491,12 @@ static int rtl_init_one(struct pci_dev * if (rc) return rc; diff --git a/target/linux/generic/backport-6.6/780-12-v6.9-r8169-add-generic-rtl_set_eee_txidle_timer-function.patch b/target/linux/generic/backport-6.6/780-12-v6.9-r8169-add-generic-rtl_set_eee_txidle_timer-function.patch index 1a7eed191f6cf1..5f762f7729e806 100644 --- a/target/linux/generic/backport-6.6/780-12-v6.9-r8169-add-generic-rtl_set_eee_txidle_timer-function.patch +++ b/target/linux/generic/backport-6.6/780-12-v6.9-r8169-add-generic-rtl_set_eee_txidle_timer-function.patch @@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -619,6 +619,7 @@ struct rtl8169_private { +@@ -646,6 +646,7 @@ struct rtl8169_private { struct page *Rx_databuff[NUM_RX_DESC]; /* Rx data buffers */ struct ring_info tx_skb[NUM_TX_DESC]; /* Tx data buffers */ u16 cp_cmd; @@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski u32 irq_mask; int irq; struct clk *clk; -@@ -2054,6 +2055,22 @@ static int rtl_set_coalesce(struct net_d +@@ -2081,6 +2082,22 @@ static int rtl_set_coalesce(struct net_d return 0; } @@ -49,7 +49,7 @@ Signed-off-by: Jakub Kicinski static int rtl8169_get_eee(struct net_device *dev, struct ethtool_eee *data) { struct rtl8169_private *tp = netdev_priv(dev); -@@ -2312,14 +2329,8 @@ static void rtl8125a_config_eee_mac(stru +@@ -2339,14 +2356,8 @@ static void rtl8125a_config_eee_mac(stru r8168_mac_ocp_modify(tp, 0xeb62, 0, BIT(2) | BIT(1)); } @@ -64,7 +64,7 @@ Signed-off-by: Jakub Kicinski r8168_mac_ocp_modify(tp, 0xe040, 0, BIT(1) | BIT(0)); } -@@ -3852,6 +3863,8 @@ static void rtl_hw_start(struct rtl8169 +@@ -3879,6 +3890,8 @@ static void rtl_hw_start(struct rtl8169 rtl_hw_aspm_clkreq_enable(tp, false); RTL_W16(tp, CPlusCmd, tp->cp_cmd); @@ -73,7 +73,7 @@ Signed-off-by: Jakub Kicinski if (tp->mac_version <= RTL_GIGA_MAC_VER_06) rtl_hw_start_8169(tp); else if (rtl_is_8125(tp)) -@@ -3885,14 +3898,7 @@ static int rtl8169_change_mtu(struct net +@@ -3912,14 +3925,7 @@ static int rtl8169_change_mtu(struct net dev->mtu = new_mtu; netdev_update_features(dev); rtl_jumbo_config(tp); diff --git a/target/linux/generic/backport-6.6/780-13-v6.9-r8169-support-setting-the-EEE-tx-idle-timer-on-RTL81.patch b/target/linux/generic/backport-6.6/780-13-v6.9-r8169-support-setting-the-EEE-tx-idle-timer-on-RTL81.patch index 917c7c194fc288..8669dd2fea3d02 100644 --- a/target/linux/generic/backport-6.6/780-13-v6.9-r8169-support-setting-the-EEE-tx-idle-timer-on-RTL81.patch +++ b/target/linux/generic/backport-6.6/780-13-v6.9-r8169-support-setting-the-EEE-tx-idle-timer-on-RTL81.patch @@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -2060,6 +2060,11 @@ static void rtl_set_eee_txidle_timer(str +@@ -2087,6 +2087,11 @@ static void rtl_set_eee_txidle_timer(str unsigned int timer_val = READ_ONCE(tp->dev->mtu) + ETH_HLEN + 0x20; switch (tp->mac_version) { diff --git a/target/linux/generic/backport-6.6/780-14-v6.9-r8169-add-support-for-returning-tx_lpi_timer-in-etht.patch b/target/linux/generic/backport-6.6/780-14-v6.9-r8169-add-support-for-returning-tx_lpi_timer-in-etht.patch index 51477d0142fc8c..1a27bd190fb634 100644 --- a/target/linux/generic/backport-6.6/780-14-v6.9-r8169-add-support-for-returning-tx_lpi_timer-in-etht.patch +++ b/target/linux/generic/backport-6.6/780-14-v6.9-r8169-add-support-for-returning-tx_lpi_timer-in-etht.patch @@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -2076,14 +2076,34 @@ static void rtl_set_eee_txidle_timer(str +@@ -2103,14 +2103,34 @@ static void rtl_set_eee_txidle_timer(str } } diff --git a/target/linux/generic/backport-6.6/780-15-v6.9-r8169-add-MODULE_FIRMWARE-entry-for-RTL8126A.patch b/target/linux/generic/backport-6.6/780-15-v6.9-r8169-add-MODULE_FIRMWARE-entry-for-RTL8126A.patch index 6a7ebc885b3782..da33372306c67d 100644 --- a/target/linux/generic/backport-6.6/780-15-v6.9-r8169-add-MODULE_FIRMWARE-entry-for-RTL8126A.patch +++ b/target/linux/generic/backport-6.6/780-15-v6.9-r8169-add-MODULE_FIRMWARE-entry-for-RTL8126A.patch @@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -676,6 +676,7 @@ MODULE_FIRMWARE(FIRMWARE_8168FP_3); +@@ -703,6 +703,7 @@ MODULE_FIRMWARE(FIRMWARE_8168FP_3); MODULE_FIRMWARE(FIRMWARE_8107E_2); MODULE_FIRMWARE(FIRMWARE_8125A_3); MODULE_FIRMWARE(FIRMWARE_8125B_2); diff --git a/target/linux/generic/backport-6.6/780-16-v6.9-r8169-fix-LED-related-deadlock-on-module-removal.patch b/target/linux/generic/backport-6.6/780-16-v6.9-r8169-fix-LED-related-deadlock-on-module-removal.patch index d8e4a4f6ff1c82..6e0ff9b14bd566 100644 --- a/target/linux/generic/backport-6.6/780-16-v6.9-r8169-fix-LED-related-deadlock-on-module-removal.patch +++ b/target/linux/generic/backport-6.6/780-16-v6.9-r8169-fix-LED-related-deadlock-on-module-removal.patch @@ -115,7 +115,7 @@ Signed-off-by: David S. Miller } --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -647,6 +647,8 @@ struct rtl8169_private { +@@ -674,6 +674,8 @@ struct rtl8169_private { const char *fw_name; struct rtl_fw *rtl_fw; @@ -124,7 +124,7 @@ Signed-off-by: David S. Miller u32 ocp_base; }; -@@ -5040,6 +5042,8 @@ static void rtl_remove_one(struct pci_de +@@ -5067,6 +5069,8 @@ static void rtl_remove_one(struct pci_de cancel_work_sync(&tp->wk.work); @@ -133,7 +133,7 @@ Signed-off-by: David S. Miller unregister_netdev(tp->dev); if (tp->dash_type != RTL_DASH_NONE) -@@ -5498,9 +5502,9 @@ static int rtl_init_one(struct pci_dev * +@@ -5525,9 +5529,9 @@ static int rtl_init_one(struct pci_dev * if (IS_ENABLED(CONFIG_R8169_LEDS)) { if (rtl_is_8125(tp)) diff --git a/target/linux/generic/backport-6.6/780-17-v6.9-r8169-add-missing-conditional-compiling-for-call-to-.patch b/target/linux/generic/backport-6.6/780-17-v6.9-r8169-add-missing-conditional-compiling-for-call-to-.patch index 366ae803f9ddc4..e647e18167e48a 100644 --- a/target/linux/generic/backport-6.6/780-17-v6.9-r8169-add-missing-conditional-compiling-for-call-to-.patch +++ b/target/linux/generic/backport-6.6/780-17-v6.9-r8169-add-missing-conditional-compiling-for-call-to-.patch @@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -5042,7 +5042,8 @@ static void rtl_remove_one(struct pci_de +@@ -5069,7 +5069,8 @@ static void rtl_remove_one(struct pci_de cancel_work_sync(&tp->wk.work); diff --git a/target/linux/generic/backport-6.6/780-18-v6.10-r8169-add-support-for-RTL8168M.patch b/target/linux/generic/backport-6.6/780-18-v6.10-r8169-add-support-for-RTL8168M.patch index 2abbe2ccf153db..95455ee2cbbedb 100644 --- a/target/linux/generic/backport-6.6/780-18-v6.10-r8169-add-support-for-RTL8168M.patch +++ b/target/linux/generic/backport-6.6/780-18-v6.10-r8169-add-support-for-RTL8168M.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -2230,6 +2230,8 @@ static enum mac_version rtl8169_get_mac_ +@@ -2257,6 +2257,8 @@ static enum mac_version rtl8169_get_mac_ * the wild. Let's disable detection. * { 0x7cf, 0x540, RTL_GIGA_MAC_VER_45 }, */ diff --git a/target/linux/generic/backport-6.6/780-19-v6.10-net-annotate-writes-on-dev-mtu-from-ndo_change_mtu.patch b/target/linux/generic/backport-6.6/780-19-v6.10-net-annotate-writes-on-dev-mtu-from-ndo_change_mtu.patch index cad1210e4dde37..4c05976d2e5f69 100644 --- a/target/linux/generic/backport-6.6/780-19-v6.10-net-annotate-writes-on-dev-mtu-from-ndo_change_mtu.patch +++ b/target/linux/generic/backport-6.6/780-19-v6.10-net-annotate-writes-on-dev-mtu-from-ndo_change_mtu.patch @@ -49,7 +49,7 @@ Signed-off-by: Jakub Kicinski } --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -3925,7 +3925,7 @@ static int rtl8169_change_mtu(struct net +@@ -3952,7 +3952,7 @@ static int rtl8169_change_mtu(struct net { struct rtl8169_private *tp = netdev_priv(dev); diff --git a/target/linux/generic/backport-6.6/780-20-v6.11-r8169-disable-interrupt-source-RxOverflow.patch b/target/linux/generic/backport-6.6/780-20-v6.11-r8169-disable-interrupt-source-RxOverflow.patch index cef5d95252ef85..9389585f160355 100644 --- a/target/linux/generic/backport-6.6/780-20-v6.11-r8169-disable-interrupt-source-RxOverflow.patch +++ b/target/linux/generic/backport-6.6/780-20-v6.11-r8169-disable-interrupt-source-RxOverflow.patch @@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -5083,12 +5083,10 @@ static void rtl_set_irq_mask(struct rtl8 +@@ -5110,12 +5110,10 @@ static void rtl_set_irq_mask(struct rtl8 tp->irq_mask = RxOK | RxErr | TxOK | TxErr | LinkChg; if (tp->mac_version <= RTL_GIGA_MAC_VER_06) diff --git a/target/linux/generic/backport-6.6/780-21-v6.11-r8169-remove-detection-of-chip-version-11-early-RTL8.patch b/target/linux/generic/backport-6.6/780-21-v6.11-r8169-remove-detection-of-chip-version-11-early-RTL8.patch index 7f0f23fccb671b..5e9e765a7ebbc2 100644 --- a/target/linux/generic/backport-6.6/780-21-v6.11-r8169-remove-detection-of-chip-version-11-early-RTL8.patch +++ b/target/linux/generic/backport-6.6/780-21-v6.11-r8169-remove-detection-of-chip-version-11-early-RTL8.patch @@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -2275,7 +2275,9 @@ static enum mac_version rtl8169_get_mac_ +@@ -2302,7 +2302,9 @@ static enum mac_version rtl8169_get_mac_ /* 8168B family. */ { 0x7c8, 0x380, RTL_GIGA_MAC_VER_17 }, diff --git a/target/linux/generic/backport-6.6/780-22-v6.12-r8169-add-support-for-RTL8126A-rev.b.patch b/target/linux/generic/backport-6.6/780-22-v6.12-r8169-add-support-for-RTL8126A-rev.b.patch index d15edf85e1a3a8..0915cb729fdcf2 100644 --- a/target/linux/generic/backport-6.6/780-22-v6.12-r8169-add-support-for-RTL8126A-rev.b.patch +++ b/target/linux/generic/backport-6.6/780-22-v6.12-r8169-add-support-for-RTL8126A-rev.b.patch @@ -44,7 +44,7 @@ Signed-off-by: Jakub Kicinski }; static const struct pci_device_id rtl8169_pci_tbl[] = { -@@ -1201,7 +1203,7 @@ static void rtl_writephy(struct rtl8169_ +@@ -1228,7 +1230,7 @@ static void rtl_writephy(struct rtl8169_ case RTL_GIGA_MAC_VER_31: r8168dp_2_mdio_write(tp, location, val); break; @@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski r8168g_mdio_write(tp, location, val); break; default: -@@ -1216,7 +1218,7 @@ static int rtl_readphy(struct rtl8169_pr +@@ -1243,7 +1245,7 @@ static int rtl_readphy(struct rtl8169_pr case RTL_GIGA_MAC_VER_28: case RTL_GIGA_MAC_VER_31: return r8168dp_2_mdio_read(tp, location); @@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski return r8168g_mdio_read(tp, location); default: return r8169_mdio_read(tp, location); -@@ -1425,7 +1427,7 @@ static void rtl_set_d3_pll_down(struct r +@@ -1452,7 +1454,7 @@ static void rtl_set_d3_pll_down(struct r case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: case RTL_GIGA_MAC_VER_29 ... RTL_GIGA_MAC_VER_30: case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_37: @@ -71,7 +71,7 @@ Signed-off-by: Jakub Kicinski if (enable) RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~D3_NO_PLL_DOWN); else -@@ -1592,7 +1594,7 @@ static void __rtl8169_set_wol(struct rtl +@@ -1619,7 +1621,7 @@ static void __rtl8169_set_wol(struct rtl break; case RTL_GIGA_MAC_VER_34: case RTL_GIGA_MAC_VER_37: @@ -80,7 +80,7 @@ Signed-off-by: Jakub Kicinski if (wolopts) rtl_mod_config2(tp, 0, PME_SIGNAL); else -@@ -2071,6 +2073,7 @@ static void rtl_set_eee_txidle_timer(str +@@ -2098,6 +2100,7 @@ static void rtl_set_eee_txidle_timer(str case RTL_GIGA_MAC_VER_61: case RTL_GIGA_MAC_VER_63: case RTL_GIGA_MAC_VER_65: @@ -88,7 +88,7 @@ Signed-off-by: Jakub Kicinski tp->tx_lpi_timer = timer_val; RTL_W16(tp, EEE_TXIDLE_TIMER_8125, timer_val); break; -@@ -2200,6 +2203,7 @@ static enum mac_version rtl8169_get_mac_ +@@ -2227,6 +2230,7 @@ static enum mac_version rtl8169_get_mac_ enum mac_version ver; } mac_info[] = { /* 8126A family. */ @@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski { 0x7cf, 0x649, RTL_GIGA_MAC_VER_65 }, /* 8125B family. */ -@@ -2471,6 +2475,7 @@ static void rtl_init_rxcfg(struct rtl816 +@@ -2498,6 +2502,7 @@ static void rtl_init_rxcfg(struct rtl816 break; case RTL_GIGA_MAC_VER_63: case RTL_GIGA_MAC_VER_65: @@ -104,7 +104,7 @@ Signed-off-by: Jakub Kicinski RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST | RX_PAUSE_SLOT_ON); break; -@@ -2657,7 +2662,7 @@ static void rtl_wait_txrx_fifo_empty(str +@@ -2684,7 +2689,7 @@ static void rtl_wait_txrx_fifo_empty(str case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_61: rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42); break; @@ -113,7 +113,7 @@ Signed-off-by: Jakub Kicinski RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq); rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42); rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond_2, 100, 42); -@@ -2900,7 +2905,7 @@ static void rtl_enable_exit_l1(struct rt +@@ -2927,7 +2932,7 @@ static void rtl_enable_exit_l1(struct rt case RTL_GIGA_MAC_VER_37 ... RTL_GIGA_MAC_VER_38: rtl_eri_set_bits(tp, 0xd4, 0x0c00); break; @@ -122,7 +122,7 @@ Signed-off-by: Jakub Kicinski r8168_mac_ocp_modify(tp, 0xc0ac, 0, 0x1f80); break; default: -@@ -2914,7 +2919,7 @@ static void rtl_disable_exit_l1(struct r +@@ -2941,7 +2946,7 @@ static void rtl_disable_exit_l1(struct r case RTL_GIGA_MAC_VER_34 ... RTL_GIGA_MAC_VER_38: rtl_eri_clear_bits(tp, 0xd4, 0x1f00); break; @@ -131,7 +131,7 @@ Signed-off-by: Jakub Kicinski r8168_mac_ocp_modify(tp, 0xc0ac, 0x1f80, 0); break; default: -@@ -2941,6 +2946,7 @@ static void rtl_hw_aspm_clkreq_enable(st +@@ -2968,6 +2973,7 @@ static void rtl_hw_aspm_clkreq_enable(st rtl_mod_config5(tp, 0, ASPM_en); switch (tp->mac_version) { case RTL_GIGA_MAC_VER_65: @@ -139,7 +139,7 @@ Signed-off-by: Jakub Kicinski val8 = RTL_R8(tp, INT_CFG0_8125) | INT_CFG0_CLKREQEN; RTL_W8(tp, INT_CFG0_8125, val8); break; -@@ -2951,7 +2957,7 @@ static void rtl_hw_aspm_clkreq_enable(st +@@ -2978,7 +2984,7 @@ static void rtl_hw_aspm_clkreq_enable(st switch (tp->mac_version) { case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48: @@ -148,7 +148,7 @@ Signed-off-by: Jakub Kicinski /* reset ephy tx/rx disable timer */ r8168_mac_ocp_modify(tp, 0xe094, 0xff00, 0); /* chip can trigger L1.2 */ -@@ -2963,7 +2969,7 @@ static void rtl_hw_aspm_clkreq_enable(st +@@ -2990,7 +2996,7 @@ static void rtl_hw_aspm_clkreq_enable(st } else { switch (tp->mac_version) { case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48: @@ -157,7 +157,7 @@ Signed-off-by: Jakub Kicinski r8168_mac_ocp_modify(tp, 0xe092, 0x00ff, 0); break; default: -@@ -2972,6 +2978,7 @@ static void rtl_hw_aspm_clkreq_enable(st +@@ -2999,6 +3005,7 @@ static void rtl_hw_aspm_clkreq_enable(st switch (tp->mac_version) { case RTL_GIGA_MAC_VER_65: @@ -165,7 +165,7 @@ Signed-off-by: Jakub Kicinski val8 = RTL_R8(tp, INT_CFG0_8125) & ~INT_CFG0_CLKREQEN; RTL_W8(tp, INT_CFG0_8125, val8); break; -@@ -3691,10 +3698,12 @@ static void rtl_hw_start_8125_common(str +@@ -3718,10 +3725,12 @@ static void rtl_hw_start_8125_common(str /* disable new tx descriptor format */ r8168_mac_ocp_modify(tp, 0xeb58, 0x0001, 0x0000); @@ -180,7 +180,7 @@ Signed-off-by: Jakub Kicinski r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0400); else if (tp->mac_version == RTL_GIGA_MAC_VER_63) r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0200); -@@ -3712,7 +3721,8 @@ static void rtl_hw_start_8125_common(str +@@ -3739,7 +3748,8 @@ static void rtl_hw_start_8125_common(str r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030); r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000); r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001); @@ -190,7 +190,7 @@ Signed-off-by: Jakub Kicinski r8168_mac_ocp_modify(tp, 0xea1c, 0x0300, 0x0000); else r8168_mac_ocp_modify(tp, 0xea1c, 0x0004, 0x0000); -@@ -3826,6 +3836,7 @@ static void rtl_hw_config(struct rtl8169 +@@ -3853,6 +3863,7 @@ static void rtl_hw_config(struct rtl8169 [RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2, [RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b, [RTL_GIGA_MAC_VER_65] = rtl_hw_start_8126a, @@ -198,7 +198,7 @@ Signed-off-by: Jakub Kicinski }; if (hw_configs[tp->mac_version]) -@@ -3846,6 +3857,7 @@ static void rtl_hw_start_8125(struct rtl +@@ -3873,6 +3884,7 @@ static void rtl_hw_start_8125(struct rtl break; case RTL_GIGA_MAC_VER_63: case RTL_GIGA_MAC_VER_65: @@ -206,7 +206,7 @@ Signed-off-by: Jakub Kicinski for (i = 0xa00; i < 0xa80; i += 4) RTL_W32(tp, i, 0); RTL_W16(tp, INT_CFG1_8125, 0x0000); -@@ -4074,7 +4086,7 @@ static void rtl8169_cleanup(struct rtl81 +@@ -4101,7 +4113,7 @@ static void rtl8169_cleanup(struct rtl81 RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq); rtl_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666); break; @@ -215,7 +215,7 @@ Signed-off-by: Jakub Kicinski rtl_enable_rxdvgate(tp); fsleep(2000); break; -@@ -4225,7 +4237,7 @@ static unsigned int rtl_quirk_packet_pad +@@ -4252,7 +4264,7 @@ static unsigned int rtl_quirk_packet_pad switch (tp->mac_version) { case RTL_GIGA_MAC_VER_34: @@ -224,7 +224,7 @@ Signed-off-by: Jakub Kicinski padto = max_t(unsigned int, padto, ETH_ZLEN); break; default: -@@ -5259,7 +5271,7 @@ static void rtl_hw_initialize(struct rtl +@@ -5286,7 +5298,7 @@ static void rtl_hw_initialize(struct rtl case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48: rtl_hw_init_8168g(tp); break; diff --git a/target/linux/generic/backport-6.6/780-23-v6.12-r8169-Fix-spelling-mistake-tx_underun-tx_underrun.patch b/target/linux/generic/backport-6.6/780-23-v6.12-r8169-Fix-spelling-mistake-tx_underun-tx_underrun.patch deleted file mode 100644 index 9d0992fcbb2e77..00000000000000 --- a/target/linux/generic/backport-6.6/780-23-v6.12-r8169-Fix-spelling-mistake-tx_underun-tx_underrun.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 8df9439389a44fb2cc4ef695e08d6a8870b1616c Mon Sep 17 00:00:00 2001 -From: Colin Ian King -Date: Mon, 9 Sep 2024 15:00:21 +0100 -Subject: [PATCH 44/47] r8169: Fix spelling mistake: "tx_underun" -> - "tx_underrun" - -There is a spelling mistake in the struct field tx_underun, rename -it to tx_underrun. - -Signed-off-by: Colin Ian King -Reviewed-by: Simon Horman -Reviewed-by: Heiner Kallweit -Link: https://patch.msgid.link/20240909140021.64884-1-colin.i.king@gmail.com -Signed-off-by: Jakub Kicinski ---- - drivers/net/ethernet/realtek/r8169_main.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/net/ethernet/realtek/r8169_main.c -+++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -578,7 +578,7 @@ struct rtl8169_counters { - __le64 rx_broadcast; - __le32 rx_multicast; - __le16 tx_aborted; -- __le16 tx_underun; -+ __le16 tx_underrun; - }; - - struct rtl8169_tc_offsets { -@@ -1843,7 +1843,7 @@ static void rtl8169_get_ethtool_stats(st - data[9] = le64_to_cpu(counters->rx_broadcast); - data[10] = le32_to_cpu(counters->rx_multicast); - data[11] = le16_to_cpu(counters->tx_aborted); -- data[12] = le16_to_cpu(counters->tx_underun); -+ data[12] = le16_to_cpu(counters->tx_underrun); - } - - static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data) diff --git a/target/linux/generic/backport-6.6/780-25-v6.12-r8169-add-tally-counter-fields-added-with-RTL8125.patch b/target/linux/generic/backport-6.6/780-25-v6.12-r8169-add-tally-counter-fields-added-with-RTL8125.patch deleted file mode 100644 index 3b1110fb67adfe..00000000000000 --- a/target/linux/generic/backport-6.6/780-25-v6.12-r8169-add-tally-counter-fields-added-with-RTL8125.patch +++ /dev/null @@ -1,56 +0,0 @@ -From ced8e8b8f40accfcce4a2bbd8b150aa76d5eff9a Mon Sep 17 00:00:00 2001 -From: Heiner Kallweit -Date: Tue, 17 Sep 2024 23:04:46 +0200 -Subject: [PATCH 46/47] r8169: add tally counter fields added with RTL8125 - -RTL8125 added fields to the tally counter, what may result in the chip -dma'ing these new fields to unallocated memory. Therefore make sure -that the allocated memory area is big enough to hold all of the -tally counter values, even if we use only parts of it. - -Fixes: f1bce4ad2f1c ("r8169: add support for RTL8125") -Cc: stable@vger.kernel.org -Signed-off-by: Heiner Kallweit -Reviewed-by: Simon Horman -Link: https://patch.msgid.link/741d26a9-2b2b-485d-91d9-ecb302e345b5@gmail.com -Signed-off-by: Paolo Abeni ---- - drivers/net/ethernet/realtek/r8169_main.c | 27 +++++++++++++++++++++++ - 1 file changed, 27 insertions(+) - ---- a/drivers/net/ethernet/realtek/r8169_main.c -+++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -579,6 +579,33 @@ struct rtl8169_counters { - __le32 rx_multicast; - __le16 tx_aborted; - __le16 tx_underrun; -+ /* new since RTL8125 */ -+ __le64 tx_octets; -+ __le64 rx_octets; -+ __le64 rx_multicast64; -+ __le64 tx_unicast64; -+ __le64 tx_broadcast64; -+ __le64 tx_multicast64; -+ __le32 tx_pause_on; -+ __le32 tx_pause_off; -+ __le32 tx_pause_all; -+ __le32 tx_deferred; -+ __le32 tx_late_collision; -+ __le32 tx_all_collision; -+ __le32 tx_aborted32; -+ __le32 align_errors32; -+ __le32 rx_frame_too_long; -+ __le32 rx_runt; -+ __le32 rx_pause_on; -+ __le32 rx_pause_off; -+ __le32 rx_pause_all; -+ __le32 rx_unknown_opcode; -+ __le32 rx_mac_error; -+ __le32 tx_underrun32; -+ __le32 rx_mac_missed; -+ __le32 rx_tcam_dropped; -+ __le32 tdu; -+ __le32 rdu; - }; - - struct rtl8169_tc_offsets { diff --git a/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch b/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch index 53f313044a5cee..52d6ff1e4457d6 100644 --- a/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch +++ b/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch @@ -23,7 +23,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -10968,7 +10968,8 @@ void free_netdev(struct net_device *dev) +@@ -10972,7 +10972,8 @@ void free_netdev(struct net_device *dev) dev->xdp_bulkq = NULL; /* Compatibility with error handling in drivers */ diff --git a/target/linux/generic/config-6.6 b/target/linux/generic/config-6.6 index c8bca0d0ff0b41..0118b8dfbabc42 100644 --- a/target/linux/generic/config-6.6 +++ b/target/linux/generic/config-6.6 @@ -4358,6 +4358,7 @@ CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_OCTEONTX2_PF is not set # CONFIG_OCTEON_EP is not set # CONFIG_OF_OVERLAY is not set +CONFIG_OF_PARTITION=y CONFIG_OF_RESERVED_MEM=y # CONFIG_OF_UNITTEST is not set # CONFIG_OID_REGISTRY is not set @@ -4731,6 +4732,9 @@ CONFIG_PRINT_STACK_DEPTH=64 # CONFIG_PROC_CHILDREN is not set CONFIG_PROC_FS=y # CONFIG_PROC_KCORE is not set +CONFIG_PROC_MEM_ALWAYS_FORCE=y +# CONFIG_PROC_MEM_FORCE_PTRACE is not set +# CONFIG_PROC_MEM_NO_FORCE is not set # CONFIG_PROC_PAGE_MONITOR is not set # CONFIG_PROC_STRIPPED is not set CONFIG_PROC_SYSCTL=y diff --git a/target/linux/generic/pending-6.6/451-block-partitions-populate-fwnode.patch b/target/linux/generic/pending-6.6/451-block-partitions-populate-fwnode.patch index e279b7117379ee..35b908ca6d6c31 100644 --- a/target/linux/generic/pending-6.6/451-block-partitions-populate-fwnode.patch +++ b/target/linux/generic/pending-6.6/451-block-partitions-populate-fwnode.patch @@ -49,7 +49,7 @@ Signed-off-by: Daniel Golle #include "check.h" static int (*const check_part[])(struct parsed_partitions *) = { -@@ -292,6 +294,74 @@ static ssize_t whole_disk_show(struct de +@@ -295,6 +297,74 @@ static ssize_t whole_disk_show(struct de } static const DEVICE_ATTR(whole_disk, 0444, whole_disk_show, NULL); @@ -124,7 +124,7 @@ Signed-off-by: Daniel Golle /* * Must be called either with open_mutex held, before a disk can be opened or * after all disk users are gone. -@@ -374,6 +444,8 @@ static struct block_device *add_partitio +@@ -377,6 +447,8 @@ static struct block_device *add_partitio goto out_put; } diff --git a/target/linux/generic/pending-6.6/452-block-add-support-for-notifications.patch b/target/linux/generic/pending-6.6/452-block-add-support-for-notifications.patch index cad3fbfa9001b5..667852e38794af 100644 --- a/target/linux/generic/pending-6.6/452-block-add-support-for-notifications.patch +++ b/target/linux/generic/pending-6.6/452-block-add-support-for-notifications.patch @@ -156,7 +156,7 @@ Signed-off-by: Daniel Golle +device_initcall(blk_notifications_init); --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h -@@ -1564,4 +1564,15 @@ struct io_comp_batch { +@@ -1567,4 +1567,15 @@ struct io_comp_batch { #define DEFINE_IO_COMP_BATCH(name) struct io_comp_batch name = { } diff --git a/target/linux/generic/pending-6.6/457-mmc-block-set-fwnode-of-disk-devices.patch b/target/linux/generic/pending-6.6/457-mmc-block-set-fwnode-of-disk-devices.patch index b45a0ebb1ada5c..66f35156218e0f 100644 --- a/target/linux/generic/pending-6.6/457-mmc-block-set-fwnode-of-disk-devices.patch +++ b/target/linux/generic/pending-6.6/457-mmc-block-set-fwnode-of-disk-devices.patch @@ -14,24 +14,14 @@ Signed-off-by: Daniel Golle --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c -@@ -2463,6 +2463,7 @@ static struct mmc_blk_data *mmc_blk_allo - int area_type, - unsigned int part_type) - { -+ struct fwnode_handle *fwnode; - struct mmc_blk_data *md; - int devidx, ret; - char cap_str[10]; -@@ -2559,6 +2560,12 @@ static struct mmc_blk_data *mmc_blk_allo - - blk_queue_write_cache(md->queue.queue, cache_enabled, fua_enabled); - -+ fwnode = device_get_named_child_node(subname ? md->parent->parent : -+ md->parent, -+ subname ? subname : "block"); -+ if (fwnode) -+ device_set_node(disk_to_dev(md->disk), fwnode); -+ - string_get_size((u64)size, 512, STRING_UNITS_2, - cap_str, sizeof(cap_str)); - pr_info("%s: %s %s %s%s\n", +@@ -2620,6 +2620,10 @@ static struct mmc_blk_data *mmc_blk_allo + if (area_type == MMC_BLK_DATA_AREA_MAIN) + dev_set_drvdata(&card->dev, md); + disk_fwnode = mmc_blk_get_partitions_node(parent, subname); ++ if (!disk_fwnode) ++ disk_fwnode = device_get_named_child_node(subname ? md->parent->parent : ++ md->parent, ++ subname ? subname : "block"); + ret = add_disk_fwnode(md->parent, md->disk, mmc_disk_attr_groups, + disk_fwnode); + if (ret) diff --git a/target/linux/generic/pending-6.6/458-mmc-block-set-GENHD_FL_NVMEM.patch b/target/linux/generic/pending-6.6/458-mmc-block-set-GENHD_FL_NVMEM.patch index 713401f104274d..7f9c512e457063 100644 --- a/target/linux/generic/pending-6.6/458-mmc-block-set-GENHD_FL_NVMEM.patch +++ b/target/linux/generic/pending-6.6/458-mmc-block-set-GENHD_FL_NVMEM.patch @@ -12,7 +12,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c -@@ -2516,6 +2516,7 @@ static struct mmc_blk_data *mmc_blk_allo +@@ -2566,6 +2566,7 @@ static struct mmc_blk_data *mmc_blk_allo md->disk->major = MMC_BLOCK_MAJOR; md->disk->minors = perdev_minors; md->disk->first_minor = devidx * perdev_minors; diff --git a/target/linux/generic/pending-6.6/680-net-add-TCP-fraglist-GRO-support.patch b/target/linux/generic/pending-6.6/680-net-add-TCP-fraglist-GRO-support.patch index 68ebf4e68a8f2e..b810e7ec91a48d 100644 --- a/target/linux/generic/pending-6.6/680-net-add-TCP-fraglist-GRO-support.patch +++ b/target/linux/generic/pending-6.6/680-net-add-TCP-fraglist-GRO-support.patch @@ -45,7 +45,7 @@ Signe-off-by: Felix Fietkau INDIRECT_CALLABLE_DECLARE(int tcp6_gro_complete(struct sk_buff *skb, int thoff)); --- a/net/core/gro.c +++ b/net/core/gro.c -@@ -233,6 +233,33 @@ done: +@@ -228,6 +228,33 @@ done: return 0; } @@ -379,7 +379,7 @@ Signe-off-by: Felix Fietkau skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4; --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c -@@ -452,33 +452,6 @@ out: +@@ -470,33 +470,6 @@ out: return segs; } diff --git a/target/linux/generic/pending-6.6/684-gso-fix-gso-fraglist-segmentation-after-pull-from-fr.patch b/target/linux/generic/pending-6.6/684-gso-fix-gso-fraglist-segmentation-after-pull-from-fr.patch deleted file mode 100644 index 5a7ba07fd04b6c..00000000000000 --- a/target/linux/generic/pending-6.6/684-gso-fix-gso-fraglist-segmentation-after-pull-from-fr.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: Willem de Bruijn -Date: Sun, 22 Sep 2024 11:03:45 -0400 -Subject: [PATCH] gso: fix gso fraglist segmentation after pull from - frag_list - -Detect gso fraglist skbs with corrupted geometry (see below) and -pass these to skb_segment instead of skb_segment_list, as the first -can segment them correctly. - -Valid SKB_GSO_FRAGLIST skbs -- consist of two or more segments -- the head_skb holds the protocol headers plus first gso_size -- one or more frag_list skbs hold exactly one segment -- all but the last must be gso_size - -Optional datapath hooks such as NAT and BPF (bpf_skb_pull_data) can -modify these skbs, breaking these invariants. - -In extreme cases they pull all data into skb linear. For UDP, this -causes a NULL ptr deref in __udpv4_gso_segment_list_csum at -udp_hdr(seg->next)->dest. - -Detect invalid geometry due to pull, by checking head_skb size. -Don't just drop, as this may blackhole a destination. Convert to be -able to pass to regular skb_segment. - -Link: https://lore.kernel.org/netdev/20240428142913.18666-1-shiming.cheng@mediatek.com/ -Fixes: 3a1296a38d0c ("net: Support GRO/GSO fraglist chaining.") -Signed-off-by: Willem de Bruijn -Cc: stable@vger.kernel.org ---- - ---- a/net/ipv4/udp_offload.c -+++ b/net/ipv4/udp_offload.c -@@ -296,8 +296,16 @@ struct sk_buff *__udp_gso_segment(struct - return NULL; - } - -- if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST) -- return __udp_gso_segment_list(gso_skb, features, is_ipv6); -+ if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST) { -+ /* Detect modified geometry and pass these to skb_segment. */ -+ if (skb_pagelen(gso_skb) - sizeof(*uh) == skb_shinfo(gso_skb)->gso_size) -+ return __udp_gso_segment_list(gso_skb, features, is_ipv6); -+ -+ /* Setup csum, as fraglist skips this in udp4_gro_receive. */ -+ gso_skb->csum_start = skb_transport_header(gso_skb) - gso_skb->head; -+ gso_skb->csum_offset = offsetof(struct udphdr, check); -+ gso_skb->ip_summed = CHECKSUM_PARTIAL; -+ } - - skb_pull(gso_skb, sizeof(*uh)); - diff --git a/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch b/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch index 2b9543da6de2df..f27581d3e922b3 100644 --- a/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch +++ b/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -8333,7 +8333,7 @@ static int nft_register_flowtable_net_ho +@@ -8376,7 +8376,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index b5d387b14a06c0..478e399d0cedec 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -1093,7 +1093,7 @@ endef TARGET_DEVICES += qxwlan_e2600ac-c2 define Device/skspruce_wia3300-20 - $(call Device/FitImage) + $(call Device/FitzImage) BLOCKSIZE := 64k IMAGE_SIZE := 55104k SOC := qcom-ipq4019 diff --git a/target/linux/lantiq/patches-6.6/0025-v6.12-net-ethernet-lantiq_etop-fix-memory-disclosure.patch b/target/linux/lantiq/patches-6.6/0025-v6.12-net-ethernet-lantiq_etop-fix-memory-disclosure.patch deleted file mode 100644 index 3b2ac25065091c..00000000000000 --- a/target/linux/lantiq/patches-6.6/0025-v6.12-net-ethernet-lantiq_etop-fix-memory-disclosure.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 45c0de18ff2dc9af01236380404bbd6a46502c69 Mon Sep 17 00:00:00 2001 -From: Aleksander Jan Bajkowski -Date: Mon, 23 Sep 2024 23:49:49 +0200 -Subject: net: ethernet: lantiq_etop: fix memory disclosure - -When applying padding, the buffer is not zeroed, which results in memory -disclosure. The mentioned data is observed on the wire. This patch uses -skb_put_padto() to pad Ethernet frames properly. The mentioned function -zeroes the expanded buffer. - -In case the packet cannot be padded it is silently dropped. Statistics -are also not incremented. This driver does not support statistics in the -old 32-bit format or the new 64-bit format. These will be added in the -future. In its current form, the patch should be easily backported to -stable versions. - -Ethernet MACs on Amazon-SE and Danube cannot do padding of the packets -in hardware, so software padding must be applied. - -Fixes: 504d4721ee8e ("MIPS: Lantiq: Add ethernet driver") -Signed-off-by: Aleksander Jan Bajkowski -Reviewed-by: Jacob Keller -Reviewed-by: Florian Fainelli -Link: https://patch.msgid.link/20240923214949.231511-2-olek2@wp.pl -Signed-off-by: Paolo Abeni ---- - drivers/net/ethernet/lantiq_etop.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/drivers/net/ethernet/lantiq_etop.c -+++ b/drivers/net/ethernet/lantiq_etop.c -@@ -482,7 +482,9 @@ ltq_etop_tx(struct sk_buff *skb, struct - unsigned long flags; - u32 byte_offset; - -- len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; -+ if (skb_put_padto(skb, ETH_ZLEN)) -+ return NETDEV_TX_OK; -+ len = skb->len; - - if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) || ch->skb[ch->dma.desc]) { - netdev_err(dev, "tx ring full\n"); diff --git a/target/linux/mediatek/patches-6.6/901-arm-add-cmdline-override.patch b/target/linux/mediatek/patches-6.6/901-arm-add-cmdline-override.patch index 21bbed88d7b0f3..034826253df2a6 100644 --- a/target/linux/mediatek/patches-6.6/901-arm-add-cmdline-override.patch +++ b/target/linux/mediatek/patches-6.6/901-arm-add-cmdline-override.patch @@ -37,7 +37,7 @@ * CONFIG_CMDLINE is meant to be a default in case nothing else --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -2307,6 +2307,14 @@ config CMDLINE_FORCE +@@ -2308,6 +2308,14 @@ config CMDLINE_FORCE endchoice diff --git a/target/linux/sifiveu/patches-6.6/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch b/target/linux/sifiveu/patches-6.6/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch index 90dcb0e3e473bf..905e3cccb75218 100644 --- a/target/linux/sifiveu/patches-6.6/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch +++ b/target/linux/sifiveu/patches-6.6/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch @@ -14,7 +14,7 @@ Signed-off-by: David Abdurachmanov --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig -@@ -897,6 +897,14 @@ config PORTABLE +@@ -901,6 +901,14 @@ config PORTABLE select MMU select OF