From c5dea7cecc82581baade7e292b930cc8ac45b9bf Mon Sep 17 00:00:00 2001 From: anaelorlinski Date: Wed, 28 Jun 2023 17:32:45 +0200 Subject: [PATCH] remove 21.02 / add 23.05 --- .github/workflows/NanoPi-Build.yml | 5 +- README.md | 8 +- .../patches/0002-kernel-crypto.addon | 23 - .../package/kernel/linux/modules/video.mk | 1079 ---------- .../target/linux/rockchip/Makefile | 23 - .../armv8/base-files/etc/board.d/01_leds | 26 - .../armv8/base-files/etc/board.d/02_network | 64 - .../etc/hotplug.d/net/40-net-smp-affinity | 42 - .../base-files/lib/preinit/79_move_config | 16 - .../armv8/base-files/lib/upgrade/platform.sh | 86 - .../target/linux/rockchip/armv8/config-5.4 | 519 ----- .../target/linux/rockchip/armv8/target.mk | 8 - .../target/linux/rockchip/config-default | 303 --- .../rockchip/rk3328-dram-default-timing.dtsi | 311 --- .../drivers/char/hw_random/rockchip-rng.c | 310 --- .../files/drivers/devfreq/rk3328_dmc.c | 846 -------- .../include/dt-bindings/clock/rockchip-ddr.h | 63 - .../include/dt-bindings/memory/rk3328-dram.h | 159 -- .../target/linux/rockchip/image/Makefile | 78 - .../target/linux/rockchip/image/armv8.mk | 64 - .../linux/rockchip/image/mmc.bootscript | 8 - .../rockchip/image/nanopi-r2s.bootscript | 8 - .../rockchip/image/nanopi-r4s.bootscript | 8 - .../target/linux/rockchip/modules.mk | 63 - ...Add-support-for-FriendlyARM-NanoPi-R.patch | 404 ---- ...-r8152-add-LED-configuration-from-OF.patch | 74 - ...et-add-RTL8152-binding-documentation.patch | 54 - ...hip-Add-txpbl-node-for-RK3399-RK3328.patch | 54 - ...k3328-fix-NanoPi-R2S-GMAC-clock-name.patch | 27 - ...4-dts-rockchip-Add-RK3328-idle-state.patch | 69 - ...-add-hwmon-support-for-SoCs-and-GPUs.patch | 53 - ...Add-support-for-FriendlyARM-NanoPi-R.patch | 177 -- ...kchip-add-EEPROM-node-for-NanoPi-R4S.patch | 40 - ...usb3-controller-node-for-RK3328-SoCs.patch | 62 - ...ckchip-enable-LAN-port-on-NanoPi-R2S.patch | 60 - ...dd-OF-node-for-USB-eth-on-NanoPi-R2S.patch | 28 - ...-host-by-default-on-rk3399-rock-pi-4.patch | 32 - ...-initial-signal-voltage-on-power-off.patch | 35 - ...d-OF-node-for-pcie-eth-on-NanoPi-R4S.patch | 22 - ...8-add-i2c0-controller-for-nanopi-r2s.patch | 22 - ...328-Add-support-for-OrangePi-R1-Plus.patch | 52 - ...Add-support-for-FriendlyARM-NanoPi-R.patch | 60 - ...Add-driver-for-Motorcomm-YT85xx-PHYs.patch | 457 ---- ...-for-rockchip-hardware-random-number.patch | 45 - ...ip-add-hardware-random-number-genera.patch | 50 - ...ip-add-devfreq-driver-for-rk3328-dmc.patch | 48 - ...setting-ddr-clock-via-SIP-Version-2-.patch | 218 -- ...eq-rockchip-dfi-add-more-soc-support.patch | 665 ------ ...m64-dts-rockchip-rk3328-add-dfi-node.patch | 27 - ...anopi-r2s-add-rk3328-dmc-relate-node.patch | 126 -- ...adjust-default-coherent_pool-to-2MiB.patch | 20 - ...ip-add-more-cpu-operating-points-for.patch | 44 - ...chip-rk3399-overclock-to-2.2-1.8-GHz.patch | 46 - .../kernel-5.4/001-r8152-v1-11-11.patch | 1876 ----------------- .../kernel-5.4/995-watchdog-rk3328.patch | 47 - .../kernel-5.4/996-watchdog-rk3399.patch | 30 - .../add-rk3328-usb3-phy-driver-full.patch | 1205 ----------- .../add-rk3328-usb3-phy-driver.patch | 92 - .../node/010-execvp-arg-list-too-long.patch | 208 -- .../luci-app-vpn-policy-routing/Makefile | 17 - .../luasrc/controller/vpn-policy-routing.lua | 33 - .../luasrc/model/cbi/vpn-policy-routing.lua | 376 ---- .../view/vpn-policy-routing/buttons.htm | 77 - .../luasrc/view/vpn-policy-routing/css.htm | 9 - .../luasrc/view/vpn-policy-routing/js.htm | 59 - .../vpn-policy-routing/status-gateways.htm | 18 - .../luasrc/view/vpn-policy-routing/status.htm | 12 - .../po/templates/vpn-policy-routing.pot | 430 ---- .../uci-defaults/40_luci-vpn-policy-routing | 4 - .../acl.d/luci-app-vpn-policy-routing.json | 36 - ...01-scripts-remove-dependency-on-swig.patch | 24 - ...-spl-remove-dtoc-of-pdata-generation.patch | 28 - ...rock64pro-disable-CONFIG_USE_PREBOOT.patch | 27 - ...anopi4-unify-1GB-4GB-variants-of-R4S.patch | 89 - .../of-platdata/nanopi-r2c-rk3328/dt-decl.h | 23 - .../of-platdata/nanopi-r2c-rk3328/dt-plat.c | 155 -- .../nanopi-r2c-rk3328/dt-structs-gen.h | 51 - .../of-platdata/nanopi-r2s-rk3328/dt-decl.h | 23 - .../of-platdata/nanopi-r2s-rk3328/dt-plat.c | 155 -- .../nanopi-r2s-rk3328/dt-structs-gen.h | 51 - .../package/vpn-policy-routing/Makefile | 71 - .../vpn-policy-routing/files/README.md | 3 - .../files/vpn-policy-routing.aws.user | 19 - .../files/vpn-policy-routing.config | 30 - .../files/vpn-policy-routing.firewall.hotplug | 6 - .../files/vpn-policy-routing.init | 1322 ------------ .../files/vpn-policy-routing.netflix.user | 37 - .../package/vpn-policy-routing/test.sh | 3 - openwrt-21.02/release-info.md | 18 - openwrt-21.02/steps/01_clone_openwrt.sh | 24 - openwrt-21.02/steps/03_patch_openwrt.sh | 129 -- openwrt-21.02/steps/07-all_kmods.sh | 14 - .../steps/old/01_clone_openwrt_master.sh | 24 - .../steps/old/02_prepare_openwrt_folder.sh | 12 - .../patches/package/adguardhome/Makefile | 4 +- .../patches/package/adguardhome/Makefile | 58 + .../adguardhome/files/adguardhome.config | 3 + .../adguardhome/files/adguardhome.init | 23 + ...and-GCM-with-ARMv8-Crypto-Extensions.patch | 76 +- .../patches/package}/r8168/Makefile | 28 +- ...-r8168-add-LED-configuration-from-OF.patch | 4 +- .../patches/package/uboot-rockchip/Makefile | 16 +- ...rt-Makefile-Only-build-dtc-if-needed.patch | 128 ++ .../patches/004-no-kwbimage.patch | 10 + .../patches/005-fix-mkimage-host-build.patch | 24 + ...Add-support-for-FriendlyARM-NanoPi-R.patch | 20 +- ...c-support-to-disable-HS-mode-for-SPL.patch | 26 + ...399-nanopi4-Add-u-boot-spl-broken-hs.patch | 19 + ...k3328-add-mmc-aliases-for-nanopi-r2s.patch | 29 + ...mc-Fixes-timeout-issue-for-FIFO-mode.patch | 31 + ...-Add-arch_addr_aligned-hook-for-rk33.patch | 78 + ...3399-r4s-disable-nodes-for-vopb-vopl.patch | 36 + ...FIG_SYS_MMC_ENV_DEV-1-for-nanopi-r4s.patch | 20 + ...328-Implement-arch_addr_aligned-hook.patch | 52 + ...dd-support-for-multiple-DDR-types-v2.patch | 63 +- ...9-split-nanopi-r4s-out-of-evb_rk3399.patch | 134 +- .../patches/snd-usb-caiaq.makefileaddon | 0 .../target/linux/rockchip/image/armv8.mk | 79 + ...add-compatible-to-NanoPi-R2S-etherne.patch | 2 +- ...-rockchip-use-system-LED-for-OpenWrt.patch | 50 +- ...3-arm64-rockchip-add-OF-node-for-eth.patch | 61 + openwrt-23.05/release-info.md | 22 + .../seed/ao-R4S-full.seed | 183 +- openwrt-23.05/seed/ao-R4S-full.seed.orig | 499 +++++ .../seed/ao-R4S-mini.seed | 160 +- openwrt-23.05/seed/ao-R4S-mini.seed.orig | 392 ++++ openwrt-23.05/steps/01_clone_openwrt.sh | 20 + .../steps/02_prepare_openwrt_folder.sh | 6 +- openwrt-23.05/steps/03_patch_openwrt.sh | 60 + .../steps/04-prepare_package.sh | 26 +- .../steps/05-create_luci_acl.sh | 2 +- .../steps/06-create_config_from_seed.sh | 2 +- openwrt-23.05/steps/07-all_kmods.sh | 44 + .../steps/create_acl_for_luci.sh | 0 .../steps/organize_files.sh | 1 + workflow-scripts/free_disk_space.sh | 4 +- 136 files changed, 2092 insertions(+), 14461 deletions(-) delete mode 100644 openwrt-21.02/patches/0002-kernel-crypto.addon delete mode 100644 openwrt-21.02/patches/immortalwrt/package/kernel/linux/modules/video.mk delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/Makefile delete mode 100755 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds delete mode 100755 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/board.d/02_network delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/lib/preinit/79_move_config delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/config-5.4 delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/target.mk delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/config-default delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3328-dram-default-timing.dtsi delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/drivers/char/hw_random/rockchip-rng.c delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/drivers/devfreq/rk3328_dmc.c delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/include/dt-bindings/clock/rockchip-ddr.h delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/include/dt-bindings/memory/rk3328-dram.h delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/Makefile delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/armv8.mk delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/mmc.bootscript delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/nanopi-r2s.bootscript delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/nanopi-r4s.bootscript delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/modules.mk delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/001-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/002-net-usb-r8152-add-LED-configuration-from-OF.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/003-dt-bindings-net-add-RTL8152-binding-documentation.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/006-rockchip-rk3328-fix-NanoPi-R2S-GMAC-clock-name.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/007-arm64-dts-rockchip-Add-RK3328-idle-state.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/008-rockchip-add-hwmon-support-for-SoCs-and-GPUs.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/009-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/010-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/101-dts-rockchip-add-usb3-controller-node-for-RK3328-SoCs.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/102-rockchip-enable-LAN-port-on-NanoPi-R2S.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/105-mmc-core-set-initial-signal-voltage-on-power-off.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/106-arm64-rockchip-add-OF-node-for-pcie-eth-on-NanoPi-R4S.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/201-rockchip-rk3328-add-i2c0-controller-for-nanopi-r2s.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/202-rockchip-rk3328-Add-support-for-OrangePi-R1-Plus.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/203-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/600-net-phy-Add-driver-for-Motorcomm-YT85xx-PHYs.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/801-char-add-support-for-rockchip-hardware-random-number.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/803-PM-devfreq-rockchip-add-devfreq-driver-for-rk3328-dmc.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/804-clk-rockchip-support-setting-ddr-clock-via-SIP-Version-2-.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/805-PM-devfreq-rockchip-dfi-add-more-soc-support.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/807-arm64-dts-nanopi-r2s-add-rk3328-dmc-relate-node.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/911-kernel-dma-adjust-default-coherent_pool-to-2MiB.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch delete mode 100644 openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/992-rockchip-rk3399-overclock-to-2.2-1.8-GHz.patch delete mode 100644 openwrt-21.02/patches/kernel-5.4/001-r8152-v1-11-11.patch delete mode 100644 openwrt-21.02/patches/kernel-5.4/995-watchdog-rk3328.patch delete mode 100644 openwrt-21.02/patches/kernel-5.4/996-watchdog-rk3399.patch delete mode 100644 openwrt-21.02/patches/kernel-5.4/add-rk3328-usb3-phy-driver-full.patch delete mode 100644 openwrt-21.02/patches/kernel-5.4/add-rk3328-usb3-phy-driver.patch delete mode 100644 openwrt-21.02/patches/node/010-execvp-arg-list-too-long.patch delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/Makefile delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/buttons.htm delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/css.htm delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/js.htm delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status-gateways.htm delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status.htm delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/po/templates/vpn-policy-routing.pot delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/root/etc/uci-defaults/40_luci-vpn-policy-routing delete mode 100644 openwrt-21.02/patches/package/luci-app-vpn-policy-routing/root/usr/share/rpcd/acl.d/luci-app-vpn-policy-routing.json delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/patches/001-scripts-remove-dependency-on-swig.patch delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/patches/002-spl-remove-dtoc-of-pdata-generation.patch delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/patches/204-board-nanopi4-unify-1GB-4GB-variants-of-R4S.patch delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-decl.h delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-plat.c delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-structs-gen.h delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-decl.h delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-plat.c delete mode 100644 openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-structs-gen.h delete mode 100644 openwrt-21.02/patches/package/vpn-policy-routing/Makefile delete mode 100644 openwrt-21.02/patches/package/vpn-policy-routing/files/README.md delete mode 100644 openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.aws.user delete mode 100644 openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.config delete mode 100755 openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.firewall.hotplug delete mode 100755 openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.init delete mode 100644 openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.netflix.user delete mode 100644 openwrt-21.02/patches/package/vpn-policy-routing/test.sh delete mode 100644 openwrt-21.02/release-info.md delete mode 100755 openwrt-21.02/steps/01_clone_openwrt.sh delete mode 100755 openwrt-21.02/steps/03_patch_openwrt.sh delete mode 100755 openwrt-21.02/steps/07-all_kmods.sh delete mode 100755 openwrt-21.02/steps/old/01_clone_openwrt_master.sh delete mode 100755 openwrt-21.02/steps/old/02_prepare_openwrt_folder.sh create mode 100644 openwrt-23.05/patches/package/adguardhome/Makefile create mode 100644 openwrt-23.05/patches/package/adguardhome/files/adguardhome.config create mode 100644 openwrt-23.05/patches/package/adguardhome/files/adguardhome.init rename {openwrt-21.02/patches/immortalwrt/package/libs => openwrt-23.05/patches/package}/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch (89%) rename {openwrt-21.02/patches/immortalwrt/package/kernel => openwrt-23.05/patches/package}/r8168/Makefile (58%) rename {openwrt-21.02/patches/immortalwrt/package/kernel => openwrt-23.05/patches/package}/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch (87%) rename {openwrt-21.02 => openwrt-23.05}/patches/package/uboot-rockchip/Makefile (82%) create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/003-Revert-Makefile-Only-build-dtc-if-needed.patch create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/004-no-kwbimage.patch create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/005-fix-mkimage-host-build.patch rename {openwrt-21.02 => openwrt-23.05}/patches/package/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch (87%) create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/301-rockchip-dw_mmc-support-to-disable-HS-mode-for-SPL.patch create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/302-arm64-dts-rk3399-nanopi4-Add-u-boot-spl-broken-hs.patch create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/303-rockchip-rk3328-add-mmc-aliases-for-nanopi-r2s.patch create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/304-mmc-dw_mmc-Fixes-timeout-issue-for-FIFO-mode.patch create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/305-common-bouncebuf-Add-arch_addr_aligned-hook-for-rk33.patch create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/306-arm64-rk3399-r4s-disable-nodes-for-vopb-vopl.patch create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/307-configs-Add-CONFIG_SYS_MMC_ENV_DEV-1-for-nanopi-r4s.patch create mode 100644 openwrt-23.05/patches/package/uboot-rockchip/patches/308-rockchip-rk3328-Implement-arch_addr_aligned-hook.patch rename openwrt-21.02/patches/package/uboot-rockchip/patches/203-ram-rk3399-Add-support-for-multiple-DDR-types.patch => openwrt-23.05/patches/package/uboot-rockchip/patches/309-ram-rk3399-Add-support-for-multiple-DDR-types-v2.patch (73%) rename openwrt-21.02/patches/package/uboot-rockchip/patches/202-rockchip-rk3399-split-nanopi-r4s-out-of-evb_rk3399.patch => openwrt-23.05/patches/package/uboot-rockchip/patches/310-rockchip-rk3399-split-nanopi-r4s-out-of-evb_rk3399.patch (84%) rename {openwrt-21.02 => openwrt-23.05}/patches/snd-usb-caiaq.makefileaddon (100%) create mode 100644 openwrt-23.05/patches/target/linux/rockchip/image/armv8.mk rename {openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4 => openwrt-23.05/patches/target/linux/rockchip/patches-5.15}/005-rockchip-rk3328-add-compatible-to-NanoPi-R2S-etherne.patch (97%) rename {openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4 => openwrt-23.05/patches/target/linux/rockchip/patches-5.15}/100-rockchip-use-system-LED-for-OpenWrt.patch (57%) create mode 100644 openwrt-23.05/patches/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-eth.patch create mode 100644 openwrt-23.05/release-info.md rename {openwrt-21.02 => openwrt-23.05}/seed/ao-R4S-full.seed (79%) create mode 100644 openwrt-23.05/seed/ao-R4S-full.seed.orig rename {openwrt-21.02 => openwrt-23.05}/seed/ao-R4S-mini.seed (77%) create mode 100644 openwrt-23.05/seed/ao-R4S-mini.seed.orig create mode 100755 openwrt-23.05/steps/01_clone_openwrt.sh rename {openwrt-21.02 => openwrt-23.05}/steps/02_prepare_openwrt_folder.sh (71%) create mode 100755 openwrt-23.05/steps/03_patch_openwrt.sh rename {openwrt-21.02 => openwrt-23.05}/steps/04-prepare_package.sh (57%) rename {openwrt-21.02 => openwrt-23.05}/steps/05-create_luci_acl.sh (74%) rename {openwrt-21.02 => openwrt-23.05}/steps/06-create_config_from_seed.sh (92%) create mode 100755 openwrt-23.05/steps/07-all_kmods.sh rename {openwrt-21.02 => openwrt-23.05}/steps/create_acl_for_luci.sh (100%) rename {openwrt-21.02 => openwrt-23.05}/steps/organize_files.sh (99%) diff --git a/.github/workflows/NanoPi-Build.yml b/.github/workflows/NanoPi-Build.yml index 07891a8..d26526e 100644 --- a/.github/workflows/NanoPi-Build.yml +++ b/.github/workflows/NanoPi-Build.yml @@ -27,9 +27,8 @@ on: default: '22.03' type: choice options: - - '21.02' - '22.03' - - 'master' + - '23.05' model_R4S: description: 'Build R4S' type: boolean @@ -69,7 +68,7 @@ jobs: run: | model_R4S="${{ fromJSON('["", "R4S"]')[github.event.inputs.model_R4S == 'true'] }}" model_R2S="${{ fromJSON('["", "R2S"]')[github.event.inputs.model_R2S == 'true'] }}" - model_R2C="${{ fromJSON('["", "R2C"]')[github.event.inputs.model_R2C == 'true' && (github.event.inputs.openwrt_branch == '21.02' || github.event.inputs.openwrt_branch == '22.03')] }}" + model_R2C="${{ fromJSON('["", "R2C"]')[github.event.inputs.model_R2C == 'true'] }}" models="$model_R4S $model_R2S $model_R2C" modelsJson=$(echo -n "$models" | jq -R -s -c 'split(" ") | map(select(length>0))') matrix="{\"nanopi_model\":$modelsJson}" diff --git a/README.md b/README.md index 1ee2e72..3540900 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,11 @@ If you like this project you can gift me a coffee ! [Download 22.03 Releases](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/releases?q=OpenWrtAO-22.03&expanded=true) [Changelog](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/blob/main/openwrt-22.03/release-info.md) Supported Models : R2S / R4S(1Gb & 4Gb) / R2C (Untested) -## OpenWrt branch master (experimental) +## OpenWrt 23.05.0-rc2 (beta) -[Download master Releases](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/releases?q=OpenWrtAO-master&expanded=true) [Changelog](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/blob/main/openwrt-master/release-info.md) +[Download 23.05 Releases](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/releases?q=OpenWrtAO-23.05&expanded=true) [Changelog](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/blob/main/openwrt-23.05/release-info.md) Supported Models : R2S / R4S(1Gb & 4Gb) -## OpenWrt 21.02.7 (EOL) - -[Download 21.02 Releases](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/releases?q=OpenWrtAO-21.02&expanded=true) [Changelog](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/blob/main/openwrt-21.02/release-info.md) - ⚠ Warning: No support / Use at your own risk ⚠ ## License diff --git a/openwrt-21.02/patches/0002-kernel-crypto.addon b/openwrt-21.02/patches/0002-kernel-crypto.addon deleted file mode 100644 index d18ce4f..0000000 --- a/openwrt-21.02/patches/0002-kernel-crypto.addon +++ /dev/null @@ -1,23 +0,0 @@ -CONFIG_CRYPTO_AES_ARM64_CE_BLK=y -CONFIG_CRYPTO_AES_ARM64_CE_CCM=y -CONFIG_CRYPTO_SHA512_ARM64=y -CONFIG_CRYPTO_SHA512_ARM64_CE=y -CONFIG_CRYPTO_SHA3_ARM64=y -CONFIG_CRYPTO_SM3_ARM64_CE=y -CONFIG_CRYPTO_SM4_ARM64_CE=y -CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=y -CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y -CONFIG_CRYPTO_AES_ARM64_BS=y -CONFIG_CRYPTO_ANSI_CPRNG=y -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_ECB=y -CONFIG_CRYPTO_GHASH_ARM64_CE=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA1_ARM64_CE=y -CONFIG_CRYPTO_SHA2_ARM64_CE=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_TWOFISH=y -CONFIG_CRYPTO_USER_API_HASH=y -CONFIG_CRYPTO_USER_API_SKCIPHER=y -CONFIG_CRYPTO_DEV_ROCKCHIP=y \ No newline at end of file diff --git a/openwrt-21.02/patches/immortalwrt/package/kernel/linux/modules/video.mk b/openwrt-21.02/patches/immortalwrt/package/kernel/linux/modules/video.mk deleted file mode 100644 index 73d999f..0000000 --- a/openwrt-21.02/patches/immortalwrt/package/kernel/linux/modules/video.mk +++ /dev/null @@ -1,1079 +0,0 @@ -# -# Copyright (C) 2009 David Cooper -# Copyright (C) 2006-2010 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -VIDEO_MENU:=Video Support - -V4L2_DIR=v4l2-core -V4L2_USB_DIR=usb - -# -# Video Display -# - -define KernelPackage/backlight - SUBMENU:=$(VIDEO_MENU) - TITLE:=Backlight support - DEPENDS:=@DISPLAY_SUPPORT - HIDDEN:=1 - KCONFIG:=CONFIG_BACKLIGHT_CLASS_DEVICE \ - CONFIG_BACKLIGHT_LCD_SUPPORT=y \ - CONFIG_LCD_CLASS_DEVICE=n \ - CONFIG_BACKLIGHT_GENERIC=n \ - CONFIG_BACKLIGHT_ADP8860=n \ - CONFIG_BACKLIGHT_ADP8870=n \ - CONFIG_BACKLIGHT_OT200=n \ - CONFIG_BACKLIGHT_PM8941_WLED=n - FILES:=$(LINUX_DIR)/drivers/video/backlight/backlight.ko - AUTOLOAD:=$(call AutoProbe,video backlight) -endef - -define KernelPackage/backlight/description - Kernel module for Backlight support. -endef - -$(eval $(call KernelPackage,backlight)) - -define KernelPackage/backlight-pwm - SUBMENU:=$(VIDEO_MENU) - TITLE:=PWM Backlight support - DEPENDS:=+kmod-backlight - KCONFIG:=CONFIG_BACKLIGHT_PWM - FILES:=$(LINUX_DIR)/drivers/video/backlight/pwm_bl.ko - AUTOLOAD:=$(call AutoProbe,video pwm_bl) -endef - -define KernelPackage/backlight-pwm/description - Kernel module for PWM based Backlight support. -endef - -$(eval $(call KernelPackage,backlight-pwm)) - - -define KernelPackage/fb - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer and framebuffer console support - DEPENDS:=@DISPLAY_SUPPORT - KCONFIG:= \ - CONFIG_FB \ - CONFIG_FB_MXS=n \ - CONFIG_FB_SM750=n \ - CONFIG_FRAMEBUFFER_CONSOLE=y \ - CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y \ - CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y \ - CONFIG_FONTS=y \ - CONFIG_FONT_8x8=y \ - CONFIG_FONT_8x16=y \ - CONFIG_FONT_6x11=n \ - CONFIG_FONT_7x14=n \ - CONFIG_FONT_PEARL_8x8=n \ - CONFIG_FONT_ACORN_8x8=n \ - CONFIG_FONT_MINI_4x6=n \ - CONFIG_FONT_6x10=n \ - CONFIG_FONT_SUN8x16=n \ - CONFIG_FONT_SUN12x22=n \ - CONFIG_FONT_10x18=n \ - CONFIG_VT=y \ - CONFIG_CONSOLE_TRANSLATIONS=y \ - CONFIG_VT_CONSOLE=y \ - CONFIG_VT_HW_CONSOLE_BINDING=y - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb.ko \ - $(LINUX_DIR)/lib/fonts/font.ko - AUTOLOAD:=$(call AutoLoad,06,fb font) -endef - -define KernelPackage/fb/description - Kernel support for framebuffers and framebuffer console. -endef - -define KernelPackage/fb/x86 - FILES+=$(LINUX_DIR)/arch/x86/video/fbdev.ko - AUTOLOAD:=$(call AutoLoad,06,fbdev fb font) -endef - -$(eval $(call KernelPackage,fb)) - - -define KernelPackage/fb-cfb-fillrect - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer software rectangle filling support - DEPENDS:=+kmod-fb - KCONFIG:=CONFIG_FB_CFB_FILLRECT - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/cfbfillrect.ko - AUTOLOAD:=$(call AutoLoad,07,cfbfillrect) -endef - -define KernelPackage/fb-cfb-fillrect/description - Kernel support for software rectangle filling -endef - -$(eval $(call KernelPackage,fb-cfb-fillrect)) - - -define KernelPackage/fb-cfb-copyarea - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer software copy area support - DEPENDS:=+kmod-fb - KCONFIG:=CONFIG_FB_CFB_COPYAREA - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/cfbcopyarea.ko - AUTOLOAD:=$(call AutoLoad,07,cfbcopyarea) -endef - -define KernelPackage/fb-cfb-copyarea/description - Kernel support for software copy area -endef - -$(eval $(call KernelPackage,fb-cfb-copyarea)) - -define KernelPackage/fb-cfb-imgblt - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer software image blit support - DEPENDS:=+kmod-fb - KCONFIG:=CONFIG_FB_CFB_IMAGEBLIT - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/cfbimgblt.ko - AUTOLOAD:=$(call AutoLoad,07,cfbimgblt) -endef - -define KernelPackage/fb-cfb-imgblt/description - Kernel support for software image blitting -endef - -$(eval $(call KernelPackage,fb-cfb-imgblt)) - - -define KernelPackage/fb-sys-fops - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer software sys ops support - DEPENDS:=+kmod-fb - KCONFIG:=CONFIG_FB_SYS_FOPS - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb_sys_fops.ko - AUTOLOAD:=$(call AutoLoad,07,fb_sys_fops) -endef - -define KernelPackage/fb-sys-fops/description - Kernel support for framebuffer sys ops -endef - -$(eval $(call KernelPackage,fb-sys-fops)) - - -define KernelPackage/fb-sys-ram - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer in system RAM support - DEPENDS:=+kmod-fb - KCONFIG:= \ - CONFIG_FB_SYS_COPYAREA \ - CONFIG_FB_SYS_FILLRECT \ - CONFIG_FB_SYS_IMAGEBLIT - FILES:= \ - $(LINUX_DIR)/drivers/video/fbdev/core/syscopyarea.ko \ - $(LINUX_DIR)/drivers/video/fbdev/core/sysfillrect.ko \ - $(LINUX_DIR)/drivers/video/fbdev/core/sysimgblt.ko - AUTOLOAD:=$(call AutoLoad,07,syscopyarea sysfillrect sysimgblt) -endef - -define KernelPackage/fb-sys-ram/description - Kernel support for framebuffers in system RAM -endef - -$(eval $(call KernelPackage,fb-sys-ram)) - - -define KernelPackage/fb-tft - SUBMENU:=$(VIDEO_MENU) - TITLE:=Support for small TFT LCD display modules - DEPENDS:= \ - @GPIO_SUPPORT +kmod-backlight \ - +kmod-fb +kmod-fb-sys-fops +kmod-fb-sys-ram +kmod-spi-bitbang - KCONFIG:= \ - CONFIG_FB_BACKLIGHT=y \ - CONFIG_FB_DEFERRED_IO=y \ - CONFIG_FB_TFT - FILES:= \ - $(LINUX_DIR)/drivers/staging/fbtft/fbtft.ko - AUTOLOAD:=$(call AutoLoad,08,fbtft) -endef - -define KernelPackage/fb-tft/description - Support for small TFT LCD display modules -endef - -$(eval $(call KernelPackage,fb-tft)) - - -define KernelPackage/fb-tft-ili9486 - SUBMENU:=$(VIDEO_MENU) - TITLE:=FB driver for the ILI9486 LCD Controller - DEPENDS:=+kmod-fb-tft - KCONFIG:=CONFIG_FB_TFT_ILI9486 - FILES:=$(LINUX_DIR)/drivers/staging/fbtft/fb_ili9486.ko - AUTOLOAD:=$(call AutoLoad,09,fb_ili9486) -endef - -define KernelPackage/fb-tft-ili9486/description - FB driver for the ILI9486 LCD Controller -endef - -$(eval $(call KernelPackage,fb-tft-ili9486)) - - -define KernelPackage/multimedia-input - SUBMENU:=$(VIDEO_MENU) - TITLE:=Multimedia input support - DEPENDS:=+kmod-input-core - KCONFIG:=CONFIG_RC_CORE \ - CONFIG_LIRC=y \ - CONFIG_RC_DECODERS=y \ - CONFIG_RC_DEVICES=y - FILES:=$(LINUX_DIR)/drivers/media/rc/rc-core.ko - AUTOLOAD:=$(call AutoProbe,rc-core) -endef - -define KernelPackage/multimedia-input/description - Enable multimedia input. -endef - -$(eval $(call KernelPackage,multimedia-input)) - - -define KernelPackage/drm - SUBMENU:=$(VIDEO_MENU) - TITLE:=Direct Rendering Manager (DRM) support - HIDDEN:=1 - DEPENDS:=+kmod-dma-buf +kmod-i2c-core - KCONFIG:=CONFIG_DRM - FILES:= \ - $(LINUX_DIR)/drivers/gpu/drm/drm.ko \ - $(LINUX_DIR)/drivers/gpu/drm/drm_panel_orientation_quirks.ko - AUTOLOAD:=$(call AutoLoad,05,drm) -endef - -define KernelPackage/drm/description - Direct Rendering Manager (DRM) core support -endef - -$(eval $(call KernelPackage,drm)) - -define KernelPackage/drm-ttm - SUBMENU:=$(VIDEO_MENU) - TITLE:=GPU memory management subsystem - DEPENDS:=@DISPLAY_SUPPORT +kmod-drm - KCONFIG:=CONFIG_DRM_TTM - FILES:=$(LINUX_DIR)/drivers/gpu/drm/ttm/ttm.ko - AUTOLOAD:=$(call AutoProbe,ttm) -endef - -define KernelPackage/drm-ttm/description - GPU memory management subsystem for devices with multiple GPU memory types. - Will be enabled automatically if a device driver uses it. -endef - -$(eval $(call KernelPackage,drm-ttm)) - -define KernelPackage/drm-kms-helper - SUBMENU:=$(VIDEO_MENU) - TITLE:=CRTC helpers for KMS drivers - DEPENDS:=@DISPLAY_SUPPORT +kmod-drm +kmod-fb +kmod-fb-sys-fops +kmod-fb-cfb-copyarea \ - +kmod-fb-cfb-fillrect +kmod-fb-cfb-imgblt +kmod-fb-sys-ram - KCONFIG:= \ - CONFIG_DRM_KMS_HELPER \ - CONFIG_DRM_KMS_FB_HELPER=y - FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_kms_helper.ko - AUTOLOAD:=$(call AutoProbe,drm_kms_helper) -endef - -define KernelPackage/drm-kms-helper/description - CRTC helpers for KMS drivers. -endef - -$(eval $(call KernelPackage,drm-kms-helper)) - -define KernelPackage/drm-amdgpu - SUBMENU:=$(VIDEO_MENU) - TITLE:=AMDGPU DRM support - DEPENDS:=@TARGET_x86 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \ - +kmod-drm-kms-helper +kmod-i2c-algo-bit +amdgpu-firmware - KCONFIG:=CONFIG_DRM_AMDGPU \ - CONFIG_DRM_AMDGPU_SI=y \ - CONFIG_DRM_AMDGPU_CIK=y \ - CONFIG_DRM_AMD_DC=y \ - CONFIG_DEBUG_KERNEL_DC=n - FILES:=$(LINUX_DIR)/drivers/gpu/drm/amd/amdgpu/amdgpu.ko \ - $(LINUX_DIR)/drivers/gpu/drm/scheduler/gpu-sched.ko - AUTOLOAD:=$(call AutoProbe,amdgpu) -endef - -define KernelPackage/drm-amdgpu/description - Direct Rendering Manager (DRM) support for AMDGPU Cards -endef - -$(eval $(call KernelPackage,drm-amdgpu)) - - -define KernelPackage/drm-imx - SUBMENU:=$(VIDEO_MENU) - TITLE:=Freescale i.MX DRM support - DEPENDS:=@TARGET_imx6 +kmod-drm-kms-helper - KCONFIG:=CONFIG_DRM_IMX \ - CONFIG_DRM_FBDEV_EMULATION=y \ - CONFIG_DRM_FBDEV_OVERALLOC=100 \ - CONFIG_IMX_IPUV3_CORE \ - CONFIG_RESET_CONTROLLER=y \ - CONFIG_DRM_IMX_IPUV3 \ - CONFIG_IMX_IPUV3 \ - CONFIG_DRM_GEM_CMA_HELPER=y \ - CONFIG_DRM_KMS_CMA_HELPER=y \ - CONFIG_DRM_IMX_FB_HELPER \ - CONFIG_DRM_IMX_PARALLEL_DISPLAY=n \ - CONFIG_DRM_IMX_TVE=n \ - CONFIG_DRM_IMX_LDB=n \ - CONFIG_DRM_IMX_HDMI=n - FILES:= \ - $(LINUX_DIR)/drivers/gpu/drm/imx/imxdrm.ko \ - $(LINUX_DIR)/drivers/gpu/ipu-v3/imx-ipu-v3.ko - AUTOLOAD:=$(call AutoLoad,08,imxdrm imx-ipu-v3 imx-ipuv3-crtc) -endef - -define KernelPackage/drm-imx/description - Direct Rendering Manager (DRM) support for Freescale i.MX -endef - -$(eval $(call KernelPackage,drm-imx)) - -define KernelPackage/drm-imx-hdmi - SUBMENU:=$(VIDEO_MENU) - TITLE:=Freescale i.MX HDMI DRM support - DEPENDS:=+kmod-sound-core kmod-drm-imx - KCONFIG:=CONFIG_DRM_IMX_HDMI \ - CONFIG_DRM_DW_HDMI_AHB_AUDIO \ - CONFIG_DRM_DW_HDMI_I2S_AUDIO - FILES:= \ - $(LINUX_DIR)/drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko \ - $(LINUX_DIR)/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.ko \ - $(LINUX_DIR)/drivers/gpu/drm/imx/dw_hdmi-imx.ko - AUTOLOAD:=$(call AutoLoad,08,dw-hdmi dw-hdmi-ahb-audio.ko dw_hdmi-imx) -endef - -define KernelPackage/drm-imx-hdmi/description - Direct Rendering Manager (DRM) support for Freescale i.MX HDMI -endef - -$(eval $(call KernelPackage,drm-imx-hdmi)) - -define KernelPackage/drm-imx-ldb - SUBMENU:=$(VIDEO_MENU) - TITLE:=Freescale i.MX LVDS DRM support - DEPENDS:=+kmod-backlight kmod-drm-imx - KCONFIG:=CONFIG_DRM_IMX_LDB \ - CONFIG_DRM_PANEL_SIMPLE \ - CONFIG_DRM_PANEL=y \ - CONFIG_DRM_PANEL_SAMSUNG_LD9040=n \ - CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=n \ - CONFIG_DRM_PANEL_LG_LG4573=n \ - CONFIG_DRM_PANEL_LD9040=n \ - CONFIG_DRM_PANEL_LVDS=n \ - CONFIG_DRM_PANEL_S6E8AA0=n \ - CONFIG_DRM_PANEL_SITRONIX_ST7789V=n - FILES:=$(LINUX_DIR)/drivers/gpu/drm/imx/imx-ldb.ko \ - $(LINUX_DIR)/drivers/gpu/drm/panel/panel-simple.ko - AUTOLOAD:=$(call AutoLoad,08,imx-ldb) -endef - -define KernelPackage/drm-imx-ldb/description - Direct Rendering Manager (DRM) support for Freescale i.MX LVDS -endef - -$(eval $(call KernelPackage,drm-imx-ldb)) - -define KernelPackage/drm-lima - SUBMENU:=$(VIDEO_MENU) - TITLE:=Mali-4xx GPU support - DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm - KCONFIG:= \ - CONFIG_DRM_VGEM \ - CONFIG_DRM_GEM_CMA_HELPER=y \ - CONFIG_DRM_LIMA - FILES:= \ - $(LINUX_DIR)/drivers/gpu/drm/vgem/vgem.ko \ - $(LINUX_DIR)/drivers/gpu/drm/scheduler/gpu-sched.ko \ - $(LINUX_DIR)/drivers/gpu/drm/lima/lima.ko - AUTOLOAD:=$(call AutoProbe,lima vgem) -endef - -define KernelPackage/drm-lima/description - Open-source reverse-engineered driver for Mali-4xx GPUs -endef - -$(eval $(call KernelPackage,drm-lima)) - -define KernelPackage/drm-panfrost - SUBMENU:=$(VIDEO_MENU) - TITLE:=DRM support for ARM Mali Midgard/Bifrost GPUs - DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm - KCONFIG:=CONFIG_DRM_PANFROST - FILES:= \ - $(LINUX_DIR)/drivers/gpu/drm/panfrost/panfrost.ko \ - $(LINUX_DIR)/drivers/gpu/drm/scheduler/gpu-sched.ko - AUTOLOAD:=$(call AutoProbe,panfrost) -endef - -define KernelPackage/drm-panfrost/description - DRM driver for ARM Mali Midgard (T6xx, T7xx, T8xx) and - Bifrost (G3x, G5x, G7x) GPUs -endef - -$(eval $(call KernelPackage,drm-panfrost)) - -define KernelPackage/drm-radeon - SUBMENU:=$(VIDEO_MENU) - TITLE:=Radeon DRM support - DEPENDS:=@TARGET_x86 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-kms-helper \ - +kmod-drm-ttm +kmod-i2c-algo-bit +radeon-firmware - KCONFIG:=CONFIG_DRM_RADEON - FILES:=$(LINUX_DIR)/drivers/gpu/drm/radeon/radeon.ko - AUTOLOAD:=$(call AutoProbe,radeon) -endef - -define KernelPackage/drm-radeon/description - Direct Rendering Manager (DRM) support for Radeon Cards -endef - -$(eval $(call KernelPackage,drm-radeon)) - -# -# Video Capture -# - -define KernelPackage/video-core - SUBMENU:=$(VIDEO_MENU) - TITLE=Video4Linux support - DEPENDS:=@PCI_SUPPORT||USB_SUPPORT +PACKAGE_kmod-i2c-core:kmod-i2c-core - KCONFIG:= \ - CONFIG_MEDIA_SUPPORT \ - CONFIG_MEDIA_CAMERA_SUPPORT=y \ - CONFIG_VIDEO_DEV \ - CONFIG_VIDEO_V4L1=y \ - CONFIG_VIDEO_ALLOW_V4L1=y \ - CONFIG_VIDEO_CAPTURE_DRIVERS=y \ - CONFIG_V4L_USB_DRIVERS=y \ - CONFIG_V4L_PCI_DRIVERS=y \ - CONFIG_V4L_PLATFORM_DRIVERS=y \ - CONFIG_V4L_ISA_PARPORT_DRIVERS=y - FILES:= \ - $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videodev.ko - AUTOLOAD:=$(call AutoLoad,60, videodev v4l2-common) -endef - -define KernelPackage/video-core/description - Kernel modules for Video4Linux support -endef - -$(eval $(call KernelPackage,video-core)) - - -define AddDepends/video - SUBMENU:=$(VIDEO_MENU) - DEPENDS+=kmod-video-core $(1) -endef - -define AddDepends/camera -$(AddDepends/video) - KCONFIG+=CONFIG_MEDIA_USB_SUPPORT=y \ - CONFIG_MEDIA_CAMERA_SUPPORT=y -endef - - -define KernelPackage/video-videobuf2 - TITLE:=videobuf2 lib - DEPENDS:=+kmod-dma-buf - KCONFIG:= \ - CONFIG_VIDEOBUF2_CORE \ - CONFIG_VIDEOBUF2_MEMOPS \ - CONFIG_VIDEOBUF2_VMALLOC - FILES:= \ - $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-common.ko \ - $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-v4l2.ko \ - $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-memops.ko \ - $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-vmalloc.ko - AUTOLOAD:=$(call AutoLoad,65,videobuf2-core videobuf-v4l2 videobuf2-memops videobuf2-vmalloc) - $(call AddDepends/video) -endef - -define KernelPackage/video-videobuf2/description - Kernel modules that implements three basic types of media buffers. -endef - -$(eval $(call KernelPackage,video-videobuf2)) - - -define KernelPackage/video-cpia2 - TITLE:=CPIA2 video driver - DEPENDS:=@USB_SUPPORT +kmod-usb-core - KCONFIG:=CONFIG_VIDEO_CPIA2 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/cpia2/cpia2.ko - AUTOLOAD:=$(call AutoProbe,cpia2) - $(call AddDepends/camera) -endef - -define KernelPackage/video-cpia2/description - Kernel modules for supporting CPIA2 USB based cameras -endef - -$(eval $(call KernelPackage,video-cpia2)) - - -define KernelPackage/video-pwc - TITLE:=Philips USB webcam support - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-video-videobuf2 - KCONFIG:= \ - CONFIG_USB_PWC \ - CONFIG_USB_PWC_DEBUG=n - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/pwc/pwc.ko - AUTOLOAD:=$(call AutoProbe,pwc) - $(call AddDepends/camera) -endef - -define KernelPackage/video-pwc/description - Kernel modules for supporting Philips USB based cameras -endef - -$(eval $(call KernelPackage,video-pwc)) - - -define KernelPackage/video-uvc - TITLE:=USB Video Class (UVC) support - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-video-videobuf2 +kmod-input-core - KCONFIG:= CONFIG_USB_VIDEO_CLASS - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/uvc/uvcvideo.ko - AUTOLOAD:=$(call AutoProbe,uvcvideo) - $(call AddDepends/camera) -endef - -define KernelPackage/video-uvc/description - Kernel modules for supporting USB Video Class (UVC) devices -endef - -$(eval $(call KernelPackage,video-uvc)) - - -define KernelPackage/video-gspca-core - MENU:=1 - TITLE:=GSPCA webcam core support framework - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-input-core +kmod-video-videobuf2 - KCONFIG:=CONFIG_USB_GSPCA - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_main.ko - AUTOLOAD:=$(call AutoProbe,gspca_main) - $(call AddDepends/camera) -endef - -define KernelPackage/video-gspca-core/description - Kernel modules for supporting GSPCA based webcam devices. Note this is just - the core of the driver, please select a submodule that supports your webcam. -endef - -$(eval $(call KernelPackage,video-gspca-core)) - - -define AddDepends/camera-gspca - SUBMENU:=$(VIDEO_MENU) - DEPENDS+=kmod-video-gspca-core $(1) -endef - - -define KernelPackage/video-gspca-conex - TITLE:=conex webcam support - KCONFIG:=CONFIG_USB_GSPCA_CONEX - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_conex.ko - AUTOLOAD:=$(call AutoProbe,gspca_conex) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-conex/description - The Conexant Camera Driver (conex) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-conex)) - - -define KernelPackage/video-gspca-etoms - TITLE:=etoms webcam support - KCONFIG:=CONFIG_USB_GSPCA_ETOMS - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_etoms.ko - AUTOLOAD:=$(call AutoProbe,gspca_etoms) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-etoms/description - The Etoms USB Camera Driver (etoms) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-etoms)) - - -define KernelPackage/video-gspca-finepix - TITLE:=finepix webcam support - KCONFIG:=CONFIG_USB_GSPCA_FINEPIX - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_finepix.ko - AUTOLOAD:=$(call AutoProbe,gspca_finepix) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-finepix/description - The Fujifilm FinePix USB V4L2 driver (finepix) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-finepix)) - - -define KernelPackage/video-gspca-mars - TITLE:=mars webcam support - KCONFIG:=CONFIG_USB_GSPCA_MARS - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_mars.ko - AUTOLOAD:=$(call AutoProbe,gspca_mars) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-mars/description - The Mars USB Camera Driver (mars) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-mars)) - - -define KernelPackage/video-gspca-mr97310a - TITLE:=mr97310a webcam support - KCONFIG:=CONFIG_USB_GSPCA_MR97310A - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_mr97310a.ko - AUTOLOAD:=$(call AutoProbe,gspca_mr97310a) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-mr97310a/description - The Mars-Semi MR97310A USB Camera Driver (mr97310a) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-mr97310a)) - - -define KernelPackage/video-gspca-ov519 - TITLE:=ov519 webcam support - KCONFIG:=CONFIG_USB_GSPCA_OV519 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_ov519.ko - AUTOLOAD:=$(call AutoProbe,gspca_ov519) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-ov519/description - The OV519 USB Camera Driver (ov519) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-ov519)) - - -define KernelPackage/video-gspca-ov534 - TITLE:=ov534 webcam support - KCONFIG:=CONFIG_USB_GSPCA_OV534 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_ov534.ko - AUTOLOAD:=$(call AutoProbe,gspca_ov534) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-ov534/description - The OV534 USB Camera Driver (ov534) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-ov534)) - - -define KernelPackage/video-gspca-ov534-9 - TITLE:=ov534-9 webcam support - KCONFIG:=CONFIG_USB_GSPCA_OV534_9 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_ov534_9.ko - AUTOLOAD:=$(call AutoProbe,gspca_ov534_9) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-ov534-9/description - The OV534-9 USB Camera Driver (ov534_9) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-ov534-9)) - - -define KernelPackage/video-gspca-pac207 - TITLE:=pac207 webcam support - KCONFIG:=CONFIG_USB_GSPCA_PAC207 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_pac207.ko - AUTOLOAD:=$(call AutoProbe,gspca_pac207) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-pac207/description - The Pixart PAC207 USB Camera Driver (pac207) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-pac207)) - - -define KernelPackage/video-gspca-pac7311 - TITLE:=pac7311 webcam support - KCONFIG:=CONFIG_USB_GSPCA_PAC7311 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_pac7311.ko - AUTOLOAD:=$(call AutoProbe,gspca_pac7311) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-pac7311/description - The Pixart PAC7311 USB Camera Driver (pac7311) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-pac7311)) - - -define KernelPackage/video-gspca-se401 - TITLE:=se401 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SE401 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_se401.ko - AUTOLOAD:=$(call AutoProbe,gspca_se401) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-se401/description - The SE401 USB Camera Driver kernel module -endef - -$(eval $(call KernelPackage,video-gspca-se401)) - - -define KernelPackage/video-gspca-sn9c20x - TITLE:=sn9c20x webcam support - KCONFIG:=CONFIG_USB_GSPCA_SN9C20X - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sn9c20x.ko - AUTOLOAD:=$(call AutoProbe,gspca_sn9c20x) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sn9c20x/description - The SN9C20X USB Camera Driver (sn9c20x) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sn9c20x)) - - -define KernelPackage/video-gspca-sonixb - TITLE:=sonixb webcam support - KCONFIG:=CONFIG_USB_GSPCA_SONIXB - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sonixb.ko - AUTOLOAD:=$(call AutoProbe,gspca_sonixb) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sonixb/description - The SONIX Bayer USB Camera Driver (sonixb) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sonixb)) - - -define KernelPackage/video-gspca-sonixj - TITLE:=sonixj webcam support - KCONFIG:=CONFIG_USB_GSPCA_SONIXJ - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sonixj.ko - AUTOLOAD:=$(call AutoProbe,gspca_sonixj) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sonixj/description - The SONIX JPEG USB Camera Driver (sonixj) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sonixj)) - - -define KernelPackage/video-gspca-spca500 - TITLE:=spca500 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA500 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca500.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca500) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca500/description - The SPCA500 USB Camera Driver (spca500) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca500)) - - -define KernelPackage/video-gspca-spca501 - TITLE:=spca501 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA501 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca501.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca501) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca501/description - The SPCA501 USB Camera Driver (spca501) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca501)) - - -define KernelPackage/video-gspca-spca505 - TITLE:=spca505 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA505 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca505.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca505) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca505/description - The SPCA505 USB Camera Driver (spca505) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca505)) - - -define KernelPackage/video-gspca-spca506 - TITLE:=spca506 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA506 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca506.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca506) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca506/description - The SPCA506 USB Camera Driver (spca506) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca506)) - - -define KernelPackage/video-gspca-spca508 - TITLE:=spca508 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA508 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca508.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca508) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca508/description - The SPCA508 USB Camera Driver (spca508) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca508)) - - -define KernelPackage/video-gspca-spca561 - TITLE:=spca561 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA561 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca561.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca561) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca561/description - The SPCA561 USB Camera Driver (spca561) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca561)) - - -define KernelPackage/video-gspca-sq905 - TITLE:=sq905 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SQ905 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sq905.ko - AUTOLOAD:=$(call AutoProbe,gspca_sq905) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sq905/description - The SQ Technologies SQ905 based USB Camera Driver (sq905) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sq905)) - - -define KernelPackage/video-gspca-sq905c - TITLE:=sq905c webcam support - KCONFIG:=CONFIG_USB_GSPCA_SQ905C - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sq905c.ko - AUTOLOAD:=$(call AutoProbe,gspca_sq905c) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sq905c/description - The SQ Technologies SQ905C based USB Camera Driver (sq905c) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sq905c)) - - -define KernelPackage/video-gspca-stk014 - TITLE:=stk014 webcam support - KCONFIG:=CONFIG_USB_GSPCA_STK014 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_stk014.ko - AUTOLOAD:=$(call AutoProbe,gspca_stk014) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-stk014/description - The Syntek DV4000 (STK014) USB Camera Driver (stk014) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-stk014)) - - -define KernelPackage/video-gspca-sunplus - TITLE:=sunplus webcam support - KCONFIG:=CONFIG_USB_GSPCA_SUNPLUS - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sunplus.ko - AUTOLOAD:=$(call AutoProbe,gspca_sunplus) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sunplus/description - The SUNPLUS USB Camera Driver (sunplus) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sunplus)) - - -define KernelPackage/video-gspca-t613 - TITLE:=t613 webcam support - KCONFIG:=CONFIG_USB_GSPCA_T613 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_t613.ko - AUTOLOAD:=$(call AutoProbe,gspca_t613) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-t613/description - The T613 (JPEG Compliance) USB Camera Driver (t613) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-t613)) - - -define KernelPackage/video-gspca-tv8532 - TITLE:=tv8532 webcam support - KCONFIG:=CONFIG_USB_GSPCA_TV8532 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_tv8532.ko - AUTOLOAD:=$(call AutoProbe,gspca_tv8532) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-tv8532/description - The TV8532 USB Camera Driver (tv8532) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-tv8532)) - - -define KernelPackage/video-gspca-vc032x - TITLE:=vc032x webcam support - KCONFIG:=CONFIG_USB_GSPCA_VC032X - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_vc032x.ko - AUTOLOAD:=$(call AutoProbe,gspca_vc032x) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-vc032x/description - The VC032X USB Camera Driver (vc032x) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-vc032x)) - - -define KernelPackage/video-gspca-zc3xx - TITLE:=zc3xx webcam support - KCONFIG:=CONFIG_USB_GSPCA_ZC3XX - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_zc3xx.ko - AUTOLOAD:=$(call AutoProbe,gspca_zc3xx) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-zc3xx/description - The ZC3XX USB Camera Driver (zc3xx) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-zc3xx)) - - -define KernelPackage/video-gspca-m5602 - TITLE:=m5602 webcam support - KCONFIG:=CONFIG_USB_M5602 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/m5602/gspca_m5602.ko - AUTOLOAD:=$(call AutoProbe,gspca_m5602) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-m5602/description - The ALi USB m5602 Camera Driver (m5602) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-m5602)) - - -define KernelPackage/video-gspca-stv06xx - TITLE:=stv06xx webcam support - KCONFIG:=CONFIG_USB_STV06XX - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/stv06xx/gspca_stv06xx.ko - AUTOLOAD:=$(call AutoProbe,gspca_stv06xx) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-stv06xx/description - The STV06XX USB Camera Driver (stv06xx) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-stv06xx)) - - -define KernelPackage/video-gspca-gl860 - TITLE:=gl860 webcam support - KCONFIG:=CONFIG_USB_GL860 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gl860/gspca_gl860.ko - AUTOLOAD:=$(call AutoProbe,gspca_gl860) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-gl860/description - The GL860 USB Camera Driver (gl860) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-gl860)) - - -define KernelPackage/video-gspca-jeilinj - TITLE:=jeilinj webcam support - KCONFIG:=CONFIG_USB_GSPCA_JEILINJ - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_jeilinj.ko - AUTOLOAD:=$(call AutoProbe,gspca_jeilinj) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-jeilinj/description - The JEILINJ USB Camera Driver (jeilinj) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-jeilinj)) - - -define KernelPackage/video-gspca-konica - TITLE:=konica webcam support - KCONFIG:=CONFIG_USB_GSPCA_KONICA - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_konica.ko - AUTOLOAD:=$(call AutoProbe,gspca_konica) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-konica/description - The Konica USB Camera Driver (konica) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-konica)) diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/Makefile b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/Makefile deleted file mode 100644 index acac24c..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -include $(TOPDIR)/rules.mk - -BOARD:=rockchip -BOARDNAME:=Rockchip -FEATURES:=ext4 audio usb usbgadget display gpio fpu pci pcie rootfs-part boot-part squashfs -SUBTARGETS:=armv8 - -KERNEL_PATCHVER=5.4 - -define Target/Description - Build firmware image for Rockchip SoC devices. -endef - -include $(INCLUDE_DIR)/target.mk - -DEFAULT_PACKAGES += uboot-envtools partx-utils e2fsprogs mkf2fs kmod-gpio-button-hotplug \ - automount autocore-arm fdisk e2fsprogs ethtool - -KERNELNAME:=Image dtbs - -$(eval $(call BuildTarget)) diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds deleted file mode 100755 index 6acdb2e..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -. /lib/functions/leds.sh -. /lib/functions/uci-defaults.sh - -board=$(board_name) -boardname="${board##*,}" - -board_config_update - -case $board in -friendlyarm,nanopi-r2c|\ -friendlyarm,nanopi-r2s|\ -xunlong,orangepi-r1-plus) - ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" - ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1" - ;; -friendlyarm,nanopi-r4s) - ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" - ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth1" - ;; -esac - -board_config_flush - -exit 0 diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/board.d/02_network deleted file mode 100755 index 07164b6..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -. /lib/functions/uci-defaults.sh -. /lib/functions/system.sh - -rockchip_setup_interfaces() -{ - local board="$1" - - case "$board" in - friendlyarm,nanopi-r2c|\ - friendlyarm,nanopi-r2s|\ - friendlyarm,nanopi-r4s|\ - xunlong,orangepi-r1-plus) - ucidef_set_interfaces_lan_wan 'eth1' 'eth0' - ;; - *) - ucidef_set_interface_lan 'eth0' - ;; - esac -} - -nanopi_r2s_generate_mac() -{ - local sd_hash=$(sha256sum /sys/devices/platform/ff500000.dwmmc/mmc_host/mmc0/mmc0:*/cid) - local mac_base=$(macaddr_canonicalize "$(echo "${sd_hash}" | dd bs=1 count=12 2>/dev/null)") - echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${mac_base}")")" -} - -rockchip_setup_macs() -{ - local board="$1" - local lan_mac="" - local wan_mac="" - local label_mac="" - - case "$board" in - friendlyarm,nanopi-r2c|\ - friendlyarm,nanopi-r2s) - wan_mac=$(nanopi_r2s_generate_mac) - lan_mac=$(macaddr_add "$wan_mac" +1) - ;; - friendlyarm,nanopi-r4s) - wan_mac=$(get_mac_binary "/sys/bus/i2c/devices/2-0051/eeprom" 0xfa) - lan_mac=$(macaddr_setbit_la "$wan_mac") - ;; - xunlong,orangepi-r1-plus) - lan_mac=$(cat /sys/class/net/eth1/address) - wan_mac=$(macaddr_add "$lan_mac" -1) - ;; - esac - - [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac - [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac - [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac -} - -board_config_update -board=$(board_name) -rockchip_setup_interfaces $board -rockchip_setup_macs $board -board_config_flush - -exit 0 diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity deleted file mode 100644 index 2279fbe..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -[ "$ACTION" = add ] || exit - -get_device_irq() { - local device="$1" - local line - local seconds - - # wait up to 10 seconds for the irq/device to appear - for seconds in $(seq 0 9); do - line=$(grep -m 1 "${device}\$" /proc/interrupts) && break - sleep 1 - done - echo ${line} | sed 's/:.*//' -} - -set_interface_core() { - local core_mask="$1" - local interface="$2" - local device="$3" - - [ -z "${device}" ] && device="$interface" - - local irq=$(get_device_irq "$device") - - echo "${core_mask}" > /proc/irq/${irq}/smp_affinity -} - -case "$(board_name)" in -friendlyarm,nanopi-r2c|\ -friendlyarm,nanopi-r2s|\ -xunlong,orangepi-r1-plus) - set_interface_core 2 "eth0" - set_interface_core 4 "eth1" "xhci-hcd:usb3" - ;; -friendlyarm,nanopi-r4s) - set_interface_core 10 "eth0" - set_interface_core 20 "eth1" - ;; -esac - diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/lib/preinit/79_move_config b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/lib/preinit/79_move_config deleted file mode 100644 index 96e636e..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/lib/preinit/79_move_config +++ /dev/null @@ -1,16 +0,0 @@ -move_config() { - local partdev - - . /lib/upgrade/common.sh - - if export_bootdevice && export_partdevice partdev 1; then - if mount -o rw,noatime "/dev/$partdev" /mnt; then - if [ -f "/mnt/$BACKUP_FILE" ]; then - mv -f "/mnt/$BACKUP_FILE" / - fi - umount /mnt - fi - fi -} - -boot_hook_add preinit_mount_root move_config diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh deleted file mode 100644 index faed066..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh +++ /dev/null @@ -1,86 +0,0 @@ -platform_check_image() { - local diskdev partdev diff - - export_bootdevice && export_partdevice diskdev 0 || { - echo "Unable to determine upgrade device" - return 1 - } - - get_partitions "/dev/$diskdev" bootdisk - - #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null - - get_partitions /tmp/image.bs image - - #compare tables - diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" - - rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image - - if [ -n "$diff" ]; then - echo "Partition layout has changed. Full image will be written." - ask_bool 0 "Abort" && exit 1 - return 0 - fi -} - -platform_copy_config() { - local partdev - - if export_partdevice partdev 1; then - mount -o rw,noatime "/dev/$partdev" /mnt - cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE" - umount /mnt - fi -} - -platform_do_upgrade() { - local diskdev partdev diff - - export_bootdevice && export_partdevice diskdev 0 || { - echo "Unable to determine upgrade device" - return 1 - } - - sync - - if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then - get_partitions "/dev/$diskdev" bootdisk - - #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b - - get_partitions /tmp/image.bs image - - #compare tables - diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" - else - diff=1 - fi - - if [ -n "$diff" ]; then - get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync - - # Separate removal and addtion is necessary; otherwise, partition 1 - # will be missing if it overlaps with the old partition 2 - partx -d - "/dev/$diskdev" - partx -a - "/dev/$diskdev" - - return 0 - fi - - #iterate over each partition from the image and write it to the boot disk - while read part start size; do - if export_partdevice partdev $part; then - echo "Writing image to /dev/$partdev..." - get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync - else - echo "Unable to find partition $part device, skipped." - fi - done < /tmp/partmap.image - - #copy partition uuid - echo "Writing new UUID to /dev/$diskdev..." - get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync -} diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/config-5.4 b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/config-5.4 deleted file mode 100644 index 1fceddf..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/config-5.4 +++ /dev/null @@ -1,519 +0,0 @@ -CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y -CONFIG_ARCH_HAS_RELR=y -CONFIG_ARCH_HAS_RESET_CONTROLLER=y -CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_MMAP_RND_BITS_MAX=33 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11 -CONFIG_ARCH_ROCKCHIP=y -CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y -CONFIG_ARC_EMAC_CORE=y -CONFIG_ARM64_CNP=y -# CONFIG_ARM64_ERRATUM_1165522 is not set -# CONFIG_ARM64_ERRATUM_1286807 is not set -# CONFIG_ARM64_ERRATUM_1418040 is not set -CONFIG_ARM64_ERRATUM_819472=y -CONFIG_ARM64_ERRATUM_824069=y -CONFIG_ARM64_ERRATUM_826319=y -CONFIG_ARM64_ERRATUM_827319=y -CONFIG_ARM64_ERRATUM_832075=y -CONFIG_ARM64_ERRATUM_843419=y -CONFIG_ARM64_ERRATUM_845719=y -CONFIG_ARM64_ERRATUM_858921=y -CONFIG_ARM64_HW_AFDBM=y -CONFIG_ARM64_LSE_ATOMICS=y -CONFIG_ARM64_MODULE_PLTS=y -CONFIG_ARM64_PAN=y -CONFIG_ARM64_RAS_EXTN=y -# CONFIG_ARM64_SW_TTBR0_PAN is not set -CONFIG_ARM64_UAO=y -CONFIG_ARM64_VA_BITS=48 -# CONFIG_ARM64_VA_BITS_39 is not set -CONFIG_ARM64_VA_BITS_48=y -CONFIG_ARM64_VHE=y -CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y -# CONFIG_ARMV8_DEPRECATED is not set -CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y -CONFIG_ARM_CPUIDLE=y -CONFIG_ARM_GIC_V2M=y -CONFIG_ARM_GIC_V3_ITS_PCI=y -CONFIG_ARM_MHU=y -CONFIG_ARM_PSCI_CPUIDLE=y -CONFIG_ARM_RK3328_DMC_DEVFREQ=y -# CONFIG_ARM_RK3399_DMC_DEVFREQ is not set -# CONFIG_ARM_SCMI_PROTOCOL is not set -CONFIG_ARM_SCPI_CPUFREQ=y -CONFIG_ARM_SCPI_POWER_DOMAIN=y -CONFIG_ARM_SCPI_PROTOCOL=y -CONFIG_ARM_SMMU=y -CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT=y -CONFIG_ARM_SMMU_V3=y -CONFIG_BACKLIGHT_CLASS_DEVICE=y -CONFIG_BACKLIGHT_GPIO=y -CONFIG_BACKLIGHT_PWM=y -CONFIG_BLK_DEV_BSG=y -CONFIG_BLK_DEV_BSGLIB=y -# CONFIG_BLK_DEV_INITRD is not set -CONFIG_BLK_DEV_INTEGRITY=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NVME=y -CONFIG_BLK_DEV_PCIESSD_MTIP32XX=y -CONFIG_BLK_DEV_SD=y -CONFIG_BLK_MQ_PCI=y -CONFIG_BLK_PM=y -CONFIG_BLK_SCSI_REQUEST=y -CONFIG_BLOCK_COMPAT=y -CONFIG_BRCMSTB_GISB_ARB=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y -# CONFIG_CAVIUM_TX2_ERRATUM_219 is not set -CONFIG_CHARGER_GPIO=y -CONFIG_CLKSRC_MMIO=y -CONFIG_CMA=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 -# CONFIG_CMA_DEBUG is not set -# CONFIG_CMA_DEBUGFS is not set -CONFIG_CMA_SIZE_MBYTES=5 -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -CONFIG_COMMON_CLK_RK808=y -CONFIG_COMMON_CLK_SCPI=y -CONFIG_COMPAT=y -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_COMPAT_BINFMT_ELF=y -CONFIG_COMPAT_NETLINK_MESSAGES=y -CONFIG_COMPAT_OLD_SIGACTION=y -CONFIG_CONFIGFS_FS=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_CONTIG_ALLOC=y -CONFIG_CPUFREQ_DT=y -CONFIG_CPUFREQ_DT_PLATDEV=y -CONFIG_CPU_FREQ=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y -CONFIG_CPU_FREQ_GOV_ATTR_SET=y -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set -# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y -# CONFIG_CPU_FREQ_GOV_USERSPACE is not set -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y -CONFIG_CPU_ISOLATION=y -CONFIG_CPU_PM=y -CONFIG_CPU_THERMAL=y -CONFIG_CRASH_CORE=y -CONFIG_CRASH_DUMP=y -CONFIG_CRC16=y -# CONFIG_CRC32_SARWATE is not set -CONFIG_CRC32_SLICEBY8=y -CONFIG_CRC_T10DIF=y -CONFIG_CROSS_MEMORY_ATTACH=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CRCT10DIF=y -# CONFIG_CRYPTO_DEV_ROCKCHIP is not set -CONFIG_DEBUG_BUGVERBOSE=y -# CONFIG_DEVFREQ_GOV_PASSIVE is not set -CONFIG_DEVFREQ_GOV_PERFORMANCE=y -CONFIG_DEVFREQ_GOV_POWERSAVE=y -CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y -CONFIG_DEVFREQ_GOV_USERSPACE=y -# CONFIG_DEVFREQ_THERMAL is not set -CONFIG_DEVMEM=y -# CONFIG_DEVPORT is not set -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -CONFIG_DMADEVICES=y -CONFIG_DMA_CMA=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_OF=y -CONFIG_DMA_SHARED_BUFFER=y -CONFIG_DNOTIFY=y -# CONFIG_DRM_ROCKCHIP is not set -CONFIG_DT_IDLE_STATES=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_DWMAC_DWC_QOS_ETH=y -CONFIG_DWMAC_GENERIC=y -CONFIG_DWMAC_ROCKCHIP=y -CONFIG_EEPROM_AT24=y -CONFIG_EMAC_ROCKCHIP=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_ENERGY_MODEL=y -CONFIG_EXT4_FS=y -CONFIG_EXT4_FS_POSIX_ACL=y -CONFIG_EXTCON=y -CONFIG_FANOTIFY=y -CONFIG_FHANDLE=y -CONFIG_FIXED_PHY=y -# CONFIG_FLATMEM_MANUAL is not set -# CONFIG_FORTIFY_SOURCE is not set -CONFIG_FRAME_WARN=2048 -CONFIG_FS_IOMAP=y -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=y -# CONFIG_FUJITSU_ERRATUM_010001 is not set -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_MIGRATION=y -CONFIG_GENERIC_PHY=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_DWAPB=y -CONFIG_GPIO_GENERIC=y -CONFIG_GPIO_GENERIC_PLATFORM=y -# CONFIG_HARDENED_USERCOPY is not set -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y -CONFIG_HAVE_MEMORY_PRESENT=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_SCHED_AVG_IRQ=y -CONFIG_HAVE_UID16=y -CONFIG_HID=y -CONFIG_HID_GENERIC=y -CONFIG_HOTPLUG_CPU=y -CONFIG_HOTPLUG_PCI=y -# CONFIG_HOTPLUG_PCI_CPCI is not set -# CONFIG_HOTPLUG_PCI_PCIE is not set -# CONFIG_HOTPLUG_PCI_SHPC is not set -CONFIG_HUGETLBFS=y -CONFIG_HUGETLB_PAGE=y -CONFIG_HWMON=y -CONFIG_HWSPINLOCK=y -CONFIG_HW_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_HW_RANDOM_ROCKCHIP=y -CONFIG_HZ=250 -CONFIG_HZ_250=y -# CONFIG_HZ_PERIODIC is not set -CONFIG_I2C=y -CONFIG_I2C_ALGOBIT=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_RK3X=y -CONFIG_INDIRECT_PIO=y -CONFIG_INPUT=y -CONFIG_INPUT_EVDEV=y -CONFIG_INPUT_FF_MEMLESS=y -CONFIG_INPUT_KEYBOARD=y -CONFIG_INPUT_LEDS=y -CONFIG_INPUT_MATRIXKMAP=y -# CONFIG_INPUT_MISC is not set -# CONFIG_INPUT_RK805_PWRKEY is not set -CONFIG_IOMMU_API=y -# CONFIG_IOMMU_DEBUGFS is not set -# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set -CONFIG_IOMMU_DMA=y -CONFIG_IOMMU_IOVA=y -CONFIG_IOMMU_IO_PGTABLE=y -# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set -CONFIG_IOMMU_IO_PGTABLE_LPAE=y -# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set -CONFIG_IOMMU_SUPPORT=y -# CONFIG_IO_STRICT_DEVMEM is not set -CONFIG_IO_URING=y -CONFIG_IRQ_MSI_IOMMU=y -CONFIG_IRQ_TIME_ACCOUNTING=y -CONFIG_JBD2=y -CONFIG_JFFS2_ZLIB=y -CONFIG_JUMP_LABEL=y -CONFIG_KALLSYMS=y -CONFIG_KEXEC_CORE=y -CONFIG_KEXEC_FILE=y -# CONFIG_KEXEC_SIG is not set -CONFIG_KSM=y -# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set -CONFIG_LEDS_GPIO=y -CONFIG_LEDS_PWM=y -CONFIG_LEDS_SYSCON=y -CONFIG_LEDS_TRIGGER_CPU=y -CONFIG_LEDS_TRIGGER_PANIC=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=16 -CONFIG_LIBCRC32C=y -CONFIG_LOCALVERSION_AUTO=y -CONFIG_LOG_BUF_SHIFT=19 -CONFIG_MAGIC_SYSRQ=y -CONFIG_MAGIC_SYSRQ_SERIAL=y -CONFIG_MAILBOX=y -# CONFIG_MAILBOX_TEST is not set -CONFIG_MANDATORY_FILE_LOCKING=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_BUS_MUX=y -CONFIG_MDIO_BUS_MUX_GPIO=y -CONFIG_MDIO_BUS_MUX_MMIOREG=y -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_GPIO=y -CONFIG_MEMORY_ISOLATION=y -CONFIG_MFD_CORE=y -CONFIG_MFD_RK808=y -CONFIG_MFD_SYSCON=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_MINORS=32 -CONFIG_MMC_CQHCI=y -CONFIG_MMC_DW=y -# CONFIG_MMC_DW_BLUEFIELD is not set -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_HI3798CV200 is not set -# CONFIG_MMC_DW_K3 is not set -# CONFIG_MMC_DW_PCI is not set -CONFIG_MMC_DW_PLTFM=y -CONFIG_MMC_DW_ROCKCHIP=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_OF_ARASAN=y -CONFIG_MMC_SDHCI_OF_DWCMSHC=y -# CONFIG_MMC_SDHCI_PCI is not set -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MOTORCOMM_PHY=y -CONFIG_MQ_IOSCHED_DEADLINE=y -# CONFIG_MTD_CFI is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_SPI_NOR=y -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y -CONFIG_MTD_SPLIT_FIRMWARE=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NOP_USB_XCEIV=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NVMEM=y -CONFIG_NVMEM_SYSFS=y -CONFIG_NVME_CORE=y -# CONFIG_NVME_MULTIPATH is not set -# CONFIG_NVME_TCP is not set -CONFIG_OF_DYNAMIC=y -CONFIG_OF_GPIO=y -CONFIG_OF_IOMMU=y -CONFIG_OF_MDIO=y -CONFIG_OF_OVERLAY=y -CONFIG_OF_RESOLVE=y -CONFIG_OLD_SIGSUSPEND3=y -# CONFIG_OVERLAY_FS_XINO_AUTO is not set -CONFIG_PAGE_POOL=y -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_PCI=y -CONFIG_PCIEAER=y -CONFIG_PCIEASPM=y -# CONFIG_PCIEASPM_DEBUG is not set -CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_PERFORMANCE is not set -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -CONFIG_PCIEPORTBUS=y -CONFIG_PCIE_PME=y -CONFIG_PCIE_ROCKCHIP=y -CONFIG_PCIE_ROCKCHIP_HOST=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DOMAINS_GENERIC=y -CONFIG_PCI_MSI=y -CONFIG_PCI_MSI_IRQ_DOMAIN=y -CONFIG_PCI_STUB=y -CONFIG_PGTABLE_LEVELS=4 -CONFIG_PHYLIB=y -CONFIG_PHYLINK=y -CONFIG_PHY_ROCKCHIP_DP=y -CONFIG_PHY_ROCKCHIP_EMMC=y -# CONFIG_PHY_ROCKCHIP_INNO_HDMI is not set -CONFIG_PHY_ROCKCHIP_INNO_USB2=y -CONFIG_PHY_ROCKCHIP_PCIE=y -CONFIG_PHY_ROCKCHIP_TYPEC=y -CONFIG_PHY_ROCKCHIP_USB=y -CONFIG_PINCTRL=y -# CONFIG_PINCTRL_RK805 is not set -CONFIG_PINCTRL_ROCKCHIP=y -# CONFIG_PINCTRL_SINGLE is not set -CONFIG_PL330_DMA=y -CONFIG_PLATFORM_MHU=y -CONFIG_PM=y -CONFIG_PM_CLK=y -CONFIG_PM_DEVFREQ=y -# CONFIG_PM_DEVFREQ_EVENT is not set -CONFIG_PM_GENERIC_DOMAINS=y -CONFIG_PM_GENERIC_DOMAINS_OF=y -CONFIG_PM_OPP=y -CONFIG_POWER_AVS=y -CONFIG_POWER_SUPPLY_HWMON=y -CONFIG_PREEMPT=y -CONFIG_PREEMPTION=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y -CONFIG_PRINTK_TIME=y -# CONFIG_PRINT_QUOTA_WARNING is not set -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PROC_VMCORE=y -CONFIG_PWM=y -CONFIG_PWM_ROCKCHIP=y -CONFIG_PWM_SYSFS=y -# CONFIG_QFMT_V1 is not set -# CONFIG_QFMT_V2 is not set -CONFIG_QUOTA=y -CONFIG_QUOTACTL=y -# CONFIG_QUOTA_NETLINK_INTERFACE is not set -CONFIG_RAID_ATTRS=y -CONFIG_RANDOMIZE_BASE=y -CONFIG_RANDOMIZE_MODULE_REGION_FULL=y -CONFIG_RAS=y -# CONFIG_RAVE_SP_CORE is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=21 -# CONFIG_RCU_EXPERT is not set -CONFIG_RCU_TRACE=y -# CONFIG_READ_ONLY_THP_FOR_FS is not set -CONFIG_REALTEK_PHY=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_IRQ=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_FAN53555=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_REGULATOR_GPIO=y -CONFIG_REGULATOR_PWM=y -CONFIG_REGULATOR_RK808=y -CONFIG_RELOCATABLE=y -CONFIG_RESET_CONTROLLER=y -CONFIG_ROCKCHIP_EFUSE=y -CONFIG_ROCKCHIP_GRF=y -CONFIG_ROCKCHIP_IODOMAIN=y -CONFIG_ROCKCHIP_IOMMU=y -CONFIG_ROCKCHIP_MBOX=y -CONFIG_ROCKCHIP_PHY=y -CONFIG_ROCKCHIP_PM_DOMAINS=y -CONFIG_ROCKCHIP_THERMAL=y -CONFIG_ROCKCHIP_TIMER=y -CONFIG_RSEQ=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_RK808=y -CONFIG_RTC_I2C_AND_SPI=y -CONFIG_RTC_NVMEM=y -# CONFIG_RUNTIME_TESTING_MENU is not set -CONFIG_SCHED_MC=y -CONFIG_SCSI=y -# CONFIG_SCSI_LOWLEVEL is not set -# CONFIG_SCSI_PROC_FS is not set -CONFIG_SCSI_SAS_ATTRS=y -CONFIG_SCSI_SAS_HOST_SMP=y -CONFIG_SCSI_SAS_LIBSAS=y -# CONFIG_SECURITY_DMESG_RESTRICT is not set -CONFIG_SENSORS_ARM_SCPI=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_DW=y -CONFIG_SERIAL_8250_DWLIB=y -CONFIG_SERIAL_8250_EXAR=y -CONFIG_SERIAL_8250_EXTENDED=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SERIAL_8250_SHARE_IRQ=y -CONFIG_SERIAL_AMBA_PL011=y -CONFIG_SERIAL_AMBA_PL011_CONSOLE=y -CONFIG_SERIAL_DEV_BUS=y -CONFIG_SERIAL_DEV_CTRL_TTYPORT=y -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIO=y -CONFIG_SERIO_AMBAKMI=y -CONFIG_SERIO_LIBPS2=y -CONFIG_SG_POOL=y -CONFIG_SIMPLE_PM_BUS=y -CONFIG_SLUB_DEBUG=y -# CONFIG_SND_SOC_ROCKCHIP is not set -CONFIG_SPARSEMEM=y -CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_MANUAL=y -CONFIG_SPARSEMEM_VMEMMAP=y -CONFIG_SPI=y -CONFIG_SPI_BITBANG=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_MEM=y -CONFIG_SPI_ROCKCHIP=y -CONFIG_SPI_SPIDEV=y -# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_EMBEDDED is not set -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SRAM=y -CONFIG_STACKPROTECTOR=y -CONFIG_STACKPROTECTOR_STRONG=y -# CONFIG_STAGING is not set -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -# CONFIG_STMMAC_SELFTESTS is not set -CONFIG_STRICT_DEVMEM=y -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_SWAP is not set -CONFIG_SWPHY=y -CONFIG_SYNC_FILE=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_SYSVIPC_COMPAT=y -CONFIG_TASKS_RCU=y -# CONFIG_TEXTSEARCH is not set -CONFIG_THERMAL=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -CONFIG_THERMAL_EMULATION=y -CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y -CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_OF=y -CONFIG_TRACE_CLOCK=y -CONFIG_TRANSPARENT_HUGEPAGE=y -CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y -# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set -CONFIG_TRANSPARENT_HUGE_PAGECACHE=y -CONFIG_TYPEC=y -# CONFIG_TYPEC_DP_ALTMODE is not set -CONFIG_TYPEC_FUSB302=y -# CONFIG_TYPEC_MUX_PI3USB30532 is not set -# CONFIG_TYPEC_TCPCI is not set -CONFIG_TYPEC_TCPM=y -# CONFIG_TYPEC_TPS6598X is not set -# CONFIG_UCLAMP_TASK is not set -# CONFIG_UEVENT_HELPER is not set -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_USB=y -CONFIG_USB_COMMON=y -CONFIG_USB_DWC3=y -CONFIG_USB_DWC3_DUAL_ROLE=y -CONFIG_USB_DWC3_HOST=y -CONFIG_USB_DWC3_OF_SIMPLE=y -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_HCD_PLATFORM=y -# CONFIG_USB_EHCI_ROOT_HUB_TT is not set -CONFIG_USB_HID=y -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_OHCI_HCD_PLATFORM=y -CONFIG_USB_PHY=y -CONFIG_USB_ROLE_SWITCH=y -CONFIG_USB_STORAGE=y -CONFIG_USB_SUPPORT=y -CONFIG_USB_ULPI=y -CONFIG_USB_ULPI_BUS=y -CONFIG_USB_ULPI_VIEWPORT=y -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_PLATFORM=y -# CONFIG_USERIO is not set -# CONFIG_VIRTIO_MENU is not set -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_HW_CONSOLE_BINDING=y -# CONFIG_WATCHDOG is not set -CONFIG_XARRAY_MULTI=y -CONFIG_XXHASH=y -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_ZLIB_INFLATE=y diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/target.mk b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/target.mk deleted file mode 100644 index a5e60a6..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/armv8/target.mk +++ /dev/null @@ -1,8 +0,0 @@ -ARCH:=aarch64 -SUBTARGET:=armv8 -BOARDNAME:=RK33xx boards (64 bit) - -define Target/Description - Build firmware image for Rockchip RK33xx devices. - This firmware features a 64 bit kernel. -endef diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/config-default b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/config-default deleted file mode 100644 index 1e2cee9..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/config-default +++ /dev/null @@ -1,303 +0,0 @@ -CONFIG_64BIT=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y -CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN=y -CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_ARCH_HAS_FAST_MULTIPLIER=y -CONFIG_ARCH_HAS_FORTIFY_SOURCE=y -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_GIGANTIC_PAGE=y -CONFIG_ARCH_HAS_KCOV=y -CONFIG_ARCH_HAS_KEEPINITRD=y -CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y -CONFIG_ARCH_HAS_PTE_DEVMAP=y -CONFIG_ARCH_HAS_PTE_SPECIAL=y -CONFIG_ARCH_HAS_SETUP_DMA_OPS=y -CONFIG_ARCH_HAS_SET_DIRECT_MAP=y -CONFIG_ARCH_HAS_SET_MEMORY=y -CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y -CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y -CONFIG_ARCH_INLINE_READ_LOCK=y -CONFIG_ARCH_INLINE_READ_LOCK_BH=y -CONFIG_ARCH_INLINE_READ_LOCK_IRQ=y -CONFIG_ARCH_INLINE_READ_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_READ_UNLOCK=y -CONFIG_ARCH_INLINE_READ_UNLOCK_BH=y -CONFIG_ARCH_INLINE_READ_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_READ_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_INLINE_SPIN_LOCK=y -CONFIG_ARCH_INLINE_SPIN_LOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_LOCK_IRQ=y -CONFIG_ARCH_INLINE_SPIN_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_SPIN_TRYLOCK=y -CONFIG_ARCH_INLINE_SPIN_TRYLOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_INLINE_WRITE_LOCK=y -CONFIG_ARCH_INLINE_WRITE_LOCK_BH=y -CONFIG_ARCH_INLINE_WRITE_LOCK_IRQ=y -CONFIG_ARCH_INLINE_WRITE_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_BH=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_KEEP_MEMBLOCK=y -CONFIG_ARCH_MMAP_RND_BITS=18 -CONFIG_ARCH_MMAP_RND_BITS_MAX=24 -CONFIG_ARCH_MMAP_RND_BITS_MIN=18 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 -CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_SPARSEMEM_DEFAULT=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y -CONFIG_ARCH_SUPPORTS_INT128=y -CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y -CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_USE_MEMREMAP_PROT=y -CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y -CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y -CONFIG_ARCH_WANT_FRAME_POINTERS=y -CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y -CONFIG_ARM64=y -CONFIG_ARM64_4K_PAGES=y -CONFIG_ARM64_CONT_SHIFT=4 -CONFIG_ARM64_ERRATUM_1165522=y -CONFIG_ARM64_ERRATUM_1286807=y -CONFIG_ARM64_PAGE_SHIFT=12 -CONFIG_ARM64_PA_BITS=48 -CONFIG_ARM64_PA_BITS_48=y -CONFIG_ARM64_PTR_AUTH=y -CONFIG_ARM64_SSBD=y -CONFIG_ARM64_SVE=y -CONFIG_ARM64_TAGGED_ADDR_ABI=y -CONFIG_ARM64_VA_BITS=39 -CONFIG_ARM64_VA_BITS_39=y -CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y -CONFIG_ARM_AMBA=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -CONFIG_ARM_GIC=y -CONFIG_ARM_GIC_V3=y -CONFIG_ARM_GIC_V3_ITS=y -CONFIG_ARM_PSCI_FW=y -CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y -CONFIG_CAVIUM_TX2_ERRATUM_219=y -CONFIG_CC_HAS_KASAN_GENERIC=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -CONFIG_CPU_RMAP=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_CRC32=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_DMA_DIRECT_REMAP=y -CONFIG_DMA_REMAP=y -CONFIG_DRM_RCAR_WRITEBACK=y -CONFIG_DTC=y -CONFIG_EDAC_SUPPORT=y -CONFIG_EFI_EARLYCON=y -CONFIG_F2FS_FS=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_FONT_8x16=y -CONFIG_FONT_AUTOSELECT=y -CONFIG_FONT_SUPPORT=y -CONFIG_FRAME_POINTER=y -CONFIG_FUJITSU_ERRATUM_010001=y -CONFIG_FW_LOADER_PAGED_BUF=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_ARCH_TOPOLOGY=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_CPU_VULNERABILITIES=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_EARLY_IOREMAP=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -CONFIG_GENERIC_IRQ_MULTI_HANDLER=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_MSI_IRQ_DOMAIN=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDEN_BRANCH_PREDICTOR=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_HAVE_ARCH_HUGE_VMAP=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y -CONFIG_HAVE_ARCH_KASAN=y -CONFIG_HAVE_ARCH_KASAN_SW_TAGS=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_PFN_VALID=y -CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_STACKLEAK=y -CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARCH_VMAP_STACK=y -CONFIG_HAVE_ARM_SMCCC=y -CONFIG_HAVE_ASM_MODVERSIONS=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CMPXCHG_DOUBLE=y -CONFIG_HAVE_CMPXCHG_LOCAL=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_COPY_THREAD_TLS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_BUGVERBOSE=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_EBPF_JIT=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_FAST_GUP=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y -CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_GENERIC_VDSO=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_PATA_PLATFORM=y -CONFIG_HAVE_PCI=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_RCU_TABLE_FREE=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_RSEQ=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HOLES_IN_ZONE=y -CONFIG_HZ=250 -CONFIG_HZ_250=y -CONFIG_HZ_PERIODIC=y -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_INITRAMFS_SOURCE="" -CONFIG_INLINE_READ_LOCK=y -CONFIG_INLINE_READ_LOCK_BH=y -CONFIG_INLINE_READ_LOCK_IRQ=y -CONFIG_INLINE_READ_LOCK_IRQSAVE=y -CONFIG_INLINE_READ_UNLOCK_BH=y -CONFIG_INLINE_READ_UNLOCK_IRQRESTORE=y -CONFIG_INLINE_SPIN_LOCK=y -CONFIG_INLINE_SPIN_LOCK_BH=y -CONFIG_INLINE_SPIN_LOCK_IRQ=y -CONFIG_INLINE_SPIN_LOCK_IRQSAVE=y -CONFIG_INLINE_SPIN_TRYLOCK=y -CONFIG_INLINE_SPIN_TRYLOCK_BH=y -CONFIG_INLINE_SPIN_UNLOCK_BH=y -CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE=y -CONFIG_INLINE_WRITE_LOCK=y -CONFIG_INLINE_WRITE_LOCK_BH=y -CONFIG_INLINE_WRITE_LOCK_IRQ=y -CONFIG_INLINE_WRITE_LOCK_IRQSAVE=y -CONFIG_INLINE_WRITE_UNLOCK_BH=y -CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE=y -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -CONFIG_LIBFDT=y -CONFIG_LOCK_DEBUGGING_SUPPORT=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_MEMFD_CREATE=y -CONFIG_MIGRATION=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NLS=y -CONFIG_NO_IOPORT_MAP=y -CONFIG_NR_CPUS=256 -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_IRQ=y -CONFIG_OF_KOBJ=y -CONFIG_OF_NET=y -CONFIG_PADATA=y -CONFIG_PARTITION_PERCPU=y -CONFIG_PGTABLE_LEVELS=3 -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_PLUGIN_HOSTCC="g++" -CONFIG_POWER_RESET=y -CONFIG_POWER_SUPPLY=y -CONFIG_QUEUED_RWLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_RATIONAL=y -CONFIG_RCU_NEED_SEGCBLIST=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_REFCOUNT_FULL=y -CONFIG_RFS_ACCEL=y -CONFIG_RODATA_FULL_DEFAULT_ENABLED=y -CONFIG_RPS=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_SERIAL_8250_FSL=y -CONFIG_SMP=y -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPARSE_IRQ=y -CONFIG_SRCU=y -CONFIG_SWIOTLB=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_SYS_SUPPORTS_HUGETLBFS=y -CONFIG_THREAD_INFO_IN_TASK=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TREE_RCU=y -CONFIG_TREE_SRCU=y -CONFIG_UNMAP_KERNEL_AT_EL0=y -CONFIG_VMAP_STACK=y -CONFIG_XPS=y -CONFIG_ZONE_DMA32=y diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3328-dram-default-timing.dtsi b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3328-dram-default-timing.dtsi deleted file mode 100644 index a3f5ff4..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3328-dram-default-timing.dtsi +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ -#include -#include - -/ { - ddr_timing: ddr_timing { - compatible = "rockchip,ddr-timing"; - ddr3_speed_bin = ; - ddr4_speed_bin = ; - pd_idle = <0>; - sr_idle = <0>; - sr_mc_gate_idle = <0>; - srpd_lite_idle = <0>; - standby_idle = <0>; - - auto_pd_dis_freq = <1066>; - auto_sr_dis_freq = <800>; - ddr3_dll_dis_freq = <300>; - ddr4_dll_dis_freq = <625>; - phy_dll_dis_freq = <400>; - - ddr3_odt_dis_freq = <100>; - phy_ddr3_odt_dis_freq = <100>; - ddr3_drv = ; - ddr3_odt = ; - phy_ddr3_ca_drv = ; - phy_ddr3_ck_drv = ; - phy_ddr3_dq_drv = ; - phy_ddr3_odt = ; - - lpddr3_odt_dis_freq = <666>; - phy_lpddr3_odt_dis_freq = <666>; - lpddr3_drv = ; - lpddr3_odt = ; - phy_lpddr3_ca_drv = ; - phy_lpddr3_ck_drv = ; - phy_lpddr3_dq_drv = ; - phy_lpddr3_odt = ; - - lpddr4_odt_dis_freq = <800>; - phy_lpddr4_odt_dis_freq = <800>; - lpddr4_drv = ; - lpddr4_dq_odt = ; - lpddr4_ca_odt = ; - phy_lpddr4_ca_drv = ; - phy_lpddr4_ck_cs_drv = ; - phy_lpddr4_dq_drv = ; - phy_lpddr4_odt = ; - - ddr4_odt_dis_freq = <666>; - phy_ddr4_odt_dis_freq = <666>; - ddr4_drv = ; - ddr4_odt = ; - phy_ddr4_ca_drv = ; - phy_ddr4_ck_drv = ; - phy_ddr4_dq_drv = ; - phy_ddr4_odt = ; - - /* CA de-skew, one step is 47.8ps, range 0-15 */ - ddr3a1_ddr4a9_de-skew = <7>; - ddr3a0_ddr4a10_de-skew = <7>; - ddr3a3_ddr4a6_de-skew = <8>; - ddr3a2_ddr4a4_de-skew = <8>; - ddr3a5_ddr4a8_de-skew = <7>; - ddr3a4_ddr4a5_de-skew = <9>; - ddr3a7_ddr4a11_de-skew = <7>; - ddr3a6_ddr4a7_de-skew = <9>; - ddr3a9_ddr4a0_de-skew = <8>; - ddr3a8_ddr4a13_de-skew = <7>; - ddr3a11_ddr4a3_de-skew = <9>; - ddr3a10_ddr4cs0_de-skew = <7>; - ddr3a13_ddr4a2_de-skew = <8>; - ddr3a12_ddr4ba1_de-skew = <7>; - ddr3a15_ddr4odt0_de-skew = <7>; - ddr3a14_ddr4a1_de-skew = <8>; - ddr3ba1_ddr4a15_de-skew = <7>; - ddr3ba0_ddr4bg0_de-skew = <7>; - ddr3ras_ddr4cke_de-skew = <7>; - ddr3ba2_ddr4ba0_de-skew = <8>; - ddr3we_ddr4bg1_de-skew = <8>; - ddr3cas_ddr4a12_de-skew = <7>; - ddr3ckn_ddr4ckn_de-skew = <8>; - ddr3ckp_ddr4ckp_de-skew = <8>; - ddr3cke_ddr4a16_de-skew = <8>; - ddr3odt0_ddr4a14_de-skew = <7>; - ddr3cs0_ddr4act_de-skew = <8>; - ddr3reset_ddr4reset_de-skew = <7>; - ddr3cs1_ddr4cs1_de-skew = <7>; - ddr3odt1_ddr4odt1_de-skew = <7>; - - /* DATA de-skew - * RX one step is 25.1ps, range 0-15 - * TX one step is 47.8ps, range 0-15 - */ - cs0_dm0_rx_de-skew = <7>; - cs0_dm0_tx_de-skew = <8>; - cs0_dq0_rx_de-skew = <7>; - cs0_dq0_tx_de-skew = <8>; - cs0_dq1_rx_de-skew = <7>; - cs0_dq1_tx_de-skew = <8>; - cs0_dq2_rx_de-skew = <7>; - cs0_dq2_tx_de-skew = <8>; - cs0_dq3_rx_de-skew = <7>; - cs0_dq3_tx_de-skew = <8>; - cs0_dq4_rx_de-skew = <7>; - cs0_dq4_tx_de-skew = <8>; - cs0_dq5_rx_de-skew = <7>; - cs0_dq5_tx_de-skew = <8>; - cs0_dq6_rx_de-skew = <7>; - cs0_dq6_tx_de-skew = <8>; - cs0_dq7_rx_de-skew = <7>; - cs0_dq7_tx_de-skew = <8>; - cs0_dqs0_rx_de-skew = <6>; - cs0_dqs0p_tx_de-skew = <9>; - cs0_dqs0n_tx_de-skew = <9>; - - cs0_dm1_rx_de-skew = <7>; - cs0_dm1_tx_de-skew = <7>; - cs0_dq8_rx_de-skew = <7>; - cs0_dq8_tx_de-skew = <8>; - cs0_dq9_rx_de-skew = <7>; - cs0_dq9_tx_de-skew = <7>; - cs0_dq10_rx_de-skew = <7>; - cs0_dq10_tx_de-skew = <8>; - cs0_dq11_rx_de-skew = <7>; - cs0_dq11_tx_de-skew = <7>; - cs0_dq12_rx_de-skew = <7>; - cs0_dq12_tx_de-skew = <8>; - cs0_dq13_rx_de-skew = <7>; - cs0_dq13_tx_de-skew = <7>; - cs0_dq14_rx_de-skew = <7>; - cs0_dq14_tx_de-skew = <8>; - cs0_dq15_rx_de-skew = <7>; - cs0_dq15_tx_de-skew = <7>; - cs0_dqs1_rx_de-skew = <7>; - cs0_dqs1p_tx_de-skew = <9>; - cs0_dqs1n_tx_de-skew = <9>; - - cs0_dm2_rx_de-skew = <7>; - cs0_dm2_tx_de-skew = <8>; - cs0_dq16_rx_de-skew = <7>; - cs0_dq16_tx_de-skew = <8>; - cs0_dq17_rx_de-skew = <7>; - cs0_dq17_tx_de-skew = <8>; - cs0_dq18_rx_de-skew = <7>; - cs0_dq18_tx_de-skew = <8>; - cs0_dq19_rx_de-skew = <7>; - cs0_dq19_tx_de-skew = <8>; - cs0_dq20_rx_de-skew = <7>; - cs0_dq20_tx_de-skew = <8>; - cs0_dq21_rx_de-skew = <7>; - cs0_dq21_tx_de-skew = <8>; - cs0_dq22_rx_de-skew = <7>; - cs0_dq22_tx_de-skew = <8>; - cs0_dq23_rx_de-skew = <7>; - cs0_dq23_tx_de-skew = <8>; - cs0_dqs2_rx_de-skew = <6>; - cs0_dqs2p_tx_de-skew = <9>; - cs0_dqs2n_tx_de-skew = <9>; - - cs0_dm3_rx_de-skew = <7>; - cs0_dm3_tx_de-skew = <7>; - cs0_dq24_rx_de-skew = <7>; - cs0_dq24_tx_de-skew = <8>; - cs0_dq25_rx_de-skew = <7>; - cs0_dq25_tx_de-skew = <7>; - cs0_dq26_rx_de-skew = <7>; - cs0_dq26_tx_de-skew = <7>; - cs0_dq27_rx_de-skew = <7>; - cs0_dq27_tx_de-skew = <7>; - cs0_dq28_rx_de-skew = <7>; - cs0_dq28_tx_de-skew = <7>; - cs0_dq29_rx_de-skew = <7>; - cs0_dq29_tx_de-skew = <7>; - cs0_dq30_rx_de-skew = <7>; - cs0_dq30_tx_de-skew = <7>; - cs0_dq31_rx_de-skew = <7>; - cs0_dq31_tx_de-skew = <7>; - cs0_dqs3_rx_de-skew = <7>; - cs0_dqs3p_tx_de-skew = <9>; - cs0_dqs3n_tx_de-skew = <9>; - - cs1_dm0_rx_de-skew = <7>; - cs1_dm0_tx_de-skew = <8>; - cs1_dq0_rx_de-skew = <7>; - cs1_dq0_tx_de-skew = <8>; - cs1_dq1_rx_de-skew = <7>; - cs1_dq1_tx_de-skew = <8>; - cs1_dq2_rx_de-skew = <7>; - cs1_dq2_tx_de-skew = <8>; - cs1_dq3_rx_de-skew = <7>; - cs1_dq3_tx_de-skew = <8>; - cs1_dq4_rx_de-skew = <7>; - cs1_dq4_tx_de-skew = <8>; - cs1_dq5_rx_de-skew = <7>; - cs1_dq5_tx_de-skew = <8>; - cs1_dq6_rx_de-skew = <7>; - cs1_dq6_tx_de-skew = <8>; - cs1_dq7_rx_de-skew = <7>; - cs1_dq7_tx_de-skew = <8>; - cs1_dqs0_rx_de-skew = <6>; - cs1_dqs0p_tx_de-skew = <9>; - cs1_dqs0n_tx_de-skew = <9>; - - cs1_dm1_rx_de-skew = <7>; - cs1_dm1_tx_de-skew = <7>; - cs1_dq8_rx_de-skew = <7>; - cs1_dq8_tx_de-skew = <8>; - cs1_dq9_rx_de-skew = <7>; - cs1_dq9_tx_de-skew = <7>; - cs1_dq10_rx_de-skew = <7>; - cs1_dq10_tx_de-skew = <8>; - cs1_dq11_rx_de-skew = <7>; - cs1_dq11_tx_de-skew = <7>; - cs1_dq12_rx_de-skew = <7>; - cs1_dq12_tx_de-skew = <8>; - cs1_dq13_rx_de-skew = <7>; - cs1_dq13_tx_de-skew = <7>; - cs1_dq14_rx_de-skew = <7>; - cs1_dq14_tx_de-skew = <8>; - cs1_dq15_rx_de-skew = <7>; - cs1_dq15_tx_de-skew = <7>; - cs1_dqs1_rx_de-skew = <7>; - cs1_dqs1p_tx_de-skew = <9>; - cs1_dqs1n_tx_de-skew = <9>; - - cs1_dm2_rx_de-skew = <7>; - cs1_dm2_tx_de-skew = <8>; - cs1_dq16_rx_de-skew = <7>; - cs1_dq16_tx_de-skew = <8>; - cs1_dq17_rx_de-skew = <7>; - cs1_dq17_tx_de-skew = <8>; - cs1_dq18_rx_de-skew = <7>; - cs1_dq18_tx_de-skew = <8>; - cs1_dq19_rx_de-skew = <7>; - cs1_dq19_tx_de-skew = <8>; - cs1_dq20_rx_de-skew = <7>; - cs1_dq20_tx_de-skew = <8>; - cs1_dq21_rx_de-skew = <7>; - cs1_dq21_tx_de-skew = <8>; - cs1_dq22_rx_de-skew = <7>; - cs1_dq22_tx_de-skew = <8>; - cs1_dq23_rx_de-skew = <7>; - cs1_dq23_tx_de-skew = <8>; - cs1_dqs2_rx_de-skew = <6>; - cs1_dqs2p_tx_de-skew = <9>; - cs1_dqs2n_tx_de-skew = <9>; - - cs1_dm3_rx_de-skew = <7>; - cs1_dm3_tx_de-skew = <7>; - cs1_dq24_rx_de-skew = <7>; - cs1_dq24_tx_de-skew = <8>; - cs1_dq25_rx_de-skew = <7>; - cs1_dq25_tx_de-skew = <7>; - cs1_dq26_rx_de-skew = <7>; - cs1_dq26_tx_de-skew = <7>; - cs1_dq27_rx_de-skew = <7>; - cs1_dq27_tx_de-skew = <7>; - cs1_dq28_rx_de-skew = <7>; - cs1_dq28_tx_de-skew = <7>; - cs1_dq29_rx_de-skew = <7>; - cs1_dq29_tx_de-skew = <7>; - cs1_dq30_rx_de-skew = <7>; - cs1_dq30_tx_de-skew = <7>; - cs1_dq31_rx_de-skew = <7>; - cs1_dq31_tx_de-skew = <7>; - cs1_dqs3_rx_de-skew = <7>; - cs1_dqs3p_tx_de-skew = <9>; - cs1_dqs3n_tx_de-skew = <9>; - }; -}; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/drivers/char/hw_random/rockchip-rng.c b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/drivers/char/hw_random/rockchip-rng.c deleted file mode 100644 index 9a61f80..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/drivers/char/hw_random/rockchip-rng.c +++ /dev/null @@ -1,310 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * rockchip-rng.c Random Number Generator driver for the Rockchip - * - * Copyright (c) 2018, Fuzhou Rockchip Electronics Co., Ltd. - * Author: Lin Jinhan - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#define _SBF(s, v) ((v) << (s)) -#define HIWORD_UPDATE(val, mask, shift) \ - ((val) << (shift) | (mask) << ((shift) + 16)) - -#define ROCKCHIP_AUTOSUSPEND_DELAY 100 -#define ROCKCHIP_POLL_PERIOD_US 100 -#define ROCKCHIP_POLL_TIMEOUT_US 10000 -#define RK_MAX_RNG_BYTE (32) - -/* start of CRYPTO V1 register define */ -#define CRYPTO_V1_CTRL 0x0008 -#define CRYPTO_V1_RNG_START BIT(8) -#define CRYPTO_V1_RNG_FLUSH BIT(9) - -#define CRYPTO_V1_TRNG_CTRL 0x0200 -#define CRYPTO_V1_OSC_ENABLE BIT(16) -#define CRYPTO_V1_TRNG_SAMPLE_PERIOD(x) (x) - -#define CRYPTO_V1_TRNG_DOUT_0 0x0204 -/* end of CRYPTO V1 register define */ - -/* start of CRYPTO V2 register define */ -#define CRYPTO_V2_RNG_CTL 0x0400 -#define CRYPTO_V2_RNG_64_BIT_LEN _SBF(4, 0x00) -#define CRYPTO_V2_RNG_128_BIT_LEN _SBF(4, 0x01) -#define CRYPTO_V2_RNG_192_BIT_LEN _SBF(4, 0x02) -#define CRYPTO_V2_RNG_256_BIT_LEN _SBF(4, 0x03) -#define CRYPTO_V2_RNG_FATESY_SOC_RING _SBF(2, 0x00) -#define CRYPTO_V2_RNG_SLOWER_SOC_RING_0 _SBF(2, 0x01) -#define CRYPTO_V2_RNG_SLOWER_SOC_RING_1 _SBF(2, 0x02) -#define CRYPTO_V2_RNG_SLOWEST_SOC_RING _SBF(2, 0x03) -#define CRYPTO_V2_RNG_ENABLE BIT(1) -#define CRYPTO_V2_RNG_START BIT(0) -#define CRYPTO_V2_RNG_SAMPLE_CNT 0x0404 -#define CRYPTO_V2_RNG_DOUT_0 0x0410 -/* end of CRYPTO V2 register define */ - -struct rk_rng_soc_data { - int (*rk_rng_read)(struct hwrng *rng, void *buf, size_t max, bool wait); -}; - -struct rk_rng { - struct device *dev; - struct hwrng rng; - void __iomem *mem; - struct rk_rng_soc_data *soc_data; - int clk_num; - struct clk_bulk_data *clk_bulks; -}; - -static void rk_rng_writel(struct rk_rng *rng, u32 val, u32 offset) -{ - __raw_writel(val, rng->mem + offset); -} - -static u32 rk_rng_readl(struct rk_rng *rng, u32 offset) -{ - return __raw_readl(rng->mem + offset); -} - -static int rk_rng_init(struct hwrng *rng) -{ - int ret; - struct rk_rng *rk_rng = container_of(rng, struct rk_rng, rng); - - dev_dbg(rk_rng->dev, "clk_bulk_prepare_enable.\n"); - - ret = clk_bulk_prepare_enable(rk_rng->clk_num, rk_rng->clk_bulks); - if (ret < 0) { - dev_err(rk_rng->dev, "failed to enable clks %d\n", ret); - return ret; - } - - return 0; -} - -static void rk_rng_cleanup(struct hwrng *rng) -{ - struct rk_rng *rk_rng = container_of(rng, struct rk_rng, rng); - - dev_dbg(rk_rng->dev, "clk_bulk_disable_unprepare.\n"); - clk_bulk_disable_unprepare(rk_rng->clk_num, rk_rng->clk_bulks); -} - -static void rk_rng_read_regs(struct rk_rng *rng, u32 offset, void *buf, - size_t size) -{ - u32 i; - - for (i = 0; i < size; i += 4) - *(u32 *)(buf + i) = be32_to_cpu(rk_rng_readl(rng, offset + i)); -} - -static int rk_rng_v1_read(struct hwrng *rng, void *buf, size_t max, bool wait) -{ - int ret = 0; - u32 reg_ctrl = 0; - struct rk_rng *rk_rng = container_of(rng, struct rk_rng, rng); - - ret = pm_runtime_get_sync(rk_rng->dev); - if (ret < 0) { - pm_runtime_put_noidle(rk_rng->dev); - return ret; - } - - /* enable osc_ring to get entropy, sample period is set as 100 */ - reg_ctrl = CRYPTO_V1_OSC_ENABLE | CRYPTO_V1_TRNG_SAMPLE_PERIOD(100); - rk_rng_writel(rk_rng, reg_ctrl, CRYPTO_V1_TRNG_CTRL); - - reg_ctrl = HIWORD_UPDATE(CRYPTO_V1_RNG_START, CRYPTO_V1_RNG_START, 0); - - rk_rng_writel(rk_rng, reg_ctrl, CRYPTO_V1_CTRL); - - ret = readl_poll_timeout(rk_rng->mem + CRYPTO_V1_CTRL, reg_ctrl, - !(reg_ctrl & CRYPTO_V1_RNG_START), - ROCKCHIP_POLL_PERIOD_US, - ROCKCHIP_POLL_TIMEOUT_US); - if (ret < 0) - goto out; - - ret = min_t(size_t, max, RK_MAX_RNG_BYTE); - - rk_rng_read_regs(rk_rng, CRYPTO_V1_TRNG_DOUT_0, buf, ret); - -out: - /* close TRNG */ - rk_rng_writel(rk_rng, HIWORD_UPDATE(0, CRYPTO_V1_RNG_START, 0), - CRYPTO_V1_CTRL); - - pm_runtime_mark_last_busy(rk_rng->dev); - pm_runtime_put_sync_autosuspend(rk_rng->dev); - - return ret; -} - -static int rk_rng_v2_read(struct hwrng *rng, void *buf, size_t max, bool wait) -{ - int ret = 0; - u32 reg_ctrl = 0; - struct rk_rng *rk_rng = container_of(rng, struct rk_rng, rng); - - ret = pm_runtime_get_sync(rk_rng->dev); - if (ret < 0) { - pm_runtime_put_noidle(rk_rng->dev); - return ret; - } - - /* enable osc_ring to get entropy, sample period is set as 100 */ - rk_rng_writel(rk_rng, 100, CRYPTO_V2_RNG_SAMPLE_CNT); - - reg_ctrl |= CRYPTO_V2_RNG_256_BIT_LEN; - reg_ctrl |= CRYPTO_V2_RNG_SLOWER_SOC_RING_0; - reg_ctrl |= CRYPTO_V2_RNG_ENABLE; - reg_ctrl |= CRYPTO_V2_RNG_START; - - rk_rng_writel(rk_rng, HIWORD_UPDATE(reg_ctrl, 0xffff, 0), - CRYPTO_V2_RNG_CTL); - - ret = readl_poll_timeout(rk_rng->mem + CRYPTO_V2_RNG_CTL, reg_ctrl, - !(reg_ctrl & CRYPTO_V2_RNG_START), - ROCKCHIP_POLL_PERIOD_US, - ROCKCHIP_POLL_TIMEOUT_US); - if (ret < 0) - goto out; - - ret = min_t(size_t, max, RK_MAX_RNG_BYTE); - - rk_rng_read_regs(rk_rng, CRYPTO_V2_RNG_DOUT_0, buf, ret); - -out: - /* close TRNG */ - rk_rng_writel(rk_rng, HIWORD_UPDATE(0, 0xffff, 0), CRYPTO_V2_RNG_CTL); - - pm_runtime_mark_last_busy(rk_rng->dev); - pm_runtime_put_sync_autosuspend(rk_rng->dev); - - return ret; -} - -static const struct rk_rng_soc_data rk_rng_v1_soc_data = { - .rk_rng_read = rk_rng_v1_read, -}; - -static const struct rk_rng_soc_data rk_rng_v2_soc_data = { - .rk_rng_read = rk_rng_v2_read, -}; - -static const struct of_device_id rk_rng_dt_match[] = { - { - .compatible = "rockchip,cryptov1-rng", - .data = (void *)&rk_rng_v1_soc_data, - }, - { - .compatible = "rockchip,cryptov2-rng", - .data = (void *)&rk_rng_v2_soc_data, - }, - { }, -}; - -MODULE_DEVICE_TABLE(of, rk_rng_dt_match); - -static int rk_rng_probe(struct platform_device *pdev) -{ - int ret; - struct rk_rng *rk_rng; - struct device_node *np = pdev->dev.of_node; - const struct of_device_id *match; - - dev_dbg(&pdev->dev, "probing...\n"); - rk_rng = devm_kzalloc(&pdev->dev, sizeof(struct rk_rng), GFP_KERNEL); - if (!rk_rng) - return -ENOMEM; - - match = of_match_node(rk_rng_dt_match, np); - rk_rng->soc_data = (struct rk_rng_soc_data *)match->data; - - rk_rng->dev = &pdev->dev; - rk_rng->rng.name = "rockchip"; -#ifndef CONFIG_PM - rk_rng->rng.init = rk_rng_init; - rk_rng->rng.cleanup = rk_rng_cleanup, -#endif - rk_rng->rng.read = rk_rng->soc_data->rk_rng_read; - rk_rng->rng.quality = 999; - - rk_rng->mem = devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NULL); - if (IS_ERR(rk_rng->mem)) - return PTR_ERR(rk_rng->mem); - - rk_rng->clk_num = devm_clk_bulk_get_all(&pdev->dev, &rk_rng->clk_bulks); - if (rk_rng->clk_num < 0) { - dev_err(&pdev->dev, "failed to get clks property\n"); - return -ENODEV; - } - - platform_set_drvdata(pdev, rk_rng); - - pm_runtime_set_autosuspend_delay(&pdev->dev, - ROCKCHIP_AUTOSUSPEND_DELAY); - pm_runtime_use_autosuspend(&pdev->dev); - pm_runtime_enable(&pdev->dev); - - ret = devm_hwrng_register(&pdev->dev, &rk_rng->rng); - if (ret) { - pm_runtime_dont_use_autosuspend(&pdev->dev); - pm_runtime_disable(&pdev->dev); - } - - return ret; -} - -#ifdef CONFIG_PM -static int rk_rng_runtime_suspend(struct device *dev) -{ - struct rk_rng *rk_rng = dev_get_drvdata(dev); - - rk_rng_cleanup(&rk_rng->rng); - - return 0; -} - -static int rk_rng_runtime_resume(struct device *dev) -{ - struct rk_rng *rk_rng = dev_get_drvdata(dev); - - return rk_rng_init(&rk_rng->rng); -} - -static const struct dev_pm_ops rk_rng_pm_ops = { - SET_RUNTIME_PM_OPS(rk_rng_runtime_suspend, - rk_rng_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -}; - -#endif - -static struct platform_driver rk_rng_driver = { - .driver = { - .name = "rockchip-rng", -#ifdef CONFIG_PM - .pm = &rk_rng_pm_ops, -#endif - .of_match_table = rk_rng_dt_match, - }, - .probe = rk_rng_probe, -}; - -module_platform_driver(rk_rng_driver); - -MODULE_DESCRIPTION("ROCKCHIP H/W Random Number Generator driver"); -MODULE_AUTHOR("Lin Jinhan "); -MODULE_LICENSE("GPL v2"); diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/drivers/devfreq/rk3328_dmc.c b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/drivers/devfreq/rk3328_dmc.c deleted file mode 100644 index 9e3c870..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/drivers/devfreq/rk3328_dmc.c +++ /dev/null @@ -1,846 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2016, Fuzhou Rockchip Electronics Co., Ltd. - * Author: Lin Huang - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define DTS_PAR_OFFSET (4096) - -struct share_params { - u32 hz; - u32 lcdc_type; - u32 vop; - u32 vop_dclk_mode; - u32 sr_idle_en; - u32 addr_mcu_el3; - /* - * 1: need to wait flag1 - * 0: never wait flag1 - */ - u32 wait_flag1; - /* - * 1: need to wait flag1 - * 0: never wait flag1 - */ - u32 wait_flag0; - u32 complt_hwirq; - /* if need, add parameter after */ -}; - -static struct share_params *ddr_psci_param; - -/* hope this define can adapt all future platform */ -static const char * const rk3328_dts_timing[] = { - "ddr3_speed_bin", - "ddr4_speed_bin", - "pd_idle", - "sr_idle", - "sr_mc_gate_idle", - "srpd_lite_idle", - "standby_idle", - - "auto_pd_dis_freq", - "auto_sr_dis_freq", - "ddr3_dll_dis_freq", - "ddr4_dll_dis_freq", - "phy_dll_dis_freq", - - "ddr3_odt_dis_freq", - "phy_ddr3_odt_dis_freq", - "ddr3_drv", - "ddr3_odt", - "phy_ddr3_ca_drv", - "phy_ddr3_ck_drv", - "phy_ddr3_dq_drv", - "phy_ddr3_odt", - - "lpddr3_odt_dis_freq", - "phy_lpddr3_odt_dis_freq", - "lpddr3_drv", - "lpddr3_odt", - "phy_lpddr3_ca_drv", - "phy_lpddr3_ck_drv", - "phy_lpddr3_dq_drv", - "phy_lpddr3_odt", - - "lpddr4_odt_dis_freq", - "phy_lpddr4_odt_dis_freq", - "lpddr4_drv", - "lpddr4_dq_odt", - "lpddr4_ca_odt", - "phy_lpddr4_ca_drv", - "phy_lpddr4_ck_cs_drv", - "phy_lpddr4_dq_drv", - "phy_lpddr4_odt", - - "ddr4_odt_dis_freq", - "phy_ddr4_odt_dis_freq", - "ddr4_drv", - "ddr4_odt", - "phy_ddr4_ca_drv", - "phy_ddr4_ck_drv", - "phy_ddr4_dq_drv", - "phy_ddr4_odt", -}; - -static const char * const rk3328_dts_ca_timing[] = { - "ddr3a1_ddr4a9_de-skew", - "ddr3a0_ddr4a10_de-skew", - "ddr3a3_ddr4a6_de-skew", - "ddr3a2_ddr4a4_de-skew", - "ddr3a5_ddr4a8_de-skew", - "ddr3a4_ddr4a5_de-skew", - "ddr3a7_ddr4a11_de-skew", - "ddr3a6_ddr4a7_de-skew", - "ddr3a9_ddr4a0_de-skew", - "ddr3a8_ddr4a13_de-skew", - "ddr3a11_ddr4a3_de-skew", - "ddr3a10_ddr4cs0_de-skew", - "ddr3a13_ddr4a2_de-skew", - "ddr3a12_ddr4ba1_de-skew", - "ddr3a15_ddr4odt0_de-skew", - "ddr3a14_ddr4a1_de-skew", - "ddr3ba1_ddr4a15_de-skew", - "ddr3ba0_ddr4bg0_de-skew", - "ddr3ras_ddr4cke_de-skew", - "ddr3ba2_ddr4ba0_de-skew", - "ddr3we_ddr4bg1_de-skew", - "ddr3cas_ddr4a12_de-skew", - "ddr3ckn_ddr4ckn_de-skew", - "ddr3ckp_ddr4ckp_de-skew", - "ddr3cke_ddr4a16_de-skew", - "ddr3odt0_ddr4a14_de-skew", - "ddr3cs0_ddr4act_de-skew", - "ddr3reset_ddr4reset_de-skew", - "ddr3cs1_ddr4cs1_de-skew", - "ddr3odt1_ddr4odt1_de-skew", -}; - -static const char * const rk3328_dts_cs0_timing[] = { - "cs0_dm0_rx_de-skew", - "cs0_dm0_tx_de-skew", - "cs0_dq0_rx_de-skew", - "cs0_dq0_tx_de-skew", - "cs0_dq1_rx_de-skew", - "cs0_dq1_tx_de-skew", - "cs0_dq2_rx_de-skew", - "cs0_dq2_tx_de-skew", - "cs0_dq3_rx_de-skew", - "cs0_dq3_tx_de-skew", - "cs0_dq4_rx_de-skew", - "cs0_dq4_tx_de-skew", - "cs0_dq5_rx_de-skew", - "cs0_dq5_tx_de-skew", - "cs0_dq6_rx_de-skew", - "cs0_dq6_tx_de-skew", - "cs0_dq7_rx_de-skew", - "cs0_dq7_tx_de-skew", - "cs0_dqs0_rx_de-skew", - "cs0_dqs0p_tx_de-skew", - "cs0_dqs0n_tx_de-skew", - - "cs0_dm1_rx_de-skew", - "cs0_dm1_tx_de-skew", - "cs0_dq8_rx_de-skew", - "cs0_dq8_tx_de-skew", - "cs0_dq9_rx_de-skew", - "cs0_dq9_tx_de-skew", - "cs0_dq10_rx_de-skew", - "cs0_dq10_tx_de-skew", - "cs0_dq11_rx_de-skew", - "cs0_dq11_tx_de-skew", - "cs0_dq12_rx_de-skew", - "cs0_dq12_tx_de-skew", - "cs0_dq13_rx_de-skew", - "cs0_dq13_tx_de-skew", - "cs0_dq14_rx_de-skew", - "cs0_dq14_tx_de-skew", - "cs0_dq15_rx_de-skew", - "cs0_dq15_tx_de-skew", - "cs0_dqs1_rx_de-skew", - "cs0_dqs1p_tx_de-skew", - "cs0_dqs1n_tx_de-skew", - - "cs0_dm2_rx_de-skew", - "cs0_dm2_tx_de-skew", - "cs0_dq16_rx_de-skew", - "cs0_dq16_tx_de-skew", - "cs0_dq17_rx_de-skew", - "cs0_dq17_tx_de-skew", - "cs0_dq18_rx_de-skew", - "cs0_dq18_tx_de-skew", - "cs0_dq19_rx_de-skew", - "cs0_dq19_tx_de-skew", - "cs0_dq20_rx_de-skew", - "cs0_dq20_tx_de-skew", - "cs0_dq21_rx_de-skew", - "cs0_dq21_tx_de-skew", - "cs0_dq22_rx_de-skew", - "cs0_dq22_tx_de-skew", - "cs0_dq23_rx_de-skew", - "cs0_dq23_tx_de-skew", - "cs0_dqs2_rx_de-skew", - "cs0_dqs2p_tx_de-skew", - "cs0_dqs2n_tx_de-skew", - - "cs0_dm3_rx_de-skew", - "cs0_dm3_tx_de-skew", - "cs0_dq24_rx_de-skew", - "cs0_dq24_tx_de-skew", - "cs0_dq25_rx_de-skew", - "cs0_dq25_tx_de-skew", - "cs0_dq26_rx_de-skew", - "cs0_dq26_tx_de-skew", - "cs0_dq27_rx_de-skew", - "cs0_dq27_tx_de-skew", - "cs0_dq28_rx_de-skew", - "cs0_dq28_tx_de-skew", - "cs0_dq29_rx_de-skew", - "cs0_dq29_tx_de-skew", - "cs0_dq30_rx_de-skew", - "cs0_dq30_tx_de-skew", - "cs0_dq31_rx_de-skew", - "cs0_dq31_tx_de-skew", - "cs0_dqs3_rx_de-skew", - "cs0_dqs3p_tx_de-skew", - "cs0_dqs3n_tx_de-skew", -}; - -static const char * const rk3328_dts_cs1_timing[] = { - "cs1_dm0_rx_de-skew", - "cs1_dm0_tx_de-skew", - "cs1_dq0_rx_de-skew", - "cs1_dq0_tx_de-skew", - "cs1_dq1_rx_de-skew", - "cs1_dq1_tx_de-skew", - "cs1_dq2_rx_de-skew", - "cs1_dq2_tx_de-skew", - "cs1_dq3_rx_de-skew", - "cs1_dq3_tx_de-skew", - "cs1_dq4_rx_de-skew", - "cs1_dq4_tx_de-skew", - "cs1_dq5_rx_de-skew", - "cs1_dq5_tx_de-skew", - "cs1_dq6_rx_de-skew", - "cs1_dq6_tx_de-skew", - "cs1_dq7_rx_de-skew", - "cs1_dq7_tx_de-skew", - "cs1_dqs0_rx_de-skew", - "cs1_dqs0p_tx_de-skew", - "cs1_dqs0n_tx_de-skew", - - "cs1_dm1_rx_de-skew", - "cs1_dm1_tx_de-skew", - "cs1_dq8_rx_de-skew", - "cs1_dq8_tx_de-skew", - "cs1_dq9_rx_de-skew", - "cs1_dq9_tx_de-skew", - "cs1_dq10_rx_de-skew", - "cs1_dq10_tx_de-skew", - "cs1_dq11_rx_de-skew", - "cs1_dq11_tx_de-skew", - "cs1_dq12_rx_de-skew", - "cs1_dq12_tx_de-skew", - "cs1_dq13_rx_de-skew", - "cs1_dq13_tx_de-skew", - "cs1_dq14_rx_de-skew", - "cs1_dq14_tx_de-skew", - "cs1_dq15_rx_de-skew", - "cs1_dq15_tx_de-skew", - "cs1_dqs1_rx_de-skew", - "cs1_dqs1p_tx_de-skew", - "cs1_dqs1n_tx_de-skew", - - "cs1_dm2_rx_de-skew", - "cs1_dm2_tx_de-skew", - "cs1_dq16_rx_de-skew", - "cs1_dq16_tx_de-skew", - "cs1_dq17_rx_de-skew", - "cs1_dq17_tx_de-skew", - "cs1_dq18_rx_de-skew", - "cs1_dq18_tx_de-skew", - "cs1_dq19_rx_de-skew", - "cs1_dq19_tx_de-skew", - "cs1_dq20_rx_de-skew", - "cs1_dq20_tx_de-skew", - "cs1_dq21_rx_de-skew", - "cs1_dq21_tx_de-skew", - "cs1_dq22_rx_de-skew", - "cs1_dq22_tx_de-skew", - "cs1_dq23_rx_de-skew", - "cs1_dq23_tx_de-skew", - "cs1_dqs2_rx_de-skew", - "cs1_dqs2p_tx_de-skew", - "cs1_dqs2n_tx_de-skew", - - "cs1_dm3_rx_de-skew", - "cs1_dm3_tx_de-skew", - "cs1_dq24_rx_de-skew", - "cs1_dq24_tx_de-skew", - "cs1_dq25_rx_de-skew", - "cs1_dq25_tx_de-skew", - "cs1_dq26_rx_de-skew", - "cs1_dq26_tx_de-skew", - "cs1_dq27_rx_de-skew", - "cs1_dq27_tx_de-skew", - "cs1_dq28_rx_de-skew", - "cs1_dq28_tx_de-skew", - "cs1_dq29_rx_de-skew", - "cs1_dq29_tx_de-skew", - "cs1_dq30_rx_de-skew", - "cs1_dq30_tx_de-skew", - "cs1_dq31_rx_de-skew", - "cs1_dq31_tx_de-skew", - "cs1_dqs3_rx_de-skew", - "cs1_dqs3p_tx_de-skew", - "cs1_dqs3n_tx_de-skew", -}; - -struct rk3328_ddr_dts_config_timing { - unsigned int ddr3_speed_bin; - unsigned int ddr4_speed_bin; - unsigned int pd_idle; - unsigned int sr_idle; - unsigned int sr_mc_gate_idle; - unsigned int srpd_lite_idle; - unsigned int standby_idle; - - unsigned int auto_pd_dis_freq; - unsigned int auto_sr_dis_freq; - /* for ddr3 only */ - unsigned int ddr3_dll_dis_freq; - /* for ddr4 only */ - unsigned int ddr4_dll_dis_freq; - unsigned int phy_dll_dis_freq; - - unsigned int ddr3_odt_dis_freq; - unsigned int phy_ddr3_odt_dis_freq; - unsigned int ddr3_drv; - unsigned int ddr3_odt; - unsigned int phy_ddr3_ca_drv; - unsigned int phy_ddr3_ck_drv; - unsigned int phy_ddr3_dq_drv; - unsigned int phy_ddr3_odt; - - unsigned int lpddr3_odt_dis_freq; - unsigned int phy_lpddr3_odt_dis_freq; - unsigned int lpddr3_drv; - unsigned int lpddr3_odt; - unsigned int phy_lpddr3_ca_drv; - unsigned int phy_lpddr3_ck_drv; - unsigned int phy_lpddr3_dq_drv; - unsigned int phy_lpddr3_odt; - - unsigned int lpddr4_odt_dis_freq; - unsigned int phy_lpddr4_odt_dis_freq; - unsigned int lpddr4_drv; - unsigned int lpddr4_dq_odt; - unsigned int lpddr4_ca_odt; - unsigned int phy_lpddr4_ca_drv; - unsigned int phy_lpddr4_ck_cs_drv; - unsigned int phy_lpddr4_dq_drv; - unsigned int phy_lpddr4_odt; - - unsigned int ddr4_odt_dis_freq; - unsigned int phy_ddr4_odt_dis_freq; - unsigned int ddr4_drv; - unsigned int ddr4_odt; - unsigned int phy_ddr4_ca_drv; - unsigned int phy_ddr4_ck_drv; - unsigned int phy_ddr4_dq_drv; - unsigned int phy_ddr4_odt; - - unsigned int ca_skew[15]; - unsigned int cs0_skew[44]; - unsigned int cs1_skew[44]; - - unsigned int available; -}; - -struct rk3328_ddr_de_skew_setting { - unsigned int ca_de_skew[30]; - unsigned int cs0_de_skew[84]; - unsigned int cs1_de_skew[84]; -}; - -struct rk3328_dmcfreq { - struct device *dev; - struct devfreq *devfreq; - struct devfreq_simple_ondemand_data ondemand_data; - struct clk *dmc_clk; - struct devfreq_event_dev *edev; - struct mutex lock; - struct regulator *vdd_center; - unsigned long rate, target_rate; - unsigned long volt, target_volt; - - int (*set_auto_self_refresh)(u32 en); -}; - -static void -rk3328_de_skew_setting_2_register(struct rk3328_ddr_de_skew_setting *de_skew, - struct rk3328_ddr_dts_config_timing *tim) -{ - u32 n; - u32 offset; - u32 shift; - - memset_io(tim->ca_skew, 0, sizeof(tim->ca_skew)); - memset_io(tim->cs0_skew, 0, sizeof(tim->cs0_skew)); - memset_io(tim->cs1_skew, 0, sizeof(tim->cs1_skew)); - - /* CA de-skew */ - for (n = 0; n < ARRAY_SIZE(de_skew->ca_de_skew); n++) { - offset = n / 2; - shift = n % 2; - /* 0 => 4; 1 => 0 */ - shift = (shift == 0) ? 4 : 0; - tim->ca_skew[offset] &= ~(0xf << shift); - tim->ca_skew[offset] |= (de_skew->ca_de_skew[n] << shift); - } - - /* CS0 data de-skew */ - for (n = 0; n < ARRAY_SIZE(de_skew->cs0_de_skew); n++) { - offset = ((n / 21) * 11) + ((n % 21) / 2); - shift = ((n % 21) % 2); - if ((n % 21) == 20) - shift = 0; - else - /* 0 => 4; 1 => 0 */ - shift = (shift == 0) ? 4 : 0; - tim->cs0_skew[offset] &= ~(0xf << shift); - tim->cs0_skew[offset] |= (de_skew->cs0_de_skew[n] << shift); - } - - /* CS1 data de-skew */ - for (n = 0; n < ARRAY_SIZE(de_skew->cs1_de_skew); n++) { - offset = ((n / 21) * 11) + ((n % 21) / 2); - shift = ((n % 21) % 2); - if ((n % 21) == 20) - shift = 0; - else - /* 0 => 4; 1 => 0 */ - shift = (shift == 0) ? 4 : 0; - tim->cs1_skew[offset] &= ~(0xf << shift); - tim->cs1_skew[offset] |= (de_skew->cs1_de_skew[n] << shift); - } -} - -static void of_get_rk3328_timings(struct device *dev, - struct device_node *np, uint32_t *timing) -{ - struct device_node *np_tim; - u32 *p; - struct rk3328_ddr_dts_config_timing *dts_timing; - struct rk3328_ddr_de_skew_setting *de_skew; - int ret = 0; - u32 i; - - dts_timing = - (struct rk3328_ddr_dts_config_timing *)(timing + - DTS_PAR_OFFSET / 4); - - np_tim = of_parse_phandle(np, "ddr_timing", 0); - if (!np_tim) { - ret = -EINVAL; - goto end; - } - de_skew = kmalloc(sizeof(*de_skew), GFP_KERNEL); - if (!de_skew) { - ret = -ENOMEM; - goto end; - } - - p = (u32 *)dts_timing; - for (i = 0; i < ARRAY_SIZE(rk3328_dts_timing); i++) { - ret |= of_property_read_u32(np_tim, rk3328_dts_timing[i], - p + i); - } - p = (u32 *)de_skew->ca_de_skew; - for (i = 0; i < ARRAY_SIZE(rk3328_dts_ca_timing); i++) { - ret |= of_property_read_u32(np_tim, rk3328_dts_ca_timing[i], - p + i); - } - p = (u32 *)de_skew->cs0_de_skew; - for (i = 0; i < ARRAY_SIZE(rk3328_dts_cs0_timing); i++) { - ret |= of_property_read_u32(np_tim, rk3328_dts_cs0_timing[i], - p + i); - } - p = (u32 *)de_skew->cs1_de_skew; - for (i = 0; i < ARRAY_SIZE(rk3328_dts_cs1_timing); i++) { - ret |= of_property_read_u32(np_tim, rk3328_dts_cs1_timing[i], - p + i); - } - if (!ret) - rk3328_de_skew_setting_2_register(de_skew, dts_timing); - - kfree(de_skew); -end: - if (!ret) { - dts_timing->available = 1; - } else { - dts_timing->available = 0; - dev_err(dev, "of_get_ddr_timings: fail\n"); - } - - of_node_put(np_tim); -} - -static int rockchip_ddr_set_auto_self_refresh(uint32_t en) -{ - struct arm_smccc_res res; - - ddr_psci_param->sr_idle_en = en; - - arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, - SHARE_PAGE_TYPE_DDR, 0, ROCKCHIP_SIP_CONFIG_DRAM_SET_AT_SR, - 0, 0, 0, 0, &res); - - return res.a0; -} - -static int rk3328_dmc_init(struct platform_device *pdev, - struct rk3328_dmcfreq *dmcfreq) -{ - struct arm_smccc_res res; - u32 size, page_num; - - arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, - 0, 0, ROCKCHIP_SIP_CONFIG_DRAM_GET_VERSION, - 0, 0, 0, 0, &res); - if (res.a0 || (res.a1 < 0x101)) { - dev_err(&pdev->dev, - "trusted firmware need to update or is invalid\n"); - return -ENXIO; - } - - dev_notice(&pdev->dev, "current ATF version 0x%lx\n", res.a1); - - /* - * first 4KB is used for interface parameters - * after 4KB * N is dts parameters - */ - size = sizeof(struct rk3328_ddr_dts_config_timing); - page_num = DIV_ROUND_UP(size, 4096) + 1; - - arm_smccc_smc(ROCKCHIP_SIP_SHARE_MEM, - page_num, SHARE_PAGE_TYPE_DDR, 0, - 0, 0, 0, 0, &res); - if (res.a0 != 0) { - dev_err(&pdev->dev, "no ATF memory for init\n"); - return -ENOMEM; - } - - ddr_psci_param = ioremap(res.a1, page_num << 12); - of_get_rk3328_timings(&pdev->dev, pdev->dev.of_node, - (uint32_t *)ddr_psci_param); - - arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, - SHARE_PAGE_TYPE_DDR, 0, ROCKCHIP_SIP_CONFIG_DRAM_INIT, - 0, 0, 0, 0, &res); - if (res.a0) { - dev_err(&pdev->dev, "Rockchip dram init error %lx\n", res.a0); - return -ENOMEM; - } - - dmcfreq->set_auto_self_refresh = rockchip_ddr_set_auto_self_refresh; - - return 0; -} - -static int rk3328_dmcfreq_target(struct device *dev, unsigned long *freq, - u32 flags) -{ - struct rk3328_dmcfreq *dmcfreq = dev_get_drvdata(dev); - struct dev_pm_opp *opp; - unsigned long old_clk_rate = dmcfreq->rate; - unsigned long target_volt, target_rate; - int err; - - opp = devfreq_recommended_opp(dev, freq, flags); - if (IS_ERR(opp)) - return PTR_ERR(opp); - - target_rate = dev_pm_opp_get_freq(opp); - target_volt = dev_pm_opp_get_voltage(opp); - dev_pm_opp_put(opp); - - if (dmcfreq->rate == target_rate) - return 0; - - mutex_lock(&dmcfreq->lock); - - /* - * If frequency scaling from low to high, adjust voltage first. - * If frequency scaling from high to low, adjust frequency first. - */ - if (old_clk_rate < target_rate) { - err = regulator_set_voltage(dmcfreq->vdd_center, target_volt, - target_volt); - if (err) { - dev_err(dev, "Cannot set voltage %lu uV\n", - target_volt); - goto out; - } - } - - err = clk_set_rate(dmcfreq->dmc_clk, target_rate); - if (err) { - dev_err(dev, "Cannot set frequency %lu (%d)\n", target_rate, - err); - regulator_set_voltage(dmcfreq->vdd_center, dmcfreq->volt, - dmcfreq->volt); - goto out; - } - - /* - * Check the dpll rate, - * There only two result we will get, - * 1. Ddr frequency scaling fail, we still get the old rate. - * 2. Ddr frequency scaling sucessful, we get the rate we set. - */ - dmcfreq->rate = clk_get_rate(dmcfreq->dmc_clk); - - /* If get the incorrect rate, set voltage to old value. */ - if (dmcfreq->rate != target_rate) { - dev_err(dev, "Got wrong frequency, Request %lu, Current %lu\n", - target_rate, dmcfreq->rate); - regulator_set_voltage(dmcfreq->vdd_center, dmcfreq->volt, - dmcfreq->volt); - goto out; - } else if (old_clk_rate > target_rate) - err = regulator_set_voltage(dmcfreq->vdd_center, target_volt, - target_volt); - if (err) - dev_err(dev, "Cannot set voltage %lu uV\n", target_volt); - - dmcfreq->rate = target_rate; - dmcfreq->volt = target_volt; - -out: - mutex_unlock(&dmcfreq->lock); - return err; -} - -static int rk3328_dmcfreq_get_dev_status(struct device *dev, - struct devfreq_dev_status *stat) -{ - struct rk3328_dmcfreq *dmcfreq = dev_get_drvdata(dev); - struct devfreq_event_data edata; - int ret = 0; - - ret = devfreq_event_get_event(dmcfreq->edev, &edata); - if (ret < 0) - return ret; - - stat->current_frequency = dmcfreq->rate; - stat->busy_time = edata.load_count; - stat->total_time = edata.total_count; - - return ret; -} - -static int rk3328_dmcfreq_get_cur_freq(struct device *dev, unsigned long *freq) -{ - struct rk3328_dmcfreq *dmcfreq = dev_get_drvdata(dev); - - *freq = dmcfreq->rate; - - return 0; -} - -static struct devfreq_dev_profile rk3328_devfreq_dmc_profile = { - .polling_ms = 200, - .target = rk3328_dmcfreq_target, - .get_dev_status = rk3328_dmcfreq_get_dev_status, - .get_cur_freq = rk3328_dmcfreq_get_cur_freq, -}; - -static __maybe_unused int rk3328_dmcfreq_suspend(struct device *dev) -{ - struct rk3328_dmcfreq *dmcfreq = dev_get_drvdata(dev); - int ret = 0; - - ret = devfreq_event_disable_edev(dmcfreq->edev); - if (ret < 0) { - dev_err(dev, "failed to disable the devfreq-event devices\n"); - return ret; - } - - ret = devfreq_suspend_device(dmcfreq->devfreq); - if (ret < 0) { - dev_err(dev, "failed to suspend the devfreq devices\n"); - return ret; - } - - return 0; -} - -static __maybe_unused int rk3328_dmcfreq_resume(struct device *dev) -{ - struct rk3328_dmcfreq *dmcfreq = dev_get_drvdata(dev); - int ret = 0; - - ret = devfreq_event_enable_edev(dmcfreq->edev); - if (ret < 0) { - dev_err(dev, "failed to enable the devfreq-event devices\n"); - return ret; - } - - ret = devfreq_resume_device(dmcfreq->devfreq); - if (ret < 0) { - dev_err(dev, "failed to resume the devfreq devices\n"); - return ret; - } - return ret; -} - -static SIMPLE_DEV_PM_OPS(rk3328_dmcfreq_pm, rk3328_dmcfreq_suspend, - rk3328_dmcfreq_resume); - -static int rk3328_dmcfreq_probe(struct platform_device *pdev) -{ - struct device *dev = &pdev->dev; - struct device_node *np = pdev->dev.of_node; - struct rk3328_dmcfreq *data; - struct dev_pm_opp *opp; - int ret; - - data = devm_kzalloc(dev, sizeof(struct rk3328_dmcfreq), GFP_KERNEL); - if (!data) - return -ENOMEM; - - mutex_init(&data->lock); - - data->vdd_center = devm_regulator_get(dev, "center"); - if (IS_ERR(data->vdd_center)) { - if (PTR_ERR(data->vdd_center) == -EPROBE_DEFER) - return -EPROBE_DEFER; - - dev_err(dev, "Cannot get the regulator \"center\"\n"); - return PTR_ERR(data->vdd_center); - } - - data->dmc_clk = devm_clk_get(dev, "dmc_clk"); - if (IS_ERR(data->dmc_clk)) { - if (PTR_ERR(data->dmc_clk) == -EPROBE_DEFER) - return -EPROBE_DEFER; - - dev_err(dev, "Cannot get the clk dmc_clk\n"); - return PTR_ERR(data->dmc_clk); - } - - data->edev = devfreq_event_get_edev_by_phandle(dev, 0); - if (IS_ERR(data->edev)) - return -EPROBE_DEFER; - - ret = devfreq_event_enable_edev(data->edev); - if (ret < 0) { - dev_err(dev, "failed to enable devfreq-event devices\n"); - return ret; - } - - ret = rk3328_dmc_init(pdev, data); - if (ret) - return ret; - - /* - * We add a devfreq driver to our parent since it has a device tree node - * with operating points. - */ - if (dev_pm_opp_of_add_table(dev)) { - dev_err(dev, "Invalid operating-points in device tree.\n"); - return -EINVAL; - } - - of_property_read_u32(np, "upthreshold", - &data->ondemand_data.upthreshold); - of_property_read_u32(np, "downdifferential", - &data->ondemand_data.downdifferential); - - data->rate = clk_get_rate(data->dmc_clk); - - opp = devfreq_recommended_opp(dev, &data->rate, 0); - if (IS_ERR(opp)) { - ret = PTR_ERR(opp); - goto err_free_opp; - } - - data->rate = dev_pm_opp_get_freq(opp); - data->volt = dev_pm_opp_get_voltage(opp); - dev_pm_opp_put(opp); - - rk3328_devfreq_dmc_profile.initial_freq = data->rate; - - data->devfreq = devm_devfreq_add_device(dev, - &rk3328_devfreq_dmc_profile, - DEVFREQ_GOV_SIMPLE_ONDEMAND, - &data->ondemand_data); - if (IS_ERR(data->devfreq)) { - ret = PTR_ERR(data->devfreq); - goto err_free_opp; - } - - devm_devfreq_register_opp_notifier(dev, data->devfreq); - - data->dev = dev; - platform_set_drvdata(pdev, data); - - return 0; - -err_free_opp: - dev_pm_opp_of_remove_table(&pdev->dev); - return ret; -} - -static int rk3328_dmcfreq_remove(struct platform_device *pdev) -{ - struct rk3328_dmcfreq *dmcfreq = dev_get_drvdata(&pdev->dev); - - /* - * Before remove the opp table we need to unregister the opp notifier. - */ - devm_devfreq_unregister_opp_notifier(dmcfreq->dev, dmcfreq->devfreq); - dev_pm_opp_of_remove_table(dmcfreq->dev); - - return 0; -} - -static const struct of_device_id rk3328dmc_devfreq_of_match[] = { - { .compatible = "rockchip,rk3328-dmc" }, - { }, -}; -MODULE_DEVICE_TABLE(of, rk3328dmc_devfreq_of_match); - -static struct platform_driver rk3328_dmcfreq_driver = { - .probe = rk3328_dmcfreq_probe, - .remove = rk3328_dmcfreq_remove, - .driver = { - .name = "rk3328-dmc-freq", - .pm = &rk3328_dmcfreq_pm, - .of_match_table = rk3328dmc_devfreq_of_match, - }, -}; -module_platform_driver(rk3328_dmcfreq_driver); - -MODULE_LICENSE("GPL v2"); -MODULE_AUTHOR("Lin Huang "); -MODULE_DESCRIPTION("RK3328 dmcfreq driver with devfreq framework"); diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/include/dt-bindings/clock/rockchip-ddr.h b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/include/dt-bindings/clock/rockchip-ddr.h deleted file mode 100644 index b065432..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/include/dt-bindings/clock/rockchip-ddr.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * Copyright (C) 2017 ROCKCHIP, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef _DT_BINDINGS_CLOCK_ROCKCHIP_DDR_H -#define _DT_BINDINGS_CLOCK_ROCKCHIP_DDR_H - -#define DDR2_DEFAULT (0) - -#define DDR3_800D (0) /* 5-5-5 */ -#define DDR3_800E (1) /* 6-6-6 */ -#define DDR3_1066E (2) /* 6-6-6 */ -#define DDR3_1066F (3) /* 7-7-7 */ -#define DDR3_1066G (4) /* 8-8-8 */ -#define DDR3_1333F (5) /* 7-7-7 */ -#define DDR3_1333G (6) /* 8-8-8 */ -#define DDR3_1333H (7) /* 9-9-9 */ -#define DDR3_1333J (8) /* 10-10-10 */ -#define DDR3_1600G (9) /* 8-8-8 */ -#define DDR3_1600H (10) /* 9-9-9 */ -#define DDR3_1600J (11) /* 10-10-10 */ -#define DDR3_1600K (12) /* 11-11-11 */ -#define DDR3_1866J (13) /* 10-10-10 */ -#define DDR3_1866K (14) /* 11-11-11 */ -#define DDR3_1866L (15) /* 12-12-12 */ -#define DDR3_1866M (16) /* 13-13-13 */ -#define DDR3_2133K (17) /* 11-11-11 */ -#define DDR3_2133L (18) /* 12-12-12 */ -#define DDR3_2133M (19) /* 13-13-13 */ -#define DDR3_2133N (20) /* 14-14-14 */ -#define DDR3_DEFAULT (21) -#define DDR_DDR2 (22) -#define DDR_LPDDR (23) -#define DDR_LPDDR2 (24) - -#define DDR4_1600J (0) /* 10-10-10 */ -#define DDR4_1600K (1) /* 11-11-11 */ -#define DDR4_1600L (2) /* 12-12-12 */ -#define DDR4_1866L (3) /* 12-12-12 */ -#define DDR4_1866M (4) /* 13-13-13 */ -#define DDR4_1866N (5) /* 14-14-14 */ -#define DDR4_2133N (6) /* 14-14-14 */ -#define DDR4_2133P (7) /* 15-15-15 */ -#define DDR4_2133R (8) /* 16-16-16 */ -#define DDR4_2400P (9) /* 15-15-15 */ -#define DDR4_2400R (10) /* 16-16-16 */ -#define DDR4_2400U (11) /* 18-18-18 */ -#define DDR4_DEFAULT (12) - -#define PAUSE_CPU_STACK_SIZE 16 - -#endif diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/include/dt-bindings/memory/rk3328-dram.h b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/include/dt-bindings/memory/rk3328-dram.h deleted file mode 100644 index 171f41c..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/files/include/dt-bindings/memory/rk3328-dram.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef _DT_BINDINGS_DRAM_ROCKCHIP_RK3328_H -#define _DT_BINDINGS_DRAM_ROCKCHIP_RK3328_H - -#define DDR3_DS_34ohm (34) -#define DDR3_DS_40ohm (40) - -#define DDR3_ODT_DIS (0) -#define DDR3_ODT_40ohm (40) -#define DDR3_ODT_60ohm (60) -#define DDR3_ODT_120ohm (120) - -#define LP2_DS_34ohm (34) -#define LP2_DS_40ohm (40) -#define LP2_DS_48ohm (48) -#define LP2_DS_60ohm (60) -#define LP2_DS_68_6ohm (68) /* optional */ -#define LP2_DS_80ohm (80) -#define LP2_DS_120ohm (120) /* optional */ - -#define LP3_DS_34ohm (34) -#define LP3_DS_40ohm (40) -#define LP3_DS_48ohm (48) -#define LP3_DS_60ohm (60) -#define LP3_DS_80ohm (80) -#define LP3_DS_34D_40U (3440) -#define LP3_DS_40D_48U (4048) -#define LP3_DS_34D_48U (3448) - -#define LP3_ODT_DIS (0) -#define LP3_ODT_60ohm (60) -#define LP3_ODT_120ohm (120) -#define LP3_ODT_240ohm (240) - -#define LP4_PDDS_40ohm (40) -#define LP4_PDDS_48ohm (48) -#define LP4_PDDS_60ohm (60) -#define LP4_PDDS_80ohm (80) -#define LP4_PDDS_120ohm (120) -#define LP4_PDDS_240ohm (240) - -#define LP4_DQ_ODT_40ohm (40) -#define LP4_DQ_ODT_48ohm (48) -#define LP4_DQ_ODT_60ohm (60) -#define LP4_DQ_ODT_80ohm (80) -#define LP4_DQ_ODT_120ohm (120) -#define LP4_DQ_ODT_240ohm (240) -#define LP4_DQ_ODT_DIS (0) - -#define LP4_CA_ODT_40ohm (40) -#define LP4_CA_ODT_48ohm (48) -#define LP4_CA_ODT_60ohm (60) -#define LP4_CA_ODT_80ohm (80) -#define LP4_CA_ODT_120ohm (120) -#define LP4_CA_ODT_240ohm (240) -#define LP4_CA_ODT_DIS (0) - -#define DDR4_DS_34ohm (34) -#define DDR4_DS_48ohm (48) -#define DDR4_RTT_NOM_DIS (0) -#define DDR4_RTT_NOM_60ohm (60) -#define DDR4_RTT_NOM_120ohm (120) -#define DDR4_RTT_NOM_40ohm (40) -#define DDR4_RTT_NOM_240ohm (240) -#define DDR4_RTT_NOM_48ohm (48) -#define DDR4_RTT_NOM_80ohm (80) -#define DDR4_RTT_NOM_34ohm (34) - -#define PHY_DDR3_RON_RTT_DISABLE (0) -#define PHY_DDR3_RON_RTT_451ohm (1) -#define PHY_DDR3_RON_RTT_225ohm (2) -#define PHY_DDR3_RON_RTT_150ohm (3) -#define PHY_DDR3_RON_RTT_112ohm (4) -#define PHY_DDR3_RON_RTT_90ohm (5) -#define PHY_DDR3_RON_RTT_75ohm (6) -#define PHY_DDR3_RON_RTT_64ohm (7) -#define PHY_DDR3_RON_RTT_56ohm (16) -#define PHY_DDR3_RON_RTT_50ohm (17) -#define PHY_DDR3_RON_RTT_45ohm (18) -#define PHY_DDR3_RON_RTT_41ohm (19) -#define PHY_DDR3_RON_RTT_37ohm (20) -#define PHY_DDR3_RON_RTT_34ohm (21) -#define PHY_DDR3_RON_RTT_33ohm (22) -#define PHY_DDR3_RON_RTT_30ohm (23) -#define PHY_DDR3_RON_RTT_28ohm (24) -#define PHY_DDR3_RON_RTT_26ohm (25) -#define PHY_DDR3_RON_RTT_25ohm (26) -#define PHY_DDR3_RON_RTT_23ohm (27) -#define PHY_DDR3_RON_RTT_22ohm (28) -#define PHY_DDR3_RON_RTT_21ohm (29) -#define PHY_DDR3_RON_RTT_20ohm (30) -#define PHY_DDR3_RON_RTT_19ohm (31) - -#define PHY_DDR4_LPDDR3_RON_RTT_DISABLE (0) -#define PHY_DDR4_LPDDR3_RON_RTT_480ohm (1) -#define PHY_DDR4_LPDDR3_RON_RTT_240ohm (2) -#define PHY_DDR4_LPDDR3_RON_RTT_160ohm (3) -#define PHY_DDR4_LPDDR3_RON_RTT_120ohm (4) -#define PHY_DDR4_LPDDR3_RON_RTT_96ohm (5) -#define PHY_DDR4_LPDDR3_RON_RTT_80ohm (6) -#define PHY_DDR4_LPDDR3_RON_RTT_68ohm (7) -#define PHY_DDR4_LPDDR3_RON_RTT_60ohm (16) -#define PHY_DDR4_LPDDR3_RON_RTT_53ohm (17) -#define PHY_DDR4_LPDDR3_RON_RTT_48ohm (18) -#define PHY_DDR4_LPDDR3_RON_RTT_43ohm (19) -#define PHY_DDR4_LPDDR3_RON_RTT_40ohm (20) -#define PHY_DDR4_LPDDR3_RON_RTT_37ohm (21) -#define PHY_DDR4_LPDDR3_RON_RTT_34ohm (22) -#define PHY_DDR4_LPDDR3_RON_RTT_32ohm (23) -#define PHY_DDR4_LPDDR3_RON_RTT_30ohm (24) -#define PHY_DDR4_LPDDR3_RON_RTT_28ohm (25) -#define PHY_DDR4_LPDDR3_RON_RTT_26ohm (26) -#define PHY_DDR4_LPDDR3_RON_RTT_25ohm (27) -#define PHY_DDR4_LPDDR3_RON_RTT_24ohm (28) -#define PHY_DDR4_LPDDR3_RON_RTT_22ohm (29) -#define PHY_DDR4_LPDDR3_RON_RTT_21ohm (30) -#define PHY_DDR4_LPDDR3_RON_RTT_20ohm (31) - -#endif /*_DT_BINDINGS_DRAM_ROCKCHIP_RK3328_H*/ diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/Makefile b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/Makefile deleted file mode 100644 index f05fe85..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.mk - -DEVICE_VARS += UBOOT_DEVICE_NAME - -define Build/Compile - $(CP) $(LINUX_DIR)/COPYING $(KDIR)/COPYING.linux -endef - -### Image scripts ### -define Build/boot-common - # This creates a new folder copies the dtb (as rockchip.dtb) - # and the kernel image (as kernel.img) - rm -fR $@.boot - mkdir -p $@.boot - - $(CP) $(DTS_DIR)/$(DEVICE_DTS).dtb $@.boot/rockchip.dtb - $(CP) $(IMAGE_KERNEL) $@.boot/kernel.img -endef - -define Build/boot-script - # Make an U-boot image and copy it to the boot partition - mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $(if $(1),$(1),mmc).bootscript $@.boot/boot.scr -endef - -define Build/pine64-img - # Creates the final SD/eMMC images, - # combining boot partition, root partition as well as the u-boot bootloader - - # Generate a new partition table in $@ with 32 MiB of - # alignment padding for the idbloader and u-boot to fit: - # http://opensource.rock-chips.com/wiki_Boot_option#Boot_flow - # - # U-Boot SPL expects the U-Boot ITB to be located at sector 0x4000 (8 MiB) on the MMC storage - PADDING=1 $(SCRIPT_DIR)/gen_image_generic.sh \ - $@ \ - $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \ - 32768 - - # Copy the idbloader and the u-boot image to the image at sector 0x40 and 0x4000 - dd if="$(STAGING_DIR_IMAGE)"/$(UBOOT_DEVICE_NAME)-idbloader.img of="$@" seek=64 conv=notrunc - dd if="$(STAGING_DIR_IMAGE)"/$(UBOOT_DEVICE_NAME)-u-boot.itb of="$@" seek=16384 conv=notrunc -endef - -define Build/pine64-bin - # Typical Rockchip boot flow with Rockchip miniloader - # Rockchp idbLoader which is combinded by Rockchip ddr init bin - # and miniloader bin from Rockchip rkbin project - - # Generate a new partition table in $@ with 32 MiB of alignment - # padding for the idbloader, uboot and trust image to fit: - # http://opensource.rock-chips.com/wiki_Boot_option#Boot_flow - PADDING=1 $(SCRIPT_DIR)/gen_image_generic.sh \ - $@ \ - $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \ - 32768 - - # Copy the idbloader, uboot and trust image to the image at sector 0x40, 0x4000 and 0x6000 - dd if="$(STAGING_DIR_IMAGE)"/$(SOC)-idbloader.bin of="$@" seek=64 conv=notrunc - dd if="$(STAGING_DIR_IMAGE)"/$(UBOOT_DEVICE_NAME)-uboot.img of="$@" seek=16384 conv=notrunc - dd if="$(STAGING_DIR_IMAGE)"/$(SOC)-trust.bin of="$@" seek=24576 conv=notrunc -endef - -### Devices ### -define Device/Default - PROFILES := Default - KERNEL := kernel-bin - IMAGES := sysupgrade.img.gz - DEVICE_DTS = rockchip/$$(SOC)-$(lastword $(subst _, ,$(1))) -endef - -include $(SUBTARGET).mk - -$(eval $(call BuildImage)) diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/armv8.mk b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/armv8.mk deleted file mode 100644 index 807ecb1..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/armv8.mk +++ /dev/null @@ -1,64 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Copyright (C) 2020 Tobias Maedel - -define Device/friendlyarm_nanopi-r2c - DEVICE_VENDOR := FriendlyARM - DEVICE_MODEL := NanoPi R2C - SOC := rk3328 - UBOOT_DEVICE_NAME := nanopi-r2c-rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata - DEVICE_PACKAGES := kmod-usb-net-rtl8152 -endef -TARGET_DEVICES += friendlyarm_nanopi-r2c - -define Device/friendlyarm_nanopi-r2s - DEVICE_VENDOR := FriendlyARM - DEVICE_MODEL := NanoPi R2S - SOC := rk3328 - UBOOT_DEVICE_NAME := nanopi-r2s-rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata - DEVICE_PACKAGES := kmod-usb-net-rtl8152 -endef -TARGET_DEVICES += friendlyarm_nanopi-r2s - -define Device/friendlyarm_nanopi-r4s - DEVICE_VENDOR := FriendlyARM - DEVICE_MODEL := NanoPi R4S - SOC := rk3399 - UBOOT_DEVICE_NAME := nanopi-r4s-rk3399 - IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r4s | pine64-bin | gzip | append-metadata - DEVICE_PACKAGES := kmod-r8168 -urngd -endef -TARGET_DEVICES += friendlyarm_nanopi-r4s - -define Device/pine64_rockpro64 - DEVICE_VENDOR := Pine64 - DEVICE_MODEL := RockPro64 - SOC := rk3399 - UBOOT_DEVICE_NAME := rockpro64-rk3399 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata - DEVICE_PACKAGES := -urngd -endef -TARGET_DEVICES += pine64_rockpro64 - -define Device/radxa_rock-pi-4 - DEVICE_VENDOR := Radxa - DEVICE_MODEL := ROCK Pi 4 - SOC := rk3399 - SUPPORTED_DEVICES := radxa,rockpi4 - UBOOT_DEVICE_NAME := rock-pi-4-rk3399 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata - DEVICE_PACKAGES := brcmfmac-firmware-43456-sdio brcmfmac-nvram-43456-sdio kmod-brcmfmac -urngd -endef -TARGET_DEVICES += radxa_rock-pi-4 - -define Device/xunlong_orangepi-r1-plus - DEVICE_VENDOR := Xunlong - DEVICE_MODEL := Orange Pi R1 Plus - SOC := rk3328 - UBOOT_DEVICE_NAME := orangepi-r1-plus-rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata - DEVICE_PACKAGES := kmod-usb-net-rtl8152 -endef -TARGET_DEVICES += xunlong_orangepi-r1-plus diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/mmc.bootscript b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/mmc.bootscript deleted file mode 100644 index b70a62c..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/mmc.bootscript +++ /dev/null @@ -1,8 +0,0 @@ -part uuid mmc ${devnum}:2 uuid - -setenv bootargs "console=ttyS2,1500000 console=tty1 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait" - -load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb -load mmc ${devnum}:1 ${kernel_addr_r} kernel.img - -booti ${kernel_addr_r} - ${fdt_addr_r} diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/nanopi-r2s.bootscript b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/nanopi-r2s.bootscript deleted file mode 100644 index 5198881..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/nanopi-r2s.bootscript +++ /dev/null @@ -1,8 +0,0 @@ -part uuid mmc ${devnum}:2 uuid - -setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff130000 root=PARTUUID=${uuid} rw rootwait" - -load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb -load mmc ${devnum}:1 ${kernel_addr_r} kernel.img - -booti ${kernel_addr_r} - ${fdt_addr_r} diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/nanopi-r4s.bootscript b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/nanopi-r4s.bootscript deleted file mode 100644 index abe9c24..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/image/nanopi-r4s.bootscript +++ /dev/null @@ -1,8 +0,0 @@ -part uuid mmc ${devnum}:2 uuid - -setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait" - -load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb -load mmc ${devnum}:1 ${kernel_addr_r} kernel.img - -booti ${kernel_addr_r} - ${fdt_addr_r} diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/modules.mk b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/modules.mk deleted file mode 100644 index 4942878..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/modules.mk +++ /dev/null @@ -1,63 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Copyright (C) 2020 OpenWrt.org - -define KernelPackage/drm-rockchip - SUBMENU:=$(VIDEO_MENU) - TITLE:=Rockchip DRM support - DEPENDS:=@TARGET_rockchip +kmod-backlight +kmod-drm-kms-helper +kmod-multimedia-input - KCONFIG:= \ - CONFIG_DRM_ROCKCHIP \ - CONFIG_DRM_LOAD_EDID_FIRMWARE=y \ - CONFIG_DRM_FBDEV_EMULATION=y \ - CONFIG_DRM_FBDEV_OVERALLOC=100 \ - CONFIG_DRM_BRIDGE \ - CONFIG_HDMI \ - CONFIG_PHY_ROCKCHIP_INNO_HDMI \ - CONFIG_DRM_DW_HDMI \ - CONFIG_DRM_DW_HDMI_CEC \ - CONFIG_ROCKCHIP_ANALOGIX_DP=n \ - CONFIG_ROCKCHIP_CDN_DP=n \ - CONFIG_ROCKCHIP_DW_HDMI=y \ - CONFIG_ROCKCHIP_INNO_HDMI=y \ - CONFIG_ROCKCHIP_DW_MIPI_DSI=y \ - CONFIG_ROCKCHIP_LVDS=y \ - CONFIG_ROCKCHIP_RGB=n \ - CONFIG_ROCKCHIP_RK3066_HDMI=n \ - CONFIG_DRM_PANEL \ - CONFIG_DRM_PANEL_BRIDGE \ - CONFIG_DRM_PANEL_SIMPLE - FILES:= \ - $(LINUX_DIR)/drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko \ - $(LINUX_DIR)/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.ko \ - $(LINUX_DIR)/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.ko \ - $(LINUX_DIR)/drivers/media/cec/cec.ko \ - $(LINUX_DIR)/drivers/phy/rockchip/phy-rockchip-inno-hdmi.ko \ - $(LINUX_DIR)/drivers/gpu/drm/panel/panel-simple.ko \ - $(LINUX_DIR)/drivers/gpu/drm/rockchip/rockchipdrm.ko - AUTOLOAD:=$(call AutoProbe,rockchipdrm phy-rockchip-inno-hdmi dw-hdmi-cec) -endef - -define KernelPackage/drm-rockchip/description - Direct Rendering Manager (DRM) support for Rockchip -endef - -$(eval $(call KernelPackage,drm-rockchip)) - -define KernelPackage/saradc-rockchip - SUBMENU:=$(IIO_MENU) - TITLE:=Rockchip SARADC support - DEPENDS:=@TARGET_rockchip +kmod-industrialio-triggered-buffer - KCONFIG:= \ - CONFIG_RESET_CONTROLLER=y \ - CONFIG_ROCKCHIP_SARADC - FILES:= \ - $(LINUX_DIR)/drivers/iio/adc/rockchip_saradc.ko - AUTOLOAD:=$(call AutoProbe,rockchip_saradc) -endef - -define KernelPackage/saradc-rockchip/description - Support for the SARADC found in SoCs from Rockchip -endef - -$(eval $(call KernelPackage,saradc-rockchip)) diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/001-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/001-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch deleted file mode 100644 index 69ee8a7..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/001-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch +++ /dev/null @@ -1,404 +0,0 @@ -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 - -This adds support for the NanoPi R2S from FriendlyARM. - -Rockchip RK3328 SoC -1GB DDR4 RAM -Gigabit Ethernet (WAN) -Gigabit Ethernet (USB3) (LAN) -USB 2.0 Host Port -MicroSD slot -Reset button -WAN - LAN - SYS LED - -Signed-off-by: David Bauer ---- - arch/arm64/boot/dts/rockchip/Makefile | 1 + - .../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 -+++ b/arch/arm64/boot/dts/rockchip/Makefile -@@ -1,6 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-evb.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb -+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-roc-cc.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-evb-act8846.dtb ---- /dev/null -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -0,0 +1,368 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2020 David Bauer -+ */ -+ -+/dts-v1/; -+ -+#include -+#include -+#include "rk3328.dtsi" -+ -+/ { -+ model = "FriendlyElec NanoPi R2S"; -+ compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328"; -+ -+ chosen { -+ stdout-path = "serial2:1500000n8"; -+ }; -+ -+ gmac_clk: gmac-clock { -+ compatible = "fixed-clock"; -+ clock-frequency = <125000000>; -+ clock-output-names = "gmac_clk"; -+ #clock-cells = <0>; -+ }; -+ -+ keys { -+ compatible = "gpio-keys"; -+ pinctrl-0 = <&reset_button_pin>; -+ pinctrl-names = "default"; -+ -+ 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"; -+ -+ lan_led: led-0 { -+ gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; -+ label = "nanopi-r2s:green:lan"; -+ }; -+ -+ 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"; -+ }; -+ }; -+ -+ 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"; -+ 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>; -+ }; -+ -+ 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>; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <&vdd_arm>; -+}; -+ -+&cpu1 { -+ cpu-supply = <&vdd_arm>; -+}; -+ -+&cpu2 { -+ cpu-supply = <&vdd_arm>; -+}; -+ -+&cpu3 { -+ cpu-supply = <&vdd_arm>; -+}; -+ -+&gmac2io { -+ assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>; -+ assigned-clock-parents = <&gmac_clk>, <&gmac_clk>; -+ clock_in_out = "input"; -+ phy-handle = <&rtl8211e>; -+ phy-mode = "rgmii"; -+ phy-supply = <&vcc_io_33>; -+ pinctrl-0 = <&rgmiim1_pins>; -+ pinctrl-names = "default"; -+ rx_delay = <0x18>; -+ snps,aal; -+ tx_delay = <0x24>; -+ status = "okay"; -+ -+ mdio { -+ compatible = "snps,dwmac-mdio"; -+ #address-cells = <1>; -+ #size-cells = <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>; -+ }; -+ }; -+}; -+ -+&i2c1 { -+ status = "okay"; -+ -+ rk805: pmic@18 { -+ compatible = "rockchip,rk805"; -+ reg = <0x18>; -+ interrupt-parent = <&gpio1>; -+ interrupts = <24 IRQ_TYPE_LEVEL_LOW>; -+ #clock-cells = <1>; -+ clock-output-names = "xin32k", "rk805-clkout2"; -+ gpio-controller; -+ #gpio-cells = <2>; -+ pinctrl-0 = <&pmic_int_l>; -+ pinctrl-names = "default"; -+ rockchip,system-power-controller; -+ wakeup-source; -+ -+ 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_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-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1000000>; -+ }; -+ }; -+ -+ 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-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <950000>; -+ }; -+ }; -+ -+ vcc_ddr: DCDC_REG3 { -+ regulator-name = "vcc_ddr"; -+ regulator-always-on; -+ regulator-boot-on; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ 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>; -+ }; -+ }; -+ -+ vcc_18: LDO_REG1 { -+ regulator-name = "vcc_18"; -+ 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>; -+ }; -+ }; -+ -+ vcc18_emmc: LDO_REG2 { -+ regulator-name = "vcc18_emmc"; -+ 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>; -+ }; -+ }; -+ -+ vdd_10: LDO_REG3 { -+ regulator-name = "vdd_10"; -+ 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>; -+ }; -+ }; -+ }; -+ }; -+}; -+ -+&io_domains { -+ pmuio-supply = <&vcc_io_33>; -+ vccio1-supply = <&vcc_io_33>; -+ vccio2-supply = <&vcc18_emmc>; -+ vccio3-supply = <&vcc_io_sdio>; -+ vccio4-supply = <&vcc_18>; -+ vccio5-supply = <&vcc_io_33>; -+ vccio6-supply = <&vcc_io_33>; -+ status = "okay"; -+}; -+ -+&pinctrl { -+ button { -+ reset_button_pin: reset-button-pin { -+ 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 = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ sd { -+ sdio_vcc_pin: sdio-vcc-pin { -+ rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+}; -+ -+&pwm2 { -+ status = "okay"; -+}; -+ -+&sdmmc { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ disable-wp; -+ pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>; -+ pinctrl-names = "default"; -+ sd-uhs-sdr12; -+ sd-uhs-sdr25; -+ sd-uhs-sdr50; -+ sd-uhs-sdr104; -+ vmmc-supply = <&vcc_sd>; -+ vqmmc-supply = <&vcc_io_sdio>; -+ status = "okay"; -+}; -+ -+&tsadc { -+ rockchip,hw-tshut-mode = <0>; -+ rockchip,hw-tshut-polarity = <0>; -+ status = "okay"; -+}; -+ -+&u2phy { -+ status = "okay"; -+}; -+ -+&u2phy_host { -+ status = "okay"; -+}; -+ -+&u2phy_otg { -+ status = "okay"; -+}; -+ -+&uart2 { -+ status = "okay"; -+}; -+ -+&usb20_otg { -+ status = "okay"; -+ dr_mode = "host"; -+}; -+ -+&usb_host0_ehci { -+ status = "okay"; -+}; -+ -+&usb_host0_ohci { -+ status = "okay"; -+}; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/002-net-usb-r8152-add-LED-configuration-from-OF.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/002-net-usb-r8152-add-LED-configuration-from-OF.patch deleted file mode 100644 index a96661c..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/002-net-usb-r8152-add-LED-configuration-from-OF.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 82985725e071f2a5735052f18e109a32aeac3a0b Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Sun, 26 Jul 2020 02:38:31 +0200 -Subject: [PATCH] net: usb: r8152: add LED configuration from OF - -This adds the ability to configure the LED configuration register using -OF. This way, the correct value for board specific LED configuration can -be determined. - -Signed-off-by: David Bauer ---- - drivers/net/usb/r8152.c | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - ---- a/drivers/net/usb/r8152.c -+++ b/drivers/net/usb/r8152.c -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -4336,6 +4337,22 @@ static void rtl_tally_reset(struct r8152 - ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); - } - -+static int r8152_led_configuration(struct r8152 *tp) -+{ -+ u32 led_data; -+ int ret; -+ -+ ret = of_property_read_u32(tp->udev->dev.of_node, "realtek,led-data", -+ &led_data); -+ -+ if (ret) -+ return ret; -+ -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_LEDSEL, led_data); -+ -+ return 0; -+} -+ - static void r8152b_init(struct r8152 *tp) - { - u32 ocp_data; -@@ -4377,6 +4394,8 @@ static void r8152b_init(struct r8152 *tp - ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); - ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); - ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); -+ -+ r8152_led_configuration(tp); - } - - static void r8153_init(struct r8152 *tp) -@@ -4511,6 +4530,8 @@ static void r8153_init(struct r8152 *tp) - tp->coalesce = COALESCE_SLOW; - break; - } -+ -+ r8152_led_configuration(tp); - } - - static void r8153b_init(struct r8152 *tp) -@@ -4587,6 +4608,8 @@ static void r8153b_init(struct r8152 *tp - rtl_tally_reset(tp); - - tp->coalesce = 15000; /* 15 us */ -+ -+ r8152_led_configuration(tp); - } - - static int rtl8152_pre_reset(struct usb_interface *intf) diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/003-dt-bindings-net-add-RTL8152-binding-documentation.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/003-dt-bindings-net-add-RTL8152-binding-documentation.patch deleted file mode 100644 index be262b9..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/003-dt-bindings-net-add-RTL8152-binding-documentation.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 3ee05f4aa64fc86af3be5bc176ba5808de9260a7 Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Sun, 26 Jul 2020 15:30:33 +0200 -Subject: [PATCH] dt-bindings: net: add RTL8152 binding documentation - -Add binding documentation for the Realtek RTL8152 / RTL8153 USB ethernet -adapters. - -Signed-off-by: David Bauer ---- - .../bindings/net/realtek,rtl8152.yaml | 36 +++++++++++++++++++ - 1 file changed, 36 insertions(+) - create mode 100644 Documentation/devicetree/bindings/net/realtek,rtl8152.yaml - ---- /dev/null -+++ b/Documentation/devicetree/bindings/net/realtek,rtl8152.yaml -@@ -0,0 +1,36 @@ -+# SPDX-License-Identifier: GPL-2.0 -+%YAML 1.2 -+--- -+$id: http://devicetree.org/schemas/net/realtek,rtl8152.yaml# -+$schema: http://devicetree.org/meta-schemas/core.yaml# -+ -+title: Realtek RTL8152/RTL8153 series USB ethernet -+ -+maintainers: -+ - David Bauer -+ -+properties: -+ compatible: -+ oneOf: -+ - items: -+ - enum: -+ - realtek,rtl8152 -+ - realtek,rtl8153 -+ -+ reg: -+ description: The device number on the USB bus -+ -+ realtek,led-data: -+ description: Value to be written to the LED configuration register. -+ -+required: -+ - compatible -+ - reg -+ -+examples: -+ - | -+ usb-eth@2 { -+ compatible = "realtek,rtl8153"; -+ reg = <2>; -+ realtek,led-data = <0x87>; -+ }; -\ No newline at end of file diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch deleted file mode 100644 index 83ce8f1..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 8a469ee35606ba65448d54e5a2a23302f7e79e3c Mon Sep 17 00:00:00 2001 -From: Carlos de Paula -Date: Tue, 18 Feb 2020 17:10:37 -0500 -Subject: [PATCH] arm64: dts: rockchip: Add txpbl node for RK3399/RK3328 - -Some rockchip SoCs like the RK3399 and RK3328 exhibit an issue -where tx checksumming does not work with packets larger than 1498. - -The default Programmable Buffer Length for TX in these GMAC's is -not suitable for MTUs higher than 1498. The workaround is to disable -TX offloading with 'ethtool -K eth0 tx off rx off' causing performance -impacts as it disables hardware checksumming. - -This patch sets snps,txpbl to 0x4 which is a safe number tested ok for -the most popular MTU value of 1500. - -For reference, see https://lkml.org/lkml/2019/4/1/1382. - -Signed-off-by: Carlos de Paula -Link: https://lore.kernel.org/r/20200218221040.10955-1-me@carlosedp.com -Signed-off-by: Heiko Stuebner ---- - arch/arm64/boot/dts/rockchip/rk3328.dtsi | 2 ++ - arch/arm64/boot/dts/rockchip/rk3399.dtsi | 1 + - 2 files changed, 3 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -857,6 +857,7 @@ - resets = <&cru SRST_GMAC2IO_A>; - reset-names = "stmmaceth"; - rockchip,grf = <&grf>; -+ snps,txpbl = <0x4>; - status = "disabled"; - }; - -@@ -878,6 +879,7 @@ - reset-names = "stmmaceth", "mac-phy"; - phy-mode = "rmii"; - phy-handle = <&phy>; -+ snps,txpbl = <0x4>; - status = "disabled"; - - mdio { ---- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -291,6 +291,7 @@ - resets = <&cru SRST_A_GMAC>; - reset-names = "stmmaceth"; - rockchip,grf = <&grf>; -+ snps,txpbl = <0x4>; - status = "disabled"; - }; - diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/006-rockchip-rk3328-fix-NanoPi-R2S-GMAC-clock-name.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/006-rockchip-rk3328-fix-NanoPi-R2S-GMAC-clock-name.patch deleted file mode 100644 index 15c8ad7..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/006-rockchip-rk3328-fix-NanoPi-R2S-GMAC-clock-name.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f2962ed3805c5b74948d00e4e6fbb33388261ba8 Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Sun, 4 Oct 2020 16:43:29 +0200 -Subject: [PATCH] rockchip: rk3328: fix NanoPi R2S GMAC clock name - -This commit fixes the name for the GMAC clock to gmac_clkin, as this is -the name of the clock provided by the rk3328-clk driver. - -Without this commit, the GMAC will not work in TX direction. - -Suggested-by: Tobias Waldvogel -Signed-off-by: David Bauer ---- - arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -20,7 +20,7 @@ - gmac_clk: gmac-clock { - compatible = "fixed-clock"; - clock-frequency = <125000000>; -- clock-output-names = "gmac_clk"; -+ clock-output-names = "gmac_clkin"; - #clock-cells = <0>; - }; - diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/007-arm64-dts-rockchip-Add-RK3328-idle-state.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/007-arm64-dts-rockchip-Add-RK3328-idle-state.patch deleted file mode 100644 index 874d4dd..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/007-arm64-dts-rockchip-Add-RK3328-idle-state.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 4f279f9fbca54464173240f7e73b145a136dfa1e Mon Sep 17 00:00:00 2001 -From: Robin Murphy -Date: Sun, 29 Dec 2019 20:16:17 +0000 -Subject: arm64: dts: rockchip: Add RK3328 idle state - -Downstream RK3328 DTBs describe a CPU idle state matching that present -on other SoCs like RK3399. This works with upstream Trusted Firmware-A -too, so let's add it here. - -Signed-off-by: Robin Murphy -Link: https://lore.kernel.org/r/a8c83e705d387446ea8121516d410e38b2d9c57b.1577640736.git.robin.murphy@arm.com -Signed-off-by: Heiko Stuebner ---- - arch/arm64/boot/dts/rockchip/rk3328.dtsi | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -41,6 +41,7 @@ - reg = <0x0 0x0>; - clocks = <&cru ARMCLK>; - #cooling-cells = <2>; -+ cpu-idle-states = <&CPU_SLEEP>; - dynamic-power-coefficient = <120>; - enable-method = "psci"; - next-level-cache = <&l2>; -@@ -53,6 +54,7 @@ - reg = <0x0 0x1>; - clocks = <&cru ARMCLK>; - #cooling-cells = <2>; -+ cpu-idle-states = <&CPU_SLEEP>; - dynamic-power-coefficient = <120>; - enable-method = "psci"; - next-level-cache = <&l2>; -@@ -65,6 +67,7 @@ - reg = <0x0 0x2>; - clocks = <&cru ARMCLK>; - #cooling-cells = <2>; -+ cpu-idle-states = <&CPU_SLEEP>; - dynamic-power-coefficient = <120>; - enable-method = "psci"; - next-level-cache = <&l2>; -@@ -77,12 +80,26 @@ - reg = <0x0 0x3>; - clocks = <&cru ARMCLK>; - #cooling-cells = <2>; -+ cpu-idle-states = <&CPU_SLEEP>; - dynamic-power-coefficient = <120>; - enable-method = "psci"; - next-level-cache = <&l2>; - operating-points-v2 = <&cpu0_opp_table>; - }; - -+ idle-states { -+ entry-method = "psci"; -+ -+ CPU_SLEEP: cpu-sleep { -+ compatible = "arm,idle-state"; -+ local-timer-stop; -+ arm,psci-suspend-param = <0x0010000>; -+ entry-latency-us = <120>; -+ exit-latency-us = <250>; -+ min-residency-us = <900>; -+ }; -+ }; -+ - l2: l2-cache0 { - compatible = "cache"; - }; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/008-rockchip-add-hwmon-support-for-SoCs-and-GPUs.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/008-rockchip-add-hwmon-support-for-SoCs-and-GPUs.patch deleted file mode 100644 index 7ea18e4..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/008-rockchip-add-hwmon-support-for-SoCs-and-GPUs.patch +++ /dev/null @@ -1,53 +0,0 @@ -From d27970b82a0f552f70e76fab154855b3192aac23 Mon Sep 17 00:00:00 2001 -From: Stefan Schaeckeler -Date: Wed, 11 Dec 2019 22:17:02 -0800 -Subject: thermal: rockchip: Enable hwmon - -By default, of-based thermal drivers do not enable hwmon. -Explicitly enable hwmon for both, the soc and gpu temperature -sensor. - -Signed-off-by: Stefan Schaeckeler -Tested-by: Daniel Lezcano -Signed-off-by: Daniel Lezcano -Link: https://lore.kernel.org/r/20191212061702.BFE2D6E85603@corona.crabdance.com ---- - drivers/thermal/rockchip_thermal.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - ---- a/drivers/thermal/rockchip_thermal.c -+++ b/drivers/thermal/rockchip_thermal.c -@@ -58,6 +58,8 @@ enum adc_sort_mode { - ADC_INCREMENT, - }; - -+#include "thermal_hwmon.h" -+ - /** - * The max sensors is two in rockchip SoCs. - * Two sensors: CPU and GPU sensor. -@@ -1321,8 +1323,15 @@ static int rockchip_thermal_probe(struct - - thermal->chip->control(thermal->regs, true); - -- for (i = 0; i < thermal->chip->chn_num; i++) -+ for (i = 0; i < thermal->chip->chn_num; i++) { - rockchip_thermal_toggle_sensor(&thermal->sensors[i], true); -+ thermal->sensors[i].tzd->tzp->no_hwmon = false; -+ error = thermal_add_hwmon_sysfs(thermal->sensors[i].tzd); -+ if (error) -+ dev_warn(&pdev->dev, -+ "failed to register sensor %d with hwmon: %d\n", -+ i, error); -+ } - - platform_set_drvdata(pdev, thermal); - -@@ -1344,6 +1353,7 @@ static int rockchip_thermal_remove(struc - for (i = 0; i < thermal->chip->chn_num; i++) { - struct rockchip_thermal_sensor *sensor = &thermal->sensors[i]; - -+ thermal_remove_hwmon_sysfs(sensor->tzd); - rockchip_thermal_toggle_sensor(sensor, false); - } - diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/009-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/009-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch deleted file mode 100644 index c508d71..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/009-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch +++ /dev/null @@ -1,177 +0,0 @@ -From db792e9adbf85ffc9d6b0b060ac3c8e3148c8992 Mon Sep 17 00:00:00 2001 -From: Tianling Shen -Date: Fri, 19 Mar 2021 13:16:27 +0800 -Subject: [PATCH] rockchip: rk3399: Add support for FriendlyARM NanoPi R4S - -This adds support for the NanoPi R4S from FriendlyArm. - -Rockchip RK3399 SoC -1GB DDR3 or 4GB LPDDR4 RAM -Gigabit Ethernet (WAN) -Gigabit Ethernet (PCIe) (LAN) -USB 3.0 Port x 2 -MicroSD slot -Reset button -WAN - LAN - SYS LED - -Co-developed-by: Jensen Huang -Signed-off-by: Jensen Huang -[minor adjustments] -Co-developed-by: Marty Jones -Signed-off-by: Marty Jones -[further adjustments, fixed format issues] -Signed-off-by: Tianling Shen -Link: https://lore.kernel.org/r/20210319051627.814-2-cnsztl@gmail.com -Signed-off-by: Heiko Stuebner ---- - arch/arm64/boot/dts/rockchip/Makefile | 1 + - .../boot/dts/rockchip/rk3399-nanopi-r4s.dts | 133 +++++++++++++++++++++ - 2 files changed, 134 insertions(+) - create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts - ---- a/arch/arm64/boot/dts/rockchip/Makefile -+++ b/arch/arm64/boot/dts/rockchip/Makefile -@@ -25,6 +25,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-le - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopc-t4.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb -+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb ---- /dev/null -+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -@@ -0,0 +1,133 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * FriendlyElec NanoPC-T4 board device tree source -+ * -+ * Copyright (c) 2020 FriendlyElec Computer Tech. Co., Ltd. -+ * (http://www.friendlyarm.com) -+ * -+ * Copyright (c) 2018 Collabora Ltd. -+ * -+ * Copyright (c) 2020 Jensen Huang -+ * Copyright (c) 2020 Marty Jones -+ * Copyright (c) 2021 Tianling Shen -+ */ -+ -+/dts-v1/; -+#include "rk3399-nanopi4.dtsi" -+ -+/ { -+ model = "FriendlyElec NanoPi R4S"; -+ compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399"; -+ -+ /delete-node/ display-subsystem; -+ -+ gpio-leds { -+ pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>; -+ -+ /delete-node/ status; -+ -+ lan_led: led-lan { -+ gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>; -+ label = "green:lan"; -+ }; -+ -+ sys_led: led-sys { -+ gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>; -+ label = "red:sys"; -+ default-state = "on"; -+ }; -+ -+ wan_led: led-wan { -+ gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; -+ label = "green:wan"; -+ }; -+ }; -+ -+ gpio-keys { -+ pinctrl-0 = <&reset_button_pin>; -+ -+ /delete-node/ power; -+ -+ reset { -+ debounce-interval = <50>; -+ gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>; -+ label = "reset"; -+ linux,code = ; -+ }; -+ }; -+ -+ vdd_5v: vdd-5v { -+ compatible = "regulator-fixed"; -+ regulator-name = "vdd_5v"; -+ regulator-always-on; -+ regulator-boot-on; -+ }; -+}; -+ -+&emmc_phy { -+ status = "disabled"; -+}; -+ -+&i2c4 { -+ status = "disabled"; -+}; -+ -+&pcie0 { -+ max-link-speed = <1>; -+ num-lanes = <1>; -+ vpcie3v3-supply = <&vcc3v3_sys>; -+}; -+ -+&pinctrl { -+ gpio-leds { -+ /delete-node/ leds-gpio; -+ -+ lan_led_pin: lan-led-pin { -+ rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ sys_led_pin: sys-led-pin { -+ rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ wan_led_pin: wan-led-pin { -+ rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ rockchip-key { -+ /delete-node/ power-key; -+ -+ reset_button_pin: reset-button-pin { -+ rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+}; -+ -+&sdhci { -+ status = "disabled"; -+}; -+ -+&sdio0 { -+ status = "disabled"; -+}; -+ -+&u2phy0_host { -+ phy-supply = <&vdd_5v>; -+}; -+ -+&u2phy1_host { -+ status = "disabled"; -+}; -+ -+&uart0 { -+ status = "disabled"; -+}; -+ -+&usbdrd_dwc3_0 { -+ dr_mode = "host"; -+}; -+ -+&vcc3v3_sys { -+ vin-supply = <&vcc5v0_sys>; -+}; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/010-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/010-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch deleted file mode 100644 index cd6640f..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/010-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 43f3999d1836117ab2e601aec9a9e6f292ce4958 Mon Sep 17 00:00:00 2001 -From: Tianling Shen -Date: Mon, 7 Jun 2021 15:45:37 +0800 -Subject: [PATCH] arm64: dts: rockchip: add EEPROM node for NanoPi R4S - -NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which -stores the MAC address. - -Signed-off-by: Tianling Shen ---- - .../boot/dts/rockchip/rk3399-nanopi-r4s.dts | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -@@ -68,6 +68,24 @@ - status = "disabled"; - }; - -+&gmac { -+ nvmem-cells = <&mac_address>; -+ nvmem-cell-names = "mac-address"; -+}; -+ -+&i2c2 { -+ eeprom@51 { -+ compatible = "microchip,24c02", "atmel,24c02"; -+ reg = <0x51>; -+ pagesize = <16>; -+ size = <256>; -+ -+ mac_address: mac-address@fa { -+ reg = <0xfa 0x06>; -+ }; -+ }; -+}; -+ - &i2c4 { - status = "disabled"; - }; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/101-dts-rockchip-add-usb3-controller-node-for-RK3328-SoCs.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/101-dts-rockchip-add-usb3-controller-node-for-RK3328-SoCs.patch deleted file mode 100644 index 621b25a..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/101-dts-rockchip-add-usb3-controller-node-for-RK3328-SoCs.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: William Wu - -RK3328 has one USB 3.0 OTG controller which uses DWC_USB3 -core's general architecture. It can act as static xHCI host -controller, static device controller, USB 3.0/2.0 OTG basing -on ID of USB3.0 PHY. - -Signed-off-by: William Wu -Signed-off-by: Leonidas P. Papadakos - ---- - -NOTE: This binding still has issues. From the original thread: - -the rk3328 usb3-phy has an issue with detecting any plugin events -after a previous device got removed - see the inno-usb3-phy driver -in the vendor kernel. - -The current state is good-enough for enabling the USB3 attached LAN -port of the NanoPi R2S. However, it might explode depending on your -use-case. You've been warned. - ---- - arch/arm64/boot/dts/rockchip/rk3328.dtsi | 27 ++++++++++++++++++++++++ - 1 file changed, 27 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -955,6 +955,33 @@ - status = "disabled"; - }; - -+ usbdrd3: usb@ff600000 { -+ compatible = "rockchip,rk3328-dwc3", "rockchip,rk3399-dwc3"; -+ clocks = <&cru SCLK_USB3OTG_REF>, <&cru SCLK_USB3OTG_SUSPEND>, -+ <&cru ACLK_USB3OTG>; -+ clock-names = "ref_clk", "suspend_clk", -+ "bus_clk"; -+ #address-cells = <2>; -+ #size-cells = <2>; -+ ranges; -+ status = "disabled"; -+ -+ usbdrd_dwc3: dwc3@ff600000 { -+ compatible = "snps,dwc3"; -+ reg = <0x0 0xff600000 0x0 0x100000>; -+ interrupts = ; -+ dr_mode = "otg"; -+ phy_type = "utmi_wide"; -+ snps,dis_enblslpm_quirk; -+ snps,dis-u2-freeclk-exists-quirk; -+ snps,dis_u2_susphy_quirk; -+ snps,dis_u3_susphy_quirk; -+ snps,dis-del-phy-power-chg-quirk; -+ snps,dis-tx-ipgap-linecheck-quirk; -+ status = "disabled"; -+ }; -+ }; -+ - gic: interrupt-controller@ff811000 { - compatible = "arm,gic-400"; - #interrupt-cells = <3>; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/102-rockchip-enable-LAN-port-on-NanoPi-R2S.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/102-rockchip-enable-LAN-port-on-NanoPi-R2S.patch deleted file mode 100644 index 37dcb88..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/102-rockchip-enable-LAN-port-on-NanoPi-R2S.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 7cde8541d04e0ade5d126bdada3cf0c0429eaa99 Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Fri, 10 Jul 2020 21:12:16 +0200 -Subject: [PATCH] rockchip: enabled LAN port on NanoPi R2S - -Enable the USB3 port on the FriendlyARM NanoPi R2S. -This is required for the USB3 attached LAN port to work. - -Signed-off-by: David Bauer ---- - .../boot/dts/rockchip/rk3328-nanopi-r2s.dts | 27 +++++++++++++++++++ - 1 file changed, 27 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -103,6 +103,18 @@ - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - }; -+ -+ vcc_rtl8153: vcc-rtl8153-regulator { -+ compatible = "regulator-fixed"; -+ gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&rtl8153_en_drv>; -+ regulator-always-on; -+ regulator-name = "vcc_rtl8153"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ enable-active-high; -+ }; - }; - - &cpu0 { -@@ -320,6 +332,12 @@ - rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>; - }; - }; -+ -+ usb { -+ rtl8153_en_drv: rtl8153-en-drv { -+ rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; - }; - - &pwm2 { -@@ -375,3 +393,12 @@ - &usb_host0_ohci { - status = "okay"; - }; -+ -+&usbdrd3 { -+ status = "okay"; -+}; -+ -+&usbdrd_dwc3 { -+ dr_mode = "host"; -+ status = "okay"; -+}; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch deleted file mode 100644 index e318f31..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 2795c8b31a686bdb8338f9404d18ef7a154f0d75 Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Sun, 26 Jul 2020 13:32:59 +0200 -Subject: [PATCH] arm64: rockchip: add OF node for USB eth on NanoPi R2S - -This adds the OF node for the USB3 ethernet adapter on the FriendlyARM -NanoPi R2S. Add the correct value for the RTL8153 LED configuration -register to match the blink behavior of the other port on the device. - -Signed-off-by: David Bauer ---- - arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -401,4 +401,11 @@ - &usbdrd_dwc3 { - dr_mode = "host"; - status = "okay"; -+ -+ usb-eth@2 { -+ compatible = "realtek,rtl8153"; -+ reg = <2>; -+ -+ realtek,led-data = <0x87>; -+ }; - }; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch deleted file mode 100644 index 1abab5e..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e12f67fe83446432ef16704c22ec23bd1dbcd094 Mon Sep 17 00:00:00 2001 -From: Vicente Bergas -Date: Tue, 1 Dec 2020 16:41:32 +0100 -Subject: arm64: dts: rockchip: use USB host by default on rk3399-rock-pi-4 - -Based on the board schematics at -https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi_4c_v12_sch_20200620.pdf -on page 19 there is an USB Type-A receptacle being used as an USB-OTG port. - -But the Type-A connector is not valid for OTG operation, for this reason -there is a switch to select host or device role. -This is non-compliant and error prone because switching is manual. -So, use host mode as it corresponds for a Type-A receptacle. - -Signed-off-by: Vicente Bergas -Link: https://lore.kernel.org/r/20201201154132.1286-4-vicencb@gmail.com -Signed-off-by: Heiko Stuebner ---- - arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts -@@ -684,7 +684,7 @@ - - &usbdrd_dwc3_0 { - status = "okay"; -- dr_mode = "otg"; -+ dr_mode = "host"; - }; - - &usbdrd3_1 { diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/105-mmc-core-set-initial-signal-voltage-on-power-off.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/105-mmc-core-set-initial-signal-voltage-on-power-off.patch deleted file mode 100644 index d462899..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/105-mmc-core-set-initial-signal-voltage-on-power-off.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0d329112c709d6cfedf0fffb19f0cc6b19043f6b Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Wed, 20 Feb 2019 07:38:34 +0000 -Subject: [PATCH] mmc: core: set initial signal voltage on power off - -Some boards have SD card connectors where the power rail cannot be switched -off by the driver. If the card has not been power cycled, it may still be -using 1.8V signaling after a warm re-boot. Bootroms expecting 3.3V signaling -will fail to boot from a UHS card that continue to use 1.8V signaling. - -Set initial signal voltage in mmc_power_off() to allow re-boot to function. - -This fixes re-boot with UHS cards on Asus Tinker Board (Rockchip RK3288), -same issue have been seen on some Rockchip RK3399 boards. - -I am sending this as a RFC because I have no insights into SD/MMC subsystem, -this change fix a re-boot issue on my boards and does not break emmc/sdio. -Is this an acceptable workaround? Any advice is appreciated. - -Signed-off-by: Jonas Karlman ---- - drivers/mmc/core/core.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/drivers/mmc/core/core.c -+++ b/drivers/mmc/core/core.c -@@ -1371,6 +1371,8 @@ void mmc_power_off(struct mmc_host *host - - mmc_pwrseq_power_off(host); - -+ mmc_set_initial_signal_voltage(host); -+ - host->ios.clock = 0; - host->ios.vdd = 0; - diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/106-arm64-rockchip-add-OF-node-for-pcie-eth-on-NanoPi-R4S.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/106-arm64-rockchip-add-OF-node-for-pcie-eth-on-NanoPi-R4S.patch deleted file mode 100644 index 563a7f6..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/106-arm64-rockchip-add-OF-node-for-pcie-eth-on-NanoPi-R4S.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -@@ -101,6 +101,19 @@ - max-link-speed = <1>; - num-lanes = <1>; - vpcie3v3-supply = <&vcc3v3_sys>; -+ -+ pcie@0 { -+ reg = <0x00000000 0 0 0 0>; -+ #address-cells = <3>; -+ #size-cells = <2>; -+ -+ pcie-eth@0,0 { -+ compatible = "realtek,r8168"; -+ reg = <0x000000 0 0 0 0>; -+ -+ realtek,led-data = <0x870>; -+ }; -+ }; - }; - - &pinctrl { diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/201-rockchip-rk3328-add-i2c0-controller-for-nanopi-r2s.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/201-rockchip-rk3328-add-i2c0-controller-for-nanopi-r2s.patch deleted file mode 100644 index 2879804..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/201-rockchip-rk3328-add-i2c0-controller-for-nanopi-r2s.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 3b7eb946b1d640d684a921e53e1e50985ab7eb89 Mon Sep 17 00:00:00 2001 -From: QiuSimons <45143996+QiuSimons@users.noreply.github.com> -Date: Tue, 4 Aug 2020 20:17:53 +0800 -Subject: [PATCH] rockchip: rk3328: add i2c0 controller for nanopi r2s - ---- - arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts | 4 ++++ - 1 files changed, 4 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -165,6 +165,10 @@ - }; - }; - -+&i2c0 { -+ status = "okay"; -+}; -+ - &i2c1 { - status = "okay"; - diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/202-rockchip-rk3328-Add-support-for-OrangePi-R1-Plus.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/202-rockchip-rk3328-Add-support-for-OrangePi-R1-Plus.patch deleted file mode 100644 index de9d9be..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/202-rockchip-rk3328-Add-support-for-OrangePi-R1-Plus.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- a/arch/arm64/boot/dts/rockchip/Makefile -+++ b/arch/arm64/boot/dts/rockchip/Makefile -@@ -2,6 +2,7 @@ - dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-evb.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb -+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-orangepi-r1-plus.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-roc-cc.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-evb-act8846.dtb ---- /dev/null -+++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts -@@ -0,0 +1,39 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+#include "rk3328-nanopi-r2s.dts" -+ -+/ { -+ model = "Xunlong Orange Pi R1 Plus"; -+ compatible = "xunlong,orangepi-r1-plus", "rockchip,rk3328"; -+}; -+ -+&lan_led { -+ label = "orangepi-r1-plus:green:lan"; -+}; -+ -+&spi0 { -+ max-freq = <48000000>; -+ status = "okay"; -+ -+ flash@0 { -+ compatible = "jedec,spi-nor"; -+ reg = <0>; -+ spi-max-frequency = <10000000>; -+ }; -+}; -+ -+&sys_led { -+ gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>; -+ label = "orangepi-r1-plus:red:sys"; -+}; -+ -+&sys_led_pin { -+ rockchip,pins = <3 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; -+}; -+ -+&uart1 { -+ status = "okay"; -+}; -+ -+&wan_led { -+ label = "orangepi-r1-plus:green:wan"; -+}; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/203-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/203-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch deleted file mode 100644 index 9e6dc67..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/203-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- a/arch/arm64/boot/dts/rockchip/Makefile -+++ b/arch/arm64/boot/dts/rockchip/Makefile -@@ -1,6 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-evb.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb -+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2c.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-orangepi-r1-plus.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb ---- /dev/null -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2c.dts -@@ -0,0 +1,47 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2021 FriendlyElec Computer Tech. Co., Ltd. -+ * (http://www.friendlyarm.com) -+ * -+ * Copyright (c) 2021 Tianling Shen -+ */ -+ -+/dts-v1/; -+ -+#include "rk3328-nanopi-r2s.dts" -+ -+/ { -+ model = "FriendlyElec NanoPi R2C"; -+ compatible = "friendlyarm,nanopi-r2c", "rockchip,rk3328"; -+}; -+ -+&gmac2io { -+ phy-handle = <&yt8521s>; -+ -+ mdio { -+ /delete-node/ ethernet-phy@1; -+ -+ yt8521s: ethernet-phy@3 { -+ compatible = "ethernet-phy-id0000.011a", -+ "ethernet-phy-ieee802.3-c22"; -+ reg = <3>; -+ pinctrl-0 = <ð_phy_reset_pin>; -+ pinctrl-names = "default"; -+ reset-assert-us = <10000>; -+ reset-deassert-us = <50000>; -+ reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+&lan_led { -+ label = "nanopi-r2c:green:lan"; -+}; -+ -+&sys_led { -+ label = "nanopi-r2c:red:sys"; -+}; -+ -+&wan_led { -+ label = "nanopi-r2c:green:wan"; -+}; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/600-net-phy-Add-driver-for-Motorcomm-YT85xx-PHYs.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/600-net-phy-Add-driver-for-Motorcomm-YT85xx-PHYs.patch deleted file mode 100644 index 2271308..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/600-net-phy-Add-driver-for-Motorcomm-YT85xx-PHYs.patch +++ /dev/null @@ -1,457 +0,0 @@ -From 5d6862cc5eac1679d7a4ef388f7c9bbc70e76770 Mon Sep 17 00:00:00 2001 -From: hmz007 -Date: Mon, 5 Jul 2021 17:03:00 +0800 -Subject: [PATCH] net: phy: Add driver for Motorcomm YT85xx PHYs - -Signed-off-by: hmz007 ---- - drivers/net/phy/Kconfig | 5 + - drivers/net/phy/Makefile | 1 + - drivers/net/phy/motorcomm.c | 346 ++++++++++++++++++++++++++++++++++ - include/linux/motorcomm_phy.h | 68 +++++++ - 4 files changed, 420 insertions(+) - create mode 100644 drivers/net/phy/motorcomm.c - create mode 100644 include/linux/motorcomm_phy.h - ---- a/drivers/net/phy/Kconfig -+++ b/drivers/net/phy/Kconfig -@@ -519,6 +519,11 @@ config MICROSEMI_PHY - ---help--- - Currently supports VSC8514, VSC8530, VSC8531, VSC8540 and VSC8541 PHYs - -+config MOTORCOMM_PHY -+ tristate "Motorcomm PHYs" -+ ---help--- -+ Supports the YT8010, YT8510, YT8511, YT8512 PHYs. -+ - config NATIONAL_PHY - tristate "National Semiconductor PHYs" - ---help--- ---- a/drivers/net/phy/Makefile -+++ b/drivers/net/phy/Makefile -@@ -98,6 +98,7 @@ obj-$(CONFIG_MICREL_PHY) += micrel.o - obj-$(CONFIG_MICROCHIP_PHY) += microchip.o - obj-$(CONFIG_MICROCHIP_T1_PHY) += microchip_t1.o - obj-$(CONFIG_MICROSEMI_PHY) += mscc.o -+obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm.o - obj-$(CONFIG_NATIONAL_PHY) += national.o - obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o - obj-$(CONFIG_QSEMI_PHY) += qsemi.o ---- /dev/null -+++ b/drivers/net/phy/motorcomm.c -@@ -0,0 +1,345 @@ -+/* -+ * drivers/net/phy/motorcomm.c -+ * -+ * Driver for Motorcomm PHYs -+ * -+ * Author: Leilei Zhao -+ * -+ * Copyright (c) 2019 Motorcomm, Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by the -+ * Free Software Foundation; either version 2 of the License, or (at your -+ * option) any later version. -+ * -+ * Support : Motorcomm Phys: -+ * Giga phys: yt8511, yt8521 -+ * 100/10 Phys : yt8512, yt8512b, yt8510 -+ * Automotive 100Mb Phys : yt8010 -+ * Automotive 100/10 hyper range Phys: yt8510 -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static int ytphy_read_ext(struct phy_device *phydev, u32 regnum) -+{ -+ int ret; -+ int val; -+ -+ ret = phy_write(phydev, REG_DEBUG_ADDR_OFFSET, regnum); -+ if (ret < 0) -+ return ret; -+ -+ val = phy_read(phydev, REG_DEBUG_DATA); -+ -+ return val; -+} -+ -+static int ytphy_write_ext(struct phy_device *phydev, u32 regnum, u16 val) -+{ -+ int ret; -+ -+ ret = phy_write(phydev, REG_DEBUG_ADDR_OFFSET, regnum); -+ if (ret < 0) -+ return ret; -+ -+ ret = phy_write(phydev, REG_DEBUG_DATA, val); -+ -+ return ret; -+} -+ -+static int yt8010_config_aneg(struct phy_device *phydev) -+{ -+ phydev->speed = SPEED_100; -+ return 0; -+} -+ -+static int yt8512_clk_init(struct phy_device *phydev) -+{ -+ int ret; -+ int val; -+ -+ val = ytphy_read_ext(phydev, YT8512_EXTREG_AFE_PLL); -+ if (val < 0) -+ return val; -+ -+ val |= YT8512_CONFIG_PLL_REFCLK_SEL_EN; -+ -+ ret = ytphy_write_ext(phydev, YT8512_EXTREG_AFE_PLL, val); -+ if (ret < 0) -+ return ret; -+ -+ val = ytphy_read_ext(phydev, YT8512_EXTREG_EXTEND_COMBO); -+ if (val < 0) -+ return val; -+ -+ val |= YT8512_CONTROL1_RMII_EN; -+ -+ ret = ytphy_write_ext(phydev, YT8512_EXTREG_EXTEND_COMBO, val); -+ if (ret < 0) -+ return ret; -+ -+ val = phy_read(phydev, MII_BMCR); -+ if (val < 0) -+ return val; -+ -+ val |= YT_SOFTWARE_RESET; -+ ret = phy_write(phydev, MII_BMCR, val); -+ -+ return ret; -+} -+ -+static int yt8512_led_init(struct phy_device *phydev) -+{ -+ int ret; -+ int val; -+ int mask; -+ -+ val = ytphy_read_ext(phydev, YT8512_EXTREG_LED0); -+ if (val < 0) -+ return val; -+ -+ val |= YT8512_LED0_ACT_BLK_IND; -+ -+ mask = YT8512_LED0_DIS_LED_AN_TRY | YT8512_LED0_BT_BLK_EN | -+ YT8512_LED0_HT_BLK_EN | YT8512_LED0_COL_BLK_EN | -+ YT8512_LED0_BT_ON_EN; -+ val &= ~mask; -+ -+ ret = ytphy_write_ext(phydev, YT8512_EXTREG_LED0, val); -+ if (ret < 0) -+ return ret; -+ -+ val = ytphy_read_ext(phydev, YT8512_EXTREG_LED1); -+ if (val < 0) -+ return val; -+ -+ val |= YT8512_LED1_BT_ON_EN; -+ -+ mask = YT8512_LED1_TXACT_BLK_EN | YT8512_LED1_RXACT_BLK_EN; -+ val &= ~mask; -+ -+ ret = ytphy_write_ext(phydev, YT8512_LED1_BT_ON_EN, val); -+ -+ return ret; -+} -+ -+static int yt8512_config_init(struct phy_device *phydev) -+{ -+ int ret; -+ int val; -+ -+ ret = yt8512_clk_init(phydev); -+ if (ret < 0) -+ return ret; -+ -+ ret = yt8512_led_init(phydev); -+ -+ /* disable auto sleep */ -+ val = ytphy_read_ext(phydev, YT8512_EXTREG_SLEEP_CONTROL1); -+ if (val < 0) -+ return val; -+ -+ val &= (~BIT(YT8512_EN_SLEEP_SW_BIT)); -+ -+ ret = ytphy_write_ext(phydev, YT8512_EXTREG_SLEEP_CONTROL1, val); -+ if (ret < 0) -+ return ret; -+ -+ return ret; -+} -+ -+static int yt8512_read_status(struct phy_device *phydev) -+{ -+ int ret; -+ int val; -+ int speed, speed_mode, duplex; -+ -+ ret = genphy_update_link(phydev); -+ if (ret) -+ return ret; -+ -+ val = phy_read(phydev, REG_PHY_SPEC_STATUS); -+ if (val < 0) -+ return val; -+ -+ duplex = (val & YT8512_DUPLEX) >> YT8512_DUPLEX_BIT; -+ speed_mode = (val & YT8512_SPEED_MODE) >> YT8512_SPEED_MODE_BIT; -+ switch (speed_mode) { -+ case 0: -+ speed = SPEED_10; -+ break; -+ case 1: -+ speed = SPEED_100; -+ break; -+ case 2: -+ case 3: -+ default: -+ speed = SPEED_UNKNOWN; -+ break; -+ } -+ -+ phydev->speed = speed; -+ phydev->duplex = duplex; -+ -+ return 0; -+} -+ -+static int yt8521_config_init(struct phy_device *phydev) -+{ -+ int ret; -+ int val; -+ -+ /* disable auto sleep */ -+ val = ytphy_read_ext(phydev, YT8521_EXTREG_SLEEP_CONTROL1); -+ if (val < 0) -+ return val; -+ -+ val &= (~BIT(YT8521_EN_SLEEP_SW_BIT)); -+ ret = ytphy_write_ext(phydev, YT8521_EXTREG_SLEEP_CONTROL1, val); -+ if (ret < 0) -+ return ret; -+ -+ /* switch to access UTP */ -+ ret = ytphy_write_ext(phydev, 0xa000, 0); -+ if (ret < 0) -+ return ret; -+ -+ /* enable RXC clock when no wire plug */ -+ val = ytphy_read_ext(phydev, 0xc); -+ if (val < 0) -+ return val; -+ -+ val &= ~(1 << 12); -+ ret = ytphy_write_ext(phydev, 0xc, val); -+ if (ret < 0) -+ return ret; -+ -+ /* output SyncE clock (125mhz) even link is down */ -+ ret = ytphy_write_ext(phydev, 0xa012, 0x38); -+ if (ret < 0) -+ return ret; -+ -+ /* disable rgmii clk 2ns delay */ -+ val = ytphy_read_ext(phydev, 0xa001); -+ if (val < 0) -+ return val; -+ -+ val &= ~(1 << 8); -+ ret = ytphy_write_ext(phydev, 0xa001, val); -+ if (ret < 0) -+ return ret; -+ -+ /* setup delay */ -+ val = (1 << 10) | (0xf << 4) | 5; -+ ret = ytphy_write_ext(phydev, 0xa003, val); -+ if (ret < 0) -+ return ret; -+ -+ /* LED0: Unused/Off, LED1: Link, LED2: Activity, 8Hz */ -+ ytphy_write_ext(phydev, 0xa00b, 0xe004); -+ ytphy_write_ext(phydev, 0xa00c, 0); -+ ytphy_write_ext(phydev, 0xa00d, 0x2600); -+ ytphy_write_ext(phydev, 0xa00e, 0x0070); -+ ytphy_write_ext(phydev, 0xa00f, 0x000a); -+ -+ return 0; -+} -+ -+static int yt8521_config_intr(struct phy_device *phydev) -+{ -+ int val; -+ -+ if (phydev->interrupts == PHY_INTERRUPT_ENABLED) -+ val = BIT(14) | BIT(13) | BIT(11) | BIT(10); -+ else -+ val = 0; -+ -+ return phy_write(phydev, REG_INT_MASK, val); -+} -+ -+static int yt8521_ack_interrupt(struct phy_device *phydev) -+{ -+ int val; -+ -+ val = phy_read(phydev, REG_INT_STATUS); -+ phydev_dbg(phydev, "intr status 0x04%x\n", val); -+ -+ return (val < 0) ? val : 0; -+} -+ -+static struct phy_driver ytphy_drvs[] = { -+ { -+ .phy_id = PHY_ID_YT8010, -+ .name = "YT8010 Automotive Ethernet", -+ .phy_id_mask = MOTORCOMM_PHY_ID_MASK, -+ .features = PHY_BASIC_FEATURES, -+ .config_aneg = yt8010_config_aneg, -+ .read_status = genphy_read_status, -+ }, { -+ .phy_id = PHY_ID_YT8510, -+ .name = "YT8510 100/10Mb Ethernet", -+ .phy_id_mask = MOTORCOMM_PHY_ID_MASK, -+ .features = PHY_BASIC_FEATURES, -+ .read_status = genphy_read_status, -+ }, { -+ .phy_id = PHY_ID_YT8511, -+ .name = "YT8511 Gigabit Ethernet", -+ .phy_id_mask = MOTORCOMM_PHY_ID_MASK, -+ .features = PHY_GBIT_FEATURES, -+ .read_status = genphy_read_status, -+ .suspend = genphy_suspend, -+ .resume = genphy_resume, -+ }, { -+ .phy_id = PHY_ID_YT8512, -+ .name = "YT8512 Ethernet", -+ .phy_id_mask = MOTORCOMM_PHY_ID_MASK, -+ .features = PHY_BASIC_FEATURES, -+ .config_init = yt8512_config_init, -+ .read_status = yt8512_read_status, -+ .suspend = genphy_suspend, -+ .resume = genphy_resume, -+ }, { -+ .phy_id = PHY_ID_YT8512B, -+ .name = "YT8512B Ethernet", -+ .phy_id_mask = MOTORCOMM_PHY_ID_MASK, -+ .features = PHY_BASIC_FEATURES, -+ .config_init = yt8512_config_init, -+ .read_status = yt8512_read_status, -+ .suspend = genphy_suspend, -+ .resume = genphy_resume, -+ }, { -+ .phy_id = PHY_ID_YT8521, -+ .name = "YT8521 Ethernet", -+ .phy_id_mask = MOTORCOMM_PHY_ID_MASK, -+ /* PHY_GBIT_FEATURES */ -+ .config_init = yt8521_config_init, -+ .ack_interrupt = yt8521_ack_interrupt, -+ .config_intr = yt8521_config_intr, -+ .suspend = genphy_suspend, -+ .resume = genphy_resume, -+ }, -+}; -+ -+module_phy_driver(ytphy_drvs); -+ -+MODULE_DESCRIPTION("Motorcomm PHY driver"); -+MODULE_AUTHOR("Leilei Zhao"); -+MODULE_LICENSE("GPL"); -+ -+static struct mdio_device_id __maybe_unused motorcomm_tbl[] = { -+ { PHY_ID_YT8010, MOTORCOMM_PHY_ID_MASK }, -+ { PHY_ID_YT8510, MOTORCOMM_PHY_ID_MASK }, -+ { PHY_ID_YT8511, MOTORCOMM_PHY_ID_MASK }, -+ { PHY_ID_YT8512, MOTORCOMM_PHY_ID_MASK }, -+ { PHY_ID_YT8512B, MOTORCOMM_PHY_ID_MASK }, -+ { PHY_ID_YT8521, MOTORCOMM_PHY_ID_MASK }, -+ { } -+}; -+ -+MODULE_DEVICE_TABLE(mdio, motorcomm_tbl); ---- /dev/null -+++ b/include/linux/motorcomm_phy.h -@@ -0,0 +1,67 @@ -+/* -+ * include/linux/motorcomm_phy.h -+ * -+ * Motorcomm PHY IDs -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by the -+ * Free Software Foundation; either version 2 of the License, or (at your -+ * option) any later version. -+ * -+ */ -+ -+#ifndef _MOTORCOMM_PHY_H -+#define _MOTORCOMM_PHY_H -+ -+#define MOTORCOMM_PHY_ID_MASK 0x00000fff -+ -+#define PHY_ID_YT8010 0x00000309 -+#define PHY_ID_YT8510 0x00000109 -+#define PHY_ID_YT8511 0x0000010a -+#define PHY_ID_YT8512 0x00000118 -+#define PHY_ID_YT8512B 0x00000128 -+#define PHY_ID_YT8521 0x0000011a -+ -+#define REG_PHY_SPEC_STATUS 0x11 -+#define REG_INT_MASK 0x12 -+#define REG_INT_STATUS 0x13 -+#define REG_DEBUG_ADDR_OFFSET 0x1e -+#define REG_DEBUG_DATA 0x1f -+ -+#define YT8512_EXTREG_AFE_PLL 0x50 -+#define YT8512_EXTREG_EXTEND_COMBO 0x4000 -+#define YT8512_EXTREG_LED0 0x40c0 -+#define YT8512_EXTREG_LED1 0x40c3 -+ -+#define YT8512_EXTREG_SLEEP_CONTROL1 0x2027 -+ -+#define YT_SOFTWARE_RESET 0x8000 -+ -+#define YT8512_CONFIG_PLL_REFCLK_SEL_EN 0x0040 -+#define YT8512_CONTROL1_RMII_EN 0x0001 -+#define YT8512_LED0_ACT_BLK_IND 0x1000 -+#define YT8512_LED0_DIS_LED_AN_TRY 0x0001 -+#define YT8512_LED0_BT_BLK_EN 0x0002 -+#define YT8512_LED0_HT_BLK_EN 0x0004 -+#define YT8512_LED0_COL_BLK_EN 0x0008 -+#define YT8512_LED0_BT_ON_EN 0x0010 -+#define YT8512_LED1_BT_ON_EN 0x0010 -+#define YT8512_LED1_TXACT_BLK_EN 0x0100 -+#define YT8512_LED1_RXACT_BLK_EN 0x0200 -+#define YT8512_SPEED_MODE 0xc000 -+#define YT8512_DUPLEX 0x2000 -+ -+#define YT8512_SPEED_MODE_BIT 14 -+#define YT8512_DUPLEX_BIT 13 -+#define YT8512_EN_SLEEP_SW_BIT 15 -+ -+#define YT8521_EXTREG_SLEEP_CONTROL1 0x27 -+#define YT8521_EN_SLEEP_SW_BIT 15 -+ -+#define YT8521_SPEED_MODE 0xc000 -+#define YT8521_DUPLEX 0x2000 -+#define YT8521_SPEED_MODE_BIT 14 -+#define YT8521_DUPLEX_BIT 13 -+#define YT8521_LINK_STATUS_BIT 10 -+ -+#endif /* _MOTORCOMM_PHY_H */ diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/801-char-add-support-for-rockchip-hardware-random-number.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/801-char-add-support-for-rockchip-hardware-random-number.patch deleted file mode 100644 index 85f14e6..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/801-char-add-support-for-rockchip-hardware-random-number.patch +++ /dev/null @@ -1,45 +0,0 @@ -From e5b5361651940ff5c0c1784dfd0130abec7ab535 Mon Sep 17 00:00:00 2001 -From: wevsty -Date: Mon, 24 Aug 2020 02:27:11 +0800 -Subject: [PATCH] char: add support for rockchip hardware random number - generator - -This patch provides hardware random number generator support for all rockchip SOC. - -rockchip-rng.c from https://github.com/rockchip-linux/kernel/blob/develop-4.4/drivers/char/hw_random/rockchip-rng.c - -Signed-off-by: wevsty ---- - ---- a/drivers/char/hw_random/Kconfig -+++ b/drivers/char/hw_random/Kconfig -@@ -345,6 +345,19 @@ config HW_RANDOM_STM32 - - If unsure, say N. - -+config HW_RANDOM_ROCKCHIP -+ tristate "Rockchip Random Number Generator support" -+ depends on ARCH_ROCKCHIP -+ default HW_RANDOM -+ help -+ This driver provides kernel-side support for the Random Number -+ Generator hardware found on Rockchip cpus. -+ -+ To compile this driver as a module, choose M here: the -+ module will be called rockchip-rng. -+ -+ If unsure, say Y. -+ - config HW_RANDOM_PIC32 - tristate "Microchip PIC32 Random Number Generator support" - depends on HW_RANDOM && MACH_PIC32 ---- a/drivers/char/hw_random/Makefile -+++ b/drivers/char/hw_random/Makefile -@@ -32,6 +32,7 @@ obj-$(CONFIG_HW_RANDOM_IPROC_RNG200) += - obj-$(CONFIG_HW_RANDOM_ST) += st-rng.o - obj-$(CONFIG_HW_RANDOM_XGENE) += xgene-rng.o - obj-$(CONFIG_HW_RANDOM_STM32) += stm32-rng.o -+obj-$(CONFIG_HW_RANDOM_ROCKCHIP) += rockchip-rng.o - obj-$(CONFIG_HW_RANDOM_PIC32) += pic32-rng.o - obj-$(CONFIG_HW_RANDOM_MESON) += meson-rng.o - obj-$(CONFIG_HW_RANDOM_CAVIUM) += cavium-rng.o cavium-rng-vf.o diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch deleted file mode 100644 index 970e798..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch +++ /dev/null @@ -1,50 +0,0 @@ -From e5b5361651940ff5c0c1784dfd0130abec7ab535 Mon Sep 17 00:00:00 2001 -From: wevsty -Date: Mon, 24 Aug 2020 02:27:11 +0800 -Subject: [PATCH] arm64: dts: rockchip: add hardware random number generator - for RK3328 and RK3399 - -Adding Hardware Random Number Generator Resources to the RK3328 and RK3399. - -Signed-off-by: wevsty ---- - ---- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -264,6 +264,17 @@ - status = "disabled"; - }; - -+ rng: rng@ff060000 { -+ compatible = "rockchip,cryptov1-rng"; -+ reg = <0x0 0xff060000 0x0 0x4000>; -+ -+ clocks = <&cru SCLK_CRYPTO>, <&cru HCLK_CRYPTO_SLV>; -+ clock-names = "clk_crypto", "hclk_crypto"; -+ assigned-clocks = <&cru SCLK_CRYPTO>, <&cru HCLK_CRYPTO_SLV>; -+ assigned-clock-rates = <150000000>, <100000000>; -+ status = "disabled"; -+ }; -+ - grf: syscon@ff100000 { - compatible = "rockchip,rk3328-grf", "syscon", "simple-mfd"; - reg = <0x0 0xff100000 0x0 0x1000>; ---- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -1882,6 +1882,16 @@ - }; - }; - -+ rng: rng@ff8b8000 { -+ compatible = "rockchip,cryptov1-rng"; -+ reg = <0x0 0xff8b8000 0x0 0x1000>; -+ clocks = <&cru SCLK_CRYPTO1>, <&cru HCLK_S_CRYPTO1>; -+ clock-names = "clk_crypto", "hclk_crypto"; -+ assigned-clocks = <&cru SCLK_CRYPTO1>, <&cru HCLK_S_CRYPTO1>; -+ assigned-clock-rates = <150000000>, <100000000>; -+ status = "okay"; -+ }; -+ - gpu: gpu@ff9a0000 { - compatible = "rockchip,rk3399-mali", "arm,mali-t860"; - reg = <0x0 0xff9a0000 0x0 0x10000>; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/803-PM-devfreq-rockchip-add-devfreq-driver-for-rk3328-dmc.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/803-PM-devfreq-rockchip-add-devfreq-driver-for-rk3328-dmc.patch deleted file mode 100644 index 3018bd3..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/803-PM-devfreq-rockchip-add-devfreq-driver-for-rk3328-dmc.patch +++ /dev/null @@ -1,48 +0,0 @@ -From fcd9629c05f373771e85920e1c1d0ab252617878 Mon Sep 17 00:00:00 2001 -From: hmz007 -Date: Tue, 19 Nov 2019 13:53:25 +0800 -Subject: [PATCH] PM / devfreq: rockchip: add devfreq driver for rk3328 dmc - -Signed-off-by: hmz007 ---- - drivers/devfreq/Kconfig | 18 +- - drivers/devfreq/Makefile | 1 + - drivers/devfreq/rk3328_dmc.c | 846 +++++++++++++++++++++++++++++++++++ - 3 files changed, 862 insertions(+), 3 deletions(-) - create mode 100644 drivers/devfreq/rk3328_dmc.c - -diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig -index defe1d438710..5ae0832f046b 100644 ---- a/drivers/devfreq/Kconfig -+++ b/drivers/devfreq/Kconfig -@@ -116,6 +116,18 @@ config ARM_TEGRA20_DEVFREQ - It reads Memory Controller counters and adjusts the operating - frequencies and voltages with OPP support. - -+config ARM_RK3328_DMC_DEVFREQ -+ tristate "ARM RK3328 DMC DEVFREQ Driver" -+ depends on ARCH_ROCKCHIP -+ select DEVFREQ_EVENT_ROCKCHIP_DFI -+ select DEVFREQ_GOV_SIMPLE_ONDEMAND -+ select PM_DEVFREQ_EVENT -+ select PM_OPP -+ help -+ This adds the DEVFREQ driver for the RK3328 DMC(Dynamic Memory Controller). -+ It sets the frequency for the memory controller and reads the usage counts -+ from hardware. -+ - config ARM_RK3399_DMC_DEVFREQ - tristate "ARM RK3399 DMC DEVFREQ Driver" - depends on (ARCH_ROCKCHIP && HAVE_ARM_SMCCC) || \ -diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile -index 338ae8440db6..ec568406ef50 100644 ---- a/drivers/devfreq/Makefile -+++ b/drivers/devfreq/Makefile -@@ -9,6 +9,7 @@ obj-$(CONFIG_DEVFREQ_GOV_PASSIVE) += governor_passive.o - - # DEVFREQ Drivers - obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o -+obj-$(CONFIG_ARM_RK3328_DMC_DEVFREQ) += rk3328_dmc.o - obj-$(CONFIG_ARM_RK3399_DMC_DEVFREQ) += rk3399_dmc.o - obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra30-devfreq.o - obj-$(CONFIG_ARM_TEGRA20_DEVFREQ) += tegra20-devfreq.o diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/804-clk-rockchip-support-setting-ddr-clock-via-SIP-Version-2-.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/804-clk-rockchip-support-setting-ddr-clock-via-SIP-Version-2-.patch deleted file mode 100644 index 4e688f8..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/804-clk-rockchip-support-setting-ddr-clock-via-SIP-Version-2-.patch +++ /dev/null @@ -1,218 +0,0 @@ -From ce6d3614888e6358466f0e84e248177a6bca5258 Mon Sep 17 00:00:00 2001 -From: Tang Yun ping -Date: Thu, 4 May 2017 20:49:58 +0800 -Subject: [PATCH] clk: rockchip: support setting ddr clock via SIP Version 2 - APIs - -commit 764e893ee82321938fc6f4349e9e7caf06a04410 rockchip. - -Signed-off-by: Tang Yun ping -Signed-off-by: hmz007 ---- - drivers/clk/rockchip/clk-ddr.c | 130 ++++++++++++++++++++++++++++ - drivers/clk/rockchip/clk-rk3328.c | 7 +- - drivers/clk/rockchip/clk.h | 3 +- - include/soc/rockchip/rockchip_sip.h | 11 +++ - 4 files changed, 147 insertions(+), 4 deletions(-) - -diff --git a/drivers/clk/rockchip/clk-ddr.c b/drivers/clk/rockchip/clk-ddr.c -index 9273bce4d7b6..555aaf4e758d 100644 ---- a/drivers/clk/rockchip/clk-ddr.c -+++ b/drivers/clk/rockchip/clk-ddr.c -@@ -87,6 +87,133 @@ static const struct clk_ops rockchip_ddrclk_sip_ops = { - .get_parent = rockchip_ddrclk_get_parent, - }; - -+/* See v4.4/include/dt-bindings/display/rk_fb.h */ -+#define SCREEN_NULL 0 -+#define SCREEN_HDMI 6 -+ -+static inline int rk_drm_get_lcdc_type(void) -+{ -+ return SCREEN_NULL; -+} -+ -+struct share_params { -+ u32 hz; -+ u32 lcdc_type; -+ u32 vop; -+ u32 vop_dclk_mode; -+ u32 sr_idle_en; -+ u32 addr_mcu_el3; -+ /* -+ * 1: need to wait flag1 -+ * 0: never wait flag1 -+ */ -+ u32 wait_flag1; -+ /* -+ * 1: need to wait flag1 -+ * 0: never wait flag1 -+ */ -+ u32 wait_flag0; -+ u32 complt_hwirq; -+ /* if need, add parameter after */ -+}; -+ -+struct rockchip_ddrclk_data { -+ u32 inited_flag; -+ void __iomem *share_memory; -+}; -+ -+static struct rockchip_ddrclk_data ddr_data; -+ -+static void rockchip_ddrclk_data_init(void) -+{ -+ struct arm_smccc_res res; -+ -+ arm_smccc_smc(ROCKCHIP_SIP_SHARE_MEM, -+ 1, SHARE_PAGE_TYPE_DDR, 0, -+ 0, 0, 0, 0, &res); -+ -+ if (!res.a0) { -+ ddr_data.share_memory = (void __iomem *)ioremap(res.a1, 1<<12); -+ ddr_data.inited_flag = 1; -+ } -+} -+ -+static int rockchip_ddrclk_sip_set_rate_v2(struct clk_hw *hw, -+ unsigned long drate, -+ unsigned long prate) -+{ -+ struct share_params *p; -+ struct arm_smccc_res res; -+ -+ if (!ddr_data.inited_flag) -+ rockchip_ddrclk_data_init(); -+ -+ p = (struct share_params *)ddr_data.share_memory; -+ -+ p->hz = drate; -+ p->lcdc_type = rk_drm_get_lcdc_type(); -+ p->wait_flag1 = 1; -+ p->wait_flag0 = 1; -+ -+ arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, -+ SHARE_PAGE_TYPE_DDR, 0, -+ ROCKCHIP_SIP_CONFIG_DRAM_SET_RATE, -+ 0, 0, 0, 0, &res); -+ -+ if ((int)res.a1 == -6) { -+ pr_err("%s: timeout, drate = %lumhz\n", __func__, drate/1000000); -+ /* TODO: rockchip_dmcfreq_wait_complete(); */ -+ } -+ -+ return res.a0; -+} -+ -+static unsigned long rockchip_ddrclk_sip_recalc_rate_v2 -+ (struct clk_hw *hw, unsigned long parent_rate) -+{ -+ struct arm_smccc_res res; -+ -+ arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, -+ SHARE_PAGE_TYPE_DDR, 0, -+ ROCKCHIP_SIP_CONFIG_DRAM_GET_RATE, -+ 0, 0, 0, 0, &res); -+ if (!res.a0) -+ return res.a1; -+ else -+ return 0; -+} -+ -+static long rockchip_ddrclk_sip_round_rate_v2(struct clk_hw *hw, -+ unsigned long rate, -+ unsigned long *prate) -+{ -+ struct share_params *p; -+ struct arm_smccc_res res; -+ -+ if (!ddr_data.inited_flag) -+ rockchip_ddrclk_data_init(); -+ -+ p = (struct share_params *)ddr_data.share_memory; -+ -+ p->hz = rate; -+ -+ arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, -+ SHARE_PAGE_TYPE_DDR, 0, -+ ROCKCHIP_SIP_CONFIG_DRAM_ROUND_RATE, -+ 0, 0, 0, 0, &res); -+ if (!res.a0) -+ return res.a1; -+ else -+ return 0; -+} -+ -+static const struct clk_ops rockchip_ddrclk_sip_ops_v2 = { -+ .recalc_rate = rockchip_ddrclk_sip_recalc_rate_v2, -+ .set_rate = rockchip_ddrclk_sip_set_rate_v2, -+ .round_rate = rockchip_ddrclk_sip_round_rate_v2, -+ .get_parent = rockchip_ddrclk_get_parent, -+}; -+ - struct clk *rockchip_clk_register_ddrclk(const char *name, int flags, - const char *const *parent_names, - u8 num_parents, int mux_offset, -@@ -114,6 +241,9 @@ struct clk *rockchip_clk_register_ddrclk(const char *name, int flags, - case ROCKCHIP_DDRCLK_SIP: - init.ops = &rockchip_ddrclk_sip_ops; - break; -+ case ROCKCHIP_DDRCLK_SIP_V2: -+ init.ops = &rockchip_ddrclk_sip_ops_v2; -+ break; - default: - pr_err("%s: unsupported ddrclk type %d\n", __func__, ddr_flag); - kfree(ddrclk); -diff --git a/drivers/clk/rockchip/clk-rk3328.c b/drivers/clk/rockchip/clk-rk3328.c -index c186a1985bf4..ac6e6163a232 100644 ---- a/drivers/clk/rockchip/clk-rk3328.c -+++ b/drivers/clk/rockchip/clk-rk3328.c -@@ -314,9 +314,10 @@ static struct rockchip_clk_branch rk3328_clk_branches[] __initdata = { - RK3328_CLKGATE_CON(14), 1, GFLAGS), - - /* PD_DDR */ -- COMPOSITE(0, "clk_ddr", mux_ddrphy_p, CLK_IGNORE_UNUSED, -- RK3328_CLKSEL_CON(3), 8, 2, MFLAGS, 0, 3, DFLAGS | CLK_DIVIDER_POWER_OF_TWO, -- RK3328_CLKGATE_CON(0), 4, GFLAGS), -+ COMPOSITE_DDRCLK(SCLK_DDRCLK, "sclk_ddrc", mux_ddrphy_p, 0, -+ RK3328_CLKSEL_CON(3), 8, 2, 0, 3, -+ ROCKCHIP_DDRCLK_SIP_V2), -+ - GATE(0, "clk_ddrmsch", "clk_ddr", CLK_IGNORE_UNUSED, - RK3328_CLKGATE_CON(18), 6, GFLAGS), - GATE(0, "clk_ddrupctl", "clk_ddr", CLK_IGNORE_UNUSED, -diff --git a/drivers/clk/rockchip/clk.h b/drivers/clk/rockchip/clk.h -index 2271a84124b0..7405aaf965ec 100644 ---- a/drivers/clk/rockchip/clk.h -+++ b/drivers/clk/rockchip/clk.h -@@ -362,7 +362,8 @@ struct clk *rockchip_clk_register_mmc(const char *name, - * DDRCLK flags, including method of setting the rate - * ROCKCHIP_DDRCLK_SIP: use SIP call to bl31 to change ddrclk rate. - */ --#define ROCKCHIP_DDRCLK_SIP BIT(0) -+#define ROCKCHIP_DDRCLK_SIP 0x01 -+#define ROCKCHIP_DDRCLK_SIP_V2 0x03 - - struct clk *rockchip_clk_register_ddrclk(const char *name, int flags, - const char *const *parent_names, -diff --git a/include/soc/rockchip/rockchip_sip.h b/include/soc/rockchip/rockchip_sip.h -index c46a9ae2a2ab..fa7e0a2d72cc 100644 ---- a/include/soc/rockchip/rockchip_sip.h -+++ b/include/soc/rockchip/rockchip_sip.h -@@ -16,5 +16,16 @@ - #define ROCKCHIP_SIP_CONFIG_DRAM_CLR_IRQ 0x06 - #define ROCKCHIP_SIP_CONFIG_DRAM_SET_PARAM 0x07 - #define ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD 0x08 -+#define ROCKCHIP_SIP_CONFIG_DRAM_GET_VERSION 0x08 -+ -+#define ROCKCHIP_SIP_SHARE_MEM 0x82000009 -+ -+/* Share mem page types */ -+typedef enum { -+ SHARE_PAGE_TYPE_INVALID = 0, -+ SHARE_PAGE_TYPE_UARTDBG, -+ SHARE_PAGE_TYPE_DDR, -+ SHARE_PAGE_TYPE_MAX, -+} share_page_type_t; - - #endif diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/805-PM-devfreq-rockchip-dfi-add-more-soc-support.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/805-PM-devfreq-rockchip-dfi-add-more-soc-support.patch deleted file mode 100644 index dbf491a..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/805-PM-devfreq-rockchip-dfi-add-more-soc-support.patch +++ /dev/null @@ -1,665 +0,0 @@ -From 4db93c6dad0c71750b86163df2fdb21c35f00d9a Mon Sep 17 00:00:00 2001 -From: hmz007 -Date: Tue, 19 Nov 2019 12:49:48 +0800 -Subject: [PATCH] PM / devfreq: rockchip-dfi: add more soc support - -Signed-off-by: hmz007 ---- - drivers/devfreq/event/rockchip-dfi.c | 554 ++++++++++++++++++++++++--- - 1 file changed, 505 insertions(+), 49 deletions(-) - -diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c -index 5d1042188727..80be0efdfb9b 100644 ---- a/drivers/devfreq/event/rockchip-dfi.c -+++ b/drivers/devfreq/event/rockchip-dfi.c -@@ -18,25 +18,66 @@ - #include - #include - --#include -- --#define RK3399_DMC_NUM_CH 2 -- -+#define PX30_PMUGRF_OS_REG2 0x208 -+ -+#define RK3128_GRF_SOC_CON0 0x140 -+#define RK3128_GRF_OS_REG1 0x1cc -+#define RK3128_GRF_DFI_WRNUM 0x220 -+#define RK3128_GRF_DFI_RDNUM 0x224 -+#define RK3128_GRF_DFI_TIMERVAL 0x22c -+#define RK3128_DDR_MONITOR_EN ((1 << (16 + 6)) + (1 << 6)) -+#define RK3128_DDR_MONITOR_DISB ((1 << (16 + 6)) + (0 << 6)) -+ -+#define RK3288_PMU_SYS_REG2 0x9c -+#define RK3288_GRF_SOC_CON4 0x254 -+#define RK3288_GRF_SOC_STATUS(n) (0x280 + (n) * 4) -+#define RK3288_DFI_EN (0x30003 << 14) -+#define RK3288_DFI_DIS (0x30000 << 14) -+#define RK3288_LPDDR_SEL (0x10001 << 13) -+#define RK3288_DDR3_SEL (0x10000 << 13) -+ -+#define RK3328_GRF_OS_REG2 0x5d0 -+ -+#define RK3368_GRF_DDRC0_CON0 0x600 -+#define RK3368_GRF_SOC_STATUS5 0x494 -+#define RK3368_GRF_SOC_STATUS6 0x498 -+#define RK3368_GRF_SOC_STATUS8 0x4a0 -+#define RK3368_GRF_SOC_STATUS9 0x4a4 -+#define RK3368_GRF_SOC_STATUS10 0x4a8 -+#define RK3368_DFI_EN (0x30003 << 5) -+#define RK3368_DFI_DIS (0x30000 << 5) -+ -+#define MAX_DMC_NUM_CH 2 -+#define READ_DRAMTYPE_INFO(n) (((n) >> 13) & 0x7) -+#define READ_CH_INFO(n) (((n) >> 28) & 0x3) - /* DDRMON_CTRL */ --#define DDRMON_CTRL 0x04 --#define CLR_DDRMON_CTRL (0x1f0000 << 0) --#define LPDDR4_EN (0x10001 << 4) --#define HARDWARE_EN (0x10001 << 3) --#define LPDDR3_EN (0x10001 << 2) --#define SOFTWARE_EN (0x10001 << 1) --#define SOFTWARE_DIS (0x10000 << 1) --#define TIME_CNT_EN (0x10001 << 0) -+#define DDRMON_CTRL 0x04 -+#define CLR_DDRMON_CTRL (0x3f0000 << 0) -+#define DDR4_EN (0x10001 << 5) -+#define LPDDR4_EN (0x10001 << 4) -+#define HARDWARE_EN (0x10001 << 3) -+#define LPDDR2_3_EN (0x10001 << 2) -+#define SOFTWARE_EN (0x10001 << 1) -+#define SOFTWARE_DIS (0x10000 << 1) -+#define TIME_CNT_EN (0x10001 << 0) - - #define DDRMON_CH0_COUNT_NUM 0x28 - #define DDRMON_CH0_DFI_ACCESS_NUM 0x2c - #define DDRMON_CH1_COUNT_NUM 0x3c - #define DDRMON_CH1_DFI_ACCESS_NUM 0x40 - -+/* pmu grf */ -+#define PMUGRF_OS_REG2 0x308 -+ -+enum { -+ DDR4 = 0, -+ DDR3 = 3, -+ LPDDR2 = 5, -+ LPDDR3 = 6, -+ LPDDR4 = 7, -+ UNUSED = 0xFF -+}; -+ - struct dmc_usage { - u32 access; - u32 total; -@@ -50,33 +91,261 @@ struct dmc_usage { - struct rockchip_dfi { - struct devfreq_event_dev *edev; - struct devfreq_event_desc *desc; -- struct dmc_usage ch_usage[RK3399_DMC_NUM_CH]; -+ struct dmc_usage ch_usage[MAX_DMC_NUM_CH]; - struct device *dev; - void __iomem *regs; - struct regmap *regmap_pmu; -+ struct regmap *regmap_grf; -+ struct regmap *regmap_pmugrf; - struct clk *clk; -+ u32 dram_type; -+ /* -+ * available mask, 1: available, 0: not available -+ * each bit represent a channel -+ */ -+ u32 ch_msk; -+}; -+ -+static void rk3128_dfi_start_hardware_counter(struct devfreq_event_dev *edev) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ -+ regmap_write(info->regmap_grf, -+ RK3128_GRF_SOC_CON0, -+ RK3128_DDR_MONITOR_EN); -+} -+ -+static void rk3128_dfi_stop_hardware_counter(struct devfreq_event_dev *edev) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ -+ regmap_write(info->regmap_grf, -+ RK3128_GRF_SOC_CON0, -+ RK3128_DDR_MONITOR_DISB); -+} -+ -+static int rk3128_dfi_disable(struct devfreq_event_dev *edev) -+{ -+ rk3128_dfi_stop_hardware_counter(edev); -+ -+ return 0; -+} -+ -+static int rk3128_dfi_enable(struct devfreq_event_dev *edev) -+{ -+ rk3128_dfi_start_hardware_counter(edev); -+ -+ return 0; -+} -+ -+static int rk3128_dfi_set_event(struct devfreq_event_dev *edev) -+{ -+ return 0; -+} -+ -+static int rk3128_dfi_get_event(struct devfreq_event_dev *edev, -+ struct devfreq_event_data *edata) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ unsigned long flags; -+ u32 dfi_wr, dfi_rd, dfi_timer; -+ -+ local_irq_save(flags); -+ -+ rk3128_dfi_stop_hardware_counter(edev); -+ -+ regmap_read(info->regmap_grf, RK3128_GRF_DFI_WRNUM, &dfi_wr); -+ regmap_read(info->regmap_grf, RK3128_GRF_DFI_RDNUM, &dfi_rd); -+ regmap_read(info->regmap_grf, RK3128_GRF_DFI_TIMERVAL, &dfi_timer); -+ -+ edata->load_count = (dfi_wr + dfi_rd) * 4; -+ edata->total_count = dfi_timer; -+ -+ rk3128_dfi_start_hardware_counter(edev); -+ -+ local_irq_restore(flags); -+ -+ return 0; -+} -+ -+static const struct devfreq_event_ops rk3128_dfi_ops = { -+ .disable = rk3128_dfi_disable, -+ .enable = rk3128_dfi_enable, -+ .get_event = rk3128_dfi_get_event, -+ .set_event = rk3128_dfi_set_event, -+}; -+ -+static void rk3288_dfi_start_hardware_counter(struct devfreq_event_dev *edev) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ -+ regmap_write(info->regmap_grf, RK3288_GRF_SOC_CON4, RK3288_DFI_EN); -+} -+ -+static void rk3288_dfi_stop_hardware_counter(struct devfreq_event_dev *edev) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ -+ regmap_write(info->regmap_grf, RK3288_GRF_SOC_CON4, RK3288_DFI_DIS); -+} -+ -+static int rk3288_dfi_disable(struct devfreq_event_dev *edev) -+{ -+ rk3288_dfi_stop_hardware_counter(edev); -+ -+ return 0; -+} -+ -+static int rk3288_dfi_enable(struct devfreq_event_dev *edev) -+{ -+ rk3288_dfi_start_hardware_counter(edev); -+ -+ return 0; -+} -+ -+static int rk3288_dfi_set_event(struct devfreq_event_dev *edev) -+{ -+ return 0; -+} -+ -+static int rk3288_dfi_get_busier_ch(struct devfreq_event_dev *edev) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ u32 tmp, max = 0; -+ u32 i, busier_ch = 0; -+ u32 rd_count, wr_count, total_count; -+ -+ rk3288_dfi_stop_hardware_counter(edev); -+ -+ /* Find out which channel is busier */ -+ for (i = 0; i < MAX_DMC_NUM_CH; i++) { -+ if (!(info->ch_msk & BIT(i))) -+ continue; -+ regmap_read(info->regmap_grf, -+ RK3288_GRF_SOC_STATUS(11 + i * 4), &wr_count); -+ regmap_read(info->regmap_grf, -+ RK3288_GRF_SOC_STATUS(12 + i * 4), &rd_count); -+ regmap_read(info->regmap_grf, -+ RK3288_GRF_SOC_STATUS(14 + i * 4), &total_count); -+ info->ch_usage[i].access = (wr_count + rd_count) * 4; -+ info->ch_usage[i].total = total_count; -+ tmp = info->ch_usage[i].access; -+ if (tmp > max) { -+ busier_ch = i; -+ max = tmp; -+ } -+ } -+ rk3288_dfi_start_hardware_counter(edev); -+ -+ return busier_ch; -+} -+ -+static int rk3288_dfi_get_event(struct devfreq_event_dev *edev, -+ struct devfreq_event_data *edata) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ int busier_ch; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ busier_ch = rk3288_dfi_get_busier_ch(edev); -+ local_irq_restore(flags); -+ -+ edata->load_count = info->ch_usage[busier_ch].access; -+ edata->total_count = info->ch_usage[busier_ch].total; -+ -+ return 0; -+} -+ -+static const struct devfreq_event_ops rk3288_dfi_ops = { -+ .disable = rk3288_dfi_disable, -+ .enable = rk3288_dfi_enable, -+ .get_event = rk3288_dfi_get_event, -+ .set_event = rk3288_dfi_set_event, -+}; -+ -+static void rk3368_dfi_start_hardware_counter(struct devfreq_event_dev *edev) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ -+ regmap_write(info->regmap_grf, RK3368_GRF_DDRC0_CON0, RK3368_DFI_EN); -+} -+ -+static void rk3368_dfi_stop_hardware_counter(struct devfreq_event_dev *edev) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ -+ regmap_write(info->regmap_grf, RK3368_GRF_DDRC0_CON0, RK3368_DFI_DIS); -+} -+ -+static int rk3368_dfi_disable(struct devfreq_event_dev *edev) -+{ -+ rk3368_dfi_stop_hardware_counter(edev); -+ -+ return 0; -+} -+ -+static int rk3368_dfi_enable(struct devfreq_event_dev *edev) -+{ -+ rk3368_dfi_start_hardware_counter(edev); -+ -+ return 0; -+} -+ -+static int rk3368_dfi_set_event(struct devfreq_event_dev *edev) -+{ -+ return 0; -+} -+ -+static int rk3368_dfi_get_event(struct devfreq_event_dev *edev, -+ struct devfreq_event_data *edata) -+{ -+ struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); -+ unsigned long flags; -+ u32 dfi0_wr, dfi0_rd, dfi1_wr, dfi1_rd, dfi_timer; -+ -+ local_irq_save(flags); -+ -+ rk3368_dfi_stop_hardware_counter(edev); -+ -+ regmap_read(info->regmap_grf, RK3368_GRF_SOC_STATUS5, &dfi0_wr); -+ regmap_read(info->regmap_grf, RK3368_GRF_SOC_STATUS6, &dfi0_rd); -+ regmap_read(info->regmap_grf, RK3368_GRF_SOC_STATUS9, &dfi1_wr); -+ regmap_read(info->regmap_grf, RK3368_GRF_SOC_STATUS10, &dfi1_rd); -+ regmap_read(info->regmap_grf, RK3368_GRF_SOC_STATUS8, &dfi_timer); -+ -+ edata->load_count = (dfi0_wr + dfi0_rd + dfi1_wr + dfi1_rd) * 2; -+ edata->total_count = dfi_timer; -+ -+ rk3368_dfi_start_hardware_counter(edev); -+ -+ local_irq_restore(flags); -+ -+ return 0; -+} -+ -+static const struct devfreq_event_ops rk3368_dfi_ops = { -+ .disable = rk3368_dfi_disable, -+ .enable = rk3368_dfi_enable, -+ .get_event = rk3368_dfi_get_event, -+ .set_event = rk3368_dfi_set_event, - }; - - static void rockchip_dfi_start_hardware_counter(struct devfreq_event_dev *edev) - { - struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); - void __iomem *dfi_regs = info->regs; -- u32 val; -- u32 ddr_type; -- -- /* get ddr type */ -- regmap_read(info->regmap_pmu, RK3399_PMUGRF_OS_REG2, &val); -- ddr_type = (val >> RK3399_PMUGRF_DDRTYPE_SHIFT) & -- RK3399_PMUGRF_DDRTYPE_MASK; - - /* clear DDRMON_CTRL setting */ - writel_relaxed(CLR_DDRMON_CTRL, dfi_regs + DDRMON_CTRL); - - /* set ddr type to dfi */ -- if (ddr_type == RK3399_PMUGRF_DDRTYPE_LPDDR3) -- writel_relaxed(LPDDR3_EN, dfi_regs + DDRMON_CTRL); -- else if (ddr_type == RK3399_PMUGRF_DDRTYPE_LPDDR4) -+ if (info->dram_type == LPDDR3 || info->dram_type == LPDDR2) -+ writel_relaxed(LPDDR2_3_EN, dfi_regs + DDRMON_CTRL); -+ else if (info->dram_type == LPDDR4) - writel_relaxed(LPDDR4_EN, dfi_regs + DDRMON_CTRL); -+ else if (info->dram_type == DDR4) -+ writel_relaxed(DDR4_EN, dfi_regs + DDRMON_CTRL); - - /* enable count, use software mode */ - writel_relaxed(SOFTWARE_EN, dfi_regs + DDRMON_CTRL); -@@ -100,12 +369,22 @@ static int rockchip_dfi_get_busier_ch(struct devfreq_event_dev *edev) - rockchip_dfi_stop_hardware_counter(edev); - - /* Find out which channel is busier */ -- for (i = 0; i < RK3399_DMC_NUM_CH; i++) { -- info->ch_usage[i].access = readl_relaxed(dfi_regs + -- DDRMON_CH0_DFI_ACCESS_NUM + i * 20) * 4; -+ for (i = 0; i < MAX_DMC_NUM_CH; i++) { -+ if (!(info->ch_msk & BIT(i))) -+ continue; -+ - info->ch_usage[i].total = readl_relaxed(dfi_regs + - DDRMON_CH0_COUNT_NUM + i * 20); -- tmp = info->ch_usage[i].access; -+ -+ /* LPDDR4 BL = 16,other DDR type BL = 8 */ -+ tmp = readl_relaxed(dfi_regs + -+ DDRMON_CH0_DFI_ACCESS_NUM + i * 20); -+ if (info->dram_type == LPDDR4) -+ tmp *= 8; -+ else -+ tmp *= 4; -+ info->ch_usage[i].access = tmp; -+ - if (tmp > max) { - busier_ch = i; - max = tmp; -@@ -121,7 +400,8 @@ static int rockchip_dfi_disable(struct devfreq_event_dev *edev) - struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); - - rockchip_dfi_stop_hardware_counter(edev); -- clk_disable_unprepare(info->clk); -+ if (info->clk) -+ clk_disable_unprepare(info->clk); - - return 0; - } -@@ -131,10 +411,13 @@ static int rockchip_dfi_enable(struct devfreq_event_dev *edev) - struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); - int ret; - -- ret = clk_prepare_enable(info->clk); -- if (ret) { -- dev_err(&edev->dev, "failed to enable dfi clk: %d\n", ret); -- return ret; -+ if (info->clk) { -+ ret = clk_prepare_enable(info->clk); -+ if (ret) { -+ dev_err(&edev->dev, "failed to enable dfi clk: %d\n", -+ ret); -+ return ret; -+ } - } - - rockchip_dfi_start_hardware_counter(edev); -@@ -151,8 +434,11 @@ static int rockchip_dfi_get_event(struct devfreq_event_dev *edev, - { - struct rockchip_dfi *info = devfreq_event_get_drvdata(edev); - int busier_ch; -+ unsigned long flags; - -+ local_irq_save(flags); - busier_ch = rockchip_dfi_get_busier_ch(edev); -+ local_irq_restore(flags); - - edata->load_count = info->ch_usage[busier_ch].access; - edata->total_count = info->ch_usage[busier_ch].total; -@@ -167,23 +453,117 @@ static const struct devfreq_event_ops rockchip_dfi_ops = { - .set_event = rockchip_dfi_set_event, - }; - --static const struct of_device_id rockchip_dfi_id_match[] = { -- { .compatible = "rockchip,rk3399-dfi" }, -- { }, --}; --MODULE_DEVICE_TABLE(of, rockchip_dfi_id_match); -+static __init int px30_dfi_init(struct platform_device *pdev, -+ struct rockchip_dfi *data, -+ struct devfreq_event_desc *desc) -+{ -+ struct device_node *np = pdev->dev.of_node, *node; -+ struct resource *res; -+ u32 val; - --static int rockchip_dfi_probe(struct platform_device *pdev) -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ data->regs = devm_ioremap_resource(&pdev->dev, res); -+ if (IS_ERR(data->regs)) -+ return PTR_ERR(data->regs); -+ -+ node = of_parse_phandle(np, "rockchip,pmugrf", 0); -+ if (node) { -+ data->regmap_pmugrf = syscon_node_to_regmap(node); -+ if (IS_ERR(data->regmap_pmugrf)) -+ return PTR_ERR(data->regmap_pmugrf); -+ } -+ -+ regmap_read(data->regmap_pmugrf, PX30_PMUGRF_OS_REG2, &val); -+ data->dram_type = READ_DRAMTYPE_INFO(val); -+ data->ch_msk = 1; -+ data->clk = NULL; -+ -+ desc->ops = &rockchip_dfi_ops; -+ -+ return 0; -+} -+ -+static __init int rk3128_dfi_init(struct platform_device *pdev, -+ struct rockchip_dfi *data, -+ struct devfreq_event_desc *desc) -+{ -+ struct device_node *np = pdev->dev.of_node, *node; -+ -+ node = of_parse_phandle(np, "rockchip,grf", 0); -+ if (node) { -+ data->regmap_grf = syscon_node_to_regmap(node); -+ if (IS_ERR(data->regmap_grf)) -+ return PTR_ERR(data->regmap_grf); -+ } -+ -+ desc->ops = &rk3128_dfi_ops; -+ -+ return 0; -+} -+ -+static __init int rk3288_dfi_init(struct platform_device *pdev, -+ struct rockchip_dfi *data, -+ struct devfreq_event_desc *desc) -+{ -+ struct device_node *np = pdev->dev.of_node, *node; -+ u32 val; -+ -+ node = of_parse_phandle(np, "rockchip,pmu", 0); -+ if (node) { -+ data->regmap_pmu = syscon_node_to_regmap(node); -+ if (IS_ERR(data->regmap_pmu)) -+ return PTR_ERR(data->regmap_pmu); -+ } -+ -+ node = of_parse_phandle(np, "rockchip,grf", 0); -+ if (node) { -+ data->regmap_grf = syscon_node_to_regmap(node); -+ if (IS_ERR(data->regmap_grf)) -+ return PTR_ERR(data->regmap_grf); -+ } -+ -+ regmap_read(data->regmap_pmu, RK3288_PMU_SYS_REG2, &val); -+ data->dram_type = READ_DRAMTYPE_INFO(val); -+ data->ch_msk = READ_CH_INFO(val); -+ -+ if (data->dram_type == DDR3) -+ regmap_write(data->regmap_grf, RK3288_GRF_SOC_CON4, -+ RK3288_DDR3_SEL); -+ else -+ regmap_write(data->regmap_grf, RK3288_GRF_SOC_CON4, -+ RK3288_LPDDR_SEL); -+ -+ desc->ops = &rk3288_dfi_ops; -+ -+ return 0; -+} -+ -+static __init int rk3368_dfi_init(struct platform_device *pdev, -+ struct rockchip_dfi *data, -+ struct devfreq_event_desc *desc) -+{ -+ struct device *dev = &pdev->dev; -+ -+ if (!dev->parent || !dev->parent->of_node) -+ return -EINVAL; -+ -+ data->regmap_grf = syscon_node_to_regmap(dev->parent->of_node); -+ if (IS_ERR(data->regmap_grf)) -+ return PTR_ERR(data->regmap_grf); -+ -+ desc->ops = &rk3368_dfi_ops; -+ -+ return 0; -+} -+ -+static __init int rockchip_dfi_init(struct platform_device *pdev, -+ struct rockchip_dfi *data, -+ struct devfreq_event_desc *desc) - { - struct device *dev = &pdev->dev; -- struct rockchip_dfi *data; - struct resource *res; -- struct devfreq_event_desc *desc; - struct device_node *np = pdev->dev.of_node, *node; -- -- data = devm_kzalloc(dev, sizeof(struct rockchip_dfi), GFP_KERNEL); -- if (!data) -- return -ENOMEM; -+ u32 val; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - data->regs = devm_ioremap_resource(&pdev->dev, res); -@@ -203,21 +583,97 @@ static int rockchip_dfi_probe(struct platform_device *pdev) - if (IS_ERR(data->regmap_pmu)) - return PTR_ERR(data->regmap_pmu); - } -- data->dev = dev; -+ -+ regmap_read(data->regmap_pmu, PMUGRF_OS_REG2, &val); -+ data->dram_type = READ_DRAMTYPE_INFO(val); -+ data->ch_msk = READ_CH_INFO(val); -+ -+ desc->ops = &rockchip_dfi_ops; -+ -+ return 0; -+} -+ -+static __init int rk3328_dfi_init(struct platform_device *pdev, -+ struct rockchip_dfi *data, -+ struct devfreq_event_desc *desc) -+{ -+ struct device_node *np = pdev->dev.of_node, *node; -+ struct resource *res; -+ u32 val; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ data->regs = devm_ioremap_resource(&pdev->dev, res); -+ if (IS_ERR(data->regs)) -+ return PTR_ERR(data->regs); -+ -+ node = of_parse_phandle(np, "rockchip,grf", 0); -+ if (node) { -+ data->regmap_grf = syscon_node_to_regmap(node); -+ if (IS_ERR(data->regmap_grf)) -+ return PTR_ERR(data->regmap_grf); -+ } -+ -+ regmap_read(data->regmap_grf, RK3328_GRF_OS_REG2, &val); -+ data->dram_type = READ_DRAMTYPE_INFO(val); -+ data->ch_msk = 1; -+ data->clk = NULL; -+ -+ desc->ops = &rockchip_dfi_ops; -+ -+ return 0; -+} -+ -+static const struct of_device_id rockchip_dfi_id_match[] = { -+ { .compatible = "rockchip,px30-dfi", .data = px30_dfi_init }, -+ { .compatible = "rockchip,rk1808-dfi", .data = px30_dfi_init }, -+ { .compatible = "rockchip,rk3128-dfi", .data = rk3128_dfi_init }, -+ { .compatible = "rockchip,rk3288-dfi", .data = rk3288_dfi_init }, -+ { .compatible = "rockchip,rk3328-dfi", .data = rk3328_dfi_init }, -+ { .compatible = "rockchip,rk3368-dfi", .data = rk3368_dfi_init }, -+ { .compatible = "rockchip,rk3399-dfi", .data = rockchip_dfi_init }, -+ { }, -+}; -+MODULE_DEVICE_TABLE(of, rockchip_dfi_id_match); -+ -+static int rockchip_dfi_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct rockchip_dfi *data; -+ struct devfreq_event_desc *desc; -+ struct device_node *np = pdev->dev.of_node; -+ const struct of_device_id *match; -+ int (*init)(struct platform_device *pdev, struct rockchip_dfi *data, -+ struct devfreq_event_desc *desc); -+ -+ data = devm_kzalloc(dev, sizeof(struct rockchip_dfi), GFP_KERNEL); -+ if (!data) -+ return -ENOMEM; - - desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL); - if (!desc) - return -ENOMEM; - -- desc->ops = &rockchip_dfi_ops; -+ match = of_match_node(rockchip_dfi_id_match, pdev->dev.of_node); -+ if (match) { -+ init = match->data; -+ if (init) { -+ if (init(pdev, data, desc)) -+ return -EINVAL; -+ } else { -+ return 0; -+ } -+ } else { -+ return 0; -+ } -+ - desc->driver_data = data; - desc->name = np->name; - data->desc = desc; -+ data->dev = dev; - -- data->edev = devm_devfreq_event_add_edev(&pdev->dev, desc); -+ data->edev = devm_devfreq_event_add_edev(dev, desc); - if (IS_ERR(data->edev)) { -- dev_err(&pdev->dev, -- "failed to add devfreq-event device\n"); -+ dev_err(dev, "failed to add devfreq-event device\n"); - return PTR_ERR(data->edev); - } diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch deleted file mode 100644 index e9b79b6..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f9ae6e992d3d9e80357fee7d65ba0fe2dd37ae1f Mon Sep 17 00:00:00 2001 -From: hmz007 -Date: Tue, 19 Nov 2019 14:21:51 +0800 -Subject: [PATCH] arm64: dts: rockchip: rk3328: add dfi node - -Signed-off-by: hmz007 -[adjusted commit title] -Signed-off-by: Tianling Shen ---- - arch/arm64/boot/dts/rockchip/rk3328.dtsi | 7 +++++++ - ---- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -993,6 +993,13 @@ - }; - }; - -+ dfi: dfi@ff790000 { -+ reg = <0x00 0xff790000 0x00 0x400>; -+ compatible = "rockchip,rk3328-dfi"; -+ rockchip,grf = <&grf>; -+ status = "disabled"; -+ }; -+ - gic: interrupt-controller@ff811000 { - compatible = "arm,gic-400"; - #interrupt-cells = <3>; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/807-arm64-dts-nanopi-r2s-add-rk3328-dmc-relate-node.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/807-arm64-dts-nanopi-r2s-add-rk3328-dmc-relate-node.patch deleted file mode 100644 index 091e295..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/807-arm64-dts-nanopi-r2s-add-rk3328-dmc-relate-node.patch +++ /dev/null @@ -1,126 +0,0 @@ -From f9ae6e992d3d9e80357fee7d65ba0fe2dd37ae1f Mon Sep 17 00:00:00 2001 -From: hmz007 -Date: Tue, 19 Nov 2019 14:21:51 +0800 -Subject: [PATCH] arm64: dts: nanopi-r2: add rk3328-dmc relate node - -Signed-off-by: hmz007 ---- - .../rockchip/rk3328-dram-default-timing.dtsi | 311 ++++++++++++++++++ - .../dts/rockchip/rk3328-nanopi-r2-common.dtsi | 85 ++++- - include/dt-bindings/clock/rockchip-ddr.h | 63 ++++ - include/dt-bindings/memory/rk3328-dram.h | 159 +++++++++ - 4 files changed, 617 insertions(+), 1 deletion(-) - create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-dram-default-timing.dtsi - create mode 100644 include/dt-bindings/clock/rockchip-ddr.h - create mode 100644 include/dt-bindings/memory/rk3328-dram.h - ---- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -7,6 +7,7 @@ - - #include - #include -+#include "rk3328-dram-default-timing.dtsi" - #include "rk3328.dtsi" - - / { -@@ -115,6 +116,72 @@ - regulator-max-microvolt = <5000000>; - enable-active-high; - }; -+ -+ dmc: dmc { -+ compatible = "rockchip,rk3328-dmc"; -+ devfreq-events = <&dfi>; -+ center-supply = <&vdd_log>; -+ clocks = <&cru SCLK_DDRCLK>; -+ clock-names = "dmc_clk"; -+ operating-points-v2 = <&dmc_opp_table>; -+ ddr_timing = <&ddr_timing>; -+ upthreshold = <40>; -+ downdifferential = <20>; -+ auto-min-freq = <786000>; -+ auto-freq-en = <0>; -+ #cooling-cells = <2>; -+ status = "okay"; -+ -+ ddr_power_model: ddr_power_model { -+ compatible = "ddr_power_model"; -+ dynamic-power-coefficient = <120>; -+ static-power-coefficient = <200>; -+ ts = <32000 4700 (-80) 2>; -+ thermal-zone = "soc-thermal"; -+ }; -+ }; -+ -+ dmc_opp_table: dmc-opp-table { -+ compatible = "operating-points-v2"; -+ -+ rockchip,leakage-voltage-sel = < -+ 1 10 0 -+ 11 254 1 -+ >; -+ nvmem-cells = <&logic_leakage>; -+ nvmem-cell-names = "ddr_leakage"; -+ -+ opp-786000000 { -+ opp-hz = /bits/ 64 <786000000>; -+ opp-microvolt = <1075000>; -+ opp-microvolt-L0 = <1075000>; -+ opp-microvolt-L1 = <1050000>; -+ }; -+ opp-798000000 { -+ opp-hz = /bits/ 64 <798000000>; -+ opp-microvolt = <1075000>; -+ opp-microvolt-L0 = <1075000>; -+ opp-microvolt-L1 = <1050000>; -+ }; -+ opp-840000000 { -+ opp-hz = /bits/ 64 <840000000>; -+ opp-microvolt = <1075000>; -+ opp-microvolt-L0 = <1075000>; -+ opp-microvolt-L1 = <1050000>; -+ }; -+ opp-924000000 { -+ opp-hz = /bits/ 64 <924000000>; -+ opp-microvolt = <1100000>; -+ opp-microvolt-L0 = <1100000>; -+ opp-microvolt-L1 = <1075000>; -+ }; -+ opp-1056000000 { -+ opp-hz = /bits/ 64 <1056000000>; -+ opp-microvolt = <1175000>; -+ opp-microvolt-L0 = <1175000>; -+ opp-microvolt-L1 = <1150000>; -+ }; -+ }; - }; - - &cpu0 { -@@ -133,6 +200,10 @@ - cpu-supply = <&vdd_arm>; - }; - -+&dfi { -+ status = "okay"; -+}; -+ - &gmac2io { - assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>; - assigned-clock-parents = <&gmac_clk>, <&gmac_clk>; -@@ -198,6 +269,7 @@ - regulator-name = "vdd_log"; - regulator-always-on; - regulator-boot-on; -+ regulator-init-microvolt = <1075000>; - regulator-min-microvolt = <712500>; - regulator-max-microvolt = <1450000>; - regulator-ramp-delay = <12500>; -@@ -212,6 +284,7 @@ - regulator-name = "vdd_arm"; - regulator-always-on; - regulator-boot-on; -+ regulator-init-microvolt = <1225000>; - regulator-min-microvolt = <712500>; - regulator-max-microvolt = <1450000>; - regulator-ramp-delay = <12500>; diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/911-kernel-dma-adjust-default-coherent_pool-to-2MiB.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/911-kernel-dma-adjust-default-coherent_pool-to-2MiB.patch deleted file mode 100644 index c870a4f..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/911-kernel-dma-adjust-default-coherent_pool-to-2MiB.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 16bdf3e76fec6ddb44f1fcf221139fb39d225031 Mon Sep 17 00:00:00 2001 -From: Igor Pecovnik -Date: Sat, 2 Jan 2021 05:23:55 +0000 -Subject: [PATCH] kernel: dma: adjust default coherent_pool to 2MiB - ---- - kernel/dma/remap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/kernel/dma/remap.c -+++ b/kernel/dma/remap.c -@@ -101,7 +101,7 @@ void dma_common_free_remap(void *cpu_add - #ifdef CONFIG_DMA_DIRECT_REMAP - static struct gen_pool *atomic_pool __ro_after_init; - --#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K -+#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_2M - static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE; - - static int __init early_coherent_pool(char *p) diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch deleted file mode 100644 index 818ee4c..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Leonidas P. Papadakos -Date: Fri, 1 Mar 2019 21:55:53 +0200 -Subject: [PATCH v2] arm64: dts: rockchip: add more cpu operating points for - RK3328 - -This allows for greater max frequency on rk3328 boards, -increasing performance. - -It has been included in Armbian (a linux distibution for ARM boards) -for a while now without any reported issues - -https://github.com/armbian/build/blob/master/patch/kernel/rockchip64-default/enable-1392mhz-opp.patch -https://github.com/armbian/build/blob/master/patch/kernel/rockchip64-default/enable-1512mhz-opp.patch - -Signed-off-by: Leonidas P. Papadakos ---- - arch/arm64/boot/dts/rockchip/rk3328.dtsi | 15 +++++++++++++++ - 1 files changed, 15 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -140,6 +140,21 @@ - opp-microvolt = <1300000>; - clock-latency-ns = <40000>; - }; -+ opp-1392000000 { -+ opp-hz = /bits/ 64 <1392000000>; -+ opp-microvolt = <1350000>; -+ clock-latency-ns = <40000>; -+ }; -+ opp-1512000000 { -+ opp-hz = /bits/ 64 <1512000000>; -+ opp-microvolt = <1400000>; -+ clock-latency-ns = <40000>; -+ }; -+ opp-1608000000 { -+ opp-hz = /bits/ 64 <1608000000>; -+ opp-microvolt = <1450000>; -+ clock-latency-ns = <40000>; -+ }; - }; - - amba { diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/992-rockchip-rk3399-overclock-to-2.2-1.8-GHz.patch b/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/992-rockchip-rk3399-overclock-to-2.2-1.8-GHz.patch deleted file mode 100644 index 12cb932..0000000 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/992-rockchip-rk3399-overclock-to-2.2-1.8-GHz.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 04202df5cb497b1934c95211cf43784ef62245a4 Mon Sep 17 00:00:00 2001 -From: Tianling Shen -Date: Mon, 18 Oct 2021 12:47:30 +0800 -Subject: [PATCH] rockchip: rk3399: overclock to 2.2/1.8 GHz - -It's stable enough to overclock cpu frequency to 2.2/1.8 GHz, -and for better performance. - -Co-development-by: gzelvis -Signed-off-by: Tianling Shen ---- - arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi -@@ -33,6 +33,14 @@ - opp-hz = /bits/ 64 <1416000000>; - opp-microvolt = <1125000>; - }; -+ opp06 { -+ opp-hz = /bits/ 64 <1608000000>; -+ opp-microvolt = <1225000>; -+ }; -+ opp07 { -+ opp-hz = /bits/ 64 <1800000000>; -+ opp-microvolt = <1275000>; -+ }; - }; - - cluster1_opp: opp-table1 { -@@ -72,6 +80,14 @@ - opp-hz = /bits/ 64 <1800000000>; - opp-microvolt = <1200000>; - }; -+ opp08 { -+ opp-hz = /bits/ 64 <2016000000>; -+ opp-microvolt = <1250000>; -+ }; -+ opp09 { -+ opp-hz = /bits/ 64 <2208000000>; -+ opp-microvolt = <1325000>; -+ }; - }; - - gpu_opp_table: opp-table2 { diff --git a/openwrt-21.02/patches/kernel-5.4/001-r8152-v1-11-11.patch b/openwrt-21.02/patches/kernel-5.4/001-r8152-v1-11-11.patch deleted file mode 100644 index 0a57ad2..0000000 --- a/openwrt-21.02/patches/kernel-5.4/001-r8152-v1-11-11.patch +++ /dev/null @@ -1,1876 +0,0 @@ -diff -rauN linux-5.4.111-orig/drivers/net/usb/r8152.c linux-5.4.111/drivers/net/usb/r8152.c ---- linux-5.4.111-orig/drivers/net/usb/r8152.c 2021-04-10 13:34:32.000000000 +0200 -+++ linux-5.4.111/drivers/net/usb/r8152.c 2021-04-26 02:09:31.827492250 +0200 -@@ -24,9 +24,11 @@ - #include - #include - #include -+#include -+#include - - /* Information for net-next */ --#define NETNEXT_VERSION "10" -+#define NETNEXT_VERSION "11" - - /* Information for net */ - #define NET_VERSION "11" -@@ -54,8 +56,11 @@ - #define PLA_BDC_CR 0xd1a0 - #define PLA_TEREDO_TIMER 0xd2cc - #define PLA_REALWOW_TIMER 0xd2e8 -+#define PLA_UPHY_TIMER 0xd388 - #define PLA_SUSPEND_FLAG 0xd38a - #define PLA_INDICATE_FALG 0xd38c -+#define PLA_MACDBG_PRE 0xd38c /* RTL_VER_04 only */ -+#define PLA_MACDBG_POST 0xd38e /* RTL_VER_04 only */ - #define PLA_EXTRA_STATUS 0xd398 - #define PLA_EFUSE_DATA 0xdd00 - #define PLA_EFUSE_CMD 0xdd02 -@@ -113,7 +118,12 @@ - #define USB_CONNECT_TIMER 0xcbf8 - #define USB_MSC_TIMER 0xcbfc - #define USB_BURST_SIZE 0xcfc0 -+#define USB_FW_FIX_EN0 0xcfca -+#define USB_FW_FIX_EN1 0xcfcc - #define USB_LPM_CONFIG 0xcfd8 -+#define USB_CSTMR 0xcfef /* RTL8153A */ -+#define USB_FW_CTRL 0xd334 /* RTL8153B */ -+#define USB_FC_TIMER 0xd340 - #define USB_USB_CTRL 0xd406 - #define USB_PHY_CTRL 0xd408 - #define USB_TX_AGG 0xd40a -@@ -129,6 +139,7 @@ - #define USB_LPM_CTRL 0xd41a - #define USB_BMU_RESET 0xd4b0 - #define USB_U1U2_TIMER 0xd4da -+#define USB_FW_TASK 0xd4e8 /* RTL8153B */ - #define USB_UPS_CTRL 0xd800 - #define USB_POWER_CUT 0xd80a - #define USB_MISC_0 0xd81a -@@ -136,18 +147,19 @@ - #define USB_AFE_CTRL2 0xd824 - #define USB_UPS_CFG 0xd842 - #define USB_UPS_FLAGS 0xd848 -+#define USB_WDT1_CTRL 0xe404 - #define USB_WDT11_CTRL 0xe43c --#define USB_BP_BA 0xfc26 --#define USB_BP_0 0xfc28 --#define USB_BP_1 0xfc2a --#define USB_BP_2 0xfc2c --#define USB_BP_3 0xfc2e --#define USB_BP_4 0xfc30 --#define USB_BP_5 0xfc32 --#define USB_BP_6 0xfc34 --#define USB_BP_7 0xfc36 --#define USB_BP_EN 0xfc38 --#define USB_BP_8 0xfc38 -+#define USB_BP_BA PLA_BP_BA -+#define USB_BP_0 PLA_BP_0 -+#define USB_BP_1 PLA_BP_1 -+#define USB_BP_2 PLA_BP_2 -+#define USB_BP_3 PLA_BP_3 -+#define USB_BP_4 PLA_BP_4 -+#define USB_BP_5 PLA_BP_5 -+#define USB_BP_6 PLA_BP_6 -+#define USB_BP_7 PLA_BP_7 -+#define USB_BP_EN PLA_BP_EN /* RTL8153A */ -+#define USB_BP_8 0xfc38 /* RTL8153B */ - #define USB_BP_9 0xfc3a - #define USB_BP_10 0xfc3c - #define USB_BP_11 0xfc3e -@@ -178,6 +190,7 @@ - #define OCP_PHY_STATE 0xa708 /* nway state for 8153 */ - #define OCP_PHY_PATCH_STAT 0xb800 - #define OCP_PHY_PATCH_CMD 0xb820 -+#define OCP_PHY_LOCK 0xb82e - #define OCP_ADC_IOFFSET 0xbcfc - #define OCP_ADC_CFG 0xbc06 - #define OCP_SYSCLK_CFG 0xc416 -@@ -188,6 +201,7 @@ - #define SRAM_10M_AMP1 0x8080 - #define SRAM_10M_AMP2 0x8082 - #define SRAM_IMPEDANCE 0x8084 -+#define SRAM_PHY_LOCK 0xb82e - - /* PLA_RCR */ - #define RCR_AAP 0x00000001 -@@ -357,8 +371,15 @@ - /* PLA_INDICATE_FALG */ - #define UPCOMING_RUNTIME_D3 BIT(0) - -+/* PLA_MACDBG_PRE and PLA_MACDBG_POST */ -+#define DEBUG_OE BIT(0) -+#define DEBUG_LTSSM 0x0082 -+ - /* PLA_EXTRA_STATUS */ -+#define CUR_LINK_OK BIT(15) -+#define U3P3_CHECK_EN BIT(7) /* RTL_VER_05 only */ - #define LINK_CHANGE_FLAG BIT(8) -+#define POLL_LINK_CHG BIT(0) - - /* USB_USB2PHY */ - #define USB2PHY_SUSPEND 0x0001 -@@ -382,6 +403,12 @@ - #define STAT_SPEED_HIGH 0x0000 - #define STAT_SPEED_FULL 0x0002 - -+/* USB_FW_FIX_EN0 */ -+#define FW_FIX_SUSPEND BIT(14) -+ -+/* USB_FW_FIX_EN1 */ -+#define FW_IP_RESET_EN BIT(9) -+ - /* USB_LPM_CONFIG */ - #define LPM_U1U2_EN BIT(0) - -@@ -406,12 +433,24 @@ - #define OWN_UPDATE BIT(0) - #define OWN_CLEAR BIT(1) - -+/* USB_FW_TASK */ -+#define FC_PATCH_TASK BIT(1) -+ - /* USB_UPS_CTRL */ - #define POWER_CUT 0x0100 - - /* USB_PM_CTRL_STATUS */ - #define RESUME_INDICATE 0x0001 - -+/* USB_CSTMR */ -+#define FORCE_SUPER BIT(0) -+ -+/* USB_FW_CTRL */ -+#define FLOW_CTRL_PATCH_OPT BIT(1) -+ -+/* USB_FC_TIMER */ -+#define CTRL_TIMER_EN BIT(15) -+ - /* USB_USB_CTRL */ - #define RX_AGG_DISABLE 0x0010 - #define RX_ZERO_EN 0x0080 -@@ -433,6 +472,9 @@ - #define COALESCE_HIGH 250000U - #define COALESCE_SLOW 524280U - -+/* USB_WDT1_CTRL */ -+#define WTD1_EN BIT(0) -+ - /* USB_WDT11_CTRL */ - #define TIMER11_EN 0x0001 - -@@ -553,6 +595,9 @@ - /* OCP_PHY_PATCH_CMD */ - #define PATCH_REQUEST BIT(4) - -+/* OCP_PHY_LOCK */ -+#define PATCH_LOCK BIT(0) -+ - /* OCP_ADC_CFG */ - #define CKADSEL_L 0x0100 - #define ADC_EN 0x0080 -@@ -577,6 +622,9 @@ - /* SRAM_IMPEDANCE */ - #define RX_DRIVING_MASK 0x6000 - -+/* SRAM_PHY_LOCK */ -+#define PHY_PATCH_LOCK 0x0001 -+ - /* MAC PASSTHRU */ - #define AD_MASK 0xfee0 - #define BND_MASK 0x0004 -@@ -584,6 +632,8 @@ - #define EFUSE 0xcfdb - #define PASS_THRU_MASK 0x1 - -+#define BP4_SUPER_ONLY 0x1578 /* RTL_VER_04 only */ -+ - enum rtl_register_content { - _1000bps = 0x10, - _100bps = 0x08, -@@ -636,6 +686,7 @@ - SCHEDULE_TASKLET, - GREEN_ETHERNET, - DELL_TB_RX_AGG_BUG, -+ LENOVO_MACPASSTHRU, - }; - - /* Define these values to match your device */ -@@ -750,16 +801,16 @@ - struct tasklet_struct tx_tl; - - struct rtl_ops { -- void (*init)(struct r8152 *); -- int (*enable)(struct r8152 *); -- void (*disable)(struct r8152 *); -- void (*up)(struct r8152 *); -- void (*down)(struct r8152 *); -- void (*unload)(struct r8152 *); -- int (*eee_get)(struct r8152 *, struct ethtool_eee *); -- int (*eee_set)(struct r8152 *, struct ethtool_eee *); -- bool (*in_nway)(struct r8152 *); -- void (*hw_phy_cfg)(struct r8152 *); -+ void (*init)(struct r8152 *tp); -+ int (*enable)(struct r8152 *tp); -+ void (*disable)(struct r8152 *tp); -+ void (*up)(struct r8152 *tp); -+ void (*down)(struct r8152 *tp); -+ void (*unload)(struct r8152 *tp); -+ int (*eee_get)(struct r8152 *tp, struct ethtool_eee *eee); -+ int (*eee_set)(struct r8152 *tp, struct ethtool_eee *eee); -+ bool (*in_nway)(struct r8152 *tp); -+ void (*hw_phy_cfg)(struct r8152 *tp); - void (*autosuspend_en)(struct r8152 *tp, bool enable); - } rtl_ops; - -@@ -780,6 +831,19 @@ - u32 ctap_short_off:1; - } ups_info; - -+#define RTL_VER_SIZE 32 -+ -+ struct rtl_fw { -+ const char *fw_name; -+ const struct firmware *fw; -+ -+ char version[RTL_VER_SIZE]; -+ int (*pre_fw)(struct r8152 *tp); -+ int (*post_fw)(struct r8152 *tp); -+ -+ bool retry; -+ } rtl_fw; -+ - atomic_t rx_count; - - bool eee_en; -@@ -802,6 +866,131 @@ - u8 autoneg; - }; - -+/** -+ * struct fw_block - block type and total length -+ * @type: type of the current block, such as RTL_FW_END, RTL_FW_PLA, -+ * RTL_FW_USB and so on. -+ * @length: total length of the current block. -+ */ -+struct fw_block { -+ __le32 type; -+ __le32 length; -+} __packed; -+ -+/** -+ * struct fw_header - header of the firmware file -+ * @checksum: checksum of sha256 which is calculated from the whole file -+ * except the checksum field of the file. That is, calculate sha256 -+ * from the version field to the end of the file. -+ * @version: version of this firmware. -+ * @blocks: the first firmware block of the file -+ */ -+struct fw_header { -+ u8 checksum[32]; -+ char version[RTL_VER_SIZE]; -+ struct fw_block blocks[0]; -+} __packed; -+ -+/** -+ * struct fw_mac - a firmware block used by RTL_FW_PLA and RTL_FW_USB. -+ * The layout of the firmware block is: -+ * + + . -+ * @fw_offset: offset of the firmware binary data. The start address of -+ * the data would be the address of struct fw_mac + @fw_offset. -+ * @fw_reg: the register to load the firmware. Depends on chip. -+ * @bp_ba_addr: the register to write break point base address. Depends on -+ * chip. -+ * @bp_ba_value: break point base address. Depends on chip. -+ * @bp_en_addr: the register to write break point enabled mask. Depends -+ * on chip. -+ * @bp_en_value: break point enabled mask. Depends on the firmware. -+ * @bp_start: the start register of break points. Depends on chip. -+ * @bp_num: the break point number which needs to be set for this firmware. -+ * Depends on the firmware. -+ * @bp: break points. Depends on firmware. -+ * @fw_ver_reg: the register to store the fw version. -+ * @fw_ver_data: the firmware version of the current type. -+ * @info: additional information for debugging, and is followed by the -+ * binary data of firmware. -+ */ -+struct fw_mac { -+ struct fw_block blk_hdr; -+ __le16 fw_offset; -+ __le16 fw_reg; -+ __le16 bp_ba_addr; -+ __le16 bp_ba_value; -+ __le16 bp_en_addr; -+ __le16 bp_en_value; -+ __le16 bp_start; -+ __le16 bp_num; -+ __le16 bp[16]; /* any value determined by firmware */ -+ __le32 reserved; -+ __le16 fw_ver_reg; -+ u8 fw_ver_data; -+ char info[0]; -+} __packed; -+ -+/** -+ * struct fw_phy_patch_key - a firmware block used by RTL_FW_PHY_START. -+ * This is used to set patch key when loading the firmware of PHY. -+ * @key_reg: the register to write the patch key. -+ * @key_data: patch key. -+ */ -+struct fw_phy_patch_key { -+ struct fw_block blk_hdr; -+ __le16 key_reg; -+ __le16 key_data; -+ __le32 reserved; -+} __packed; -+ -+/** -+ * struct fw_phy_nc - a firmware block used by RTL_FW_PHY_NC. -+ * The layout of the firmware block is: -+ * + + . -+ * @fw_offset: offset of the firmware binary data. The start address of -+ * the data would be the address of struct fw_phy_nc + @fw_offset. -+ * @fw_reg: the register to load the firmware. Depends on chip. -+ * @ba_reg: the register to write the base address. Depends on chip. -+ * @ba_data: base address. Depends on chip. -+ * @patch_en_addr: the register of enabling patch mode. Depends on chip. -+ * @patch_en_value: patch mode enabled mask. Depends on the firmware. -+ * @mode_reg: the regitster of switching the mode. -+ * @mod_pre: the mode needing to be set before loading the firmware. -+ * @mod_post: the mode to be set when finishing to load the firmware. -+ * @bp_start: the start register of break points. Depends on chip. -+ * @bp_num: the break point number which needs to be set for this firmware. -+ * Depends on the firmware. -+ * @bp: break points. Depends on firmware. -+ * @info: additional information for debugging, and is followed by the -+ * binary data of firmware. -+ */ -+struct fw_phy_nc { -+ struct fw_block blk_hdr; -+ __le16 fw_offset; -+ __le16 fw_reg; -+ __le16 ba_reg; -+ __le16 ba_data; -+ __le16 patch_en_addr; -+ __le16 patch_en_value; -+ __le16 mode_reg; -+ __le16 mode_pre; -+ __le16 mode_post; -+ __le16 reserved; -+ __le16 bp_start; -+ __le16 bp_num; -+ __le16 bp[4]; -+ char info[0]; -+} __packed; -+ -+enum rtl_fw_type { -+ RTL_FW_END = 0, -+ RTL_FW_PLA, -+ RTL_FW_USB, -+ RTL_FW_PHY_START, -+ RTL_FW_PHY_STOP, -+ RTL_FW_PHY_NC, -+}; -+ - enum rtl_version { - RTL_VER_UNKNOWN = 0, - RTL_VER_01, -@@ -1236,38 +1425,52 @@ - int ret = -EINVAL; - u32 ocp_data; - unsigned char buf[6]; -- -- /* test for -AD variant of RTL8153 */ -- ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0); -- if ((ocp_data & AD_MASK) == 0x1000) { -- /* test for MAC address pass-through bit */ -- ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, EFUSE); -- if ((ocp_data & PASS_THRU_MASK) != 1) { -- netif_dbg(tp, probe, tp->netdev, -- "No efuse for RTL8153-AD MAC pass through\n"); -- return -ENODEV; -- } -+ char *mac_obj_name; -+ acpi_object_type mac_obj_type; -+ int mac_strlen; -+ -+ if (test_bit(LENOVO_MACPASSTHRU, &tp->flags)) { -+ mac_obj_name = "\\MACA"; -+ mac_obj_type = ACPI_TYPE_STRING; -+ mac_strlen = 0x16; - } else { -- /* test for RTL8153-BND and RTL8153-BD */ -- ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1); -- if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) { -- netif_dbg(tp, probe, tp->netdev, -- "Invalid variant for MAC pass through\n"); -- return -ENODEV; -+ /* test for -AD variant of RTL8153 */ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0); -+ if ((ocp_data & AD_MASK) == 0x1000) { -+ /* test for MAC address pass-through bit */ -+ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, EFUSE); -+ if ((ocp_data & PASS_THRU_MASK) != 1) { -+ netif_dbg(tp, probe, tp->netdev, -+ "No efuse for RTL8153-AD MAC pass through\n"); -+ return -ENODEV; -+ } -+ } else { -+ /* test for RTL8153-BND and RTL8153-BD */ -+ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1); -+ if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) { -+ netif_dbg(tp, probe, tp->netdev, -+ "Invalid variant for MAC pass through\n"); -+ return -ENODEV; -+ } - } -+ -+ mac_obj_name = "\\_SB.AMAC"; -+ mac_obj_type = ACPI_TYPE_BUFFER; -+ mac_strlen = 0x17; - } - - /* returns _AUXMAC_#AABBCCDDEEFF# */ -- status = acpi_evaluate_object(NULL, "\\_SB.AMAC", NULL, &buffer); -+ status = acpi_evaluate_object(NULL, mac_obj_name, NULL, &buffer); - obj = (union acpi_object *)buffer.pointer; - if (!ACPI_SUCCESS(status)) - return -ENODEV; -- if (obj->type != ACPI_TYPE_BUFFER || obj->string.length != 0x17) { -+ if (obj->type != mac_obj_type || obj->string.length != mac_strlen) { - netif_warn(tp, probe, tp->netdev, - "Invalid buffer for pass-thru MAC addr: (%d, %d)\n", - obj->type, obj->string.length); - goto amacout; - } -+ - if (strncmp(obj->string.pointer, "_AUXMAC_#", 9) != 0 || - strncmp(obj->string.pointer + 0x15, "#", 1) != 0) { - netif_warn(tp, probe, tp->netdev, -@@ -1702,7 +1905,7 @@ - } - - /* r8152_csum_workaround() -- * The hw limites the value the transport offset. When the offset is out of the -+ * The hw limits the value of the transport offset. When the offset is out of - * range, calculate the checksum by sw. - */ - static void r8152_csum_workaround(struct r8152 *tp, struct sk_buff *skb, -@@ -1710,8 +1913,8 @@ - { - if (skb_shinfo(skb)->gso_size) { - netdev_features_t features = tp->netdev->features; -+ struct sk_buff *segs, *seg, *next; - struct sk_buff_head seg_list; -- struct sk_buff *segs, *nskb; - - features &= ~(NETIF_F_SG | NETIF_F_IPV6_CSUM | NETIF_F_TSO6); - segs = skb_gso_segment(skb, features); -@@ -1720,12 +1923,10 @@ - - __skb_queue_head_init(&seg_list); - -- do { -- nskb = segs; -- segs = segs->next; -- nskb->next = NULL; -- __skb_queue_tail(&seg_list, nskb); -- } while (segs); -+ skb_list_walk_safe(segs, seg, next) { -+ skb_mark_not_on_list(seg); -+ __skb_queue_tail(&seg_list, seg); -+ } - - skb_queue_splice(&seg_list, list); - dev_kfree_skb(skb); -@@ -2192,6 +2393,7 @@ - int res; - - do { -+ struct net_device *netdev = tp->netdev; - struct tx_agg *agg; - - if (skb_queue_empty(&tp->tx_queue)) -@@ -2202,24 +2404,23 @@ - break; - - res = r8152_tx_agg_fill(tp, agg); -- if (res) { -- struct net_device *netdev = tp->netdev; -+ if (!res) -+ continue; - -- if (res == -ENODEV) { -- rtl_set_unplug(tp); -- netif_device_detach(netdev); -- } else { -- struct net_device_stats *stats = &netdev->stats; -- unsigned long flags; -+ if (res == -ENODEV) { -+ rtl_set_unplug(tp); -+ netif_device_detach(netdev); -+ } else { -+ struct net_device_stats *stats = &netdev->stats; -+ unsigned long flags; - -- netif_warn(tp, tx_err, netdev, -- "failed tx_urb %d\n", res); -- stats->tx_dropped += agg->skb_num; -- -- spin_lock_irqsave(&tp->tx_lock, flags); -- list_add_tail(&agg->list, &tp->tx_free); -- spin_unlock_irqrestore(&tp->tx_lock, flags); -- } -+ netif_warn(tp, tx_err, netdev, -+ "failed tx_urb %d\n", res); -+ stats->tx_dropped += agg->skb_num; -+ -+ spin_lock_irqsave(&tp->tx_lock, flags); -+ list_add_tail(&agg->list, &tp->tx_free); -+ spin_unlock_irqrestore(&tp->tx_lock, flags); - } - } while (res == 0); - } -@@ -2676,6 +2877,17 @@ - r8153_set_rx_early_timeout(tp); - r8153_set_rx_early_size(tp); - -+ if (tp->version == RTL_VER_09) { -+ u32 ocp_data; -+ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_FW_TASK); -+ ocp_data &= ~FC_PATCH_TASK; -+ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_TASK, ocp_data); -+ usleep_range(1000, 2000); -+ ocp_data |= FC_PATCH_TASK; -+ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_TASK, ocp_data); -+ } -+ - return rtl_enable(tp); - } - -@@ -2836,6 +3048,29 @@ - device_set_wakeup_enable(&tp->udev->dev, false); - } - -+static void r8153_mac_clk_spd(struct r8152 *tp, bool enable) -+{ -+ /* MAC clock speed down */ -+ if (enable) { -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, -+ ALDPS_SPDWN_RATIO); -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, -+ EEE_SPDWN_RATIO); -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, -+ PKT_AVAIL_SPDWN_EN | SUSPEND_SPDWN_EN | -+ U1U2_SPDWN_EN | L1_SPDWN_EN); -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, -+ PWRSAVE_SPDWN_EN | RXDV_SPDWN_EN | TX10MIDLE_EN | -+ TP100_SPDWN_EN | TP500_SPDWN_EN | EEE_SPDWN_EN | -+ TP1000_SPDWN_EN); -+ } else { -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0); -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0); -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0); -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0); -+ } -+} -+ - static void r8153_u1u2en(struct r8152 *tp, bool enable) - { - u8 u1u2[8]; -@@ -2983,8 +3218,6 @@ - } - - msleep(20); -- if (test_bit(RTL8152_UNPLUG, &tp->flags)) -- break; - } - - return data; -@@ -3135,9 +3368,11 @@ - if (enable) { - r8153_u1u2en(tp, false); - r8153_u2p3en(tp, false); -+ r8153_mac_clk_spd(tp, true); - rtl_runtime_suspend_enable(tp, true); - } else { - rtl_runtime_suspend_enable(tp, false); -+ r8153_mac_clk_spd(tp, false); - - switch (tp->version) { - case RTL_VER_03: -@@ -3166,7 +3401,8 @@ - r8153b_ups_en(tp, false); - r8153_queue_wake(tp, false); - rtl_runtime_suspend_enable(tp, false); -- r8153b_u1u2en(tp, true); -+ if (tp->udev->speed != USB_SPEED_HIGH) -+ r8153b_u1u2en(tp, true); - } - } - -@@ -3216,6 +3452,688 @@ - ocp_write_byte(tp, MCU_TYPE_USB, USB_BMU_RESET, ocp_data); - } - -+/* Clear the bp to stop the firmware before loading a new one */ -+static void rtl_clear_bp(struct r8152 *tp, u16 type) -+{ -+ switch (tp->version) { -+ case RTL_VER_01: -+ case RTL_VER_02: -+ case RTL_VER_07: -+ break; -+ case RTL_VER_03: -+ case RTL_VER_04: -+ case RTL_VER_05: -+ case RTL_VER_06: -+ ocp_write_byte(tp, type, PLA_BP_EN, 0); -+ break; -+ case RTL_VER_08: -+ case RTL_VER_09: -+ default: -+ if (type == MCU_TYPE_USB) { -+ ocp_write_byte(tp, MCU_TYPE_USB, USB_BP2_EN, 0); -+ -+ ocp_write_word(tp, MCU_TYPE_USB, USB_BP_8, 0); -+ ocp_write_word(tp, MCU_TYPE_USB, USB_BP_9, 0); -+ ocp_write_word(tp, MCU_TYPE_USB, USB_BP_10, 0); -+ ocp_write_word(tp, MCU_TYPE_USB, USB_BP_11, 0); -+ ocp_write_word(tp, MCU_TYPE_USB, USB_BP_12, 0); -+ ocp_write_word(tp, MCU_TYPE_USB, USB_BP_13, 0); -+ ocp_write_word(tp, MCU_TYPE_USB, USB_BP_14, 0); -+ ocp_write_word(tp, MCU_TYPE_USB, USB_BP_15, 0); -+ } else { -+ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_BP_EN, 0); -+ } -+ break; -+ } -+ -+ ocp_write_word(tp, type, PLA_BP_0, 0); -+ ocp_write_word(tp, type, PLA_BP_1, 0); -+ ocp_write_word(tp, type, PLA_BP_2, 0); -+ ocp_write_word(tp, type, PLA_BP_3, 0); -+ ocp_write_word(tp, type, PLA_BP_4, 0); -+ ocp_write_word(tp, type, PLA_BP_5, 0); -+ ocp_write_word(tp, type, PLA_BP_6, 0); -+ ocp_write_word(tp, type, PLA_BP_7, 0); -+ -+ /* wait 3 ms to make sure the firmware is stopped */ -+ usleep_range(3000, 6000); -+ ocp_write_word(tp, type, PLA_BP_BA, 0); -+} -+ -+static int r8153_patch_request(struct r8152 *tp, bool request) -+{ -+ u16 data; -+ int i; -+ -+ data = ocp_reg_read(tp, OCP_PHY_PATCH_CMD); -+ if (request) -+ data |= PATCH_REQUEST; -+ else -+ data &= ~PATCH_REQUEST; -+ ocp_reg_write(tp, OCP_PHY_PATCH_CMD, data); -+ -+ for (i = 0; request && i < 5000; i++) { -+ usleep_range(1000, 2000); -+ if (ocp_reg_read(tp, OCP_PHY_PATCH_STAT) & PATCH_READY) -+ break; -+ } -+ -+ if (request && !(ocp_reg_read(tp, OCP_PHY_PATCH_STAT) & PATCH_READY)) { -+ netif_err(tp, drv, tp->netdev, "patch request fail\n"); -+ r8153_patch_request(tp, false); -+ return -ETIME; -+ } else { -+ return 0; -+ } -+} -+ -+static int r8153_pre_ram_code(struct r8152 *tp, u16 key_addr, u16 patch_key) -+{ -+ if (r8153_patch_request(tp, true)) { -+ dev_err(&tp->intf->dev, "patch request fail\n"); -+ return -ETIME; -+ } -+ -+ sram_write(tp, key_addr, patch_key); -+ sram_write(tp, SRAM_PHY_LOCK, PHY_PATCH_LOCK); -+ -+ return 0; -+} -+ -+static int r8153_post_ram_code(struct r8152 *tp, u16 key_addr) -+{ -+ u16 data; -+ -+ sram_write(tp, 0x0000, 0x0000); -+ -+ data = ocp_reg_read(tp, OCP_PHY_LOCK); -+ data &= ~PATCH_LOCK; -+ ocp_reg_write(tp, OCP_PHY_LOCK, data); -+ -+ sram_write(tp, key_addr, 0x0000); -+ -+ r8153_patch_request(tp, false); -+ -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, tp->ocp_base); -+ -+ return 0; -+} -+ -+static bool rtl8152_is_fw_phy_nc_ok(struct r8152 *tp, struct fw_phy_nc *phy) -+{ -+ u32 length; -+ u16 fw_offset, fw_reg, ba_reg, patch_en_addr, mode_reg, bp_start; -+ bool rc = false; -+ -+ switch (tp->version) { -+ case RTL_VER_04: -+ case RTL_VER_05: -+ case RTL_VER_06: -+ fw_reg = 0xa014; -+ ba_reg = 0xa012; -+ patch_en_addr = 0xa01a; -+ mode_reg = 0xb820; -+ bp_start = 0xa000; -+ break; -+ default: -+ goto out; -+ } -+ -+ fw_offset = __le16_to_cpu(phy->fw_offset); -+ if (fw_offset < sizeof(*phy)) { -+ dev_err(&tp->intf->dev, "fw_offset too small\n"); -+ goto out; -+ } -+ -+ length = __le32_to_cpu(phy->blk_hdr.length); -+ if (length < fw_offset) { -+ dev_err(&tp->intf->dev, "invalid fw_offset\n"); -+ goto out; -+ } -+ -+ length -= __le16_to_cpu(phy->fw_offset); -+ if (!length || (length & 1)) { -+ dev_err(&tp->intf->dev, "invalid block length\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(phy->fw_reg) != fw_reg) { -+ dev_err(&tp->intf->dev, "invalid register to load firmware\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(phy->ba_reg) != ba_reg) { -+ dev_err(&tp->intf->dev, "invalid base address register\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(phy->patch_en_addr) != patch_en_addr) { -+ dev_err(&tp->intf->dev, -+ "invalid patch mode enabled register\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(phy->mode_reg) != mode_reg) { -+ dev_err(&tp->intf->dev, -+ "invalid register to switch the mode\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(phy->bp_start) != bp_start) { -+ dev_err(&tp->intf->dev, -+ "invalid start register of break point\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(phy->bp_num) > 4) { -+ dev_err(&tp->intf->dev, "invalid break point number\n"); -+ goto out; -+ } -+ -+ rc = true; -+out: -+ return rc; -+} -+ -+static bool rtl8152_is_fw_mac_ok(struct r8152 *tp, struct fw_mac *mac) -+{ -+ u16 fw_reg, bp_ba_addr, bp_en_addr, bp_start, fw_offset; -+ bool rc = false; -+ u32 length, type; -+ int i, max_bp; -+ -+ type = __le32_to_cpu(mac->blk_hdr.type); -+ if (type == RTL_FW_PLA) { -+ switch (tp->version) { -+ case RTL_VER_01: -+ case RTL_VER_02: -+ case RTL_VER_07: -+ fw_reg = 0xf800; -+ bp_ba_addr = PLA_BP_BA; -+ bp_en_addr = 0; -+ bp_start = PLA_BP_0; -+ max_bp = 8; -+ break; -+ case RTL_VER_03: -+ case RTL_VER_04: -+ case RTL_VER_05: -+ case RTL_VER_06: -+ case RTL_VER_08: -+ case RTL_VER_09: -+ fw_reg = 0xf800; -+ bp_ba_addr = PLA_BP_BA; -+ bp_en_addr = PLA_BP_EN; -+ bp_start = PLA_BP_0; -+ max_bp = 8; -+ break; -+ default: -+ goto out; -+ } -+ } else if (type == RTL_FW_USB) { -+ switch (tp->version) { -+ case RTL_VER_03: -+ case RTL_VER_04: -+ case RTL_VER_05: -+ case RTL_VER_06: -+ fw_reg = 0xf800; -+ bp_ba_addr = USB_BP_BA; -+ bp_en_addr = USB_BP_EN; -+ bp_start = USB_BP_0; -+ max_bp = 8; -+ break; -+ case RTL_VER_08: -+ case RTL_VER_09: -+ fw_reg = 0xe600; -+ bp_ba_addr = USB_BP_BA; -+ bp_en_addr = USB_BP2_EN; -+ bp_start = USB_BP_0; -+ max_bp = 16; -+ break; -+ case RTL_VER_01: -+ case RTL_VER_02: -+ case RTL_VER_07: -+ default: -+ goto out; -+ } -+ } else { -+ goto out; -+ } -+ -+ fw_offset = __le16_to_cpu(mac->fw_offset); -+ if (fw_offset < sizeof(*mac)) { -+ dev_err(&tp->intf->dev, "fw_offset too small\n"); -+ goto out; -+ } -+ -+ length = __le32_to_cpu(mac->blk_hdr.length); -+ if (length < fw_offset) { -+ dev_err(&tp->intf->dev, "invalid fw_offset\n"); -+ goto out; -+ } -+ -+ length -= fw_offset; -+ if (length < 4 || (length & 3)) { -+ dev_err(&tp->intf->dev, "invalid block length\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(mac->fw_reg) != fw_reg) { -+ dev_err(&tp->intf->dev, "invalid register to load firmware\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(mac->bp_ba_addr) != bp_ba_addr) { -+ dev_err(&tp->intf->dev, "invalid base address register\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(mac->bp_en_addr) != bp_en_addr) { -+ dev_err(&tp->intf->dev, "invalid enabled mask register\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(mac->bp_start) != bp_start) { -+ dev_err(&tp->intf->dev, -+ "invalid start register of break point\n"); -+ goto out; -+ } -+ -+ if (__le16_to_cpu(mac->bp_num) > max_bp) { -+ dev_err(&tp->intf->dev, "invalid break point number\n"); -+ goto out; -+ } -+ -+ for (i = __le16_to_cpu(mac->bp_num); i < max_bp; i++) { -+ if (mac->bp[i]) { -+ dev_err(&tp->intf->dev, "unused bp%u is not zero\n", i); -+ goto out; -+ } -+ } -+ -+ rc = true; -+out: -+ return rc; -+} -+ -+/* Verify the checksum for the firmware file. It is calculated from the version -+ * field to the end of the file. Compare the result with the checksum field to -+ * make sure the file is correct. -+ */ -+static long rtl8152_fw_verify_checksum(struct r8152 *tp, -+ struct fw_header *fw_hdr, size_t size) -+{ -+ unsigned char checksum[sizeof(fw_hdr->checksum)]; -+ struct crypto_shash *alg; -+ struct shash_desc *sdesc; -+ size_t len; -+ long rc; -+ -+ alg = crypto_alloc_shash("sha256", 0, 0); -+ if (IS_ERR(alg)) { -+ rc = PTR_ERR(alg); -+ goto out; -+ } -+ -+ if (crypto_shash_digestsize(alg) != sizeof(fw_hdr->checksum)) { -+ rc = -EFAULT; -+ dev_err(&tp->intf->dev, "digestsize incorrect (%u)\n", -+ crypto_shash_digestsize(alg)); -+ goto free_shash; -+ } -+ -+ len = sizeof(*sdesc) + crypto_shash_descsize(alg); -+ sdesc = kmalloc(len, GFP_KERNEL); -+ if (!sdesc) { -+ rc = -ENOMEM; -+ goto free_shash; -+ } -+ sdesc->tfm = alg; -+ -+ len = size - sizeof(fw_hdr->checksum); -+ rc = crypto_shash_digest(sdesc, fw_hdr->version, len, checksum); -+ kfree(sdesc); -+ if (rc) -+ goto free_shash; -+ -+ if (memcmp(fw_hdr->checksum, checksum, sizeof(fw_hdr->checksum))) { -+ dev_err(&tp->intf->dev, "checksum fail\n"); -+ rc = -EFAULT; -+ } -+ -+free_shash: -+ crypto_free_shash(alg); -+out: -+ return rc; -+} -+ -+static long rtl8152_check_firmware(struct r8152 *tp, struct rtl_fw *rtl_fw) -+{ -+ const struct firmware *fw = rtl_fw->fw; -+ struct fw_header *fw_hdr = (struct fw_header *)fw->data; -+ struct fw_mac *pla = NULL, *usb = NULL; -+ struct fw_phy_patch_key *start = NULL; -+ struct fw_phy_nc *phy_nc = NULL; -+ struct fw_block *stop = NULL; -+ long ret = -EFAULT; -+ int i; -+ -+ if (fw->size < sizeof(*fw_hdr)) { -+ dev_err(&tp->intf->dev, "file too small\n"); -+ goto fail; -+ } -+ -+ ret = rtl8152_fw_verify_checksum(tp, fw_hdr, fw->size); -+ if (ret) -+ goto fail; -+ -+ ret = -EFAULT; -+ -+ for (i = sizeof(*fw_hdr); i < fw->size;) { -+ struct fw_block *block = (struct fw_block *)&fw->data[i]; -+ u32 type; -+ -+ if ((i + sizeof(*block)) > fw->size) -+ goto fail; -+ -+ type = __le32_to_cpu(block->type); -+ switch (type) { -+ case RTL_FW_END: -+ if (__le32_to_cpu(block->length) != sizeof(*block)) -+ goto fail; -+ goto fw_end; -+ case RTL_FW_PLA: -+ if (pla) { -+ dev_err(&tp->intf->dev, -+ "multiple PLA firmware encountered"); -+ goto fail; -+ } -+ -+ pla = (struct fw_mac *)block; -+ if (!rtl8152_is_fw_mac_ok(tp, pla)) { -+ dev_err(&tp->intf->dev, -+ "check PLA firmware failed\n"); -+ goto fail; -+ } -+ break; -+ case RTL_FW_USB: -+ if (usb) { -+ dev_err(&tp->intf->dev, -+ "multiple USB firmware encountered"); -+ goto fail; -+ } -+ -+ usb = (struct fw_mac *)block; -+ if (!rtl8152_is_fw_mac_ok(tp, usb)) { -+ dev_err(&tp->intf->dev, -+ "check USB firmware failed\n"); -+ goto fail; -+ } -+ break; -+ case RTL_FW_PHY_START: -+ if (start || phy_nc || stop) { -+ dev_err(&tp->intf->dev, -+ "check PHY_START fail\n"); -+ goto fail; -+ } -+ -+ if (__le32_to_cpu(block->length) != sizeof(*start)) { -+ dev_err(&tp->intf->dev, -+ "Invalid length for PHY_START\n"); -+ goto fail; -+ } -+ -+ start = (struct fw_phy_patch_key *)block; -+ break; -+ case RTL_FW_PHY_STOP: -+ if (stop || !start) { -+ dev_err(&tp->intf->dev, -+ "Check PHY_STOP fail\n"); -+ goto fail; -+ } -+ -+ if (__le32_to_cpu(block->length) != sizeof(*block)) { -+ dev_err(&tp->intf->dev, -+ "Invalid length for PHY_STOP\n"); -+ goto fail; -+ } -+ -+ stop = block; -+ break; -+ case RTL_FW_PHY_NC: -+ if (!start || stop) { -+ dev_err(&tp->intf->dev, -+ "check PHY_NC fail\n"); -+ goto fail; -+ } -+ -+ if (phy_nc) { -+ dev_err(&tp->intf->dev, -+ "multiple PHY NC encountered\n"); -+ goto fail; -+ } -+ -+ phy_nc = (struct fw_phy_nc *)block; -+ if (!rtl8152_is_fw_phy_nc_ok(tp, phy_nc)) { -+ dev_err(&tp->intf->dev, -+ "check PHY NC firmware failed\n"); -+ goto fail; -+ } -+ -+ break; -+ default: -+ dev_warn(&tp->intf->dev, "Unknown type %u is found\n", -+ type); -+ break; -+ } -+ -+ /* next block */ -+ i += ALIGN(__le32_to_cpu(block->length), 8); -+ } -+ -+fw_end: -+ if ((phy_nc || start) && !stop) { -+ dev_err(&tp->intf->dev, "without PHY_STOP\n"); -+ goto fail; -+ } -+ -+ return 0; -+fail: -+ return ret; -+} -+ -+static void rtl8152_fw_phy_nc_apply(struct r8152 *tp, struct fw_phy_nc *phy) -+{ -+ u16 mode_reg, bp_index; -+ u32 length, i, num; -+ __le16 *data; -+ -+ mode_reg = __le16_to_cpu(phy->mode_reg); -+ sram_write(tp, mode_reg, __le16_to_cpu(phy->mode_pre)); -+ sram_write(tp, __le16_to_cpu(phy->ba_reg), -+ __le16_to_cpu(phy->ba_data)); -+ -+ length = __le32_to_cpu(phy->blk_hdr.length); -+ length -= __le16_to_cpu(phy->fw_offset); -+ num = length / 2; -+ data = (__le16 *)((u8 *)phy + __le16_to_cpu(phy->fw_offset)); -+ -+ ocp_reg_write(tp, OCP_SRAM_ADDR, __le16_to_cpu(phy->fw_reg)); -+ for (i = 0; i < num; i++) -+ ocp_reg_write(tp, OCP_SRAM_DATA, __le16_to_cpu(data[i])); -+ -+ sram_write(tp, __le16_to_cpu(phy->patch_en_addr), -+ __le16_to_cpu(phy->patch_en_value)); -+ -+ bp_index = __le16_to_cpu(phy->bp_start); -+ num = __le16_to_cpu(phy->bp_num); -+ for (i = 0; i < num; i++) { -+ sram_write(tp, bp_index, __le16_to_cpu(phy->bp[i])); -+ bp_index += 2; -+ } -+ -+ sram_write(tp, mode_reg, __le16_to_cpu(phy->mode_post)); -+ -+ dev_dbg(&tp->intf->dev, "successfully applied %s\n", phy->info); -+} -+ -+static void rtl8152_fw_mac_apply(struct r8152 *tp, struct fw_mac *mac) -+{ -+ u16 bp_en_addr, bp_index, type, bp_num, fw_ver_reg; -+ u32 length; -+ u8 *data; -+ int i; -+ -+ switch (__le32_to_cpu(mac->blk_hdr.type)) { -+ case RTL_FW_PLA: -+ type = MCU_TYPE_PLA; -+ break; -+ case RTL_FW_USB: -+ type = MCU_TYPE_USB; -+ break; -+ default: -+ return; -+ } -+ -+ rtl_clear_bp(tp, type); -+ -+ /* Enable backup/restore of MACDBG. This is required after clearing PLA -+ * break points and before applying the PLA firmware. -+ */ -+ if (tp->version == RTL_VER_04 && type == MCU_TYPE_PLA && -+ !(ocp_read_word(tp, MCU_TYPE_PLA, PLA_MACDBG_POST) & DEBUG_OE)) { -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MACDBG_PRE, DEBUG_LTSSM); -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MACDBG_POST, DEBUG_LTSSM); -+ } -+ -+ length = __le32_to_cpu(mac->blk_hdr.length); -+ length -= __le16_to_cpu(mac->fw_offset); -+ -+ data = (u8 *)mac; -+ data += __le16_to_cpu(mac->fw_offset); -+ -+ generic_ocp_write(tp, __le16_to_cpu(mac->fw_reg), 0xff, length, data, -+ type); -+ -+ ocp_write_word(tp, type, __le16_to_cpu(mac->bp_ba_addr), -+ __le16_to_cpu(mac->bp_ba_value)); -+ -+ bp_index = __le16_to_cpu(mac->bp_start); -+ bp_num = __le16_to_cpu(mac->bp_num); -+ for (i = 0; i < bp_num; i++) { -+ ocp_write_word(tp, type, bp_index, __le16_to_cpu(mac->bp[i])); -+ bp_index += 2; -+ } -+ -+ bp_en_addr = __le16_to_cpu(mac->bp_en_addr); -+ if (bp_en_addr) -+ ocp_write_word(tp, type, bp_en_addr, -+ __le16_to_cpu(mac->bp_en_value)); -+ -+ fw_ver_reg = __le16_to_cpu(mac->fw_ver_reg); -+ if (fw_ver_reg) -+ ocp_write_byte(tp, MCU_TYPE_USB, fw_ver_reg, -+ mac->fw_ver_data); -+ -+ dev_dbg(&tp->intf->dev, "successfully applied %s\n", mac->info); -+} -+ -+static void rtl8152_apply_firmware(struct r8152 *tp) -+{ -+ struct rtl_fw *rtl_fw = &tp->rtl_fw; -+ const struct firmware *fw; -+ struct fw_header *fw_hdr; -+ struct fw_phy_patch_key *key; -+ u16 key_addr = 0; -+ int i; -+ -+ if (IS_ERR_OR_NULL(rtl_fw->fw)) -+ return; -+ -+ fw = rtl_fw->fw; -+ fw_hdr = (struct fw_header *)fw->data; -+ -+ if (rtl_fw->pre_fw) -+ rtl_fw->pre_fw(tp); -+ -+ for (i = offsetof(struct fw_header, blocks); i < fw->size;) { -+ struct fw_block *block = (struct fw_block *)&fw->data[i]; -+ -+ switch (__le32_to_cpu(block->type)) { -+ case RTL_FW_END: -+ goto post_fw; -+ case RTL_FW_PLA: -+ case RTL_FW_USB: -+ rtl8152_fw_mac_apply(tp, (struct fw_mac *)block); -+ break; -+ case RTL_FW_PHY_START: -+ key = (struct fw_phy_patch_key *)block; -+ key_addr = __le16_to_cpu(key->key_reg); -+ r8153_pre_ram_code(tp, key_addr, -+ __le16_to_cpu(key->key_data)); -+ break; -+ case RTL_FW_PHY_STOP: -+ WARN_ON(!key_addr); -+ r8153_post_ram_code(tp, key_addr); -+ break; -+ case RTL_FW_PHY_NC: -+ rtl8152_fw_phy_nc_apply(tp, (struct fw_phy_nc *)block); -+ break; -+ default: -+ break; -+ } -+ -+ i += ALIGN(__le32_to_cpu(block->length), 8); -+ } -+ -+post_fw: -+ if (rtl_fw->post_fw) -+ rtl_fw->post_fw(tp); -+ -+ strscpy(rtl_fw->version, fw_hdr->version, RTL_VER_SIZE); -+ dev_info(&tp->intf->dev, "load %s successfully\n", rtl_fw->version); -+} -+ -+static void rtl8152_release_firmware(struct r8152 *tp) -+{ -+ struct rtl_fw *rtl_fw = &tp->rtl_fw; -+ -+ if (!IS_ERR_OR_NULL(rtl_fw->fw)) { -+ release_firmware(rtl_fw->fw); -+ rtl_fw->fw = NULL; -+ } -+} -+ -+static int rtl8152_request_firmware(struct r8152 *tp) -+{ -+ struct rtl_fw *rtl_fw = &tp->rtl_fw; -+ long rc; -+ -+ if (rtl_fw->fw || !rtl_fw->fw_name) { -+ dev_info(&tp->intf->dev, "skip request firmware\n"); -+ rc = 0; -+ goto result; -+ } -+ -+ rc = request_firmware(&rtl_fw->fw, rtl_fw->fw_name, &tp->intf->dev); -+ if (rc < 0) -+ goto result; -+ -+ rc = rtl8152_check_firmware(tp, rtl_fw); -+ if (rc < 0) -+ release_firmware(rtl_fw->fw); -+ -+result: -+ if (rc) { -+ rtl_fw->fw = ERR_PTR(rc); -+ -+ dev_warn(&tp->intf->dev, -+ "unable to load firmware patch %s (%ld)\n", -+ rtl_fw->fw_name, rc); -+ } -+ -+ return rc; -+} -+ - static void r8152_aldps_en(struct r8152 *tp, bool enable) - { - if (enable) { -@@ -3360,6 +4278,7 @@ - - static void r8152b_hw_phy_cfg(struct r8152 *tp) - { -+ rtl8152_apply_firmware(tp); - rtl_eee_enable(tp, tp->eee_en); - r8152_aldps_en(tp, true); - r8152b_enable_fc(tp); -@@ -3367,11 +4286,23 @@ - set_bit(PHY_RESET, &tp->flags); - } - --static void r8152b_exit_oob(struct r8152 *tp) -+static void wait_oob_link_list_ready(struct r8152 *tp) - { - u32 ocp_data; - int i; - -+ for (i = 0; i < 1000; i++) { -+ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); -+ if (ocp_data & LINK_LIST_READY) -+ break; -+ usleep_range(1000, 2000); -+ } -+} -+ -+static void r8152b_exit_oob(struct r8152 *tp) -+{ -+ u32 ocp_data; -+ - ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR); - ocp_data &= ~RCR_ACPT_ALL; - ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); -@@ -3389,23 +4320,13 @@ - ocp_data &= ~MCU_BORW_EN; - ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data); - -- for (i = 0; i < 1000; i++) { -- ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); -- if (ocp_data & LINK_LIST_READY) -- break; -- usleep_range(1000, 2000); -- } -+ wait_oob_link_list_ready(tp); - - ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7); - ocp_data |= RE_INIT_LL; - ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data); - -- for (i = 0; i < 1000; i++) { -- ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); -- if (ocp_data & LINK_LIST_READY) -- break; -- usleep_range(1000, 2000); -- } -+ wait_oob_link_list_ready(tp); - - rtl8152_nic_reset(tp); - -@@ -3447,7 +4368,6 @@ - static void r8152b_enter_oob(struct r8152 *tp) - { - u32 ocp_data; -- int i; - - ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); - ocp_data &= ~NOW_IS_OOB; -@@ -3459,23 +4379,13 @@ - - rtl_disable(tp); - -- for (i = 0; i < 1000; i++) { -- ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); -- if (ocp_data & LINK_LIST_READY) -- break; -- usleep_range(1000, 2000); -- } -+ wait_oob_link_list_ready(tp); - - ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7); - ocp_data |= RE_INIT_LL; - ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data); - -- for (i = 0; i < 1000; i++) { -- ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); -- if (ocp_data & LINK_LIST_READY) -- break; -- usleep_range(1000, 2000); -- } -+ wait_oob_link_list_ready(tp); - - ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8152_RMS); - -@@ -3496,31 +4406,124 @@ - ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); - } - --static int r8153_patch_request(struct r8152 *tp, bool request) -+static int r8153_pre_firmware_1(struct r8152 *tp) - { -- u16 data; - int i; - -- data = ocp_reg_read(tp, OCP_PHY_PATCH_CMD); -- if (request) -- data |= PATCH_REQUEST; -- else -- data &= ~PATCH_REQUEST; -- ocp_reg_write(tp, OCP_PHY_PATCH_CMD, data); -+ /* Wait till the WTD timer is ready. It would take at most 104 ms. */ -+ for (i = 0; i < 104; i++) { -+ u32 ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_WDT1_CTRL); - -- for (i = 0; request && i < 5000; i++) { -- usleep_range(1000, 2000); -- if (ocp_reg_read(tp, OCP_PHY_PATCH_STAT) & PATCH_READY) -+ if (!(ocp_data & WTD1_EN)) - break; -+ usleep_range(1000, 2000); - } - -- if (request && !(ocp_reg_read(tp, OCP_PHY_PATCH_STAT) & PATCH_READY)) { -- netif_err(tp, drv, tp->netdev, "patch request fail\n"); -- r8153_patch_request(tp, false); -- return -ETIME; -- } else { -- return 0; -+ return 0; -+} -+ -+static int r8153_post_firmware_1(struct r8152 *tp) -+{ -+ /* set USB_BP_4 to support USB_SPEED_SUPER only */ -+ if (ocp_read_byte(tp, MCU_TYPE_USB, USB_CSTMR) & FORCE_SUPER) -+ ocp_write_word(tp, MCU_TYPE_USB, USB_BP_4, BP4_SUPER_ONLY); -+ -+ /* reset UPHY timer to 36 ms */ -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_UPHY_TIMER, 36000 / 16); -+ -+ return 0; -+} -+ -+static int r8153_pre_firmware_2(struct r8152 *tp) -+{ -+ u32 ocp_data; -+ -+ r8153_pre_firmware_1(tp); -+ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_FW_FIX_EN0); -+ ocp_data &= ~FW_FIX_SUSPEND; -+ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_FIX_EN0, ocp_data); -+ -+ return 0; -+} -+ -+static int r8153_post_firmware_2(struct r8152 *tp) -+{ -+ u32 ocp_data; -+ -+ /* enable bp0 if support USB_SPEED_SUPER only */ -+ if (ocp_read_byte(tp, MCU_TYPE_USB, USB_CSTMR) & FORCE_SUPER) { -+ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_BP_EN); -+ ocp_data |= BIT(0); -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_EN, ocp_data); -+ } -+ -+ /* reset UPHY timer to 36 ms */ -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_UPHY_TIMER, 36000 / 16); -+ -+ /* enable U3P3 check, set the counter to 4 */ -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, U3P3_CHECK_EN | 4); -+ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_FW_FIX_EN0); -+ ocp_data |= FW_FIX_SUSPEND; -+ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_FIX_EN0, ocp_data); -+ -+ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_USB2PHY); -+ ocp_data |= USB2PHY_L1 | USB2PHY_SUSPEND; -+ ocp_write_byte(tp, MCU_TYPE_USB, USB_USB2PHY, ocp_data); -+ -+ return 0; -+} -+ -+static int r8153_post_firmware_3(struct r8152 *tp) -+{ -+ u32 ocp_data; -+ -+ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_USB2PHY); -+ ocp_data |= USB2PHY_L1 | USB2PHY_SUSPEND; -+ ocp_write_byte(tp, MCU_TYPE_USB, USB_USB2PHY, ocp_data); -+ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_FW_FIX_EN1); -+ ocp_data |= FW_IP_RESET_EN; -+ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_FIX_EN1, ocp_data); -+ -+ return 0; -+} -+ -+static int r8153b_pre_firmware_1(struct r8152 *tp) -+{ -+ /* enable fc timer and set timer to 1 second. */ -+ ocp_write_word(tp, MCU_TYPE_USB, USB_FC_TIMER, -+ CTRL_TIMER_EN | (1000 / 8)); -+ -+ return 0; -+} -+ -+static int r8153b_post_firmware_1(struct r8152 *tp) -+{ -+ u32 ocp_data; -+ -+ /* enable bp0 for RTL8153-BND */ -+ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1); -+ if (ocp_data & BND_MASK) { -+ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_BP_EN); -+ ocp_data |= BIT(0); -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_EN, ocp_data); - } -+ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_FW_CTRL); -+ ocp_data |= FLOW_CTRL_PATCH_OPT; -+ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_CTRL, ocp_data); -+ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_FW_TASK); -+ ocp_data |= FC_PATCH_TASK; -+ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_TASK, ocp_data); -+ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_FW_FIX_EN1); -+ ocp_data |= FW_IP_RESET_EN; -+ ocp_write_word(tp, MCU_TYPE_USB, USB_FW_FIX_EN1, ocp_data); -+ -+ return 0; - } - - static void r8153_aldps_en(struct r8152 *tp, bool enable) -@@ -3557,6 +4560,8 @@ - /* disable EEE before updating the PHY parameters */ - rtl_eee_enable(tp, false); - -+ rtl8152_apply_firmware(tp); -+ - if (tp->version == RTL_VER_03) { - data = ocp_reg_read(tp, OCP_EEE_CFG); - data &= ~CTAP_SHORT_EN; -@@ -3629,6 +4634,8 @@ - /* disable EEE before updating the PHY parameters */ - rtl_eee_enable(tp, false); - -+ rtl8152_apply_firmware(tp); -+ - r8153b_green_en(tp, test_bit(GREEN_ETHERNET, &tp->flags)); - - data = sram_read(tp, SRAM_GREEN_CFG); -@@ -3700,8 +4707,8 @@ - static void r8153_first_init(struct r8152 *tp) - { - u32 ocp_data; -- int i; - -+ r8153_mac_clk_spd(tp, false); - rxdy_gated_en(tp, true); - r8153_teredo_off(tp); - -@@ -3720,23 +4727,13 @@ - ocp_data &= ~MCU_BORW_EN; - ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data); - -- for (i = 0; i < 1000; i++) { -- ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); -- if (ocp_data & LINK_LIST_READY) -- break; -- usleep_range(1000, 2000); -- } -+ wait_oob_link_list_ready(tp); - - ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7); - ocp_data |= RE_INIT_LL; - ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data); - -- for (i = 0; i < 1000; i++) { -- ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); -- if (ocp_data & LINK_LIST_READY) -- break; -- usleep_range(1000, 2000); -- } -+ wait_oob_link_list_ready(tp); - - rtl_rx_vlan_en(tp, tp->netdev->features & NETIF_F_HW_VLAN_CTAG_RX); - -@@ -3761,7 +4758,8 @@ - static void r8153_enter_oob(struct r8152 *tp) - { - u32 ocp_data; -- int i; -+ -+ r8153_mac_clk_spd(tp, true); - - ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); - ocp_data &= ~NOW_IS_OOB; -@@ -3770,23 +4768,13 @@ - rtl_disable(tp); - rtl_reset_bmu(tp); - -- for (i = 0; i < 1000; i++) { -- ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); -- if (ocp_data & LINK_LIST_READY) -- break; -- usleep_range(1000, 2000); -- } -+ wait_oob_link_list_ready(tp); - - ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7); - ocp_data |= RE_INIT_LL; - ocp_write_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, ocp_data); - -- for (i = 0; i < 1000; i++) { -- ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); -- if (ocp_data & LINK_LIST_READY) -- break; -- usleep_range(1000, 2000); -- } -+ wait_oob_link_list_ready(tp); - - ocp_data = tp->netdev->mtu + VLAN_ETH_HLEN + ETH_FCS_LEN; - ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, ocp_data); -@@ -4068,7 +5056,9 @@ - ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, ocp_data); - - r8153_aldps_en(tp, true); -- r8153b_u1u2en(tp, true); -+ -+ if (tp->udev->speed != USB_SPEED_HIGH) -+ r8153b_u1u2en(tp, true); - } - - static void rtl8153b_down(struct r8152 *tp) -@@ -4205,11 +5195,22 @@ - - mutex_lock(&tp->control); - -+ if (rtl8152_request_firmware(tp) == -ENODEV && tp->rtl_fw.retry) { -+ tp->rtl_fw.retry = false; -+ tp->rtl_fw.fw = NULL; -+ -+ /* Delay execution in case request_firmware() is not ready yet. -+ */ -+ queue_delayed_work(system_long_wq, &tp->hw_phy_work, HZ * 10); -+ goto ignore_once; -+ } -+ - tp->rtl_ops.hw_phy_cfg(tp); - - rtl8152_set_speed(tp, tp->autoneg, tp->speed, tp->duplex, - tp->advertising); - -+ignore_once: - mutex_unlock(&tp->control); - - usb_autopm_put_interface(tp->intf); -@@ -4247,6 +5248,11 @@ - struct r8152 *tp = netdev_priv(netdev); - int res = 0; - -+ if (work_busy(&tp->hw_phy_work.work) & WORK_BUSY_PENDING) { -+ cancel_delayed_work_sync(&tp->hw_phy_work); -+ rtl_hw_phy_work_func_t(&tp->hw_phy_work.work); -+ } -+ - res = alloc_all_mem(tp); - if (res) - goto out; -@@ -4393,10 +5399,7 @@ - if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & - AUTOLOAD_DONE) - break; -- - msleep(20); -- if (test_bit(RTL8152_UNPLUG, &tp->flags)) -- break; - } - - data = r8153_phy_status(tp, 0); -@@ -4442,6 +5445,16 @@ - else - ocp_data |= DYNAMIC_BURST; - ocp_write_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY1, ocp_data); -+ -+ r8153_queue_wake(tp, false); -+ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS); -+ if (rtl8152_get_speed(tp) & LINK_STATUS) -+ ocp_data |= CUR_LINK_OK; -+ else -+ ocp_data &= ~CUR_LINK_OK; -+ ocp_data |= POLL_LINK_CHG; -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, ocp_data); - } - - ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY2); -@@ -4470,14 +5483,10 @@ - - ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001); - -- /* MAC clock speed down */ -- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0); -- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0); -- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0); -- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0); -- - r8153_power_cut_en(tp, false); -+ rtl_runtime_suspend_enable(tp, false); - r8153_u1u2en(tp, true); -+ r8153_mac_clk_spd(tp, false); - usb_enable_lpm(tp->udev); - - ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CONFIG6); -@@ -4527,10 +5536,7 @@ - if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & - AUTOLOAD_DONE) - break; -- - msleep(20); -- if (test_bit(RTL8152_UNPLUG, &tp->flags)) -- break; - } - - data = r8153_phy_status(tp, 0); -@@ -4555,7 +5561,17 @@ - r8153b_ups_en(tp, false); - r8153_queue_wake(tp, false); - rtl_runtime_suspend_enable(tp, false); -- r8153b_u1u2en(tp, true); -+ -+ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS); -+ if (rtl8152_get_speed(tp) & LINK_STATUS) -+ ocp_data |= CUR_LINK_OK; -+ else -+ ocp_data &= ~CUR_LINK_OK; -+ ocp_data |= POLL_LINK_CHG; -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, ocp_data); -+ -+ if (tp->udev->speed != USB_SPEED_HIGH) -+ r8153b_u1u2en(tp, true); - usb_enable_lpm(tp->udev); - - /* MAC clock speed down */ -@@ -4925,6 +5941,9 @@ - strlcpy(info->driver, MODULENAME, sizeof(info->driver)); - strlcpy(info->version, DRIVER_VERSION, sizeof(info->version)); - usb_make_path(tp->udev, info->bus_info, sizeof(info->bus_info)); -+ if (!IS_ERR_OR_NULL(tp->rtl_fw.fw)) -+ strlcpy(info->fw_version, tp->rtl_fw.version, -+ sizeof(info->fw_version)); - } - - static -@@ -5529,10 +6548,7 @@ - ops->in_nway = rtl8153_in_nway; - ops->hw_phy_cfg = r8153_hw_phy_cfg; - ops->autosuspend_en = rtl8153_runtime_enable; -- if (tp->udev->speed < USB_SPEED_SUPER) -- tp->rx_buf_sz = 16 * 1024; -- else -- tp->rx_buf_sz = 32 * 1024; -+ tp->rx_buf_sz = 32 * 1024; - tp->eee_en = true; - tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; - break; -@@ -5564,6 +6580,47 @@ - return ret; - } - -+#define FIRMWARE_8153A_2 "rtl_nic/rtl8153a-2.fw" -+#define FIRMWARE_8153A_3 "rtl_nic/rtl8153a-3.fw" -+#define FIRMWARE_8153A_4 "rtl_nic/rtl8153a-4.fw" -+#define FIRMWARE_8153B_2 "rtl_nic/rtl8153b-2.fw" -+ -+MODULE_FIRMWARE(FIRMWARE_8153A_2); -+MODULE_FIRMWARE(FIRMWARE_8153A_3); -+MODULE_FIRMWARE(FIRMWARE_8153A_4); -+MODULE_FIRMWARE(FIRMWARE_8153B_2); -+ -+static int rtl_fw_init(struct r8152 *tp) -+{ -+ struct rtl_fw *rtl_fw = &tp->rtl_fw; -+ -+ switch (tp->version) { -+ case RTL_VER_04: -+ rtl_fw->fw_name = FIRMWARE_8153A_2; -+ rtl_fw->pre_fw = r8153_pre_firmware_1; -+ rtl_fw->post_fw = r8153_post_firmware_1; -+ break; -+ case RTL_VER_05: -+ rtl_fw->fw_name = FIRMWARE_8153A_3; -+ rtl_fw->pre_fw = r8153_pre_firmware_2; -+ rtl_fw->post_fw = r8153_post_firmware_2; -+ break; -+ case RTL_VER_06: -+ rtl_fw->fw_name = FIRMWARE_8153A_4; -+ rtl_fw->post_fw = r8153_post_firmware_3; -+ break; -+ case RTL_VER_09: -+ rtl_fw->fw_name = FIRMWARE_8153B_2; -+ rtl_fw->pre_fw = r8153b_pre_firmware_1; -+ rtl_fw->post_fw = r8153b_post_firmware_1; -+ break; -+ default: -+ break; -+ } -+ -+ return 0; -+} -+ - static u8 rtl_get_version(struct usb_interface *intf) - { - struct usb_device *udev = interface_to_usbdev(intf); -@@ -5674,6 +6731,8 @@ - if (ret) - goto out; - -+ rtl_fw_init(tp); -+ - mutex_init(&tp->control); - INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t); - INIT_DELAYED_WORK(&tp->hw_phy_work, rtl_hw_phy_work_func_t); -@@ -5700,8 +6759,13 @@ - netdev->hw_features &= ~NETIF_F_RXCSUM; - } - -+ if (le16_to_cpu(udev->descriptor.idVendor) == VENDOR_ID_LENOVO && -+ le16_to_cpu(udev->descriptor.idProduct) == 0x3082) -+ set_bit(LENOVO_MACPASSTHRU, &tp->flags); -+ - if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x3011 && udev->serial && -- (!strcmp(udev->serial, "000001000000") || !strcmp(udev->serial, "000002000000"))) { -+ (!strcmp(udev->serial, "000001000000") || -+ !strcmp(udev->serial, "000002000000"))) { - dev_info(&udev->dev, "Dell TB16 Dock, disable RX aggregation"); - set_bit(DELL_TB_RX_AGG_BUG, &tp->flags); - } -@@ -5749,6 +6813,10 @@ - tp->saved_wolopts = __rtl_get_wol(tp); - - tp->rtl_ops.init(tp); -+#if IS_BUILTIN(CONFIG_USB_RTL8152) -+ /* Retry in case request_firmware() is not ready yet. */ -+ tp->rtl_fw.retry = true; -+#endif - queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0); - set_ethernet_addr(tp); - -@@ -5790,6 +6858,7 @@ - tasklet_kill(&tp->tx_tl); - cancel_delayed_work_sync(&tp->hw_phy_work); - tp->rtl_ops.unload(tp); -+ rtl8152_release_firmware(tp); - free_netdev(tp->netdev); - } - } -@@ -5817,15 +6886,14 @@ - {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)}, - {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)}, - {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)}, -- {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927)}, - {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069)}, -+ {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214)}, -- {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041)}, - {REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff)}, diff --git a/openwrt-21.02/patches/kernel-5.4/995-watchdog-rk3328.patch b/openwrt-21.02/patches/kernel-5.4/995-watchdog-rk3328.patch deleted file mode 100644 index c964275..0000000 --- a/openwrt-21.02/patches/kernel-5.4/995-watchdog-rk3328.patch +++ /dev/null @@ -1,47 +0,0 @@ -The watchdog compatible strings are suppose to be SoC orientated. -In the more recently added Rockchip rk3328.dtsi file only -the fallback string "snps,dw-wdt" is used, so add the new -compatible string: - -"rockchip,rk3328-wdt", "snps,dw-wdt" - -make ARCH=arm64 dtbs_check -DT_SCHEMA_FILES=Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml - -Signed-off-by: Johan Jonker ---- - arch/arm64/boot/dts/rockchip/rk3328.dtsi | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -index bbdb19a3e..1e3e1086e 100644 ---- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -453,7 +453,7 @@ - }; - - wdt: watchdog@ff1a0000 { -- compatible = "snps,dw-wdt"; -+ compatible = "rockchip,rk3328-wdt", "snps,dw-wdt"; - reg = <0x0 0xff1a0000 0x0 0x100>; - interrupts = ; - clocks = <&cru PCLK_WDT>; -+ status = "disabled"; - }; --- -2.11.0 - ---- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -416,6 +416,10 @@ - status = "okay"; - }; - -+&wdt { -+ status = "okay"; -+}; -+ - &usbdrd3 { - status = "okay"; - }; --- \ No newline at end of file diff --git a/openwrt-21.02/patches/kernel-5.4/996-watchdog-rk3399.patch b/openwrt-21.02/patches/kernel-5.4/996-watchdog-rk3399.patch deleted file mode 100644 index c5bc438..0000000 --- a/openwrt-21.02/patches/kernel-5.4/996-watchdog-rk3399.patch +++ /dev/null @@ -1,30 +0,0 @@ -The watchdog compatible strings are suppose to be SoC orientated. -In the more recently added Rockchip rk3399.dtsi file only -the fallback string "snps,dw-wdt" is used, so add the new -compatible string: - -"rockchip,rk3399-wdt", "snps,dw-wdt" - -make ARCH=arm64 dtbs_check -DT_SCHEMA_FILES=Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml - -Signed-off-by: Johan Jonker ---- - arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -index 2b99480ea..825eb254b 100644 ---- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -1536,7 +1536,7 @@ - }; - - watchdog@ff848000 { -- compatible = "snps,dw-wdt"; -+ compatible = "rockchip,rk3399-wdt", "snps,dw-wdt"; - reg = <0x0 0xff848000 0x0 0x100>; - clocks = <&cru PCLK_WDT>; - interrupts = ; --- -2.11.0 \ No newline at end of file diff --git a/openwrt-21.02/patches/kernel-5.4/add-rk3328-usb3-phy-driver-full.patch b/openwrt-21.02/patches/kernel-5.4/add-rk3328-usb3-phy-driver-full.patch deleted file mode 100644 index efc0e86..0000000 --- a/openwrt-21.02/patches/kernel-5.4/add-rk3328-usb3-phy-driver-full.patch +++ /dev/null @@ -1,1205 +0,0 @@ ---- a/drivers/phy/rockchip/Kconfig -+++ b/drivers/phy/rockchip/Kconfig -@@ -35,6 +35,15 @@ config PHY_ROCKCHIP_INNO_USB2 - help - Support for Rockchip USB2.0 PHY with Innosilicon IP block. - -+config PHY_ROCKCHIP_INNO_USB3 -+ tristate "Rockchip INNO USB 3.0 PHY Driver" -+ depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF -+ depends on USB_SUPPORT -+ select GENERIC_PHY -+ select USB_PHY -+ help -+ Support for Rockchip USB 3.0 PHY with Innosilicon IP block. -+ - config PHY_ROCKCHIP_PCIE - tristate "Rockchip PCIe PHY Driver" - depends on (ARCH_ROCKCHIP && OF) || COMPILE_TEST - ---- a/drivers/phy/rockchip/Makefile -+++ b/drivers/phy/rockchip/Makefile -@@ -5,6 +5,7 @@ - obj-$(CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY) += phy-rockchip-inno-dsidphy.o - obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o - obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o -+obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB3) += phy-rockchip-inno-usb3.o - obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o - obj-$(CONFIG_PHY_ROCKCHIP_TYPEC) += phy-rockchip-typec.o - obj-$(CONFIG_PHY_ROCKCHIP_USB) += phy-rockchip-usb.o - -new file mode 100644 ---- /dev/null -+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb3.c -@@ -0,0 +1,1107 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later -+/* -+ * Rockchip USB 3.0 PHY with Innosilicon IP block driver -+ * -+ * Copyright (C) 2016 Fuzhou Rockchip Electronics Co., Ltd -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define U3PHY_PORT_NUM 2 -+#define BIT_WRITEABLE_SHIFT 16 -+#define SCHEDULE_DELAY (60 * HZ) -+ -+#define U3PHY_APB_RST BIT(0) -+#define U3PHY_POR_RST BIT(1) -+#define U3PHY_MAC_RST BIT(2) -+ -+struct rockchip_u3phy; -+struct rockchip_u3phy_port; -+ -+enum rockchip_u3phy_type { -+ U3PHY_TYPE_PIPE, -+ U3PHY_TYPE_UTMI, -+}; -+ -+enum rockchip_u3phy_pipe_pwr { -+ PIPE_PWR_P0 = 0, -+ PIPE_PWR_P1 = 1, -+ PIPE_PWR_P2 = 2, -+ PIPE_PWR_P3 = 3, -+ PIPE_PWR_MAX = 4, -+}; -+ -+enum rockchip_u3phy_rest_req { -+ U3_POR_RSTN = 0, -+ U2_POR_RSTN = 1, -+ PIPE_MAC_RSTN = 2, -+ UTMI_MAC_RSTN = 3, -+ PIPE_APB_RSTN = 4, -+ UTMI_APB_RSTN = 5, -+ U3PHY_RESET_MAX = 6, -+}; -+ -+enum rockchip_u3phy_utmi_state { -+ PHY_UTMI_HS_ONLINE = 0, -+ PHY_UTMI_DISCONNECT = 1, -+ PHY_UTMI_CONNECT = 2, -+ PHY_UTMI_FS_LS_ONLINE = 4, -+}; -+ -+/* -+ * @rvalue: reset value -+ * @dvalue: desired value -+ */ -+struct u3phy_reg { -+ unsigned int offset; -+ unsigned int bitend; -+ unsigned int bitstart; -+ unsigned int rvalue; -+ unsigned int dvalue; -+}; -+ -+struct rockchip_u3phy_grfcfg { -+ struct u3phy_reg um_suspend; -+ struct u3phy_reg ls_det_en; -+ struct u3phy_reg ls_det_st; -+ struct u3phy_reg um_ls; -+ struct u3phy_reg um_hstdct; -+ struct u3phy_reg u2_only_ctrl; -+ struct u3phy_reg u3_disable; -+ struct u3phy_reg pp_pwr_st; -+ struct u3phy_reg pp_pwr_en[PIPE_PWR_MAX]; -+}; -+ -+/** -+ * struct rockchip_u3phy_apbcfg: usb3-phy apb configuration. -+ * @u2_pre_emp: usb2-phy pre-emphasis tuning. -+ * @u2_pre_emp_sth: usb2-phy pre-emphasis strength tuning. -+ * @u2_odt_tuning: usb2-phy odt 45ohm tuning. -+ */ -+struct rockchip_u3phy_apbcfg { -+ unsigned int u2_pre_emp; -+ unsigned int u2_pre_emp_sth; -+ unsigned int u2_odt_tuning; -+}; -+ -+struct rockchip_u3phy_cfg { -+ unsigned int reg; -+ const struct rockchip_u3phy_grfcfg grfcfg; -+ -+ int (*phy_pipe_power)(struct rockchip_u3phy *u3phy, -+ struct rockchip_u3phy_port *u3phy_port, -+ bool on); -+ int (*phy_tuning)(struct rockchip_u3phy *u3phy, -+ struct rockchip_u3phy_port *u3phy_port, -+ struct device_node *child_np); -+}; -+ -+struct rockchip_u3phy_port { -+ struct phy *phy; -+ void __iomem *base; -+ unsigned int index; -+ unsigned char type; -+ bool suspended; -+ bool refclk_25m_quirk; -+ struct mutex mutex; /* mutex for updating register */ -+ struct delayed_work um_sm_work; -+}; -+ -+struct rockchip_u3phy { -+ struct device *dev; -+ struct regmap *u3phy_grf; -+ struct regmap *grf; -+ int um_ls_irq; -+ struct clk **clks; -+ int num_clocks; -+ struct dentry *root; -+ struct gpio_desc *vbus_drv_gpio; -+ struct reset_control *rsts[U3PHY_RESET_MAX]; -+ struct rockchip_u3phy_apbcfg apbcfg; -+ const struct rockchip_u3phy_cfg *cfgs; -+ struct rockchip_u3phy_port ports[U3PHY_PORT_NUM]; -+ struct usb_phy usb_phy; -+}; -+ -+static inline int param_write(void __iomem *base, -+ const struct u3phy_reg *reg, bool desired) -+{ -+ unsigned int val, mask; -+ unsigned int tmp = desired ? reg->dvalue : reg->rvalue; -+ int ret = 0; -+ -+ mask = GENMASK(reg->bitend, reg->bitstart); -+ val = (tmp << reg->bitstart) | (mask << BIT_WRITEABLE_SHIFT); -+ ret = regmap_write(base, reg->offset, val); -+ -+ return ret; -+} -+ -+static inline bool param_exped(void __iomem *base, -+ const struct u3phy_reg *reg, -+ unsigned int value) -+{ -+ int ret; -+ unsigned int tmp, orig; -+ unsigned int mask = GENMASK(reg->bitend, reg->bitstart); -+ -+ ret = regmap_read(base, reg->offset, &orig); -+ if (ret) -+ return false; -+ -+ tmp = (orig & mask) >> reg->bitstart; -+ return tmp == value; -+} -+ -+static int rockchip_u3phy_usb2_only_show(struct seq_file *s, void *unused) -+{ -+ struct rockchip_u3phy *u3phy = s->private; -+ -+ if (param_exped(u3phy->u3phy_grf, &u3phy->cfgs->grfcfg.u2_only_ctrl, 1)) -+ dev_info(u3phy->dev, "u2\n"); -+ else -+ dev_info(u3phy->dev, "u3\n"); -+ -+ return 0; -+} -+ -+static int rockchip_u3phy_usb2_only_open(struct inode *inode, -+ struct file *file) -+{ -+ return single_open(file, rockchip_u3phy_usb2_only_show, -+ inode->i_private); -+} -+ -+static ssize_t rockchip_u3phy_usb2_only_write(struct file *file, -+ const char __user *ubuf, -+ size_t count, loff_t *ppos) -+{ -+ struct seq_file *s = file->private_data; -+ struct rockchip_u3phy *u3phy = s->private; -+ struct rockchip_u3phy_port *u3phy_port; -+ char buf[32]; -+ u8 index; -+ -+ if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) -+ return -EFAULT; -+ -+ if (!strncmp(buf, "u3", 2) && -+ param_exped(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.u2_only_ctrl, 1)) { -+ dev_info(u3phy->dev, "Set usb3.0 and usb2.0 mode successfully\n"); -+ -+ gpiod_set_value_cansleep(u3phy->vbus_drv_gpio, 0); -+ -+ param_write(u3phy->grf, -+ &u3phy->cfgs->grfcfg.u3_disable, false); -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.u2_only_ctrl, false); -+ -+ for (index = 0; index < U3PHY_PORT_NUM; index++) { -+ u3phy_port = &u3phy->ports[index]; -+ /* enable u3 rx termimation */ -+ if (u3phy_port->type == U3PHY_TYPE_PIPE) -+ writel(0x30, u3phy_port->base + 0xd8); -+ } -+ -+ atomic_notifier_call_chain(&u3phy->usb_phy.notifier, 0, NULL); -+ -+ gpiod_set_value_cansleep(u3phy->vbus_drv_gpio, 1); -+ } else if (!strncmp(buf, "u2", 2) && -+ param_exped(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.u2_only_ctrl, 0)) { -+ dev_info(u3phy->dev, "Set usb2.0 only mode successfully\n"); -+ -+ gpiod_set_value_cansleep(u3phy->vbus_drv_gpio, 0); -+ -+ param_write(u3phy->grf, -+ &u3phy->cfgs->grfcfg.u3_disable, true); -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.u2_only_ctrl, true); -+ -+ for (index = 0; index < U3PHY_PORT_NUM; index++) { -+ u3phy_port = &u3phy->ports[index]; -+ /* disable u3 rx termimation */ -+ if (u3phy_port->type == U3PHY_TYPE_PIPE) -+ writel(0x20, u3phy_port->base + 0xd8); -+ } -+ -+ atomic_notifier_call_chain(&u3phy->usb_phy.notifier, 0, NULL); -+ -+ gpiod_set_value_cansleep(u3phy->vbus_drv_gpio, 1); -+ } else { -+ dev_info(u3phy->dev, "Same or illegal mode\n"); -+ } -+ -+ return count; -+} -+ -+static const struct file_operations rockchip_u3phy_usb2_only_fops = { -+ .open = rockchip_u3phy_usb2_only_open, -+ .write = rockchip_u3phy_usb2_only_write, -+ .read = seq_read, -+ .llseek = seq_lseek, -+ .release = single_release, -+}; -+ -+int rockchip_u3phy_debugfs_init(struct rockchip_u3phy *u3phy) -+{ -+ struct dentry *root; -+ struct dentry *file; -+ int ret; -+ -+ root = debugfs_create_dir(dev_name(u3phy->dev), NULL); -+ if (!root) { -+ ret = -ENOMEM; -+ goto err0; -+ } -+ -+ u3phy->root = root; -+ -+ file = debugfs_create_file("u3phy_mode", 0644, root, -+ u3phy, &rockchip_u3phy_usb2_only_fops); -+ if (!file) { -+ ret = -ENOMEM; -+ goto err1; -+ } -+ return 0; -+ -+err1: -+ debugfs_remove_recursive(root); -+err0: -+ return ret; -+} -+ -+static const char *get_rest_name(enum rockchip_u3phy_rest_req rst) -+{ -+ switch (rst) { -+ case U2_POR_RSTN: -+ return "u3phy-u2-por"; -+ case U3_POR_RSTN: -+ return "u3phy-u3-por"; -+ case PIPE_MAC_RSTN: -+ return "u3phy-pipe-mac"; -+ case UTMI_MAC_RSTN: -+ return "u3phy-utmi-mac"; -+ case UTMI_APB_RSTN: -+ return "u3phy-utmi-apb"; -+ case PIPE_APB_RSTN: -+ return "u3phy-pipe-apb"; -+ default: -+ return "invalid"; -+ } -+} -+ -+static void rockchip_u3phy_rest_deassert(struct rockchip_u3phy *u3phy, -+ unsigned int flag) -+{ -+ int rst; -+ -+ if (flag & U3PHY_APB_RST) { -+ dev_dbg(u3phy->dev, "deassert APB bus interface reset\n"); -+ for (rst = PIPE_APB_RSTN; rst <= UTMI_APB_RSTN; rst++) { -+ if (u3phy->rsts[rst]) -+ reset_control_deassert(u3phy->rsts[rst]); -+ } -+ } -+ -+ if (flag & U3PHY_POR_RST) { -+ usleep_range(12, 15); -+ dev_dbg(u3phy->dev, "deassert u2 and u3 phy power on reset\n"); -+ for (rst = U3_POR_RSTN; rst <= U2_POR_RSTN; rst++) { -+ if (u3phy->rsts[rst]) -+ reset_control_deassert(u3phy->rsts[rst]); -+ } -+ } -+ -+ if (flag & U3PHY_MAC_RST) { -+ usleep_range(1200, 1500); -+ dev_dbg(u3phy->dev, "deassert pipe and utmi MAC reset\n"); -+ for (rst = PIPE_MAC_RSTN; rst <= UTMI_MAC_RSTN; rst++) -+ if (u3phy->rsts[rst]) -+ reset_control_deassert(u3phy->rsts[rst]); -+ } -+} -+ -+static void rockchip_u3phy_rest_assert(struct rockchip_u3phy *u3phy) -+{ -+ int rst; -+ -+ dev_dbg(u3phy->dev, "assert u3phy reset\n"); -+ for (rst = 0; rst < U3PHY_RESET_MAX; rst++) -+ if (u3phy->rsts[rst]) -+ reset_control_assert(u3phy->rsts[rst]); -+} -+ -+static int rockchip_u3phy_clk_enable(struct rockchip_u3phy *u3phy) -+{ -+ int ret, clk; -+ -+ for (clk = 0; clk < u3phy->num_clocks && u3phy->clks[clk]; clk++) { -+ ret = clk_prepare_enable(u3phy->clks[clk]); -+ if (ret) -+ goto err_disable_clks; -+ } -+ return 0; -+ -+err_disable_clks: -+ while (--clk >= 0) -+ clk_disable_unprepare(u3phy->clks[clk]); -+ return ret; -+} -+ -+static void rockchip_u3phy_clk_disable(struct rockchip_u3phy *u3phy) -+{ -+ int clk; -+ -+ for (clk = u3phy->num_clocks - 1; clk >= 0; clk--) -+ if (u3phy->clks[clk]) -+ clk_disable_unprepare(u3phy->clks[clk]); -+} -+ -+static int rockchip_u3phy_init(struct phy *phy) -+{ -+ return 0; -+} -+ -+static int rockchip_u3phy_exit(struct phy *phy) -+{ -+ return 0; -+} -+ -+static int rockchip_u3phy_power_on(struct phy *phy) -+{ -+ struct rockchip_u3phy_port *u3phy_port = phy_get_drvdata(phy); -+ struct rockchip_u3phy *u3phy = dev_get_drvdata(phy->dev.parent); -+ int ret; -+ -+ dev_info(&u3phy_port->phy->dev, "u3phy %s power on\n", -+ (u3phy_port->type == U3PHY_TYPE_UTMI) ? "u2" : "u3"); -+ -+ if (!u3phy_port->suspended) -+ return 0; -+ -+ ret = rockchip_u3phy_clk_enable(u3phy); -+ if (ret) -+ return ret; -+ -+ if (u3phy_port->type == U3PHY_TYPE_UTMI) { -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.um_suspend, false); -+ } else { -+ /* current in p2 ? */ -+ if (param_exped(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.pp_pwr_st, PIPE_PWR_P2)) -+ goto done; -+ -+ if (u3phy->cfgs->phy_pipe_power) { -+ dev_dbg(u3phy->dev, "do pipe power up\n"); -+ u3phy->cfgs->phy_pipe_power(u3phy, u3phy_port, true); -+ } -+ -+ /* exit to p0 */ -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.pp_pwr_en[PIPE_PWR_P0], true); -+ usleep_range(90, 100); -+ -+ /* enter to p2 from p0 */ -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.pp_pwr_en[PIPE_PWR_P2], -+ false); -+ udelay(3); -+ } -+ -+done: -+ u3phy_port->suspended = false; -+ return 0; -+} -+ -+static int rockchip_u3phy_power_off(struct phy *phy) -+{ -+ struct rockchip_u3phy_port *u3phy_port = phy_get_drvdata(phy); -+ struct rockchip_u3phy *u3phy = dev_get_drvdata(phy->dev.parent); -+ -+ dev_info(&u3phy_port->phy->dev, "u3phy %s power off\n", -+ (u3phy_port->type == U3PHY_TYPE_UTMI) ? "u2" : "u3"); -+ -+ if (u3phy_port->suspended) -+ return 0; -+ -+ if (u3phy_port->type == U3PHY_TYPE_UTMI) { -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.um_suspend, true); -+ } else { -+ /* current in p3 ? */ -+ if (param_exped(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.pp_pwr_st, PIPE_PWR_P3)) -+ goto done; -+ -+ /* exit to p0 */ -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.pp_pwr_en[PIPE_PWR_P0], true); -+ udelay(2); -+ -+ /* enter to p3 from p0 */ -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.pp_pwr_en[PIPE_PWR_P3], true); -+ udelay(6); -+ -+ if (u3phy->cfgs->phy_pipe_power) { -+ dev_dbg(u3phy->dev, "do pipe power down\n"); -+ u3phy->cfgs->phy_pipe_power(u3phy, u3phy_port, false); -+ } -+ } -+ -+done: -+ rockchip_u3phy_clk_disable(u3phy); -+ u3phy_port->suspended = true; -+ return 0; -+} -+ -+static __maybe_unused -+struct phy *rockchip_u3phy_xlate(struct device *dev, -+ struct of_phandle_args *args) -+{ -+ struct rockchip_u3phy *u3phy = dev_get_drvdata(dev); -+ struct rockchip_u3phy_port *u3phy_port = NULL; -+ struct device_node *phy_np = args->np; -+ int index; -+ -+ if (args->args_count != 1) { -+ dev_err(dev, "invalid number of cells in 'phy' property\n"); -+ return ERR_PTR(-EINVAL); -+ } -+ -+ for (index = 0; index < U3PHY_PORT_NUM; index++) { -+ if (phy_np == u3phy->ports[index].phy->dev.of_node) { -+ u3phy_port = &u3phy->ports[index]; -+ break; -+ } -+ } -+ -+ if (!u3phy_port) { -+ dev_err(dev, "failed to find appropriate phy\n"); -+ return ERR_PTR(-EINVAL); -+ } -+ -+ return u3phy_port->phy; -+} -+ -+static struct phy_ops rockchip_u3phy_ops = { -+ .init = rockchip_u3phy_init, -+ .exit = rockchip_u3phy_exit, -+ .power_on = rockchip_u3phy_power_on, -+ .power_off = rockchip_u3phy_power_off, -+ .owner = THIS_MODULE, -+}; -+ -+/* -+ * The function manage host-phy port state and suspend/resume phy port -+ * to save power automatically. -+ * -+ * we rely on utmi_linestate and utmi_hostdisconnect to identify whether -+ * devices is disconnect or not. Besides, we do not need care it is FS/LS -+ * disconnected or HS disconnected, actually, we just only need get the -+ * device is disconnected at last through rearm the delayed work, -+ * to suspend the phy port in _PHY_STATE_DISCONNECT_ case. -+ */ -+static void rockchip_u3phy_um_sm_work(struct work_struct *work) -+{ -+ struct rockchip_u3phy_port *u3phy_port = -+ container_of(work, struct rockchip_u3phy_port, um_sm_work.work); -+ struct rockchip_u3phy *u3phy = -+ dev_get_drvdata(u3phy_port->phy->dev.parent); -+ unsigned int sh = u3phy->cfgs->grfcfg.um_hstdct.bitend - -+ u3phy->cfgs->grfcfg.um_hstdct.bitstart + 1; -+ unsigned int ul, uhd, state; -+ unsigned int ul_mask, uhd_mask; -+ int ret; -+ -+ mutex_lock(&u3phy_port->mutex); -+ -+ ret = regmap_read(u3phy->u3phy_grf, -+ u3phy->cfgs->grfcfg.um_ls.offset, &ul); -+ if (ret < 0) -+ goto next_schedule; -+ -+ ret = regmap_read(u3phy->u3phy_grf, -+ u3phy->cfgs->grfcfg.um_hstdct.offset, &uhd); -+ if (ret < 0) -+ goto next_schedule; -+ -+ uhd_mask = GENMASK(u3phy->cfgs->grfcfg.um_hstdct.bitend, -+ u3phy->cfgs->grfcfg.um_hstdct.bitstart); -+ ul_mask = GENMASK(u3phy->cfgs->grfcfg.um_ls.bitend, -+ u3phy->cfgs->grfcfg.um_ls.bitstart); -+ -+ /* stitch on um_ls and um_hstdct as phy state */ -+ state = ((uhd & uhd_mask) >> u3phy->cfgs->grfcfg.um_hstdct.bitstart) | -+ (((ul & ul_mask) >> u3phy->cfgs->grfcfg.um_ls.bitstart) << sh); -+ -+ switch (state) { -+ case PHY_UTMI_HS_ONLINE: -+ dev_dbg(&u3phy_port->phy->dev, "HS online\n"); -+ break; -+ case PHY_UTMI_FS_LS_ONLINE: -+ /* -+ * For FS/LS device, the online state share with connect state -+ * from um_ls and um_hstdct register, so we distinguish -+ * them via suspended flag. -+ * -+ * Plus, there are two cases, one is D- Line pull-up, and D+ -+ * line pull-down, the state is 4; another is D+ line pull-up, -+ * and D- line pull-down, the state is 2. -+ */ -+ if (!u3phy_port->suspended) { -+ /* D- line pull-up, D+ line pull-down */ -+ dev_dbg(&u3phy_port->phy->dev, "FS/LS online\n"); -+ break; -+ } -+ /* fall through */ -+ case PHY_UTMI_CONNECT: -+ if (u3phy_port->suspended) { -+ dev_dbg(&u3phy_port->phy->dev, "Connected\n"); -+ rockchip_u3phy_power_on(u3phy_port->phy); -+ u3phy_port->suspended = false; -+ } else { -+ /* D+ line pull-up, D- line pull-down */ -+ dev_dbg(&u3phy_port->phy->dev, "FS/LS online\n"); -+ } -+ break; -+ case PHY_UTMI_DISCONNECT: -+ if (!u3phy_port->suspended) { -+ dev_dbg(&u3phy_port->phy->dev, "Disconnected\n"); -+ rockchip_u3phy_power_off(u3phy_port->phy); -+ u3phy_port->suspended = true; -+ } -+ -+ /* -+ * activate the linestate detection to get the next device -+ * plug-in irq. -+ */ -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.ls_det_st, true); -+ param_write(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.ls_det_en, true); -+ -+ /* -+ * we don't need to rearm the delayed work when the phy port -+ * is suspended. -+ */ -+ mutex_unlock(&u3phy_port->mutex); -+ return; -+ default: -+ dev_dbg(&u3phy_port->phy->dev, "unknown phy state\n"); -+ break; -+ } -+ -+next_schedule: -+ mutex_unlock(&u3phy_port->mutex); -+ schedule_delayed_work(&u3phy_port->um_sm_work, SCHEDULE_DELAY); -+} -+ -+static irqreturn_t rockchip_u3phy_um_ls_irq(int irq, void *data) -+{ -+ struct rockchip_u3phy_port *u3phy_port = data; -+ struct rockchip_u3phy *u3phy = -+ dev_get_drvdata(u3phy_port->phy->dev.parent); -+ -+ if (!param_exped(u3phy->u3phy_grf, -+ &u3phy->cfgs->grfcfg.ls_det_st, -+ u3phy->cfgs->grfcfg.ls_det_st.dvalue)) -+ return IRQ_NONE; -+ -+ dev_dbg(u3phy->dev, "utmi linestate interrupt\n"); -+ mutex_lock(&u3phy_port->mutex); -+ -+ /* disable linestate detect irq and clear its status */ -+ param_write(u3phy->u3phy_grf, &u3phy->cfgs->grfcfg.ls_det_en, false); -+ param_write(u3phy->u3phy_grf, &u3phy->cfgs->grfcfg.ls_det_st, true); -+ -+ mutex_unlock(&u3phy_port->mutex); -+ -+ /* -+ * In this case for host phy, a new device is plugged in, meanwhile, -+ * if the phy port is suspended, we need rearm the work to resume it -+ * and mange its states; otherwise, we just return irq handled. -+ */ -+ if (u3phy_port->suspended) { -+ dev_dbg(u3phy->dev, "schedule utmi sm work\n"); -+ rockchip_u3phy_um_sm_work(&u3phy_port->um_sm_work.work); -+ } -+ -+ return IRQ_HANDLED; -+} -+ -+static int rockchip_u3phy_parse_dt(struct rockchip_u3phy *u3phy, -+ struct platform_device *pdev) -+ -+{ -+ struct device *dev = &pdev->dev; -+ struct device_node *np = dev->of_node; -+ int ret, i, clk; -+ -+ u3phy->um_ls_irq = platform_get_irq_byname(pdev, "linestate"); -+ if (u3phy->um_ls_irq < 0) { -+ dev_err(dev, "get utmi linestate irq failed\n"); -+ return -ENXIO; -+ } -+ -+ u3phy->vbus_drv_gpio = devm_gpiod_get_optional(dev, "vbus-drv", -+ GPIOD_OUT_HIGH); -+ -+ if (!u3phy->vbus_drv_gpio) { -+ dev_warn(&pdev->dev, "vbus_drv is not assigned\n"); -+ } else if (IS_ERR(u3phy->vbus_drv_gpio)) { -+ dev_err(&pdev->dev, "failed to get vbus_drv\n"); -+ return PTR_ERR(u3phy->vbus_drv_gpio); -+ } -+ -+ u3phy->num_clocks = of_clk_get_parent_count(np); -+ if (u3phy->num_clocks == 0) -+ dev_warn(&pdev->dev, "no clks found in dt\n"); -+ -+ u3phy->clks = devm_kcalloc(dev, u3phy->num_clocks, -+ sizeof(struct clk *), GFP_KERNEL); -+ -+ for (clk = 0; clk < u3phy->num_clocks; clk++) { -+ u3phy->clks[clk] = of_clk_get(np, clk); -+ if (IS_ERR(u3phy->clks[clk])) { -+ ret = PTR_ERR(u3phy->clks[clk]); -+ if (ret == -EPROBE_DEFER) -+ goto err_put_clks; -+ dev_err(&pdev->dev, "failed to get clks, %i\n", -+ ret); -+ u3phy->clks[clk] = NULL; -+ break; -+ } -+ } -+ -+ for (i = 0; i < U3PHY_RESET_MAX; i++) { -+ u3phy->rsts[i] = devm_reset_control_get(dev, get_rest_name(i)); -+ if (IS_ERR(u3phy->rsts[i])) { -+ dev_info(dev, "no %s reset control specified\n", -+ get_rest_name(i)); -+ u3phy->rsts[i] = NULL; -+ } -+ } -+ -+ return 0; -+ -+err_put_clks: -+ while (--clk >= 0) -+ clk_put(u3phy->clks[clk]); -+ return ret; -+} -+ -+static int rockchip_u3phy_port_init(struct rockchip_u3phy *u3phy, -+ struct rockchip_u3phy_port *u3phy_port, -+ struct device_node *child_np) -+{ -+ struct resource res; -+ struct phy *phy; -+ int ret; -+ -+ dev_dbg(u3phy->dev, "u3phy port initialize\n"); -+ -+ mutex_init(&u3phy_port->mutex); -+ u3phy_port->suspended = true; /* initial status */ -+ -+ phy = devm_phy_create(u3phy->dev, child_np, &rockchip_u3phy_ops); -+ if (IS_ERR(phy)) { -+ dev_err(u3phy->dev, "failed to create phy\n"); -+ return PTR_ERR(phy); -+ } -+ -+ u3phy_port->phy = phy; -+ -+ ret = of_address_to_resource(child_np, 0, &res); -+ if (ret) { -+ dev_err(u3phy->dev, "failed to get address resource(np-%s)\n", -+ child_np->name); -+ return ret; -+ } -+ -+ u3phy_port->base = devm_ioremap_resource(&u3phy_port->phy->dev, &res); -+ if (IS_ERR(u3phy_port->base)) { -+ dev_err(u3phy->dev, "failed to remap phy regs\n"); -+ return PTR_ERR(u3phy_port->base); -+ } -+ -+ if (!of_node_cmp(child_np->name, "pipe")) { -+ u3phy_port->type = U3PHY_TYPE_PIPE; -+ u3phy_port->refclk_25m_quirk = -+ of_property_read_bool(child_np, -+ "rockchip,refclk-25m-quirk"); -+ } else { -+ u3phy_port->type = U3PHY_TYPE_UTMI; -+ INIT_DELAYED_WORK(&u3phy_port->um_sm_work, -+ rockchip_u3phy_um_sm_work); -+ -+ ret = devm_request_threaded_irq(u3phy->dev, u3phy->um_ls_irq, -+ NULL, rockchip_u3phy_um_ls_irq, -+ IRQF_ONESHOT, "rockchip_u3phy", -+ u3phy_port); -+ if (ret) { -+ dev_err(u3phy->dev, "failed to request utmi linestate irq handle\n"); -+ return ret; -+ } -+ } -+ -+ if (u3phy->cfgs->phy_tuning) { -+ dev_dbg(u3phy->dev, "do u3phy tuning\n"); -+ ret = u3phy->cfgs->phy_tuning(u3phy, u3phy_port, child_np); -+ if (ret) -+ return ret; -+ } -+ -+ phy_set_drvdata(u3phy_port->phy, u3phy_port); -+ return 0; -+} -+ -+static int rockchip_u3phy_on_init(struct usb_phy *usb_phy) -+{ -+ struct rockchip_u3phy *u3phy = -+ container_of(usb_phy, struct rockchip_u3phy, usb_phy); -+ -+ rockchip_u3phy_rest_deassert(u3phy, U3PHY_POR_RST | U3PHY_MAC_RST); -+ return 0; -+} -+ -+static void rockchip_u3phy_on_shutdown(struct usb_phy *usb_phy) -+{ -+ struct rockchip_u3phy *u3phy = -+ container_of(usb_phy, struct rockchip_u3phy, usb_phy); -+ int rst; -+ -+ for (rst = 0; rst < U3PHY_RESET_MAX; rst++) -+ if (u3phy->rsts[rst] && rst != UTMI_APB_RSTN && -+ rst != PIPE_APB_RSTN) -+ reset_control_assert(u3phy->rsts[rst]); -+ udelay(1); -+} -+ -+static int rockchip_u3phy_on_disconnect(struct usb_phy *usb_phy, -+ enum usb_device_speed speed) -+{ -+ struct rockchip_u3phy *u3phy = -+ container_of(usb_phy, struct rockchip_u3phy, usb_phy); -+ -+ dev_info(u3phy->dev, "%s device has disconnected\n", -+ (speed == USB_SPEED_SUPER) ? "U3" : "UW/U2/U1.1/U1"); -+ -+ if (speed == USB_SPEED_SUPER) -+ atomic_notifier_call_chain(&usb_phy->notifier, 0, NULL); -+ -+ return 0; -+} -+ -+static int rockchip_u3phy_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct device_node *np = dev->of_node; -+ struct device_node *child_np; -+ struct phy_provider *provider; -+ struct rockchip_u3phy *u3phy; -+ const struct rockchip_u3phy_cfg *phy_cfgs; -+ const struct of_device_id *match; -+ unsigned int reg[2]; -+ int index, ret; -+ -+ match = of_match_device(dev->driver->of_match_table, dev); -+ if (!match || !match->data) { -+ dev_err(dev, "phy-cfgs are not assigned!\n"); -+ return -EINVAL; -+ } -+ -+ u3phy = devm_kzalloc(dev, sizeof(*u3phy), GFP_KERNEL); -+ if (!u3phy) -+ return -ENOMEM; -+ -+ u3phy->u3phy_grf = -+ syscon_regmap_lookup_by_phandle(np, "rockchip,u3phygrf"); -+ if (IS_ERR(u3phy->u3phy_grf)) -+ return PTR_ERR(u3phy->u3phy_grf); -+ -+ u3phy->grf = -+ syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); -+ if (IS_ERR(u3phy->grf)) { -+ dev_err(dev, "Missing rockchip,grf property\n"); -+ return PTR_ERR(u3phy->grf); -+ } -+ -+ if (of_property_read_u32_array(np, "reg", reg, 2)) { -+ dev_err(dev, "the reg property is not assigned in %s node\n", -+ np->name); -+ return -EINVAL; -+ } -+ -+ u3phy->dev = dev; -+ phy_cfgs = match->data; -+ platform_set_drvdata(pdev, u3phy); -+ -+ /* find out a proper config which can be matched with dt. */ -+ index = 0; -+ while (phy_cfgs[index].reg) { -+ if (phy_cfgs[index].reg == reg[1]) { -+ u3phy->cfgs = &phy_cfgs[index]; -+ break; -+ } -+ -+ ++index; -+ } -+ -+ if (!u3phy->cfgs) { -+ dev_err(dev, "no phy-cfgs can be matched with %s node\n", -+ np->name); -+ return -EINVAL; -+ } -+ -+ ret = rockchip_u3phy_parse_dt(u3phy, pdev); -+ if (ret) { -+ dev_err(dev, "parse dt failed, ret(%d)\n", ret); -+ return ret; -+ } -+ -+ ret = rockchip_u3phy_clk_enable(u3phy); -+ if (ret) { -+ dev_err(dev, "clk enable failed, ret(%d)\n", ret); -+ return ret; -+ } -+ -+ rockchip_u3phy_rest_assert(u3phy); -+ rockchip_u3phy_rest_deassert(u3phy, U3PHY_APB_RST | U3PHY_POR_RST); -+ -+ index = 0; -+ for_each_available_child_of_node(np, child_np) { -+ struct rockchip_u3phy_port *u3phy_port = &u3phy->ports[index]; -+ -+ u3phy_port->index = index; -+ ret = rockchip_u3phy_port_init(u3phy, u3phy_port, child_np); -+ if (ret) { -+ dev_err(dev, "u3phy port init failed,ret(%d)\n", ret); -+ goto put_child; -+ } -+ -+ /* to prevent out of boundary */ -+ if (++index >= U3PHY_PORT_NUM) -+ break; -+ } -+ -+ provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); -+ if (IS_ERR_OR_NULL(provider)) -+ goto put_child; -+ -+ rockchip_u3phy_rest_deassert(u3phy, U3PHY_MAC_RST); -+ rockchip_u3phy_clk_disable(u3phy); -+ -+ u3phy->usb_phy.dev = dev; -+ u3phy->usb_phy.init = rockchip_u3phy_on_init; -+ u3phy->usb_phy.shutdown = rockchip_u3phy_on_shutdown; -+ u3phy->usb_phy.notify_disconnect = rockchip_u3phy_on_disconnect; -+ usb_add_phy(&u3phy->usb_phy, USB_PHY_TYPE_USB3); -+ ATOMIC_INIT_NOTIFIER_HEAD(&u3phy->usb_phy.notifier); -+ -+ rockchip_u3phy_debugfs_init(u3phy); -+ -+ dev_info(dev, "Rockchip u3phy initialized successfully\n"); -+ return 0; -+ -+put_child: -+ of_node_put(child_np); -+ return ret; -+} -+ -+static int rk3328_u3phy_pipe_power(struct rockchip_u3phy *u3phy, -+ struct rockchip_u3phy_port *u3phy_port, -+ bool on) -+{ -+ unsigned int reg; -+ -+ if (on) { -+ reg = readl(u3phy_port->base + 0x1a8); -+ reg &= ~BIT(4); /* ldo power up */ -+ writel(reg, u3phy_port->base + 0x1a8); -+ -+ reg = readl(u3phy_port->base + 0x044); -+ reg &= ~BIT(4); /* bg power on */ -+ writel(reg, u3phy_port->base + 0x044); -+ -+ reg = readl(u3phy_port->base + 0x150); -+ reg |= BIT(6); /* tx bias enable */ -+ writel(reg, u3phy_port->base + 0x150); -+ -+ reg = readl(u3phy_port->base + 0x080); -+ reg &= ~BIT(2); /* tx cm power up */ -+ writel(reg, u3phy_port->base + 0x080); -+ -+ reg = readl(u3phy_port->base + 0x0c0); -+ /* tx obs enable and rx cm enable */ -+ reg |= (BIT(3) | BIT(4)); -+ writel(reg, u3phy_port->base + 0x0c0); -+ -+ udelay(1); -+ } else { -+ reg = readl(u3phy_port->base + 0x1a8); -+ reg |= BIT(4); /* ldo power down */ -+ writel(reg, u3phy_port->base + 0x1a8); -+ -+ reg = readl(u3phy_port->base + 0x044); -+ reg |= BIT(4); /* bg power down */ -+ writel(reg, u3phy_port->base + 0x044); -+ -+ reg = readl(u3phy_port->base + 0x150); -+ reg &= ~BIT(6); /* tx bias disable */ -+ writel(reg, u3phy_port->base + 0x150); -+ -+ reg = readl(u3phy_port->base + 0x080); -+ reg |= BIT(2); /* tx cm power down */ -+ writel(reg, u3phy_port->base + 0x080); -+ -+ reg = readl(u3phy_port->base + 0x0c0); -+ /* tx obs disable and rx cm disable */ -+ reg &= ~(BIT(3) | BIT(4)); -+ writel(reg, u3phy_port->base + 0x0c0); -+ } -+ -+ return 0; -+} -+ -+static int rk3328_u3phy_tuning(struct rockchip_u3phy *u3phy, -+ struct rockchip_u3phy_port *u3phy_port, -+ struct device_node *child_np) -+{ -+ if (u3phy_port->type == U3PHY_TYPE_UTMI) { -+ /* -+ * For rk3328 SoC, pre-emphasis and pre-emphasis strength must -+ * be written as one fixed value as below. -+ * -+ * Dissimilarly, the odt 45ohm value should be flexibly tuninged -+ * for the different boards to adjust HS eye height, so its -+ * value can be assigned in DT in code design. -+ */ -+ -+ /* {bits[2:0]=111}: always enable pre-emphasis */ -+ u3phy->apbcfg.u2_pre_emp = 0x0f; -+ -+ /* {bits[5:3]=000}: pre-emphasis strength as the weakest */ -+ u3phy->apbcfg.u2_pre_emp_sth = 0x41; -+ -+ /* {bits[4:0]=10101}: odt 45ohm tuning */ -+ u3phy->apbcfg.u2_odt_tuning = 0xb5; -+ /* optional override of the odt 45ohm tuning */ -+ of_property_read_u32(child_np, "rockchip,odt-val-tuning", -+ &u3phy->apbcfg.u2_odt_tuning); -+ -+ writel(u3phy->apbcfg.u2_pre_emp, u3phy_port->base + 0x030); -+ writel(u3phy->apbcfg.u2_pre_emp_sth, u3phy_port->base + 0x040); -+ writel(u3phy->apbcfg.u2_odt_tuning, u3phy_port->base + 0x11c); -+ } else if (u3phy_port->type == U3PHY_TYPE_PIPE) { -+ if (u3phy_port->refclk_25m_quirk) { -+ dev_dbg(u3phy->dev, "switch to 25m refclk\n"); -+ /* ref clk switch to 25M */ -+ writel(0x64, u3phy_port->base + 0x11c); -+ writel(0x64, u3phy_port->base + 0x028); -+ writel(0x01, u3phy_port->base + 0x020); -+ writel(0x21, u3phy_port->base + 0x030); -+ writel(0x06, u3phy_port->base + 0x108); -+ writel(0x00, u3phy_port->base + 0x118); -+ } else { -+ /* configure for 24M ref clk */ -+ writel(0x80, u3phy_port->base + 0x10c); -+ writel(0x01, u3phy_port->base + 0x118); -+ writel(0x38, u3phy_port->base + 0x11c); -+ writel(0x83, u3phy_port->base + 0x020); -+ writel(0x02, u3phy_port->base + 0x108); -+ } -+ -+ /* Enable SSC */ -+ udelay(3); -+ writel(0x08, u3phy_port->base + 0x000); -+ writel(0x0c, u3phy_port->base + 0x120); -+ -+ /* Tuning Rx for compliance RJTL test */ -+ writel(0x70, u3phy_port->base + 0x150); -+ writel(0x12, u3phy_port->base + 0x0c8); -+ writel(0x05, u3phy_port->base + 0x148); -+ writel(0x08, u3phy_port->base + 0x068); -+ writel(0xf0, u3phy_port->base + 0x1c4); -+ writel(0xff, u3phy_port->base + 0x070); -+ writel(0x0f, u3phy_port->base + 0x06c); -+ writel(0xe0, u3phy_port->base + 0x060); -+ -+ /* -+ * Tuning Tx to increase the bias current -+ * used in TX driver and RX EQ, it can -+ * also increase the voltage of LFPS. -+ */ -+ writel(0x08, u3phy_port->base + 0x180); -+ } else { -+ dev_err(u3phy->dev, "invalid u3phy port type\n"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static const struct rockchip_u3phy_cfg rk3328_u3phy_cfgs[] = { -+ { -+ .reg = 0xff470000, -+ .grfcfg = { -+ .um_suspend = { 0x0004, 15, 0, 0x1452, 0x15d1 }, -+ .u2_only_ctrl = { 0x0020, 15, 15, 0, 1 }, -+ .um_ls = { 0x0030, 5, 4, 0, 1 }, -+ .um_hstdct = { 0x0030, 7, 7, 0, 1 }, -+ .ls_det_en = { 0x0040, 0, 0, 0, 1 }, -+ .ls_det_st = { 0x0044, 0, 0, 0, 1 }, -+ .pp_pwr_st = { 0x0034, 14, 13, 0, 0}, -+ .pp_pwr_en = { {0x0020, 14, 0, 0x0014, 0x0005}, -+ {0x0020, 14, 0, 0x0014, 0x000d}, -+ {0x0020, 14, 0, 0x0014, 0x0015}, -+ {0x0020, 14, 0, 0x0014, 0x001d} }, -+ .u3_disable = { 0x04c4, 15, 0, 0x1100, 0x101}, -+ }, -+ .phy_pipe_power = rk3328_u3phy_pipe_power, -+ .phy_tuning = rk3328_u3phy_tuning, -+ }, -+ { /* sentinel */ } -+}; -+ -+static const struct of_device_id rockchip_u3phy_dt_match[] = { -+ { .compatible = "rockchip,rk3328-u3phy", .data = &rk3328_u3phy_cfgs }, -+ {} -+}; -+MODULE_DEVICE_TABLE(of, rockchip_u3phy_dt_match); -+ -+static struct platform_driver rockchip_u3phy_driver = { -+ .probe = rockchip_u3phy_probe, -+ .driver = { -+ .name = "rockchip-u3phy", -+ .of_match_table = rockchip_u3phy_dt_match, -+ }, -+}; -+module_platform_driver(rockchip_u3phy_driver); -+ -+MODULE_AUTHOR("Frank Wang "); -+MODULE_AUTHOR("William Wu "); -+MODULE_DESCRIPTION("Rockchip USB 3.0 PHY driver"); -+MODULE_LICENSE("GPL v2"); - - ---- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -816,6 +816,47 @@ - <32768>; - }; - -+ usb3phy_grf: syscon@ff460000 { -+ compatible = "rockchip,usb3phy-grf", "syscon"; -+ reg = <0x0 0xff460000 0x0 0x1000>; -+ }; -+ -+ u3phy: usb3-phy@ff470000 { -+ compatible = "rockchip,rk3328-u3phy"; -+ reg = <0x0 0xff470000 0x0 0x0>; -+ rockchip,u3phygrf = <&usb3phy_grf>; -+ rockchip,grf = <&grf>; -+ interrupts = ; -+ interrupt-names = "linestate"; -+ clocks = <&cru PCLK_USB3PHY_OTG>, <&cru PCLK_USB3PHY_PIPE>; -+ clock-names = "u3phy-otg", "u3phy-pipe"; -+ resets = <&cru SRST_USB3PHY_U2>, -+ <&cru SRST_USB3PHY_U3>, -+ <&cru SRST_USB3PHY_PIPE>, -+ <&cru SRST_USB3OTG_UTMI>, -+ <&cru SRST_USB3PHY_OTG_P>, -+ <&cru SRST_USB3PHY_PIPE_P>; -+ reset-names = "u3phy-u2-por", "u3phy-u3-por", -+ "u3phy-pipe-mac", "u3phy-utmi-mac", -+ "u3phy-utmi-apb", "u3phy-pipe-apb"; -+ #address-cells = <2>; -+ #size-cells = <2>; -+ ranges; -+ status = "disabled"; -+ -+ u3phy_utmi: utmi@ff470000 { -+ reg = <0x0 0xff470000 0x0 0x8000>; -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; -+ -+ u3phy_pipe: pipe@ff478000 { -+ reg = <0x0 0xff478000 0x0 0x8000>; -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; -+ }; -+ - usb2phy_grf: syscon@ff450000 { - compatible = "rockchip,rk3328-usb2phy-grf", "syscon", - "simple-mfd"; - - ---- a/drivers/usb/dwc3/dwc3-of-simple.c -+++ b/drivers/usb/dwc3/dwc3-of-simple.c -@@ -171,6 +171,7 @@ }; - - static const struct of_device_id of_dwc3_simple_match[] = { -+ { .compatible = "rockchip,rk3328-dwc3" }, - { .compatible = "rockchip,rk3399-dwc3" }, - { .compatible = "xlnx,zynqmp-dwc3" }, - { .compatible = "cavium,octeon-7130-usb-uctl" }, - diff --git a/openwrt-21.02/patches/kernel-5.4/add-rk3328-usb3-phy-driver.patch b/openwrt-21.02/patches/kernel-5.4/add-rk3328-usb3-phy-driver.patch deleted file mode 100644 index 349a88d..0000000 --- a/openwrt-21.02/patches/kernel-5.4/add-rk3328-usb3-phy-driver.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- a/drivers/phy/rockchip/Kconfig -+++ b/drivers/phy/rockchip/Kconfig -@@ -35,6 +35,15 @@ config PHY_ROCKCHIP_INNO_USB2 - help - Support for Rockchip USB2.0 PHY with Innosilicon IP block. - -+config PHY_ROCKCHIP_INNO_USB3 -+ tristate "Rockchip INNO USB 3.0 PHY Driver" -+ depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF -+ depends on USB_SUPPORT -+ select GENERIC_PHY -+ select USB_PHY -+ help -+ Support for Rockchip USB 3.0 PHY with Innosilicon IP block. -+ - config PHY_ROCKCHIP_PCIE - tristate "Rockchip PCIe PHY Driver" - depends on (ARCH_ROCKCHIP && OF) || COMPILE_TEST - ---- a/drivers/phy/rockchip/Makefile -+++ b/drivers/phy/rockchip/Makefile -@@ -5,6 +5,7 @@ - obj-$(CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY) += phy-rockchip-inno-dsidphy.o - obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o - obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o -+obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB3) += phy-rockchip-inno-usb3.o - obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o - obj-$(CONFIG_PHY_ROCKCHIP_TYPEC) += phy-rockchip-typec.o - obj-$(CONFIG_PHY_ROCKCHIP_USB) += phy-rockchip-usb.o - ---- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -816,6 +816,47 @@ - <32768>; - }; - -+ usb3phy_grf: syscon@ff460000 { -+ compatible = "rockchip,usb3phy-grf", "syscon"; -+ reg = <0x0 0xff460000 0x0 0x1000>; -+ }; -+ -+ u3phy: usb3-phy@ff470000 { -+ compatible = "rockchip,rk3328-u3phy"; -+ reg = <0x0 0xff470000 0x0 0x0>; -+ rockchip,u3phygrf = <&usb3phy_grf>; -+ rockchip,grf = <&grf>; -+ interrupts = ; -+ interrupt-names = "linestate"; -+ clocks = <&cru PCLK_USB3PHY_OTG>, <&cru PCLK_USB3PHY_PIPE>; -+ clock-names = "u3phy-otg", "u3phy-pipe"; -+ resets = <&cru SRST_USB3PHY_U2>, -+ <&cru SRST_USB3PHY_U3>, -+ <&cru SRST_USB3PHY_PIPE>, -+ <&cru SRST_USB3OTG_UTMI>, -+ <&cru SRST_USB3PHY_OTG_P>, -+ <&cru SRST_USB3PHY_PIPE_P>; -+ reset-names = "u3phy-u2-por", "u3phy-u3-por", -+ "u3phy-pipe-mac", "u3phy-utmi-mac", -+ "u3phy-utmi-apb", "u3phy-pipe-apb"; -+ #address-cells = <2>; -+ #size-cells = <2>; -+ ranges; -+ status = "disabled"; -+ -+ u3phy_utmi: utmi@ff470000 { -+ reg = <0x0 0xff470000 0x0 0x8000>; -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; -+ -+ u3phy_pipe: pipe@ff478000 { -+ reg = <0x0 0xff478000 0x0 0x8000>; -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; -+ }; -+ - usb2phy_grf: syscon@ff450000 { - compatible = "rockchip,rk3328-usb2phy-grf", "syscon", - "simple-mfd"; - - ---- a/drivers/usb/dwc3/dwc3-of-simple.c -+++ b/drivers/usb/dwc3/dwc3-of-simple.c -@@ -171,6 +171,7 @@ }; - - static const struct of_device_id of_dwc3_simple_match[] = { -+ { .compatible = "rockchip,rk3328-dwc3" }, - { .compatible = "rockchip,rk3399-dwc3" }, - { .compatible = "xlnx,zynqmp-dwc3" }, - { .compatible = "cavium,octeon-7130-usb-uctl" }, - diff --git a/openwrt-21.02/patches/node/010-execvp-arg-list-too-long.patch b/openwrt-21.02/patches/node/010-execvp-arg-list-too-long.patch deleted file mode 100644 index c0390c7..0000000 --- a/openwrt-21.02/patches/node/010-execvp-arg-list-too-long.patch +++ /dev/null @@ -1,208 +0,0 @@ ---- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py -+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py -@@ -151,6 +151,32 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOL - quiet_cmd_link = LINK($(TOOLSET)) $@ - cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group - -+define xargs -+ $(1) $(wordlist 1,100,$(2)) -+ $(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2)))) -+endef -+ -+define write-to-file -+ @echo >$(1) -+ $(call xargs,printf "%s\\n" >>$(1),$(2)) -+endef -+ -+OBJ_FILE_LIST_SFX := ar-file-list -+ -+define create_archive -+ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) -+ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` -+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) -+ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) -+endef -+ -+define create_thin_archive -+ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) -+ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` -+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) -+ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) -+endef -+ - # We support two kinds of shared objects (.so): - # 1) shared_library, which is just bundling together many dependent libraries - # into a link line. -@@ -195,6 +221,32 @@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) - quiet_cmd_alink_thin = AR($(TOOLSET)) $@ - cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -+define xargs -+ $(1) $(wordlist 1,100,$(2)) -+ $(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2)))) -+endef -+ -+define write-to-file -+ @echo >$(1) -+ $(call xargs,printf "%s\\n" >>$(1),$(2)) -+endef -+ -+OBJ_FILE_LIST_SFX := ar-file-list -+ -+define create_archive -+ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) -+ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` -+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) -+ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) -+endef -+ -+define create_thin_archive -+ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) -+ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` -+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) -+ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) -+endef -+ - # Due to circular dependencies between libraries :(, we wrap the - # special "figure out circular dependencies" flags around the entire - # input list during linking. -@@ -1612,11 +1664,17 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj) - "Spaces in alink input filenames not supported (%s)" % link_dep) - if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not - self.is_standalone_static_library): -- self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin', -- part_of_all, postbuilds=postbuilds) -+ if self.flavor in ('linux', 'android'): -+ self.WriteMakeRule([self.output_binary], link_deps, actions = ['$(call create_thin_archive,$@,$^)']) -+ else: -+ self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin', -+ part_of_all, postbuilds=postbuilds) - else: -- self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all, -- postbuilds=postbuilds) -+ if self.flavor in ('linux', 'android'): -+ self.WriteMakeRule([self.output_binary], link_deps, actions = ['$(call create_archive,$@,$^)']) -+ else: -+ self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all, -+ postbuilds=postbuilds) - elif self.type == 'shared_library': - self.WriteLn('%s: LD_INPUTS := %s' % ( - QuoteSpaces(self.output_binary), ---- a/tools/gyp/pylib/gyp/generator/make.py -+++ b/tools/gyp/pylib/gyp/generator/make.py -@@ -155,6 +155,32 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOL - quiet_cmd_link = LINK($(TOOLSET)) $@ - cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group - -+define xargs -+ $(1) $(wordlist 1,100,$(2)) -+ $(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2)))) -+endef -+ -+define write-to-file -+ @echo >$(1) -+ $(call xargs,printf "%s\\n" >>$(1),$(2)) -+endef -+ -+OBJ_FILE_LIST_SFX := ar-file-list -+ -+define create_archive -+ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) -+ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` -+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) -+ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) -+endef -+ -+define create_thin_archive -+ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) -+ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` -+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) -+ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) -+endef -+ - # We support two kinds of shared objects (.so): - # 1) shared_library, which is just bundling together many dependent libraries - # into a link line. -@@ -199,6 +225,32 @@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) - quiet_cmd_alink_thin = AR($(TOOLSET)) $@ - cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -+define xargs -+ $(1) $(wordlist 1,100,$(2)) -+ $(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2)))) -+endef -+ -+define write-to-file -+ @echo >$(1) -+ $(call xargs,printf "%s\\n" >>$(1),$(2)) -+endef -+ -+OBJ_FILE_LIST_SFX := ar-file-list -+ -+define create_archive -+ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) -+ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` -+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) -+ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) -+endef -+ -+define create_thin_archive -+ $(eval OBJ_FILE_LIST := $(basename $(notdir $(1))).$(OBJ_FILE_LIST_SFX)) -+ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` -+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) -+ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) -+endef -+ - # Due to circular dependencies between libraries :(, we wrap the - # special "figure out circular dependencies" flags around the entire - # input list during linking. -@@ -1766,21 +1818,35 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj) - self.flavor not in ("mac", "openbsd", "netbsd", "win") - and not self.is_standalone_static_library - ): -- self.WriteDoCmd( -- [self.output_binary], -- link_deps, -- "alink_thin", -- part_of_all, -- postbuilds=postbuilds, -- ) -+ if self.flavor in ('linux', 'android'): -+ self.WriteMakeRule( -+ [self.output_binary], -+ link_deps, -+ actions = ['$(call create_thin_archive,$@,$^)'] -+ ) -+ else: -+ self.WriteDoCmd( -+ [self.output_binary], -+ link_deps, -+ 'alink_thin', -+ part_of_all, -+ postbuilds=postbuilds -+ ) - else: -- self.WriteDoCmd( -- [self.output_binary], -- link_deps, -- "alink", -- part_of_all, -- postbuilds=postbuilds, -- ) -+ if self.flavor in ('linux', 'android'): -+ self.WriteMakeRule( -+ [self.output_binary], -+ link_deps, -+ actions = ['$(call create_archive,$@,$^)'] -+ ) -+ else: -+ self.WriteDoCmd( -+ [self.output_binary], -+ link_deps, -+ 'alink', -+ part_of_all, -+ postbuilds=postbuilds -+ ) - elif self.type == "shared_library": - self.WriteLn( - "%s: LD_INPUTS := %s" diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/Makefile b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/Makefile deleted file mode 100644 index e2fda7e..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2017-2019 Stan Grishin (stangri@melmac.ca) -# This is free software, licensed under the GNU General Public License v3. - -include $(TOPDIR)/rules.mk - -PKG_LICENSE:=GPL-3.0-or-later -PKG_MAINTAINER:=Stan Grishin -PKG_VERSION:=0.3.4-8 - -LUCI_TITLE:=VPN Policy-Based Routing Service Web UI -LUCI_DESCRIPTION:=Provides Web UI for vpn-policy-routing service. -LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +vpn-policy-routing -LUCI_PKGARCH:=all - -include ../../luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua deleted file mode 100644 index 53c0991..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua +++ /dev/null @@ -1,33 +0,0 @@ -module("luci.controller.vpn-policy-routing", package.seeall) -function index() - if nixio.fs.access("/etc/config/vpn-policy-routing") then - local e = entry({"admin", "vpn"}, firstchild(), _("VPN"), 60) - e.dependent = false - e.acl_depends = { "luci-app-vpn-policy-routing" } - entry({"admin", "vpn", "vpn-policy-routing"}, cbi("vpn-policy-routing"), _("VPN Policy Routing")) - entry({"admin", "vpn", "vpn-policy-routing", "action"}, call("vpn_policy_routing_action"), nil).leaf = true - end -end - -function vpn_policy_routing_action(name) - local packageName = "vpn-policy-routing" - local http = require "luci.http" - local sys = require "luci.sys" - local uci = require "luci.model.uci".cursor() - local util = require "luci.util" - if name == "start" then - sys.init.start(packageName) - elseif name == "action" then - util.exec("/etc/init.d/" .. packageName .. " restart >/dev/null 2>&1") - elseif name == "stop" then - sys.init.stop(packageName) - elseif name == "enable" then - uci:set(packageName, "config", "enabled", "1") - uci:commit(packageName) - elseif name == "disable" then - uci:set(packageName, "config", "enabled", "0") - uci:commit(packageName) - end - http.prepare_content("text/plain") - http.write("0") -end diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua deleted file mode 100644 index a732c7d..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua +++ /dev/null @@ -1,376 +0,0 @@ -local packageName = "vpn-policy-routing" -local readmeURL = "https://docs.openwrt.melmac.net/" .. packageName .. "/" -local uci = require "luci.model.uci".cursor() -local sys = require "luci.sys" -local util = require "luci.util" -local ip = require "luci.ip" -local fs = require "nixio.fs" -local jsonc = require "luci.jsonc" -local http = require "luci.http" -local nutil = require "nixio.util" -local dispatcher = require "luci.dispatcher" -local enc - -function getPackageVersion() - local opkgFile = "/usr/lib/opkg/status" - local line - local flag = false - for line in io.lines(opkgFile) do - if flag then - return line:match('[%d%.$-]+') or "" - elseif line:find("Package: " .. packageName:gsub("%-", "%%%-")) then - flag = true - end - end - return "" -end - -local ubusStatus = util.ubus("service", "list", { name = packageName }) -if ubusStatus and ubusStatus[packageName] and - ubusStatus[packageName]["instances"] and - ubusStatus[packageName]["instances"]["main"] and - ubusStatus[packageName]["instances"]["main"]["data"] and - ubusStatus[packageName]["instances"]["main"]["data"]["status"] and - ubusStatus[packageName]["instances"]["main"]["data"]["status"][1] then - serviceGateways = ubusStatus[packageName]["instances"]["main"]["data"]["status"][1]["gateway"] - serviceGateways = serviceGateways and serviceGateways:gsub('\\n', '\n') - serviceGateways = serviceGateways and serviceGateways:gsub('\\033%[0;32m%[\\xe2\\x9c\\x93%]\\033%[0m', '✓') - serviceErrors = ubusStatus[packageName]["instances"]["main"]["data"]["status"][1]["error"] - serviceErrors = serviceErrors and serviceErrors:gsub('\\n', '\n') - serviceErrors = serviceErrors and serviceErrors:gsub('\\033%[0;31mERROR\\033%[0m: ', '') - serviceWarnings = ubusStatus[packageName]["instances"]["main"]["data"]["status"][1]["warning"] - serviceWarnings = serviceWarnings and serviceWarnings:gsub('\\n', '\n') - serviceWarnings = serviceWarnings and serviceWarnings:gsub('\\033%[0;33mWARNING\\033%[0m: ', '') - serviceMode = ubusStatus[packageName]["instances"]["main"]["data"]["status"][1]["mode"] -end - -local serviceRunning, statusText = false, nil -local packageVersion = getPackageVersion() -if packageVersion == "" then - statusText = translatef("%s is not installed or not found", packageName) -end -if sys.call("iptables -t mangle -L | grep -q VPR_PREROUTING") == 0 then - serviceRunning = true - statusText = translate("Running") - if serviceMode and serviceMode == "strict" then - statusText = translatef("%s (strict mode)", statusText) - end -else - statusText = translate("Stopped") - if uci:get(packageName, "config", "enabled") ~= "1" then - statusText = translatef("%s (disabled)", statusText) - end -end - -local t = uci:get("vpn-policy-routing", "config", "supported_interface") -if not t then - supportedIfaces = "" -elseif type(t) == "table" then - for key,value in pairs(t) do supportedIfaces = supportedIfaces and supportedIfaces .. ' ' .. value or value end -elseif type(t) == "string" then - supportedIfaces = t -end - -t = uci:get("vpn-policy-routing", "config", "ignored_interface") -if not t then - ignoredIfaces = "" -elseif type(t) == "table" then - for key,value in pairs(t) do ignoredIfaces = ignoredIfaces and ignoredIfaces .. ' ' .. value or value end -elseif type(t) == "string" then - ignoredIfaces = t -end - -local lanIPAddr = uci:get("network", "lan", "ipaddr") -local lanNetmask = uci:get("network", "lan", "netmask") --- if multiple ip addresses on lan interface, will be returned as table of CIDR notations i.e. {"10.0.0.1/24","10.0.0.2/24"} -if (type(lanIPAddr) == "table") then - first = true - for i,line in ipairs(lanIPAddr) do - lanIPAddr = lanIPAddr[i] - break - end - lanIPAddr = lanIPAddr:match("[0-9.]+") -end -if lanIPAddr and lanNetmask then - laPlaceholder = ip.new(lanIPAddr .. "/" .. lanNetmask ) -end - -function is_wan(name) - return name:sub(1,3) == "wan" or name:sub(-3) == "wan" -end - -function is_supported_interface(arg) - local name=arg['.name'] - local proto=arg['proto'] - local ifname=arg['ifname'] - local device=arg['device'] - ifname = ifname or device - - if name and is_wan(name) then return true end - if name and supportedIfaces:match('%f[%w]' .. name .. '%f[%W]') then return true end - if name and not ignoredIfaces:match('%f[%w]' .. name .. '%f[%W]') then - if type(ifname) == "table" then - for key,value in pairs(ifname) do - if value and value:sub(1,3) == "tun" then return true end - if value and value:sub(1,3) == "tap" then return true end - if value and value:sub(1,3) == "tor" then return true end - if value and fs.access("/sys/devices/virtual/net/" .. value .. "/tun_flags") then return true end - end - elseif type(ifname) == "string" then - if ifname and ifname:sub(1,3) == "tun" then return true end - if ifname and ifname:sub(1,3) == "tap" then return true end - if ifname and ifname:sub(1,3) == "tor" then return true end - if ifname and fs.access("/sys/devices/virtual/net/" .. ifname .. "/tun_flags") then return true end - end - if proto and proto:sub(1,11) == "openconnect" then return true end - if proto and proto:sub(1,4) == "pptp" then return true end - if proto and proto:sub(1,4) == "l2tp" then return true end - if proto and proto:sub(1,9) == "wireguard" then return true end - end -end - -m = Map("vpn-policy-routing", translate("VPN and WAN Policy-Based Routing")) - -h = m:section(NamedSection, "config", packageName, translatef("Service Status [%s %s]", packageName, packageVersion)) -status = h:option(DummyValue, "_dummy", translate("Service Status")) -status.template = "vpn-policy-routing/status" -status.value = statusText -if serviceRunning and serviceGateways and serviceGateways ~= "" then - gateways = h:option(DummyValue, "_dummy", translate("Service Gateways")) - gateways.template = packageName .. "/status-gateways" - gateways.value = serviceGateways -end -if serviceErrors and serviceErrors ~= "" then - errors = h:option(DummyValue, "_dummy", translate("Service Errors")) - errors.template = packageName .. "/status" - errors.value = serviceErrors -end -if serviceWarnings and serviceWarnings ~= "" then - warnings = h:option(DummyValue, "_dummy", translate("Service Warnings")) - warnings.template = packageName .. "/status" - warnings.value = serviceWarnings -end -if packageVersion ~= "" then - buttons = h:option(DummyValue, "_dummy", translate("Service Control")) - buttons.template = packageName .. "/buttons" -end - --- General Options -config = m:section(NamedSection, "config", "vpn-policy-routing", translate("Configuration")) -config.override_values = true -config.override_depends = true - --- Basic Options -config:tab("basic", translate("Basic Configuration")) - -verb = config:taboption("basic", ListValue, "verbosity", translate("Output verbosity"), translate("Controls both system log and console output verbosity.")) -verb:value("0", translate("Suppress/No output")) -verb:value("1", translate("Condensed output")) -verb:value("2", translate("Verbose output")) -verb.default = 2 - -se = config:taboption("basic", ListValue, "strict_enforcement", translate("Strict enforcement"), - translatef("See the %sREADME%s for details.", "", "")) -se:value("0", translate("Do not enforce policies when their gateway is down")) -se:value("1", translate("Strictly enforce policies when their gateway is down")) -se.default = 1 - -resolver_ipset = config:taboption("basic", ListValue, "resolver_ipset", translate("Use resolver's ipset for domains"), - translatef("Please check the %sREADME%s before changing this option.", "", "")) -resolver_ipset:value("none", translate("Disabled")) -resolver_ipset:value("dnsmasq.ipset", translate("DNSMASQ ipset")) -resolver_ipset.default = "dnsmasq.ipset" - -ipv6 = config:taboption("basic", ListValue, "ipv6_enabled", translate("IPv6 Support")) -ipv6:value("0", translate("Disabled")) -ipv6:value("1", translate("Enabled")) - --- Advanced Options -config:tab("advanced", translate("Advanced Configuration"), - translatef("%sWARNING:%s Please make sure to check the %sREADME%s before changing anything in this section! Change any of the settings below with extreme caution!%s" , "
    ", "", "", "", "

")) - -supportedIface = config:taboption("advanced", DynamicList, "supported_interface", translate("Supported Interfaces"), translate("Allows to specify the list of interface names (in lower case) to be explicitly supported by the service. Can be useful if your OpenVPN tunnels have dev option other than tun* or tap*.")) -supportedIface.optional = false - -ignoredIface = config:taboption("advanced", DynamicList, "ignored_interface", translate("Ignored Interfaces"), translate("Allows to specify the list of interface names (in lower case) to be ignored by the service. Can be useful if running both VPN server and VPN client on the router.")) -ignoredIface.optional = false - -timeout = config:taboption("advanced", Value, "boot_timeout", translate("Boot Time-out"), translate("Time (in seconds) for service to wait for WAN gateway discovery on boot.")) -timeout.optional = false -timeout.rmempty = true - -dest_ipset = config:taboption("advanced", ListValue, "dest_ipset", translate("The ipset option for remote policies"), - translatef("Please check the %sREADME%s before changing this option.", "", "")) -dest_ipset:value("0", translate("Disabled")) -dest_ipset:value("1", translate("Use ipset command")) -dest_ipset.default = "0" - -src_ipset = config:taboption("advanced", ListValue, "src_ipset", translate("The ipset option for local policies"), - translatef("Please check the %sREADME%s before changing this option.", "", "")) -src_ipset:value("0", translate("Disabled")) -src_ipset:value("1", translate("Use ipset command")) -src_ipset.default = "0" - -insert = config:taboption("advanced", ListValue, "iptables_rule_option", translate("IPTables rule option"), translate("Select Append for -A and Insert for -I.")) -insert:value("append", translate("Append")) -insert:value("insert", translate("Insert")) -insert.default = "append" - -icmp = config:taboption("advanced", ListValue, "icmp_interface", translate("Default ICMP Interface"), translate("Force the ICMP protocol interface.")) -icmp:value("", translate("No Change")) -icmp:value("wan", translate("WAN")) -uci:foreach("network", "interface", function(s) - local name=s['.name'] - if is_supported_interface(s) then icmp:value(name, name:upper()) end -end) -icmp.rmempty = true - -wantid = config:taboption("advanced", Value, "wan_tid", translate("WAN Table ID"), translate("Starting (WAN) Table ID number for tables created by the service.")) -wantid.rmempty = true -wantid.placeholder = "201" -wantid.datatype = 'and(uinteger, min(201))' - -wanmark = config:taboption("advanced", Value, "wan_mark", translate("WAN Table FW Mark"), translate("Starting (WAN) FW Mark for marks used by the service. High starting mark is used to avoid conflict with SQM/QoS. Change with caution together with") .. " " .. translate("Service FW Mask") .. ".") -wanmark.rmempty = true -wanmark.placeholder = "0x010000" -wanmark.datatype = "hex(8)" - -fwmask = config:taboption("advanced", Value, "fw_mask", translate("Service FW Mask"), translate("FW Mask used by the service. High mask is used to avoid conflict with SQM/QoS. Change with caution together with") .. " " .. translate("WAN Table FW Mark") .. ".") -fwmask.rmempty = true -fwmask.placeholder = "0xff0000" -fwmask.datatype = "hex(8)" - -config:tab("webui", translate("Web UI Configuration")) - -webui_enable_column = config:taboption("webui", ListValue, "webui_enable_column", translate("Show Enable Column"), translate("Shows the enable checkbox column for policies, allowing you to quickly enable/disable specific policy without deleting it.")) -webui_enable_column:value("0", translate("Disabled")) -webui_enable_column:value("1", translate("Enabled")) - -webui_protocol_column = config:taboption("webui", ListValue, "webui_protocol_column", translate("Show Protocol Column"), translate("Shows the protocol column for policies, allowing you to assign a specific protocol to a policy.")) -webui_protocol_column:value("0", translate("Disabled")) -webui_protocol_column:value("1", translate("Enabled")) - -webui_supported_protocol = config:taboption("webui", DynamicList, "webui_supported_protocol", translate("Supported Protocols"), translate("Display these protocols in protocol column in Web UI.")) -webui_supported_protocol.optional = false - -webui_chain_column = config:taboption("webui", ListValue, "webui_chain_column", translate("Show Chain Column"), translate("Shows the chain column for policies, allowing you to assign a PREROUTING, FORWARD, INPUT or OUTPUT chain to a policy.")) -webui_chain_column:value("0", translate("Disabled")) -webui_chain_column:value("1", translate("Enabled")) - -webui_show_ignore_target = config:taboption("webui", ListValue, "webui_show_ignore_target", translate("Add IGNORE Target"), translate("Adds `IGNORE` to the list of interfaces for policies, allowing you to skip further processing by VPN Policy Routing.")) -webui_show_ignore_target:value("0", translate("Disabled")) -webui_show_ignore_target:value("1", translate("Enabled")) - -webui_sorting = config:taboption("webui", ListValue, "webui_sorting", translate("Show Up/Down Buttons"), translate("Shows the Up/Down buttons for policies, allowing you to move a policy up or down in the list.")) -webui_sorting:value("0", translate("Disabled")) -webui_sorting:value("1", translate("Enabled")) -webui_sorting.default = "1" - --- Policies -p = m:section(TypedSection, "policy", translate("Policies"), translate("Name, interface and at least one other field are required. Multiple local and remote addresses/devices/domains and ports can be space separated. Placeholders below represent just the format/syntax and will not be used if fields are left blank.")) -p.template = "cbi/tblsection" -if uci:get("vpn-policy-routing", "config", "webui_sorting") == "1" then - p.sortable = true -end -p.anonymous = true -p.addremove = true - -if uci:get("vpn-policy-routing", "config", "webui_enable_column") == "1" then - le = p:option(Flag, "enabled", translate("Enabled")) - le.default = "1" -end - -if uci:get_first("vpn-policy-routing", "policy", "comment") then - p:option(Value, "comment", translate("Comment")) -else - p:option(Value, "name", translate("Name")) -end - -la = p:option(Value, "src_addr", translate("Local addresses / devices")) -if laPlaceholder then - la.placeholder = laPlaceholder -end -la.rmempty = true -la.datatype = 'list(neg(or(host,network,macaddr,string)))' - -lp = p:option(Value, "src_port", translate("Local ports")) -lp.datatype = 'list(neg(or(portrange, string)))' -lp.placeholder = "0-65535" -lp.rmempty = true - -ra = p:option(Value, "dest_addr", translate("Remote addresses / domains")) -ra.datatype = 'list(neg(host))' -ra.placeholder = "0.0.0.0/0" -ra.rmempty = true - -rp = p:option(Value, "dest_port", translate("Remote ports")) -rp.datatype = 'list(neg(or(portrange, string)))' -rp.placeholder = "0-65535" -rp.rmempty = true - -if uci:get("vpn-policy-routing", "config", "webui_protocol_column") == "1" then - proto = p:option(ListValue, "proto", translate("Protocol")) - proto:value("", "AUTO") - proto.default = "" - proto.rmempty = true - enc = uci:get_list("vpn-policy-routing", "config", "webui_supported_protocol") - if next(enc) == nil then - enc = { "tcp", "udp", "tcp udp", "icmp", "all" } - end - for key,value in pairs(enc) do - proto:value(value:lower(), value:gsub(" ", "/"):upper()) - end -end - -if uci:get("vpn-policy-routing", "config", "webui_chain_column") == "1" then - chain = p:option(ListValue, "chain", translate("Chain")) - chain:value("", "PREROUTING") - chain:value("FORWARD", "FORWARD") - chain:value("INPUT", "INPUT") - chain:value("OUTPUT", "OUTPUT") - chain.default = "" - chain.rmempty = true -end - -gw = p:option(ListValue, "interface", translate("Interface")) -gw.datatype = "network" -gw.rmempty = false -uci:foreach("network", "interface", function(s) - local name=s['.name'] - if is_wan(name) then - gw:value(name, name:upper()) - if not gw.default then gw.default = name end - elseif is_supported_interface(s) then - gw:value(name, name:upper()) - end -end) -if fs.access("/etc/tor/torrc") then gw:value("tor", "TOR") end -if uci:get("vpn-policy-routing", "config", "webui_show_ignore_target") == "1" then - gw:value("ignore", "IGNORE") -end - -dscp = m:section(NamedSection, "config", "vpn-policy-routing", translate("DSCP Tagging"), - translatef("Set DSCP tags (in range between 1 and 63) for specific interfaces. See the %sREADME%s for details.", "", "")) -uci:foreach("network", "interface", function(s) - local name=s['.name'] - if is_supported_interface(s) then - local x = dscp:option(Value, name .. "_dscp", name:upper() .. " " .. translate("DSCP Tag")) - x.rmempty = true - x.datatype = "range(1,63)" - end -end) - --- Includes -inc = m:section(TypedSection, "include", translate("Custom User File Includes"), - translatef("Run the following user files after setting up but before restarting DNSMASQ. See the %sREADME%s for details.", "", "")) -inc.template = "cbi/tblsection" -inc.sortable = true -inc.anonymous = true -inc.addremove = true - -finc = inc:option(Flag, "enabled", translate("Enabled")) -finc.optional = false -finc.default = "1" -inc:option(Value, "path", translate("Path")).optional = false - -return m diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/buttons.htm b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/buttons.htm deleted file mode 100644 index 338bc97..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/buttons.htm +++ /dev/null @@ -1,77 +0,0 @@ -<%# Copyright 2020 Stan Grishin -%> - -<%+vpn-policy-routing/css%> -<%+vpn-policy-routing/js%> - -<%- - local packageName = "vpn-policy-routing" - local uci = require "luci.model.uci".cursor() - local sys = require "luci.sys" - local serviceRunning, serviceEnabled = false, false; - if sys.call("iptables -t mangle -L | grep -q VPR_PREROUTING") == 0 then - serviceRunning = true - end - if uci:get(packageName, "config", "enabled") == "1" then - serviceEnabled = true - end - - if serviceEnabled then - btn_start_status = true - btn_action_status = true - btn_stop_status = true - btn_enable_status = false - btn_disable_status = true - else - btn_start_status = false - btn_action_status = false - btn_stop_status = false - btn_enable_status = true - btn_disable_status = false - end - if serviceRunning then - btn_start_status = false - btn_action_status = true - btn_stop_status = true - else - btn_action_status = false - btn_stop_status = false - end --%> - -<%+cbi/valueheader%> - - - - - - -   -   -   -   - - - - -<%+cbi/valuefooter%> - -<%-if not btn_start_status then%> - -<%-end%> -<%-if not btn_action_status then%> - -<%-end%> -<%-if not btn_stop_status then%> - -<%-end%> -<%-if not btn_enable_status then%> - -<%-end%> -<%-if not btn_disable_status then%> - -<%-end%> diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/css.htm b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/css.htm deleted file mode 100644 index 6fb3d51..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/css.htm +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/js.htm b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/js.htm deleted file mode 100644 index 7c19032..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/js.htm +++ /dev/null @@ -1,59 +0,0 @@ - \ No newline at end of file diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status-gateways.htm b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status-gateways.htm deleted file mode 100644 index b10d3b1..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status-gateways.htm +++ /dev/null @@ -1,18 +0,0 @@ -<%# -Copyright 2017-2020 Stan Grishin (stangri@melmac.ca) -This is free software, licensed under the Apache License, Version 2.0 --%> - -<%+cbi/valueheader%> - -
- <%=self:cfgvalue(section):gsub('\n', '
' )%> -
-
- -
- <%- local readmeURL = "https://docs.openwrt.melmac.net/vpn-policy-routing/" -%> - <%=translatef("The %s indicates default gateway. See the %sREADME%s for details.", "", "", "")%> -
- -<%+cbi/valuefooter%> diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status.htm b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status.htm deleted file mode 100644 index dfe468d..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status.htm +++ /dev/null @@ -1,12 +0,0 @@ -<%# -Copyright 2017-2019 Stan Grishin (stangri@melmac.ca) -This is free software, licensed under the Apache License, Version 2.0 --%> - -<%+cbi/valueheader%> - -
- <%=self:cfgvalue(section):gsub('\n', '
' )%> -
- -<%+cbi/valuefooter%> diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/po/templates/vpn-policy-routing.pot b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/po/templates/vpn-policy-routing.pot deleted file mode 100644 index 2a6f5a3..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/po/templates/vpn-policy-routing.pot +++ /dev/null @@ -1,430 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:61 -msgid "%s (disabled)" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:56 -msgid "%s (strict mode)" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:50 -msgid "%s is not installed or not found" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:190 -msgid "" -"%sWARNING:%s Please make sure to check the %sREADME%s before changing " -"anything in this section! Change any of the settings below with extreme " -"caution!%s" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:260 -msgid "Add IGNORE Target" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:260 -msgid "" -"Adds `IGNORE` to the list of interfaces for policies, allowing you to skip " -"further processing by VPN Policy Routing." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:189 -msgid "Advanced Configuration" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:192 -msgid "" -"Allows to specify the list of interface names (in lower case) to be " -"explicitly supported by the service. Can be useful if your OpenVPN tunnels " -"have dev option other than tun* or tap*." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:195 -msgid "" -"Allows to specify the list of interface names (in lower case) to be ignored " -"by the service. Can be useful if running both VPN server and VPN client on " -"the router." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:215 -msgid "Append" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:164 -msgid "Basic Configuration" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:198 -msgid "Boot Time-out" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:326 -msgid "Chain" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:284 -msgid "Comment" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:168 -msgid "Condensed output" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:159 -msgid "Configuration" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:166 -msgid "Controls both system log and console output verbosity." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:364 -msgid "Custom User File Includes" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:181 -msgid "DNSMASQ ipset" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:357 -msgid "DSCP Tag" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:352 -msgid "DSCP Tagging" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:219 -msgid "Default ICMP Interface" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/buttons.htm:58 -msgid "Disable" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:180 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:185 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:204 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:210 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:246 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:250 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:257 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:261 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:265 -msgid "Disabled" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:253 -msgid "Display these protocols in protocol column in Web UI." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:174 -msgid "Do not enforce policies when their gateway is down" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/buttons.htm:55 -msgid "Enable" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:186 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:247 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:251 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:258 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:262 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:266 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:279 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:371 -msgid "Enabled" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:238 -msgid "" -"FW Mask used by the service. High mask is used to avoid conflict with SQM/" -"QoS. Change with caution together with" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:219 -msgid "Force the ICMP protocol interface." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/root/usr/share/rpcd/acl.d/luci-app-vpn-policy-routing.json:3 -msgid "Grant UCI and file access for luci-app-vpn-policy-routing" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:214 -msgid "IPTables rule option" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:184 -msgid "IPv6 Support" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:195 -msgid "Ignored Interfaces" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:216 -msgid "Insert" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:335 -msgid "Interface" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/js.htm:51 -msgid "Loading" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:289 -msgid "Local addresses / devices" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:296 -msgid "Local ports" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:286 -msgid "Name" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:270 -msgid "" -"Name, interface and at least one other field are required. Multiple local " -"and remote addresses/devices/domains and ports can be space separated. " -"Placeholders below represent just the format/syntax and will not be used if " -"fields are left blank." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:220 -msgid "No Change" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:166 -msgid "Output verbosity" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:374 -msgid "Path" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:179 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:203 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:209 -msgid "Please check the %sREADME%s before changing this option." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:270 -msgid "Policies" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:312 -msgid "Protocol" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:301 -msgid "Remote addresses / domains" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:306 -msgid "Remote ports" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/buttons.htm:45 -msgid "Restart" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:365 -msgid "" -"Run the following user files after setting up but before restarting DNSMASQ. " -"See the %sREADME%s for details." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:54 -msgid "Running" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:173 -msgid "See the %sREADME%s for details." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:214 -msgid "Select Append for -A and Insert for -I." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:154 -msgid "Service Control" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:144 -msgid "Service Errors" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:233 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:238 -msgid "Service FW Mask" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:139 -msgid "Service Gateways" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:135 -msgid "Service Status" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:134 -msgid "Service Status [%s %s]" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:149 -msgid "Service Warnings" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:353 -msgid "" -"Set DSCP tags (in range between 1 and 63) for specific interfaces. See the " -"%sREADME%s for details." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:256 -msgid "Show Chain Column" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:245 -msgid "Show Enable Column" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:249 -msgid "Show Protocol Column" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:264 -msgid "Show Up/Down Buttons" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:264 -msgid "" -"Shows the Up/Down buttons for policies, allowing you to move a policy up or " -"down in the list." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:256 -msgid "" -"Shows the chain column for policies, allowing you to assign a PREROUTING, " -"FORWARD, INPUT or OUTPUT chain to a policy." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:245 -msgid "" -"Shows the enable checkbox column for policies, allowing you to quickly " -"enable/disable specific policy without deleting it." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:249 -msgid "" -"Shows the protocol column for policies, allowing you to assign a specific " -"protocol to a policy." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/buttons.htm:42 -msgid "Start" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:233 -msgid "" -"Starting (WAN) FW Mark for marks used by the service. High starting mark is " -"used to avoid conflict with SQM/QoS. Change with caution together with" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:228 -msgid "Starting (WAN) Table ID number for tables created by the service." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/buttons.htm:48 -msgid "Stop" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:59 -msgid "Stopped" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:172 -msgid "Strict enforcement" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:175 -msgid "Strictly enforce policies when their gateway is down" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:192 -msgid "Supported Interfaces" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:253 -msgid "Supported Protocols" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:167 -msgid "Suppress/No output" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status-gateways.htm:15 -msgid "The %s indicates default gateway. See the %sREADME%s for details." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:208 -msgid "The ipset option for local policies" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:202 -msgid "The ipset option for remote policies" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:198 -msgid "" -"Time (in seconds) for service to wait for WAN gateway discovery on boot." -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:205 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:211 -msgid "Use ipset command" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:178 -msgid "Use resolver's ipset for domains" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua:4 -msgid "VPN" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/controller/vpn-policy-routing.lua:7 -msgid "VPN Policy Routing" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:132 -msgid "VPN and WAN Policy-Based Routing" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:169 -msgid "Verbose output" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:221 -msgid "WAN" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:233 -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:238 -msgid "WAN Table FW Mark" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:228 -msgid "WAN Table ID" -msgstr "" - -#: applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua:243 -msgid "Web UI Configuration" -msgstr "" diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/root/etc/uci-defaults/40_luci-vpn-policy-routing b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/root/etc/uci-defaults/40_luci-vpn-policy-routing deleted file mode 100644 index b42fa58..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/root/etc/uci-defaults/40_luci-vpn-policy-routing +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache; -[ -x /etc/init.d/rpcd ] && /etc/init.d/rpcd reload -exit 0 diff --git a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/root/usr/share/rpcd/acl.d/luci-app-vpn-policy-routing.json b/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/root/usr/share/rpcd/acl.d/luci-app-vpn-policy-routing.json deleted file mode 100644 index 5cdb67f..0000000 --- a/openwrt-21.02/patches/package/luci-app-vpn-policy-routing/root/usr/share/rpcd/acl.d/luci-app-vpn-policy-routing.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "luci-app-vpn-policy-routing": { - "description": "Grant UCI and file access for luci-app-vpn-policy-routing", - "read": { - "cgi-io": [ - "exec" - ], - "file": { - "/usr/lib/opkg/status": [ - "read" - ], - "/etc/init.d/vpn-policy-routing *": [ - "exec" - ], - "/usr/bin/grep *": [ - "exec" - ], - "/usr/sbin/grep *": [ - "exec" - ], - "/usr/sbin/iptables *": [ - "exec" - ] - }, - "uci": [ - "network", - "vpn-policy-routing" - ] - }, - "write": { - "uci": [ - "vpn-policy-routing" - ] - } - } -} \ No newline at end of file diff --git a/openwrt-21.02/patches/package/uboot-rockchip/patches/001-scripts-remove-dependency-on-swig.patch b/openwrt-21.02/patches/package/uboot-rockchip/patches/001-scripts-remove-dependency-on-swig.patch deleted file mode 100644 index 0505589..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/patches/001-scripts-remove-dependency-on-swig.patch +++ /dev/null @@ -1,24 +0,0 @@ -From b137ca16b54c67d76714ea5a0138741959b0dc29 Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Mon, 13 Jul 2020 23:37:37 +0200 -Subject: [PATCH] scripts: remove dependency on swig - -Don't build the libfdt tool, as it has a dependency on swig (which -OpenWrt does not ship). - -This requires more hacks, as of-platdata generation does not work -without it. - -Signed-off-by: David Bauer ---- - scripts/dtc/Makefile | 2 -- - 1 file changed, 2 deletions(-) - ---- a/scripts/dtc/Makefile -+++ b/scripts/dtc/Makefile -@@ -18,5 +18,3 @@ HOSTCFLAGS_dtc-parser.tab.o := -I$(src) - # dependencies on generated files need to be listed explicitly - $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h - --# Added for U-Boot --subdir-$(CONFIG_PYLIBFDT) += pylibfdt diff --git a/openwrt-21.02/patches/package/uboot-rockchip/patches/002-spl-remove-dtoc-of-pdata-generation.patch b/openwrt-21.02/patches/package/uboot-rockchip/patches/002-spl-remove-dtoc-of-pdata-generation.patch deleted file mode 100644 index 14bcbfb..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/patches/002-spl-remove-dtoc-of-pdata-generation.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 55273cf6079ddd3b006da69f0113c2c66c03f17e Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Tue, 14 Jul 2020 22:44:22 +0200 -Subject: [PATCH] spl: remove dtoc of-pdata generation - -Remove the dtoc of-pdata generation. This generation is dependant on -libpython-dev. As OpenWrt does not ship with this dependency, use -pre-generated pdata files and remove the generation from the -build-process. - -This only affects RK3328 boards. - -Signed-off-by: David Bauer ---- - scripts/Makefile.spl | 6 ------ - 1 file changed, 6 deletions(-) - ---- a/scripts/Makefile.spl -+++ b/scripts/Makefile.spl -@@ -354,8 +354,6 @@ $(platdata-hdr) $(u-boot-spl-platdata_c) - @# of OF_PLATDATA_INST and this might change between builds. Leaving old - @# ones around is confusing and it is possible that switching the - @# setting again will use the old one instead of regenerating it. -- @rm -f $(u-boot-spl-all-platdata_c) $(u-boot-spl-all-platdata) -- $(call if_changed,dtoc) - - ifdef CONFIG_SAMSUNG - ifdef CONFIG_VAR_SIZE_SPL diff --git a/openwrt-21.02/patches/package/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch b/openwrt-21.02/patches/package/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch deleted file mode 100644 index f630818..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 2114d68b3c755ec8043ae9e43ac8e9753e0cec84 Mon Sep 17 00:00:00 2001 -From: Marty Jones -Date: Sun, 17 Jan 2021 15:26:09 -0500 -Subject: [PATCH] rockpro64: disable CONFIG_USE_PREBOOT - -On commit https://github.com/u-boot/u-boot/commit/f81f9f0ebac596bae7f27db095f4f0272b606cc3 -CONFIG_USE_PREBOOT was enabled on the RockPro64. - -When the board is booting, U-Boot hangs as soon as it disables the USB -controller. This is a workaround until a final solution is deployed -upstream. - -Signed-off-by: Marty Jones ---- - configs/rockpro64-rk3399_defconfig | 1 - - 1 file changed, 1 deletion(-) - ---- a/configs/rockpro64-rk3399_defconfig -+++ b/configs/rockpro64-rk3399_defconfig -@@ -12,7 +12,6 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y - CONFIG_SPL_SPI_SUPPORT=y - CONFIG_DEFAULT_DEVICE_TREE="rk3399-rockpro64" - CONFIG_DEBUG_UART=y --CONFIG_USE_PREBOOT=y - CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rockpro64.dtb" - CONFIG_DISPLAY_BOARDINFO_LATE=y - CONFIG_MISC_INIT_R=y diff --git a/openwrt-21.02/patches/package/uboot-rockchip/patches/204-board-nanopi4-unify-1GB-4GB-variants-of-R4S.patch b/openwrt-21.02/patches/package/uboot-rockchip/patches/204-board-nanopi4-unify-1GB-4GB-variants-of-R4S.patch deleted file mode 100644 index 07ce241..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/patches/204-board-nanopi4-unify-1GB-4GB-variants-of-R4S.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 317331b3d7ddcf2a5e7b5a9002ac559627000032 Mon Sep 17 00:00:00 2001 -From: hmz007 -Date: Sat, 19 Dec 2020 20:39:29 +0800 -Subject: [PATCH 4/4] board: nanopi4: unify 1GB/4GB variants of R4S - -Signed-off-by: hmz007 ---- - .../arm/dts/rk3399-nanopi-r4s-4gb-u-boot.dtsi | 8 -- - arch/arm/dts/rk3399-nanopi-r4s-4gb.dts | 114 ------------------ - arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi | 2 + - board/friendlyarm/nanopi4/hwrev.c | 36 ++++++ - configs/nanopi-r4s-4gb-rk3399_defconfig | 63 ---------- - configs/nanopi-r4s-rk3399_defconfig | 1 + - 6 files changed, 39 insertions(+), 185 deletions(-) - delete mode 100644 arch/arm/dts/rk3399-nanopi-r4s-4gb-u-boot.dtsi - delete mode 100644 arch/arm/dts/rk3399-nanopi-r4s-4gb.dts - delete mode 100644 configs/nanopi-r4s-4gb-rk3399_defconfig - -diff --git a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi -index eb0aca4758..9369a7022a 100644 ---- a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi -+++ b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi -@@ -4,4 +4,6 @@ - */ - - #include "rk3399-nanopi4-u-boot.dtsi" - #include "rk3399-sdram-lpddr4-100.dtsi" -+#include "rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi" -+#include "rk3399-sdram-ddr3-1866.dtsi" -diff --git a/board/friendlyarm/nanopi4/hwrev.c b/board/friendlyarm/nanopi4/hwrev.c -index 9199a927ee..812fcef9c7 100644 ---- a/board/friendlyarm/nanopi4/hwrev.c -+++ b/board/friendlyarm/nanopi4/hwrev.c -@@ -101,9 +101,13 @@ static uint32_t get_adc_index(int chn) - * Group A: - * 0x04 - NanoPi NEO4 - * 0x06 - SOC-RK3399 -+ * 0x07 - SOC-RK3399 V2 -+ * 0x09 - NanoPi R4S 1GB -+ * 0x0A - NanoPi R4S 4GB - * - * Group B: - * 0x21 - NanoPi M4 Ver2.0 -+ * 0x22 - NanoPi M4B - */ - static int pcb_rev = -1; - -@@ -141,6 +145,38 @@ void bd_hwrev_init(void) - } - } - -+#ifdef CONFIG_SPL_BUILD -+static struct board_ddrtype { -+ int rev; -+ const char *type; -+} ddrtypes[] = { -+ { 0x00, "lpddr3-samsung-4GB-1866" }, -+ { 0x01, "lpddr3-samsung-4GB-1866" }, -+ { 0x04, "ddr3-1866" }, -+ { 0x06, "ddr3-1866" }, -+ { 0x07, "lpddr4-100" }, -+ { 0x09, "ddr3-1866" }, -+ { 0x0a, "lpddr4-100" }, -+ { 0x21, "lpddr4-100" }, -+ { 0x22, "ddr3-1866" }, -+}; -+ -+const char *rk3399_get_ddrtype(void) { -+ int i; -+ -+ bd_hwrev_init(); -+ printf("Board: rev%02x\n", pcb_rev); -+ -+ for (i = 0; i < ARRAY_SIZE(ddrtypes); i++) { -+ if (ddrtypes[i].rev == pcb_rev) -+ return ddrtypes[i].type; -+ } -+ -+ /* fallback to first subnode (ie, first included dtsi) */ -+ return NULL; -+} -+#endif -+ - /* To override __weak symbols */ - u32 get_board_rev(void) - { --- -2.25.1 - diff --git a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-decl.h b/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-decl.h deleted file mode 100644 index 0919e4e..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-decl.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares externs for all device/uclass instances. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include - -/* driver declarations - these allow DM_DRIVER_GET() to be used */ -extern U_BOOT_DRIVER(rockchip_rk3328_cru); -extern U_BOOT_DRIVER(rockchip_rk3328_dmc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(ns16550_serial); -extern U_BOOT_DRIVER(rockchip_rk3328_grf); - -/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -extern UCLASS_DRIVER(clk); -extern UCLASS_DRIVER(mmc); -extern UCLASS_DRIVER(ram); -extern UCLASS_DRIVER(serial); -extern UCLASS_DRIVER(syscon); diff --git a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-plat.c b/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-plat.c deleted file mode 100644 index e5b330c..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-plat.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares the U_BOOT_DRIVER() records and platform data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -/* Allow use of U_BOOT_DRVINFO() in this file */ -#define DT_PLAT_C - -#include -#include -#include - -/* - * driver_info declarations, ordered by 'struct driver_info' linker_list idx: - * - * idx driver_info driver - * --- -------------------- -------------------- - * 0: clock_controller_at_ff440000 rockchip_rk3328_cru - * 1: dmc rockchip_rk3328_dmc - * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc - * 3: serial_at_ff130000 ns16550_serial - * 4: syscon_at_ff100000 rockchip_rk3328_grf - * --- -------------------- -------------------- - */ - -/* - * Node /clock-controller@ff440000 index 0 - * driver rockchip_rk3328_cru parent None - */ -static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { - .reg = {0xff440000, 0x1000}, - .rockchip_grf = 0x3a, -}; -U_BOOT_DRVINFO(clock_controller_at_ff440000) = { - .name = "rockchip_rk3328_cru", - .plat = &dtv_clock_controller_at_ff440000, - .plat_size = sizeof(dtv_clock_controller_at_ff440000), - .parent_idx = -1, -}; - -/* - * Node /dmc index 1 - * driver rockchip_rk3328_dmc parent None - */ -static struct dtd_rockchip_rk3328_dmc dtv_dmc = { - .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, - 0xff720000, 0x1000, 0xff798000, 0x1000}, - .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, - 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, - 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, - 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, - 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, - 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, - 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, - 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, - 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, - 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, - 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, - 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, - 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, - 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, - 0x77, 0x77, 0x79, 0x9}, -}; -U_BOOT_DRVINFO(dmc) = { - .name = "rockchip_rk3328_dmc", - .plat = &dtv_dmc, - .plat_size = sizeof(dtv_dmc), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff500000 index 2 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { - .bus_width = 0x4, - .cap_sd_highspeed = true, - .clocks = { - {0, {317}}, - {0, {33}}, - {0, {74}}, - {0, {78}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xc, 0x4}, - .max_frequency = 0x8f0d180, - .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, - .pinctrl_names = "default", - .reg = {0xff500000, 0x4000}, - .sd_uhs_sdr104 = true, - .sd_uhs_sdr12 = true, - .sd_uhs_sdr25 = true, - .sd_uhs_sdr50 = true, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x4b, - .vqmmc_supply = 0x1e, -}; -U_BOOT_DRVINFO(mmc_at_ff500000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff500000, - .plat_size = sizeof(dtv_mmc_at_ff500000), - .parent_idx = -1, -}; - -/* - * Node /serial@ff130000 index 3 - * driver ns16550_serial parent None - */ -static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { - .clock_frequency = 0x16e3600, - .clocks = { - {0, {40}}, - {0, {212}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x6, 0x10, 0x7}, - .interrupts = {0x0, 0x39, 0x4}, - .pinctrl_0 = 0x26, - .pinctrl_names = "default", - .reg = {0xff130000, 0x100}, - .reg_io_width = 0x4, - .reg_shift = 0x2, -}; -U_BOOT_DRVINFO(serial_at_ff130000) = { - .name = "ns16550_serial", - .plat = &dtv_serial_at_ff130000, - .plat_size = sizeof(dtv_serial_at_ff130000), - .parent_idx = -1, -}; - -/* - * Node /syscon@ff100000 index 4 - * driver rockchip_rk3328_grf parent None - */ -static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { - .reg = {0xff100000, 0x1000}, -}; -U_BOOT_DRVINFO(syscon_at_ff100000) = { - .name = "rockchip_rk3328_grf", - .plat = &dtv_syscon_at_ff100000, - .plat_size = sizeof(dtv_syscon_at_ff100000), - .parent_idx = -1, -}; - diff --git a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-structs-gen.h b/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-structs-gen.h deleted file mode 100644 index b1ff08a..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-structs-gen.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * DO NOT MODIFY - * - * Defines the structs used to hold devicetree data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include -struct dtd_ns16550_serial { - fdt32_t clock_frequency; - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0; - const char * pinctrl_names; - fdt64_t reg[2]; - fdt32_t reg_io_width; - fdt32_t reg_shift; -}; -struct dtd_rockchip_rk3288_dw_mshc { - fdt32_t bus_width; - bool cap_sd_highspeed; - struct phandle_1_arg clocks[4]; - bool disable_wp; - fdt32_t fifo_depth; - fdt32_t interrupts[3]; - fdt32_t max_frequency; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; - bool sd_uhs_sdr104; - bool sd_uhs_sdr12; - bool sd_uhs_sdr25; - bool sd_uhs_sdr50; - bool u_boot_spl_fifo_mode; - fdt32_t vmmc_supply; - fdt32_t vqmmc_supply; -}; -struct dtd_rockchip_rk3328_cru { - fdt64_t reg[2]; - fdt32_t rockchip_grf; -}; -struct dtd_rockchip_rk3328_dmc { - fdt64_t reg[12]; - fdt32_t rockchip_sdram_params[196]; -}; -struct dtd_rockchip_rk3328_grf { - fdt64_t reg[2]; -}; diff --git a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-decl.h b/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-decl.h deleted file mode 100644 index 0919e4e..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-decl.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares externs for all device/uclass instances. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include - -/* driver declarations - these allow DM_DRIVER_GET() to be used */ -extern U_BOOT_DRIVER(rockchip_rk3328_cru); -extern U_BOOT_DRIVER(rockchip_rk3328_dmc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(ns16550_serial); -extern U_BOOT_DRIVER(rockchip_rk3328_grf); - -/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -extern UCLASS_DRIVER(clk); -extern UCLASS_DRIVER(mmc); -extern UCLASS_DRIVER(ram); -extern UCLASS_DRIVER(serial); -extern UCLASS_DRIVER(syscon); diff --git a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-plat.c b/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-plat.c deleted file mode 100644 index e5b330c..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-plat.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares the U_BOOT_DRIVER() records and platform data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -/* Allow use of U_BOOT_DRVINFO() in this file */ -#define DT_PLAT_C - -#include -#include -#include - -/* - * driver_info declarations, ordered by 'struct driver_info' linker_list idx: - * - * idx driver_info driver - * --- -------------------- -------------------- - * 0: clock_controller_at_ff440000 rockchip_rk3328_cru - * 1: dmc rockchip_rk3328_dmc - * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc - * 3: serial_at_ff130000 ns16550_serial - * 4: syscon_at_ff100000 rockchip_rk3328_grf - * --- -------------------- -------------------- - */ - -/* - * Node /clock-controller@ff440000 index 0 - * driver rockchip_rk3328_cru parent None - */ -static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { - .reg = {0xff440000, 0x1000}, - .rockchip_grf = 0x3a, -}; -U_BOOT_DRVINFO(clock_controller_at_ff440000) = { - .name = "rockchip_rk3328_cru", - .plat = &dtv_clock_controller_at_ff440000, - .plat_size = sizeof(dtv_clock_controller_at_ff440000), - .parent_idx = -1, -}; - -/* - * Node /dmc index 1 - * driver rockchip_rk3328_dmc parent None - */ -static struct dtd_rockchip_rk3328_dmc dtv_dmc = { - .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, - 0xff720000, 0x1000, 0xff798000, 0x1000}, - .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, - 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, - 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, - 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, - 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, - 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, - 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, - 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, - 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, - 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, - 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, - 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, - 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, - 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, - 0x77, 0x77, 0x79, 0x9}, -}; -U_BOOT_DRVINFO(dmc) = { - .name = "rockchip_rk3328_dmc", - .plat = &dtv_dmc, - .plat_size = sizeof(dtv_dmc), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff500000 index 2 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { - .bus_width = 0x4, - .cap_sd_highspeed = true, - .clocks = { - {0, {317}}, - {0, {33}}, - {0, {74}}, - {0, {78}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xc, 0x4}, - .max_frequency = 0x8f0d180, - .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, - .pinctrl_names = "default", - .reg = {0xff500000, 0x4000}, - .sd_uhs_sdr104 = true, - .sd_uhs_sdr12 = true, - .sd_uhs_sdr25 = true, - .sd_uhs_sdr50 = true, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x4b, - .vqmmc_supply = 0x1e, -}; -U_BOOT_DRVINFO(mmc_at_ff500000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff500000, - .plat_size = sizeof(dtv_mmc_at_ff500000), - .parent_idx = -1, -}; - -/* - * Node /serial@ff130000 index 3 - * driver ns16550_serial parent None - */ -static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { - .clock_frequency = 0x16e3600, - .clocks = { - {0, {40}}, - {0, {212}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x6, 0x10, 0x7}, - .interrupts = {0x0, 0x39, 0x4}, - .pinctrl_0 = 0x26, - .pinctrl_names = "default", - .reg = {0xff130000, 0x100}, - .reg_io_width = 0x4, - .reg_shift = 0x2, -}; -U_BOOT_DRVINFO(serial_at_ff130000) = { - .name = "ns16550_serial", - .plat = &dtv_serial_at_ff130000, - .plat_size = sizeof(dtv_serial_at_ff130000), - .parent_idx = -1, -}; - -/* - * Node /syscon@ff100000 index 4 - * driver rockchip_rk3328_grf parent None - */ -static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { - .reg = {0xff100000, 0x1000}, -}; -U_BOOT_DRVINFO(syscon_at_ff100000) = { - .name = "rockchip_rk3328_grf", - .plat = &dtv_syscon_at_ff100000, - .plat_size = sizeof(dtv_syscon_at_ff100000), - .parent_idx = -1, -}; - diff --git a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-structs-gen.h b/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-structs-gen.h deleted file mode 100644 index b1ff08a..0000000 --- a/openwrt-21.02/patches/package/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-structs-gen.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * DO NOT MODIFY - * - * Defines the structs used to hold devicetree data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include -struct dtd_ns16550_serial { - fdt32_t clock_frequency; - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0; - const char * pinctrl_names; - fdt64_t reg[2]; - fdt32_t reg_io_width; - fdt32_t reg_shift; -}; -struct dtd_rockchip_rk3288_dw_mshc { - fdt32_t bus_width; - bool cap_sd_highspeed; - struct phandle_1_arg clocks[4]; - bool disable_wp; - fdt32_t fifo_depth; - fdt32_t interrupts[3]; - fdt32_t max_frequency; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; - bool sd_uhs_sdr104; - bool sd_uhs_sdr12; - bool sd_uhs_sdr25; - bool sd_uhs_sdr50; - bool u_boot_spl_fifo_mode; - fdt32_t vmmc_supply; - fdt32_t vqmmc_supply; -}; -struct dtd_rockchip_rk3328_cru { - fdt64_t reg[2]; - fdt32_t rockchip_grf; -}; -struct dtd_rockchip_rk3328_dmc { - fdt64_t reg[12]; - fdt32_t rockchip_sdram_params[196]; -}; -struct dtd_rockchip_rk3328_grf { - fdt64_t reg[2]; -}; diff --git a/openwrt-21.02/patches/package/vpn-policy-routing/Makefile b/openwrt-21.02/patches/package/vpn-policy-routing/Makefile deleted file mode 100644 index b7686bd..0000000 --- a/openwrt-21.02/patches/package/vpn-policy-routing/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2017-2018 Stan Grishin (stangri@melmac.ca) -# This is free software, licensed under the GNU General Public License v3. - -include $(TOPDIR)/rules.mk - -PKG_NAME:=vpn-policy-routing -PKG_VERSION:=0.3.4 -PKG_RELEASE:=8 -PKG_LICENSE:=GPL-3.0-or-later -PKG_MAINTAINER:=Stan Grishin - -include $(INCLUDE_DIR)/package.mk - -define Package/vpn-policy-routing - SECTION:=net - CATEGORY:=Network - TITLE:=VPN Policy-Based Routing Service - URL:=https://docs.openwrt.melmac.net/vpn-policy-routing/ - DEPENDS:=+jshn +ipset +iptables +resolveip +kmod-ipt-ipset +iptables-mod-ipopt +ip-full - PKGARCH:=all -endef - -define Package/vpn-policy-routing/description -This service allows policy-based routing for L2TP, Openconnect, OpenVPN, PPTP and Wireguard tunnels and WAN interface. -Policies can specify domains, local IPs/subnets and ports, as well as remote IPs/subnets and ports. -endef - -define Package/vpn-policy-routing/conffiles -/etc/config/vpn-policy-routing -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/vpn-policy-routing/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DIR) $(1)/etc/hotplug.d/firewall - $(INSTALL_DIR) $(1)/etc/ - $(INSTALL_BIN) ./files/vpn-policy-routing.init $(1)/etc/init.d/vpn-policy-routing - $(SED) "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/etc/init.d/vpn-policy-routing - $(INSTALL_CONF) ./files/vpn-policy-routing.config $(1)/etc/config/vpn-policy-routing - $(INSTALL_DATA) ./files/vpn-policy-routing.firewall.hotplug $(1)/etc/hotplug.d/firewall/70-vpn-policy-routing - $(INSTALL_DATA) ./files/vpn-policy-routing.aws.user $(1)/etc/vpn-policy-routing.aws.user - $(INSTALL_DATA) ./files/vpn-policy-routing.netflix.user $(1)/etc/vpn-policy-routing.netflix.user -endef - -define Package/vpn-policy-routing/postinst - #!/bin/sh - # check if we are on real system - if [ -z "$${IPKG_INSTROOT}" ]; then - /etc/init.d/vpn-policy-routing enable - fi - exit 0 -endef - -define Package/vpn-policy-routing/prerm - #!/bin/sh - # check if we are on real system - if [ -z "$${IPKG_INSTROOT}" ]; then - echo "Stopping service and removing rc.d symlink for vpn-policy-routing" - /etc/init.d/vpn-policy-routing stop || true - /etc/init.d/vpn-policy-routing disable || true - fi - exit 0 -endef - -$(eval $(call BuildPackage,vpn-policy-routing)) diff --git a/openwrt-21.02/patches/package/vpn-policy-routing/files/README.md b/openwrt-21.02/patches/package/vpn-policy-routing/files/README.md deleted file mode 100644 index 98d7efc..0000000 --- a/openwrt-21.02/patches/package/vpn-policy-routing/files/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# README - -README has been moved to [https://docs.openwrt.melmac.net/vpn-policy-routing/](https://docs.openwrt.melmac.net/vpn-policy-routing/). diff --git a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.aws.user b/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.aws.user deleted file mode 100644 index a00770b..0000000 --- a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.aws.user +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# This file is heavily based on code from https://github.com/Xentrk/netflix-vpn-bypass/blob/master/IPSET_Netflix.sh - -TARGET_IPSET='wan' - -TARGET_URL="https://ip-ranges.amazonaws.com/ip-ranges.json" -TARGET_FNAME="/var/vpn-policy-routing_tmp_aws_ip_ranges" - -_ret=1 - -if [ ! -s "$TARGET_FNAME" ]; then - curl "$TARGET_URL" 2>/dev/null | grep "ip_prefix" | sed 's/^.*\"ip_prefix\": \"//; s/\",//' > "$TARGET_FNAME" -fi -if [ -s "$TARGET_FNAME" ]; then - awk -v ipset="$TARGET_IPSET" '{print "add " ipset " " $1}' "$TARGET_FNAME" | ipset restore -! && _ret=0 -fi -rm -f "$TARGET_FNAME" - -return $_ret diff --git a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.config b/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.config deleted file mode 100644 index ed6f01c..0000000 --- a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.config +++ /dev/null @@ -1,30 +0,0 @@ -config vpn-policy-routing 'config' - option enabled '0' - option verbosity '2' - option strict_enforcement '1' - option src_ipset '0' - option dest_ipset '0' - option resolver_ipset 'dnsmasq.ipset' - option ipv6_enabled '0' - list ignored_interface 'vpnserver wgserver' - option boot_timeout '30' - option iptables_rule_option 'append' - option procd_reload_delay '1' - option webui_enable_column '0' - option webui_protocol_column '0' - option webui_chain_column '0' - option webui_show_ignore_target '0' - option webui_sorting '1' - list webui_supported_protocol 'tcp' - list webui_supported_protocol 'udp' - list webui_supported_protocol 'tcp udp' - list webui_supported_protocol 'icmp' - list webui_supported_protocol 'all' - -config include - option path '/etc/vpn-policy-routing.netflix.user' - option enabled 0 - -config include - option path '/etc/vpn-policy-routing.aws.user' - option enabled 0 diff --git a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.firewall.hotplug b/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.firewall.hotplug deleted file mode 100755 index 3932b2b..0000000 --- a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.firewall.hotplug +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -[ "$ACTION" = "reload" ] || exit 0 - -logger -t "vpn-policy-routing" "Reloading vpn-policy-routing due to $ACTION of firewall" -/etc/init.d/vpn-policy-routing reload diff --git a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.init b/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.init deleted file mode 100755 index 29e941b..0000000 --- a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.init +++ /dev/null @@ -1,1322 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright 2017-2020 Stan Grishin (stangri@melmac.ca) -# shellcheck disable=SC2039,SC1091,SC2018,SC2019,SC3043,SC3057,SC3060 -PKG_VERSION='dev-test' - -# sysctl net.ipv4.conf.default.rp_filter=1 -# sysctl net.ipv4.conf.all.rp_filter=1 - -# shellcheck disable=SC2034 -START=94 -# shellcheck disable=SC2034 -USE_PROCD=1 - -if type extra_command 1>/dev/null 2>&1; then - extra_command 'support' "Generates output required to troubleshoot routing issues - Use '-d' option for more detailed output - Use '-p' option to automatically upload data under VPR paste.ee account - WARNING: while paste.ee uploads are unlisted, they are still publicly available - List domain names after options to include their lookup in report" - extra_command 'version' 'Show version information' - extra_command 'reload_interface' 'Reload specific interface only' -else -# shellcheck disable=SC2034 - EXTRA_COMMANDS='support version' -# shellcheck disable=SC2034 - EXTRA_HELP=" support Generates output required to troubleshoot routing issues - Use '-d' option for more detailed output - Use '-p' option to automatically upload data under VPR paste.ee account - WARNING: while paste.ee uploads are unlisted, they are still publicly available - List domain names after options to include their lookup in report" -fi - -readonly packageName='vpn-policy-routing' -readonly serviceName="$packageName $PKG_VERSION" -readonly PIDFile="/var/run/${packageName}.pid" -readonly jsonFile="/var/run/${packageName}.json" -readonly dnsmasqFile="/var/dnsmasq.d/${packageName}" -readonly sharedMemoryOutput="/dev/shm/$packageName-output" -readonly _OK_='\033[0;32m\xe2\x9c\x93\033[0m' -readonly _FAIL_='\033[0;31m\xe2\x9c\x97\033[0m' -readonly __OK__='\033[0;32m[\xe2\x9c\x93]\033[0m' -readonly __FAIL__='\033[0;31m[\xe2\x9c\x97]\033[0m' -readonly _ERROR_='\033[0;31mERROR\033[0m' -readonly _WARNING_='\033[0;33mWARNING\033[0m' - -gatewaySummary=''; errorSummary=''; warningSummary=''; -serviceEnabled=''; verbosity=''; strictMode=''; -wanTableID=''; wanMark=''; fwMask=''; -ipv6Enabled=''; srcIpset=''; destIpset=''; resolverIpset=''; -wanIface4=''; wanIface6=''; ifaceMark=''; ifaceTableID=''; -ifAll=''; ifSupported=''; ignoredIfaces=''; supportedIfaces=''; icmpIface=''; -wanGW4=''; wanGW6=''; bootTimeout=''; insertOption=''; -webuiChainColumn=''; webuiShowIgnore=''; dnsmasqIpsetSupported=''; -procdReloadDelay=''; -usedChainsList='PREROUTING' -ipsetSupported='true' -configLoaded='false' - -version() { echo "$PKG_VERSION"; } -output_ok() { output 1 "$_OK_"; output 2 "$__OK__\\n"; } -output_okn() { output 1 "$_OK_\\n"; output 2 "$__OK__\\n"; } -output_fail() { s=1; output 1 "$_FAIL_"; output 2 "$__FAIL__\\n"; } -output_failn() { output 1 "$_FAIL_\\n"; output 2 "$__FAIL__\\n"; } -str_replace() { printf "%b" "$1" | sed -e "s/$(printf "%b" "$2")/$(printf "%b" "$3")/g"; } -str_replace() { echo "${1//$2/$3}"; } -str_contains() { [ -n "$2" ] && [ "${1//$2}" != "$1" ]; } -str_contains_word() { echo "$1" | grep -q -w "$2"; } -str_to_lower() { echo "$1" | tr 'A-Z' 'a-z'; } -str_extras_to_underscore() { echo "$1" | tr '[\. ~`!@#$%^&*()\+/,<>?//;:]' '_'; } -str_extras_to_space() { echo "$1" | tr ';{}' ' '; } - -output() { -# Can take a single parameter (text) to be output at any verbosity -# Or target verbosity level and text to be output at specifc verbosity - local msg memmsg logmsg - if [ $# -ne 1 ]; then - if [ $((verbosity & $1)) -gt 0 ] || [ "$verbosity" = "$1" ]; then shift; else return 0; fi - fi - [ -t 1 ] && printf "%b" "$1" - msg="${1//$serviceName /service }"; - if [ "$(printf "%b" "$msg" | wc -l)" -gt 0 ]; then - [ -s "$sharedMemoryOutput" ] && memmsg="$(cat "$sharedMemoryOutput")" - logmsg="$(printf "%b" "${memmsg}${msg}" | sed 's/\x1b\[[0-9;]*m//g')" - logger -t "${packageName:-service} [$$]" "$(printf "%b" "$logmsg")" - rm -f "$sharedMemoryOutput" - else - printf "%b" "$msg" >> "$sharedMemoryOutput" - fi -} -is_present() { command -v "$1" >/dev/null 2>&1; } -is_installed() { [ -s "/usr/lib/opkg/info/${1}.control" ]; } -is_variant_installed() { [ "$(echo /usr/lib/opkg/info/"${1}"*.control)" != "/usr/lib/opkg/info/${1}*.control" ]; } - -build_ifAll() { ifAll="${ifAll}${1} "; } -build_ifSupported() { is_supported_interface "$1" && ifSupported="${ifSupported}${1} "; } -vpr_find_iface() { - local iface i param="$2" - [ "$param" = 'wan6' ] || param='wan' - "network_find_${param}" iface - is_tunnel "$iface" && unset iface - if [ -z "$iface" ]; then - for i in $ifAll; do - if "is_${param}" "$i"; then break; else unset i; fi - done - fi - eval "$1"='${iface:-$i}' -} -vpr_get_gateway() { - local iface="$2" dev="$3" gw - network_get_gateway gw "$iface" - if [ -z "$gw" ] || [ "$gw" = '0.0.0.0' ]; then - gw="$(ip -4 a list dev "$dev" 2>/dev/null | grep inet | awk '{print $2}' | awk -F "/" '{print $1}')" - fi - eval "$1"='$gw' -} -vpr_get_gateway6() { - local iface="$2" dev="$3" gw - network_get_gateway6 gw "$iface" - if [ -z "$gw" ] || [ "$gw" = '::/0' ] || [ "$gw" = '::0/0' ] || [ "$gw" = '::' ]; then - gw="$(ip -6 a list dev "$dev" 2>/dev/null | grep inet6 | awk '{print $2}')" - fi - eval "$1"='$gw' -} -is_l2tp() { local proto; proto=$(uci -q get network."$1".proto); [ "${proto:0:4}" = "l2tp" ]; } -is_oc() { local proto; proto=$(uci -q get network."$1".proto); [ "${proto:0:11}" = "openconnect" ]; } -is_ovpn() { local dev i; for i in ifname device; do [ -z "$dev" ] && dev="$(uci -q get "network.${1}.${i}")"; done; [ "${dev:0:3}" = "tun" ] || [ "${dev:0:3}" = "tap" ] || [ -f "/sys/devices/virtual/net/${dev}/tun_flags" ]; } -is_pptp() { local proto; proto=$(uci -q get network."$1".proto); [ "${proto:0:4}" = "pptp" ]; } -is_tor() { [ "$(str_to_lower "$1")" = "tor" ]; } -is_tor_running() { - local ret=0 - if [ -s "/etc/tor/torrc" ]; then - json_load "$(ubus call service list "{ 'name': 'tor' }")" - json_select 'tor'; json_select 'instances'; json_select 'instance1'; - json_get_var ret 'running'; json_cleanup - fi - if [ "$ret" = "0" ]; then return 1; else return 0; fi -} -is_wg() { local proto; proto=$(uci -q get network."$1".proto); [ "${proto:0:9}" = "wireguard" ]; } -is_tunnel() { is_l2tp "$1" || is_oc "$1" || is_ovpn "$1" || is_pptp "$1" || is_tor "$1" || is_wg "$1"; } -is_wan() { [ "$1" = "$wanIface4" ] || { [ "${1##wan}" != "$1" ] && [ "${1##wan6}" = "$1" ]; } || [ "${1%%wan}" != "$1" ]; } -is_wan6() { [ -n "$wanIface6" ] && [ "$1" = "$wanIface6" ] || [ "${1/#wan6}" != "$1" ] || [ "${1/%wan6}" != "$1" ]; } -is_ignored_interface() { str_contains_word "$ignoredIfaces" "$1"; } -is_supported_interface() { str_contains_word "$supportedIfaces" "$1" || { ! is_ignored_interface "$1" && { is_wan "$1" || is_wan6 "$1" || is_tunnel "$1"; }; }; } -is_mac_address() { expr "$1" : '[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]$' >/dev/null; } -is_ipv4() { expr "$1" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; } -is_ipv6() { ! is_mac_address "$1" && str_contains "$1" ":"; } -is_family_mismatch() { ( is_netmask "${1//!}" && is_ipv6 "${2//!}" ) || ( is_ipv6 "${1//!}" && is_netmask "${2//!}" ); } -is_ipv6_link_local() { [ "${1:0:4}" = "fe80" ]; } -is_ipv6_unique_local() { [ "${1:0:2}" = "fc" ] || [ "${1:0:2}" = "fd" ]; } -is_ipv6_global() { [ "${1:0:4}" = "2001" ]; } -# is_ipv6_global() { is_ipv6 "$1" && ! is_ipv6_link_local "$1" && ! is_ipv6_link_local "$1"; } -is_netmask() { local ip="${1%/*}"; [ "$ip" != "$1" ] && is_ipv4 "$ip"; } -is_domain() { str_contains "$1" '[a-zA-Z]'; } -is_phys_dev() { [ "${1:0:1}" = "@" ] && ip l show | grep -E -q "^\\d+\\W+${1:1}"; } -is_turris() { /bin/ubus -S call system board | /bin/grep 'Turris' | /bin/grep -q '15.05'; } -is_chaos_calmer() { ubus -S call system board | grep -q 'Chaos Calmer'; } -dnsmasq_kill() { killall -q -s HUP dnsmasq; } -dnsmasq_restart() { output 3 'Restarting DNSMASQ '; if /etc/init.d/dnsmasq restart >/dev/null 2>&1; then output_okn; else output_failn; fi; } -is_default_dev() { [ "$1" = "$(ip -4 r | grep -m1 'dev' | grep -Eso 'dev [^ ]*' | awk '{print $2}')" ]; } -is_supported_iface_dev() { - for n in $ifSupported; do - if [ "$1" = "$(uci -q get "network.${n}.ifname" || echo "$n")" ] || \ - [ "$1" = "$(uci -q get "network.${n}.device" || echo "$n")" ] || \ - [ "$1" = "$(uci -q get "network.${n}.proto")-${n}" ] ; then return 0; fi - done - return 1 -} -is_supported_protocol () { grep -o '^[^#]*' /etc/protocols | grep -w -v '0' | grep . | awk '{print $1}' | grep -q "$1"; } -append_chains_targets() { - local chain iface name - config_get name "$1" 'name' 'blank' - config_get chain "$1" 'chain' 'PREROUTING' - config_get iface "$1" 'interface' - if ! str_contains_word "$usedChainsList" "$chain"; then - usedChainsList="$usedChainsList $chain" - if [ "$chain" != 'PREROUTING' ] && [ "$webuiChainColumn" != '1' ]; then - warningSummary="${warningSummary}$_WARNING_: Chain '$chain' is used by a policy '$name', but a WebUI setting to show chains column (webui_chain_column) is disabled!\\n" - fi - fi - if [ "$iface" = 'ignore' ] && ! str_contains_word "$supportedIfaces" 'ignore'; then - supportedIfaces="$supportedIfaces ignore" - if [ "$webuiShowIgnore" != '1' ]; then - warningSummary="${warningSummary}$_WARNING_: The 'ignore' target is used by a policy '$name', but a WebUI setting to show 'ignore' target (webui_show_ignore_target) is disabled!\\n" - fi - fi -} - -load_package_config() { - [ "$configLoaded" = 'false' ] || return 0 - - config_load "$packageName" - config_get_bool serviceEnabled 'config' 'enabled' 0 - config_get_bool strictMode 'config' 'strict_enforcement' 1 - config_get_bool ipv6Enabled 'config' 'ipv6_enabled' 0 - config_get_bool srcIpset 'config' 'src_ipset' 0 - config_get_bool destIpset 'config' 'dest_ipset' 0 - config_get resolverIpset 'config' 'resolver_ipset' 'dnsmasq.ipset' - config_get verbosity 'config' 'verbosity' '2' - config_get wanTableID 'config' 'wan_tid' '201' - config_get wanMark 'config' 'wan_mark' '0x010000' - config_get fwMask 'config' 'fw_mask' '0xff0000' - config_get icmpIface 'config' 'icmp_interface' - config_get ignoredIfaces 'config' 'ignored_interface' - config_get supportedIfaces 'config' 'supported_interface' - config_get bootTimeout 'config' 'boot_timeout' '30' - config_get insertOption 'config' 'iptables_rule_option' 'append' - config_get procdReloadDelay 'config' 'procd_reload_delay' '0' - config_get_bool webuiChainColumn 'config' 'webui_chain_column' '0' - config_get_bool webuiShowIgnore 'config' 'webui_show_ignore_target' '0' - config_foreach append_chains_targets 'policy' - - if [ -z "${verbosity##*[!0-9]*}" ] || [ "$verbosity" -lt 0 ] || [ "$verbosity" -gt 2 ]; then - verbosity=2 - fi - - . /lib/functions/network.sh - . /usr/share/libubox/jshn.sh - mkdir -p "${PIDFile%/*}" - mkdir -p "${jsonFile%/*}" - mkdir -p "${dnsmasqFile%/*}" - - if [ -n "$icmpIface" ] && ! str_contains_word "$usedChainsList" 'OUTPUT'; then - usedChainsList="$usedChainsList OUTPUT" - fi - - case $insertOption in - insert|-i|-I) insertOption='-I';; - append|-a|-A|*) insertOption='-A';; - esac - - [ "$resolverIpset" = 'dnsmasq.ipset' ] && dnsmasqIpsetSupported='true' - if dnsmasq -v 2>/dev/null | grep -q 'no-ipset' || ! dnsmasq -v 2>/dev/null | grep -q -w 'ipset'; then - unset dnsmasqIpsetSupported - if [ -n "$dnsmasqIpsetSupported" ]; then - errorSummary="${errorSummary}${_ERROR_}: Resolver ipset support (dnsmasq.ipset) is enabled in $packageName, but DNSMASQ ipsets are not supported on this system!\\n" - fi - fi - if ! ipset help hash:net >/dev/null 2>&1; then - unset ipsetSupported - if [ -n "$dnsmasqIpsetSupported" ]; then - errorSummary="${errorSummary}${_ERROR_}: DNSMASQ ipsets are supported, but ipset is either not installed or installed ipset does not support 'hash:net' type!\\n" - unset dnsmasqIpsetSupported - fi - if [ "$destIpset" -ne 0 ]; then - errorSummary="${errorSummary}${_ERROR_}: Destination ipset support is enabled in $packageName, but ipset is either not installed or installed ipset does not support 'hash:net' type!\\n" - destIpset=0 - fi - if [ "$srcIpset" -ne 0 ]; then - errorSummary="${errorSummary}${_ERROR_}: Source ipset support is enabled in $packageName, but ipset is either not installed or installed ipset does not support 'hash:net' type!\\n" - srcIpset=0 - fi - fi - if ! ipset help hash:mac >/dev/null 2>&1; then - if [ "$srcIpset" -ne 0 ]; then - errorSummary="${errorSummary}${_ERROR_}: Source ipset support is enabled in $packageName, but ipset is either not installed or installed ipset does not support 'hash:mac' type!\\n" - srcIpset=0 - fi - fi - - configLoaded='true' -} - -is_enabled() { - load_package_config - if [ "$serviceEnabled" -eq 0 ]; then - if [ "$1" = 'on_start' ]; then - errorSummary="${errorSummary}${_ERROR_}: ${packageName} is currently disabled.\\n" - errorSummary="${errorSummary}Enable ${packageName} from WebUI or run the following commands:\\n" - errorSummary="${errorSummary}uci set $packageName.config.enabled='1'; uci commit $packageName;\\n" - fi - return 1 - fi -} - -load_network() { - if [ -z "$ifAll" ]; then - config_load 'network' - config_foreach build_ifAll 'interface' - fi - vpr_find_iface wanIface4 'wan' - [ "$ipv6Enabled" -ne 0 ] && vpr_find_iface wanIface6 'wan6' - [ -n "$wanIface4" ] && network_get_gateway wanGW4 "$wanIface4" - [ -n "$wanIface6" ] && network_get_gateway6 wanGW6 "$wanIface6" - wanGW="${wanGW4:-$wanGW6}" - unset ifSupported - config_load 'network' - config_foreach build_ifSupported 'interface' -} - -is_wan_up() { - local sleepCount=1 - load_network - while [ -z "$wanGW" ] ; do - load_network - if [ $((sleepCount)) -gt $((bootTimeout)) ] || [ -n "$wanGW" ]; then break; fi - output "$serviceName waiting for wan gateway...\\n" - sleep 1 - network_flush_cache - sleepCount=$((sleepCount+1)) - done - if [ -n "$wanGW" ]; then - return 0 - else - errorSummary="${errorSummary}${_ERROR_}: ${serviceName} failed to discover WAN gateway!\\n" - return 1 - fi -} - -ipt_cleanup() { - local i - for i in PREROUTING FORWARD INPUT OUTPUT; do - while iptables -t mangle -D $i -m mark --mark 0x0/0xff0000 -j VPR_${i} >/dev/null 2>&1; do : ; done - done - for i in PREROUTING FORWARD INPUT OUTPUT; do - while iptables -t mangle -D $i -j VPR_${i} >/dev/null 2>&1; do : ; done - done -} - -# shellcheck disable=SC2086 -ipt() { - local d failFlagIpv4=1 failFlagIpv6=1 - for d in "${*//-A/-D}" "${*//-I/-D}" "${*//-N/-F}" "${*//-N/-X}"; do - [ "$d" != "$*" ] && { iptables $d >/dev/null 2>&1; ip6tables $d >/dev/null 2>&1; } - done - - d="$*"; iptables $d >/dev/null 2>&1 && failFlagIpv4=0; - if [ "$ipv6Enabled" -gt 0 ]; then ip6tables $d >/dev/null 2>&1 && failFlagIpv6=0; fi - - [ "$failFlagIpv4" -eq 0 ] || [ "$failFlagIpv6" -eq 0 ] -} - -# shellcheck disable=SC2086 -ips() { - local command="$1" ipset="${2//-/_}" param="$3" comment="$4" appendix failFlag=0 - if str_contains "$ipset" '_ip'; then - ipset="${ipset//_ip}"; appendix='_ip'; - elif str_contains "$ipset" '_mac'; then - ipset="${ipset//_mac}"; appendix='_mac'; - fi - - case "$command" in - add_dnsmasq) - [ "$resolverIpset" = "dnsmasq.ipset" ] || return 1 - if [ -z "$dnsmasqIpsetSupported" ]; then - warningSummary="${warningSummary}${_WARNING_}: The 'resolver_ipset' is set to 'dnsmasq.ipset', but DNSMASQ ipsets are not supported on this system!\\n" - failFlag=1 - elif [ "$ipv6Enabled" -ne 0 ]; then - echo "ipset=/${param}/${ipset},${ipset}6 # $comment" >> "$dnsmasqFile" || failFlag=1 - else - echo "ipset=/${param}/${ipset} # $comment" >> "$dnsmasqFile" || failFlag=1 - fi - ;; - add) - if [ -z "$appendix" ] && [ "$destIpset" -eq 0 ]; then return 1; fi - if [ -n "$appendix" ] && [ "$srcIpset" -eq 0 ]; then return 1; fi - if [ "$ipv6Enabled" -ne 0 ] && [ "$appendix" != "_mac" ]; then - ipset -q -! $command "${ipset}6${appendix}" $param comment "$comment" || failFlag=1 - fi - ipset -q -! $command "${ipset}${appendix}" $param comment "$comment" || failFlag=1 - ;; - create) - if [ "$ipv6Enabled" -ne 0 ] && [ "$appendix" != "_mac" ]; then - ipset -q -! "$command" "${ipset}6${appendix}" $param family inet6 || failFlag=1 - fi - ipset -q -! "$command" "${ipset}${appendix}" $param || failFlag=1 - ;; - destroy|flush) - ipset -q -! "$command" "${ipset}6${appendix}" 2>/dev/null || failFlag=1 - ipset -q -! "$command" "${ipset}${appendix}" 2>/dev/null || failFlag=1 - return 0 - ;; - esac - return $failFlag -} - -insert_tor_policy() { - local comment="$1" iface="$2" laddr="$3" lport="$4" raddr="$5" rport="$6" proto chain - proto="$(str_to_lower "$7")" - chain="${8:-PREROUTING}" - if [ -n "${laddr}${lport}${rport}" ]; then - processPolicyWarning="${processPolicyWarning}${_WARNING_}: Please unset 'src_addr', 'src_port' and 'dest_port' for policy '$comment'\\n" - fi - if [ -n "$proto" ] && [ "$proto" != "all" ]; then - processPolicyWarning="${processPolicyWarning}${_WARNING_}: Please unset 'proto' or set 'proto' to 'all' for policy '$comment'\\n" - fi - if [ "$chain" != "PREROUTING" ]; then - processPolicyWarning="${processPolicyWarning}${_WARNING_}: Please unset 'chain' or set 'chain' to 'PREROUTING' for policy '$comment'\\n" - fi - ips 'add' "${iface}" "$raddr" "${comment}: $raddr" || processPolicyError="${processPolicyError}${_ERROR_}: ipset 'add' $iface $raddr\\n" - return 0 -} - -insert_policy() { - local comment="$1" iface="$2" laddr="$3" lport="$4" raddr="$5" rport="$6" proto chain - local mark param i valueNeg value dest ipInsertOption="-A" - proto="$(str_to_lower "$7")" - chain="${8:-PREROUTING}" - mark=$(eval echo "\$mark_${iface//-/_}") - if [ "$ipv6Enabled" -eq 0 ] && ( is_ipv6 "$laddr" || is_ipv6 "$raddr" ); then - processPolicyError="${processPolicyError}${_ERROR_}: Skipping IPv6 policy '$comment' as IPv6 support is disabled\\n" - return 1 - fi - - if [ -n "$mark" ]; then - dest="-g VPR_MARK${mark}" - elif [ "$iface" = "ignore" ]; then - dest="-j RETURN" - else - processPolicyError="${processPolicyError}${_ERROR_}: Unknown fw_mark for ${iface}\\n" - return 0 - fi - - if [ -z "$proto" ]; then - if [ -n "$lport" ] || [ -n "$rport" ]; then - proto='tcp udp' - else - proto='all' - fi - fi - - if is_family_mismatch "$laddr" "$raddr"; then - processPolicyError="${processPolicyError}${_ERROR_}: Mismatched IP family between '$laddr' and '$raddr' in policy '$comment'\\n" - return 0 - fi - - for i in $proto; do - if [ "$i" = 'all' ]; then - param="-t mangle ${ipInsertOption} VPR_${chain} $dest" - elif ! is_supported_protocol "$i"; then - processPolicyError="${processPolicyError}${_ERROR_}: Unknown protocol '$i' in policy '$comment'\\n" - return 0 - else - param="-t mangle ${ipInsertOption} VPR_${chain} $dest -p $i" - fi - - if [ -n "$laddr" ]; then - if [ "${laddr:0:1}" = "!" ]; then - valueNeg='!'; value="${laddr:1}" - else - unset valueNeg; value="$laddr"; - fi - if is_phys_dev "$value"; then - param="$param $valueNeg -m physdev --physdev-in ${value:1}" - elif is_mac_address "$value"; then - param="$param -m mac $valueNeg --mac-source $value" - else - param="$param $valueNeg -s $value" - fi - fi - - if [ -n "$lport" ]; then - if [ "${lport:0:1}" = "!" ]; then - valueNeg='!'; value="${lport:1}" - else - unset valueNeg; value="$lport"; - fi - param="$param -m multiport $valueNeg --sport ${value//-/:}" - fi - - if [ -n "$raddr" ]; then - if [ "${raddr:0:1}" = "!" ]; then - valueNeg='!'; value="${raddr:1}" - else - unset valueNeg; value="$raddr"; - fi - param="$param $valueNeg -d $value" - fi - - if [ -n "$rport" ]; then - if [ "${rport:0:1}" = "!" ]; then - valueNeg='!'; value="${rport:1}" - else - unset valueNeg; value="$rport"; - fi - param="$param -m multiport $valueNeg --dport ${value//-/:}" - fi - - [ -n "$comment" ] && param="$param -m comment --comment $(str_extras_to_underscore "$comment")" - ipt "$param" || processPolicyError="${processPolicyError}${_ERROR_}: iptables $param\\n" - done - return 0 -} - -r_process_policy(){ - local comment="$1" iface="$2" laddr="$3" lport="$4" raddr="$5" rport="$6" proto="$7" chain="$8" resolved_laddr resolved_raddr i ipsFailFlag - if str_contains "$laddr" '[ ;\{\}]'; then - for i in $(str_extras_to_space "$laddr"); do [ -n "$i" ] && r_process_policy "$comment" "$iface" "$i" "$lport" "$raddr" "$rport" "$proto" "$chain"; done - return 0 - elif str_contains "$lport" '[ ;\{\}]'; then - for i in $(str_extras_to_space "$lport"); do [ -n "$i" ] && r_process_policy "$comment" "$iface" "$laddr" "$i" "$raddr" "$rport" "$proto" "$chain"; done - return 0 - elif str_contains "$raddr" '[ ;\{\}]'; then - for i in $(str_extras_to_space "$raddr"); do [ -n "$i" ] && r_process_policy "$comment" "$iface" "$laddr" "$lport" "$i" "$rport" "$proto" "$chain"; done - return 0 - elif str_contains "$rport" '[ ;\{\}]'; then - for i in $(str_extras_to_space "$rport"); do [ -n "$i" ] && r_process_policy "$comment" "$iface" "$laddr" "$lport" "$raddr" "$i" "$proto" "$chain"; done - return 0 - fi - - # start non-recursive processing - # process TOR, netmask, physical device and mac-address separately, so we don't send them to resolveip - if is_tor "$iface"; then - insert_tor_policy "$comment" "$iface" "$laddr" "$lport" "$raddr" "$rport" "$proto" "$chain" - elif is_phys_dev "$laddr"; then - insert_policy "$comment" "$iface" "$laddr" "$lport" "$raddr" "$rport" "$proto" "$chain" - elif [ -n "$laddr" ] && [ -z "${lport}${raddr}${rport}" ] && [ "$chain" = 'PREROUTING' ]; then - if is_mac_address "$laddr"; then - if [ -n "$proto" ] && [ "$proto" != 'all' ] && [ "$srcIpset" -ne 0 ]; then - processPolicyWarning="${processPolicyWarning}${_WARNING_}: Please unset 'proto' or set 'proto' to 'all' for policy: '$comment', mac-address: '$laddr'\\n" - fi - ips 'add' "${iface}_mac" "$laddr" "${comment}: $laddr" || ipsFailFlag=1 - else - if [ -n "$proto" ] && [ "$proto" != "all" ] && [ "$srcIpset" -ne 0 ]; then - processPolicyWarning="${processPolicyWarning}${_WARNING_}: Please unset 'proto' or set 'proto' to 'all' for policy: '$comment', source: '$laddr'\\n" - fi - ips 'add' "${iface}_ip" "$laddr" "${comment}: $laddr" || ipsFailFlag=1 - fi - elif [ -n "$raddr" ] && [ -z "${laddr}${lport}${rport}" ] && [ "$chain" = 'PREROUTING' ]; then - if [ -n "$proto" ] && [ "$proto" != 'all' ]; then - processPolicyWarning="${processPolicyWarning}${_WARNING_}: Please unset 'proto' or set 'proto' to 'all' for policy: '$comment', destination: '$raddr'\\n" - fi - if is_domain "$raddr"; then - ips 'add_dnsmasq' "${iface}" "$raddr" "${comment}" || ipsFailFlag=1 - else - ips 'add' "${iface}" "$raddr" "${comment}: $raddr" || ipsFailFlag=1 - fi - else - ipsFailFlag=1 - fi - [ -n "$ipsFailFlag" ] || return 0; - if is_mac_address "$laddr"; then - insert_policy "$comment" "$iface" "$laddr" "$lport" "$raddr" "$rport" "$proto" "$chain" - elif is_netmask "$laddr" || is_netmask "$raddr"; then - insert_policy "$comment" "$iface" "$laddr" "$lport" "$raddr" "$rport" "$proto" "$chain" - else - [ -n "$laddr" ] && resolved_laddr="$(resolveip "$laddr")" - [ -n "$raddr" ] && resolved_raddr="$(resolveip "$raddr")" - if [ -n "$resolved_laddr" ] && [ "$resolved_laddr" != "$laddr" ]; then - for i in $resolved_laddr; do [ -n "$i" ] && r_process_policy "$comment $laddr" "$iface" "$i" "$lport" "$raddr" "$rport" "$proto" "$chain"; done - elif [ -n "$resolved_raddr" ] && [ "$resolved_raddr" != "$raddr" ]; then - for i in $resolved_raddr; do [ -n "$i" ] && r_process_policy "$comment $raddr" "$iface" "$laddr" "$lport" "$i" "$rport" "$proto" "$chain"; done - else - insert_policy "$comment" "$iface" "$laddr" "$lport" "$raddr" "$rport" "$proto" "$chain" - fi - fi -} - -process_policy(){ - local name comment iface laddr lport raddr rport param mark processPolicyError processPolicyWarning proto chain enabled - config_get comment "$1" 'comment' - config_get name "$1" 'name' 'blank' - config_get iface "$1" 'interface' - config_get laddr "$1" 'src_addr' - config_get lport "$1" 'src_port' - config_get raddr "$1" 'dest_addr' - config_get rport "$1" 'dest_port' - config_get proto "$1" 'proto' - config_get chain "$1" 'chain' 'PREROUTING' - config_get_bool enabled "$1" 'enabled' 1 - - [ "$enabled" -gt 0 ] || return 0 - proto="$(str_to_lower "$proto")" - [ "$proto" = 'auto' ] && unset proto - - comment="${comment:-$name}" - output 2 "Routing '$comment' via $iface " - - if [ -z "$comment" ]; then - errorSummary="${errorSummary}${_ERROR_}: Policy name is empty\\n" - output_fail; return 1; - fi - if [ -z "${laddr}${lport}${raddr}${rport}" ]; then - errorSummary="${errorSummary}${_ERROR_}: Policy '$comment' missing all IPs/ports\\n" - output_fail; return 1; - fi - if [ -z "$iface" ]; then - errorSummary="${errorSummary}${_ERROR_}: Policy '$comment' has no assigned interface\\n" - output_fail; return 1; - fi - if ! is_supported_interface "$iface"; then - errorSummary="${errorSummary}${_ERROR_}: Policy '$comment' has unknown interface: '${iface}'\\n" - output_fail; return 1; - fi - - lport="${lport// / }"; lport="${lport// /,}"; lport="${lport//,\!/ !}"; - rport="${rport// / }"; rport="${rport// /,}"; rport="${rport//,\!/ !}"; - r_process_policy "$comment" "$iface" "$laddr" "$lport" "$raddr" "$rport" "$proto" "$chain" - if [ -n "$processPolicyWarning" ]; then - warningSummary="${warningSummary}${processPolicyWarning}\\n" - fi - if [ -n "$processPolicyError" ]; then - output_fail - errorSummary="${errorSummary}${processPolicyError}\\n" - else - output_ok - fi -} - -table_destroy(){ - local tid="$1" iface="$2" mark="$3" - if [ -n "$tid" ] && [ -n "$iface" ] && [ -n "$mark" ]; then - ipt -t mangle -F "VPR_MARK${mark}" - ipt -t mangle -X "VPR_MARK${mark}" - ip -4 rule del fwmark "$mark" table "$tid" >/dev/null 2>&1 - ip -6 rule del fwmark "$mark" table "$tid" >/dev/null 2>&1 - ip -4 rule del table "$tid" >/dev/null 2>&1 - ip -6 rule del table "$tid" >/dev/null 2>&1 - ip -4 route flush table "$tid" >/dev/null 2>&1 - ip -6 route flush table "$tid" >/dev/null 2>&1 - ips 'flush' "${iface}"; ips 'destroy' "${iface}"; - ips 'flush' "${iface}_ip"; ips 'destroy' "${iface}_ip"; - ips 'flush' "${iface}_mac"; ips 'destroy' "${iface}_mac"; - ip -4 route flush cache - ip -6 route flush cache - sed -i "/$iface/d" /etc/iproute2/rt_tables - return 0 - else - return 1 - fi -} - -# shellcheck disable=SC2086 -table_create(){ - local tid="$1" mark="$2" iface="$3" gw4="$4" dev="$5" gw6="$6" dev6="$7" match="$8" dscp s=0 i ipv4_error=0 ipv6_error=1 - - if [ -z "$tid" ] || [ -z "$mark" ] || [ -z "$iface" ]; then - return 1 - fi - - table_destroy "$tid" "$iface" "$mark" - - if [ -n "$gw4" ] || [ "$strictMode" -ne 0 ]; then - echo "$tid" "$iface" >> /etc/iproute2/rt_tables - if [ -z "$gw4" ]; then - ip -4 route add unreachable default table "$tid" >/dev/null 2>&1 || ipv4_error=1 - else - ip -4 route add default via "$gw4" dev "$dev" table "$tid" >/dev/null 2>&1 || ipv4_error=1 - fi -# ip -4 route list table main | grep -v 'br-lan' | while read -r i; do - ip -4 route list table main | while read -r i; do - idev="$(echo "$i" | grep -Eso 'dev [^ ]*' | awk '{print $2}')" - if ! is_supported_iface_dev "$idev"; then - ip -4 route add $i table "$tid" >/dev/null 2>&1 || ipv4_error=1 - fi - done - ip -4 route flush cache || ipv4_error=1 - ip -4 rule add fwmark "${mark}/${fwMask}" table "$tid" || ipv4_error=1 - ipt -t mangle -N "VPR_MARK${mark}" || ipv4_error=1 - ipt -t mangle -A "VPR_MARK${mark}" -j MARK --set-xmark "${mark}/${fwMask}" || ipv4_error=1 - ipt -t mangle -A "VPR_MARK${mark}" -j RETURN || ipv4_error=1 - fi - - if [ "$ipv6Enabled" -ne 0 ]; then - ipv6_error=0 - if { [ -n "$gw6" ] && [ "$gw6" != "::/0" ]; } || [ "$strictMode" -ne 0 ]; then - if [ -z "$gw6" ] || [ "$gw6" = "::/0" ]; then - ip -6 route add unreachable default table "$tid" || ipv6_error=1 - else - ip -6 route list table main | grep " dev $dev6 " | while read -r i; do - ip -6 route add $i table "$tid" >/dev/null 2>&1 || ipv6_error=1 - done - fi - ip -6 route flush cache || ipv6_error=1 - ip -6 rule add fwmark "${mark}/${fwMask}" table "$tid" || ipv6_error=1 - fi - fi - - if [ $ipv4_error -eq 0 ] || [ $ipv6_error -eq 0 ]; then - dscp="$(uci -q get "${packageName}".config."${iface}"_dscp)" - if [ "${dscp:-0}" -ge 1 ] && [ "${dscp:-0}" -le 63 ]; then - ipt -t mangle -I VPR_PREROUTING -m dscp --dscp "${dscp}" -g "VPR_MARK${mark}" || s=1 - fi - if [ -n "$ipsetSupported" ] && { [ -n "$dnsmasqIpsetSupported" ] || [ "$destIpset" -ne 0 ]; }; then - if ips 'create' "${iface}" 'hash:net comment' && ips 'flush' "${iface}"; then - for i in $usedChainsList; do - ipt -t mangle -I VPR_${i} -m set --match-set "${iface}" dst -g "VPR_MARK${mark}" || s=1 - if [ "$ipv6Enabled" -ne 0 ]; then ipt -t mangle -I VPR_${i} -m set --match-set "${iface}6" dst -g "VPR_MARK${mark}" || s=1; fi - done - else - s=1 - fi - fi - if [ -n "$ipsetSupported" ] && [ "$srcIpset" -ne 0 ]; then - if ips 'create' "${iface}_ip" 'hash:net comment' && ips 'flush' "${iface}_ip"; then - ipt -t mangle -I VPR_PREROUTING -m set --match-set "${iface}_ip" src -g "VPR_MARK${mark}" || s=1 - if [ "$ipv6Enabled" -ne 0 ]; then ipt -t mangle -I VPR_PREROUTING -m set --match-set "${iface}6_ip" src -g "VPR_MARK${mark}" || s=1; fi - else - s=1 - fi - if ips 'create' "${iface}_mac" 'hash:mac comment' && ips 'flush' "${iface}_mac"; then - ipt -t mangle -I VPR_PREROUTING -m set --match-set "${iface}_mac" src -g "VPR_MARK${mark}" || s=1 - else - s=1 - fi - fi - if [ "$iface" = "$icmpIface" ]; then - ipt -t mangle -I VPR_OUTPUT -p icmp -g "VPR_MARK${mark}" || s=1 - fi - else - s=1 - fi - - return $s -} - -table_reload() { - local tid="$1" mark="$2" iface="$3" gw4="$4" dev="$5" gw6="$6" dev6="$7" match="$8" dscp s=0 i ipv4_error=0 ipv6_error=1 - - if [ -z "$tid" ] || [ -z "$mark" ] || [ -z "$iface" ]; then - return 1 - fi - - ip -4 route del default table "$tid" >/dev/null 2>&1 - if [ -n "$gw4" ] || [ "$strictMode" -ne 0 ]; then - if [ -z "$gw4" ]; then - ip -4 route add unreachable default table "$tid" >/dev/null 2>&1 || ipv4_error=1 - else - ip -4 route add default via "$gw4" dev "$dev" table "$tid" >/dev/null 2>&1 || ipv4_error=1 - fi - ip -4 route flush cache || ipv4_error=1 - ip -4 rule del fwmark "${mark}/${fwMask}" table "$tid" >/dev/null 2>&1 - ip -4 rule add fwmark "${mark}/${fwMask}" table "$tid" || ipv4_error=1 - fi - - if [ "$ipv6Enabled" -ne 0 ]; then - ip -6 route del default table "$tid" >/dev/null 2>&1 - ipv6_error=0 - if { [ -n "$gw6" ] && [ "$gw6" != "::/0" ]; } || [ "$strictMode" -ne 0 ]; then - if [ -z "$gw6" ] || [ "$gw6" = "::/0" ]; then - ip -6 route add unreachable default table "$tid" || ipv6_error=1 - else - ip -6 route list table main | grep " dev $dev6 " | while read -r i; do - ip -6 route add "$i" table "$tid" >/dev/null 2>&1 || ipv6_error=1 - done - fi - ip -6 route flush cache || ipv6_error=1 - ip -6 rule del fwmark "${mark}/${fwMask}" table "$tid" >/dev/null 2>&1 - ip -6 rule add fwmark "${mark}/${fwMask}" table "$tid" || ipv6_error=1 - fi - fi - - if [ $ipv4_error -eq 0 ] || [ $ipv6_error -eq 0 ]; then - dscp="$(uci -q get "${packageName}".config."${iface}"_dscp)" - if [ "${dscp:-0}" -ge 1 ] && [ "${dscp:-0}" -le 63 ]; then - ipt -t mangle -I VPR_PREROUTING -m dscp --dscp "${dscp}" -g "VPR_MARK${mark}" || s=1 - fi - if [ "$iface" = "$icmpIface" ]; then - ipt -t mangle -I VPR_OUTPUT -p icmp -g "VPR_MARK${mark}" || s=1 - fi - else - s=1 - fi - - return $s -} - -process_interface(){ - local gw4 gw6 dev dev6 s=0 dscp iface="$1" action="$2" match="$3" displayText - - is_supported_interface "$iface" || return 0 - is_wan6 "$iface" && return 0 - [ $((ifaceMark)) -gt $((fwMask)) ] && return 1 - - network_get_device dev "$iface" - [ -z "$dev" ] && config_get dev "$iface" 'ifname' - [ -z "$dev" ] && config_get dev "$iface" 'device' - if is_wan "$iface" && [ -n "$wanIface6" ]; then - network_get_device dev6 "$wanIface6" - [ -z "$dev6" ] && config_get dev6 "$wanIface6" 'ifname' - [ -z "$dev6" ] && config_get dev6 "$wanIface6" 'device' - fi - [ -z "$dev6" ] && dev6="$dev" - - [ -z "$ifaceTableID" ] && ifaceTableID="$wanTableID"; [ -z "$ifaceMark" ] && ifaceMark="$wanMark"; - - case "$action" in - destroy) - table_destroy "${ifaceTableID}" "${iface}" "${ifaceMark}" - ifaceTableID="$((ifaceTableID + 1))"; ifaceMark="$(printf '0x%06x' $((ifaceMark + wanMark)))"; - ;; - create) - eval "mark_${iface//-/_}"='$ifaceMark' - eval "tid_${iface//-/_}"='$ifaceTableID' - if [ -z "$match" ]; then - table_destroy "$ifaceTableID" "$iface" - fi - vpr_get_gateway gw4 "$iface" "$dev" - vpr_get_gateway6 gw6 "$iface" "$dev6" - if [ "$iface" = "$dev" ]; then - displayText="${iface}/${gw4:-0.0.0.0}" - else - displayText="${iface}/${dev}/${gw4:-0.0.0.0}" - fi - [ "$ipv6Enabled" -ne 0 ] && displayText="${displayText}/${gw6:-::/0}" - if [ -z "$match" ]; then - output 2 "Creating table '$displayText' " - is_default_dev "$dev" && displayText="${displayText} ${__OK__}" - if table_create "$ifaceTableID" "$ifaceMark" "$iface" "$gw4" "$dev" "$gw6" "$dev6" "$match"; then - gatewaySummary="${gatewaySummary}${displayText}\\n" - output_ok - else - errorSummary="${errorSummary}${_ERROR_}: Failed to set up '$displayText'\\n" - output_fail - fi - elif [ "$iface" = "$match" ]; then - output 2 "Reloading table '$displayText' " - is_default_dev "$dev" && displayText="${displayText} ${__OK__}" - if table_reload "$ifaceTableID" "$ifaceMark" "$iface" "$gw4" "$dev" "$gw6" "$dev6" "$match"; then - gatewaySummary="${gatewaySummary}${displayText}\\n" - output_ok - else - errorSummary="${errorSummary}${_ERROR_}: Failed to reload '$displayText'\\n" - output_fail - fi - else - is_default_dev "$dev" && displayText="${displayText} ${__OK__}" - gatewaySummary="${gatewaySummary}${displayText}\\n" - fi - ifaceTableID="$((ifaceTableID + 1))"; ifaceMark="$(printf '0x%06x' $((ifaceMark + wanMark)))"; - ;; - esac - return $s -} - -process_tor_interface(){ - local s=0 iface="$1" action="$2" displayText - case "$action" in - destroy) - for i in PREROUTING FORWARD INPUT OUTPUT; do - ipt -t nat -D "${i}" -m mark --mark "0x0/${fwMask}" -j "VPR_${i}" - ipt -t nat -F "VPR_${i}"; ipt -t nat -X "VPR_${i}"; - done - ;; - create) - output 2 "Creating TOR redirects " - dnsPort="$(grep -m1 DNSPort /etc/tor/torrc | awk -F: '{print $2}')" - transPort="$(grep -m1 TransPort /etc/tor/torrc | awk -F: '{print $2}')" - dnsPort="${dnsPort:-9053}"; transPort="${transPort:-9040}"; - for i in $usedChainsList; do - ipt -t nat -N "VPR_${i}" - ipt -t nat "$insertOption" "$i" -m mark --mark "0x0/${fwMask}" -j "VPR_${i}" - done - if ips 'create' "${iface}" 'hash:net comment' && ips 'flush' "${iface}"; then - for i in $usedChainsList; do - ipt -t nat -I "VPR_${i}" -p udp -m udp --dport 53 -m set --match-set "${iface}" dst -j REDIRECT --to-ports "$dnsPort" -m comment --comment "TorDNS-UDP" || s=1 - ipt -t nat -I "VPR_${i}" -p tcp -m tcp --dport 80 -m set --match-set "${iface}" dst -j REDIRECT --to-ports "$transPort" -m comment --comment "TorHTTP-TCP" || s=1 - ipt -t nat -I "VPR_${i}" -p udp -m udp --dport 80 -m set --match-set "${iface}" dst -j REDIRECT --to-ports "$transPort" -m comment --comment "TorHTTP-UDP" || s=1 - ipt -t nat -I "VPR_${i}" -p tcp -m tcp --dport 443 -m set --match-set "${iface}" dst -j REDIRECT --to-ports "$transPort" -m comment --comment "TorHTTPS-TCP" || s=1 - ipt -t nat -I "VPR_${i}" -p udp -m udp --dport 443 -m set --match-set "${iface}" dst -j REDIRECT --to-ports "$transPort" -m comment --comment "TorHTTPS-UDP" || s=1 - done - else - s=1 - fi - displayText="${iface}/53->${dnsPort}/80,443->${transPort}" - if [ "$s" -eq "0" ]; then - gatewaySummary="${gatewaySummary}${displayText}\\n" - output_ok - else - errorSummary="${errorSummary}${_ERROR_}: Failed to set up '$displayText'\\n" - output_fail - fi - ;; - esac - return $s -} - -convert_config(){ - local i src_ipset dest_ipset resolver_ipset - [ -s "/etc/config/${packageName}" ] || return 0 - grep -q "ignored_interfaces" "/etc/config/${packageName}" && sed -i 's/ignored_interfaces/ignored_interface/g' "/etc/config/${packageName}" - grep -q "supported_interfaces" "/etc/config/${packageName}" && sed -i 's/supported_interfaces/supported_interface/g' "/etc/config/${packageName}" - grep -q "local_addresses" "/etc/config/${packageName}" && sed -i 's/local_addresses/local_address/g' "/etc/config/${packageName}" - grep -q "local_ports" "/etc/config/${packageName}" && sed -i 's/local_ports/local_port/g' "/etc/config/${packageName}" - grep -q "remote_addresses" "/etc/config/${packageName}" && sed -i 's/remote_addresses/remote_address/g' "/etc/config/${packageName}" - grep -q "remote_ports" "/etc/config/${packageName}" && sed -i 's/remote_ports/remote_port/g' "/etc/config/${packageName}" - grep -q "ipset_enabled" "/etc/config/${packageName}" && sed -i 's/ipset_enabled/dest_ipset/g' "/etc/config/${packageName}" - grep -q "dnsmasq_enabled" "/etc/config/${packageName}" && sed -i 's/dnsmasq_enabled/resolver_ipset/g' "/etc/config/${packageName}" - grep -q "enable_control" "/etc/config/${packageName}" && sed -i 's/enable_control/webui_enable_column/g' "/etc/config/${packageName}" - grep -q "proto_control" "/etc/config/${packageName}" && sed -i 's/proto_control/webui_protocol_column/g' "/etc/config/${packageName}" - grep -q "chain_control" "/etc/config/${packageName}" && sed -i 's/chain_control/webui_chain_column/g' "/etc/config/${packageName}" - grep -q "sort_control" "/etc/config/${packageName}" && sed -i 's/sort_control/webui_sorting/g' "/etc/config/${packageName}" - grep -q "local_address" "/etc/config/${packageName}" && sed -i 's/local_address/src_addr/g' "/etc/config/${packageName}" - grep -q "local_port" "/etc/config/${packageName}" && sed -i 's/local_port/src_port/g' "/etc/config/${packageName}" - grep -q "remote_address" "/etc/config/${packageName}" && sed -i 's/remote_address/dest_addr/g' "/etc/config/${packageName}" - grep -q "remote_port" "/etc/config/${packageName}" && sed -i 's/remote_port/dest_port/g' "/etc/config/${packageName}" - grep -q "local_ipset" "/etc/config/${packageName}" && sed -i 's/local_ipset/src_ipset/g' "/etc/config/${packageName}" - grep -q "remote_ipset" "/etc/config/${packageName}" && sed -i 's/remote_ipset/dest_ipset/g' "/etc/config/${packageName}" - dest_ipset="$(uci -q get $packageName.config.dest_ipset)" - src_ipset="$(uci -q get $packageName.config.src_ipset)" - resolver_ipset="$(uci -q get $packageName.config.resolver_ipset)" - - if [ -n "$dest_ipset" ] && [ "$dest_ipset" != "0" ] && [ "$dest_ipset" != "1" ]; then - uci set "$packageName".config.dest_ipset='0' - if [ -z "$resolver_ipset" ]; then - uci set "$packageName".config.resolver_ipset='dnsmasq.ipset' - fi - uci commit "$packageName" - fi - if [ -n "$src_ipset" ] && [ "$src_ipset" != "0" ] && [ "$src_ipset" != "1" ]; then - uci set "$packageName".config.src_ipset='1' - uci commit "$packageName" - fi - if [ -z "$(uci -q get $packageName.config.webui_supported_protocol)" ]; then - uci add_list "$packageName".config.webui_supported_protocol='tcp' - uci add_list "$packageName".config.webui_supported_protocol='udp' - uci add_list "$packageName".config.webui_supported_protocol='tcp udp' - uci add_list "$packageName".config.webui_supported_protocol='icmp' - uci add_list "$packageName".config.webui_supported_protocol='all' - uci commit "$packageName" - fi - for i in append_local_rules append_src_rules \ - append_remote_rules append_dest_rules; do - if [ -n "$(uci -q get $packageName.config.$i)" ]; then - warningSummary="${warningSummary}$_WARNING_: $i setting is not supported in ${serviceName}.\\n" - fi - done - for i in udp_proto_enabled forward_chain_enabled input_chain_enabled \ - output_chain_enabled iprule_enabled; do - if [ "$(uci -q get $packageName.config.$i)" = "1" ]; then - warningSummary="${warningSummary}$_WARNING_: $i setting is not supported in ${serviceName}.\\n" - fi - done -} - -check_config(){ local en; config_get_bool en "$1" 'enabled' 1; [ "$en" -gt 0 ] && _cfg_enabled=0; } -is_config_enabled(){ - local cfg="$1" _cfg_enabled=1 - [ -n "$1" ] || return 1 - config_load "$packageName" - config_foreach check_config "$cfg" - return "$_cfg_enabled" -} - -process_user_file(){ - local path enabled shellBin="${SHELL:-/bin/ash}" - config_get_bool enabled "$1" 'enabled' 1 - config_get path "$1" 'path' - [ "$enabled" -gt 0 ] || return 0 - if [ ! -s "$path" ]; then - errorSummary="${errorSummary}${_ERROR_}: Custom user file '$path' not found or empty!\\n" - output_fail - return 1 - fi - if ! $shellBin -n "$path"; then - errorSummary="${errorSummary}${_ERROR_}: Syntax error in custom user file '$path'!\\n" - output_fail - return 1 - fi - output 2 "Running $path " -# shellcheck disable=SC1090 - if ! . "$path"; then - errorSummary="${errorSummary}${_ERROR_}: Error running custom user file '$path'!\\n" - if grep -q -w 'curl' "$path" && ! is_present 'curl'; then - errorSummary="${errorSummary}${_ERROR_}: Use of 'curl' is detected in custom user file '$path', but 'curl' isn't installed!\\n" - errorSummary="${errorSummary}${_ERROR_}: If 'curl' is needed, install it with 'opkg update; opkg install curl;' command in CLI.\\n" - fi - output_fail - return 1 - else - output_ok - return 0 - fi -} - -boot() { rc_procd start_service && rc_procd service_triggers; } - -start_service() { - local dnsmasqStoredHash dnsmasqNewHash i modprobeStatus=0 reloadedIface="$1" - convert_config - is_enabled 'on_start' || return 1 - is_wan_up || return 1 - - iptables -t 'mangle' --list 'VPR_PREROUTING' >/dev/null 2>&1 || unset reloadedIface - [ -n "$(tmpfs get gateway)" ] || unset reloadedIface - - if [ -s "$dnsmasqFile" ]; then - dnsmasqStoredHash="$(md5sum $dnsmasqFile | awk '{ print $1; }')" - rm -f "$dnsmasqFile" - fi - - for i in xt_set ip_set ip_set_hash_ip; do - modprobe "$i" >/dev/null 2>/dev/null || modprobeStatus=$((modprobeStatus + 1)) - done - - if [ "$modprobeStatus" -gt 0 ] && ! is_chaos_calmer; then - errorSummary="${errorSummary}${_ERROR_}: Failed to load kernel modules\\n" - fi - - if [ -z "$reloadedIface" ]; then - for i in $usedChainsList; do - ipt -t mangle -N "VPR_${i}" - ipt -t mangle "$insertOption" "$i" -m mark --mark "0x0/${fwMask}" -j "VPR_${i}" - done - fi - - if [ -z "$reloadedIface" ]; then - output 1 'Processing Interfaces ' - config_load 'network'; config_foreach process_interface 'interface' 'create'; - process_tor_interface 'tor' 'destroy'; is_tor_running && process_tor_interface 'tor' 'create'; - output 1 '\n' - if is_config_enabled 'policy'; then - output 1 'Processing Policies ' - config_load "$packageName"; config_foreach process_policy 'policy' "$reloadedIface"; - output 1 '\n' - fi - if is_config_enabled 'include'; then - output 1 'Processing User File(s) ' - config_load "$packageName"; config_foreach process_user_file 'include'; - output 1 '\n' - fi - else - output 1 "Reloading Interface: $reloadedIface " - config_load 'network'; config_foreach process_interface 'interface' 'create' "$reloadedIface"; - output 1 '\n' - fi - - if [ -s "$dnsmasqFile" ]; then - dnsmasqNewHash="$(md5sum $dnsmasqFile | awk '{ print $1; }')" - fi - [ "$dnsmasqNewHash" != "$dnsmasqStoredHash" ] && dnsmasq_restart - - if [ -z "$gatewaySummary" ]; then - errorSummary="${errorSummary}${_ERROR_}: failed to set up any gateway!\\n" - fi - procd_open_instance "main" - procd_set_param command /bin/true - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_open_data - json_add_array 'status' - json_add_object '' - [ -n "$gatewaySummary" ] && json_add_string gateway "$gatewaySummary" - [ -n "$errorSummary" ] && json_add_string error "$errorSummary" - [ -n "$warningSummary" ] && json_add_string warning "$warningSummary" - if [ "$strictMode" -ne 0 ] && str_contains "$gatewaySummary" '0.0.0.0'; then - json_add_string mode "strict" - fi - json_close_object - json_close_array - procd_close_data - procd_close_instance -} - -tmpfs() { - local action="$1" param="$2" value="$3" -# shellcheck disable=SC2034 - local gateway error warning mode i - if [ -s "$jsonFile" ]; then - json_load_file "$jsonFile" 2>/dev/null - json_select 'status' 2>/dev/null - for i in gateway error warning mode; do - json_get_var $i "$i" 2>/dev/null - done - fi - case "$action" in - get) - printf "%b" "$(eval echo "\$$param")"; return;; - add) - eval "$param"='$(eval echo "\$$param")${value}';; - del) - case "$param" in - all) - unset gateway error warning mode;; - *) - unset "$param";; - esac - ;; - set) - eval "$param"='$value';; - esac - json_init - json_add_object 'status' - json_add_string version "$PKG_VERSION" - for i in gateway error warning mode; do - json_add_string "$i" "$(eval echo "\$$i")" - done - json_close_object - json_dump > "$jsonFile" - sync -} - -service_started() { - tmpfs set 'gateway' "$gatewaySummary" - tmpfs set 'error' "$errorSummary" - tmpfs set 'warning' "$warningSummary" - if [ "$strictMode" -ne 0 ] && str_contains "$gatewaySummary" '0.0.0.0'; then - tmpfs set 'mode' 'strict' - fi - [ -n "$gatewaySummary" ] && output "$serviceName started with gateways:\\n${gatewaySummary}" - [ -n "$errorSummary" ] && output "${errorSummary}" - [ -n "$warningSummary" ] && output "${warningSummary}" - if [ -n "$errorSummary" ]; then - return 2 - elif [ -n "$warningSummary" ]; then - return 1 - else - return 0 - fi -} - -stop_service() { - local i - iptables -t mangle -L | grep -q VPR_PREROUTING || return 0 - load_package_config - for i in PREROUTING FORWARD INPUT OUTPUT; do - ipt -t mangle -D "${i}" -m mark --mark "0x0/${fwMask}" -j "VPR_${i}" - ipt -t mangle -F "VPR_${i}"; ipt -t mangle -X "VPR_${i}"; - done - config_load 'network'; config_foreach process_interface 'interface' 'destroy'; - process_tor_interface 'tor' 'destroy' - unset ifaceTableID; unset ifaceMark; - if [ -s "$dnsmasqFile" ]; then - rm -f "$dnsmasqFile" - dnsmasq_restart - fi - if [ "$serviceEnabled" -ne 0 ]; then - output "$serviceName stopped "; output_okn; - fi -} - -reload_interface() { rc_procd start_service "$1"; } - -service_triggers() { - local n - is_enabled || return 1 - - if [ "$procdReloadDelay" -gt 0 ] && [ "$procdReloadDelay" -lt 100 ]; then -# shellcheck disable=SC2034 - PROCD_RELOAD_DELAY=$(( procdReloadDelay * 1000 )) - fi - - procd_open_validate - validate_config - validate_policy - validate_include - procd_close_validate - - procd_open_trigger - procd_add_reload_trigger 'openvpn' - if type procd_add_service_trigger 1>/dev/null 2>&1; then - procd_add_service_trigger "service.restart" "firewall" /etc/init.d/${packageName} reload - fi - procd_add_config_trigger "config.change" "${packageName}" /etc/init.d/${packageName} reload - for n in $ifSupported; do - procd_add_interface_trigger "interface.*" "$n" /etc/init.d/${packageName} reload_interface "$n" - done - procd_close_trigger - - output 3 "$serviceName monitoring interfaces: $ifSupported"; output_okn; -} - -status_service() { support "$@"; } -support() { - local dist vers out id s param status set_d set_p tableCount i=0 dev dev6 j - readonly _SEPARATOR_='============================================================' - is_enabled - - json_load "$(ubus call system board)"; json_select release; json_get_var dist distribution; json_get_var vers version - if [ -n "$wanIface4" ]; then - network_get_gateway wanGW4 "$wanIface4" - [ -z "$dev" ] && dev="$(uci -q get network."${wanIface4}".ifname)" - [ -z "$dev" ] && dev="$(uci -q get network."${wanIface4}".device)" - fi - if [ -n "$wanIface6" ]; then - [ -z "$dev6" ] && dev6="$(uci -q get network."${wanIface6}".ifname)" - [ -z "$dev6" ] && dev6="$(uci -q get network."${wanIface6}".device)" - wanGW6=$(ip -6 route show | grep -m1 " dev $dev6 " | awk '{print $1}') - [ "$wanGW6" = "default" ] && wanGW6=$(ip -6 route show | grep -m1 " dev $dev6 " | awk '{print $3}') - fi - while [ "${1:0:1}" = "-" ]; do param="${1//-/}"; eval "set_$param=1"; shift; done - [ -e "/var/${packageName}-support" ] && rm -f "/var/${packageName}-support" - status="$serviceName running on $dist $vers." - [ -n "$wanIface4" ] && status="$status WAN (IPv4): ${wanIface4}/${dev}/${wanGW4:-0.0.0.0}." - [ -n "$wanIface6" ] && status="$status WAN (IPv6): ${wanIface6}/${dev6}/${wanGW6:-::/0}." - { - echo "$status" - echo "$_SEPARATOR_" - dnsmasq --version 2>/dev/null | sed '/^$/,$d' - if [ -n "$1" ]; then - echo "$_SEPARATOR_" - echo "Resolving domains" - for i in $1; do - echo "$i: $(resolveip "$i" | tr '\n' ' ')" - done - fi - - echo "$_SEPARATOR_" - echo "Routes/IP Rules" - tableCount=$(ip rule list | grep -c 'fwmark') || tableCount=0 - if [ -n "$set_d" ]; then route; else route | grep '^default'; fi - if [ -n "$set_d" ]; then ip rule list; fi - i=0; while [ $i -lt $tableCount ]; do - echo "" - echo "IPv4 Table $((wanTableID + i)): $(ip -4 route show table $((wanTableID + i)))" - echo "IPv4 Table $((wanTableID + i)) Rules:" - ip -4 rule list table "$((wanTableID + i))" - i=$((i + 1)) - done - - if [ "$ipv6Enabled" -ne 0 ]; then - i=0; while [ $i -lt $tableCount ]; do - ip -6 route show table $((wanTableID + i)) | while read -r param; do - echo "IPv6 Table $((wanTableID + i)): $param" - done - i=$((i + 1)) - done - fi - - for j in Mangle NAT; do - if [ -z "$set_d" ]; then - for i in $usedChainsList; do - if iptables -v -t "$(str_to_lower $j)" -S "VPR_${i}" 1>/dev/null 2>&1; then - echo "$_SEPARATOR_" - echo "$j IP Table: $i" - iptables -v -t "$(str_to_lower $j)" -S "VPR_${i}" - if [ "$ipv6Enabled" -ne 0 ]; then - echo "$_SEPARATOR_" - echo "$j IPv6 Table: $i" - ip6tables -v -t "$(str_to_lower $j)" -S "VPR_${i}" - fi - fi - done - else - echo "$_SEPARATOR_" - echo "$j IP Table" - iptables -L -t "$(str_to_lower $j)" - if [ "$ipv6Enabled" -ne 0 ]; then - echo "$_SEPARATOR_" - echo "$j IPv6 Table" - ip6tables -L -t "$(str_to_lower $j)" - fi - fi - i=0; ifaceMark="$wanMark"; - while [ $i -lt $tableCount ]; do - if iptables -v -t "$(str_to_lower $j)" -S "VPR_MARK${ifaceMark}" 1>/dev/null 2>&1; then - echo "$_SEPARATOR_" - echo "$j IP Table MARK Chain: VPR_MARK${ifaceMark}" - iptables -v -t "$(str_to_lower $j)" -S "VPR_MARK${ifaceMark}" - ifaceMark="$(printf '0x%06x' $((ifaceMark + wanMark)))"; - fi - i=$((i + 1)) - done - done - - echo "$_SEPARATOR_" - echo "Current ipsets" - ipset save - if [ -s "$dnsmasqFile" ]; then - echo "$_SEPARATOR_" - echo "DNSMASQ ipsets" - cat "$dnsmasqFile" - fi - echo "$_SEPARATOR_" - } | tee -a /var/${packageName}-support - if [ -n "$set_p" ]; then - printf "%b" "Pasting to paste.ee... " - if is_present 'curl' && is_variant_installed 'libopenssl' && is_installed 'ca-bundle'; then - json_init; json_add_string "description" "${packageName}-support" - json_add_array "sections"; json_add_object '0' - json_add_string "name" "$(uci -q get system.@system[0].hostname)" - json_add_string "contents" "$(cat /var/${packageName}-support)" - json_close_object; json_close_array; payload=$(json_dump) - out=$(curl -s -k "https://api.paste.ee/v1/pastes" -X "POST" -H "Content-Type: application/json" -H "X-Auth-Token:uVOJt6pNqjcEWu7qiuUuuxWQafpHhwMvNEBviRV2B" -d "$payload") - json_load "$out"; json_get_var id id; json_get_var s success - [ "$s" = "1" ] && printf "%b" "https://paste.ee/p/$id $__OK__\\n" || printf "%b" "$__FAIL__\\n" - [ -e "/var/${packageName}-support" ] && rm -f "/var/${packageName}-support" - else - printf "%b" "$__FAIL__\\n" - printf "%b" "$_ERROR_: curl, libopenssl or ca-bundle were not found!\\nRun 'opkg update; opkg install curl libopenssl ca-bundle' to install them.\\n" - fi - else - printf "%b" "Your support details have been logged to '/var/${packageName}-support'. $__OK__\\n" - fi -} - -# shellcheck disable=SC2120 -validate_config() { - uci_validate_section "${packageName}" config "${1}" \ - 'enabled:bool:0' \ - 'strict_enforcement:bool:1' \ - 'ipv6_enabled:bool:0' \ - 'src_ipset:bool:0' \ - 'dest_ipset:bool:0' \ - 'resolver_ipset::or("", "none", "dnsmasq.ipset")' \ - 'verbosity:range(0,2):1' \ - 'wan_tid:integer:201' \ - 'wan_fw_mark:hex(8)' \ - 'fw_mask:hex(8)' \ - 'icmp_interface:string' \ - 'ignored_interface:list(string)' \ - 'supported_interface:list(string)' \ - 'boot_timeout:integer:30' \ - 'iptables_rule_option:or("", "append", "insert")' \ - 'procd_reload_delay:integer:0' \ - 'webui_enable_column:bool:0' \ - 'webui_protocol_column:bool:0' \ - 'webui_supported_protocol:list(string)' \ - 'webui_chain_column:bool:0' \ - 'webui_sorting:bool:1' \ - 'webui_show_ignore_target:bool:0' -} - -# shellcheck disable=SC2120 -validate_policy() { - uci_validate_section "${packageName}" policy "${1}" \ - 'name:string' \ - 'enabled:bool:0' \ - 'interface:network' \ - 'proto:or(string)' \ - 'chain:or("", "PREROUTING", "FORWARD", "INPUT", "OUTPUT")' \ - 'src_addr:list(neg(or(host,network,macaddr)))' \ - 'src_port:list(neg(or(portrange, string)))' \ - 'dest_addr:list(neg(host))' \ - 'dest_port:list(neg(or(portrange, string)))' -} - -# shellcheck disable=SC2120 -validate_include() { - uci_validate_section "${packageName}" include "${1}" \ - 'path:string' \ - 'enabled:bool:0' -} diff --git a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.netflix.user b/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.netflix.user deleted file mode 100644 index 02335c4..0000000 --- a/openwrt-21.02/patches/package/vpn-policy-routing/files/vpn-policy-routing.netflix.user +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# This file is heavily based on code from https://github.com/Xentrk/netflix-vpn-bypass/blob/master/IPSET_Netflix.sh -# Credits to https://forum.openwrt.org/u/dscpl for api.hackertarget.com code. -# Credits to https://github.com/kkeker and https://github.com/tophirsch for api.bgpview.io code. - -TARGET_IPSET='wan' -TARGET_ASN='2906' -TARGET_FNAME="/var/vpn-policy-routing_tmp_AS${TARGET_ASN}" -#DB_SOURCE='ipinfo.io' -#DB_SOURCE='api.hackertarget.com' -DB_SOURCE='api.bgpview.io' - -_ret=1 - -if [ ! -s "$TARGET_FNAME" ]; then - if [ "$DB_SOURCE" = "ipinfo.io" ]; then - TARGET_URL="https://ipinfo.io/AS${TARGET_ASN}" - curl "$TARGET_URL" 2>/dev/null | grep -E "a href.*${TARGET_ASN}\/" | grep -v ":" | sed "s/^.*//" > "$TARGET_FNAME" - fi - - if [ "$DB_SOURCE" = "api.hackertarget.com" ]; then - TARGET_URL="https://api.hackertarget.com/aslookup/?q=AS${TARGET_ASN}" - curl "$TARGET_URL" 2>/dev/null | sed '1d' > "$TARGET_FNAME" - fi - - if [ "$DB_SOURCE" = "api.bgpview.io" ]; then - TARGET_URL="https://api.bgpview.io/asn/${TARGET_ASN}/prefixes" - curl -s "$TARGET_URL" 2>/dev/null | jsonfilter -e '@.data.ipv4_prefixes[*].prefix' > "$TARGET_FNAME" - fi -fi - -if [ -s "$TARGET_FNAME" ]; then - awk -v ipset="$TARGET_IPSET" '{print "add " ipset " " $1}' "$TARGET_FNAME" | ipset restore -! && _ret=0 -fi -rm -f "$TARGET_FNAME" - -return $_ret diff --git a/openwrt-21.02/patches/package/vpn-policy-routing/test.sh b/openwrt-21.02/patches/package/vpn-policy-routing/test.sh deleted file mode 100644 index 45469ed..0000000 --- a/openwrt-21.02/patches/package/vpn-policy-routing/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -/etc/init.d/"$1" version 2>&1 | grep "$2" diff --git a/openwrt-21.02/release-info.md b/openwrt-21.02/release-info.md deleted file mode 100644 index 1b26871..0000000 --- a/openwrt-21.02/release-info.md +++ /dev/null @@ -1,18 +0,0 @@ -## OpenWrt 21.02.7 (EOL) - -### Configuration -- OpenWRT 21.02.7 Vanilla / Kernel 5.4 -- ImmortalWRT patches for Rockchip target NanoPi R2S (rk3328) / NanoPi R4S support (rk3399) -- NanoPi R2S : r8152 driver v1.11.11 backport from kernel 5.10 + realtek r8169 firmwares package -- NanoPi R4S : r8168 driver for R4S (realtek) instead of kernel r8169 + r8169 firmwares package - -### Applications -- A useful set of applications from official OpenWrt package feed -- Mini build without UI -- Full build with LuCI, docker and extra packages -- vpn-routing-policy more recent version - -### Changelog -- Build from openwrt 21.02.7 tag -- Use default gcc version -- Freeze vpn-routing-policy \ No newline at end of file diff --git a/openwrt-21.02/steps/01_clone_openwrt.sh b/openwrt-21.02/steps/01_clone_openwrt.sh deleted file mode 100755 index 7975f27..0000000 --- a/openwrt-21.02/steps/01_clone_openwrt.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -ROOTDIR=$(pwd) -echo $ROOTDIR -if [ ! -e "$ROOTDIR/LICENSE" ]; then - echo "Please run from root" - exit 1 -fi - -cd $ROOTDIR -mkdir build -cd build - -OPENWRT_FOLDER=openwrt-fresh-2102 -git clone -b openwrt-21.02 --single-branch https://git.openwrt.org/openwrt/openwrt.git $OPENWRT_FOLDER -cd $OPENWRT_FOLDER -echo "Current OpenWRT commit" -git log -1 - -# git go to specific tag if needed -#OPENWRT_TAG=2ce89a35788fcd768a4a872d3d4f5a3a131b1d43 -#git reset --hard $OPENWRT_TAG - -# note how to freeze feeds too if needed -# see https://github.com/openwrt/openwrt/commit/1d5aa4bde731905073dbfb96d9dfb9b480715505 diff --git a/openwrt-21.02/steps/03_patch_openwrt.sh b/openwrt-21.02/steps/03_patch_openwrt.sh deleted file mode 100755 index ef4f210..0000000 --- a/openwrt-21.02/steps/03_patch_openwrt.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/bash -ROOTDIR=$(pwd) -echo $ROOTDIR -if [ ! -e "$ROOTDIR/build" ]; then - echo "Please run from root / no build dir" - exit 1 -fi - -BUILDDIR="$ROOTDIR/build" - -cd "$BUILDDIR/openwrt" -OPENWRT_SUFFIX=2102 -OPENWRT_BRANCH=21.02 - -# -------------- UBOOT ----------------------------------- -# replace uboot with local uboot package -# this version does not need arm-trusted-firmware-rk3328 -rm -rf package/boot/uboot-rockchip -cp -R $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/package/uboot-rockchip package/boot/ - -# -------------- target rockchip / linux ---------------- -# replace target rockchip with immortalwrt one -rm -rf target/linux/rockchip -cp -R $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/immortalwrt/target/linux/rockchip target/linux/ - -# remove patches that make kernel panic -# do not forget to run 03.sh !!!!!!! then make target/linux/clean -rm target/linux/rockchip/patches-5.4/805* # kernel oops, remove !!! -rm target/linux/rockchip/patches-5.4/9* - -# revert to openwrt target/linux/rockchip/image/armv8.mk -cp $BUILDDIR/openwrt-fresh-$OPENWRT_SUFFIX/target/linux/rockchip/image/armv8.mk target/linux/rockchip/image/armv8.mk - -# note: for r4s, need to move it ! -cat <> target/linux/rockchip/image/armv8.mk - -define Device/friendlyarm_nanopi-r4s - DEVICE_VENDOR := FriendlyARM - DEVICE_MODEL := NanoPi R4S - SOC := rk3399 - UBOOT_DEVICE_NAME := nanopi-r4s-rk3399 - IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r4s | pine64-img | gzip | append-metadata - DEVICE_PACKAGES := kmod-r8168 -urngd -endef -TARGET_DEVICES += friendlyarm_nanopi-r4s -EOT - -cat <> target/linux/rockchip/image/armv8.mk - -define Device/friendlyarm_nanopi-r2c - DEVICE_VENDOR := FriendlyARM - DEVICE_MODEL := NanoPi R2C - SOC := rk3328 - UBOOT_DEVICE_NAME := nanopi-r2c-rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-img | gzip | append-metadata - DEVICE_PACKAGES := kmod-usb-net-rtl8152 -endef -TARGET_DEVICES += friendlyarm_nanopi-r2c -EOT - - -# r8152 driver from friendlywrt for kernel 5.4 -# add extra patch to update r8152 driver to v.1.11.11 -# note : driver 2.13 and 2.14 seem unstable from this thread -# https://forum.armbian.com/topic/15165-nanopi-r2s-lan0-goes-offline-with-high-traffic/ -# the patch idea is taken from https://github.com/friendlyarm/kernel-rockchip/blob/nanopi-r2-v5.4.y-opp1/drivers/net/usb/r8152.c -# I just add a backport ov v1.11.11 instead -cp $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/kernel-5.4/001-r8152-v1-11-11.patch target/linux/rockchip/patches-5.4/ - -#copy crafted patch -cp $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/kernel-5.4/add-rk3328-usb3-phy-driver.patch target/linux/rockchip/patches-5.4/808-add-rk3328-usb3-phy-driver.patch -# enable PHY usb3 for r2s -sed -i 's/# CONFIG_PHY_ROCKCHIP_INNO_USB3 is not set/CONFIG_PHY_ROCKCHIP_INNO_USB3=y/' target/linux/rockchip/armv8/config-5.4 - - - -# ------------------ packages ------------------------------------ - -# arm trusted firmware -#rm -rf package/boot/arm-trusted-firmware-rockchip -#cp -R $BUILDDIR/immortal-fresh/package/boot/arm-trusted-firmware-rockchip package/boot/ - -# new video module dependancy for rockchip drm -rm -f package/kernel/linux/modules/video.mk -cp -R $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/immortalwrt/package/kernel/linux/modules/video.mk package/kernel/linux/modules/ - -# r8168 driver for r4s -cp -R $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/immortalwrt/package/kernel/r8168 package/kernel/ - -# r8152 driver from realtek -#cp -R $BUILDDIR/immortal-fresh/package/kernel/r8152 package/kernel/ - -# copy extra patch from immortalwrt -cp $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/immortalwrt/package/libs/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch \ - package/libs/mbedtls/patches/ - -# enable watchdog -#sed -i 's/# CONFIG_WATCHDOG is not set/CONFIG_WATCHDOG=y/' target/linux/rockchip/armv8/config-5.4 -#sed -i '/CONFIG_WATCHDOG=y/a CONFIG_DW_WATCHDOG=y' target/linux/rockchip/armv8/config-5.4 -#cp $ROOTDIR/patches/kernel-5.4/995-watchdog-rk3328.patch target/linux/rockchip/patches-5.4/ -#cp $ROOTDIR/patches/kernel-5.4/996-watchdog-rk3399.patch target/linux/rockchip/patches-5.4/ -#cp $ROOTDIR/patches/kernel-5.4/997-clk-rk3328.patch target/linux/rockchip/patches-5.4/ - -# enable crypto -if ! grep -q "0002-kernel-crypto.addon" target/linux/rockchip/armv8/config-5.4; then - echo "Adding 0002-kernel-crypto.addon to target/linux/rockchip/armv8/config-5.4" - echo "# --- 0002-kernel-crypto.addon " >> target/linux/rockchip/armv8/config-5.4 - cat $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/0002-kernel-crypto.addon >> target/linux/rockchip/armv8/config-5.4 -else - echo "Already added 0002-kernel-crypto.addon to target/linux/rockchip/armv8/config-5.4" -fi - -# add caiaq usb sound module for shairport with old soundcard -ADDON_PATH='snd-usb-caiaq.makefileaddon' -ADDON_DEST='package/kernel/linux/modules/usb.mk' -if ! grep -q " --- $ADDON_PATH" $ADDON_DEST; then - echo "Adding $ADDON_PATH to $ADDON_DEST" - echo "# --- $ADDON_PATH" >> $ADDON_DEST - cat $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/$ADDON_PATH >> $ADDON_DEST -else - echo "Already added $ADDON_PATH to $ADDON_DEST" -fi - -#cleanup -if [ -e .config ]; then - echo "Cleaning up ..." - make target/linux/clean - make package/boot/uboot-rockchip/clean -fi \ No newline at end of file diff --git a/openwrt-21.02/steps/07-all_kmods.sh b/openwrt-21.02/steps/07-all_kmods.sh deleted file mode 100755 index 26540da..0000000 --- a/openwrt-21.02/steps/07-all_kmods.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -ROOTDIR=$(pwd) -echo $ROOTDIR -if [ ! -e "$ROOTDIR/build" ]; then - echo "Please run from root / no build dir" - exit 1 -fi - -cd "$ROOTDIR/build" - -cd openwrt - -# not implemented in 21.02 - diff --git a/openwrt-21.02/steps/old/01_clone_openwrt_master.sh b/openwrt-21.02/steps/old/01_clone_openwrt_master.sh deleted file mode 100755 index f627226..0000000 --- a/openwrt-21.02/steps/old/01_clone_openwrt_master.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -ROOTDIR=$(pwd) -echo $ROOTDIR -if [ ! -e "$ROOTDIR/LICENSE" ]; then - echo "Please run from root" - exit 1 -fi - -cd $ROOTDIR -mkdir build -cd build - -OPENWRT_FOLDER=openwrt-fresh-master -git clone -b master --single-branch https://git.openwrt.org/openwrt/openwrt.git $OPENWRT_FOLDER -cd $OPENWRT_FOLDER -echo "Current OpenWRT commit" -git log -1 - -# git go to specific tag if needed -#OPENWRT_TAG=2ce89a35788fcd768a4a872d3d4f5a3a131b1d43 -#git reset --hard $OPENWRT_TAG - -# note how to freeze feeds too if needed -# see https://github.com/openwrt/openwrt/commit/1d5aa4bde731905073dbfb96d9dfb9b480715505 diff --git a/openwrt-21.02/steps/old/02_prepare_openwrt_folder.sh b/openwrt-21.02/steps/old/02_prepare_openwrt_folder.sh deleted file mode 100755 index d6aa9f9..0000000 --- a/openwrt-21.02/steps/old/02_prepare_openwrt_folder.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -ROOTDIR=$(pwd) -echo $ROOTDIR -if [ ! -e "$ROOTDIR/build" ]; then - echo "Please run from root / no build dir" - exit 1 -fi - -cd "$ROOTDIR/build" - -cp -R openwrt-fresh-2102 openwrt - diff --git a/openwrt-22.03/patches/package/adguardhome/Makefile b/openwrt-22.03/patches/package/adguardhome/Makefile index 7a0af6e..f373981 100644 --- a/openwrt-22.03/patches/package/adguardhome/Makefile +++ b/openwrt-22.03/patches/package/adguardhome/Makefile @@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adguardhome -PKG_VERSION:=0.107.28 +PKG_VERSION:=0.107.32 PKG_RELEASE:=1 # WARNING : need rework for other arch PKG_SOURCE:=AdGuardHome_linux_arm64.tar.gz PKG_SOURCE_URL:=https://github.com/AdguardTeam/AdGuardHome/releases/download/v$(PKG_VERSION)/ -PKG_HASH:=136401c00d29ac9e01f1aead123f65064027ad851396cc1e38906942c2c1a3d3 +PKG_HASH:=2e3e1e09c320a72d809461ca03fc51c597361d5de5972916c157935251d7bf22 PKG_LICENSE:=GPL-3.0-only PKG_LICENSE_FILES:=LICENSE.txt diff --git a/openwrt-23.05/patches/package/adguardhome/Makefile b/openwrt-23.05/patches/package/adguardhome/Makefile new file mode 100644 index 0000000..f373981 --- /dev/null +++ b/openwrt-23.05/patches/package/adguardhome/Makefile @@ -0,0 +1,58 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=adguardhome +PKG_VERSION:=0.107.32 +PKG_RELEASE:=1 + +# WARNING : need rework for other arch +PKG_SOURCE:=AdGuardHome_linux_arm64.tar.gz +PKG_SOURCE_URL:=https://github.com/AdguardTeam/AdGuardHome/releases/download/v$(PKG_VERSION)/ +PKG_HASH:=2e3e1e09c320a72d809461ca03fc51c597361d5de5972916c157935251d7bf22 + +PKG_LICENSE:=GPL-3.0-only +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Dobroslaw Kijowski + +include $(INCLUDE_DIR)/package.mk + +define Package/adguardhome + SECTION:=net + CATEGORY:=Network + TITLE:=Network-wide ads and trackers blocking DNS server + URL:=https://github.com/AdguardTeam/AdGuardHome + DEPENDS:=+ca-bundle +endef + +define Package/adguardhome/conffiles +/etc/adguardhome.yaml +/etc/config/adguardhome +endef + +define Package/adguardhome/description +Free and open source, powerful network-wide ads and trackers blocking DNS server. +endef + +define Build/Prepare + $(TAR) -C $(PKG_BUILD_DIR) -xf $(DL_DIR)/$(PKG_SOURCE) +endef + +define Build/Compile +endef + +define Package/adguardhome/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/AdGuardHome/AdGuardHome $(1)/usr/bin/AdGuardHome + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/adguardhome.init $(1)/etc/init.d/adguardhome + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/adguardhome.config $(1)/etc/config/adguardhome +endef + +$(eval $(call BuildPackage,adguardhome)) diff --git a/openwrt-23.05/patches/package/adguardhome/files/adguardhome.config b/openwrt-23.05/patches/package/adguardhome/files/adguardhome.config new file mode 100644 index 0000000..9f49348 --- /dev/null +++ b/openwrt-23.05/patches/package/adguardhome/files/adguardhome.config @@ -0,0 +1,3 @@ +config adguardhome config + # Where to store persistent data by AdGuard Home + option workdir /var/adguardhome diff --git a/openwrt-23.05/patches/package/adguardhome/files/adguardhome.init b/openwrt-23.05/patches/package/adguardhome/files/adguardhome.init new file mode 100644 index 0000000..b26abbf --- /dev/null +++ b/openwrt-23.05/patches/package/adguardhome/files/adguardhome.init @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common + +PROG=/usr/bin/AdGuardHome + +USE_PROCD=1 + +# starts after network starts +START=21 +# stops before networking stops +STOP=89 + +start_service() { + config_load adguardhome + config_get WORK_DIR config workdir + + [ -d "$WORK_DIR" ] || mkdir -m 0755 -p "$WORK_DIR" + + procd_open_instance + procd_set_param command "$PROG" -c /etc/adguardhome.yaml -w "$WORK_DIR" --no-check-update + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} diff --git a/openwrt-21.02/patches/immortalwrt/package/libs/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch b/openwrt-23.05/patches/package/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch similarity index 89% rename from openwrt-21.02/patches/immortalwrt/package/libs/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch rename to openwrt-23.05/patches/package/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch index 7c840c0..3633b35 100644 --- a/openwrt-21.02/patches/immortalwrt/package/libs/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch +++ b/openwrt-23.05/patches/package/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch @@ -27,12 +27,12 @@ QEMU seems to also need Then run normal make or cmake etc. --- ---- a/ChangeLog.d/armv8_crypto_extensions.txt +--- /dev/null +++ b/ChangeLog.d/armv8_crypto_extensions.txt @@ -0,0 +1,2 @@ +Features + * Support ARMv8 Cryptography Extensions for AES and GCM. ---- a/include/mbedtls/armv8ce_aes.h +--- /dev/null +++ b/include/mbedtls/armv8ce_aes.h @@ -0,0 +1,63 @@ +/** @@ -100,8 +100,8 @@ Then run normal make or cmake etc. +#endif /* MBEDTLS_ARMV8CE_AES_H */ --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h -@@ -95,6 +95,10 @@ - #error "MBEDTLS_AESNI_C defined, but not all prerequisites" +@@ -69,6 +69,10 @@ + #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" #endif +#if defined(MBEDTLS_ARMV8CE_AES_C) && !defined(MBEDTLS_HAVE_ASM) @@ -111,14 +111,14 @@ Then run normal make or cmake etc. #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" #endif -@@ -772,3 +776,4 @@ - typedef int mbedtls_iso_c_forbids_empty_translation_units; +@@ -959,3 +963,4 @@ typedef int mbedtls_iso_c_forbids_empty_ + /* *INDENT-ON* */ #endif /* MBEDTLS_CHECK_CONFIG_H */ + --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h -@@ -73,6 +73,7 @@ +@@ -46,6 +46,7 @@ * Requires support for asm() in compiler. * * Used in: @@ -126,7 +126,7 @@ Then run normal make or cmake etc. * library/aria.c * library/timing.c * include/mbedtls/bn_mul.h -@@ -1905,6 +1906,21 @@ +@@ -2374,6 +2375,21 @@ #define MBEDTLS_AESNI_C /** @@ -150,7 +150,7 @@ Then run normal make or cmake etc. * Enable the AES block cipher. --- a/library/aes.c +++ b/library/aes.c -@@ -69,7 +69,9 @@ +@@ -39,7 +39,9 @@ #if defined(MBEDTLS_AESNI_C) #include "mbedtls/aesni.h" #endif @@ -158,11 +158,11 @@ Then run normal make or cmake etc. +#if defined(MBEDTLS_ARMV8CE_AES_C) +#include "mbedtls/armv8ce_aes.h" +#endif - #if defined(MBEDTLS_SELF_TEST) - #if defined(MBEDTLS_PLATFORM_C) #include "mbedtls/platform.h" -@@ -1052,6 +1054,11 @@ - return( mbedtls_aesni_crypt_ecb( ctx, mode, input, output ) ); + + #if !defined(MBEDTLS_AES_ALT) +@@ -1040,6 +1042,11 @@ int mbedtls_aes_crypt_ecb(mbedtls_aes_co + } #endif +#if defined(MBEDTLS_ARMV8CE_AES_C) @@ -171,9 +171,9 @@ Then run normal make or cmake etc. +#endif + #if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_HAVE_X86) - if( aes_padlock_ace ) - { ---- a/library/armv8ce_aes.c + if (aes_padlock_ace) { + return mbedtls_padlock_xcryptecb(ctx, mode, input, output); +--- /dev/null +++ b/library/armv8ce_aes.c @@ -0,0 +1,142 @@ +/* @@ -320,7 +320,7 @@ Then run normal make or cmake etc. +#endif /* MBEDTLS_ARMV8CE_AES_C */ --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt -@@ -7,6 +7,7 @@ +@@ -15,6 +15,7 @@ set(src_crypto aesni.c arc4.c aria.c @@ -330,7 +330,7 @@ Then run normal make or cmake etc. base64.c --- a/library/gcm.c +++ b/library/gcm.c -@@ -71,6 +71,10 @@ +@@ -42,6 +42,10 @@ #include "mbedtls/aesni.h" #endif @@ -338,12 +338,12 @@ Then run normal make or cmake etc. +#include "mbedtls/armv8ce_aes.h" +#endif + - #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C) - #include "mbedtls/aes.h" - #include "mbedtls/platform.h" -@@ -140,6 +144,12 @@ - if( ( ret = mbedtls_cipher_update( &ctx->cipher_ctx, h, 16, h, &olen ) ) != 0 ) - return( ret ); + #if !defined(MBEDTLS_GCM_ALT) + + /* Parameter validation macros */ +@@ -80,6 +84,12 @@ static int gcm_gen_table(mbedtls_gcm_con + return ret; + } +#if defined(MBEDTLS_ARMV8CE_AES_C) + // we don't do feature testing with ARMv8 cryptography extensions @@ -352,9 +352,9 @@ Then run normal make or cmake etc. +#endif + /* pack h as two 64-bits ints, big-endian */ - GET_UINT32_BE( hi, h, 0 ); - GET_UINT32_BE( lo, h, 4 ); -@@ -248,6 +258,11 @@ + hi = MBEDTLS_GET_UINT32_BE(h, 0); + lo = MBEDTLS_GET_UINT32_BE(h, 4); +@@ -190,6 +200,11 @@ static void gcm_mult(mbedtls_gcm_context unsigned char lo, hi, rem; uint64_t zh, zl; @@ -363,22 +363,22 @@ Then run normal make or cmake etc. + return; +#endif + - #if defined(MBEDTLS_AESNI_C) && defined(MBEDTLS_HAVE_X86_64) - if( mbedtls_aesni_has_support( MBEDTLS_AESNI_CLMUL ) ) { + #if defined(MBEDTLS_AESNI_HAVE_CODE) + if (mbedtls_aesni_has_support(MBEDTLS_AESNI_CLMUL)) { unsigned char h[16]; --- a/library/Makefile +++ b/library/Makefile -@@ -65,6 +65,7 @@ - - OBJS_CRYPTO= aes.o aesni.o arc4.o \ - aria.o asn1parse.o asn1write.o \ -+ armv8ce_aes.o \ - base64.o bignum.o blowfish.o \ - camellia.o ccm.o chacha20.o \ - chachapoly.o cipher.o cipher_wrap.o \ +@@ -74,6 +74,7 @@ OBJS_CRYPTO= \ + aria.o \ + asn1parse.o \ + asn1write.o \ ++ armv8ce_aes.o \ + base64.o \ + bignum.o \ + blowfish.o \ --- a/library/version_features.c +++ b/library/version_features.c -@@ -586,6 +586,9 @@ +@@ -624,6 +624,9 @@ static const char * const features[] = { #if defined(MBEDTLS_AESNI_C) "MBEDTLS_AESNI_C", #endif /* MBEDTLS_AESNI_C */ diff --git a/openwrt-21.02/patches/immortalwrt/package/kernel/r8168/Makefile b/openwrt-23.05/patches/package/r8168/Makefile similarity index 58% rename from openwrt-21.02/patches/immortalwrt/package/kernel/r8168/Makefile rename to openwrt-23.05/patches/package/r8168/Makefile index fd5977a..1c1bf84 100644 --- a/openwrt-21.02/patches/immortalwrt/package/kernel/r8168/Makefile +++ b/openwrt-23.05/patches/package/r8168/Makefile @@ -7,48 +7,34 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=r8168 -PKG_VERSION:=8.049.02 -PKG_RELEASE:=$(AUTORELEAE) +PKG_VERSION:=8.051.02 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/BROBIRD/openwrt-r8168.git -PKG_SOURCE_DATE:=2021-10-08 -PKG_SOURCE_VERSION:=2b969c15afe403a685fc7ee069620782241e3ad6 -PKG_MIRROR_HASH:=e4632c10d460f005eff76da8a183d7ff0c8819b0d099872589b7b06a9b8d9952 +PKG_SOURCE_VERSION:=4f6cfe1ca12fb772deed57f1d2d1062af041ad07 +PKG_MIRROR_HASH:=6b149f5eb3b9e1dc50867a694984d253aa58d97dd5fbab30eb405d2d7b2be587 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) -MAKE_PATH:=src - include $(INCLUDE_DIR)/package.mk define KernelPackage/r8168 TITLE:=Driver for Realtek r8168 chipsets SUBMENU:=Network Devices VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) + DEPENDS:=@PCI_SUPPORT FILES:= $(PKG_BUILD_DIR)/src/r8168.ko AUTOLOAD:=$(call AutoProbe,r8168) CONFLICTS:=kmod-r8169 endef -define Package/r8168/description +define KernelPackage/r8168/description This package contains a driver for Realtek r8168 chipsets. endef -R8168_MAKEOPTS= -C $(PKG_BUILD_DIR)/src \ - PATH="$(TARGET_PATH)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - TARGET="$(HAL_TARGET)" \ - TOOLPREFIX="$(KERNEL_CROSS)" \ - TOOLPATH="$(KERNEL_CROSS)" \ - KERNELPATH="$(LINUX_DIR)" \ - KERNELDIR="$(LINUX_DIR)" \ - LDOPTS=" " \ - DOMULTI=1 - define Build/Compile - $(MAKE) $(R8168_MAKEOPTS) modules + +$(KERNEL_MAKE) M=$(PKG_BUILD_DIR)/src modules endef $(eval $(call KernelPackage,r8168)) diff --git a/openwrt-21.02/patches/immortalwrt/package/kernel/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch b/openwrt-23.05/patches/package/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch similarity index 87% rename from openwrt-21.02/patches/immortalwrt/package/kernel/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch rename to openwrt-23.05/patches/package/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch index 096d271..891cabe 100644 --- a/openwrt-21.02/patches/immortalwrt/package/kernel/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch +++ b/openwrt-23.05/patches/package/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -23482,6 +23483,22 @@ rtl8168_set_bios_setting(struct net_devi +@@ -24769,6 +24770,22 @@ rtl8168_set_bios_setting(struct net_devi } } @@ -31,7 +31,7 @@ static void rtl8168_init_software_variable(struct net_device *dev) { -@@ -24000,6 +24017,8 @@ rtl8168_init_software_variable(struct ne +@@ -25343,6 +25360,8 @@ rtl8168_init_software_variable(struct ne tp->NotWrMcuPatchCode = TRUE; } diff --git a/openwrt-21.02/patches/package/uboot-rockchip/Makefile b/openwrt-23.05/patches/package/uboot-rockchip/Makefile similarity index 82% rename from openwrt-21.02/patches/package/uboot-rockchip/Makefile rename to openwrt-23.05/patches/package/uboot-rockchip/Makefile index 486bc3c..ee3a07f 100644 --- a/openwrt-21.02/patches/package/uboot-rockchip/Makefile +++ b/openwrt-23.05/patches/package/uboot-rockchip/Makefile @@ -5,10 +5,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2021.07 +PKG_VERSION:=2022.07 PKG_RELEASE:=$(AUTORELEASE) -PKG_HASH:=312b7eeae44581d1362c3a3f02c28d806647756c82ba8c72241c7cdbe68ba77e +PKG_HASH:=92b08eb49c24da14c1adbf70a71ae8f37cc53eeb4230e859ad8b6733d13dcf5e PKG_MAINTAINER:=Tobias Maedel @@ -32,7 +32,6 @@ define U-Boot/nanopi-r2c-rk3328 DEPENDS:=+PACKAGE_u-boot-nanopi-r2c-rk3328:arm-trusted-firmware-rockchip PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip ATF:=rk3328_bl31.elf - OF_PLATDATA:=$(1) endef define U-Boot/nanopi-r2s-rk3328 @@ -43,7 +42,6 @@ define U-Boot/nanopi-r2s-rk3328 DEPENDS:=+PACKAGE_u-boot-nanopi-r2s-rk3328:arm-trusted-firmware-rockchip PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip ATF:=rk3328_bl31.elf - OF_PLATDATA:=$(1) endef @@ -94,15 +92,7 @@ UBOOT_MAKE_FLAGS += \ define Build/Configure $(call Build/Configure/U-Boot) -ifneq ($(OF_PLATDATA),) - mkdir -p $(PKG_BUILD_DIR)/tpl/dts - mkdir -p $(PKG_BUILD_DIR)/include/generated - - $(CP) $(PKG_BUILD_DIR)/of-platdata/$(OF_PLATDATA)/dt-plat.c $(PKG_BUILD_DIR)/tpl/dts/dt-plat.c - $(CP) $(PKG_BUILD_DIR)/of-platdata/$(OF_PLATDATA)/dt-structs-gen.h $(PKG_BUILD_DIR)/include/generated/dt-structs-gen.h - $(CP) $(PKG_BUILD_DIR)/of-platdata/$(OF_PLATDATA)/dt-decl.h $(PKG_BUILD_DIR)/include/generated/dt-decl.h -endif - + $(SED) 's/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/' $(PKG_BUILD_DIR)/.config $(SED) 's#CONFIG_MKIMAGE_DTC_PATH=.*#CONFIG_MKIMAGE_DTC_PATH="$(PKG_BUILD_DIR)/scripts/dtc/dtc"#g' $(PKG_BUILD_DIR)/.config echo 'CONFIG_IDENT_STRING=" OpenWrt"' >> $(PKG_BUILD_DIR)/.config endef diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/003-Revert-Makefile-Only-build-dtc-if-needed.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/003-Revert-Makefile-Only-build-dtc-if-needed.patch new file mode 100644 index 0000000..d6e9d31 --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/003-Revert-Makefile-Only-build-dtc-if-needed.patch @@ -0,0 +1,128 @@ +--- a/Makefile ++++ b/Makefile +@@ -413,13 +413,7 @@ PERL = perl + PYTHON ?= python + PYTHON2 = python2 + PYTHON3 ?= python3 +- +-# The devicetree compiler and pylibfdt are automatically built unless DTC is +-# provided. If DTC is provided, it is assumed the pylibfdt is available too. +-DTC_INTREE := $(objtree)/scripts/dtc/dtc +-DTC ?= $(DTC_INTREE) +-DTC_MIN_VERSION := 010406 +- ++DTC ?= $(objtree)/scripts/dtc/dtc + CHECK = sparse + + CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ +@@ -2060,29 +2054,9 @@ endif + + endif + +-# Check dtc and pylibfdt, if DTC is provided, else build them + PHONY += scripts_dtc + scripts_dtc: scripts_basic +- $(Q)if test "$(DTC)" = "$(DTC_INTREE)"; then \ +- $(MAKE) $(build)=scripts/dtc; \ +- else \ +- if ! $(DTC) -v >/dev/null; then \ +- echo '*** Failed to check dtc version: $(DTC)'; \ +- false; \ +- else \ +- if test "$(call dtc-version)" -lt $(DTC_MIN_VERSION); then \ +- echo '*** Your dtc is too old, please upgrade to dtc $(DTC_MIN_VERSION) or newer'; \ +- false; \ +- else \ +- if [ -n "$(CONFIG_PYLIBFDT)" ]; then \ +- if ! echo "import libfdt" | $(PYTHON3) 2>/dev/null; then \ +- echo '*** pylibfdt does not seem to be available with $(PYTHON3)'; \ +- false; \ +- fi; \ +- fi; \ +- fi; \ +- fi; \ +- fi ++ $(Q)$(MAKE) $(build)=scripts/dtc + + # --------------------------------------------------------------------------- + quiet_cmd_cpp_lds = LDS $@ +--- a/doc/build/gcc.rst ++++ b/doc/build/gcc.rst +@@ -131,27 +131,6 @@ Further important build parameters are + * O= - generate all output files in directory , including .config + * V=1 - verbose build + +-Devicetree compiler +-~~~~~~~~~~~~~~~~~~~ +- +-Boards that use `CONFIG_OF_CONTROL` (i.e. almost all of them) need the +-devicetree compiler (dtc). Those with `CONFIG_PYLIBFDT` need pylibfdt, a Python +-library for accessing devicetree data. Suitable versions of these are included +-in the U-Boot tree in `scripts/dtc` and built automatically as needed. +- +-To use the system versions of these, use the DTC parameter, for example +- +-.. code-block:: bash +- +- DTC=/usr/bin/dtc make +- +-In this case, dtc and pylibfdt are not built. The build checks that the version +-of dtc is new enough. It also makes sure that pylibfdt is present, if needed +-(see `scripts_dtc` in the Makefile). +- +-Note that the :doc:`tools` are always built with the included version of libfdt +-so it is not possible to build U-Boot tools with a system libfdt, at present. +- + Other build targets + ~~~~~~~~~~~~~~~~~~~ + +--- a/dts/Kconfig ++++ b/dts/Kconfig +@@ -5,6 +5,9 @@ + config SUPPORT_OF_CONTROL + bool + ++config DTC ++ bool ++ + config PYLIBFDT + bool + +@@ -21,6 +24,7 @@ menu "Device Tree Control" + + config OF_CONTROL + bool "Run-time configuration via Device Tree" ++ select DTC + select OF_LIBFDT if !OF_PLATDATA + select OF_REAL if !OF_PLATDATA + help +--- a/scripts/Makefile ++++ b/scripts/Makefile +@@ -9,4 +9,6 @@ hostprogs-$(CONFIG_BUILD_BIN2C) += bin2 + always := $(hostprogs-y) + + # Let clean descend into subdirs +-subdir- += basic kconfig dtc ++subdir- += basic kconfig ++subdir-$(CONFIG_DTC) += dtc ++ +--- a/scripts/dtc-version.sh ++++ b/scripts/dtc-version.sh +@@ -10,16 +10,11 @@ + dtc="$*" + + if [ ${#dtc} -eq 0 ]; then +- echo "Error: No dtc command specified" ++ echo "Error: No dtc command specified." + printf "Usage:\n\t$0 \n" + exit 1 + fi + +-if ! which $dtc >/dev/null ; then +- echo "Error: Cannot find dtc: $dtc" +- exit 1 +-fi +- + MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1) + MINOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 2) + PATCH=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 3 | cut -d - -f 1) diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/004-no-kwbimage.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/004-no-kwbimage.patch new file mode 100644 index 0000000..3e146c0 --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/004-no-kwbimage.patch @@ -0,0 +1,10 @@ +--- a/tools/Makefile ++++ b/tools/Makefile +@@ -117,7 +117,6 @@ dumpimage-mkimage-objs := aisimage.o \ + imximage.o \ + imx8image.o \ + imx8mimage.o \ +- kwbimage.o \ + lib/md5.o \ + lpc32xximage.o \ + mxsimage.o \ diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/005-fix-mkimage-host-build.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/005-fix-mkimage-host-build.patch new file mode 100644 index 0000000..8b110a8 --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/005-fix-mkimage-host-build.patch @@ -0,0 +1,24 @@ +--- a/tools/image-host.c ++++ b/tools/image-host.c +@@ -1122,6 +1122,7 @@ static int fit_config_add_verification_d + * 2) get public key (X509_get_pubkey) + * 3) provide der format (d2i_RSAPublicKey) + */ ++#ifdef CONFIG_TOOLS_LIBCRYPTO + static int read_pub_key(const char *keydir, const void *name, + unsigned char **pubkey, int *pubkey_len) + { +@@ -1175,6 +1176,13 @@ err_cert: + fclose(f); + return ret; + } ++#else ++static int read_pub_key(const char *keydir, const void *name, ++ unsigned char **pubkey, int *pubkey_len) ++{ ++ return -ENOSYS; ++} ++#endif + + int fit_pre_load_data(const char *keydir, void *keydest, void *fit) + { diff --git a/openwrt-21.02/patches/package/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch similarity index 87% rename from openwrt-21.02/patches/package/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch rename to openwrt-23.05/patches/package/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch index 2e3dc17..7202a94 100644 --- a/openwrt-21.02/patches/package/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch @@ -1,8 +1,6 @@ -diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile -index d3e89ca3ba..d5f64ac432 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -108,6 +108,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3308) += \ +@@ -124,6 +124,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3308) += \ dtb-$(CONFIG_ROCKCHIP_RK3328) += \ rk3328-evb.dtb \ @@ -10,9 +8,6 @@ index d3e89ca3ba..d5f64ac432 100644 rk3328-nanopi-r2s.dtb \ rk3328-orangepi-r1-plus.dtb \ rk3328-roc-cc.dtb \ -diff --git a/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi b/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi -new file mode 100644 -index 0000000000..c2e86d0f0e --- /dev/null +++ b/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi @@ -0,0 +1,7 @@ @@ -23,9 +18,6 @@ index 0000000000..c2e86d0f0e + */ + +#include "rk3328-nanopi-r2s-u-boot.dtsi" -diff --git a/arch/arm/dts/rk3328-nanopi-r2c.dts b/arch/arm/dts/rk3328-nanopi-r2c.dts -new file mode 100644 -index 0000000000..adf91a0306 --- /dev/null +++ b/arch/arm/dts/rk3328-nanopi-r2c.dts @@ -0,0 +1,47 @@ @@ -76,14 +68,15 @@ index 0000000000..adf91a0306 +&wan_led { + label = "nanopi-r2c:green:wan"; +}; -diff --git a/configs/nanopi-r2c-rk3328_defconfig b/configs/nanopi-r2c-rk3328_defconfig -new file mode 100644 -index 0000000000..7bc7a3274f --- /dev/null +++ b/configs/nanopi-r2c-rk3328_defconfig -@@ -0,0 +1,98 @@ +@@ -0,0 +1,103 @@ +CONFIG_ARM=y ++CONFIG_SKIP_LOWLEVEL_INIT=y ++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y ++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000 +CONFIG_ARCH_ROCKCHIP=y ++CONFIG_COUNTER_FREQUENCY=24000000 +CONFIG_SYS_TEXT_BASE=0x00200000 +CONFIG_SPL_GPIO_SUPPORT=y +CONFIG_NR_DRAM_BANKS=1 @@ -99,6 +92,7 @@ index 0000000000..7bc7a3274f +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_DEBUG_UART=y +CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 ++CONFIG_SYS_LOAD_ADDR=0x800800 +# CONFIG_ANDROID_BOOT_IMAGE is not set +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/301-rockchip-dw_mmc-support-to-disable-HS-mode-for-SPL.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/301-rockchip-dw_mmc-support-to-disable-HS-mode-for-SPL.patch new file mode 100644 index 0000000..604312c --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/301-rockchip-dw_mmc-support-to-disable-HS-mode-for-SPL.patch @@ -0,0 +1,26 @@ +From baecb10c4b34be29ca0aac97158d4cdbc84d76a0 Mon Sep 17 00:00:00 2001 +From: hmz007 +Date: Wed, 1 Dec 2021 16:45:27 +0800 +Subject: [PATCH 301/308] rockchip: dw_mmc: support to disable HS mode for SPL + +For rk3399, the highspeed mode doesn't work because of +the signal voltage remains at 1.8V after reboot. + +Signed-off-by: hmz007 +--- + drivers/mmc/rockchip_dw_mmc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/mmc/rockchip_dw_mmc.c ++++ b/drivers/mmc/rockchip_dw_mmc.c +@@ -147,6 +147,10 @@ static int rockchip_dwmmc_probe(struct u + } + #endif + dwmci_setup_cfg(&plat->cfg, host, priv->minmax[1], priv->minmax[0]); ++#ifdef CONFIG_SPL_BUILD ++ if (dev_read_bool(dev, "u-boot,spl-broken-hs")) ++ plat->cfg.host_caps &= ~MMC_MODE_HS; ++#endif + host->mmc = &plat->mmc; + host->mmc->priv = &priv->host; + host->mmc->dev = dev; diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/302-arm64-dts-rk3399-nanopi4-Add-u-boot-spl-broken-hs.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/302-arm64-dts-rk3399-nanopi4-Add-u-boot-spl-broken-hs.patch new file mode 100644 index 0000000..7797b0c --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/302-arm64-dts-rk3399-nanopi4-Add-u-boot-spl-broken-hs.patch @@ -0,0 +1,19 @@ +From c608d2fd04cb4973f75082807e5df0653fc6e819 Mon Sep 17 00:00:00 2001 +From: hmz007 +Date: Wed, 1 Dec 2021 18:20:37 +0800 +Subject: [PATCH 302/308] arm64: dts: rk3399-nanopi4: Add u-boot,spl-broken-hs + +Signed-off-by: hmz007 +--- + arch/arm/dts/rk3399-nanopi4-u-boot.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm/dts/rk3399-nanopi4-u-boot.dtsi ++++ b/arch/arm/dts/rk3399-nanopi4-u-boot.dtsi +@@ -13,4 +13,6 @@ + + &sdmmc { + pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc_cd>; ++ ++ u-boot,spl-broken-hs; + }; diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/303-rockchip-rk3328-add-mmc-aliases-for-nanopi-r2s.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/303-rockchip-rk3328-add-mmc-aliases-for-nanopi-r2s.patch new file mode 100644 index 0000000..1c4ab53 --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/303-rockchip-rk3328-add-mmc-aliases-for-nanopi-r2s.patch @@ -0,0 +1,29 @@ +From b8d642fadf95508f3a728a995b6892467deb1097 Mon Sep 17 00:00:00 2001 +From: hmz007 +Date: Tue, 4 Jan 2022 14:54:20 +0800 +Subject: [PATCH 303/308] rockchip: rk3328: add mmc aliases for nanopi-r2s + +Signed-off-by: hmz007 +--- + arch/arm/dts/rk3328-nanopi-r2s-u-boot.dtsi | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/arm/dts/rk3328-nanopi-r2s-u-boot.dtsi b/arch/arm/dts/rk3328-nanopi-r2s-u-boot.dtsi +index 9e2ced1541..df692ec30a 100644 +--- a/arch/arm/dts/rk3328-nanopi-r2s-u-boot.dtsi ++++ b/arch/arm/dts/rk3328-nanopi-r2s-u-boot.dtsi +@@ -7,6 +7,11 @@ + #include "rk3328-u-boot.dtsi" + #include "rk3328-sdram-ddr4-666.dtsi" + / { ++ aliases { ++ mmc0 = &sdmmc; ++ mmc1 = &emmc; ++ }; ++ + chosen { + u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc; + }; +-- +2.34.1 + diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/304-mmc-dw_mmc-Fixes-timeout-issue-for-FIFO-mode.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/304-mmc-dw_mmc-Fixes-timeout-issue-for-FIFO-mode.patch new file mode 100644 index 0000000..f95e64a --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/304-mmc-dw_mmc-Fixes-timeout-issue-for-FIFO-mode.patch @@ -0,0 +1,31 @@ +From 6a662654973ff75baa44288829142eed4ed5a411 Mon Sep 17 00:00:00 2001 +From: hmz007 +Date: Tue, 11 Jan 2022 16:22:04 +0800 +Subject: [PATCH 304/308] mmc: dw_mmc: Fixes timeout issue for FIFO mode + +Clearing the DTO interrupt should be unnecessary, and it would +potentially result in never receiving this interrupt again. + +Do power-on or reset from uboot for a while can reproduce the issue: + dwmci_data_transfer: Timeout waiting for data! + mmc_load_image_raw_sector: mmc block read error + +Tested on NanoPi R4S with SanDisk Extreme PRO 32GB. + +Fixes: 8cb9d3ed3a ("mmc: dw_mmc: Fixes data read when receiving DTO interrupt in FIFO mode") +Signed-off-by: hmz007 +--- + drivers/mmc/dw_mmc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mmc/dw_mmc.c ++++ b/drivers/mmc/dw_mmc.c +@@ -168,7 +168,7 @@ static int dwmci_data_transfer(struct dw + if (data->flags == MMC_DATA_READ && + (mask & (DWMCI_INTMSK_RXDR | DWMCI_INTMSK_DTO))) { + dwmci_writel(host, DWMCI_RINTSTS, +- DWMCI_INTMSK_RXDR | DWMCI_INTMSK_DTO); ++ DWMCI_INTMSK_RXDR); + while (size) { + ret = dwmci_fifo_ready(host, + DWMCI_FIFO_EMPTY, diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/305-common-bouncebuf-Add-arch_addr_aligned-hook-for-rk33.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/305-common-bouncebuf-Add-arch_addr_aligned-hook-for-rk33.patch new file mode 100644 index 0000000..3de2118 --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/305-common-bouncebuf-Add-arch_addr_aligned-hook-for-rk33.patch @@ -0,0 +1,78 @@ +From 7b108ebc5f9ac82487ad17dea0ae7163285d906f Mon Sep 17 00:00:00 2001 +From: hmz007 +Date: Wed, 12 Jan 2022 10:59:31 +0800 +Subject: [PATCH 305/308] common: bouncebuf: Add arch_addr_aligned() hook for + rk3399 + +As described in rk3399-u-boot.dtsi ("mmc to sram can't do dma"), +this restrict can be sorted out by adding a hook and returning +the non-DRAM area as Unaligned (0) in rk3399's implementation. + +Then we can enable DMA mode and save about 200ms of SPL boot. + +Signed-off-by: hmz007 +--- + arch/arm/dts/rk3399-u-boot.dtsi | 3 --- + arch/arm/mach-rockchip/rk3399/rk3399.c | 13 +++++++++++++ + common/bouncebuf.c | 9 +++++++-- + 3 files changed, 20 insertions(+), 5 deletions(-) + +--- a/arch/arm/dts/rk3399-u-boot.dtsi ++++ b/arch/arm/dts/rk3399-u-boot.dtsi +@@ -119,9 +119,6 @@ + + &sdmmc { + u-boot,dm-pre-reloc; +- +- /* mmc to sram can't do dma, prevent aborts transferring TF-A parts */ +- u-boot,spl-fifo-mode; + }; + + &spi1 { +--- a/arch/arm/mach-rockchip/rk3399/rk3399.c ++++ b/arch/arm/mach-rockchip/rk3399/rk3399.c +@@ -111,6 +111,19 @@ int arch_cpu_init(void) + return 0; + } + ++int arch_addr_aligned(void *ubuf) ++{ ++#define DRAM_END 0xf8000000 ++ ++ if ((uintptr_t)ubuf < DRAM_END) { ++ /* Aligned for DRAM area */ ++ return 1; ++ } ++ ++ debug("Unsupported buffer for DMA transfer\n"); ++ return 0; ++} ++ + #ifdef CONFIG_DEBUG_UART_BOARD_INIT + void board_debug_uart_init(void) + { +--- a/common/bouncebuf.c ++++ b/common/bouncebuf.c +@@ -13,6 +13,12 @@ + #include + #include + ++__weak int arch_addr_aligned(void *ubuf) ++{ ++ /* Aligned */ ++ return 1; ++} ++ + static int addr_aligned(struct bounce_buffer *state) + { + const ulong align_mask = ARCH_DMA_MINALIGN - 1; +@@ -29,8 +35,7 @@ static int addr_aligned(struct bounce_bu + return 0; + } + +- /* Aligned */ +- return 1; ++ return arch_addr_aligned(state->user_buffer); + } + + int bounce_buffer_start_extalign(struct bounce_buffer *state, void *data, diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/306-arm64-rk3399-r4s-disable-nodes-for-vopb-vopl.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/306-arm64-rk3399-r4s-disable-nodes-for-vopb-vopl.patch new file mode 100644 index 0000000..f2bfded --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/306-arm64-rk3399-r4s-disable-nodes-for-vopb-vopl.patch @@ -0,0 +1,36 @@ +From 8a8b3ef12c68ad662223aefb4a46b1ca43e23482 Mon Sep 17 00:00:00 2001 +From: hmz007 +Date: Wed, 12 Jan 2022 11:00:08 +0800 +Subject: [PATCH 306/308] arm64: rk3399: r4s: disable nodes for vopb/vopl + +Disable vopb and vopl to fix: + rk3399_vop vop@ff8f0000: failed to get ahb reset (ret=-524) + rk3399_vop vop@ff8f0000: failed to get ahb reset (ret=-524) + +Signed-off-by: hmz007 +--- + arch/arm/dts/rk3399-nanopi-r4s.dts | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/arch/arm/dts/rk3399-nanopi-r4s.dts ++++ b/arch/arm/dts/rk3399-nanopi-r4s.dts +@@ -131,3 +131,19 @@ + &vcc3v3_sys { + vin-supply = <&vcc5v0_sys>; + }; ++ ++&vopb { ++ status = "disabled"; ++}; ++ ++&vopb_mmu { ++ status = "disabled"; ++}; ++ ++&vopl { ++ status = "disabled"; ++}; ++ ++&vopl_mmu { ++ status = "disabled"; ++}; diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/307-configs-Add-CONFIG_SYS_MMC_ENV_DEV-1-for-nanopi-r4s.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/307-configs-Add-CONFIG_SYS_MMC_ENV_DEV-1-for-nanopi-r4s.patch new file mode 100644 index 0000000..e105563 --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/307-configs-Add-CONFIG_SYS_MMC_ENV_DEV-1-for-nanopi-r4s.patch @@ -0,0 +1,20 @@ +From 92c1bcf0983464f7bcc9e38bc2a6edccc239bd93 Mon Sep 17 00:00:00 2001 +From: hmz007 +Date: Wed, 12 Jan 2022 11:00:21 +0800 +Subject: [PATCH 307/308] configs: Add CONFIG_SYS_MMC_ENV_DEV=1 for nanopi-r4s + +Signed-off-by: hmz007 +--- + configs/nanopi-r4s-rk3399_defconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/configs/nanopi-r4s-rk3399_defconfig ++++ b/configs/nanopi-r4s-rk3399_defconfig +@@ -27,6 +27,7 @@ CONFIG_SPL_OF_CONTROL=y + CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" + CONFIG_ENV_IS_IN_MMC=y + CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_SYS_MMC_ENV_DEV=1 + CONFIG_ROCKCHIP_GPIO=y + CONFIG_SYS_I2C_ROCKCHIP=y + CONFIG_MMC_DW=y diff --git a/openwrt-23.05/patches/package/uboot-rockchip/patches/308-rockchip-rk3328-Implement-arch_addr_aligned-hook.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/308-rockchip-rk3328-Implement-arch_addr_aligned-hook.patch new file mode 100644 index 0000000..758b11c --- /dev/null +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/308-rockchip-rk3328-Implement-arch_addr_aligned-hook.patch @@ -0,0 +1,52 @@ +From 886a84ea1a0e501fd168ad779ca54aecc70f8f4d Mon Sep 17 00:00:00 2001 +From: hmz007 +Date: Wed, 12 Jan 2022 11:21:37 +0800 +Subject: [PATCH 308/308] rockchip: rk3328: Implement arch_addr_aligned() hook + +Signed-off-by: hmz007 +--- + arch/arm/dts/rk3328-u-boot.dtsi | 6 ------ + arch/arm/mach-rockchip/rk3328/rk3328.c | 13 +++++++++++++ + 2 files changed, 13 insertions(+), 6 deletions(-) + +--- a/arch/arm/dts/rk3328-u-boot.dtsi ++++ b/arch/arm/dts/rk3328-u-boot.dtsi +@@ -52,16 +52,10 @@ + + &emmc { + u-boot,dm-pre-reloc; +- +- /* mmc to sram can't do dma, prevent aborts transfering TF-A parts */ +- u-boot,spl-fifo-mode; + }; + + &sdmmc { + u-boot,dm-pre-reloc; +- +- /* mmc to sram can't do dma, prevent aborts transfering TF-A parts */ +- u-boot,spl-fifo-mode; + }; + + &usb20_otg { +--- a/arch/arm/mach-rockchip/rk3328/rk3328.c ++++ b/arch/arm/mach-rockchip/rk3328/rk3328.c +@@ -58,6 +58,19 @@ int arch_cpu_init(void) + return 0; + } + ++int arch_addr_aligned(void *ubuf) ++{ ++#define DRAM_END 0xff000000 ++ ++ if ((uintptr_t)ubuf < DRAM_END) { ++ /* Aligned for DRAM area */ ++ return 1; ++ } ++ ++ debug("Unsupported buffer for DMA transfer\n"); ++ return 0; ++} ++ + void board_debug_uart_init(void) + { + struct rk3328_grf_regs * const grf = (void *)GRF_BASE; diff --git a/openwrt-21.02/patches/package/uboot-rockchip/patches/203-ram-rk3399-Add-support-for-multiple-DDR-types.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/309-ram-rk3399-Add-support-for-multiple-DDR-types-v2.patch similarity index 73% rename from openwrt-21.02/patches/package/uboot-rockchip/patches/203-ram-rk3399-Add-support-for-multiple-DDR-types.patch rename to openwrt-23.05/patches/package/uboot-rockchip/patches/309-ram-rk3399-Add-support-for-multiple-DDR-types-v2.patch index a979584..315ae69 100644 --- a/openwrt-21.02/patches/package/uboot-rockchip/patches/203-ram-rk3399-Add-support-for-multiple-DDR-types.patch +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/309-ram-rk3399-Add-support-for-multiple-DDR-types-v2.patch @@ -1,14 +1,14 @@ -From 1bc90230df5cd55513268f2f7a43abdbad1161b5 Mon Sep 17 00:00:00 2001 -From: hmz007 -Date: Sat, 19 Dec 2020 19:39:14 +0800 -Subject: [PATCH 3/4] ram: rk3399: Add support for multiple DDR types +From c82588ad68829f74ed1f411b58999ab11e849634 Mon Sep 17 00:00:00 2001 +From: Jensen Huang +Date: Fri, 26 Aug 2022 13:39:20 +0800 +Subject: [PATCH 1/2] ram: rk3399: Add support for multiple DDR types (v2) Move rockchip,sdram-params to named subnode to include multiple sdram parameters, and then read the parameters (by subnode name, first subnode or current node) before rk3399_dmc_init(). -Signed-off-by: hmz007 +Signed-off-by: Jensen Huang --- arch/arm/dts/rk3399-sdram-ddr3-1333.dtsi | 6 ++- arch/arm/dts/rk3399-sdram-ddr3-1600.dtsi | 5 +- @@ -17,11 +17,10 @@ Signed-off-by: hmz007 .../arm/dts/rk3399-sdram-lpddr3-4GB-1600.dtsi | 3 ++ .../rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi | 3 ++ arch/arm/dts/rk3399-sdram-lpddr4-100.dtsi | 3 ++ + drivers/ram/rockchip/sdram_common.c | 2 + drivers/ram/rockchip/sdram_rk3399.c | 49 +++++++++++++++---- - 8 files changed, 64 insertions(+), 14 deletions(-) + 9 files changed, 66 insertions(+), 14 deletions(-) -diff --git a/arch/arm/dts/rk3399-sdram-ddr3-1333.dtsi b/arch/arm/dts/rk3399-sdram-ddr3-1333.dtsi -index 7fae249536..dad5b7fbd4 100644 --- a/arch/arm/dts/rk3399-sdram-ddr3-1333.dtsi +++ b/arch/arm/dts/rk3399-sdram-ddr3-1333.dtsi @@ -4,7 +4,9 @@ @@ -42,8 +41,6 @@ index 7fae249536..dad5b7fbd4 100644 + }; }; - -diff --git a/arch/arm/dts/rk3399-sdram-ddr3-1600.dtsi b/arch/arm/dts/rk3399-sdram-ddr3-1600.dtsi -index 23c7c34a9a..238f667a76 100644 --- a/arch/arm/dts/rk3399-sdram-ddr3-1600.dtsi +++ b/arch/arm/dts/rk3399-sdram-ddr3-1600.dtsi @@ -4,7 +4,9 @@ @@ -63,8 +60,6 @@ index 23c7c34a9a..238f667a76 100644 >; + }; }; -diff --git a/arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi b/arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi -index ea029ca90a..7f6b95fe42 100644 --- a/arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi +++ b/arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi @@ -4,7 +4,9 @@ @@ -85,8 +80,6 @@ index ea029ca90a..7f6b95fe42 100644 + }; }; - -diff --git a/arch/arm/dts/rk3399-sdram-lpddr3-2GB-1600.dtsi b/arch/arm/dts/rk3399-sdram-lpddr3-2GB-1600.dtsi -index 7296dbb80e..a83564794e 100644 --- a/arch/arm/dts/rk3399-sdram-lpddr3-2GB-1600.dtsi +++ b/arch/arm/dts/rk3399-sdram-lpddr3-2GB-1600.dtsi @@ -5,6 +5,8 @@ @@ -104,8 +97,6 @@ index 7296dbb80e..a83564794e 100644 >; + }; }; -diff --git a/arch/arm/dts/rk3399-sdram-lpddr3-4GB-1600.dtsi b/arch/arm/dts/rk3399-sdram-lpddr3-4GB-1600.dtsi -index bf429c21e4..537936c6fb 100644 --- a/arch/arm/dts/rk3399-sdram-lpddr3-4GB-1600.dtsi +++ b/arch/arm/dts/rk3399-sdram-lpddr3-4GB-1600.dtsi @@ -4,6 +4,8 @@ @@ -123,8 +114,6 @@ index bf429c21e4..537936c6fb 100644 >; + }; }; -diff --git a/arch/arm/dts/rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi b/arch/arm/dts/rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi -index 96f459fd0b..a0acdb5add 100644 --- a/arch/arm/dts/rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi +++ b/arch/arm/dts/rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi @@ -4,6 +4,8 @@ @@ -142,8 +131,6 @@ index 96f459fd0b..a0acdb5add 100644 >; + }; }; -diff --git a/arch/arm/dts/rk3399-sdram-lpddr4-100.dtsi b/arch/arm/dts/rk3399-sdram-lpddr4-100.dtsi -index f0c478d189..21d212236f 100644 --- a/arch/arm/dts/rk3399-sdram-lpddr4-100.dtsi +++ b/arch/arm/dts/rk3399-sdram-lpddr4-100.dtsi @@ -6,6 +6,8 @@ @@ -161,11 +148,20 @@ index f0c478d189..21d212236f 100644 >; + }; }; -diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c -index 530c8a2f40..db30105989 100644 +--- a/drivers/ram/rockchip/sdram_common.c ++++ b/drivers/ram/rockchip/sdram_common.c +@@ -396,6 +396,8 @@ int sdram_detect_cs1_row(struct sdram_ca + + if (cap_info->rank == 2) { + cs0_cap = sdram_get_cs_cap(cap_info, 0, dram_type); ++ if (cap_info->row_3_4) ++ cs0_cap = cs0_cap * 3 / 4; + + if (dram_type == DDR4) { + if (cap_info->dbw == 0) --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c -@@ -1625,7 +1625,6 @@ static void set_ddr_stride(struct rk3399_pmusgrf_regs *pmusgrf, u32 stride) +@@ -1625,7 +1625,6 @@ static void set_ddr_stride(struct rk3399 rk_clrsetreg(&pmusgrf->soc_con4, 0x1f << 10, stride << 10); } @@ -173,7 +169,7 @@ index 530c8a2f40..db30105989 100644 static int data_training_first(struct dram_info *dram, u32 channel, u8 rank, struct rk3399_sdram_params *params) { -@@ -1715,8 +1714,8 @@ void modify_param(const struct chan_info *chan, +@@ -1715,8 +1714,8 @@ void modify_param(const struct chan_info clrsetbits_le32(&denali_pi_params[76], 0x1 << 24, 0x1 << 24); clrsetbits_le32(&denali_pi_params[77], 0x1, 0x1); } @@ -183,7 +179,7 @@ index 530c8a2f40..db30105989 100644 struct rk3399_sdram_params dfs_cfgs_lpddr4[] = { #include "sdram-rk3399-lpddr4-400.inc" #include "sdram-rk3399-lpddr4-800.inc" -@@ -3011,20 +3010,40 @@ static int sdram_init(struct dram_info *dram, +@@ -3011,22 +3010,42 @@ static int sdram_init(struct dram_info * return 0; } @@ -194,20 +190,22 @@ index 530c8a2f40..db30105989 100644 + static int rk3399_dmc_of_to_plat(struct udevice *dev) { - #if !CONFIG_IS_ENABLED(OF_PLATDATA) struct rockchip_dmc_plat *plat = dev_get_plat(dev); -+ ofnode node = { .np = NULL }; ++ ofnode node = ofnode_null(); + const char *name; int ret; + if (!CONFIG_IS_ENABLED(OF_REAL)) + return 0; + - ret = dev_read_u32_array(dev, "rockchip,sdram-params", - (u32 *)&plat->sdram_params, - sizeof(plat->sdram_params) / sizeof(u32)); -+ name = rk3399_get_ddrtype(); ++ name = rk3399_get_ddrtype(); printf("DDR type: %s\n", name); + if (name) + node = dev_read_subnode(dev, name); + if (!ofnode_valid(node)) { -+ debug("Failed to read subnode %s\n", name); ++ debug("Failed to read subnode %s\n", name ? : ""); + node = dev_read_first_subnode(dev); + } + @@ -227,7 +225,7 @@ index 530c8a2f40..db30105989 100644 ret = regmap_init_mem(dev_ofnode(dev), &plat->map); if (ret) printf("%s: regmap failed %d\n", __func__, ret); -@@ -3051,18 +3070,20 @@ static int conv_of_platdata(struct udevice *dev) +@@ -3051,18 +3070,20 @@ static int conv_of_plat(struct udevice * #endif static const struct sdram_rk3399_ops rk3399_ops = { @@ -251,7 +249,7 @@ index 530c8a2f40..db30105989 100644 static int rk3399_dmc_init(struct udevice *dev) { -@@ -3081,7 +3102,17 @@ static int rk3399_dmc_init(struct udevice *dev) +@@ -3081,7 +3102,17 @@ static int rk3399_dmc_init(struct udevic return ret; #endif @@ -270,6 +268,3 @@ index 530c8a2f40..db30105989 100644 priv->cic = syscon_get_first_range(ROCKCHIP_SYSCON_CIC); priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); priv->pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU); --- -2.25.1 - diff --git a/openwrt-21.02/patches/package/uboot-rockchip/patches/202-rockchip-rk3399-split-nanopi-r4s-out-of-evb_rk3399.patch b/openwrt-23.05/patches/package/uboot-rockchip/patches/310-rockchip-rk3399-split-nanopi-r4s-out-of-evb_rk3399.patch similarity index 84% rename from openwrt-21.02/patches/package/uboot-rockchip/patches/202-rockchip-rk3399-split-nanopi-r4s-out-of-evb_rk3399.patch rename to openwrt-23.05/patches/package/uboot-rockchip/patches/310-rockchip-rk3399-split-nanopi-r4s-out-of-evb_rk3399.patch index ebdca08..018a056 100644 --- a/openwrt-21.02/patches/package/uboot-rockchip/patches/202-rockchip-rk3399-split-nanopi-r4s-out-of-evb_rk3399.patch +++ b/openwrt-23.05/patches/package/uboot-rockchip/patches/310-rockchip-rk3399-split-nanopi-r4s-out-of-evb_rk3399.patch @@ -1,23 +1,25 @@ -From 244492a7a5451eca042d3ec7ccff8de6e23dd288 Mon Sep 17 00:00:00 2001 -From: hmz007 -Date: Fri, 18 Dec 2020 17:10:35 +0800 -Subject: [PATCH 2/4] rockchip: rk3399: split nanopi-r4s out of evb_rk3399 +From 329da1fe7c952bbda56a9ee18bc42d8a9a7ed97f Mon Sep 17 00:00:00 2001 +From: Jensen Huang +Date: Fri, 26 Aug 2022 14:41:41 +0800 +Subject: [PATCH 2/2] rockchip: rk3399: split nanopi-r4s out of evb_rk3399 -Signed-off-by: hmz007 +And now it's ready for NanoPi R4SE. + +Signed-off-by: Jensen Huang --- - arch/arm/mach-rockchip/rk3399/Kconfig | 6 + - board/friendlyarm/nanopi4/Kconfig | 15 +++ - board/friendlyarm/nanopi4/MAINTAINERS | 6 + - board/friendlyarm/nanopi4/Makefile | 8 ++ - board/friendlyarm/nanopi4/README | 122 +++++++++++++++++++ - board/friendlyarm/nanopi4/hwrev.c | 149 ++++++++++++++++++++++++ - board/friendlyarm/nanopi4/hwrev.h | 27 +++++ - board/friendlyarm/nanopi4/nanopi4.c | 148 +++++++++++++++++++++++ - configs/nanopi-r4s-4gb-rk3399_defconfig | 4 +- - configs/nanopi-r4s-rk3399_defconfig | 4 +- - drivers/clk/rockchip/clk_rk3399.c | 2 + - include/configs/nanopi4.h | 24 ++++ - 12 files changed, 511 insertions(+), 4 deletions(-) + arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi | 2 + + arch/arm/mach-rockchip/rk3399/Kconfig | 6 + + board/friendlyarm/nanopi4/Kconfig | 15 ++ + board/friendlyarm/nanopi4/MAINTAINERS | 6 + + board/friendlyarm/nanopi4/Makefile | 8 + + board/friendlyarm/nanopi4/README | 122 ++++++++++++++ + board/friendlyarm/nanopi4/hwrev.c | 187 +++++++++++++++++++++ + board/friendlyarm/nanopi4/hwrev.h | 27 +++ + board/friendlyarm/nanopi4/nanopi4.c | 150 +++++++++++++++++ + configs/nanopi-r4s-rk3399_defconfig | 4 +- + drivers/clk/rockchip/clk_rk3399.c | 2 + + include/configs/nanopi4.h | 24 +++ + 12 files changed, 551 insertions(+), 2 deletions(-) create mode 100644 board/friendlyarm/nanopi4/Kconfig create mode 100644 board/friendlyarm/nanopi4/MAINTAINERS create mode 100644 board/friendlyarm/nanopi4/Makefile @@ -27,8 +29,14 @@ Signed-off-by: hmz007 create mode 100644 board/friendlyarm/nanopi4/nanopi4.c create mode 100644 include/configs/nanopi4.h -diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig -index 17628f9171..2a44aae43c 100644 +--- a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi ++++ b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi +@@ -14,3 +14,5 @@ + + #include "rk3399-nanopi4-u-boot.dtsi" + #include "rk3399-sdram-lpddr4-100.dtsi" ++#include "rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi" ++#include "rk3399-sdram-ddr3-1866.dtsi" --- a/arch/arm/mach-rockchip/rk3399/Kconfig +++ b/arch/arm/mach-rockchip/rk3399/Kconfig @@ -109,6 +109,11 @@ config TARGET_ROC_PC_RK3399 @@ -51,9 +59,6 @@ index 17628f9171..2a44aae43c 100644 source "board/google/gru/Kconfig" source "board/pine64/pinebook-pro-rk3399/Kconfig" source "board/pine64/rockpro64_rk3399/Kconfig" -diff --git a/board/friendlyarm/nanopi4/Kconfig b/board/friendlyarm/nanopi4/Kconfig -new file mode 100644 -index 0000000000..f3f9dd7b56 --- /dev/null +++ b/board/friendlyarm/nanopi4/Kconfig @@ -0,0 +1,15 @@ @@ -72,9 +77,6 @@ index 0000000000..f3f9dd7b56 + def_bool y + +endif -diff --git a/board/friendlyarm/nanopi4/MAINTAINERS b/board/friendlyarm/nanopi4/MAINTAINERS -new file mode 100644 -index 0000000000..b4c35701d6 --- /dev/null +++ b/board/friendlyarm/nanopi4/MAINTAINERS @@ -0,0 +1,6 @@ @@ -84,9 +86,6 @@ index 0000000000..b4c35701d6 +F: board/friendlyarm/nanopi4/ +F: include/configs/nanopi4.h +F: configs/nanopi4_defconfig -diff --git a/board/friendlyarm/nanopi4/Makefile b/board/friendlyarm/nanopi4/Makefile -new file mode 100644 -index 0000000000..33a1466567 --- /dev/null +++ b/board/friendlyarm/nanopi4/Makefile @@ -0,0 +1,8 @@ @@ -98,9 +97,6 @@ index 0000000000..33a1466567 +# + +obj-y += nanopi4.o hwrev.o -diff --git a/board/friendlyarm/nanopi4/README b/board/friendlyarm/nanopi4/README -new file mode 100644 -index 0000000000..c6f58203eb --- /dev/null +++ b/board/friendlyarm/nanopi4/README @@ -0,0 +1,122 @@ @@ -226,12 +222,9 @@ index 0000000000..c6f58203eb +You should be able to get U-Boot log in console/UART2(baurdrate 1500000) +For more detail, please reference to: +http://opensource.rock-chips.com/wiki_Boot_option -diff --git a/board/friendlyarm/nanopi4/hwrev.c b/board/friendlyarm/nanopi4/hwrev.c -new file mode 100644 -index 0000000000..9199a927ee --- /dev/null +++ b/board/friendlyarm/nanopi4/hwrev.c -@@ -0,0 +1,149 @@ +@@ -0,0 +1,187 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2020 FriendlyElec Computer Tech. Co., Ltd. @@ -335,9 +328,14 @@ index 0000000000..9199a927ee + * Group A: + * 0x04 - NanoPi NEO4 + * 0x06 - SOC-RK3399 ++ * 0x07 - SOC-RK3399 V2 ++ * 0x09 - NanoPi R4S 1GB ++ * 0x0A - NanoPi R4S 4GB ++ * 0x0B - NanoPi R4SE + * + * Group B: + * 0x21 - NanoPi M4 Ver2.0 ++ * 0x22 - NanoPi M4B + */ +static int pcb_rev = -1; + @@ -375,15 +373,45 @@ index 0000000000..9199a927ee + } +} + ++#ifdef CONFIG_SPL_BUILD ++static struct board_ddrtype { ++ int rev; ++ const char *type; ++} ddrtypes[] = { ++ { 0x00, "lpddr3-samsung-4GB-1866" }, ++ { 0x01, "lpddr3-samsung-4GB-1866" }, ++ { 0x04, "ddr3-1866" }, ++ { 0x06, "ddr3-1866" }, ++ { 0x07, "lpddr4-100" }, ++ { 0x09, "ddr3-1866" }, ++ { 0x0a, "lpddr4-100" }, ++ { 0x0b, "lpddr4-100" }, ++ { 0x21, "lpddr4-100" }, ++ { 0x22, "ddr3-1866" }, ++}; ++ ++const char *rk3399_get_ddrtype(void) { ++ int i; ++ ++ bd_hwrev_init(); ++ printf("Board: rev%02x\n", pcb_rev); ++ ++ for (i = 0; i < ARRAY_SIZE(ddrtypes); i++) { ++ if (ddrtypes[i].rev == pcb_rev) ++ return ddrtypes[i].type; ++ } ++ ++ /* fallback to first subnode (ie, first included dtsi) */ ++ return NULL; ++} ++#endif ++ +/* To override __weak symbols */ +u32 get_board_rev(void) +{ + return pcb_rev; +} + -diff --git a/board/friendlyarm/nanopi4/hwrev.h b/board/friendlyarm/nanopi4/hwrev.h -new file mode 100644 -index 0000000000..23b3c7a557 --- /dev/null +++ b/board/friendlyarm/nanopi4/hwrev.h @@ -0,0 +1,27 @@ @@ -414,12 +442,9 @@ index 0000000000..23b3c7a557 +extern u32 get_board_rev(void); + +#endif /* __BD_HW_REV_H__ */ -diff --git a/board/friendlyarm/nanopi4/nanopi4.c b/board/friendlyarm/nanopi4/nanopi4.c -new file mode 100644 -index 0000000000..a140370ca2 --- /dev/null +++ b/board/friendlyarm/nanopi4/nanopi4.c -@@ -0,0 +1,148 @@ +@@ -0,0 +1,150 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2020 FriendlyElec Computer Tech. Co., Ltd. @@ -445,6 +470,8 @@ index 0000000000..a140370ca2 +#include +#include + ++#include "hwrev.h" ++ +#ifdef CONFIG_MISC_INIT_R +static void setup_iodomain(void) +{ @@ -568,20 +595,17 @@ index 0000000000..a140370ca2 + serialnr->low = (u32)(serial & 0xffffffff); +} +#endif -diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig -index 034241f209..b67f7c0dc9 100644 --- a/configs/nanopi-r4s-rk3399_defconfig +++ b/configs/nanopi-r4s-rk3399_defconfig -@@ -4,13 +4,13 @@ CONFIG_SYS_TEXT_BASE=0x00200000 - CONFIG_NR_DRAM_BANKS=1 +@@ -6,13 +6,13 @@ CONFIG_NR_DRAM_BANKS=1 CONFIG_ENV_OFFSET=0x3F8000 --CONFIG_DEFAULT_DEVICE_TREE="rk3399-nanopi-r4s" + CONFIG_DEFAULT_DEVICE_TREE="rk3399-nanopi-r4s" CONFIG_ROCKCHIP_RK3399=y -CONFIG_TARGET_EVB_RK3399=y +CONFIG_TARGET_NANOPI4=y CONFIG_DEBUG_UART_BASE=0xFF1A0000 CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_DEFAULT_DEVICE_TREE="rk3399-nanopi-r4s" + CONFIG_SYS_LOAD_ADDR=0x800800 CONFIG_DEBUG_UART=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopi-r4s.dtb" -CONFIG_DISPLAY_BOARDINFO_LATE=y @@ -589,22 +613,17 @@ index 034241f209..b67f7c0dc9 100644 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 -diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c -index 22c373a623..38975c0c65 100644 --- a/drivers/clk/rockchip/clk_rk3399.c +++ b/drivers/clk/rockchip/clk_rk3399.c -@@ -1351,6 +1351,8 @@ static void rkclk_init(struct rockchip_cru *cru) +@@ -1372,6 +1372,8 @@ static void rkclk_init(struct rockchip_c pclk_div << PCLK_PERILP1_DIV_CON_SHIFT | hclk_div << HCLK_PERILP1_DIV_CON_SHIFT | HCLK_PERILP1_PLL_SEL_GPLL << HCLK_PERILP1_PLL_SEL_SHIFT); + + rk3399_saradc_set_clk(cru, 1000000); } - #endif -diff --git a/include/configs/nanopi4.h b/include/configs/nanopi4.h -new file mode 100644 -index 0000000000..a86d38976a + static int rk3399_clk_probe(struct udevice *dev) --- /dev/null +++ b/include/configs/nanopi4.h @@ -0,0 +1,24 @@ @@ -632,6 +651,3 @@ index 0000000000..a86d38976a +#define CONFIG_REVISION_TAG + +#endif --- -2.25.1 - diff --git a/openwrt-21.02/patches/snd-usb-caiaq.makefileaddon b/openwrt-23.05/patches/snd-usb-caiaq.makefileaddon similarity index 100% rename from openwrt-21.02/patches/snd-usb-caiaq.makefileaddon rename to openwrt-23.05/patches/snd-usb-caiaq.makefileaddon diff --git a/openwrt-23.05/patches/target/linux/rockchip/image/armv8.mk b/openwrt-23.05/patches/target/linux/rockchip/image/armv8.mk new file mode 100644 index 0000000..3cd984c --- /dev/null +++ b/openwrt-23.05/patches/target/linux/rockchip/image/armv8.mk @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2020 Tobias Maedel + +# FIT will be loaded at 0x02080000. Leave 16M for that, align it to 2M and load the kernel after it. +KERNEL_LOADADDR := 0x03200000 + +define Device/firefly_roc-rk3328-cc + DEVICE_VENDOR := Firefly + DEVICE_MODEL := ROC-RK3328-CC + SOC := rk3328 + DEVICE_DTS := rockchip/rk3328-roc-cc + UBOOT_DEVICE_NAME := roc-cc-rk3328 + IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata +endef +TARGET_DEVICES += firefly_roc-rk3328-cc + +define Device/friendlyarm_nanopi-r2c + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := NanoPi R2C + SOC := rk3328 + IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata + DEVICE_PACKAGES := kmod-usb-net-rtl8152 +endef +TARGET_DEVICES += friendlyarm_nanopi-r2c + +define Device/friendlyarm_nanopi-r2s + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := NanoPi R2S + SOC := rk3328 + IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata + DEVICE_PACKAGES := kmod-usb-net-rtl8152 +endef +TARGET_DEVICES += friendlyarm_nanopi-r2s + +define Device/friendlyarm_nanopi-r4s + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := NanoPi R4S + SOC := rk3399 + IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata + DEVICE_PACKAGES := kmod-r8168 +endef +TARGET_DEVICES += friendlyarm_nanopi-r4s + +define Device/pine64_rockpro64 + DEVICE_VENDOR := Pine64 + DEVICE_MODEL := RockPro64 + SOC := rk3399 + IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata +endef +TARGET_DEVICES += pine64_rockpro64 + +define Device/radxa_rock-pi-4a + DEVICE_VENDOR := Radxa + DEVICE_MODEL := ROCK Pi 4A + SOC := rk3399 + SUPPORTED_DEVICES := radxa,rockpi4a radxa,rockpi4 + UBOOT_DEVICE_NAME := rock-pi-4-rk3399 + IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata +endef +TARGET_DEVICES += radxa_rock-pi-4a + +define Device/xunlong_orangepi-r1-plus + DEVICE_VENDOR := Xunlong + DEVICE_MODEL := Orange Pi R1 Plus + SOC := rk3328 + IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata + DEVICE_PACKAGES := kmod-usb-net-rtl8152 +endef +TARGET_DEVICES += xunlong_orangepi-r1-plus + +define Device/xunlong_orangepi-r1-plus-lts + DEVICE_VENDOR := Xunlong + DEVICE_MODEL := Orange Pi R1 Plus LTS + SOC := rk3328 + IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata + DEVICE_PACKAGES := kmod-usb-net-rtl8152 +endef +TARGET_DEVICES += xunlong_orangepi-r1-plus-lts diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/005-rockchip-rk3328-add-compatible-to-NanoPi-R2S-etherne.patch b/openwrt-23.05/patches/target/linux/rockchip/patches-5.15/005-rockchip-rk3328-add-compatible-to-NanoPi-R2S-etherne.patch similarity index 97% rename from openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/005-rockchip-rk3328-add-compatible-to-NanoPi-R2S-etherne.patch rename to openwrt-23.05/patches/target/linux/rockchip/patches-5.15/005-rockchip-rk3328-add-compatible-to-NanoPi-R2S-etherne.patch index 897a42f..6434ef4 100644 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/005-rockchip-rk3328-add-compatible-to-NanoPi-R2S-etherne.patch +++ b/openwrt-23.05/patches/target/linux/rockchip/patches-5.15/005-rockchip-rk3328-add-compatible-to-NanoPi-R2S-etherne.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 -@@ -134,6 +134,8 @@ +@@ -156,6 +156,8 @@ #size-cells = <0>; rtl8211e: ethernet-phy@1 { diff --git a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch b/openwrt-23.05/patches/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch similarity index 57% rename from openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch rename to openwrt-23.05/patches/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch index d0860de..34438e8 100644 --- a/openwrt-21.02/patches/immortalwrt/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch +++ b/openwrt-23.05/patches/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch @@ -15,33 +15,37 @@ 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 -@@ -13,6 +13,13 @@ - model = "FriendlyElec NanoPi R2S"; - compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328"; - -+ aliases { +@@ -16,6 +16,11 @@ + aliases { + ethernet1 = &rtl8153; + mmc0 = &sdmmc; ++ + led-boot = &sys_led; + led-failsafe = &sys_led; + led-running = &sys_led; + led-upgrade = &sys_led; -+ }; -+ - chosen { - stdout-path = "serial2:1500000n8"; }; ---- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -@@ -19,6 +19,13 @@ - model = "FriendlyElec NanoPi R4S"; - compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399"; -+ aliases { -+ led-boot = &sys_led; -+ led-failsafe = &sys_led; -+ led-running = &sys_led; -+ led-upgrade = &sys_led; -+ }; -+ - /delete-node/ display-subsystem; + chosen { +@@ -49,18 +54,18 @@ + + lan_led: led-0 { + gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; +- label = "nanopi-r2s:green:lan"; ++ label = "green:lan"; + }; + + sys_led: led-1 { + gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; +- label = "nanopi-r2s:red:sys"; ++ label = "red:sys"; + default-state = "on"; + }; + + wan_led: led-2 { + gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>; +- label = "nanopi-r2s:green:wan"; ++ label = "green:wan"; + }; + }; - gpio-leds { diff --git a/openwrt-23.05/patches/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-eth.patch b/openwrt-23.05/patches/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-eth.patch new file mode 100644 index 0000000..6578af9 --- /dev/null +++ b/openwrt-23.05/patches/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-eth.patch @@ -0,0 +1,61 @@ +From 2795c8b31a686bdb8338f9404d18ef7a154f0d75 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Sun, 26 Jul 2020 13:32:59 +0200 +Subject: [PATCH] arm64: rockchip: add OF node for USB eth on NanoPi R2S + +This adds the OF node for the USB3 ethernet adapter on the FriendlyARM +NanoPi R2S. Add the correct value for the RTL8153 LED configuration +register to match the blink behavior of the other port on the device. + +Signed-off-by: David Bauer +--- + arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2c.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2c.dts +@@ -38,3 +38,7 @@ + }; + }; + }; ++ ++&rtl8153 { ++ realtek,led-data = <0x78>; ++}; +--- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +@@ -401,9 +401,9 @@ + #size-cells = <0>; + + /* Second port is for USB 3.0 */ +- rtl8153: device@2 { +- compatible = "usbbda,8153"; ++ rtl8153: usb-eth@2 { ++ compatible = "realtek,rtl8153"; + reg = <2>; + realtek,led-data = <0x87>; + }; + }; + +--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts +@@ -83,6 +83,19 @@ + max-link-speed = <1>; + num-lanes = <1>; + vpcie3v3-supply = <&vcc3v3_sys>; ++ ++ pcie@0 { ++ reg = <0x00000000 0 0 0 0>; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ ++ pcie-eth@0,0 { ++ compatible = "pci10ec,8168"; ++ reg = <0x000000 0 0 0 0>; ++ ++ realtek,led-data = <0x870>; ++ }; ++ }; + }; + + &pinctrl { diff --git a/openwrt-23.05/release-info.md b/openwrt-23.05/release-info.md new file mode 100644 index 0000000..dca4d1f --- /dev/null +++ b/openwrt-23.05/release-info.md @@ -0,0 +1,22 @@ +## OpenWrt 23.05 (beta) + +### General Info +- Based of openwrt 23.05.0-rc2 + +### Notes +- For R2C/R2S, theres almost no difference with official builds, except the preinstalled package set + +### Configuration +- OpenWRT 23.05 Vanilla / Kernel 5.15 +- ImmortalWRT patches for Rockchip target NanoPi R2S (rk3328) / NanoPi R4S support (rk3399) +- NanoPi R4S : r8168 driver for R4S (realtek) instead of kernel r8169 + r8169 firmwares package + +### Applications +- A useful set of applications from official OpenWrt package feed +- Mini build without UI +- Full build with LuCI, docker and extra packages +- firewall4 based (nftables) + iptables compatibility packages for now, might change later. +- pbr latest version from https://github.com/stangri/source.openwrt.melmac.net + +### Changelog +- [2023-06-28] Initial OpenWrt 23.05.0-rc2 diff --git a/openwrt-21.02/seed/ao-R4S-full.seed b/openwrt-23.05/seed/ao-R4S-full.seed similarity index 79% rename from openwrt-21.02/seed/ao-R4S-full.seed rename to openwrt-23.05/seed/ao-R4S-full.seed index 1d9bed6..0639825 100644 --- a/openwrt-21.02/seed/ao-R4S-full.seed +++ b/openwrt-23.05/seed/ao-R4S-full.seed @@ -3,6 +3,10 @@ CONFIG_TARGET_rockchip_armv8=y CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4s=y CONFIG_DEVEL=y CONFIG_TOOLCHAINOPTS=y +CONFIG_BIND_ENABLE_DOH=y +CONFIG_BPF_TOOLCHAIN_HOST=y +CONFIG_BPF_TOOLCHAIN_HOST_PATH="" +# CONFIG_BPF_TOOLCHAIN_NONE is not set CONFIG_COREMARK_ENABLE_MULTITHREADING=y CONFIG_COREMARK_NUMBER_OF_THREADS=16 CONFIG_COREMARK_OPTIMIZE_O3=y @@ -13,6 +17,7 @@ CONFIG_DOCKER_OPTIONAL_FEATURES=y CONFIG_DOCKER_STO_BTRFS=y CONFIG_DOCKER_STO_EXT4=y CONFIG_EXPERIMENTAL=y +CONFIG_HAS_BPF_TOOLCHAIN=y CONFIG_IFSTAT_SNMP=y CONFIG_IPERF_ENABLE_MULTICAST=y CONFIG_KERNEL_ARM_PMU=y @@ -39,24 +44,30 @@ CONFIG_KERNEL_PROC_PID_CPUSET=y CONFIG_KERNEL_TRANSPARENT_HUGEPAGE=y CONFIG_KERNEL_TRANSPARENT_HUGEPAGE_ALWAYS=y CONFIG_LIBCURL_COOKIES=y -CONFIG_LIBCURL_CRYPTO_AUTH=y CONFIG_LIBCURL_FILE=y CONFIG_LIBCURL_FTP=y CONFIG_LIBCURL_HTTP=y CONFIG_LIBCURL_NGHTTP2=y +CONFIG_LIBCURL_NO_SMB="!" CONFIG_LIBCURL_OPENSSL=y CONFIG_LIBCURL_PROXY=y -CONFIG_LUCI_LANG_en=y +CONFIG_LIBCURL_UNIX_SOCKETS=y +CONFIG_LXC_SECCOMP=y CONFIG_OPENSSL_ENGINE=y CONFIG_OPENSSL_OPTIMIZE_SPEED=y +CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y CONFIG_OPENSSL_WITH_ASM=y CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y CONFIG_OPENSSL_WITH_CMS=y CONFIG_OPENSSL_WITH_DEPRECATED=y CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y +CONFIG_OPENSSL_WITH_IDEA=y +CONFIG_OPENSSL_WITH_MDC2=y CONFIG_OPENSSL_WITH_PSK=y +CONFIG_OPENSSL_WITH_SEED=y CONFIG_OPENSSL_WITH_SRP=y CONFIG_OPENSSL_WITH_TLS13=y +CONFIG_OPENSSL_WITH_WHIRLPOOL=y CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y CONFIG_OPENVPN_openssl_ENABLE_FRAGMENT=y CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y @@ -66,16 +77,19 @@ CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y CONFIG_OPENVPN_openssl_ENABLE_PF=y CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y CONFIG_OPENVPN_openssl_ENABLE_SMALL=y -CONFIG_PACKAGE_adblock=y +CONFIG_PACKAGE_acme=y +CONFIG_PACKAGE_acme-acmesh=y +CONFIG_PACKAGE_acme-acmesh-dnsapi=y +CONFIG_PACKAGE_acme-common=y CONFIG_PACKAGE_adguardhome=y CONFIG_PACKAGE_alsa-lib=y CONFIG_PACKAGE_alsa-ucm-conf=y CONFIG_PACKAGE_alsa-utils=y -CONFIG_PACKAGE_arptables=y +CONFIG_PACKAGE_arptables-nft=y CONFIG_PACKAGE_avahi-dbus-daemon=y -CONFIG_PACKAGE_banip=y CONFIG_PACKAGE_bind-check=y CONFIG_PACKAGE_bind-client=y +CONFIG_PACKAGE_bind-ddns-confgen=y CONFIG_PACKAGE_bind-dig=y CONFIG_PACKAGE_bind-dnssec=y CONFIG_PACKAGE_bind-host=y @@ -132,14 +146,13 @@ CONFIG_PACKAGE_dnsmasq_full_conntrack=y CONFIG_PACKAGE_dnsmasq_full_dhcp=y CONFIG_PACKAGE_dnsmasq_full_dhcpv6=y CONFIG_PACKAGE_dnsmasq_full_dnssec=y -CONFIG_PACKAGE_dnsmasq_full_ipset=y +CONFIG_PACKAGE_dnsmasq_full_nftset=y CONFIG_PACKAGE_dnsmasq_full_noid=y CONFIG_PACKAGE_dnsmasq_full_tftp=y CONFIG_PACKAGE_docker=y CONFIG_PACKAGE_dockerd=y CONFIG_PACKAGE_ds-lite=y -CONFIG_PACKAGE_ebtables=y -CONFIG_PACKAGE_ebtables-utils=y +CONFIG_PACKAGE_ebtables-nft=y CONFIG_PACKAGE_etherwake=y CONFIG_PACKAGE_f2fs-tools=y CONFIG_PACKAGE_f2fsck=y @@ -151,40 +164,20 @@ CONFIG_PACKAGE_ifstat=y CONFIG_PACKAGE_iftop=y CONFIG_PACKAGE_igmpproxy=y CONFIG_PACKAGE_ip-full=y -CONFIG_PACKAGE_ip-tiny=y -CONFIG_PACKAGE_ip6tables-extra=y -CONFIG_PACKAGE_ip6tables-mod-nat=y +CONFIG_PACKAGE_ip6tables-nft=y CONFIG_PACKAGE_iperf=y CONFIG_PACKAGE_iperf3=y CONFIG_PACKAGE_ipset=y -CONFIG_PACKAGE_iptables-mod-cluster=y -CONFIG_PACKAGE_iptables-mod-clusterip=y -CONFIG_PACKAGE_iptables-mod-condition=y CONFIG_PACKAGE_iptables-mod-conntrack-extra=y CONFIG_PACKAGE_iptables-mod-extra=y -CONFIG_PACKAGE_iptables-mod-iface=y -CONFIG_PACKAGE_iptables-mod-ipmark=y CONFIG_PACKAGE_iptables-mod-ipopt=y -CONFIG_PACKAGE_iptables-mod-iprange=y CONFIG_PACKAGE_iptables-mod-ipsec=y -CONFIG_PACKAGE_iptables-mod-length2=y -CONFIG_PACKAGE_iptables-mod-logmark=y -CONFIG_PACKAGE_iptables-mod-nat-extra=y -CONFIG_PACKAGE_iptables-mod-nflog=y -CONFIG_PACKAGE_iptables-mod-nfqueue=y -CONFIG_PACKAGE_iptables-mod-physdev=y -CONFIG_PACKAGE_iptables-mod-proto=y -CONFIG_PACKAGE_iptables-mod-rpfilter=y -CONFIG_PACKAGE_iptables-mod-tproxy=y -CONFIG_PACKAGE_iptables-mod-u32=y -CONFIG_PACKAGE_iw=y -CONFIG_PACKAGE_iwinfo=y +CONFIG_PACKAGE_iptables-nft=y CONFIG_PACKAGE_jq=y CONFIG_PACKAGE_kmod-arptables=y -CONFIG_PACKAGE_kmod-backlight=y -CONFIG_PACKAGE_kmod-backlight-pwm=y +CONFIG_PACKAGE_kmod-asn1-decoder=y +CONFIG_PACKAGE_kmod-asn1-encoder=y CONFIG_PACKAGE_kmod-br-netfilter=y -CONFIG_PACKAGE_kmod-crypto-acompress=y CONFIG_PACKAGE_kmod-crypto-aead=y CONFIG_PACKAGE_kmod-crypto-arc4=y CONFIG_PACKAGE_kmod-crypto-authenc=y @@ -192,7 +185,6 @@ CONFIG_PACKAGE_kmod-crypto-cbc=y CONFIG_PACKAGE_kmod-crypto-ccm=y CONFIG_PACKAGE_kmod-crypto-cmac=y CONFIG_PACKAGE_kmod-crypto-crc32=y -CONFIG_PACKAGE_kmod-crypto-crc32c=y CONFIG_PACKAGE_kmod-crypto-ctr=y CONFIG_PACKAGE_kmod-crypto-deflate=y CONFIG_PACKAGE_kmod-crypto-des=y @@ -201,7 +193,6 @@ CONFIG_PACKAGE_kmod-crypto-echainiv=y CONFIG_PACKAGE_kmod-crypto-gcm=y CONFIG_PACKAGE_kmod-crypto-gf128=y CONFIG_PACKAGE_kmod-crypto-ghash=y -CONFIG_PACKAGE_kmod-crypto-hash=y CONFIG_PACKAGE_kmod-crypto-hmac=y CONFIG_PACKAGE_kmod-crypto-kpp=y CONFIG_PACKAGE_kmod-crypto-lib-chacha20=y @@ -212,7 +203,6 @@ CONFIG_PACKAGE_kmod-crypto-manager=y CONFIG_PACKAGE_kmod-crypto-md4=y CONFIG_PACKAGE_kmod-crypto-md5=y CONFIG_PACKAGE_kmod-crypto-null=y -CONFIG_PACKAGE_kmod-crypto-pcompress=y CONFIG_PACKAGE_kmod-crypto-rng=y CONFIG_PACKAGE_kmod-crypto-seqiv=y CONFIG_PACKAGE_kmod-crypto-sha1=y @@ -222,22 +212,14 @@ CONFIG_PACKAGE_kmod-crypto-user=y CONFIG_PACKAGE_kmod-cryptodev=y CONFIG_PACKAGE_kmod-dax=y CONFIG_PACKAGE_kmod-dm=y -CONFIG_PACKAGE_kmod-dma-buf=y -CONFIG_PACKAGE_kmod-drm=y -CONFIG_PACKAGE_kmod-drm-kms-helper=y -CONFIG_PACKAGE_kmod-drm-rockchip=y +CONFIG_PACKAGE_kmod-dnsresolver=y CONFIG_PACKAGE_kmod-dummy=y CONFIG_PACKAGE_kmod-ebtables=y -CONFIG_PACKAGE_kmod-fb=y -CONFIG_PACKAGE_kmod-fb-cfb-copyarea=y -CONFIG_PACKAGE_kmod-fb-cfb-fillrect=y -CONFIG_PACKAGE_kmod-fb-cfb-imgblt=y -CONFIG_PACKAGE_kmod-fb-sys-fops=y -CONFIG_PACKAGE_kmod-fb-sys-ram=y CONFIG_PACKAGE_kmod-fs-btrfs=y CONFIG_PACKAGE_kmod-fs-cifs=y CONFIG_PACKAGE_kmod-fs-ext4=y CONFIG_PACKAGE_kmod-fs-f2fs=y +CONFIG_PACKAGE_kmod-fs-smbfs-common=y CONFIG_PACKAGE_kmod-fs-squashfs=y CONFIG_PACKAGE_kmod-fs-vfat=y CONFIG_PACKAGE_kmod-hwmon-core=y @@ -248,46 +230,30 @@ CONFIG_PACKAGE_kmod-input-core=y CONFIG_PACKAGE_kmod-ip-vti=y CONFIG_PACKAGE_kmod-ip6-tunnel=y CONFIG_PACKAGE_kmod-ip6-vti=y -CONFIG_PACKAGE_kmod-ip6tables-extra=y +CONFIG_PACKAGE_kmod-ip6tables=y CONFIG_PACKAGE_kmod-ipsec=y CONFIG_PACKAGE_kmod-ipsec4=y CONFIG_PACKAGE_kmod-ipsec6=y -CONFIG_PACKAGE_kmod-ipt-cluster=y -CONFIG_PACKAGE_kmod-ipt-clusterip=y CONFIG_PACKAGE_kmod-ipt-compat-xtables=y -CONFIG_PACKAGE_kmod-ipt-condition=y +CONFIG_PACKAGE_kmod-ipt-conntrack=y CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y -CONFIG_PACKAGE_kmod-ipt-conntrack-label=y +CONFIG_PACKAGE_kmod-ipt-core=y CONFIG_PACKAGE_kmod-ipt-extra=y -CONFIG_PACKAGE_kmod-ipt-iface=y -CONFIG_PACKAGE_kmod-ipt-ipmark=y CONFIG_PACKAGE_kmod-ipt-ipopt=y -CONFIG_PACKAGE_kmod-ipt-iprange=y CONFIG_PACKAGE_kmod-ipt-ipsec=y CONFIG_PACKAGE_kmod-ipt-ipset=y -CONFIG_PACKAGE_kmod-ipt-ipv4options=y -CONFIG_PACKAGE_kmod-ipt-length2=y -CONFIG_PACKAGE_kmod-ipt-logmark=y -CONFIG_PACKAGE_kmod-ipt-nat-extra=y +CONFIG_PACKAGE_kmod-ipt-nat=y CONFIG_PACKAGE_kmod-ipt-nat6=y -CONFIG_PACKAGE_kmod-ipt-nflog=y -CONFIG_PACKAGE_kmod-ipt-nfqueue=y CONFIG_PACKAGE_kmod-ipt-physdev=y -CONFIG_PACKAGE_kmod-ipt-proto=y CONFIG_PACKAGE_kmod-ipt-raw=y -CONFIG_PACKAGE_kmod-ipt-raw6=y -CONFIG_PACKAGE_kmod-ipt-rpfilter=y -CONFIG_PACKAGE_kmod-ipt-tproxy=y -CONFIG_PACKAGE_kmod-ipt-u32=y CONFIG_PACKAGE_kmod-iptunnel=y CONFIG_PACKAGE_kmod-iptunnel4=y CONFIG_PACKAGE_kmod-iptunnel6=y CONFIG_PACKAGE_kmod-keys-encrypted=y CONFIG_PACKAGE_kmod-keys-trusted=y CONFIG_PACKAGE_kmod-lib-crc16=y -CONFIG_PACKAGE_kmod-lib-crc32c=y -CONFIG_PACKAGE_kmod-lib-lzo=y CONFIG_PACKAGE_kmod-lib-raid6=y +CONFIG_PACKAGE_kmod-lib-textsearch=y CONFIG_PACKAGE_kmod-lib-xor=y CONFIG_PACKAGE_kmod-lib-zlib-deflate=y CONFIG_PACKAGE_kmod-lib-zlib-inflate=y @@ -295,26 +261,29 @@ CONFIG_PACKAGE_kmod-lib-zstd=y CONFIG_PACKAGE_kmod-libphy=y CONFIG_PACKAGE_kmod-macvlan=y CONFIG_PACKAGE_kmod-mii=y -CONFIG_PACKAGE_kmod-multimedia-input=y +CONFIG_PACKAGE_kmod-nf-conncount=y CONFIG_PACKAGE_kmod-nf-conntrack-netlink=y +CONFIG_PACKAGE_kmod-nf-ipt=y +CONFIG_PACKAGE_kmod-nf-ipt6=y CONFIG_PACKAGE_kmod-nf-ipvs=y CONFIG_PACKAGE_kmod-nf-nat6=y CONFIG_PACKAGE_kmod-nf-nathelper=y -CONFIG_PACKAGE_kmod-nfnetlink=y +CONFIG_PACKAGE_kmod-nf-tproxy=y CONFIG_PACKAGE_kmod-nfnetlink-log=y CONFIG_PACKAGE_kmod-nfnetlink-queue=y +CONFIG_PACKAGE_kmod-nft-arp=y CONFIG_PACKAGE_kmod-nft-bridge=y -CONFIG_PACKAGE_kmod-nft-core=y -CONFIG_PACKAGE_kmod-nft-nat=y -CONFIG_PACKAGE_kmod-nft-nat6=y -CONFIG_PACKAGE_kmod-nft-offload=y +CONFIG_PACKAGE_kmod-nft-compat=y CONFIG_PACKAGE_kmod-nft-queue=y CONFIG_PACKAGE_kmod-nls-base=y CONFIG_PACKAGE_kmod-nls-cp437=y CONFIG_PACKAGE_kmod-nls-iso8859-1=y CONFIG_PACKAGE_kmod-nls-utf8=y +CONFIG_PACKAGE_kmod-oid-registry=y CONFIG_PACKAGE_kmod-phy-realtek=y CONFIG_PACKAGE_kmod-random-core=y +CONFIG_PACKAGE_kmod-sched=y +CONFIG_PACKAGE_kmod-sched-bpf=y CONFIG_PACKAGE_kmod-sched-cake=y CONFIG_PACKAGE_kmod-sched-connmark=y CONFIG_PACKAGE_kmod-sched-core=y @@ -332,7 +301,11 @@ CONFIG_PACKAGE_kmod-usb-dwc3=y CONFIG_PACKAGE_kmod-usb-ehci=y CONFIG_PACKAGE_kmod-usb-gadget=y CONFIG_PACKAGE_kmod-usb-net=y +CONFIG_PACKAGE_kmod-usb-net-cdc-ether=y +CONFIG_PACKAGE_kmod-usb-net-cdc-ncm=y CONFIG_PACKAGE_kmod-usb-net-rtl8152=y +CONFIG_PACKAGE_kmod-usb-roles=y +CONFIG_PACKAGE_kmod-usb-xhci-hcd=y CONFIG_PACKAGE_kmod-usb2=y CONFIG_PACKAGE_kmod-usb3=y CONFIG_PACKAGE_kmod-veth=y @@ -344,6 +317,7 @@ CONFIG_PACKAGE_libattr=y CONFIG_PACKAGE_libavahi-client=y CONFIG_PACKAGE_libavahi-dbus-support=y CONFIG_PACKAGE_libbpf=y +CONFIG_PACKAGE_libcap=y CONFIG_PACKAGE_libcap-ng=y CONFIG_PACKAGE_libconfig=y CONFIG_PACKAGE_libcurl=y @@ -355,9 +329,16 @@ CONFIG_PACKAGE_libevent2=y CONFIG_PACKAGE_libevent2-core=y CONFIG_PACKAGE_libevent2-pthreads=y CONFIG_PACKAGE_libexpat=y +CONFIG_PACKAGE_libfdisk=y CONFIG_PACKAGE_libgmp=y CONFIG_PACKAGE_libi2c=y +CONFIG_PACKAGE_libip4tc=y +CONFIG_PACKAGE_libip6tc=y +CONFIG_PACKAGE_libiperf3=y CONFIG_PACKAGE_libipset=y +CONFIG_PACKAGE_libiptext=y +CONFIG_PACKAGE_libiptext-nft=y +CONFIG_PACKAGE_libiptext6=y CONFIG_PACKAGE_libiwinfo=y CONFIG_PACKAGE_libiwinfo-data=y CONFIG_PACKAGE_libiwinfo-lua=y @@ -367,18 +348,18 @@ CONFIG_PACKAGE_liblua=y CONFIG_PACKAGE_liblua5.3=y CONFIG_PACKAGE_liblucihttp=y CONFIG_PACKAGE_liblucihttp-lua=y +CONFIG_PACKAGE_liblucihttp-ucode=y CONFIG_PACKAGE_liblzo=y -CONFIG_PACKAGE_libmnl=y +CONFIG_PACKAGE_libmbedtls=m CONFIG_PACKAGE_libmount=y +CONFIG_PACKAGE_libncurses=y CONFIG_PACKAGE_libnetfilter-conntrack=y CONFIG_PACKAGE_libnetfilter-cthelper=y CONFIG_PACKAGE_libnetfilter-cttimeout=y CONFIG_PACKAGE_libnetfilter-queue=y CONFIG_PACKAGE_libnetsnmp=y CONFIG_PACKAGE_libnettle=y -CONFIG_PACKAGE_libnetwork=y CONFIG_PACKAGE_libnfnetlink=y -CONFIG_PACKAGE_libnftnl=y CONFIG_PACKAGE_libnghttp2=y CONFIG_PACKAGE_libnl-core=y CONFIG_PACKAGE_libnl-route=y @@ -397,54 +378,50 @@ CONFIG_PACKAGE_libseccomp=y CONFIG_PACKAGE_libsensors=y CONFIG_PACKAGE_libsoxr=y CONFIG_PACKAGE_libsqlite3=y +CONFIG_PACKAGE_libstdcpp=y CONFIG_PACKAGE_libsysfs=y CONFIG_PACKAGE_libubus-lua=y +CONFIG_PACKAGE_libuci-lua=y CONFIG_PACKAGE_libunbound=y CONFIG_PACKAGE_libunbound_ipset=y CONFIG_PACKAGE_libunbound_libevent=y CONFIG_PACKAGE_libunbound_libpthread=y +CONFIG_PACKAGE_libustream-mbedtls=m +CONFIG_PACKAGE_libustream-openssl=y CONFIG_PACKAGE_libuv=y +CONFIG_PACKAGE_libwebsockets-full=y +CONFIG_PACKAGE_libxtables=y CONFIG_PACKAGE_lm-sensors=y CONFIG_PACKAGE_losetup=y CONFIG_PACKAGE_lua=y CONFIG_PACKAGE_luci=y CONFIG_PACKAGE_luci-app-acl=y -CONFIG_PACKAGE_luci-app-adblock=y -CONFIG_PACKAGE_luci-app-banip=y +CONFIG_PACKAGE_luci-app-acme=y CONFIG_PACKAGE_luci-app-commands=y CONFIG_PACKAGE_luci-app-ddns=y +CONFIG_PACKAGE_luci-app-dockerman=y CONFIG_PACKAGE_luci-app-firewall=y CONFIG_PACKAGE_luci-app-ntpc=y CONFIG_PACKAGE_luci-app-openvpn=y CONFIG_PACKAGE_luci-app-opkg=y +CONFIG_PACKAGE_luci-app-pbr=y CONFIG_PACKAGE_luci-app-qos=y CONFIG_PACKAGE_luci-app-sqm=y CONFIG_PACKAGE_luci-app-statistics=y CONFIG_PACKAGE_luci-app-tinyproxy=y +CONFIG_PACKAGE_luci-app-watchcat=y CONFIG_PACKAGE_luci-base=y CONFIG_PACKAGE_luci-compat=y -CONFIG_PACKAGE_luci-i18n-acl-en=y -CONFIG_PACKAGE_luci-i18n-adblock-en=y -CONFIG_PACKAGE_luci-i18n-banip-en=y -CONFIG_PACKAGE_luci-i18n-base-en=y -CONFIG_PACKAGE_luci-i18n-commands-en=y -CONFIG_PACKAGE_luci-i18n-ddns-en=y -CONFIG_PACKAGE_luci-i18n-firewall-en=y -CONFIG_PACKAGE_luci-i18n-ntpc-en=y -CONFIG_PACKAGE_luci-i18n-openvpn-en=y -CONFIG_PACKAGE_luci-i18n-opkg-en=y -CONFIG_PACKAGE_luci-i18n-qos-en=y -CONFIG_PACKAGE_luci-i18n-sqm-en=y -CONFIG_PACKAGE_luci-i18n-statistics-en=y -CONFIG_PACKAGE_luci-i18n-tinyproxy-en=y CONFIG_PACKAGE_luci-lib-base=y +CONFIG_PACKAGE_luci-lib-docker=y CONFIG_PACKAGE_luci-lib-ip=y CONFIG_PACKAGE_luci-lib-ipkg=y CONFIG_PACKAGE_luci-lib-jsonc=y CONFIG_PACKAGE_luci-lib-nixio=y +CONFIG_PACKAGE_luci-light=y +CONFIG_PACKAGE_luci-lua-runtime=y CONFIG_PACKAGE_luci-mod-admin-full=y CONFIG_PACKAGE_luci-mod-dashboard=y -CONFIG_PACKAGE_luci-mod-failsafe=y CONFIG_PACKAGE_luci-mod-network=y CONFIG_PACKAGE_luci-mod-status=y CONFIG_PACKAGE_luci-mod-system=y @@ -453,6 +430,7 @@ CONFIG_PACKAGE_luci-proto-ppp=y CONFIG_PACKAGE_luci-proto-wireguard=y CONFIG_PACKAGE_luci-theme-bootstrap=y CONFIG_PACKAGE_luci-theme-openwrt-2020=y +CONFIG_PACKAGE_lxc=y CONFIG_PACKAGE_mount-utils=y CONFIG_PACKAGE_mt7601u-firmware=y CONFIG_PACKAGE_nano=y @@ -465,8 +443,11 @@ CONFIG_PACKAGE_nstat=y CONFIG_PACKAGE_ntpclient=y CONFIG_PACKAGE_openssl-util=y CONFIG_PACKAGE_openvpn-openssl=y +CONFIG_PACKAGE_pbr=y CONFIG_PACKAGE_picocom=y CONFIG_PACKAGE_qos-scripts=y +CONFIG_PACKAGE_qosify=y +CONFIG_PACKAGE_r8152-firmware=y CONFIG_PACKAGE_r8169-firmware=y CONFIG_PACKAGE_resolveip=y CONFIG_PACKAGE_rng-tools=y @@ -475,6 +456,7 @@ CONFIG_PACKAGE_rpcd-mod-file=y CONFIG_PACKAGE_rpcd-mod-iwinfo=y CONFIG_PACKAGE_rpcd-mod-luci=y CONFIG_PACKAGE_rpcd-mod-rrdns=y +CONFIG_PACKAGE_rpcd-mod-ucode=y CONFIG_PACKAGE_rrdtool1=y CONFIG_PACKAGE_runc=y CONFIG_PACKAGE_shairport-sync-openssl=y @@ -483,32 +465,37 @@ CONFIG_PACKAGE_speedtest-netperf=y CONFIG_PACKAGE_sqm-scripts=y CONFIG_PACKAGE_sqm-scripts-extra=y CONFIG_PACKAGE_sysfsutils=y +CONFIG_PACKAGE_tc-full=y CONFIG_PACKAGE_tc-mod-iptables=y -CONFIG_PACKAGE_tc-tiny=y CONFIG_PACKAGE_tcpdump=y +CONFIG_PACKAGE_terminfo=y CONFIG_PACKAGE_tini=y CONFIG_PACKAGE_tinyproxy=y -CONFIG_PACKAGE_uacme=y -CONFIG_PACKAGE_uclibcxx=y +CONFIG_PACKAGE_ttyd=y +CONFIG_PACKAGE_ucode-mod-html=y +CONFIG_PACKAGE_ucode-mod-lua=y +CONFIG_PACKAGE_ucode-mod-math=y CONFIG_PACKAGE_uhttpd=y CONFIG_PACKAGE_uhttpd-mod-ubus=y -CONFIG_PACKAGE_urngd=y -CONFIG_PACKAGE_vpn-policy-routing=y +CONFIG_PACKAGE_watchcat=y CONFIG_PACKAGE_wget-ssl=y CONFIG_PACKAGE_wireguard-tools=y CONFIG_PACKAGE_wireless-regdb=y +CONFIG_PACKAGE_xtables-legacy=y +CONFIG_PACKAGE_xtables-nft=y CONFIG_PACKAGE_zlib=y CONFIG_PACKAGE_zoneinfo-core=y CONFIG_PACKAGE_zoneinfo-europe=y CONFIG_SOCAT_SSL=y +CONFIG_SQLITE3_COLUMN_METADATA=y CONFIG_SQLITE3_DYNAMIC_EXTENSIONS=y CONFIG_SQLITE3_FTS3=y CONFIG_SQLITE3_FTS4=y CONFIG_SQLITE3_FTS5=y -CONFIG_SQLITE3_JSON1=y CONFIG_SQLITE3_RTREE=y # CONFIG_TARGET_IMAGES_GZIP is not set CONFIG_TARGET_KERNEL_PARTSIZE=40 CONFIG_TARGET_OPTIMIZATION="-O3 -pipe -mcpu=cortex-a72.cortex-a53+crypto+crc" CONFIG_TARGET_OPTIONS=y CONFIG_TARGET_ROOTFS_PARTSIZE=1024 +CONFIG_USE_LLVM_HOST=y diff --git a/openwrt-23.05/seed/ao-R4S-full.seed.orig b/openwrt-23.05/seed/ao-R4S-full.seed.orig new file mode 100644 index 0000000..f3751f8 --- /dev/null +++ b/openwrt-23.05/seed/ao-R4S-full.seed.orig @@ -0,0 +1,499 @@ +CONFIG_TARGET_rockchip=y +CONFIG_TARGET_rockchip_armv8=y +CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4s=y +CONFIG_DEVEL=y +CONFIG_TOOLCHAINOPTS=y +CONFIG_BIND_ENABLE_DOH=y +CONFIG_COREMARK_ENABLE_MULTITHREADING=y +CONFIG_COREMARK_NUMBER_OF_THREADS=16 +CONFIG_COREMARK_OPTIMIZE_O3=y +CONFIG_DOCKER_CGROUP_OPTIONS=y +CONFIG_DOCKER_NET_ENCRYPT=y +CONFIG_DOCKER_NET_OVERLAY=y +CONFIG_DOCKER_OPTIONAL_FEATURES=y +CONFIG_DOCKER_STO_BTRFS=y +CONFIG_DOCKER_STO_EXT4=y +CONFIG_EXPERIMENTAL=y +CONFIG_GCC_USE_VERSION_10=y +# CONFIG_GCC_USE_VERSION_11 is not set +CONFIG_GCC_VERSION="10.3.0" +CONFIG_GCC_VERSION_10=y +CONFIG_IFSTAT_SNMP=y +CONFIG_IPERF_ENABLE_MULTICAST=y +CONFIG_KERNEL_ARM_PMU=y +CONFIG_KERNEL_BLK_DEV_THROTTLING_LOW=y +CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y +CONFIG_KERNEL_BUILD_DOMAIN="openwrt" +CONFIG_KERNEL_BUILD_USER="ao" +CONFIG_KERNEL_CFQ_GROUP_IOSCHED=y +CONFIG_KERNEL_CGROUP_DEVICE=y +CONFIG_KERNEL_CGROUP_FREEZER=y +CONFIG_KERNEL_CGROUP_HUGETLB=y +CONFIG_KERNEL_CGROUP_NET_PRIO=y +CONFIG_KERNEL_CGROUP_PERF=y +CONFIG_KERNEL_DEBUG_BLK_CGROUP=y +CONFIG_KERNEL_EXT4_FS_POSIX_ACL=y +CONFIG_KERNEL_EXT4_FS_SECURITY=y +CONFIG_KERNEL_FS_POSIX_ACL=y +CONFIG_KERNEL_HUGETLBFS=y +CONFIG_KERNEL_HUGETLB_PAGE=y +CONFIG_KERNEL_MEMCG_SWAP_ENABLED=y +CONFIG_KERNEL_NET_CLS_CGROUP=y +CONFIG_KERNEL_PERF_EVENTS=y +CONFIG_KERNEL_PROC_PID_CPUSET=y +CONFIG_KERNEL_TRANSPARENT_HUGEPAGE=y +CONFIG_KERNEL_TRANSPARENT_HUGEPAGE_ALWAYS=y +CONFIG_LIBCURL_COOKIES=y +CONFIG_LIBCURL_FILE=y +CONFIG_LIBCURL_FTP=y +CONFIG_LIBCURL_HTTP=y +CONFIG_LIBCURL_NGHTTP2=y +CONFIG_LIBCURL_NO_SMB="!" +CONFIG_LIBCURL_PROXY=y +CONFIG_LIBCURL_WOLFSSL=y +CONFIG_LUCI_LANG_en=y +CONFIG_OPENSSL_ENGINE=y +CONFIG_OPENSSL_OPTIMIZE_SPEED=y +CONFIG_OPENSSL_WITH_ASM=y +CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y +CONFIG_OPENSSL_WITH_CMS=y +CONFIG_OPENSSL_WITH_DEPRECATED=y +CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y +CONFIG_OPENSSL_WITH_PSK=y +CONFIG_OPENSSL_WITH_SRP=y +CONFIG_OPENSSL_WITH_TLS13=y +CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y +CONFIG_OPENVPN_openssl_ENABLE_FRAGMENT=y +CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y +CONFIG_OPENVPN_openssl_ENABLE_LZ4=y +CONFIG_OPENVPN_openssl_ENABLE_LZO=y +CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y +CONFIG_OPENVPN_openssl_ENABLE_PF=y +CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y +CONFIG_OPENVPN_openssl_ENABLE_SMALL=y +CONFIG_PACKAGE_acme=y +CONFIG_PACKAGE_acme-dnsapi=y +CONFIG_PACKAGE_adblock=y +CONFIG_PACKAGE_alsa-lib=y +CONFIG_PACKAGE_alsa-ucm-conf=y +CONFIG_PACKAGE_alsa-utils=y +CONFIG_PACKAGE_avahi-dbus-daemon=y +CONFIG_PACKAGE_banip=y +CONFIG_PACKAGE_bind-check=y +CONFIG_PACKAGE_bind-client=y +CONFIG_PACKAGE_bind-dig=y +CONFIG_PACKAGE_bind-dnssec=y +CONFIG_PACKAGE_bind-host=y +CONFIG_PACKAGE_bind-libs=y +CONFIG_PACKAGE_bind-nslookup=y +CONFIG_PACKAGE_bind-rndc=y +CONFIG_PACKAGE_bind-tools=y +CONFIG_PACKAGE_blkid=y +CONFIG_PACKAGE_bmon=y +CONFIG_PACKAGE_bridge=y +CONFIG_PACKAGE_btrfs-progs=y +CONFIG_PACKAGE_ca-certificates=y +CONFIG_PACKAGE_cfdisk=y +CONFIG_PACKAGE_cgi-io=y +CONFIG_PACKAGE_cgroupfs-mount=y +CONFIG_PACKAGE_collectd=y +CONFIG_PACKAGE_collectd-mod-cpu=y +CONFIG_PACKAGE_collectd-mod-ethstat=y +CONFIG_PACKAGE_collectd-mod-interface=y +CONFIG_PACKAGE_collectd-mod-irq=y +CONFIG_PACKAGE_collectd-mod-iwinfo=y +CONFIG_PACKAGE_collectd-mod-load=y +CONFIG_PACKAGE_collectd-mod-memory=y +CONFIG_PACKAGE_collectd-mod-network=y +CONFIG_PACKAGE_collectd-mod-rrdtool=y +CONFIG_PACKAGE_collectd-mod-sensors=y +CONFIG_PACKAGE_collectd-mod-thermal=y +CONFIG_PACKAGE_confuse=y +CONFIG_PACKAGE_conntrack=y +CONFIG_PACKAGE_conntrackd=y +CONFIG_PACKAGE_containerd=y +CONFIG_PACKAGE_coremark=y +CONFIG_PACKAGE_coreutils=y +CONFIG_PACKAGE_coreutils-sort=y +CONFIG_PACKAGE_curl=y +CONFIG_PACKAGE_dbus=y +CONFIG_PACKAGE_dbus-utils=y +CONFIG_PACKAGE_ddns-scripts=y +CONFIG_PACKAGE_ddns-scripts-cloudflare=y +CONFIG_PACKAGE_ddns-scripts-cnkuai=y +CONFIG_PACKAGE_ddns-scripts-digitalocean=y +CONFIG_PACKAGE_ddns-scripts-freedns=y +CONFIG_PACKAGE_ddns-scripts-gandi=y +CONFIG_PACKAGE_ddns-scripts-godaddy=y +CONFIG_PACKAGE_ddns-scripts-noip=y +CONFIG_PACKAGE_ddns-scripts-nsupdate=y +CONFIG_PACKAGE_ddns-scripts-route53=y +CONFIG_PACKAGE_ddns-scripts-services=y +CONFIG_PACKAGE_diffutils=y +# CONFIG_PACKAGE_dnsmasq is not set +CONFIG_PACKAGE_dnsmasq-full=y +CONFIG_PACKAGE_dnsmasq_full_auth=y +CONFIG_PACKAGE_dnsmasq_full_conntrack=y +CONFIG_PACKAGE_dnsmasq_full_dhcp=y +CONFIG_PACKAGE_dnsmasq_full_dhcpv6=y +CONFIG_PACKAGE_dnsmasq_full_dnssec=y +CONFIG_PACKAGE_dnsmasq_full_ipset=y +CONFIG_PACKAGE_dnsmasq_full_noid=y +CONFIG_PACKAGE_dnsmasq_full_tftp=y +CONFIG_PACKAGE_docker=y +CONFIG_PACKAGE_dockerd=y +CONFIG_PACKAGE_ds-lite=y +CONFIG_PACKAGE_etherwake=y +CONFIG_PACKAGE_f2fs-tools=y +CONFIG_PACKAGE_f2fsck=y +CONFIG_PACKAGE_giflib-utils=y +CONFIG_PACKAGE_halog=y +CONFIG_PACKAGE_haproxy=y +CONFIG_PACKAGE_i2c-tools=y +CONFIG_PACKAGE_ifstat=y +CONFIG_PACKAGE_iftop=y +CONFIG_PACKAGE_igmpproxy=y +CONFIG_PACKAGE_ip-full=y +CONFIG_PACKAGE_ip-tiny=y +CONFIG_PACKAGE_ip6tables-nft=y +CONFIG_PACKAGE_iperf=y +CONFIG_PACKAGE_iperf3=y +CONFIG_PACKAGE_ipset=y +CONFIG_PACKAGE_iptables-legacy=y +CONFIG_PACKAGE_iptables-mod-conntrack-extra=y +CONFIG_PACKAGE_iptables-mod-extra=y +CONFIG_PACKAGE_iptables-mod-iface=y +CONFIG_PACKAGE_iptables-mod-ipmark=y +CONFIG_PACKAGE_iptables-mod-ipopt=y +CONFIG_PACKAGE_iptables-mod-ipsec=y +CONFIG_PACKAGE_iptables-mod-physdev=y +CONFIG_PACKAGE_iptables-mod-proto=y +CONFIG_PACKAGE_iw=y +CONFIG_PACKAGE_iwinfo=y +CONFIG_PACKAGE_jq=y +CONFIG_PACKAGE_kmod-backlight=y +CONFIG_PACKAGE_kmod-backlight-pwm=y +CONFIG_PACKAGE_kmod-br-netfilter=y +CONFIG_PACKAGE_kmod-crypto-acompress=y +CONFIG_PACKAGE_kmod-crypto-aead=y +CONFIG_PACKAGE_kmod-crypto-arc4=y +CONFIG_PACKAGE_kmod-crypto-authenc=y +CONFIG_PACKAGE_kmod-crypto-cbc=y +CONFIG_PACKAGE_kmod-crypto-ccm=y +CONFIG_PACKAGE_kmod-crypto-cmac=y +CONFIG_PACKAGE_kmod-crypto-crc32=y +CONFIG_PACKAGE_kmod-crypto-ctr=y +CONFIG_PACKAGE_kmod-crypto-deflate=y +CONFIG_PACKAGE_kmod-crypto-des=y +CONFIG_PACKAGE_kmod-crypto-ecb=y +CONFIG_PACKAGE_kmod-crypto-echainiv=y +CONFIG_PACKAGE_kmod-crypto-gcm=y +CONFIG_PACKAGE_kmod-crypto-gf128=y +CONFIG_PACKAGE_kmod-crypto-ghash=y +CONFIG_PACKAGE_kmod-crypto-hmac=y +CONFIG_PACKAGE_kmod-crypto-kpp=y +CONFIG_PACKAGE_kmod-crypto-lib-blake2s=y +CONFIG_PACKAGE_kmod-crypto-lib-chacha20=y +CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=y +CONFIG_PACKAGE_kmod-crypto-lib-curve25519=y +CONFIG_PACKAGE_kmod-crypto-lib-poly1305=y +CONFIG_PACKAGE_kmod-crypto-manager=y +CONFIG_PACKAGE_kmod-crypto-md4=y +CONFIG_PACKAGE_kmod-crypto-md5=y +CONFIG_PACKAGE_kmod-crypto-null=y +CONFIG_PACKAGE_kmod-crypto-rng=y +CONFIG_PACKAGE_kmod-crypto-seqiv=y +CONFIG_PACKAGE_kmod-crypto-sha1=y +CONFIG_PACKAGE_kmod-crypto-sha256=y +CONFIG_PACKAGE_kmod-crypto-sha512=y +CONFIG_PACKAGE_kmod-crypto-user=y +CONFIG_PACKAGE_kmod-cryptodev=y +CONFIG_PACKAGE_kmod-dax=y +CONFIG_PACKAGE_kmod-dm=y +CONFIG_PACKAGE_kmod-dma-buf=y +CONFIG_PACKAGE_kmod-drm=y +CONFIG_PACKAGE_kmod-drm-kms-helper=y +CONFIG_PACKAGE_kmod-drm-rockchip=y +CONFIG_PACKAGE_kmod-dummy=y +CONFIG_PACKAGE_kmod-fb=y +CONFIG_PACKAGE_kmod-fb-cfb-copyarea=y +CONFIG_PACKAGE_kmod-fb-cfb-fillrect=y +CONFIG_PACKAGE_kmod-fb-cfb-imgblt=y +CONFIG_PACKAGE_kmod-fb-sys-fops=y +CONFIG_PACKAGE_kmod-fb-sys-ram=y +CONFIG_PACKAGE_kmod-fs-btrfs=y +CONFIG_PACKAGE_kmod-fs-cifs=y +CONFIG_PACKAGE_kmod-fs-ext4=y +CONFIG_PACKAGE_kmod-fs-f2fs=y +CONFIG_PACKAGE_kmod-fs-squashfs=y +CONFIG_PACKAGE_kmod-fs-vfat=y +CONFIG_PACKAGE_kmod-hwmon-core=y +CONFIG_PACKAGE_kmod-i2c-core=y +CONFIG_PACKAGE_kmod-ifb=y +CONFIG_PACKAGE_kmod-ikconfig=y +CONFIG_PACKAGE_kmod-input-core=y +CONFIG_PACKAGE_kmod-ip-vti=y +CONFIG_PACKAGE_kmod-ip6-tunnel=y +CONFIG_PACKAGE_kmod-ip6-vti=y +CONFIG_PACKAGE_kmod-ip6tables=y +CONFIG_PACKAGE_kmod-ipsec=y +CONFIG_PACKAGE_kmod-ipsec4=y +CONFIG_PACKAGE_kmod-ipsec6=y +CONFIG_PACKAGE_kmod-ipt-compat-xtables=y +CONFIG_PACKAGE_kmod-ipt-conntrack=y +CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y +CONFIG_PACKAGE_kmod-ipt-core=y +CONFIG_PACKAGE_kmod-ipt-extra=y +CONFIG_PACKAGE_kmod-ipt-iface=y +CONFIG_PACKAGE_kmod-ipt-ipmark=y +CONFIG_PACKAGE_kmod-ipt-ipopt=y +CONFIG_PACKAGE_kmod-ipt-ipsec=y +CONFIG_PACKAGE_kmod-ipt-ipset=y +CONFIG_PACKAGE_kmod-ipt-nat=y +CONFIG_PACKAGE_kmod-ipt-nat-extra=y +CONFIG_PACKAGE_kmod-ipt-physdev=y +CONFIG_PACKAGE_kmod-ipt-proto=y +CONFIG_PACKAGE_kmod-ipt-raw=y +CONFIG_PACKAGE_kmod-iptunnel=y +CONFIG_PACKAGE_kmod-iptunnel4=y +CONFIG_PACKAGE_kmod-iptunnel6=y +CONFIG_PACKAGE_kmod-keys-encrypted=y +CONFIG_PACKAGE_kmod-keys-trusted=y +CONFIG_PACKAGE_kmod-lib-crc16=y +CONFIG_PACKAGE_kmod-lib-lzo=y +CONFIG_PACKAGE_kmod-lib-raid6=y +CONFIG_PACKAGE_kmod-lib-xor=y +CONFIG_PACKAGE_kmod-lib-zlib-deflate=y +CONFIG_PACKAGE_kmod-lib-zlib-inflate=y +CONFIG_PACKAGE_kmod-lib-zstd=y +CONFIG_PACKAGE_kmod-libphy=y +CONFIG_PACKAGE_kmod-macvlan=y +CONFIG_PACKAGE_kmod-mii=y +CONFIG_PACKAGE_kmod-multimedia-input=y +CONFIG_PACKAGE_kmod-nf-conntrack-netlink=y +CONFIG_PACKAGE_kmod-nf-ipt=y +CONFIG_PACKAGE_kmod-nf-ipt6=y +CONFIG_PACKAGE_kmod-nf-ipvs=y +CONFIG_PACKAGE_kmod-nf-nathelper=y +CONFIG_PACKAGE_kmod-nf-tproxy=y +CONFIG_PACKAGE_kmod-nfnetlink-log=y +CONFIG_PACKAGE_kmod-nfnetlink-queue=y +CONFIG_PACKAGE_kmod-nft-bridge=y +CONFIG_PACKAGE_kmod-nft-compat=y +CONFIG_PACKAGE_kmod-nft-queue=y +CONFIG_PACKAGE_kmod-nls-base=y +CONFIG_PACKAGE_kmod-nls-cp437=y +CONFIG_PACKAGE_kmod-nls-iso8859-1=y +CONFIG_PACKAGE_kmod-nls-utf8=y +CONFIG_PACKAGE_kmod-phy-realtek=y +CONFIG_PACKAGE_kmod-random-core=y +CONFIG_PACKAGE_kmod-sched-cake=y +CONFIG_PACKAGE_kmod-sched-connmark=y +CONFIG_PACKAGE_kmod-sched-core=y +CONFIG_PACKAGE_kmod-sound-core=y +CONFIG_PACKAGE_kmod-sound-usb-caiaq=y +CONFIG_PACKAGE_kmod-tpm=y +CONFIG_PACKAGE_kmod-tun=y +CONFIG_PACKAGE_kmod-udptunnel4=y +CONFIG_PACKAGE_kmod-udptunnel6=y +CONFIG_PACKAGE_kmod-usb-audio=y +CONFIG_PACKAGE_kmod-usb-core=y +CONFIG_PACKAGE_kmod-usb-dwc2=y +CONFIG_PACKAGE_kmod-usb-dwc3=y +CONFIG_PACKAGE_kmod-usb-ehci=y +CONFIG_PACKAGE_kmod-usb-gadget=y +CONFIG_PACKAGE_kmod-usb-net=y +CONFIG_PACKAGE_kmod-usb-net-cdc-ether=y +CONFIG_PACKAGE_kmod-usb-net-cdc-ncm=y +CONFIG_PACKAGE_kmod-usb-net-rtl8152=y +CONFIG_PACKAGE_kmod-usb-roles=y +CONFIG_PACKAGE_kmod-usb-xhci-hcd=y +CONFIG_PACKAGE_kmod-usb2=y +CONFIG_PACKAGE_kmod-usb3=y +CONFIG_PACKAGE_kmod-veth=y +CONFIG_PACKAGE_kmod-vxlan=y +CONFIG_PACKAGE_kmod-wireguard=y +CONFIG_PACKAGE_kmod-xfrm-interface=y +CONFIG_PACKAGE_libatomic=y +CONFIG_PACKAGE_libattr=y +CONFIG_PACKAGE_libavahi-client=y +CONFIG_PACKAGE_libavahi-dbus-support=y +CONFIG_PACKAGE_libbpf=y +CONFIG_PACKAGE_libcap-ng=y +CONFIG_PACKAGE_libconfig=y +CONFIG_PACKAGE_libcurl=y +CONFIG_PACKAGE_libdaemon=y +CONFIG_PACKAGE_libdbus=y +CONFIG_PACKAGE_libdevmapper=y +CONFIG_PACKAGE_libelf=y +CONFIG_PACKAGE_libevent2=y +CONFIG_PACKAGE_libevent2-core=y +CONFIG_PACKAGE_libevent2-pthreads=y +CONFIG_PACKAGE_libexpat=y +CONFIG_PACKAGE_libgmp=y +CONFIG_PACKAGE_libi2c=y +CONFIG_PACKAGE_libip4tc=y +CONFIG_PACKAGE_libip6tc=y +CONFIG_PACKAGE_libipset=y +CONFIG_PACKAGE_libiptext=y +CONFIG_PACKAGE_libiptext-nft=y +CONFIG_PACKAGE_libiptext6=y +CONFIG_PACKAGE_libiwinfo=y +CONFIG_PACKAGE_libiwinfo-data=y +CONFIG_PACKAGE_libiwinfo-lua=y +CONFIG_PACKAGE_libldns=y +CONFIG_PACKAGE_libltdl=y +CONFIG_PACKAGE_liblua=y +CONFIG_PACKAGE_liblua5.3=y +CONFIG_PACKAGE_liblucihttp=y +CONFIG_PACKAGE_liblucihttp-lua=y +CONFIG_PACKAGE_liblzo=y +CONFIG_PACKAGE_libmount=y +CONFIG_PACKAGE_libnetfilter-conntrack=y +CONFIG_PACKAGE_libnetfilter-cthelper=y +CONFIG_PACKAGE_libnetfilter-cttimeout=y +CONFIG_PACKAGE_libnetfilter-queue=y +CONFIG_PACKAGE_libnetsnmp=y +CONFIG_PACKAGE_libnettle=y +CONFIG_PACKAGE_libnetwork=y +CONFIG_PACKAGE_libnfnetlink=y +CONFIG_PACKAGE_libnghttp2=y +CONFIG_PACKAGE_libnl-core=y +CONFIG_PACKAGE_libnl-route=y +CONFIG_PACKAGE_libnss=y +CONFIG_PACKAGE_libopenssl=y +CONFIG_PACKAGE_libopenssl-conf=y +CONFIG_PACKAGE_libopenssl-devcrypto=y +CONFIG_PACKAGE_libpcap=y +CONFIG_PACKAGE_libpci=y +CONFIG_PACKAGE_libpcre=y +CONFIG_PACKAGE_libpopt=y +CONFIG_PACKAGE_libreadline=y +CONFIG_PACKAGE_libreswan=y +CONFIG_PACKAGE_librrd1=y +CONFIG_PACKAGE_libseccomp=y +CONFIG_PACKAGE_libsensors=y +CONFIG_PACKAGE_libsoxr=y +CONFIG_PACKAGE_libsqlite3=y +CONFIG_PACKAGE_libstdcpp=y +CONFIG_PACKAGE_libsysfs=y +CONFIG_PACKAGE_libubus-lua=y +CONFIG_PACKAGE_libuci-lua=y +CONFIG_PACKAGE_libunbound=y +CONFIG_PACKAGE_libunbound_ipset=y +CONFIG_PACKAGE_libunbound_libevent=y +CONFIG_PACKAGE_libunbound_libpthread=y +CONFIG_PACKAGE_libuv=y +CONFIG_PACKAGE_libxtables=y +CONFIG_PACKAGE_lm-sensors=y +CONFIG_PACKAGE_losetup=y +CONFIG_PACKAGE_lua=y +CONFIG_PACKAGE_luci=y +CONFIG_PACKAGE_luci-app-acl=y +CONFIG_PACKAGE_luci-app-acme=y +CONFIG_PACKAGE_luci-app-adblock=y +CONFIG_PACKAGE_luci-app-banip=y +CONFIG_PACKAGE_luci-app-commands=y +CONFIG_PACKAGE_luci-app-ddns=y +CONFIG_PACKAGE_luci-app-firewall=y +CONFIG_PACKAGE_luci-app-ntpc=y +CONFIG_PACKAGE_luci-app-openvpn=y +CONFIG_PACKAGE_luci-app-opkg=y +CONFIG_PACKAGE_luci-app-pbr=y +CONFIG_PACKAGE_luci-app-qos=y +CONFIG_PACKAGE_luci-app-sqm=y +CONFIG_PACKAGE_luci-app-statistics=y +CONFIG_PACKAGE_luci-app-tinyproxy=y +CONFIG_PACKAGE_luci-base=y +CONFIG_PACKAGE_luci-compat=y +CONFIG_PACKAGE_luci-i18n-acl-en=y +CONFIG_PACKAGE_luci-i18n-acme-en=y +CONFIG_PACKAGE_luci-i18n-adblock-en=y +CONFIG_PACKAGE_luci-i18n-banip-en=y +CONFIG_PACKAGE_luci-i18n-base-en=y +CONFIG_PACKAGE_luci-i18n-commands-en=y +CONFIG_PACKAGE_luci-i18n-dashboard-en=y +CONFIG_PACKAGE_luci-i18n-ddns-en=y +CONFIG_PACKAGE_luci-i18n-firewall-en=y +CONFIG_PACKAGE_luci-i18n-ntpc-en=y +CONFIG_PACKAGE_luci-i18n-openvpn-en=y +CONFIG_PACKAGE_luci-i18n-opkg-en=y +CONFIG_PACKAGE_luci-i18n-qos-en=y +CONFIG_PACKAGE_luci-i18n-sqm-en=y +CONFIG_PACKAGE_luci-i18n-statistics-en=y +CONFIG_PACKAGE_luci-i18n-tinyproxy-en=y +CONFIG_PACKAGE_luci-lib-base=y +CONFIG_PACKAGE_luci-lib-ip=y +CONFIG_PACKAGE_luci-lib-ipkg=y +CONFIG_PACKAGE_luci-lib-jsonc=y +CONFIG_PACKAGE_luci-lib-nixio=y +CONFIG_PACKAGE_luci-mod-admin-full=y +CONFIG_PACKAGE_luci-mod-dashboard=y +CONFIG_PACKAGE_luci-mod-network=y +CONFIG_PACKAGE_luci-mod-status=y +CONFIG_PACKAGE_luci-mod-system=y +CONFIG_PACKAGE_luci-proto-ipv6=y +CONFIG_PACKAGE_luci-proto-ppp=y +CONFIG_PACKAGE_luci-proto-wireguard=y +CONFIG_PACKAGE_luci-theme-bootstrap=y +CONFIG_PACKAGE_luci-theme-openwrt-2020=y +CONFIG_PACKAGE_mount-utils=y +CONFIG_PACKAGE_mt7601u-firmware=y +CONFIG_PACKAGE_nano=y +CONFIG_PACKAGE_netcat=y +CONFIG_PACKAGE_netperf=y +CONFIG_PACKAGE_nlbwmon=y +CONFIG_PACKAGE_nspr=y +CONFIG_PACKAGE_nss-utils=y +CONFIG_PACKAGE_nstat=y +CONFIG_PACKAGE_ntpclient=y +CONFIG_PACKAGE_openssl-util=y +CONFIG_PACKAGE_openvpn-openssl=y +CONFIG_PACKAGE_pbr-ipt=y +CONFIG_PACKAGE_picocom=y +CONFIG_PACKAGE_qos-scripts=y +CONFIG_PACKAGE_r8152-firmware=y +CONFIG_PACKAGE_r8169-firmware=y +CONFIG_PACKAGE_resolveip=y +CONFIG_PACKAGE_rng-tools=y +CONFIG_PACKAGE_rpcd=y +CONFIG_PACKAGE_rpcd-mod-file=y +CONFIG_PACKAGE_rpcd-mod-iwinfo=y +CONFIG_PACKAGE_rpcd-mod-luci=y +CONFIG_PACKAGE_rpcd-mod-rrdns=y +CONFIG_PACKAGE_rrdtool1=y +CONFIG_PACKAGE_runc=y +CONFIG_PACKAGE_shairport-sync-openssl=y +CONFIG_PACKAGE_socat=y +CONFIG_PACKAGE_speedtest-netperf=y +CONFIG_PACKAGE_sqm-scripts=y +CONFIG_PACKAGE_sqm-scripts-extra=y +CONFIG_PACKAGE_sysfsutils=y +CONFIG_PACKAGE_tc-mod-iptables=y +CONFIG_PACKAGE_tc-tiny=y +CONFIG_PACKAGE_tcpdump=y +CONFIG_PACKAGE_tini=y +CONFIG_PACKAGE_tinyproxy=y +CONFIG_PACKAGE_uhttpd=y +CONFIG_PACKAGE_uhttpd-mod-ubus=y +CONFIG_PACKAGE_urngd=y +CONFIG_PACKAGE_wget-ssl=y +CONFIG_PACKAGE_wireguard-tools=y +CONFIG_PACKAGE_wireless-regdb=y +CONFIG_PACKAGE_xtables-legacy=y +CONFIG_PACKAGE_xtables-nft=y +CONFIG_PACKAGE_zlib=y +CONFIG_PACKAGE_zoneinfo-core=y +CONFIG_PACKAGE_zoneinfo-europe=y +CONFIG_SOCAT_SSL=y +CONFIG_SQLITE3_DYNAMIC_EXTENSIONS=y +CONFIG_SQLITE3_FTS3=y +CONFIG_SQLITE3_FTS4=y +CONFIG_SQLITE3_FTS5=y +CONFIG_SQLITE3_JSON1=y +CONFIG_SQLITE3_RTREE=y +# CONFIG_TARGET_IMAGES_GZIP is not set +CONFIG_TARGET_KERNEL_PARTSIZE=40 +CONFIG_TARGET_OPTIMIZATION="-O3 -pipe -mcpu=cortex-a72.cortex-a53+crypto+crc" +CONFIG_TARGET_OPTIONS=y +CONFIG_TARGET_ROOTFS_PARTSIZE=1024 diff --git a/openwrt-21.02/seed/ao-R4S-mini.seed b/openwrt-23.05/seed/ao-R4S-mini.seed similarity index 77% rename from openwrt-21.02/seed/ao-R4S-mini.seed rename to openwrt-23.05/seed/ao-R4S-mini.seed index b86f8b5..da7a9c2 100644 --- a/openwrt-21.02/seed/ao-R4S-mini.seed +++ b/openwrt-23.05/seed/ao-R4S-mini.seed @@ -3,45 +3,64 @@ CONFIG_TARGET_rockchip_armv8=y CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4s=y CONFIG_DEVEL=y CONFIG_TOOLCHAINOPTS=y +CONFIG_BIND_ENABLE_DOH=y +CONFIG_BPF_TOOLCHAIN_HOST=y +CONFIG_BPF_TOOLCHAIN_HOST_PATH="" +# CONFIG_BPF_TOOLCHAIN_NONE is not set CONFIG_COREMARK_ENABLE_MULTITHREADING=y CONFIG_COREMARK_NUMBER_OF_THREADS=16 CONFIG_COREMARK_OPTIMIZE_O3=y CONFIG_EXPERIMENTAL=y +CONFIG_HAS_BPF_TOOLCHAIN=y CONFIG_IFSTAT_SNMP=y CONFIG_IPERF_ENABLE_MULTICAST=y CONFIG_KERNEL_ARM_PMU=y +CONFIG_KERNEL_BLK_DEV_THROTTLING_LOW=y CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y CONFIG_KERNEL_BUILD_DOMAIN="openwrt" CONFIG_KERNEL_BUILD_USER="ao" -# CONFIG_KERNEL_CGROUPS is not set +CONFIG_KERNEL_CFQ_GROUP_IOSCHED=y +CONFIG_KERNEL_CGROUP_DEVICE=y +CONFIG_KERNEL_CGROUP_FREEZER=y +CONFIG_KERNEL_CGROUP_HUGETLB=y +CONFIG_KERNEL_CGROUP_NET_PRIO=y +CONFIG_KERNEL_CGROUP_PERF=y +CONFIG_KERNEL_DEBUG_BLK_CGROUP=y CONFIG_KERNEL_EXT4_FS_POSIX_ACL=y CONFIG_KERNEL_EXT4_FS_SECURITY=y CONFIG_KERNEL_FS_POSIX_ACL=y CONFIG_KERNEL_HUGETLBFS=y CONFIG_KERNEL_HUGETLB_PAGE=y -# CONFIG_KERNEL_NAMESPACES is not set +CONFIG_KERNEL_MEMCG_SWAP_ENABLED=y +CONFIG_KERNEL_NET_CLS_CGROUP=y CONFIG_KERNEL_PERF_EVENTS=y +CONFIG_KERNEL_PROC_PID_CPUSET=y CONFIG_KERNEL_TRANSPARENT_HUGEPAGE=y CONFIG_KERNEL_TRANSPARENT_HUGEPAGE_ALWAYS=y CONFIG_LIBCURL_COOKIES=y -CONFIG_LIBCURL_CRYPTO_AUTH=y CONFIG_LIBCURL_FILE=y CONFIG_LIBCURL_FTP=y CONFIG_LIBCURL_HTTP=y CONFIG_LIBCURL_NGHTTP2=y +CONFIG_LIBCURL_NO_SMB="!" CONFIG_LIBCURL_OPENSSL=y CONFIG_LIBCURL_PROXY=y -CONFIG_LUCI_LANG_en=y +CONFIG_LIBCURL_UNIX_SOCKETS=y CONFIG_OPENSSL_ENGINE=y CONFIG_OPENSSL_OPTIMIZE_SPEED=y +CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y CONFIG_OPENSSL_WITH_ASM=y CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y CONFIG_OPENSSL_WITH_CMS=y CONFIG_OPENSSL_WITH_DEPRECATED=y CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y +CONFIG_OPENSSL_WITH_IDEA=y +CONFIG_OPENSSL_WITH_MDC2=y CONFIG_OPENSSL_WITH_PSK=y +CONFIG_OPENSSL_WITH_SEED=y CONFIG_OPENSSL_WITH_SRP=y CONFIG_OPENSSL_WITH_TLS13=y +CONFIG_OPENSSL_WITH_WHIRLPOOL=y CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y CONFIG_OPENVPN_openssl_ENABLE_FRAGMENT=y CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y @@ -51,15 +70,19 @@ CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y CONFIG_OPENVPN_openssl_ENABLE_PF=y CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y CONFIG_OPENVPN_openssl_ENABLE_SMALL=y +CONFIG_PACKAGE_acme=y +CONFIG_PACKAGE_acme-acmesh=y +CONFIG_PACKAGE_acme-acmesh-dnsapi=y +CONFIG_PACKAGE_acme-common=y CONFIG_PACKAGE_adguardhome=y CONFIG_PACKAGE_alsa-lib=y CONFIG_PACKAGE_alsa-ucm-conf=y CONFIG_PACKAGE_alsa-utils=y -CONFIG_PACKAGE_arptables=y +CONFIG_PACKAGE_arptables-nft=y CONFIG_PACKAGE_avahi-dbus-daemon=y -CONFIG_PACKAGE_banip=y CONFIG_PACKAGE_bind-check=y CONFIG_PACKAGE_bind-client=y +CONFIG_PACKAGE_bind-ddns-confgen=y CONFIG_PACKAGE_bind-dig=y CONFIG_PACKAGE_bind-dnssec=y CONFIG_PACKAGE_bind-host=y @@ -109,12 +132,11 @@ CONFIG_PACKAGE_dnsmasq_full_conntrack=y CONFIG_PACKAGE_dnsmasq_full_dhcp=y CONFIG_PACKAGE_dnsmasq_full_dhcpv6=y CONFIG_PACKAGE_dnsmasq_full_dnssec=y -CONFIG_PACKAGE_dnsmasq_full_ipset=y +CONFIG_PACKAGE_dnsmasq_full_nftset=y CONFIG_PACKAGE_dnsmasq_full_noid=y CONFIG_PACKAGE_dnsmasq_full_tftp=y CONFIG_PACKAGE_ds-lite=y -CONFIG_PACKAGE_ebtables=y -CONFIG_PACKAGE_ebtables-utils=y +CONFIG_PACKAGE_ebtables-nft=y CONFIG_PACKAGE_etherwake=y CONFIG_PACKAGE_f2fs-tools=y CONFIG_PACKAGE_f2fsck=y @@ -125,37 +147,18 @@ CONFIG_PACKAGE_ifstat=y CONFIG_PACKAGE_iftop=y CONFIG_PACKAGE_igmpproxy=y CONFIG_PACKAGE_ip-full=y -CONFIG_PACKAGE_ip-tiny=y -CONFIG_PACKAGE_ip6tables-extra=y -CONFIG_PACKAGE_ip6tables-mod-nat=y +CONFIG_PACKAGE_ip6tables-nft=y CONFIG_PACKAGE_iperf=y CONFIG_PACKAGE_iperf3=y CONFIG_PACKAGE_ipset=y -CONFIG_PACKAGE_iptables-mod-cluster=y -CONFIG_PACKAGE_iptables-mod-clusterip=y -CONFIG_PACKAGE_iptables-mod-condition=y CONFIG_PACKAGE_iptables-mod-conntrack-extra=y -CONFIG_PACKAGE_iptables-mod-extra=y -CONFIG_PACKAGE_iptables-mod-iface=y -CONFIG_PACKAGE_iptables-mod-ipmark=y CONFIG_PACKAGE_iptables-mod-ipopt=y -CONFIG_PACKAGE_iptables-mod-iprange=y -CONFIG_PACKAGE_iptables-mod-length2=y -CONFIG_PACKAGE_iptables-mod-logmark=y -CONFIG_PACKAGE_iptables-mod-nat-extra=y -CONFIG_PACKAGE_iptables-mod-nflog=y -CONFIG_PACKAGE_iptables-mod-nfqueue=y -CONFIG_PACKAGE_iptables-mod-physdev=y -CONFIG_PACKAGE_iptables-mod-proto=y -CONFIG_PACKAGE_iptables-mod-rpfilter=y -CONFIG_PACKAGE_iptables-mod-tproxy=y -CONFIG_PACKAGE_iptables-mod-u32=y +CONFIG_PACKAGE_iptables-nft=y CONFIG_PACKAGE_jq=y CONFIG_PACKAGE_kmod-arptables=y -CONFIG_PACKAGE_kmod-backlight=y -CONFIG_PACKAGE_kmod-backlight-pwm=y +CONFIG_PACKAGE_kmod-asn1-decoder=y +CONFIG_PACKAGE_kmod-asn1-encoder=y CONFIG_PACKAGE_kmod-br-netfilter=y -CONFIG_PACKAGE_kmod-crypto-acompress=y CONFIG_PACKAGE_kmod-crypto-aead=y CONFIG_PACKAGE_kmod-crypto-arc4=y CONFIG_PACKAGE_kmod-crypto-authenc=y @@ -163,7 +166,6 @@ CONFIG_PACKAGE_kmod-crypto-cbc=y CONFIG_PACKAGE_kmod-crypto-ccm=y CONFIG_PACKAGE_kmod-crypto-cmac=y CONFIG_PACKAGE_kmod-crypto-crc32=y -CONFIG_PACKAGE_kmod-crypto-crc32c=y CONFIG_PACKAGE_kmod-crypto-ctr=y CONFIG_PACKAGE_kmod-crypto-deflate=y CONFIG_PACKAGE_kmod-crypto-des=y @@ -172,7 +174,6 @@ CONFIG_PACKAGE_kmod-crypto-echainiv=y CONFIG_PACKAGE_kmod-crypto-gcm=y CONFIG_PACKAGE_kmod-crypto-gf128=y CONFIG_PACKAGE_kmod-crypto-ghash=y -CONFIG_PACKAGE_kmod-crypto-hash=y CONFIG_PACKAGE_kmod-crypto-hmac=y CONFIG_PACKAGE_kmod-crypto-kpp=y CONFIG_PACKAGE_kmod-crypto-lib-chacha20=y @@ -183,7 +184,6 @@ CONFIG_PACKAGE_kmod-crypto-manager=y CONFIG_PACKAGE_kmod-crypto-md4=y CONFIG_PACKAGE_kmod-crypto-md5=y CONFIG_PACKAGE_kmod-crypto-null=y -CONFIG_PACKAGE_kmod-crypto-pcompress=y CONFIG_PACKAGE_kmod-crypto-rng=y CONFIG_PACKAGE_kmod-crypto-seqiv=y CONFIG_PACKAGE_kmod-crypto-sha1=y @@ -193,18 +193,8 @@ CONFIG_PACKAGE_kmod-crypto-user=y CONFIG_PACKAGE_kmod-cryptodev=y CONFIG_PACKAGE_kmod-dax=y CONFIG_PACKAGE_kmod-dm=y -CONFIG_PACKAGE_kmod-dma-buf=y -CONFIG_PACKAGE_kmod-drm=y -CONFIG_PACKAGE_kmod-drm-kms-helper=y -CONFIG_PACKAGE_kmod-drm-rockchip=y CONFIG_PACKAGE_kmod-dummy=y CONFIG_PACKAGE_kmod-ebtables=y -CONFIG_PACKAGE_kmod-fb=y -CONFIG_PACKAGE_kmod-fb-cfb-copyarea=y -CONFIG_PACKAGE_kmod-fb-cfb-fillrect=y -CONFIG_PACKAGE_kmod-fb-cfb-imgblt=y -CONFIG_PACKAGE_kmod-fb-sys-fops=y -CONFIG_PACKAGE_kmod-fb-sys-ram=y CONFIG_PACKAGE_kmod-fs-ext4=y CONFIG_PACKAGE_kmod-fs-f2fs=y CONFIG_PACKAGE_kmod-fs-squashfs=y @@ -215,66 +205,48 @@ CONFIG_PACKAGE_kmod-ifb=y CONFIG_PACKAGE_kmod-ikconfig=y CONFIG_PACKAGE_kmod-input-core=y CONFIG_PACKAGE_kmod-ip6-tunnel=y -CONFIG_PACKAGE_kmod-ip6tables-extra=y +CONFIG_PACKAGE_kmod-ip6tables=y CONFIG_PACKAGE_kmod-ipsec=y -CONFIG_PACKAGE_kmod-ipt-cluster=y -CONFIG_PACKAGE_kmod-ipt-clusterip=y -CONFIG_PACKAGE_kmod-ipt-compat-xtables=y -CONFIG_PACKAGE_kmod-ipt-condition=y +CONFIG_PACKAGE_kmod-ipt-conntrack=y CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y -CONFIG_PACKAGE_kmod-ipt-conntrack-label=y -CONFIG_PACKAGE_kmod-ipt-extra=y -CONFIG_PACKAGE_kmod-ipt-iface=y -CONFIG_PACKAGE_kmod-ipt-ipmark=y +CONFIG_PACKAGE_kmod-ipt-core=y CONFIG_PACKAGE_kmod-ipt-ipopt=y -CONFIG_PACKAGE_kmod-ipt-iprange=y CONFIG_PACKAGE_kmod-ipt-ipset=y -CONFIG_PACKAGE_kmod-ipt-ipv4options=y -CONFIG_PACKAGE_kmod-ipt-length2=y -CONFIG_PACKAGE_kmod-ipt-logmark=y -CONFIG_PACKAGE_kmod-ipt-nat-extra=y -CONFIG_PACKAGE_kmod-ipt-nat6=y -CONFIG_PACKAGE_kmod-ipt-nflog=y -CONFIG_PACKAGE_kmod-ipt-nfqueue=y -CONFIG_PACKAGE_kmod-ipt-physdev=y -CONFIG_PACKAGE_kmod-ipt-proto=y CONFIG_PACKAGE_kmod-ipt-raw=y -CONFIG_PACKAGE_kmod-ipt-raw6=y -CONFIG_PACKAGE_kmod-ipt-rpfilter=y -CONFIG_PACKAGE_kmod-ipt-tproxy=y -CONFIG_PACKAGE_kmod-ipt-u32=y CONFIG_PACKAGE_kmod-iptunnel=y CONFIG_PACKAGE_kmod-iptunnel6=y CONFIG_PACKAGE_kmod-keys-encrypted=y CONFIG_PACKAGE_kmod-keys-trusted=y -# CONFIG_PACKAGE_kmod-lib-crc-ccitt is not set CONFIG_PACKAGE_kmod-lib-crc16=y -CONFIG_PACKAGE_kmod-lib-crc32c=y +CONFIG_PACKAGE_kmod-lib-textsearch=y CONFIG_PACKAGE_kmod-lib-zlib-deflate=y CONFIG_PACKAGE_kmod-lib-zlib-inflate=y CONFIG_PACKAGE_kmod-lib-zstd=y CONFIG_PACKAGE_kmod-libphy=y -CONFIG_PACKAGE_kmod-multimedia-input=y +CONFIG_PACKAGE_kmod-mii=y +CONFIG_PACKAGE_kmod-nf-conncount=y CONFIG_PACKAGE_kmod-nf-conntrack-netlink=y +CONFIG_PACKAGE_kmod-nf-ipt=y +CONFIG_PACKAGE_kmod-nf-ipt6=y CONFIG_PACKAGE_kmod-nf-ipvs=y -CONFIG_PACKAGE_kmod-nf-nat6=y CONFIG_PACKAGE_kmod-nf-nathelper=y -CONFIG_PACKAGE_kmod-nfnetlink=y +CONFIG_PACKAGE_kmod-nf-tproxy=y CONFIG_PACKAGE_kmod-nfnetlink-log=y CONFIG_PACKAGE_kmod-nfnetlink-queue=y +CONFIG_PACKAGE_kmod-nft-arp=y CONFIG_PACKAGE_kmod-nft-bridge=y -CONFIG_PACKAGE_kmod-nft-core=y -CONFIG_PACKAGE_kmod-nft-nat=y -CONFIG_PACKAGE_kmod-nft-nat6=y -CONFIG_PACKAGE_kmod-nft-offload=y +CONFIG_PACKAGE_kmod-nft-compat=y CONFIG_PACKAGE_kmod-nft-queue=y CONFIG_PACKAGE_kmod-nls-base=y CONFIG_PACKAGE_kmod-nls-cp437=y CONFIG_PACKAGE_kmod-nls-iso8859-1=y CONFIG_PACKAGE_kmod-nls-utf8=y +CONFIG_PACKAGE_kmod-oid-registry=y CONFIG_PACKAGE_kmod-phy-realtek=y # CONFIG_PACKAGE_kmod-ppp is not set CONFIG_PACKAGE_kmod-random-core=y +CONFIG_PACKAGE_kmod-sched=y +CONFIG_PACKAGE_kmod-sched-bpf=y CONFIG_PACKAGE_kmod-sched-cake=y CONFIG_PACKAGE_kmod-sched-connmark=y CONFIG_PACKAGE_kmod-sched-core=y @@ -291,6 +263,12 @@ CONFIG_PACKAGE_kmod-usb-dwc2=y CONFIG_PACKAGE_kmod-usb-dwc3=y CONFIG_PACKAGE_kmod-usb-ehci=y CONFIG_PACKAGE_kmod-usb-gadget=y +CONFIG_PACKAGE_kmod-usb-net=y +CONFIG_PACKAGE_kmod-usb-net-cdc-ether=y +CONFIG_PACKAGE_kmod-usb-net-cdc-ncm=y +CONFIG_PACKAGE_kmod-usb-net-rtl8152=y +CONFIG_PACKAGE_kmod-usb-roles=y +CONFIG_PACKAGE_kmod-usb-xhci-hcd=y CONFIG_PACKAGE_kmod-usb2=y CONFIG_PACKAGE_kmod-usb3=y CONFIG_PACKAGE_kmod-veth=y @@ -307,9 +285,16 @@ CONFIG_PACKAGE_libdaemon=y CONFIG_PACKAGE_libdbus=y CONFIG_PACKAGE_libelf=y CONFIG_PACKAGE_libexpat=y +CONFIG_PACKAGE_libfdisk=y CONFIG_PACKAGE_libgmp=y CONFIG_PACKAGE_libi2c=y +CONFIG_PACKAGE_libip4tc=y +CONFIG_PACKAGE_libip6tc=y +CONFIG_PACKAGE_libiperf3=y CONFIG_PACKAGE_libipset=y +CONFIG_PACKAGE_libiptext=y +CONFIG_PACKAGE_libiptext-nft=y +CONFIG_PACKAGE_libiptext6=y CONFIG_PACKAGE_libiwinfo=y CONFIG_PACKAGE_libiwinfo-data=y CONFIG_PACKAGE_libiwinfo-lua=y @@ -319,8 +304,9 @@ CONFIG_PACKAGE_liblua5.3=y CONFIG_PACKAGE_liblucihttp=y CONFIG_PACKAGE_liblucihttp-lua=y CONFIG_PACKAGE_liblzo=y -CONFIG_PACKAGE_libmnl=y +CONFIG_PACKAGE_libmbedtls=m CONFIG_PACKAGE_libmount=y +CONFIG_PACKAGE_libncurses=y CONFIG_PACKAGE_libnetfilter-conntrack=y CONFIG_PACKAGE_libnetfilter-cthelper=y CONFIG_PACKAGE_libnetfilter-cttimeout=y @@ -328,7 +314,6 @@ CONFIG_PACKAGE_libnetfilter-queue=y CONFIG_PACKAGE_libnetsnmp=y CONFIG_PACKAGE_libnettle=y CONFIG_PACKAGE_libnfnetlink=y -CONFIG_PACKAGE_libnftnl=y CONFIG_PACKAGE_libnghttp2=y CONFIG_PACKAGE_libnl-core=y CONFIG_PACKAGE_libnl-route=y @@ -344,9 +329,13 @@ CONFIG_PACKAGE_librrd1=y CONFIG_PACKAGE_libseccomp=y CONFIG_PACKAGE_libsensors=y CONFIG_PACKAGE_libsoxr=y +CONFIG_PACKAGE_libstdcpp=y CONFIG_PACKAGE_libsysfs=y CONFIG_PACKAGE_libubus-lua=y +# CONFIG_PACKAGE_libustream-mbedtls is not set +CONFIG_PACKAGE_libustream-openssl=y CONFIG_PACKAGE_libuv=y +CONFIG_PACKAGE_libxtables=y CONFIG_PACKAGE_losetup=y CONFIG_PACKAGE_lua=y CONFIG_PACKAGE_mount-utils=y @@ -359,9 +348,12 @@ CONFIG_PACKAGE_nstat=y CONFIG_PACKAGE_ntpclient=y CONFIG_PACKAGE_openssl-util=y CONFIG_PACKAGE_openvpn-openssl=y +CONFIG_PACKAGE_pbr=y CONFIG_PACKAGE_picocom=y # CONFIG_PACKAGE_ppp is not set CONFIG_PACKAGE_qos-scripts=y +CONFIG_PACKAGE_qosify=y +CONFIG_PACKAGE_r8152-firmware=y CONFIG_PACKAGE_r8169-firmware=y CONFIG_PACKAGE_resolveip=y CONFIG_PACKAGE_rng-tools=y @@ -377,18 +369,18 @@ CONFIG_PACKAGE_speedtest-netperf=y CONFIG_PACKAGE_sqm-scripts=y CONFIG_PACKAGE_sqm-scripts-extra=y CONFIG_PACKAGE_sysfsutils=y +CONFIG_PACKAGE_tc-full=y CONFIG_PACKAGE_tc-mod-iptables=y -CONFIG_PACKAGE_tc-tiny=y CONFIG_PACKAGE_tcpdump=y +CONFIG_PACKAGE_terminfo=y CONFIG_PACKAGE_tinyproxy=y -CONFIG_PACKAGE_uacme=y -CONFIG_PACKAGE_uclibcxx=y CONFIG_PACKAGE_uhttpd=y CONFIG_PACKAGE_uhttpd-mod-ubus=y -CONFIG_PACKAGE_vpn-policy-routing=y +CONFIG_PACKAGE_watchcat=y CONFIG_PACKAGE_wget-ssl=y CONFIG_PACKAGE_wireguard-tools=y CONFIG_PACKAGE_wireless-regdb=y +CONFIG_PACKAGE_xtables-nft=y CONFIG_PACKAGE_zlib=y CONFIG_PACKAGE_zoneinfo-core=y CONFIG_PACKAGE_zoneinfo-europe=y @@ -398,3 +390,5 @@ CONFIG_TARGET_KERNEL_PARTSIZE=20 CONFIG_TARGET_OPTIMIZATION="-O3 -pipe -mcpu=cortex-a72.cortex-a53+crypto+crc" CONFIG_TARGET_OPTIONS=y CONFIG_TARGET_ROOTFS_PARTSIZE=1024 +CONFIG_USE_LLVM_HOST=y +CONFIG_PACKAGE_kmod-lib-crc-ccitt=y diff --git a/openwrt-23.05/seed/ao-R4S-mini.seed.orig b/openwrt-23.05/seed/ao-R4S-mini.seed.orig new file mode 100644 index 0000000..9a48598 --- /dev/null +++ b/openwrt-23.05/seed/ao-R4S-mini.seed.orig @@ -0,0 +1,392 @@ +CONFIG_TARGET_rockchip=y +CONFIG_TARGET_rockchip_armv8=y +CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4s=y +CONFIG_DEVEL=y +CONFIG_TOOLCHAINOPTS=y +CONFIG_BIND_ENABLE_DOH=y +CONFIG_COREMARK_ENABLE_MULTITHREADING=y +CONFIG_COREMARK_NUMBER_OF_THREADS=16 +CONFIG_COREMARK_OPTIMIZE_O3=y +CONFIG_EXPERIMENTAL=y +CONFIG_GCC_USE_VERSION_10=y +# CONFIG_GCC_USE_VERSION_11 is not set +CONFIG_GCC_VERSION="10.3.0" +CONFIG_GCC_VERSION_10=y +CONFIG_IFSTAT_SNMP=y +CONFIG_IPERF_ENABLE_MULTICAST=y +CONFIG_KERNEL_ARM_PMU=y +CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y +CONFIG_KERNEL_BUILD_DOMAIN="openwrt" +CONFIG_KERNEL_BUILD_USER="ao" +# CONFIG_KERNEL_CGROUPS is not set +CONFIG_KERNEL_EXT4_FS_POSIX_ACL=y +CONFIG_KERNEL_EXT4_FS_SECURITY=y +CONFIG_KERNEL_FS_POSIX_ACL=y +CONFIG_KERNEL_HUGETLBFS=y +CONFIG_KERNEL_HUGETLB_PAGE=y +# CONFIG_KERNEL_NAMESPACES is not set +CONFIG_KERNEL_PERF_EVENTS=y +CONFIG_KERNEL_TRANSPARENT_HUGEPAGE=y +CONFIG_KERNEL_TRANSPARENT_HUGEPAGE_ALWAYS=y +CONFIG_LIBCURL_COOKIES=y +CONFIG_LIBCURL_FILE=y +CONFIG_LIBCURL_FTP=y +CONFIG_LIBCURL_HTTP=y +CONFIG_LIBCURL_NGHTTP2=y +CONFIG_LIBCURL_NO_SMB="!" +CONFIG_LIBCURL_PROXY=y +CONFIG_LIBCURL_WOLFSSL=y +CONFIG_LUCI_LANG_en=y +CONFIG_OPENSSL_ENGINE=y +CONFIG_OPENSSL_OPTIMIZE_SPEED=y +CONFIG_OPENSSL_WITH_ASM=y +CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y +CONFIG_OPENSSL_WITH_CMS=y +CONFIG_OPENSSL_WITH_DEPRECATED=y +CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y +CONFIG_OPENSSL_WITH_PSK=y +CONFIG_OPENSSL_WITH_SRP=y +CONFIG_OPENSSL_WITH_TLS13=y +CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y +CONFIG_OPENVPN_openssl_ENABLE_FRAGMENT=y +CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y +CONFIG_OPENVPN_openssl_ENABLE_LZ4=y +CONFIG_OPENVPN_openssl_ENABLE_LZO=y +CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y +CONFIG_OPENVPN_openssl_ENABLE_PF=y +CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y +CONFIG_OPENVPN_openssl_ENABLE_SMALL=y +CONFIG_PACKAGE_acme=y +CONFIG_PACKAGE_acme-dnsapi=y +CONFIG_PACKAGE_adblock=y +CONFIG_PACKAGE_alsa-lib=y +CONFIG_PACKAGE_alsa-ucm-conf=y +CONFIG_PACKAGE_alsa-utils=y +CONFIG_PACKAGE_avahi-dbus-daemon=y +CONFIG_PACKAGE_banip=y +CONFIG_PACKAGE_bind-check=y +CONFIG_PACKAGE_bind-client=y +CONFIG_PACKAGE_bind-dig=y +CONFIG_PACKAGE_bind-dnssec=y +CONFIG_PACKAGE_bind-host=y +CONFIG_PACKAGE_bind-libs=y +CONFIG_PACKAGE_bind-nslookup=y +CONFIG_PACKAGE_bind-rndc=y +CONFIG_PACKAGE_bind-tools=y +CONFIG_PACKAGE_blkid=y +CONFIG_PACKAGE_bmon=y +CONFIG_PACKAGE_bridge=y +CONFIG_PACKAGE_ca-certificates=y +CONFIG_PACKAGE_cfdisk=y +CONFIG_PACKAGE_cgi-io=y +CONFIG_PACKAGE_collectd=y +CONFIG_PACKAGE_collectd-mod-cpu=y +CONFIG_PACKAGE_collectd-mod-interface=y +CONFIG_PACKAGE_collectd-mod-iwinfo=y +CONFIG_PACKAGE_collectd-mod-load=y +CONFIG_PACKAGE_collectd-mod-memory=y +CONFIG_PACKAGE_collectd-mod-network=y +CONFIG_PACKAGE_collectd-mod-rrdtool=y +CONFIG_PACKAGE_confuse=y +CONFIG_PACKAGE_conntrack=y +CONFIG_PACKAGE_conntrackd=y +CONFIG_PACKAGE_coremark=y +CONFIG_PACKAGE_coreutils=y +CONFIG_PACKAGE_coreutils-sort=y +CONFIG_PACKAGE_curl=y +CONFIG_PACKAGE_dbus=y +CONFIG_PACKAGE_dbus-utils=y +CONFIG_PACKAGE_ddns-scripts=y +CONFIG_PACKAGE_ddns-scripts-cloudflare=y +CONFIG_PACKAGE_ddns-scripts-cnkuai=y +CONFIG_PACKAGE_ddns-scripts-digitalocean=y +CONFIG_PACKAGE_ddns-scripts-freedns=y +CONFIG_PACKAGE_ddns-scripts-gandi=y +CONFIG_PACKAGE_ddns-scripts-godaddy=y +CONFIG_PACKAGE_ddns-scripts-noip=y +CONFIG_PACKAGE_ddns-scripts-nsupdate=y +CONFIG_PACKAGE_ddns-scripts-route53=y +CONFIG_PACKAGE_ddns-scripts-services=y +CONFIG_PACKAGE_diffutils=y +# CONFIG_PACKAGE_dnsmasq is not set +CONFIG_PACKAGE_dnsmasq-full=y +CONFIG_PACKAGE_dnsmasq_full_auth=y +CONFIG_PACKAGE_dnsmasq_full_conntrack=y +CONFIG_PACKAGE_dnsmasq_full_dhcp=y +CONFIG_PACKAGE_dnsmasq_full_dhcpv6=y +CONFIG_PACKAGE_dnsmasq_full_dnssec=y +CONFIG_PACKAGE_dnsmasq_full_ipset=y +CONFIG_PACKAGE_dnsmasq_full_noid=y +CONFIG_PACKAGE_dnsmasq_full_tftp=y +CONFIG_PACKAGE_ds-lite=y +CONFIG_PACKAGE_etherwake=y +CONFIG_PACKAGE_f2fs-tools=y +CONFIG_PACKAGE_f2fsck=y +CONFIG_PACKAGE_giflib-utils=y +CONFIG_PACKAGE_halog=y +CONFIG_PACKAGE_haproxy=y +CONFIG_PACKAGE_ifstat=y +CONFIG_PACKAGE_iftop=y +CONFIG_PACKAGE_igmpproxy=y +CONFIG_PACKAGE_ip-full=y +CONFIG_PACKAGE_ip-tiny=y +CONFIG_PACKAGE_ip6tables-extra=y +CONFIG_PACKAGE_ip6tables-legacy=y +CONFIG_PACKAGE_ip6tables-mod-nat=y +CONFIG_PACKAGE_ip6tables-nft=y +CONFIG_PACKAGE_iperf=y +CONFIG_PACKAGE_iperf3=y +CONFIG_PACKAGE_ipset=y +CONFIG_PACKAGE_iptables-legacy=y +CONFIG_PACKAGE_iptables-mod-conntrack-extra=y +CONFIG_PACKAGE_iptables-mod-iface=y +CONFIG_PACKAGE_iptables-mod-ipmark=y +CONFIG_PACKAGE_iptables-mod-ipopt=y +CONFIG_PACKAGE_iptables-mod-physdev=y +CONFIG_PACKAGE_iptables-mod-proto=y +CONFIG_PACKAGE_iptables-mod-rpfilter=y +CONFIG_PACKAGE_jq=y +CONFIG_PACKAGE_kmod-backlight=y +CONFIG_PACKAGE_kmod-backlight-pwm=y +CONFIG_PACKAGE_kmod-br-netfilter=y +CONFIG_PACKAGE_kmod-crypto-acompress=y +CONFIG_PACKAGE_kmod-crypto-aead=y +CONFIG_PACKAGE_kmod-crypto-arc4=y +CONFIG_PACKAGE_kmod-crypto-authenc=y +CONFIG_PACKAGE_kmod-crypto-cbc=y +CONFIG_PACKAGE_kmod-crypto-ccm=y +CONFIG_PACKAGE_kmod-crypto-cmac=y +CONFIG_PACKAGE_kmod-crypto-crc32=y +CONFIG_PACKAGE_kmod-crypto-ctr=y +CONFIG_PACKAGE_kmod-crypto-deflate=y +CONFIG_PACKAGE_kmod-crypto-des=y +CONFIG_PACKAGE_kmod-crypto-ecb=y +CONFIG_PACKAGE_kmod-crypto-echainiv=y +CONFIG_PACKAGE_kmod-crypto-gcm=y +CONFIG_PACKAGE_kmod-crypto-gf128=y +CONFIG_PACKAGE_kmod-crypto-ghash=y +CONFIG_PACKAGE_kmod-crypto-hmac=y +CONFIG_PACKAGE_kmod-crypto-kpp=y +CONFIG_PACKAGE_kmod-crypto-lib-blake2s=y +CONFIG_PACKAGE_kmod-crypto-lib-chacha20=y +CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=y +CONFIG_PACKAGE_kmod-crypto-lib-curve25519=y +CONFIG_PACKAGE_kmod-crypto-lib-poly1305=y +CONFIG_PACKAGE_kmod-crypto-manager=y +CONFIG_PACKAGE_kmod-crypto-md4=y +CONFIG_PACKAGE_kmod-crypto-md5=y +CONFIG_PACKAGE_kmod-crypto-null=y +CONFIG_PACKAGE_kmod-crypto-rng=y +CONFIG_PACKAGE_kmod-crypto-seqiv=y +CONFIG_PACKAGE_kmod-crypto-sha1=y +CONFIG_PACKAGE_kmod-crypto-sha256=y +CONFIG_PACKAGE_kmod-crypto-sha512=y +CONFIG_PACKAGE_kmod-crypto-user=y +CONFIG_PACKAGE_kmod-cryptodev=y +CONFIG_PACKAGE_kmod-dax=y +CONFIG_PACKAGE_kmod-dm=y +CONFIG_PACKAGE_kmod-dma-buf=y +CONFIG_PACKAGE_kmod-drm=y +CONFIG_PACKAGE_kmod-drm-kms-helper=y +CONFIG_PACKAGE_kmod-drm-rockchip=y +CONFIG_PACKAGE_kmod-dummy=y +CONFIG_PACKAGE_kmod-fb=y +CONFIG_PACKAGE_kmod-fb-cfb-copyarea=y +CONFIG_PACKAGE_kmod-fb-cfb-fillrect=y +CONFIG_PACKAGE_kmod-fb-cfb-imgblt=y +CONFIG_PACKAGE_kmod-fb-sys-fops=y +CONFIG_PACKAGE_kmod-fb-sys-ram=y +CONFIG_PACKAGE_kmod-fs-ext4=y +CONFIG_PACKAGE_kmod-fs-f2fs=y +CONFIG_PACKAGE_kmod-fs-squashfs=y +CONFIG_PACKAGE_kmod-fs-vfat=y +CONFIG_PACKAGE_kmod-hwmon-core=y +CONFIG_PACKAGE_kmod-i2c-core=y +CONFIG_PACKAGE_kmod-ifb=y +CONFIG_PACKAGE_kmod-ikconfig=y +CONFIG_PACKAGE_kmod-input-core=y +CONFIG_PACKAGE_kmod-ip6-tunnel=y +CONFIG_PACKAGE_kmod-ip6tables=y +CONFIG_PACKAGE_kmod-ip6tables-extra=y +CONFIG_PACKAGE_kmod-ipsec=y +CONFIG_PACKAGE_kmod-ipt-compat-xtables=y +CONFIG_PACKAGE_kmod-ipt-conntrack=y +CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y +CONFIG_PACKAGE_kmod-ipt-core=y +CONFIG_PACKAGE_kmod-ipt-iface=y +CONFIG_PACKAGE_kmod-ipt-ipmark=y +CONFIG_PACKAGE_kmod-ipt-ipopt=y +CONFIG_PACKAGE_kmod-ipt-ipset=y +CONFIG_PACKAGE_kmod-ipt-nat=y +CONFIG_PACKAGE_kmod-ipt-nat-extra=y +CONFIG_PACKAGE_kmod-ipt-nat6=y +CONFIG_PACKAGE_kmod-ipt-physdev=y +CONFIG_PACKAGE_kmod-ipt-proto=y +CONFIG_PACKAGE_kmod-ipt-raw=y +CONFIG_PACKAGE_kmod-ipt-raw6=y +CONFIG_PACKAGE_kmod-ipt-rpfilter=y +CONFIG_PACKAGE_kmod-iptunnel=y +CONFIG_PACKAGE_kmod-iptunnel6=y +CONFIG_PACKAGE_kmod-keys-encrypted=y +CONFIG_PACKAGE_kmod-keys-trusted=y +# CONFIG_PACKAGE_kmod-lib-crc-ccitt is not set +CONFIG_PACKAGE_kmod-lib-crc16=y +CONFIG_PACKAGE_kmod-lib-zlib-deflate=y +CONFIG_PACKAGE_kmod-lib-zlib-inflate=y +CONFIG_PACKAGE_kmod-lib-zstd=y +CONFIG_PACKAGE_kmod-libphy=y +CONFIG_PACKAGE_kmod-mii=y +CONFIG_PACKAGE_kmod-multimedia-input=y +CONFIG_PACKAGE_kmod-nf-conntrack-netlink=y +CONFIG_PACKAGE_kmod-nf-ipt=y +CONFIG_PACKAGE_kmod-nf-ipt6=y +CONFIG_PACKAGE_kmod-nf-ipvs=y +CONFIG_PACKAGE_kmod-nf-nathelper=y +CONFIG_PACKAGE_kmod-nf-tproxy=y +CONFIG_PACKAGE_kmod-nfnetlink-log=y +CONFIG_PACKAGE_kmod-nfnetlink-queue=y +CONFIG_PACKAGE_kmod-nft-bridge=y +CONFIG_PACKAGE_kmod-nft-compat=y +CONFIG_PACKAGE_kmod-nft-queue=y +CONFIG_PACKAGE_kmod-nls-base=y +CONFIG_PACKAGE_kmod-nls-cp437=y +CONFIG_PACKAGE_kmod-nls-iso8859-1=y +CONFIG_PACKAGE_kmod-nls-utf8=y +CONFIG_PACKAGE_kmod-phy-realtek=y +# CONFIG_PACKAGE_kmod-ppp is not set +CONFIG_PACKAGE_kmod-random-core=y +CONFIG_PACKAGE_kmod-sched-cake=y +CONFIG_PACKAGE_kmod-sched-connmark=y +CONFIG_PACKAGE_kmod-sched-core=y +CONFIG_PACKAGE_kmod-sound-core=y +CONFIG_PACKAGE_kmod-sound-usb-caiaq=y +CONFIG_PACKAGE_kmod-tpm=y +CONFIG_PACKAGE_kmod-tun=y +CONFIG_PACKAGE_kmod-udptunnel4=y +CONFIG_PACKAGE_kmod-udptunnel6=y +CONFIG_PACKAGE_kmod-usb-audio=y +CONFIG_PACKAGE_kmod-usb-core=y +CONFIG_PACKAGE_kmod-usb-dwc2=y +CONFIG_PACKAGE_kmod-usb-dwc3=y +CONFIG_PACKAGE_kmod-usb-ehci=y +CONFIG_PACKAGE_kmod-usb-gadget=y +CONFIG_PACKAGE_kmod-usb-net=y +CONFIG_PACKAGE_kmod-usb-net-cdc-ether=y +CONFIG_PACKAGE_kmod-usb-net-cdc-ncm=y +CONFIG_PACKAGE_kmod-usb-net-rtl8152=y +CONFIG_PACKAGE_kmod-usb-roles=y +CONFIG_PACKAGE_kmod-usb-xhci-hcd=y +CONFIG_PACKAGE_kmod-usb2=y +CONFIG_PACKAGE_kmod-usb3=y +CONFIG_PACKAGE_kmod-veth=y +CONFIG_PACKAGE_kmod-vxlan=y +CONFIG_PACKAGE_kmod-wireguard=y +CONFIG_PACKAGE_libatomic=y +CONFIG_PACKAGE_libattr=y +CONFIG_PACKAGE_libavahi-client=y +CONFIG_PACKAGE_libavahi-dbus-support=y +CONFIG_PACKAGE_libbpf=y +CONFIG_PACKAGE_libconfig=y +CONFIG_PACKAGE_libcurl=y +CONFIG_PACKAGE_libdaemon=y +CONFIG_PACKAGE_libdbus=y +CONFIG_PACKAGE_libelf=y +CONFIG_PACKAGE_libexpat=y +CONFIG_PACKAGE_libgmp=y +CONFIG_PACKAGE_libi2c=y +CONFIG_PACKAGE_libip4tc=y +CONFIG_PACKAGE_libip6tc=y +CONFIG_PACKAGE_libipset=y +CONFIG_PACKAGE_libiptext=y +CONFIG_PACKAGE_libiptext-nft=y +CONFIG_PACKAGE_libiptext6=y +CONFIG_PACKAGE_libiwinfo=y +CONFIG_PACKAGE_libiwinfo-data=y +CONFIG_PACKAGE_libiwinfo-lua=y +CONFIG_PACKAGE_libltdl=y +CONFIG_PACKAGE_liblua=y +CONFIG_PACKAGE_liblua5.3=y +CONFIG_PACKAGE_liblucihttp=y +CONFIG_PACKAGE_liblucihttp-lua=y +CONFIG_PACKAGE_liblzo=y +CONFIG_PACKAGE_libmount=y +CONFIG_PACKAGE_libnetfilter-conntrack=y +CONFIG_PACKAGE_libnetfilter-cthelper=y +CONFIG_PACKAGE_libnetfilter-cttimeout=y +CONFIG_PACKAGE_libnetfilter-queue=y +CONFIG_PACKAGE_libnetsnmp=y +CONFIG_PACKAGE_libnettle=y +CONFIG_PACKAGE_libnfnetlink=y +CONFIG_PACKAGE_libnghttp2=y +CONFIG_PACKAGE_libnl-core=y +CONFIG_PACKAGE_libnl-route=y +CONFIG_PACKAGE_libopenssl=y +CONFIG_PACKAGE_libopenssl-conf=y +CONFIG_PACKAGE_libopenssl-devcrypto=y +CONFIG_PACKAGE_libpcap=y +CONFIG_PACKAGE_libpci=y +CONFIG_PACKAGE_libpcre=y +CONFIG_PACKAGE_libpopt=y +CONFIG_PACKAGE_libreadline=y +CONFIG_PACKAGE_librrd1=y +CONFIG_PACKAGE_libseccomp=y +CONFIG_PACKAGE_libsensors=y +CONFIG_PACKAGE_libsoxr=y +CONFIG_PACKAGE_libstdcpp=y +CONFIG_PACKAGE_libsysfs=y +CONFIG_PACKAGE_libubus-lua=y +CONFIG_PACKAGE_libuv=y +CONFIG_PACKAGE_libxtables=y +CONFIG_PACKAGE_losetup=y +CONFIG_PACKAGE_lua=y +CONFIG_PACKAGE_mount-utils=y +CONFIG_PACKAGE_mt7601u-firmware=y +CONFIG_PACKAGE_nano=y +CONFIG_PACKAGE_netcat=y +CONFIG_PACKAGE_netperf=y +CONFIG_PACKAGE_nlbwmon=y +CONFIG_PACKAGE_nstat=y +CONFIG_PACKAGE_ntpclient=y +CONFIG_PACKAGE_openssl-util=y +CONFIG_PACKAGE_openvpn-openssl=y +CONFIG_PACKAGE_pbr-ipt=y +CONFIG_PACKAGE_picocom=y +# CONFIG_PACKAGE_ppp is not set +CONFIG_PACKAGE_qos-scripts=y +CONFIG_PACKAGE_r8152-firmware=y +CONFIG_PACKAGE_r8169-firmware=y +CONFIG_PACKAGE_resolveip=y +CONFIG_PACKAGE_rng-tools=y +CONFIG_PACKAGE_rpcd=y +CONFIG_PACKAGE_rpcd-mod-file=y +CONFIG_PACKAGE_rpcd-mod-iwinfo=y +CONFIG_PACKAGE_rpcd-mod-luci=y +CONFIG_PACKAGE_rpcd-mod-rrdns=y +CONFIG_PACKAGE_rrdtool1=y +CONFIG_PACKAGE_shairport-sync-openssl=y +CONFIG_PACKAGE_socat=y +CONFIG_PACKAGE_speedtest-netperf=y +CONFIG_PACKAGE_sqm-scripts=y +CONFIG_PACKAGE_sqm-scripts-extra=y +CONFIG_PACKAGE_sysfsutils=y +CONFIG_PACKAGE_tc-mod-iptables=y +CONFIG_PACKAGE_tc-tiny=y +CONFIG_PACKAGE_tcpdump=y +CONFIG_PACKAGE_tinyproxy=y +CONFIG_PACKAGE_uhttpd=y +CONFIG_PACKAGE_uhttpd-mod-ubus=y +CONFIG_PACKAGE_urngd=y +CONFIG_PACKAGE_wget-ssl=y +CONFIG_PACKAGE_wireguard-tools=y +CONFIG_PACKAGE_wireless-regdb=y +CONFIG_PACKAGE_xtables-legacy=y +CONFIG_PACKAGE_xtables-nft=y +CONFIG_PACKAGE_zlib=y +CONFIG_PACKAGE_zoneinfo-core=y +CONFIG_PACKAGE_zoneinfo-europe=y +CONFIG_SOCAT_SSL=y +# CONFIG_TARGET_IMAGES_GZIP is not set +CONFIG_TARGET_KERNEL_PARTSIZE=20 +CONFIG_TARGET_OPTIMIZATION="-O3 -pipe -mcpu=cortex-a72.cortex-a53+crypto+crc" +CONFIG_TARGET_OPTIONS=y +CONFIG_TARGET_ROOTFS_PARTSIZE=1024 diff --git a/openwrt-23.05/steps/01_clone_openwrt.sh b/openwrt-23.05/steps/01_clone_openwrt.sh new file mode 100755 index 0000000..6df788c --- /dev/null +++ b/openwrt-23.05/steps/01_clone_openwrt.sh @@ -0,0 +1,20 @@ +#!/bin/bash +ROOTDIR=$(pwd) +echo $ROOTDIR +if [ ! -e "$ROOTDIR/LICENSE" ]; then + echo "Please run from root" + exit 1 +fi + +cd $ROOTDIR +mkdir build +cd build + +OPENWRT_FOLDER=openwrt-fresh-23.05 + +git clone -b openwrt-23.05 --single-branch https://git.openwrt.org/openwrt/openwrt.git $OPENWRT_FOLDER +#git clone --single-branch https://git.openwrt.org/openwrt/openwrt.git $OPENWRT_FOLDER + +cd $OPENWRT_FOLDER +echo "Current OpenWRT commit" +git log -1 diff --git a/openwrt-21.02/steps/02_prepare_openwrt_folder.sh b/openwrt-23.05/steps/02_prepare_openwrt_folder.sh similarity index 71% rename from openwrt-21.02/steps/02_prepare_openwrt_folder.sh rename to openwrt-23.05/steps/02_prepare_openwrt_folder.sh index 1dbda67..e8f8456 100755 --- a/openwrt-21.02/steps/02_prepare_openwrt_folder.sh +++ b/openwrt-23.05/steps/02_prepare_openwrt_folder.sh @@ -8,11 +8,11 @@ fi cd "$ROOTDIR/build" -cp -R openwrt-fresh-2102 openwrt +cp -R openwrt-fresh-23.05 openwrt -# freeze revision to 21.02.7 +# freeze revision to 23.05.0-rc2 cd openwrt -git reset --hard 57a6d97ddf8f6541a52e0f8fad8c6f47685a1bc3 +git reset --hard 55ae516f61fa9d38a5080630795070a8e6673088 echo "Current OpenWRT commit" git log -1 diff --git a/openwrt-23.05/steps/03_patch_openwrt.sh b/openwrt-23.05/steps/03_patch_openwrt.sh new file mode 100755 index 0000000..3e7919b --- /dev/null +++ b/openwrt-23.05/steps/03_patch_openwrt.sh @@ -0,0 +1,60 @@ +#!/bin/bash +ROOTDIR=$(pwd) +echo $ROOTDIR +if [ ! -e "$ROOTDIR/build" ]; then + echo "Please run from root / no build dir" + exit 1 +fi + +BUILDDIR="$ROOTDIR/build" + +cd "$BUILDDIR/openwrt" +OPENWRT_BRANCH=23.05 + +# -------------- UBOOT ----------------------------------- +# replace uboot with local uboot package +# this version does not need arm-trusted-firmware-rk3328 +rm -rf package/boot/uboot-rockchip +cp -R $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/package/uboot-rockchip package/boot/ + +# -------------- target linux/rockchip ---------------- +# replace target rockchip with original one +rm -rf target/linux/rockchip +cp -R $BUILDDIR/openwrt-fresh-$OPENWRT_BRANCH/target/linux/rockchip target/linux/ + +# override manually some files in the rockchip target using rsync to merge folders and override same filenames +rsync -avz $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/target/ target + +# ------------------ packages ------------------------------------ + +# r8168 driver for r4s +cp -R $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/package/r8168 package/kernel/ + +# enable armv8 crypto for mbedtls +cp $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/package/mbedtls/patches/100-Implements-AES-and-GCM-with-ARMv8-Crypto-Extensions.patch \ + package/libs/mbedtls/patches/ + +# enable motorcomm for R2C +echo "CONFIG_MOTORCOMM_PHY=y" >> target/linux/rockchip/armv8/config-5.15 + +# add caiaq usb sound module for shairport with old soundcard +ADDON_PATH='snd-usb-caiaq.makefileaddon' +ADDON_DEST='package/kernel/linux/modules/usb.mk' +if ! grep -q " --- $ADDON_PATH" $ADDON_DEST; then + echo "Adding $ADDON_PATH to $ADDON_DEST" + echo "# --- $ADDON_PATH" >> $ADDON_DEST + cat $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/$ADDON_PATH >> $ADDON_DEST +else + echo "Already added $ADDON_PATH to $ADDON_DEST" +fi + +# revert to fresh config +cp $BUILDDIR/openwrt-fresh-$OPENWRT_BRANCH/target/linux/generic/config-5.15 target/linux/generic/config-5.15 + +#cleanup +if [ -e .config ]; then + echo "Cleaning up ..." + make target/linux/clean + make package/boot/uboot-rockchip/clean + make package/kernel/r8168/clean +fi \ No newline at end of file diff --git a/openwrt-21.02/steps/04-prepare_package.sh b/openwrt-23.05/steps/04-prepare_package.sh similarity index 57% rename from openwrt-21.02/steps/04-prepare_package.sh rename to openwrt-23.05/steps/04-prepare_package.sh index e749ccb..402d4be 100755 --- a/openwrt-21.02/steps/04-prepare_package.sh +++ b/openwrt-23.05/steps/04-prepare_package.sh @@ -6,29 +6,27 @@ if [ ! -e "$ROOTDIR/build" ]; then exit 1 fi -OPENWRT_BRANCH=21.02 +OPENWRT_BRANCH=23.05 cd "$ROOTDIR/build" # clone stangri repo -# rm -rf stangri_repo -# git clone https://github.com/stangri/source.openwrt.melmac.net stangri_repo +rm -rf stangri_repo +git clone https://github.com/stangri/source.openwrt.melmac.net stangri_repo # install feeds cd openwrt ./scripts/feeds update -a -# replace vpn routing packages -rm -rf feeds/packages/net/vpn-policy-routing/ -cp -R $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/package/vpn-policy-routing feeds/packages/net/ -rm -rf feeds/luci/applications/luci-app-vpn-policy-routing -cp -R $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/package/luci-app-vpn-policy-routing feeds/luci/applications/ +# replace pbr packages +rm -rf feeds/packages/net/pbr/ +cp -R ../stangri_repo/pbr feeds/packages/net/ +rm -rf feeds/luci/applications/luci-app-pbr +cp -R ../stangri_repo/luci-app-pbr feeds/luci/applications/ - - - -# copy patch for nodejs not building -cp $ROOTDIR/openwrt-21.02/patches/node/010-execvp-arg-list-too-long.patch feeds/packages/lang/node/patches/ +# replace adguardhome with prebuilt latest version +rm -rf feeds/packages/net/adguardhome +cp -R $ROOTDIR/openwrt-$OPENWRT_BRANCH/patches/package/adguardhome feeds/packages/net/ ./scripts/feeds update -i && ./scripts/feeds install -a @@ -41,6 +39,6 @@ echo -e '\nAO Build@'${BUILD_STRING}'\n' >> package/base-files/files/etc/banner #echo "DISTRIB_REVISION='${BUILD_STRING}'" >> package/base-files/files/etc/openwrt_release sed -i '/DISTRIB_DESCRIPTION/d' package/base-files/files/etc/openwrt_release echo "DISTRIB_DESCRIPTION='AO Build@${BUILD_STRING}'" >> package/base-files/files/etc/openwrt_release -sed -i '/luciversion/d' feeds/luci/modules/luci-base/luasrc/version.lua +#sed -i '/luciversion/d' feeds/luci/modules/luci-base/luasrc/version.lua rm -rf .config diff --git a/openwrt-21.02/steps/05-create_luci_acl.sh b/openwrt-23.05/steps/05-create_luci_acl.sh similarity index 74% rename from openwrt-21.02/steps/05-create_luci_acl.sh rename to openwrt-23.05/steps/05-create_luci_acl.sh index 66c6011..6431fc0 100755 --- a/openwrt-21.02/steps/05-create_luci_acl.sh +++ b/openwrt-23.05/steps/05-create_luci_acl.sh @@ -11,4 +11,4 @@ cd "$ROOTDIR/build" # install feeds cd openwrt -/bin/bash $ROOTDIR/openwrt-21.02/steps/create_acl_for_luci.sh -a \ No newline at end of file +/bin/bash $ROOTDIR/openwrt-23.05/steps/create_acl_for_luci.sh -a \ No newline at end of file diff --git a/openwrt-21.02/steps/06-create_config_from_seed.sh b/openwrt-23.05/steps/06-create_config_from_seed.sh similarity index 92% rename from openwrt-21.02/steps/06-create_config_from_seed.sh rename to openwrt-23.05/steps/06-create_config_from_seed.sh index 14e4bc4..d0bda8a 100755 --- a/openwrt-21.02/steps/06-create_config_from_seed.sh +++ b/openwrt-23.05/steps/06-create_config_from_seed.sh @@ -10,7 +10,7 @@ cd "$ROOTDIR/build" cd openwrt # copy R4S in any case, and then patch if R2S -cp $ROOTDIR/openwrt-21.02/seed/ao-R4S-$2.seed .config +cp $ROOTDIR/openwrt-23.05/seed/ao-R4S-$2.seed .config # $1 is model # if model == R2S, then patch .config diff --git a/openwrt-23.05/steps/07-all_kmods.sh b/openwrt-23.05/steps/07-all_kmods.sh new file mode 100755 index 0000000..288435b --- /dev/null +++ b/openwrt-23.05/steps/07-all_kmods.sh @@ -0,0 +1,44 @@ +#!/bin/bash +ROOTDIR=$(pwd) +echo $ROOTDIR +if [ ! -e "$ROOTDIR/build" ]; then + echo "Please run from root / no build dir" + exit 1 +fi + +cd "$ROOTDIR/build" + +cd openwrt + +# patch config to build all kernel modules +sed -i -e '/^# CONFIG_PACKAGE_kmod-/d' .config +echo CONFIG_ALL_KMODS=y >> .config +make defconfig + +rm -rf bin/ +rm -rf files/ipks/ +let make_process=$(nproc)+1 + +# compile toolchain if not built yet +make toolchain/install -j${make_process} || { make toolchain/install -j 1 V=s ; exit 1 ; } + +# compile kernel kmods and build packages +make target/compile -j ${make_process} || { make target/compile -j 1 V=s ; exit 1 ; } +make package/linux/compile -j ${make_process} || { make package/linux/compile -j 1 V=s ; exit 1 ; } + +# build signing tools and generate key +make package/usign/host/compile V=s || exit 1 +make package/ucert/host/compile V=s || exit 1 +make package/base-files/configure V=s || exit 1 + +# sign packages +make package/index V=s || exit 1 +mkdir -p files/ipks +cd files/ipks +find ../../bin/targets/rockchip/armv8/packages/ -type f -exec ln {} . \; +cd .. +mkdir -p etc/uci-defaults +cat << "EOF" > etc/uci-defaults/99-local-ipks +echo "src/gz local file:///ipks/" >> /etc/opkg/distfeeds.conf +EOF + diff --git a/openwrt-21.02/steps/create_acl_for_luci.sh b/openwrt-23.05/steps/create_acl_for_luci.sh similarity index 100% rename from openwrt-21.02/steps/create_acl_for_luci.sh rename to openwrt-23.05/steps/create_acl_for_luci.sh diff --git a/openwrt-21.02/steps/organize_files.sh b/openwrt-23.05/steps/organize_files.sh similarity index 99% rename from openwrt-21.02/steps/organize_files.sh rename to openwrt-23.05/steps/organize_files.sh index 7d5ca79..5eeaad1 100755 --- a/openwrt-21.02/steps/organize_files.sh +++ b/openwrt-23.05/steps/organize_files.sh @@ -22,3 +22,4 @@ mv openwrt-rockchip-armv8-friendlyarm_nanopi-$NANOPI_MODEL_LOW-squashfs-sysupgra gzip -d *.gz && exit 0 gzip --best *.img ls -Ahl + diff --git a/workflow-scripts/free_disk_space.sh b/workflow-scripts/free_disk_space.sh index 44339cd..dd012e7 100755 --- a/workflow-scripts/free_disk_space.sh +++ b/workflow-scripts/free_disk_space.sh @@ -36,7 +36,9 @@ sudo apt-get remove -y '^ghc-8.*' sudo apt-get remove -y '^dotnet-.*' sudo apt-get remove -y '^llvm-.*' sudo apt-get remove -y 'php.*' -sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel +sudo apt-get remove -y 'temurin-.*' +sudo apt-get remove -y 'mono-.*' +sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell microsoft-edge-stable sudo apt-get autoremove -y sudo apt-get clean df -h