From 475838de1a33d49d1a0b81aad374a8db6dd2b3c8 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Sun, 27 Sep 2020 19:01:27 -0300 Subject: [PATCH 01/11] openssl: bump to 1.1.1h This is a bug-fix release. Patches were refreshed. Signed-off-by: Eneas U de Queiroz --- package/libs/openssl/Makefile | 4 ++-- .../libs/openssl/patches/100-Configure-afalg-support.patch | 2 +- package/libs/openssl/patches/130-dont-build-tests-fuzz.patch | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 8fe00d970b..9696748106 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.1.1 -PKG_BUGFIX:=g +PKG_BUGFIX:=h PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) PKG_RELEASE:=1 PKG_USE_MIPS16:=0 @@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ http://www.openssl.org/source/ \ http://www.openssl.org/source/old/$(PKG_BASE)/ -PKG_HASH:=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46 +PKG_HASH:=5c9ca8774bd7b03e5784f26ae9e9e6d749c9da2438545077e6b3d755a06595d9 PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE diff --git a/package/libs/openssl/patches/100-Configure-afalg-support.patch b/package/libs/openssl/patches/100-Configure-afalg-support.patch index 0f91a9d5da..98944103b5 100644 --- a/package/libs/openssl/patches/100-Configure-afalg-support.patch +++ b/package/libs/openssl/patches/100-Configure-afalg-support.patch @@ -12,7 +12,7 @@ diff --git a/Configure b/Configure index 5a699836f3..74d057c219 100755 --- a/Configure +++ b/Configure -@@ -1532,7 +1532,9 @@ unless ($disabled{"crypto-mdebug-backtrace"}) +@@ -1545,7 +1545,9 @@ unless ($disabled{"crypto-mdebug-backtrace"}) unless ($disabled{afalgeng}) { $config{afalgeng}=""; diff --git a/package/libs/openssl/patches/130-dont-build-tests-fuzz.patch b/package/libs/openssl/patches/130-dont-build-tests-fuzz.patch index fa79cc6022..7f33cb9dae 100644 --- a/package/libs/openssl/patches/130-dont-build-tests-fuzz.patch +++ b/package/libs/openssl/patches/130-dont-build-tests-fuzz.patch @@ -11,7 +11,7 @@ diff --git a/Configure b/Configure index 74d057c219..5813e9f8fe 100755 --- a/Configure +++ b/Configure -@@ -296,7 +296,7 @@ my $auto_threads=1; # enable threads automatically? true by default +@@ -318,7 +318,7 @@ my $auto_threads=1; # enable threads automatically? true by default my $default_ranlib; # Top level directories to build @@ -20,7 +20,7 @@ index 74d057c219..5813e9f8fe 100755 # crypto/ subdirectories to build $config{sdirs} = [ "objects", -@@ -308,7 +308,7 @@ $config{sdirs} = [ +@@ -330,7 +330,7 @@ $config{sdirs} = [ "cms", "ts", "srp", "cmac", "ct", "async", "kdf", "store" ]; # test/ subdirectories to build From a735eabc32d4e7e419c0f052ceb3b0529516595b Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 26 Sep 2020 22:14:32 +0200 Subject: [PATCH 02/11] ath79: add WiFi migration for AR913x This adds the automatic WiFi path migration for AR913x platforms. Tested on: TP-Link TL-WA901ND v2 Signed-off-by: David Bauer --- .../base-files/etc/hotplug.d/ieee80211/00-wifi-migration | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration index b0a5d79f9d..d2df0533fe 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration +++ b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration @@ -34,6 +34,10 @@ migrate_wifi_path() { path="platform/ahb/18100000.wmac" WIFI_PATH_CHANGED=1 ;; + "platform/ath9k") + path="platform/ahb/180c0000.wmac" + WIFI_PATH_CHANGED=1 + ;; *) return 0 ;; From 283cdb30ab70e01ddeae3bb74a4c719bc460d3e9 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 26 Sep 2020 13:30:16 -0400 Subject: [PATCH 03/11] kernel: bump 5.4 to 5.4.68 All modifications made by update_kernel.sh Build system: x86_64 Build-tested: ipq806x, ath79/generic, bcm72xx/bcm2711 Run-tested: ipq806x (R7800) No dmesg regressions, everything functional Signed-off-by: John Audia --- include/kernel-version.mk | 4 ++-- .../737-v5.5-net-phy-add-core-phylib-sfp-support.patch | 2 +- ...net-phy-add-support-for-clause-37-auto-negotiation.patch | 6 +++--- .../generic/hack-5.4/702-phy_add_aneg_done_function.patch | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index b23f36e289..b251526c7d 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL endif LINUX_VERSION-4.19 = .138 -LINUX_VERSION-5.4 = .67 +LINUX_VERSION-5.4 = .68 LINUX_KERNEL_HASH-4.19.138 = d15c27d05f6c527269b75b30cc72972748e55720e7e00ad8abbaa4fe3b1d5e02 -LINUX_KERNEL_HASH-5.4.67 = c175bd9c5d54c7120365d51cf235102e14d5a9a1baddd6296819839240dccaa4 +LINUX_KERNEL_HASH-5.4.68 = 0e93876c5ae8dc0c55cbe631971a46ab02b90cf7461fed3085703a5e4e3cd6dd remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch b/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch index 6ee99b4791..ecb70a9904 100644 --- a/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch +++ b/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch @@ -130,7 +130,7 @@ Signed-off-by: Russell King /* Some Ethernet drivers try to connect to a PHY device before * calling register_netdevice() -> netdev_register_kobject() and * does the dev->dev.kobj initialization. Here we only check for -@@ -2289,6 +2352,9 @@ static int phy_remove(struct device *dev +@@ -2290,6 +2353,9 @@ static int phy_remove(struct device *dev phydev->state = PHY_DOWN; mutex_unlock(&phydev->lock); diff --git a/target/linux/generic/backport-5.4/750-v5.5-net-phy-add-support-for-clause-37-auto-negotiation.patch b/target/linux/generic/backport-5.4/750-v5.5-net-phy-add-support-for-clause-37-auto-negotiation.patch index f03cd2a984..bb26986c79 100644 --- a/target/linux/generic/backport-5.4/750-v5.5-net-phy-add-support-for-clause-37-auto-negotiation.patch +++ b/target/linux/generic/backport-5.4/750-v5.5-net-phy-add-support-for-clause-37-auto-negotiation.patch @@ -20,7 +20,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1681,6 +1681,40 @@ static int genphy_config_advert(struct p +@@ -1682,6 +1682,40 @@ static int genphy_config_advert(struct p } /** @@ -61,7 +61,7 @@ Signed-off-by: David S. Miller * genphy_config_eee_advert - disable unwanted eee mode advertisement * @phydev: target phy_device struct * -@@ -1789,6 +1823,54 @@ int __genphy_config_aneg(struct phy_devi +@@ -1790,6 +1824,54 @@ int __genphy_config_aneg(struct phy_devi EXPORT_SYMBOL(__genphy_config_aneg); /** @@ -116,7 +116,7 @@ Signed-off-by: David S. Miller * genphy_aneg_done - return auto-negotiation status * @phydev: target phy_device struct * -@@ -1960,6 +2042,63 @@ int genphy_read_status(struct phy_device +@@ -1961,6 +2043,63 @@ int genphy_read_status(struct phy_device EXPORT_SYMBOL(genphy_read_status); /** diff --git a/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch index 4201dfe7fc..0e292f5b6f 100644 --- a/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch @@ -15,7 +15,7 @@ --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1911,6 +1911,9 @@ int genphy_update_link(struct phy_device +@@ -1912,6 +1912,9 @@ int genphy_update_link(struct phy_device if (bmcr & BMCR_ANRESTART) goto done; From f29c7a1f3013341828f63e55ccfa579c38b6106a Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 27 Sep 2020 10:11:11 +0200 Subject: [PATCH 04/11] ath10k-firmware: package Wave1 from linux-firmware The firmware for Wave1 chips was updated to the latest release 10.2.4-1.0-00047 at the end of 2019 (commit 513d70cc50b). Package firmware for these chips from linux-firmware. This avoids downloading the ath10k-firmware repository. Signed-off-by: David Bauer --- package/firmware/ath10k-firmware/Makefile | 4 ++-- package/firmware/linux-firmware/qca_ath10k.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index c427f08842..52c974e9f8 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -173,9 +173,9 @@ define Package/ath10k-firmware-qca9984/install $(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin endef -$(eval $(call BuildPackage,ath10k-firmware-qca9887)) +#$(eval $(call BuildPackage,ath10k-firmware-qca9887)) #$(eval $(call BuildPackage,ath10k-firmware-qca9888)) -$(eval $(call BuildPackage,ath10k-firmware-qca988x)) +#$(eval $(call BuildPackage,ath10k-firmware-qca988x)) #$(eval $(call BuildPackage,ath10k-firmware-qca99x0)) #$(eval $(call BuildPackage,ath10k-firmware-qca6174)) #$(eval $(call BuildPackage,ath10k-firmware-qca9984)) diff --git a/package/firmware/linux-firmware/qca_ath10k.mk b/package/firmware/linux-firmware/qca_ath10k.mk index 72735819fd..a7c5b13b84 100644 --- a/package/firmware/linux-firmware/qca_ath10k.mk +++ b/package/firmware/linux-firmware/qca_ath10k.mk @@ -31,7 +31,7 @@ define Package/ath10k-firmware-qca9887/install $(PKG_BUILD_DIR)/ath10k/QCA9887/hw1.0/board.bin \ $(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin endef -# $(eval $(call BuildPackage,ath10k-firmware-qca9887)) +$(eval $(call BuildPackage,ath10k-firmware-qca9887)) Package/ath10k-firmware-qca9888 = $(call Package/firmware-default,ath10k qca9888 firmware) define Package/ath10k-firmware-qca9888/install @@ -55,7 +55,7 @@ define Package/ath10k-firmware-qca988x/install $(PKG_BUILD_DIR)/ath10k/QCA988X/hw2.0/firmware-5.bin \ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin endef -# $(eval $(call BuildPackage,ath10k-firmware-qca988x)) +$(eval $(call BuildPackage,ath10k-firmware-qca988x)) Package/ath10k-firmware-qca6174 = $(call Package/firmware-default,ath10k qca6174 firmware) define Package/ath10k-firmware-qca6174/install From 8b4233188dae1415a019b4d5323ebba2075ebcfb Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 13 Sep 2020 06:45:52 +0200 Subject: [PATCH 05/11] rockchip: refresh NanoPi R2S patches Update the patches for the NanoPi R2S to the v3 sent (and accepted) upstream. Signed-off-by: David Bauer --- ...Add-support-for-FriendlyARM-NanoPi-R.patch | 276 ++++++++++-------- ...-rockchip-use-system-LED-for-OpenWrt.patch | 29 +- ...ckchip-enable-LAN-port-on-NanoPi-R2S.patch | 14 +- ...dd-OF-node-for-USB-eth-on-NanoPi-R2S.patch | 2 +- 4 files changed, 173 insertions(+), 148 deletions(-) diff --git a/target/linux/rockchip/patches-5.4/001-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch b/target/linux/rockchip/patches-5.4/001-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch index 904a2f31b6..69ee8a7c3a 100644 --- a/target/linux/rockchip/patches-5.4/001-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch +++ b/target/linux/rockchip/patches-5.4/001-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch @@ -1,4 +1,4 @@ -From 749cbb7b1a4bc2244b6af8cd7d8b471d4e33c80f Mon Sep 17 00:00:00 2001 +From 0720be5371c806c1b89936984a321248fa739bea Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 10 Jul 2020 15:57:46 +0200 Subject: [PATCH] rockchip: rk3328: Add support for FriendlyARM NanoPi R2S @@ -17,8 +17,8 @@ WAN - LAN - SYS LED Signed-off-by: David Bauer --- arch/arm64/boot/dts/rockchip/Makefile | 1 + - .../boot/dts/rockchip/rk3328-nanopi-r2s.dts | 334 ++++++++++++++++++ - 2 files changed, 335 insertions(+) + .../boot/dts/rockchip/rk3328-nanopi-r2s.dts | 368 ++++++++++++++++++ + 2 files changed, 369 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts --- a/arch/arm64/boot/dts/rockchip/Makefile @@ -33,7 +33,7 @@ Signed-off-by: David Bauer dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-evb-act8846.dtb --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -0,0 +1,334 @@ +@@ -0,0 +1,368 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2020 David Bauer @@ -46,92 +46,91 @@ Signed-off-by: David Bauer +#include "rk3328.dtsi" + +/ { -+ model = "FriendlyARM NanoPi R2S"; ++ model = "FriendlyElec NanoPi R2S"; + compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328"; + + chosen { + stdout-path = "serial2:1500000n8"; + }; + -+ gmac_clkin: external-gmac-clock { ++ gmac_clk: gmac-clock { + compatible = "fixed-clock"; + clock-frequency = <125000000>; -+ clock-output-names = "gmac_clkin"; ++ clock-output-names = "gmac_clk"; + #clock-cells = <0>; + }; + -+ vcc_sd: sdmmc-regulator { -+ compatible = "regulator-fixed"; -+ gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>; ++ keys { ++ compatible = "gpio-keys"; ++ pinctrl-0 = <&reset_button_pin>; + pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc0m1_gpio>; -+ regulator-name = "vcc_sd"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc_io>; -+ }; + -+ vcc_sdio: sdmmcio-regulator { -+ compatible = "regulator-gpio"; -+ gpios = <&gpio1 RK_PD4 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ states = <1800000 0x1 -+ 3300000 0x0>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdio_vcc_pin>; -+ regulator-always-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc_sdio"; -+ regulator-settling-time-us = <5000>; -+ regulator-type = "voltage"; -+ vin-supply = <&vcc_io>; -+ }; -+ -+ vcc_sys: vcc-sys { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; ++ reset { ++ label = "reset"; ++ gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ debounce-interval = <50>; ++ }; + }; + + leds { + compatible = "gpio-leds"; -+ ++ pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>; + pinctrl-names = "default"; -+ pinctrl-0 = <&led_pins>; + -+ sys { -+ gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; -+ label = "nanopi-r2s:red:sys"; -+ }; -+ -+ lan { ++ lan_led: led-0 { + gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; + label = "nanopi-r2s:green:lan"; + }; + -+ wan { ++ sys_led: led-1 { ++ gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; ++ label = "nanopi-r2s:red:sys"; ++ }; ++ ++ wan_led: led-2 { + gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>; + label = "nanopi-r2s:green:wan"; + }; + }; + -+ gpio_keys { -+ compatible = "gpio-keys-polled"; -+ poll-interval = <100>; -+ ++ vcc_io_sdio: sdmmcio-regulator { ++ compatible = "regulator-gpio"; ++ enable-active-high; ++ gpios = <&gpio1 RK_PD4 GPIO_ACTIVE_HIGH>; ++ pinctrl-0 = <&sdio_vcc_pin>; + pinctrl-names = "default"; -+ pinctrl-0 = <&button_pins>; ++ regulator-name = "vcc_io_sdio"; ++ regulator-always-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-settling-time-us = <5000>; ++ regulator-type = "voltage"; ++ startup-delay-us = <2000>; ++ states = <1800000 0x1 ++ 3300000 0x0>; ++ vin-supply = <&vcc_io_33>; ++ }; + -+ reset { -+ label = "Reset Button"; -+ gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>; -+ linux,code = ; -+ debounce-interval = <50>; -+ }; ++ vcc_sd: sdmmc-regulator { ++ compatible = "regulator-fixed"; ++ gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>; ++ pinctrl-0 = <&sdmmc0m1_gpio>; ++ pinctrl-names = "default"; ++ regulator-name = "vcc_sd"; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vcc_io_33>; ++ }; ++ ++ vdd_5v: vdd-5v { ++ compatible = "regulator-fixed"; ++ regulator-name = "vdd_5v"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; + }; +}; + @@ -153,19 +152,16 @@ Signed-off-by: David Bauer + +&gmac2io { + assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>; -+ assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>; ++ assigned-clock-parents = <&gmac_clk>, <&gmac_clk>; + clock_in_out = "input"; -+ phy-supply = <&vcc_io>; + phy-handle = <&rtl8211e>; + phy-mode = "rgmii"; -+ pinctrl-names = "default"; ++ phy-supply = <&vcc_io_33>; + pinctrl-0 = <&rgmiim1_pins>; -+ snps,aal; -+ snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; -+ snps,reset-active-low; -+ snps,reset-delays-us = <0 10000 50000>; -+ tx_delay = <0x24>; ++ pinctrl-names = "default"; + rx_delay = <0x18>; ++ snps,aal; ++ tx_delay = <0x24>; + status = "okay"; + + mdio { @@ -173,8 +169,13 @@ Signed-off-by: David Bauer + #address-cells = <1>; + #size-cells = <0>; + -+ rtl8211e: ethernet-phy@0 { -+ reg = <0>; ++ rtl8211e: ethernet-phy@1 { ++ reg = <1>; ++ pinctrl-0 = <ð_phy_reset_pin>; ++ pinctrl-names = "default"; ++ reset-assert-us = <10000>; ++ reset-deassert-us = <50000>; ++ reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; + }; + }; +}; @@ -182,35 +183,36 @@ Signed-off-by: David Bauer +&i2c1 { + status = "okay"; + -+ rk805: rk805@18 { ++ rk805: pmic@18 { + compatible = "rockchip,rk805"; + reg = <0x18>; -+ interrupt-parent = <&gpio2>; -+ interrupts = <6 IRQ_TYPE_LEVEL_LOW>; ++ interrupt-parent = <&gpio1>; ++ interrupts = <24 IRQ_TYPE_LEVEL_LOW>; + #clock-cells = <1>; + clock-output-names = "xin32k", "rk805-clkout2"; + gpio-controller; + #gpio-cells = <2>; -+ pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; ++ pinctrl-names = "default"; + rockchip,system-power-controller; + wakeup-source; + -+ vcc1-supply = <&vcc_sys>; -+ vcc2-supply = <&vcc_sys>; -+ vcc3-supply = <&vcc_sys>; -+ vcc4-supply = <&vcc_sys>; -+ vcc5-supply = <&vcc_io>; -+ vcc6-supply = <&vcc_sys>; ++ vcc1-supply = <&vdd_5v>; ++ vcc2-supply = <&vdd_5v>; ++ vcc3-supply = <&vdd_5v>; ++ vcc4-supply = <&vdd_5v>; ++ vcc5-supply = <&vcc_io_33>; ++ vcc6-supply = <&vdd_5v>; + + regulators { -+ vdd_logic: DCDC_REG1 { -+ regulator-name = "vdd_logic"; ++ vdd_log: DCDC_REG1 { ++ regulator-name = "vdd_log"; ++ regulator-always-on; ++ regulator-boot-on; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1450000>; + regulator-ramp-delay = <12500>; -+ regulator-always-on; -+ regulator-boot-on; ++ + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1000000>; @@ -219,11 +221,12 @@ Signed-off-by: David Bauer + + vdd_arm: DCDC_REG2 { + regulator-name = "vdd_arm"; ++ regulator-always-on; ++ regulator-boot-on; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1450000>; + regulator-ramp-delay = <12500>; -+ regulator-always-on; -+ regulator-boot-on; ++ + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <950000>; @@ -234,17 +237,19 @@ Signed-off-by: David Bauer + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; ++ + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + -+ vcc_io: DCDC_REG4 { -+ regulator-name = "vcc_io"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; ++ vcc_io_33: DCDC_REG4 { ++ regulator-name = "vcc_io_33"; + 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>; @@ -253,10 +258,11 @@ Signed-off-by: David Bauer + + vcc_18: LDO_REG1 { + regulator-name = "vcc_18"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; + 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>; @@ -265,10 +271,11 @@ Signed-off-by: David Bauer + + vcc18_emmc: LDO_REG2 { + regulator-name = "vcc18_emmc"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; + 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>; @@ -277,10 +284,11 @@ Signed-off-by: David Bauer + + vdd_10: LDO_REG3 { + regulator-name = "vdd_10"; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1000000>; + regulator-always-on; + regulator-boot-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1000000>; ++ + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1000000>; @@ -291,35 +299,46 @@ Signed-off-by: David Bauer +}; + +&io_domains { -+ status = "okay"; -+ -+ vccio1-supply = <&vcc_io>; ++ pmuio-supply = <&vcc_io_33>; ++ vccio1-supply = <&vcc_io_33>; + vccio2-supply = <&vcc18_emmc>; -+ vccio3-supply = <&vcc_sdio>; ++ vccio3-supply = <&vcc_io_sdio>; + vccio4-supply = <&vcc_18>; -+ vccio5-supply = <&vcc_io>; -+ vccio6-supply = <&vcc_io>; -+ pmuio-supply = <&vcc_io>; ++ vccio5-supply = <&vcc_io_33>; ++ vccio6-supply = <&vcc_io_33>; ++ status = "okay"; +}; + +&pinctrl { -+ leds { -+ led_pins: led-pins { -+ rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>, -+ <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>, -+ <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; ++ button { ++ reset_button_pin: reset-button-pin { ++ rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + -+ button { -+ button_pins: button-pins { -+ rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; ++ ethernet-phy { ++ eth_phy_reset_pin: eth-phy-reset-pin { ++ rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ leds { ++ lan_led_pin: lan-led-pin { ++ rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ sys_led_pin: sys-led-pin { ++ rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ wan_led_pin: wan-led-pin { ++ rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + pmic { + pmic_int_l: pmic-int-l { -+ rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>; ++ rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + @@ -330,16 +349,22 @@ Signed-off-by: David Bauer + }; +}; + ++&pwm2 { ++ status = "okay"; ++}; ++ +&sdmmc { + bus-width = <4>; -+ cap-mmc-highspeed; + cap-sd-highspeed; + disable-wp; -+ max-frequency = <150000000>; ++ pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>; + pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>; ++ sd-uhs-sdr12; ++ sd-uhs-sdr25; ++ sd-uhs-sdr50; ++ sd-uhs-sdr104; + vmmc-supply = <&vcc_sd>; -+ vqmmc-supply = <&vcc_sdio>; ++ vqmmc-supply = <&vcc_io_sdio>; + status = "okay"; +}; + @@ -349,16 +374,25 @@ Signed-off-by: David Bauer + status = "okay"; +}; + ++&u2phy { ++ status = "okay"; ++}; ++ ++&u2phy_host { ++ status = "okay"; ++}; ++ ++&u2phy_otg { ++ status = "okay"; ++}; ++ +&uart2 { + status = "okay"; +}; + -+&u2phy { ++&usb20_otg { + status = "okay"; -+ -+ u2phy_host: host-port { -+ status = "okay"; -+ }; ++ dr_mode = "host"; +}; + +&usb_host0_ehci { diff --git a/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch b/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch index 1250dbcd9b..7f9af85b1d 100644 --- a/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch +++ b/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch @@ -15,26 +15,17 @@ Signed-off-by: David Bauer --- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -17,6 +17,13 @@ - stdout-path = "serial2:1500000n8"; - }; +@@ -13,6 +13,13 @@ + model = "FriendlyElec NanoPi R2S"; + compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328"; + aliases { -+ led-boot = &led_sys; -+ led-failsafe = &led_sys; -+ led-running = &led_sys; -+ led-upgrade = &led_sys; ++ led-boot = &sys_led; ++ led-failsafe = &sys_led; ++ led-running = &sys_led; ++ led-upgrade = &sys_led; + }; + - gmac_clkin: external-gmac-clock { - compatible = "fixed-clock"; - clock-frequency = <125000000>; -@@ -67,7 +74,7 @@ - pinctrl-names = "default"; - pinctrl-0 = <&led_pins>; - -- sys { -+ led_sys: sys { - gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; - label = "nanopi-r2s:red:sys"; - }; + chosen { + stdout-path = "serial2:1500000n8"; + }; diff --git a/target/linux/rockchip/patches-5.4/102-rockchip-enable-LAN-port-on-NanoPi-R2S.patch b/target/linux/rockchip/patches-5.4/102-rockchip-enable-LAN-port-on-NanoPi-R2S.patch index e2aa2d67e6..20d18597db 100644 --- a/target/linux/rockchip/patches-5.4/102-rockchip-enable-LAN-port-on-NanoPi-R2S.patch +++ b/target/linux/rockchip/patches-5.4/102-rockchip-enable-LAN-port-on-NanoPi-R2S.patch @@ -13,8 +13,8 @@ Signed-off-by: David Bauer --- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -68,6 +68,18 @@ - regulator-max-microvolt = <5000000>; +@@ -44,6 +44,18 @@ + }; }; + vcc_rtl8153: vcc-rtl8153-regulator { @@ -31,9 +31,9 @@ Signed-off-by: David Bauer + leds { compatible = "gpio-leds"; - -@@ -299,6 +311,12 @@ - rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>; + pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>; +@@ -267,6 +279,12 @@ + }; }; }; + @@ -44,8 +44,8 @@ Signed-off-by: David Bauer + }; }; - &sdmmc { -@@ -339,3 +357,12 @@ + &io_domains { +@@ -373,3 +391,12 @@ &usb_host0_ohci { status = "okay"; }; diff --git a/target/linux/rockchip/patches-5.4/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch b/target/linux/rockchip/patches-5.4/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch index 3b97ecde9e..473c265016 100644 --- a/target/linux/rockchip/patches-5.4/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch +++ b/target/linux/rockchip/patches-5.4/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch @@ -14,7 +14,7 @@ Signed-off-by: David Bauer --- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -365,4 +365,11 @@ +@@ -399,4 +399,11 @@ &usbdrd_dwc3 { dr_mode = "host"; status = "okay"; From fc20c75a6c360b97a62228246f2545532abe89a2 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 28 Sep 2020 23:40:27 +0100 Subject: [PATCH 06/11] toolchain: nasm: update to 2.15.05 Compile-tested libx264 and ffmpeg with x86-asm, worked fine. Signed-off-by: Daniel Golle --- toolchain/nasm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/nasm/Makefile b/toolchain/nasm/Makefile index 3efcc86203..f733c52912 100644 --- a/toolchain/nasm/Makefile +++ b/toolchain/nasm/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nasm -PKG_VERSION:=2.14 +PKG_VERSION:=2.15.05 PKG_SOURCE_URL:=https://www.nasm.us/pub/nasm/releasebuilds/$(PKG_VERSION)/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=97c615dbf02ef80e4e2b6c385f7e28368d51efc214daa98e600ca4572500eec0 +PKG_HASH:=3caf6729c1073bf96629b57cee31eeb54f4f8129b01902c73428836550b30a3f HOST_BUILD_PARALLEL:=1 From 29fd93da1455910d961c0a0e2d081c3620eec4a3 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 27 Sep 2020 11:50:40 -1000 Subject: [PATCH 07/11] imagebuilder: add missing libfakeroot files The `libfakeroot` files are currently missing in the ImageBuilder. As `fakeroot` is always built, copy those files unconditionally. Signed-off-by: Paul Spooren --- target/imagebuilder/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile index ad19ab2b53..fb6c26b482 100644 --- a/target/imagebuilder/Makefile +++ b/target/imagebuilder/Makefile @@ -85,6 +85,7 @@ endif $(CP) $(STAGING_DIR_HOST)/bin/* $(PKG_BUILD_DIR)/staging_dir/host/bin/ (cd $(PKG_BUILD_DIR); find staging_dir/host/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \ $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host) + $(CP) $(TOPDIR)/staging_dir/host/lib/libfakeroot* $(PKG_BUILD_DIR)/staging_dir/host/lib STRIP=sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/ (cd $(BUILD_DIR); \ tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(IB_NAME) \ From 96d1dc5ebfbbf68f960610407a83423915e5e966 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 27 Sep 2020 22:37:53 -1000 Subject: [PATCH 08/11] policycoreutils: install to host/bin not hostpkg By installing policycoreutils to host/bin it is also available within the ImageBuilder and SDK, allowing to correctly label both filesystems and packages. Signed-off-by: Paul Spooren --- include/image.mk | 2 +- package/utils/policycoreutils/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/image.mk b/include/image.mk index da3d500e81..f72095db56 100644 --- a/include/image.mk +++ b/include/image.mk @@ -243,7 +243,7 @@ endef ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y) define Image/mkfs/squashfs - echo "$(STAGING_DIR_HOSTPKG)/bin/setfiles -r" \ + echo "$(STAGING_DIR_HOST)/bin/setfiles -r" \ "$(call mkfs_target_dir,$(1))" \ "$(call mkfs_target_dir,$(1))/etc/selinux/targeted/contexts/files/file_contexts " \ "$(call mkfs_target_dir,$(1))" > $@.fakeroot-script diff --git a/package/utils/policycoreutils/Makefile b/package/utils/policycoreutils/Makefile index 6b7b78ed78..a237542be6 100644 --- a/package/utils/policycoreutils/Makefile +++ b/package/utils/policycoreutils/Makefile @@ -67,7 +67,7 @@ MAKE_FLAGS += \ HOST_MAKE_FLAGS += \ PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM) \ - DESTDIR=$(STAGING_DIR_HOSTPKG) \ + DESTDIR=$(STAGING_DIR_HOST) \ PREFIX= \ SBINDIR=/bin From 26aa7952d539f85dd60e36a5fcc37925a9b92d65 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 29 Sep 2020 01:46:25 +0100 Subject: [PATCH 09/11] image.mk: evaluate /etc/selinux/config to choose SELinux policy Instead of hardcoding 'targeted' policy, evaluate /etc/selinux/config in rootfs to choose according to which policy files in the rootfs got to be labeled. Signed-off-by: Daniel Golle --- include/image.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/image.mk b/include/image.mk index f72095db56..28f40fe6a9 100644 --- a/include/image.mk +++ b/include/image.mk @@ -243,10 +243,11 @@ endef ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y) define Image/mkfs/squashfs + echo ". $(call mkfs_target_dir,$(1))/etc/selinux/config" > $@.fakeroot-script echo "$(STAGING_DIR_HOST)/bin/setfiles -r" \ "$(call mkfs_target_dir,$(1))" \ - "$(call mkfs_target_dir,$(1))/etc/selinux/targeted/contexts/files/file_contexts " \ - "$(call mkfs_target_dir,$(1))" > $@.fakeroot-script + "$(call mkfs_target_dir,$(1))/etc/selinux/\$${SELINUXTYPE}/contexts/files/file_contexts " \ + "$(call mkfs_target_dir,$(1))" >> $@.fakeroot-script echo "$(Image/mkfs/squashfs-common)" >> $@.fakeroot-script chmod +x $@.fakeroot-script $(FAKEROOT) "$@.fakeroot-script" From 1a22964399cc33a32564c82eaf6cb494cacf5b99 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 29 Sep 2020 02:47:25 +0100 Subject: [PATCH 10/11] config: prepare for choice of SELinux policy Only 'targeted' from refpolicy is supported for now. Signed-off-by: Daniel Golle --- config/Config-build.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/Config-build.in b/config/Config-build.in index fc94f4d45e..2242470079 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -335,7 +335,18 @@ menu "Global build settings" select KERNEL_F2FS_FS_SECURITY select KERNEL_UBIFS_FS_SECURITY select KERNEL_JFFS2_FS_SECURITY - select PACKAGE_refpolicy help This option enables the usage of SELinux labels + + choice + prompt "default SELinux type" + depends on TARGET_ROOTFS_SECURITY_LABELS + default SELINUXTYPE_targeted + help + Choose SELinux policy to be used for build. + config SELINUXTYPE_targeted + bool "targeted" + select PACKAGE_refpolicy + endchoice + endmenu From 3fab4ace570740a90f96c55c2c6ce85c48bc0bdc Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 29 Sep 2020 04:02:03 +0100 Subject: [PATCH 11/11] refpolicy: mark as architecture independent Use PKGARCH:=all to declare this package to be free of any architecture dependent code. Signed-off-by: Daniel Golle --- package/system/refpolicy/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/system/refpolicy/Makefile b/package/system/refpolicy/Makefile index c5a8a5cc32..a80b4d043c 100644 --- a/package/system/refpolicy/Makefile +++ b/package/system/refpolicy/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=refpolicy PKG_VERSION:=2.20200229 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_2_20200229 @@ -29,6 +29,7 @@ define Package/refpolicy CATEGORY:=Base system TITLE:=SELinux reference policy URL:=http://selinuxproject.org/page/Main_Page + PKGARCH:=all endef define Package/refpolicy/description