From 34ac92f6cc99446dd99f4c2e8b3233ccd6491871 Mon Sep 17 00:00:00 2001 From: lean Date: Sat, 9 Sep 2023 23:36:45 +0800 Subject: [PATCH] ipq40xx: switch to kernel 5.10 --- target/linux/ipq40xx/Makefile | 11 +- .../ipq40xx/base-files/etc/board.d/01_leds | 89 +- .../ipq40xx/base-files/etc/board.d/02_network | 209 ++-- .../base-files/etc/board.d/03_gpio_switches | 11 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 207 ++-- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 21 - .../etc/hotplug.d/net/21_adjust_network | 7 - .../base-files/etc/init.d/adjust_network | 19 - .../ipq40xx/base-files/etc/init.d/bootcount | 20 + .../base-files/etc/init.d/mt7615_reboot | 13 - .../base-files/etc/init.d/zlinksys_recovery | 35 - .../etc/uci-defaults/04_led_migration | 6 + .../etc/uci-defaults/05_fix-compat-version | 10 + .../ipq40xx/base-files/lib/adjust_network.sh | 89 -- .../lib/preinit/05_set_iface_mac_ipq40xx.sh | 20 +- .../preinit/06_set_preinit_iface_ipq40xx.sh | 5 + .../{openmesh.sh => dualboot_datachk.sh} | 12 +- .../ipq40xx/base-files/lib/upgrade/linksys.sh | 119 +- .../ipq40xx/base-files/lib/upgrade/netgear.sh | 76 ++ .../base-files/lib/upgrade/platform.sh | 274 ++--- .../linux/ipq40xx/{config-5.4 => config-5.10} | 98 +- .../drivers/net/mdio}/ar40xx.c | 84 +- .../drivers/net/mdio}/ar40xx.h | 5 + .../arch/arm/boot/dts/qcom-ipq4018-a42.dts | 17 +- .../arm/boot/dts/qcom-ipq4018-ap120c-ac.dts | 31 + .../arch/arm/boot/dts/qcom-ipq4018-cap-ac.dts | 249 ++++ .../dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts | 35 +- .../arm/boot/dts/qcom-ipq4018-dap-2610.dts | 14 - .../arm/boot/dts/qcom-ipq4018-ea6350v3.dts | 30 +- .../arm/boot/dts/qcom-ipq4018-eap1300.dts | 34 +- .../arm/boot/dts/qcom-ipq4018-ecw5211.dts | 337 ++++++ .../arch/arm/boot/dts/qcom-ipq4018-emd1.dts | 9 - .../arm/boot/dts/qcom-ipq4018-emr3500.dts | 18 +- .../arm/boot/dts/qcom-ipq4018-ens620ext.dts | 11 - .../arm/boot/dts/qcom-ipq4018-ex6100v2.dts | 2 - .../arm/boot/dts/qcom-ipq4018-ex6150v2.dts | 2 - .../arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi | 44 +- .../arm/boot/dts/qcom-ipq4018-ex6200v2.dts | 45 - .../boot/dts/qcom-ipq4018-fritzbox-4040.dts | 12 - ...l-a1300.dts => qcom-ipq4018-gl-ap1300.dts} | 87 +- .../arm/boot/dts/qcom-ipq4018-hap-ac2.dts | 272 +++++ .../arm/boot/dts/qcom-ipq4018-jalapeno.dtsi | 31 +- .../dts/qcom-ipq4018-magic-2-wifi-next.dts | 268 +++++ .../arm/boot/dts/qcom-ipq4018-nbg6617.dts | 21 +- .../arch/arm/boot/dts/qcom-ipq4018-pa1200.dts | 197 ++++ .../arm/boot/dts/qcom-ipq4018-rt-ac58u.dts | 15 +- .../arch/arm/boot/dts/qcom-ipq4018-rutx.dtsi | 251 ++++ .../arch/arm/boot/dts/qcom-ipq4018-rutx10.dts | 26 + .../arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts | 241 ++++ .../arch/arm/boot/dts/qcom-ipq4018-wac510.dts | 382 ++++++ .../arm/boot/dts/qcom-ipq4018-wre6606.dts | 1 - .../arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts | 293 +++++ .../arch/arm/boot/dts/qcom-ipq4019-a62.dts | 11 +- .../arch/arm/boot/dts/qcom-ipq4019-c526a.dts | 314 ----- .../arm/boot/dts/qcom-ipq4019-cm520-79f.dts | 99 +- .../arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts | 33 +- .../arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts | 33 +- .../arm/boot/dts/qcom-ipq4019-e2600ac.dtsi | 12 - .../arch/arm/boot/dts/qcom-ipq4019-ea8300.dts | 306 +---- .../arm/boot/dts/qcom-ipq4019-eap2200.dts | 33 +- .../boot/dts/qcom-ipq4019-fritzbox-7530.dts | 3 + .../dts/qcom-ipq4019-fritzrepeater-1200.dts | 3 +- .../dts/qcom-ipq4019-fritzrepeater-3000.dts | 9 +- .../arm/boot/dts/qcom-ipq4019-gl-b2200.dts | 388 ++++++ .../boot/dts/qcom-ipq4019-habanero-dvk.dts | 26 +- .../arm/boot/dts/qcom-ipq4019-hap-ac3.dts | 327 ++++++ .../arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts | 268 +++++ .../arm/boot/dts/qcom-ipq4019-map-ac2200.dts | 123 +- .../arch/arm/boot/dts/qcom-ipq4019-mf286d.dts | 435 +++++++ .../arch/arm/boot/dts/qcom-ipq4019-mf289f.dts | 442 +++++++ .../arch/arm/boot/dts/qcom-ipq4019-mr8300.dts | 80 ++ .../arch/arm/boot/dts/qcom-ipq4019-oap100.dts | 354 ++++++ .../arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi | 325 +++++ ...4019-ca100.dts => qcom-ipq4019-pa2200.dts} | 216 ++-- .../arm/boot/dts/qcom-ipq4019-r619ac-128m.dts | 10 +- .../arm/boot/dts/qcom-ipq4019-r619ac-64m.dts | 12 + .../arch/arm/boot/dts/qcom-ipq4019-r619ac.dts | 8 - .../arm/boot/dts/qcom-ipq4019-r619ac.dtsi | 121 +- .../arch/arm/boot/dts/qcom-ipq4019-rbr50.dts | 30 + .../arch/arm/boot/dts/qcom-ipq4019-rbs50.dts | 30 + ...t-acrh17.dts => qcom-ipq4019-rt-ac42u.dts} | 283 +++-- .../arch/arm/boot/dts/qcom-ipq4019-srr60.dts | 12 + .../arch/arm/boot/dts/qcom-ipq4019-srs60.dts | 12 + .../arm/boot/dts/qcom-ipq4019-u4019-32m.dts | 22 +- .../arch/arm/boot/dts/qcom-ipq4019-u4019.dtsi | 6 +- .../arch/arm/boot/dts/qcom-ipq4019-wpj419.dts | 35 +- .../boot/dts/qcom-ipq4019-wr142ac-nand.dts | 64 - .../arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts | 46 +- ...019-wr142ac.dts => qcom-ipq4019-x1pro.dts} | 64 +- ...9-wr142ac.dtsi => qcom-ipq4019-x1pro.dtsi} | 97 +- .../arm/boot/dts/qcom-ipq4019-xx8300.dtsi | 310 +++++ .../arm/boot/dts/qcom-ipq4019-zte-mf263.dts | 390 ------ .../arch/arm/boot/dts/qcom-ipq4028-wpj428.dts | 40 +- .../arch/arm/boot/dts/qcom-ipq4029-ap-303.dts | 20 +- .../arm/boot/dts/qcom-ipq4029-ap-303h.dts | 27 +- .../arch/arm/boot/dts/qcom-ipq4029-ap-365.dts | 28 +- .../dts/qcom-ipq4029-aruba-glenmorangie.dtsi | 7 +- .../arm/boot/dts/qcom-ipq4029-gl-b1300.dts | 18 +- .../arm/boot/dts/qcom-ipq4029-gl-s1300.dts | 24 +- .../arch/arm/boot/dts/qcom-ipq4029-mr33.dts | 34 +- .../net/ethernet/qualcomm/essedma/edma.c | 59 +- .../net/ethernet/qualcomm/essedma/edma.h | 5 +- .../net/ethernet/qualcomm/essedma/edma_axi.c | 50 +- .../ethernet/qualcomm/essedma/edma_ethtool.c | 4 + target/linux/ipq40xx/generic/target.mk | 3 + target/linux/ipq40xx/image/Makefile | 825 +------------ target/linux/ipq40xx/image/generic.mk | 1042 +++++++++++++++++ target/linux/ipq40xx/image/mikrotik.mk | 64 + target/linux/ipq40xx/mikrotik/config-default | 5 + target/linux/ipq40xx/mikrotik/target.mk | 4 + ...om-ipq4019-add-USB-devicetree-nodes.patch} | 8 +- ...RM-dts-qcom-ipq4019-add-more-labels.patch} | 12 +- ...om-ipq4019-add-SDHCI-VQMMC-LDO-node.patch} | 9 +- .../104-clk-fix-apss-cpu-overclocking.patch | 0 .../300-clk-qcom-ipq4019-add-ess-reset.patch | 0 ...-compressed-add-appended-DTB-section.patch | 48 + ...d-set-ipq40xx-watchdog-to-allow-boot.patch | 66 ++ ...msm-use-sdhci_set_clock-instead-of-s.patch | 15 +- ...-add-support-for-Toshiba-TC58NVG0S3H.patch | 32 + ...702-dts-ipq4019-add-PHY-switch-nodes.patch | 0 ...4019-needs-rfs-vlan_tag-callbacks-in.patch | 4 +- .../705-net-add-qualcomm-ar40xx-phy.patch | 27 + .../706-dt-bindings-net-add-QCA807x-PHY.patch | 0 ...7-net-phy-Add-Qualcom-QCA807x-driver.patch | 10 +- ...8-arm-dts-ipq4019-QCA807x-properties.patch | 0 ...add-qualcomm-essedma-ethernet-driver.patch | 11 - ...ts-ipq4019-add-ethernet-essedma-node.patch | 0 .../850-soc-add-qualcomm-syscon.patch | 8 +- .../900-dts-ipq4019-ap-dk01.1.patch | 0 .../901-arm-boot-add-dts-files.patch | 44 +- .../902-dts-ipq4019-ap-dk04.1.patch | 0 .../999-ipq40xx-unlock-cpu-frequency.patch | 0 ...5.7-ARM-qcom-Add-support-for-IPQ40xx.patch | 42 - ...r-add-IPQ4019-SDHCI-VQMMC-LDO-driver.patch | 153 --- ...om-ipq4019-Add-SDHCI-controller-node.patch | 36 - ...om-Add-nodes-for-SMP-boot-in-IPQ40xx.patch | 71 -- ...RM-dts-qcom-add-gpio-ranges-property.patch | 119 -- ...om-ipq4019-fix-high-resolution-timer.patch | 33 - ...net-phy-mdio-add-IPQ4019-MDIO-driver.patch | 210 ---- ...2-ARM-dts-qcom-ipq4019-add-MDIO-node.patch | 57 - ...add-CRYPTO_ALG_KERN_DRIVER_ONLY-flag.patch | 31 - ....5-crypto-qce-switch-to-skcipher-API.patch | 993 ---------------- ...ce-fix-ctr-aes-qce-block-chunk-sizes.patch | 43 - ...crypto-qce-fix-xts-aes-qce-key-sizes.patch | 60 - ...-save-a-sg-table-slot-for-result-buf.patch | 85 -- ....6-crypto-qce-update-the-skcipher-IV.patch | 31 - ...qce-initialize-fallback-only-for-AES.patch | 54 - ...e-allow-building-only-hashes-ciphers.patch | 419 ------- ...e-use-cryptlen-when-adding-extra-sgl.patch | 89 -- ...-use-AES-fallback-for-small-requests.patch | 113 -- ...-handle-AES-XTS-cases-that-qce-fails.patch | 59 - ...-driver-for-Qualcomm-IPQ40xx-USB-PHY.patch | 197 ---- .../0018-v5.9-pinctrl-msm-open-drain.patch | 81 -- ...d-spi-nor-Add-support-for-mx25r3235f.patch | 29 - .../305-spi-nor-add-en25qh16.patch | 11 - .../705-net-add-qualcomm-ar40xx-phy.patch | 26 - .../900-arm-add-cmdline-override.patch | 37 - ...essedma-disable-default-vlan-tagging.patch | 45 - .../patches-5.4/995-add-qca-rfs-support.patch | 695 ----------- .../996-add-qca-ssdk-support.patch | 109 -- .../patches-5.4/997-device_tree_cmdline.patch | 12 - .../patches-5.4/998-enable-ramoops.patch | 18 - target/linux/ipq40xx/profiles/00-default.mk | 9 - 163 files changed, 8781 insertions(+), 7546 deletions(-) mode change 100755 => 100644 target/linux/ipq40xx/base-files/etc/board.d/01_leds mode change 100755 => 100644 target/linux/ipq40xx/base-files/etc/board.d/02_network mode change 100755 => 100644 target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches delete mode 100644 target/linux/ipq40xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac delete mode 100644 target/linux/ipq40xx/base-files/etc/hotplug.d/net/21_adjust_network delete mode 100755 target/linux/ipq40xx/base-files/etc/init.d/adjust_network create mode 100755 target/linux/ipq40xx/base-files/etc/init.d/bootcount delete mode 100755 target/linux/ipq40xx/base-files/etc/init.d/mt7615_reboot delete mode 100755 target/linux/ipq40xx/base-files/etc/init.d/zlinksys_recovery create mode 100644 target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version delete mode 100644 target/linux/ipq40xx/base-files/lib/adjust_network.sh rename target/linux/ipq40xx/base-files/lib/upgrade/{openmesh.sh => dualboot_datachk.sh} (91%) mode change 100755 => 100644 target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh create mode 100644 target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh rename target/linux/ipq40xx/{config-5.4 => config-5.10} (86%) rename target/linux/ipq40xx/{files/drivers/net/phy => files-5.10/drivers/net/mdio}/ar40xx.c (96%) rename target/linux/ipq40xx/{files/drivers/net/phy => files-5.10/drivers/net/mdio}/ar40xx.h (98%) create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cap-ac.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts delete mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6200v2.dts rename target/linux/ipq40xx/files/arch/arm/boot/dts/{qcom-ipq4018-gl-a1300.dts => qcom-ipq4018-gl-ap1300.dts} (78%) create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-magic-2-wifi-next.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx.dtsi create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx10.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts delete mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-hap-ac3.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mr8300.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi rename target/linux/ipq40xx/files/arch/arm/boot/dts/{qcom-ipq4019-ca100.dts => qcom-ipq4019-pa2200.dts} (53%) create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-64m.dts delete mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts rename target/linux/ipq40xx/files/arch/arm/boot/dts/{qcom-ipq4019-rt-acrh17.dts => qcom-ipq4019-rt-ac42u.dts} (53%) create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts delete mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac-nand.dts rename target/linux/ipq40xx/files/arch/arm/boot/dts/{qcom-ipq4019-wr142ac.dts => qcom-ipq4019-x1pro.dts} (53%) rename target/linux/ipq40xx/files/arch/arm/boot/dts/{qcom-ipq4019-wr142ac.dtsi => qcom-ipq4019-x1pro.dtsi} (70%) create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi delete mode 100755 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-zte-mf263.dts create mode 100644 target/linux/ipq40xx/generic/target.mk create mode 100644 target/linux/ipq40xx/image/generic.mk create mode 100644 target/linux/ipq40xx/image/mikrotik.mk create mode 100644 target/linux/ipq40xx/mikrotik/config-default create mode 100644 target/linux/ipq40xx/mikrotik/target.mk rename target/linux/ipq40xx/{patches-5.4/102-ARM-dts-qcom-ipq4019-add-USB-devicetree-nodes.patch => patches-5.10/0001-v5.12-ARM-dts-qcom-ipq4019-add-USB-devicetree-nodes.patch} (91%) rename target/linux/ipq40xx/{patches-5.4/103-arm-dts-qcom-ipq4019-add-more-labels.patch => patches-5.10/0002-v5.12-ARM-dts-qcom-ipq4019-add-more-labels.patch} (74%) rename target/linux/ipq40xx/{patches-5.4/101-arm-dts-IPQ4019-add-SDHCI-VQMMC-LDO-node.patch => patches-5.10/0003-v5.12-ARM-dts-qcom-ipq4019-add-SDHCI-VQMMC-LDO-node.patch} (71%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/104-clk-fix-apss-cpu-overclocking.patch (100%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/300-clk-qcom-ipq4019-add-ess-reset.patch (100%) create mode 100644 target/linux/ipq40xx/patches-5.10/301-arm-compressed-add-appended-DTB-section.patch create mode 100644 target/linux/ipq40xx/patches-5.10/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch (57%) create mode 100644 target/linux/ipq40xx/patches-5.10/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/702-dts-ipq4019-add-PHY-switch-nodes.patch (100%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch (95%) create mode 100644 target/linux/ipq40xx/patches-5.10/705-net-add-qualcomm-ar40xx-phy.patch rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/706-dt-bindings-net-add-QCA807x-PHY.patch (100%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/707-net-phy-Add-Qualcom-QCA807x-driver.patch (88%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/708-arm-dts-ipq4019-QCA807x-properties.patch (100%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/710-net-add-qualcomm-essedma-ethernet-driver.patch (77%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/711-dts-ipq4019-add-ethernet-essedma-node.patch (100%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/850-soc-add-qualcomm-syscon.patch (96%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/900-dts-ipq4019-ap-dk01.1.patch (100%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/901-arm-boot-add-dts-files.patch (70%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/902-dts-ipq4019-ap-dk04.1.patch (100%) rename target/linux/ipq40xx/{patches-5.4 => patches-5.10}/999-ipq40xx-unlock-cpu-frequency.patch (100%) delete mode 100644 target/linux/ipq40xx/patches-5.4/0001-v5.7-ARM-qcom-Add-support-for-IPQ40xx.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0002-01-v5.6-regulator-add-IPQ4019-SDHCI-VQMMC-LDO-driver.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0002-02-v5.5-ARM-dts-qcom-ipq4019-Add-SDHCI-controller-node.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0003-v5.6-ARM-dts-qcom-Add-nodes-for-SMP-boot-in-IPQ40xx.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0003-v5.7-ARM-dts-qcom-add-gpio-ranges-property.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0004-v5.8-ARM-dts-qcom-ipq4019-fix-high-resolution-timer.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0005-02-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0006-v5.5-crypto-qce-add-CRYPTO_ALG_KERN_DRIVER_ONLY-flag.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0007-v5.5-crypto-qce-switch-to-skcipher-API.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0008-v5.6-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0009-v5.6-crypto-qce-fix-xts-aes-qce-key-sizes.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0010-v5.6-crypto-qce-save-a-sg-table-slot-for-result-buf.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0011-v5.6-crypto-qce-update-the-skcipher-IV.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0012-v5.6-crypto-qce-initialize-fallback-only-for-AES.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0013-v5.6-crypto-qce-allow-building-only-hashes-ciphers.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0014-v5.7-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0015-v5.7-crypto-qce-use-AES-fallback-for-small-requests.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0016-v5.7-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0017-v5.8-phy-add-driver-for-Qualcomm-IPQ40xx-USB-PHY.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0018-v5.9-pinctrl-msm-open-drain.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/0019-v5.6-mtd-spi-nor-Add-support-for-mx25r3235f.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/305-spi-nor-add-en25qh16.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/900-arm-add-cmdline-override.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/901-essedma-disable-default-vlan-tagging.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/995-add-qca-rfs-support.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/996-add-qca-ssdk-support.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/997-device_tree_cmdline.patch delete mode 100644 target/linux/ipq40xx/patches-5.4/998-enable-ramoops.patch delete mode 100644 target/linux/ipq40xx/profiles/00-default.mk diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index 8f1027146..b704e1b54 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -6,9 +6,10 @@ BOARDNAME:=Qualcomm Atheros IPQ40XX FEATURES:=squashfs fpu ramdisk nand CPU_TYPE:=cortex-a7 CPU_SUBTYPE:=neon-vfpv4 -MAINTAINER:=John Crispin +SUBTARGETS:=generic mikrotik -KERNEL_PATCHVER:=5.4 +KERNEL_PATCHVER:=5.10 +KERNEL_TESTING_PATCHVER:=5.10 KERNELNAME:=zImage Image dtbs @@ -16,10 +17,8 @@ include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += \ kmod-usb-dwc3-qcom \ kmod-leds-gpio kmod-gpio-button-hotplug swconfig \ - kmod-ath10k-ct wpad-openssl uboot-envtools \ + kmod-ath10k-ct wpad-basic-wolfssl \ kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \ - autocore-arm automount autosamba ethtool htop \ - luci-app-adbyby-plus luci-app-cpufreq luci-app-ipsec-vpnd \ - luci-app-unblockmusic luci-app-zerotier + uboot-envtools $(eval $(call BuildTarget)) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/01_leds b/target/linux/ipq40xx/base-files/etc/board.d/01_leds old mode 100755 new mode 100644 index 1b1f01767..0e473534f --- a/target/linux/ipq40xx/base-files/etc/board.d/01_leds +++ b/target/linux/ipq40xx/base-files/etc/board.d/01_leds @@ -1,4 +1,3 @@ -#!/bin/sh # # Copyright (C) 2015 OpenWrt.org # @@ -11,79 +10,91 @@ board=$(board_name) case "$board" in alfa-network,ap120c-ac) - ucidef_set_led_switch "wan" "WAN" "amber:wan" "switch0" "0x20" + ucidef_set_led_netdev "wan" "WAN" "amber:wan" "eth1" + ;; +asus,rt-ac42u) + ucidef_set_led_switch "lan1" "LAN1" "blue:lan-1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "blue:lan-2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "blue:lan-3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "blue:lan-4" "switch0" "0x10" ;; asus,rt-ac58u) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2G" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wlan5G" "phy1tpt" - ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x20" + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x1e" ;; -asus,rt-acrh17) - ucidef_set_led_default "status" "STATUS" "blue:status" "1" - ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy1tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wlan5g" "phy0tpt" - ucidef_set_led_switch "wan" "WAN(blue)" "blue:wan" "switch0" "0x20" - ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x02" - ucidef_set_led_switch "lan2" "LAN2" "blue:lan2" "switch0" "0x04" - ucidef_set_led_switch "lan3" "LAN3" "blue:lan3" "switch0" "0x08" - ucidef_set_led_switch "lan4" "LAN4" "blue:lan4" "switch0" "0x10" - ;; avm,fritzbox-4040) ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" "phy1tpt" - ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x20" + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x1e" ;; avm,fritzbox-7530 |\ -glinet,gl-b1300) +glinet,gl-b1300 |\ +mikrotik,lhgg-60ad) ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" ;; -century,wr142ac |\ -century,wr142ac-nand) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy1tpt" +edgecore,oap100) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wlan5g" "phy1tpt" ;; engenius,eap1300) - ucidef_set_led_switch "wan" "WAN" "amber:wan" "switch0" "0x20" + ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "yellow:wlan5g" "phy1tpt" ucidef_set_led_default "mesh" "MESH" "blue:mesh" "0" ;; engenius,eap2200) - ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x10" - ucidef_set_led_switch "lan2" "LAN2" "blue:lan2" "switch0" "0x20" + ucidef_set_led_netdev "lan1" "LAN1" "blue:lan1" "eth0" + ucidef_set_led_netdev "lan2" "LAN2" "blue:lan2" "eth1" ;; engenius,ens620ext) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2G" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5G" "phy1tpt" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy1tpt" + ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth0" + ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth1" + ;; +glinet,gl-ap1300) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" + ;; +mikrotik,cap-ac) + ucidef_set_led_default "power" "POWER" "blue:power" "1" + ucidef_set_led_default "user" "USER" "green:user" "0" + ucidef_set_led_switch "eth1" "ETH1" "green:eth1" "switch0" "0x20" + ucidef_set_led_switch "eth2" "ETH2" "green:eth2" "switch0" "0x10" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy1tpt" + ;; +mikrotik,hap-ac3) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x10" - ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x20" + ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x04" + ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x02" + ucidef_set_led_gpio "poe" "POE" "red:poe" "452" "0" + ;; +mikrotik,sxtsq-5-ac) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumlow" "rssimediumlow" "green:rssimediumlow" "wlan0" "21" "100" + ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "41" "100" + ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "61" "100" + ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "81" "100" ;; mobipromo,cm520-79f) - ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x20" + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x10" ucidef_set_led_switch "lan2" "LAN2" "blue:lan2" "switch0" "0x08" ;; netgear,ex6100v2 |\ -netgear,ex6150v2 |\ -netgear,ex6200v2) +netgear,ex6150v2) ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:router" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:client" "phy1tpt" ;; -p2w,r619ac |\ -p2w,r619ac-128m) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wlan5g" "phy1tpt" - ;; qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2) ucidef_set_led_wlan "wlan2g" "WLAN0" "green:wlan0" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN1" "green:wlan1" "phy1tpt" ;; -zyxel,nbg6617) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2G" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5G" "phy1tpt" - ;; +zyxel,nbg6617 |\ zyxel,wre6606) ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy1tpt" diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network old mode 100755 new mode 100644 index 6b7069c3d..a38d35a10 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -1,4 +1,3 @@ -#!/bin/sh # # Copyright (c) 2015 The Linux Foundation. All rights reserved. # Copyright (c) 2011-2015 OpenWrt.org @@ -16,94 +15,145 @@ ipq40xx_setup_interfaces() 8dev,jalapeno|\ alfa-network,ap120c-ac|\ engenius,emr3500|\ - engenius,ens620ext) - ucidef_add_switch "switch0" \ - "0t@eth0" "4:lan" "5:wan" - ;; - asus,map-ac2200|\ - cilab,meshpoint-one|\ - openmesh,a42|\ - openmesh,a62) - ucidef_add_switch "switch0" \ - "0t@eth0" "5:lan" "4:wan" - ;; - aruba,ap-303h|\ - asus,rt-acrh17|\ - asus,rt-ac58u|\ - avm,fritzbox-4040|\ - century,wr142ac|\ - century,wr142ac-nand|\ - ezviz,cs-w3-wd1200g-eup|\ - linksys,ea6350v3|\ - linksys,ea8300|\ - unielec,u4019-32m) - ucidef_add_switch "switch0" \ - "0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" - ;; - avm,fritzrepeater-3000|\ - compex,wpj419|\ - compex,wpj428|\ - engenius,eap1300|\ - engenius,eap2200) - ucidef_add_switch "switch0" \ - "0t@eth0" "4:lan" "5:lan" - ;; - avm,fritzbox-7530) - ucidef_add_switch "switch0" \ - "0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" + engenius,ens620ext|\ + luma,wrtq-329acn|\ + netgear,wac510|\ + plasmacloud,pa1200|\ + plasmacloud,pa2200) + ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; aruba,ap-303|\ aruba,ap-365|\ avm,fritzrepeater-1200|\ dlink,dap-2610 |\ + engenius,eap1300|\ engenius,emd1|\ meraki,mr33|\ + mikrotik,lhgg-60ad|\ + mikrotik,sxtsq-5-ac|\ + netgear,ex6100v2|\ + netgear,ex6150v2|\ zyxel,wre6606) ucidef_set_interface_lan "eth0" ;; - buffalo,wtr-m2133hp) + aruba,ap-303h|\ + teltonika,rutx10) + ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ - "0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" + "0u@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "0u@eth1" "5:wan" + ;; + asus,map-ac2200|\ + cilab,meshpoint-one|\ + edgecore,ecw5211|\ + edgecore,oap100|\ + openmesh,a42|\ + openmesh,a62) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ;; + mikrotik,cap-ac) + ucidef_add_switch "switch0" \ + "0t@eth0" "4:lan" "5:wan" + ;; + asus,rt-ac42u|\ + asus,rt-ac58u|\ + mikrotik,hap-ac2|\ + mikrotik,hap-ac3|\ + p2w,r619ac-64m|\ + p2w,r619ac-128m|\ + zyxel,nbg6617) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_add_switch "switch0" \ + "0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" + ;; + avm,fritzbox-4040|\ + linksys,ea6350v3|\ + linksys,ea8300) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_add_switch "switch0" \ + "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" + ;; + linksys,mr8300) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_add_switch "switch0" \ + "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan" + ;; + avm,fritzbox-7530) + ucidef_add_switch "switch0" \ + "0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" + ;; + avm,fritzrepeater-3000) + ucidef_add_switch "switch0" \ + "0u@eth0" "4:lan:1" "5:lan:2" + ;; + compex,wpj419|\ + compex,wpj428|\ + engenius,eap2200) + ucidef_set_interface_lan "eth0 eth1" + ;; + buffalo,wtr-m2133hp) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_add_switch "switch0" \ + "0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1" ;; cellc,rtl30vw) + ucidef_set_interface_lan "eth0" ucidef_add_switch "switch0" \ - "0t@eth0" "3:lan" "4:lan" + "0u@eth0" "3:lan" "4:lan" ;; - glinet,gl-a1300|\ - glinet,gl-b1300|\ - glinet,gl-s1300|\ - qxwlan,e2600ac-c1|\ - qxwlan,e2600ac-c2) - ucidef_add_switch "switch0" \ - "0t@eth0" "3:lan" "4:lan" "5:wan" + devolo,magic-2-wifi-next) + ucidef_set_interface_lan "eth0 eth1 eth2" ;; - hiwifi,c526a|\ - zte,mf263) + ezviz,cs-w3-wd1200g-eup) + ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ - "0t@eth0" "2:lan" "3:lan" "4:lan" "5:wan" + "0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "0u@eth1" "5:wan" ;; - leguang,ca100) + glinet,gl-ap1300 |\ + glinet,gl-b1300 |\ + glinet,gl-s1300) + ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ - "0t@eth0" "3:lan" "5:wan" + "0u@eth0" "3:lan" "4:lan" + ;; + glinet,gl-b2200) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_add_switch "switch0" \ + "0u@eth0" "1:lan" "2:lan" "3:lan" "5:lan" "0u@eth1" "4:wan" ;; mobipromo,cm520-79f) ucidef_add_switch "switch0" \ - "0t@eth0" "3:lan:2" "4:lan:1" "5:wan" + "0u@eth0" "3:lan:2" "4:lan:1" + ucidef_set_interface_wan "eth1" ;; - netgear,ex6100v2|\ - netgear,ex6150v2) + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) ucidef_add_switch "switch0" \ - "0u@eth0" "4:lan" + "0u@eth0" "2:lan" "3:lan" "4:lan" + ucidef_set_interface_wan "eth1" ;; - netgear,ex6200v2) + qxwlan,e2600ac-c1 |\ + qxwlan,e2600ac-c2) + ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ - "0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" + "0u@eth0" "3:lan" "4:lan" "0u@eth1" "5:wan" ;; - p2w,r619ac|\ - p2w,r619ac-128m|\ - zyxel,nbg6617) + unielec,u4019-32m |\ + tel,x1pro) + ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ - "0t@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan:5" + "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan" + ;; + zte,mf286d) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_add_switch "switch0" \ + "0u@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "0u@eth1" "5:wan" + ;; + zte,mf289f) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_add_switch "switch0" \ + "0u@eth0" "5:lan:2" "0u@eth1" "2:wan" ;; *) echo "Unsupported hardware. Network interfaces not initialized" @@ -122,20 +172,18 @@ ipq40xx_setup_macs() 8dev,habanero-dvk) label_mac=$(mtd_get_mac_binary "ART" 0x1006) ;; - asus,rt-acrh17|\ asus,rt-ac58u) - lan_mac=$(cat /sys/class/net/eth0/address) - wan_mac=$(macaddr_add "$lan_mac" 1) - label_mac=$lan_mac - ;; - century,wr142ac|\ - century,wr142ac-nand) - lan_mac=$(cat /sys/class/net/eth0/address) - wan_mac=$(macaddr_add "$lan_mac" -1) + wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006) + lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006) + label_mac=$wan_mac ;; cilab,meshpoint-one) label_mac=$(mtd_get_mac_binary "ART" 0x1006) ;; + devolo,magic-2-wifi-next) + lan_mac=$(mtd_get_mac_ascii APPSBLENV MacAddress0) + label_mac=$lan_mac + ;; dlink,dap-2610) lan_mac=$(mtd_get_mac_ascii bdcfg lanmac) label_mac=$lan_mac @@ -157,22 +205,21 @@ ipq40xx_setup_macs() ezviz,cs-w3-wd1200g-eup) label_mac=$(mtd_get_mac_binary "ART" 0x6) ;; - hiwifi,c526a) - lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") - wan_mac=$(macaddr_add "$lan_mac" 1) - ;; linksys,ea6350v3) wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) lan_mac=$(macaddr_add "$wan_mac" 1) ;; - p2w,r619ac|\ - p2w,r619ac-128m) - wan_mac=$(cat /sys/class/net/eth0/address) - lan_mac=$(macaddr_add "$wan_mac" 1) + mikrotik,cap-ac |\ + mikrotik,hap-ac2|\ + mikrotik,hap-ac3) + wan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base) + lan_mac=$(macaddr_add $wan_mac 1) + label_mac="$wan_mac" ;; - zte,mf263) - wan_mac=$(mtd_get_mac_binary mac 0x0) - lan_mac=$(macaddr_add "$wan_mac" 1) + mikrotik,lhgg-60ad|\ + mikrotik,sxtsq-5-ac) + lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base) + label_mac="$lan_mac" ;; esac diff --git a/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches old mode 100755 new mode 100644 index c255707f9..b5c96da96 --- a/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches @@ -1,4 +1,3 @@ -#!/bin/sh . /lib/functions/uci-defaults.sh @@ -19,6 +18,16 @@ cilab,meshpoint-one) compex,wpj428) ucidef_add_gpio_switch "sim_card_select" "SIM card select" "3" "0" ;; +mikrotik,cap-ac) + ucidef_add_gpio_switch "poe_passtrough" "POE passtrough enable" "414" "0" + ;; +mikrotik,hap-ac3) + ucidef_add_gpio_switch "poe_passtrough" "PoE Passthrough" "452" "0" + ;; +zte,mf286d|\ +zte,mf289f) + ucidef_add_gpio_switch "power_btn_block" "Power button blocker" "421" "0" + ;; esac board_config_flush diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 01afece95..8fb9d81d3 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -12,7 +12,7 @@ case "$FIRMWARE" in meraki,mr33) caldata_extract_ubi "ART" 0x9000 0x844 caldata_valid "4408" || caldata_extract "ART" 0x9000 0x844 - ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +1) + ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) 1) ;; esac ;; @@ -23,8 +23,7 @@ case "$FIRMWARE" in ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ;; - asus,rt-acrh17) - CI_UBIPART=UBI_DEV + asus,rt-ac42u) caldata_extract_ubi "Factory" 0x9000 0x2f20 ;; avm,fritzrepeater-3000) @@ -35,52 +34,33 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \ /usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; - buffalo,wtr-m2133hp) - caldata_extract "ART" 0x9000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x32) - ;; - engenius,eap2200 |\ - openmesh,a62) + openmesh,a62 |\ + plasmacloud,pa2200) caldata_extract "0:ART" 0x9000 0x2f20 ;; - linksys,ea8300) + linksys,ea8300 |\ + linksys,mr8300) caldata_extract "ART" 0x9000 0x2f20 # OEM assigns 4 sequential MACs ath10k_patch_mac $(macaddr_setbit_la $(macaddr_add "$(cat /sys/class/net/eth0/address)" 4)) ;; + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + caldata_extract_mmc "0:ART" 0x9000 0x2f20 + ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0x12) + ;; esac ;; "ath10k/pre-cal-ahb-a000000.wifi.bin") case "$board" in - 8dev,habanero-dvk |\ - 8dev,jalapeno |\ - alfa-network,ap120c-ac |\ - century,wr142ac |\ - century,wr142ac-nand |\ - cilab,meshpoint-one |\ - ezviz,cs-w3-wd1200g-eup |\ - glinet,gl-b1300 |\ - glinet,gl-s1300 |\ - leguang,ca100 |\ - linksys,ea6350v3 |\ - mobipromo,cm520-79f |\ - p2w,r619ac |\ - p2w,r619ac-128m |\ qcom,ap-dk01.1-c1) caldata_extract "ART" 0x1000 0x2f20 ;; - aruba,ap-303 |\ - aruba,ap-303h |\ - aruba,ap-365) - caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary mfginfo 0x1D) - ;; - asus,map-ac2200) - caldata_extract_ubi "Factory" 0x1000 0x2f20 - ;; - asus,rt-acrh17 |\ + asus,map-ac2200|\ + asus,rt-ac42u|\ asus,rt-ac58u) - CI_UBIPART=UBI_DEV caldata_extract_ubi "Factory" 0x1000 0x2f20 ;; avm,fritzbox-4040) @@ -96,22 +76,17 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \ /usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; - buffalo,wtr-m2133hp) - caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x26) - ;; cellc,rtl30vw |\ - compex,wpj419 |\ - compex,wpj428 |\ - engenius,eap1300 |\ - engenius,eap2200 |\ openmesh,a42 |\ openmesh,a62 |\ - qxwlan,e2600ac-c1 |\ - qxwlan,e2600ac-c2 |\ - unielec,u4019-32m) + plasmacloud,pa1200 |\ + plasmacloud,pa2200) caldata_extract "0:ART" 0x1000 0x2f20 ;; + devolo,magic-2-wifi-next) + caldata_extract "ART" 0x1000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii APPSBLENV WiFiMacAddress0) + ;; dlink,dap-2610) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac) @@ -126,30 +101,35 @@ case "$FIRMWARE" in ;; engenius,ens620ext) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2) ;; - hiwifi,c526a) + linksys,ea8300 |\ + linksys,mr8300) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii bdinfo "Vfac_mac ") +2) - ;; - linksys,ea8300) - caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" +2) + ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 2) ;; meraki,mr33) caldata_extract_ubi "ART" 0x1000 0x2f20 caldata_valid "202f" || caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +2) + ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) 2) ;; - netgear,ex6100v2 |\ - netgear,ex6150v2 |\ - netgear,ex6200v2) - caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary dnidata 0x0) + mikrotik,cap-ac |\ + mikrotik,hap-ac2 |\ + mikrotik,hap-ac3) + wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data" + ( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x0 0x2f20 ) || \ + ( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_0" 0x0 0x2f20 ) ;; - zte,mf263) + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + caldata_extract_mmc "0:ART" 0x1000 0x2f20 + ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0x0) + ;; + teltonika,rutx10) caldata_extract "0:ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x0) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:CONFIG" 0x0) 2) ;; zyxel,nbg6617 |\ zyxel,wre6606) @@ -160,34 +140,11 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-ahb-a800000.wifi.bin") case "$board" in - 8dev,habanero-dvk |\ - 8dev,jalapeno |\ - alfa-network,ap120c-ac |\ - century,wr142ac |\ - century,wr142ac-nand |\ - cilab,meshpoint-one |\ - ezviz,cs-w3-wd1200g-eup |\ - glinet,gl-b1300 |\ - glinet,gl-s1300 |\ - leguang,ca100 |\ - linksys,ea6350v3 |\ - mobipromo,cm520-79f |\ - p2w,r619ac |\ - p2w,r619ac-128m |\ qcom,ap-dk01.1-c1) caldata_extract "ART" 0x5000 0x2f20 ;; - aruba,ap-303 |\ - aruba,ap-303h |\ - aruba,ap-365) - caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mfginfo 0x1D) +1) - ;; - asus,map-ac2200) - caldata_extract_ubi "Factory" 0x5000 0x2f20 - ;; + asus,map-ac2200|\ asus,rt-ac58u) - CI_UBIPART=UBI_DEV caldata_extract_ubi "Factory" 0x5000 0x2f20 ;; avm,fritzbox-4040) @@ -203,60 +160,61 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \ /usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; - buffalo,wtr-m2133hp) - caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x2c) - ;; cellc,rtl30vw |\ - compex,wpj419 |\ - compex,wpj428 |\ - engenius,eap1300 |\ - engenius,eap2200 |\ openmesh,a42 |\ openmesh,a62 |\ - qxwlan,e2600ac-c1 |\ - qxwlan,e2600ac-c2 |\ - unielec,u4019-32m) + plasmacloud,pa1200 |\ + plasmacloud,pa2200) caldata_extract "0:ART" 0x5000 0x2f20 ;; + devolo,magic-2-wifi-next) + caldata_extract "ART" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii APPSBLENV WiFiMacAddress1) + ;; dlink,dap-2610) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a) ;; engenius,emd1) caldata_extract "0:ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr) 1) ;; engenius,emr3500) caldata_extract "0:ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) 1) ;; engenius,ens620ext) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 3) ;; - hiwifi,c526a) + linksys,ea8300 |\ + linksys,mr8300) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii bdinfo "Vfac_mac ") +3) - ;; - linksys,ea8300) - caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" +3) + ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 3) ;; meraki,mr33) caldata_extract_ubi "ART" 0x5000 0x2f20 caldata_valid "202f" || caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +3) + ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) 3) ;; - netgear,ex6100v2 |\ - netgear,ex6150v2 |\ - netgear,ex6200v2) - caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary dnidata 0xc) + mikrotik,cap-ac |\ + mikrotik,hap-ac2 |\ + mikrotik,hap-ac3 |\ + mikrotik,sxtsq-5-ac) + wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data" + ( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x8000 0x2f20 ) || \ + ( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_2" 0x0 0x2f20 ) ;; - zte,mf263) + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + caldata_extract_mmc "0:ART" 0x5000 0x2f20 + ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0xc) + ;; + teltonika,rutx10) caldata_extract "0:ART" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x0) +3) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:CONFIG" 0x0) 3) ;; zyxel,nbg6617 |\ zyxel,wre6606) @@ -265,6 +223,29 @@ case "$FIRMWARE" in ;; esac ;; +"ath10k/QCA4019/hw1.0/board-ahb-a000000.wifi.bin") + case "$board" in + mikrotik,cap-ac |\ + mikrotik,hap-ac2 |\ + mikrotik,hap-ac3) + wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data" + ( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x2f20 0x2f20 ) || \ + ( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_0" 0x2f20 0x2f20 ) + ;; + esac + ;; +"ath10k/QCA4019/hw1.0/board-ahb-a800000.wifi.bin") + case "$board" in + mikrotik,cap-ac |\ + mikrotik,hap-ac2 |\ + mikrotik,hap-ac3 |\ + mikrotik,sxtsq-5-ac) + wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data" + ( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0xaf20 0x2f20 ) || \ + ( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_2" 0x2f20 0x2f20 ) + ;; + esac + ;; *) exit 1 ;; diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ipq40xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac deleted file mode 100644 index 0be00f5eb..000000000 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/ash - -[ "$ACTION" = "add" ] || exit 0 - -PHYNBR=${DEVPATH##*/phy} - -[ -n $PHYNBR ] || exit 0 - -. /lib/functions.sh -. /lib/functions/system.sh - -board=$(board_name) - -case "$board" in - hiwifi,c526a) - [ "$PHYNBR" -eq 0 ] && \ - mtd_get_mac_ascii bdinfo "Vfac_mac " > /sys${DEVPATH}/macaddress - ;; - *) - ;; -esac diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/net/21_adjust_network b/target/linux/ipq40xx/base-files/etc/hotplug.d/net/21_adjust_network deleted file mode 100644 index 7aa4f6f72..000000000 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/net/21_adjust_network +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -[ -f /lib/adjust_network.sh ] && { - . /lib/adjust_network.sh - - adjust_eth_queue -} diff --git a/target/linux/ipq40xx/base-files/etc/init.d/adjust_network b/target/linux/ipq40xx/base-files/etc/init.d/adjust_network deleted file mode 100755 index 02af81983..000000000 --- a/target/linux/ipq40xx/base-files/etc/init.d/adjust_network +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2006-2011 OpenWrt.org - -START=11 -STOP=98 - -adjust_smp_affinity() { - test -f /lib/adjust_network.sh && { - . /lib/adjust_network.sh - - adjust_eth_queue - adjust_edma_smp_affinity - adjust_radio_smp_affinity - } -} - -boot() { - adjust_smp_affinity -} diff --git a/target/linux/ipq40xx/base-files/etc/init.d/bootcount b/target/linux/ipq40xx/base-files/etc/init.d/bootcount new file mode 100755 index 000000000..9abfbddc4 --- /dev/null +++ b/target/linux/ipq40xx/base-files/etc/init.d/bootcount @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common + +START=99 + +boot() { + case $(board_name) in + alfa-network,ap120c-ac) + [ -n "$(fw_printenv bootcount changed 2>/dev/null)" ] &&\ + echo -e "bootcount\nchanged\n" | /usr/sbin/fw_setenv -s - + ;; + linksys,ea6350v3|\ + linksys,ea8300|\ + linksys,mr8300) + mtd resetbc s_env || true + ;; + netgear,wac510) + fw_setenv boot_cnt=0 + ;; + esac +} diff --git a/target/linux/ipq40xx/base-files/etc/init.d/mt7615_reboot b/target/linux/ipq40xx/base-files/etc/init.d/mt7615_reboot deleted file mode 100755 index 47c35a217..000000000 --- a/target/linux/ipq40xx/base-files/etc/init.d/mt7615_reboot +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh /etc/rc.common - -STOP=60 - -stop() { - . /lib/functions.sh - - case $(board_name) in - hiwifi,c526a) - rmmod mt7615e - ;; - esac -} diff --git a/target/linux/ipq40xx/base-files/etc/init.d/zlinksys_recovery b/target/linux/ipq40xx/base-files/etc/init.d/zlinksys_recovery deleted file mode 100755 index a3b1ce62d..000000000 --- a/target/linux/ipq40xx/base-files/etc/init.d/zlinksys_recovery +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh /etc/rc.common -# -# This script sets auto_recovery to "yes" and resets the boot counter to 0. -# As a golden rule, this should be the latest script to run at boot. For a -# developer snapshot, it is fine to set auto_recovery here. But for a stable -# release, this script must in fact turn off auto_recovery. -# -# Why? Because the custom sysupgrade script for the device will turn on -# auto_recovery to "yes". And it's the job of this script to set the -# boot boot_count to 0 and then disable auto_recovery, as that condition -# means that the stable release went well. -# -# I have to repeat: this script should be changed for stable releases. - -START=99 -boot() { - . /lib/functions.sh - - case $(board_name) in - linksys,ea6350v3) - # make sure auto_recovery in uboot is always on - IS_AUTO_RECOVERY="$(fw_printenv -n auto_recovery)" - if [ "$IS_AUTO_RECOVERY" != "yes" ] ; then - fw_setenv auto_recovery yes - echo "Linksys EA6350v3: fw_setenv: auto_recovery has been set to yes" - fi - # reset the boot counter - fw_setenv boot_count 0 - mtd resetbc s_env - echo "Linksys EA6350v3: boot counter has been reset" - echo "Linksys EA6350v3: boot_part=$(fw_printenv -n boot_part)" - ;; - esac - -} diff --git a/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration b/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration index c4f82b35d..e8818a41e 100644 --- a/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration @@ -3,6 +3,9 @@ board=$(board_name) case "$board" in +asus,map-ac2200) + migrate_leds ':chan=-' + ;; engenius,emr3500) migrate_leds "emr3500:=" ;; @@ -10,6 +13,9 @@ engenius,ens620ext|\ zyxel,nbg6617) migrate_leds ":wlan2G=:wlan2g" ":wlan5G=:wlan5g" ;; +netgear,wac510) + migrate_leds ":wlan2g=:wlan-0" ":wlan5g=:wlan-1" ":act=:activity" + ;; esac remove_devicename_leds diff --git a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version new file mode 100644 index 000000000..44873b9df --- /dev/null +++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version @@ -0,0 +1,10 @@ +. /lib/functions.sh + +case "$(board_name)" in +ezviz,cs-w3-wd1200g-eup) + uci set system.@system[0].compat_version="2.0" + uci commit system + ;; +esac + +exit 0 diff --git a/target/linux/ipq40xx/base-files/lib/adjust_network.sh b/target/linux/ipq40xx/base-files/lib/adjust_network.sh deleted file mode 100644 index 99423022c..000000000 --- a/target/linux/ipq40xx/base-files/lib/adjust_network.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# this scripts is used for adjust cpu's choice of interrupts. -# - -################################################ -# Adjust smp_affinity of edma -# Globals: -# None -# Arguments: -# None -# Returns: -# None -# Remark: -# execute only once on start-up. -################################################ -adjust_edma_smp_affinity() { - grep -q edma_eth_ /proc/interrupts || return 0 - local nr=`cat /proc/cpuinfo | grep processor | wc -l` - local cpu=0 - local tx_irq_num - - for tx_num in `seq 0 1 15` ; do - cpu=`printf "%x" $((1<<((tx_num/4+0)%nr)))` - tx_irq_num=`grep -m1 edma_eth_tx$tx_num /proc/interrupts | cut -d ':' -f 1 | tail -n1 | tr -d ' '` - [ -n "$tx_irq_num" ] && echo $cpu > /proc/irq/$tx_irq_num/smp_affinity - done - - for rx_num in `seq 0 1 7` ; do - cpu=`printf "%x" $((1<<((rx_num/2)%nr)))` - rx_irq_num=`grep -m1 edma_eth_rx$rx_num /proc/interrupts | cut -d ':' -f 1 | tail -n1 | tr -d ' '` - [ -n "$rx_irq_num" ] && echo $cpu > /proc/irq/$rx_irq_num/smp_affinity - done -} - -################################################ -# Adjust smp_affinity of ath10k for 2G and 5G -# Globals: -# None -# Arguments: -# None -# Returns: -# None -# Remark: -# execute only once on start-up. -################################################ -adjust_radio_smp_affinity() { - local irqs="`grep -E 'ath10k' /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`" - local nr=`cat /proc/cpuinfo | grep processor | wc -l` - local idx=2 - - for irq in $irqs; do - cpu=`printf "%x" $((1<<((idx)%nr)))` - echo $cpu > /proc/irq/$irq/smp_affinity - idx=$((idx+1)) - done -} - -################################################ -# Adjust queue of eth -# Globals: -# None -# Arguments: -# None -# Returns: -# None -# Remark: -# Each network reboot needs to be executed. -################################################ -adjust_eth_queue() { - local nr=`cat /proc/cpuinfo | grep processor | wc -l` - local idx=0 - - for epath in /sys/class/net/eth[0-9]*; do - test -e $epath || break - echo $epath | grep -q "\." && continue - eth=`basename $epath` - idx=0 - for exps in /sys/class/net/$eth/queues/rx-[0-9]*/rps_cpus; do - test -e $exps || break - cpu=`printf "%x" $((1<<((idx+1)%nr)))` - idx=$((idx+1)) - echo $cpu > $exps - echo 256 > `dirname $exps`/rps_flow_cnt - done - which ethtool >/dev/null 2>&1 && ethtool -K $eth gro off - done - - echo 1024 > /proc/sys/net/core/rps_sock_flow_entries -} diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh index d06ba7e9a..2609a55d2 100644 --- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh +++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh @@ -5,22 +5,21 @@ preinit_set_mac_address() { asus,map-ac2200) base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006) ip link set dev eth0 address $(macaddr_add "$base_mac" 1) + ip link set dev eth1 address $(macaddr_add "$base_mac" 3) ;; - asus,rt-acrh17|\ - asus,rt-ac58u) - CI_UBIPART=UBI_DEV - base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006) - ip link set dev eth0 address $(macaddr_add "$base_mac" 1) - ;; - ezviz,cs-w3-wd1200g-eup) - ip link set dev eth0 address $(mtd_get_mac_binary "ART" 0x6) + asus,rt-ac42u) + ip link set dev eth0 address $(mtd_get_mac_binary_ubi Factory 0x1006) + ip link set dev eth1 address $(mtd_get_mac_binary_ubi Factory 0x9006) ;; engenius,eap2200) base_mac=$(cat /sys/class/net/eth0/address) + ip link set dev eth1 address $(macaddr_add "$base_mac" 1) ;; - linksys,ea8300) + linksys,ea8300|\ + linksys,mr8300) base_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) - ip link set dev eth0 address "${base_mac}" + ip link set dev eth0 address "$base_mac" + ip link set dev eth1 address $(macaddr_add "$base_mac" 1) ;; meraki,mr33) mac_lan=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) @@ -29,6 +28,7 @@ preinit_set_mac_address() { zyxel,nbg6617) base_mac=$(cat /sys/class/net/eth0/address) ip link set dev eth0 address $(macaddr_add "$base_mac" 2) + ip link set dev eth1 address $(macaddr_add "$base_mac" 3) ;; esac } diff --git a/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh index f94116de6..18c13c602 100644 --- a/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh +++ b/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh @@ -3,15 +3,20 @@ set_preinit_iface() { case $(board_name) in aruba,ap-303| \ + asus,rt-ac42u| \ asus,rt-ac58u| \ avm,fritzbox-4040| \ ezviz,cs-w3-wd1200g-eup| \ glinet,gl-b1300| \ linksys,ea8300| \ + linksys,mr8300| \ meraki,mr33| \ zyxel,nbg6617) ifname=eth0 ;; + devolo,magic-2-wifi-next) + ifname=eth1 + ;; esac } diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh similarity index 91% rename from target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh rename to target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh index f4bc7e756..81418fe0b 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh @@ -1,11 +1,11 @@ -# The U-Boot loader of the OpenMesh devices requires image sizes and -# checksums to be provided in the U-Boot environment. -# The OpenMesh devices come with 2 main partitions - while one is active +# The U-Boot loader with the datachk patchset for dualbooting requires image +# sizes and checksums to be provided in the U-Boot environment. +# The devices come with 2 main partitions - while one is active # sysupgrade will flash the other. The boot order is changed to boot the # newly flashed partition. If the new partition can't be booted due to # upgrade failures the previously used partition is loaded. -platform_do_upgrade_openmesh() { +platform_do_upgrade_dualboot_datachk() { local tar_file="$1" local restore_backup local primary_kernel_mtd @@ -44,9 +44,11 @@ platform_do_upgrade_openmesh() { # boot anymore to Linux until it was reflashed with ap51-flash. local next_boot_part="1" case "$(board_name)" in + plasmacloud,pa1200|\ openmesh,a42) primary_kernel_mtd=8 ;; + plasmacloud,pa2200|\ openmesh,a62) primary_kernel_mtd=10 ;; @@ -74,7 +76,7 @@ platform_do_upgrade_openmesh() { # # take care of restoring a saved config - [ "$SAVE_CONFIG" -eq 1 ] && restore_backup="${MTD_CONFIG_ARGS} -j ${CONF_TAR}" + [ -n "$UPGRADE_BACKUP" ] && restore_backup="${MTD_CONFIG_ARGS} -j ${UPGRADE_BACKUP}" mtd -q erase inactive tar xf $tar_file ${board_dir}/root -O | mtd -n -p $kernel_length $restore_backup write - $PART_NAME diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh b/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh old mode 100755 new mode 100644 index 9772d68f3..5d25c20ad --- a/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh @@ -1,45 +1,76 @@ linksys_get_target_firmware() { - cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part) - target_firmware="" - if [ "$cur_boot_part" = "1" ]; then - # current primary boot - update alt boot - target_firmware="alt_kernel" - fw_setenv boot_part 2 - # In the Linksys EA6350v3, it is enough to set the boot_part as the boot command line is - # bootcmd=if test $boot_part = 1; then run bootpart1; else run bootpart2; fi - # - You probably want to use that if your device's uboot does not eval bootcmd - #fw_setenv bootcmd "run altnandboot" - elif [ "$cur_boot_part" = "2" ]; then - # current alt boot - update primary boot - target_firmware="kernel" - fw_setenv boot_part 1 - #fw_setenv bootcmd "run nandboot" + local cur_boot_part mtd_ubi0 + + cur_boot_part="$(/usr/sbin/fw_printenv -n boot_part)" + if [ -z "${cur_boot_part}" ]; then + mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num) + case "$(grep -E "^mtd${mtd_ubi0}:" /proc/mtd | cut -d '"' -f 2)" in + kernel|rootfs) + cur_boot_part=1 + ;; + alt_kernel|alt_rootfs) + cur_boot_part=2 + ;; + esac + >&2 printf "Current boot_part='%s' selected from ubi0/mtd_num='%s'" \ + "${cur_boot_part}" "${mtd_ubi0}" fi - # re-enable recovery so we get back if the new firmware is broken - fw_setenv auto_recovery yes - # see /etc/init.d/zlinksys_recovery + # OEM U-Boot for EA6350v3, EA8300 and MR8300; bootcmd= + # if test $auto_recovery = no; + # then bootipq; + # elif test $boot_part = 1; + # then run bootpart1; + # else run bootpart2; + # fi - echo "$target_firmware" + case "$cur_boot_part" in + 1) + fw_setenv -s - <<-EOF + boot_part 2 + auto_recovery yes + EOF + printf "alt_kernel" + return + ;; + 2) + fw_setenv -s - <<-EOF + boot_part 1 + auto_recovery yes + EOF + printf "kernel" + return + ;; + *) + return + ;; + esac } -linksys_get_root_magic() { - (get_image "$@" | dd skip=786432 bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2>/dev/null +linksys_is_factory_image() { + local board=$(board_name) + board=${board##*,} + + # check matching footer signature + tail -c 256 $1 | grep -q -i "\.LINKSYS\.........${board}" } platform_do_upgrade_linksys() { local magic_long="$(get_magic_long "$1")" + local rm_oem_fw_vols="squashfs ubifs" # from OEM [alt_]rootfs UBI + local vol + mkdir -p /var/lock local part_label="$(linksys_get_target_firmware)" touch /var/lock/fw_printenv.lock - if [ ! -n "$part_label" ]; then + if [ -z "$part_label" ]; then echo "cannot find target partition" exit 1 fi - local target_mtd=$(find_mtd_part $part_label) + local target_mtd=$(find_mtd_part "$part_label") [ "$magic_long" = "73797375" ] && { CI_KERNPART="$part_label" @@ -49,47 +80,41 @@ platform_do_upgrade_linksys() { CI_UBIPART="alt_rootfs" fi - # remove "squashfs" vol (in case we are flashing over a stock image, which is also UBI) - - local mtdnum="$( find_mtd_index "$CI_UBIPART" )" + local mtdnum="$(find_mtd_index "$CI_UBIPART")" if [ ! "$mtdnum" ]; then echo "cannot find ubi mtd partition $CI_UBIPART" return 1 fi - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" + local ubidev="$(nand_find_ubi "$CI_UBIPART")" if [ ! "$ubidev" ]; then ubiattach -m "$mtdnum" sync - ubidev="$( nand_find_ubi "$CI_UBIPART" )" + ubidev="$(nand_find_ubi "$CI_UBIPART")" fi if [ "$ubidev" ]; then - local squash_ubivol="$( nand_find_volume $ubidev squashfs )" - # kill volume - [ "$squash_ubivol" ] && ubirmvol /dev/$ubidev -N squashfs || true + for vol in $rm_oem_fw_vols; do + ubirmvol "/dev/$ubidev" -N "$vol" 2>/dev/null + done fi # complete std upgrade nand_upgrade_tar "$1" } - [ "$magic_long" = "27051956" ] && { - # This magic is for a uImage (which is a sysupgrade image) - # check firmwares' rootfs types - local oldroot="$(linksys_get_root_magic $target_mtd)" - local newroot="$(linksys_get_root_magic "$1")" - if [ "$newroot" = "55424923" -a "$oldroot" = "55424923" ]; then - # we're upgrading from a firmware with UBI to one with UBI - # erase everything to be safe - # - Is that really needed? Won't remove (or comment) the if, because it may be needed in a future device. - #mtd erase $part_label - #get_image "$1" | mtd -n write - $part_label - echo "writing \"$1\" UBI image to \"$part_label\" (UBI)..." - get_image "$1" | mtd write - $part_label - else - echo "writing \"$1\" image to \"$part_label\"" - get_image "$1" | mtd write - $part_label + [ "$magic_long" = "27051956" ] && { + echo "writing \"$1\" image to \"$part_label\"" + get_image "$1" | mtd write - "$part_label" + } + + [ "$magic_long" = "d00dfeed" ] && { + if ! linksys_is_factory_image "$1"; then + echo "factory image doesn't match device" + return 1 fi + + echo "writing \"$1\" factory image to \"$part_label\"" + get_image "$1" | mtd -e "$part_label" write - "$part_label" } } diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh b/target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh new file mode 100644 index 000000000..f3fb626d1 --- /dev/null +++ b/target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh @@ -0,0 +1,76 @@ +# SPDX-License-Identifier: GPL-2.0-only +. /lib/functions.sh + +platform_do_upgrade_netgear_orbi_upgrade() { + command -v losetup >/dev/null || { + logger -s "Upgrade failed: 'losetup' not installed." + return 1 + } + + local tar_file=$1 + local kernel=$2 + local rootfs=$3 + + [ -z "$kernel" ] && kernel=$(find_mmc_part "kernel") + [ -z "$rootfs" ] && rootfs=$(find_mmc_part "rootfs") + + [ -z "$kernel" ] && echo "Upgrade failed: kernel partition not found! Rebooting..." && reboot -f + [ -z "$rootfs" ] && echo "Upgrade failed: rootfs partition not found! Rebooting..." && reboot -f + + netgear_orbi_do_flash $tar_file $kernel $rootfs + + echo "sysupgrade successful" + umount -a + reboot -f +} + +netgear_orbi_do_flash() { + local tar_file=$1 + local kernel=$2 + local rootfs=$3 + + # keep sure its unbound + losetup --detach-all || { + echo "Failed to detach all loop devices. Skip this try." + reboot -f + } + + # use the first found directory in the tar archive + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + echo "flashing kernel to $kernel" + tar xf $tar_file ${board_dir}/kernel -O >$kernel + + echo "flashing rootfs to ${rootfs}" + tar xf $tar_file ${board_dir}/root -O >"${rootfs}" + + # a padded rootfs is needed for overlay fs creation + local offset=$(tar xf $tar_file ${board_dir}/root -O | wc -c) + [ $offset -lt 65536 ] && { + echo "Wrong size for rootfs: $offset" + sleep 10 + reboot -f + } + + # Mount loop for rootfs_data + local loopdev="$(losetup -f)" + losetup -o $offset $loopdev $rootfs || { + echo "Failed to mount looped rootfs_data." + sleep 10 + reboot -f + } + + echo "Format new rootfs_data at position ${offset}." + mkfs.ext4 -F -L rootfs_data $loopdev + mkdir /tmp/new_root + mount -t ext4 $loopdev /tmp/new_root && { + echo "Saving config to rootfs_data at position ${offset}." + cp -v "$UPGRADE_BACKUP" "/tmp/new_root/$BACKUP_FILE" + umount /tmp/new_root + } + + # Cleanup + losetup -d $loopdev >/dev/null 2>&1 + sync +} diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 8467c699b..e9c17e5b0 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -4,141 +4,52 @@ REQUIRE_IMAGE_METADATA=1 RAMFS_COPY_BIN='fw_printenv fw_setenv' RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' -ubi_kill_if_exist() { - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - local c_ubivol="$( nand_find_volume $ubidev $1 )" - umount -f /dev/$c_ubivol 2>/dev/null - [ "$c_ubivol" ] && ubirmvol /dev/$ubidev -N $1 || true - echo "Partition $1 removed." -} - -# idea from @981213 -# Tar sysupgrade for ASUS RT-AC82U/RT-AC58U -# An ubi repartition is required due to the strange partition table created by Asus. -# We create all the factory partitions to make sure that the U-boot tftp recovery still works. -# The reserved kernel partition size should be enough to put the factory image in. -asus_nand_upgrade_tar() { - local kpart_size="$1" - local tar_file="$2" - - local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') - board_dir=${board_dir%/} - - local kernel_length=`(tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null` - local rootfs_length=`(tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null` - - local mtdnum="$( find_mtd_index "$CI_UBIPART" )" - if [ ! "$mtdnum" ]; then - echo "cannot find ubi mtd partition $CI_UBIPART" - return 1 - fi - - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - if [ ! "$ubidev" ]; then - ubiattach -m "$mtdnum" - sync - ubidev="$( nand_find_ubi "$CI_UBIPART" )" - fi - - if [ ! "$ubidev" ]; then - echo "cannot find ubi device $CI_UBIPART" - return 1 - fi - - local root_ubivol="$( nand_find_volume $ubidev rootfs )" - # remove ubiblock device of rootfs - local root_ubiblk="ubiblock${root_ubivol:3}" - if [ "$root_ubivol" -a -e "/dev/$root_ubiblk" ]; then - echo "removing $root_ubiblk" - if ! ubiblock -r /dev/$root_ubivol; then - echo "cannot remove $root_ubiblk" - return 1; - fi - fi - - ubi_kill_if_exist rootfs_data - ubi_kill_if_exist rootfs - ubi_kill_if_exist jffs2 - ubi_kill_if_exist linux2 - ubi_kill_if_exist linux - - ubimkvol /dev/$ubidev -N linux -s $kpart_size - ubimkvol /dev/$ubidev -N linux2 -s $kpart_size - ubimkvol /dev/$ubidev -N jffs2 -s 2539520 - ubimkvol /dev/$ubidev -N rootfs -s $rootfs_length - ubimkvol /dev/$ubidev -N rootfs_data -m - - local kern_ubivol="$(nand_find_volume $ubidev $CI_KERNPART)" - echo "Kernel at $kern_ubivol.Writing..." - tar xf $tar_file ${board_dir}/kernel -O | \ - ubiupdatevol /dev/$kern_ubivol -s $kernel_length - - echo "Done." - - local root_ubivol="$(nand_find_volume $ubidev rootfs)" - echo "Rootfs at $root_ubivol.Writing..." - tar xf $tar_file ${board_dir}/root -O | \ - ubiupdatevol /dev/$root_ubivol -s $rootfs_length - - echo "Done." - - nand_do_upgrade_success -} - -# idea from @981213 -# Factory image sysupgrade for ASUS RT-AC82U/RT-AC58U -# Delete all the partitions we created before, create "linux" partition and write factory image in. -# Skip the first 64bytes which is an uImage header to verify the firmware. -# The kernel partition size should be the original one. -asus_nand_upgrade_factory() { - local kpart_size="$1" - local fw_file="$2" - - local mtdnum="$( find_mtd_index "$CI_UBIPART" )" - if [ ! "$mtdnum" ]; then - echo "cannot find ubi mtd partition $CI_UBIPART" - return 1 - fi - - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - if [ ! "$ubidev" ]; then - ubiattach -m "$mtdnum" - sync - ubidev="$( nand_find_ubi "$CI_UBIPART" )" - fi - - if [ ! "$ubidev" ]; then - echo "cannot find ubi device $CI_UBIPART" - return 1 - fi - - local root_ubivol="$( nand_find_volume $ubidev rootfs )" - # remove ubiblock device of rootfs - local root_ubiblk="ubiblock${root_ubivol:3}" - if [ "$root_ubivol" -a -e "/dev/$root_ubiblk" ]; then - echo "removing $root_ubiblk" - if ! ubiblock -r /dev/$root_ubivol; then - echo "cannot remove $root_ubiblk" - return 1; - fi - fi - - ubi_kill_if_exist rootfs_data - ubi_kill_if_exist rootfs - ubi_kill_if_exist jffs2 - ubi_kill_if_exist linux2 - ubi_kill_if_exist linux - - ubimkvol /dev/$ubidev -N linux -s $kpart_size - - local kern_ubivol="$(nand_find_volume $ubidev $CI_KERNPART)" - echo "Asus linux at $kern_ubivol.Writing..." - ubiupdatevol /dev/$kern_ubivol --skip=64 $fw_file - echo "Done." - - umount -a - reboot -f -} - platform_check_image() { + case "$(board_name)" in + asus,rt-ac42u |\ + asus,rt-ac58u) + local ubidev=$(nand_find_ubi $CI_UBIPART) + local asus_root=$(nand_find_volume $ubidev jffs2) + + [ -n "$asus_root" ] || return 0 + + cat << EOF +jffs2 partition is still present. +There's probably no space left +to install the filesystem. + +You need to delete the jffs2 partition first: +# ubirmvol /dev/ubi0 --name=jffs2 + +Once this is done. Retry. +EOF + return 1 + ;; + zte,mf286d |\ + zte,mf289f) + CI_UBIPART="rootfs" + local mtdnum="$( find_mtd_index $CI_UBIPART )" + [ ! "$mtdnum" ] && return 1 + ubiattach -m "$mtdnum" || true + local ubidev="$( nand_find_ubi $CI_UBIPART )" + local ubi_rootfs=$(nand_find_volume $ubidev ubi_rootfs) + local ubi_rootfs_data=$(nand_find_volume $ubidev ubi_rootfs_data) + + [ -n "$ubi_rootfs" ] || [ -n "$ubi_rootfs_data" ] || return 0 + + cat << EOF +ubi_rootfs partition is still present. + +You need to delete the stock partition first: +# ubirmvol /dev/ubi0 -N ubi_rootfs +Please also delete ubi_rootfs_data, if exist: +# ubirmvol /dev/ubi0 -N ubi_rootfs_data + +Once this is done. Retry. +EOF + return 1 + ;; + esac return 0; } @@ -161,13 +72,31 @@ zyxel_do_upgrade() { tar Oxf $tar_file ${board_dir}/kernel | mtd write - kernel - if [ "$SAVE_CONFIG" -eq 1 ]; then - tar Oxf $tar_file ${board_dir}/root | mtd -j "$CONF_TAR" write - rootfs + if [ -n "$UPGRADE_BACKUP" ]; then + tar Oxf $tar_file ${board_dir}/root | mtd -j "$UPGRADE_BACKUP" write - rootfs else tar Oxf $tar_file ${board_dir}/root | mtd write - rootfs fi } +platform_do_upgrade_mikrotik_nand() { + local fw_mtd=$(find_mtd_part kernel) + fw_mtd="${fw_mtd/block/}" + [ -n "$fw_mtd" ] || return + + local board_dir=$(tar tf "$1" | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + [ -n "$board_dir" ] || return + + local kernel_len=$(tar xf "$1" ${board_dir}/kernel -O | wc -c) + [ -n "$kernel_len" ] || return + + tar xf "$1" ${board_dir}/kernel -O | ubiformat "$fw_mtd" -y -S $kernel_len -f - + + CI_KERNPART="none" + nand_do_upgrade "$1" +} + platform_do_upgrade() { case "$(board_name)" in 8dev,jalapeno |\ @@ -178,15 +107,25 @@ platform_do_upgrade() { avm,fritzrepeater-1200 |\ avm,fritzrepeater-3000 |\ buffalo,wtr-m2133hp |\ - century,wr142ac-nand |\ cilab,meshpoint-one |\ - glinet,gl-a1300 |\ - hiwifi,c526a |\ + edgecore,ecw5211 |\ + edgecore,oap100 |\ + engenius,eap2200 |\ + glinet,gl-ap1300 |\ + luma,wrtq-329acn |\ mobipromo,cm520-79f |\ - qxwlan,e2600ac-c2 |\ - zte,mf263) + netgear,wac510 |\ + p2w,r619ac-64m |\ + p2w,r619ac-128m |\ + qxwlan,e2600ac-c2) nand_do_upgrade "$1" ;; + glinet,gl-b2200) + CI_KERNPART="0:HLOS" + CI_ROOTPART="rootfs" + CI_DATAPART="rootfs_data" + emmc_do_upgrade "$1" + ;; alfa-network,ap120c-ac) part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')" if [ "$part" = "rootfs1" ]; then @@ -202,39 +141,55 @@ platform_do_upgrade() { CI_KERNPART="linux" nand_do_upgrade "$1" ;; - asus,rt-acrh17|\ + asus,rt-ac42u |\ asus,rt-ac58u) - local magic=$(get_magic_long "$1") - CI_UBIPART="UBI_DEV" CI_KERNPART="linux" - if [ "$magic" == "27051956" ]; then - echo "Got Asus factory image." - asus_nand_upgrade_factory 50409472 "$1" - else - asus_nand_upgrade_tar 20951040 "$1" - fi + nand_do_upgrade "$1" ;; cellc,rtl30vw) CI_UBIPART="ubifs" askey_do_upgrade "$1" ;; - compex,wpj419|\ - p2w,r619ac|\ - p2w,r619ac-128m) + compex,wpj419) nand_do_upgrade "$1" ;; linksys,ea6350v3 |\ - linksys,ea8300) + linksys,ea8300 |\ + linksys,mr8300) platform_do_upgrade_linksys "$1" ;; meraki,mr33) CI_KERNPART="part.safe" nand_do_upgrade "$1" ;; + mikrotik,cap-ac|\ + mikrotik,hap-ac2|\ + mikrotik,lhgg-60ad|\ + mikrotik,sxtsq-5-ac) + [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware + default_do_upgrade "$1" + ;; + mikrotik,hap-ac3) + platform_do_upgrade_mikrotik_nand "$1" + ;; + netgear,rbr50 |\ + netgear,rbs50 |\ + netgear,srr60 |\ + netgear,srs60) + platform_do_upgrade_netgear_orbi_upgrade "$1" + ;; openmesh,a42 |\ - openmesh,a62) + openmesh,a62 |\ + plasmacloud,pa1200 |\ + plasmacloud,pa2200) PART_NAME="inactive" - platform_do_upgrade_openmesh "$1" + platform_do_upgrade_dualboot_datachk "$1" + ;; + teltonika,rutx10 |\ + zte,mf286d |\ + zte,mf289f) + CI_UBIPART="rootfs" + nand_do_upgrade "$1" ;; zyxel,nbg6617) zyxel_do_upgrade "$1" @@ -245,10 +200,11 @@ platform_do_upgrade() { esac } -platform_nand_pre_upgrade() { +platform_copy_config() { case "$(board_name)" in - meraki,mr33) - CI_KERNPART="part.safe" + glinet,gl-b2200) + emmc_copy_config ;; esac + return 0; } diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.10 similarity index 86% rename from target/linux/ipq40xx/config-5.4 rename to target/linux/ipq40xx/config-5.10 index f94036505..fda14f013 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.10 @@ -3,7 +3,6 @@ CONFIG_ALIGNMENT_TRAP=y # CONFIG_APQ_MMCC_8084 is not set CONFIG_AR40XX_PHY=y CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_IPQ40XX=y CONFIG_ARCH_KEEP_MEMBLOCK=y @@ -19,6 +18,8 @@ CONFIG_ARCH_NR_GPIO=0 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y CONFIG_ARCH_QCOM=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARM=y CONFIG_ARM_AMBA=y @@ -27,7 +28,6 @@ CONFIG_ARM_ARCH_TIMER=y CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y # CONFIG_ARM_ATAG_DTB_COMPAT is not set CONFIG_ARM_CPUIDLE=y -CONFIG_ARM_CPU_SUSPEND=y # CONFIG_ARM_CPU_TOPOLOGY is not set CONFIG_ARM_CRYPTO=y CONFIG_ARM_GIC=y @@ -37,6 +37,8 @@ CONFIG_ARM_L1_CACHE_SHIFT_6=y CONFIG_ARM_PATCH_IDIV=y CONFIG_ARM_PATCH_PHYS_VIRT=y # CONFIG_ARM_QCOM_CPUFREQ_HW is not set +# CONFIG_ARM_QCOM_CPUFREQ_NVMEM is not set +# CONFIG_ARM_QCOM_SPM_CPUIDLE is not set # CONFIG_ARM_SMMU is not set CONFIG_ARM_THUMB=y CONFIG_ARM_UNWIND=y @@ -45,6 +47,7 @@ CONFIG_AT803X_PHY=y CONFIG_AUTO_ZRELADDR=y CONFIG_BCH=y CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_CMDLINE_PARSER=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y @@ -52,7 +55,7 @@ CONFIG_BOUNCE=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y -CONFIG_CMDLINE_OVERRIDE=y +CONFIG_CMDLINE_PARTITION=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y CONFIG_COMPAT_32BIT_TIME=y @@ -67,15 +70,14 @@ CONFIG_CPU_COPY_V6=y CONFIG_CPU_CP15=y CONFIG_CPU_CP15_MMU=y CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=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_COMMON=y # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_GOV_POWERSAVE is not set -CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y # CONFIG_CPU_FREQ_GOV_USERSPACE is not set CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_HAS_ASID=y @@ -94,14 +96,11 @@ CONFIG_CPU_V7=y CONFIG_CRC16=y # CONFIG_CRC32_SARWATE is not set CONFIG_CRC32_SLICEBY8=y -CONFIG_CRYPTO_ACOMP2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_AES_ARM=y CONFIG_CRYPTO_AES_ARM_BS=y +CONFIG_CRYPTO_BLAKE2S=y CONFIG_CRYPTO_CBC=y CONFIG_CRYPTO_CRYPTD=y -CONFIG_CRYPTO_CTR=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_DEV_QCE=y @@ -115,23 +114,19 @@ CONFIG_CRYPTO_DRBG=y CONFIG_CRYPTO_DRBG_HMAC=y CONFIG_CRYPTO_DRBG_MENU=y CONFIG_CRYPTO_ECB=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y CONFIG_CRYPTO_HASH_INFO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_HW=y CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y CONFIG_CRYPTO_LIB_DES=y CONFIG_CRYPTO_LIB_SHA256=y CONFIG_CRYPTO_LZO=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_RNG_DEFAULT=y CONFIG_CRYPTO_SEQIV=y +CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA256_ARM=y CONFIG_CRYPTO_SIMD=y @@ -143,6 +138,7 @@ CONFIG_DEBUG_MISC=y CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y CONFIG_DMA_OF=y +CONFIG_DMA_OPS=y CONFIG_DMA_REMAP=y CONFIG_DMA_SHARED_BUFFER=y CONFIG_DMA_VIRTUAL_CHANNELS=y @@ -163,6 +159,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CPU_AUTOPROBE=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 @@ -180,11 +177,12 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_VDSO_32=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_74X164=y CONFIG_GPIO_WATCHDOG=y -# CONFIG_GPIO_WATCHDOG_ARCH_INITCALL is not set +CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y @@ -193,7 +191,7 @@ CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y CONFIG_HAVE_SMP=y CONFIG_HIGHMEM=y -# CONFIG_HIGHPTE is not set +CONFIG_HIGHPTE=y CONFIG_HWSPINLOCK=y CONFIG_HWSPINLOCK_QCOM=y CONFIG_HW_RANDOM=y @@ -203,6 +201,7 @@ CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y CONFIG_I2C_CHARDEV=y CONFIG_I2C_HELPER_AUTO=y +# CONFIG_I2C_QCOM_CCI is not set CONFIG_I2C_QUP=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_IOMMU_DEBUGFS is not set @@ -210,13 +209,16 @@ CONFIG_INITRAMFS_SOURCE="" # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y CONFIG_IO_URING=y +# CONFIG_IPQ_APSS_PLL is not set CONFIG_IPQ_GCC_4019=y +# CONFIG_IPQ_GCC_6018 is not set # CONFIG_IPQ_GCC_806X is not set # CONFIG_IPQ_GCC_8074 is not set # CONFIG_IPQ_LCC_806X is not set CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FASTEOI_HIERARCHY_HANDLERS=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y # CONFIG_KPSS_XCC is not set @@ -224,6 +226,8 @@ CONFIG_IRQ_WORK=y CONFIG_LEDS_LP5523=y CONFIG_LEDS_LP5562=y CONFIG_LEDS_LP55XX_COMMON=y +CONFIG_LEDS_TLC591XX=y +CONFIG_LED_TRIGGER_PHY=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LOCK_SPIN_ON_OWNER=y @@ -232,11 +236,13 @@ CONFIG_LZO_DECOMPRESS=y CONFIG_MDIO_BITBANG=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y CONFIG_MDIO_GPIO=y CONFIG_MDIO_IPQ4019=y # CONFIG_MDM_GCC_9615 is not set # CONFIG_MDM_LCC_9615 is not set CONFIG_MEMFD_CREATE=y +# CONFIG_MFD_HI6421_SPMI is not set # CONFIG_MFD_QCOM_RPM is not set # CONFIG_MFD_SPMI_PMIC is not set CONFIG_MFD_SYSCON=y @@ -244,6 +250,7 @@ CONFIG_MIGHT_HAVE_CACHE_L2X0=y CONFIG_MIGRATION=y CONFIG_MMC=y CONFIG_MMC_BLOCK=y +CONFIG_MMC_CQHCI=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_IO_ACCESSORS=y CONFIG_MMC_SDHCI_MSM=y @@ -252,17 +259,21 @@ CONFIG_MMC_SDHCI_PLTFM=y CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MSM_GCC_8660 is not set # CONFIG_MSM_GCC_8916 is not set +# CONFIG_MSM_GCC_8939 is not set # CONFIG_MSM_GCC_8960 is not set # CONFIG_MSM_GCC_8974 is not set # CONFIG_MSM_GCC_8994 is not set # CONFIG_MSM_GCC_8996 is not set # CONFIG_MSM_GCC_8998 is not set +# CONFIG_MSM_GPUCC_8998 is not set # CONFIG_MSM_LCC_8960 is not set # CONFIG_MSM_MMCC_8960 is not set # CONFIG_MSM_MMCC_8974 is not set # CONFIG_MSM_MMCC_8996 is not set +# CONFIG_MSM_MMCC_8998 is not set CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_NAND_CORE=y +CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_ECC_SW_BCH=y CONFIG_MTD_NAND_ECC_SW_HAMMING=y CONFIG_MTD_NAND_QCOM=y @@ -287,6 +298,7 @@ CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_IDLE=y CONFIG_NR_CPUS=4 CONFIG_NVMEM=y +# CONFIG_NVMEM_SPMI_SDAM is not set CONFIG_NVMEM_SYSFS=y CONFIG_OF=y CONFIG_OF_ADDRESS=y @@ -320,21 +332,27 @@ CONFIG_PHYLIB=y # CONFIG_PHY_QCOM_APQ8064_SATA is not set CONFIG_PHY_QCOM_IPQ4019_USB=y # CONFIG_PHY_QCOM_IPQ806X_SATA is not set +# CONFIG_PHY_QCOM_IPQ806X_USB is not set # CONFIG_PHY_QCOM_PCIE2 is not set # CONFIG_PHY_QCOM_QMP is not set # CONFIG_PHY_QCOM_QUSB2 is not set -# CONFIG_PHY_QCOM_UFS is not set +# CONFIG_PHY_QCOM_USB_HS_28NM is not set +# CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2 is not set +# CONFIG_PHY_QCOM_USB_SS is not set CONFIG_PINCTRL=y # CONFIG_PINCTRL_APQ8064 is not set # CONFIG_PINCTRL_APQ8084 is not set CONFIG_PINCTRL_IPQ4019=y +# CONFIG_PINCTRL_IPQ6018 is not set # CONFIG_PINCTRL_IPQ8064 is not set # CONFIG_PINCTRL_IPQ8074 is not set # CONFIG_PINCTRL_MDM9615 is not set CONFIG_PINCTRL_MSM=y +# CONFIG_PINCTRL_MSM8226 is not set # CONFIG_PINCTRL_MSM8660 is not set # CONFIG_PINCTRL_MSM8916 is not set # CONFIG_PINCTRL_MSM8960 is not set +# CONFIG_PINCTRL_MSM8976 is not set # CONFIG_PINCTRL_MSM8994 is not set # CONFIG_PINCTRL_MSM8996 is not set # CONFIG_PINCTRL_MSM8998 is not set @@ -345,42 +363,32 @@ CONFIG_PINCTRL_MSM=y # CONFIG_PINCTRL_SDM660 is not set # CONFIG_PINCTRL_SDM845 is not set # CONFIG_PINCTRL_SM8150 is not set +# CONFIG_PINCTRL_SM8250 is not set CONFIG_PM_OPP=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_MSM=y +CONFIG_POWER_RESET_GPIO_RESTART=y CONFIG_POWER_SUPPLY=y CONFIG_PPS=y CONFIG_PRINTK_TIME=y -CONFIG_PSTORE=y -# CONFIG_PSTORE_842_COMPRESS is not set -CONFIG_PSTORE_COMPRESS=y -CONFIG_PSTORE_COMPRESS_DEFAULT="deflate" -# CONFIG_PSTORE_CONSOLE is not set -CONFIG_PSTORE_DEFLATE_COMPRESS=y -CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT=y -# CONFIG_PSTORE_LZ4HC_COMPRESS is not set -# CONFIG_PSTORE_LZ4_COMPRESS is not set -# CONFIG_PSTORE_LZO_COMPRESS is not set -# CONFIG_PSTORE_PMSG is not set -CONFIG_PSTORE_RAM=y -# CONFIG_PSTORE_ZSTD_COMPRESS is not set CONFIG_PTP_1588_CLOCK=y CONFIG_QCA807X_PHY=y CONFIG_QCOM_A53PLL=y CONFIG_QCOM_BAM_DMA=y # CONFIG_QCOM_COMMAND_DB is not set +# CONFIG_QCOM_CPR is not set # CONFIG_QCOM_EBI2 is not set # CONFIG_QCOM_GENI_SE is not set # CONFIG_QCOM_GSBI is not set # CONFIG_QCOM_HFPLL is not set # CONFIG_QCOM_IOMMU is not set # CONFIG_QCOM_LLCC is not set +# CONFIG_QCOM_OCMEM is not set # CONFIG_QCOM_PDC is not set -CONFIG_QCOM_PM=y CONFIG_QCOM_QFPROM=y # CONFIG_QCOM_RMTFS_MEM is not set +# CONFIG_QCOM_RPMH is not set CONFIG_QCOM_SCM=y -CONFIG_QCOM_SCM_32=y # CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set CONFIG_QCOM_SMEM=y # CONFIG_QCOM_SMSM is not set @@ -389,23 +397,18 @@ CONFIG_QCOM_TCSR=y # CONFIG_QCOM_TSENS is not set CONFIG_QCOM_WDT=y # CONFIG_QCS_GCC_404 is not set +# CONFIG_QCS_Q6SSTOP_404 is not set # CONFIG_QCS_TURING_404 is not set -# CONFIG_QRTR is not set CONFIG_RAS=y CONFIG_RATIONAL=y -CONFIG_RCU_CPU_STALL_TIMEOUT=21 -CONFIG_RCU_NEED_SEGCBLIST=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_REED_SOLOMON=y -CONFIG_REED_SOLOMON_DEC8=y -CONFIG_REED_SOLOMON_ENC8=y -CONFIG_REFCOUNT_FULL=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y +# CONFIG_REGULATOR_QCOM_LABIBB is not set # CONFIG_REGULATOR_QCOM_SPMI is not set +# CONFIG_REGULATOR_QCOM_USB_VBUS is not set CONFIG_REGULATOR_VCTRL=y CONFIG_REGULATOR_VQMMC_IPQ4019=y CONFIG_RESET_CONTROLLER=y @@ -417,6 +420,12 @@ CONFIG_RTC_CLASS=y CONFIG_RTC_I2C_AND_SPI=y CONFIG_RTC_MC146818_LIB=y CONFIG_RWSEM_SPIN_ON_OWNER=y +# CONFIG_SC_DISPCC_7180 is not set +# CONFIG_SC_GCC_7180 is not set +# CONFIG_SC_GPUCC_7180 is not set +# CONFIG_SC_LPASS_CORECC_7180 is not set +# CONFIG_SC_MSS_7180 is not set +# CONFIG_SC_VIDEOCC_7180 is not set # CONFIG_SDM_CAMCC_845 is not set # CONFIG_SDM_DISPCC_845 is not set # CONFIG_SDM_GCC_660 is not set @@ -432,6 +441,11 @@ CONFIG_SGL_ALLOC=y CONFIG_SMP=y CONFIG_SMP_ON_UP=y # CONFIG_SM_GCC_8150 is not set +# CONFIG_SM_GCC_8250 is not set +# CONFIG_SM_GPUCC_8150 is not set +# CONFIG_SM_GPUCC_8250 is not set +# CONFIG_SM_VIDEOCC_8150 is not set +# CONFIG_SM_VIDEOCC_8250 is not set CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_BITBANG=y @@ -440,6 +454,7 @@ CONFIG_SPI_MASTER=y CONFIG_SPI_MEM=y CONFIG_SPI_QUP=y CONFIG_SPMI=y +# CONFIG_SPMI_HISI3670 is not set CONFIG_SPMI_MSM_PMIC_ARB=y # CONFIG_SPMI_PMIC_CLKDIV is not set CONFIG_SRCU=y @@ -460,7 +475,6 @@ CONFIG_TIMER_PROBE=y CONFIG_TREE_RCU=y CONFIG_TREE_SRCU=y CONFIG_UBIFS_FS=y -# CONFIG_UCLAMP_TASK is not set CONFIG_UEVENT_HELPER_PATH="" CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y diff --git a/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c b/target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.c similarity index 96% rename from target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c rename to target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.c index 369124a27..d5ef7af15 100644 --- a/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c +++ b/target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.c @@ -13,6 +13,7 @@ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include #include #include @@ -82,8 +83,6 @@ static const struct ar40xx_mib_desc ar40xx_mibs[] = { MIB_DESC(1, AR40XX_STATS_TXLATECOL, "TxLateCol"), }; -static const int ar40xx_mibs_rx_tx[] = { 15, 31 }; - static u32 ar40xx_read(struct ar40xx_priv *priv, int reg) { @@ -432,36 +431,6 @@ ar40xx_mib_fetch_port_stat(struct ar40xx_priv *priv, int port, bool flush) } } -/* similar to ar40xx_mib_fetch_port_stat, but only fetch RXGOODBYTE and TXBYTE */ -static void -ar40xx_mib_fetch_port_stat_rx_tx(struct ar40xx_priv *priv, int port) -{ - unsigned int base; - u64 *mib_stats; - int j; - u32 num_mibs = ARRAY_SIZE(ar40xx_mibs); - - WARN_ON(port >= priv->dev.ports); - - lockdep_assert_held(&priv->mib_lock); - - base = AR40XX_REG_PORT_STATS_START + - AR40XX_REG_PORT_STATS_LEN * port; - - mib_stats = &priv->mib_stats[port * num_mibs]; - for (j = 0; j < ARRAY_SIZE(ar40xx_mibs_rx_tx); j++) { - const int i = ar40xx_mibs_rx_tx[j]; - const struct ar40xx_mib_desc *mib; - u64 t; - - mib = &ar40xx_mibs[i]; - t = ar40xx_read(priv, base + mib->offset); - t |= ar40xx_read(priv, base + mib->offset + 4) << 32; - - mib_stats[i] += t; - } -} - static int ar40xx_mib_capture(struct ar40xx_priv *priv) { @@ -803,36 +772,6 @@ ar40xx_sw_get_port_link(struct switch_dev *dev, int port, return 0; } -static int -ar40xx_sw_get_port_stats(struct switch_dev *dev, int port, - struct switch_port_stats *stats) -{ - struct ar40xx_priv *priv = swdev_to_ar40xx(dev); - u32 num_mibs = ARRAY_SIZE(ar40xx_mibs); - u64 *mib_stats; - int ret = 0; - static int last_port = AR40XX_NUM_PORTS - 1; - - mutex_lock(&priv->mib_lock); - - /* Avoid unnecessary capture */ - if (last_port >= port) { - ret = ar40xx_mib_capture(priv); - if (ret) - goto unlock; - } - last_port = port; - - ar40xx_mib_fetch_port_stat_rx_tx(priv, port); - - mib_stats = &priv->mib_stats[port * num_mibs]; - stats->rx_bytes = mib_stats[ar40xx_mibs_rx_tx[0]]; - stats->tx_bytes = mib_stats[ar40xx_mibs_rx_tx[1]]; -unlock: - mutex_unlock(&priv->mib_lock); - return ret; -} - static const struct switch_attr ar40xx_sw_attr_globals[] = { { .type = SWITCH_TYPE_INT, @@ -997,6 +936,7 @@ ar40xx_malibu_psgmii_ess_reset(struct ar40xx_priv *priv) */ mdelay(2); } + mdelay(50); /*check malibu psgmii calibration done end..*/ @@ -1015,6 +955,7 @@ ar40xx_malibu_psgmii_ess_reset(struct ar40xx_priv *priv) /* Polling interval to check PSGMII PLL in ESS is ready */ mdelay(2); } + mdelay(50); /* check dakota psgmii calibration done end..*/ @@ -1022,6 +963,7 @@ ar40xx_malibu_psgmii_ess_reset(struct ar40xx_priv *priv) mdiobus_write(bus, 5, 0x1a, 0x3230); /* release phy psgmii RX 20bit */ mdiobus_write(bus, 5, 0x0, 0x005f); + mdelay(200); } static void @@ -1260,8 +1202,7 @@ ar40xx_init_port(struct ar40xx_priv *priv, int port) { u32 t; - ar40xx_rmw(priv, AR40XX_REG_PORT_STATUS(port), - AR40XX_PORT_AUTO_LINK_EN, 0); + ar40xx_write(priv, AR40XX_REG_PORT_STATUS(port), 0); ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0); @@ -1398,13 +1339,13 @@ ar40xx_sw_mac_polling_task(struct ar40xx_priv *priv) for (i = 1; i < AR40XX_NUM_PORTS; ++i) { port_phy_status[i] = mdiobus_read(bus, i-1, AR40XX_PHY_SPEC_STATUS); - speed = link = duplex = port_phy_status[i]; - speed &= AR40XX_PHY_SPEC_STATUS_SPEED; - speed >>= 14; - link &= AR40XX_PHY_SPEC_STATUS_LINK; - link >>= 10; - duplex &= AR40XX_PHY_SPEC_STATUS_DUPLEX; - duplex >>= 13; + + speed = FIELD_GET(AR40XX_PHY_SPEC_STATUS_SPEED, + port_phy_status[i]); + link = FIELD_GET(AR40XX_PHY_SPEC_STATUS_LINK, + port_phy_status[i]); + duplex = FIELD_GET(AR40XX_PHY_SPEC_STATUS_DUPLEX, + port_phy_status[i]); if (link != priv->ar40xx_port_old_link[i]) { ++link_cnt[i]; @@ -1786,7 +1727,6 @@ static const struct switch_dev_ops ar40xx_sw_ops = { .apply_config = ar40xx_sw_hw_apply, .reset_switch = ar40xx_sw_reset_switch, .get_port_link = ar40xx_sw_get_port_link, - .get_port_stats = ar40xx_sw_get_port_stats, }; /* Platform driver probe function */ diff --git a/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.h b/target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.h similarity index 98% rename from target/linux/ipq40xx/files/drivers/net/phy/ar40xx.h rename to target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.h index 722bf6ae4..7ba40ccf7 100644 --- a/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.h +++ b/target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.h @@ -151,6 +151,9 @@ struct ar40xx_mib_desc { #define AR40XX_MIB_FUNC_NO_OP 0x0 #define AR40XX_MIB_FUNC_FLUSH 0x1 +#define AR40XX_ESS_SERVICE_TAG 0x48 +#define AR40XX_ESS_SERVICE_TAG_STAG BIT(17) + #define AR40XX_REG_PORT_STATUS(_i) (0x07c + (_i) * 4) #define AR40XX_PORT_SPEED BITS(0, 2) #define AR40XX_PORT_STATUS_SPEED_S 0 @@ -179,6 +182,8 @@ struct ar40xx_mib_desc { #define AR40XX_PORT_VLAN0_DEF_CVID_S 16 #define AR40XX_REG_PORT_VLAN1(_i) (0x424 + (_i) * 0x8) +#define AR40XX_PORT_VLAN1_CORE_PORT BIT(9) +#define AR40XX_PORT_VLAN1_PORT_TLS_MODE BIT(7) #define AR40XX_PORT_VLAN1_PORT_VLAN_PROP BIT(6) #define AR40XX_PORT_VLAN1_OUT_MODE BITS(12, 2) #define AR40XX_PORT_VLAN1_OUT_MODE_S 12 diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts index 6430e2a08..f571da510 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts @@ -134,7 +134,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio54"; @@ -175,6 +174,22 @@ status = "okay"; }; +&gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <2 0x20>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + &usb2_hs_phy { status = "okay"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts index f87514821..b2d8aa499 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts @@ -211,6 +211,17 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; partition@180000 { @@ -266,6 +277,22 @@ #gpio-cells = <2>; }; +&gmac0 { + qcom,forced_duplex = <1>; + qcom,forced_speed = <1000>; + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + vlan_tag = <1 0x10>; +}; + +&gmac1 { + qcom,forced_duplex = <1>; + qcom,forced_speed = <1000>; + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + vlan_tag = <2 0x20>; +}; + &tlmm { i2c0_pins: i2c0_pinmux { mux_i2c { @@ -326,9 +353,13 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; }; &wifi1 { status = "okay"; qcom,ath10k-calibration-variant = "ALFA-Network-AP120C-AC"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cap-ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cap-ac.dts new file mode 100644 index 000000000..b18ba4d46 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cap-ac.dts @@ -0,0 +1,249 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2020, Robert Marko */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "MikroTik cAP ac"; + compatible = "mikrotik,cap-ac"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x08000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + qcom,poll_required = <0>; + qcom,num_gmac = <1>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + mode { + label = "mode"; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "blue:power"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + }; + + led_user: user { + label = "green:user"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + + wlan2g { + label = "green:wlan2g"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + }; + + eth1 { + label = "green:eth1"; + gpios = <ðphy4 1 GPIO_ACTIVE_HIGH>; + }; + + eth2 { + label = "green:eth2"; + gpios = <ðphy3 1 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <2>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Qualcomm"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + label = "RouterBoot"; + reg = <0x80000 0x80000>; + + hard_config { + read-only; + }; + + dtb_config { + read-only; + }; + + soft_config { + }; + }; + + partition@100000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x100000 0xf00000>; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + +&gmac0 { + vlan_tag = <0 0x3f>; +}; + +ðphy3 { + gpio-controller; + #gpio-cells = <2>; +}; + +ðphy4 { + gpio-controller; + #gpio-cells = <2>; +}; + +&wifi0 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-cAP-ac"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-cAP-ac"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts index 20a8de4a4..52311755b 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts @@ -134,7 +134,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio54"; @@ -211,6 +210,26 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; partition9@580000 { @@ -235,9 +254,23 @@ &wifi0 { status = "okay"; qcom,ath10k-calibration-variant = "ezviz-cs-w3-wd1200g-eup"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; }; &wifi1 { status = "okay"; qcom,ath10k-calibration-variant = "ezviz-cs-w3-wd1200g-eup"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; +}; + +&gmac0 { + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_art_6>; +}; + +&gmac1 { + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_art_0>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts index 3e2b75c10..e3afddb37 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts @@ -109,79 +109,66 @@ reg = <0x0 0x40000>; read-only; }; - partition@40000 { label = "MIBIB"; reg = <0x40000 0x20000>; read-only; }; - partition@60000 { label = "QSEE"; reg = <0x60000 0x60000>; read-only; }; - partition@c0000 { label = "CDT"; reg = <0xc0000 0x10000>; read-only; }; - partition@d0000 { label = "DDRPARAMS"; reg = <0xd0000 0x10000>; read-only; }; - partition@e0000 { label = "APPSBLENV"; reg = <0xe0000 0x10000>; read-only; }; - partition@f0000 { label = "APPSBL"; reg = <0xf0000 0x80000>; read-only; }; - partition@170000 { label = "ART"; reg = <0x170000 0x10000>; read-only; }; - partition@180000 { compatible = "wrg"; label = "firmware"; reg = <0x180000 0xdc0000>; }; - partition@fb0000 { label = "rgbd"; reg = <0xfb0000 0x10000>; read-only; }; - partition@fc0000 { label = "bdcfg"; reg = <0xfc0000 0x10000>; read-only; }; - partition@fd0000 { label = "langpack"; reg = <0xfd0000 0x20000>; read-only; }; - partition@ff0000 { label = "certificate"; reg = <0xff0000 0x10000>; read-only; }; - partition@f40000 { label = "captival"; reg = <0xf40000 0x70000>; @@ -233,7 +220,6 @@ drive-strength = <12>; bias-disable; }; - mux_cs { function = "gpio"; pins = "gpio54"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts index c3e1d8fa3..a99aa90b6 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts @@ -116,15 +116,18 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; qcom,ath10k-calibration-variant = "linksys-ea6350v3"; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; qcom,ath10k-calibration-variant = "linksys-ea6350v3"; }; - &blsp_dma { status = "okay"; }; @@ -178,53 +181,55 @@ reg = <0x00000000 0x00040000>; read-only; }; - MBIB@40000 { label = "MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - QSEE@60000 { label = "QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - CDT@c0000 { label = "CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - APPSBLENV@d0000 { label = "APPSBLENV"; reg = <0x000d0000 0x00010000>; read-only; }; - APPSBL@e0000 { label = "APPSBL"; /* uboot */ reg = <0x000e0000 0x00080000>; read-only; }; - ART@160000 { label = "ART"; reg = <0x00160000 0x00010000>; read-only; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; u_env@170000 { label = "u_env"; reg = <0x00170000 0x00020000>; }; - s_env@190000 { label = "s_env"; reg = <0x00190000 0x00020000>; }; - devinfo@1b0000 { label = "devinfo"; reg = <0x001b0000 0x00010000>; @@ -248,27 +253,22 @@ label = "kernel"; reg = <0x00000000 0x02800000>; }; - rootfs@300000 { label = "rootfs"; reg = <0x00300000 0x02500000>; }; - alt_kernel@2800000 { label = "alt_kernel"; reg = <0x02800000 0x02800000>; }; - alt_rootfs@2b00000 { label = "alt_rootfs"; reg = <0x02b00000 0x02500000>; }; - sysdiag@5000000 { label = "sysdiag"; reg = <0x05000000 0x00100000>; }; - syscfg@5100000 { label = "syscfg"; reg = <0x05100000 0x02F00000>; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts index 4daf58a03..6a7f4e5b0 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts @@ -120,7 +120,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio54"; @@ -155,60 +154,61 @@ reg = <0x00000000 0x00040000>; read-only; }; - partition1@40000 { label = "0:MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - partition2@60000 { label = "0:QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - partition3@c0000 { label = "0:CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - partition4@d0000 { label = "0:DDRPARAMS"; reg = <0x000d0000 0x00010000>; read-only; }; - partition5@e0000 { label = "0:APPSBLENV"; reg = <0x000e0000 0x00010000>; read-only; }; - partition6@f0000 { label = "0:APPSBL"; reg = <0x000f0000 0x00090000>; read-only; }; - partition7@180000 { label = "0:ART"; reg = <0x00180000 0x00010000>; read-only; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; partition8@190000 { compatible = "denx,fit"; label = "firmware"; reg = <0x190000 0x1dc0000>; }; - partition9@1f50000 { label = "u-boot-env"; reg = <0x01f50000 0x00010000>; }; - partition10@1f60000 { label = "userconfig"; reg = <0x01f60000 0x000a0000>; @@ -227,12 +227,24 @@ status = "okay"; }; +&gmac0 { + vlan_tag = <2 0x20>; +}; + +&gmac1 { + vlan_tag = <1 0x10>; +}; + &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; qcom,ath10k-calibration-variant = "EnGenius-EAP1300"; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; qcom,ath10k-calibration-variant = "EnGenius-EAP1300"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts new file mode 100644 index 000000000..6f4d7b5f3 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts @@ -0,0 +1,337 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Edgecore ECW5211"; + compatible = "edgecore,ecw5211"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &gmac0; + }; + + chosen { + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "yellow:power"; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "green:wlan2g"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + phys = <&usb3_hs_phy>; + phy-names = "usb2-phy"; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + + switch_lan_bmp = <0x10>; + switch_wan_bmp = <0x20>; + }; + + edma@c080000 { + status = "okay"; + }; + }; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + mux_mdio { + pins = "gpio53"; + function = "mdio"; + bias-pull-up; + }; + + mux_mdc { + pins = "gpio52"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi0_pins: spi0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <2>; + bias-disable; + }; + + pin_cs { + function = "gpio"; + pins = "gpio54", "gpio4"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + i2c0_pins: i2c0_pinmux { + mux_i2c { + function = "blsp_i2c0"; + pins = "gpio58", "gpio59"; + drive-strength = <16>; + bias-disable; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, <&tlmm 4 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; /* uboot env */ + reg = <0x000e0000 0x00010000>; + }; + + partition@f0000 { + label = "0:APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + + partition@170000 { + label = "0:ART"; + reg = <0x00170000 0x00010000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + }; + }; + + flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "rootfs"; + reg = <0x00000000 0x04000000>; + }; + }; + }; +}; + +&blsp1_i2c3 { + status = "okay"; + + pinctrl-0 = <&i2c0_pins>; + pinctrl-names = "default"; + + tpm@29 { + compatible = "atmel,at97sc3204t"; + reg = <0x29>; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; +}; + +&gmac0 { + qcom,poll_required = <1>; + qcom,phy_mdio_addr = <4>; + vlan_tag = <2 0x20>; +}; + +&gmac1 { + qcom,poll_required = <1>; + qcom,phy_mdio_addr = <3>; + vlan_tag = <1 0x10>; +}; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; +}; + +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; + qcom,ath10k-calibration-variant = "ALFA-Network-AP120C-AC"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts index 32b8f453e..b40586713 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts @@ -155,55 +155,46 @@ reg = <0x00000000 0x00040000>; read-only; }; - partition1@40000 { label = "0:MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - partition2@60000 { label = "0:QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - partition3@c0000 { label = "0:CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - partition4@d0000 { label = "0:DDRPARAMS"; reg = <0x000d0000 0x00010000>; read-only; }; - partition5@e0000 { label = "0:APPSBLENV"; reg = <0x000e0000 0x00010000>; read-only; }; - partition6@f0000 { label = "0:APPSBL"; reg = <0x000f0000 0x00080000>; read-only; }; - partition7@170000 { label = "0:ART"; reg = <0x00170000 0x00010000>; read-only; }; - partition8@180000 { label = "userconfig"; reg = <0x00180000 0x00080000>; read-only; }; - partition9@200000 { compatible = "denx,fit"; label = "firmware"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts index 1f6cc43c3..848e5c236 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts @@ -119,7 +119,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio54"; @@ -154,55 +153,46 @@ reg = <0x00000000 0x00040000>; read-only; }; - partition@40000 { label = "0:MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - partition@60000 { label = "0:QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - partition@c0000 { label = "0:CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - partition@d0000 { label = "0:DDRPARAMS"; reg = <0x000d0000 0x00010000>; read-only; }; - partition@e0000 { label = "0:APPSBLENV"; reg = <0x000e0000 0x00010000>; read-only; }; - partition@f0000 { label = "0:APPSBL"; reg = <0x000f0000 0x00080000>; read-only; }; - partition@170000 { label = "0:ART"; reg = <0x00170000 0x00010000>; read-only; }; - partition@180000 { label = "userconfig"; reg = <0x00180000 0x00080000>; read-only; }; - partition@200000 { compatible = "denx,fit"; label = "firmware"; @@ -222,6 +212,14 @@ status = "okay"; }; +&gmac0 { + vlan_tag = <1 0x10>; +}; + +&gmac1 { + vlan_tag = <2 0x20>; +}; + &usb2_hs_phy { status = "okay"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts index 60f8cbc0d..b765d68b5 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts @@ -177,67 +177,56 @@ reg = <0x00000000 0x00040000>; read-only; }; - partition@40000 { label = "MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - partition@60000 { label = "QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - partition@c0000 { label = "CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - partition@d0000 { label = "DDRPARAMS"; reg = <0x000d0000 0x00010000>; read-only; }; - partition@e0000 { label = "APPSBLENV"; /* uboot env*/ reg = <0x000e0000 0x00010000>; read-only; }; - partition@f0000 { label = "APPSBL"; /* uboot */ reg = <0x000f0000 0x00090000>; read-only; }; - partition@180000 { label = "ART"; reg = <0x00180000 0x00010000>; read-only; }; - partition@190000 { compatible = "denx,fit"; label = "firmware"; reg = <0x00190000 0x14d0000>; }; - partition@1660000 { label = "failsafe"; reg = <0x01660000 0x008F0000>; read-only; }; - partition@1f50000 { label = "u-boot-env"; reg = <0x01f50000 0x00010000>; read-only; }; - partition@1f60000 { label = "userconfig"; reg = <0x01f60000 0x000a0000>; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6100v2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6100v2.dts index 2b93dcbb9..1495c64da 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6100v2.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6100v2.dts @@ -16,8 +16,6 @@ */ #include "qcom-ipq4018-ex61x0v2.dtsi" -#include -#include / { model = "Netgear EX6100v2"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6150v2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6150v2.dts index f1c44c1ae..ce24466e5 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6150v2.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6150v2.dts @@ -16,8 +16,6 @@ */ #include "qcom-ipq4018-ex61x0v2.dtsi" -#include -#include / { model = "Netgear EX6150v2"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi index 56cd0e4c8..eb97130c2 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi @@ -43,12 +43,6 @@ qcom,wifi_glb_cfg = ; }; - tcsr@194b000 { - compatible = "qcom,tcsr"; - reg = <0x194b000 0x100>; - qcom,usb-hsphy-mode-select = ; - }; - ess_tcsr@1953000 { compatible = "qcom,tcsr"; reg = <0x1953000 0x1000>; @@ -61,14 +55,6 @@ qcom,wifi_noc_memtype_m0_m2 = ; }; - usb2@60f8800 { - status = "okay"; - }; - - usb3@8af8800 { - status = "okay"; - }; - crypto@8e3a000 { status = "okay"; }; @@ -196,7 +182,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio54"; @@ -216,7 +201,7 @@ mx25l12805d@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <24000000>; + spi-max-frequency = <45000000>; partitions { compatible = "fixed-partitions"; @@ -268,7 +253,18 @@ partition7@170000 { label = "ART"; reg = <0x00170000 0x00010000>; + compatible = "nvmem-cells"; read-only; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; partition8@180000 { @@ -284,9 +280,21 @@ }; partition10@1a0000 { + compatible = "nvmem-cells"; label = "dnidata"; reg = <0x001a0000 0x00010000>; read-only; + + #address-cells = <1>; + #size-cells = <1>; + + macaddr_dnidata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_dnidata_c: macaddr@c { + reg = <0xc 0x6>; + }; }; partition11@1b0000 { @@ -320,8 +328,12 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_dnidata_0>; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_dnidata_c>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6200v2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6200v2.dts deleted file mode 100644 index c43eb7206..000000000 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex6200v2.dts +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * Copyright (c) 2018, David Bauer - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -#include "qcom-ipq4018-ex61x0v2.dtsi" -#include -#include - -/ { - model = "Netgear EX6200v2"; - compatible = "netgear,ex6200v2"; -}; - -&usb3_ss_phy { - status = "okay"; -}; - -&usb3_hs_phy { - status = "okay"; -}; - -&usb2_hs_phy { - status = "okay"; -}; - -&wifi0 { - qcom,ath10k-calibration-variant = "Netgear-EX6150v2"; -}; - -&wifi1 { - qcom,ath10k-calibration-variant = "Netgear-EX6150v2"; -}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts index 1804ac382..77b1810f0 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts @@ -189,74 +189,62 @@ reg = <0x00000000 0x00040000>; read-only; }; - partition1@40000 { label = "MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - partition2@60000 { label = "QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - partition3@c0000 { label = "CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - partition4@d0000 { label = "DDRPARAMS"; reg = <0x000d0000 0x00010000>; read-only; }; - partition5@e0000 { label = "APPSBLENV"; /* uboot env - empty */ reg = <0x000e0000 0x00010000>; read-only; }; - partition6@f0000 { label = "urlader"; /* APPSBL */ reg = <0x000f0000 0x0002dc000>; read-only; }; - partition7@11dc00 { /* make a backup of this partition! */ label = "urlader_config"; reg = <0x0011dc00 0x00002400>; read-only; }; - partition8@120000 { label = "tffs1"; reg = <0x00120000 0x00080000>; read-only; }; - partition9@1a0000 { label = "tffs2"; reg = <0x001a0000 0x00080000>; read-only; }; - partition10@220000 { label = "uboot"; reg = <0x00220000 0x00080000>; read-only; }; - partition11@2A0000 { compatible = "denx,fit"; label = "firmware"; reg = <0x002a0000 0x01c60000>; }; - partition12@1f00000 { label = "jffs2"; reg = <0x01f00000 0x00100000>; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts similarity index 78% rename from target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts rename to target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts index a6e8feedb..b96f014dd 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts @@ -6,14 +6,20 @@ #include / { - model = "GL.iNet GL-A1300"; - compatible = "glinet,gl-a1300", "qcom,ipq4019"; + model = "GL.iNet GL-AP1300"; + compatible = "glinet,gl-ap1300"; aliases { - led-boot = &led_run; - led-failsafe = &led_run; - led-running = &led_run; - led-upgrade = &led_run; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &gmac0; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; }; chosen { @@ -40,6 +46,7 @@ }; tcsr@194b000 { + /* select hostmode */ compatible = "qcom,tcsr"; reg = <0x194b000 0x100>; qcom,usb-hsphy-mode-select = ; @@ -93,35 +100,20 @@ gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; linux,code = ; }; - - switch { - label = "switch-button"; - gpios = <&tlmm 0 GPIO_ACTIVE_LOW>; - linux,code = ; - }; }; leds { compatible = "gpio-leds"; - led_run: blue { - label = "blue:status"; + led_power: power { + label = "green:power"; gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + default-state = "on"; }; - white { - label = "white:status"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; - }; - }; - - gpio_export { - compatible = "gpio-export"; - - usb { - gpio-export,name = "usb_power"; - gpio-export,output = <1>; - gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>; + wan { + label = "green:wan"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; }; }; }; @@ -142,6 +134,8 @@ cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, <&tlmm 5 GPIO_ACTIVE_HIGH>; flash@0 { + status = "okay"; + compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <24000000>; @@ -197,6 +191,8 @@ reg = <0x00170000 0x00010000>; read-only; compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; precal_art_1000: precal@1000 { reg = <0x1000 0x2f20>; @@ -205,24 +201,13 @@ precal_art_5000: precal@5000 { reg = <0x5000 0x2f20>; }; - - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; - }; - }; - - partition@180000 { - label = "log"; - reg = <0x00180000 0x00020000>; }; }; }; spi-nand@1 { + status = "okay"; + compatible = "spi-nand"; reg = <1>; spi-max-frequency = <24000000>; @@ -255,14 +240,6 @@ }; }; - i2c_0_pins: i2c_0_pinmux { - pinmux { - pins = "gpio58", "gpio59"; - function = "blsp_i2c0"; - bias-disable; - }; - }; - spi0_pins: spi0_pinmux { mux_spi { function = "blsp_spi0"; @@ -281,12 +258,6 @@ }; }; -&blsp1_i2c3 { - pinctrl-0 = <&i2c_0_pins>; - pinctrl-names = "default"; - status = "okay"; -}; - &usb2_hs_phy { status = "okay"; }; @@ -301,10 +272,14 @@ &wifi0 { status = "okay"; - qcom,ath10k-calibration-variant = "GL-A1300"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; + qcom,ath10k-calibration-variant = "GL-AP1300"; }; &wifi1 { status = "okay"; - qcom,ath10k-calibration-variant = "GL-A1300"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; + qcom,ath10k-calibration-variant = "GL-AP1300"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts new file mode 100644 index 000000000..b5818cef3 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts @@ -0,0 +1,272 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2020, Robert Marko */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "MikroTik hAP ac2"; + compatible = "mikrotik,hap-ac2"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x08000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + phys = <&usb3_hs_phy>; + phy-names = "usb2-phy"; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + mode { + label = "mode"; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "green:power"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + panic-indicator; + }; + + led_user: user { + label = "green:user"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <2>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + enable-usb-power { + gpio-hog; + gpios = <2 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "enable USB power"; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Qualcomm"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + label = "RouterBoot"; + reg = <0x80000 0x80000>; + + hard_config { + read-only; + size = <0x2000>; + }; + + dtb_config { + read-only; + }; + + soft_config { + }; + }; + + partition@100000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x100000 0xf00000>; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + +ðphy0 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy1 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy2 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy3 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy4 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +&wifi0 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-hAP-ac2"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-hAP-ac2"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi index 2da5b0aa9..da09e53cc 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi @@ -195,6 +195,17 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; @@ -230,15 +241,31 @@ status = "okay"; }; +&gmac0 { + qcom,poll_required = <1>; + qcom,poll_required_dynamic = <1>; + qcom,phy_mdio_addr = <3>; + vlan_tag = <1 0x10>; +}; + +&gmac1 { + qcom,poll_required = <1>; + qcom,poll_required_dynamic = <1>; + qcom,phy_mdio_addr = <4>; + vlan_tag = <2 0x20>; +}; + &wifi0 { status = "okay"; - + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; qcom,ath10k-calibration-variant = "8devices-Jalapeno"; }; &wifi1 { status = "okay"; - + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; qcom,ath10k-calibration-variant = "8devices-Jalapeno"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-magic-2-wifi-next.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-magic-2-wifi-next.dts new file mode 100644 index 000000000..2709aef50 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-magic-2-wifi-next.dts @@ -0,0 +1,268 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include + +/ { + model = "devolo Magic 2 WiFi next"; + compatible = "devolo,magic-2-wifi-next"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 59 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; + + /delete-node/ ethernet-phy@0; + /delete-node/ ethernet-phy@1; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + switch_lan_bmp = <0x3e>; + switch_wan_bmp = <0x0>; + }; + + edma@c080000 { + status = "okay"; + qcom,num_gmac = <3>; + + gmac0 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + /delete-property/ qcom,forced_speed; + /delete-property/ qcom,forced_duplex; + vlan_tag = <1 0x10>; + }; + + gmac1 { + qcom,phy_mdio_addr = <2>; + qcom,poll_required = <1>; + /delete-property/ qcom,forced_speed; + /delete-property/ qcom,forced_duplex; + vlan_tag = <1 0x08>; + }; + + gmac2 { + local-mac-address = [00 00 00 00 00 00]; + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + /delete-property/ qcom,forced_speed; + /delete-property/ qcom,forced_duplex; + vlan_tag = <1 0x20>; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + plc { + gpio-export,name = "plc-enable"; + gpio-export,output = <1>; + gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; + }; + }; + + }; + + keys { + compatible = "gpio-keys"; + + wlan { + label = "WLAN"; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "Reset"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_dlan { + label = "white:dlan"; + gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + status_wlan { + label = "white:wlan"; + gpios = <&tlmm 58 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + error_dlan { + label = "red:dlan"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + }; + }; +}; + +&tlmm { + spi_0_pins: spi_0_pinmux { + mux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + mux_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio53"; + function = "mdio"; + bias-pull-up; + }; + mux_2 { + pins = "gpio52"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio61", "gpio60"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + button_pins: button_pinmux { + mux { + function = "gpio"; + pins = "gpio0", "gpio5"; + bias-disable; + input; + }; + }; +}; + +&cryptobam { + status = "okay"; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "devolo,magic-2-wifi-next"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "devolo,magic-2-wifi-next"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + linux,modalias = "n25q128a11"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + partition@40000 { + label = "MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + partition@60000 { + label = "QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + partition@c0000 { + label = "CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + partition@d0000 { + label = "DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + partition@e0000 { + label = "APPSBLENV"; /* uboot env*/ + reg = <0x000e0000 0x00010000>; + }; + partition@f0000 { + label = "APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + partition@170000 { + label = "ART"; + reg = <0x00170000 0x00010000>; + read-only; + }; + firmware@180000 { + compatible = "denx,fit"; + label = "firmware"; + reg = <0x00180000 0x01a80000>; + }; + }; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-nbg6617.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-nbg6617.dts index 2c187f79d..caafc1beb 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-nbg6617.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-nbg6617.dts @@ -178,7 +178,6 @@ bias-disable; }; }; - spi_0_pins: spi_0_pinmux { mux { function = "blsp_spi0"; @@ -195,7 +194,6 @@ output-low; }; }; - led_pins: led_pinmux { mux { pins = "gpio0", "gpio1", "gpio3", "gpio5", "gpio58"; @@ -212,10 +210,10 @@ status = "okay"; cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; - mx25l25635f@0 { - compatible = "mx25l25635f", "jedec,spi-nor"; + flash@0 { + compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <24000000>; + spi-max-frequency = <50000000>; status = "okay"; m25p,fast-read; @@ -229,72 +227,60 @@ reg = <0x00000000 0x00040000>; read-only; }; - partition1@40000 { label = "MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - partition2@60000 { label = "QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - partition3@c0000 { label = "CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - partition4@d0000 { label = "DDRPARAMS"; reg = <0x000d0000 0x00010000>; read-only; }; - partition5@e0000 { label = "APPSBL"; /* u-boot */ reg = <0x000e0000 0x00080000>; /* U-Boot Standalone App "zloader" is located at 0x64000 */ read-only; }; - partition6@160000 { label = "APPSBLENV"; /* u-boot env */ reg = <0x00160000 0x00010000>; }; - partition7@170000 { /* make a backup of this partition! */ label = "ART"; reg = <0x00170000 0x00010000>; read-only; }; - partition8@180000 { label = "kernel"; reg = <0x00180000 0x00400000>; }; - partition9@580000 { label = "dualflag"; reg = <0x00580000 0x00010000>; read-only; }; - partition10@590000 { label = "header"; reg = <0x00590000 0x00010000>; }; - partition11@5a0000 { label = "romd"; reg = <0x005a0000 0x00100000>; read-only; }; - partition12@6a0000 { label = "not_root_data"; /* @@ -306,7 +292,6 @@ */ reg = <0x006a0000 0x00100000>; }; - partition13@7a0000 { label = "rootfs"; reg = <0x007a0000 0x01860000>; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts new file mode 100644 index 000000000..bcb9552ce --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2017-2020, Sven Eckelmann + * Copyright (c) 2018, Marek Lindner + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Plasma Cloud PA1200"; + compatible = "plasmacloud,pa1200"; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2: usb2@60f8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 59 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + aliases { + led-boot = &led_status_purple; + led-failsafe = &led_status_yellow; + led-running = &led_status_cyan; + led-upgrade = &led_status_yellow; + }; + + leds { + compatible = "gpio-leds"; + + led_status_cyan: status_cyan { + label = "cyan:status"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + }; + + led_status_purple: status_purple { + label = "purple:status"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + led_status_yellow: status_yellow { + label = "yellow:status"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + }; + +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + /* partitions are passed via bootloader */ + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <2 0x20>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts index c41b87bf9..ac4d4a139 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts @@ -6,12 +6,12 @@ #include / { - model = "ASUS RT-AC58U / RT-AC1300UHP"; + model = "ASUS RT-AC58U"; compatible = "asus,rt-ac58u"; memory { device_type = "memory"; - reg = <0x80000000 0x10000000>; + reg = <0x80000000 0x8000000>; }; aliases { @@ -21,10 +21,6 @@ led-upgrade = &led_power; }; - chosen { - bootargs-append = " ubi.mtd=UBI_DEV"; - }; - soc { rng@22000 { status = "okay"; @@ -272,12 +268,7 @@ #size-cells = <1>; partition@0 { - /* - * TODO: change to label = "ubi" once we drop 4.14. - * also drop the bootargs-append and all the - * userspace CI_UBIPART="UBI_DEV" remains. - */ - label = "UBI_DEV"; + label = "ubi"; reg = <0x00000000 0x08000000>; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx.dtsi new file mode 100644 index 000000000..3673a1343 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx.dtsi @@ -0,0 +1,251 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-ap.dk01.1.dtsi" + +#include +#include + +/ { + aliases { + label-mac-device = &gmac0; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + soc { + pinctrl@1000000 { + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio53"; + function = "mdio"; + bias-pull-up; + }; + mux_2 { + pins = "gpio52"; + function = "mdc"; + bias-pull-up; + }; + }; + + i2c_0_pins: i2c_0_pinmux { + mux { + pins = "gpio58", "gpio59"; + function = "blsp_i2c0"; + bias-disable; + }; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 4 1>; + linux,code = ; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + gpio_out { + gpio-export,name = "gpio_out"; + gpio-export,output = <0>; + gpio-export,direction_may_change = <0>; + gpios = <&stm32_io 23 GPIO_ACTIVE_HIGH>; + }; + + gpio_in { + gpio-export,name = "gpio_in"; + gpio-export,input = <0>; + gpio-export,direction_may_change = <0>; + gpios = <&stm32_io 24 GPIO_ACTIVE_LOW>; + }; + }; + }; +}; + +&blsp1_i2c3 { + status = "okay"; + pinctrl-0 = <&i2c_0_pins>; + pinctrl-names = "default"; + clock-frequency = <400000>; + + stm32_io: stm32@74 { + compatible = "tlt,stm32v1"; + #gpio-cells = <2>; + #interrupt-cells = <2>; + gpio-controller; + interrupt-controller; + interrupt-parent = <&tlmm>; + interrupts = <5 2>; + reg = <0x74>; + }; +}; + +&blsp1_spi1 { + cs-gpios = <&tlmm 54 0>, <&tlmm 63 0>; + num-cs = <2>; + + xt25f128b@0 { + /* + * Factory U-boot looks in 0:BOOTCONFIG partition for active + * partitions settings and mangles the partition config so + * 0:QSEE/0:QSEE_1, 0:CDT/0:CDT_1 and 0:APPSBL/0:APPSBL_1 pairs + * can be swaped. It isn't a problem but we never can be sure where + * OFW put factory images. "n25q128a11" is required for proper nor + * recognition in u-boot. + */ + compatible = "jedec,spi-nor", "n25q128a11"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "0:BOOTCONFIG"; + reg = <0x60000 0x20000>; + read-only; + }; + + partition@80000 { + label = "0:BOOTCONFIG1"; + reg = <0x80000 0x20000>; + read-only; + }; + + partition@a0000 { + label = "0:QSEE"; + reg = <0xa0000 0x60000>; + read-only; + }; + + partition@100000 { + label = "0:QSEE_1"; + reg = <0x100000 0x60000>; + read-only; + }; + + partition@160000 { + label = "0:CDT"; + reg = <0x160000 0x10000>; + read-only; + }; + + partition@170000 { + label = "0:CDT_1"; + reg = <0x170000 0x10000>; + read-only; + }; + + partition@180000 { + label = "0:DDRPARAMS"; + reg = <0x180000 0x10000>; + read-only; + }; + + partition@190000 { + label = "0:APPSBLENV"; + reg = <0x190000 0x10000>; + read-only; + }; + + partition@1a0000 { + label = "0:APPSBL"; + reg = <0x1a0000 0xa0000>; + read-only; + }; + + partition@240000 { + label = "0:APPSBL_1"; + reg = <0x240000 0xa0000>; + read-only; + }; + + partition@2e0000 { + label = "0:ART"; + reg = <0x2e0000 0x10000>; + read-only; + }; + + config: partition@2f0000 { + label = "0:CONFIG"; + reg = <0x2f0000 0x10000>; + read-only; + }; + + partition@300000 { + label = "0:CONFIG_RW"; + reg = <0x300000 0x10000>; + read-only; + }; + + partition@310000 { + label = "0:EVENTSLOG"; + reg = <0x310000 0x90000>; + read-only; + }; + }; + }; + + xt26g02a@1 { + /* + * Factory U-boot looks in 0:BOOTCONFIG partition for active + * partitions settings and mangles the partition config so + * rootfs/rootfs_1 pairs can be swaped. + * It isn't a problem but we never can be sure where OFW put + * factory images. "spinand,mt29f" value is required for proper + * nand recognition in u-boot. + */ + compatible = "spi-nand", "spinand,mt29f"; + #address-cells = <1>; + #size-cells = <1>; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "rootfs_1"; + reg = <0x00000000 0x08000000>; + }; + + partition@8000000 { + label = "rootfs"; + reg = <0x08000000 0x08000000>; + }; + }; + }; +}; + +&mdio { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + phy-reset-gpio = <&tlmm 62 0>; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx10.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx10.dts new file mode 100644 index 000000000..d1d632568 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rutx10.dts @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4018-rutx.dtsi" + +/ { + model = "Teltonika RUTX10"; + compatible = "teltonika,rutx10"; + + soc { + leds { + compatible = "gpio-leds"; + + wifi2g { + label = "green:wifi2g"; + gpios = <&stm32_io 19 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wifi5g { + label = "green:wifi5g"; + gpios = <&stm32_io 18 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + }; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts new file mode 100644 index 000000000..87bceecbb --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2020, Robert Marko */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "MikroTik SXTsq 5 ac (RBSXTsqG-5acD)"; + compatible = "mikrotik,sxtsq-5-ac"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + phy-mode = "rgmii"; + qcom,num_gmac = <1>; + qcom,single-phy; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "blue:power"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + panic-indicator; + }; + + led_user: user { + label = "green:user"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + + rssilow { + label = "green:rssilow"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + }; + + rssimediumlow { + label = "green:rssimediumlow"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + rssimedium { + label = "green:rssimedium"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + + rssimediumhigh { + label = "green:rssimediumhigh"; + gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>; + }; + + rssihigh { + label = "green:rssihigh"; + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <2>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Qualcomm"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + label = "RouterBoot"; + reg = <0x80000 0x80000>; + + hard_config { + read-only; + }; + + dtb_config { + read-only; + }; + + soft_config { + }; + }; + + partition@100000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x100000 0xf00000>; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-SXTsq-5-ac"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x20>; +}; + +&mdio { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts new file mode 100644 index 000000000..d7972cd53 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts @@ -0,0 +1,382 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2020, Robert Marko */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include +#include + +/ { + model = "Netgear WAC510"; + compatible = "netgear,wac510"; + + aliases { + led-boot = &led_power_amber; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; + label-mac-device = &gmac0; + }; + + chosen { + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + led_spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>; + num-chipselects = <0>; + + ssr: ssr@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <1>; + spi-max-frequency = <1000000>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_amber: led-0 { + label = "amber:power"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&ssr 6 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led_power_green: led-1 { + label = "green:power"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&ssr 5 GPIO_ACTIVE_LOW>; + }; + + led-2 { + /* 2.4GHz blue - activity */ + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <0>; + gpios = <&ssr 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-3 { + /* 2.4GHz green - link */ + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <0>; + gpios = <&ssr 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + led-4 { + /* 5GHz blue - activity */ + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <1>; + gpios = <&ssr 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led-5 { + /* 5GHz green - link */ + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <1>; + gpios = <&ssr 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; + + led-6 { + color = ; + function = LED_FUNCTION_ACTIVITY; + gpios = <&ssr 0 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio53"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio52"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio54", "gpio59"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, + <&tlmm 59 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <50000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0x000e0000 0x00010000>; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0x000f0000 0x000f0000>; + read-only; + }; + + partition@1e0000 { + label = "0:MANUDATA"; + reg = <0x001e0000 0x00010000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_manudata_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; + + partition@1f0000 { + label = "0:ART"; + reg = <0x001f0000 0x00010000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + }; + }; + + nand@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <48000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "rootfs"; + reg = <0x00000000 0x03800000>; + }; + + partition@3800000 { + label = "rootfs_1"; + reg = <0x03800000 0x03800000>; + }; + + partition@7000000 { + label = "var_config"; + reg = <0x07000000 0x00f00000>; + read-only; + }; + + partition@7f00000 { + label = "Oops_log"; + reg = <0x07f00000 0x000c0000>; + read-only; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; +}; + +&gmac0 { + qcom,forced_duplex = <1>; + qcom,forced_speed = <1000>; + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + vlan_tag = <1 0x10>; +}; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_manudata_6>; + qcom,ath10k-calibration-variant = "Netgear-WAC510"; +}; + +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_manudata_6>; + mac-address-increment = <16>; + qcom,ath10k-calibration-variant = "Netgear-WAC510"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts index ba6110f0b..8fa5a3190 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts @@ -145,7 +145,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio54"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts new file mode 100644 index 000000000..0eed441a2 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts @@ -0,0 +1,293 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Luma Home WRTQ-329ACN"; + compatible = "luma,wrtq-329acn"; + + aliases { + ethernet0 = &gmac1; + ethernet1 = &gmac0; + }; + + i2c-gpio { + compatible = "i2c-gpio"; + sda-gpios = <&tlmm 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&tlmm 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + #address-cells = <1>; + #size-cells = <0>; + + /* No driver exists */ + led_ring@48 { + compatible = "ti,msp430"; + reg = <0x48>; + }; + + eeprom@50 { + compatible = "atmel,24c16"; + reg = <0x50>; + pagesize = <16>; + read-only; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + + /delete-node/ ethernet-phy@0; + /delete-node/ ethernet-phy@1; + /delete-node/ ethernet-phy@3; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + + switch_lan_bmp = <0x1e>; + switch_wan_bmp = <0x20>; + }; + + edma@c080000 { + status = "okay"; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + + +&blsp1_spi1 { + status = "okay"; + + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, + <&tlmm 59 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&spi0_pins>; + pinctrl-names = "default"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x040000 0x020000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x060000 0x060000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0x0c0000 0x010000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0x0d0000 0x010000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0x0e0000 0x010000>; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0x0f0000 0x080000>; + read-only; + }; + + partition@170000 { + label = "0:ART"; + reg = <0x170000 0x010000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + }; + }; + + flash@1 { + status = "okay"; + + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0000000 0x8000000>; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial0_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <2>; + qcom,poll_required = <1>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; +}; + +&tlmm { + serial0_pins: serial0_pinmux { + mux { + function = "blsp_uart0"; + pins = "gpio60", "gpio61"; + bias-disable; + }; + }; + + spi0_pins: spi0_pinmux { + mux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + bias-disable; + drive-strength = <12>; + }; + + mux_cs { + function = "gpio"; + pins = "gpio54", "gpio59"; + bias-disable; + drive-strength = <2>; + output-high; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; + qcom,ath10k-calibration-variant = "Luma-WRTQ-329ACN"; +}; + +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; + qcom,ath10k-calibration-variant = "Luma-WRTQ-329ACN"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts index 772bc4b51..279050fa1 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts @@ -81,7 +81,7 @@ reset { label = "reset"; gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; - linux,code = ; + linux,code = ; }; }; @@ -137,7 +137,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio12"; @@ -185,6 +184,14 @@ status = "okay"; }; +&gmac0 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + &usb2_hs_phy { status = "okay"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dts deleted file mode 100644 index 74e0b1259..000000000 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dts +++ /dev/null @@ -1,314 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "qcom-ipq4019.dtsi" -#include -#include -#include - -/ { - model = "HiWiFi C526A"; - compatible = "hiwifi,c526a"; - - aliases { - led-boot = &led_boot; - led-failsafe = &led_boot; - led-running = &led_sys; - led-upgrade = &led_sys; - }; - - chosen { - bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1"; - }; - - soc { - rng@22000 { - status = "okay"; - }; - - mdio@90000 { - status = "okay"; - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - }; - - ess-psgmii@98000 { - status = "okay"; - }; - - tcsr@1949000 { - compatible = "qcom,tcsr"; - reg = <0x1949000 0x100>; - qcom,wifi_glb_cfg = ; - }; - - tcsr@194b000 { - compatible = "qcom,tcsr"; - reg = <0x194b000 0x100>; - qcom,usb-hsphy-mode-select = ; - }; - - ess_tcsr@1953000 { - compatible = "qcom,tcsr"; - reg = <0x1953000 0x1000>; - qcom,ess-interface-select = ; - }; - - tcsr@1957000 { - compatible = "qcom,tcsr"; - reg = <0x1957000 0x100>; - qcom,wifi_noc_memtype_m0_m2 = ; - }; - - usb2@60f8800 { - status = "okay"; - }; - - usb3@8af8800 { - status = "okay"; - }; - - crypto@8e3a000 { - status = "okay"; - }; - - watchdog@b017000 { - status = "okay"; - }; - - ess-switch@c000000 { - status = "okay"; - }; - - edma@c080000 { - status = "okay"; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_sys: blue { - label = "blue:sys"; - gpios = <&tlmm 36 GPIO_ACTIVE_LOW>; - }; - - led_boot: red { - label = "red:sys"; - gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; - panic-indicator; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&blsp_dma { - status = "okay"; -}; - -&blsp1_spi1 { - status = "okay"; - - flash@0 { - reg = <0>; - compatible = "jedec,spi-nor"; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "SBL1"; - reg = <0x0 0x40000>; - read-only; - }; - - partition@40000 { - label = "MIBIB"; - reg = <0x40000 0x20000>; - read-only; - }; - - partition@60000 { - label = "QSEE"; - reg = <0x60000 0x60000>; - read-only; - }; - - partition@c0000 { - label = "CDT"; - reg = <0xc0000 0x10000>; - read-only; - }; - - partition@d0000 { - label = "DDRPARAMS"; - reg = <0xd0000 0x10000>; - read-only; - }; - - partition@e0000 { - label = "APPSBLENV"; - reg = <0xe0000 0x10000>; - read-only; - }; - - partition@f0000 { - label = "APPSBL"; - reg = <0xf0000 0x80000>; - read-only; - }; - - partition@170000 { - label = "ART"; - reg = <0x170000 0x10000>; - read-only; - }; - - partition@180000 { - label = "bdinfo"; - reg = <0x180000 0x10000>; - read-only; - }; - - partition@190000 { - label = "debug"; - reg = <0x190000 0x10000>; - read-only; - }; - - partition@1a0000 { - label = "oem"; - reg = <0x1a0000 0x20000>; - read-only; - }; - - factory: partition@1c0000 { - label = "Factory"; - reg = <0x1c0000 0x10000>; - read-only; - }; - - partition@1d0000 { - label = "hw_panic"; - reg = <0x1d0000 0x10000>; - read-only; - }; - - partition@1e0000 { - label = "upgrade_config"; - reg = <0x1e0000 0x10000>; - read-only; - }; - }; - }; -}; - -&blsp1_uart1 { - pinctrl-0 = <&serial_0_pins>; - pinctrl-names = "default"; - status = "okay"; -}; - -&cryptobam { - status = "okay"; -}; - -&nand { - status = "okay"; - - nand@0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "ubi"; - reg = <0x0 0x8000000>; - }; - }; - }; -}; - -&pcie0 { - status = "okay"; - perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - wake-gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; - - bridge@0,0 { - reg = <0x00000000 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - ranges; - - wifi@1,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - ieee80211-freq-limit = <2400000 2500000>; - }; - }; -}; - -&qpic_bam { - status = "okay"; -}; - -&tlmm { - mdio_pins: mdio_pinmux { - mux_1 { - pins = "gpio6"; - function = "mdio"; - bias-pull-up; - }; - - mux_2 { - pins = "gpio7"; - function = "mdc"; - bias-pull-up; - }; - }; - - serial_0_pins: serial0-pinmux { - mux { - pins = "gpio16", "gpio17"; - function = "blsp_uart0"; - bias-disable; - }; - }; -}; - -&usb3_ss_phy { - status = "okay"; -}; - -&usb3_hs_phy { - status = "okay"; -}; - -&usb2_hs_phy { - status = "okay"; -}; - -&wifi0 { - status = "okay"; - ieee80211-freq-limit = <5470000 5875000>; - qcom,ath10k-calibration-variant = "C526A"; -}; - -&wifi1 { - status = "okay"; - ieee80211-freq-limit = <5170000 5350000>; - qcom,ath10k-calibration-variant = "C526A"; -}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts index 0d7f24002..ba6aabdc9 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts @@ -16,10 +16,6 @@ led-upgrade = &led_sys; }; - chosen { - bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1"; - }; - soc { rng@22000 { status = "okay"; @@ -133,7 +129,7 @@ leds { compatible = "gpio-leds"; - led_usb: usb { + usb { label = "blue:usb"; gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; linux,default-trigger = "usbport"; @@ -201,11 +197,13 @@ }; &gmac0 { - mtd-mac-address = <&art 0x1006>; + nvmem-cells = <&macaddr_art_1006>; + nvmem-cell-names = "mac-address"; }; &gmac1 { - mtd-mac-address = <&art 0x5006>; + nvmem-cells = <&macaddr_art_5006>; + nvmem-cell-names = "mac-address"; }; &nand { @@ -220,18 +218,95 @@ #size-cells = <1>; partition@0 { - label = "Bootloader"; - reg = <0x0 0xb00000>; + label = "SBL1"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "MIBIB"; + reg = <0x100000 0x100000>; + read-only; + }; + + partition@200000 { + label = "BOOTCONFIG"; + reg = <0x200000 0x100000>; + }; + + partition@300000 { + label = "QSEE"; + reg = <0x300000 0x100000>; + read-only; + }; + + partition@400000 { + label = "QSEE_1"; + reg = <0x400000 0x100000>; + read-only; + }; + + partition@500000 { + label = "CDT"; + reg = <0x500000 0x80000>; + read-only; + }; + + partition@580000 { + label = "CDT_1"; + reg = <0x580000 0x80000>; + read-only; + }; + + partition@600000 { + label = "BOOTCONFIG1"; + reg = <0x600000 0x80000>; + }; + + partition@680000 { + label = "APPSBLENV"; + reg = <0x680000 0x80000>; + }; + + partition@700000 { + label = "APPSBL"; + reg = <0x700000 0x200000>; + read-only; + }; + + partition@900000 { + label = "APPSBL_1"; + reg = <0x900000 0x200000>; + read-only; }; art: partition@b00000 { label = "ART"; reg = <0xb00000 0x80000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + macaddr_art_1006: macaddr@1006 { + reg = <0x1006 0x6>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + + macaddr_art_5006: macaddr@5006 { + reg = <0x5006 0x6>; + }; }; partition@b80000 { - label = "rootfs"; + label = "ubi"; reg = <0xb80000 0x7480000>; }; }; @@ -291,10 +366,14 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; qcom,ath10k-calibration-variant = "CM520-79F"; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; qcom,ath10k-calibration-variant = "CM520-79F"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts index 9f03070a5..f9205c28f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts @@ -34,49 +34,52 @@ reg = <0x0 0x40000>; read-only; }; - partition@40000 { label = "0:MIBIB"; reg = <0x40000 0x20000>; read-only; }; - partition@60000 { label = "0:QSEE"; reg = <0x60000 0x60000>; read-only; }; - partition@c0000 { label = "0:CDT"; reg = <0xc0000 0x10000>; read-only; }; - partition@d0000 { label = "0:DDRPARAMS"; reg = <0xd0000 0x10000>; read-only; }; - partition@e0000 { label = "0:APPSBLENV"; reg = <0xe0000 0x10000>; read-only; }; - partition@f0000 { label = "0:APPSBL"; reg = <0xf0000 0x80000>; read-only; }; - partition@170000 { label = "0:ART"; reg = <0x170000 0x10000>; read-only; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; partition@180000 { compatible = "denx,fit"; label = "firmware"; @@ -85,3 +88,17 @@ }; }; }; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; + qcom,ath10k-calibration-variant = "Qxwlan-E2600AC-C1"; +}; + +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; + qcom,ath10k-calibration-variant = "Qxwlan-E2600AC-C1"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts index a9b177836..1f88322a4 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts @@ -34,47 +34,51 @@ reg = <0x0 0x40000>; read-only; }; - partition@40000 { label = "0:MIBIB"; reg = <0x40000 0x20000>; read-only; }; - partition@60000 { label = "0:QSEE"; reg = <0x60000 0x60000>; read-only; }; - partition@c0000 { label = "0:CDT"; reg = <0xc0000 0x10000>; read-only; }; - partition@d0000 { label = "0:DDRPARAMS"; reg = <0xd0000 0x10000>; read-only; }; - partition@e0000 { label = "0:APPSBLENV"; reg = <0xe0000 0x10000>; read-only; }; - partition@f0000 { label = "0:APPSBL"; reg = <0xf0000 0x80000>; read-only; }; - partition@170000 { label = "0:ART"; reg = <0x170000 0x10000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; @@ -101,6 +105,7 @@ &tlmm { nand_pins: nand-pins { + pullups { pins = "gpio53", "gpio58", "gpio59"; function = "qpic"; @@ -118,3 +123,17 @@ }; }; }; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; + qcom,ath10k-calibration-variant = "Qxwlan-E2600AC-C2"; +}; + +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; + qcom,ath10k-calibration-variant = "Qxwlan-E2600AC-C2"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac.dtsi index 9ad3fa4df..5bfb758e5 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac.dtsi @@ -203,7 +203,6 @@ function = "mdio"; bias-pull-up; }; - mux_2 { pins = "gpio7"; function = "mdc"; @@ -234,7 +233,6 @@ drive-strength = <12>; bias-disable; }; - pinmux_cs { function = "gpio"; pins = "gpio12"; @@ -256,13 +254,3 @@ &usb2_hs_phy { status = "okay"; }; - -&wifi0 { - status = "okay"; - qcom,ath10k-calibration-variant = "Qxwlan-E2600AC"; -}; - -&wifi1 { - status = "okay"; - qcom,ath10k-calibration-variant = "Qxwlan-E2600AC"; -}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-ea8300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-ea8300.dts index 6770d2996..5a738da33 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-ea8300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-ea8300.dts @@ -1,23 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/* - * Device Tree Source for Linksys EA8300 (Dallas) - * - * Copyright (C) 2019 Jeff Kletsky - * - */ - -/dts-v1/; - -#include "qcom-ipq4019.dtsi" -#include -#include -#include +#include "qcom-ipq4019-xx8300.dtsi" / { model = "Linksys EA8300 (Dallas)"; compatible = "linksys,ea8300", "qcom,ipq4019"; + aliases { led-boot = &led_wps_amber; led-failsafe = &led_wps; @@ -26,6 +15,7 @@ serial0 = &blsp1_uart1; }; + leds { compatible = "gpio-leds"; @@ -73,304 +63,18 @@ keys { compatible = "gpio-keys"; - button@0 { + reset { label = "reset"; linux,code = ; gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; }; - button@1 { + wps { label = "wps"; linux,code = ; gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; }; }; - - // - // OEM U-Boot provides either - // init=/sbin/init rootfstype=ubifs ubi.mtd=11,2048 \ - // root=ubi0:ubifs rootwait rw - // or the same with ubi.mtd=13,2048 - // - - chosen { - bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro"; - }; - - memory { - device_type = "memory"; - reg = <0x80000000 0x10000000>; - }; - - soc { - rng@22000 { - status = "okay"; - }; - - mdio@90000 { - status = "okay"; - }; - - ess-psgmii@98000 { - status = "okay"; - }; - - tcsr@1949000 { - compatible = "qcom,tcsr"; - reg = <0x1949000 0x100>; - qcom,wifi_glb_cfg = ; - }; - - tcsr@194b000 { - compatible = "qcom,tcsr"; - reg = <0x194b000 0x100>; - qcom,usb-hsphy-mode-select = ; - }; - - ess_tcsr@1953000 { - compatible = "qcom,tcsr"; - reg = <0x1953000 0x1000>; - qcom,ess-interface-select = ; - }; - - tcsr@1957000 { - compatible = "qcom,tcsr"; - reg = <0x1957000 0x100>; - qcom,wifi_noc_memtype_m0_m2 = ; - }; - - usb2@60f8800 { - status = "okay"; - - dwc3@6000000 { - #address-cells = <1>; - #size-cells = <0>; - - usb2_port1: port@1 { - reg = <1>; - #trigger-source-cells = <0>; - }; - }; - }; - - usb3@8af8800 { - status = "okay"; - - dwc3@8a00000 { - #address-cells = <1>; - #size-cells = <0>; - - usb3_port1: port@1 { - reg = <1>; - #trigger-source-cells = <0>; - }; - - usb3_port2: port@2 { - reg = <2>; - #trigger-source-cells = <0>; - }; - }; - }; - - crypto@8e3a000 { - status = "okay"; - }; - - watchdog@b017000 { - status = "okay"; - }; - - ess-switch@c000000 { - status = "okay"; - }; - - edma@c080000 { - status = "okay"; - }; - }; -}; - -&blsp_dma { - status = "okay"; -}; - -&blsp1_uart1 { - status = "okay"; - pinctrl-0 = <&serial_0_pins>; - pinctrl-names = "default"; -}; - -&cryptobam { - status = "okay"; -}; - -&nand { - status = "okay"; - - pinctrl-0 = <&nand_pins>; - pinctrl-names = "default"; - - nand@0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "sbl1"; - reg = <0x0 0x100000>; - read-only; - }; - - partition@100000 { - label = "mibib"; - reg = <0x100000 0x100000>; - read-only; - }; - - partition@200000 { - label = "qsee"; - reg = <0x200000 0x100000>; - read-only; - }; - - partition@300000 { - label = "cdt"; - reg = <0x300000 0x80000>; - read-only; - }; - - partition@380000 { - label = "appsblenv"; - reg = <0x380000 0x80000>; - read-only; - }; - - partition@400000 { - label = "ART"; - reg = <0x400000 0x80000>; - read-only; - }; - - partition@480000 { - label = "appsbl"; - reg = <0x480000 0x200000>; - read-only; - }; - - partition@680000 { - label = "u_env"; - reg = <0x680000 0x80000>; - // writable -- U-Boot environment - }; - - partition@700000 { - label = "s_env"; - reg = <0x700000 0x40000>; - // writable -- Boot counter records - }; - - partition@740000 { - label = "devinfo"; - reg = <0x740000 0x40000>; - read-only; - }; - - partition@780000 { - label = "kernel"; - reg = <0x780000 0x5800000>; - }; - - partition@a80000 { - label = "rootfs"; - reg = <0xa80000 0x5500000>; - }; - - partition@5f80000 { - label = "alt_kernel"; - reg = <0x5f80000 0x5800000>; - }; - - partition@6280000 { - label = "alt_rootfs"; - reg = <0x6280000 0x5500000>; - }; - - partition@b780000 { - label = "sysdiag"; - reg = <0xb780000 0x100000>; - read-only; - }; - - partition@b880000 { - label = "syscfg"; - reg = <0xb880000 0x4680000>; - read-only; - }; - }; - }; -}; - -&pcie0 { - status = "okay"; - - perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; - wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; - - bridge@0,0 { - reg = <0x00000000 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - ranges; - - wifi2: wifi@1,0 { - compatible = "qcom,ath10k"; - reg = <0x00010000 0 0 0 0>; - }; - }; -}; - -&qpic_bam { - status = "okay"; -}; - -&tlmm { - serial_0_pins: serial0-pinmux { - pins = "gpio16", "gpio17"; - function = "blsp_uart0"; - bias-disable; - }; - - nand_pins: nand_pins { - pullups { - pins = "gpio53", "gpio58", "gpio59"; - function = "qpic"; - bias-pull-up; - }; - - // gpio61 controls led_usb - - pulldowns { - pins = "gpio55", "gpio56", "gpio57", - "gpio60", "gpio62", "gpio63", - "gpio64", "gpio65", "gpio66", - "gpio67", "gpio68", "gpio69"; - function = "qpic"; - bias-pull-down; - }; - }; -}; - -&usb2_hs_phy { - status = "okay"; -}; - -&usb3_hs_phy { - status = "okay"; -}; - -&usb3_ss_phy { - status = "okay"; }; &wifi0 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts index 80d94e179..c8112c04f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts @@ -125,47 +125,55 @@ reg = <0x00000000 0x00040000>; read-only; }; - partition1@40000 { label = "0:MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - partition2@60000 { label = "0:QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - partition3@c0000 { label = "0:CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - partition4@d0000 { label = "0:DDRPARAMS"; reg = <0x000d0000 0x00010000>; read-only; }; - partition5@e0000 { label = "0:APPSBLENV"; reg = <0x000e0000 0x00010000>; read-only; }; - partition6@f0000 { label = "0:APPSBL"; reg = <0x000f0000 0x00080000>; read-only; }; - partition7@170000 { label = "0:ART"; reg = <0x00170000 0x00010000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; }; @@ -181,6 +189,10 @@ status = "okay"; }; +&gmac0 { + vlan_tag = <1 0x10>; +}; + &nand { pinctrl-0 = <&nand_pins>; pinctrl-names = "default"; @@ -196,7 +208,6 @@ label = "rootfs1"; reg = <0x00000000 0x04000000>; }; - partition@40000000 { label = "ubi"; reg = <0x04000000 0x04000000>; @@ -220,6 +231,8 @@ wifi2: wifi@1,0 { compatible = "qcom,ath10k"; reg = <0x00010000 0 0 0 0>; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_9000>; ieee80211-freq-limit = <5470000 5875000>; qcom,ath10k-calibration-variant = "EnGenius-EAP2200"; }; @@ -276,11 +289,15 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; qcom,ath10k-calibration-variant = "EnGenius-EAP2200"; }; &wifi1 { status = "okay"; ieee80211-freq-limit = <5170000 5350000>; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; qcom,ath10k-calibration-variant = "EnGenius-EAP2200"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzbox-7530.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzbox-7530.dts index dcd336e71..27c7d071d 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzbox-7530.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzbox-7530.dts @@ -173,6 +173,9 @@ status = "okay"; nand@0 { + /delete-property/ nand-ecc-strength; + /delete-property/ nand-ecc-step-size; + partitions { compatible = "fixed-partitions"; #address-cells = <1>; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts index 5c4bca30d..2d20d5928 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts @@ -68,7 +68,7 @@ edma@c080000 { status = "okay"; - phy-mode = "rgmii-rxid"; + phy-mode = "rgmii-id"; qcom,num_gmac = <1>; qcom,single-phy; }; @@ -137,7 +137,6 @@ function = "mdio"; bias-pull-up; }; - mux_2 { pins = "gpio7"; function = "mdc"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-3000.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-3000.dts index c0e5d77a5..2e4bfd69b 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-3000.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-3000.dts @@ -58,12 +58,13 @@ ess-switch@c000000 { status = "okay"; - switch_lan_bmp = <0x10>; - switch_wan_bmp = <0x20>; + switch_lan_bmp = <0x30>; + switch_wan_bmp = <0x02>; }; edma@c080000 { status = "okay"; + qcom,num_gmac = <1>; }; }; @@ -209,6 +210,10 @@ }; }; +&gmac0 { + vlan_tag = <1 0x30>; +}; + &cryptobam { status = "okay"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts new file mode 100644 index 000000000..9d7259c35 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts @@ -0,0 +1,388 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "GL.iNet GL-B2200"; + compatible = "glinet,gl-b2200", "qcom,ipq4019"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + bootargs-append = " root=/dev/mmcblk0p2 rw rootwait clk_ignore_unused"; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + switch_lan_bmp = <0x2e>; + switch_wan_bmp = <0x10>; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = <1>; + }; + + reset { + label = "reset"; + gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = <1>; + }; + }; + + leds { + compatible = "gpio-leds"; + + power_blue { + label = "blue:power"; + gpios = <&tlmm 57 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + internet_blue { + label = "blue:internet"; + gpios = <&tlmm 60 GPIO_ACTIVE_HIGH>; + }; + power_white { + label = "white:power"; + gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; + }; + internet_white { + label = "white:internet"; + gpios = <&tlmm 66 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gmac1 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <2 0x10>; +}; + +&gmac0 { + vlan_tag = <1 0x2e>; +}; + +&vqmmc { + status = "okay"; +}; + +&sdhci { + status = "okay"; + pinctrl-0 = <&sd_pins>; + pinctrl-names = "default"; + cd-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>; + vqmmc-supply = <&vqmmc>; +}; + +&blsp_dma { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "APPSBL"; + reg = <0xf0000 0x80000>; + read-only; + }; + + partition@170000 { + label = "ART"; + reg = <0x170000 0x10000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; + }; + }; + }; +}; + +&blsp1_spi2 { + pinctrl-0 = <&spi_1_pins>; + pinctrl-names = "default"; + status = "okay"; + + spidev1: spi@0 { + compatible = "siliconlabs,si3210"; + reg = <0>; + spi-max-frequency = <24000000>; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&blsp1_uart2 { + pinctrl-0 = <&serial_1_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + serial_1_pins: serial1_pinmux { + mux { + pins = "gpio8", "gpio9", + "gpio10", "gpio11"; + function = "blsp_uart1"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + }; + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + }; + pinconf { + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + pinconf_cs { + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + spi_1_pins: spi_1_pinmux { + mux { + pins = "gpio44", "gpio46", "gpio47"; + function = "blsp_spi1"; + bias-disable; + }; + cs { + pins = "gpio45"; + function = "gpio"; + bias-pull-up; + }; + reset { + pins = "gpio43"; + function = "gpio"; + output-high; + }; + mux_2 { + pins = "gpio35"; + function = "gpio"; + output-high; + }; + host_int { + pins = "gpio2"; + function = "gpio"; + input; + }; + wake { + pins = "gpio48"; + function = "gpio"; + output-high; + }; + }; + + sd_pins: sd_pins { + pinmux { + function = "sdio"; + pins = "gpio23", "gpio24", "gpio25", "gpio26", + "gpio29", "gpio30", "gpio31", "gpio32"; + drive-strength = <10>; + }; + + pinmux_sd_clk { + function = "sdio"; + pins = "gpio27"; + drive-strength = <16>; + }; + + pinmux_sd7 { + function = "sdio"; + pins = "gpio28"; + drive-strength = <10>; + bias-disable; + }; + }; + +}; + +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi2: wifi@1,0 { + status = "okay"; + /* Bootlog shows this is a 168c:0056 - QCA 9888v2 */ + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_9000>; + qcom,ath10k-calibration-variant = "GL-B2200"; + ieee80211-freq-limit = <5450000 5900000>; + }; + }; +}; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; + qcom,ath10k-calibration-variant = "GL-B2200"; +}; + +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; + qcom,ath10k-calibration-variant = "GL-B2200"; + ieee80211-freq-limit = <5100000 5400000>; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts index aed30028a..2a2cfb9ac 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts @@ -250,54 +250,56 @@ reg = <0x00000000 0x00040000>; read-only; }; - partition@40000 { label = "MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - partition@60000 { label = "QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - partition@c0000 { label = "CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - partition@d0000 { label = "DDRPARAMS"; reg = <0x000d0000 0x00010000>; read-only; }; - partition@e0000 { label = "APPSBLENV"; /* uboot env */ reg = <0x000e0000 0x00010000>; read-only; }; - partition@f0000 { label = "APPSBL"; /* uboot */ reg = <0x000f0000 0x00080000>; read-only; }; - partition@170000 { label = "ART"; reg = <0x00170000 0x00010000>; read-only; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; partition@180000 { label = "cfg"; reg = <0x00180000 0x00040000>; }; - partition@1c0000 { label = "firmware"; compatible = "denx,fit"; @@ -343,13 +345,15 @@ &wifi0 { status = "okay"; - + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; qcom,ath10k-calibration-variant = "8devices-Habanero"; }; &wifi1 { status = "okay"; - + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; qcom,ath10k-calibration-variant = "8devices-Habanero"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-hap-ac3.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-hap-ac3.dts new file mode 100644 index 000000000..c8b7e202f --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-hap-ac3.dts @@ -0,0 +1,327 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2021, Robert Marko */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "MikroTik hAP ac3"; + compatible = "mikrotik,hap-ac3"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &led_status_blue; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2: usb2@60f8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + mode { + label = "mode"; + gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + led { + label = "led"; + gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: status-blue { + label = "blue:status"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: status-red { + label = "red:status"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + + led_status_green: status-green { + label = "green:status"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + + wlan { + label = "green:wlan"; + gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>; + }; + + ethernet { + label = "green:ethernet"; + gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>; + }; + + wan { + label = "green:wan"; + gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>; + }; + + lan1 { + label = "green:lan1"; + gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; + }; + + lan2 { + label = "green:lan2"; + gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; + }; + + lan3 { + label = "green:lan3"; + gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; + }; + + lan4 { + label = "green:lan4"; + gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; + }; + + poe { + label = "red:poe"; + gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + + pin_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio53", "gpio58", "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + pulldowns { + pins = "gpio55", "gpio56", "gpio57", "gpio60", + "gpio62", "gpio63", "gpio64", "gpio65", + "gpio66", "gpio67", "gpio68", "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; + + enable-usb-power { + gpio-hog; + gpios = <44 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "enable USB power"; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Qualcomm"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + label = "RouterBoot"; + reg = <0x80000 0x80000>; + + hard_config { + read-only; + size = <0x2000>; + }; + + dtb_config { + read-only; + }; + + soft_config { + }; + }; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&nand { + status = "okay"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0xa00000>; + }; + + partition@a00000 { + label = "ubi"; + reg = <0xa00000 0x7600000>; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-hAP-ac3"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-hAP-ac3"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts new file mode 100644 index 000000000..aecbb673b --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts @@ -0,0 +1,268 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, Robert Marko + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Mikrotik Wireless Wire Dish LHGG-60ad"; + compatible = "mikrotik,lhgg-60ad"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &user; + led-failsafe = &user; + led-running = &user; + led-upgrade = &user; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + + /delete-node/ ethernet-phy@1; + /delete-node/ ethernet-phy@2; + /delete-node/ ethernet-phy@3; + /delete-node/ ethernet-phy@4; + /delete-node/ psgmii-phy@5; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + switch_mac_mode = <0x3>; /* mac mode for RGMII RMII */ + switch_lan_bmp = <0x0>; /* lan port bitmap */ + switch_wan_bmp = <0x10>; /* wan port bitmap */ + }; + + edma@c080000 { + status = "okay"; + phy-mode = "rgmii-id"; + qcom,num_gmac = <1>; + qcom,single-phy; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power: power { + label = "blue:power"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + panic-indicator; + }; + + user: user { + label = "yellow:user"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + + wlan { + label = "green:wlan"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + }; + + align-left { + label = "green:align-left"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + align-right { + label = "green:align-right"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + + wlan-rx { + label = "green:align-down"; + gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>; + }; + + wlan-tx { + label = "green:align-up"; + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi-0-pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + status = "okay"; + + m25p80@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Qualcomm"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + label = "RouterBoot"; + reg = <0x80000 0x80000>; + + hard_config { + read-only; + size = <0x2000>; + }; + + dtb_config { + read-only; + }; + + soft_config { + }; + }; + + partition@100000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x100000 0xf00000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 42 GPIO_ACTIVE_HIGH>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + /* wil6210 802.11ad card */ + wifi: wifi@1,0 { + status = "okay"; + /* wil6210 driver has no compatible */ + reg = <0x00010000 0 0 0 0>; + }; + }; +}; + +&gmac0 { + qcom,phy_mdio_addr = <0>; + qcom,poll_required = <1>; + vlan_tag = <0 0x20>; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-map-ac2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-map-ac2200.dts index c67af3b22..433048dd4 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-map-ac2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-map-ac2200.dts @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qcom-ipq4019.dtsi" #include #include #include +#include / { model = "ASUS Lyra MAP-AC2200"; @@ -177,7 +177,6 @@ bias-pull-down; }; }; - enable_ext_pa_high { gpio-hog; gpios = <44 GPIO_ACTIVE_HIGH>, @@ -186,7 +185,6 @@ bias-pull-down; line-name = "enable external PA output-high"; }; - enable_ext_pa_low { gpio-hog; gpios = <45 GPIO_ACTIVE_HIGH>, @@ -255,69 +253,96 @@ /* 9-channel RGB LED controller */ compatible = "national,lp5523"; reg = <0x32>; - clock-mode = [01]; + clock-mode = /bits/ 8 <1>; + #address-cells = <1>; + #size-cells = <0>; - led_blue0: blue0 { - chan-name = "blue0"; - label = "blue:chan0"; - led-cur = [fa]; - max-cur = [ff]; + /* + * There is only one single extremely bright RGB-LED. + * The RGB-color channels are running in parallel to + * increase the current delivery capabilities beyond + * what a single PWM-output of the controller can do. + */ + + led_blue0: led@0 { + chan-name = "blue-0"; + led-cur = /bits/ 8 <0xfa>; + max-cur = /bits/ 8 <0xff>; + reg = <0>; + color = ; + function-enumerator = <0>; }; - blue1 { - chan-name = "blue1"; - label = "blue:chan1"; - led-cur = [fa]; - max-cur = [ff]; + led@1 { + chan-name = "blue-1"; + led-cur = /bits/ 8 <0xfa>; + max-cur = /bits/ 8 <0xff>; + reg = <1>; + color = ; + function-enumerator = <1>; }; - blue2 { - chan-name = "blue2"; - label = "blue:chan2"; - led-cur = [fa]; - max-cur = [ff]; + led@2 { + chan-name = "blue-2"; + led-cur = /bits/ 8 <0xfa>; + max-cur = /bits/ 8 <0xff>; + reg = <2>; + color = ; + function-enumerator = <2>; }; - led_green0: green0 { - chan-name = "green0"; - label = "green:chan0"; - led-cur = [fa]; - max-cur = [ff]; + led_green0: led@3 { + chan-name = "green-0"; + led-cur = /bits/ 8 <0xfa>; + max-cur = /bits/ 8 <0xff>; + reg = <3>; + color = ; + function-enumerator = <0>; }; - green1 { - chan-name = "green1"; - label = "green:chan1"; - led-cur = [fa]; - max-cur = [ff]; + led@4 { + chan-name = "green-1"; + led-cur = /bits/ 8 <0xfa>; + max-cur = /bits/ 8 <0xff>; + reg = <4>; + color = ; + function-enumerator = <1>; }; - green2 { - chan-name = "green2"; - label = "green:chan2"; - led-cur = [fa]; - max-cur = [ff]; + led@5 { + chan-name = "green-2"; + led-cur = /bits/ 8 <0xfa>; + max-cur = /bits/ 8 <0xff>; + reg = <5>; + color = ; + function-enumerator = <2>; }; - led_red0: red0 { - chan-name = "red0"; - label = "red:chan0"; - led-cur = [fa]; - max-cur = [ff]; + led_red0: led@6 { + chan-name = "red-0"; + led-cur = /bits/ 8 <0xfa>; + max-cur = /bits/ 8 <0xff>; + reg = <6>; + color = ; + function-enumerator = <0>; }; - red1 { - chan-name = "red1"; - label = "red:chan1"; - led-cur = [fa]; - max-cur = [ff]; + led@7 { + chan-name = "red-1"; + led-cur = /bits/ 8 <0xfa>; + max-cur = /bits/ 8 <0xff>; + reg = <7>; + color = ; + function-enumerator = <1>; }; - red2 { - chan-name = "red2"; - label = "red:chan2"; - led-cur = [fa]; - max-cur = [ff]; + led@8 { + chan-name = "red-2"; + led-cur = /bits/ 8 <0xfa>; + max-cur = /bits/ 8 <0xff>; + reg = <8>; + color = ; + function-enumerator = <2>; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts new file mode 100644 index 000000000..8d1505cfe --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts @@ -0,0 +1,435 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2022, Pawel Dembicki . + +#include "qcom-ipq4019.dtsi" +#include +#include +#include +#include + +/ { + model = "ZTE MF286D"; + compatible = "zte,mf286d"; + + aliases { + led-boot = &led_internal; + led-failsafe = &led_internal; + led-running = &led_internal; + led-upgrade = &led_internal; + }; + + chosen { + /* + * bootargs forced by u-boot bootipq command: + * 'ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs rootwait' + */ + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + gpio-restart { + compatible = "gpio-restart"; + gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>; + }; + + leds { + compatible = "gpio-leds"; + + led_internal: led-0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&tlmm 10 GPIO_ACTIVE_LOW>; + label = "blue:internal_led"; + default-state = "keep"; + }; + + led-1 { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + wifi { + label = "wifi"; + linux,code = ; + gpios = <&tlmm 11 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 68 GPIO_ACTIVE_LOW>; + }; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + /* u-boot is looking for "n25q128a11" property */ + compatible = "jedec,spi-nor", "n25q128a11"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0xf0000 0xc0000>; + read-only; + }; + + partition@1b0000 { + label = "0:reserved1"; + reg = <0x1b0000 0x50000>; + read-only; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_config_0>; +}; + +&gmac1 { + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_config_0>; + mac-address-increment = <1>; +}; + +&nand { + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + status = "okay"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fota-flag"; + reg = <0x0 0xa0000>; + read-only; + }; + + partition@a0000 { + label = "ART"; + reg = <0xa0000 0x80000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@120000 { + label = "mac"; + reg = <0x120000 0x80000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; + + partition@1a0000 { + label = "reserved2"; + reg = <0x1a0000 0xc0000>; + read-only; + }; + + partition@260000 { + label = "cfg-param"; + reg = <0x260000 0x400000>; + read-only; + }; + + partition@660000 { + label = "log"; + reg = <0x660000 0x400000>; + }; + + partition@a60000 { + label = "oops"; + reg = <0xa60000 0xa0000>; + }; + + partition@b00000 { + label = "reserved3"; + reg = <0xb00000 0x500000>; + read-only; + }; + + partition@1000000 { + label = "web"; + reg = <0x1000000 0x800000>; + }; + + partition@1800000 { + label = "rootfs"; + reg = <0x1800000 0x1d00000>; + }; + + partition@3500000 { + label = "data"; + reg = <0x3500000 0x1900000>; + }; + + partition@4e00000 { + label = "fota"; + reg = <0x4e00000 0x3200000>; + }; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + i2c_0_pins: i2c_0_pinmux { + mux { + pins = "gpio20", "gpio21"; + function = "blsp_i2c0"; + bias-disable; + }; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio52", "gpio53", "gpio58", + "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + pulldowns { + pins = "gpio54", "gpio55", "gpio56", + "gpio57", "gpio60", + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>; + mac-address-increment = <2>; + qcom,ath10k-calibration-variant = "zte,mf286d"; +}; + +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_config_0>; + mac-address-increment = <3>; + qcom,ath10k-calibration-variant = "zte,mf286d"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts new file mode 100644 index 000000000..3f16b56a5 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts @@ -0,0 +1,442 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2022, Pawel Dembicki . +// Copyright (c) 2022, Giammarco Marzano . + +#include "qcom-ipq4019.dtsi" +#include +#include +#include +#include + +/ { + model = "ZTE MF289F"; + compatible = "zte,mf289f"; + + aliases { + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + chosen { + /* + * bootargs forced by u-boot bootipq command: + * 'ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs rootwait' + */ + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + /* + * This node is used to restart modem module to avoid anomalous + * behaviours on initial communication. + */ + gpio-restart { + compatible = "gpio-restart"; + gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>; + }; + + leds { + compatible = "gpio-leds"; + + led_status: led-0 { + label = "blue:power"; + function = LED_FUNCTION_POWER; + color = ; + gpios = <&tlmm 35 GPIO_ACTIVE_LOW>; + }; + + led-1 { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + key-reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + }; + + key-wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 68 GPIO_ACTIVE_LOW>; + }; + }; + + soc { + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + ess-switch@c000000 { + status = "okay"; + switch_lan_bmp = <0x20>; + switch_wan_bmp = <0x4>; + }; + + edma@c080000 { + status = "okay"; + }; + }; +}; + +&prng { + status = "okay"; +}; + +&mdio { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; +}; + +&watchdog { + status = "okay"; +}; + +&blsp_dma { + status = "okay"; +}; + +&usb2 { + status = "okay"; +}; + +&usb3 { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>, + <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0xf0000 0xc0000>; + read-only; + }; + + partition@1b0000 { + label = "0:reserved1"; + reg = <0x1b0000 0x50000>; + read-only; + }; + }; + }; + + spi-nand@1 { /* flash@1 ? */ + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fota-flag"; + reg = <0x0 0xa0000>; + read-only; + }; + + partition@a0000 { + label = "ART"; + reg = <0xa0000 0x80000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@120000 { + label = "mac"; + reg = <0x120000 0x80000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; + + partition@1a0000 { + label = "reserved2"; + reg = <0x1a0000 0xc0000>; + read-only; + }; + + partition@260000 { + label = "cfg-param"; + reg = <0x260000 0x400000>; + read-only; + }; + + partition@660000 { + label = "log"; + reg = <0x660000 0x400000>; + }; + + partition@a60000 { + label = "oops"; + reg = <0xa60000 0xa0000>; + }; + + partition@b00000 { + label = "reserved3"; + reg = <0xb00000 0x500000>; + read-only; + }; + + partition@1000000 { + label = "web"; + reg = <0x1000000 0x800000>; + }; + + partition@1800000 { + label = "rootfs"; + reg = <0x1800000 0x1d00000>; + }; + + partition@3500000 { + label = "data"; + reg = <0x3500000 0x1900000>; + }; + + partition@4e00000 { + label = "fota"; + reg = <0x4e00000 0x3200000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_mac_0>; + vlan_tag = <1 0x20>; +}; + +&gmac1 { + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_mac_0>; + mac-address-increment = <1>; + vlan_tag = <2 0x4>; +}; + + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + i2c_0_pins: i2c_0_pinmux { + mux { + pins = "gpio20", "gpio21"; + function = "blsp_i2c0"; + bias-disable; + }; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12", "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0>; + mac-address-increment = <2>; + qcom,ath10k-calibration-variant = "zte,mf289f"; +}; + +/* This node is used only on AT2 version for 5Ghz on IPQ4019 with board-id=21 */ +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0>; + mac-address-increment = <3>; + qcom,ath10k-calibration-variant = "zte,mf289f"; +}; + +/* This node is used only on AT1 version for 5Ghz on QCA9984 */ +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 40 GPIO_ACTIVE_LOW>; + clkreq-gpio = <&tlmm 39 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi2: wifi@1,0 { + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_mac_0>; + mac-address-increment = <4>; + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + qcom,ath10k-calibration-variant = "zte,mf289f"; + }; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mr8300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mr8300.dts new file mode 100644 index 000000000..057aa8802 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mr8300.dts @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-xx8300.dtsi" + +/ { + model = "Linksys MR8300 (Dallas)"; + compatible = "linksys,mr8300", "qcom,ipq4019"; + + aliases { + led-boot = &led_blue; + led-failsafe = &led_red; + led-running = &led_blue; + led-upgrade = &led_amber; + serial0 = &blsp1_uart1; + }; + + // Top panel LEDs, above Linksys logo + leds { + compatible = "gpio-leds"; + + led_red: red { + label = "red:alarm"; + gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>; + }; + + led_amber: amber { + label = "amber:programming"; + gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + + led_blue: blue { + label = "blue:power"; + gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; + }; + + // On back panel, above USB socket + + led_usb: usb { + label = "green:usb"; + gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; + trigger-sources = <&usb3_port1>, <&usb3_port2>, + <&usb2_port1>; + linux,default-trigger = "usbport"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "linksys-mr8300-v0-fcc"; +}; + +&wifi1 { + status = "okay"; + ieee80211-freq-limit = <5170000 5330000>; + qcom,ath10k-calibration-variant = "linksys-mr8300-v0-fcc"; +}; + +&wifi2 { + status = "okay"; + ieee80211-freq-limit = <5490000 5835000>; + qcom,ath10k-calibration-variant = "linksys-mr8300-v0-fcc"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts new file mode 100644 index 000000000..bdcc31fef --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts @@ -0,0 +1,354 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "EdgeCore OAP-100"; + compatible = "edgecore,oap100"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + chosen { + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + soc { + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + usb2@60f8800 { + status = "okay"; + + dwc3@6000000 { + #address-cells = <1>; + #size-cells = <0>; + + usb2_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + }; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + switch_mac_mode = <0x0>; /* mac mode for RGMII RMII */ + switch_initvlas = <0x0007c 0x54>; /* port0 status */ + switch_lan_bmp = <0x10>; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + key { + compatible = "gpio-keys"; + + button@1 { + label = "reset"; + linux,code = ; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,input-type = <1>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system: led_system { + label = "green:system"; + gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>; + }; + + led_2g { + label = "blue:wlan2g"; + gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>; + }; + + led_5g { + label = "blue:wlan5g"; + gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + usb { + gpio-export,name = "usb-power"; + gpio-export,output = <1>; + gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>; + }; + + poe { + gpio-export,name = "poe-power"; + gpio-export,output = <0>; + gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_0_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio53", "gpio58", "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + pulldowns { + pins = "gpio54", "gpio55", "gpio56", + "gpio57", "gpio60", "gpio61", + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio68", "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; +}; + +&cryptobam { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + linux,modalias = "m25p80", "gd25q256"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition0@0 { + label = "0:SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + partition1@40000 { + label = "0:MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + partition2@60000 { + label = "0:QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + partition3@c0000 { + label = "0:CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + partition4@d0000 { + label = "0:DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + partition5@e0000 { + label = "0:APPSBLENV"; + reg = <0x000e0000 0x00010000>; + read-only; + }; + partition6@f0000 { + label = "0:APPSBL"; + reg = <0x000f0000 0x00080000>; + read-only; + }; + partition7@170000 { + label = "0:ART"; + reg = <0x00170000 0x00010000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + }; + }; +}; + +&nand { + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + status = "okay"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "rootfs"; + reg = <0x00000000 0x4000000>; + }; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_0_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; + qcom,ath10k-calibration-variant = "Edgecore OAP100"; +}; + +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; + qcom,ath10k-calibration-variant = "Edgecore OAP100"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi new file mode 100644 index 000000000..bdbee7f83 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi @@ -0,0 +1,325 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + aliases { + led-boot = &led_status_white; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_blue; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + status = "okay"; + + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + + switch_lan_bmp = <0x1c>; + switch_wan_bmp = <0x02>; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "green:power"; + gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led-1 { + label = "red:power"; + gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + + led_status_green: led-2 { + label = "green:status"; + gpios = <&tlmm 53 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led-3 { + label = "red:status"; + gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: led-4 { + label = "blue:status"; + gpios = <&tlmm 57 GPIO_ACTIVE_HIGH>; + }; + + led_status_white: led-5 { + label = "white:status"; + gpios = <&tlmm 60 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&vqmmc { + status = "okay"; +}; + +&sdhci { + status = "okay"; + + pinctrl-0 = <&sd_pins>; + pinctrl-names = "default"; + cd-gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; + vqmmc-supply = <&vqmmc>; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + i2c_0_pins: i2c_0_pinmux { + pinmux { + function = "blsp_i2c0"; + pins = "gpio58", "gpio59"; + bias-disable; + }; + }; + + sd_pins: sd_pins { + pinmux { + function = "sdio"; + pins = "gpio23", "gpio24", "gpio25", "gpio26", + "gpio28", "gpio29", "gpio30", "gpio31"; + drive-strength = <10>; + }; + + pinmux_sd_clk { + function = "sdio"; + pins = "gpio27"; + drive-strength = <16>; + }; + + pinmux_sd7 { + function = "sdio"; + pins = "gpio32"; + drive-strength = <10>; + bias-disable; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_i2c3 { + pinctrl-0 = <&i2c_0_pins>; + pinctrl-names = "default"; + + status = "okay"; + + led-controller@27 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,tlc59108"; /* really is tlc59208f */ + reg = <0x27>; + + led0@0 { + label = "rgb:led0"; + reg = <0x0>; + linux,default-trigger = "default-on"; + }; + + led1@1 { + label = "rgb:led1"; + reg = <0x1>; + linux,default-trigger = "default-on"; + }; + + led2@2 { + label = "rgb:led2"; + reg = <0x2>; + linux,default-trigger = "default-on"; + }; + + led3@3 { + label = "rgb:led3"; + reg = <0x3>; + linux,default-trigger = "default-on"; + }; + + led4@4 { + label = "rgb:led4"; + reg = <0x4>; + linux,default-trigger = "default-on"; + }; + + led5@5 { + label = "rgb:led5"; + reg = <0x5>; + linux,default-trigger = "default-on"; + }; + + led6@6 { + label = "rgb:led6"; + reg = <0x6>; + linux,default-trigger = "default-on"; + }; + + led7@7 { + label = "rgb:led7"; + reg = <0x7>; + linux,default-trigger = "default-on"; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + vlan_tag = <1 0x1c>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <0>; + vlan_tag = <2 0x02>; +}; + +&pcie0 { + status = "okay"; + + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + ieee80211-freq-limit = <5470000 5875000>; + qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60"; + }; + }; +}; + +&wifi0 { + status = "okay"; + + qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-ca100.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts similarity index 53% rename from target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-ca100.dts rename to target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts index 04028d112..2d0655114 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-ca100.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts @@ -1,4 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2017-2020, Sven Eckelmann + * Copyright (c) 2018, Marek Lindner + */ #include "qcom-ipq4019.dtsi" #include @@ -6,15 +9,8 @@ #include / { - model = "LEGUANG CA100"; - compatible = "leguang,ca100", "qcom,ipq4019"; - - aliases { - led-boot = &led_status_blue; - led-failsafe = &led_status_red; - led-running = &led_status_blue; - led-upgrade = &led_status_green; - }; + model = "Plasma Cloud PA2200"; + compatible = "plasmacloud,pa2200"; soc { rng@22000 { @@ -23,8 +19,6 @@ mdio@90000 { status = "okay"; - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; }; ess-psgmii@98000 { @@ -37,13 +31,6 @@ qcom,wifi_glb_cfg = ; }; - tcsr@194b000 { - compatible = "qcom,tcsr"; - reg = <0x194b000 0x100>; - qcom,usb-hsphy-mode-select = ; - status = "okay"; - }; - ess_tcsr@1953000 { compatible = "qcom,tcsr"; reg = <0x1953000 0x1000>; @@ -65,6 +52,9 @@ }; ess-switch@c000000 { + switch_lan_bmp = <0x10>; + switch_wan_bmp = <0x20>; + status = "okay"; }; @@ -79,26 +69,72 @@ reset { label = "reset"; gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; - linux,code = ; + linux,code = ; }; }; + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_status_blue; + led-running = &led_power_orange; + led-upgrade = &led_status_blue; + }; + leds { compatible = "gpio-leds"; - led_status_green: status-green { - label = "green:status"; - gpios = <&tlmm 44 GPIO_ACTIVE_LOW>; + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; }; - led_status_red: status-red { - label = "red:status"; - gpios = <&tlmm 45 GPIO_ACTIVE_LOW>; - }; - - led_status_blue: status-blue { - label = "blue:status"; + 2g_blue { + label = "blue:2g"; gpios = <&tlmm 46 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + 2g_green { + label = "green:5g1"; + gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + 5g2_green { + label = "green:5g2"; + gpios = <&tlmm 48 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy2tpt"; + }; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; }; }; }; @@ -114,69 +150,12 @@ cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; flash@0 { + #address-cells = <1>; + #size-cells = <1>; compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "SBL1"; - reg = <0x0 0x40000>; - read-only; - }; - - partition@40000 { - label = "MIBIB"; - reg = <0x40000 0x20000>; - read-only; - }; - - partition@60000 { - label = "QSEE"; - reg = <0x60000 0x60000>; - read-only; - }; - - partition@c0000 { - label = "CDT"; - reg = <0xc0000 0x10000>; - read-only; - }; - - partition@d0000 { - label = "DDRPARAMS"; - reg = <0xd0000 0x10000>; - read-only; - }; - - partition@e0000 { - label = "APPSBLENV"; - reg = <0xe0000 0x10000>; - read-only; - }; - - partition@f0000 { - label = "APPSBL"; - reg = <0xf0000 0x80000>; - read-only; - }; - - partition@170000 { - label = "ART"; - reg = <0x170000 0x10000>; - read-only; - }; - - partition@180000 { - compatible = "denx,fit"; - label = "firmware"; - reg = <0x180000 0x1e80000>; - }; - }; + /* partitions are passed via bootloader */ }; }; @@ -190,51 +169,42 @@ status = "okay"; }; -&tlmm { - mdio_pins: mdio_pinmux { - mux_1 { - pins = "gpio6"; - function = "mdio"; - bias-pull-up; - }; +&gmac0 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; - mux_2 { - pins = "gpio7"; - function = "mdc"; - bias-pull-up; - }; - }; +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; - serial_pins: serial_pinmux { - mux { - pins = "gpio16", "gpio17"; - function = "blsp_uart0"; - bias-disable; - }; - }; + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; - spi_0_pins: spi_0_pinmux { - pinmux { - function = "blsp_spi0"; - pins = "gpio13", "gpio14", "gpio15"; - drive-strength = <12>; - bias-disable; - }; - - pinmux_cs { - function = "gpio"; - pins = "gpio12"; - drive-strength = <2>; - bias-disable; - output-high; + wifi2: wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; + ieee80211-freq-limit = <5170000 5350000>; }; }; }; &wifi0 { status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; }; &wifi1 { status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; + ieee80211-freq-limit = <5470000 5875000>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts index 4c3ad862d..0896374ab 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts @@ -7,8 +7,12 @@ compatible = "p2w,r619ac-128m"; }; -&rootfs_part1 { +&nand_rootfs { + /* + * Watch out: stock MIBIB is set up for a 64MiB chip. + * If a 128MiB flash chip is used, make sure to have + * the right values in MIBIB or the device might not + * boot. + */ reg = <0x0 0x8000000>; }; - -/delete-node/ &rootfs_part2; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-64m.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-64m.dts new file mode 100644 index 000000000..6c8821a90 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-64m.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-r619ac.dtsi" + +/ { + model = "P&W R619AC 64M"; + compatible = "p2w,r619ac-64m"; +}; + +&nand_rootfs { + reg = <0x0 0x4000000>; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts deleted file mode 100644 index d257e4b26..000000000 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "qcom-ipq4019-r619ac.dtsi" - -/ { - model = "P&W R619AC"; - compatible = "p2w,r619ac"; -}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi index d8b68ab33..87e0d103b 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi @@ -4,8 +4,13 @@ #include #include #include +#include / { + chosen { + bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1"; + }; + aliases { led-boot = &led_sys; led-failsafe = &led_sys; @@ -14,10 +19,6 @@ label-mac-device = &gmac0; }; - chosen { - bootargs-append = " root=/dev/ubiblock0_1 rootfstype=squashfs"; - }; - soc { rng@22000 { status = "okay"; @@ -84,24 +85,30 @@ leds { compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - led_sys: sys { + led_sys: led-0 { label = "blue:sys"; gpios = <&tlmm 39 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_POWER; }; - wlan2g { + led-1 { label = "blue:wlan2g"; gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0tpt"; + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <0>; }; - wlan5g { + led-2 { label = "blue:wlan5g"; gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy1tpt"; + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <1>; }; }; @@ -175,21 +182,38 @@ read-only; }; - partition@1 { - label = "Bootloader"; - reg = <0x0 0x170000>; - read-only; - }; - partition@170000 { label = "ART"; reg = <0x170000 0x10000>; read-only; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; - partition@180000 { - label = "unused"; - reg = <0x180000 0xe80000>; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + }; + }; +}; + +&nand { + status = "okay"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + nand_rootfs: partition@0 { + label = "ubi"; + /* reg defined in 64M/128M variant dts. */ }; }; }; @@ -205,33 +229,11 @@ status = "okay"; }; -&nand { - status = "okay"; - - nand@0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - rootfs_part1: partition@0 { - label = "rootfs"; - reg = <0x0 0x4000000>; - }; - - rootfs_part2: partition@4000000 { - label = "reserve"; - reg = <0x4000000 0x4000000>; - }; - }; - }; -}; - &pcie0 { status = "okay"; - pinctrl-0 = <&pcie_pins>; pinctrl-names = "default"; - perst-gpio = <&tlmm 4 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&pcie_pins>; + perst-gpio = <&tlmm 4 GPIO_ACTIVE_LOW>; wake-gpio = <&tlmm 40 GPIO_ACTIVE_HIGH>; /* Free slot for use */ @@ -259,8 +261,8 @@ mux { pins = "gpio2"; function = "gpio"; - bias-pull-down; output-low; + bias-pull-down; }; }; @@ -299,29 +301,6 @@ bias-disable; }; }; - - led_pins: led_pinmux { - mux { - pins = "gpio32", "gpio39", "gpio50"; - function = "gpio"; - bias-pull-up; - output-low; - }; - - mux_1 { - pins = "gpio52"; - function = "gpio"; - bias-pull-up; - output-high; - }; - - mux_2 { - pins = "gpio61"; - function = "gpio"; - bias-pull-down; - output-high; - }; - }; }; ðphy0 { @@ -372,10 +351,14 @@ &wifi0 { status = "okay"; - qcom,ath10k-calibration-variant = "R619AC"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; + qcom,ath10k-calibration-variant = "P&W-R619AC"; }; &wifi1 { status = "okay"; - qcom,ath10k-calibration-variant = "R619AC"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; + qcom,ath10k-calibration-variant = "P&W-R619AC"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts new file mode 100644 index 000000000..a80399980 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR RBR50"; + compatible = "netgear,rbr50"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; + + soc { + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + }; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts new file mode 100644 index 000000000..4d0a9132c --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR RBS50"; + compatible = "netgear,rbs50"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; + + soc { + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + }; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-ac42u.dts similarity index 53% rename from target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts rename to target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-ac42u.dts index 1ece9ec4b..3d58eac09 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-ac42u.dts @@ -1,43 +1,25 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 X-WRT - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "qcom-ipq4019.dtsi" #include #include +#include #include / { - model = "ASUS RT-ACRH17"; - compatible = "asus,rt-acrh17"; + model = "ASUS RT-AC42U"; + compatible = "asus,rt-ac42u"; memory { device_type = "memory"; - reg = <0x80000000 0x10000000>; + reg = <0x80000000 0x10000000>; /* 256MB */ }; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; - }; - - chosen { - bootargs-append = " ubi.mtd=UBI_DEV"; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; soc { @@ -77,12 +59,23 @@ qcom,wifi_noc_memtype_m0_m2 = ; }; - usb2@60f8800 { - status = "okay"; - }; - usb3@8af8800 { status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; }; crypto@8e3a000 { @@ -121,50 +114,70 @@ leds { compatible = "gpio-leds"; - power: status { - label = "blue:status"; + led_power: led-0 { + color = ; + function = LED_FUNCTION_STATUS; gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; + label = "blue:status"; }; - lan1 { - label = "blue:lan1"; + led-1 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "90000.mdio-1:04:link"; + }; + + led-2 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "none"; + }; + + led-3 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <0>; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led-4 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <1>; + gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-5 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; gpios = <&tlmm 45 GPIO_ACTIVE_LOW>; }; - lan2 { - label = "blue:lan2"; + led-6 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; }; - lan3 { - label = "blue:lan3"; + led-7 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; }; - lan4 { - label = "blue:lan4"; + led-8 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <4>; gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; }; - - wan_blue { - label = "blue:wan"; - gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>; - }; - - wan_red { - label = "red:wan"; - gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; - }; - - wlan2g { - label = "blue:wlan2g"; - gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; - }; - - wlan5g { - label = "blue:wlan5g"; - gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; - }; }; }; @@ -180,6 +193,38 @@ status = "okay"; }; +&tlmm { + serial_0_pins: serial0_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio53", "gpio58", "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + pulldowns { + pins = "gpio55", "gpio56", "gpio57", "gpio60", + "gpio62", "gpio63", "gpio64", "gpio65", + "gpio66", "gpio67", "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_0_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + &nand { pinctrl-0 = <&nand_pins>; pinctrl-names = "default"; @@ -192,77 +237,43 @@ #size-cells = <1>; partition@0 { - label = "Bootloader"; - reg = <0x000000000000 0x000000400000>; + label = "SBL1"; + reg = <0x00000000 0x00080000>; + read-only; + }; + partition@80000 { + label = "MIBIB"; + reg = <0x00080000 0x00080000>; + read-only; + }; + partition@100000 { + label = "QSEE"; + reg = <0x00100000 0x00100000>; + read-only; + }; + partition@200000 { + label = "CDT"; + reg = <0x00200000 0x00080000>; + read-only; + }; + partition@280000 { + label = "APPSBL"; + reg = <0x00280000 0x00140000>; + read-only; + }; + partition@3C0000 { + label = "APPSBLENV"; + reg = <0x003C0000 0x00040000>; read-only; }; partition@400000 { - label = "UBI_DEV"; - reg = <0x000000400000 0x000007C00000>; + label = "ubi"; + reg = <0x00400000 0x07C00000>; }; }; }; }; -&tlmm { - serial_pins: serial_pinmux { - mux { - pins = "gpio16", "gpio17"; - function = "blsp_uart0"; - bias-disable; - }; - }; - - nand_pins: nand_pins { - pullups { - pins = "gpio53", "gpio58", - "gpio59"; - function = "qpic"; - bias-pull-up; - }; - - pulldowns { - pins = "gpio55", "gpio56", - "gpio57", "gpio60", - "gpio62", "gpio63", "gpio64", - "gpio65", "gpio66", "gpio67", - "gpio69"; - function = "qpic"; - bias-pull-down; - }; - }; -}; - -&pcie0 { - status = "okay"; - perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; - wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; - - bridge@0,0 { - reg = <0x00000000 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - ranges; - - wifi2: wifi@1,0 { - compatible = "qcom,ath10k"; - status = "okay"; - reg = <0x00010000 0 0 0 0>; - }; - }; -}; - -&wifi0 { - status = "okay"; - qcom,ath10k-calibration-variant = "RT-ACRH17"; -}; - -&blsp1_uart1 { - pinctrl-0 = <&serial_pins>; - pinctrl-names = "default"; - status = "okay"; -}; - &usb3_ss_phy { status = "okay"; }; @@ -271,6 +282,28 @@ status = "okay"; }; -&usb2_hs_phy { +&wifi0 { status = "okay"; + qcom,ath10k-calibration-variant = "ASUS-RT-AC42U"; +}; + +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + clkreq-gpio = <&tlmm 39 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi2: wifi@1,0 { + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + + qcom,ath10k-calibration-variant = "ASUS-RT-AC42U"; + }; + }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts new file mode 100644 index 000000000..80bcb2e20 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR SRR60"; + compatible = "netgear,srr60"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K@44881K(firmware-2)ro,5M(device_table)ro,17M(cp_file)ro,102737K(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts new file mode 100644 index 000000000..65bb7ac39 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR SRS60"; + compatible = "netgear,srs60"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K@44881K(firmware-2)ro,5M(device_table)ro,17M(cp_file)ro,102737K(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts index 747029b32..4efcdaf39 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "qcom-ipq4019-u4019.dtsi" #include #include @@ -33,49 +31,52 @@ reg = <0x0 0x40000>; read-only; }; - partition@40000 { label = "0:MIBIB"; reg = <0x40000 0x20000>; read-only; }; - partition@60000 { label = "0:QSEE"; reg = <0x60000 0x60000>; read-only; }; - partition@c0000 { label = "0:CDT"; reg = <0xc0000 0x10000>; read-only; }; - partition@d0000 { label = "0:DDRPARAMS"; reg = <0xd0000 0x10000>; read-only; }; - partition@e0000 { label = "0:APPSBLENV"; reg = <0xe0000 0x10000>; read-only; }; - partition@f0000 { label = "0:APPSBL"; reg = <0xf0000 0x80000>; read-only; }; - partition@170000 { label = "0:ART"; reg = <0x170000 0x10000>; read-only; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; partition@180000 { compatible = "denx,fit"; label = "firmware"; @@ -84,3 +85,4 @@ }; }; }; + diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019.dtsi index 5275a55ff..ece80571b 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019.dtsi @@ -154,7 +154,6 @@ function = "mdio"; bias-pull-up; }; - mux_2 { pins = "gpio7"; function = "mdc"; @@ -169,7 +168,6 @@ bias-disable; }; }; - serial_1_pins: serial1_pinmux { mux { pins = "gpio8", "gpio9"; @@ -219,8 +217,12 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts index a07286346..09cbfaca9 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts @@ -36,7 +36,6 @@ reg = <0x87000000 0x500000>; no-map; }; - wifi_dump@87500000 { reg = <0x87500000 0x600000>; no-map; @@ -50,7 +49,7 @@ }; chosen { - bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1 clk_ignore_unused"; + bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1"; }; soc { @@ -132,7 +131,6 @@ function = "led0"; bias-pull-down; }; - mux_2 { pins = "gpio40"; function = "led4"; @@ -208,6 +206,17 @@ label = "0:ART"; reg = <0x170000 0x010000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; @@ -362,10 +371,30 @@ }; }; +&gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <2 0x20>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac-nand.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac-nand.dts deleted file mode 100644 index cb898503c..000000000 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac-nand.dts +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "qcom-ipq4019-wr142ac.dtsi" - -/ { - model = "Century WR142AC NAND"; - compatible = "century,wr142ac-nand"; - - chosen { - bootargs-append = " root=/dev/ubiblock0_1 rootfstype=squashfs"; - }; -}; - -&blsp1_spi1 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - status = "okay"; - cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; - - flash@0 { - reg = <0>; - compatible = "jedec,spi-nor"; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "Bootloader"; - reg = <0x0 0x170000>; - }; - - partition@170000 { - label = "ART"; - reg = <0x170000 0x10000>; - read-only; - }; - - partition@180000 { - label = "oem-firmware"; - reg = <0x180000 0x1e80000>; - }; - }; - }; -}; - -&nand { - status = "okay"; - - nand@0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "rootfs"; - reg = <0x0 0x8000000>; - }; - }; - }; -}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts index cdf0cfe64..1f8c830d9 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts @@ -254,7 +254,8 @@ wifi@0,0 { compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_9000>, <&macaddr_orgdata_32>; qcom,ath10k-calibration-variant = "Buffalo-WTR-M2133HP"; }; }; @@ -340,10 +341,25 @@ read-only; }; - art: partition@b00000 { + partition@b00000 { label = "ART"; reg = <0x0b00000 0x0080000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + + precal_art_9000: precal@9000 { + reg = <0x5000 0x2f20>; + }; }; partition@b80000 { @@ -356,6 +372,22 @@ label = "ORGDATA"; reg = <0x0c00000 0x0080000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_orgdata_20: macaddr@20 { + reg = <0x20 0x6>; + }; + macaddr_orgdata_26: macaddr@26 { + reg = <0x26 0x6>; + }; + macaddr_orgdata_2c: macaddr@2c { + reg = <0x2c 0x6>; + }; + macaddr_orgdata_32: macaddr@32 { + reg = <0x32 0x6>; + }; }; partition@c80000 { @@ -386,12 +418,16 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_orgdata_26>; qcom,ath10k-calibration-variant = "Buffalo-WTR-M2133HP"; ieee80211-freq-limit = <2400000 2483000>; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_orgdata_2c>; qcom,ath10k-calibration-variant = "Buffalo-WTR-M2133HP"; }; @@ -403,11 +439,13 @@ }; &gmac0 { - mtd-mac-address = <&orgdata 0x20>; + nvmem-cells = <&macaddr_orgdata_20>; + nvmem-cell-names = "mac-address"; }; &gmac1 { - mtd-mac-address = <&orgdata 0x20>; + nvmem-cells = <&macaddr_orgdata_20>; + nvmem-cell-names = "mac-address"; }; &usb3_ss_phy { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts similarity index 53% rename from target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac.dts rename to target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts index 9bc60c13e..95a0ded6d 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts @@ -1,22 +1,27 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qcom-ipq4019-wr142ac.dtsi" +/dts-v1/; + +#include "qcom-ipq4019-x1pro.dtsi" +#include +#include / { - model = "Century WR142AC"; - compatible = "century,wr142ac"; + model = "Telco X1 Pro"; + compatible = "tel,x1pro","qcom,ipq4019"; }; &blsp1_spi1 { pinctrl-0 = <&spi_0_pins>; pinctrl-names = "default"; status = "okay"; - cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_LOW>; flash@0 { reg = <0>; compatible = "jedec,spi-nor"; spi-max-frequency = <24000000>; + broken-flash-reset; partitions { compatible = "fixed-partitions"; @@ -24,53 +29,56 @@ #size-cells = <1>; partition@0 { - label = "SBL1"; + label = "0:SBL1"; reg = <0x0 0x40000>; read-only; }; - partition@40000 { - label = "MIBIB"; + label = "0:MIBIB"; reg = <0x40000 0x20000>; read-only; }; - partition@60000 { - label = "QSEE"; + label = "0:QSEE"; reg = <0x60000 0x60000>; read-only; }; - partition@c0000 { - label = "CDT"; + label = "0:CDT"; reg = <0xc0000 0x10000>; read-only; }; - partition@d0000 { - label = "DDRPARAMS"; + label = "0:DDRPARAMS"; reg = <0xd0000 0x10000>; read-only; }; - partition@e0000 { - label = "APPSBLENV"; + label = "0:APPSBLENV"; reg = <0xe0000 0x10000>; read-only; }; - partition@f0000 { - label = "APPSBL"; + label = "0:APPSBL"; reg = <0xf0000 0x80000>; read-only; }; - - partition@170000 { - label = "ART"; + art: partition@170000 { + label = "0:ART"; reg = <0x170000 0x10000>; read-only; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; partition@180000 { compatible = "denx,fit"; label = "firmware"; @@ -79,3 +87,17 @@ }; }; }; + +&gmac0 { + status = "okay"; + + mtd-mac-address = <&art 0x5006>; + mtd-mac-address-increment = <2>; +}; + +&gmac1 { + status = "okay"; + + mtd-mac-address = <&art 0x5006>; + mtd-mac-address-increment = <3>; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dtsi similarity index 70% rename from target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac.dtsi rename to target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dtsi index ab3c67c2f..4edd88cde 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wr142ac.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dtsi @@ -6,14 +6,18 @@ #include / { + compatible = "tel,x1pro","qcom,ipq4019"; aliases { - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + serial0 = &blsp1_uart1; + serial1 = &blsp1_uart2; }; - + soc { + rng@22000 { status = "okay"; }; @@ -22,6 +26,8 @@ status = "okay"; pinctrl-0 = <&mdio_pins>; pinctrl-names = "default"; + reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; }; ess-psgmii@98000 { @@ -38,6 +44,7 @@ compatible = "qcom,tcsr"; reg = <0x194b000 0x100>; qcom,usb-hsphy-mode-select = ; + status = "okay"; }; ess_tcsr@1953000 { @@ -59,7 +66,7 @@ #address-cells = <1>; #size-cells = <0>; - usb2_port1: port@1 { + port@1 { reg = <1>; #trigger-source-cells = <0>; }; @@ -73,22 +80,18 @@ #address-cells = <1>; #size-cells = <0>; - usb3_port1: port@1 { + port@1 { reg = <1>; #trigger-source-cells = <0>; }; - usb3_port2: port@2 { + port@2 { reg = <2>; #trigger-source-cells = <0>; }; }; }; - crypto@8e3a000 { - status = "okay"; - }; - watchdog@b017000 { status = "okay"; }; @@ -100,45 +103,26 @@ edma@c080000 { status = "okay"; }; - }; - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; - led_power: power { - label = "green:power"; - gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; + led_status: status { + label = "green:status"; + gpios = <&tlmm 68 GPIO_ACTIVE_LOW>; + }; }; - usb { - label = "green:usb"; - gpios = <&tlmm 36 GPIO_ACTIVE_LOW>; - linux,default-trigger = "usbport"; - trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>; - }; + keys { + compatible = "gpio-keys"; - wlan2g { - label = "green:wlan2g"; - gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - wlan5g { - label = "green:wlan5g"; - gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; - linux,code = ; + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; }; }; }; @@ -159,10 +143,6 @@ status = "okay"; }; -&cryptobam { - status = "okay"; -}; - &qpic_bam { status = "okay"; }; @@ -174,7 +154,6 @@ function = "mdio"; bias-pull-up; }; - mux_2 { pins = "gpio7"; function = "mdc"; @@ -189,7 +168,6 @@ bias-disable; }; }; - serial_1_pins: serial1_pinmux { mux { pins = "gpio8", "gpio9"; @@ -199,14 +177,14 @@ }; spi_0_pins: spi_0_pinmux { - pin { + pinmux { function = "blsp_spi0"; pins = "gpio13", "gpio14", "gpio15"; drive-strength = <12>; bias-disable; }; - pin_cs { + pinmux_cs { function = "gpio"; pins = "gpio12"; drive-strength = <2>; @@ -217,9 +195,10 @@ led_pins: led_pinmux { mux { - pins = "gpio36", "gpio40"; function = "gpio"; - bias-pull-down; + pins = "gpio68"; + bias-disabled; + output-low; }; }; }; @@ -238,10 +217,12 @@ &wifi0 { status = "okay"; - qcom,ath10k-calibration-variant = "WR142AC"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; }; &wifi1 { status = "okay"; - qcom,ath10k-calibration-variant = "WR142AC"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi new file mode 100644 index 000000000..cb75e86c7 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi @@ -0,0 +1,310 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/* + * Device Tree Source for Linksys xx8300 (Dallas) + * + * Copyright (C) 2019 Jeff Kletsky + * Updated 2020 Hans Geiblinger + * + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + + // + // OEM U-Boot provides either + // init=/sbin/init rootfstype=ubifs ubi.mtd=11,2048 \ + // root=ubi0:ubifs rootwait rw + // or the same with ubi.mtd=13,2048 + // + +/ { + chosen { + bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro"; + }; + + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + + dwc3@6000000 { + #address-cells = <1>; + #size-cells = <0>; + + usb2_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + }; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + regulator-usb-vbus { + compatible = "regulator-fixed"; + regulator-name = "USB_VBUS"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; + gpio = <&tlmm 68 GPIO_ACTIVE_LOW>; + }; +}; + + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + status = "okay"; + pinctrl-0 = <&serial_0_pins>; + pinctrl-names = "default"; + +}; + +&cryptobam { + status = "okay"; +}; + +&nand { + status = "okay"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "sbl1"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "mibib"; + reg = <0x100000 0x100000>; + read-only; + }; + + partition@200000 { + label = "qsee"; + reg = <0x200000 0x100000>; + read-only; + }; + + partition@300000 { + label = "cdt"; + reg = <0x300000 0x80000>; + read-only; + }; + + partition@380000 { + label = "appsblenv"; + reg = <0x380000 0x80000>; + read-only; + }; + + partition@400000 { + label = "ART"; + reg = <0x400000 0x80000>; + read-only; + }; + + partition@480000 { + label = "appsbl"; + reg = <0x480000 0x200000>; + read-only; + }; + + partition@680000 { + label = "u_env"; + reg = <0x680000 0x80000>; + // writable -- U-Boot environment + }; + + partition@700000 { + label = "s_env"; + reg = <0x700000 0x40000>; + // writable -- Boot counter records + }; + + partition@740000 { + label = "devinfo"; + reg = <0x740000 0x40000>; + read-only; + }; + + partition@780000 { + label = "kernel"; + reg = <0x780000 0x5800000>; + }; + + partition@a80000 { + label = "rootfs"; + reg = <0xa80000 0x5500000>; + }; + + partition@5f80000 { + label = "alt_kernel"; + reg = <0x5f80000 0x5800000>; + }; + + partition@6280000 { + label = "alt_rootfs"; + reg = <0x6280000 0x5500000>; + }; + + partition@b780000 { + label = "sysdiag"; + reg = <0xb780000 0x100000>; + read-only; + }; + + partition@b880000 { + label = "syscfg"; + reg = <0xb880000 0x4680000>; + read-only; + }; + }; + }; +}; + +&pcie0 { + status = "okay"; + + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi2: wifi@1,0 { + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + serial_0_pins: serial0-pinmux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio53", "gpio58", "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + // gpio61 controls led_usb + + pulldowns { + pins = "gpio55", "gpio56", "gpio57", + "gpio60", "gpio62", "gpio63", + "gpio64", "gpio65", "gpio66", + "gpio67", "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-zte-mf263.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-zte-mf263.dts deleted file mode 100755 index ed78d8497..000000000 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-zte-mf263.dts +++ /dev/null @@ -1,390 +0,0 @@ -/* - * Copyright (c) 2021 Hugo Yuan - */ - -#include "qcom-ipq4019.dtsi" -#include -#include -#include - -/ { - model = "ZTE MF263"; - compatible = "zte,mf263", "qcom,ipq4019"; - - memory { - device_type = "memory"; - reg = <0x80000000 0x10000000>; /* 256MB */ - }; - - aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; - }; - - chosen { - bootargs-override = "ubi.mtd=rootfs root=/dev/ubiblock0_1 rootfstype=squashfs rootwait clk_ignore_unused"; - }; - - soc { - mdio@90000 { - status = "okay"; - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - }; - - ess-psgmii@98000 { - status = "okay"; - }; - - tcsr@1949000 { - compatible = "qcom,tcsr"; - reg = <0x1949000 0x100>; - qcom,wifi_glb_cfg = ; - }; - - tcsr@194b000 { - /* select hostmode */ - compatible = "qcom,tcsr"; - reg = <0x194b000 0x100>; - qcom,usb-hsphy-mode-select = ; - status = "okay"; - }; - - ess_tcsr@1953000 { - compatible = "qcom,tcsr"; - reg = <0x1953000 0x1000>; - qcom,ess-interface-select = ; - }; - - tcsr@1957000 { - compatible = "qcom,tcsr"; - reg = <0x1957000 0x100>; - qcom,wifi_noc_memtype_m0_m2 = ; - }; - - usb2@60f8800 { - status = "okay"; - - dwc3@6000000 { - #address-cells = <1>; - #size-cells = <0>; - - usb2_port1: port@1 { - reg = <1>; - #trigger-source-cells = <0>; - }; - }; - }; - - serial@78af000 { - pinctrl-0 = <&serial_0_pins>; - pinctrl-names = "default"; - status = "okay"; - }; - - serial@78b0000 { - pinctrl-0 = <&serial_1_pins>; - pinctrl-names = "default"; - status = "okay"; - }; - - i2c@78b7000 { /* BLSP1 QUP2 */ - pinctrl-0 = <&i2c_0_pins>; - pinctrl-names = "default"; - - status = "okay"; - }; - - usb3: usb3@8af8800 { - status = "okay"; - - dwc3@8a00000 { - #address-cells = <1>; - #size-cells = <0>; - - usb3_port1: port@1 { - reg = <1>; - #trigger-source-cells = <0>; - }; - - usb3_port2: port@2 { - reg = <2>; - #trigger-source-cells = <0>; - }; - }; - }; - - crypto@8e3a000 { - status = "okay"; - }; - - watchdog@b017000 { - status = "okay"; - }; - - ess-switch@c000000 { - status = "okay"; - }; - - edma@c080000 { - status = "okay"; - }; - - leds { - compatible = "gpio-leds"; - - power: status { - label = "status"; - gpios = <&tlmm 36 GPIO_ACTIVE_LOW>; - }; - - other: other { - label = "other"; - gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&tlmm 68 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - }; -}; - -&blsp_dma { - status = "okay"; -}; - -&blsp1_spi1 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - status = "okay"; - cs-gpios = <&tlmm 12 GPIO_ACTIVE_LOW>, - <&tlmm 54 GPIO_ACTIVE_HIGH>; - num-cs = <2>; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - linux,modalias = "m25p80", "mx25l1606e", "n25q128a11"; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "0:SBL1"; - reg = < 0x00 0x40000 >; - }; - - partition@40000 { - label = "0:MIBIB"; - reg = < 0x40000 0x20000 >; - }; - - partition@60000 { - label = "0:QSEE"; - reg = < 0x60000 0x60000 >; - }; - - partition@c0000 { - label = "0:CDT"; - reg = < 0xc0000 0x10000 >; - }; - - partition@d0000 { - label = "0:DDRPARAMS"; - reg = < 0xd0000 0x10000 >; - }; - - partition@e0000 { - label = "0:APPSBLENV"; - reg = < 0xe0000 0x10000 >; - }; - - partition@f0000 { - label = "0:APPSBL"; - reg = < 0xf0000 0xc0000 >; - }; - - partition@1b0000 { - label = "0:reserved1"; - reg = < 0x1b0000 0x50000 >; - }; - }; - }; - - spi-nand@1 { - compatible = "spi-nand"; - reg = <1>; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "fota-flag"; - reg = < 0x00 0xa0000 >; - }; - - partition@a0000 { - label = "0:ART"; - reg = < 0xa0000 0x80000 >; - }; - - partition@120000 { - label = "mac"; - reg = < 0x120000 0x80000 >; - }; - - partition@1a0000 { - label = "reserved2"; - reg = < 0x1a0000 0xc0000 >; - }; - - partition@260000 { - label = "cfg-param"; - reg = < 0x260000 0x400000 >; - }; - - partition@660000 { - label = "log"; - reg = < 0x660000 0x400000 >; - }; - - partition@a60000 { - label = "oops"; - reg = < 0xa60000 0xa0000 >; - }; - - partition@b00000 { - label = "reserved3"; - reg = < 0xb00000 0x500000 >; - }; - - partition@1000000 { - label = "web"; - reg = < 0x1000000 0x800000 >; - }; - - partition@1800000 { - label = "rootfs"; - reg = < 0x1800000 0x1d00000 >; - }; - - partition@3500000 { - label = "data"; - reg = < 0x3500000 0x1900000 >; - }; - - partition@4e00000 { - label = "fota"; - reg = < 0x4e00000 0x3200000 >; - }; - }; - }; -}; - -&cryptobam { - status = "okay"; -}; - -&qpic_bam { - status = "okay"; -}; - -&tlmm { - i2c_0_pins: i2c-0-pinmux { - mux { - pins = "gpio20", "gpio21"; - function = "blsp_i2c0"; - bias-disable; - }; - }; - - mdio_pins: mdio_pinmux { - mux_1 { - pins = "gpio6"; - function = "mdio"; - bias-pull-up; - }; - - mux_2 { - pins = "gpio7"; - function = "mdc"; - bias-pull-up; - }; - }; - - serial_0_pins: serial0-pinmux { - mux { - pins = "gpio16", "gpio17"; - function = "blsp_uart0"; - bias-disable; - }; - }; - - serial_1_pins: serial1_pinmux { - mux { - pins = "gpio8", "gpio9"; - function = "blsp_uart1"; - bias-disable; - }; - }; - - spi_0_pins: spi_0_pinmux { - pinmux { - function = "blsp_spi0"; - pins = "gpio13", "gpio14", "gpio15"; - drive-strength = <12>; - bias-disable; - }; - - pinmux_cs { - function = "gpio"; - pins = "gpio12"; - drive-strength = <2>; - bias-disable; - output-high; - }; - }; -}; - -&usb3_ss_phy { - status = "okay"; -}; - -&usb3_hs_phy { - status = "okay"; -}; - -&usb2_hs_phy { - status = "okay"; -}; - -&wifi0 { - status = "okay"; - qcom,ath10k-calibration-variant = "zte_mf263"; -}; - -&wifi1 { - status = "okay"; - qcom,ath10k-calibration-variant = "zte_mf263"; -}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts index b64f0d78f..3892c9bd8 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts @@ -162,7 +162,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio54"; @@ -198,49 +197,52 @@ reg = <0x00000000 0x00040000>; read-only; }; - partition1@40000 { label = "0:MIBIB"; reg = <0x00040000 0x00020000>; read-only; }; - partition2@60000 { label = "0:QSEE"; reg = <0x00060000 0x00060000>; read-only; }; - partition3@c0000 { label = "0:CDT"; reg = <0x000c0000 0x00010000>; read-only; }; - partition4@d0000 { label = "0:DDRPARAMS"; reg = <0x000d0000 0x00010000>; read-only; }; - partition5@e0000 { label = "0:APPSBLENV"; /* uboot env*/ reg = <0x000e0000 0x00010000>; read-only; }; - partition5@f0000 { label = "0:APPSBL"; /* uboot */ reg = <0x000f0000 0x00080000>; read-only; }; - partition5@170000 { label = "0:ART"; reg = <0x00170000 0x00010000>; read-only; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; partition6@180000 { compatible = "denx,fit"; label = "firmware"; @@ -260,6 +262,22 @@ status = "okay"; }; +&gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <2 0x20>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + &usb3_ss_phy { status = "okay"; }; @@ -274,8 +292,12 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts index a3cecddd6..6cbfa8f37 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts @@ -118,6 +118,17 @@ label = "ART"; reg = <0xe0000 0x10000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; partition@f0000 { @@ -130,6 +141,13 @@ label = "mfginfo"; reg = <0x1e0000 0x10000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mfginfo_1d: macaddr@1d { + reg = <0x1d 0x6>; + }; }; partition@1f0000 { @@ -145,10 +163,8 @@ }; partition@380000 { - /* This is empty */ label = "appsblenv"; reg = <0x380000 0x10000>; - read-only; }; partition@390000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts index 240e0ed0c..201ce97cd 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts @@ -198,7 +198,6 @@ function = "mdio"; bias-pull-up; }; - mux_2 { pins = "gpio7"; function = "mdc"; @@ -213,7 +212,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio12", "gpio59"; @@ -327,6 +325,17 @@ label = "ART"; reg = <0x1f0000 0x10000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; partition@1f0000 { @@ -351,6 +360,13 @@ label = "mfginfo"; reg = <0x390000 0x10000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mfginfo_1d: macaddr@1d { + reg = <0x1d 0x6>; + }; }; partition@3a0000 { @@ -415,9 +431,16 @@ &wifi0 { status = "okay"; qcom,ath10k-calibration-variant = "Aruba-AP-303"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_1d>; + qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; &wifi1 { status = "okay"; qcom,ath10k-calibration-variant = "Aruba-AP-303"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_1d>; + mac-address-increment = <1>; + qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts index 1d4e50292..1f7b37d56 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts @@ -138,7 +138,6 @@ partition@e0000 { label = "u-boot-env"; reg = <0xe0000 0x10000>; - read-only; }; partition@f0000 { @@ -151,6 +150,17 @@ label = "ART"; reg = <0x1f0000 0x10000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; partition@200000 { @@ -175,6 +185,13 @@ label = "mfginfo"; reg = <0x390000 0x10000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mfginfo_1d: macaddr@1d { + reg = <0x1d 0x6>; + }; }; partition@3a0000 { @@ -191,3 +208,12 @@ }; }; }; + +&wifi0 { + qcom,ath10k-calibration-variant = "Aruba-AP-365"; +}; + +&wifi1 { + qcom,ath10k-calibration-variant = "Aruba-AP-365"; +}; + diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi index 63e5c628e..0b94aafc8 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi @@ -140,7 +140,6 @@ function = "mdio"; bias-pull-up; }; - mux_2 { pins = "gpio7"; function = "mdc"; @@ -173,7 +172,6 @@ drive-strength = <12>; bias-disable; }; - pin_cs { function = "gpio"; pins = "gpio12"; @@ -244,10 +242,15 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_1d>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_1d>; + mac-address-increment = <1>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts index 599201f73..6e087ba02 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts @@ -208,6 +208,17 @@ label = "ART"; reg = <0x170000 0x10000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; firmware@180000 { @@ -239,18 +250,15 @@ function = "blsp_spi0"; pins = "gpio55", "gpio56", "gpio57"; }; - pinmux_cs { function = "gpio"; pins = "gpio54"; }; - pinconf { pins = "gpio55", "gpio56", "gpio57"; drive-strength = <12>; bias-disable; }; - pinconf_cs { pins = "gpio54"; drive-strength = <2>; @@ -274,10 +282,14 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; qcom,ath10k-calibration-variant = "GL-B1300"; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; qcom,ath10k-calibration-variant = "GL-B1300"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts index e4c4ed62c..e9490c269 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts @@ -207,6 +207,17 @@ label = "ART"; reg = <0x170000 0x10000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; firmware@180000 { @@ -224,7 +235,7 @@ status = "okay"; spidev1: spi@0 { - compatible = "silabs,si3210"; + compatible = "siliconlabs,si3210"; reg = <0>; spi-max-frequency = <24000000>; }; @@ -265,18 +276,15 @@ function = "blsp_spi0"; pins = "gpio13", "gpio14", "gpio15"; }; - pinmux_cs { function = "gpio"; pins = "gpio12"; }; - pinconf { pins = "gpio13", "gpio14", "gpio15"; drive-strength = <12>; bias-disable; }; - pinconf_cs { pins = "gpio12"; drive-strength = <2>; @@ -291,25 +299,21 @@ function = "blsp_spi1"; bias-disable; }; - host_int { pins = "gpio42"; function = "gpio"; input; }; - cs { pins = "gpio45"; function = "gpio"; bias-pull-up; }; - wake { pins = "gpio40"; function = "gpio"; output-high; }; - reset { pins = "gpio49"; function = "gpio"; @@ -354,10 +358,14 @@ &wifi0 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; qcom,ath10k-calibration-variant = "GL-S1300"; }; &wifi1 { status = "okay"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; qcom,ath10k-calibration-variant = "GL-S1300"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-mr33.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-mr33.dts index 47135e645..9f311b197 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-mr33.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-mr33.dts @@ -16,6 +16,7 @@ #include #include #include +#include / { model = "Meraki MR33 Access Point"; @@ -148,7 +149,6 @@ pinctrl-0 = <&i2c_0_pins>; pinctrl-names = "default"; status = "okay"; - at24@50 { compatible = "atmel,24c64"; pagesize = <32>; @@ -167,30 +167,40 @@ reg = <0x30>; clock-mode = /bits/8 <2>; enable-gpio = <&tlmm 48 GPIO_ACTIVE_HIGH>; + #address-cells = <1>; + #size-cells = <0>; /* RGB led */ - status_red: chan0 { + status_red: chan@0 { chan-name = "red:status"; led-cur = /bits/ 8 <0x20>; max-cur = /bits/ 8 <0x60>; + reg = <0>; + color = ; }; - status_green: chan1 { + status_green: chan@1 { chan-name = "green:status"; led-cur = /bits/ 8 <0x20>; max-cur = /bits/ 8 <0x60>; + reg = <1>; + color = ; }; - chan2 { + chan@2 { chan-name = "blue:status"; led-cur = /bits/ 8 <0x20>; max-cur = /bits/ 8 <0x60>; + reg = <2>; + color = ; }; - chan3 { + chan@3 { chan-name = "white:status"; led-cur = /bits/ 8 <0x20>; max-cur = /bits/ 8 <0x60>; + reg = <3>; + color = ; }; }; }; @@ -211,67 +221,56 @@ reg = <0x00000000 0x00100000>; read-only; }; - partition@100000 { label = "mibib"; reg = <0x00100000 0x00100000>; read-only; }; - partition@200000 { label = "bootconfig"; reg = <0x00200000 0x00100000>; read-only; }; - partition@300000 { label = "qsee"; reg = <0x00300000 0x00100000>; read-only; }; - partition@400000 { label = "qsee_alt"; reg = <0x00400000 0x00100000>; read-only; }; - partition@500000 { label = "cdt"; reg = <0x00500000 0x00080000>; read-only; }; - partition@580000 { label = "cdt_alt"; reg = <0x00580000 0x00080000>; read-only; }; - partition@600000 { label = "ddrparams"; reg = <0x00600000 0x00080000>; read-only; }; - partition@700000 { label = "u-boot"; reg = <0x00700000 0x00200000>; read-only; }; - partition@900000 { label = "u-boot-backup"; reg = <0x00900000 0x00200000>; read-only; }; - partition@b00000 { label = "ART"; reg = <0x00b00000 0x00080000>; read-only; }; - partition@c00000 { label = "ubi"; reg = <0x00c00000 0x07000000>; @@ -323,7 +322,6 @@ function = "mdio"; bias-pull-up; }; - mux_2 { pins = "gpio7"; function = "mdc"; @@ -353,7 +351,6 @@ function = "blsp_i2c0"; pins = "gpio20", "gpio21"; }; - pinconf { pins = "gpio20", "gpio21"; drive-strength = <16>; @@ -366,7 +363,6 @@ function = "blsp_i2c1"; pins = "gpio34", "gpio35"; }; - pinconf { pins = "gpio34", "gpio35"; drive-strength = <16>; diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c index ed96f38bb..80db1f0ac 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c @@ -22,6 +22,14 @@ extern struct net_device *edma_netdev[EDMA_MAX_PORTID_SUPPORTED]; bool edma_stp_rstp; u16 edma_ath_eth_type; +/* edma_skb_priority_offset() + * get edma skb priority + */ +static unsigned int edma_skb_priority_offset(struct sk_buff *skb) +{ + return (skb->priority >> 2) & 1; +} + /* edma_alloc_tx_ring() * Allocate Tx descriptors ring */ @@ -719,11 +727,13 @@ static u16 edma_rx_complete(struct edma_common_info *edma_cinfo, edma_receive_checksum(rd, skb); /* Process VLAN HW acceleration indication provided by HW */ - vlan = rd->rrd4; - if (likely(rd->rrd7 & EDMA_RRD_CVLAN)) - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan); - else if (rd->rrd1 & EDMA_RRD_SVLAN) - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), vlan); + if (unlikely(adapter->default_vlan_tag != rd->rrd4)) { + vlan = rd->rrd4; + if (likely(rd->rrd7 & EDMA_RRD_CVLAN)) + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan); + else if (rd->rrd1 & EDMA_RRD_SVLAN) + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), vlan); + } /* Update rx statistics */ adapter->stats.rx_packets++; @@ -1004,14 +1014,13 @@ static inline u16 edma_tpd_available(struct edma_common_info *edma_cinfo, /* edma_tx_queue_get() * Get the starting number of the queue */ -static inline int edma_tx_queue_get(struct edma_common_info *edma_cinfo, struct edma_adapter *adapter, +static inline int edma_tx_queue_get(struct edma_adapter *adapter, struct sk_buff *skb, int txq_id) { /* skb->priority is used as an index to skb priority table * and based on packet priority, correspong queue is assigned. - * FIXME we just simple use jiffies for time base balance */ - return adapter->tx_start_offset[txq_id] + (smp_processor_id() % edma_cinfo->num_txq_per_core_netdev); + return adapter->tx_start_offset[txq_id] + edma_skb_priority_offset(skb); } /* edma_tx_update_hw_idx() @@ -1380,9 +1389,8 @@ netdev_tx_t edma_xmit(struct sk_buff *skb, } /* this will be one of the 4 TX queues exposed to linux kernel */ - /* XXX what if num_online_cpus() > EDMA_CPU_CORES_SUPPORTED */ - txq_id = ((jiffies >> 5) % (EDMA_CPU_CORES_SUPPORTED - 1) + smp_processor_id() + 1) % EDMA_CPU_CORES_SUPPORTED; - queue_id = edma_tx_queue_get(edma_cinfo, adapter, skb, txq_id); + txq_id = skb_get_queue_mapping(skb); + queue_id = edma_tx_queue_get(adapter, skb, txq_id); etdr = edma_cinfo->tpd_ring[queue_id]; nq = netdev_get_tx_queue(net_dev, txq_id); @@ -1863,8 +1871,8 @@ void edma_free_irqs(struct edma_adapter *adapter) int i, j; int k = ((edma_cinfo->num_rx_queues == 4) ? 1 : 2); - for (i = 0; i < num_online_cpus() && i < EDMA_CPU_CORES_SUPPORTED; i++) { - for (j = edma_cinfo->edma_percpu_info[i].tx_start; j < (edma_cinfo->edma_percpu_info[i].tx_start + edma_cinfo->num_txq_per_core); j++) + for (i = 0; i < CONFIG_NR_CPUS; i++) { + for (j = edma_cinfo->edma_percpu_info[i].tx_start; j < (edma_cinfo->edma_percpu_info[i].tx_start + 4); j++) free_irq(edma_cinfo->tx_irq[j], &edma_cinfo->edma_percpu_info[i]); for (j = edma_cinfo->edma_percpu_info[i].rx_start; j < (edma_cinfo->edma_percpu_info[i].rx_start + k); j++) @@ -2077,13 +2085,15 @@ int edma_poll(struct napi_struct *napi, int budget) int i, work_done = 0; u16 rx_pending_fill; - /* Store the Tx status by ANDing it with - * appropriate CPU TX mask + /* Store the Rx/Tx status by ANDing it with + * appropriate CPU RX?TX mask */ + edma_read_reg(EDMA_REG_RX_ISR, ®_data); + edma_percpu_info->rx_status |= reg_data & edma_percpu_info->rx_mask; + shadow_rx_status = edma_percpu_info->rx_status; edma_read_reg(EDMA_REG_TX_ISR, ®_data); edma_percpu_info->tx_status |= reg_data & edma_percpu_info->tx_mask; shadow_tx_status = edma_percpu_info->tx_status; - edma_write_reg(EDMA_REG_TX_ISR, shadow_tx_status); /* Every core will have a start, which will be computed * in probe and stored in edma_percpu_info->tx_start variable. @@ -2098,14 +2108,6 @@ int edma_poll(struct napi_struct *napi, int budget) edma_percpu_info->tx_status &= ~(1 << queue_id); } - /* Store the Rx status by ANDing it with - * appropriate CPU RX mask - */ - edma_read_reg(EDMA_REG_RX_ISR, ®_data); - edma_percpu_info->rx_status |= reg_data & edma_percpu_info->rx_mask; - shadow_rx_status = edma_percpu_info->rx_status; - edma_write_reg(EDMA_REG_RX_ISR, shadow_rx_status); - /* Every core will have a start, which will be computed * in probe and stored in edma_percpu_info->tx_start variable. * We will shift the status bit by tx_start to obtain @@ -2130,6 +2132,15 @@ int edma_poll(struct napi_struct *napi, int budget) } } + /* Clear the status register, to avoid the interrupts to + * reoccur.This clearing of interrupt status register is + * done here as writing to status register only takes place + * once the producer/consumer index has been updated to + * reflect that the packet transmission/reception went fine. + */ + edma_write_reg(EDMA_REG_RX_ISR, shadow_rx_status); + edma_write_reg(EDMA_REG_TX_ISR, shadow_tx_status); + /* If budget not fully consumed, exit the polling mode */ if (likely(work_done < budget)) { napi_complete(napi); diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.h b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.h index abb0bd5f5..015e5f502 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.h +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.h @@ -324,7 +324,6 @@ struct edma_common_info { u32 from_cpu; /* from CPU TPD field */ u32 num_rxq_per_core; /* Rx queues per core */ u32 num_txq_per_core; /* Tx queues per core */ - u32 num_txq_per_core_netdev; /* Tx queues per core per netdev */ u16 tx_ring_count; /* Tx ring count */ u16 rx_ring_count; /* Rx ring*/ u16 rx_head_buffer_len; /* rx buffer length */ @@ -332,7 +331,7 @@ struct edma_common_info { u32 page_mode; /* Jumbo frame supported flag */ u32 fraglist_mode; /* fraglist supported flag */ struct edma_hw hw; /* edma hw specific structure */ - struct edma_per_cpu_queues_info edma_percpu_info[EDMA_CPU_CORES_SUPPORTED]; /* per cpu information */ + struct edma_per_cpu_queues_info edma_percpu_info[CONFIG_NR_CPUS]; /* per cpu information */ spinlock_t stats_lock; /* protect edma stats area for updation */ struct timer_list edma_stats_timer; bool is_single_phy; @@ -402,7 +401,7 @@ struct edma_adapter { u32 link_state; /* phy link state */ u32 phy_mdio_addr; /* PHY device address on MII interface */ u32 poll_required; /* check if link polling is required */ - u32 tx_start_offset[EDMA_CPU_CORES_SUPPORTED]; /* tx queue start */ + u32 tx_start_offset[CONFIG_NR_CPUS]; /* tx queue start */ u32 default_vlan_tag; /* vlan tag */ u32 dp_bitmap; uint8_t phy_id[MII_BUS_ID_SIZE + 3]; diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c index 16dc74688..e6739261c 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "edma.h" #include "ess_edma.h" @@ -718,7 +719,11 @@ static int edma_axi_probe(struct platform_device *pdev) int i, j, k, err = 0; int portid_bmp; int idx = 0, idx_mac = 0; - int netdev_group = 2; + + if (CONFIG_NR_CPUS != EDMA_CPU_CORES_SUPPORTED) { + dev_err(&pdev->dev, "Invalid CPU Cores\n"); + return -EINVAL; + } if ((num_rxq != 4) && (num_rxq != 8)) { dev_err(&pdev->dev, "Invalid RX queue, edma probe failed\n"); @@ -742,7 +747,7 @@ static int edma_axi_probe(struct platform_device *pdev) /* Initialize the netdev array before allocation * to avoid double free */ - for (i = 0 ; i < EDMA_MAX_PORTID_SUPPORTED; i++) + for (i = 0 ; i < edma_cinfo->num_gmac ; i++) edma_netdev[i] = NULL; for (i = 0 ; i < edma_cinfo->num_gmac ; i++) { @@ -763,11 +768,8 @@ static int edma_axi_probe(struct platform_device *pdev) /* Fill ring details */ edma_cinfo->num_tx_queues = EDMA_MAX_TRANSMIT_QUEUE; - edma_cinfo->num_txq_per_core = (EDMA_MAX_TRANSMIT_QUEUE / num_online_cpus()); - edma_cinfo->num_txq_per_core_netdev = (EDMA_MAX_TRANSMIT_QUEUE / netdev_group / num_online_cpus()); + edma_cinfo->num_txq_per_core = (EDMA_MAX_TRANSMIT_QUEUE / 4); edma_cinfo->tx_ring_count = EDMA_TX_RING_SIZE; - if (edma_cinfo->num_txq_per_core == 0) - edma_cinfo->num_txq_per_core = 1; /* Update num rx queues based on module parameter */ edma_cinfo->num_rx_queues = num_rxq; @@ -917,13 +919,6 @@ static int edma_axi_probe(struct platform_device *pdev) idx_mac++; } - if (edma_cinfo->num_gmac == 1) { - netdev_group = 1; - edma_cinfo->num_txq_per_core_netdev = (EDMA_MAX_TRANSMIT_QUEUE / netdev_group / num_online_cpus()); - } - if (edma_cinfo->num_txq_per_core_netdev == 0) - edma_cinfo->num_txq_per_core_netdev = 1; - /* Populate the adapter structure register the netdevice */ for (i = 0; i < edma_cinfo->num_gmac; i++) { int k, m; @@ -931,16 +926,17 @@ static int edma_axi_probe(struct platform_device *pdev) adapter[i] = netdev_priv(edma_netdev[i]); adapter[i]->netdev = edma_netdev[i]; adapter[i]->pdev = pdev; - for (j = 0; j < num_online_cpus() && j < EDMA_CPU_CORES_SUPPORTED; j++) { - m = i % netdev_group; - adapter[i]->tx_start_offset[j] = j * edma_cinfo->num_txq_per_core + m * edma_cinfo->num_txq_per_core_netdev; + for (j = 0; j < CONFIG_NR_CPUS; j++) { + m = i % 2; + adapter[i]->tx_start_offset[j] = + ((j << EDMA_TX_CPU_START_SHIFT) + (m << 1)); /* Share the queues with available net-devices. * For instance , with 5 net-devices * eth0/eth2/eth4 will share q0,q1,q4,q5,q8,q9,q12,q13 * and eth1/eth3 will get the remaining. */ for (k = adapter[i]->tx_start_offset[j]; k < - (adapter[i]->tx_start_offset[j] + edma_cinfo->num_txq_per_core_netdev); k++) { + (adapter[i]->tx_start_offset[j] + 2); k++) { if (edma_fill_netdev(edma_cinfo, k, i, j)) { pr_err("Netdev overflow Error\n"); goto err_register; @@ -1089,12 +1085,9 @@ static int edma_axi_probe(struct platform_device *pdev) /* populate per_core_info, do a napi_Add, request 16 TX irqs, * 8 RX irqs, do a napi enable */ - for (i = 0; i < num_online_cpus() && i < EDMA_CPU_CORES_SUPPORTED; i++) { + for (i = 0; i < CONFIG_NR_CPUS; i++) { u8 rx_start; - tx_mask[i] = (0xFFFF >> (16 - edma_cinfo->num_txq_per_core)) << (i * edma_cinfo->num_txq_per_core); - tx_start[i] = i * edma_cinfo->num_txq_per_core; - edma_cinfo->edma_percpu_info[i].napi.state = 0; netif_napi_add(edma_netdev[0], @@ -1114,7 +1107,7 @@ static int edma_axi_probe(struct platform_device *pdev) /* Request irq per core */ for (j = edma_cinfo->edma_percpu_info[i].tx_start; - j < tx_start[i] + edma_cinfo->num_txq_per_core; j++) { + j < tx_start[i] + 4; j++) { sprintf(&edma_tx_irq[j][0], "edma_eth_tx%d", j); err = request_irq(edma_cinfo->tx_irq[j], edma_interrupt, @@ -1192,10 +1185,17 @@ static int edma_axi_probe(struct platform_device *pdev) for (i = 0; i < edma_cinfo->num_gmac; i++) { if (adapter[i]->poll_required) { - int phy_mode = of_get_phy_mode(np); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) + phy_interface_t phy_mode; + err = of_get_phy_mode(np, &phy_mode); + if (err) + phy_mode = PHY_INTERFACE_MODE_SGMII; +#else + int phy_mode = of_get_phy_mode(np); if (phy_mode < 0) phy_mode = PHY_INTERFACE_MODE_SGMII; +#endif adapter[i]->phydev = phy_connect(edma_netdev[i], (const char *)adapter[i]->phy_id, @@ -1238,7 +1238,7 @@ err_configure: #endif err_rmap_add_fail: edma_free_irqs(adapter[0]); - for (i = 0; i < num_online_cpus() && i < EDMA_CPU_CORES_SUPPORTED; i++) + for (i = 0; i < CONFIG_NR_CPUS; i++) napi_disable(&edma_cinfo->edma_percpu_info[i].napi); err_reset: err_unregister_sysctl_tbl: @@ -1286,7 +1286,7 @@ static int edma_axi_remove(struct platform_device *pdev) unregister_netdev(edma_netdev[i]); edma_stop_rx_tx(hw); - for (i = 0; i < num_online_cpus() && i < EDMA_CPU_CORES_SUPPORTED; i++) + for (i = 0; i < CONFIG_NR_CPUS; i++) napi_disable(&edma_cinfo->edma_percpu_info[i].napi); edma_irq_disable(edma_cinfo); diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c index ac5cb5096..f84cd5aa6 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "edma.h" struct edma_ethtool_stats { @@ -308,6 +309,9 @@ static void edma_get_ringparam(struct net_device *netdev, /* Ethtool operations */ static const struct ethtool_ops edma_ethtool_ops = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0) + .supported_coalesce_params = ETHTOOL_COALESCE_USECS, +#endif .get_drvinfo = &edma_get_drvinfo, .get_link = ðtool_op_get_link, .get_msglevel = &edma_get_msglevel, diff --git a/target/linux/ipq40xx/generic/target.mk b/target/linux/ipq40xx/generic/target.mk new file mode 100644 index 000000000..90c1b762a --- /dev/null +++ b/target/linux/ipq40xx/generic/target.mk @@ -0,0 +1,3 @@ +BOARDNAME:=Generic +FEATURES+=emmc +DEFAULT_PACKAGES += ath10k-board-qca4019 diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 27ac633a2..5851b2987 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -1,838 +1,17 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID -DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION -DEVICE_VARS += WRGG_DEVNAME WRGG_SIGNATURE - define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) - KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs - KERNEL_PREFIX := $$(IMAGE_PREFIX) KERNEL_LOADADDR := 0x80208000 + DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1))) DEVICE_DTS_CONFIG := config@1 IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin/squashfs := endef -define Device/FitImage - KERNEL_SUFFIX := -fit-uImage.itb - KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - -define Device/FitImageLzma - KERNEL_SUFFIX := -fit-uImage.itb - KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - -define Device/FitzImage - KERNEL_SUFFIX := -fit-zImage.itb - KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL_NAME := zImage -endef - -define Device/UbiFit - KERNEL_IN_UBI := 1 - IMAGES := nand-factory.ubi nand-sysupgrade.bin - IMAGE/nand-factory.ubi := append-ubi - IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata -endef - -define Device/DniImage - $(call Device/FitzImage) - NETGEAR_BOARD_ID := - NETGEAR_HW_ID := - IMAGES += factory.img - IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni - IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | \ - append-rootfs | pad-rootfs | append-metadata | check-size -endef - -define Build/append-rootfshdr - mkimage -A $(LINUX_KARCH) \ - -O linux -T filesystem \ - -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n root.squashfs -d $(IMAGE_ROOTFS) $@.new - dd if=$@.new bs=64 count=1 >> $(IMAGE_KERNEL) -endef - -define Build/mkmylofw_32m - $(eval device_id=$(word 1,$(1))) - $(eval revision=$(word 2,$(1))) - - let \ - size="$$(stat -c%s $@)" \ - pad="$(subst k,* 1024,$(BLOCKSIZE))" \ - pad="(pad - (size % pad)) % pad" \ - newsize='size + pad'; \ - $(STAGING_DIR_HOST)/bin/mkmylofw \ - -B WPE72 -i 0x11f6:$(device_id):0x11f6:$(device_id) -r $(revision) \ - -s 0x2000000 -p0x180000:$$newsize:al:0x80208000:"OpenWrt":$@ \ - $@.new - @mv $@.new $@ -endef - -define Build/qsdk-ipq-factory-nand-askey - $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\ - askey_kernel $(IMAGE_KERNEL) \ - askey_fs $(IMAGE_ROOTFS) \ - ubifs $@ - PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new - @mv $@.new $@ -endef - -define Build/SenaoFW - -$(STAGING_DIR_HOST)/bin/mksenaofw \ - -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \ - -c $(DATECODE) -w $(2) -x $(CW_VER) -t 0 \ - -e $@ \ - -o $@.new - @cp $@.new $@ -endef - -define Build/wrgg-image - mkwrggimg -i $@ \ - -o $@.new \ - -d "$(WRGG_DEVNAME)" \ - -s "$(WRGG_SIGNATURE)" \ - -v "" -m "" -B "" - mv $@.new $@ -endef - -define Device/8dev_habanero-dvk - $(call Device/FitImageLzma) - DEVICE_VENDOR := 8devices - DEVICE_MODEL := Habanero DVK - IMAGE_SIZE := 30976k - DEVICE_DTS := qcom-ipq4019-habanero-dvk - DEVICE_PACKAGES := ipq-wifi-8dev_habanero-dvk - IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | append-metadata | check-size -endef -TARGET_DEVICES += 8dev_habanero-dvk - -define Device/8dev_jalapeno-common - $(call Device/FitImage) - $(call Device/UbiFit) - BLOCKSIZE := 128k - PAGESIZE := 2048 -endef - -define Device/8dev_jalapeno - $(call Device/8dev_jalapeno-common) - DEVICE_VENDOR := 8devices - DEVICE_MODEL := Jalapeno - DEVICE_DTS := qcom-ipq4018-jalapeno -endef -TARGET_DEVICES += 8dev_jalapeno - -define Device/alfa-network_ap120c-ac - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := ALFA Network - DEVICE_MODEL := AP120C-AC - DEVICE_DTS := qcom-ipq4018-ap120c-ac - DEVICE_PACKAGES := kmod-usb-acm kmod-tpm-i2c-atmel - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGE_SIZE := 65536k - IMAGES := nand-factory.bin nand-sysupgrade.bin - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand -endef -TARGET_DEVICES += alfa-network_ap120c-ac - -define Device/aruba_glenmorangie - $(call Device/FitImageLzma) - DEVICE_VENDOR := Aruba - DEVICE_PACKAGES := ipq-wifi-aruba_ap-303 -endef - -define Device/aruba_ap-303 - $(call Device/aruba_glenmorangie) - DEVICE_MODEL := AP-303 - DEVICE_DTS := qcom-ipq4029-ap-303 -endef -TARGET_DEVICES += aruba_ap-303 - -define Device/aruba_ap-303h - $(call Device/aruba_glenmorangie) - DEVICE_MODEL := AP-303H - DEVICE_DTS := qcom-ipq4029-ap-303h -endef -TARGET_DEVICES += aruba_ap-303h - -define Device/aruba_ap-365 - $(call Device/aruba_glenmorangie) - DEVICE_MODEL := AP-365 - DEVICE_DTS := qcom-ipq4029-ap-365 - DEVICE_PACKAGES += kmod-hwmon-ad7418 -endef -TARGET_DEVICES += aruba_ap-365 - -define Device/asus_map-ac2200 - $(call Device/FitImageLzma) - DEVICE_VENDOR := ASUS - DEVICE_MODEL := Lyra (MAP-AC2200) - DEVICE_DTS := qcom-ipq4019-map-ac2200 - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-ath3k -endef -TARGET_DEVICES += asus_map-ac2200 - -define Device/asus_rt-ac58u - $(call Device/FitImageLzma) - DEVICE_VENDOR := ASUS - DEVICE_MODEL := RT-AC58U - DEVICE_DTS := qcom-ipq4018-rt-ac58u - BLOCKSIZE := 128k - PAGESIZE := 2048 - DTB_SIZE := 65536 - IMAGE_SIZE := 20439364 - FILESYSTEMS := squashfs -# Someone - in their infinite wisdom - decided to put the firmware -# version in front of the image name \03\00\00\04 => Version 3.0.0.4 -# Since u-boot works with strings we either need another fixup step -# to add a version... or we are very careful not to add '\0' into that -# string and call it a day.... Yeah, we do the latter! - UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U') - KERNEL_INITRAMFS := $$(KERNEL) | uImage none - KERNEL_INITRAMFS_SUFFIX := -factory.trx - DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers ath10k-firmware-qca4019-ct kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += asus_rt-ac58u - -define Device/asus_rt-acrh17 - $(call Device/FitImageLzma) - DEVICE_VENDOR := ASUS - DEVICE_MODEL := RT-ACRH17 - DEVICE_DTS := qcom-ipq4019-rt-acrh17 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DTB_SIZE := 65536 - IMAGE_SIZE := 20439364 - FILESYSTEMS := squashfs - UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC82U') - KERNEL_INITRAMFS := $$(KERNEL) | uImage none - KERNEL_INITRAMFS_SUFFIX := -factory.trx - DEVICE_PACKAGES := ipq-wifi-asus_rt-acrh17 ath10k-firmware-qca9984-ct kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += asus_rt-acrh17 - -define Device/avm_fritzbox-4040 - $(call Device/FitImageLzma) - DEVICE_VENDOR := AVM - DEVICE_MODEL := FRITZ!Box 4040 - DEVICE_DTS := qcom-ipq4018-fritzbox-4040 - BOARD_NAME := fritz4040 - IMAGE_SIZE := 29056k - UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin - UBOOT_PARTITION_SIZE := 524288 - IMAGES += eva.bin - IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size - DEVICE_PACKAGES := fritz-tffs fritz-caldata -endef -TARGET_DEVICES += avm_fritzbox-4040 - -define Device/avm_fritzbox-7530 - $(call Device/FitImageLzma) - DEVICE_VENDOR := AVM - DEVICE_MODEL := FRITZ!Box 7530 - DEVICE_DTS := qcom-ipq4019-fritzbox-7530 - DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand -endef -TARGET_DEVICES += avm_fritzbox-7530 - -define Device/avm_fritzrepeater-1200 - $(call Device/FitImageLzma) - DEVICE_VENDOR := AVM - DEVICE_MODEL := FRITZ!Repeater 1200 - DEVICE_DTS := qcom-ipq4019-fritzrepeater-1200 - DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200 -endef -TARGET_DEVICES += avm_fritzrepeater-1200 - -define Device/avm_fritzrepeater-3000 - $(call Device/FitImageLzma) - DEVICE_VENDOR := AVM - DEVICE_MODEL := FRITZ!Repeater 3000 - DEVICE_DTS := qcom-ipq4019-fritzrepeater-3000 - DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand -endef -TARGET_DEVICES += avm_fritzrepeater-3000 - -define Device/buffalo_wtr-m2133hp - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Buffalo - DEVICE_MODEL := WTR-M2133HP - DEVICE_DTS := qcom-ipq4019-wtr-m2133hp - DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp - BLOCKSIZE := 128k - PAGESIZE := 2048 -endef -TARGET_DEVICES += buffalo_wtr-m2133hp - -define Device/cellc_rtl30vw - KERNEL_SUFFIX := -fit-uImage.itb - KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | uImage lzma | pad-to 2048 - KERNEL_NAME := Image - KERNEL_IN_UBI := - IMAGES := nand-factory.bin nand-sysupgrade.bin - IMAGE/nand-factory.bin := append-rootfshdr | append-ubi | qsdk-ipq-factory-nand-askey - IMAGE/nand-sysupgrade.bin := append-rootfshdr | sysupgrade-tar | append-metadata - DEVICE_VENDOR := Cell C - DEVICE_MODEL := RTL30VW - DEVICE_DTS := qcom-ipq4019-rtl30vw - DEVICE_DTS_CONFIG := config@5 - KERNEL_INSTALL := 1 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 57344k - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi ipq-wifi-cellc_rtl30vw -endef -TARGET_DEVICES += cellc_rtl30vw - -define Device/century_wr142ac - $(call Device/FitzImage) - DEVICE_VENDOR := Century - DEVICE_MODEL := WR142AC - DEVICE_DTS := qcom-ipq4019-wr142ac - KERNEL_SIZE := 4096k - IMAGE_SIZE := 31232k - IMAGES += factory.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size - DEVICE_PACKAGES := ipq-wifi-century_wr142ac kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += century_wr142ac - -define Device/century_wr142ac-nand - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Century - DEVICE_MODEL := WR142AC - DEVICE_VARIANT := NAND - DEVICE_DTS := qcom-ipq4019-wr142ac-nand - DEVICE_DTS_CONFIG := config@10 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ipq-wifi-century_wr142ac kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += century_wr142ac-nand - -define Device/cilab_meshpoint-one - $(call Device/8dev_jalapeno-common) - DEVICE_VENDOR := Crisis Innovation Lab - DEVICE_MODEL := MeshPoint.One - DEVICE_DTS := qcom-ipq4018-meshpoint-one - DEVICE_PACKAGES := kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127 -endef -TARGET_DEVICES += cilab_meshpoint-one - -define Device/compex_wpj419 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Compex - DEVICE_MODEL := WPJ419 - DEVICE_DTS := qcom-ipq4019-wpj419 - DEVICE_DTS_CONFIG := config@12 - KERNEL_INSTALL := 1 - BLOCKSIZE := 128k - PAGESIZE := 2048 - FILESYSTEMS := squashfs -endef -TARGET_DEVICES += compex_wpj419 - -define Device/compex_wpj428 - $(call Device/FitImage) - DEVICE_VENDOR := Compex - DEVICE_MODEL := WPJ428 - DEVICE_DTS := qcom-ipq4028-wpj428 - DEVICE_DTS_CONFIG := config@4 - BLOCKSIZE := 64k - IMAGE_SIZE := 31232k - KERNEL_SIZE := 4096k - IMAGES += cpximg-6a04.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGE/cpximg-6a04.bin := append-kernel | append-rootfs | pad-rootfs | mkmylofw_32m 0x8A2 3 - DEVICE_PACKAGES := kmod-gpio-beeper -endef -TARGET_DEVICES += compex_wpj428 - -define Device/dlink_dap-2610 - $(call Device/FitImageLzma) - DEVICE_VENDOR := D-Link - DEVICE_MODEL := DAP-2610 - DEVICE_DTS := qcom-ipq4018-dap-2610 - DEVICE_DTS_CONFIG := config@ap.dk01.1-c1 - BLOCKSIZE := 64k - WRGG_DEVNAME := /dev/mtdblock/8 - WRGG_SIGNATURE := wapac30_dkbs_dap2610 - IMAGE_SIZE := 14080k - IMAGES += factory.bin - # Bootloader expects a special 160 byte header which is added by - # wrgg-image. - # Factory image size must be larger than 6MB, and size in wrgg header must - # match actual factory image size to be flashable from D-Link http server. - # Bootloader verifies checksum of wrgg image before booting, thus jffs2 - # cannot be part of the wrgg image. This is solved in the factory image by - # having the rootfs at the end of the image (without pad-rootfs). And in - # the sysupgrade image only the kernel is included in the wrgg checksum, - # but this is not flashable from the D-link http server. - # append-rootfs must start on an erase block boundary. - IMAGE/factory.bin := append-kernel | pad-offset 6144k 160 | append-rootfs | wrgg-image | check-size - IMAGE/sysupgrade.bin := append-kernel | wrgg-image | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size | append-metadata - DEVICE_PACKAGES := ipq-wifi-dlink_dap2610 -endef -TARGET_DEVICES += dlink_dap-2610 - -define Device/engenius_eap1300 - $(call Device/FitImage) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := EAP1300 - DEVICE_DTS := qcom-ipq4018-eap1300 - DEVICE_DTS_CONFIG := config@4 - BOARD_NAME := eap1300 - KERNEL_SIZE := 5120k - IMAGE_SIZE := 25344k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata -endef -TARGET_DEVICES += engenius_eap1300 - -define Device/engenius_eap2200 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := EAP2200 - DEVICE_DTS := qcom-ipq4019-eap2200 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-engenius_eap2200 -endef -TARGET_DEVICES += engenius_eap2200 - -define Device/engenius_emd1 - $(call Device/FitImage) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := EMD1 - DEVICE_DTS := qcom-ipq4018-emd1 - DEVICE_DTS_CONFIG := config@4 - IMAGE_SIZE := 30720k - IMAGES += factory.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size -endef -TARGET_DEVICES += engenius_emd1 - -define Device/engenius_emr3500 - $(call Device/FitImage) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := EMR3500 - DEVICE_DTS := qcom-ipq4018-emr3500 - DEVICE_DTS_CONFIG := config@4 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 30720k - IMAGES += factory.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size -endef -TARGET_DEVICES += engenius_emr3500 - -define Device/engenius_ens620ext - $(call Device/FitImage) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := ENS620EXT - DEVICE_DTS := qcom-ipq4018-ens620ext - DEVICE_DTS_CONFIG := config@4 - BLOCKSIZE := 64k - PAGESIZE := 256 - BOARD_NAME := ENS620EXT - VENDOR_ID := 0x0101 - PRODUCT_ID := 0x79 - PRODUCT_ID_NEW := 0xA4 - DATECODE := 190507 - FW_VER := 3.1.2 - FW_VER_NEW := 3.5.6 - CW_VER := 1.8.99 - IMAGE_SIZE := 21312k - KERNEL_SIZE := 5120k - FILESYSTEMS := squashfs - IMAGES += factory_30.bin factory_35.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata - IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER) - IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW) -endef -TARGET_DEVICES += engenius_ens620ext - -define Device/ezviz_cs-w3-wd1200g-eup - $(call Device/FitImage) - DEVICE_VENDOR := EZVIZ - DEVICE_MODEL := CS-W3-WD1200G - DEVICE_VARIANT := EUP - DEVICE_DTS_CONFIG := config@4 - IMAGE_SIZE := 14848k - DEVICE_DTS := qcom-ipq4018-cs-w3-wd1200g-eup - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ - append-metadata - DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \ - ipq-wifi-ezviz_cs-w3-wd1200g-eup -endef -TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup - -define Device/glinet_gl-a1300 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := GL.iNet - DEVICE_MODEL := GL-A1300 - BOARD_NAME := gl-a1300 - DEVICE_DTS := qcom-ipq4018-gl-a1300 - DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGE_SIZE := 131072k - DEVICE_PACKAGE := ipq-wifi-glinet_gl-a1300 -endef -TARGET_DEVICES += glinet_gl-a1300 - -define Device/glinet_gl-b1300 - $(call Device/FitImage) - DEVICE_VENDOR := GL.iNet - DEVICE_MODEL := GL-B1300 - BOARD_NAME := gl-b1300 - DEVICE_DTS := qcom-ipq4029-gl-b1300 - BOARD_NAME := gl-b1300 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 26624k - IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata -endef -TARGET_DEVICES += glinet_gl-b1300 - -define Device/glinet_gl-s1300 - $(call Device/FitImage) - DEVICE_VENDOR := GL.iNet - DEVICE_MODEL := GL-S1300 - DEVICE_DTS := qcom-ipq4029-gl-s1300 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 26624k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - DEVICE_PACKAGES := ipq-wifi-glinet_gl-s1300 kmod-fs-ext4 kmod-mmc kmod-spi-dev -endef -TARGET_DEVICES += glinet_gl-s1300 - -define Device/hiwifi_c526a - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := HiWiFi - DEVICE_MODEL := C526A - DEVICE_DTS := qcom-ipq4019-c526a - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ipq-wifi-hiwifi_c526a kmod-mt7615e kmod-mt7615-firmware -endef -TARGET_DEVICES += hiwifi_c526a - -define Device/leguang_ca100 - $(call Device/FitzImage) - DEVICE_VENDOR := LEGUANG - DEVICE_MODEL := CA100 - DEVICE_DTS := qcom-ipq4019-ca100 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 31232k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata -endef -TARGET_DEVICES += leguang_ca100 - -define Device/linksys_ea6350v3 - # The Linksys EA6350v3 has a uboot bootloader that does not - # support either booting lzma kernel images nor booting UBI - # partitions. This uboot, however, supports raw kernel images and - # gzipped images. - # - # As for the time of writing this, the device will boot the kernel - # from a fixed address with a fixed length of 3MiB. Also, the - # device has a hard-coded kernel command line that requieres the - # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively. - # Oh... and the kernel partition overlaps with the rootfs - # partition (the same for alt_kernel and alt_rootfs). - # - # If you are planing re-partitioning the device, you may want to - # keep those details in mind: - # 1. The kernel adresses you should honor are 0x00000000 and - # 0x02800000 respectively. - # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size. - # 3. You can use 'zImage', but not a raw 'Image' packed with lzma. - # 4. The kernel command line from uboot is harcoded to boot with - # rootfs either in mtd11 or mtd13. - $(call Device/FitzImage) - DEVICE_VENDOR := Linksys - DEVICE_MODEL := EA6350 - DEVICE_VARIANT := v3 - DEVICE_DTS := qcom-ipq4018-ea6350v3 - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE := 3072k - IMAGE_SIZE := 37888k - UBINIZE_OPTS := -E 5 - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3 -endef -TARGET_DEVICES += linksys_ea6350v3 - -define Device/linksys_ea8300 - $(call Device/FitzImage) - DEVICE_VENDOR := Linksys - DEVICE_MODEL := EA8300 - DEVICE_DTS := qcom-ipq4019-ea8300 - KERNEL_SIZE := 3072k - IMAGE_SIZE := 87040k - BLOCKSIZE := 128k - PAGESIZE := 2048 - UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300 - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += linksys_ea8300 - -define Device/meraki_mr33 - $(call Device/FitImage) - DEVICE_VENDOR := Cisco Meraki - DEVICE_MODEL := MR33 - DEVICE_DTS := qcom-ipq4029-mr33 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct -endef -TARGET_DEVICES += meraki_mr33 - -define Device/mobipromo_cm520-79f - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := MobiPromo - DEVICE_MODEL := CM520-79F - DEVICE_DTS := qcom-ipq4019-cm520-79f - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ipq-wifi-mobipromo_cm520-79f kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += mobipromo_cm520-79f - -define Device/netgear_ex61x0v2 - $(call Device/DniImage) - DEVICE_DTS_CONFIG := config@4 - NETGEAR_BOARD_ID := EX6150v2series - NETGEAR_HW_ID := 29765285+16+0+128+2x2 - IMAGE_SIZE := 14400k -endef - -define Device/netgear_ex6100v2 - $(call Device/netgear_ex61x0v2) - DEVICE_VENDOR := Netgear - DEVICE_MODEL := EX6100 - DEVICE_VARIANT := v2 - DEVICE_DTS := qcom-ipq4018-ex6100v2 -endef -TARGET_DEVICES += netgear_ex6100v2 - -define Device/netgear_ex6150v2 - $(call Device/netgear_ex61x0v2) - DEVICE_VENDOR := Netgear - DEVICE_MODEL := EX6150 - DEVICE_VARIANT := v2 - DEVICE_DTS := qcom-ipq4018-ex6150v2 -endef -TARGET_DEVICES += netgear_ex6150v2 - -define Device/netgear_ex6200v2 - $(call Device/DniImage) - DEVICE_DTS_CONFIG := config@4 - NETGEAR_HW_ID := 29765265+16+0+256+2x2+2x2 - DEVICE_VENDOR := Netgear - DEVICE_MODEL := EX6200 - DEVICE_VARIANT := v2 - DEVICE_DTS := qcom-ipq4018-ex6200v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += netgear_ex6200v2 - -define Device/openmesh_a42 - $(call Device/FitImageLzma) - DEVICE_VENDOR := OpenMesh - DEVICE_MODEL := A42 - DEVICE_DTS := qcom-ipq4018-a42 - DEVICE_DTS_CONFIG := config@om.a42 - BLOCKSIZE := 64k - KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) - IMAGE_SIZE := 15616k - IMAGES += factory.bin - IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42 - IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata -endef -TARGET_DEVICES += openmesh_a42 - -define Device/openmesh_a62 - $(call Device/FitImageLzma) - DEVICE_VENDOR := OpenMesh - DEVICE_MODEL := A62 - DEVICE_DTS := qcom-ipq4019-a62 - DEVICE_DTS_CONFIG := config@om.a62 - BLOCKSIZE := 64k - KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) - IMAGE_SIZE := 15552k - IMAGES += factory.bin - IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62 - IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct -endef -TARGET_DEVICES += openmesh_a62 - -define Device/p2w_r619ac-common - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := P&W - DEVICE_MODEL := R619AC - DEVICE_DTS_CONFIG := config@10 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ipq-wifi-p2w_r619ac -endef - -define Device/p2w_r619ac - $(call Device/p2w_r619ac-common) - DEVICE_DTS := qcom-ipq4019-r619ac - IMAGES += nand-factory.bin - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand -endef -TARGET_DEVICES += p2w_r619ac - -define Device/p2w_r619ac-128m - $(call Device/p2w_r619ac-common) - DEVICE_VARIANT := 128M - DEVICE_DTS := qcom-ipq4019-r619ac-128m -endef -TARGET_DEVICES += p2w_r619ac-128m - -define Device/qcom_ap-dk01.1-c1 - DEVICE_VENDOR := Qualcomm Atheros - DEVICE_MODEL := AP-DK01.1 - DEVICE_VARIANT := C1 - BOARD_NAME := ap-dk01.1-c1 - DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1 - KERNEL_INSTALL := 1 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 26624k - $(call Device/FitImage) - IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata -endef -TARGET_DEVICES += qcom_ap-dk01.1-c1 - -define Device/qcom_ap-dk04.1-c1 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Qualcomm Atheros - DEVICE_MODEL := AP-DK04.1 - DEVICE_VARIANT := C1 - DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1 - KERNEL_INSTALL := 1 - KERNEL_SIZE := 4048k - BLOCKSIZE := 128k - PAGESIZE := 2048 - BOARD_NAME := ap-dk04.1-c1 -endef -TARGET_DEVICES += qcom_ap-dk04.1-c1 - -define Device/qxwlan_e2600ac-c1 - $(call Device/FitImage) - DEVICE_VENDOR := Qxwlan - DEVICE_MODEL := E2600AC - DEVICE_VARIANT := C1 - BOARD_NAME := e2600ac-c1 - DEVICE_DTS := qcom-ipq4019-e2600ac-c1 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 31232k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac -endef -TARGET_DEVICES += qxwlan_e2600ac-c1 - -define Device/qxwlan_e2600ac-c2 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Qxwlan - DEVICE_MODEL := E2600AC - DEVICE_VARIANT := C2 - DEVICE_DTS := qcom-ipq4019-e2600ac-c2 - KERNEL_INSTALL := 1 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac -endef -TARGET_DEVICES += qxwlan_e2600ac-c2 - -define Device/unielec_u4019-32m - $(call Device/FitImage) - DEVICE_VENDOR := Unielec - DEVICE_MODEL := U4019 - DEVICE_VARIANT := 32M - BOARD_NAME := u4019-32m - DEVICE_DTS := qcom-ipq4019-u4019-32m - KERNEL_SIZE := 4096k - IMAGE_SIZE := 31232k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata -endef -TARGET_DEVICES += unielec_u4019-32m - -define Device/zte_mf263 - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := ZTE - DEVICE_MODEL := MF263 - DEVICE_DTS := qcom-ipq4019-zte-mf263 - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := ipq-wifi-zte_mf263 -endef -TARGET_DEVICES += zte_mf263 - -define Device/zyxel_nbg6617 - $(call Device/FitImageLzma) - DEVICE_VENDOR := ZyXEL - DEVICE_MODEL := NBG6617 - DEVICE_DTS := qcom-ipq4018-nbg6617 - KERNEL_SIZE := 4096k - ROOTFS_SIZE := 24960k - RAS_BOARD := NBG6617 - RAS_ROOTFS_SIZE := 19840k - RAS_VERSION := "$(VERSION_DIST) $(REVISION)" - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGES += factory.bin -# The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is -# at least as large as the one of the initial firmware image (not the current -# one on the device). This only applies to the Web-UI, the bootlaoder ignores -# this minimum-size. However, the larger image can be flashed both ways. - IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel - IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += zyxel_nbg6617 - -define Device/zyxel_wre6606 - $(call Device/FitImage) - DEVICE_VENDOR := ZyXEL - DEVICE_MODEL := WRE6606 - DEVICE_DTS := qcom-ipq4018-wre6606 - DEVICE_DTS_CONFIG := config@4 - IMAGE_SIZE := 13184k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers ath10k-firmware-qca4019-ct -endef -TARGET_DEVICES += zyxel_wre6606 +include $(SUBTARGET).mk $(eval $(call BuildImage)) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk new file mode 100644 index 000000000..b8e3edf85 --- /dev/null +++ b/target/linux/ipq40xx/image/generic.mk @@ -0,0 +1,1042 @@ + +DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID +DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION +DEVICE_VARS += WRGG_DEVNAME WRGG_SIGNATURE + +define Device/FitImage + KERNEL_SUFFIX := -fit-uImage.itb + KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL_NAME := Image +endef + +define Device/FitImageLzma + KERNEL_SUFFIX := -fit-uImage.itb + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL_NAME := Image +endef + +define Device/FitzImage + KERNEL_SUFFIX := -fit-zImage.itb + KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL_NAME := zImage +endef + +define Device/UbiFit + KERNEL_IN_UBI := 1 + IMAGES := nand-factory.ubi nand-sysupgrade.bin + IMAGE/nand-factory.ubi := append-ubi + IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/DniImage + $(call Device/FitzImage) + NETGEAR_BOARD_ID := + NETGEAR_HW_ID := + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni + IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | \ + append-rootfs | pad-rootfs | check-size | append-metadata +endef + +define Build/append-rootfshdr + mkimage -A $(LINUX_KARCH) \ + -O linux -T filesystem \ + -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -n root.squashfs -d $(IMAGE_ROOTFS) $@.new + dd if=$@.new bs=64 count=1 >> $(IMAGE_KERNEL) +endef + +define Build/append-rutx-metadata + echo \ + '{ \ + "device_code": [".*"], \ + "hwver": [".*"], \ + "batch": [".*"], \ + "serial": [".*"], \ + "supported_devices":["teltonika,rutx"] \ + }' | fwtool -I - $@ +endef + +define Build/copy-file + cat "$(1)" > "$@" +endef + +define Build/mkmylofw_32m + $(eval device_id=$(word 1,$(1))) + $(eval revision=$(word 2,$(1))) + + let \ + size="$$(stat -c%s $@)" \ + pad="$(subst k,* 1024,$(BLOCKSIZE))" \ + pad="(pad - (size % pad)) % pad" \ + newsize='size + pad'; \ + $(STAGING_DIR_HOST)/bin/mkmylofw \ + -B WPE72 -i 0x11f6:$(device_id):0x11f6:$(device_id) -r $(revision) \ + -s 0x2000000 -p0x180000:$$newsize:al:0x80208000:"OpenWrt":$@ \ + $@.new + @mv $@.new $@ +endef + +define Build/wac5xx-netgear-tar + mkdir $@.tmp + mv $@ $@.tmp/wac5xx-ubifs-root.img + md5sum $@.tmp/wac5xx-ubifs-root.img > $@.tmp/wac5xx-ubifs-root.md5sum + echo "WAC505 WAC510" > $@.tmp/metadata.txt + echo "WAC505_V9.9.9.9" > $@.tmp/version + tar -C $@.tmp/ -cf $@ . + rm -rf $@.tmp +endef + +define Build/qsdk-ipq-factory-nand-askey + $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\ + askey_kernel $(IMAGE_KERNEL) \ + askey_fs $(IMAGE_ROOTFS) \ + ubifs $@ + PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new + @mv $@.new $@ +endef + +define Build/qsdk-ipq-app-gpt + cp $@ $@.tmp 2>/dev/null || true + ptgen -g -o $@.tmp -a 1 -l 1024 \ + -t 0x2e -N 0:HLOS -r -p 32M \ + -t 0x83 -N rootfs -r -p 128M \ + -N rootfs_data -p 512M + cat $@.tmp >> $@ + rm $@.tmp +endef + +define Build/SenaoFW + -$(STAGING_DIR_HOST)/bin/mksenaofw \ + -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \ + -c $(DATECODE) -w $(2) -x $(CW_VER) -t 0 \ + -e $@ \ + -o $@.new + @cp $@.new $@ +endef + +define Build/wrgg-image + mkwrggimg -i $@ \ + -o $@.new \ + -d "$(WRGG_DEVNAME)" \ + -s "$(WRGG_SIGNATURE)" \ + -v "" -m "" -B "" + mv $@.new $@ +endef + +define Device/8dev_habanero-dvk + $(call Device/FitImageLzma) + DEVICE_VENDOR := 8devices + DEVICE_MODEL := Habanero DVK + IMAGE_SIZE := 30976k + SOC := qcom-ipq4019 + IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | check-size | append-metadata +endef +TARGET_DEVICES += 8dev_habanero-dvk + +define Device/8dev_jalapeno-common + $(call Device/FitImage) + $(call Device/UbiFit) + BLOCKSIZE := 128k + PAGESIZE := 2048 + SOC := qcom-ipq4018 +endef + +define Device/8dev_jalapeno + $(call Device/8dev_jalapeno-common) + DEVICE_VENDOR := 8devices + DEVICE_MODEL := Jalapeno +endef +TARGET_DEVICES += 8dev_jalapeno + +define Device/alfa-network_ap120c-ac + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := AP120C-AC + SOC := qcom-ipq4018 + DEVICE_PACKAGES := kmod-usb-acm kmod-tpm-i2c-atmel + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + IMAGES := nand-factory.bin nand-sysupgrade.bin + IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand +endef +TARGET_DEVICES += alfa-network_ap120c-ac + +define Device/aruba_glenmorangie + $(call Device/FitImageLzma) + DEVICE_VENDOR := Aruba + SOC := qcom-ipq4029 +endef + +define Device/aruba_ap-303 + $(call Device/aruba_glenmorangie) + DEVICE_MODEL := AP-303 +endef +TARGET_DEVICES += aruba_ap-303 + +define Device/aruba_ap-303h + $(call Device/aruba_glenmorangie) + DEVICE_MODEL := AP-303H +endef +TARGET_DEVICES += aruba_ap-303h + +define Device/aruba_ap-365 + $(call Device/aruba_glenmorangie) + DEVICE_MODEL := AP-365 + DEVICE_PACKAGES := kmod-hwmon-ad7418 +endef +TARGET_DEVICES += aruba_ap-365 + +define Device/asus_map-ac2200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := ASUS + DEVICE_MODEL := Lyra (MAP-AC2200) + SOC := qcom-ipq4019 + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-ath3k +endef +TARGET_DEVICES += asus_map-ac2200 + +# WARNING: this is an initramfs image that gets you half of the way there +# you need to delete the jffs2 ubi volume and sysupgrade to the final image +# to get a "trx" you can flash via web UI for ac42u/ac58u: +# - change call Device/FitImageLzma to Device/FitImage +# - add the following below UIMAGE_NAME +# UIMAGE_MAGIC := 0x27051956 +# IMAGES += factory.trx +# IMAGE/factory.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | uImage none +define Device/asus_rt-ac42u + $(call Device/FitImageLzma) + DEVICE_VENDOR := ASUS + DEVICE_MODEL := RT-AC42U + DEVICE_ALT0_VENDOR := ASUS + DEVICE_ALT0_MODEL := RT-ACRH17 + DEVICE_ALT1_VENDOR := ASUS + DEVICE_ALT1_MODEL := RT-AC2200 + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 20439364 + FILESYSTEMS := squashfs +# RT-AC82U is nowhere to be found online +# Rather, this device is a/k/a RT-AC42U +# But we'll go with what the vendor firmware has... + UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC82U') + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += asus_rt-ac42u + +define Device/asus_rt-ac58u + $(call Device/FitImageLzma) + DEVICE_VENDOR := ASUS + DEVICE_MODEL := RT-AC58U + DEVICE_ALT0_VENDOR := ASUS + DEVICE_ALT0_MODEL := RT-ACRH13 + SOC := qcom-ipq4018 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 20439364 + FILESYSTEMS := squashfs +# Someone - in their infinite wisdom - decided to put the firmware +# version in front of the image name \03\00\00\04 => Version 3.0.0.4 +# Since u-boot works with strings we either need another fixup step +# to add a version... or we are very careful not to add '\0' into that +# string and call it a day.... Yeah, we do the latter! + UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U') + DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \ + kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += asus_rt-ac58u + +define Device/avm_fritzbox-4040 + $(call Device/FitImageLzma) + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!Box 4040 + SOC := qcom-ipq4018 + BOARD_NAME := fritz4040 + IMAGE_SIZE := 29056k + UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin + UBOOT_PARTITION_SIZE := 524288 + IMAGES += eva.bin + IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata + DEVICE_PACKAGES := fritz-tffs fritz-caldata +endef +TARGET_DEVICES += avm_fritzbox-4040 + +define Device/avm_fritzbox-7530 + $(call Device/FitImageLzma) + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!Box 7530 + DEVICE_ALT0_VENDOR := AVM + DEVICE_ALT0_MODEL := FRITZ!Box 7520 + SOC := qcom-ipq4019 + DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand +endef +TARGET_DEVICES += avm_fritzbox-7530 + +define Device/avm_fritzrepeater-1200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!Repeater 1200 + SOC := qcom-ipq4019 + DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand +endef +TARGET_DEVICES += avm_fritzrepeater-1200 + +define Device/avm_fritzrepeater-3000 + $(call Device/FitImageLzma) + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!Repeater 3000 + SOC := qcom-ipq4019 + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand +endef +TARGET_DEVICES += avm_fritzrepeater-3000 + +define Device/buffalo_wtr-m2133hp + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WTR-M2133HP + SOC := qcom-ipq4019 + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct + BLOCKSIZE := 128k + PAGESIZE := 2048 +endef +TARGET_DEVICES += buffalo_wtr-m2133hp + +define Device/cellc_rtl30vw + KERNEL_SUFFIX := -fit-zImage.itb + KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb | uImage lzma | pad-to 2048 + KERNEL_NAME := zImage + KERNEL_IN_UBI := + IMAGES := nand-factory.bin nand-sysupgrade.bin + IMAGE/nand-factory.bin := append-rootfshdr | append-ubi | qsdk-ipq-factory-nand-askey + IMAGE/nand-sysupgrade.bin := append-rootfshdr | sysupgrade-tar | append-metadata + DEVICE_VENDOR := Cell C + DEVICE_MODEL := RTL30VW + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@5 + KERNEL_INSTALL := 1 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 57344k + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi +endef +TARGET_DEVICES += cellc_rtl30vw + +define Device/cilab_meshpoint-one + $(call Device/8dev_jalapeno-common) + DEVICE_VENDOR := Crisis Innovation Lab + DEVICE_MODEL := MeshPoint.One + DEVICE_PACKAGES := kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127 +endef +TARGET_DEVICES += cilab_meshpoint-one + +define Device/compex_wpj419 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPJ419 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@12 + KERNEL_INSTALL := 1 + BLOCKSIZE := 128k + PAGESIZE := 2048 + FILESYSTEMS := squashfs +endef +TARGET_DEVICES += compex_wpj419 + +define Device/compex_wpj428 + $(call Device/FitImage) + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPJ428 + SOC := qcom-ipq4028 + DEVICE_DTS_CONFIG := config@4 + BLOCKSIZE := 64k + IMAGE_SIZE := 31232k + KERNEL_SIZE := 4096k + IMAGES += cpximg-6a04.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + IMAGE/cpximg-6a04.bin := append-kernel | append-rootfs | pad-rootfs | mkmylofw_32m 0x8A2 3 + DEVICE_PACKAGES := kmod-gpio-beeper + DEFAULT := n +endef +TARGET_DEVICES += compex_wpj428 + +define Device/devolo_magic-2-wifi-next + $(call Device/FitImage) + DEVICE_VENDOR := devolo + DEVICE_MODEL := Magic 2 WiFi next + SOC := qcom-ipq4018 + KERNEL_SIZE := 4096k + + # If the bootloader sees 0xDEADC0DE and this trailer at the 64k boundary of a TFTP image + # it will bootm it, just like we want for the initramfs. + KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to 64k |\ + append-string -e '\xDE\xAD\xC0\xDE{"fl_initramfs":""}\x00' + + IMAGE_SIZE := 26624k + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEFAULT := n +endef +TARGET_DEVICES += devolo_magic-2-wifi-next + +define Device/dlink_dap-2610 + $(call Device/FitImageLzma) + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DAP-2610 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c1 + BLOCKSIZE := 64k + WRGG_DEVNAME := /dev/mtdblock/8 + WRGG_SIGNATURE := wapac30_dkbs_dap2610 + IMAGE_SIZE := 14080k + IMAGES += factory.bin + # Bootloader expects a special 160 byte header which is added by + # wrgg-image. + # Factory image size must be larger than 6MB, and size in wrgg header must + # match actual factory image size to be flashable from D-Link http server. + # Bootloader verifies checksum of wrgg image before booting, thus jffs2 + # cannot be part of the wrgg image. This is solved in the factory image by + # having the rootfs at the end of the image (without pad-rootfs). And in + # the sysupgrade image only the kernel is included in the wrgg checksum, + # but this is not flashable from the D-link http server. + # append-rootfs must start on an erase block boundary. + IMAGE/factory.bin := append-kernel | pad-offset 6144k 160 | append-rootfs | wrgg-image | check-size + IMAGE/sysupgrade.bin := append-kernel | wrgg-image | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size | append-metadata +endef +TARGET_DEVICES += dlink_dap-2610 + +define Device/edgecore_ecw5211 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Edgecore + DEVICE_MODEL := ECW5211 + SOC := qcom-ipq4018 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 + DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm +endef +TARGET_DEVICES += edgecore_ecw5211 + +define Device/edgecore_oap100 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Edgecore + DEVICE_MODEL := OAP100 + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGES := nand-sysupgrade.bin + DEVICE_DTS_CONFIG := config@ap.dk07.1-c1 + DEVICE_PACKAGES := kmod-usb-acm kmod-usb-net kmod-usb-net-cdc-qmi uqmi +endef +TARGET_DEVICES += edgecore_oap100 + +define Device/engenius_eap1300 + $(call Device/FitImage) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EAP1300 + DEVICE_DTS_CONFIG := config@4 + BOARD_NAME := eap1300 + SOC := qcom-ipq4018 + KERNEL_SIZE := 5120k + IMAGE_SIZE := 25344k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata +endef +TARGET_DEVICES += engenius_eap1300 + +define Device/engenius_eap2200 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EAP2200 + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers +endef +TARGET_DEVICES += engenius_eap2200 + +define Device/engenius_emd1 + $(call Device/FitImage) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EMD1 + DEVICE_DTS_CONFIG := config@4 + SOC := qcom-ipq4018 + IMAGE_SIZE := 30720k + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size +endef +TARGET_DEVICES += engenius_emd1 + +define Device/engenius_emr3500 + $(call Device/FitImage) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EMR3500 + DEVICE_DTS_CONFIG := config@4 + SOC := qcom-ipq4018 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 30720k + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size + DEFAULT := n +endef +TARGET_DEVICES += engenius_emr3500 + +define Device/engenius_ens620ext + $(call Device/FitImage) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := ENS620EXT + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@4 + BLOCKSIZE := 64k + PAGESIZE := 256 + BOARD_NAME := ENS620EXT + VENDOR_ID := 0x0101 + PRODUCT_ID := 0x79 + PRODUCT_ID_NEW := 0xA4 + DATECODE := 190507 + FW_VER := 3.1.2 + FW_VER_NEW := 3.5.6 + CW_VER := 1.8.99 + IMAGE_SIZE := 21312k + KERNEL_SIZE := 5120k + FILESYSTEMS := squashfs + IMAGES += factory_30.bin factory_35.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata + IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER) + IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW) +endef +TARGET_DEVICES += engenius_ens620ext + +define Device/ezviz_cs-w3-wd1200g-eup + $(call Device/FitImage) + DEVICE_VENDOR := EZVIZ + DEVICE_MODEL := CS-W3-WD1200G + DEVICE_VARIANT := EUP + IMAGE_SIZE := 14848k + KERNEL_SIZE = 6m + SOC := qcom-ipq4018 + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ + append-metadata + DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := uboot's bootcmd has to be updated (see wiki). \ + Upgrade via sysupgrade mechanism is not possible. +endef +TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup + +define Device/glinet_gl-ap1300 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AP1300 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 131072k + KERNEL_INSTALL := 1 + DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi +endef +TARGET_DEVICES += glinet_gl-ap1300 + +define Device/glinet_gl-b1300 + $(call Device/FitzImage) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-B1300 + BOARD_NAME := gl-b1300 + SOC := qcom-ipq4029 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 26624k + IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata +endef +TARGET_DEVICES += glinet_gl-b1300 + +define Device/glinet_gl-b2200 + $(call Device/FitzImage) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-B2200 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@ap.dk04.1-c3 + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + IMAGES := emmc.img.gz sysupgrade.bin + IMAGE/emmc.img.gz := qsdk-ipq-app-gpt |\ + pad-to 1024k | append-kernel |\ + pad-to 33792k | append-rootfs |\ + append-metadata | gzip + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct \ + kmod-fs-ext4 kmod-mmc kmod-spi-dev mkf2fs e2fsprogs kmod-fs-f2fs +endef +TARGET_DEVICES += glinet_gl-b2200 + +define Device/glinet_gl-s1300 + $(call Device/FitzImage) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-S1300 + SOC := qcom-ipq4029 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 26624k + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := kmod-fs-ext4 kmod-mmc kmod-spi-dev +endef +TARGET_DEVICES += glinet_gl-s1300 + +define Device/linksys_ea6350v3 + # The Linksys EA6350v3 has a uboot bootloader that does not + # support either booting lzma kernel images nor booting UBI + # partitions. This uboot, however, supports raw kernel images and + # gzipped images. + # + # As for the time of writing this, the device will boot the kernel + # from a fixed address with a fixed length of 3MiB. Also, the + # device has a hard-coded kernel command line that requieres the + # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively. + # Oh... and the kernel partition overlaps with the rootfs + # partition (the same for alt_kernel and alt_rootfs). + # + # If you are planing re-partitioning the device, you may want to + # keep those details in mind: + # 1. The kernel adresses you should honor are 0x00000000 and + # 0x02800000 respectively. + # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size. + # 3. You can use 'zImage', but not a raw 'Image' packed with lzma. + # 4. The kernel command line from uboot is harcoded to boot with + # rootfs either in mtd11 or mtd13. + $(call Device/FitzImage) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := EA6350 + DEVICE_VARIANT := v3 + SOC := qcom-ipq4018 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 3072k + IMAGE_SIZE := 37888k + UBINIZE_OPTS := -E 5 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3 +endef +TARGET_DEVICES += linksys_ea6350v3 + +define Device/linksys_ea8300 + $(call Device/FitzImage) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := EA8300 + SOC := qcom-ipq4019 + KERNEL_SIZE := 3072k + IMAGE_SIZE := 87040k + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300 + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += linksys_ea8300 + +define Device/linksys_mr8300 + $(call Device/FitzImage) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := MR8300 + SOC := qcom-ipq4019 + KERNEL_SIZE := 3072k + IMAGE_SIZE := 87040k + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MR8300 + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += linksys_mr8300 + +define Device/luma_wrtq-329acn + $(call Device/FitImage) + DEVICE_VENDOR := Luma Home + DEVICE_MODEL := WRTQ-329ACN + SOC := qcom-ipq4018 + DEVICE_PACKAGES := kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio + IMAGE_SIZE := 76632k + BLOCKSIZE := 128k + PAGESIZE := 2048 +endef +TARGET_DEVICES += luma_wrtq-329acn + +define Device/meraki_mr33 + $(call Device/FitImage) + DEVICE_VENDOR := Cisco Meraki + DEVICE_MODEL := MR33 + SOC := qcom-ipq4029 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct +endef +TARGET_DEVICES += meraki_mr33 + +define Device/mobipromo_cm520-79f + $(call Device/FitzImage) + $(call Device/UbiFit) + DEVICE_VENDOR := MobiPromo + DEVICE_MODEL := CM520-79F + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += mobipromo_cm520-79f + +define Device/netgear_ex61x0v2 + $(call Device/DniImage) + DEVICE_VENDOR := NETGEAR + DEVICE_DTS_CONFIG := config@4 + NETGEAR_BOARD_ID := EX6150v2series + NETGEAR_HW_ID := 29765285+16+0+128+2x2 + IMAGE_SIZE := 14400k + SOC := qcom-ipq4018 +endef + +define Device/netgear_ex6100v2 + $(call Device/netgear_ex61x0v2) + DEVICE_MODEL := EX6100 + DEVICE_VARIANT := v2 +endef +TARGET_DEVICES += netgear_ex6100v2 + +define Device/netgear_ex6150v2 + $(call Device/netgear_ex61x0v2) + DEVICE_MODEL := EX6150 + DEVICE_VARIANT := v2 +endef +TARGET_DEVICES += netgear_ex6150v2 + +define Device/netgear_orbi + $(call Device/DniImage) + SOC := qcom-ipq4019 + DEVICE_VENDOR := NETGEAR + IMAGE/factory.img := append-kernel | pad-offset 128k 64 | \ + append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | \ + append-rootfs | pad-rootfs | netgear-dni + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | \ + sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs kmod-fs-ext4 losetup +endef + +define Device/netgear_rbx50 + $(call Device/netgear_orbi) + NETGEAR_HW_ID := 29765352+0+4000+512+2x2+2x2+4x4 + KERNEL_SIZE := 3932160 + ROOTFS_SIZE := 32243712 + IMAGE_SIZE := 36175872 +endef + +define Device/netgear_rbr50 + $(call Device/netgear_rbx50) + DEVICE_MODEL := RBR50 + DEVICE_VARIANT := v1 + NETGEAR_BOARD_ID := RBR50 +endef +TARGET_DEVICES += netgear_rbr50 + +define Device/netgear_rbs50 + $(call Device/netgear_rbx50) + DEVICE_MODEL := RBS50 + DEVICE_VARIANT := v1 + NETGEAR_BOARD_ID := RBS50 +endef +TARGET_DEVICES += netgear_rbs50 + +define Device/netgear_srx60 + $(call Device/netgear_orbi) + NETGEAR_HW_ID := 29765352+0+4096+512+2x2+2x2+4x4 + KERNEL_SIZE := 3932160 + ROOTFS_SIZE := 32243712 + IMAGE_SIZE := 36175872 +endef + +define Device/netgear_srr60 + $(call Device/netgear_srx60) + DEVICE_MODEL := SRR60 + NETGEAR_BOARD_ID := SRR60 +endef +TARGET_DEVICES += netgear_srr60 + +define Device/netgear_srs60 + $(call Device/netgear_srx60) + DEVICE_MODEL := SRS60 + NETGEAR_BOARD_ID := SRS60 +endef +TARGET_DEVICES += netgear_srs60 + +define Device/netgear_wac510 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Netgear + DEVICE_MODEL := WAC510 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGES += nand-factory.tar + IMAGE/nand-factory.tar := append-ubi | wac5xx-netgear-tar + DEVICE_PACKAGES := uboot-envtools +endef +TARGET_DEVICES += netgear_wac510 + +define Device/openmesh_a42 + $(call Device/FitImageLzma) + DEVICE_VENDOR := OpenMesh + DEVICE_MODEL := A42 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@om.a42 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15616k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata +endef +TARGET_DEVICES += openmesh_a42 + +define Device/openmesh_a62 + $(call Device/FitImageLzma) + DEVICE_VENDOR := OpenMesh + DEVICE_MODEL := A62 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@om.a62 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15552k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct +endef +TARGET_DEVICES += openmesh_a62 + +define Device/p2w_r619ac + $(call Device/FitzImage) + $(call Device/UbiFit) + DEVICE_VENDOR := P&W + DEVICE_MODEL := R619AC + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@10 + BLOCKSIZE := 128k + PAGESIZE := 2048 +endef + +define Device/p2w_r619ac-64m + $(call Device/p2w_r619ac) + DEVICE_VARIANT := 64M NAND + IMAGES += nand-factory.bin + IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand +endef +TARGET_DEVICES += p2w_r619ac-64m + +define Device/p2w_r619ac-128m + $(call Device/p2w_r619ac) + DEVICE_VARIANT := 128M NAND +endef +TARGET_DEVICES += p2w_r619ac-128m + +define Device/plasmacloud_pa1200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA1200 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@pc.pa1200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15616k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata +endef +TARGET_DEVICES += plasmacloud_pa1200 + +define Device/plasmacloud_pa2200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA2200 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@pc.pa2200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15552k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct +endef +TARGET_DEVICES += plasmacloud_pa2200 + +define Device/qcom_ap-dk01.1-c1 + DEVICE_VENDOR := Qualcomm Atheros + DEVICE_MODEL := AP-DK01.1 + DEVICE_VARIANT := C1 + BOARD_NAME := ap-dk01.1-c1 + SOC := qcom-ipq4019 + DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1 + KERNEL_INSTALL := 1 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 26624k + $(call Device/FitImage) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata + DEFAULT := n +endef +TARGET_DEVICES += qcom_ap-dk01.1-c1 + +define Device/qcom_ap-dk04.1-c1 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Qualcomm Atheros + DEVICE_MODEL := AP-DK04.1 + DEVICE_VARIANT := C1 + SOC := qcom-ipq4019 + DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1 + KERNEL_INSTALL := 1 + KERNEL_SIZE := 4048k + BLOCKSIZE := 128k + PAGESIZE := 2048 + BOARD_NAME := ap-dk04.1-c1 + DEFAULT := n +endef +TARGET_DEVICES += qcom_ap-dk04.1-c1 + +define Device/qxwlan_e2600ac-c1 + $(call Device/FitImage) + DEVICE_VENDOR := Qxwlan + DEVICE_MODEL := E2600AC + DEVICE_VARIANT := C1 + BOARD_NAME := e2600ac-c1 + SOC := qcom-ipq4019 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 31232k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEFAULT := n +endef +TARGET_DEVICES += qxwlan_e2600ac-c1 + +define Device/qxwlan_e2600ac-c2 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Qxwlan + DEVICE_MODEL := E2600AC + DEVICE_VARIANT := C2 + SOC := qcom-ipq4019 + KERNEL_INSTALL := 1 + BLOCKSIZE := 128k + PAGESIZE := 2048 +endef +TARGET_DEVICES += qxwlan_e2600ac-c2 + +define Device/teltonika_rutx10 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Teltonika + DEVICE_MODEL := RUTX10 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@5 + KERNEL_INSTALL := 1 + BLOCKSIZE := 128k + PAGESIZE := 2048 + FILESYSTEMS := squashfs + IMAGE/nand-factory.ubi := append-ubi | qsdk-ipq-factory-nand | append-rutx-metadata + DEVICE_PACKAGES := kmod-bluetooth +endef +TARGET_DEVICES += teltonika_rutx10 + +define Device/tel_x1pro + $(call Device/FitImage) + DEVICE_VENDOR := Telco + DEVICE_MODEL := X1 Pro + SOC := qcom-ipq4019 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 31232k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi + DEFAULT := n +endef +TARGET_DEVICES += tel_x1pro + +define Device/unielec_u4019-32m + $(call Device/FitImage) + DEVICE_VENDOR := Unielec + DEVICE_MODEL := U4019 + DEVICE_VARIANT := 32M + BOARD_NAME := u4019-32m + SOC := qcom-ipq4019 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 31232k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEFAULT := n +endef +TARGET_DEVICES += unielec_u4019-32m + +define Device/zte_mf28x_common + $(call Device/FitzImage) + DEVICE_VENDOR := ZTE + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@ap.dk04.1-c1 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi +endef + +define Device/zte_mf286d + $(call Device/zte_mf28x_common) + DEVICE_MODEL := MF286D +endef +TARGET_DEVICES += zte_mf286d + +define Device/zte_mf289f + $(call Device/zte_mf28x_common) + DEVICE_MODEL := MF289F + DEVICE_PACKAGES += ipq-wifi-zte_mf289f ath10k-firmware-qca9984-ct +endef +TARGET_DEVICES += zte_mf289f + +define Device/zyxel_nbg6617 + $(call Device/FitImageLzma) + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := NBG6617 + SOC := qcom-ipq4018 + KERNEL_SIZE := 4096k + ROOTFS_SIZE := 24960k + RAS_BOARD := NBG6617 + RAS_ROOTFS_SIZE := 19840k + RAS_VERSION := "$(VERSION_DIST) $(REVISION)" + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + IMAGES += factory.bin +# The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is +# at least as large as the one of the initial firmware image (not the current +# one on the device). This only applies to the Web-UI, the bootlaoder ignores +# this minimum-size. However, the larger image can be flashed both ways. + IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += zyxel_nbg6617 + +define Device/zyxel_wre6606 + $(call Device/FitImage) + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := WRE6606 + DEVICE_DTS_CONFIG := config@4 + SOC := qcom-ipq4018 + IMAGE_SIZE := 13184k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata + DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers +endef +TARGET_DEVICES += zyxel_wre6606 diff --git a/target/linux/ipq40xx/image/mikrotik.mk b/target/linux/ipq40xx/image/mikrotik.mk new file mode 100644 index 000000000..b2e8428e9 --- /dev/null +++ b/target/linux/ipq40xx/image/mikrotik.mk @@ -0,0 +1,64 @@ +define Device/mikrotik_nor + DEVICE_VENDOR := MikroTik + BLOCKSIZE := 64k + IMAGE_SIZE := 16128k + KERNEL_NAME := vmlinux + KERNEL := kernel-bin | append-dtb-elf + IMAGES = sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 | \ + pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ + check-size | append-metadata +endef + +define Device/mikrotik_nand + DEVICE_VENDOR := MikroTik + KERNEL_NAME := vmlinux + KERNEL_INITRAMFS := kernel-bin | append-dtb-elf + KERNEL := kernel-bin | append-dtb-elf | package-kernel-ubifs | \ + ubinize-kernel + IMAGES := nand-sysupgrade.bin + IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/mikrotik_cap-ac + $(call Device/mikrotik_nor) + DEVICE_MODEL := cAP ac + SOC := qcom-ipq4018 + DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers +endef +TARGET_DEVICES += mikrotik_cap-ac + +define Device/mikrotik_hap-ac2 + $(call Device/mikrotik_nor) + DEVICE_MODEL := hAP ac2 + SOC := qcom-ipq4018 + DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers +endef +TARGET_DEVICES += mikrotik_hap-ac2 + +define Device/mikrotik_hap-ac3 + $(call Device/mikrotik_nand) + DEVICE_MODEL := hAP ac3 + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_UBIFS_OPTS = -m $$(PAGESIZE) -e 124KiB -c $$(PAGESIZE) -x none + DEVICE_PACKAGES := kmod-ledtrig-gpio +endef +TARGET_DEVICES += mikrotik_hap-ac3 + +define Device/mikrotik_lhgg-60ad + $(call Device/mikrotik_nor) + DEVICE_MODEL := Wireless Wire Dish LHGG-60ad + DEVICE_DTS := qcom-ipq4019-lhgg-60ad + DEVICE_PACKAGES += -kmod-ath10k-ct -ath10k-firmware-qca4019-ct kmod-wil6210 +endef +TARGET_DEVICES += mikrotik_lhgg-60ad + +define Device/mikrotik_sxtsq-5-ac + $(call Device/mikrotik_nor) + DEVICE_MODEL := SXTsq 5 ac (RBSXTsqG-5acD) + SOC := qcom-ipq4018 + DEVICE_PACKAGES := rssileds +endef +TARGET_DEVICES += mikrotik_sxtsq-5-ac diff --git a/target/linux/ipq40xx/mikrotik/config-default b/target/linux/ipq40xx/mikrotik/config-default new file mode 100644 index 000000000..dd0c69b74 --- /dev/null +++ b/target/linux/ipq40xx/mikrotik/config-default @@ -0,0 +1,5 @@ +CONFIG_MIKROTIK=y +CONFIG_MIKROTIK_RB_SYSFS=y +CONFIG_MTD_ROUTERBOOT_PARTS=y +CONFIG_MTD_SPLIT_MINOR_FW=y +CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y diff --git a/target/linux/ipq40xx/mikrotik/target.mk b/target/linux/ipq40xx/mikrotik/target.mk new file mode 100644 index 000000000..4530a9098 --- /dev/null +++ b/target/linux/ipq40xx/mikrotik/target.mk @@ -0,0 +1,4 @@ +BOARDNAME:=MikroTik +FEATURES += minor +KERNEL_IMAGES:=vmlinux +IMAGES_DIR:=compressed diff --git a/target/linux/ipq40xx/patches-5.4/102-ARM-dts-qcom-ipq4019-add-USB-devicetree-nodes.patch b/target/linux/ipq40xx/patches-5.10/0001-v5.12-ARM-dts-qcom-ipq4019-add-USB-devicetree-nodes.patch similarity index 91% rename from target/linux/ipq40xx/patches-5.4/102-ARM-dts-qcom-ipq4019-add-USB-devicetree-nodes.patch rename to target/linux/ipq40xx/patches-5.10/0001-v5.12-ARM-dts-qcom-ipq4019-add-USB-devicetree-nodes.patch index a5ea021af..5ebed88bb 100644 --- a/target/linux/ipq40xx/patches-5.4/102-ARM-dts-qcom-ipq4019-add-USB-devicetree-nodes.patch +++ b/target/linux/ipq40xx/patches-5.10/0001-v5.12-ARM-dts-qcom-ipq4019-add-USB-devicetree-nodes.patch @@ -1,6 +1,6 @@ -From 193856b5fe11c50a0b6ff22457dd674c1a45fec6 Mon Sep 17 00:00:00 2001 +From b8afc254b40167fd37b4d4263e750dab1f9ef157 Mon Sep 17 00:00:00 2001 From: John Crispin -Date: Wed, 9 Sep 2020 18:31:03 +0200 +Date: Wed, 9 Sep 2020 18:38:31 +0200 Subject: [PATCH] ARM: dts: qcom: ipq4019: add USB devicetree nodes Since we now have driver for the USB PHY, and USB controller is already supported by the DWC3 driver lets add the necessary nodes to DTSI. @@ -9,13 +9,15 @@ Signed-off-by: John Crispin Signed-off-by: Robert Marko Cc: Luka Perkov Reviewed-by: Vinod Koul +Link: https://lore.kernel.org/r/20200909163831.1894142-1-robert.marko@sartura.hr +Signed-off-by: Bjorn Andersson --- arch/arm/boot/dts/qcom-ipq4019.dtsi | 74 +++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -616,5 +616,79 @@ +@@ -606,5 +606,79 @@ reg = <4>; }; }; diff --git a/target/linux/ipq40xx/patches-5.4/103-arm-dts-qcom-ipq4019-add-more-labels.patch b/target/linux/ipq40xx/patches-5.10/0002-v5.12-ARM-dts-qcom-ipq4019-add-more-labels.patch similarity index 74% rename from target/linux/ipq40xx/patches-5.4/103-arm-dts-qcom-ipq4019-add-more-labels.patch rename to target/linux/ipq40xx/patches-5.10/0002-v5.12-ARM-dts-qcom-ipq4019-add-more-labels.patch index 833a5ccdb..d7af2bb7b 100644 --- a/target/linux/ipq40xx/patches-5.4/103-arm-dts-qcom-ipq4019-add-more-labels.patch +++ b/target/linux/ipq40xx/patches-5.10/0002-v5.12-ARM-dts-qcom-ipq4019-add-more-labels.patch @@ -1,12 +1,14 @@ -From caa3ee6b094ee18021943504c938919fcac325ec Mon Sep 17 00:00:00 2001 +From d1ae4c808e7802008225078d93fbadd4aeea1e2d Mon Sep 17 00:00:00 2001 From: Robert Marko -Date: Wed, 9 Sep 2020 20:40:33 +0200 -Subject: [PATCH] arm: dts: qcom: ipq4019: add more labels +Date: Wed, 9 Sep 2020 21:56:37 +0200 +Subject: [PATCH] ARM: dts: qcom: ipq4019: add more labels Lets add labels to more commonly used nodes for easier modification in board DTS files. Signed-off-by: Robert Marko Cc: Luka Perkov +Link: https://lore.kernel.org/r/20200909195640.3127341-2-robert.marko@sartura.hr +Signed-off-by: Bjorn Andersson --- arch/arm/boot/dts/qcom-ipq4019.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) @@ -22,7 +24,7 @@ Cc: Luka Perkov compatible = "qcom,prng"; reg = <0x22000 0x140>; clocks = <&gcc GCC_PRNG_AHB_CLK>; -@@ -311,7 +311,7 @@ +@@ -301,7 +301,7 @@ status = "disabled"; }; @@ -31,7 +33,7 @@ Cc: Luka Perkov compatible = "qcom,crypto-v5.1"; reg = <0x08e3a000 0x6000>; clocks = <&gcc GCC_CRYPTO_AHB_CLK>, -@@ -397,7 +397,7 @@ +@@ -387,7 +387,7 @@ dma-names = "rx", "tx"; }; diff --git a/target/linux/ipq40xx/patches-5.4/101-arm-dts-IPQ4019-add-SDHCI-VQMMC-LDO-node.patch b/target/linux/ipq40xx/patches-5.10/0003-v5.12-ARM-dts-qcom-ipq4019-add-SDHCI-VQMMC-LDO-node.patch similarity index 71% rename from target/linux/ipq40xx/patches-5.4/101-arm-dts-IPQ4019-add-SDHCI-VQMMC-LDO-node.patch rename to target/linux/ipq40xx/patches-5.10/0003-v5.12-ARM-dts-qcom-ipq4019-add-SDHCI-VQMMC-LDO-node.patch index 2e98d84d9..ff3fdc540 100644 --- a/target/linux/ipq40xx/patches-5.4/101-arm-dts-IPQ4019-add-SDHCI-VQMMC-LDO-node.patch +++ b/target/linux/ipq40xx/patches-5.10/0003-v5.12-ARM-dts-qcom-ipq4019-add-SDHCI-VQMMC-LDO-node.patch @@ -1,12 +1,15 @@ -From 77d9b11ae7269dcf376c3b9493209f712524e986 Mon Sep 17 00:00:00 2001 +From e14775aa2feac18e7378cb8009b55c13d4236b50 Mon Sep 17 00:00:00 2001 From: Robert Marko -Date: Wed, 22 Jan 2020 12:56:35 +0100 -Subject: [PATCH] arm: dts: IPQ4019: add SDHCI VQMMC LDO node +Date: Mon, 7 Sep 2020 12:19:37 +0200 +Subject: [PATCH] ARM: dts: qcom: ipq4019: add SDHCI VQMMC LDO node Since we now have driver for the SDHCI VQMMC LDO needed for I/0 voltage levels lets introduce the necessary node for it. Signed-off-by: Robert Marko +Cc: Luka Perkov +Link: https://lore.kernel.org/r/20200907101937.10155-1-robert.marko@sartura.hr +Signed-off-by: Bjorn Andersson --- arch/arm/boot/dts/qcom-ipq4019.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/linux/ipq40xx/patches-5.4/104-clk-fix-apss-cpu-overclocking.patch b/target/linux/ipq40xx/patches-5.10/104-clk-fix-apss-cpu-overclocking.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/104-clk-fix-apss-cpu-overclocking.patch rename to target/linux/ipq40xx/patches-5.10/104-clk-fix-apss-cpu-overclocking.patch diff --git a/target/linux/ipq40xx/patches-5.4/300-clk-qcom-ipq4019-add-ess-reset.patch b/target/linux/ipq40xx/patches-5.10/300-clk-qcom-ipq4019-add-ess-reset.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/300-clk-qcom-ipq4019-add-ess-reset.patch rename to target/linux/ipq40xx/patches-5.10/300-clk-qcom-ipq4019-add-ess-reset.patch diff --git a/target/linux/ipq40xx/patches-5.10/301-arm-compressed-add-appended-DTB-section.patch b/target/linux/ipq40xx/patches-5.10/301-arm-compressed-add-appended-DTB-section.patch new file mode 100644 index 000000000..99e33632c --- /dev/null +++ b/target/linux/ipq40xx/patches-5.10/301-arm-compressed-add-appended-DTB-section.patch @@ -0,0 +1,48 @@ +From 0843a61d6913bdac8889eb048ed89f7903059787 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Fri, 30 Oct 2020 13:36:31 +0100 +Subject: [PATCH] arm: compressed: add appended DTB section + +This adds a appended_dtb section to the ARM decompressor +linker script. + +This allows using the existing ARM zImage appended DTB support for +appending a DTB to the raw ELF kernel. + +Its size is set to 1MB max to match the zImage appended DTB size limit. + +To use it to pass the DTB to the kernel, objcopy is used: + +objcopy --set-section-flags=.appended_dtb=alloc,contents \ + --update-section=.appended_dtb=.dtb vmlinux + +This is based off the following patch: +https://github.com/openwrt/openwrt/commit/c063e27e02a9dcac0e7f5877fb154e58fa3e1a69 + +Signed-off-by: Robert Marko +--- + arch/arm/boot/compressed/vmlinux.lds.S | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/compressed/vmlinux.lds.S ++++ b/arch/arm/boot/compressed/vmlinux.lds.S +@@ -101,6 +101,13 @@ SECTIONS + + _edata = .; + ++ .appended_dtb : { ++ /* leave space for appended DTB */ ++ . += 0x100000; ++ } ++ ++ _edata_dtb = .; ++ + /* + * The image_end section appears after any additional loadable sections + * that the linker may decide to insert in the binary image. Having +@@ -138,4 +145,4 @@ SECTIONS + + ARM_ASSERTS + } +-ASSERT(_edata_real == _edata, "error: zImage file size is incorrect"); ++ASSERT(_edata_real == _edata_dtb, "error: zImage file size is incorrect"); diff --git a/target/linux/ipq40xx/patches-5.10/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch b/target/linux/ipq40xx/patches-5.10/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch new file mode 100644 index 000000000..1aa5a9f38 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.10/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch @@ -0,0 +1,66 @@ +From 11d6a6128a5a07c429941afc202b6e62a19771be Mon Sep 17 00:00:00 2001 +From: John Thomson +Date: Fri, 23 Oct 2020 19:42:36 +1000 +Subject: [PATCH 2/2] arm: compressed: set ipq40xx watchdog to allow boot + +For IPQ40XX systems where the SoC watchdog is activated before linux, +the watchdog timer may be too small for linux to finish uncompress, +boot, and watchdog management start. +If the watchdog is enabled, set the timeout for it to 30 seconds. +The functionality and offsets were copied from: +drivers/watchdog/qcom-wdt.c qcom_wdt_set_timeout & qcom_wdt_start +The watchdog memory address was taken from: +arch/arm/boot/dts/qcom-ipq4019.dtsi + +This was required on Mikrotik IPQ40XX consumer hardware using Mikrotik's +RouterBoot bootloader. + +Signed-off-by: John Thomson +--- + arch/arm/boot/compressed/head.S | 35 +++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +--- a/arch/arm/boot/compressed/head.S ++++ b/arch/arm/boot/compressed/head.S +@@ -602,6 +602,41 @@ not_relocated: mov r0, #0 + bic r4, r4, #1 + blne cache_on + ++/* Set the Qualcom IPQ40xx watchdog timeout to 30 seconds ++ * if it is enabled, so that there is time for kernel ++ * to decompress, boot, and take over the watchdog. ++ * data and functionality from drivers/watchdog/qcom-wdt.c ++ * address from arch/arm/boot/dts/qcom-ipq4019.dtsi ++ */ ++#ifdef CONFIG_ARCH_IPQ40XX ++watchdog_set: ++ /* offsets: ++ * 0x04 reset (=1 resets countdown) ++ * 0x08 enable (=0 disables) ++ * 0x0c status (=1 when SoC was reset by watchdog) ++ * 0x10 bark (=timeout warning in ticks) ++ * 0x14 bite (=timeout reset in ticks) ++ * clock rate is 1<<15 hertz ++ */ ++ .equ watchdog, 0x0b017000 @Store watchdog base address ++ movw r0, #:lower16:watchdog ++ movt r0, #:upper16:watchdog ++ ldr r1, [r0, #0x08] @Get enabled? ++ cmp r1, #1 @If not enabled, do not change ++ bne watchdog_finished ++ mov r1, #0 ++ str r1, [r0, #0x08] @Disable the watchdog ++ mov r1, #1 ++ str r1, [r0, #0x04] @Pet the watchdog ++ mov r1, #30 @30 seconds timeout ++ lsl r1, r1, #15 @converted to ticks ++ str r1, [r0, #0x10] @Set the bark timeout ++ str r1, [r0, #0x14] @Set the bite timeout ++ mov r1, #1 ++ str r1, [r0, #0x08] @Enable the watchdog ++watchdog_finished: ++#endif /* CONFIG_ARCH_IPQ40XX */ ++ + /* + * The C runtime environment should now be setup sufficiently. + * Set up some pointers, and start decompressing. diff --git a/target/linux/ipq40xx/patches-5.4/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch b/target/linux/ipq40xx/patches-5.10/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch similarity index 57% rename from target/linux/ipq40xx/patches-5.4/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch rename to target/linux/ipq40xx/patches-5.10/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch index d3f0ef7d0..07d274f0d 100644 --- a/target/linux/ipq40xx/patches-5.4/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch +++ b/target/linux/ipq40xx/patches-5.10/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch @@ -1,23 +1,22 @@ -From 0e28623a11f3916c1fe5b7e789c7ab8ca932a929 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 22 Jan 2020 13:02:13 +0100 -Subject: [PATCH] mmc: sdhci: sdhci-msm: use sdhci_set_clock instead of - sdhci_msm_set_clock +From f63ea127643a605da97090ce585fdd7c2d17fa42 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Mon, 14 Dec 2020 13:35:35 +0100 +Subject: [PATCH] mmc: sdhci-msm: use sdhci_set_clock When using sdhci_msm_set_clock clock setting will fail, so lets use the generic sdhci_set_clock. -Signed-off-by: Robert Marko +Signed-off-by: Robert Marko --- drivers/mmc/host/sdhci-msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c -@@ -1764,7 +1764,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat +@@ -2193,7 +2193,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat static const struct sdhci_ops sdhci_msm_ops = { - .reset = sdhci_reset, + .reset = sdhci_msm_reset, - .set_clock = sdhci_msm_set_clock, + .set_clock = sdhci_set_clock, .get_min_clock = sdhci_msm_get_min_clock, diff --git a/target/linux/ipq40xx/patches-5.10/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch b/target/linux/ipq40xx/patches-5.10/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch new file mode 100644 index 000000000..7e9692e5c --- /dev/null +++ b/target/linux/ipq40xx/patches-5.10/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch @@ -0,0 +1,32 @@ +From 35ca7e3e6ccd120d694a3425f37fc6374ad2e11e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20B=C3=B6hler?= +Date: Wed, 20 Apr 2022 12:08:38 +0200 +Subject: [PATCH] mtd: rawnand: add support for Toshiba TC58NVG0S3HTA00 + NAND flash +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The Toshiba TC58NVG0S3HTA00 is detected with 64 byte OOB while the flash +has 128 bytes OOB. This adds a static NAND ID entry to correct this. + +Tested on FRITZ!Box 7530 flashed with OpenWrt. + +Signed-off-by: Andreas Böhler +(changed id_len to 8, added comment about possible counterfeits) +--- + drivers/mtd/nand/raw/nand_ids.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/mtd/nand/raw/nand_ids.c ++++ b/drivers/mtd/nand/raw/nand_ids.c +@@ -29,6 +29,9 @@ struct nand_flash_dev nand_flash_ids[] = + {"TC58NVG0S3E 1G 3.3V 8-bit", + { .id = {0x98, 0xd1, 0x90, 0x15, 0x76, 0x14, 0x01, 0x00} }, + SZ_2K, SZ_128, SZ_128K, 0, 8, 64, NAND_ECC_INFO(1, SZ_512), }, ++ {"TC58NVG0S3HTA00 1G 3.3V 8-bit", /* possibly counterfeit chip - see commit */ ++ { .id = {0x98, 0xf1, 0x80, 0x15} /* should be more bytes */ }, ++ SZ_2K, SZ_128, SZ_128K, 0, 8, 128, NAND_ECC_INFO(8, SZ_512), }, + {"TC58NVG2S0F 4G 3.3V 8-bit", + { .id = {0x98, 0xdc, 0x90, 0x26, 0x76, 0x15, 0x01, 0x08} }, + SZ_4K, SZ_512, SZ_256K, 0, 8, 224, NAND_ECC_INFO(4, SZ_512) }, diff --git a/target/linux/ipq40xx/patches-5.4/702-dts-ipq4019-add-PHY-switch-nodes.patch b/target/linux/ipq40xx/patches-5.10/702-dts-ipq4019-add-PHY-switch-nodes.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/702-dts-ipq4019-add-PHY-switch-nodes.patch rename to target/linux/ipq40xx/patches-5.10/702-dts-ipq4019-add-PHY-switch-nodes.patch diff --git a/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch b/target/linux/ipq40xx/patches-5.10/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch similarity index 95% rename from target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch rename to target/linux/ipq40xx/patches-5.10/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch index b1bc8705b..3c0f53bab 100644 --- a/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch +++ b/target/linux/ipq40xx/patches-5.10/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch @@ -24,7 +24,7 @@ Reviewed-by: Grant Grundler --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -788,6 +788,16 @@ struct xps_map { +@@ -791,6 +791,16 @@ struct xps_map { #define XPS_MIN_MAP_ALLOC ((L1_CACHE_ALIGN(offsetof(struct xps_map, queues[1])) \ - sizeof(struct xps_map)) / sizeof(u16)) @@ -41,7 +41,7 @@ Reviewed-by: Grant Grundler /* * This structure holds all XPS maps for device. Maps are indexed by CPU. */ -@@ -1446,6 +1456,9 @@ struct net_device_ops { +@@ -1478,6 +1488,9 @@ struct net_device_ops { const struct sk_buff *skb, u16 rxq_index, u32 flow_id); diff --git a/target/linux/ipq40xx/patches-5.10/705-net-add-qualcomm-ar40xx-phy.patch b/target/linux/ipq40xx/patches-5.10/705-net-add-qualcomm-ar40xx-phy.patch new file mode 100644 index 000000000..cd0b10c6c --- /dev/null +++ b/target/linux/ipq40xx/patches-5.10/705-net-add-qualcomm-ar40xx-phy.patch @@ -0,0 +1,27 @@ +--- a/drivers/net/mdio/Kconfig ++++ b/drivers/net/mdio/Kconfig +@@ -27,6 +27,13 @@ config OF_MDIO + help + OpenFirmware MDIO bus (Ethernet PHY) accessors + ++config AR40XX_PHY ++ tristate "Driver for Qualcomm Atheros IPQ40XX switches" ++ depends on HAS_IOMEM && OF && OF_MDIO ++ select SWCONFIG ++ help ++ This is the driver for Qualcomm Atheros IPQ40XX ESS switches. ++ + if MDIO_BUS + + config MDIO_DEVRES +--- a/drivers/net/mdio/Makefile ++++ b/drivers/net/mdio/Makefile +@@ -21,6 +21,8 @@ obj-$(CONFIG_MDIO_SUN4I) += mdio-sun4i. + obj-$(CONFIG_MDIO_THUNDER) += mdio-thunder.o + obj-$(CONFIG_MDIO_XGENE) += mdio-xgene.o + ++obj-$(CONFIG_AR40XX_PHY) += ar40xx.o ++ + obj-$(CONFIG_MDIO_BUS_MUX) += mdio-mux.o + obj-$(CONFIG_MDIO_BUS_MUX_BCM_IPROC) += mdio-mux-bcm-iproc.o + obj-$(CONFIG_MDIO_BUS_MUX_GPIO) += mdio-mux-gpio.o diff --git a/target/linux/ipq40xx/patches-5.4/706-dt-bindings-net-add-QCA807x-PHY.patch b/target/linux/ipq40xx/patches-5.10/706-dt-bindings-net-add-QCA807x-PHY.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/706-dt-bindings-net-add-QCA807x-PHY.patch rename to target/linux/ipq40xx/patches-5.10/706-dt-bindings-net-add-QCA807x-PHY.patch diff --git a/target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch b/target/linux/ipq40xx/patches-5.10/707-net-phy-Add-Qualcom-QCA807x-driver.patch similarity index 88% rename from target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch rename to target/linux/ipq40xx/patches-5.10/707-net-phy-Add-Qualcom-QCA807x-driver.patch index 7d6202b99..ba441022f 100644 --- a/target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch +++ b/target/linux/ipq40xx/patches-5.10/707-net-phy-Add-Qualcom-QCA807x-driver.patch @@ -25,9 +25,9 @@ Signed-off-by: Robert Marko --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -537,6 +537,12 @@ config NXP_TJA11XX_PHY - ---help--- - Currently supports the NXP TJA1100 and TJA1101 PHY. +@@ -320,6 +320,12 @@ config AT803X_PHY + Currently supports the AR8030, AR8031, AR8033, AR8035 and internal + QCA8337(Internal qca8k PHY) model +config QCA807X_PHY + tristate "Qualcomm QCA807X PHYs" @@ -37,10 +37,10 @@ Signed-off-by: Robert Marko + config QSEMI_PHY tristate "Quality Semiconductor PHYs" - ---help--- + help --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -105,6 +105,7 @@ obj-$(CONFIG_MICROSEMI_PHY) += mscc.o +@@ -86,6 +86,7 @@ obj-$(CONFIG_MICROSEMI_PHY) += mscc/ obj-$(CONFIG_NATIONAL_PHY) += national.o obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o obj-$(CONFIG_QSEMI_PHY) += qsemi.o diff --git a/target/linux/ipq40xx/patches-5.4/708-arm-dts-ipq4019-QCA807x-properties.patch b/target/linux/ipq40xx/patches-5.10/708-arm-dts-ipq4019-QCA807x-properties.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/708-arm-dts-ipq4019-QCA807x-properties.patch rename to target/linux/ipq40xx/patches-5.10/708-arm-dts-ipq4019-QCA807x-properties.patch diff --git a/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch b/target/linux/ipq40xx/patches-5.10/710-net-add-qualcomm-essedma-ethernet-driver.patch similarity index 77% rename from target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch rename to target/linux/ipq40xx/patches-5.10/710-net-add-qualcomm-essedma-ethernet-driver.patch index 5bf2c9242..793ce7214 100644 --- a/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch +++ b/target/linux/ipq40xx/patches-5.10/710-net-add-qualcomm-essedma-ethernet-driver.patch @@ -35,14 +35,3 @@ Signed-off-by: Christian Lamparter +obj-$(CONFIG_ESSEDMA) += essedma/ obj-$(CONFIG_RMNET) += rmnet/ ---- a/drivers/net/ethernet/qualcomm/essedma/edma.c -+++ b/drivers/net/ethernet/qualcomm/essedma/edma.c -@@ -1487,7 +1487,7 @@ int edma_rx_flow_steer(struct net_device - int res; - - if (skb->protocol == htons(ETH_P_IPV6)) { -- dev_err(&adapter->pdev->dev, "IPv6 not supported\n"); -+ - res = -EINVAL; - goto no_protocol_err; - } diff --git a/target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch b/target/linux/ipq40xx/patches-5.10/711-dts-ipq4019-add-ethernet-essedma-node.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch rename to target/linux/ipq40xx/patches-5.10/711-dts-ipq4019-add-ethernet-essedma-node.patch diff --git a/target/linux/ipq40xx/patches-5.4/850-soc-add-qualcomm-syscon.patch b/target/linux/ipq40xx/patches-5.10/850-soc-add-qualcomm-syscon.patch similarity index 96% rename from target/linux/ipq40xx/patches-5.4/850-soc-add-qualcomm-syscon.patch rename to target/linux/ipq40xx/patches-5.10/850-soc-add-qualcomm-syscon.patch index d879730ae..33ea97dde 100644 --- a/target/linux/ipq40xx/patches-5.4/850-soc-add-qualcomm-syscon.patch +++ b/target/linux/ipq40xx/patches-5.10/850-soc-add-qualcomm-syscon.patch @@ -2,17 +2,17 @@ From: Christian Lamparter Subject: SoC: add qualcomm syscon --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile -@@ -20,6 +20,7 @@ obj-$(CONFIG_QCOM_SMP2P) += smp2p.o +@@ -21,6 +21,7 @@ obj-$(CONFIG_QCOM_SMP2P) += smp2p.o obj-$(CONFIG_QCOM_SMSM) += smsm.o obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o +obj-$(CONFIG_QCOM_TCSR) += qcom_tcsr.o obj-$(CONFIG_QCOM_APR) += apr.o - obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o - obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o + obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o + obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig -@@ -184,6 +184,13 @@ config QCOM_SOCINFO +@@ -191,6 +191,13 @@ config QCOM_SOCINFO Say yes here to support the Qualcomm socinfo driver, providing information about the SoC to user space. diff --git a/target/linux/ipq40xx/patches-5.4/900-dts-ipq4019-ap-dk01.1.patch b/target/linux/ipq40xx/patches-5.10/900-dts-ipq4019-ap-dk01.1.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/900-dts-ipq4019-ap-dk01.1.patch rename to target/linux/ipq40xx/patches-5.10/900-dts-ipq4019-ap-dk01.1.patch diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch similarity index 70% rename from target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch rename to target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch index a2a65769b..c51586a23 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,60 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -904,11 +904,76 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -18,56 +18,72 @@ Signed-off-by: John Crispin + qcom-ipq4018-ap120c-ac.dtb \ + qcom-ipq4018-dap-2610.dtb \ + qcom-ipq4018-cs-w3-wd1200g-eup.dtb \ ++ qcom-ipq4018-magic-2-wifi-next.dtb \ + qcom-ipq4018-ea6350v3.dtb \ + qcom-ipq4018-eap1300.dtb \ ++ qcom-ipq4018-ecw5211.dtb \ + qcom-ipq4018-emd1.dtb \ + qcom-ipq4018-emr3500.dtb \ + qcom-ipq4018-ens620ext.dtb \ + qcom-ipq4018-ex6100v2.dtb \ + qcom-ipq4018-ex6150v2.dtb \ -+ qcom-ipq4018-ex6200v2.dtb \ + qcom-ipq4018-fritzbox-4040.dtb \ ++ qcom-ipq4018-gl-ap1300.dtb \ + qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-meshpoint-one.dtb \ ++ qcom-ipq4018-cap-ac.dtb \ ++ qcom-ipq4018-hap-ac2.dtb \ ++ qcom-ipq4018-sxtsq-5-ac.dtb \ + qcom-ipq4018-nbg6617.dtb \ ++ qcom-ipq4019-oap100.dtb \ ++ qcom-ipq4018-pa1200.dtb \ + qcom-ipq4018-rt-ac58u.dtb \ ++ qcom-ipq4018-rutx10.dtb \ ++ qcom-ipq4018-wac510.dtb \ + qcom-ipq4018-wre6606.dtb \ ++ qcom-ipq4018-wrtq-329acn.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \ qcom-ipq4019-ap.dk04.1-c1.dtb \ qcom-ipq4019-ap.dk04.1-c3.dtb \ qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ + qcom-ipq4019-a62.dtb \ -+ qcom-ipq4019-c526a.dtb \ -+ qcom-ipq4019-ca100.dtb \ + qcom-ipq4019-cm520-79f.dtb \ ++ qcom-ipq4019-e2600ac-c1.dtb \ ++ qcom-ipq4019-e2600ac-c2.dtb \ + qcom-ipq4019-ea8300.dtb \ + qcom-ipq4019-eap2200.dtb \ -+ qcom-ipq4019-zte-mf263.dtb \ + qcom-ipq4019-fritzbox-7530.dtb \ + qcom-ipq4019-fritzrepeater-1200.dtb \ + qcom-ipq4019-fritzrepeater-3000.dtb \ -+ qcom-ipq4019-map-ac2200.dtb \ -+ qcom-ipq4019-e2600ac-c1.dtb \ -+ qcom-ipq4019-e2600ac-c2.dtb \ + qcom-ipq4019-habanero-dvk.dtb \ -+ qcom-ipq4019-r619ac.dtb \ ++ qcom-ipq4019-hap-ac3.dtb \ ++ qcom-ipq4019-map-ac2200.dtb \ ++ qcom-ipq4019-lhgg-60ad.dtb \ ++ qcom-ipq4019-mf286d.dtb \ ++ qcom-ipq4019-mf289f.dtb \ ++ qcom-ipq4019-mr8300.dtb \ ++ qcom-ipq4019-pa2200.dtb \ ++ qcom-ipq4019-r619ac-64m.dtb \ + qcom-ipq4019-r619ac-128m.dtb \ ++ qcom-ipq4019-rbr50.dtb \ ++ qcom-ipq4019-rbs50.dtb \ ++ qcom-ipq4019-rt-ac42u.dtb \ + qcom-ipq4019-rtl30vw.dtb \ -+ qcom-ipq4019-rt-acrh17.dtb \ ++ qcom-ipq4019-srr60.dtb \ ++ qcom-ipq4019-srs60.dtb \ ++ qcom-ipq4019-x1pro.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ -+ qcom-ipq4019-wr142ac.dtb \ -+ qcom-ipq4019-wr142ac-nand.dtb \ + qcom-ipq4019-wtr-m2133hp.dtb \ + qcom-ipq4028-wpj428.dtb \ + qcom-ipq4029-ap-303.dtb \ + qcom-ipq4029-ap-303h.dtb \ + qcom-ipq4029-ap-365.dtb \ -+ qcom-ipq4018-gl-a1300.dtb \ + qcom-ipq4029-gl-b1300.dtb \ ++ qcom-ipq4019-gl-b2200.dtb \ + qcom-ipq4029-gl-s1300.dtb \ + qcom-ipq4029-mr33.dtb \ qcom-ipq8064-ap148.dtb \ + qcom-ipq8064-rb3011.dtb \ qcom-msm8660-surf.dtb \ - qcom-msm8960-cdp.dtb \ diff --git a/target/linux/ipq40xx/patches-5.4/902-dts-ipq4019-ap-dk04.1.patch b/target/linux/ipq40xx/patches-5.10/902-dts-ipq4019-ap-dk04.1.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/902-dts-ipq4019-ap-dk04.1.patch rename to target/linux/ipq40xx/patches-5.10/902-dts-ipq4019-ap-dk04.1.patch diff --git a/target/linux/ipq40xx/patches-5.4/999-ipq40xx-unlock-cpu-frequency.patch b/target/linux/ipq40xx/patches-5.10/999-ipq40xx-unlock-cpu-frequency.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/999-ipq40xx-unlock-cpu-frequency.patch rename to target/linux/ipq40xx/patches-5.10/999-ipq40xx-unlock-cpu-frequency.patch diff --git a/target/linux/ipq40xx/patches-5.4/0001-v5.7-ARM-qcom-Add-support-for-IPQ40xx.patch b/target/linux/ipq40xx/patches-5.4/0001-v5.7-ARM-qcom-Add-support-for-IPQ40xx.patch deleted file mode 100644 index 8aa71f360..000000000 --- a/target/linux/ipq40xx/patches-5.4/0001-v5.7-ARM-qcom-Add-support-for-IPQ40xx.patch +++ /dev/null @@ -1,42 +0,0 @@ -From f125e2d4339dda6937865f975470b29c84714c9b Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Mon, 6 Jan 2020 14:57:15 +0100 -Subject: [PATCH] ARM: qcom: Add support for IPQ40xx - -Add support for the Qualcomm IPQ40xx SoC in Kconfig. -Also add its appropriate textofs. - -Signed-off-by: Christian Lamparter -Signed-off-by: John Crispin -Tested-by: Robert Marko -Cc: Luka Perkov -Signed-off-by: Arnd Bergmann ---- - arch/arm/Makefile | 1 + - arch/arm/mach-qcom/Kconfig | 5 +++++ - 2 files changed, 6 insertions(+) - ---- a/arch/arm/Makefile -+++ b/arch/arm/Makefile -@@ -152,6 +152,7 @@ textofs-$(CONFIG_PM_H1940) := 0x001 - ifeq ($(CONFIG_ARCH_SA1100),y) - textofs-$(CONFIG_SA1111) := 0x00208000 - endif -+textofs-$(CONFIG_ARCH_IPQ40XX) := 0x00208000 - textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000 - textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 - textofs-$(CONFIG_ARCH_MESON) := 0x00208000 ---- a/arch/arm/mach-qcom/Kconfig -+++ b/arch/arm/mach-qcom/Kconfig -@@ -12,6 +12,11 @@ menuconfig ARCH_QCOM - - if ARCH_QCOM - -+config ARCH_IPQ40XX -+ bool "Enable support for IPQ40XX" -+ select CLKSRC_QCOM -+ select HAVE_ARM_ARCH_TIMER -+ - config ARCH_MSM8X60 - bool "Enable support for MSM8X60" - select CLKSRC_QCOM diff --git a/target/linux/ipq40xx/patches-5.4/0002-01-v5.6-regulator-add-IPQ4019-SDHCI-VQMMC-LDO-driver.patch b/target/linux/ipq40xx/patches-5.4/0002-01-v5.6-regulator-add-IPQ4019-SDHCI-VQMMC-LDO-driver.patch deleted file mode 100644 index aaf8c807e..000000000 --- a/target/linux/ipq40xx/patches-5.4/0002-01-v5.6-regulator-add-IPQ4019-SDHCI-VQMMC-LDO-driver.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 97043d292365ae39d62b54a6d79dff98d048b501 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 22 Jan 2020 12:44:14 +0100 -Subject: [PATCH] From ebf652b408200504194be32ad0a3f5bb49d6000a Mon Sep 17 - 00:00:00 2001 From: Robert Marko Date: Sun, 12 Jan - 2020 12:30:01 +0100 Subject: [PATCH] regulator: add IPQ4019 SDHCI VQMMC LDO - driver - -This introduces the IPQ4019 VQMMC LDO driver needed for -the SD/EMMC driver I/O level operation. -This will enable introducing SD/EMMC support for the built-in controller. - -Signed-off-by: Mantas Pucka -Signed-off-by: Robert Marko -Link: https://lore.kernel.org/r/20200112113003.11110-1-robert.marko@sartura.hr -Signed-off-by: Mark Brown ---- - drivers/regulator/Kconfig | 7 ++ - drivers/regulator/Makefile | 1 + - drivers/regulator/vqmmc-ipq4019-regulator.c | 101 ++++++++++++++++++++ - 3 files changed, 109 insertions(+) - create mode 100644 drivers/regulator/vqmmc-ipq4019-regulator.c - ---- a/drivers/regulator/Kconfig -+++ b/drivers/regulator/Kconfig -@@ -1077,6 +1077,13 @@ config REGULATOR_VEXPRESS - This driver provides support for voltage regulators available - on the ARM Ltd's Versatile Express platform. - -+config REGULATOR_VQMMC_IPQ4019 -+ tristate "IPQ4019 VQMMC SD LDO regulator support" -+ depends on ARCH_QCOM -+ help -+ This driver provides support for the VQMMC LDO I/0 -+ voltage regulator of the IPQ4019 SD/EMMC controller. -+ - config REGULATOR_WM831X - tristate "Wolfson Microelectronics WM831x PMIC regulators" - depends on MFD_WM831X ---- a/drivers/regulator/Makefile -+++ b/drivers/regulator/Makefile -@@ -132,6 +132,7 @@ obj-$(CONFIG_REGULATOR_TWL4030) += twl-r - obj-$(CONFIG_REGULATOR_UNIPHIER) += uniphier-regulator.o - obj-$(CONFIG_REGULATOR_VCTRL) += vctrl-regulator.o - obj-$(CONFIG_REGULATOR_VEXPRESS) += vexpress-regulator.o -+obj-$(CONFIG_REGULATOR_VQMMC_IPQ4019) += vqmmc-ipq4019-regulator.o - obj-$(CONFIG_REGULATOR_WM831X) += wm831x-dcdc.o - obj-$(CONFIG_REGULATOR_WM831X) += wm831x-isink.o - obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o ---- /dev/null -+++ b/drivers/regulator/vqmmc-ipq4019-regulator.c -@@ -0,0 +1,101 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+// -+// Copyright (c) 2019 Mantas Pucka -+// Copyright (c) 2019 Robert Marko -+// -+// Driver for IPQ4019 SD/MMC controller's I/O LDO voltage regulator -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static const unsigned int ipq4019_vmmc_voltages[] = { -+ 1500000, 1800000, 2500000, 3000000, -+}; -+ -+static const struct regulator_ops ipq4019_regulator_voltage_ops = { -+ .list_voltage = regulator_list_voltage_table, -+ .map_voltage = regulator_map_voltage_ascend, -+ .get_voltage_sel = regulator_get_voltage_sel_regmap, -+ .set_voltage_sel = regulator_set_voltage_sel_regmap, -+}; -+ -+static const struct regulator_desc vmmc_regulator = { -+ .name = "vmmcq", -+ .ops = &ipq4019_regulator_voltage_ops, -+ .type = REGULATOR_VOLTAGE, -+ .owner = THIS_MODULE, -+ .volt_table = ipq4019_vmmc_voltages, -+ .n_voltages = ARRAY_SIZE(ipq4019_vmmc_voltages), -+ .vsel_reg = 0, -+ .vsel_mask = 0x3, -+}; -+ -+static const struct regmap_config ipq4019_vmmcq_regmap_config = { -+ .reg_bits = 32, -+ .reg_stride = 4, -+ .val_bits = 32, -+}; -+ -+static int ipq4019_regulator_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct regulator_init_data *init_data; -+ struct regulator_config cfg = {}; -+ struct regulator_dev *rdev; -+ struct resource *res; -+ struct regmap *rmap; -+ void __iomem *base; -+ -+ init_data = of_get_regulator_init_data(dev, dev->of_node, -+ &vmmc_regulator); -+ if (!init_data) -+ return -EINVAL; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ base = devm_ioremap_resource(dev, res); -+ if (IS_ERR(base)) -+ return PTR_ERR(base); -+ -+ rmap = devm_regmap_init_mmio(dev, base, &ipq4019_vmmcq_regmap_config); -+ if (IS_ERR(rmap)) -+ return PTR_ERR(rmap); -+ -+ cfg.dev = dev; -+ cfg.init_data = init_data; -+ cfg.of_node = dev->of_node; -+ cfg.regmap = rmap; -+ -+ rdev = devm_regulator_register(dev, &vmmc_regulator, &cfg); -+ if (IS_ERR(rdev)) { -+ dev_err(dev, "Failed to register regulator: %ld\n", -+ PTR_ERR(rdev)); -+ return PTR_ERR(rdev); -+ } -+ platform_set_drvdata(pdev, rdev); -+ -+ return 0; -+} -+ -+static const struct of_device_id regulator_ipq4019_of_match[] = { -+ { .compatible = "qcom,vqmmc-ipq4019-regulator", }, -+ {}, -+}; -+ -+static struct platform_driver ipq4019_regulator_driver = { -+ .probe = ipq4019_regulator_probe, -+ .driver = { -+ .name = "vqmmc-ipq4019-regulator", -+ .of_match_table = of_match_ptr(regulator_ipq4019_of_match), -+ }, -+}; -+module_platform_driver(ipq4019_regulator_driver); -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Mantas Pucka "); -+MODULE_DESCRIPTION("IPQ4019 VQMMC voltage regulator"); diff --git a/target/linux/ipq40xx/patches-5.4/0002-02-v5.5-ARM-dts-qcom-ipq4019-Add-SDHCI-controller-node.patch b/target/linux/ipq40xx/patches-5.4/0002-02-v5.5-ARM-dts-qcom-ipq4019-Add-SDHCI-controller-node.patch deleted file mode 100644 index 1f54446b9..000000000 --- a/target/linux/ipq40xx/patches-5.4/0002-02-v5.5-ARM-dts-qcom-ipq4019-Add-SDHCI-controller-node.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 04b3b72b5b8fdb883bfdc619cb29b03641b1cc6a Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Thu, 15 Aug 2019 19:28:23 +0200 -Subject: [PATCH] ARM: dts: qcom: ipq4019: Add SDHCI controller node - -IPQ4019 has a built in SD/eMMC controller which is supported by the -SDHCI MSM driver, by the "qcom,sdhci-msm-v4" binding. -So lets add the appropriate node for it. - -Signed-off-by: Robert Marko -Signed-off-by: Bjorn Andersson ---- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -207,6 +207,18 @@ - interrupts = ; - }; - -+ sdhci: sdhci@7824900 { -+ compatible = "qcom,sdhci-msm-v4"; -+ reg = <0x7824900 0x11c>, <0x7824000 0x800>; -+ interrupts = , ; -+ interrupt-names = "hc_irq", "pwr_irq"; -+ bus-width = <8>; -+ clocks = <&gcc GCC_SDCC1_APPS_CLK>, <&gcc GCC_SDCC1_AHB_CLK>, -+ <&gcc GCC_DCD_XO_CLK>; -+ clock-names = "core", "iface", "xo"; -+ status = "disabled"; -+ }; -+ - blsp_dma: dma@7884000 { - compatible = "qcom,bam-v1.7.0"; - reg = <0x07884000 0x23000>; diff --git a/target/linux/ipq40xx/patches-5.4/0003-v5.6-ARM-dts-qcom-Add-nodes-for-SMP-boot-in-IPQ40xx.patch b/target/linux/ipq40xx/patches-5.4/0003-v5.6-ARM-dts-qcom-Add-nodes-for-SMP-boot-in-IPQ40xx.patch deleted file mode 100644 index 40c4eb1ae..000000000 --- a/target/linux/ipq40xx/patches-5.4/0003-v5.6-ARM-dts-qcom-Add-nodes-for-SMP-boot-in-IPQ40xx.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 5e4548922009870a38bcf1d887317676d4e08f54 Mon Sep 17 00:00:00 2001 -From: Damir Franusic -Date: Thu, 21 Nov 2019 16:29:02 +0100 -Subject: [PATCH] ARM: dts: qcom: Add nodes for SMP boot in IPQ40xx - -Add missing nodes and properties to enable SMP -support on IPQ40xx devices. - -Booting without "saw_l2" node: - -[ 0.001400] CPU: Testing write buffer coherency: ok -[ 0.001856] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 -[ 0.060163] Setting up static identity map for 0x80300000 - 0x80300060 -[ 0.080140] rcu: Hierarchical SRCU implementation. -[ 0.120258] smp: Bringing up secondary CPUs ... -[ 0.200540] CPU1: failed to boot: -19 -[ 0.280689] CPU2: failed to boot: -19 -[ 0.360874] CPU3: failed to boot: -19 -[ 0.360966] smp: Brought up 1 node, 1 CPU -[ 0.360979] SMP: Total of 1 processors activated (96.00 BogoMIPS). -[ 0.360988] CPU: All CPU(s) started in SVC mode. - -Then, booting with "saw_l2" node present (this patch applied): - -[ 0.001450] CPU: Testing write buffer coherency: ok -[ 0.001904] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 -[ 0.060161] Setting up static identity map for 0x80300000 - 0x80300060 -[ 0.080137] rcu: Hierarchical SRCU implementation. -[ 0.120252] smp: Bringing up secondary CPUs ... -[ 0.200958] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001 -[ 0.281091] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002 -[ 0.361264] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003 -[ 0.361430] smp: Brought up 1 node, 4 CPUs -[ 0.361460] SMP: Total of 4 processors activated (384.00 BogoMIPS). -[ 0.361469] CPU: All CPU(s) started in SVC mode. - -Signed-off-by: Damir Franusic -Cc: Luka Perkov -Cc: Robert Marko -Cc: Andy Gross -Cc: Rob Herring -Cc: linux-arm-msm@vger.kernel.org -Link: https://lore.kernel.org/r/20191121152902.21394-1-damir.franusic@gmail.com -Signed-off-by: Bjorn Andersson ---- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -102,6 +102,7 @@ - L2: l2-cache { - compatible = "cache"; - cache-level = <2>; -+ qcom,saw = <&saw_l2>; - }; - }; - -@@ -354,6 +355,12 @@ - regulator; - }; - -+ saw_l2: regulator@b012000 { -+ compatible = "qcom,saw2"; -+ reg = <0xb012000 0x1000>; -+ regulator; -+ }; -+ - blsp1_uart1: serial@78af000 { - compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; - reg = <0x78af000 0x200>; diff --git a/target/linux/ipq40xx/patches-5.4/0003-v5.7-ARM-dts-qcom-add-gpio-ranges-property.patch b/target/linux/ipq40xx/patches-5.4/0003-v5.7-ARM-dts-qcom-add-gpio-ranges-property.patch deleted file mode 100644 index 0df702cf1..000000000 --- a/target/linux/ipq40xx/patches-5.4/0003-v5.7-ARM-dts-qcom-add-gpio-ranges-property.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 8b99dc0922618062a1589ebd74df6108b4f9ac22 Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Wed, 8 Jan 2020 13:54:55 +0100 -Subject: [PATCH] ARM: dts: qcom: add gpio-ranges property - -This patch adds the gpio-ranges property to almost all of -the Qualcomm ARM platforms that utilize the pinctrl-msm -framework. - -The gpio-ranges property is part of the gpiolib subsystem. -As a result, the binding text is available in section -"2.1 gpio- and pin-controller interaction" of -Documentation/devicetree/bindings/gpio/gpio.txt - -For more information please see the patch titled: -"pinctrl: msm: fix gpio-hog related boot issues" from -this series. - -Reported-by: Sven Eckelmann -Tested-by: Sven Eckelmann [ipq4019] -Reviewed-by: Bjorn Andersson -Reviewed-by: Linus Walleij -Signed-off-by: Christian Lamparter -Tested-by: Robert Marko [ipq4019] -Cc: Luka Perkov -Signed-off-by: Robert Marko -Link: https://lore.kernel.org/r/20200108125455.308969-1-robert.marko@sartura.hr -Signed-off-by: Bjorn Andersson ---- - arch/arm/boot/dts/qcom-apq8064.dtsi | 1 + - arch/arm/boot/dts/qcom-apq8084.dtsi | 1 + - arch/arm/boot/dts/qcom-ipq4019.dtsi | 1 + - arch/arm/boot/dts/qcom-ipq8064.dtsi | 1 + - arch/arm/boot/dts/qcom-mdm9615.dtsi | 1 + - arch/arm/boot/dts/qcom-msm8660.dtsi | 1 + - arch/arm/boot/dts/qcom-msm8960.dtsi | 1 + - arch/arm/boot/dts/qcom-msm8974.dtsi | 1 + - 8 files changed, 8 insertions(+) - ---- a/arch/arm/boot/dts/qcom-apq8064.dtsi -+++ b/arch/arm/boot/dts/qcom-apq8064.dtsi -@@ -350,6 +350,7 @@ - reg = <0x800000 0x4000>; - - gpio-controller; -+ gpio-ranges = <&tlmm_pinmux 0 0 90>; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; ---- a/arch/arm/boot/dts/qcom-apq8084.dtsi -+++ b/arch/arm/boot/dts/qcom-apq8084.dtsi -@@ -401,6 +401,7 @@ - compatible = "qcom,apq8084-pinctrl"; - reg = <0xfd510000 0x4000>; - gpio-controller; -+ gpio-ranges = <&tlmm 0 0 147>; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -202,6 +202,7 @@ - compatible = "qcom,ipq4019-pinctrl"; - reg = <0x01000000 0x300000>; - gpio-controller; -+ gpio-ranges = <&tlmm 0 0 100>; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; ---- a/arch/arm/boot/dts/qcom-ipq8064.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi -@@ -119,6 +119,7 @@ - reg = <0x800000 0x4000>; - - gpio-controller; -+ gpio-ranges = <&qcom_pinmux 0 0 69>; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; ---- a/arch/arm/boot/dts/qcom-mdm9615.dtsi -+++ b/arch/arm/boot/dts/qcom-mdm9615.dtsi -@@ -128,6 +128,7 @@ - msmgpio: pinctrl@800000 { - compatible = "qcom,mdm9615-pinctrl"; - gpio-controller; -+ gpio-ranges = <&msmgpio 0 0 88>; - #gpio-cells = <2>; - interrupts = ; - interrupt-controller; ---- a/arch/arm/boot/dts/qcom-msm8660.dtsi -+++ b/arch/arm/boot/dts/qcom-msm8660.dtsi -@@ -115,6 +115,7 @@ - reg = <0x800000 0x4000>; - - gpio-controller; -+ gpio-ranges = <&tlmm 0 0 173>; - #gpio-cells = <2>; - interrupts = <0 16 0x4>; - interrupt-controller; ---- a/arch/arm/boot/dts/qcom-msm8960.dtsi -+++ b/arch/arm/boot/dts/qcom-msm8960.dtsi -@@ -107,6 +107,7 @@ - msmgpio: pinctrl@800000 { - compatible = "qcom,msm8960-pinctrl"; - gpio-controller; -+ gpio-ranges = <&msmgpio 0 0 152>; - #gpio-cells = <2>; - interrupts = <0 16 0x4>; - interrupt-controller; ---- a/arch/arm/boot/dts/qcom-msm8974.dtsi -+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi -@@ -707,6 +707,7 @@ - compatible = "qcom,msm8974-pinctrl"; - reg = <0xfd510000 0x4000>; - gpio-controller; -+ gpio-ranges = <&msmgpio 0 0 146>; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; diff --git a/target/linux/ipq40xx/patches-5.4/0004-v5.8-ARM-dts-qcom-ipq4019-fix-high-resolution-timer.patch b/target/linux/ipq40xx/patches-5.4/0004-v5.8-ARM-dts-qcom-ipq4019-fix-high-resolution-timer.patch deleted file mode 100644 index 00a50bec1..000000000 --- a/target/linux/ipq40xx/patches-5.4/0004-v5.8-ARM-dts-qcom-ipq4019-fix-high-resolution-timer.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8acc36189dcaf4487d8c6ba7445948f39b1d248a Mon Sep 17 00:00:00 2001 -From: Abhishek Sahu -Date: Fri, 3 Apr 2020 13:40:40 +0200 -Subject: [PATCH] ARM: dts: qcom: ipq4019: fix high resolution timer - -Cherry-picked from CAF QSDK repo. -Original commit message: -The kernel is failing in switching the timer for high resolution -mode and clock source operates in 10ms resolution. The always-on -property needs to be given for timer device tree node to make -clock source working in 1ns resolution. - -Signed-off-by: Abhishek Sahu -Signed-off-by: Pavel Kubelun -Signed-off-by: Christian Lamparter -Tested-by: Robert Marko -Cc: Luka Perkov -Link: https://lore.kernel.org/r/20200403114040.349787-1-robert.marko@sartura.hr -Signed-off-by: Bjorn Andersson ---- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -167,6 +167,7 @@ - <1 4 0xf08>, - <1 1 0xf08>; - clock-frequency = <48000000>; -+ always-on; - }; - - soc { diff --git a/target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch b/target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch deleted file mode 100644 index bc107df55..000000000 --- a/target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch +++ /dev/null @@ -1,210 +0,0 @@ -From 466ed24fb22342f3ae1c10758a6a0c6a8c081b2d Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Thu, 30 Apr 2020 11:07:05 +0200 -Subject: [PATCH] net: phy: mdio: add IPQ4019 MDIO driver - -This patch adds the driver for the MDIO interface -inside of Qualcomm IPQ40xx series SoC-s. - -Signed-off-by: Christian Lamparter -Signed-off-by: Robert Marko -Reviewed-by: Andrew Lunn -Reviewed-by: Florian Fainelli -Cc: Luka Perkov -Signed-off-by: David S. Miller ---- - drivers/net/phy/Kconfig | 7 ++ - drivers/net/phy/Makefile | 1 + - drivers/net/phy/mdio-ipq4019.c | 160 +++++++++++++++++++++++++++++++++ - 3 files changed, 168 insertions(+) - create mode 100644 drivers/net/phy/mdio-ipq4019.c - ---- a/drivers/net/phy/Kconfig -+++ b/drivers/net/phy/Kconfig -@@ -156,6 +156,13 @@ config MDIO_I2C - - This is library mode. - -+config MDIO_IPQ4019 -+ tristate "Qualcomm IPQ4019 MDIO interface support" -+ depends on HAS_IOMEM && OF_MDIO -+ help -+ This driver supports the MDIO interface found in Qualcomm -+ IPQ40xx series Soc-s. -+ - config MDIO_MOXART - tristate "MOXA ART MDIO interface support" - depends on ARCH_MOXART || COMPILE_TEST ---- a/drivers/net/phy/Makefile -+++ b/drivers/net/phy/Makefile -@@ -52,6 +52,7 @@ obj-$(CONFIG_MDIO_CAVIUM) += mdio-cavium - obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o - obj-$(CONFIG_MDIO_HISI_FEMAC) += mdio-hisi-femac.o - obj-$(CONFIG_MDIO_I2C) += mdio-i2c.o -+obj-$(CONFIG_MDIO_IPQ4019) += mdio-ipq4019.o - obj-$(CONFIG_MDIO_MOXART) += mdio-moxart.o - obj-$(CONFIG_MDIO_MSCC_MIIM) += mdio-mscc-miim.o - obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o ---- /dev/null -+++ b/drivers/net/phy/mdio-ipq4019.c -@@ -0,0 +1,160 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* Copyright (c) 2015, The Linux Foundation. All rights reserved. */ -+/* Copyright (c) 2020 Sartura Ltd. */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define MDIO_ADDR_REG 0x44 -+#define MDIO_DATA_WRITE_REG 0x48 -+#define MDIO_DATA_READ_REG 0x4c -+#define MDIO_CMD_REG 0x50 -+#define MDIO_CMD_ACCESS_BUSY BIT(16) -+#define MDIO_CMD_ACCESS_START BIT(8) -+#define MDIO_CMD_ACCESS_CODE_READ 0 -+#define MDIO_CMD_ACCESS_CODE_WRITE 1 -+ -+#define ipq4019_MDIO_TIMEOUT 10000 -+#define ipq4019_MDIO_SLEEP 10 -+ -+struct ipq4019_mdio_data { -+ void __iomem *membase; -+}; -+ -+static int ipq4019_mdio_wait_busy(struct mii_bus *bus) -+{ -+ struct ipq4019_mdio_data *priv = bus->priv; -+ unsigned int busy; -+ -+ return readl_poll_timeout(priv->membase + MDIO_CMD_REG, busy, -+ (busy & MDIO_CMD_ACCESS_BUSY) == 0, -+ ipq4019_MDIO_SLEEP, ipq4019_MDIO_TIMEOUT); -+} -+ -+static int ipq4019_mdio_read(struct mii_bus *bus, int mii_id, int regnum) -+{ -+ struct ipq4019_mdio_data *priv = bus->priv; -+ unsigned int cmd; -+ -+ /* Reject clause 45 */ -+ if (regnum & MII_ADDR_C45) -+ return -EOPNOTSUPP; -+ -+ if (ipq4019_mdio_wait_busy(bus)) -+ return -ETIMEDOUT; -+ -+ /* issue the phy address and reg */ -+ writel((mii_id << 8) | regnum, priv->membase + MDIO_ADDR_REG); -+ -+ cmd = MDIO_CMD_ACCESS_START | MDIO_CMD_ACCESS_CODE_READ; -+ -+ /* issue read command */ -+ writel(cmd, priv->membase + MDIO_CMD_REG); -+ -+ /* Wait read complete */ -+ if (ipq4019_mdio_wait_busy(bus)) -+ return -ETIMEDOUT; -+ -+ /* Read and return data */ -+ return readl(priv->membase + MDIO_DATA_READ_REG); -+} -+ -+static int ipq4019_mdio_write(struct mii_bus *bus, int mii_id, int regnum, -+ u16 value) -+{ -+ struct ipq4019_mdio_data *priv = bus->priv; -+ unsigned int cmd; -+ -+ /* Reject clause 45 */ -+ if (regnum & MII_ADDR_C45) -+ return -EOPNOTSUPP; -+ -+ if (ipq4019_mdio_wait_busy(bus)) -+ return -ETIMEDOUT; -+ -+ /* issue the phy address and reg */ -+ writel((mii_id << 8) | regnum, priv->membase + MDIO_ADDR_REG); -+ -+ /* issue write data */ -+ writel(value, priv->membase + MDIO_DATA_WRITE_REG); -+ -+ cmd = MDIO_CMD_ACCESS_START | MDIO_CMD_ACCESS_CODE_WRITE; -+ /* issue write command */ -+ writel(cmd, priv->membase + MDIO_CMD_REG); -+ -+ /* Wait write complete */ -+ if (ipq4019_mdio_wait_busy(bus)) -+ return -ETIMEDOUT; -+ -+ return 0; -+} -+ -+static int ipq4019_mdio_probe(struct platform_device *pdev) -+{ -+ struct ipq4019_mdio_data *priv; -+ struct mii_bus *bus; -+ int ret; -+ -+ bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv)); -+ if (!bus) -+ return -ENOMEM; -+ -+ priv = bus->priv; -+ -+ priv->membase = devm_platform_ioremap_resource(pdev, 0); -+ if (IS_ERR(priv->membase)) -+ return PTR_ERR(priv->membase); -+ -+ bus->name = "ipq4019_mdio"; -+ bus->read = ipq4019_mdio_read; -+ bus->write = ipq4019_mdio_write; -+ bus->parent = &pdev->dev; -+ snprintf(bus->id, MII_BUS_ID_SIZE, "%s%d", pdev->name, pdev->id); -+ -+ ret = of_mdiobus_register(bus, pdev->dev.of_node); -+ if (ret) { -+ dev_err(&pdev->dev, "Cannot register MDIO bus!\n"); -+ return ret; -+ } -+ -+ platform_set_drvdata(pdev, bus); -+ -+ return 0; -+} -+ -+static int ipq4019_mdio_remove(struct platform_device *pdev) -+{ -+ struct mii_bus *bus = platform_get_drvdata(pdev); -+ -+ mdiobus_unregister(bus); -+ -+ return 0; -+} -+ -+static const struct of_device_id ipq4019_mdio_dt_ids[] = { -+ { .compatible = "qcom,ipq4019-mdio" }, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, ipq4019_mdio_dt_ids); -+ -+static struct platform_driver ipq4019_mdio_driver = { -+ .probe = ipq4019_mdio_probe, -+ .remove = ipq4019_mdio_remove, -+ .driver = { -+ .name = "ipq4019-mdio", -+ .of_match_table = ipq4019_mdio_dt_ids, -+ }, -+}; -+ -+module_platform_driver(ipq4019_mdio_driver); -+ -+MODULE_DESCRIPTION("ipq4019 MDIO interface driver"); -+MODULE_AUTHOR("Qualcomm Atheros"); -+MODULE_LICENSE("Dual BSD/GPL"); diff --git a/target/linux/ipq40xx/patches-5.4/0005-02-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch b/target/linux/ipq40xx/patches-5.4/0005-02-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch deleted file mode 100644 index 0f4b505b6..000000000 --- a/target/linux/ipq40xx/patches-5.4/0005-02-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 9c8c0f70ec6fdac2398632c723c48277be09b7c0 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Thu, 30 Apr 2020 11:07:07 +0200 -Subject: [PATCH] ARM: dts: qcom: ipq4019: add MDIO node - -This patch adds the necessary MDIO interface node -to the Qualcomm IPQ4019 DTSI. - -Built-in QCA8337N switch is managed using it, -and since we have a driver for it lets add it. - -Signed-off-by: Christian Lamparter -Signed-off-by: Robert Marko -Reviewed-by: Andrew Lunn -Reviewed-by: Florian Fainelli -Cc: Luka Perkov -Signed-off-by: David S. Miller ---- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 28 ++++++++++++++++++++++++++++ - 1 file changed, 28 insertions(+) - ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -578,5 +578,33 @@ - "legacy"; - status = "disabled"; - }; -+ -+ mdio: mdio@90000 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ compatible = "qcom,ipq4019-mdio"; -+ reg = <0x90000 0x64>; -+ status = "disabled"; -+ -+ ethphy0: ethernet-phy@0 { -+ reg = <0>; -+ }; -+ -+ ethphy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+ -+ ethphy2: ethernet-phy@2 { -+ reg = <2>; -+ }; -+ -+ ethphy3: ethernet-phy@3 { -+ reg = <3>; -+ }; -+ -+ ethphy4: ethernet-phy@4 { -+ reg = <4>; -+ }; -+ }; - }; - }; diff --git a/target/linux/ipq40xx/patches-5.4/0006-v5.5-crypto-qce-add-CRYPTO_ALG_KERN_DRIVER_ONLY-flag.patch b/target/linux/ipq40xx/patches-5.4/0006-v5.5-crypto-qce-add-CRYPTO_ALG_KERN_DRIVER_ONLY-flag.patch deleted file mode 100644 index 415d6fff9..000000000 --- a/target/linux/ipq40xx/patches-5.4/0006-v5.5-crypto-qce-add-CRYPTO_ALG_KERN_DRIVER_ONLY-flag.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Eneas U de Queiroz -Subject: [PATCH] crypto: qce - add CRYPTO_ALG_KERN_DRIVER_ONLY flag - -Set the CRYPTO_ALG_KERN_DRIVER_ONLY flag to all algorithms exposed by -the qce driver, since they are all hardware accelerated, accessible -through a kernel driver only, and not available directly to userspace. - -Signed-off-by: Eneas U de Queiroz - ---- a/drivers/crypto/qce/ablkcipher.c -+++ b/drivers/crypto/qce/ablkcipher.c -@@ -380,7 +380,7 @@ static int qce_ablkcipher_register_one(c - - alg->cra_priority = 300; - alg->cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC | -- CRYPTO_ALG_NEED_FALLBACK; -+ CRYPTO_ALG_NEED_FALLBACK | CRYPTO_ALG_KERN_DRIVER_ONLY; - alg->cra_ctxsize = sizeof(struct qce_cipher_ctx); - alg->cra_alignmask = 0; - alg->cra_type = &crypto_ablkcipher_type; ---- a/drivers/crypto/qce/sha.c -+++ b/drivers/crypto/qce/sha.c -@@ -495,7 +495,7 @@ static int qce_ahash_register_one(const - base = &alg->halg.base; - base->cra_blocksize = def->blocksize; - base->cra_priority = 300; -- base->cra_flags = CRYPTO_ALG_ASYNC; -+ base->cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY; - base->cra_ctxsize = sizeof(struct qce_sha_ctx); - base->cra_alignmask = 0; - base->cra_module = THIS_MODULE; diff --git a/target/linux/ipq40xx/patches-5.4/0007-v5.5-crypto-qce-switch-to-skcipher-API.patch b/target/linux/ipq40xx/patches-5.4/0007-v5.5-crypto-qce-switch-to-skcipher-API.patch deleted file mode 100644 index 4dcb94215..000000000 --- a/target/linux/ipq40xx/patches-5.4/0007-v5.5-crypto-qce-switch-to-skcipher-API.patch +++ /dev/null @@ -1,993 +0,0 @@ -From f441873642eebf20566c18d2966a8cd4b433ec1c Mon Sep 17 00:00:00 2001 -From: Ard Biesheuvel -Date: Tue, 5 Nov 2019 14:28:17 +0100 -Subject: [PATCH] crypto: qce - switch to skcipher API - -Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface") -dated 20 august 2015 introduced the new skcipher API which is supposed to -replace both blkcipher and ablkcipher. While all consumers of the API have -been converted long ago, some producers of the ablkcipher remain, forcing -us to keep the ablkcipher support routines alive, along with the matching -code to expose [a]blkciphers via the skcipher API. - -So switch this driver to the skcipher API, allowing us to finally drop the -blkcipher code in the near future. - -Reviewed-by: Stanimir Varbanov -Signed-off-by: Ard Biesheuvel -Backported-to-4.19-by: Eneas U de Queiroz - ---- a/drivers/crypto/qce/Makefile -+++ b/drivers/crypto/qce/Makefile -@@ -4,4 +4,4 @@ qcrypto-objs := core.o \ - common.o \ - dma.o \ - sha.o \ -- ablkcipher.o -+ skcipher.o ---- a/drivers/crypto/qce/cipher.h -+++ b/drivers/crypto/qce/cipher.h -@@ -45,12 +45,12 @@ struct qce_cipher_reqctx { - unsigned int cryptlen; - }; - --static inline struct qce_alg_template *to_cipher_tmpl(struct crypto_tfm *tfm) -+static inline struct qce_alg_template *to_cipher_tmpl(struct crypto_skcipher *tfm) - { -- struct crypto_alg *alg = tfm->__crt_alg; -- return container_of(alg, struct qce_alg_template, alg.crypto); -+ struct skcipher_alg *alg = crypto_skcipher_alg(tfm); -+ return container_of(alg, struct qce_alg_template, alg.skcipher); - } - --extern const struct qce_algo_ops ablkcipher_ops; -+extern const struct qce_algo_ops skcipher_ops; - - #endif /* _CIPHER_H_ */ ---- a/drivers/crypto/qce/common.c -+++ b/drivers/crypto/qce/common.c -@@ -304,13 +304,13 @@ go_proc: - return 0; - } - --static int qce_setup_regs_ablkcipher(struct crypto_async_request *async_req, -+static int qce_setup_regs_skcipher(struct crypto_async_request *async_req, - u32 totallen, u32 offset) - { -- struct ablkcipher_request *req = ablkcipher_request_cast(async_req); -- struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); -+ struct skcipher_request *req = skcipher_request_cast(async_req); -+ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); - struct qce_cipher_ctx *ctx = crypto_tfm_ctx(async_req->tfm); -- struct qce_alg_template *tmpl = to_cipher_tmpl(async_req->tfm); -+ struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); - struct qce_device *qce = tmpl->qce; - __be32 enckey[QCE_MAX_CIPHER_KEY_SIZE / sizeof(__be32)] = {0}; - __be32 enciv[QCE_MAX_IV_SIZE / sizeof(__be32)] = {0}; -@@ -389,8 +389,8 @@ int qce_start(struct crypto_async_reques - u32 offset) - { - switch (type) { -- case CRYPTO_ALG_TYPE_ABLKCIPHER: -- return qce_setup_regs_ablkcipher(async_req, totallen, offset); -+ case CRYPTO_ALG_TYPE_SKCIPHER: -+ return qce_setup_regs_skcipher(async_req, totallen, offset); - case CRYPTO_ALG_TYPE_AHASH: - return qce_setup_regs_ahash(async_req, totallen, offset); - default: ---- a/drivers/crypto/qce/common.h -+++ b/drivers/crypto/qce/common.h -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - - /* key size in bytes */ - #define QCE_SHA_HMAC_KEY_SIZE 64 -@@ -79,7 +80,7 @@ struct qce_alg_template { - unsigned long alg_flags; - const u32 *std_iv; - union { -- struct crypto_alg crypto; -+ struct skcipher_alg skcipher; - struct ahash_alg ahash; - } alg; - struct qce_device *qce; ---- a/drivers/crypto/qce/core.c -+++ b/drivers/crypto/qce/core.c -@@ -22,7 +22,7 @@ - #define QCE_QUEUE_LENGTH 1 - - static const struct qce_algo_ops *qce_ops[] = { -- &ablkcipher_ops, -+ &skcipher_ops, - &ahash_ops, - }; - ---- a/drivers/crypto/qce/ablkcipher.c -+++ /dev/null -@@ -1,440 +0,0 @@ --// SPDX-License-Identifier: GPL-2.0-only --/* -- * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. -- */ -- --#include --#include --#include --#include --#include --#include -- --#include "cipher.h" -- --static LIST_HEAD(ablkcipher_algs); -- --static void qce_ablkcipher_done(void *data) --{ -- struct crypto_async_request *async_req = data; -- struct ablkcipher_request *req = ablkcipher_request_cast(async_req); -- struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); -- struct qce_alg_template *tmpl = to_cipher_tmpl(async_req->tfm); -- struct qce_device *qce = tmpl->qce; -- enum dma_data_direction dir_src, dir_dst; -- u32 status; -- int error; -- bool diff_dst; -- -- diff_dst = (req->src != req->dst) ? true : false; -- dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; -- dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; -- -- error = qce_dma_terminate_all(&qce->dma); -- if (error) -- dev_dbg(qce->dev, "ablkcipher dma termination error (%d)\n", -- error); -- -- if (diff_dst) -- dma_unmap_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src); -- dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); -- -- sg_free_table(&rctx->dst_tbl); -- -- error = qce_check_status(qce, &status); -- if (error < 0) -- dev_dbg(qce->dev, "ablkcipher operation error (%x)\n", status); -- -- qce->async_req_done(tmpl->qce, error); --} -- --static int --qce_ablkcipher_async_req_handle(struct crypto_async_request *async_req) --{ -- struct ablkcipher_request *req = ablkcipher_request_cast(async_req); -- struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); -- struct crypto_ablkcipher *ablkcipher = crypto_ablkcipher_reqtfm(req); -- struct qce_alg_template *tmpl = to_cipher_tmpl(async_req->tfm); -- struct qce_device *qce = tmpl->qce; -- enum dma_data_direction dir_src, dir_dst; -- struct scatterlist *sg; -- bool diff_dst; -- gfp_t gfp; -- int ret; -- -- rctx->iv = req->info; -- rctx->ivsize = crypto_ablkcipher_ivsize(ablkcipher); -- rctx->cryptlen = req->nbytes; -- -- diff_dst = (req->src != req->dst) ? true : false; -- dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; -- dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; -- -- rctx->src_nents = sg_nents_for_len(req->src, req->nbytes); -- if (diff_dst) -- rctx->dst_nents = sg_nents_for_len(req->dst, req->nbytes); -- else -- rctx->dst_nents = rctx->src_nents; -- if (rctx->src_nents < 0) { -- dev_err(qce->dev, "Invalid numbers of src SG.\n"); -- return rctx->src_nents; -- } -- if (rctx->dst_nents < 0) { -- dev_err(qce->dev, "Invalid numbers of dst SG.\n"); -- return -rctx->dst_nents; -- } -- -- rctx->dst_nents += 1; -- -- gfp = (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? -- GFP_KERNEL : GFP_ATOMIC; -- -- ret = sg_alloc_table(&rctx->dst_tbl, rctx->dst_nents, gfp); -- if (ret) -- return ret; -- -- sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); -- -- sg = qce_sgtable_add(&rctx->dst_tbl, req->dst); -- if (IS_ERR(sg)) { -- ret = PTR_ERR(sg); -- goto error_free; -- } -- -- sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg); -- if (IS_ERR(sg)) { -- ret = PTR_ERR(sg); -- goto error_free; -- } -- -- sg_mark_end(sg); -- rctx->dst_sg = rctx->dst_tbl.sgl; -- -- ret = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); -- if (ret < 0) -- goto error_free; -- -- if (diff_dst) { -- ret = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src); -- if (ret < 0) -- goto error_unmap_dst; -- rctx->src_sg = req->src; -- } else { -- rctx->src_sg = rctx->dst_sg; -- } -- -- ret = qce_dma_prep_sgs(&qce->dma, rctx->src_sg, rctx->src_nents, -- rctx->dst_sg, rctx->dst_nents, -- qce_ablkcipher_done, async_req); -- if (ret) -- goto error_unmap_src; -- -- qce_dma_issue_pending(&qce->dma); -- -- ret = qce_start(async_req, tmpl->crypto_alg_type, req->nbytes, 0); -- if (ret) -- goto error_terminate; -- -- return 0; -- --error_terminate: -- qce_dma_terminate_all(&qce->dma); --error_unmap_src: -- if (diff_dst) -- dma_unmap_sg(qce->dev, req->src, rctx->src_nents, dir_src); --error_unmap_dst: -- dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); --error_free: -- sg_free_table(&rctx->dst_tbl); -- return ret; --} -- --static int qce_ablkcipher_setkey(struct crypto_ablkcipher *ablk, const u8 *key, -- unsigned int keylen) --{ -- struct crypto_tfm *tfm = crypto_ablkcipher_tfm(ablk); -- struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); -- int ret; -- -- if (!key || !keylen) -- return -EINVAL; -- -- switch (keylen) { -- case AES_KEYSIZE_128: -- case AES_KEYSIZE_256: -- break; -- default: -- goto fallback; -- } -- -- ctx->enc_keylen = keylen; -- memcpy(ctx->enc_key, key, keylen); -- return 0; --fallback: -- ret = crypto_sync_skcipher_setkey(ctx->fallback, key, keylen); -- if (!ret) -- ctx->enc_keylen = keylen; -- return ret; --} -- --static int qce_des_setkey(struct crypto_ablkcipher *ablk, const u8 *key, -- unsigned int keylen) --{ -- struct qce_cipher_ctx *ctx = crypto_ablkcipher_ctx(ablk); -- int err; -- -- err = verify_ablkcipher_des_key(ablk, key); -- if (err) -- return err; -- -- ctx->enc_keylen = keylen; -- memcpy(ctx->enc_key, key, keylen); -- return 0; --} -- --static int qce_des3_setkey(struct crypto_ablkcipher *ablk, const u8 *key, -- unsigned int keylen) --{ -- struct qce_cipher_ctx *ctx = crypto_ablkcipher_ctx(ablk); -- int err; -- -- err = verify_ablkcipher_des3_key(ablk, key); -- if (err) -- return err; -- -- ctx->enc_keylen = keylen; -- memcpy(ctx->enc_key, key, keylen); -- return 0; --} -- --static int qce_ablkcipher_crypt(struct ablkcipher_request *req, int encrypt) --{ -- struct crypto_tfm *tfm = -- crypto_ablkcipher_tfm(crypto_ablkcipher_reqtfm(req)); -- struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); -- struct qce_cipher_reqctx *rctx = ablkcipher_request_ctx(req); -- struct qce_alg_template *tmpl = to_cipher_tmpl(tfm); -- int ret; -- -- rctx->flags = tmpl->alg_flags; -- rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; -- -- if (IS_AES(rctx->flags) && ctx->enc_keylen != AES_KEYSIZE_128 && -- ctx->enc_keylen != AES_KEYSIZE_256) { -- SYNC_SKCIPHER_REQUEST_ON_STACK(subreq, ctx->fallback); -- -- skcipher_request_set_sync_tfm(subreq, ctx->fallback); -- skcipher_request_set_callback(subreq, req->base.flags, -- NULL, NULL); -- skcipher_request_set_crypt(subreq, req->src, req->dst, -- req->nbytes, req->info); -- ret = encrypt ? crypto_skcipher_encrypt(subreq) : -- crypto_skcipher_decrypt(subreq); -- skcipher_request_zero(subreq); -- return ret; -- } -- -- return tmpl->qce->async_req_enqueue(tmpl->qce, &req->base); --} -- --static int qce_ablkcipher_encrypt(struct ablkcipher_request *req) --{ -- return qce_ablkcipher_crypt(req, 1); --} -- --static int qce_ablkcipher_decrypt(struct ablkcipher_request *req) --{ -- return qce_ablkcipher_crypt(req, 0); --} -- --static int qce_ablkcipher_init(struct crypto_tfm *tfm) --{ -- struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); -- -- memset(ctx, 0, sizeof(*ctx)); -- tfm->crt_ablkcipher.reqsize = sizeof(struct qce_cipher_reqctx); -- -- ctx->fallback = crypto_alloc_sync_skcipher(crypto_tfm_alg_name(tfm), -- 0, CRYPTO_ALG_NEED_FALLBACK); -- return PTR_ERR_OR_ZERO(ctx->fallback); --} -- --static void qce_ablkcipher_exit(struct crypto_tfm *tfm) --{ -- struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); -- -- crypto_free_sync_skcipher(ctx->fallback); --} -- --struct qce_ablkcipher_def { -- unsigned long flags; -- const char *name; -- const char *drv_name; -- unsigned int blocksize; -- unsigned int ivsize; -- unsigned int min_keysize; -- unsigned int max_keysize; --}; -- --static const struct qce_ablkcipher_def ablkcipher_def[] = { -- { -- .flags = QCE_ALG_AES | QCE_MODE_ECB, -- .name = "ecb(aes)", -- .drv_name = "ecb-aes-qce", -- .blocksize = AES_BLOCK_SIZE, -- .ivsize = AES_BLOCK_SIZE, -- .min_keysize = AES_MIN_KEY_SIZE, -- .max_keysize = AES_MAX_KEY_SIZE, -- }, -- { -- .flags = QCE_ALG_AES | QCE_MODE_CBC, -- .name = "cbc(aes)", -- .drv_name = "cbc-aes-qce", -- .blocksize = AES_BLOCK_SIZE, -- .ivsize = AES_BLOCK_SIZE, -- .min_keysize = AES_MIN_KEY_SIZE, -- .max_keysize = AES_MAX_KEY_SIZE, -- }, -- { -- .flags = QCE_ALG_AES | QCE_MODE_CTR, -- .name = "ctr(aes)", -- .drv_name = "ctr-aes-qce", -- .blocksize = AES_BLOCK_SIZE, -- .ivsize = AES_BLOCK_SIZE, -- .min_keysize = AES_MIN_KEY_SIZE, -- .max_keysize = AES_MAX_KEY_SIZE, -- }, -- { -- .flags = QCE_ALG_AES | QCE_MODE_XTS, -- .name = "xts(aes)", -- .drv_name = "xts-aes-qce", -- .blocksize = AES_BLOCK_SIZE, -- .ivsize = AES_BLOCK_SIZE, -- .min_keysize = AES_MIN_KEY_SIZE, -- .max_keysize = AES_MAX_KEY_SIZE, -- }, -- { -- .flags = QCE_ALG_DES | QCE_MODE_ECB, -- .name = "ecb(des)", -- .drv_name = "ecb-des-qce", -- .blocksize = DES_BLOCK_SIZE, -- .ivsize = 0, -- .min_keysize = DES_KEY_SIZE, -- .max_keysize = DES_KEY_SIZE, -- }, -- { -- .flags = QCE_ALG_DES | QCE_MODE_CBC, -- .name = "cbc(des)", -- .drv_name = "cbc-des-qce", -- .blocksize = DES_BLOCK_SIZE, -- .ivsize = DES_BLOCK_SIZE, -- .min_keysize = DES_KEY_SIZE, -- .max_keysize = DES_KEY_SIZE, -- }, -- { -- .flags = QCE_ALG_3DES | QCE_MODE_ECB, -- .name = "ecb(des3_ede)", -- .drv_name = "ecb-3des-qce", -- .blocksize = DES3_EDE_BLOCK_SIZE, -- .ivsize = 0, -- .min_keysize = DES3_EDE_KEY_SIZE, -- .max_keysize = DES3_EDE_KEY_SIZE, -- }, -- { -- .flags = QCE_ALG_3DES | QCE_MODE_CBC, -- .name = "cbc(des3_ede)", -- .drv_name = "cbc-3des-qce", -- .blocksize = DES3_EDE_BLOCK_SIZE, -- .ivsize = DES3_EDE_BLOCK_SIZE, -- .min_keysize = DES3_EDE_KEY_SIZE, -- .max_keysize = DES3_EDE_KEY_SIZE, -- }, --}; -- --static int qce_ablkcipher_register_one(const struct qce_ablkcipher_def *def, -- struct qce_device *qce) --{ -- struct qce_alg_template *tmpl; -- struct crypto_alg *alg; -- int ret; -- -- tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); -- if (!tmpl) -- return -ENOMEM; -- -- alg = &tmpl->alg.crypto; -- -- snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); -- snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", -- def->drv_name); -- -- alg->cra_blocksize = def->blocksize; -- alg->cra_ablkcipher.ivsize = def->ivsize; -- alg->cra_ablkcipher.min_keysize = def->min_keysize; -- alg->cra_ablkcipher.max_keysize = def->max_keysize; -- alg->cra_ablkcipher.setkey = IS_3DES(def->flags) ? qce_des3_setkey : -- IS_DES(def->flags) ? qce_des_setkey : -- qce_ablkcipher_setkey; -- alg->cra_ablkcipher.encrypt = qce_ablkcipher_encrypt; -- alg->cra_ablkcipher.decrypt = qce_ablkcipher_decrypt; -- -- alg->cra_priority = 300; -- alg->cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC | -- CRYPTO_ALG_NEED_FALLBACK | CRYPTO_ALG_KERN_DRIVER_ONLY; -- alg->cra_ctxsize = sizeof(struct qce_cipher_ctx); -- alg->cra_alignmask = 0; -- alg->cra_type = &crypto_ablkcipher_type; -- alg->cra_module = THIS_MODULE; -- alg->cra_init = qce_ablkcipher_init; -- alg->cra_exit = qce_ablkcipher_exit; -- -- INIT_LIST_HEAD(&tmpl->entry); -- tmpl->crypto_alg_type = CRYPTO_ALG_TYPE_ABLKCIPHER; -- tmpl->alg_flags = def->flags; -- tmpl->qce = qce; -- -- ret = crypto_register_alg(alg); -- if (ret) { -- kfree(tmpl); -- dev_err(qce->dev, "%s registration failed\n", alg->cra_name); -- return ret; -- } -- -- list_add_tail(&tmpl->entry, &ablkcipher_algs); -- dev_dbg(qce->dev, "%s is registered\n", alg->cra_name); -- return 0; --} -- --static void qce_ablkcipher_unregister(struct qce_device *qce) --{ -- struct qce_alg_template *tmpl, *n; -- -- list_for_each_entry_safe(tmpl, n, &ablkcipher_algs, entry) { -- crypto_unregister_alg(&tmpl->alg.crypto); -- list_del(&tmpl->entry); -- kfree(tmpl); -- } --} -- --static int qce_ablkcipher_register(struct qce_device *qce) --{ -- int ret, i; -- -- for (i = 0; i < ARRAY_SIZE(ablkcipher_def); i++) { -- ret = qce_ablkcipher_register_one(&ablkcipher_def[i], qce); -- if (ret) -- goto err; -- } -- -- return 0; --err: -- qce_ablkcipher_unregister(qce); -- return ret; --} -- --const struct qce_algo_ops ablkcipher_ops = { -- .type = CRYPTO_ALG_TYPE_ABLKCIPHER, -- .register_algs = qce_ablkcipher_register, -- .unregister_algs = qce_ablkcipher_unregister, -- .async_req_handle = qce_ablkcipher_async_req_handle, --}; ---- /dev/null -+++ b/drivers/crypto/qce/skcipher.c -@@ -0,0 +1,440 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* -+ * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "cipher.h" -+ -+static LIST_HEAD(skcipher_algs); -+ -+static void qce_skcipher_done(void *data) -+{ -+ struct crypto_async_request *async_req = data; -+ struct skcipher_request *req = skcipher_request_cast(async_req); -+ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); -+ struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); -+ struct qce_device *qce = tmpl->qce; -+ enum dma_data_direction dir_src, dir_dst; -+ u32 status; -+ int error; -+ bool diff_dst; -+ -+ diff_dst = (req->src != req->dst) ? true : false; -+ dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; -+ dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; -+ -+ error = qce_dma_terminate_all(&qce->dma); -+ if (error) -+ dev_dbg(qce->dev, "skcipher dma termination error (%d)\n", -+ error); -+ -+ if (diff_dst) -+ dma_unmap_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src); -+ dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); -+ -+ sg_free_table(&rctx->dst_tbl); -+ -+ error = qce_check_status(qce, &status); -+ if (error < 0) -+ dev_dbg(qce->dev, "skcipher operation error (%x)\n", status); -+ -+ qce->async_req_done(tmpl->qce, error); -+} -+ -+static int -+qce_skcipher_async_req_handle(struct crypto_async_request *async_req) -+{ -+ struct skcipher_request *req = skcipher_request_cast(async_req); -+ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); -+ struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req); -+ struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); -+ struct qce_device *qce = tmpl->qce; -+ enum dma_data_direction dir_src, dir_dst; -+ struct scatterlist *sg; -+ bool diff_dst; -+ gfp_t gfp; -+ int ret; -+ -+ rctx->iv = req->iv; -+ rctx->ivsize = crypto_skcipher_ivsize(skcipher); -+ rctx->cryptlen = req->cryptlen; -+ -+ diff_dst = (req->src != req->dst) ? true : false; -+ dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; -+ dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; -+ -+ rctx->src_nents = sg_nents_for_len(req->src, req->cryptlen); -+ if (diff_dst) -+ rctx->dst_nents = sg_nents_for_len(req->dst, req->cryptlen); -+ else -+ rctx->dst_nents = rctx->src_nents; -+ if (rctx->src_nents < 0) { -+ dev_err(qce->dev, "Invalid numbers of src SG.\n"); -+ return rctx->src_nents; -+ } -+ if (rctx->dst_nents < 0) { -+ dev_err(qce->dev, "Invalid numbers of dst SG.\n"); -+ return -rctx->dst_nents; -+ } -+ -+ rctx->dst_nents += 1; -+ -+ gfp = (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? -+ GFP_KERNEL : GFP_ATOMIC; -+ -+ ret = sg_alloc_table(&rctx->dst_tbl, rctx->dst_nents, gfp); -+ if (ret) -+ return ret; -+ -+ sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); -+ -+ sg = qce_sgtable_add(&rctx->dst_tbl, req->dst); -+ if (IS_ERR(sg)) { -+ ret = PTR_ERR(sg); -+ goto error_free; -+ } -+ -+ sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg); -+ if (IS_ERR(sg)) { -+ ret = PTR_ERR(sg); -+ goto error_free; -+ } -+ -+ sg_mark_end(sg); -+ rctx->dst_sg = rctx->dst_tbl.sgl; -+ -+ ret = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); -+ if (ret < 0) -+ goto error_free; -+ -+ if (diff_dst) { -+ ret = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src); -+ if (ret < 0) -+ goto error_unmap_dst; -+ rctx->src_sg = req->src; -+ } else { -+ rctx->src_sg = rctx->dst_sg; -+ } -+ -+ ret = qce_dma_prep_sgs(&qce->dma, rctx->src_sg, rctx->src_nents, -+ rctx->dst_sg, rctx->dst_nents, -+ qce_skcipher_done, async_req); -+ if (ret) -+ goto error_unmap_src; -+ -+ qce_dma_issue_pending(&qce->dma); -+ -+ ret = qce_start(async_req, tmpl->crypto_alg_type, req->cryptlen, 0); -+ if (ret) -+ goto error_terminate; -+ -+ return 0; -+ -+error_terminate: -+ qce_dma_terminate_all(&qce->dma); -+error_unmap_src: -+ if (diff_dst) -+ dma_unmap_sg(qce->dev, req->src, rctx->src_nents, dir_src); -+error_unmap_dst: -+ dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); -+error_free: -+ sg_free_table(&rctx->dst_tbl); -+ return ret; -+} -+ -+static int qce_skcipher_setkey(struct crypto_skcipher *ablk, const u8 *key, -+ unsigned int keylen) -+{ -+ struct crypto_tfm *tfm = crypto_skcipher_tfm(ablk); -+ struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); -+ int ret; -+ -+ if (!key || !keylen) -+ return -EINVAL; -+ -+ switch (keylen) { -+ case AES_KEYSIZE_128: -+ case AES_KEYSIZE_256: -+ break; -+ default: -+ goto fallback; -+ } -+ -+ ctx->enc_keylen = keylen; -+ memcpy(ctx->enc_key, key, keylen); -+ return 0; -+fallback: -+ ret = crypto_sync_skcipher_setkey(ctx->fallback, key, keylen); -+ if (!ret) -+ ctx->enc_keylen = keylen; -+ return ret; -+} -+ -+static int qce_des_setkey(struct crypto_skcipher *ablk, const u8 *key, -+ unsigned int keylen) -+{ -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(ablk); -+ int err; -+ -+ err = verify_skcipher_des_key(ablk, key); -+ if (err) -+ return err; -+ -+ ctx->enc_keylen = keylen; -+ memcpy(ctx->enc_key, key, keylen); -+ return 0; -+} -+ -+static int qce_des3_setkey(struct crypto_skcipher *ablk, const u8 *key, -+ unsigned int keylen) -+{ -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(ablk); -+ int err; -+ -+ err = verify_skcipher_des3_key(ablk, key); -+ if (err) -+ return err; -+ -+ ctx->enc_keylen = keylen; -+ memcpy(ctx->enc_key, key, keylen); -+ return 0; -+} -+ -+static int qce_skcipher_crypt(struct skcipher_request *req, int encrypt) -+{ -+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); -+ struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); -+ struct qce_alg_template *tmpl = to_cipher_tmpl(tfm); -+ int ret; -+ -+ rctx->flags = tmpl->alg_flags; -+ rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; -+ -+ if (IS_AES(rctx->flags) && ctx->enc_keylen != AES_KEYSIZE_128 && -+ ctx->enc_keylen != AES_KEYSIZE_256) { -+ SYNC_SKCIPHER_REQUEST_ON_STACK(subreq, ctx->fallback); -+ -+ skcipher_request_set_sync_tfm(subreq, ctx->fallback); -+ skcipher_request_set_callback(subreq, req->base.flags, -+ NULL, NULL); -+ skcipher_request_set_crypt(subreq, req->src, req->dst, -+ req->cryptlen, req->iv); -+ ret = encrypt ? crypto_skcipher_encrypt(subreq) : -+ crypto_skcipher_decrypt(subreq); -+ skcipher_request_zero(subreq); -+ return ret; -+ } -+ -+ return tmpl->qce->async_req_enqueue(tmpl->qce, &req->base); -+} -+ -+static int qce_skcipher_encrypt(struct skcipher_request *req) -+{ -+ return qce_skcipher_crypt(req, 1); -+} -+ -+static int qce_skcipher_decrypt(struct skcipher_request *req) -+{ -+ return qce_skcipher_crypt(req, 0); -+} -+ -+static int qce_skcipher_init(struct crypto_skcipher *tfm) -+{ -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); -+ -+ memset(ctx, 0, sizeof(*ctx)); -+ crypto_skcipher_set_reqsize(tfm, sizeof(struct qce_cipher_reqctx)); -+ -+ ctx->fallback = crypto_alloc_sync_skcipher(crypto_tfm_alg_name(&tfm->base), -+ 0, CRYPTO_ALG_NEED_FALLBACK); -+ return PTR_ERR_OR_ZERO(ctx->fallback); -+} -+ -+static void qce_skcipher_exit(struct crypto_skcipher *tfm) -+{ -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); -+ -+ crypto_free_sync_skcipher(ctx->fallback); -+} -+ -+struct qce_skcipher_def { -+ unsigned long flags; -+ const char *name; -+ const char *drv_name; -+ unsigned int blocksize; -+ unsigned int ivsize; -+ unsigned int min_keysize; -+ unsigned int max_keysize; -+}; -+ -+static const struct qce_skcipher_def skcipher_def[] = { -+ { -+ .flags = QCE_ALG_AES | QCE_MODE_ECB, -+ .name = "ecb(aes)", -+ .drv_name = "ecb-aes-qce", -+ .blocksize = AES_BLOCK_SIZE, -+ .ivsize = AES_BLOCK_SIZE, -+ .min_keysize = AES_MIN_KEY_SIZE, -+ .max_keysize = AES_MAX_KEY_SIZE, -+ }, -+ { -+ .flags = QCE_ALG_AES | QCE_MODE_CBC, -+ .name = "cbc(aes)", -+ .drv_name = "cbc-aes-qce", -+ .blocksize = AES_BLOCK_SIZE, -+ .ivsize = AES_BLOCK_SIZE, -+ .min_keysize = AES_MIN_KEY_SIZE, -+ .max_keysize = AES_MAX_KEY_SIZE, -+ }, -+ { -+ .flags = QCE_ALG_AES | QCE_MODE_CTR, -+ .name = "ctr(aes)", -+ .drv_name = "ctr-aes-qce", -+ .blocksize = AES_BLOCK_SIZE, -+ .ivsize = AES_BLOCK_SIZE, -+ .min_keysize = AES_MIN_KEY_SIZE, -+ .max_keysize = AES_MAX_KEY_SIZE, -+ }, -+ { -+ .flags = QCE_ALG_AES | QCE_MODE_XTS, -+ .name = "xts(aes)", -+ .drv_name = "xts-aes-qce", -+ .blocksize = AES_BLOCK_SIZE, -+ .ivsize = AES_BLOCK_SIZE, -+ .min_keysize = AES_MIN_KEY_SIZE, -+ .max_keysize = AES_MAX_KEY_SIZE, -+ }, -+ { -+ .flags = QCE_ALG_DES | QCE_MODE_ECB, -+ .name = "ecb(des)", -+ .drv_name = "ecb-des-qce", -+ .blocksize = DES_BLOCK_SIZE, -+ .ivsize = 0, -+ .min_keysize = DES_KEY_SIZE, -+ .max_keysize = DES_KEY_SIZE, -+ }, -+ { -+ .flags = QCE_ALG_DES | QCE_MODE_CBC, -+ .name = "cbc(des)", -+ .drv_name = "cbc-des-qce", -+ .blocksize = DES_BLOCK_SIZE, -+ .ivsize = DES_BLOCK_SIZE, -+ .min_keysize = DES_KEY_SIZE, -+ .max_keysize = DES_KEY_SIZE, -+ }, -+ { -+ .flags = QCE_ALG_3DES | QCE_MODE_ECB, -+ .name = "ecb(des3_ede)", -+ .drv_name = "ecb-3des-qce", -+ .blocksize = DES3_EDE_BLOCK_SIZE, -+ .ivsize = 0, -+ .min_keysize = DES3_EDE_KEY_SIZE, -+ .max_keysize = DES3_EDE_KEY_SIZE, -+ }, -+ { -+ .flags = QCE_ALG_3DES | QCE_MODE_CBC, -+ .name = "cbc(des3_ede)", -+ .drv_name = "cbc-3des-qce", -+ .blocksize = DES3_EDE_BLOCK_SIZE, -+ .ivsize = DES3_EDE_BLOCK_SIZE, -+ .min_keysize = DES3_EDE_KEY_SIZE, -+ .max_keysize = DES3_EDE_KEY_SIZE, -+ }, -+}; -+ -+static int qce_skcipher_register_one(const struct qce_skcipher_def *def, -+ struct qce_device *qce) -+{ -+ struct qce_alg_template *tmpl; -+ struct skcipher_alg *alg; -+ int ret; -+ -+ tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL); -+ if (!tmpl) -+ return -ENOMEM; -+ -+ alg = &tmpl->alg.skcipher; -+ -+ snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); -+ snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", -+ def->drv_name); -+ -+ alg->base.cra_blocksize = def->blocksize; -+ alg->ivsize = def->ivsize; -+ alg->min_keysize = def->min_keysize; -+ alg->max_keysize = def->max_keysize; -+ alg->setkey = IS_3DES(def->flags) ? qce_des3_setkey : -+ IS_DES(def->flags) ? qce_des_setkey : -+ qce_skcipher_setkey; -+ alg->encrypt = qce_skcipher_encrypt; -+ alg->decrypt = qce_skcipher_decrypt; -+ -+ alg->base.cra_priority = 300; -+ alg->base.cra_flags = CRYPTO_ALG_ASYNC | -+ CRYPTO_ALG_NEED_FALLBACK | -+ CRYPTO_ALG_KERN_DRIVER_ONLY; -+ alg->base.cra_ctxsize = sizeof(struct qce_cipher_ctx); -+ alg->base.cra_alignmask = 0; -+ alg->base.cra_module = THIS_MODULE; -+ -+ alg->init = qce_skcipher_init; -+ alg->exit = qce_skcipher_exit; -+ -+ INIT_LIST_HEAD(&tmpl->entry); -+ tmpl->crypto_alg_type = CRYPTO_ALG_TYPE_SKCIPHER; -+ tmpl->alg_flags = def->flags; -+ tmpl->qce = qce; -+ -+ ret = crypto_register_skcipher(alg); -+ if (ret) { -+ kfree(tmpl); -+ dev_err(qce->dev, "%s registration failed\n", alg->base.cra_name); -+ return ret; -+ } -+ -+ list_add_tail(&tmpl->entry, &skcipher_algs); -+ dev_dbg(qce->dev, "%s is registered\n", alg->base.cra_name); -+ return 0; -+} -+ -+static void qce_skcipher_unregister(struct qce_device *qce) -+{ -+ struct qce_alg_template *tmpl, *n; -+ -+ list_for_each_entry_safe(tmpl, n, &skcipher_algs, entry) { -+ crypto_unregister_skcipher(&tmpl->alg.skcipher); -+ list_del(&tmpl->entry); -+ kfree(tmpl); -+ } -+} -+ -+static int qce_skcipher_register(struct qce_device *qce) -+{ -+ int ret, i; -+ -+ for (i = 0; i < ARRAY_SIZE(skcipher_def); i++) { -+ ret = qce_skcipher_register_one(&skcipher_def[i], qce); -+ if (ret) -+ goto err; -+ } -+ -+ return 0; -+err: -+ qce_skcipher_unregister(qce); -+ return ret; -+} -+ -+const struct qce_algo_ops skcipher_ops = { -+ .type = CRYPTO_ALG_TYPE_SKCIPHER, -+ .register_algs = qce_skcipher_register, -+ .unregister_algs = qce_skcipher_unregister, -+ .async_req_handle = qce_skcipher_async_req_handle, -+}; diff --git a/target/linux/ipq40xx/patches-5.4/0008-v5.6-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch b/target/linux/ipq40xx/patches-5.4/0008-v5.6-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch deleted file mode 100644 index ac4f163f4..000000000 --- a/target/linux/ipq40xx/patches-5.4/0008-v5.6-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch +++ /dev/null @@ -1,43 +0,0 @@ -From bb5c863b3d3cbd10e80b2ebf409934a091058f54 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 20 Dec 2019 16:02:13 -0300 -Subject: [PATCH 02/11] crypto: qce - fix ctr-aes-qce block, chunk sizes - -Set blocksize of ctr-aes-qce to 1, so it can operate as a stream cipher, -adding the definition for chucksize instead, where the underlying block -size belongs. - -Signed-off-by: Eneas U de Queiroz -Signed-off-by: Herbert Xu ---- - drivers/crypto/qce/skcipher.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/crypto/qce/skcipher.c -+++ b/drivers/crypto/qce/skcipher.c -@@ -270,6 +270,7 @@ struct qce_skcipher_def { - const char *name; - const char *drv_name; - unsigned int blocksize; -+ unsigned int chunksize; - unsigned int ivsize; - unsigned int min_keysize; - unsigned int max_keysize; -@@ -298,7 +299,8 @@ static const struct qce_skcipher_def skc - .flags = QCE_ALG_AES | QCE_MODE_CTR, - .name = "ctr(aes)", - .drv_name = "ctr-aes-qce", -- .blocksize = AES_BLOCK_SIZE, -+ .blocksize = 1, -+ .chunksize = AES_BLOCK_SIZE, - .ivsize = AES_BLOCK_SIZE, - .min_keysize = AES_MIN_KEY_SIZE, - .max_keysize = AES_MAX_KEY_SIZE, -@@ -368,6 +370,7 @@ static int qce_skcipher_register_one(con - def->drv_name); - - alg->base.cra_blocksize = def->blocksize; -+ alg->chunksize = def->chunksize; - alg->ivsize = def->ivsize; - alg->min_keysize = def->min_keysize; - alg->max_keysize = def->max_keysize; diff --git a/target/linux/ipq40xx/patches-5.4/0009-v5.6-crypto-qce-fix-xts-aes-qce-key-sizes.patch b/target/linux/ipq40xx/patches-5.4/0009-v5.6-crypto-qce-fix-xts-aes-qce-key-sizes.patch deleted file mode 100644 index 4dcf1ac72..000000000 --- a/target/linux/ipq40xx/patches-5.4/0009-v5.6-crypto-qce-fix-xts-aes-qce-key-sizes.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 7de4c2bd196f111e39cc60f6197654aff23ba2b4 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 20 Dec 2019 16:02:14 -0300 -Subject: [PATCH 03/11] crypto: qce - fix xts-aes-qce key sizes - -XTS-mode uses two keys, so the keysizes should be doubled in -skcipher_def, and halved when checking if it is AES-128/192/256. - -Signed-off-by: Eneas U de Queiroz -Signed-off-by: Herbert Xu ---- - drivers/crypto/qce/skcipher.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - ---- a/drivers/crypto/qce/skcipher.c -+++ b/drivers/crypto/qce/skcipher.c -@@ -154,12 +154,13 @@ static int qce_skcipher_setkey(struct cr - { - struct crypto_tfm *tfm = crypto_skcipher_tfm(ablk); - struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); -+ unsigned long flags = to_cipher_tmpl(ablk)->alg_flags; - int ret; - - if (!key || !keylen) - return -EINVAL; - -- switch (keylen) { -+ switch (IS_XTS(flags) ? keylen >> 1 : keylen) { - case AES_KEYSIZE_128: - case AES_KEYSIZE_256: - break; -@@ -213,13 +214,15 @@ static int qce_skcipher_crypt(struct skc - struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); - struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); - struct qce_alg_template *tmpl = to_cipher_tmpl(tfm); -+ int keylen; - int ret; - - rctx->flags = tmpl->alg_flags; - rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; -+ keylen = IS_XTS(rctx->flags) ? ctx->enc_keylen >> 1 : ctx->enc_keylen; - -- if (IS_AES(rctx->flags) && ctx->enc_keylen != AES_KEYSIZE_128 && -- ctx->enc_keylen != AES_KEYSIZE_256) { -+ if (IS_AES(rctx->flags) && keylen != AES_KEYSIZE_128 && -+ keylen != AES_KEYSIZE_256) { - SYNC_SKCIPHER_REQUEST_ON_STACK(subreq, ctx->fallback); - - skcipher_request_set_sync_tfm(subreq, ctx->fallback); -@@ -311,8 +314,8 @@ static const struct qce_skcipher_def skc - .drv_name = "xts-aes-qce", - .blocksize = AES_BLOCK_SIZE, - .ivsize = AES_BLOCK_SIZE, -- .min_keysize = AES_MIN_KEY_SIZE, -- .max_keysize = AES_MAX_KEY_SIZE, -+ .min_keysize = AES_MIN_KEY_SIZE * 2, -+ .max_keysize = AES_MAX_KEY_SIZE * 2, - }, - { - .flags = QCE_ALG_DES | QCE_MODE_ECB, diff --git a/target/linux/ipq40xx/patches-5.4/0010-v5.6-crypto-qce-save-a-sg-table-slot-for-result-buf.patch b/target/linux/ipq40xx/patches-5.4/0010-v5.6-crypto-qce-save-a-sg-table-slot-for-result-buf.patch deleted file mode 100644 index 2385d483f..000000000 --- a/target/linux/ipq40xx/patches-5.4/0010-v5.6-crypto-qce-save-a-sg-table-slot-for-result-buf.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 3ee50c896d712dc2fc8f34c2cd1918d035e74045 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 20 Dec 2019 16:02:15 -0300 -Subject: [PATCH 04/11] crypto: qce - save a sg table slot for result buf - -When ctr-aes-qce is used for gcm-mode, an extra sg entry for the -authentication tag is present, causing trouble when the qce driver -prepares the dst-results sg table for dma. - -It computes the number of entries needed with sg_nents_for_len, leaving -out the tag entry. Then it creates a sg table with that number plus -one, used to store a result buffer. - -When copying the sg table, there's no limit to the number of entries -copied, so the extra slot is filled with the authentication tag sg. -When the driver tries to add the result sg, the list is full, and it -returns EINVAL. - -By limiting the number of sg entries copied to the dest table, the slot -for the result buffer is guaranteed to be unused. - -Signed-off-by: Eneas U de Queiroz -Signed-off-by: Herbert Xu ---- - drivers/crypto/qce/dma.c | 6 ++++-- - drivers/crypto/qce/dma.h | 3 ++- - drivers/crypto/qce/skcipher.c | 4 ++-- - 3 files changed, 8 insertions(+), 5 deletions(-) - ---- a/drivers/crypto/qce/dma.c -+++ b/drivers/crypto/qce/dma.c -@@ -47,7 +47,8 @@ void qce_dma_release(struct qce_dma_data - } - - struct scatterlist * --qce_sgtable_add(struct sg_table *sgt, struct scatterlist *new_sgl) -+qce_sgtable_add(struct sg_table *sgt, struct scatterlist *new_sgl, -+ int max_ents) - { - struct scatterlist *sg = sgt->sgl, *sg_last = NULL; - -@@ -60,12 +61,13 @@ qce_sgtable_add(struct sg_table *sgt, st - if (!sg) - return ERR_PTR(-EINVAL); - -- while (new_sgl && sg) { -+ while (new_sgl && sg && max_ents) { - sg_set_page(sg, sg_page(new_sgl), new_sgl->length, - new_sgl->offset); - sg_last = sg; - sg = sg_next(sg); - new_sgl = sg_next(new_sgl); -+ max_ents--; - } - - return sg_last; ---- a/drivers/crypto/qce/dma.h -+++ b/drivers/crypto/qce/dma.h -@@ -42,6 +42,7 @@ int qce_dma_prep_sgs(struct qce_dma_data - void qce_dma_issue_pending(struct qce_dma_data *dma); - int qce_dma_terminate_all(struct qce_dma_data *dma); - struct scatterlist * --qce_sgtable_add(struct sg_table *sgt, struct scatterlist *sg_add); -+qce_sgtable_add(struct sg_table *sgt, struct scatterlist *sg_add, -+ int max_ents); - - #endif /* _DMA_H_ */ ---- a/drivers/crypto/qce/skcipher.c -+++ b/drivers/crypto/qce/skcipher.c -@@ -95,13 +95,13 @@ qce_skcipher_async_req_handle(struct cry - - sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); - -- sg = qce_sgtable_add(&rctx->dst_tbl, req->dst); -+ sg = qce_sgtable_add(&rctx->dst_tbl, req->dst, rctx->dst_nents - 1); - if (IS_ERR(sg)) { - ret = PTR_ERR(sg); - goto error_free; - } - -- sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg); -+ sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg, 1); - if (IS_ERR(sg)) { - ret = PTR_ERR(sg); - goto error_free; diff --git a/target/linux/ipq40xx/patches-5.4/0011-v5.6-crypto-qce-update-the-skcipher-IV.patch b/target/linux/ipq40xx/patches-5.4/0011-v5.6-crypto-qce-update-the-skcipher-IV.patch deleted file mode 100644 index 5efdb72c4..000000000 --- a/target/linux/ipq40xx/patches-5.4/0011-v5.6-crypto-qce-update-the-skcipher-IV.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 3e806a12d10af2581aa26c37b58439286eab9782 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 20 Dec 2019 16:02:16 -0300 -Subject: [PATCH 05/11] crypto: qce - update the skcipher IV - -Update the IV after the completion of each cipher operation. - -Signed-off-by: Eneas U de Queiroz -Signed-off-by: Herbert Xu ---- - drivers/crypto/qce/skcipher.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/drivers/crypto/qce/skcipher.c -+++ b/drivers/crypto/qce/skcipher.c -@@ -21,6 +21,7 @@ static void qce_skcipher_done(void *data - struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); - struct qce_alg_template *tmpl = to_cipher_tmpl(crypto_skcipher_reqtfm(req)); - struct qce_device *qce = tmpl->qce; -+ struct qce_result_dump *result_buf = qce->dma.result_buf; - enum dma_data_direction dir_src, dir_dst; - u32 status; - int error; -@@ -45,6 +46,7 @@ static void qce_skcipher_done(void *data - if (error < 0) - dev_dbg(qce->dev, "skcipher operation error (%x)\n", status); - -+ memcpy(rctx->iv, result_buf->encr_cntr_iv, rctx->ivsize); - qce->async_req_done(tmpl->qce, error); - } - diff --git a/target/linux/ipq40xx/patches-5.4/0012-v5.6-crypto-qce-initialize-fallback-only-for-AES.patch b/target/linux/ipq40xx/patches-5.4/0012-v5.6-crypto-qce-initialize-fallback-only-for-AES.patch deleted file mode 100644 index 84aef04ef..000000000 --- a/target/linux/ipq40xx/patches-5.4/0012-v5.6-crypto-qce-initialize-fallback-only-for-AES.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 8ceda883205db6dfedb82e39f67feae3b50c95a1 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 20 Dec 2019 16:02:17 -0300 -Subject: [PATCH 06/11] crypto: qce - initialize fallback only for AES - -Adjust cra_flags to add CRYPTO_NEED_FALLBACK only for AES ciphers, where -AES-192 is not handled by the qce hardware, and don't allocate & free -the fallback skcipher for other algorithms. - -Signed-off-by: Eneas U de Queiroz -Signed-off-by: Herbert Xu ---- - drivers/crypto/qce/skcipher.c | 17 ++++++++++++++--- - 1 file changed, 14 insertions(+), 3 deletions(-) - ---- a/drivers/crypto/qce/skcipher.c -+++ b/drivers/crypto/qce/skcipher.c -@@ -257,7 +257,14 @@ static int qce_skcipher_init(struct cryp - - memset(ctx, 0, sizeof(*ctx)); - crypto_skcipher_set_reqsize(tfm, sizeof(struct qce_cipher_reqctx)); -+ return 0; -+} -+ -+static int qce_skcipher_init_fallback(struct crypto_skcipher *tfm) -+{ -+ struct qce_cipher_ctx *ctx = crypto_skcipher_ctx(tfm); - -+ qce_skcipher_init(tfm); - ctx->fallback = crypto_alloc_sync_skcipher(crypto_tfm_alg_name(&tfm->base), - 0, CRYPTO_ALG_NEED_FALLBACK); - return PTR_ERR_OR_ZERO(ctx->fallback); -@@ -387,14 +394,18 @@ static int qce_skcipher_register_one(con - - alg->base.cra_priority = 300; - alg->base.cra_flags = CRYPTO_ALG_ASYNC | -- CRYPTO_ALG_NEED_FALLBACK | - CRYPTO_ALG_KERN_DRIVER_ONLY; - alg->base.cra_ctxsize = sizeof(struct qce_cipher_ctx); - alg->base.cra_alignmask = 0; - alg->base.cra_module = THIS_MODULE; - -- alg->init = qce_skcipher_init; -- alg->exit = qce_skcipher_exit; -+ if (IS_AES(def->flags)) { -+ alg->base.cra_flags |= CRYPTO_ALG_NEED_FALLBACK; -+ alg->init = qce_skcipher_init_fallback; -+ alg->exit = qce_skcipher_exit; -+ } else { -+ alg->init = qce_skcipher_init; -+ } - - INIT_LIST_HEAD(&tmpl->entry); - tmpl->crypto_alg_type = CRYPTO_ALG_TYPE_SKCIPHER; diff --git a/target/linux/ipq40xx/patches-5.4/0013-v5.6-crypto-qce-allow-building-only-hashes-ciphers.patch b/target/linux/ipq40xx/patches-5.4/0013-v5.6-crypto-qce-allow-building-only-hashes-ciphers.patch deleted file mode 100644 index 5b1372d08..000000000 --- a/target/linux/ipq40xx/patches-5.4/0013-v5.6-crypto-qce-allow-building-only-hashes-ciphers.patch +++ /dev/null @@ -1,419 +0,0 @@ -From 59e056cda4beb5412e3653e6360c2eb0fa770baa Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 20 Dec 2019 16:02:18 -0300 -Subject: [PATCH 07/11] crypto: qce - allow building only hashes/ciphers - -Allow the user to choose whether to build support for all algorithms -(default), hashes-only, or skciphers-only. - -The QCE engine does not appear to scale as well as the CPU to handle -multiple crypto requests. While the ipq40xx chips have 4-core CPUs, the -QCE handles only 2 requests in parallel. - -Ipsec throughput seems to improve when disabling either family of -algorithms, sharing the load with the CPU. Enabling skciphers-only -appears to work best. - -Signed-off-by: Eneas U de Queiroz -Signed-off-by: Herbert Xu ---- - ---- a/drivers/crypto/Kconfig -+++ b/drivers/crypto/Kconfig -@@ -617,6 +617,14 @@ config CRYPTO_DEV_QCE - tristate "Qualcomm crypto engine accelerator" - depends on ARCH_QCOM || COMPILE_TEST - depends on HAS_IOMEM -+ help -+ This driver supports Qualcomm crypto engine accelerator -+ hardware. To compile this driver as a module, choose M here. The -+ module will be called qcrypto. -+ -+config CRYPTO_DEV_QCE_SKCIPHER -+ bool -+ depends on CRYPTO_DEV_QCE - select CRYPTO_AES - select CRYPTO_LIB_DES - select CRYPTO_ECB -@@ -624,10 +632,57 @@ config CRYPTO_DEV_QCE - select CRYPTO_XTS - select CRYPTO_CTR - select CRYPTO_BLKCIPHER -+ -+config CRYPTO_DEV_QCE_SHA -+ bool -+ depends on CRYPTO_DEV_QCE -+ -+choice -+ prompt "Algorithms enabled for QCE acceleration" -+ default CRYPTO_DEV_QCE_ENABLE_ALL -+ depends on CRYPTO_DEV_QCE - help -- This driver supports Qualcomm crypto engine accelerator -- hardware. To compile this driver as a module, choose M here. The -- module will be called qcrypto. -+ This option allows to choose whether to build support for all algorihtms -+ (default), hashes-only, or skciphers-only. -+ -+ The QCE engine does not appear to scale as well as the CPU to handle -+ multiple crypto requests. While the ipq40xx chips have 4-core CPUs, the -+ QCE handles only 2 requests in parallel. -+ -+ Ipsec throughput seems to improve when disabling either family of -+ algorithms, sharing the load with the CPU. Enabling skciphers-only -+ appears to work best. -+ -+ config CRYPTO_DEV_QCE_ENABLE_ALL -+ bool "All supported algorithms" -+ select CRYPTO_DEV_QCE_SKCIPHER -+ select CRYPTO_DEV_QCE_SHA -+ help -+ Enable all supported algorithms: -+ - AES (CBC, CTR, ECB, XTS) -+ - 3DES (CBC, ECB) -+ - DES (CBC, ECB) -+ - SHA1, HMAC-SHA1 -+ - SHA256, HMAC-SHA256 -+ -+ config CRYPTO_DEV_QCE_ENABLE_SKCIPHER -+ bool "Symmetric-key ciphers only" -+ select CRYPTO_DEV_QCE_SKCIPHER -+ help -+ Enable symmetric-key ciphers only: -+ - AES (CBC, CTR, ECB, XTS) -+ - 3DES (ECB, CBC) -+ - DES (ECB, CBC) -+ -+ config CRYPTO_DEV_QCE_ENABLE_SHA -+ bool "Hash/HMAC only" -+ select CRYPTO_DEV_QCE_SHA -+ help -+ Enable hashes/HMAC algorithms only: -+ - SHA1, HMAC-SHA1 -+ - SHA256, HMAC-SHA256 -+ -+endchoice - - config CRYPTO_DEV_QCOM_RNG - tristate "Qualcomm Random Number Generator Driver" ---- a/drivers/crypto/qce/Makefile -+++ b/drivers/crypto/qce/Makefile -@@ -2,6 +2,7 @@ - obj-$(CONFIG_CRYPTO_DEV_QCE) += qcrypto.o - qcrypto-objs := core.o \ - common.o \ -- dma.o \ -- sha.o \ -- skcipher.o -+ dma.o -+ -+qcrypto-$(CONFIG_CRYPTO_DEV_QCE_SHA) += sha.o -+qcrypto-$(CONFIG_CRYPTO_DEV_QCE_SKCIPHER) += skcipher.o ---- a/drivers/crypto/qce/common.c -+++ b/drivers/crypto/qce/common.c -@@ -45,52 +45,56 @@ qce_clear_array(struct qce_device *qce, - qce_write(qce, offset + i * sizeof(u32), 0); - } - --static u32 qce_encr_cfg(unsigned long flags, u32 aes_key_size) -+static u32 qce_config_reg(struct qce_device *qce, int little) - { -- u32 cfg = 0; -+ u32 beats = (qce->burst_size >> 3) - 1; -+ u32 pipe_pair = qce->pipe_pair_id; -+ u32 config; - -- if (IS_AES(flags)) { -- if (aes_key_size == AES_KEYSIZE_128) -- cfg |= ENCR_KEY_SZ_AES128 << ENCR_KEY_SZ_SHIFT; -- else if (aes_key_size == AES_KEYSIZE_256) -- cfg |= ENCR_KEY_SZ_AES256 << ENCR_KEY_SZ_SHIFT; -- } -+ config = (beats << REQ_SIZE_SHIFT) & REQ_SIZE_MASK; -+ config |= BIT(MASK_DOUT_INTR_SHIFT) | BIT(MASK_DIN_INTR_SHIFT) | -+ BIT(MASK_OP_DONE_INTR_SHIFT) | BIT(MASK_ERR_INTR_SHIFT); -+ config |= (pipe_pair << PIPE_SET_SELECT_SHIFT) & PIPE_SET_SELECT_MASK; -+ config &= ~HIGH_SPD_EN_N_SHIFT; - -- if (IS_AES(flags)) -- cfg |= ENCR_ALG_AES << ENCR_ALG_SHIFT; -- else if (IS_DES(flags) || IS_3DES(flags)) -- cfg |= ENCR_ALG_DES << ENCR_ALG_SHIFT; -+ if (little) -+ config |= BIT(LITTLE_ENDIAN_MODE_SHIFT); - -- if (IS_DES(flags)) -- cfg |= ENCR_KEY_SZ_DES << ENCR_KEY_SZ_SHIFT; -+ return config; -+} - -- if (IS_3DES(flags)) -- cfg |= ENCR_KEY_SZ_3DES << ENCR_KEY_SZ_SHIFT; -+void qce_cpu_to_be32p_array(__be32 *dst, const u8 *src, unsigned int len) -+{ -+ __be32 *d = dst; -+ const u8 *s = src; -+ unsigned int n; - -- switch (flags & QCE_MODE_MASK) { -- case QCE_MODE_ECB: -- cfg |= ENCR_MODE_ECB << ENCR_MODE_SHIFT; -- break; -- case QCE_MODE_CBC: -- cfg |= ENCR_MODE_CBC << ENCR_MODE_SHIFT; -- break; -- case QCE_MODE_CTR: -- cfg |= ENCR_MODE_CTR << ENCR_MODE_SHIFT; -- break; -- case QCE_MODE_XTS: -- cfg |= ENCR_MODE_XTS << ENCR_MODE_SHIFT; -- break; -- case QCE_MODE_CCM: -- cfg |= ENCR_MODE_CCM << ENCR_MODE_SHIFT; -- cfg |= LAST_CCM_XFR << LAST_CCM_SHIFT; -- break; -- default: -- return ~0; -+ n = len / sizeof(u32); -+ for (; n > 0; n--) { -+ *d = cpu_to_be32p((const __u32 *) s); -+ s += sizeof(__u32); -+ d++; - } -+} - -- return cfg; -+static void qce_setup_config(struct qce_device *qce) -+{ -+ u32 config; -+ -+ /* get big endianness */ -+ config = qce_config_reg(qce, 0); -+ -+ /* clear status */ -+ qce_write(qce, REG_STATUS, 0); -+ qce_write(qce, REG_CONFIG, config); -+} -+ -+static inline void qce_crypto_go(struct qce_device *qce) -+{ -+ qce_write(qce, REG_GOPROC, BIT(GO_SHIFT) | BIT(RESULTS_DUMP_SHIFT)); - } - -+#ifdef CONFIG_CRYPTO_DEV_QCE_SHA - static u32 qce_auth_cfg(unsigned long flags, u32 key_size) - { - u32 cfg = 0; -@@ -137,88 +141,6 @@ static u32 qce_auth_cfg(unsigned long fl - return cfg; - } - --static u32 qce_config_reg(struct qce_device *qce, int little) --{ -- u32 beats = (qce->burst_size >> 3) - 1; -- u32 pipe_pair = qce->pipe_pair_id; -- u32 config; -- -- config = (beats << REQ_SIZE_SHIFT) & REQ_SIZE_MASK; -- config |= BIT(MASK_DOUT_INTR_SHIFT) | BIT(MASK_DIN_INTR_SHIFT) | -- BIT(MASK_OP_DONE_INTR_SHIFT) | BIT(MASK_ERR_INTR_SHIFT); -- config |= (pipe_pair << PIPE_SET_SELECT_SHIFT) & PIPE_SET_SELECT_MASK; -- config &= ~HIGH_SPD_EN_N_SHIFT; -- -- if (little) -- config |= BIT(LITTLE_ENDIAN_MODE_SHIFT); -- -- return config; --} -- --void qce_cpu_to_be32p_array(__be32 *dst, const u8 *src, unsigned int len) --{ -- __be32 *d = dst; -- const u8 *s = src; -- unsigned int n; -- -- n = len / sizeof(u32); -- for (; n > 0; n--) { -- *d = cpu_to_be32p((const __u32 *) s); -- s += sizeof(__u32); -- d++; -- } --} -- --static void qce_xts_swapiv(__be32 *dst, const u8 *src, unsigned int ivsize) --{ -- u8 swap[QCE_AES_IV_LENGTH]; -- u32 i, j; -- -- if (ivsize > QCE_AES_IV_LENGTH) -- return; -- -- memset(swap, 0, QCE_AES_IV_LENGTH); -- -- for (i = (QCE_AES_IV_LENGTH - ivsize), j = ivsize - 1; -- i < QCE_AES_IV_LENGTH; i++, j--) -- swap[i] = src[j]; -- -- qce_cpu_to_be32p_array(dst, swap, QCE_AES_IV_LENGTH); --} -- --static void qce_xtskey(struct qce_device *qce, const u8 *enckey, -- unsigned int enckeylen, unsigned int cryptlen) --{ -- u32 xtskey[QCE_MAX_CIPHER_KEY_SIZE / sizeof(u32)] = {0}; -- unsigned int xtsklen = enckeylen / (2 * sizeof(u32)); -- unsigned int xtsdusize; -- -- qce_cpu_to_be32p_array((__be32 *)xtskey, enckey + enckeylen / 2, -- enckeylen / 2); -- qce_write_array(qce, REG_ENCR_XTS_KEY0, xtskey, xtsklen); -- -- /* xts du size 512B */ -- xtsdusize = min_t(u32, QCE_SECTOR_SIZE, cryptlen); -- qce_write(qce, REG_ENCR_XTS_DU_SIZE, xtsdusize); --} -- --static void qce_setup_config(struct qce_device *qce) --{ -- u32 config; -- -- /* get big endianness */ -- config = qce_config_reg(qce, 0); -- -- /* clear status */ -- qce_write(qce, REG_STATUS, 0); -- qce_write(qce, REG_CONFIG, config); --} -- --static inline void qce_crypto_go(struct qce_device *qce) --{ -- qce_write(qce, REG_GOPROC, BIT(GO_SHIFT) | BIT(RESULTS_DUMP_SHIFT)); --} -- - static int qce_setup_regs_ahash(struct crypto_async_request *async_req, - u32 totallen, u32 offset) - { -@@ -303,6 +225,87 @@ go_proc: - - return 0; - } -+#endif -+ -+#ifdef CONFIG_CRYPTO_DEV_QCE_SKCIPHER -+static u32 qce_encr_cfg(unsigned long flags, u32 aes_key_size) -+{ -+ u32 cfg = 0; -+ -+ if (IS_AES(flags)) { -+ if (aes_key_size == AES_KEYSIZE_128) -+ cfg |= ENCR_KEY_SZ_AES128 << ENCR_KEY_SZ_SHIFT; -+ else if (aes_key_size == AES_KEYSIZE_256) -+ cfg |= ENCR_KEY_SZ_AES256 << ENCR_KEY_SZ_SHIFT; -+ } -+ -+ if (IS_AES(flags)) -+ cfg |= ENCR_ALG_AES << ENCR_ALG_SHIFT; -+ else if (IS_DES(flags) || IS_3DES(flags)) -+ cfg |= ENCR_ALG_DES << ENCR_ALG_SHIFT; -+ -+ if (IS_DES(flags)) -+ cfg |= ENCR_KEY_SZ_DES << ENCR_KEY_SZ_SHIFT; -+ -+ if (IS_3DES(flags)) -+ cfg |= ENCR_KEY_SZ_3DES << ENCR_KEY_SZ_SHIFT; -+ -+ switch (flags & QCE_MODE_MASK) { -+ case QCE_MODE_ECB: -+ cfg |= ENCR_MODE_ECB << ENCR_MODE_SHIFT; -+ break; -+ case QCE_MODE_CBC: -+ cfg |= ENCR_MODE_CBC << ENCR_MODE_SHIFT; -+ break; -+ case QCE_MODE_CTR: -+ cfg |= ENCR_MODE_CTR << ENCR_MODE_SHIFT; -+ break; -+ case QCE_MODE_XTS: -+ cfg |= ENCR_MODE_XTS << ENCR_MODE_SHIFT; -+ break; -+ case QCE_MODE_CCM: -+ cfg |= ENCR_MODE_CCM << ENCR_MODE_SHIFT; -+ cfg |= LAST_CCM_XFR << LAST_CCM_SHIFT; -+ break; -+ default: -+ return ~0; -+ } -+ -+ return cfg; -+} -+ -+static void qce_xts_swapiv(__be32 *dst, const u8 *src, unsigned int ivsize) -+{ -+ u8 swap[QCE_AES_IV_LENGTH]; -+ u32 i, j; -+ -+ if (ivsize > QCE_AES_IV_LENGTH) -+ return; -+ -+ memset(swap, 0, QCE_AES_IV_LENGTH); -+ -+ for (i = (QCE_AES_IV_LENGTH - ivsize), j = ivsize - 1; -+ i < QCE_AES_IV_LENGTH; i++, j--) -+ swap[i] = src[j]; -+ -+ qce_cpu_to_be32p_array(dst, swap, QCE_AES_IV_LENGTH); -+} -+ -+static void qce_xtskey(struct qce_device *qce, const u8 *enckey, -+ unsigned int enckeylen, unsigned int cryptlen) -+{ -+ u32 xtskey[QCE_MAX_CIPHER_KEY_SIZE / sizeof(u32)] = {0}; -+ unsigned int xtsklen = enckeylen / (2 * sizeof(u32)); -+ unsigned int xtsdusize; -+ -+ qce_cpu_to_be32p_array((__be32 *)xtskey, enckey + enckeylen / 2, -+ enckeylen / 2); -+ qce_write_array(qce, REG_ENCR_XTS_KEY0, xtskey, xtsklen); -+ -+ /* xts du size 512B */ -+ xtsdusize = min_t(u32, QCE_SECTOR_SIZE, cryptlen); -+ qce_write(qce, REG_ENCR_XTS_DU_SIZE, xtsdusize); -+} - - static int qce_setup_regs_skcipher(struct crypto_async_request *async_req, - u32 totallen, u32 offset) -@@ -384,15 +387,20 @@ static int qce_setup_regs_skcipher(struc - - return 0; - } -+#endif - - int qce_start(struct crypto_async_request *async_req, u32 type, u32 totallen, - u32 offset) - { - switch (type) { -+#ifdef CONFIG_CRYPTO_DEV_QCE_SKCIPHER - case CRYPTO_ALG_TYPE_SKCIPHER: - return qce_setup_regs_skcipher(async_req, totallen, offset); -+#endif -+#ifdef CONFIG_CRYPTO_DEV_QCE_SHA - case CRYPTO_ALG_TYPE_AHASH: - return qce_setup_regs_ahash(async_req, totallen, offset); -+#endif - default: - return -EINVAL; - } ---- a/drivers/crypto/qce/core.c -+++ b/drivers/crypto/qce/core.c -@@ -22,8 +22,12 @@ - #define QCE_QUEUE_LENGTH 1 - - static const struct qce_algo_ops *qce_ops[] = { -+#ifdef CONFIG_CRYPTO_DEV_QCE_SKCIPHER - &skcipher_ops, -+#endif -+#ifdef CONFIG_CRYPTO_DEV_QCE_SHA - &ahash_ops, -+#endif - }; - - static void qce_unregister_algs(struct qce_device *qce) diff --git a/target/linux/ipq40xx/patches-5.4/0014-v5.7-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch b/target/linux/ipq40xx/patches-5.4/0014-v5.7-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch deleted file mode 100644 index 160420b48..000000000 --- a/target/linux/ipq40xx/patches-5.4/0014-v5.7-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch +++ /dev/null @@ -1,89 +0,0 @@ -From d6364b8128439a8c0e381f80c38667de9f15eef8 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 7 Feb 2020 12:02:25 -0300 -Subject: [PATCH 09/11] crypto: qce - use cryptlen when adding extra sgl - -The qce crypto driver appends an extra entry to the dst sgl, to maintain -private state information. - -When the gcm driver sends requests to the ctr skcipher, it passes the -authentication tag after the actual crypto payload, but it must not be -touched. - -Commit 1336c2221bee ("crypto: qce - save a sg table slot for result -buf") limited the destination sgl to avoid overwriting the -authentication tag but it assumed the tag would be in a separate sgl -entry. - -This is not always the case, so it is better to limit the length of the -destination buffer to req->cryptlen before appending the result buf. - -Signed-off-by: Eneas U de Queiroz -Signed-off-by: Herbert Xu ---- - drivers/crypto/qce/dma.c | 11 ++++++----- - drivers/crypto/qce/dma.h | 2 +- - drivers/crypto/qce/skcipher.c | 5 +++-- - 3 files changed, 10 insertions(+), 8 deletions(-) - ---- a/drivers/crypto/qce/dma.c -+++ b/drivers/crypto/qce/dma.c -@@ -48,9 +48,10 @@ void qce_dma_release(struct qce_dma_data - - struct scatterlist * - qce_sgtable_add(struct sg_table *sgt, struct scatterlist *new_sgl, -- int max_ents) -+ unsigned int max_len) - { - struct scatterlist *sg = sgt->sgl, *sg_last = NULL; -+ unsigned int new_len; - - while (sg) { - if (!sg_page(sg)) -@@ -61,13 +62,13 @@ qce_sgtable_add(struct sg_table *sgt, st - if (!sg) - return ERR_PTR(-EINVAL); - -- while (new_sgl && sg && max_ents) { -- sg_set_page(sg, sg_page(new_sgl), new_sgl->length, -- new_sgl->offset); -+ while (new_sgl && sg && max_len) { -+ new_len = new_sgl->length > max_len ? max_len : new_sgl->length; -+ sg_set_page(sg, sg_page(new_sgl), new_len, new_sgl->offset); - sg_last = sg; - sg = sg_next(sg); - new_sgl = sg_next(new_sgl); -- max_ents--; -+ max_len -= new_len; - } - - return sg_last; ---- a/drivers/crypto/qce/dma.h -+++ b/drivers/crypto/qce/dma.h -@@ -43,6 +43,6 @@ void qce_dma_issue_pending(struct qce_dm - int qce_dma_terminate_all(struct qce_dma_data *dma); - struct scatterlist * - qce_sgtable_add(struct sg_table *sgt, struct scatterlist *sg_add, -- int max_ents); -+ unsigned int max_len); - - #endif /* _DMA_H_ */ ---- a/drivers/crypto/qce/skcipher.c -+++ b/drivers/crypto/qce/skcipher.c -@@ -97,13 +97,14 @@ qce_skcipher_async_req_handle(struct cry - - sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ); - -- sg = qce_sgtable_add(&rctx->dst_tbl, req->dst, rctx->dst_nents - 1); -+ sg = qce_sgtable_add(&rctx->dst_tbl, req->dst, req->cryptlen); - if (IS_ERR(sg)) { - ret = PTR_ERR(sg); - goto error_free; - } - -- sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg, 1); -+ sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg, -+ QCE_RESULT_BUF_SZ); - if (IS_ERR(sg)) { - ret = PTR_ERR(sg); - goto error_free; diff --git a/target/linux/ipq40xx/patches-5.4/0015-v5.7-crypto-qce-use-AES-fallback-for-small-requests.patch b/target/linux/ipq40xx/patches-5.4/0015-v5.7-crypto-qce-use-AES-fallback-for-small-requests.patch deleted file mode 100644 index 0b5c8c6d6..000000000 --- a/target/linux/ipq40xx/patches-5.4/0015-v5.7-crypto-qce-use-AES-fallback-for-small-requests.patch +++ /dev/null @@ -1,113 +0,0 @@ -From ce163ba0bf298f1707321ac025ef639f88e62801 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 7 Feb 2020 12:02:26 -0300 -Subject: [PATCH 10/11] crypto: qce - use AES fallback for small requests - -Process small blocks using the fallback cipher, as a workaround for an -observed failure (DMA-related, apparently) when computing the GCM ghash -key. This brings a speed gain as well, since it avoids the latency of -using the hardware engine to process small blocks. - -Using software for all 16-byte requests would be enough to make GCM -work, but to increase performance, a larger threshold would be better. -Measuring the performance of supported ciphers with openssl speed, -software matches hardware at around 768-1024 bytes. - -Considering the 256-bit ciphers, software is 2-3 times faster than qce -at 256-bytes, 30% faster at 512, and about even at 768-bytes. With -128-bit keys, the break-even point would be around 1024-bytes. - -This adds the 'aes_sw_max_len' parameter, to set the largest request -length processed by the software fallback. Its default is being set to -512 bytes, a little lower than the break-even point, to balance the cost -in CPU usage. - -Signed-off-by: Eneas U de Queiroz -Signed-off-by: Herbert Xu ---- - ---- a/drivers/crypto/Kconfig -+++ b/drivers/crypto/Kconfig -@@ -684,6 +684,29 @@ choice - - endchoice - -+config CRYPTO_DEV_QCE_SW_MAX_LEN -+ int "Default maximum request size to use software for AES" -+ depends on CRYPTO_DEV_QCE && CRYPTO_DEV_QCE_SKCIPHER -+ default 512 -+ help -+ This sets the default maximum request size to perform AES requests -+ using software instead of the crypto engine. It can be changed by -+ setting the aes_sw_max_len parameter. -+ -+ Small blocks are processed faster in software than hardware. -+ Considering the 256-bit ciphers, software is 2-3 times faster than -+ qce at 256-bytes, 30% faster at 512, and about even at 768-bytes. -+ With 128-bit keys, the break-even point would be around 1024-bytes. -+ -+ The default is set a little lower, to 512 bytes, to balance the -+ cost in CPU usage. The minimum recommended setting is 16-bytes -+ (1 AES block), since AES-GCM will fail if you set it lower. -+ Setting this to zero will send all requests to the hardware. -+ -+ Note that 192-bit keys are not supported by the hardware and are -+ always processed by the software fallback, and all DES requests -+ are done by the hardware. -+ - config CRYPTO_DEV_QCOM_RNG - tristate "Qualcomm Random Number Generator Driver" - depends on ARCH_QCOM || COMPILE_TEST ---- a/drivers/crypto/qce/skcipher.c -+++ b/drivers/crypto/qce/skcipher.c -@@ -5,6 +5,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -12,6 +13,13 @@ - - #include "cipher.h" - -+static unsigned int aes_sw_max_len = CONFIG_CRYPTO_DEV_QCE_SW_MAX_LEN; -+module_param(aes_sw_max_len, uint, 0644); -+MODULE_PARM_DESC(aes_sw_max_len, -+ "Only use hardware for AES requests larger than this " -+ "[0=always use hardware; anything <16 breaks AES-GCM; default=" -+ __stringify(CONFIG_CRYPTO_DEV_QCE_SOFT_THRESHOLD)"]"); -+ - static LIST_HEAD(skcipher_algs); - - static void qce_skcipher_done(void *data) -@@ -166,15 +174,10 @@ static int qce_skcipher_setkey(struct cr - switch (IS_XTS(flags) ? keylen >> 1 : keylen) { - case AES_KEYSIZE_128: - case AES_KEYSIZE_256: -+ memcpy(ctx->enc_key, key, keylen); - break; -- default: -- goto fallback; - } - -- ctx->enc_keylen = keylen; -- memcpy(ctx->enc_key, key, keylen); -- return 0; --fallback: - ret = crypto_sync_skcipher_setkey(ctx->fallback, key, keylen); - if (!ret) - ctx->enc_keylen = keylen; -@@ -224,8 +227,9 @@ static int qce_skcipher_crypt(struct skc - rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; - keylen = IS_XTS(rctx->flags) ? ctx->enc_keylen >> 1 : ctx->enc_keylen; - -- if (IS_AES(rctx->flags) && keylen != AES_KEYSIZE_128 && -- keylen != AES_KEYSIZE_256) { -+ if (IS_AES(rctx->flags) && -+ ((keylen != AES_KEYSIZE_128 && keylen != AES_KEYSIZE_256) || -+ req->cryptlen <= aes_sw_max_len)) { - SYNC_SKCIPHER_REQUEST_ON_STACK(subreq, ctx->fallback); - - skcipher_request_set_sync_tfm(subreq, ctx->fallback); diff --git a/target/linux/ipq40xx/patches-5.4/0016-v5.7-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch b/target/linux/ipq40xx/patches-5.4/0016-v5.7-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch deleted file mode 100644 index 18beda629..000000000 --- a/target/linux/ipq40xx/patches-5.4/0016-v5.7-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 7f19380b2cfd412dcef2facefb3f6c62788864d7 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 7 Feb 2020 12:02:27 -0300 -Subject: [PATCH 11/11] crypto: qce - handle AES-XTS cases that qce fails - -QCE hangs when presented with an AES-XTS request whose length is larger -than QCE_SECTOR_SIZE (512-bytes), and is not a multiple of it. Let the -fallback cipher handle them. - -Signed-off-by: Eneas U de Queiroz -Signed-off-by: Herbert Xu ---- - drivers/crypto/qce/common.c | 2 -- - drivers/crypto/qce/common.h | 3 +++ - drivers/crypto/qce/skcipher.c | 9 +++++++-- - 3 files changed, 10 insertions(+), 4 deletions(-) - ---- a/drivers/crypto/qce/common.c -+++ b/drivers/crypto/qce/common.c -@@ -15,8 +15,6 @@ - #include "regs-v5.h" - #include "sha.h" - --#define QCE_SECTOR_SIZE 512 -- - static inline u32 qce_read(struct qce_device *qce, u32 offset) - { - return readl(qce->base + offset); ---- a/drivers/crypto/qce/common.h -+++ b/drivers/crypto/qce/common.h -@@ -12,6 +12,9 @@ - #include - #include - -+/* xts du size */ -+#define QCE_SECTOR_SIZE 512 -+ - /* key size in bytes */ - #define QCE_SHA_HMAC_KEY_SIZE 64 - #define QCE_MAX_CIPHER_KEY_SIZE AES_KEYSIZE_256 ---- a/drivers/crypto/qce/skcipher.c -+++ b/drivers/crypto/qce/skcipher.c -@@ -227,9 +227,14 @@ static int qce_skcipher_crypt(struct skc - rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; - keylen = IS_XTS(rctx->flags) ? ctx->enc_keylen >> 1 : ctx->enc_keylen; - -+ /* qce is hanging when AES-XTS request len > QCE_SECTOR_SIZE and -+ * is not a multiple of it; pass such requests to the fallback -+ */ - if (IS_AES(rctx->flags) && -- ((keylen != AES_KEYSIZE_128 && keylen != AES_KEYSIZE_256) || -- req->cryptlen <= aes_sw_max_len)) { -+ (((keylen != AES_KEYSIZE_128 && keylen != AES_KEYSIZE_256) || -+ req->cryptlen <= aes_sw_max_len) || -+ (IS_XTS(rctx->flags) && req->cryptlen > QCE_SECTOR_SIZE && -+ req->cryptlen % QCE_SECTOR_SIZE))) { - SYNC_SKCIPHER_REQUEST_ON_STACK(subreq, ctx->fallback); - - skcipher_request_set_sync_tfm(subreq, ctx->fallback); diff --git a/target/linux/ipq40xx/patches-5.4/0017-v5.8-phy-add-driver-for-Qualcomm-IPQ40xx-USB-PHY.patch b/target/linux/ipq40xx/patches-5.4/0017-v5.8-phy-add-driver-for-Qualcomm-IPQ40xx-USB-PHY.patch deleted file mode 100644 index ad09a9f25..000000000 --- a/target/linux/ipq40xx/patches-5.4/0017-v5.8-phy-add-driver-for-Qualcomm-IPQ40xx-USB-PHY.patch +++ /dev/null @@ -1,197 +0,0 @@ -From 3c9d8f6c03a2cda1849ec3c84f82ec030d1f49ef Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Sun, 3 May 2020 22:18:22 +0200 -Subject: [PATCH] phy: add driver for Qualcomm IPQ40xx USB PHY - -Add a driver to setup the USB PHY-s on Qualcom m IPQ40xx series SoCs. -The driver sets up HS and SS phys. - -Signed-off-by: John Crispin -Signed-off-by: Robert Marko -Cc: Luka Perkov -Link: https://lore.kernel.org/r/20200503201823.531757-1-robert.marko@sartura.hr -Signed-off-by: Vinod Koul ---- - drivers/phy/qualcomm/Kconfig | 7 + - drivers/phy/qualcomm/Makefile | 1 + - drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c | 148 ++++++++++++++++++++ - 3 files changed, 156 insertions(+) - create mode 100644 drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c - ---- a/drivers/phy/qualcomm/Kconfig -+++ b/drivers/phy/qualcomm/Kconfig -@@ -18,6 +18,13 @@ config PHY_QCOM_APQ8064_SATA - depends on OF - select GENERIC_PHY - -+config PHY_QCOM_IPQ4019_USB -+ tristate "Qualcomm IPQ4019 USB PHY driver" -+ depends on OF && (ARCH_QCOM || COMPILE_TEST) -+ select GENERIC_PHY -+ help -+ Support for the USB PHY-s on Qualcomm IPQ40xx SoC-s. -+ - config PHY_QCOM_IPQ806X_SATA - tristate "Qualcomm IPQ806x SATA SerDes/PHY driver" - depends on ARCH_QCOM ---- a/drivers/phy/qualcomm/Makefile -+++ b/drivers/phy/qualcomm/Makefile -@@ -1,6 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - obj-$(CONFIG_PHY_ATH79_USB) += phy-ath79-usb.o - obj-$(CONFIG_PHY_QCOM_APQ8064_SATA) += phy-qcom-apq8064-sata.o -+obj-$(CONFIG_PHY_QCOM_IPQ4019_USB) += phy-qcom-ipq4019-usb.o - obj-$(CONFIG_PHY_QCOM_IPQ806X_SATA) += phy-qcom-ipq806x-sata.o - obj-$(CONFIG_PHY_QCOM_PCIE2) += phy-qcom-pcie2.o - obj-$(CONFIG_PHY_QCOM_QMP) += phy-qcom-qmp.o ---- /dev/null -+++ b/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c -@@ -0,0 +1,148 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later -+/* -+ * Copyright (C) 2018 John Crispin -+ * -+ * Based on code from -+ * Allwinner Technology Co., Ltd. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+struct ipq4019_usb_phy { -+ struct device *dev; -+ struct phy *phy; -+ void __iomem *base; -+ struct reset_control *por_rst; -+ struct reset_control *srif_rst; -+}; -+ -+static int ipq4019_ss_phy_power_off(struct phy *_phy) -+{ -+ struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); -+ -+ reset_control_assert(phy->por_rst); -+ msleep(10); -+ -+ return 0; -+} -+ -+static int ipq4019_ss_phy_power_on(struct phy *_phy) -+{ -+ struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); -+ -+ ipq4019_ss_phy_power_off(_phy); -+ -+ reset_control_deassert(phy->por_rst); -+ -+ return 0; -+} -+ -+static struct phy_ops ipq4019_usb_ss_phy_ops = { -+ .power_on = ipq4019_ss_phy_power_on, -+ .power_off = ipq4019_ss_phy_power_off, -+}; -+ -+static int ipq4019_hs_phy_power_off(struct phy *_phy) -+{ -+ struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); -+ -+ reset_control_assert(phy->por_rst); -+ msleep(10); -+ -+ reset_control_assert(phy->srif_rst); -+ msleep(10); -+ -+ return 0; -+} -+ -+static int ipq4019_hs_phy_power_on(struct phy *_phy) -+{ -+ struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); -+ -+ ipq4019_hs_phy_power_off(_phy); -+ -+ reset_control_deassert(phy->srif_rst); -+ msleep(10); -+ -+ reset_control_deassert(phy->por_rst); -+ -+ return 0; -+} -+ -+static struct phy_ops ipq4019_usb_hs_phy_ops = { -+ .power_on = ipq4019_hs_phy_power_on, -+ .power_off = ipq4019_hs_phy_power_off, -+}; -+ -+static const struct of_device_id ipq4019_usb_phy_of_match[] = { -+ { .compatible = "qcom,usb-hs-ipq4019-phy", .data = &ipq4019_usb_hs_phy_ops}, -+ { .compatible = "qcom,usb-ss-ipq4019-phy", .data = &ipq4019_usb_ss_phy_ops}, -+ { }, -+}; -+MODULE_DEVICE_TABLE(of, ipq4019_usb_phy_of_match); -+ -+static int ipq4019_usb_phy_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct resource *res; -+ struct phy_provider *phy_provider; -+ struct ipq4019_usb_phy *phy; -+ -+ phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); -+ if (!phy) -+ return -ENOMEM; -+ -+ phy->dev = &pdev->dev; -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ phy->base = devm_ioremap_resource(&pdev->dev, res); -+ if (IS_ERR(phy->base)) { -+ dev_err(dev, "failed to remap register memory\n"); -+ return PTR_ERR(phy->base); -+ } -+ -+ phy->por_rst = devm_reset_control_get(phy->dev, "por_rst"); -+ if (IS_ERR(phy->por_rst)) { -+ if (PTR_ERR(phy->por_rst) != -EPROBE_DEFER) -+ dev_err(dev, "POR reset is missing\n"); -+ return PTR_ERR(phy->por_rst); -+ } -+ -+ phy->srif_rst = devm_reset_control_get_optional(phy->dev, "srif_rst"); -+ if (IS_ERR(phy->srif_rst)) -+ return PTR_ERR(phy->srif_rst); -+ -+ phy->phy = devm_phy_create(dev, NULL, of_device_get_match_data(dev)); -+ if (IS_ERR(phy->phy)) { -+ dev_err(dev, "failed to create PHY\n"); -+ return PTR_ERR(phy->phy); -+ } -+ phy_set_drvdata(phy->phy, phy); -+ -+ phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); -+ -+ return PTR_ERR_OR_ZERO(phy_provider); -+} -+ -+static struct platform_driver ipq4019_usb_phy_driver = { -+ .probe = ipq4019_usb_phy_probe, -+ .driver = { -+ .of_match_table = ipq4019_usb_phy_of_match, -+ .name = "ipq4019-usb-phy", -+ } -+}; -+module_platform_driver(ipq4019_usb_phy_driver); -+ -+MODULE_DESCRIPTION("QCOM/IPQ4019 USB phy driver"); -+MODULE_AUTHOR("John Crispin "); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/ipq40xx/patches-5.4/0018-v5.9-pinctrl-msm-open-drain.patch b/target/linux/ipq40xx/patches-5.4/0018-v5.9-pinctrl-msm-open-drain.patch deleted file mode 100644 index 5cd4ccc30..000000000 --- a/target/linux/ipq40xx/patches-5.4/0018-v5.9-pinctrl-msm-open-drain.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 5b08c1d567ee8e6af94696b3e549997cbdb2bb80 Mon Sep 17 00:00:00 2001 -From: Jaiganesh Narayanan -Date: Thu, 1 Sep 2016 10:40:38 +0530 -Subject: [PATCH] pinctrl: qcom: ipq4019: add open drain support - -Signed-off-by: Jaiganesh Narayanan -[ Brian: adapted from from the Chromium OS kernel used on IPQ4019-based - WiFi APs. ] -Signed-off-by: Brian Norris ---- -https://lore.kernel.org/linux-gpio/20200703080646.23233-1-computersforpeace@gmail.com/ - - drivers/pinctrl/qcom/pinctrl-ipq4019.c | 1 + - drivers/pinctrl/qcom/pinctrl-msm.c | 13 +++++++++++++ - drivers/pinctrl/qcom/pinctrl-msm.h | 2 ++ - 3 files changed, 16 insertions(+) - ---- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c -+++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c -@@ -254,6 +254,7 @@ DECLARE_QCA_GPIO_PINS(99); - .mux_bit = 2, \ - .pull_bit = 0, \ - .drv_bit = 6, \ -+ .od_bit = 12, \ - .oe_bit = 9, \ - .in_bit = 0, \ - .out_bit = 1, \ ---- a/drivers/pinctrl/qcom/pinctrl-msm.c -+++ b/drivers/pinctrl/qcom/pinctrl-msm.c -@@ -225,6 +225,10 @@ static int msm_config_reg(struct msm_pin - *bit = g->pull_bit; - *mask = 3; - break; -+ case PIN_CONFIG_DRIVE_OPEN_DRAIN: -+ *bit = g->od_bit; -+ *mask = 1; -+ break; - case PIN_CONFIG_DRIVE_STRENGTH: - *bit = g->drv_bit; - *mask = 7; -@@ -302,6 +306,12 @@ static int msm_config_group_get(struct p - if (!arg) - return -EINVAL; - break; -+ case PIN_CONFIG_DRIVE_OPEN_DRAIN: -+ /* Pin is not open-drain */ -+ if (!arg) -+ return -EINVAL; -+ arg = 1; -+ break; - case PIN_CONFIG_DRIVE_STRENGTH: - arg = msm_regval_to_drive(arg); - break; -@@ -374,6 +384,9 @@ static int msm_config_group_set(struct p - else - arg = MSM_PULL_UP; - break; -+ case PIN_CONFIG_DRIVE_OPEN_DRAIN: -+ arg = 1; -+ break; - case PIN_CONFIG_DRIVE_STRENGTH: - /* Check for invalid values */ - if (arg > 16 || arg < 2 || (arg % 2) != 0) ---- a/drivers/pinctrl/qcom/pinctrl-msm.h -+++ b/drivers/pinctrl/qcom/pinctrl-msm.h -@@ -38,6 +38,7 @@ struct msm_function { - * @mux_bit: Offset in @ctl_reg for the pinmux function selection. - * @pull_bit: Offset in @ctl_reg for the bias configuration. - * @drv_bit: Offset in @ctl_reg for the drive strength configuration. -+ * @od_bit: Offset in @ctl_reg for controlling open drain. - * @oe_bit: Offset in @ctl_reg for controlling output enable. - * @in_bit: Offset in @io_reg for the input bit value. - * @out_bit: Offset in @io_reg for the output bit value. -@@ -75,6 +76,7 @@ struct msm_pingroup { - unsigned pull_bit:5; - unsigned drv_bit:5; - -+ unsigned od_bit:5; - unsigned oe_bit:5; - unsigned in_bit:5; - unsigned out_bit:5; diff --git a/target/linux/ipq40xx/patches-5.4/0019-v5.6-mtd-spi-nor-Add-support-for-mx25r3235f.patch b/target/linux/ipq40xx/patches-5.4/0019-v5.6-mtd-spi-nor-Add-support-for-mx25r3235f.patch deleted file mode 100644 index 641e379e3..000000000 --- a/target/linux/ipq40xx/patches-5.4/0019-v5.6-mtd-spi-nor-Add-support-for-mx25r3235f.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 707745e8d4e75b638b990d67950ab292b3b8ea2a Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Mon, 16 Dec 2019 01:36:46 +0100 -Subject: [PATCH] mtd: spi-nor: Add support for mx25r3235f - -Add MTD support for the Macronix MX25R3235F SPI NOR chip from Macronix. -The chip has 4MB of total capacity, divided into a total of 64 sectors, -each 64KB sized. The chip also supports 4KB large sectors. -Additionally, it supports dual and quad read modes. - -Functionality was verified on an HPE/Aruba AP-303 board. - -Signed-off-by: David Bauer -Signed-off-by: Tudor Ambarus ---- - drivers/mtd/spi-nor/spi-nor.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/drivers/mtd/spi-nor/spi-nor.c -+++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -2356,6 +2356,8 @@ static const struct flash_info spi_nor_i - { "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) }, - { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) }, - { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, -+ { "mx25r3235f", INFO(0xc22816, 0, 64 * 1024, 64, -+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, - { "mx25u12835f", INFO(0xc22538, 0, 64 * 1024, 256, - SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, - { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, diff --git a/target/linux/ipq40xx/patches-5.4/305-spi-nor-add-en25qh16.patch b/target/linux/ipq40xx/patches-5.4/305-spi-nor-add-en25qh16.patch deleted file mode 100644 index 17600bfe5..000000000 --- a/target/linux/ipq40xx/patches-5.4/305-spi-nor-add-en25qh16.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/mtd/spi-nor/spi-nor.c -+++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -2245,6 +2245,8 @@ static const struct flash_info spi_nor_i - { "en25qx128a", INFO(0x1c7118, 0, 64 * 1024, 256, SECT_4K) }, - { "en25q80a", INFO(0x1c3014, 0, 64 * 1024, 16, - SECT_4K | SPI_NOR_DUAL_READ) }, -+ { "en25qh16", INFO(0x1c7015, 0, 64 * 1024, 32, -+ SECT_4K | SPI_NOR_DUAL_READ) }, - { "en25qh32", INFO(0x1c7016, 0, 64 * 1024, 64, 0) }, - { "en25qh64", INFO(0x1c7017, 0, 64 * 1024, 128, - SECT_4K | SPI_NOR_DUAL_READ) }, diff --git a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch deleted file mode 100644 index 99897a103..000000000 --- a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/drivers/net/phy/Kconfig -+++ b/drivers/net/phy/Kconfig -@@ -584,6 +584,13 @@ config XILINX_GMII2RGMII - the Reduced Gigabit Media Independent Interface(RGMII) between - Ethernet physical media devices and the Gigabit Ethernet controller. - -+config AR40XX_PHY -+ tristate "Driver for Qualcomm Atheros IPQ40XX switches" -+ depends on HAS_IOMEM && OF && OF_MDIO -+ select SWCONFIG -+ help -+ This is the driver for Qualcomm Atheros IPQ40XX ESS switches. -+ - endif # PHYLIB - - config MICREL_KS8995MA ---- a/drivers/net/phy/Makefile -+++ b/drivers/net/phy/Makefile -@@ -71,6 +71,7 @@ ifdef CONFIG_HWMON - aquantia-objs += aquantia_hwmon.o - endif - obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o -+obj-$(CONFIG_AR40XX_PHY) += ar40xx.o - obj-$(CONFIG_AX88796B_PHY) += ax88796b.o - obj-$(CONFIG_AT803X_PHY) += at803x.o - obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o diff --git a/target/linux/ipq40xx/patches-5.4/900-arm-add-cmdline-override.patch b/target/linux/ipq40xx/patches-5.4/900-arm-add-cmdline-override.patch deleted file mode 100644 index f5e2619c4..000000000 --- a/target/linux/ipq40xx/patches-5.4/900-arm-add-cmdline-override.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -1826,6 +1826,14 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN - - endchoice - -+config CMDLINE_OVERRIDE -+ bool "Use alternative cmdline from device tree" -+ help -+ Some bootloaders may have uneditable bootargs. While CMDLINE_FORCE can -+ be used, this is not a good option for kernels that are shared across -+ devices. This setting enables using "chosen/cmdline-override" as the -+ cmdline if it exists in the device tree. -+ - config CMDLINE - string "Default kernel command string" - default "" ---- a/drivers/of/fdt.c -+++ b/drivers/of/fdt.c -@@ -1060,6 +1060,17 @@ int __init early_init_dt_scan_chosen(uns - if (p != NULL && l > 0) - strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); - -+ /* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different -+ * device tree option of chosen/bootargs-override. This is -+ * helpful on boards where u-boot sets bootargs, and is unable -+ * to be modified. -+ */ -+#ifdef CONFIG_CMDLINE_OVERRIDE -+ p = of_get_flat_dt_prop(node, "bootargs-override", &l); -+ if (p != NULL && l > 0) -+ strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); -+#endif -+ - /* - * CONFIG_CMDLINE is meant to be a default in case nothing else - * managed to set the command line, unless CONFIG_CMDLINE_FORCE diff --git a/target/linux/ipq40xx/patches-5.4/901-essedma-disable-default-vlan-tagging.patch b/target/linux/ipq40xx/patches-5.4/901-essedma-disable-default-vlan-tagging.patch deleted file mode 100644 index 824ba8a87..000000000 --- a/target/linux/ipq40xx/patches-5.4/901-essedma-disable-default-vlan-tagging.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 42b508d91b7f51b054f383e3aa42089ccab9300d Mon Sep 17 00:00:00 2001 -From: Chen Minqiang -Date: Thu, 15 Mar 2018 05:33:46 +0800 -Subject: [PATCH] essedma: disable default vlan tagging - -The essedma driver has its own unique take on VLAN management -and its configuration. In the original SDK, each VLAN is -assigned one virtual ethernet netdev. - -However, this is non-standard. So, this patch does away -with the default_vlan_tag property the driver is using -and therefore forces the user to use the kernel's vlan -feature. - -This patch also removes the "qcom,poll_required = <1>;" from -the essedma node. - -Signed-off-by: Christian Lamparter -Signed-off-by: Chen Minqiang ---- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 5 ++--- - drivers/net/ethernet/qualcomm/essedma/edma.c | 14 +++++--------- - 2 files changed, 7 insertions(+), 12 deletions(-) - ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -666,8 +666,7 @@ - qcom,page-mode = <0>; - qcom,rx_head_buf_size = <1540>; - qcom,mdio_supported; -- qcom,poll_required = <1>; -- qcom,num_gmac = <2>; -+ qcom,num_gmac = <1>; - interrupts = <0 65 IRQ_TYPE_EDGE_RISING - 0 66 IRQ_TYPE_EDGE_RISING - 0 67 IRQ_TYPE_EDGE_RISING -@@ -705,7 +704,7 @@ - - gmac0: gmac0 { - local-mac-address = [00 00 00 00 00 00]; -- vlan_tag = <1 0x1f>; -+ vlan_tag = <1 0x3f>; - }; - - gmac1: gmac1 { diff --git a/target/linux/ipq40xx/patches-5.4/995-add-qca-rfs-support.patch b/target/linux/ipq40xx/patches-5.4/995-add-qca-rfs-support.patch deleted file mode 100644 index 2abfa9f54..000000000 --- a/target/linux/ipq40xx/patches-5.4/995-add-qca-rfs-support.patch +++ /dev/null @@ -1,695 +0,0 @@ ---- a/include/linux/if_bridge.h -+++ b/include/linux/if_bridge.h -@@ -149,4 +149,37 @@ br_port_flag_is_set(const struct net_dev - } - #endif - -+extern struct net_device *br_port_dev_get(struct net_device *dev, -+ unsigned char *addr, -+ struct sk_buff *skb, -+ unsigned int cookie); -+extern void br_refresh_fdb_entry(struct net_device *dev, const char *addr); -+extern struct net_bridge_fdb_entry *br_fdb_has_entry(struct net_device *dev, -+ const char *addr, -+ __u16 vid); -+extern void br_fdb_update_register_notify(struct notifier_block *nb); -+extern void br_fdb_update_unregister_notify(struct notifier_block *nb); -+ -+typedef struct net_bridge_port *br_port_dev_get_hook_t(struct net_device *dev, -+ struct sk_buff *skb, -+ unsigned char *addr, -+ unsigned int cookie); -+extern br_port_dev_get_hook_t __rcu *br_port_dev_get_hook; -+ -+#define BR_FDB_EVENT_ADD 0x01 -+#define BR_FDB_EVENT_DEL 0x02 -+ -+struct br_fdb_event { -+ struct net_device *dev; -+ unsigned char addr[6]; -+ unsigned char is_local; -+}; -+extern void br_fdb_register_notify(struct notifier_block *nb); -+extern void br_fdb_unregister_notify(struct notifier_block *nb); -+ -+typedef struct net_bridge_port *br_get_dst_hook_t( -+ const struct net_bridge_port *src, -+ struct sk_buff **skb); -+extern br_get_dst_hook_t __rcu *br_get_dst_hook; -+ - #endif ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -2661,6 +2661,8 @@ enum netdev_cmd { - NETDEV_CVLAN_FILTER_DROP_INFO, - NETDEV_SVLAN_FILTER_PUSH_INFO, - NETDEV_SVLAN_FILTER_DROP_INFO, -+ NETDEV_BR_JOIN, -+ NETDEV_BR_LEAVE, - }; - const char *netdev_cmd_to_name(enum netdev_cmd cmd); - ---- a/include/linux/ppp_channel.h -+++ b/include/linux/ppp_channel.h -@@ -32,6 +32,17 @@ struct ppp_channel_ops { - #if IS_ENABLED(CONFIG_NF_FLOW_TABLE) - int (*flow_offload_check)(struct ppp_channel *, struct flow_offload_hw_path *); - #endif -+ -+ /* Get channel protocol type, one of PX_PROTO_XYZ or specific to -+ * the channel subtype -+ */ -+ int (*get_channel_protocol)(struct ppp_channel *); -+ /* Get channel protocol version */ -+ int (*get_channel_protocol_ver)(struct ppp_channel *); -+ /* Hold the channel from being destroyed */ -+ void (*hold)(struct ppp_channel *); -+ /* Release hold on the channel */ -+ void (*release)(struct ppp_channel *); - }; - - struct ppp_channel { -@@ -84,5 +95,53 @@ extern char *ppp_dev_name(struct ppp_cha - * that ppp_unregister_channel returns. - */ - -+/* Call this to obtain the underlying protocol of the PPP channel, -+ * e.g. PX_PROTO_OE -+ */ -+extern int ppp_channel_get_protocol(struct ppp_channel *); -+ -+/* Call this get protocol version */ -+extern int ppp_channel_get_proto_version(struct ppp_channel *); -+ -+/* Call this to hold a channel */ -+extern bool ppp_channel_hold(struct ppp_channel *); -+ -+/* Call this to release a hold you have upon a channel */ -+extern void ppp_channel_release(struct ppp_channel *); -+ -+/* Release hold on PPP channels */ -+extern void ppp_release_channels(struct ppp_channel *channels[], -+ unsigned int chan_sz); -+ -+/* Hold PPP channels for the PPP device */ -+extern int ppp_hold_channels(struct net_device *dev, -+ struct ppp_channel *channels[], -+ unsigned int chan_sz); -+/* Test if ppp xmit lock is locked */ -+extern bool ppp_is_xmit_locked(struct net_device *dev); -+ -+/* Hold PPP channels for the PPP device */ -+extern int __ppp_hold_channels(struct net_device *dev, -+ struct ppp_channel *channels[], -+ unsigned int chan_sz); -+ -+/* Test if the ppp device is a multi-link ppp device */ -+extern int ppp_is_multilink(struct net_device *dev); -+ -+/* Test if the ppp device is a multi-link ppp device */ -+extern int __ppp_is_multilink(struct net_device *dev); -+ -+/* Update statistics of the PPP net_device by incrementing related -+ * statistics field value with corresponding parameter -+ */ -+extern void ppp_update_stats(struct net_device *dev, unsigned long rx_packets, -+ unsigned long rx_bytes, unsigned long tx_packets, -+ unsigned long tx_bytes, unsigned long rx_errors, -+ unsigned long tx_errors, unsigned long rx_dropped, -+ unsigned long tx_dropped); -+ -+/* Get the device index associated with a channel, or 0, if none */ -+extern int ppp_dev_index(struct ppp_channel *); -+ - #endif /* __KERNEL__ */ - #endif ---- a/drivers/net/phy/phy.c -+++ b/drivers/net/phy/phy.c -@@ -728,6 +728,7 @@ void phy_stop_machine(struct phy_device - phydev->state = PHY_UP; - mutex_unlock(&phydev->lock); - } -+EXPORT_SYMBOL_GPL(phy_stop_machine); - - /** - * phy_error - enter HALTED state for this PHY device ---- a/drivers/net/ppp/ppp_generic.c -+++ b/drivers/net/ppp/ppp_generic.c -@@ -3359,6 +3359,318 @@ static void *unit_find(struct idr *p, in - return idr_find(p, n); - } - -+/* Return the PPP net device index */ -+int ppp_dev_index(struct ppp_channel *chan) -+{ -+ struct channel *pch = chan->ppp; -+ int ifindex = 0; -+ -+ if (pch) { -+ read_lock_bh(&pch->upl); -+ if (pch->ppp && pch->ppp->dev) -+ ifindex = pch->ppp->dev->ifindex; -+ read_unlock_bh(&pch->upl); -+ } -+ return ifindex; -+} -+EXPORT_SYMBOL(ppp_dev_index); -+ -+/* Updates the PPP interface statistics. */ -+void ppp_update_stats(struct net_device *dev, unsigned long rx_packets, -+ unsigned long rx_bytes, unsigned long tx_packets, -+ unsigned long tx_bytes, unsigned long rx_errors, -+ unsigned long tx_errors, unsigned long rx_dropped, -+ unsigned long tx_dropped) -+{ -+ struct ppp *ppp; -+ -+ if (!dev) -+ return; -+ -+ if (dev->type != ARPHRD_PPP) -+ return; -+ -+ ppp = netdev_priv(dev); -+ -+ ppp_xmit_lock(ppp); -+ ppp->stats64.tx_packets += tx_packets; -+ ppp->stats64.tx_bytes += tx_bytes; -+ ppp->dev->stats.tx_errors += tx_errors; -+ ppp->dev->stats.tx_dropped += tx_dropped; -+ if (tx_packets) -+ ppp->last_xmit = jiffies; -+ ppp_xmit_unlock(ppp); -+ -+ ppp_recv_lock(ppp); -+ ppp->stats64.rx_packets += rx_packets; -+ ppp->stats64.rx_bytes += rx_bytes; -+ ppp->dev->stats.rx_errors += rx_errors; -+ ppp->dev->stats.rx_dropped += rx_dropped; -+ if (rx_packets) -+ ppp->last_recv = jiffies; -+ ppp_recv_unlock(ppp); -+} -+EXPORT_SYMBOL(ppp_update_stats); -+ -+/* Returns >0 if the device is a multilink PPP netdevice, 0 if not or < 0 if -+ * the device is not PPP. -+ */ -+int ppp_is_multilink(struct net_device *dev) -+{ -+ struct ppp *ppp; -+ unsigned int flags; -+ -+ if (!dev) -+ return -1; -+ -+ if (dev->type != ARPHRD_PPP) -+ return -1; -+ -+ ppp = netdev_priv(dev); -+ ppp_lock(ppp); -+ flags = ppp->flags; -+ ppp_unlock(ppp); -+ -+ if (flags & SC_MULTILINK) -+ return 1; -+ -+ return 0; -+} -+EXPORT_SYMBOL(ppp_is_multilink); -+ -+/* __ppp_is_multilink() -+ * Returns >0 if the device is a multilink PPP netdevice, 0 if not or < 0 -+ * if the device is not PPP. Caller should acquire ppp_lock before calling -+ * this function -+ */ -+int __ppp_is_multilink(struct net_device *dev) -+{ -+ struct ppp *ppp; -+ unsigned int flags; -+ -+ if (!dev) -+ return -1; -+ -+ if (dev->type != ARPHRD_PPP) -+ return -1; -+ -+ ppp = netdev_priv(dev); -+ flags = ppp->flags; -+ -+ if (flags & SC_MULTILINK) -+ return 1; -+ -+ return 0; -+} -+EXPORT_SYMBOL(__ppp_is_multilink); -+ -+/* ppp_channel_get_protocol() -+ * Call this to obtain the underlying protocol of the PPP channel, -+ * e.g. PX_PROTO_OE -+ * -+ * NOTE: Some channels do not use PX sockets so the protocol value may be very -+ * different for them. -+ * NOTE: -1 indicates failure. -+ * NOTE: Once you know the channel protocol you may then either cast 'chan' to -+ * its sub-class or use the channel protocol specific API's as provided by that -+ * channel sub type. -+ */ -+int ppp_channel_get_protocol(struct ppp_channel *chan) -+{ -+ if (!chan->ops->get_channel_protocol) -+ return -1; -+ -+ return chan->ops->get_channel_protocol(chan); -+} -+EXPORT_SYMBOL(ppp_channel_get_protocol); -+ -+/* ppp_channel_get_proto_version() -+ * Call this to get channel protocol version -+ */ -+int ppp_channel_get_proto_version(struct ppp_channel *chan) -+{ -+ if (!chan->ops->get_channel_protocol_ver) -+ return -1; -+ -+ return chan->ops->get_channel_protocol_ver(chan); -+} -+EXPORT_SYMBOL(ppp_channel_get_proto_version); -+ -+/* ppp_channel_hold() -+ * Call this to hold a channel. -+ * -+ * Returns true on success or false if the hold could not happen. -+ * -+ * NOTE: chan must be protected against destruction during this call - -+ * either by correct locking etc. or because you already have an implicit -+ * or explicit hold to the channel already and this is an additional hold. -+ */ -+bool ppp_channel_hold(struct ppp_channel *chan) -+{ -+ if (!chan->ops->hold) -+ return false; -+ -+ chan->ops->hold(chan); -+ return true; -+} -+EXPORT_SYMBOL(ppp_channel_hold); -+ -+/* ppp_channel_release() -+ * Call this to release a hold you have upon a channel -+ */ -+void ppp_channel_release(struct ppp_channel *chan) -+{ -+ chan->ops->release(chan); -+} -+EXPORT_SYMBOL(ppp_channel_release); -+ -+/* ppp_hold_channels() -+ * Returns the PPP channels of the PPP device, storing each one into -+ * channels[]. -+ * -+ * channels[] has chan_sz elements. -+ * This function returns the number of channels stored, up to chan_sz. -+ * It will return < 0 if the device is not PPP. -+ * -+ * You MUST release the channels using ppp_release_channels(). -+ */ -+int ppp_hold_channels(struct net_device *dev, struct ppp_channel *channels[], -+ unsigned int chan_sz) -+{ -+ struct ppp *ppp; -+ int c; -+ struct channel *pch; -+ -+ if (!dev) -+ return -1; -+ -+ if (dev->type != ARPHRD_PPP) -+ return -1; -+ -+ ppp = netdev_priv(dev); -+ -+ c = 0; -+ ppp_lock(ppp); -+ list_for_each_entry(pch, &ppp->channels, clist) { -+ struct ppp_channel *chan; -+ -+ if (!pch->chan) { -+ /* Channel is going / gone away */ -+ continue; -+ } -+ -+ if (c == chan_sz) { -+ /* No space to record channel */ -+ ppp_unlock(ppp); -+ return c; -+ } -+ -+ /* Hold the channel, if supported */ -+ chan = pch->chan; -+ if (!chan->ops->hold) -+ continue; -+ -+ chan->ops->hold(chan); -+ -+ /* Record the channel */ -+ channels[c++] = chan; -+ } -+ ppp_unlock(ppp); -+ return c; -+} -+EXPORT_SYMBOL(ppp_hold_channels); -+ -+/* __ppp_hold_channels() -+ * Returns the PPP channels of the PPP device, storing each one -+ * into channels[]. -+ * -+ * channels[] has chan_sz elements. -+ * This function returns the number of channels stored, up to chan_sz. -+ * It will return < 0 if the device is not PPP. -+ * -+ * You MUST acquire ppp_lock and release the channels using -+ * ppp_release_channels(). -+ */ -+int __ppp_hold_channels(struct net_device *dev, struct ppp_channel *channels[], -+ unsigned int chan_sz) -+{ -+ struct ppp *ppp; -+ int c; -+ struct channel *pch; -+ -+ if (!dev) -+ return -1; -+ -+ if (dev->type != ARPHRD_PPP) -+ return -1; -+ -+ ppp = netdev_priv(dev); -+ -+ c = 0; -+ list_for_each_entry(pch, &ppp->channels, clist) { -+ struct ppp_channel *chan; -+ -+ if (!pch->chan) { -+ /* Channel is going / gone away*/ -+ continue; -+ } -+ if (c == chan_sz) { -+ /* No space to record channel */ -+ return c; -+ } -+ -+ /* Hold the channel, if supported */ -+ chan = pch->chan; -+ if (!chan->ops->hold) -+ continue; -+ -+ chan->ops->hold(chan); -+ -+ /* Record the channel */ -+ channels[c++] = chan; -+ } -+ return c; -+} -+EXPORT_SYMBOL(__ppp_hold_channels); -+ -+/* ppp_release_channels() -+ * Releases channels -+ */ -+void ppp_release_channels(struct ppp_channel *channels[], unsigned int chan_sz) -+{ -+ unsigned int c; -+ -+ for (c = 0; c < chan_sz; ++c) { -+ struct ppp_channel *chan; -+ -+ chan = channels[c]; -+ chan->ops->release(chan); -+ } -+} -+EXPORT_SYMBOL(ppp_release_channels); -+ -+/* Check if ppp xmit lock is on hold */ -+bool ppp_is_xmit_locked(struct net_device *dev) -+{ -+ struct ppp *ppp; -+ -+ if (!dev) -+ return false; -+ -+ if (dev->type != ARPHRD_PPP) -+ return false; -+ -+ ppp = netdev_priv(dev); -+ if (!ppp) -+ return false; -+ -+ if (spin_is_locked(&(ppp)->wlock)) -+ return true; -+ -+ return false; -+} -+EXPORT_SYMBOL(ppp_is_xmit_locked); -+ - /* Module/initialization stuff */ - - module_init(ppp_init); ---- a/net/bridge/br_if.c -+++ b/net/bridge/br_if.c -@@ -26,6 +26,10 @@ - - #include "br_private.h" - -+/* Hook for external forwarding logic */ -+br_port_dev_get_hook_t __rcu *br_port_dev_get_hook __read_mostly; -+EXPORT_SYMBOL_GPL(br_port_dev_get_hook); -+ - /* - * Determine initial path cost based on speed. - * using recommendations from 802.1d standard -@@ -696,6 +700,8 @@ int br_add_if(struct net_bridge *br, str - - kobject_uevent(&p->kobj, KOBJ_ADD); - -+ call_netdevice_notifiers(NETDEV_BR_JOIN, dev); -+ - return 0; - - err7: -@@ -732,6 +738,8 @@ int br_del_if(struct net_bridge *br, str - if (!p || p->br != br) - return -EINVAL; - -+ call_netdevice_notifiers(NETDEV_BR_LEAVE, dev); -+ - /* Since more than one interface can be attached to a bridge, - * there still maybe an alternate path for netconsole to use; - * therefore there is no reason for a NETDEV_RELEASE event. -@@ -786,6 +794,65 @@ void br_dev_update_stats(struct net_devi - } - EXPORT_SYMBOL_GPL(br_dev_update_stats); - -+/* br_port_dev_get() -+ * If a skb is provided, and the br_port_dev_get_hook_t hook exists, -+ * use that to try and determine the egress port for that skb. -+ * If not, or no egress port could be determined, use the given addr -+ * to identify the port to which it is reachable, -+ * returing a reference to the net device associated with that port. -+ * -+ * NOTE: Return NULL if given dev is not a bridge or the mac has no -+ * associated port. -+ */ -+struct net_device *br_port_dev_get(struct net_device *dev, unsigned char *addr, -+ struct sk_buff *skb, -+ unsigned int cookie) -+{ -+ struct net_bridge_fdb_entry *fdbe; -+ struct net_bridge *br; -+ struct net_device *netdev = NULL; -+ -+ /* Is this a bridge? */ -+ if (!(dev->priv_flags & IFF_EBRIDGE)) -+ return NULL; -+ -+ rcu_read_lock(); -+ -+ /* If the hook exists and the skb isn't NULL, try and get the port */ -+ if (skb) { -+ br_port_dev_get_hook_t *port_dev_get_hook; -+ -+ port_dev_get_hook = rcu_dereference(br_port_dev_get_hook); -+ if (port_dev_get_hook) { -+ struct net_bridge_port *pdst = -+ __br_get(port_dev_get_hook, NULL, dev, skb, -+ addr, cookie); -+ if (pdst) { -+ dev_hold(pdst->dev); -+ netdev = pdst->dev; -+ goto out; -+ } -+ } -+ } -+ -+ /* Either there is no hook, or can't -+ * determine the port to use - fall back to using FDB -+ */ -+ -+ br = netdev_priv(dev); -+ -+ /* Lookup the fdb entry and get reference to the port dev */ -+ fdbe = br_fdb_find_rcu(br, addr, 0); -+ if (fdbe && fdbe->dst) { -+ netdev = fdbe->dst->dev; /* port device */ -+ dev_hold(netdev); -+ } -+out: -+ rcu_read_unlock(); -+ return netdev; -+} -+EXPORT_SYMBOL_GPL(br_port_dev_get); -+ - bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag) - { - struct net_bridge_port *p; ---- a/net/bridge/br_fdb.c -+++ b/net/bridge/br_fdb.c -@@ -37,6 +37,33 @@ static int fdb_insert(struct net_bridge - static void fdb_notify(struct net_bridge *br, - const struct net_bridge_fdb_entry *, int, bool); - -+ATOMIC_NOTIFIER_HEAD(br_fdb_notifier_list); -+ATOMIC_NOTIFIER_HEAD(br_fdb_update_notifier_list); -+ -+void br_fdb_register_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_register(&br_fdb_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(br_fdb_register_notify); -+ -+void br_fdb_unregister_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_unregister(&br_fdb_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(br_fdb_unregister_notify); -+ -+void br_fdb_update_register_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_register(&br_fdb_update_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(br_fdb_update_register_notify); -+ -+void br_fdb_update_unregister_notify(struct notifier_block *nb) -+{ -+ atomic_notifier_chain_unregister(&br_fdb_update_notifier_list, nb); -+} -+EXPORT_SYMBOL_GPL(br_fdb_update_unregister_notify); -+ - int __init br_fdb_init(void) - { - br_fdb_cache = kmem_cache_create("bridge_fdb_cache", -@@ -337,6 +364,7 @@ void br_fdb_cleanup(struct work_struct * - unsigned long delay = hold_time(br); - unsigned long work_delay = delay; - unsigned long now = jiffies; -+ u8 mac_addr[6]; - - /* this part is tricky, in order to avoid blocking learning and - * consequently forwarding, we rely on rcu to delete objects with -@@ -353,8 +381,11 @@ void br_fdb_cleanup(struct work_struct * - work_delay = min(work_delay, this_timer - now); - } else { - spin_lock_bh(&br->hash_lock); -- if (!hlist_unhashed(&f->fdb_node)) -+ if (!hlist_unhashed(&f->fdb_node)) { - fdb_delete(br, f, true); -+ atomic_notifier_call_chain( -+ &br_fdb_update_notifier_list, 0, (void *)mac_addr); -+ } - spin_unlock_bh(&br->hash_lock); - } - } -@@ -587,6 +618,8 @@ void br_fdb_update(struct net_bridge *br - /* Take over HW learned entry */ - if (unlikely(fdb->added_by_external_learn)) - fdb->added_by_external_learn = 0; -+ atomic_notifier_call_chain( -+ &br_fdb_update_notifier_list, 0, (void *)addr); - } - if (now != fdb->updated) - fdb->updated = now; -@@ -696,6 +729,23 @@ static void fdb_notify(struct net_bridge - struct sk_buff *skb; - int err = -ENOBUFS; - -+ if (fdb->dst) { -+ int event; -+ struct br_fdb_event fdb_event; -+ -+ if (type == RTM_NEWNEIGH) -+ event = BR_FDB_EVENT_ADD; -+ else -+ event = BR_FDB_EVENT_DEL; -+ -+ fdb_event.dev = fdb->dst->dev; -+ ether_addr_copy(fdb_event.addr, fdb->key.addr.addr); -+ fdb_event.is_local = fdb->is_local; -+ atomic_notifier_call_chain(&br_fdb_notifier_list, -+ event, -+ (void *)&fdb_event); -+ } -+ - if (swdev_notify) - br_switchdev_fdb_notify(br, fdb, type); - -@@ -1212,3 +1262,41 @@ void br_fdb_clear_offload(const struct n - spin_unlock_bh(&p->br->hash_lock); - } - EXPORT_SYMBOL_GPL(br_fdb_clear_offload); -+ -+/* Refresh FDB entries for bridge packets being forwarded by offload engines */ -+void br_refresh_fdb_entry(struct net_device *dev, const char *addr) -+{ -+ struct net_bridge_port *p = br_port_get_rcu(dev); -+ -+ if (!p || p->state == BR_STATE_DISABLED) -+ return; -+ -+ if (!is_valid_ether_addr(addr)) { -+ pr_info("bridge: Attempt to refresh with invalid ether address %pM\n", -+ addr); -+ return; -+ } -+ -+ rcu_read_lock(); -+ br_fdb_update(p->br, p, addr, 0, true); -+ rcu_read_unlock(); -+} -+EXPORT_SYMBOL_GPL(br_refresh_fdb_entry); -+ -+/* Look up the MAC address in the device's bridge fdb table */ -+struct net_bridge_fdb_entry *br_fdb_has_entry(struct net_device *dev, -+ const char *addr, __u16 vid) -+{ -+ struct net_bridge_port *p = br_port_get_rcu(dev); -+ struct net_bridge_fdb_entry *fdb; -+ -+ if (!p || p->state == BR_STATE_DISABLED) -+ return NULL; -+ -+ rcu_read_lock(); -+ fdb = fdb_find_rcu(&p->br->fdb_hash_tbl, addr, vid); -+ rcu_read_unlock(); -+ -+ return fdb; -+} -+EXPORT_SYMBOL_GPL(br_fdb_has_entry); ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -1269,4 +1269,7 @@ void br_do_proxy_suppress_arp(struct sk_ - void br_do_suppress_nd(struct sk_buff *skb, struct net_bridge *br, - u16 vid, struct net_bridge_port *p, struct nd_msg *msg); - struct nd_msg *br_is_nd_neigh_msg(struct sk_buff *skb, struct nd_msg *m); -+ -+#define __br_get(__hook, __default, __args ...) \ -+ (__hook ? (__hook(__args)) : (__default)) - #endif diff --git a/target/linux/ipq40xx/patches-5.4/996-add-qca-ssdk-support.patch b/target/linux/ipq40xx/patches-5.4/996-add-qca-ssdk-support.patch deleted file mode 100644 index 412b6a271..000000000 --- a/target/linux/ipq40xx/patches-5.4/996-add-qca-ssdk-support.patch +++ /dev/null @@ -1,109 +0,0 @@ ---- a/include/linux/switch.h -+++ b/include/linux/switch.h -@@ -45,6 +45,9 @@ enum switch_port_speed { - SWITCH_PORT_SPEED_10 = 10, - SWITCH_PORT_SPEED_100 = 100, - SWITCH_PORT_SPEED_1000 = 1000, -+ SWITCH_PORT_SPEED_2500 = 2500, -+ SWITCH_PORT_SPEED_5000 = 5000, -+ SWITCH_PORT_SPEED_10000 = 10000, - }; - - struct switch_port_link { -@@ -83,6 +86,10 @@ struct switch_port_stats { - */ - struct switch_dev_ops { - struct switch_attrlist attr_global, attr_port, attr_vlan; -+ struct switch_attrlist attr_reg; -+ -+ int (*get_reg_val)(struct switch_dev *dev, int reg, int *val); -+ int (*set_reg_val)(struct switch_dev *dev, int reg, int val); - - int (*get_vlan_ports)(struct switch_dev *dev, struct switch_val *val); - int (*set_vlan_ports)(struct switch_dev *dev, struct switch_val *val); -@@ -146,6 +153,12 @@ struct switch_portmap { - const char *s; - }; - -+struct switch_ext { -+ const char *option_name; -+ const char *option_value; -+ struct switch_ext *next; -+}; -+ - struct switch_val { - const struct switch_attr *attr; - unsigned int port_vlan; -@@ -155,6 +168,7 @@ struct switch_val { - u32 i; - struct switch_port *ports; - struct switch_port_link *link; -+ struct switch_ext *ext_val; - } value; - }; - ---- a/include/uapi/linux/switch.h -+++ b/include/uapi/linux/switch.h -@@ -47,13 +47,17 @@ enum { - SWITCH_ATTR_OP_NAME, - SWITCH_ATTR_OP_PORT, - SWITCH_ATTR_OP_VLAN, -+ SWITCH_ATTR_OP_REG, - SWITCH_ATTR_OP_VALUE_INT, - SWITCH_ATTR_OP_VALUE_STR, - SWITCH_ATTR_OP_VALUE_PORTS, - SWITCH_ATTR_OP_VALUE_LINK, -+ SWITCH_ATTR_OP_VALUE_EXT, - SWITCH_ATTR_OP_DESCRIPTION, - /* port lists */ - SWITCH_ATTR_PORT, -+ /* switch_ext attribute */ -+ SWITCH_ATTR_EXT, - SWITCH_ATTR_MAX - }; - -@@ -78,7 +82,10 @@ enum { - SWITCH_CMD_SET_PORT, - SWITCH_CMD_LIST_VLAN, - SWITCH_CMD_GET_VLAN, -- SWITCH_CMD_SET_VLAN -+ SWITCH_CMD_SET_VLAN, -+ SWITCH_CMD_LIST_REG, -+ SWITCH_CMD_GET_REG, -+ SWITCH_CMD_SET_REG, - }; - - /* data types */ -@@ -88,6 +95,7 @@ enum switch_val_type { - SWITCH_TYPE_STRING, - SWITCH_TYPE_PORTS, - SWITCH_TYPE_LINK, -+ SWITCH_TYPE_EXT, - SWITCH_TYPE_NOVAL, - }; - -@@ -113,6 +121,14 @@ enum { - SWITCH_LINK_ATTR_MAX, - }; - -+/* switch_ext nested attributes */ -+enum { -+ SWITCH_EXT_UNSPEC, -+ SWITCH_EXT_NAME, -+ SWITCH_EXT_VALUE, -+ SWITCH_EXT_ATTR_MAX -+}; -+ - #define SWITCH_ATTR_DEFAULTS_OFFSET 0x1000 - - ---- a/include/net/ip_fib.h -+++ b/include/net/ip_fib.h -@@ -107,6 +107,7 @@ struct fib_nh { - #ifdef CONFIG_IP_ROUTE_CLASSID - __u32 nh_tclassid; - #endif -+ __be32 nh_gw; /* QCA SSDK Support */ - __be32 nh_saddr; - int nh_saddr_genid; - #define fib_nh_family nh_common.nhc_family diff --git a/target/linux/ipq40xx/patches-5.4/997-device_tree_cmdline.patch b/target/linux/ipq40xx/patches-5.4/997-device_tree_cmdline.patch deleted file mode 100644 index b6b1b0476..000000000 --- a/target/linux/ipq40xx/patches-5.4/997-device_tree_cmdline.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/drivers/of/fdt.c -+++ b/drivers/of/fdt.c -@@ -1059,6 +1059,9 @@ int __init early_init_dt_scan_chosen(uns - p = of_get_flat_dt_prop(node, "bootargs", &l); - if (p != NULL && l > 0) - strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); -+ p = of_get_flat_dt_prop(node, "bootargs-append", &l); -+ if (p != NULL && l > 0) -+ strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE)); - - /* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different - * device tree option of chosen/bootargs-override. This is diff --git a/target/linux/ipq40xx/patches-5.4/998-enable-ramoops.patch b/target/linux/ipq40xx/patches-5.4/998-enable-ramoops.patch deleted file mode 100644 index a22f4f0f7..000000000 --- a/target/linux/ipq40xx/patches-5.4/998-enable-ramoops.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -32,6 +32,15 @@ - reg = <0x87e80000 0x180000>; - no-map; - }; -+ -+ ramoops@83f00000 { -+ compatible = "ramoops"; -+ reg = <0x83f00000 0x80000>; -+ -+ record-size = <0x10000>; -+ console-size = <0x10000>; -+ ftrace-size = <0x20000>; -+ }; - }; - - aliases { diff --git a/target/linux/ipq40xx/profiles/00-default.mk b/target/linux/ipq40xx/profiles/00-default.mk deleted file mode 100644 index f6ded8544..000000000 --- a/target/linux/ipq40xx/profiles/00-default.mk +++ /dev/null @@ -1,9 +0,0 @@ -define Profile/Default - NAME:=Default Profile - PRIORITY:=1 -endef - -define Profile/Default/Description - Default package set compatible with most boards. -endef -$(eval $(call Profile,Default))