aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZoltan Herpai <wigyori@uid0.hu>2016-06-24 20:17:26 +0200
committerGitHub <noreply@github.com>2016-06-24 20:17:26 +0200
commit6eb05f9f38210bfd7cb667fab1b00e5ebd737556 (patch)
tree8adb7f0946f1c0f2fba4cc28999d915b167af464
parent282b917e47d9ae5017e1e426face9b75cb7aabd0 (diff)
parent64de7165e5bce0d6f811795bc5a0a81165eb58ca (diff)
downloadmaster-187ad058-6eb05f9f38210bfd7cb667fab1b00e5ebd737556.tar.gz
master-187ad058-6eb05f9f38210bfd7cb667fab1b00e5ebd737556.tar.bz2
master-187ad058-6eb05f9f38210bfd7cb667fab1b00e5ebd737556.zip
Merge pull request #12 from wigyori/master
update oxnas target, update ipq806x target, create trunk tag and update revisioning accordingly
-rw-r--r--include/image.mk12
-rw-r--r--package/boot/uboot-envtools/Makefile4
-rwxr-xr-xpackage/boot/uboot-envtools/files/ipq26
-rw-r--r--package/boot/uboot-envtools/files/lantiq5
-rw-r--r--package/boot/uboot-envtools/files/ramips3
-rw-r--r--package/boot/uboot-lantiq/Makefile115
-rw-r--r--package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch74
-rw-r--r--package/boot/uboot-lantiq/patches/0021-MIPS-vrx200-add-NAND-SPL-support.patch2
-rw-r--r--package/boot/uboot-lantiq/patches/0037-MIPS-add-board-support-for-Arcadyan-ARV752DPW.patch2
-rw-r--r--package/boot/uboot-lantiq/patches/0043-MIPS-add-board-support-for-Arcadyan-VGV7510KW22.patch71
-rw-r--r--package/boot/uboot-lantiq/patches/0114-MIPS-add-board-support-for-Arcadyan-VGV7519.patch288
-rw-r--r--package/kernel/lantiq/ltq-adsl-fw/Makefile14
-rw-r--r--package/kernel/lantiq/ltq-adsl-mei/Makefile8
-rw-r--r--package/kernel/lantiq/ltq-adsl/Makefile8
-rw-r--r--package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch18
-rw-r--r--package/kernel/lantiq/ltq-atm/Makefile11
-rw-r--r--package/kernel/lantiq/ltq-hcd/Makefile8
-rw-r--r--package/kernel/linux/modules/block.mk16
-rw-r--r--package/kernel/linux/modules/usb.mk17
-rw-r--r--package/network/config/ltq-adsl-app/Makefile4
-rw-r--r--package/network/config/ltq-adsl-app/patches/001-stupid_breakage_fix.patch65
-rw-r--r--package/network/services/hostapd/Makefile6
-rw-r--r--package/network/services/hostapd/patches/100-mesh_mode_fix.patch2
-rw-r--r--package/network/services/hostapd/patches/120-daemonize_fix.patch4
-rw-r--r--package/network/services/hostapd/patches/130-no_eapol_fix.patch2
-rw-r--r--package/network/services/hostapd/patches/200-multicall.patch130
-rw-r--r--package/network/services/hostapd/patches/300-noscan.patch6
-rw-r--r--package/network/services/hostapd/patches/310-rescan_immediately.patch4
-rw-r--r--package/network/services/hostapd/patches/320-optional_rfkill.patch12
-rw-r--r--package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch2
-rw-r--r--package/network/services/hostapd/patches/340-reload_freq_change.patch4
-rw-r--r--package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch12
-rw-r--r--package/network/services/hostapd/patches/360-ctrl_iface_reload.patch20
-rw-r--r--package/network/services/hostapd/patches/370-ap_sta_support.patch22
-rw-r--r--package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch38
-rw-r--r--package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch4
-rw-r--r--package/network/services/hostapd/patches/420-indicate-features.patch18
-rw-r--r--package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch12
-rw-r--r--package/network/services/hostapd/patches/432-missing-typedef.patch10
-rw-r--r--package/network/services/hostapd/patches/450-scan_wait.patch19
-rw-r--r--package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch35
-rw-r--r--package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch4
-rw-r--r--package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch16
-rw-r--r--package/network/services/hostapd/patches/470-survey_data_fallback.patch45
-rw-r--r--package/network/services/hostapd/patches/600-ubus_support.patch58
-rw-r--r--package/system/mtd/src/Makefile1
-rw-r--r--package/utils/e2fsprogs/Makefile4
-rwxr-xr-xscripts/getver.sh6
-rw-r--r--target/linux/adm5120/rb1xx/target.mk1
-rw-r--r--target/linux/adm5120/router_be/target.mk1
-rw-r--r--target/linux/adm5120/router_le/target.mk1
-rw-r--r--target/linux/ar71xx/image/generic.mk20
-rw-r--r--target/linux/ar71xx/image/legacy.mk19
-rw-r--r--target/linux/ar71xx/image/tp-link.mk12
-rw-r--r--target/linux/ipq806x/Makefile11
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/board.d/01_leds26
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/board.d/02_network13
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/diag.sh34
-rw-r--r--target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata82
-rw-r--r--target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac23
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/init.d/linksys_recovery20
-rw-r--r--target/linux/ipq806x/base-files/lib/ipq806x.sh9
-rw-r--r--target/linux/ipq806x/base-files/lib/upgrade/linksys.sh88
-rw-r--r--target/linux/ipq806x/base-files/lib/upgrade/platform.sh33
-rw-r--r--target/linux/ipq806x/config-3.182
-rw-r--r--target/linux/ipq806x/config-4.4 (renamed from target/linux/ipq806x/config-4.1)59
-rw-r--r--target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts412
-rw-r--r--target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts368
-rw-r--r--target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts381
-rw-r--r--target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts342
-rw-r--r--target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7800.dts372
-rw-r--r--target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-v1.0.dtsi1
-rw-r--r--target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi1185
-rw-r--r--target/linux/ipq806x/image/Makefile67
-rw-r--r--target/linux/ipq806x/patches-3.18/802-ARM-qcom-add-TPLink-C2600-device-tree.patch425
-rw-r--r--target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch167
-rw-r--r--target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch234
-rw-r--r--target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch26
-rw-r--r--target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch82
-rw-r--r--target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch841
-rw-r--r--target/linux/ipq806x/patches-4.1/136-clk-Add-safe-switch-hook.patch164
-rw-r--r--target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch367
-rw-r--r--target/linux/ipq806x/patches-4.1/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch734
-rw-r--r--target/linux/ipq806x/patches-4.1/701-stmmac_update_to_4.3.patch2355
-rw-r--r--target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch31
-rw-r--r--target/linux/ipq806x/patches-4.4/020-add-ap148-bootargs.patch (renamed from target/linux/ipq806x/patches-4.1/020-add-ap148-bootargs.patch)19
-rw-r--r--target/linux/ipq806x/patches-4.4/021-add-ap148-partitions.patch (renamed from target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch)0
-rw-r--r--target/linux/ipq806x/patches-4.4/022-add-db149-dts.patch (renamed from target/linux/ipq806x/patches-4.1/022-add-db149-dts.patch)2
-rw-r--r--target/linux/ipq806x/patches-4.4/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch (renamed from target/linux/ipq806x/patches-4.1/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch)25
-rw-r--r--target/linux/ipq806x/patches-4.4/024-ap148-add-memory-node.patch (renamed from target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch)0
-rw-r--r--target/linux/ipq806x/patches-4.4/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch (renamed from target/linux/ipq806x/patches-4.1/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch)4
-rw-r--r--target/linux/ipq806x/patches-4.4/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch (renamed from target/linux/ipq806x/patches-4.1/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch)2
-rw-r--r--target/linux/ipq806x/patches-4.4/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch (renamed from target/linux/ipq806x/patches-4.1/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch)61
-rw-r--r--target/linux/ipq806x/patches-4.4/100-usb-phy-Add-Qualcomm-DWC3-HS-SS-PHY-drivers.patch510
-rw-r--r--target/linux/ipq806x/patches-4.4/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch125
-rw-r--r--target/linux/ipq806x/patches-4.4/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch (renamed from target/linux/ipq806x/patches-4.1/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch)0
-rw-r--r--target/linux/ipq806x/patches-4.4/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch (renamed from target/linux/ipq806x/patches-4.1/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch)37
-rw-r--r--target/linux/ipq806x/patches-4.4/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch (renamed from target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch)10
-rw-r--r--target/linux/ipq806x/patches-4.4/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch (renamed from target/linux/ipq806x/patches-4.1/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch)0
-rw-r--r--target/linux/ipq806x/patches-4.4/114-pcie-add-ctlr-init.patch (renamed from target/linux/ipq806x/patches-4.1/114-pcie-add-ctlr-init.patch)12
-rw-r--r--target/linux/ipq806x/patches-4.4/115-add-pcie-aux-clk-dts.patch (renamed from target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch)6
-rw-r--r--target/linux/ipq806x/patches-4.4/126-add-rpm-to-ipq8064-dts.patch (renamed from target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch)0
-rw-r--r--target/linux/ipq806x/patches-4.4/133-ARM-Add-Krait-L2-register-accessor-functions.patch (renamed from target/linux/ipq806x/patches-4.1/133-ARM-Add-Krait-L2-register-accessor-functions.patch)4
-rw-r--r--target/linux/ipq806x/patches-4.4/134-clk-mux-Split-out-register-accessors-for-reuse.patch (renamed from target/linux/ipq806x/patches-4.1/134-clk-mux-Split-out-register-accessors-for-reuse.patch)90
-rw-r--r--target/linux/ipq806x/patches-4.4/135-clk-Avoid-sending-high-rates-to-downstream-clocks-du.patch (renamed from target/linux/ipq806x/patches-4.1/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch)89
-rw-r--r--target/linux/ipq806x/patches-4.4/136-clk-Add-safe-switch-hook.patch158
-rw-r--r--target/linux/ipq806x/patches-4.4/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch (renamed from target/linux/ipq806x/patches-4.1/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch)6
-rw-r--r--target/linux/ipq806x/patches-4.4/138-clk-qcom-Add-HFPLL-driver.patch (renamed from target/linux/ipq806x/patches-4.1/138-clk-qcom-Add-HFPLL-driver.patch)4
-rw-r--r--target/linux/ipq806x/patches-4.4/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch (renamed from target/linux/ipq806x/patches-4.1/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch)14
-rw-r--r--target/linux/ipq806x/patches-4.4/140-clk-qcom-Add-support-for-Krait-clocks.patch (renamed from target/linux/ipq806x/patches-4.1/140-clk-qcom-Add-support-for-Krait-clocks.patch)11
-rw-r--r--target/linux/ipq806x/patches-4.4/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch (renamed from target/linux/ipq806x/patches-4.1/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch)16
-rw-r--r--target/linux/ipq806x/patches-4.4/142-clk-qcom-Add-Krait-clock-controller-driver.patch (renamed from target/linux/ipq806x/patches-4.1/142-clk-qcom-Add-Krait-clock-controller-driver.patch)6
-rw-r--r--target/linux/ipq806x/patches-4.4/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch (renamed from target/linux/ipq806x/patches-4.1/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch)6
-rw-r--r--target/linux/ipq806x/patches-4.4/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch (renamed from target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch)0
-rw-r--r--target/linux/ipq806x/patches-4.4/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch (renamed from target/linux/ipq806x/patches-4.1/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch)8
-rw-r--r--target/linux/ipq806x/patches-4.4/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch (renamed from target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch)0
-rw-r--r--target/linux/ipq806x/patches-4.4/156-dmaengine-Add-ADM-driver.patch (renamed from target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch)14
-rw-r--r--target/linux/ipq806x/patches-4.4/157-ARM-DT-ipq8064-Add-ADM-device-node.patch (renamed from target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch)2
-rw-r--r--target/linux/ipq806x/patches-4.4/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch (renamed from target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch)9
-rw-r--r--target/linux/ipq806x/patches-4.4/162-mtd-nand-Qualcomm-NAND-controller-driver.patch (renamed from target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch)8
-rw-r--r--target/linux/ipq806x/patches-4.4/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch (renamed from target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch)0
-rw-r--r--target/linux/ipq806x/patches-4.4/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch (renamed from target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch)2
-rw-r--r--target/linux/ipq806x/patches-4.4/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch (renamed from target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch)2
-rw-r--r--target/linux/ipq806x/patches-4.4/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch (renamed from target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch)2
-rw-r--r--target/linux/ipq806x/patches-4.4/167-ARM-qcom_rpm_fix_support_for_smb208.patch50
-rw-r--r--target/linux/ipq806x/patches-4.4/168-ARM-qcom-add-smb208-DT.patch143
-rw-r--r--target/linux/ipq806x/patches-4.4/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch (renamed from target/linux/ipq806x/patches-4.1/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch)4
-rw-r--r--target/linux/ipq806x/patches-4.4/302-mtd-qcom-smem-rename-rootfs-ubi.patch (renamed from target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch)2
-rw-r--r--target/linux/ipq806x/patches-4.4/400-dsa-add-qca.patch1521
-rw-r--r--target/linux/ipq806x/patches-4.4/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch (renamed from target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch)6
-rw-r--r--target/linux/ipq806x/patches-4.4/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch (renamed from target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch)4
-rw-r--r--target/linux/ipq806x/patches-4.4/709-spi-qup-Fix-fifo-and-dma-support-for-IPQ806x.patch134
-rw-r--r--target/linux/ipq806x/patches-4.4/710-watchdog-qcom-set-WDT_BARK_TIME-register-offset-to-o.patch43
-rw-r--r--target/linux/ipq806x/patches-4.4/711-stmmac-fix-ipq806x-DMA-configuration.patch (renamed from target/linux/ipq806x/patches-4.1/710-stmmac-fix-ipq806x-DMA-configuration.patch)0
-rw-r--r--target/linux/ipq806x/patches-4.4/800-devicetree.patch27
-rw-r--r--target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch185
-rw-r--r--target/linux/ipq806x/profiles/00-default.mk9
-rw-r--r--target/linux/ipq806x/profiles/default.mk19
-rw-r--r--target/linux/ipq806x/profiles/netgear.mk33
-rw-r--r--target/linux/lantiq/Makefile4
-rwxr-xr-xtarget/linux/lantiq/base-files/etc/board.d/01_leds13
-rwxr-xr-xtarget/linux/lantiq/base-files/etc/board.d/02_network22
-rwxr-xr-xtarget/linux/lantiq/base-files/lib/upgrade/platform.sh2
-rw-r--r--target/linux/lantiq/dts/ARV452CQW.dts14
-rw-r--r--target/linux/lantiq/dts/DGN3500.dtsi2
-rw-r--r--target/linux/lantiq/dts/EASY80920.dtsi3
-rw-r--r--target/linux/lantiq/dts/EASY80920NAND.dts36
-rw-r--r--target/linux/lantiq/dts/FRITZ7320.dts10
-rw-r--r--target/linux/lantiq/dts/FRITZ7360SL.dts217
-rw-r--r--target/linux/lantiq/dts/VG3503J.dts178
-rw-r--r--target/linux/lantiq/dts/VG3503J.dtsi176
-rw-r--r--target/linux/lantiq/dts/VG3503J_V2.dts11
-rw-r--r--target/linux/lantiq/dts/VGV7510KW22.dtsi53
-rw-r--r--target/linux/lantiq/dts/VGV7519.dtsi78
-rw-r--r--target/linux/lantiq/dts/VGV7519BRN.dts65
-rw-r--r--target/linux/lantiq/dts/VGV7519NOR.dts18
-rw-r--r--target/linux/lantiq/dts/WBMR300.dts303
-rw-r--r--target/linux/lantiq/dts/amazonse.dtsi2
-rw-r--r--target/linux/lantiq/dts/ar9.dtsi2
-rw-r--r--target/linux/lantiq/dts/danube.dtsi2
-rw-r--r--target/linux/lantiq/dts/vr9.dtsi2
-rw-r--r--target/linux/lantiq/image/Makefile750
-rw-r--r--target/linux/lantiq/image/tp-link.mk48
-rw-r--r--target/linux/lantiq/patches-4.4/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch4
-rw-r--r--target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch67
-rw-r--r--target/linux/lantiq/patches-4.4/0028-NET-lantiq-various-etop-fixes.patch81
-rw-r--r--target/linux/lantiq/patches-4.4/0030-GPIO-add-named-gpio-exports.patch6
-rw-r--r--target/linux/lantiq/patches-4.4/0034-reset-Fix-compile-when-reset-RESET_CONTROLLER-is-not.patch45
-rw-r--r--target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch19
-rw-r--r--target/linux/lantiq/patches-4.4/0042-arch-mips-increase-io_space_limit.patch23
-rw-r--r--target/linux/lantiq/patches-4.4/0047-irq-fixes.patch78
-rw-r--r--target/linux/lantiq/patches-4.4/0047-poweroff.patch23
-rw-r--r--target/linux/lantiq/patches-4.4/0160-owrt-lantiq-multiple-flash.patch69
-rw-r--r--target/linux/lantiq/patches-4.4/0400-xrx200-net-multi-phy.patch38
-rw-r--r--target/linux/lantiq/xrx200/config-default54
-rw-r--r--target/linux/lantiq/xrx200/profiles/00-default.mk9
-rw-r--r--target/linux/lantiq/xrx200/profiles/arv.mk46
-rw-r--r--target/linux/lantiq/xrx200/profiles/avm.mk9
-rw-r--r--target/linux/lantiq/xrx200/profiles/bt.mk9
-rw-r--r--target/linux/lantiq/xrx200/profiles/lantiq.mk13
-rw-r--r--target/linux/lantiq/xrx200/profiles/tplink.mk20
-rw-r--r--target/linux/lantiq/xrx200/profiles/zyxel.mk20
-rw-r--r--target/linux/lantiq/xrx200/target.mk2
-rw-r--r--target/linux/lantiq/xway/profiles/00-default.mk9
-rw-r--r--target/linux/lantiq/xway/profiles/arv.mk167
-rw-r--r--target/linux/lantiq/xway/profiles/audiocodes.mk9
-rw-r--r--target/linux/lantiq/xway/profiles/avm.mk10
-rw-r--r--target/linux/lantiq/xway/profiles/aztech.mk7
-rw-r--r--target/linux/lantiq/xway/profiles/bt.mk34
-rw-r--r--target/linux/lantiq/xway/profiles/buffalo.mk23
-rw-r--r--target/linux/lantiq/xway/profiles/gigaset.mk11
-rw-r--r--target/linux/lantiq/xway/profiles/lantiq.mk5
-rw-r--r--target/linux/lantiq/xway/profiles/netgear.mk23
-rw-r--r--target/linux/lantiq/xway/profiles/zte.mk12
-rw-r--r--target/linux/lantiq/xway/profiles/zyxel.mk10
-rw-r--r--target/linux/lantiq/xway_legacy/config-default29
-rw-r--r--target/linux/lantiq/xway_legacy/profiles/00-default.mk9
-rw-r--r--target/linux/lantiq/xway_legacy/target.mk12
-rw-r--r--target/linux/malta/be/target.mk1
-rw-r--r--target/linux/malta/be64/target.mk1
-rw-r--r--target/linux/malta/le/target.mk1
-rw-r--r--target/linux/malta/le64/target.mk1
-rw-r--r--target/linux/oxnas/Makefile5
-rw-r--r--target/linux/oxnas/config-4.45
-rw-r--r--target/linux/oxnas/image/Makefile69
-rw-r--r--target/linux/oxnas/modules.mk41
-rw-r--r--target/linux/oxnas/patches-4.4/010-arm_introduce-dma-fiq-irq-broadcast.patch42
-rw-r--r--target/linux/oxnas/profiles/00-default.mk8
-rw-r--r--target/linux/oxnas/profiles/akitio.mk17
-rw-r--r--target/linux/oxnas/profiles/cloudengines.mk26
-rw-r--r--target/linux/oxnas/profiles/mitrastar.mk15
-rw-r--r--target/linux/oxnas/profiles/shuttle.mk18
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/01_leds16
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/02_network13
-rw-r--r--target/linux/ramips/base-files/etc/diag.sh12
-rwxr-xr-xtarget/linux/ramips/base-files/etc/init.d/bootcount11
-rwxr-xr-xtarget/linux/ramips/base-files/lib/ramips.sh15
-rwxr-xr-xtarget/linux/ramips/base-files/lib/upgrade/platform.sh7
-rw-r--r--target/linux/ramips/dts/3G-6200N.dts46
-rw-r--r--target/linux/ramips/dts/3G-6200NL.dts46
-rw-r--r--target/linux/ramips/dts/3G150B.dts142
-rw-r--r--target/linux/ramips/dts/3G300M.dts112
-rw-r--r--target/linux/ramips/dts/A5-V11.dts142
-rw-r--r--target/linux/ramips/dts/AI-BR100.dts146
-rw-r--r--target/linux/ramips/dts/AIR3GII.dts124
-rw-r--r--target/linux/ramips/dts/ALL0239-3G.dts47
-rw-r--r--target/linux/ramips/dts/ALL0256N-4M.dts124
-rw-r--r--target/linux/ramips/dts/ALL0256N-8M.dts124
-rw-r--r--target/linux/ramips/dts/ALL5002.dts140
-rw-r--r--target/linux/ramips/dts/ALL5003.dts140
-rw-r--r--target/linux/ramips/dts/AR670W.dts76
-rw-r--r--target/linux/ramips/dts/AR725W.dts76
-rw-r--r--target/linux/ramips/dts/ASL26555-16M.dts168
-rw-r--r--target/linux/ramips/dts/ASL26555-8M.dts156
-rw-r--r--target/linux/ramips/dts/ATP-52B.dts41
-rw-r--r--target/linux/ramips/dts/AWAPN2403.dts108
-rw-r--r--target/linux/ramips/dts/AWM002-4M.dtsi12
-rw-r--r--target/linux/ramips/dts/AWM002-8M.dtsi12
-rw-r--r--target/linux/ramips/dts/AWM002-EVB-4M.dts16
-rw-r--r--target/linux/ramips/dts/AWM002-EVB-8M.dts16
-rw-r--r--target/linux/ramips/dts/AWM002.dtsi108
-rw-r--r--target/linux/ramips/dts/AWM003-EVB.dts30
-rw-r--r--target/linux/ramips/dts/ArcherC20i.dts166
-rw-r--r--target/linux/ramips/dts/ArcherC50.dts156
-rw-r--r--target/linux/ramips/dts/BC2.dts40
-rw-r--r--target/linux/ramips/dts/BR-6425.dts42
-rw-r--r--target/linux/ramips/dts/BR-6475ND.dts188
-rw-r--r--target/linux/ramips/dts/BROADWAY.dts46
-rw-r--r--target/linux/ramips/dts/CARAMBOLA.dts48
-rw-r--r--target/linux/ramips/dts/CF-WR800N.dts140
-rw-r--r--target/linux/ramips/dts/CS-QR10.dts238
-rw-r--r--target/linux/ramips/dts/CY-SWR1100.dts122
-rw-r--r--target/linux/ramips/dts/D105.dts40
-rw-r--r--target/linux/ramips/dts/DAP-1350.dts46
-rw-r--r--target/linux/ramips/dts/DB-WRT01.dts138
-rw-r--r--target/linux/ramips/dts/DCS-930.dts40
-rw-r--r--target/linux/ramips/dts/DCS-930L-B1.dts132
-rw-r--r--target/linux/ramips/dts/DIR-300-B1.dts42
-rw-r--r--target/linux/ramips/dts/DIR-300-B7.dts118
-rw-r--r--target/linux/ramips/dts/DIR-320-B1.dts134
-rw-r--r--target/linux/ramips/dts/DIR-600-B1.dts42
-rw-r--r--target/linux/ramips/dts/DIR-600-B2.dts34
-rw-r--r--target/linux/ramips/dts/DIR-610-A1.dts124
-rw-r--r--target/linux/ramips/dts/DIR-615-D.dts36
-rw-r--r--target/linux/ramips/dts/DIR-615-H1.dts136
-rw-r--r--target/linux/ramips/dts/DIR-620-A1.dts46
-rw-r--r--target/linux/ramips/dts/DIR-620-D1.dts144
-rw-r--r--target/linux/ramips/dts/DIR-645.dts164
-rw-r--r--target/linux/ramips/dts/DIR-810L.dts178
-rw-r--r--target/linux/ramips/dts/DIR-860L-B1.dts160
-rw-r--r--target/linux/ramips/dts/DUZUN-DM06.dts155
-rw-r--r--target/linux/ramips/dts/E1700.dts204
-rw-r--r--target/linux/ramips/dts/ESR-9753.dts34
-rw-r--r--target/linux/ramips/dts/EX2700.dts131
-rw-r--r--target/linux/ramips/dts/F5D8235_V1.dts60
-rw-r--r--target/linux/ramips/dts/F5D8235_V2.dts50
-rw-r--r--target/linux/ramips/dts/F7C027.dts150
-rw-r--r--target/linux/ramips/dts/FIREWRT.dts146
-rw-r--r--target/linux/ramips/dts/FONERA20N.dts86
-rw-r--r--target/linux/ramips/dts/FREESTATION5.dts50
-rw-r--r--target/linux/ramips/dts/GL-MT300A.dts204
-rw-r--r--target/linux/ramips/dts/GL-MT300N.dts196
-rw-r--r--target/linux/ramips/dts/GL-MT750.dts204
-rw-r--r--target/linux/ramips/dts/HC5861.dts76
-rw-r--r--target/linux/ramips/dts/HC5XXX.dtsi218
-rw-r--r--target/linux/ramips/dts/HG255D.dts40
-rw-r--r--target/linux/ramips/dts/HLKRM04.dts142
-rw-r--r--target/linux/ramips/dts/HPM.dts142
-rw-r--r--target/linux/ramips/dts/HT-TM02.dts142
-rw-r--r--target/linux/ramips/dts/HW550-3G.dts46
-rw-r--r--target/linux/ramips/dts/IP2202.dts38
-rw-r--r--target/linux/ramips/dts/JHR-N805R.dts116
-rw-r--r--target/linux/ramips/dts/JHR-N825R.dts42
-rw-r--r--target/linux/ramips/dts/JHR-N926R.dts42
-rw-r--r--target/linux/ramips/dts/LINKIT7688.dts249
-rw-r--r--target/linux/ramips/dts/M2M.dts118
-rw-r--r--target/linux/ramips/dts/M3.dts126
-rw-r--r--target/linux/ramips/dts/M4-4M.dts118
-rw-r--r--target/linux/ramips/dts/M4-8M.dts126
-rw-r--r--target/linux/ramips/dts/MINIEMBPLUG.dts118
-rw-r--r--target/linux/ramips/dts/MINIEMBWIFI.dts40
-rw-r--r--target/linux/ramips/dts/MIWIFI-MINI.dts220
-rw-r--r--target/linux/ramips/dts/MIWIFI-NANO.dts86
-rw-r--r--target/linux/ramips/dts/MLW221.dts160
-rw-r--r--target/linux/ramips/dts/MLWG2.dts160
-rw-r--r--target/linux/ramips/dts/MOFI3500-3GN.dts38
-rw-r--r--target/linux/ramips/dts/MPRA1.dts140
-rw-r--r--target/linux/ramips/dts/MPRA2.dts133
-rw-r--r--target/linux/ramips/dts/MR-102N.dts51
-rw-r--r--target/linux/ramips/dts/MT7620a.dts176
-rw-r--r--target/linux/ramips/dts/MT7620a_MT7530.dts184
-rw-r--r--target/linux/ramips/dts/MT7620a_MT7610e.dts120
-rw-r--r--target/linux/ramips/dts/MT7620a_V22SG.dts116
-rw-r--r--target/linux/ramips/dts/MT7621.dts34
-rw-r--r--target/linux/ramips/dts/MT7628.dts82
-rw-r--r--target/linux/ramips/dts/MZK-750DHP.dts164
-rw-r--r--target/linux/ramips/dts/MZK-DP150N.dts140
-rw-r--r--target/linux/ramips/dts/MZK-EX300NP.dts140
-rw-r--r--target/linux/ramips/dts/MZK-EX750NP.dts166
-rw-r--r--target/linux/ramips/dts/MZK-W300NH2.dts42
-rw-r--r--target/linux/ramips/dts/MZK-WDPR.dts50
-rw-r--r--target/linux/ramips/dts/MicroWRT.dts154
-rw-r--r--target/linux/ramips/dts/NA930.dts128
-rw-r--r--target/linux/ramips/dts/NBG-419N.dts42
-rw-r--r--target/linux/ramips/dts/NCS601W.dts100
-rw-r--r--target/linux/ramips/dts/NW718.dts120
-rw-r--r--target/linux/ramips/dts/OY-0001.dts169
-rw-r--r--target/linux/ramips/dts/PBR-M1.dts169
-rw-r--r--target/linux/ramips/dts/PSG1208.dts156
-rw-r--r--target/linux/ramips/dts/PSR-680W.dts46
-rw-r--r--target/linux/ramips/dts/PWH2004.dts28
-rw-r--r--target/linux/ramips/dts/PX-4885-4M.dts58
-rw-r--r--target/linux/ramips/dts/PX-4885-8M.dts58
-rw-r--r--target/linux/ramips/dts/PX-4885.dtsi42
-rw-r--r--target/linux/ramips/dts/RE6500.dts144
-rw-r--r--target/linux/ramips/dts/RP-N53.dts164
-rw-r--r--target/linux/ramips/dts/RT-G32-B1.dts116
-rw-r--r--target/linux/ramips/dts/RT-N10-PLUS.dts24
-rw-r--r--target/linux/ramips/dts/RT-N13U.dts40
-rw-r--r--target/linux/ramips/dts/RT-N14U.dts142
-rw-r--r--target/linux/ramips/dts/RT-N15.dts72
-rw-r--r--target/linux/ramips/dts/RT-N56U.dts122
-rw-r--r--target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts142
-rw-r--r--target/linux/ramips/dts/RT5350F-OLINUXINO.dts108
-rw-r--r--target/linux/ramips/dts/RUT5XX.dts120
-rw-r--r--target/linux/ramips/dts/SAP-G3200U3.dts150
-rw-r--r--target/linux/ramips/dts/SK-WB8.dts124
-rw-r--r--target/linux/ramips/dts/SL-R7205.dts46
-rw-r--r--target/linux/ramips/dts/TEW-691GR.dts70
-rw-r--r--target/linux/ramips/dts/TEW-692GR.dts110
-rw-r--r--target/linux/ramips/dts/TINY-AC.dts225
-rw-r--r--target/linux/ramips/dts/UBNT-ERX.dts88
-rw-r--r--target/linux/ramips/dts/UR-326N4G.dts46
-rw-r--r--target/linux/ramips/dts/UR-336UN.dts50
-rw-r--r--target/linux/ramips/dts/V11STFE.dts28
-rw-r--r--target/linux/ramips/dts/V22RW-2X2.dts38
-rw-r--r--target/linux/ramips/dts/VOCORE.dtsi77
-rw-r--r--target/linux/ramips/dts/W150M.dts34
-rw-r--r--target/linux/ramips/dts/W306R_V20.dts42
-rw-r--r--target/linux/ramips/dts/W502U.dts46
-rw-r--r--target/linux/ramips/dts/WCR150GN.dts40
-rw-r--r--target/linux/ramips/dts/WF-2881.dts74
-rw-r--r--target/linux/ramips/dts/WHR-1166D.dts182
-rw-r--r--target/linux/ramips/dts/WHR-300HP2.dts138
-rw-r--r--target/linux/ramips/dts/WHR-600D.dts138
-rw-r--r--target/linux/ramips/dts/WHR-G300N.dts37
-rw-r--r--target/linux/ramips/dts/WIDORA-NEO.dts169
-rw-r--r--target/linux/ramips/dts/WITI.dts163
-rw-r--r--target/linux/ramips/dts/WIZARD8800.dts118
-rw-r--r--target/linux/ramips/dts/WIZFI630A.dts222
-rw-r--r--target/linux/ramips/dts/WL-330N.dts116
-rw-r--r--target/linux/ramips/dts/WL-330N3G.dts120
-rw-r--r--target/linux/ramips/dts/WL-341V3.dts46
-rw-r--r--target/linux/ramips/dts/WL-351.dts66
-rw-r--r--target/linux/ramips/dts/WLI-TX4-AG300N.dts36
-rw-r--r--target/linux/ramips/dts/WMR-300.dts118
-rw-r--r--target/linux/ramips/dts/WNCE2001.dts142
-rw-r--r--target/linux/ramips/dts/WNDR3700V5.dts142
-rw-r--r--target/linux/ramips/dts/WR512-3GN-4M.dts38
-rw-r--r--target/linux/ramips/dts/WR512-3GN-8M.dts38
-rw-r--r--target/linux/ramips/dts/WR6202.dts50
-rw-r--r--target/linux/ramips/dts/WRH-300CR.dts162
-rw-r--r--target/linux/ramips/dts/WRTNODE.dts134
-rw-r--r--target/linux/ramips/dts/WRTNODE2.dtsi134
-rw-r--r--target/linux/ramips/dts/WRTNODE2P.dts17
-rw-r--r--target/linux/ramips/dts/WRTNODE2R.dts17
-rw-r--r--target/linux/ramips/dts/WSR-1166.dts140
-rw-r--r--target/linux/ramips/dts/WSR-600.dts92
-rw-r--r--target/linux/ramips/dts/WT1520-4M.dts58
-rw-r--r--target/linux/ramips/dts/WT1520-8M.dts58
-rw-r--r--target/linux/ramips/dts/WT1520.dtsi48
-rw-r--r--target/linux/ramips/dts/WT3020-4M.dts142
-rw-r--r--target/linux/ramips/dts/WT3020-8M.dts142
-rw-r--r--target/linux/ramips/dts/WZR-AGL300NH.dts79
-rw-r--r--target/linux/ramips/dts/X5.dts126
-rw-r--r--target/linux/ramips/dts/X8.dts126
-rw-r--r--target/linux/ramips/dts/XDXRN502J.dts46
-rw-r--r--target/linux/ramips/dts/Y1.dts14
-rw-r--r--target/linux/ramips/dts/Y1.dtsi160
-rw-r--r--target/linux/ramips/dts/Y1S.dts76
-rw-r--r--target/linux/ramips/dts/YOUKU-YK1.dts171
-rw-r--r--target/linux/ramips/dts/ZBT-APE522II.dts143
-rw-r--r--target/linux/ramips/dts/ZBT-WA05.dts150
-rw-r--r--target/linux/ramips/dts/ZBT-WE826.dts234
-rw-r--r--target/linux/ramips/dts/ZBT-WG2626.dts153
-rw-r--r--target/linux/ramips/dts/ZBT-WG3526.dts153
-rw-r--r--target/linux/ramips/dts/ZBT-WR8305RT.dts152
-rw-r--r--target/linux/ramips/dts/ZTE-Q7.dts154
-rw-r--r--target/linux/ramips/dts/mt7620a.dtsi49
-rw-r--r--target/linux/ramips/dts/mt7620n.dtsi32
-rw-r--r--target/linux/ramips/dts/mt7621.dtsi73
-rw-r--r--target/linux/ramips/dts/mt7628an.dtsi57
-rw-r--r--target/linux/ramips/dts/rt2880.dtsi21
-rw-r--r--target/linux/ramips/dts/rt3050.dtsi50
-rw-r--r--target/linux/ramips/dts/rt3352.dtsi48
-rw-r--r--target/linux/ramips/dts/rt3883.dtsi48
-rw-r--r--target/linux/ramips/dts/rt5350.dtsi54
-rw-r--r--target/linux/ramips/image/mt7620.mk550
-rw-r--r--target/linux/ramips/image/mt7621.mk33
-rw-r--r--target/linux/ramips/image/mt7628.mk36
-rw-r--r--target/linux/ramips/image/mt7688.mk26
-rw-r--r--target/linux/ramips/image/rt288x.mk102
-rw-r--r--target/linux/ramips/modules.mk33
-rw-r--r--target/linux/ramips/mt7620/config-4.41
-rw-r--r--target/linux/ramips/mt7620/profiles/00-default.mk5
-rw-r--r--target/linux/ramips/mt7620/profiles/aigale.mk16
-rw-r--r--target/linux/ramips/mt7620/profiles/dovado.mk17
-rw-r--r--target/linux/ramips/mt7620/profiles/elecom.mk18
-rw-r--r--target/linux/ramips/mt7620/profiles/gli.mk36
-rw-r--r--target/linux/ramips/mt7620/profiles/hiwifi.mk47
-rw-r--r--target/linux/ramips/mt7620/profiles/linksys.mk16
-rw-r--r--target/linux/ramips/mt7620/profiles/mediatek.mk15
-rw-r--r--target/linux/ramips/mt7620/profiles/microduino.mk16
-rw-r--r--target/linux/ramips/mt7620/profiles/netgear.mk16
-rw-r--r--target/linux/ramips/mt7620/profiles/phicomm.mk16
-rw-r--r--target/linux/ramips/mt7620/profiles/planex.mk52
-rw-r--r--target/linux/ramips/mt7620/profiles/xiaomi.mk17
-rw-r--r--target/linux/ramips/mt7620/profiles/zbt.mk19
-rw-r--r--target/linux/ramips/mt7620/target.mk1
-rw-r--r--target/linux/ramips/mt7621/config-4.43
-rw-r--r--target/linux/ramips/mt7621/profiles/00-default.mk1
-rw-r--r--target/linux/ramips/mt7621/profiles/firefly.mk18
-rw-r--r--target/linux/ramips/mt7621/profiles/linksys.mk15
-rw-r--r--target/linux/ramips/mt7621/profiles/misc.mk20
-rw-r--r--target/linux/ramips/mt7621/profiles/mqmaker.mk20
-rw-r--r--target/linux/ramips/mt7621/profiles/netgear.mk17
-rw-r--r--target/linux/ramips/mt7621/profiles/netis.mk23
-rw-r--r--target/linux/ramips/mt7621/profiles/storylink.mk18
-rw-r--r--target/linux/ramips/mt7621/profiles/ubnt.mk18
-rw-r--r--target/linux/ramips/mt7621/profiles/zbt.mk31
-rw-r--r--target/linux/ramips/mt7621/target.mk4
-rw-r--r--target/linux/ramips/mt7628/config-4.44
-rw-r--r--target/linux/ramips/mt7628/profiles/00-default.mk5
-rw-r--r--target/linux/ramips/mt7628/profiles/xiaomi.mk18
-rw-r--r--target/linux/ramips/mt7628/target.mk1
-rw-r--r--target/linux/ramips/mt7688/profiles/00-default.mk5
-rw-r--r--target/linux/ramips/mt7688/profiles/01-mediatek.mk18
-rw-r--r--target/linux/ramips/mt7688/target.mk1
-rw-r--r--target/linux/ramips/patches-4.4/0043-spi-add-mt7621-support.patch5
-rw-r--r--target/linux/ramips/patches-4.4/0044-i2c-MIPS-adds-ralink-I2C-driver.patch441
-rw-r--r--target/linux/ramips/patches-4.4/0045-i2c-add-mt7621-driver.patch541
-rw-r--r--target/linux/ramips/patches-4.4/0047-DMA-ralink-add-rt2880-dma-engine.patch1550
-rw-r--r--target/linux/ramips/patches-4.4/0082-MIPS-ralink-fix-MT7628-pinmux-typos.patch32
-rw-r--r--target/linux/ramips/patches-4.4/0083-MIPS-ralink-fix-MT7628-wled_an-pinmux-gpio.patch35
-rw-r--r--target/linux/ramips/patches-4.4/0084-MIPS-ralink-add-MT7628-EPHY-LEDs-pinmux-support.patch151
-rw-r--r--target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch24
-rw-r--r--target/linux/ramips/patches-4.4/0509-net-next-mediatek-add-support-for-mt7621.patch5
-rw-r--r--target/linux/ramips/patches-4.4/0513-net-mediatek-add-swconfig-driver-for-gsw_mt762x.patch2
-rw-r--r--target/linux/ramips/patches-4.4/0601-net-mediatke-add-phy_ethtool_ioctl-support.patch2
-rw-r--r--target/linux/ramips/patches-4.4/0721-asoc-enable-wm8960-kconfig.patch11
-rw-r--r--target/linux/ramips/rt288x/config-4.41
-rw-r--r--target/linux/ramips/rt288x/profiles/00-default.mk16
-rw-r--r--target/linux/ramips/rt288x/profiles/asus.mk16
-rw-r--r--target/linux/ramips/rt288x/profiles/belkin.mk16
-rw-r--r--target/linux/ramips/rt305x/config-4.41
-rw-r--r--target/linux/ramips/rt305x/profiles/00-default.mk1
-rw-r--r--target/linux/ramips/rt305x/target.mk1
-rw-r--r--target/linux/ramips/rt3883/config-4.41
-rw-r--r--target/linux/ramips/rt3883/profiles/00-default.mk1
-rw-r--r--target/linux/ramips/rt3883/target.mk1
-rw-r--r--target/linux/realview/Makefile2
-rw-r--r--target/linux/realview/config-4.4297
-rw-r--r--tools/e2fsprogs/Makefile5
-rw-r--r--tools/e2fsprogs/patches/002-dont-build-e4defrag.patch2
-rw-r--r--tools/e2fsprogs/patches/003-openbsd-compat.patch12
-rw-r--r--tools/e2fsprogs/patches/004-freebsd-compat.patch2
-rw-r--r--tools/e2fsprogs/patches/005-darwin-compat.patch1
-rw-r--r--tools/firmware-utils/src/mktplinkfw2.c7
-rw-r--r--tools/firmware-utils/src/tplink-safeloader.c114
489 files changed, 23713 insertions, 18417 deletions
diff --git a/include/image.mk b/include/image.mk
index bc383e6ba8..a47a7087ef 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -325,6 +325,18 @@ define Build/netgear-dni
mv $@.new $@
endef
+define Build/tplink-safeloader
+ -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
+ -B $(TPLINK_BOARD_NAME) \
+ -V $(REVISION) \
+ -k $(word 1,$^) \
+ -r $@ \
+ -o $@.new \
+ -j \
+ $(wordlist 2,$(words $(1)),$(1)) \
+ $(if $(findstring sysupgrade,$(word 1,$(1))),-S) && mv $@.new $@ || rm -f $@
+endef
+
define Build/fit
$(TOPDIR)/scripts/mkits.sh \
-D $(DEVICE_NAME) -o $@.its -k $@ \
diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile
index a5b0f92310..fd41005aac 100644
--- a/package/boot/uboot-envtools/Makefile
+++ b/package/boot/uboot-envtools/Makefile
@@ -85,6 +85,10 @@ ifneq ($(CONFIG_TARGET_imx6),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
endif
+ifneq ($(CONFIG_TARGET_ipq806x),)
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_DATA) ./files/ipq $(1)/etc/uci-defaults/30_uboot-envtools
+endif
ifneq ($(CONFIG_TARGET_kirkwood),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
diff --git a/package/boot/uboot-envtools/files/ipq b/package/boot/uboot-envtools/files/ipq
new file mode 100755
index 0000000000..8cf0ddbb06
--- /dev/null
+++ b/package/boot/uboot-envtools/files/ipq
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Copyright (C) 2016 LEDE
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/ipq806x.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(ipq806x_board_name)
+
+
+case "$board" in
+"ea8500")
+ ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000"
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
diff --git a/package/boot/uboot-envtools/files/lantiq b/package/boot/uboot-envtools/files/lantiq
index 9f7ec8cf26..a0e0d916be 100644
--- a/package/boot/uboot-envtools/files/lantiq
+++ b/package/boot/uboot-envtools/files/lantiq
@@ -26,6 +26,11 @@ BTHOMEHUBV3A)
P2812HNUF1)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1"
;;
+WBMR300)
+ idx="$(find_mtd_index ubootconfig)"
+ [ -n "$idx" ] && \
+ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x2000" "0x1000" "2"
+ ;;
esac
config_load ubootenv
diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index a759bcc597..9ad5974348 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -24,7 +24,8 @@ linkits7688d | \
wsr-600 | \
wsr-1166 | \
br6425 | \
-miwifi-nano)
+miwifi-nano | \
+sk-wb8)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
;;
esac
diff --git a/package/boot/uboot-lantiq/Makefile b/package/boot/uboot-lantiq/Makefile
index 99b101f5f3..e224559af6 100644
--- a/package/boot/uboot-lantiq/Makefile
+++ b/package/boot/uboot-lantiq/Makefile
@@ -40,259 +40,278 @@ define uboot/arv4519pw_ram
TITLE:=U-Boot for Arcadyan arv4519pw (RAM)
SOC:=danube
DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_ARV4519PW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv4519pw_nor
TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV4519PW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv4519pw_brn
TITLE:=U-Boot for Arcadyan arv4519pw (BRN)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV4519PW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7510pw_ram
TITLE:=U-Boot for Arcadyan arv7510pw (RAM)
SOC:=danube
DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_ARV4510PW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7510pw_nor
TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV4510PW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7510pw_brn
TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV4510PW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7510pw22_ram
TITLE:=U-Boot for Arcadyan arv7510pw22 (RAM)
SOC:=danube
DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_ARV7510PW22
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7510pw22_nor
TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV7510PW22
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7510pw22_brn
TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV7510PW22
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7518pw_ram
TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
SOC:=danube
DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_ARV7518PW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7518pw_nor
TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV7518PW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7518pw_brn
TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV7518PW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv752dpw_ram
TITLE:=U-Boot for Arcadyan arv752dpw (RAM)
SOC:=danube
DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_ARV752DPW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv752dpw_nor
TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV752DPW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv752dpw_brn
TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV752DPW
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv752dpw22_ram
TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM)
SOC:=danube
DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_ARV752DPW22
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv752dpw22_nor
TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV752DPW22
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv752dpw22_brn
TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV752DPW22
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv8539pw22_ram
TITLE:=U-Boot for Speedport W 504V Typ A (RAM)
SOC:=danube
DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_ARV8539PW22
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv8539pw22_nor
TITLE:=U-Boot for Speedport W 504V Typ A (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV8539PW22
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv8539pw22_brn
TITLE:=U-Boot for Speedport W 504V Typ A (BRN)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ARV8539PW22
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/gigasx76x_ram
TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
SOC:=danube
DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_GIGASX76X
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/gigasx76x_nor
TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_GIGASX76X
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/acmp252_ram
TITLE:=U-Boot for AudioCodes MP-252 (RAM)
SOC:=danube
DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_ACMP252
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/acmp252_nor
TITLE:=U-Boot for AudioCodes MP-252 (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_ACMP252
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/easy50712_ram
TITLE:=U-Boot for Lantiq EASY50712 (RAM)
SOC:=danube
DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
- DEPS:=@TARGET_lantiq_xway_EASY50712
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/easy50712_nor
TITLE:=U-Boot for Lantiq EASY50712 (NOR)
SOC:=danube
- DEPS:=@TARGET_lantiq_xway_EASY50712
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/easy50712_norspl
TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
SOC:=danube
IMAGE:=u-boot.ltq.lzo.norspl
- DEPS:=@TARGET_lantiq_xway_EASY50712
+ DEPS:=@TARGET_lantiq_xway
endef
define uboot/easy80920_ram
TITLE:=U-Boot for Lantiq EASY80920 (RAM)
SOC:=vr9
DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
- DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/easy80920_nor
TITLE:=U-Boot for Lantiq EASY80920 (NOR)
SOC:=vr9
- DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/easy80920_norspl
TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
SOC:=vr9
IMAGE:=u-boot.ltq.lzo.norspl
- DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/easy80920_sfspl
TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
SOC:=vr9
IMAGE:=u-boot.ltq.lzo.sfspl
- DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/fb3370_eva
TITLE:=U-Boot for AVM FRITZ3370 (EVA)
SOC:=vr9
- DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/fb3370_ram
TITLE:=U-Boot for AVM FRITZ3370 (RAM)
SOC:=vr9
DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
- DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/fb3370_sfspl
TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL)
SOC:=vr9
IMAGE:=u-boot.ltq.lzo.sfspl
- DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/p2812hnufx_ram
TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM)
SOC:=vr9
DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
- DEPS:=@TARGET_lantiq_xrx200_P2812HNUF1||@TARGET_lantiq_xrx200_P2812HNUF3
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/p2812hnufx_nandspl
TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL)
SOC:=vr9
IMAGE:=u-boot.ltq.lzo.nandspl
- DEPS:=@TARGET_lantiq_xrx200_P2812HNUF1||@TARGET_lantiq_xrx200_P2812HNUF3
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/vgv7510kw22_brn
TITLE:=U-Boot for Arcadyan VGV7510KW22 (BRN)
SOC:=vr9
- DEPS:=@TARGET_lantiq_xrx200_VGV7510KW22NOR||@TARGET_lantiq_xrx200_VGV7510KW22BRN
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/vgv7510kw22_nor
TITLE:=U-Boot for Arcadyan VGV7510KW22 (NOR)
SOC:=vr9
- DEPS:=@TARGET_lantiq_xrx200_VGV7510KW22NOR||@TARGET_lantiq_xrx200_VGV7510KW22BRN
+ DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/vgv7510kw22_ram
TITLE:=U-Boot for Arcadyan VGV7510KW22 (RAM)
SOC:=vr9
DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h
- DEPS:=@TARGET_lantiq_xrx200_VGV7510KW22NOR||@TARGET_lantiq_xrx200_VGV7510KW22BRN
+ DEPS:=@TARGET_lantiq_xrx200
+endef
+
+define uboot/vgv7519_brn
+ TITLE:=U-Boot for Arcadyan VGV7519 (BRN)
+ SOC:=vr9
+ DEPS:=@TARGET_lantiq_xrx200
+endef
+
+define uboot/vgv7519_nor
+ TITLE:=U-Boot for Arcadyan VGV7519 (NOR)
+ SOC:=vr9
+ DEPS:=@TARGET_lantiq_xrx200
+endef
+
+define uboot/vgv7519_ram
+ TITLE:=U-Boot for Arcadyan VGV7519 (RAM)
+ SOC:=vr9
+ DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h
+ DEPS:=@TARGET_lantiq_xrx200
endef
UBOOTS:= \
@@ -309,7 +328,8 @@ UBOOTS:= \
easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl \
fb3370_eva fb3370_ram fb3370_sfspl \
p2812hnufx_ram p2812hnufx_nandspl \
- vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram
+ vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \
+ vgv7519_brn vgv7519_nor vgv7519_ram
define Package/uboot/template
define Package/uboot-lantiq-$(1)
@@ -330,18 +350,19 @@ define BuildUBootPackage
$(call Package/uboot/template,$(1),$(TITLE),$(DEPS))
endef
-define CopyVR9Firmware
- $(CP) $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
+define CompressVR9Firmware
+ $(STAGING_DIR_HOST)/bin/lzma e \
+ $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
$(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
endef
define Build/Prepare
$(call Build/Prepare/Default)
mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
- $(call CopyVR9Firmware,11g,1)
- $(call CopyVR9Firmware,11g,2)
- $(call CopyVR9Firmware,22f,1)
- $(call CopyVR9Firmware,22f,2)
+ $(call CompressVR9Firmware,11g,1)
+ $(call CompressVR9Firmware,11g,2)
+ $(call CompressVR9Firmware,22f,1)
+ $(call CompressVR9Firmware,22f,2)
endef
define Build/Configure
diff --git a/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch b/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch
index ef6eb1aaf9..5e6cf85985 100644
--- a/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch
+++ b/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch
@@ -2381,7 +2381,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+}
--- /dev/null
+++ b/arch/mips/cpu/mips32/vrx200/ebu.c
-@@ -0,0 +1,111 @@
+@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
+ *
@@ -2424,7 +2424,13 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#define ebu_region0_enable 0
+#endif
+
-+#if defined(CONFIG_LTQ_SUPPORT_NAND_FLASH)
++#if ((CONFIG_SYS_MAX_FLASH_BANKS == 2) && defined(CONFIG_LTQ_SUPPORT_NOR_FLASH) )
++#define ebu_region0_addrsel_mask 3
++#else
++#define ebu_region0_addrsel_mask 1
++#endif
++
++#if defined(CONFIG_LTQ_SUPPORT_NAND_FLASH) || ((CONFIG_SYS_MAX_FLASH_BANKS == 2) && defined(CONFIG_LTQ_SUPPORT_NOR_FLASH) )
+#define ebu_region1_enable 1
+#else
+#define ebu_region1_enable 0
@@ -2460,7 +2466,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+ * bank 0.
+ */
+ ltq_writel(&ltq_ebu_regs->addr_sel_0, LTQ_EBU_REGION0_BASE |
-+ EBU_ADDRSEL_MASK(1) | EBU_ADDRSEL_REGEN);
++ EBU_ADDRSEL_MASK(ebu_region0_addrsel_mask) | EBU_ADDRSEL_REGEN);
+
+ ltq_writel(&ltq_ebu_regs->con_0, EBU_CON_AGEN_DEMUX |
+ EBU_CON_WAIT_DIS | EBU_CON_PW_16BIT |
@@ -2474,17 +2480,26 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+ if (ebu_region1_enable) {
+ /*
+ * Map EBU region 1 to range 0x14000000-0x13ffffff and enable
-+ * region control. This supports NAND flash in bank 1.
++ * region control. This supports NAND flash in bank 1. (and NOR flash in bank 2)
+ */
+ ltq_writel(&ltq_ebu_regs->addr_sel_1, LTQ_EBU_REGION1_BASE |
+ EBU_ADDRSEL_MASK(3) | EBU_ADDRSEL_REGEN);
+
-+ ltq_writel(&ltq_ebu_regs->con_1, EBU_CON_AGEN_DEMUX |
-+ EBU_CON_SETUP | EBU_CON_WAIT_DIS | EBU_CON_PW_8BIT |
-+ EBU_CON_ALEC(3) | EBU_CON_BCGEN_INTEL |
-+ EBU_CON_WAITWRC(2) | EBU_CON_WAITRDC(2) |
-+ EBU_CON_HOLDC(1) | EBU_CON_RECOVC(1) |
-+ EBU_CON_CMULT_4);
++ if (ebu_region0_addrsel_mask == 1)
++ ltq_writel(&ltq_ebu_regs->con_1, EBU_CON_AGEN_DEMUX |
++ EBU_CON_SETUP | EBU_CON_WAIT_DIS | EBU_CON_PW_8BIT |
++ EBU_CON_ALEC(3) | EBU_CON_BCGEN_INTEL |
++ EBU_CON_WAITWRC(2) | EBU_CON_WAITRDC(2) |
++ EBU_CON_HOLDC(1) | EBU_CON_RECOVC(1) |
++ EBU_CON_CMULT_4);
++
++ if (ebu_region0_addrsel_mask == 3)
++ ltq_writel(&ltq_ebu_regs->con_1, EBU_CON_AGEN_DEMUX |
++ EBU_CON_WAIT_DIS | EBU_CON_PW_16BIT |
++ EBU_CON_ALEC(3) | EBU_CON_BCGEN_INTEL |
++ EBU_CON_WAITWRC(7) | EBU_CON_WAITRDC(3) |
++ EBU_CON_HOLDC(3) | EBU_CON_RECOVC(3) |
++ EBU_CON_CMULT_16);
+ } else
+ ltq_clrbits(&ltq_ebu_regs->addr_sel_1, EBU_ADDRSEL_REGEN);
+}
@@ -2495,7 +2510,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+}
--- /dev/null
+++ b/arch/mips/cpu/mips32/vrx200/gphy.c
-@@ -0,0 +1,58 @@
+@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
+ *
@@ -2506,17 +2521,23 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#include <asm/lantiq/io.h>
+#include <asm/arch/soc.h>
+#include <asm/arch/gphy.h>
++#include <lzma/LzmaTypes.h>
++#include <lzma/LzmaDec.h>
++#include <lzma/LzmaTools.h>
+
-+static inline void ltq_gphy_copy(const void *fw_start, const void *fw_end,
++static inline void ltq_gphy_decompress(const void *fw_start, const void *fw_end,
+ ulong dst_addr)
+{
+ const ulong fw_len = (ulong) fw_end - (ulong) fw_start;
+ const ulong addr = CKSEG1ADDR(dst_addr);
+
-+ debug("ltq_gphy_copy: addr %08lx, fw_start %p, fw_end %p\n",
++ debug("ltq_gphy_decompress: addr %08lx, fw_start %p, fw_end %p\n",
+ addr, fw_start, fw_end);
+
-+ memcpy((void *) addr, fw_start, fw_len);
++ SizeT lzma_len = 65536;
++ int ret = lzmaBuffToBuffDecompress(
++ (unsigned char *)addr, &lzma_len,
++ (unsigned char *)fw_start, fw_len);
+}
+
+void ltq_gphy_phy11g_a1x_load(ulong addr)
@@ -2524,8 +2545,9 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+ extern ulong __ltq_fw_phy11g_a1x_start;
+ extern ulong __ltq_fw_phy11g_a1x_end;
+
-+ ltq_gphy_copy(&__ltq_fw_phy11g_a1x_start, &__ltq_fw_phy11g_a1x_end,
-+ addr);
++ ltq_gphy_decompress(&__ltq_fw_phy11g_a1x_start,
++ &__ltq_fw_phy11g_a1x_end,
++ addr);
+}
+
+void ltq_gphy_phy11g_a2x_load(ulong addr)
@@ -2533,8 +2555,9 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+ extern ulong __ltq_fw_phy11g_a2x_start;
+ extern ulong __ltq_fw_phy11g_a2x_end;
+
-+ ltq_gphy_copy(&__ltq_fw_phy11g_a2x_start, &__ltq_fw_phy11g_a2x_end,
-+ addr);
++ ltq_gphy_decompress(&__ltq_fw_phy11g_a2x_start,
++ &__ltq_fw_phy11g_a2x_end,
++ addr);
+}
+
+void ltq_gphy_phy22f_a1x_load(ulong addr)
@@ -2542,8 +2565,9 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+ extern ulong __ltq_fw_phy22f_a1x_start;
+ extern ulong __ltq_fw_phy22f_a1x_end;
+
-+ ltq_gphy_copy(&__ltq_fw_phy22f_a1x_start, &__ltq_fw_phy22f_a1x_end,
-+ addr);
++ ltq_gphy_decompress(&__ltq_fw_phy22f_a1x_start,
++ &__ltq_fw_phy22f_a1x_end,
++ addr);
+}
+
+void ltq_gphy_phy22f_a2x_load(ulong addr)
@@ -2551,8 +2575,9 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+ extern ulong __ltq_fw_phy22f_a2x_start;
+ extern ulong __ltq_fw_phy22f_a2x_end;
+
-+ ltq_gphy_copy(&__ltq_fw_phy22f_a2x_start, &__ltq_fw_phy22f_a2x_end,
-+ addr);
++ ltq_gphy_decompress(&__ltq_fw_phy22f_a2x_start,
++ &__ltq_fw_phy22f_a2x_end,
++ addr);
+}
--- /dev/null
+++ b/arch/mips/cpu/mips32/vrx200/gphy_fw.S
@@ -3450,7 +3475,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#endif /* __DANUBE_SOC_H__ */
--- /dev/null
+++ b/arch/mips/include/asm/arch-vrx200/config.h
-@@ -0,0 +1,184 @@
+@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2010 Lantiq Deutschland GmbH
+ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
@@ -3538,9 +3563,12 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+
+/* FLASH driver */
+#if defined(CONFIG_LTQ_SUPPORT_NOR_FLASH)
++#ifndef CONFIG_SYS_MAX_FLASH_BANKS
+#define CONFIG_SYS_MAX_FLASH_BANKS 1
++#endif
+#define CONFIG_SYS_MAX_FLASH_SECT 256
+#define CONFIG_SYS_FLASH_BASE 0xB0000000
++#define CONFIG_SYS_FLASH2_BASE 0xB4000000
+#define CONFIG_FLASH_16BIT
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
diff --git a/package/boot/uboot-lantiq/patches/0021-MIPS-vrx200-add-NAND-SPL-support.patch b/package/boot/uboot-lantiq/patches/0021-MIPS-vrx200-add-NAND-SPL-support.patch
index 6c9f14b043..8296f2c75e 100644
--- a/package/boot/uboot-lantiq/patches/0021-MIPS-vrx200-add-NAND-SPL-support.patch
+++ b/package/boot/uboot-lantiq/patches/0021-MIPS-vrx200-add-NAND-SPL-support.patch
@@ -19,7 +19,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
endif
--- a/arch/mips/include/asm/arch-vrx200/config.h
+++ b/arch/mips/include/asm/arch-vrx200/config.h
-@@ -164,7 +164,7 @@
+@@ -167,7 +167,7 @@
#define CONFIG_SYS_TEXT_BASE 0xB0000000
#endif
diff --git a/package/boot/uboot-lantiq/patches/0037-MIPS-add-board-support-for-Arcadyan-ARV752DPW.patch b/package/boot/uboot-lantiq/patches/0037-MIPS-add-board-support-for-Arcadyan-ARV752DPW.patch
index 676ef12a8a..7c75fc4dd1 100644
--- a/package/boot/uboot-lantiq/patches/0037-MIPS-add-board-support-for-Arcadyan-ARV752DPW.patch
+++ b/package/boot/uboot-lantiq/patches/0037-MIPS-add-board-support-for-Arcadyan-ARV752DPW.patch
@@ -195,7 +195,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+
+/* Switch devices */
+#define CONFIG_SWITCH_MULTI
-+#define CONFIG_SWITCH_RTL8206
++#define CONFIG_SWITCH_RTL8306
+
+/* Environment */
+#if defined(CONFIG_SYS_BOOT_NOR)
diff --git a/package/boot/uboot-lantiq/patches/0043-MIPS-add-board-support-for-Arcadyan-VGV7510KW22.patch b/package/boot/uboot-lantiq/patches/0043-MIPS-add-board-support-for-Arcadyan-VGV7510KW22.patch
index adb894f018..14758fd8fc 100644
--- a/package/boot/uboot-lantiq/patches/0043-MIPS-add-board-support-for-Arcadyan-VGV7510KW22.patch
+++ b/package/boot/uboot-lantiq/patches/0043-MIPS-add-board-support-for-Arcadyan-VGV7510KW22.patch
@@ -30,7 +30,7 @@
+#########################################################################
--- /dev/null
+++ b/board/arcadyan/vgv7510kw22/vgv7510kw22.c
-@@ -0,0 +1,136 @@
+@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2015 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+ *
@@ -38,7 +38,6 @@
+ */
+
+#include <common.h>
-+#include <spi.h>
+#include <asm/gpio.h>
+#include <asm/lantiq/eth.h>
+#include <asm/lantiq/chipid.h>
@@ -67,12 +66,8 @@
+
+static void gpio_init(void)
+{
-+ /* SPI CS 0.4 to serial flash */
-+ gpio_direction_output(10, 1);
-+
+ /* Turn on the green power LED */
+ gpio_direction_output(GPIO_POWER_GREEN, 0);
-+ gpio_set_value(GPIO_POWER_GREEN, 0);
+}
+
+int board_early_init_f(void)
@@ -134,39 +129,6 @@
+
+ return ltq_eth_initialize(&eth_board_config);
+}
-+
-+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-+{
-+ if (bus)
-+ return 0;
-+
-+ if (cs == 4)
-+ return 1;
-+
-+ return 0;
-+}
-+
-+void spi_cs_activate(struct spi_slave *slave)
-+{
-+ switch (slave->cs) {
-+ case 4:
-+ gpio_set_value(10, 0);
-+ break;
-+ default:
-+ break;
-+ }
-+}
-+
-+void spi_cs_deactivate(struct spi_slave *slave)
-+{
-+ switch (slave->cs) {
-+ case 4:
-+ gpio_set_value(10, 1);
-+ break;
-+ default:
-+ break;
-+ }
-+}
--- /dev/null
+++ b/board/arcadyan/vgv7510kw22/config.mk
@@ -0,0 +1,7 @@
@@ -220,7 +182,7 @@
+#define MC_CCR28_VALUE 0x0
+#define MC_CCR29_VALUE 0x0
+#define MC_CCR30_VALUE 0x798
-+#define MC_CCR31_VALUE 0x0
++#define MC_CCR31_VALUE 0x2040F
+#define MC_CCR32_VALUE 0x0
+#define MC_CCR33_VALUE 0x650000
+#define MC_CCR34_VALUE 0x200C8
@@ -236,7 +198,7 @@
+#define MC_CCR44_VALUE 0x566504
+#define MC_CCR45_VALUE 0x565F17
+#define MC_CCR46_VALUE 0x565F17
-+#define MC_CCR47_VALUE 0x0
++#define MC_CCR47_VALUE 0x2040F
+#define MC_CCR48_VALUE 0x0
+#define MC_CCR49_VALUE 0x0
+#define MC_CCR50_VALUE 0x0
@@ -253,10 +215,10 @@
+#define MC_CCR61_VALUE 0x4
--- a/boards.cfg
+++ b/boards.cfg
-@@ -542,6 +542,9 @@
+@@ -531,6 +531,9 @@ Active mips mips32 incai
+ Active mips mips32 incaip - incaip incaip_100MHz incaip:CPU_CLOCK_RATE=100000000 Wolfgang Denk <wd@denx.de>
Active mips mips32 incaip - incaip incaip_133MHz incaip:CPU_CLOCK_RATE=133000000 Wolfgang Denk <wd@denx.de>
Active mips mips32 incaip - incaip incaip_150MHz incaip:CPU_CLOCK_RATE=150000000 Wolfgang Denk <wd@denx.de>
- Active mips mips32 vrx200 arcadyan easybox904 easybox904_ram easybox904:SYS_BOOT_RAM Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+Active mips mips32 vrx200 arcadyan vgv7510kw22 vgv7510kw22_brn vgv7510kw22:SYS_BOOT_BRN Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+Active mips mips32 vrx200 arcadyan vgv7510kw22 vgv7510kw22_nor vgv7510kw22:SYS_BOOT_NOR Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+Active mips mips32 vrx200 arcadyan vgv7510kw22 vgv7510kw22_ram vgv7510kw22:SYS_BOOT_RAM Martin Blumenstingl <martin.blumenstingl@googlemail.com>
@@ -265,7 +227,7 @@
Active mips mips32 vrx200 avm fb3370 fb3370_sfspl fb3370:SYS_BOOT_SFSPL Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
--- /dev/null
+++ b/include/configs/vgv7510kw22.h
-@@ -0,0 +1,78 @@
+@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2015 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+ *
@@ -286,33 +248,14 @@
+
+#define CONFIG_LTQ_SUPPORT_NOR_FLASH /* Have a parallel NOR flash */
+
-+#define CONFIG_LTQ_SUPPORT_SPI_FLASH
-+#define CONFIG_SPI_FLASH_MACRONIX /* Have a MX29GL128EL parallel flash */
-+
-+#define CONFIG_LTQ_SUPPORT_SPL_SPI_FLASH /* Build SPI flash SPL */
-+#define CONFIG_LTQ_SPL_COMP_LZO /* Compress SPL with LZO */
-+#define CONFIG_LTQ_SPL_CONSOLE /* Enable SPL console */
-+
-+#define CONFIG_SPL_SPI_BUS 0
-+#define CONFIG_SPL_SPI_CS 4
-+#define CONFIG_SPL_SPI_MAX_HZ 25000000
-+#define CONFIG_SPL_SPI_MODE 0
-+
-+#define CONFIG_LTQ_SUPPORT_SPL_NOR_FLASH /* Build NOR flash SPL */
-+
+#define CONFIG_SYS_BOOTM_LEN 0x1000000 /* 16 MB */
+
-+/* Environment */
-+#define CONFIG_ENV_SPI_BUS CONFIG_SPL_SPI_BUS
-+#define CONFIG_ENV_SPI_CS CONFIG_SPL_SPI_CS
-+#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SPL_SPI_MAX_HZ
-+#define CONFIG_ENV_SPI_MODE CONFIG_SPL_SPI_MODE
-+
+#if defined(CONFIG_SYS_BOOT_BRN)
+#define CONFIG_SYS_TEXT_BASE 0x80002000
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_DISABLE_CACHE
+#define CONFIG_ENV_IS_NOWHERE
++#define CONFIG_ENV_OVERWRITE 1
+#elif defined(CONFIG_SYS_BOOT_NOR)
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_OVERWRITE
diff --git a/package/boot/uboot-lantiq/patches/0114-MIPS-add-board-support-for-Arcadyan-VGV7519.patch b/package/boot/uboot-lantiq/patches/0114-MIPS-add-board-support-for-Arcadyan-VGV7519.patch
new file mode 100644
index 0000000000..952bdce0cc
--- /dev/null
+++ b/package/boot/uboot-lantiq/patches/0114-MIPS-add-board-support-for-Arcadyan-VGV7519.patch
@@ -0,0 +1,288 @@
+--- /dev/null
++++ b/board/arcadyan/vgv7519/Makefile
+@@ -0,0 +1,27 @@
++#
++# Copyright (C) 2000-2011 Wolfgang Denk, DENX Software Engineering, wd@denx.de
++#
++# SPDX-License-Identifier: GPL-2.0+
++#
++
++include $(TOPDIR)/config.mk
++
++LIB = $(obj)lib$(BOARD).o
++
++COBJS = $(BOARD).o
++
++SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
++OBJS := $(addprefix $(obj),$(COBJS))
++SOBJS := $(addprefix $(obj),$(SOBJS))
++
++$(LIB): $(obj).depend $(OBJS) $(SOBJS)
++ $(call cmd_link_o_target, $(OBJS) $(SOBJS))
++
++#########################################################################
++
++# defines $(obj).depend target
++include $(SRCTREE)/rules.mk
++
++sinclude $(obj).depend
++
++#########################################################################
+--- /dev/null
++++ b/board/arcadyan/vgv7519/config.mk
+@@ -0,0 +1,7 @@
++#
++# Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
++#
++# SPDX-License-Identifier: GPL-2.0+
++#
++
++PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(BOARDDIR)
+--- /dev/null
++++ b/board/arcadyan/vgv7519/ddr_settings.h
+@@ -0,0 +1,70 @@
++/*
++ * Copyright (C) 2016 Mathias Kresin <dev@kresin.me>
++ *
++ * The values have been extracted from original brnboot.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++#define MC_CCR00_VALUE 0x101
++#define MC_CCR01_VALUE 0x1000100
++#define MC_CCR02_VALUE 0x1010000
++#define MC_CCR03_VALUE 0x100
++#define MC_CCR04_VALUE 0x1000000
++#define MC_CCR05_VALUE 0x1000101
++#define MC_CCR06_VALUE 0x1000100
++#define MC_CCR07_VALUE 0x1010000
++#define MC_CCR08_VALUE 0x1000101
++#define MC_CCR09_VALUE 0x0
++#define MC_CCR10_VALUE 0x2000100
++#define MC_CCR11_VALUE 0x2000401
++#define MC_CCR12_VALUE 0x30000
++#define MC_CCR13_VALUE 0x202
++#define MC_CCR14_VALUE 0x7080A0F
++#define MC_CCR15_VALUE 0x2040F
++#define MC_CCR16_VALUE 0x40000
++#define MC_CCR17_VALUE 0x70102
++#define MC_CCR18_VALUE 0x4020002
++#define MC_CCR19_VALUE 0x30302
++#define MC_CCR20_VALUE 0x8000700
++#define MC_CCR21_VALUE 0x40F020A
++#define MC_CCR22_VALUE 0x0
++#define MC_CCR23_VALUE 0xC020000
++#define MC_CCR24_VALUE 0x4401B04
++#define MC_CCR25_VALUE 0x0
++#define MC_CCR26_VALUE 0x0
++#define MC_CCR27_VALUE 0x6420000
++#define MC_CCR28_VALUE 0x0
++#define MC_CCR29_VALUE 0x0
++#define MC_CCR30_VALUE 0x798
++#define MC_CCR31_VALUE 0x2040F
++#define MC_CCR32_VALUE 0x0
++#define MC_CCR33_VALUE 0x650000
++#define MC_CCR34_VALUE 0x200C8
++#define MC_CCR35_VALUE 0x1D445D
++#define MC_CCR36_VALUE 0xC8
++#define MC_CCR37_VALUE 0xC351
++#define MC_CCR38_VALUE 0x0
++#define MC_CCR39_VALUE 0x141F04
++#define MC_CCR40_VALUE 0x142704
++#define MC_CCR41_VALUE 0x141B42
++#define MC_CCR42_VALUE 0x141B42
++#define MC_CCR43_VALUE 0x566504
++#define MC_CCR44_VALUE 0x566504
++#define MC_CCR45_VALUE 0x565F17
++#define MC_CCR46_VALUE 0x565F17
++#define MC_CCR47_VALUE 0x2040F
++#define MC_CCR48_VALUE 0x0
++#define MC_CCR49_VALUE 0x0
++#define MC_CCR50_VALUE 0x0
++#define MC_CCR51_VALUE 0x0
++#define MC_CCR52_VALUE 0x133
++#define MC_CCR53_VALUE 0xF3014B27
++#define MC_CCR54_VALUE 0xF3014B27
++#define MC_CCR55_VALUE 0xF3014B27
++#define MC_CCR56_VALUE 0xF3014B27
++#define MC_CCR57_VALUE 0x7800301
++#define MC_CCR58_VALUE 0x7800301
++#define MC_CCR59_VALUE 0x7800301
++#define MC_CCR60_VALUE 0x7800301
++#define MC_CCR61_VALUE 0x4
+--- /dev/null
++++ b/board/arcadyan/vgv7519/vgv7519.c
+@@ -0,0 +1,95 @@
++/*
++ * This file is released under the terms of GPL v2 and any later version.
++ * See the file COPYING in the root directory of the source tree for details.
++ *
++ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
++ */
++
++#include <common.h>
++#include <asm/gpio.h>
++#include <asm/lantiq/eth.h>
++#include <asm/lantiq/chipid.h>
++#include <asm/lantiq/cpu.h>
++#include <asm/arch/gphy.h>
++
++#if defined(CONFIG_SYS_BOOT_RAM)
++#define do_gpio_init 1
++#define do_pll_init 0
++#define do_dcdc_init 1
++#elif defined(CONFIG_SYS_BOOT_NOR)
++#define do_gpio_init 1
++#define do_pll_init 1
++#define do_dcdc_init 1
++#else
++#define do_gpio_init 0
++#define do_pll_init 0
++#define do_dcdc_init 1
++#endif
++
++#define GPIO_GPHY_RESET 47
++
++static void gpio_init(void)
++{
++ /* Disable reset on external eth PHY */
++ gpio_direction_output(GPIO_GPHY_RESET, 1);
++}
++
++int board_early_init_f(void)
++{
++ if (do_gpio_init)
++ gpio_init();
++
++ if (do_pll_init)
++ ltq_pll_init();
++
++ if (do_dcdc_init)
++ ltq_dcdc_init(0x7F);
++
++ return 0;
++}
++
++int checkboard(void)
++{
++ puts("Board: " CONFIG_BOARD_NAME "\n");
++ ltq_chip_print_info();
++
++ return 0;
++}
++
++static const struct ltq_eth_port_config eth_port_config[] = {
++ /* GMAC0: external Lantiq PEF7071 10/100/1000 PHY for LAN port 0 */
++ { 0, 0x0, LTQ_ETH_PORT_PHY, PHY_INTERFACE_MODE_RGMII },
++ /* GMAC1: external Lantiq PEF7071 10/100/1000 PHY for LAN port 1 */
++ { 1, 0x1, LTQ_ETH_PORT_PHY, PHY_INTERFACE_MODE_RGMII },
++ /* GMAC2: internal GPHY0 with 10/100/1000 firmware for LAN port 2 */
++ { 2, 0x11, LTQ_ETH_PORT_PHY, PHY_INTERFACE_MODE_GMII },
++ /* GMAC3: unused */
++ { 3, 0x0, LTQ_ETH_PORT_NONE, PHY_INTERFACE_MODE_NONE },
++ /* GMAC4: internal GPHY1 with 10/100/1000 firmware for LAN port 3 */
++ { 4, 0x13, LTQ_ETH_PORT_PHY, PHY_INTERFACE_MODE_GMII },
++ /* GMAC5: external Lantiq PEF7071 10/100/1000 PHY for WANoE port */
++ { 5, 0x5, LTQ_ETH_PORT_PHY, PHY_INTERFACE_MODE_RGMII },
++};
++
++static const struct ltq_eth_board_config eth_board_config = {
++ .ports = eth_port_config,
++ .num_ports = ARRAY_SIZE(eth_port_config),
++};
++
++int board_eth_init(bd_t * bis)
++{
++ const enum ltq_gphy_clk clk = LTQ_GPHY_CLK_25MHZ_PLL0;
++ const ulong fw_addr = 0x80FF0000;
++
++ if (ltq_chip_version_get() == 1)
++ ltq_gphy_phy22f_a1x_load(fw_addr);
++ else
++ ltq_gphy_phy22f_a2x_load(fw_addr);
++
++ ltq_cgu_gphy_clk_src(clk);
++
++ ltq_rcu_gphy_boot(0, fw_addr);
++ ltq_rcu_gphy_boot(1, fw_addr);
++
++ return ltq_eth_initialize(&eth_board_config);
++}
+--- a/boards.cfg
++++ b/boards.cfg
+@@ -537,6 +537,9 @@ Active mips mips32 incai
+ Active mips mips32 vrx200 arcadyan vgv7510kw22 vgv7510kw22_brn vgv7510kw22:SYS_BOOT_BRN Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+ Active mips mips32 vrx200 arcadyan vgv7510kw22 vgv7510kw22_nor vgv7510kw22:SYS_BOOT_NOR Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+ Active mips mips32 vrx200 arcadyan vgv7510kw22 vgv7510kw22_ram vgv7510kw22:SYS_BOOT_RAM Martin Blumenstingl <martin.blumenstingl@googlemail.com>
++Active mips mips32 vrx200 arcadyan vgv7519 vgv7519_brn vgv7519:SYS_BOOT_BRN Mathias Kresin <dev@kresin.me>
++Active mips mips32 vrx200 arcadyan vgv7519 vgv7519_nor vgv7519:SYS_BOOT_NOR Eddi De Pieri <eddi@depieri.net>
++Active mips mips32 vrx200 arcadyan vgv7519 vgv7519_ram vgv7519:SYS_BOOT_RAM Eddi De Pieri <eddi@depieri.net>
+ Active mips mips32 vrx200 avm fb3370 fb3370_eva fb3370:SYS_BOOT_EVA Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+ Active mips mips32 vrx200 avm fb3370 fb3370_ram fb3370:SYS_BOOT_RAM Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+ Active mips mips32 vrx200 avm fb3370 fb3370_sfspl fb3370:SYS_BOOT_SFSPL Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+--- /dev/null
++++ b/include/configs/vgv7519.h
+@@ -0,0 +1,62 @@
++/*
++ * This file is released under the terms of GPL v2 and any later version.
++ * See the file COPYING in the root directory of the source tree for details.
++ *
++ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
++ */
++
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++#define CONFIG_MACH_TYPE "VGV7519"
++#define CONFIG_IDENT_STRING " "CONFIG_MACH_TYPE
++#define CONFIG_BOARD_NAME "Arcadyan VGV7519"
++
++/* Configure SoC */
++#define CONFIG_LTQ_SUPPORT_UART /* Enable ASC and UART */
++
++#define CONFIG_LTQ_SUPPORT_ETHERNET /* Enable ethernet */
++
++#define CONFIG_LTQ_SUPPORT_NOR_FLASH /* Have a parallel NOR flash */
++
++#define CONFIG_SYS_MAX_FLASH_BANKS 2 /* max number of memory banks */
++#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH2_BASE }
++
++/* Environment */
++#if defined(CONFIG_SYS_BOOT_BRN)
++#define CONFIG_SYS_TEXT_BASE 0x80002000
++#define CONFIG_SKIP_LOWLEVEL_INIT
++#define CONFIG_SYS_DISABLE_CACHE
++#define CONFIG_ENV_IS_NOWHERE
++#define CONFIG_ENV_OVERWRITE 1
++#elif defined(CONFIG_SYS_BOOT_NOR)
++#define CONFIG_ENV_IS_IN_FLASH
++#define CONFIG_ENV_OVERWRITE
++#define CONFIG_ENV_OFFSET (384 * 1024)
++#define CONFIG_ENV_SECT_SIZE (64 * 1024)
++#else
++#define CONFIG_ENV_IS_NOWHERE
++#endif
++
++#define CONFIG_ENV_SIZE (8 * 1024)
++
++#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
++
++/* Console */
++#define CONFIG_LTQ_ADVANCED_CONSOLE
++#define CONFIG_BAUDRATE 115200
++#define CONFIG_CONSOLE_ASC 1
++#define CONFIG_CONSOLE_DEV "ttyLTQ1"
++
++/* Pull in default board configs for Lantiq XWAY VRX200 */
++#include <asm/lantiq/config.h>
++#include <asm/arch/config.h>
++
++/* Pull in default OpenWrt configs for Lantiq SoC */
++#include "openwrt-lantiq-common.h"
++
++#define CONFIG_EXTRA_ENV_SETTINGS \
++ CONFIG_ENV_LANTIQ_DEFAULTS \
++ "kernel_addr=0xB0080000\0"
++
++#endif /* __CONFIG_H */
diff --git a/package/kernel/lantiq/ltq-adsl-fw/Makefile b/package/kernel/lantiq/ltq-adsl-fw/Makefile
index a26e595023..839ae715fe 100644
--- a/package/kernel/lantiq/ltq-adsl-fw/Makefile
+++ b/package/kernel/lantiq/ltq-adsl-fw/Makefile
@@ -30,15 +30,15 @@ define Package/kmod-ltq-adsl-fw-template
SOC:=$(2)
ANNEX:=$(1)
URL:=http://www.lantiq.com/
- DEPENDS:=@TARGET_lantiq_$(3) +kmod-ltq-adsl-$(2)
+ DEPENDS:=@$(3) +kmod-ltq-adsl-$(2)
endef
-Package/kmod-ltq-adsl-danube-fw-a=$(call Package/kmod-ltq-adsl-fw-template,a,danube,xway)
-Package/kmod-ltq-adsl-danube-fw-b=$(call Package/kmod-ltq-adsl-fw-template,b,danube,xway)
-Package/kmod-ltq-adsl-ar9-fw-a=$(call Package/kmod-ltq-adsl-fw-template,a,ar9,xway)
-Package/kmod-ltq-adsl-ar9-fw-b=$(call Package/kmod-ltq-adsl-fw-template,b,ar9,xway)
-Package/kmod-ltq-adsl-ase-fw-a=$(call Package/kmod-ltq-adsl-fw-template,a,ase,ase)
-Package/kmod-ltq-adsl-ase-fw-b=$(call Package/kmod-ltq-adsl-fw-template,b,ase,ase)
+Package/kmod-ltq-adsl-danube-fw-a=$(call Package/kmod-ltq-adsl-fw-template,a,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
+Package/kmod-ltq-adsl-danube-fw-b=$(call Package/kmod-ltq-adsl-fw-template,b,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
+Package/kmod-ltq-adsl-ar9-fw-a=$(call Package/kmod-ltq-adsl-fw-template,a,ar9,TARGET_lantiq_xway)
+Package/kmod-ltq-adsl-ar9-fw-b=$(call Package/kmod-ltq-adsl-fw-template,b,ar9,TARGET_lantiq_xway)
+Package/kmod-ltq-adsl-ase-fw-a=$(call Package/kmod-ltq-adsl-fw-template,a,ase,TARGET_lantiq_ase)
+Package/kmod-ltq-adsl-ase-fw-b=$(call Package/kmod-ltq-adsl-fw-template,b,ase,TARGET_lantiq_ase)
define Build/Compile
endef
diff --git a/package/kernel/lantiq/ltq-adsl-mei/Makefile b/package/kernel/lantiq/ltq-adsl-mei/Makefile
index a76591c257..b841aa15df 100644
--- a/package/kernel/lantiq/ltq-adsl-mei/Makefile
+++ b/package/kernel/lantiq/ltq-adsl-mei/Makefile
@@ -22,14 +22,14 @@ define KernelPackage/ltq-adsl-mei-template
TITLE:=mei driver for $(1)
URL:=http://www.lantiq.com/
VARIANT:=$(1)
- DEPENDS:=@TARGET_lantiq_$(2)
+ DEPENDS:=@$(2)
FILES:=$(PKG_BUILD_DIR)/ltq_mei_$(1).ko
AUTOLOAD:=$(call AutoLoad,50,ltq_mei_$(1))
endef
-KernelPackage/ltq-adsl-danube-mei=$(call KernelPackage/ltq-adsl-mei-template,danube,xway)
-KernelPackage/ltq-adsl-ar9-mei=$(call KernelPackage/ltq-adsl-mei-template,ar9,xway)
-KernelPackage/ltq-adsl-ase-mei=$(call KernelPackage/ltq-adsl-mei-template,ase,ase)
+KernelPackage/ltq-adsl-danube-mei=$(call KernelPackage/ltq-adsl-mei-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
+KernelPackage/ltq-adsl-ar9-mei=$(call KernelPackage/ltq-adsl-mei-template,ar9,TARGET_lantiq_xway)
+KernelPackage/ltq-adsl-ase-mei=$(call KernelPackage/ltq-adsl-mei-template,ase,TARGET_lantiq_ase)
define Build/Prepare
$(INSTALL_DIR) $(PKG_BUILD_DIR)/
diff --git a/package/kernel/lantiq/ltq-adsl/Makefile b/package/kernel/lantiq/ltq-adsl/Makefile
index 26c931e2a9..bd0dd7c3e7 100644
--- a/package/kernel/lantiq/ltq-adsl/Makefile
+++ b/package/kernel/lantiq/ltq-adsl/Makefile
@@ -30,14 +30,14 @@ define KernelPackage/ltq-adsl-template
TITLE:=adsl driver for $(1)
URL:=http://www.lantiq.com/
VARIANT:=$(1)
- DEPENDS:=@TARGET_lantiq_$(2) +kmod-ltq-adsl-$(1)-mei
+ DEPENDS:=@$(2) +kmod-ltq-adsl-$(1)-mei
FILES:=$(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko
AUTOLOAD:=$(call AutoLoad,51,drv_dsl_cpe_api)
endef
-KernelPackage/ltq-adsl-danube=$(call KernelPackage/ltq-adsl-template,danube,xway)
-KernelPackage/ltq-adsl-ar9=$(call KernelPackage/ltq-adsl-template,ar9,xway)
-KernelPackage/ltq-adsl-ase=$(call KernelPackage/ltq-adsl-template,ase,ase)
+KernelPackage/ltq-adsl-danube=$(call KernelPackage/ltq-adsl-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
+KernelPackage/ltq-adsl-ar9=$(call KernelPackage/ltq-adsl-template,ar9,TARGET_lantiq_xway)
+KernelPackage/ltq-adsl-ase=$(call KernelPackage/ltq-adsl-template,ase,TARGET_lantiq_ase)
define KernelPackage/ltq-dsl/config
source "$(SOURCE)/Config.in"
diff --git a/package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch b/package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch
index 80f085492c..1d1e5669ac 100644
--- a/package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch
+++ b/package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch
@@ -1,6 +1,6 @@
--- a/src/include/drv_dsl_cpe_os_linux.h
+++ b/src/include/drv_dsl_cpe_os_linux.h
-@@ -214,12 +214,35 @@ static inline int dsl_mutex_lock(struct
+@@ -214,12 +214,25 @@ static inline int dsl_mutex_lock(struct
#define DSL_DRV_MUTEX_LOCK(id) down_interruptible(&(id))
#define DSL_DRV_MUTEX_UNLOCK(id) up(&(id))
#endif
@@ -8,21 +8,11 @@
+static inline long
+ugly_hack_sleep_on_timeout(wait_queue_head_t *q, long timeout)
+{
-+ unsigned long flags;
-+ wait_queue_t wait;
-+
-+ init_waitqueue_entry(&wait, current);
-+
-+ __set_current_state(TASK_INTERRUPTIBLE);
-+ spin_lock_irqsave(&q->lock, flags);
-+ __add_wait_queue(q, &wait);
-+ spin_unlock(&q->lock);
++ DEFINE_WAIT(wait);
+
++ prepare_to_wait(q, &wait, TASK_INTERRUPTIBLE);
+ timeout = schedule_timeout(timeout);
-+
-+ spin_lock_irq(&q->lock);
-+ __remove_wait_queue(q, &wait);
-+ spin_unlock_irqrestore(&q->lock, flags);
++ finish_wait(q, &wait);
+
+ return timeout;
+}
diff --git a/package/kernel/lantiq/ltq-atm/Makefile b/package/kernel/lantiq/ltq-atm/Makefile
index 9fe1b40620..21802f46fe 100644
--- a/package/kernel/lantiq/ltq-atm/Makefile
+++ b/package/kernel/lantiq/ltq-atm/Makefile
@@ -21,16 +21,17 @@ define KernelPackage/ltq-atm-template
TITLE:=atm driver for $(1)
URL:=http://www.lantiq.com/
VARIANT:=$(1)
- DEPENDS:=@TARGET_lantiq_$(2) +kmod-atm +br2684ctl
+ DEPENDS:=@$(2) +kmod-atm +br2684ctl
FILES:=$(PKG_BUILD_DIR)/ltq_atm_$(1).ko
AUTOLOAD:=$(call AutoProbe,ltq_atm_$(1))
endef
-KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,xway)
-KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,xway)
-KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,ase)
+KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
+KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,TARGET_lantiq_xway)
+KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase)
+
define KernelPackage/ltq-atm-vr9
- $(call KernelPackage/ltq-atm-template,vr9,xrx200)
+ $(call KernelPackage/ltq-atm-template,vr9,TARGET_lantiq_xrx200)
AUTOLOAD:=
endef
diff --git a/package/kernel/lantiq/ltq-hcd/Makefile b/package/kernel/lantiq/ltq-hcd/Makefile
index d3a373dcb7..d285e56706 100644
--- a/package/kernel/lantiq/ltq-hcd/Makefile
+++ b/package/kernel/lantiq/ltq-hcd/Makefile
@@ -23,14 +23,14 @@ define KernelPackage/ltq-hcd-template
TITLE:=USB driver for $(1)
URL:=http://www.lantiq.com/
VARIANT:=$(1)
- DEPENDS:=@TARGET_lantiq_$(2) +kmod-usb-core
+ DEPENDS:=@$(2) +kmod-usb-core
FILES:=$(PKG_BUILD_DIR)/ltq_hcd_$(1).ko
AUTOLOAD:=$(call AutoProbe,ltq_hcd_$(1),1)
endef
-KernelPackage/ltq-hcd-ase=$(call KernelPackage/ltq-hcd-template,ase,ase)
-KernelPackage/ltq-hcd-danube=$(call KernelPackage/ltq-hcd-template,danube,xway)
-KernelPackage/ltq-hcd-ar9=$(call KernelPackage/ltq-hcd-template,ar9,xway)
+KernelPackage/ltq-hcd-ase=$(call KernelPackage/ltq-hcd-template,ase,TARGET_lantiq_ase)
+KernelPackage/ltq-hcd-danube=$(call KernelPackage/ltq-hcd-template,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
+KernelPackage/ltq-hcd-ar9=$(call KernelPackage/ltq-hcd-template,ar9,TARGET_lantiq_xway)
define Build/Prepare
$(INSTALL_DIR) $(PKG_BUILD_DIR)
diff --git a/package/kernel/linux/modules/block.mk b/package/kernel/linux/modules/block.mk
index c83f98ddbd..0c8d9b1fe9 100644
--- a/package/kernel/linux/modules/block.mk
+++ b/package/kernel/linux/modules/block.mk
@@ -151,22 +151,6 @@ endef
$(eval $(call KernelPackage,ata-nvidia-sata))
-define KernelPackage/ata-oxnas-sata
- TITLE:=oxnas Serial ATA support
- KCONFIG:=CONFIG_SATA_OXNAS
- DEPENDS:=@TARGET_oxnas
- FILES:=$(LINUX_DIR)/drivers/ata/sata_oxnas.ko
- AUTOLOAD:=$(call AutoLoad,41,sata_oxnas,1)
- $(call AddDepends/ata)
-endef
-
-define KernelPackage/ata-oxnas-sata/description
- SATA support for OX934 core found in the OX82x/PLX782x SoCs
-endef
-
-$(eval $(call KernelPackage,ata-oxnas-sata))
-
-
define KernelPackage/ata-pdc202xx-old
SUBMENU:=$(BLOCK_MENU)
TITLE:=Older Promise PATA controller support
diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index cfd5b11e44..0602a254ba 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -522,23 +522,6 @@ endef
$(eval $(call KernelPackage,usb-dwc2))
-define KernelPackage/usb2-oxnas
- TITLE:=OXNAS USB controller driver
- DEPENDS:=@TARGET_oxnas +kmod-usb2
- KCONFIG:=CONFIG_USB_EHCI_OXNAS
- FILES:=$(LINUX_DIR)/drivers/usb/host/ehci-oxnas.ko
- AUTOLOAD:=$(call AutoLoad,55,ehci-oxnas,1)
- $(call AddDepends/usb)
-endef
-
-define KernelPackage/usb2-oxnas/description
- This driver provides USB Device Controller support for the
- EHCI USB host built-in to the PLXTECH NAS782x SoC
-endef
-
-$(eval $(call KernelPackage,usb2-oxnas))
-
-
define KernelPackage/usb-dwc3
TITLE:=DWC3 USB controller driver
KCONFIG:= \
diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile
index 96701197e8..667b0d8915 100644
--- a/package/network/config/ltq-adsl-app/Makefile
+++ b/package/network/config/ltq-adsl-app/Makefile
@@ -24,7 +24,7 @@ PKG_CONFIG_DEPENDS:=\
CONFIG_LTQ_DSL_ENABLE_SOAP \
CONFIG_LTQ_DSL_ENABLE_DSL_EVENT_POLLING
-PKG_BUILD_DEPENDS:=TARGET_lantiq_xway:kmod-ltq-adsl-danube TARGET_lantiq_ase:kmod-ltq-adsl-ase
+PKG_BUILD_DEPENDS:=TARGET_lantiq_xway:kmod-ltq-adsl-danube TARGET_lantiq_xway_legacy:kmod-ltq-adsl-danube TARGET_lantiq_ase:kmod-ltq-adsl-ase
include $(INCLUDE_DIR)/package.mk
@@ -33,7 +33,7 @@ define Package/ltq-adsl-app
CATEGORY:=Network
TITLE:=Lantiq DSL userland tool
URL:=http://www.lantiq.com/
- DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_ase) +libpthread
+ DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +libpthread
MENU:=1
endef
diff --git a/package/network/config/ltq-adsl-app/patches/001-stupid_breakage_fix.patch b/package/network/config/ltq-adsl-app/patches/001-stupid_breakage_fix.patch
new file mode 100644
index 0000000000..a868678d1e
--- /dev/null
+++ b/package/network/config/ltq-adsl-app/patches/001-stupid_breakage_fix.patch
@@ -0,0 +1,65 @@
+--- a/src/dsl_cpe_cli_access.c 2016-05-27 12:34:43.612485449 -0700
++++ b/src/dsl_cpe_cli_access.c 2016-05-27 12:45:37.491727862 -0700
+@@ -1142,7 +1142,7 @@
+
+ if ((ret < 0) && (autobootCtrl.accessCtl.nReturn < DSL_SUCCESS))
+ {
+- DSL_CPE_FPrintf (out, sFailureReturn, autobootCtrl.accessCtl.nReturn);
++ DSL_CPE_FPrintf (out, sFailureReturn, autobootCtrl.accessCtl.nReturn, DSL_CPE_Fd2DevStr(fd));
+ }
+ else
+ {
+@@ -1213,7 +1213,7 @@
+
+ if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS))
+ {
+- DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn);
++ DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn, DSL_CPE_Fd2DevStr(fd));
+ }
+ else
+ {
+@@ -1290,7 +1290,7 @@
+
+ if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS))
+ {
+- DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn);
++ DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn, DSL_CPE_Fd2DevStr(fd));
+ }
+ else
+ {
+@@ -1355,7 +1355,7 @@
+ pCtx, &resourceUsageStatisticsData);
+ if (ret < 0)
+ {
+- DSL_CPE_FPrintf (out, sFailureReturn, ret);
++ DSL_CPE_FPrintf (out, sFailureReturn, ret, DSL_CPE_Fd2DevStr(fd));
+ }
+ else
+ {
+@@ -3084,7 +3084,7 @@
+
+ if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS))
+ {
+- DSL_CPE_FPrintf (out, sFailureReturn, pData->accessCtl.nReturn);
++ DSL_CPE_FPrintf (out, sFailureReturn, pData->accessCtl.nReturn, DSL_CPE_Fd2DevStr(fd));
+ }
+ else
+ {
+@@ -4654,7 +4654,7 @@
+
+ if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS))
+ {
+- DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn);
++ DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn, DSL_CPE_Fd2DevStr(fd));
+ }
+ else
+ {
+@@ -5714,7 +5714,7 @@
+
+ if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS))
+ {
+- DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn);
++ DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn, DSL_CPE_Fd2DevStr(fd));
+ }
+ else
+ {
diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index d843548580..1b4a5d9f3a 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,9 +7,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostapd
-PKG_VERSION:=2016-01-15
-PKG_RELEASE:=2
-PKG_REV:=e15dcf6d1bc2725388555523effca75b1ffab735
+PKG_VERSION:=2016-06-15
+PKG_RELEASE:=1
+PKG_REV:=31d3692fe5d56c05753ed4a70c7943979e1d29e7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
diff --git a/package/network/services/hostapd/patches/100-mesh_mode_fix.patch b/package/network/services/hostapd/patches/100-mesh_mode_fix.patch
index 1be7559c4a..ceb4c53afa 100644
--- a/package/network/services/hostapd/patches/100-mesh_mode_fix.patch
+++ b/package/network/services/hostapd/patches/100-mesh_mode_fix.patch
@@ -1,6 +1,6 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -2262,7 +2262,8 @@ wpa_driver_nl80211_finish_drv_init(struc
+@@ -2332,7 +2332,8 @@ wpa_driver_nl80211_finish_drv_init(struc
if (drv->hostapd || bss->static_ap)
nlmode = NL80211_IFTYPE_AP;
diff --git a/package/network/services/hostapd/patches/120-daemonize_fix.patch b/package/network/services/hostapd/patches/120-daemonize_fix.patch
index fad84669a6..0389406a98 100644
--- a/package/network/services/hostapd/patches/120-daemonize_fix.patch
+++ b/package/network/services/hostapd/patches/120-daemonize_fix.patch
@@ -60,13 +60,13 @@
+ if (chdir("/") < 0)
return -1;
- }
--
+
- return 0;
-}
-#else /* __APPLE__ */
-#define os_daemon daemon
-#endif /* __APPLE__ */
-
+-
-
-int os_daemonize(const char *pid_file)
-{
diff --git a/package/network/services/hostapd/patches/130-no_eapol_fix.patch b/package/network/services/hostapd/patches/130-no_eapol_fix.patch
index 0c4114a515..5aee3d07f1 100644
--- a/package/network/services/hostapd/patches/130-no_eapol_fix.patch
+++ b/package/network/services/hostapd/patches/130-no_eapol_fix.patch
@@ -1,6 +1,6 @@
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -253,9 +253,10 @@ void wpa_supplicant_cancel_auth_timeout(
+@@ -257,9 +257,10 @@ void wpa_supplicant_cancel_auth_timeout(
*/
void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s)
{
diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch
index 08f1e95a4f..e9d49d40fa 100644
--- a/package/network/services/hostapd/patches/200-multicall.patch
+++ b/package/network/services/hostapd/patches/200-multicall.patch
@@ -1,15 +1,25 @@
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
-@@ -32,6 +32,7 @@ export BINDIR ?= /usr/local/bin/
- # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
+@@ -28,6 +28,7 @@ CFLAGS += -I$(abspath ../src/utils)
+ export BINDIR ?= /usr/local/bin/
-include .config
+-include $(if $(MULTICALL), ../wpa_supplicant/.config)
ifndef CONFIG_NO_GITVER
# Add VERSION_STR postfix for builds from a git repository
-@@ -277,10 +278,14 @@ ifdef CONFIG_IEEE80211AC
- CFLAGS += -DCONFIG_IEEE80211AC
+@@ -190,7 +191,8 @@ endif
+
+ ifdef CONFIG_NO_VLAN
+ CFLAGS += -DCONFIG_NO_VLAN
+-else
++endif
++ifneq ($(findstring CONFIG_NO_VLAN,$(CFLAGS)), CONFIG_NO_VLAN)
+ OBJS += ../src/ap/vlan_init.o
+ OBJS += ../src/ap/vlan_ifconfig.o
+ OBJS += ../src/ap/vlan.o
+@@ -315,10 +317,14 @@ CFLAGS += -DCONFIG_MBO
+ OBJS += ../src/ap/mbo_ap.o
endif
+ifndef MULTICALL
@@ -26,7 +36,7 @@
LIBS += $(DRV_AP_LIBS)
ifdef CONFIG_L2_PACKET
-@@ -1019,6 +1024,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
+@@ -1051,6 +1057,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
BCHECK=../src/drivers/build.hostapd
@@ -39,7 +49,7 @@
hostapd: $(BCHECK) $(OBJS)
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
@$(E) " LD " $@
-@@ -1060,6 +1071,12 @@ HOBJS += ../src/crypto/aes-internal.o
+@@ -1092,6 +1104,12 @@ HOBJS += ../src/crypto/aes-internal.o
HOBJS += ../src/crypto/aes-internal-enc.o
endif
@@ -62,7 +72,7 @@
ifndef CONFIG_NO_GITVER
# Add VERSION_STR postfix for builds from a git repository
-@@ -794,6 +795,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
+@@ -803,6 +804,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
LIBS += -ldl -rdynamic
endif
@@ -73,7 +83,7 @@
endif
ifdef CONFIG_MACSEC
-@@ -814,9 +819,11 @@ NEED_EAP_COMMON=y
+@@ -823,9 +828,11 @@ NEED_EAP_COMMON=y
NEED_RSN_AUTHENTICATOR=y
CFLAGS += -DCONFIG_AP
OBJS += ap.o
@@ -85,7 +95,7 @@
OBJS += ../src/ap/hostapd.o
OBJS += ../src/ap/wpa_auth_glue.o
OBJS += ../src/ap/utils.o
-@@ -879,10 +886,18 @@ endif
+@@ -898,10 +905,18 @@ endif
ifdef CONFIG_HS20
OBJS += ../src/ap/hs20.o
endif
@@ -104,7 +114,7 @@
NEED_AES_WRAP=y
OBJS += ../src/ap/wpa_auth.o
OBJS += ../src/ap/wpa_auth_ie.o
-@@ -1657,6 +1672,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
+@@ -1680,6 +1695,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
$(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
@@ -117,8 +127,8 @@
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
@$(E) " LD " $@
-@@ -1757,6 +1778,12 @@ endif
- $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
+@@ -1782,6 +1803,12 @@ endif
+ -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
@$(E) " sed" $<
+dump_cflags:
@@ -132,7 +142,7 @@
wpa_cli.exe: wpa_cli
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -4707,8 +4707,8 @@ union wpa_event_data {
+@@ -4794,8 +4794,8 @@ union wpa_event_data {
* Driver wrapper code should call this function whenever an event is received
* from the driver.
*/
@@ -141,11 +151,20 @@
+extern void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data);
+ /**
+ * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
+@@ -4807,7 +4807,7 @@ void wpa_supplicant_event(void *ctx, enu
+ * Same as wpa_supplicant_event(), but we search for the interface in
+ * wpa_global.
+ */
+-void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
++extern void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data);
/*
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
-@@ -1122,8 +1122,8 @@ static void hostapd_event_dfs_cac_starte
+@@ -1157,8 +1157,8 @@ static void hostapd_event_dfs_cac_starte
#endif /* NEED_AP_MLME */
@@ -156,9 +175,18 @@
{
struct hostapd_data *hapd = ctx;
#ifndef CONFIG_NO_STDOUT_DEBUG
+@@ -1367,7 +1367,7 @@ void wpa_supplicant_event(void *ctx, enu
+ }
+
+
+-void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
++void hostapd_wpa_event_global(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data)
+ {
+ struct hapd_interfaces *interfaces = ctx;
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
-@@ -932,8 +932,8 @@ static void wpa_priv_send_ft_response(st
+@@ -940,8 +940,8 @@ static void wpa_priv_send_ft_response(st
}
@@ -169,17 +197,27 @@
{
struct wpa_priv_interface *iface = ctx;
-@@ -1082,6 +1082,7 @@ int main(int argc, char *argv[])
+@@ -1010,7 +1010,7 @@ void wpa_supplicant_event(void *ctx, enu
+ }
+
+
+-void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
++void supplicant_event_global(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data)
+ {
+ struct wpa_priv_global *global = ctx;
+@@ -1122,6 +1122,8 @@ int main(int argc, char *argv[])
if (os_program_init())
return -1;
+ wpa_supplicant_event = supplicant_event;
++ wpa_supplicant_event_global = supplicant_event_global;
wpa_priv_fd_workaround();
- for (;;) {
+ os_memset(&global, 0, sizeof(global));
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
-@@ -3298,8 +3298,8 @@ static void wpa_supplicant_event_assoc_a
+@@ -3384,8 +3384,8 @@ static void wpa_supplicant_event_assoc_a
}
@@ -190,7 +228,7 @@
{
struct wpa_supplicant *wpa_s = ctx;
int resched;
-@@ -3947,7 +3947,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -4051,7 +4051,7 @@ void wpa_supplicant_event(void *ctx, enu
#endif /* CONFIG_AP */
break;
case EVENT_ACS_CHANNEL_SELECTED:
@@ -199,61 +237,86 @@
if (!wpa_s->ap_iface)
break;
hostapd_acs_channel_selected(wpa_s->ap_iface->bss[0],
+@@ -4065,7 +4065,7 @@ void wpa_supplicant_event(void *ctx, enu
+ }
+
+
+-void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
++void supplicant_event_global(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data)
+ {
+ struct wpa_supplicant *wpa_s;
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -4845,6 +4845,9 @@ static void wpa_supplicant_deinit_iface(
- os_free(wpa_s);
+@@ -4982,7 +4982,6 @@ struct wpa_interface * wpa_supplicant_ma
+ return NULL;
}
+-
+ /**
+ * wpa_supplicant_match_existing - Match existing interfaces
+ * @global: Pointer to global data from wpa_supplicant_init()
+@@ -5019,6 +5018,11 @@ static int wpa_supplicant_match_existing
+
+ #endif /* CONFIG_MATCH_IFACE */
+
+extern void supplicant_event(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data);
+
++extern void supplicant_event_global(void *ctx, enum wpa_event_type event,
++ union wpa_event_data *data);
/**
* wpa_supplicant_add_iface - Add a new network interface
-@@ -5100,6 +5103,7 @@ struct wpa_global * wpa_supplicant_init(
+@@ -5274,6 +5278,8 @@ struct wpa_global * wpa_supplicant_init(
#ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
#endif /* CONFIG_NO_WPA_MSG */
+ wpa_supplicant_event = supplicant_event;
++ wpa_supplicant_event_global = supplicant_event_global;
if (params->wpa_debug_file_path)
wpa_debug_open_file(params->wpa_debug_file_path);
--- a/hostapd/main.c
+++ b/hostapd/main.c
-@@ -513,6 +513,9 @@ static int hostapd_get_ctrl_iface_group(
- return 0;
+@@ -583,6 +583,11 @@ fail:
+ return -1;
}
+void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data);
+
++void hostapd_wpa_event_global(void *ctx, enum wpa_event_type event,
++ union wpa_event_data *data);
#ifdef CONFIG_WPS
static int gen_uuid(const char *txt_addr)
-@@ -588,6 +591,7 @@ int main(int argc, char *argv[])
+@@ -660,6 +665,8 @@ int main(int argc, char *argv[])
interfaces.global_ctrl_sock = -1;
- interfaces.global_ctrl_dst = NULL;
+ dl_list_init(&interfaces.global_ctrl_dst);
+ wpa_supplicant_event = hostapd_wpa_event;
++ wpa_supplicant_event_global = hostapd_wpa_event_global;
for (;;) {
- c = getopt(argc, argv, "b:Bde:f:hKP:STtu:vg:G:");
+ c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:vg:G:");
if (c < 0)
--- a/src/drivers/drivers.c
+++ b/src/drivers/drivers.c
-@@ -10,6 +10,9 @@
+@@ -10,6 +10,11 @@
#include "utils/common.h"
#include "driver.h"
+void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data);
++void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
++ union wpa_event_data *data);
+
#ifdef CONFIG_DRIVER_WEXT
extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
#endif /* CONFIG_DRIVER_WEXT */
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
-@@ -29,7 +29,10 @@
+@@ -29,7 +29,12 @@
#include "ctrl_iface.h"
#include "pcsc_funcs.h"
#include "wpas_glue.h"
@@ -261,23 +324,28 @@
+void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data);
++void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
++ union wpa_event_data *data);
const struct wpa_driver_ops *const wpa_drivers[] = { NULL };
-@@ -1288,6 +1291,8 @@ static void usage(void)
+@@ -1295,6 +1300,10 @@ static void usage(void)
"option several times.\n");
}
+extern void supplicant_event(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data);
++extern void supplicant_event_global(void *ctx, enum wpa_event_type event,
++ union wpa_event_data *data);
int main(int argc, char *argv[])
{
-@@ -1308,6 +1313,7 @@ int main(int argc, char *argv[])
+@@ -1315,6 +1324,8 @@ int main(int argc, char *argv[])
if (os_program_init())
return -1;
+ wpa_supplicant_event = supplicant_event;
++ wpa_supplicant_event_global = supplicant_event_global;
hostapd_logger_register_cb(hostapd_logger_cb);
os_memset(&eapol_test, 0, sizeof(eapol_test));
diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch
index 85dc0c1cce..bb3d57b0ea 100644
--- a/package/network/services/hostapd/patches/300-noscan.patch
+++ b/package/network/services/hostapd/patches/300-noscan.patch
@@ -1,6 +1,6 @@
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -2852,6 +2852,10 @@ static int hostapd_config_fill(struct ho
+@@ -2861,6 +2861,10 @@ static int hostapd_config_fill(struct ho
}
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_IEEE80211N
@@ -13,7 +13,7 @@
} else if (os_strcmp(buf, "ht_capab") == 0) {
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -639,6 +639,8 @@ struct hostapd_config {
+@@ -655,6 +655,8 @@ struct hostapd_config {
int ht_op_mode_fixed;
u16 ht_capab;
@@ -24,7 +24,7 @@
int no_pri_sec_switch;
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
-@@ -473,7 +473,8 @@ static int ieee80211n_check_40mhz(struct
+@@ -474,7 +474,8 @@ static int ieee80211n_check_40mhz(struct
int ret;
/* Check that HT40 is used and PRI / SEC switch is allowed */
diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch
index 3bcdd70e75..d9486ed405 100644
--- a/package/network/services/hostapd/patches/310-rescan_immediately.patch
+++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch
@@ -1,6 +1,6 @@
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -3449,7 +3449,7 @@ wpa_supplicant_alloc(struct wpa_supplica
+@@ -3548,7 +3548,7 @@ wpa_supplicant_alloc(struct wpa_supplica
if (wpa_s == NULL)
return NULL;
wpa_s->scan_req = INITIAL_SCAN_REQ;
@@ -8,4 +8,4 @@
+ wpa_s->scan_interval = 1;
wpa_s->new_connection = 1;
wpa_s->parent = parent ? parent : wpa_s;
- wpa_s->sched_scanning = 0;
+ wpa_s->p2pdev = wpa_s->parent;
diff --git a/package/network/services/hostapd/patches/320-optional_rfkill.patch b/package/network/services/hostapd/patches/320-optional_rfkill.patch
index 349af030b9..cf2a2c108b 100644
--- a/package/network/services/hostapd/patches/320-optional_rfkill.patch
+++ b/package/network/services/hostapd/patches/320-optional_rfkill.patch
@@ -1,14 +1,14 @@
--- a/src/drivers/drivers.mak
+++ b/src/drivers/drivers.mak
-@@ -37,7 +37,6 @@ NEED_SME=y
+@@ -36,7 +36,6 @@ NEED_SME=y
NEED_AP_MLME=y
NEED_NETLINK=y
NEED_LINUX_IOCTL=y
-NEED_RFKILL=y
+ NEED_RADIOTAP=y
ifdef CONFIG_LIBNL32
- DRV_LIBS += -lnl-3
-@@ -121,7 +120,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
+@@ -123,7 +122,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
CONFIG_WIRELESS_EXTENSION=y
NEED_NETLINK=y
NEED_LINUX_IOCTL=y
@@ -16,7 +16,7 @@
endif
ifdef CONFIG_DRIVER_NDIS
-@@ -147,7 +145,6 @@ endif
+@@ -149,7 +147,6 @@ endif
ifdef CONFIG_WIRELESS_EXTENSION
DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
DRV_WPA_OBJS += ../src/drivers/driver_wext.o
@@ -24,14 +24,14 @@
endif
ifdef NEED_NETLINK
-@@ -160,6 +157,7 @@ endif
+@@ -162,6 +159,7 @@ endif
ifdef NEED_RFKILL
DRV_OBJS += ../src/drivers/rfkill.o
+DRV_WPA_CFLAGS += -DCONFIG_RFKILL
endif
- ifdef CONFIG_VLAN_NETLINK
+ ifdef NEED_RADIOTAP
--- a/src/drivers/rfkill.h
+++ b/src/drivers/rfkill.h
@@ -18,8 +18,24 @@ struct rfkill_config {
diff --git a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch
index 54dec31333..ca4601247b 100644
--- a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch
+++ b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch
@@ -1,6 +1,6 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -3709,7 +3709,7 @@ static int nl80211_set_channel(struct i8
+@@ -3795,7 +3795,7 @@ static int nl80211_set_channel(struct i8
freq->freq, freq->ht_enabled, freq->vht_enabled,
freq->bandwidth, freq->center_freq1, freq->center_freq2);
diff --git a/package/network/services/hostapd/patches/340-reload_freq_change.patch b/package/network/services/hostapd/patches/340-reload_freq_change.patch
index a687a805fc..086ade9ced 100644
--- a/package/network/services/hostapd/patches/340-reload_freq_change.patch
+++ b/package/network/services/hostapd/patches/340-reload_freq_change.patch
@@ -1,6 +1,6 @@
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -78,6 +78,16 @@ static void hostapd_reload_bss(struct ho
+@@ -80,6 +80,16 @@ static void hostapd_reload_bss(struct ho
#endif /* CONFIG_NO_RADIUS */
ssid = &hapd->conf->ssid;
@@ -17,7 +17,7 @@
if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
/*
-@@ -177,21 +187,12 @@ int hostapd_reload_config(struct hostapd
+@@ -179,21 +189,12 @@ int hostapd_reload_config(struct hostapd
oldconf = hapd->iconf;
iface->conf = newconf;
diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
index 2bcf49a7c6..247f154e30 100644
--- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
+++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
@@ -1,6 +1,6 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -2324,13 +2324,18 @@ wpa_driver_nl80211_finish_drv_init(struc
+@@ -2394,13 +2394,18 @@ wpa_driver_nl80211_finish_drv_init(struc
}
@@ -22,7 +22,7 @@
return send_and_recv_msgs(drv, msg, NULL, NULL);
}
-@@ -2381,7 +2386,7 @@ static void wpa_driver_nl80211_deinit(st
+@@ -2452,7 +2457,7 @@ static void wpa_driver_nl80211_deinit(st
nl80211_remove_monitor_interface(drv);
if (is_ap_interface(drv->nlmode))
@@ -31,7 +31,7 @@
if (drv->eapol_sock >= 0) {
eloop_unregister_read_sock(drv->eapol_sock);
-@@ -4233,8 +4238,7 @@ static void nl80211_teardown_ap(struct i
+@@ -4385,8 +4390,7 @@ static void nl80211_teardown_ap(struct i
nl80211_remove_monitor_interface(drv);
else
nl80211_mgmt_unsubscribe(bss, "AP teardown");
@@ -41,7 +41,7 @@
}
-@@ -6165,8 +6169,6 @@ static int wpa_driver_nl80211_if_remove(
+@@ -6387,8 +6391,6 @@ static int wpa_driver_nl80211_if_remove(
} else {
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
nl80211_teardown_ap(bss);
@@ -50,7 +50,7 @@
nl80211_destroy_bss(bss);
if (!bss->added_if)
i802_set_iface_flags(bss, 0);
-@@ -6528,8 +6530,7 @@ static int wpa_driver_nl80211_deinit_ap(
+@@ -6750,8 +6752,7 @@ static int wpa_driver_nl80211_deinit_ap(
struct wpa_driver_nl80211_data *drv = bss->drv;
if (!is_ap_interface(drv->nlmode))
return -1;
@@ -60,7 +60,7 @@
/*
* If the P2P GO interface was dynamically added, then it is
-@@ -6548,8 +6549,7 @@ static int wpa_driver_nl80211_stop_ap(vo
+@@ -6770,8 +6771,7 @@ static int wpa_driver_nl80211_stop_ap(vo
struct wpa_driver_nl80211_data *drv = bss->drv;
if (!is_ap_interface(drv->nlmode))
return -1;
diff --git a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch
index ebc63ab246..1e405cbf0e 100644
--- a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch
+++ b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch
@@ -1,6 +1,6 @@
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -47,6 +47,7 @@
+@@ -54,6 +54,7 @@
#include "fst/fst_ctrl_iface.h"
#include "config_file.h"
#include "ctrl_iface.h"
@@ -8,15 +8,15 @@
#define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
-@@ -59,6 +60,7 @@ struct wpa_ctrl_dst {
- int errors;
- };
+@@ -72,6 +73,7 @@ static void hostapd_ctrl_iface_send(stru
+ enum wpa_msg_type type,
+ const char *buf, size_t len);
+static char *reload_opts = NULL;
- static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
- enum wpa_msg_type type,
-@@ -169,6 +171,61 @@ static int hostapd_ctrl_iface_new_sta(st
+ static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd,
+ struct sockaddr_storage *from,
+@@ -123,6 +125,61 @@ static int hostapd_ctrl_iface_new_sta(st
return 0;
}
@@ -78,7 +78,7 @@
#ifdef CONFIG_IEEE80211W
#ifdef NEED_AP_MLME
-@@ -2257,6 +2314,8 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2483,6 +2540,8 @@ static int hostapd_ctrl_iface_receive_pr
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
reply_size);
@@ -89,7 +89,7 @@
#ifdef RADIUS_SERVER
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -552,5 +552,11 @@ int hostapd_parse_csa_settings(const cha
+@@ -593,7 +593,13 @@ int hostapd_parse_csa_settings(const cha
int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
{
@@ -102,3 +102,5 @@
+
+ return 0;
}
+
+
diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch
index 716916a0f0..6b70215c43 100644
--- a/package/network/services/hostapd/patches/370-ap_sta_support.patch
+++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch
@@ -1,6 +1,6 @@
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
-@@ -99,6 +99,11 @@ struct wpa_interface {
+@@ -100,6 +100,11 @@ struct wpa_interface {
const char *ifname;
/**
@@ -12,8 +12,8 @@
* bridge_ifname - Optional bridge interface name
*
* If the driver interface (ifname) is included in a Linux bridge
-@@ -465,6 +470,8 @@ struct wpa_supplicant {
- #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
+@@ -484,6 +489,8 @@ struct wpa_supplicant {
+ #endif /* CONFIG_CTRL_IFACE_BINDER */
char bridge_ifname[16];
+ struct wpa_ctrl *hostapd;
@@ -45,7 +45,7 @@
CONFIG_OS=win32
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -108,6 +108,55 @@ const char *const wpa_supplicant_full_li
+@@ -112,6 +112,55 @@ const char *const wpa_supplicant_full_li
"\n";
#endif /* CONFIG_NO_STDOUT_DEBUG */
@@ -101,7 +101,7 @@
/* Configure default/group WEP keys for static WEP */
int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
{
-@@ -783,8 +832,12 @@ void wpa_supplicant_set_state(struct wpa
+@@ -812,8 +861,12 @@ void wpa_supplicant_set_state(struct wpa
wpas_p2p_completed(wpa_s);
sme_sched_obss_scan(wpa_s, 1);
@@ -114,7 +114,7 @@
wpa_s->new_connection = 1;
wpa_drv_set_operstate(wpa_s, 0);
#ifndef IEEE8021X_EAPOL
-@@ -4537,6 +4590,20 @@ static int wpa_supplicant_init_iface(str
+@@ -4638,6 +4691,20 @@ static int wpa_supplicant_init_iface(str
sizeof(wpa_s->bridge_ifname));
}
@@ -135,7 +135,7 @@
/* RSNA Supplicant Key Management - INITIALIZE */
eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
-@@ -4823,6 +4890,11 @@ static void wpa_supplicant_deinit_iface(
+@@ -4929,6 +4996,11 @@ static void wpa_supplicant_deinit_iface(
if (terminate)
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
@@ -203,16 +203,16 @@
" -i = interface name\n"
" -I = additional configuration file\n"
" -K = include keys (passwords, etc.) in debug output\n"
-@@ -176,7 +177,7 @@ int main(int argc, char *argv[])
+@@ -201,7 +202,7 @@ int main(int argc, char *argv[])
for (;;) {
c = getopt(argc, argv,
-- "b:Bc:C:D:de:f:g:G:hi:I:KLm:No:O:p:P:qsTtuvW");
-+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
+- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW");
++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW");
if (c < 0)
break;
switch (c) {
-@@ -223,6 +224,9 @@ int main(int argc, char *argv[])
+@@ -248,6 +249,9 @@ int main(int argc, char *argv[])
usage();
exitcode = 0;
goto out;
diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
index 1e1aa20730..ef9c9db9a5 100644
--- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
+++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
@@ -1,18 +1,18 @@
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
-@@ -202,6 +202,9 @@ endif
+@@ -212,6 +212,9 @@ endif
ifdef CONFIG_NO_CTRL_IFACE
CFLAGS += -DCONFIG_NO_CTRL_IFACE
else
+ifdef CONFIG_CTRL_IFACE_MIB
+CFLAGS += -DCONFIG_CTRL_IFACE_MIB
+endif
- OBJS += ctrl_iface.o
- OBJS += ../src/ap/ctrl_iface_ap.o
- endif
+ ifeq ($(CONFIG_CTRL_IFACE), udp)
+ CFLAGS += -DCONFIG_CTRL_IFACE_UDP
+ else
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -2119,6 +2119,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2342,6 +2342,7 @@ static int hostapd_ctrl_iface_receive_pr
reply_size);
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
reply_len = hostapd_drv_status(hapd, reply, reply_size);
@@ -20,7 +20,7 @@
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
if (reply_len >= 0) {
-@@ -2160,6 +2161,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2383,6 +2384,7 @@ static int hostapd_ctrl_iface_receive_pr
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
reply_size);
@@ -30,8 +30,8 @@
reply_len = -1;
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -858,6 +858,9 @@ ifdef CONFIG_WNM
- OBJS += ../src/ap/wnm_ap.o
+@@ -872,6 +872,9 @@ ifdef CONFIG_MBO
+ OBJS += ../src/ap/mbo_ap.o
endif
ifdef CONFIG_CTRL_IFACE
+ifdef CONFIG_CTRL_IFACE_MIB
@@ -42,7 +42,7 @@
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
-@@ -1858,7 +1858,7 @@ static int wpa_supplicant_ctrl_iface_sta
+@@ -1895,7 +1895,7 @@ static int wpa_supplicant_ctrl_iface_sta
pos += ret;
}
@@ -51,7 +51,7 @@
if (wpa_s->ap_iface) {
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
end - pos,
-@@ -8352,6 +8352,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -8687,6 +8687,7 @@ char * wpa_supplicant_ctrl_iface_process
reply_len = -1;
} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
@@ -59,7 +59,7 @@
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
if (reply_len >= 0) {
-@@ -8359,6 +8360,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -8694,6 +8695,7 @@ char * wpa_supplicant_ctrl_iface_process
reply + reply_len,
reply_size - reply_len);
}
@@ -67,7 +67,7 @@
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
reply_len = wpa_supplicant_ctrl_iface_status(
wpa_s, buf + 6, reply, reply_size);
-@@ -8821,6 +8823,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -9164,6 +9166,7 @@ char * wpa_supplicant_ctrl_iface_process
reply_len = wpa_supplicant_ctrl_iface_bss(
wpa_s, buf + 4, reply, reply_size);
#ifdef CONFIG_AP
@@ -75,7 +75,7 @@
} else if (os_strcmp(buf, "STA-FIRST") == 0) {
reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
} else if (os_strncmp(buf, "STA ", 4) == 0) {
-@@ -8829,12 +8832,15 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -9172,12 +9175,15 @@ char * wpa_supplicant_ctrl_iface_process
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
reply_size);
@@ -93,15 +93,15 @@
reply_len = -1;
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -23,6 +23,7 @@
- #include "ctrl_iface_ap.h"
+@@ -24,6 +24,7 @@
#include "ap_drv_ops.h"
+ #include "mbo_ap.h"
+#ifdef CONFIG_CTRL_IFACE_MIB
static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
struct sta_info *sta,
-@@ -235,6 +236,7 @@ int hostapd_ctrl_iface_sta_next(struct h
+@@ -249,6 +250,7 @@ int hostapd_ctrl_iface_sta_next(struct h
return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
}
@@ -111,7 +111,7 @@
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
-@@ -2359,6 +2359,7 @@ static const char * bool_txt(Boolean val
+@@ -2441,6 +2441,7 @@ static const char * bool_txt(Boolean val
return val ? "TRUE" : "FALSE";
}
@@ -119,7 +119,7 @@
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
{
-@@ -2534,6 +2535,7 @@ int ieee802_1x_get_mib_sta(struct hostap
+@@ -2616,6 +2617,7 @@ int ieee802_1x_get_mib_sta(struct hostap
return len;
}
@@ -167,7 +167,7 @@
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
-@@ -1091,7 +1091,7 @@ int wpas_ap_wps_nfc_report_handover(stru
+@@ -1114,7 +1114,7 @@ int wpas_ap_wps_nfc_report_handover(stru
#endif /* CONFIG_WPS */
diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
index 0d752b0508..c9e7bf4209 100644
--- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
+++ b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
@@ -1,6 +1,6 @@
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
-@@ -1242,6 +1242,31 @@ u32 wpa_akm_to_suite(int akm)
+@@ -1244,6 +1244,31 @@ u32 wpa_akm_to_suite(int akm)
}
@@ -32,7 +32,7 @@
int wpa_compare_rsn_ie(int ft_initial_assoc,
const u8 *ie1, size_t ie1len,
const u8 *ie2, size_t ie2len)
-@@ -1249,8 +1274,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
+@@ -1251,8 +1276,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
if (ie1 == NULL || ie2 == NULL)
return -1;
diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch
index 234537a7bc..335e71eb51 100644
--- a/package/network/services/hostapd/patches/420-indicate-features.patch
+++ b/package/network/services/hostapd/patches/420-indicate-features.patch
@@ -8,16 +8,16 @@
#include "crypto/random.h"
#include "crypto/tls.h"
#include "common/version.h"
-@@ -593,7 +594,7 @@ int main(int argc, char *argv[])
-
+@@ -668,7 +669,7 @@ int main(int argc, char *argv[])
wpa_supplicant_event = hostapd_wpa_event;
+ wpa_supplicant_event_global = hostapd_wpa_event_global;
for (;;) {
-- c = getopt(argc, argv, "b:Bde:f:hKP:STtu:vg:G:");
-+ c = getopt(argc, argv, "b:Bde:f:hKP:STtu:g:G:v::");
+- c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:vg:G:");
++ c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:g:G:v::");
if (c < 0)
break;
switch (c) {
-@@ -630,6 +631,8 @@ int main(int argc, char *argv[])
+@@ -705,6 +706,8 @@ int main(int argc, char *argv[])
break;
#endif /* CONFIG_DEBUG_LINUX_TRACING */
case 'v':
@@ -36,16 +36,16 @@
#include "fst/fst.h"
#include "wpa_supplicant_i.h"
#include "driver_i.h"
-@@ -177,7 +178,7 @@ int main(int argc, char *argv[])
+@@ -202,7 +203,7 @@ int main(int argc, char *argv[])
for (;;) {
c = getopt(argc, argv,
-- "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
-+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuv::W");
+- "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW");
++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuv::W");
if (c < 0)
break;
switch (c) {
-@@ -280,8 +281,12 @@ int main(int argc, char *argv[])
+@@ -305,8 +306,12 @@ int main(int argc, char *argv[])
break;
#endif /* CONFIG_DBUS */
case 'v':
diff --git a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
index 9ecd78609b..d07b747c3d 100644
--- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
+++ b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
@@ -1,6 +1,6 @@
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -68,7 +68,6 @@ static const char *const commands_help =
+@@ -69,7 +69,6 @@ static const char *const commands_help =
#ifdef CONFIG_IEEE80211W
" sa_query <addr> send SA Query to a station\n"
#endif /* CONFIG_IEEE80211W */
@@ -8,7 +8,7 @@
" wps_pin <uuid> <pin> [timeout] [addr] add WPS Enrollee PIN\n"
" wps_check_pin <PIN> verify PIN checksum\n"
" wps_pbc indicate button pushed to initiate PBC\n"
-@@ -81,7 +80,6 @@ static const char *const commands_help =
+@@ -82,7 +81,6 @@ static const char *const commands_help =
" wps_ap_pin <cmd> [params..] enable/disable AP PIN\n"
" wps_config <SSID> <auth> <encr> <key> configure AP\n"
" wps_get_status show current WPS status\n"
@@ -16,7 +16,7 @@
" get_config show current configuration\n"
" help show this usage help\n"
" interface [ifname] show interfaces/select interface\n"
-@@ -364,7 +362,6 @@ static int hostapd_cli_cmd_sa_query(stru
+@@ -418,7 +416,6 @@ static int hostapd_cli_cmd_sa_query(stru
#endif /* CONFIG_IEEE80211W */
@@ -24,7 +24,7 @@
static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
-@@ -590,7 +587,6 @@ static int hostapd_cli_cmd_wps_config(st
+@@ -644,7 +641,6 @@ static int hostapd_cli_cmd_wps_config(st
ssid_hex, argv[1]);
return wpa_ctrl_command(ctrl, buf);
}
@@ -32,7 +32,7 @@
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
-@@ -1086,7 +1082,6 @@ static const struct hostapd_cli_cmd host
+@@ -1236,7 +1232,6 @@ static const struct hostapd_cli_cmd host
#ifdef CONFIG_IEEE80211W
{ "sa_query", hostapd_cli_cmd_sa_query },
#endif /* CONFIG_IEEE80211W */
@@ -40,7 +40,7 @@
{ "wps_pin", hostapd_cli_cmd_wps_pin },
{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin },
{ "wps_pbc", hostapd_cli_cmd_wps_pbc },
-@@ -1100,7 +1095,6 @@ static const struct hostapd_cli_cmd host
+@@ -1250,7 +1245,6 @@ static const struct hostapd_cli_cmd host
{ "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
{ "wps_config", hostapd_cli_cmd_wps_config },
{ "wps_get_status", hostapd_cli_cmd_wps_get_status },
diff --git a/package/network/services/hostapd/patches/432-missing-typedef.patch b/package/network/services/hostapd/patches/432-missing-typedef.patch
new file mode 100644
index 0000000000..7a100f1a0d
--- /dev/null
+++ b/package/network/services/hostapd/patches/432-missing-typedef.patch
@@ -0,0 +1,10 @@
+--- a/src/drivers/linux_wext.h
++++ b/src/drivers/linux_wext.h
+@@ -26,6 +26,7 @@ typedef int32_t __s32;
+ typedef uint16_t __u16;
+ typedef int16_t __s16;
+ typedef uint8_t __u8;
++typedef int8_t __s8;
+ #ifndef __user
+ #define __user
+ #endif /* __user */
diff --git a/package/network/services/hostapd/patches/450-scan_wait.patch b/package/network/services/hostapd/patches/450-scan_wait.patch
index 192006a872..78cf3064fa 100644
--- a/package/network/services/hostapd/patches/450-scan_wait.patch
+++ b/package/network/services/hostapd/patches/450-scan_wait.patch
@@ -33,7 +33,7 @@
/* Initialize the driver interface */
if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
b = NULL;
-@@ -382,8 +394,6 @@ static void hostapd_global_deinit(const
+@@ -401,8 +413,6 @@ static void hostapd_global_deinit(const
#endif /* CONFIG_NATIVE_WINDOWS */
eap_server_unregister_methods();
@@ -42,19 +42,26 @@
}
-@@ -409,11 +419,6 @@ static int hostapd_global_run(struct hap
+@@ -428,18 +438,6 @@ static int hostapd_global_run(struct hap
}
#endif /* EAP_SERVER_TNC */
-- if (daemonize && os_daemonize(pid_file)) {
-- wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
-- return -1;
+- if (daemonize) {
+- if (os_daemonize(pid_file)) {
+- wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
+- return -1;
+- }
+- if (eloop_sock_requeue()) {
+- wpa_printf(MSG_ERROR, "eloop_sock_requeue: %s",
+- strerror(errno));
+- return -1;
+- }
- }
-
eloop_run();
return 0;
-@@ -566,8 +571,7 @@ int main(int argc, char *argv[])
+@@ -638,8 +636,7 @@ int main(int argc, char *argv[])
struct hapd_interfaces interfaces;
int ret = 1;
size_t i, j;
diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
index 426ffc5148..169b17100d 100644
--- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
+++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
@@ -18,15 +18,15 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
#define WPA_SUPPLICANT_DRIVER_VERSION 4
-+#include "drivers/nl80211_copy.h"
++#include "ap/sta_info.h"
#include "common/defs.h"
#include "common/ieee802_11_defs.h"
#include "utils/list.h"
-@@ -570,6 +571,9 @@ struct wpa_driver_associate_params {
+@@ -587,6 +588,9 @@ struct wpa_driver_associate_params {
* responsible for selecting with which BSS to associate. */
const u8 *bssid;
-+ unsigned char rates[NL80211_MAX_SUPP_RATES];
++ unsigned char rates[WLAN_SUPP_RATES_MAX];
+ int mcast_rate;
+
/**
@@ -38,11 +38,11 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
#include "eap_peer/eap.h"
#include "p2p/p2p.h"
#include "fst/fst.h"
-+#include "drivers/nl80211_copy.h"
++#include "ap/sta_info.h"
#include "config.h"
-@@ -1742,6 +1743,97 @@ static char * wpa_config_write_mesh_basi
+@@ -1816,6 +1817,97 @@ static char * wpa_config_write_mesh_basi
#endif /* CONFIG_MESH */
@@ -88,7 +88,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
+ pos = (char *)value;
+ r = strtok_r(pos, ",", &sptr);
+ i = 0;
-+ while (pos && i < NL80211_MAX_SUPP_RATES) {
++ while (pos && i < WLAN_SUPP_RATES_MAX) {
+ rate = 0.0;
+ if (r)
+ rate = strtod(r, &end);
@@ -113,11 +113,11 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
+ if (ssid->rates[0] <= 0)
+ return NULL;
+
-+ value = os_malloc(6 * NL80211_MAX_SUPP_RATES + 1);
++ value = os_malloc(6 * WLAN_SUPP_RATES_MAX + 1);
+ if (value == NULL)
+ return NULL;
+ pos = value;
-+ for (i = 0; i < NL80211_MAX_SUPP_RATES - 1; i++) {
++ for (i = 0; i < WLAN_SUPP_RATES_MAX - 1; i++) {
+ res = os_snprintf(pos, 6, "%.1f,", (double)ssid->rates[i] / 2);
+ if (res < 0) {
+ os_free(value);
@@ -126,13 +126,13 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
+ pos += res;
+ }
+ res = os_snprintf(pos, 6, "%.1f",
-+ (double)ssid->rates[NL80211_MAX_SUPP_RATES - 1] / 2);
++ (double)ssid->rates[WLAN_SUPP_RATES_MAX - 1] / 2);
+ if (res < 0) {
+ os_free(value);
+ return NULL;
+ }
+
-+ value[6 * NL80211_MAX_SUPP_RATES] = '\0';
++ value[6 * WLAN_SUPP_RATES_MAX] = '\0';
+ return value;
+}
+#endif /* NO_CONFIG_WRITE */
@@ -140,7 +140,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
/* Helper macros for network block parser */
#ifdef OFFSET
-@@ -1973,6 +2065,9 @@ static const struct parse_data ssid_fiel
+@@ -2047,6 +2139,9 @@ static const struct parse_data ssid_fiel
{ INT(ap_max_inactivity) },
{ INT(dtim_period) },
{ INT(beacon_int) },
@@ -152,19 +152,22 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
#endif /* CONFIG_MACSEC */
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
-@@ -12,6 +12,7 @@
+@@ -10,8 +10,10 @@
+ #define CONFIG_SSID_H
+
#include "common/defs.h"
++#include "ap/sta_info.h"
#include "utils/list.h"
#include "eap_peer/eap_config.h"
+#include "drivers/nl80211_copy.h"
#define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
-@@ -698,6 +699,9 @@ struct wpa_ssid {
+@@ -711,6 +713,9 @@ struct wpa_ssid {
*/
void *parent_cred;
-+ unsigned char rates[NL80211_MAX_SUPP_RATES];
++ unsigned char rates[WLAN_SUPP_RATES_MAX];
+ double mcast_rate;
+
#ifdef CONFIG_MACSEC
@@ -172,13 +175,13 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
* macsec_policy - Determines the policy for MACsec secure session
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2421,6 +2421,13 @@ static void wpas_start_assoc_cb(struct w
+@@ -2510,6 +2510,13 @@ static void wpas_start_assoc_cb(struct w
params.beacon_int = ssid->beacon_int;
else
params.beacon_int = wpa_s->conf->beacon_int;
+ params.fixed_freq = ssid->fixed_freq;
+ i = 0;
-+ while (i < NL80211_MAX_SUPP_RATES) {
++ while (i < WLAN_SUPP_RATES_MAX) {
+ params.rates[i] = ssid->rates[i];
+ i++;
+ }
diff --git a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch
index febbd14e21..459bdb944a 100644
--- a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch
+++ b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch
@@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -4492,7 +4492,7 @@ static int wpa_driver_nl80211_ibss(struc
+@@ -4644,7 +4644,7 @@ static int wpa_driver_nl80211_ibss(struc
struct wpa_driver_associate_params *params)
{
struct nl_msg *msg;
@@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
int count = 0;
wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
-@@ -4519,6 +4519,37 @@ retry:
+@@ -4671,6 +4671,37 @@ retry:
nl80211_put_beacon_int(msg, params->beacon_int))
goto fail;
diff --git a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch
index aa2ac197e8..a81465c56f 100644
--- a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch
+++ b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch
@@ -16,9 +16,9 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -573,6 +573,8 @@ struct wpa_driver_associate_params {
+@@ -590,6 +590,8 @@ struct wpa_driver_associate_params {
- unsigned char rates[NL80211_MAX_SUPP_RATES];
+ unsigned char rates[WLAN_SUPP_RATES_MAX];
int mcast_rate;
+ int ht_set;
+ unsigned int htmode;
@@ -27,7 +27,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* bssid_hint - BSSID of a proposed AP
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -4550,6 +4550,22 @@ retry:
+@@ -4702,6 +4702,22 @@ retry:
nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
}
@@ -52,7 +52,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
goto fail;
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
-@@ -1774,6 +1774,71 @@ static char * wpa_config_write_mcast_rat
+@@ -1848,6 +1848,71 @@ static char * wpa_config_write_mcast_rat
}
#endif /* NO_CONFIG_WRITE */
@@ -124,7 +124,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
static int wpa_config_parse_rates(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
-@@ -2068,6 +2133,7 @@ static const struct parse_data ssid_fiel
+@@ -2142,6 +2207,7 @@ static const struct parse_data ssid_fiel
{ INT_RANGE(fixed_freq, 0, 1) },
{ FUNC(rates) },
{ FUNC(mcast_rate) },
@@ -134,9 +134,9 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
#endif /* CONFIG_MACSEC */
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
-@@ -701,6 +701,8 @@ struct wpa_ssid {
+@@ -715,6 +715,8 @@ struct wpa_ssid {
- unsigned char rates[NL80211_MAX_SUPP_RATES];
+ unsigned char rates[WLAN_SUPP_RATES_MAX];
double mcast_rate;
+ int ht_set;
+ unsigned int htmode;
@@ -145,7 +145,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
/**
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2428,6 +2428,8 @@ static void wpas_start_assoc_cb(struct w
+@@ -2517,6 +2517,8 @@ static void wpas_start_assoc_cb(struct w
i++;
}
params.mcast_rate = ssid->mcast_rate;
diff --git a/package/network/services/hostapd/patches/470-survey_data_fallback.patch b/package/network/services/hostapd/patches/470-survey_data_fallback.patch
new file mode 100644
index 0000000000..4e40a87558
--- /dev/null
+++ b/package/network/services/hostapd/patches/470-survey_data_fallback.patch
@@ -0,0 +1,45 @@
+--- a/src/ap/acs.c
++++ b/src/ap/acs.c
+@@ -292,18 +292,12 @@ static void acs_fail(struct hostapd_ifac
+ static long double
+ acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf)
+ {
+- long double factor, busy, total;
++ long double factor, busy = 0, total;
+
+ if (survey->filled & SURVEY_HAS_CHAN_TIME_BUSY)
+ busy = survey->channel_time_busy;
+ else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX)
+ busy = survey->channel_time_rx;
+- else {
+- /* This shouldn't really happen as survey data is checked in
+- * acs_sanity_check() */
+- wpa_printf(MSG_ERROR, "ACS: Survey data missing");
+- return 0;
+- }
+
+ total = survey->channel_time;
+
+@@ -395,20 +389,19 @@ static int acs_usable_vht80_chan(struct
+ static int acs_survey_is_sufficient(struct freq_survey *survey)
+ {
+ if (!(survey->filled & SURVEY_HAS_NF)) {
++ survey->nf = -95;
+ wpa_printf(MSG_INFO, "ACS: Survey is missing noise floor");
+- return 0;
+ }
+
+ if (!(survey->filled & SURVEY_HAS_CHAN_TIME)) {
++ survey->channel_time = 0;
+ wpa_printf(MSG_INFO, "ACS: Survey is missing channel time");
+- return 0;
+ }
+
+ if (!(survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) &&
+ !(survey->filled & SURVEY_HAS_CHAN_TIME_RX)) {
+ wpa_printf(MSG_INFO,
+ "ACS: Survey is missing RX and busy time (at least one is required)");
+- return 0;
+ }
+
+ return 1;
diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch
index d5767259b6..feacdf2c08 100644
--- a/package/network/services/hostapd/patches/600-ubus_support.patch
+++ b/package/network/services/hostapd/patches/600-ubus_support.patch
@@ -1,6 +1,6 @@
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
-@@ -155,6 +155,11 @@ OBJS += ../src/common/hw_features_common
+@@ -157,6 +157,11 @@ OBJS += ../src/common/hw_features_common
OBJS += ../src/eapol_auth/eapol_auth_sm.o
@@ -22,7 +22,7 @@
struct wpa_ctrl_dst;
struct radius_server_data;
-@@ -107,6 +108,7 @@ struct hostapd_data {
+@@ -118,6 +119,7 @@ struct hostapd_data {
struct hostapd_iface *iface;
struct hostapd_config *iconf;
struct hostapd_bss_config *conf;
@@ -30,7 +30,7 @@
int interface_added; /* virtual interface added for this BSS */
unsigned int started:1;
unsigned int disabled:1;
-@@ -299,6 +301,8 @@ struct hostapd_iface {
+@@ -323,6 +325,8 @@ struct hostapd_iface {
struct hostapd_config *conf;
char phy[16]; /* Name of the PHY (radio) */
@@ -661,7 +661,7 @@
+#endif
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -280,6 +280,7 @@ static void hostapd_free_hapd_data(struc
+@@ -284,6 +284,7 @@ static void hostapd_free_hapd_data(struc
hapd->started = 0;
wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
@@ -669,7 +669,7 @@
iapp_deinit(hapd->iapp);
hapd->iapp = NULL;
accounting_deinit(hapd);
-@@ -1118,6 +1119,8 @@ static int hostapd_setup_bss(struct host
+@@ -1139,6 +1140,8 @@ static int hostapd_setup_bss(struct host
if (hapd->driver && hapd->driver->set_operstate)
hapd->driver->set_operstate(hapd->drv_priv, 1);
@@ -678,7 +678,7 @@
return 0;
}
-@@ -1523,6 +1526,7 @@ static int hostapd_setup_interface_compl
+@@ -1664,6 +1667,7 @@ static int hostapd_setup_interface_compl
if (err)
goto fail;
@@ -686,7 +686,7 @@
wpa_printf(MSG_DEBUG, "Completing interface initialization");
if (iface->conf->channel) {
#ifdef NEED_AP_MLME
-@@ -1700,6 +1704,7 @@ dfs_offload:
+@@ -1844,6 +1848,7 @@ dfs_offload:
fail:
wpa_printf(MSG_ERROR, "Interface initialization failed");
@@ -694,7 +694,7 @@
hostapd_set_state(iface, HAPD_IFACE_DISABLED);
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
#ifdef CONFIG_FST
-@@ -2125,6 +2130,7 @@ void hostapd_interface_deinit_free(struc
+@@ -2277,6 +2282,7 @@ void hostapd_interface_deinit_free(struc
(unsigned int) iface->conf->num_bss);
driver = iface->bss[0]->driver;
drv_priv = iface->bss[0]->drv_priv;
@@ -704,7 +704,7 @@
__func__, driver, drv_priv);
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -877,7 +877,8 @@ int auth_sae_init_committed(struct hosta
+@@ -980,7 +980,8 @@ int auth_sae_init_committed(struct hosta
static void handle_auth(struct hostapd_data *hapd,
@@ -714,7 +714,7 @@
{
u16 auth_alg, auth_transaction, status_code;
u16 resp = WLAN_STATUS_SUCCESS;
-@@ -893,6 +894,11 @@ static void handle_auth(struct hostapd_d
+@@ -996,6 +997,11 @@ static void handle_auth(struct hostapd_d
char *identity = NULL;
char *radius_cui = NULL;
u16 seq_ctrl;
@@ -724,9 +724,9 @@
+ .frame_info = fi,
+ };
- if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
- wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
-@@ -1044,6 +1050,14 @@ static void handle_auth(struct hostapd_d
+ os_memset(&vlan_id, 0, sizeof(vlan_id));
+
+@@ -1149,6 +1155,14 @@ static void handle_auth(struct hostapd_d
resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
goto fail;
}
@@ -741,7 +741,7 @@
if (res == HOSTAPD_ACL_PENDING) {
wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR
" waiting for an external authentication",
-@@ -1776,13 +1790,18 @@ static void send_assoc_resp(struct hosta
+@@ -2033,13 +2047,18 @@ static u16 send_assoc_resp(struct hostap
static void handle_assoc(struct hostapd_data *hapd,
const struct ieee80211_mgmt *mgmt, size_t len,
@@ -749,7 +749,7 @@
+ int reassoc, struct hostapd_frame_info *fi)
{
u16 capab_info, listen_interval, seq_ctrl, fc;
- u16 resp = WLAN_STATUS_SUCCESS;
+ u16 resp = WLAN_STATUS_SUCCESS, reply_res;
const u8 *pos;
int left, i;
struct sta_info *sta;
@@ -761,9 +761,9 @@
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
sizeof(mgmt->u.assoc_req))) {
-@@ -1902,6 +1921,13 @@ static void handle_assoc(struct hostapd_
- goto fail;
+@@ -2159,6 +2178,13 @@ static void handle_assoc(struct hostapd_
}
+ #endif /* CONFIG_MBO */
+ if (hostapd_ubus_handle_event(hapd, &req)) {
+ wpa_printf(MSG_DEBUG, "Station " MACSTR " assoc rejected by ubus handler.\n",
@@ -772,10 +772,10 @@
+ goto fail;
+ }
+
- sta->capability = capab_info;
- sta->listen_interval = listen_interval;
-
-@@ -2328,7 +2354,7 @@ int ieee802_11_mgmt(struct hostapd_data
+ /*
+ * sta->capability is used in check_assoc_ies() for RRM enabled
+ * capability element.
+@@ -2639,7 +2665,7 @@ int ieee802_11_mgmt(struct hostapd_data
if (stype == WLAN_FC_STYPE_PROBE_REQ) {
@@ -784,7 +784,7 @@
return 1;
}
-@@ -2346,17 +2372,17 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -2657,17 +2683,17 @@ int ieee802_11_mgmt(struct hostapd_data
switch (stype) {
case WLAN_FC_STYPE_AUTH:
wpa_printf(MSG_DEBUG, "mgmt::auth");
@@ -807,7 +807,7 @@
case WLAN_FC_STYPE_DISASSOC:
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
-@@ -667,7 +667,7 @@ sta_track_seen_on(struct hostapd_iface *
+@@ -675,7 +675,7 @@ sta_track_seen_on(struct hostapd_iface *
void handle_probe_req(struct hostapd_data *hapd,
const struct ieee80211_mgmt *mgmt, size_t len,
@@ -816,7 +816,7 @@
{
u8 *resp;
struct ieee802_11_elems elems;
-@@ -676,9 +676,15 @@ void handle_probe_req(struct hostapd_dat
+@@ -684,9 +684,15 @@ void handle_probe_req(struct hostapd_dat
size_t i, resp_len;
int noack;
enum ssid_match_result res;
@@ -830,9 +830,9 @@
+ .frame_info = fi,
+ };
- ie = mgmt->u.probe_req.variable;
- if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req))
-@@ -830,6 +836,12 @@ void handle_probe_req(struct hostapd_dat
+ if (len < IEEE80211_HDRLEN)
+ return;
+@@ -838,6 +844,12 @@ void handle_probe_req(struct hostapd_dat
}
#endif /* CONFIG_P2P */
@@ -858,7 +858,7 @@
int ieee802_11_update_beacons(struct hostapd_iface *iface);
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
-@@ -51,6 +51,10 @@ int hostapd_notif_assoc(struct hostapd_d
+@@ -52,6 +52,10 @@ int hostapd_notif_assoc(struct hostapd_d
u16 reason = WLAN_REASON_UNSPECIFIED;
u16 status = WLAN_STATUS_SUCCESS;
const u8 *p2p_dev_addr = NULL;
@@ -869,7 +869,7 @@
if (addr == NULL) {
/*
-@@ -123,6 +127,12 @@ int hostapd_notif_assoc(struct hostapd_d
+@@ -124,6 +128,12 @@ int hostapd_notif_assoc(struct hostapd_d
goto fail;
}
diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile
index 94a2a1a3ac..70c61e58ae 100644
--- a/package/system/mtd/src/Makefile
+++ b/package/system/mtd/src/Makefile
@@ -12,6 +12,7 @@ obj.brcm63xx = imagetag.o
obj.ramips = $(obj.seama)
obj.mvebu = linksys_bootcount.o
obj.kirkwood = linksys_bootcount.o
+obj.ipq806x = linksys_bootcount.o
ifdef FIS_SUPPORT
obj += fis.o
diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile
index e90a752080..9da52d8a2c 100644
--- a/package/utils/e2fsprogs/Makefile
+++ b/package/utils/e2fsprogs/Makefile
@@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=e2fsprogs
-PKG_VERSION:=1.42.13
-PKG_MD5SUM:=bc759fc62666786f5436e2075beb3265
+PKG_VERSION:=1.43.1
+PKG_MD5SUM:=1775f3f0eed9dee1c5f39e08d1964a97
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/scripts/getver.sh b/scripts/getver.sh
index 6cf7797519..549d529e42 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -18,8 +18,8 @@ try_svn() {
try_git() {
git rev-parse --git-dir >/dev/null 2>&1 || return 1
- REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $0); print $1 }')"
- REV="${REV:+r$REV}"
+ REV="$(git describe --tags | sed "s/trunk-\([0-9]*\)-.*/\1/g")"
+ REV="$((REV+12009))"
[ -n "$REV" ]
}
@@ -30,5 +30,5 @@ try_hg() {
[ -n "$REV" ]
}
-try_version || try_svn || try_git || try_hg || REV="unknown"
+try_version || try_git || try_hg || REV="unknown"
echo "$REV"
diff --git a/target/linux/adm5120/rb1xx/target.mk b/target/linux/adm5120/rb1xx/target.mk
index 34d10a9649..8774794af6 100644
--- a/target/linux/adm5120/rb1xx/target.mk
+++ b/target/linux/adm5120/rb1xx/target.mk
@@ -1,5 +1,4 @@
ARCH:=mipsel
-ARCH_PACKAGES:=adm5120_mipsel
SUBTARGET:=rb1xx
BOARDNAME:=MikroTik RB-1xx boards
FEATURES+=tgz
diff --git a/target/linux/adm5120/router_be/target.mk b/target/linux/adm5120/router_be/target.mk
index 9cbf00b3eb..f9119c51c1 100644
--- a/target/linux/adm5120/router_be/target.mk
+++ b/target/linux/adm5120/router_be/target.mk
@@ -1,5 +1,4 @@
ARCH:=mips
-ARCH_PACKAGES:=adm5120_mips
SUBTARGET:=router_be
BOARDNAME:=Big Endian
FEATURES+=squashfs
diff --git a/target/linux/adm5120/router_le/target.mk b/target/linux/adm5120/router_le/target.mk
index 6847d00e14..ea2a66c5f4 100644
--- a/target/linux/adm5120/router_le/target.mk
+++ b/target/linux/adm5120/router_le/target.mk
@@ -1,5 +1,4 @@
ARCH:=mipsel
-ARCH_PACKAGES:=adm5120_mipsel
SUBTARGET:=router_le
BOARDNAME:=Little Endian
FEATURES+=squashfs tgz
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index ca79f98c97..996bc5b1ac 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -342,3 +342,23 @@ define Device/c-55
endef
TARGET_DEVICES += c-55
+
+
+define Build/uImageHiWiFi
+ # Field ih_name needs to start with "tw150v1"
+ mkimage -A $(LINUX_KARCH) \
+ -O linux -T kernel \
+ -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
+ -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' -d $@ $@.new
+ @mv $@.new $@
+endef
+
+define Device/hiwifi-hc6361
+ BOARDNAME := HiWiFi-HC6361
+ DEVICE_PROFILE := HIWIFI_HC6361
+ IMAGE_SIZE := 16128k
+ KERNEL := kernel-bin | patch-cmdline | lzma | uImageHiWiFi lzma
+ CONSOLE := ttyATH0,115200
+ MTDPARTS := spi0.0:64k(u-boot)ro,64k(bdinfo)ro,16128k(firmware),64k(backup)ro,64k(art)ro
+endef
+TARGET_DEVICES += hiwifi-hc6361
diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk
index 12e2f55463..1d8898a232 100644
--- a/target/linux/ar71xx/image/legacy.mk
+++ b/target/linux/ar71xx/image/legacy.mk
@@ -285,7 +285,6 @@ f9k1115v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),14464k(rootfs
dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,640k(certs),960k(unknown)ro,64k@0x7f0000(caldata_copy)
dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig)
dragino2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,16000k(firmware),64k(config)ro,64k(art)ro
-hiwifi_hc6361_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(bdinfo)ro,1280k(kernel),14848k(rootfs),64k(backup)ro,64k(art)ro,16128k@0x20000(firmware)
mr12_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
mr16_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
pb92_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
@@ -577,22 +576,6 @@ Image/Build/EnGenius/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
Image/Build/EnGenius/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
-define MkuImageHiWiFi
- # Field ih_name needs to start with "tw150v1"
- mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
- -e 0x80060000 -n 'tw150v1 MIPS OpenWrt Linux-$(LINUX_VERSION)' \
- -d $(3) $(4)
-endef
-
-define MkuImageLzmaHiWiFi
- $(call PatchKernelLzma,$(1),$(2),$(3),$(4))
- $(call MkuImageHiWiFi,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage)
-endef
-
-Image/Build/HiWiFi/buildkernel=$(call MkuImageLzmaHiWiFi,$(2),$(3) $(4))
-Image/Build/HiWiFi=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
-Image/Build/HiWiFi/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
-
Image/Build/PB4X/buildkernel=$(call PatchKernelLzma,$(2),$(3))
define Image/Build/PB4X
@@ -1078,8 +1061,6 @@ $(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(es
$(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
$(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71))
-$(eval $(call SingleProfile,HiWiFi,64k,HIWIFI_HC6361,hiwifi-hc6361,HiWiFi-HC6361,ttyATH0,115200,$$(hiwifi_hc6361_mtdlayout),KRuImage))
-
$(eval $(call SingleProfile,MyLoader,64k,WP543_2M,wp543,,ttyS0,115200,0x200000,2M))
$(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M))
$(eval $(call SingleProfile,MyLoader,64k,WP543_8M,wp543,,ttyS0,115200,0x800000,8M))
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 71220f3141..c30ccb1c31 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -35,18 +35,6 @@ define Build/mktplinkfw-initramfs
@mv $@.new $@
endef
-define Build/tplink-safeloader
- -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
- -B $(TPLINK_BOARD_NAME) \
- -V $(REVISION) \
- -k $(word 1,$^) \
- -r $@ \
- -o $@.new \
- -j \
- $(wordlist 2,$(words $(1)),$(1)) \
- $(if $(findstring sysupgrade,$(word 1,$(1))),-S) && mv $@.new $@ || rm -f $@
-endef
-
define Device/tplink
TPLINK_HWREV := 0x1
TPLINK_HEADER_VERSION := 1
diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile
index 97a40cfe07..19310a5585 100644
--- a/target/linux/ipq806x/Makefile
+++ b/target/linux/ipq806x/Makefile
@@ -5,19 +5,22 @@ include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=ipq806x
BOARDNAME:=Qualcomm Atheros IPQ806X
-FEATURES:=squashfs nand ubifs
+FEATURES:=squashfs nand ubifs fpu
CPU_TYPE:=cortex-a9
CPU_SUBTYPE:=neon-vfpv4
MAINTAINER:=John Crispin <blogic@openwrt.org>
-KERNEL_PATCHVER:=3.18
+KERNEL_PATCHVER:=4.4
KERNELNAME:=zImage Image dtbs
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += \
kmod-leds-gpio kmod-gpio-button-hotplug swconfig \
- kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform
-
+ kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform \
+ kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
+ kmod-usb3 kmod-usb-dwc3-qcom kmod-usb-phy-qcom-dwc3 \
+ kmod-ath10k wpad-mini \
+ uboot-envtools
$(eval $(call BuildTarget))
diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds
index b32c1cc21d..17f1a28abc 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -11,14 +11,26 @@ board_config_update
board=$(ipq806x_board_name)
case "$board" in
+c2600)
+ ucidef_set_led_usbdev "usb1" "USB 1" "usb_2:blue" "2-1"
+ ucidef_set_led_usbdev "usb2" "USB 2" "usb_4:blue" "4-1"
+ ucidef_set_led_netdev "wan" "WAN" "wan:blue" "eth0"
+ ucidef_set_led_netdev "lan" "LAN" "lan:blue" "br-lan"
+ ucidef_set_led_default "general" "general" "ledgnr:blue" "1"
+ ;;
d7800 |\
-r7500)
- ucidef_set_led_usbdev "usb1" "USB 1" "r7500:white:usb1" "1-1"
- ucidef_set_led_usbdev "usb2" "USB 2" "r7500:white:usb3" "3-1"
- ucidef_set_led_netdev "wan" "WAN" "r7500:white:wan" "eth0"
- ucidef_set_led_ide "esata" "eSATA" "r7500:amber:esata"
- ucidef_set_led_default "wps" "WPS" "r7500:white:wps" "0"
- ucidef_set_led_default "rfkill" "rfkill" "r7500:white:rfkill" "0"
+r7500 |\
+r7800)
+ ucidef_set_led_usbdev "usb1" "USB 1" "${board}:white:usb1" "1-1"
+ ucidef_set_led_usbdev "usb2" "USB 2" "${board}:white:usb3" "3-1"
+ ucidef_set_led_netdev "wan" "WAN" "${board}:white:wan" "eth0"
+ ucidef_set_led_ide "esata" "eSATA" "${board}:amber:esata"
+ ucidef_set_led_default "wps" "WPS" "${board}:white:wps" "0"
+ ucidef_set_led_default "rfkill" "rfkill" "${board}:white:rfkill" "0"
+ ;;
+ea8500)
+ ucidef_set_led_wlan "wifi" "WIFI" "ea8500:green:wifi" "phy0radio"
+ ucidef_set_led_default "wps" "WPS" "ea8500:green:wps" "0"
;;
*)
;;
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network
index 6e18297e99..16cc13cfc0 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -6,6 +6,7 @@
. /lib/functions/uci-defaults.sh
. /lib/ipq806x.sh
+. /lib/functions/system.sh
board_config_update
@@ -13,8 +14,10 @@ board=$(ipq806x_board_name)
case "$board" in
ap148 |\
+c2600 |\
d7800 |\
-r7500)
+r7500 |\
+r7800)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
;;
@@ -23,6 +26,14 @@ db149)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
;;
+ea8500)
+
+ hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+ ucidef_add_switch "switch0" \
+ "1:lan" "2:lan" "3:lan" "4:lan" "0t@eth0" "5:wan" "0t@eth0"
+ ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
+ ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
+ ;;
*)
echo "Unsupported hardware. Network interfaces not intialized"
;;
diff --git a/target/linux/ipq806x/base-files/etc/diag.sh b/target/linux/ipq806x/base-files/etc/diag.sh
new file mode 100755
index 0000000000..6b3622dc58
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/diag.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+. /lib/functions/leds.sh
+. /lib/ipq806x.sh
+
+get_status_led() {
+ case $(ipq806x_board_name) in
+ c2600)
+ status_led="status:blue"
+ ;;
+ ea8500)
+ status_led="ea8500:white:power"
+ ;;
+ esac
+}
+
+set_state() {
+ get_status_led
+
+ case "$1" in
+ preinit)
+ status_led_blink_preinit
+ ;;
+ failsafe)
+ status_led_blink_failsafe
+ ;;
+ preinit_regular)
+ status_led_blink_preinit_regular
+ ;;
+ done)
+ status_led_on
+ ;;
+ esac
+}
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
new file mode 100644
index 0000000000..a23dd80a00
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+ath10kcal_die() {
+ echo "ath10cal: " "$*"
+ exit 1
+}
+
+ath10kcal_from_file() {
+ local source=$1
+ local offset=$2
+ local count=$3
+
+ dd if=$source of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ ath10kcal_die "failed to extract calibration data from $source"
+}
+
+ath10kcal_extract() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local mtd
+
+ mtd=$(find_mtd_chardev $part)
+ [ -n "$mtd" ] || \
+ ath10kcal_die "no mtd device found for partition $part"
+
+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ ath10kcal_die "failed to extract calibration data from $mtd"
+}
+
+ath10kcal_patch_mac() {
+ local mac=$1
+
+ [ -z "$mac" ] && return
+
+ macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=6 count=6
+}
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/ipq806x.sh
+. /lib/functions.sh
+. /lib/functions/system.sh
+
+board=$(ipq806x_board_name)
+
+
+case "$FIRMWARE" in
+"ath10k/cal-pci-0000:01:00.0.bin")
+ case $board in
+ c2600)
+ ath10kcal_extract "radio" 4096 12064
+# ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 8) -1)
+ ;;
+ ea8500)
+ hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+ ath10kcal_extract "art" 4096 12064
+ ;;
+ r7800)
+ ath10kcal_extract "art" 4096 12064
+ ;;
+ esac
+ ;;
+"ath10k/cal-pci-0001:01:00.0.bin")
+ case $board in
+ c2600)
+ ath10kcal_extract "radio" 20480 12064
+# ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 8) -2)
+ ;;
+ ea8500)
+ hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+ ath10kcal_extract "art" 20480 12064
+ ;;
+ r7800)
+ ath10kcal_extract "art" 20480 12064
+ ;;
+ esac
+ ;;
+*)
+ exit 1
+ ;;
+esac
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
new file mode 100644
index 0000000000..1ae4352686
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -0,0 +1,23 @@
+#!/bin/ash
+
+[ "$ACTION" == "add" ] || exit 0
+
+PHYNBR=${DEVPATH##*/phy}
+
+[ -n $PHYNBR ] || exit 0
+
+. /lib/ipq806x.sh
+. /lib/functions/system.sh
+
+board=$(ipq806x_board_name)
+
+case "$board" in
+ c2600)
+ echo $(macaddr_add $(mtd_get_mac_binary default-mac 8) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
+ ;;
+ ea8500)
+ echo $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
+ ;;
+ *)
+ ;;
+esac
diff --git a/target/linux/ipq806x/base-files/etc/init.d/linksys_recovery b/target/linux/ipq806x/base-files/etc/init.d/linksys_recovery
new file mode 100755
index 0000000000..b9ea004207
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/init.d/linksys_recovery
@@ -0,0 +1,20 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=97
+boot() {
+. /lib/functions.sh
+. /lib/ipq806x.sh
+
+case $(ipq806x_board_name) in
+ ea8500)
+ # make sure auto_recovery in uboot is always on
+ AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
+ if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then
+ fw_setenv auto_recovery yes
+ fi
+ # reset the boot counter
+ mtd resetbc s_env
+ ;;
+esac
+}
diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh b/target/linux/ipq806x/base-files/lib/ipq806x.sh
index db227087f4..adac916f6b 100644
--- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
+++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
@@ -17,6 +17,9 @@ ipq806x_board_detect() {
*"AP148")
name="ap148"
;;
+ *"C2600")
+ name="c2600"
+ ;;
*"D7800")
name="d7800"
;;
@@ -26,6 +29,12 @@ ipq806x_board_detect() {
*"R7500")
name="r7500"
;;
+ *"Linksys EA8500"*)
+ name="ea8500"
+ ;;
+ *"R7800")
+ name="r7800"
+ ;;
esac
[ -z "$name" ] && name="unknown"
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh b/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh
new file mode 100644
index 0000000000..ca5161a61b
--- /dev/null
+++ b/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh
@@ -0,0 +1,88 @@
+#
+# Copyright (C) 2014-2015 OpenWrt.org
+#
+
+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="kernel2"
+ fw_setenv boot_part 2
+ #In EA8500 bootcmd is always "bootipq", so don't change
+ #fw_setenv bootcmd "run altnandboot"
+ elif [ "$cur_boot_part" = "2" ]
+ then
+ # current alt boot - update primary boot
+ target_firmware="kernel1"
+ fw_setenv boot_part 1
+ #In EA8500 bootcmd is always "bootipq", so don't change
+ #fw_setenv bootcmd "run nandboot"
+ fi
+
+ # re-enable recovery so we get back if the new firmware is broken
+ fw_setenv auto_recovery yes
+
+ echo "$target_firmware"
+}
+
+linksys_get_root_magic() {
+ (get_image "$@" | dd skip=786432 bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2>/dev/null
+}
+
+platform_do_upgrade_linksys() {
+ local magic_long="$(get_magic_long "$1")"
+
+ mkdir -p /var/lock
+ local part_label="$(linksys_get_target_firmware)"
+ touch /var/lock/fw_printenv.lock
+
+ if [ ! -n "$part_label" ]
+ then
+ echo "cannot find target partition"
+ exit 1
+ fi
+
+ local target_mtd=$(find_mtd_part $part_label)
+
+ [ "$magic_long" = "73797375" ] && {
+ CI_KERNPART="$part_label"
+ if [ "$part_label" = "kernel1" ]
+ then
+ CI_UBIPART="rootfs1"
+ else
+ CI_UBIPART="rootfs2"
+ fi
+
+ nand_upgrade_tar "$1"
+ }
+ [ "$magic_long" = "27051956" ] && {
+ # check firmwares' rootfs types
+ local target_mtd=$(find_mtd_part $part_label)
+ local oldroot="$(linksys_get_root_magic $target_mtd)"
+ local newroot="$(linksys_get_root_magic "$1")"
+
+ if [ "$newroot" = "55424923" -a "$oldroot" = "55424923" ]
+ # we're upgrading from a firmware with UBI to one with UBI
+ then
+ # erase everything to be safe
+ mtd erase $part_label
+ get_image "$1" | mtd -n write - $part_label
+ else
+ get_image "$1" | mtd write - $part_label
+ fi
+ }
+}
+
+linksys_preupgrade() {
+ export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/sbin/fw_printenv /usr/sbin/fw_setenv"
+ export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /bin/mkdir /bin/touch"
+ export RAMFS_COPY_DATA="${RAMFS_COPY_DATA} /etc/fw_env.config /var/lock/fw_printenv.lock"
+
+ [ -f /tmp/sysupgrade.tgz ] && {
+ cp /tmp/sysupgrade.tgz /tmp/syscfg/sysupgrade.tgz
+ }
+}
+
+append sysupgrade_pre_upgrade linksys_preupgrade
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 542b5cecde..cfd7cd7ed6 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -8,10 +8,20 @@ platform_check_image() {
case "$board" in
ap148 |\
d7800 |\
- r7500)
+ ea8500 |\
+ r7500 |\
+ r7800)
nand_do_platform_check $board $1
return $?;
;;
+ c2600)
+ local magic_long="$(get_magic_long "$1")"
+ [ "$magic_long" != "27051956" ] && {
+ echo "Invalid image, bad magic: $magic_long"
+ return 1
+ }
+ return 0;
+ ;;
*)
return 1;
esac
@@ -23,10 +33,27 @@ platform_pre_upgrade() {
case "$board" in
ap148 |\
d7800 |\
- r7500)
+ r7500 |\
+ r7800)
nand_do_upgrade "$1"
;;
+ ea8500)
+ linksys_preupgrade "$1"
+ ;;
esac
}
-# use default for platform_do_upgrade()
+platform_do_upgrade() {
+ local board=$(ipq806x_board_name)
+
+ case "$board" in
+ c2600)
+ PART_NAME="os-image:rootfs"
+ MTD_CONFIG_ARGS="-s 0x200000"
+ default_do_upgrade "$ARGV"
+ ;;
+ ea8500)
+ platform_do_upgrade_linksys "$ARGV"
+ ;;
+ esac
+}
diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 40e3a75f8c..68a8933748 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -314,6 +314,7 @@ CONFIG_PCI=y
CONFIG_PCIEAER=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCIE_DW=y
+CONFIG_PCIE_PME=y
CONFIG_PCIE_QCOM=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_MSI=y
@@ -334,6 +335,7 @@ CONFIG_PM=y
CONFIG_PM_CLK=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_OPP=y
+CONFIG_PM_RUNTIME=y
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_POWER_RESET=y
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.4
index b9ce6e79fd..a6badc9a52 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.4
@@ -37,11 +37,14 @@ CONFIG_ARM_AMBA=y
CONFIG_ARM_APPENDED_DTB=y
CONFIG_ARM_ARCH_TIMER=y
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
-# CONFIG_ARM_ATAG_DTB_COMPAT is not set
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE=y
CONFIG_ARM_CCI=y
CONFIG_ARM_CCI400_COMMON=y
CONFIG_ARM_CCI400_PMU=y
-# CONFIG_ARM_CPUIDLE is not set
+CONFIG_ARM_CCI_PMU=y
CONFIG_ARM_CPU_SUSPEND=y
CONFIG_ARM_GIC=y
CONFIG_ARM_HAS_SG_CHAIN=y
@@ -49,6 +52,7 @@ CONFIG_ARM_L1_CACHE_SHIFT=6
CONFIG_ARM_L1_CACHE_SHIFT_6=y
# CONFIG_ARM_LPAE is not set
CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_ARM_PMU=y
CONFIG_ARM_QCOM_CPUFREQ=y
# CONFIG_ARM_SMMU is not set
# CONFIG_ARM_SP805_WATCHDOG is not set
@@ -65,6 +69,7 @@ CONFIG_BUILD_BIN2C=y
CONFIG_CLEANCACHE=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLKSRC_OF=y
+CONFIG_CLKSRC_PROBE=y
CONFIG_CLKSRC_QCOM=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_COMMON_CLK=y
@@ -83,18 +88,13 @@ CONFIG_CPU_COPY_V6=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
CONFIG_CPU_FREQ=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_STAT=y
-# CONFIG_CPU_FREQ_STAT_DETAILS is not set
CONFIG_CPU_HAS_ASID=y
# CONFIG_CPU_ICACHE_DISABLE is not set
CONFIG_CPU_IDLE=y
@@ -131,16 +131,14 @@ CONFIG_DMA_VIRTUAL_CHANNELS=y
CONFIG_DTC=y
# CONFIG_DWMAC_GENERIC is not set
CONFIG_DWMAC_IPQ806X=y
-# CONFIG_DWMAC_LPC18XX is not set
-# CONFIG_DWMAC_MESON is not set
-# CONFIG_DWMAC_ROCKCHIP is not set
-# CONFIG_DWMAC_SOCFPGA is not set
-# CONFIG_DWMAC_STI is not set
# CONFIG_DWMAC_SUNXI is not set
# CONFIG_DW_DMAC_PCI is not set
CONFIG_DYNAMIC_DEBUG=y
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
CONFIG_ETHERNET_PACKET_MANGLE=y
CONFIG_FIXED_PHY=y
+CONFIG_FIX_EARLYCON_MEM=y
CONFIG_FREEZER=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_BUG=y
@@ -163,7 +161,6 @@ CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_IRQCHIP=y
CONFIG_GPIO_DEVRES=y
-# CONFIG_GPIO_MSM_V2 is not set
CONFIG_GPIO_SYSFS=y
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_HARDIRQS_SW_RESEND=y
@@ -221,7 +218,6 @@ CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HIGHMEM=y
CONFIG_HIGHPTE=y
CONFIG_HOTPLUG_CPU=y
-# CONFIG_HSU_DMA_PCI is not set
CONFIG_HWMON=y
CONFIG_HWSPINLOCK=y
CONFIG_HWSPINLOCK_QCOM=y
@@ -265,6 +261,7 @@ CONFIG_MFD_SYSCON=y
CONFIG_MIGHT_HAVE_CACHE_L2X0=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_MIGRATION=y
+CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_MODULES_USE_ELF_REL=y
CONFIG_MSM_GCC_8660=y
# CONFIG_MSM_GCC_8916 is not set
@@ -292,9 +289,12 @@ CONFIG_MULTI_IRQ_HANDLER=y
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEON=y
+CONFIG_NET_DSA=y
+# CONFIG_NET_DSA_AR8XXX is not set
+CONFIG_NET_DSA_HWMON=y
CONFIG_NET_FLOW_LIMIT=y
CONFIG_NET_PTP_CLASSIFY=y
-CONFIG_NET_VENDOR_WIZNET=y
+CONFIG_NET_SWITCHDEV=y
CONFIG_NO_BOOTMEM=y
CONFIG_NO_HZ=y
CONFIG_NO_HZ_COMMON=y
@@ -315,13 +315,11 @@ CONFIG_OF_PCI_IRQ=y
CONFIG_OF_RESERVED_MEM=y
CONFIG_OLD_SIGACTION=y
CONFIG_OLD_SIGSUSPEND3=y
-CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_PCI=y
CONFIG_PCIEAER=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCIE_DW=y
-# CONFIG_PCIE_IPROC is not set
CONFIG_PCIE_PME=y
CONFIG_PCIE_QCOM=y
CONFIG_PCI_DEBUG=y
@@ -340,19 +338,23 @@ CONFIG_PINCTRL_APQ8064=y
# CONFIG_PINCTRL_APQ8084 is not set
CONFIG_PINCTRL_IPQ8064=y
CONFIG_PINCTRL_MSM=y
+# CONFIG_PINCTRL_MSM8660 is not set
# CONFIG_PINCTRL_MSM8916 is not set
# CONFIG_PINCTRL_MSM8960 is not set
CONFIG_PINCTRL_MSM8X74=y
# CONFIG_PINCTRL_QCOM_SPMI_PMIC is not set
+# CONFIG_PINCTRL_QCOM_SSBI_PMIC is not set
# CONFIG_PL330_DMA is not set
CONFIG_PM=y
CONFIG_PM_CLK=y
# CONFIG_PM_DEBUG is not set
+CONFIG_PM_GENERIC_DOMAINS=y
+CONFIG_PM_GENERIC_DOMAINS_OF=y
+CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
CONFIG_PM_OPP=y
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_POWER_RESET=y
-# CONFIG_POWER_RESET_BRCMSTB is not set
CONFIG_POWER_RESET_MSM=y
CONFIG_POWER_SUPPLY=y
CONFIG_PPS=y
@@ -365,12 +367,18 @@ CONFIG_PROC_PAGE_MONITOR=y
CONFIG_PTP_1588_CLOCK=y
CONFIG_QCOM_ADM=y
CONFIG_QCOM_BAM_DMA=y
+CONFIG_QCOM_GDSC=y
CONFIG_QCOM_GSBI=y
CONFIG_QCOM_HFPLL=y
+# CONFIG_QCOM_PM is not set
CONFIG_QCOM_SCM=y
+CONFIG_QCOM_SCM_32=y
+# CONFIG_QCOM_SMD is not set
CONFIG_QCOM_SMEM=y
+# CONFIG_QCOM_SPMI_TEMP_ALARM is not set
CONFIG_QCOM_WDT=y
CONFIG_RAS=y
+CONFIG_RATIONAL=y
# CONFIG_RCU_BOOST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=21
CONFIG_RCU_STALL_COMMON=y
@@ -379,6 +387,7 @@ CONFIG_REGMAP=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_QCOM_RPM=y
+# CONFIG_REGULATOR_QCOM_SPMI is not set
CONFIG_RESET_CONTROLLER=y
CONFIG_RFS_ACCEL=y
CONFIG_RPS=y
@@ -387,14 +396,13 @@ CONFIG_RTC_CLASS=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_SCHED_HRTICK=y
+# CONFIG_SCHED_INFO is not set
# CONFIG_SCSI_DMA is not set
+CONFIG_SERIAL_8250_FSL=y
# CONFIG_SERIAL_AMBA_PL010 is not set
# CONFIG_SERIAL_AMBA_PL011 is not set
CONFIG_SERIAL_MSM=y
CONFIG_SERIAL_MSM_CONSOLE=y
-# CONFIG_SLAB is not set
-CONFIG_SLUB=y
-CONFIG_SLUB_CPU_PARTIAL=y
CONFIG_SMP=y
CONFIG_SMP_ON_UP=y
CONFIG_SPARSE_IRQ=y
@@ -406,7 +414,6 @@ CONFIG_SPMI_MSM_PMIC_ARB=y
CONFIG_SRCU=y
CONFIG_STMMAC_ETH=y
CONFIG_STMMAC_PLATFORM=y
-CONFIG_STOP_MACHINE=y
# CONFIG_STRIP_ASM_SYMS is not set
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
@@ -415,13 +422,8 @@ CONFIG_SWIOTLB=y
CONFIG_SWP_EMULATE=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_THERMAL=y
-# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
-# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
-# CONFIG_THERMAL_EMULATION is not set
-# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
-# CONFIG_THERMAL_GOV_USER_SPACE is not set
CONFIG_THERMAL_HWMON=y
CONFIG_THERMAL_OF=y
# CONFIG_THUMB2_KERNEL is not set
@@ -433,7 +435,6 @@ CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_XZ=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UEVENT_HELPER_PATH=""
-CONFIG_UID16=y
CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_USB_SUPPORT=y
@@ -444,8 +445,6 @@ CONFIG_VFP=y
CONFIG_VFPv3=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_WATCHDOG_CORE=y
-# CONFIG_WIZNET_W5100 is not set
-# CONFIG_WIZNET_W5300 is not set
# CONFIG_WL_TI is not set
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_XPS=y
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
new file mode 100644
index 0000000000..d62d53e7fa
--- /dev/null
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
@@ -0,0 +1,412 @@
+#include "qcom-ipq8064-v1.0.dtsi"
+#include <dt-bindings/input/input.h>
+
+/ {
+ model = "TP-Link Archer C2600";
+ compatible = "tplink,c2600", "qcom,ipq8064";
+
+ memory@0 {
+ reg = <0x42000000 0x1e000000>;
+ device_type = "memory";
+ };
+
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ rsvd@41200000 {
+ reg = <0x41200000 0x300000>;
+ no-map;
+ };
+ };
+
+ aliases {
+ serial0 = &uart4;
+ mdio-gpio0 = &mdio0;
+ };
+
+ chosen {
+ linux,stdout-path = "serial0:115200n8";
+ };
+
+ soc {
+ pinmux@800000 {
+ i2c4_pins: i2c4_pinmux {
+ pins = "gpio12", "gpio13";
+ function = "gsbi4";
+ bias-disable;
+ };
+
+ spi_pins: spi_pins {
+ mux {
+ pins = "gpio18", "gpio19", "gpio21";
+ function = "gsbi5";
+ drive-strength = <10>;
+ bias-none;
+ };
+ };
+
+ nand_pins: nand_pins {
+ mux {
+ pins = "gpio34", "gpio35", "gpio36",
+ "gpio37", "gpio38", "gpio39",
+ "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ function = "nand";
+ drive-strength = <10>;
+ bias-disable;
+ };
+
+ pullups {
+ pins = "gpio39";
+ bias-pull-up;
+ };
+
+ hold {
+ pins = "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ bias-bus-hold;
+ };
+ };
+
+ mdio0_pins: mdio0_pins {
+ mux {
+ pins = "gpio0", "gpio1";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+
+ rgmii2_pins: rgmii2_pins {
+ mux {
+ pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
+ "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
+ function = "rgmii2";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+ };
+
+ gsbi@16300000 {
+ qcom,mode = <GSBI_PROT_I2C_UART>;
+ status = "ok";
+ serial@16340000 {
+ status = "ok";
+ };
+ /*
+ * The i2c device on gsbi4 should not be enabled.
+ * On ipq806x designs gsbi4 i2c is meant for exclusive
+ * RPM usage. Turning this on in kernel manifests as
+ * i2c failure for the RPM.
+ */
+ };
+
+ gsbi5: gsbi@1a200000 {
+ qcom,mode = <GSBI_PROT_SPI>;
+ status = "ok";
+
+ spi4: spi@1a280000 {
+ status = "ok";
+ spi-max-frequency = <50000000>;
+
+ pinctrl-0 = <&spi_pins>;
+ pinctrl-names = "default";
+
+ cs-gpios = <&qcom_pinmux 20 0>;
+
+ flash: m25p80@0 {
+ compatible = "s25fl256s1";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ spi-max-frequency = <50000000>;
+ reg = <0>;
+
+ SBL1@0 {
+ label = "SBL1";
+ reg = <0x0 0x20000>;
+ read-only;
+ };
+ MIBIB@20000 {
+ label = "MIBIB";
+ reg = <0x20000 0x20000>;
+ read-only;
+ };
+ SBL2@40000 {
+ label = "SBL2";
+ reg = <0x40000 0x20000>;
+ read-only;
+ };
+ SBL3@60000 {
+ label = "SBL3";
+ reg = <0x60000 0x30000>;
+ read-only;
+ };
+ DDRCONFIG@90000 {
+ label = "DDRCONFIG";
+ reg = <0x90000 0x10000>;
+ read-only;
+ };
+ SSD@a0000 {
+ label = "SSD";
+ reg = <0xa0000 0x10000>;
+ read-only;
+ };
+ TZ@b0000 {
+ label = "TZ";
+ reg = <0xb0000 0x30000>;
+ read-only;
+ };
+ RPM@e0000 {
+ label = "RPM";
+ reg = <0xe0000 0x20000>;
+ read-only;
+ };
+ fs-uboot@100000 {
+ label = "fs-uboot";
+ reg = <0x100000 0x70000>;
+ read-only;
+ };
+ uboot-env@170000 {
+ label = "uboot-env";
+ reg = <0x170000 0x40000>;
+ read-only;
+ };
+ radio@1b0000 {
+ label = "radio";
+ reg = <0x1b0000 0x40000>;
+ read-only;
+ };
+ os-image@1f0000 {
+ label = "os-image";
+ reg = <0x1f0000 0x200000>;
+ };
+ rootfs@3f0000 {
+ label = "rootfs";
+ reg = <0x3f0000 0x1b00000>;
+ };
+ defaultmac: default-mac@1ef0000 {
+ label = "default-mac";
+ reg = <0x1ef0000 0x00200>;
+ read-only;
+ };
+ pin@1ef0200 {
+ label = "pin";
+ reg = <0x1ef0200 0x00200>;
+ read-only;
+ };
+ product-info@1ef0400 {
+ label = "product-info";
+ reg = <0x1ef0400 0x0fc00>;
+ read-only;
+ };
+ partition-table@1f00000 {
+ label = "partition-table";
+ reg = <0x1f00000 0x10000>;
+ read-only;
+ };
+ soft-version@1f10000 {
+ label = "soft-version";
+ reg = <0x1f10000 0x10000>;
+ read-only;
+ };
+ support-list@1f20000 {
+ label = "support-list";
+ reg = <0x1f20000 0x10000>;
+ read-only;
+ };
+ profile@1f30000 {
+ label = "profile";
+ reg = <0x1f30000 0x10000>;
+ read-only;
+ };
+ default-config@1f40000 {
+ label = "default-config";
+ reg = <0x1f40000 0x10000>;
+ read-only;
+ };
+ user-config@1f50000 {
+ label = "user-config";
+ reg = <0x1f50000 0x40000>;
+ read-only;
+ };
+ qos-db@1f90000 {
+ label = "qos-db";
+ reg = <0x1f90000 0x40000>;
+ read-only;
+ };
+ usb-config@1fd0000 {
+ label = "usb-config";
+ reg = <0x1fd0000 0x10000>;
+ read-only;
+ };
+ log@1fe0000 {
+ label = "log";
+ reg = <0x1fe0000 0x20000>;
+ read-only;
+ };
+ };
+ };
+ };
+
+ phy@100f8800 { /* USB3 port 1 HS phy */
+ status = "ok";
+ };
+
+ phy@100f8830 { /* USB3 port 1 SS phy */
+ status = "ok";
+ };
+
+ phy@110f8800 { /* USB3 port 0 HS phy */
+ status = "ok";
+ };
+
+ phy@110f8830 { /* USB3 port 0 SS phy */
+ status = "ok";
+ };
+
+ usb30@0 {
+ status = "ok";
+ };
+
+ usb30@1 {
+ status = "ok";
+ };
+
+ pcie0: pci@1b500000 {
+ status = "ok";
+ phy-tx0-term-offset = <7>;
+ };
+
+ pcie1: pci@1b700000 {
+ status = "ok";
+ phy-tx0-term-offset = <7>;
+ };
+
+ mdio0: mdio {
+ compatible = "virtual,mdio-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
+ pinctrl-0 = <&mdio0_pins>;
+ pinctrl-names = "default";
+
+ phy0: ethernet-phy@0 {
+ device_type = "ethernet-phy";
+ reg = <0>;
+ qca,ar8327-initvals = <
+ 0x00004 0x7600000 /* PAD0_MODE */
+ 0x00008 0x1000000 /* PAD5_MODE */
+ 0x0000c 0x80 /* PAD6_MODE */
+ 0x000e4 0x6a545 /* MAC_POWER_SEL */
+ 0x000e0 0xc74164de /* SGMII_CTRL */
+ 0x0007c 0x4e /* PORT0_STATUS */
+ 0x00094 0x4e /* PORT6_STATUS */
+ >;
+ };
+
+ phy4: ethernet-phy@4 {
+ device_type = "ethernet-phy";
+ reg = <4>;
+ };
+ };
+
+ gmac1: ethernet@37200000 {
+ status = "ok";
+ phy-mode = "rgmii";
+ qcom,id = <1>;
+
+ pinctrl-0 = <&rgmii2_pins>;
+ pinctrl-names = "default";
+
+ mtd-mac-address = <&defaultmac 0x8>;
+ mtd-mac-address-increment = <1>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+
+ gmac2: ethernet@37400000 {
+ status = "ok";
+ phy-mode = "sgmii";
+ qcom,id = <2>;
+
+ mtd-mac-address = <&defaultmac 0x8>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ wifi {
+ label = "wifi";
+ gpios = <&qcom_pinmux 49 1>;
+ linux,code = <KEY_WLAN>;
+ };
+
+ reset {
+ label = "reset";
+ gpios = <&qcom_pinmux 64 1>;
+ linux,code = <KEY_RESTART>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&qcom_pinmux 65 1>;
+ linux,code = <KEY_WPS_BUTTON>;
+ };
+ ledgeneral {
+ label = "ledgeneral";
+ gpios = <&qcom_pinmux 16 1>;
+ linux,code = <KEY_DOLLAR>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ lan {
+ label = "lan:blue";
+ gpios = <&qcom_pinmux 6 0>;
+ };
+ usb4 {
+ label = "usb_4:blue";
+ gpios = <&qcom_pinmux 7 0>;
+ };
+ usb2 {
+ label = "usb_2:blue";
+ gpios = <&qcom_pinmux 8 0>;
+ };
+ wps {
+ label = "wps:blue";
+ gpios = <&qcom_pinmux 9 0>;
+ };
+ wan_blue {
+ label = "wan:blue";
+ gpios = <&qcom_pinmux 33 1>;
+ };
+ status {
+ label = "status:blue";
+ gpios = <&qcom_pinmux 53 0>;
+ default-state = "on";
+ };
+ ledgnr {
+ label = "ledgnr:blue";
+ gpios = <&qcom_pinmux 66 0>;
+ };
+ };
+};
+
+&adm_dma {
+ status = "ok";
+};
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts
new file mode 100644
index 0000000000..4dd7a32c44
--- /dev/null
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts
@@ -0,0 +1,368 @@
+#include "qcom-ipq8064-v1.0.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+ model = "Netgear Nighthawk X4 D7800";
+ compatible = "netgear,d7800", "qcom,ipq8064";
+
+ memory@0 {
+ reg = <0x42000000 0xe000000>;
+ device_type = "memory";
+ };
+
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ rsvd@41200000 {
+ reg = <0x41200000 0x300000>;
+ no-map;
+ };
+ };
+
+ aliases {
+ serial0 = &uart4;
+ mdio-gpio0 = &mdio0;
+ };
+
+ chosen {
+ bootargs = "rootfstype=squashfs noinitrd";
+ linux,stdout-path = "serial0:115200n8";
+ };
+
+ soc {
+ pinmux@800000 {
+ i2c4_pins: i2c4_pinmux {
+ pins = "gpio12", "gpio13";
+ function = "gsbi4";
+ bias-disable;
+ };
+
+ pcie0_pins: pcie0_pinmux {
+ mux {
+ pins = "gpio3";
+ function = "pcie1_rst";
+ drive-strength = <12>;
+ bias-disable;
+ };
+ };
+
+ pcie1_pins: pcie1_pinmux {
+ mux {
+ pins = "gpio48";
+ function = "pcie2_rst";
+ drive-strength = <12>;
+ bias-disable;
+ };
+ };
+
+ nand_pins: nand_pins {
+ mux {
+ pins = "gpio34", "gpio35", "gpio36",
+ "gpio37", "gpio38", "gpio39",
+ "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ function = "nand";
+ drive-strength = <10>;
+ bias-disable;
+ };
+ pullups {
+ pins = "gpio39";
+ bias-pull-up;
+ };
+ hold {
+ pins = "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ bias-bus-hold;
+ };
+ };
+
+ mdio0_pins: mdio0_pins {
+ mux {
+ pins = "gpio0", "gpio1";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+
+ rgmii2_pins: rgmii2_pins {
+ mux {
+ pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
+ "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
+ function = "rgmii2";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+ };
+
+ gsbi@16300000 {
+ qcom,mode = <GSBI_PROT_I2C_UART>;
+ status = "ok";
+ serial@16340000 {
+ status = "ok";
+ };
+ /*
+ * The i2c device on gsbi4 should not be enabled.
+ * On ipq806x designs gsbi4 i2c is meant for exclusive
+ * RPM usage. Turning this on in kernel manifests as
+ * i2c failure for the RPM.
+ */
+ };
+
+ sata-phy@1b400000 {
+ status = "ok";
+ };
+
+ sata@29000000 {
+ status = "ok";
+ };
+
+ phy@100f8800 { /* USB3 port 1 HS phy */
+ status = "ok";
+ };
+
+ phy@100f8830 { /* USB3 port 1 SS phy */
+ status = "ok";
+ };
+
+ phy@110f8800 { /* USB3 port 0 HS phy */
+ status = "ok";
+ };
+
+ phy@110f8830 { /* USB3 port 0 SS phy */
+ status = "ok";
+ };
+
+ usb30@0 {
+ status = "ok";
+ };
+
+ usb30@1 {
+ status = "ok";
+ };
+
+ pcie0: pci@1b500000 {
+ status = "ok";
+ reset-gpio = <&qcom_pinmux 3 0>;
+ pinctrl-0 = <&pcie0_pins>;
+ pinctrl-names = "default";
+ };
+
+ pcie1: pci@1b700000 {
+ status = "ok";
+ reset-gpio = <&qcom_pinmux 48 0>;
+ pinctrl-0 = <&pcie1_pins>;
+ pinctrl-names = "default";
+ };
+
+ nand@1ac00000 {
+ status = "ok";
+
+ pinctrl-0 = <&nand_pins>;
+ pinctrl-names = "default";
+
+ nand-ecc-strength = <4>;
+ nand-bus-width = <8>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ qcadata@0 {
+ label = "qcadata";
+ reg = <0x0000000 0x0c80000>;
+ read-only;
+ };
+
+ APPSBL@c80000 {
+ label = "APPSBL";
+ reg = <0x0c80000 0x0500000>;
+ read-only;
+ };
+
+ APPSBLENV@1180000 {
+ label = "APPSBLENV";
+ reg = <0x1180000 0x0080000>;
+ read-only;
+ };
+
+ art: art@1200000 {
+ label = "art";
+ reg = <0x1200000 0x0140000>;
+ read-only;
+ };
+
+ artbak: art@1340000 {
+ label = "artbak";
+ reg = <0x1340000 0x0140000>;
+ read-only;
+ };
+
+ kernel@1480000 {
+ label = "kernel";
+ reg = <0x1480000 0x0200000>;
+ };
+
+ ubi@1680000 {
+ label = "ubi";
+ reg = <0x1680000 0x1E00000>;
+ };
+
+ netgear@3480000 {
+ label = "netgear";
+ reg = <0x3480000 0x4480000>;
+ read-only;
+ };
+
+ reserve@7900000 {
+ label = "reserve";
+ reg = <0x7900000 0x0700000>;
+ read-only;
+ };
+
+ firmware@1480000 {
+ label = "firmware";
+ reg = <0x1480000 0x2000000>;
+ };
+
+ };
+
+ mdio0: mdio {
+ compatible = "virtual,mdio-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
+ pinctrl-0 = <&mdio0_pins>;
+ pinctrl-names = "default";
+
+ phy0: ethernet-phy@0 {
+ device_type = "ethernet-phy";
+ reg = <0>;
+ qca,ar8327-initvals = <
+ 0x00004 0x7600000 /* PAD0_MODE */
+ 0x00008 0x1000000 /* PAD5_MODE */
+ 0x0000c 0x80 /* PAD6_MODE */
+ 0x000e4 0x6a545 /* MAC_POWER_SEL */
+ 0x000e0 0xc74164de /* SGMII_CTRL */
+ 0x0007c 0x4e /* PORT0_STATUS */
+ 0x00094 0x4e /* PORT6_STATUS */
+ >;
+ };
+
+ phy4: ethernet-phy@4 {
+ device_type = "ethernet-phy";
+ reg = <4>;
+ };
+ };
+
+ gmac1: ethernet@37200000 {
+ status = "ok";
+ phy-mode = "rgmii";
+ phy-handle = <&phy4>;
+ qcom,id = <1>;
+
+ pinctrl-0 = <&rgmii2_pins>;
+ pinctrl-names = "default";
+
+ mtd-mac-address = <&art 6>;
+ };
+
+ gmac2: ethernet@37400000 {
+ status = "ok";
+ phy-mode = "sgmii";
+ qcom,id = <2>;
+
+ mtd-mac-address = <&art 0>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ wifi {
+ label = "wifi";
+ gpios = <&qcom_pinmux 6 1>;
+ linux,code = <KEY_WLAN>;
+ };
+
+ reset {
+ label = "reset";
+ gpios = <&qcom_pinmux 54 1>;
+ linux,code = <KEY_RESTART>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&qcom_pinmux 65 1>;
+ linux,code = <KEY_WPS_BUTTON>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ usb1 {
+ label = "d7800:amber:usb1";
+ gpios = <&qcom_pinmux 7 0>;
+ };
+
+ usb3 {
+ label = "d7800:amber:usb3";
+ gpios = <&qcom_pinmux 8 0>;
+ };
+
+ status {
+ label = "d7800:amber:status";
+ gpios = <&qcom_pinmux 9 0>;
+ };
+
+ internet {
+ label = "d7800:white:internet";
+ gpios = <&qcom_pinmux 22 0>;
+ };
+
+ wan {
+ label = "d7800:white:wan";
+ gpios = <&qcom_pinmux 23 0>;
+ };
+
+ wps {
+ label = "d7800:white:wps";
+ gpios = <&qcom_pinmux 24 0>;
+ };
+
+ esata {
+ label = "d7800:white:esata";
+ gpios = <&qcom_pinmux 26 0>;
+ };
+
+ power {
+ label = "d7800:white:power";
+ gpios = <&qcom_pinmux 53 0>;
+ default-state = "on";
+ };
+
+ rfkill {
+ label = "d7800:white:rfkill";
+ gpios = <&qcom_pinmux 64 0>;
+ };
+
+ wifi5g {
+ label = "d7800:white:wifi5g";
+ gpios = <&qcom_pinmux 67 0>;
+ };
+ };
+};
+
+&adm_dma {
+ status = "ok";
+};
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts
new file mode 100644
index 0000000000..1bcbc9f80e
--- /dev/null
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts
@@ -0,0 +1,381 @@
+#include "qcom-ipq8064-v1.0.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+ model = "Linksys EA8500 WiFi Router";
+ compatible = "linksys,ea8500", "qcom,ipq8064";
+
+ memory@0 {
+ reg = <0x42000000 0x1e000000>;
+ device_type = "memory";
+ };
+
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ rsvd@41200000 {
+ reg = <0x41200000 0x300000>;
+ no-map;
+ };
+ };
+
+ aliases {
+ serial0 = &uart4;
+ mdio-gpio0 = &mdio0;
+ };
+
+ chosen {
+ bootargs = "console=ttyMSM0,115200n8";
+ linux,stdout-path = "serial0:115200n8";
+ append-rootblock = "ubi.mtd="; /* append to bootargs adding the root deviceblock nbr from bootloader */
+ };
+
+ soc {
+ pinmux@800000 {
+ i2c4_pins: i2c4_pinmux {
+ pins = "gpio12", "gpio13";
+ function = "gsbi4";
+ bias-disable;
+ };
+
+ spi_pins: spi_pins {
+ mux {
+ pins = "gpio18", "gpio19", "gpio21";
+ function = "gsbi5";
+ drive-strength = <10>;
+ bias-none;
+ };
+ };
+ nand_pins: nand_pins {
+ mux {
+ pins = "gpio34", "gpio35", "gpio36",
+ "gpio37", "gpio38", "gpio39",
+ "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ function = "nand";
+ drive-strength = <10>;
+ bias-disable;
+ };
+ pullups {
+ pins = "gpio39";
+ bias-pull-up;
+ };
+ hold {
+ pins = "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ bias-bus-hold;
+ };
+ };
+
+ mdio0_pins: mdio0_pins {
+ mux {
+ pins = "gpio0", "gpio1";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+
+ rgmii2_pins: rgmii2_pins {
+ mux {
+ pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
+ "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
+ function = "rgmii2";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+
+
+
+ };
+
+ gsbi@16300000 {
+ qcom,mode = <GSBI_PROT_I2C_UART>;
+ status = "ok";
+ serial@16340000 {
+ status = "ok";
+ };
+ /*
+ * The i2c device on gsbi4 should not be enabled.
+ * On ipq806x designs gsbi4 i2c is meant for exclusive
+ * RPM usage. Turning this on in kernel manifests as
+ * i2c failure for the RPM.
+ */
+ };
+
+ sata-phy@1b400000 {
+ status = "ok";
+ };
+
+ sata@29000000 {
+ status = "ok";
+ };
+
+ phy@100f8800 { /* USB3 port 1 HS phy */
+ status = "ok";
+ };
+
+ phy@100f8830 { /* USB3 port 1 SS phy */
+ status = "ok";
+ };
+
+ phy@110f8800 { /* USB3 port 0 HS phy */
+ status = "ok";
+ };
+
+ phy@110f8830 { /* USB3 port 0 SS phy */
+ status = "ok";
+ };
+
+ usb30@0 {
+ status = "ok";
+ };
+
+ usb30@1 {
+ status = "ok";
+ };
+
+ pcie0: pci@1b500000 {
+ status = "ok";
+ phy-tx0-term-offset = <7>;
+ };
+
+ pcie1: pci@1b700000 {
+ status = "ok";
+ phy-tx0-term-offset = <7>;
+ };
+
+ pcie2: pci@1b900000 {
+ status = "ok";
+ phy-tx0-term-offset = <7>;
+ };
+
+ nand@1ac00000 {
+ status = "ok";
+
+ pinctrl-0 = <&nand_pins>;
+ pinctrl-names = "default";
+
+ nand-ecc-strength = <4>;
+ nand-bus-width = <8>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ SBL1@0 {
+ label = "SBL1";
+ reg = <0x0000000 0x0040000>;
+ read-only;
+ };
+
+ MIBIB@40000 {
+ label = "MIBIB";
+ reg = <0x0040000 0x0140000>;
+ read-only;
+ };
+
+ SBL2@180000 {
+ label = "SBL2";
+ reg = <0x0180000 0x0140000>;
+ read-only;
+ };
+
+ SBL3@2c0000 {
+ label = "SBL3";
+ reg = <0x02c0000 0x0280000>;
+ read-only;
+ };
+
+ DDRCONFIG@540000 {
+ label = "DDRCONFIG";
+ reg = <0x0540000 0x0120000>;
+ read-only;
+ };
+
+ SSD@660000 {
+ label = "SSD";
+ reg = <0x0660000 0x0120000>;
+ read-only;
+ };
+
+ TZ@780000 {
+ label = "TZ";
+ reg = <0x0780000 0x0280000>;
+ read-only;
+ };
+
+ RPM@a00000 {
+ label = "RPM";
+ reg = <0x0a00000 0x0280000>;
+ read-only;
+ };
+
+ art: art@c80000 {
+ label = "art";
+ reg = <0x0c80000 0x0140000>;
+ read-only;
+ };
+
+ APPSBL@dc0000 {
+ label = "APPSBL";
+ reg = <0x0dc0000 0x0100000>;
+ read-only;
+ };
+
+ u_env@ec0000 {
+ label = "u_env";
+ reg = <0x0ec0000 0x0040000>;
+ };
+
+ s_env@f00000 {
+ label = "s_env";
+ reg = <0x0f00000 0x0040000>;
+ };
+
+ devinfo@f40000 {
+ label = "devinfo";
+ reg = <0x0f40000 0x0040000>;
+ };
+
+ linux@f80000 {
+ label = "kernel1";
+ reg = <0x0f80000 0x2800000>; /* 3 MB spill to rootfs*/
+ };
+
+ rootfs@1280000 {
+ label = "rootfs1";
+ reg = <0x1280000 0x2500000>;
+ };
+
+ linux2@3780000 {
+ label = "kernel2";
+ reg = <0x3780000 0x2800000>;
+ };
+
+ rootfs2@3a80000 {
+ label = "rootfs2";
+ reg = <0x3a80000 0x2500000>;
+ };
+
+ syscfg@5f80000 {
+ label = "syscfg";
+ reg = <0x5f80000 0x2080000>;
+ };
+
+ };
+
+ mdio0: mdio {
+ compatible = "virtual,mdio-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
+ pinctrl-0 = <&mdio0_pins>;
+ pinctrl-names = "default";
+
+ phy0: ethernet-phy@0 {
+ device_type = "ethernet-phy";
+ reg = <0>;
+ qca,ar8327-initvals = <
+ 0x00004 0x7600000 /* PAD0_MODE */
+ 0x00008 0x1000000 /* PAD5_MODE */
+ 0x0000c 0x80 /* PAD6_MODE */
+ 0x000e4 0x6a545 /* MAC_POWER_SEL */
+ 0x000e0 0xc74164de /* SGMII_CTRL */
+ 0x0007c 0x4e /* PORT0_STATUS */
+ 0x00094 0x4e /* PORT6_STATUS */
+ >;
+ };
+
+ phy4: ethernet-phy@4 {
+ device_type = "ethernet-phy";
+ reg = <4>;
+ };
+ };
+
+ gmac1: ethernet@37200000 {
+ status = "ok";
+ phy-mode = "rgmii";
+ qcom,id = <1>;
+ qcom,phy_mdio_addr = <4>;
+ qcom,poll_required = <1>;
+ qcom,rgmii_delay = <0>;
+ qcom,emulation = <0>;
+ pinctrl-0 = <&rgmii2_pins>;
+ pinctrl-names = "default";
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ //lan
+ gmac2: ethernet@37400000 {
+ status = "ok";
+ phy-mode = "sgmii";
+ qcom,id = <2>;
+ qcom,phy_mdio_addr = <0>; /* none */
+ qcom,poll_required = <0>; /* no polling */
+ qcom,rgmii_delay = <0>;
+ qcom,emulation = <0>;
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+
+ adm_dma: dma@18300000 {
+ status = "ok";
+ };
+
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ rfkill {
+ label = "rfkill"; /* WIFI on-off*/
+ gpios = <&qcom_pinmux 67 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RFKILL>;
+ };
+
+ reset {
+ label = "reset";
+ gpios = <&qcom_pinmux 68 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART >;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&qcom_pinmux 65 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_WPS_BUTTON>;
+ };
+
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ wps {
+ label = "ea8500:green:wps";
+ gpios = <&qcom_pinmux 53 0>;
+ default-state = "off";
+ };
+
+ power {
+ label = "ea8500:white:power";
+ gpios = <&qcom_pinmux 6 1>;
+ default-state = "off";
+ linux,default-trigger = "heartbeat";
+ };
+
+ wifi {
+ label = "ea8500:green:wifi";
+ gpios = <&qcom_pinmux 54 0>;
+ default-state = "off";
+ };
+ };
+};
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
new file mode 100644
index 0000000000..2ecd493205
--- /dev/null
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
@@ -0,0 +1,342 @@
+#include "qcom-ipq8064-v1.0.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+ model = "Netgear Nighthawk X4 R7500";
+ compatible = "netgear,r7500", "qcom,ipq8064";
+
+ memory@0 {
+ reg = <0x42000000 0xe000000>;
+ device_type = "memory";
+ };
+
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ rsvd@41200000 {
+ reg = <0x41200000 0x300000>;
+ no-map;
+ };
+ };
+
+ aliases {
+ serial0 = &uart4;
+ mdio-gpio0 = &mdio0;
+ };
+
+ chosen {
+ bootargs = "rootfstype=squashfs noinitrd";
+ linux,stdout-path = "serial0:115200n8";
+ };
+
+ soc {
+ pinmux@800000 {
+ i2c4_pins: i2c4_pinmux {
+ pins = "gpio12", "gpio13";
+ function = "gsbi4";
+ bias-disable;
+ };
+
+ nand_pins: nand_pins {
+ mux {
+ pins = "gpio34", "gpio35", "gpio36",
+ "gpio37", "gpio38", "gpio39",
+ "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ function = "nand";
+ drive-strength = <10>;
+ bias-disable;
+ };
+ pullups {
+ pins = "gpio39";
+ bias-pull-up;
+ };
+ hold {
+ pins = "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ bias-bus-hold;
+ };
+ };
+
+ mdio0_pins: mdio0_pins {
+ mux {
+ pins = "gpio0", "gpio1";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+
+ rgmii2_pins: rgmii2_pins {
+ mux {
+ pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
+ "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
+ function = "rgmii2";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+ };
+
+ gsbi@16300000 {
+ qcom,mode = <GSBI_PROT_I2C_UART>;
+ status = "ok";
+ serial@16340000 {
+ status = "ok";
+ };
+ /*
+ * The i2c device on gsbi4 should not be enabled.
+ * On ipq806x designs gsbi4 i2c is meant for exclusive
+ * RPM usage. Turning this on in kernel manifests as
+ * i2c failure for the RPM.
+ */
+ };
+
+ sata-phy@1b400000 {
+ status = "ok";
+ };
+
+ sata@29000000 {
+ status = "ok";
+ };
+
+ phy@100f8800 { /* USB3 port 1 HS phy */
+ status = "ok";
+ };
+
+ phy@100f8830 { /* USB3 port 1 SS phy */
+ status = "ok";
+ };
+
+ phy@110f8800 { /* USB3 port 0 HS phy */
+ status = "ok";
+ };
+
+ phy@110f8830 { /* USB3 port 0 SS phy */
+ status = "ok";
+ };
+
+ usb30@0 {
+ status = "ok";
+ };
+
+ usb30@1 {
+ status = "ok";
+ };
+
+ pcie0: pci@1b500000 {
+ status = "ok";
+ };
+
+ pcie1: pci@1b700000 {
+ status = "ok";
+ };
+
+ nand@1ac00000 {
+ status = "ok";
+
+ pinctrl-0 = <&nand_pins>;
+ pinctrl-names = "default";
+
+ nand-ecc-strength = <4>;
+ nand-bus-width = <8>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ qcadata@0 {
+ label = "qcadata";
+ reg = <0x0000000 0x0c80000>;
+ read-only;
+ };
+
+ APPSBL@c80000 {
+ label = "APPSBL";
+ reg = <0x0c80000 0x0500000>;
+ read-only;
+ };
+
+ APPSBLENV@1180000 {
+ label = "APPSBLENV";
+ reg = <0x1180000 0x0080000>;
+ read-only;
+ };
+
+ art: art@1200000 {
+ label = "art";
+ reg = <0x1200000 0x0140000>;
+ read-only;
+ };
+
+ kernel@1340000 {
+ label = "kernel";
+ reg = <0x1340000 0x0200000>;
+ };
+
+ ubi@1540000 {
+ label = "ubi";
+ reg = <0x1540000 0x1800000>;
+ };
+
+ netgear@2d40000 {
+ label = "netgear";
+ reg = <0x2d40000 0x0c00000>;
+ read-only;
+ };
+
+ reserve@3940000 {
+ label = "reserve";
+ reg = <0x3940000 0x46c0000>;
+ read-only;
+ };
+
+ firmware@1340000 {
+ label = "firmware";
+ reg = <0x1340000 0x1a00000>;
+ };
+
+ };
+
+ mdio0: mdio {
+ compatible = "virtual,mdio-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
+ pinctrl-0 = <&mdio0_pins>;
+ pinctrl-names = "default";
+
+ phy0: ethernet-phy@0 {
+ device_type = "ethernet-phy";
+ reg = <0>;
+ qca,ar8327-initvals = <
+ 0x00004 0x7600000 /* PAD0_MODE */
+ 0x00008 0x1000000 /* PAD5_MODE */
+ 0x0000c 0x80 /* PAD6_MODE */
+ 0x000e4 0x6a545 /* MAC_POWER_SEL */
+ 0x000e0 0xc74164de /* SGMII_CTRL */
+ 0x0007c 0x4e /* PORT0_STATUS */
+ 0x00094 0x4e /* PORT6_STATUS */
+ >;
+ };
+
+ phy4: ethernet-phy@4 {
+ device_type = "ethernet-phy";
+ reg = <4>;
+ };
+ };
+
+ gmac1: ethernet@37200000 {
+ status = "ok";
+ phy-mode = "rgmii";
+ qcom,id = <1>;
+
+ pinctrl-0 = <&rgmii2_pins>;
+ pinctrl-names = "default";
+
+ mtd-mac-address = <&art 6>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+
+ gmac2: ethernet@37400000 {
+ status = "ok";
+ phy-mode = "sgmii";
+ qcom,id = <2>;
+
+ mtd-mac-address = <&art 0>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ wifi {
+ label = "wifi";
+ gpios = <&qcom_pinmux 6 1>;
+ linux,code = <KEY_WLAN>;
+ };
+
+ reset {
+ label = "reset";
+ gpios = <&qcom_pinmux 54 1>;
+ linux,code = <KEY_RESTART>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&qcom_pinmux 65 1>;
+ linux,code = <KEY_WPS_BUTTON>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ usb1 {
+ label = "r7500:amber:usb1";
+ gpios = <&qcom_pinmux 7 0>;
+ };
+
+ usb3 {
+ label = "r7500:amber:usb3";
+ gpios = <&qcom_pinmux 8 0>;
+ };
+
+ status {
+ label = "r7500:amber:status";
+ gpios = <&qcom_pinmux 9 0>;
+ };
+
+ internet {
+ label = "r7500:white:internet";
+ gpios = <&qcom_pinmux 22 0>;
+ };
+
+ wan {
+ label = "r7500:white:wan";
+ gpios = <&qcom_pinmux 23 0>;
+ };
+
+ wps {
+ label = "r7500:white:wps";
+ gpios = <&qcom_pinmux 24 0>;
+ };
+
+ esata {
+ label = "r7500:white:esata";
+ gpios = <&qcom_pinmux 26 0>;
+ };
+
+ power {
+ label = "r7500:white:power";
+ gpios = <&qcom_pinmux 53 0>;
+ default-state = "on";
+ };
+
+ rfkill {
+ label = "r7500:white:rfkill";
+ gpios = <&qcom_pinmux 64 0>;
+ };
+
+ wifi5g {
+ label = "r7500:white:wifi5g";
+ gpios = <&qcom_pinmux 67 0>;
+ };
+ };
+};
+
+&adm_dma {
+ status = "ok";
+};
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7800.dts
new file mode 100644
index 0000000000..498624325d
--- /dev/null
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7800.dts
@@ -0,0 +1,372 @@
+#include "qcom-ipq8065-v1.0.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+ model = "Netgear Nighthawk X4S R7800";
+ compatible = "netgear,r7800", "qcom,ipq8065";
+
+ memory@0 {
+ reg = <0x42000000 0x1e000000>;
+ device_type = "memory";
+ };
+
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ rsvd@41200000 {
+ reg = <0x41200000 0x300000>;
+ no-map;
+ };
+ };
+
+ aliases {
+ serial0 = &uart4;
+ mdio-gpio0 = &mdio0;
+ };
+
+ chosen {
+ bootargs = "rootfstype=squashfs noinitrd";
+ linux,stdout-path = "serial0:115200n8";
+ };
+
+ soc {
+ pinmux@800000 {
+ i2c4_pins: i2c4_pinmux {
+ pins = "gpio12", "gpio13";
+ function = "gsbi4";
+ bias-disable;
+ };
+
+ pcie0_pins: pcie0_pinmux {
+ mux {
+ pins = "gpio3";
+ function = "pcie1_rst";
+ drive-strength = <12>;
+ bias-disable;
+ };
+ };
+
+ pcie1_pins: pcie1_pinmux {
+ mux {
+ pins = "gpio48";
+ function = "pcie2_rst";
+ drive-strength = <12>;
+ bias-disable;
+ };
+ };
+
+ nand_pins: nand_pins {
+ mux {
+ pins = "gpio34", "gpio35", "gpio36",
+ "gpio37", "gpio38", "gpio39",
+ "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ function = "nand";
+ drive-strength = <10>;
+ bias-disable;
+ };
+ pullups {
+ pins = "gpio39";
+ bias-pull-up;
+ };
+ hold {
+ pins = "gpio40", "gpio41", "gpio42",
+ "gpio43", "gpio44", "gpio45",
+ "gpio46", "gpio47";
+ bias-bus-hold;
+ };
+ };
+
+ mdio0_pins: mdio0_pins {
+ mux {
+ pins = "gpio0", "gpio1";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+
+ rgmii2_pins: rgmii2_pins {
+ mux {
+ pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
+ "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
+ function = "rgmii2";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+ };
+
+ gsbi@16300000 {
+ qcom,mode = <GSBI_PROT_I2C_UART>;
+ status = "ok";
+ serial@16340000 {
+ status = "ok";
+ };
+ /*
+ * The i2c device on gsbi4 should not be enabled.
+ * On ipq806x designs gsbi4 i2c is meant for exclusive
+ * RPM usage. Turning this on in kernel manifests as
+ * i2c failure for the RPM.
+ */
+ };
+
+ sata-phy@1b400000 {
+ status = "ok";
+ };
+
+ sata@29000000 {
+ status = "ok";
+ };
+
+ phy@100f8800 { /* USB3 port 1 HS phy */
+ status = "ok";
+ };
+
+ phy@100f8830 { /* USB3 port 1 SS phy */
+ status = "ok";
+ };
+
+ phy@110f8800 { /* USB3 port 0 HS phy */
+ status = "ok";
+ };
+
+ phy@110f8830 { /* USB3 port 0 SS phy */
+ status = "ok";
+ };
+
+ usb30@0 {
+ status = "ok";
+ };
+
+ usb30@1 {
+ status = "ok";
+ };
+
+ pcie0: pci@1b500000 {
+ status = "ok";
+ reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>;
+ pinctrl-0 = <&pcie0_pins>;
+ pinctrl-names = "default";
+ };
+
+ pcie1: pci@1b700000 {
+ status = "ok";
+ reset-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_LOW>;
+ pinctrl-0 = <&pcie1_pins>;
+ pinctrl-names = "default";
+ };
+
+ nand@1ac00000 {
+ status = "ok";
+
+ pinctrl-0 = <&nand_pins>;
+ pinctrl-names = "default";
+
+ nand-ecc-strength = <4>;
+ nand-bus-width = <8>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ qcadata@0 {
+ label = "qcadata";
+ reg = <0x0000000 0x0c80000>;
+ read-only;
+ };
+
+ APPSBL@c80000 {
+ label = "APPSBL";
+ reg = <0x0c80000 0x0500000>;
+ read-only;
+ };
+
+ APPSBLENV@1180000 {
+ label = "APPSBLENV";
+ reg = <0x1180000 0x0080000>;
+ read-only;
+ };
+
+ art: art@1200000 {
+ label = "art";
+ reg = <0x1200000 0x0140000>;
+ read-only;
+ };
+
+ artbak: art@1340000 {
+ label = "artbak";
+ reg = <0x1340000 0x0140000>;
+ read-only;
+ };
+
+ kernel@1480000 {
+ label = "kernel";
+ reg = <0x1480000 0x0200000>;
+ };
+
+ ubi@1680000 {
+ label = "ubi";
+ reg = <0x1680000 0x1E00000>;
+ };
+
+ netgear@3480000 {
+ label = "netgear";
+ reg = <0x3480000 0x4480000>;
+ read-only;
+ };
+
+ reserve@7900000 {
+ label = "reserve";
+ reg = <0x7900000 0x0700000>;
+ read-only;
+ };
+
+ firmware@1480000 {
+ label = "firmware";
+ reg = <0x1480000 0x2000000>;
+ };
+
+ };
+
+ mdio0: mdio {
+ compatible = "virtual,mdio-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
+ pinctrl-0 = <&mdio0_pins>;
+ pinctrl-names = "default";
+
+ phy0: ethernet-phy@0 {
+ device_type = "ethernet-phy";
+ reg = <0>;
+ qca,ar8327-initvals = <
+ 0x00004 0x7600000 /* PAD0_MODE */
+ 0x00008 0x1000000 /* PAD5_MODE */
+ 0x0000c 0x80 /* PAD6_MODE */
+ 0x000e4 0xaa545 /* MAC_POWER_SEL */
+ 0x000e0 0xc74164de /* SGMII_CTRL */
+ 0x0007c 0x4e /* PORT0_STATUS */
+ 0x00094 0x4e /* PORT6_STATUS */
+ >;
+ };
+
+ phy4: ethernet-phy@4 {
+ device_type = "ethernet-phy";
+ reg = <4>;
+ };
+ };
+
+ gmac1: ethernet@37200000 {
+ status = "ok";
+ phy-mode = "rgmii";
+ qcom,id = <1>;
+
+ pinctrl-0 = <&rgmii2_pins>;
+ pinctrl-names = "default";
+
+ mtd-mac-address = <&art 6>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+
+ gmac2: ethernet@37400000 {
+ status = "ok";
+ phy-mode = "sgmii";
+ qcom,id = <2>;
+
+ mtd-mac-address = <&art 0>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ wifi {
+ label = "wifi";
+ gpios = <&qcom_pinmux 6 1>;
+ linux,code = <KEY_WLAN>;
+ };
+
+ reset {
+ label = "reset";
+ gpios = <&qcom_pinmux 54 1>;
+ linux,code = <KEY_RESTART>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&qcom_pinmux 65 1>;
+ linux,code = <KEY_WPS_BUTTON>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ usb1 {
+ label = "r7800:amber:usb1";
+ gpios = <&qcom_pinmux 7 0>;
+ };
+
+ usb3 {
+ label = "r7800:amber:usb3";
+ gpios = <&qcom_pinmux 8 0>;
+ };
+
+ status {
+ label = "r7800:amber:status";
+ gpios = <&qcom_pinmux 9 0>;
+ };
+
+ internet {
+ label = "r7800:white:internet";
+ gpios = <&qcom_pinmux 22 0>;
+ };
+
+ wan {
+ label = "r7800:white:wan";
+ gpios = <&qcom_pinmux 23 0>;
+ };
+
+ wps {
+ label = "r7800:white:wps";
+ gpios = <&qcom_pinmux 24 0>;
+ };
+
+ esata {
+ label = "r7800:white:esata";
+ gpios = <&qcom_pinmux 26 0>;
+ };
+
+ power {
+ label = "r7800:white:power";
+ gpios = <&qcom_pinmux 53 0>;
+ default-state = "on";
+ };
+
+ rfkill {
+ label = "r7800:white:rfkill";
+ gpios = <&qcom_pinmux 64 0>;
+ };
+
+ wifi {
+ label = "r7800:white:wifi";
+ gpios = <&qcom_pinmux 67 0>;
+ };
+ };
+};
+
+&adm_dma {
+ status = "ok";
+};
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-v1.0.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-v1.0.dtsi
new file mode 100644
index 0000000000..22b5338cc0
--- /dev/null
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-v1.0.dtsi
@@ -0,0 +1 @@
+#include "qcom-ipq8065.dtsi"
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi
new file mode 100644
index 0000000000..4571ef4934
--- /dev/null
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi
@@ -0,0 +1,1185 @@
+/dts-v1/;
+
+#include "skeleton.dtsi"
+#include <dt-bindings/clock/qcom,gcc-ipq806x.h>
+#include <dt-bindings/mfd/qcom-rpm.h>
+#include <dt-bindings/soc/qcom,gsbi.h>
+#include <dt-bindings/reset/qcom,gcc-ipq806x.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ model = "Qualcomm IPQ8065";
+ compatible = "qcom,ipq8065";
+ interrupt-parent = <&intc>;
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu@0 {
+ compatible = "qcom,krait";
+ enable-method = "qcom,kpss-acc-v1";
+ device_type = "cpu";
+ reg = <0>;
+ next-level-cache = <&L2>;
+ qcom,acc = <&acc0>;
+ qcom,saw = <&saw0>;
+ clocks = <&kraitcc 0>;
+ clock-names = "cpu";
+ clock-latency = <100000>;
+ core-supply = <&smb208_s2a>;
+ voltage-tolerance = <5>;
+ cooling-min-state = <0>;
+ cooling-max-state = <10>;
+ #cooling-cells = <2>;
+
+ operating-points-0-0 = <
+ /* kHz uV */
+ 1725000 1262500
+ 1400000 1175000
+ 1000000 1100000
+ 800000 1050000
+ 600000 1000000
+ 384000 975000
+ >;
+ operating-points-0-1 = <
+ /* kHz uV */
+ 1725000 1262500
+ 1400000 1175000
+ 1000000 1100000
+ 800000 1050000
+ 600000 1000000
+ 384000 950000
+ >;
+ operating-points-0-2 = <
+ /* kHz uV */
+ 1725000 1200000
+ 1400000 1125000
+ 1000000 1050000
+ 800000 1000000
+ 600000 950000
+ 384000 925000
+ >;
+ operating-points-0-3 = <
+ /* kHz uV */
+ 1725000 1175000
+ 1400000 1100000
+ 1000000 1025000
+ 800000 975000
+ 600000 925000
+ 384000 900000
+ >;
+ operating-points-0-4 = <
+ /* kHz uV */
+ 1725000 1150000
+ 1400000 1075000
+ 1000000 1000000
+ 800000 950000
+ 600000 900000
+ 384000 875000
+ >;
+ operating-points-0-5 = <
+ /* kHz uV */
+ 1725000 1100000
+ 1400000 1025000
+ 1000000 950000
+ 800000 900000
+ 600000 850000
+ 384000 825000
+ >;
+ operating-points-0-6 = <
+ /* kHz uV */
+ 1725000 1050000
+ 1400000 975000
+ 1000000 900000
+ 800000 850000
+ 600000 800000
+ 384000 775000
+ >;
+ };
+
+ cpu@1 {
+ compatible = "qcom,krait";
+ enable-method = "qcom,kpss-acc-v1";
+ device_type = "cpu";
+ reg = <1>;
+ next-level-cache = <&L2>;
+ qcom,acc = <&acc1>;
+ qcom,saw = <&saw1>;
+ clocks = <&kraitcc 1>;
+ clock-names = "cpu";
+ clock-latency = <100000>;
+ core-supply = <&smb208_s2b>;
+
+ operating-points-0-0 = <
+ /* kHz uV */
+ 1725000 1262500
+ 1400000 1175000
+ 1000000 1100000
+ 800000 1050000
+ 600000 1000000
+ 384000 975000
+ >;
+ operating-points-0-1 = <
+ /* kHz uV */
+ 1725000 1262500
+ 1400000 1175000
+ 1000000 1100000
+ 800000 1050000
+ 600000 1000000
+ 384000 950000
+ >;
+ operating-points-0-2 = <
+ /* kHz uV */
+ 1725000 1200000
+ 1400000 1125000
+ 1000000 1050000
+ 800000 1000000
+ 600000 950000
+ 384000 925000
+ >;
+ operating-points-0-3 = <
+ /* kHz uV */
+ 1725000 1175000
+ 1400000 1100000
+ 1000000 1025000
+ 800000 975000
+ 600000 925000
+ 384000 900000
+ >;
+ operating-points-0-4 = <
+ /* kHz uV */
+ 1725000 1150000
+ 1400000 1075000
+ 1000000 1000000
+ 800000 950000
+ 600000 900000
+ 384000 875000
+ >;
+ operating-points-0-5 = <
+ /* kHz uV */
+ 1725000 1100000
+ 1400000 1025000
+ 1000000 950000
+ 800000 900000
+ 600000 850000
+ 384000 825000
+ >;
+ operating-points-0-6 = <
+ /* kHz uV */
+ 1725000 1050000
+ 1400000 975000
+ 1000000 900000
+ 800000 850000
+ 600000 800000
+ 384000 775000
+ >;
+ cooling-min-state = <0>;
+ cooling-max-state = <10>;
+ #cooling-cells = <2>;
+ };
+
+ L2: l2-cache {
+ compatible = "cache";
+ cache-level = <2>;
+ clocks = <&kraitcc 4>;
+ clock-names = "cache";
+ cache-points-kHz = <
+ /* kHz uV CPU kHz */
+ 1200000 1150000 1200000
+ 1000000 1100000 600000
+ 384000 1100000 384000
+ >;
+ vdd_dig-supply = <&smb208_s1a>;
+ };
+ };
+
+ cpu-pmu {
+ compatible = "qcom,krait-pmu";
+ interrupts = <1 10 0x304>;
+ };
+
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ nss@40000000 {
+ reg = <0x40000000 0x1000000>;
+ no-map;
+ };
+
+ smem: smem@41000000 {
+ reg = <0x41000000 0x200000>;
+ no-map;
+ };
+ };
+
+ clocks {
+ sleep_clk: sleep_clk {
+ compatible = "fixed-clock";
+ clock-frequency = <32768>;
+ #clock-cells = <0>;
+ };
+ };
+
+ kraitcc: clock-controller {
+ compatible = "qcom,krait-cc-v1";
+ #clock-cells = <1>;
+ };
+
+ qcom,pvs {
+ qcom,pvs-format-a;
+ qcom,speed0-pvs0-bin-v0 =
+ < 1725000000 1262500 >,
+ < 1400000000 1175000 >,
+ < 1000000000 1100000 >,
+ < 800000000 1050000 >,
+ < 600000000 1000000 >,
+ < 384000000 975000 >;
+ qcom,speed0-pvs1-bin-v0 =
+ < 1725000000 1262500 >,
+ < 1400000000 1175000 >,
+ < 1000000000 1100000 >,
+ < 800000000 1050000 >,
+ < 600000000 1000000 >,
+ < 384000000 950000 >;
+ qcom,speed0-pvs2-bin-v0 =
+ < 1725000000 1200000 >,
+ < 1400000000 1125000 >,
+ < 1000000000 1050000 >,
+ < 800000000 1000000 >,
+ < 600000000 950000 >,
+ < 384000000 925000 >;
+ qcom,speed0-pvs3-bin-v0 =
+ < 1725000000 1175000 >,
+ < 1400000000 1100000 >,
+ < 1000000000 1025000 >,
+ < 800000000 975000 >,
+ < 600000000 925000 >,
+ < 384000000 900000 >;
+ qcom,speed0-pvs4-bin-v0 =
+ < 1725000000 1150000 >,
+ < 1400000000 1075000 >,
+ < 1000000000 1000000 >,
+ < 800000000 950000 >,
+ < 600000000 900000 >,
+ < 384000000 875000 >;
+ qcom,speed0-pvs5-bin-v0 =
+ < 1725000000 1100000 >,
+ < 1400000000 1025000 >,
+ < 1000000000 950000 >,
+ < 800000000 900000 >,
+ < 600000000 850000 >,
+ < 384000000 825000 >;
+ qcom,speed0-pvs6-bin-v0 =
+ < 1725000000 1050000 >,
+ < 1400000000 975000 >,
+ < 1000000000 900000 >,
+ < 800000000 850000 >,
+ < 600000000 800000 >,
+ < 384000000 775000 >;
+ };
+
+ soc: soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ compatible = "simple-bus";
+
+ imem: memory@700000 {
+ compatible = "qcom,imem-ipq8064", "syscon";
+ reg = <0x00700000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0x0 0x00700000 0x1000>;
+ };
+
+ rpm@108000 {
+ compatible = "qcom,rpm-ipq8064";
+ reg = <0x108000 0x1000>;
+ qcom,ipc = <&l2cc 0x8 2>;
+
+ interrupts = <0 19 0>,
+ <0 21 0>,
+ <0 22 0>;
+ interrupt-names = "ack",
+ "err",
+ "wakeup";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ smb208_s1a: smb208-s1a {
+ compatible = "qcom,rpm-smb208";
+ reg = <QCOM_RPM_SMB208_S1a>;
+
+ regulator-min-microvolt = <1050000>;
+ regulator-max-microvolt = <1150000>;
+
+ qcom,switch-mode-frequency = <1200000>;
+
+ };
+
+ smb208_s1b: smb208-s1b {
+ compatible = "qcom,rpm-smb208";
+ reg = <QCOM_RPM_SMB208_S1b>;
+
+ regulator-min-microvolt = <1050000>;
+ regulator-max-microvolt = <1150000>;
+
+ qcom,switch-mode-frequency = <1200000>;
+ };
+
+ smb208_s2a: smb208-s2a {
+ compatible = "qcom,rpm-smb208";
+ reg = <QCOM_RPM_SMB208_S2a>;
+
+ regulator-min-microvolt = < 800000>;
+ regulator-max-microvolt = <1275000>;
+
+ qcom,switch-mode-frequency = <1400000>;
+ };
+
+ smb208_s2b: smb208-s2b {
+ compatible = "qcom,rpm-smb208";
+ reg = <QCOM_RPM_SMB208_S2b>;
+
+ regulator-min-microvolt = < 800000>;
+ regulator-max-microvolt = <1275000>;
+
+ qcom,switch-mode-frequency = <1400000>;
+ };
+
+ cxo_clk: cxo-clk {
+ #clock-cells = <0>;
+ compatible = "qcom,rpm-clk";
+ reg = <QCOM_RPM_CXO_CLK>;
+ qcom,rpm-clk-name = "cxo";
+ qcom,rpm-clk-freq = <25000000>;
+ qcom,rpm-clk-active-only;
+ };
+
+ pxo_clk: pxo-clk {
+ #clock-cells = <0>;
+ compatible = "qcom,rpm-clk";
+ reg = <QCOM_RPM_PXO_CLK>;
+ qcom,rpm-clk-name = "pxo";
+ qcom,rpm-clk-freq = <25000000>;
+ qcom,rpm-clk-active-only;
+ };
+
+ ebi1_clk: ebi1-clk {
+ #clock-cells = <0>;
+ compatible = "qcom,rpm-clk";
+ reg = <QCOM_RPM_EBI1_CLK>;
+ qcom,rpm-clk-name = "ebi1";
+ qcom,rpm-clk-freq = <533000000>;
+ qcom,rpm-clk-active-only;
+ };
+
+ apps_fabric_clk: apps-fabric-clk {
+ #clock-cells = <0>;
+ compatible = "qcom,rpm-clk";
+ reg = <QCOM_RPM_APPS_FABRIC_CLK>;
+ qcom,rpm-clk-name = "apps-fabric";
+ qcom,rpm-clk-freq = <533000000>;
+ qcom,rpm-clk-active-only;
+ };
+
+ nss_fabric0_clk: nss-fabric0-clk {
+ #clock-cells = <0>;
+ compatible = "qcom,rpm-clk";
+ reg = <QCOM_RPM_NSS_FABRIC_0_CLK>;
+ qcom,rpm-clk-name = "nss-fabric0";
+ qcom,rpm-clk-freq = <533000000>;
+ qcom,rpm-clk-active-only;
+ };
+
+ nss_fabric1_clk: nss-fabric1-clk {
+ #clock-cells = <0>;
+ compatible = "qcom,rpm-clk";
+ reg = <QCOM_RPM_NSS_FABRIC_1_CLK>;
+ qcom,rpm-clk-name = "nss-fabric1";
+ qcom,rpm-clk-freq = <266000000>;
+ qcom,rpm-clk-active-only;
+ };
+ };
+
+ rng@1a500000 {
+ compatible = "qcom,prng";
+ reg = <0x1a500000 0x200>;
+ clocks = <&gcc PRNG_CLK>;
+ clock-names = "core";
+ };
+
+ qcom,msm-imem@2A03F000 {
+ compatible = "qcom,msm-imem";
+ reg = <0x2A03F000 0x1000>; /* Address and size of IMEM */
+ ranges = <0x0 0x2A03F000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ download_mode@0 {
+ compatible = "qcom,msm-imem-download_mode";
+ reg = <0x0 8>;
+ };
+
+ restart_reason@65c {
+ compatible = "qcom,msm-imem-restart_reason";
+ reg = <0x65c 4>;
+ };
+
+ l2_dump_offset@14 {
+ compatible = "qcom,msm-imem-l2_dump_offset";
+ reg = <0x14 8>;
+ };
+ };
+
+ qcom_pinmux: pinmux@800000 {
+ compatible = "qcom,ipq8064-pinctrl";
+ reg = <0x800000 0x4000>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ interrupts = <0 32 0x4>;
+
+ pcie0_pins: pcie0_pinmux {
+ mux {
+ pins = "gpio3";
+ function = "pcie1_rst";
+ drive-strength = <12>;
+ bias-disable;
+ };
+ };
+
+ pcie1_pins: pcie1_pinmux {
+ mux {
+ pins = "gpio48";
+ function = "pcie2_rst";
+ drive-strength = <12>;
+ bias-disable;
+ };
+ };
+
+ pcie2_pins: pcie2_pinmux {
+ mux {
+ pins = "gpio63";
+ function = "pcie3_rst";
+ drive-strength = <12>;
+ bias-disable;
+ };
+ };
+ };
+
+ intc: interrupt-controller@2000000 {
+ compatible = "qcom,msm-qgic2";
+ interrupt-controller;
+ #interrupt-cells = <3>;
+ reg = <0x02000000 0x1000>,
+ <0x02002000 0x1000>;
+ };
+
+ timer@200a000 {
+ compatible = "qcom,kpss-timer", "qcom,msm-timer";
+ interrupts = <1 1 0x301>,
+ <1 2 0x301>,
+ <1 3 0x301>,
+ <1 4 0x301>,
+ <1 5 0x301>;
+ reg = <0x0200a000 0x100>;
+ clock-frequency = <25000000>,
+ <32768>;
+ clocks = <&sleep_clk>;
+ clock-names = "sleep";
+ cpu-offset = <0x80000>;
+ };
+
+ acc0: clock-controller@2088000 {
+ compatible = "qcom,kpss-acc-v1";
+ reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
+ clock-output-names = "acpu0_aux";
+ };
+
+ acc1: clock-controller@2098000 {
+ compatible = "qcom,kpss-acc-v1";
+ reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
+ clock-output-names = "acpu1_aux";
+ };
+
+ l2cc: clock-controller@2011000 {
+ compatible = "qcom,kpss-gcc", "syscon";
+ reg = <0x2011000 0x1000>;
+ clock-output-names = "acpu_l2_aux";
+ };
+
+ saw0: regulator@2089000 {
+ compatible = "qcom,saw2";
+ reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
+ regulator;
+ };
+
+ saw1: regulator@2099000 {
+ compatible = "qcom,saw2";
+ reg = <0x02099000 0x1000>, <0x02009000 0x1000>;
+ regulator;
+ };
+
+ gsbi2: gsbi@12480000 {
+ compatible = "qcom,gsbi-v1.0.0";
+ cell-index = <2>;
+ reg = <0x12480000 0x100>;
+ clocks = <&gcc GSBI2_H_CLK>;
+ clock-names = "iface";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ status = "disabled";
+
+ syscon-tcsr = <&tcsr>;
+
+ uart2: serial@12490000 {
+ compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+ reg = <0x12490000 0x1000>,
+ <0x12480000 0x1000>;
+ interrupts = <0 195 0x0>;
+ clocks = <&gcc GSBI2_UART_CLK>, <&gcc GSBI2_H_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+ };
+
+ i2c@124a0000 {
+ compatible = "qcom,i2c-qup-v1.1.1";
+ reg = <0x124a0000 0x1000>;
+ interrupts = <0 196 0>;
+
+ clocks = <&gcc GSBI2_QUP_CLK>, <&gcc GSBI2_H_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ };
+
+ gsbi4: gsbi@16300000 {
+ compatible = "qcom,gsbi-v1.0.0";
+ cell-index = <4>;
+ reg = <0x16300000 0x100>;
+ clocks = <&gcc GSBI4_H_CLK>;
+ clock-names = "iface";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ status = "disabled";
+
+ syscon-tcsr = <&tcsr>;
+
+ uart4: serial@16340000 {
+ compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+ reg = <0x16340000 0x1000>,
+ <0x16300000 0x1000>;
+ interrupts = <0 152 0x0>;
+ clocks = <&gcc GSBI4_UART_CLK>, <&gcc GSBI4_H_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+ };
+
+ i2c@16380000 {
+ compatible = "qcom,i2c-qup-v1.1.1";
+ reg = <0x16380000 0x1000>;
+ interrupts = <0 153 0>;
+
+ clocks = <&gcc GSBI4_QUP_CLK>, <&gcc GSBI4_H_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+
+ gsbi5: gsbi@1a200000 {
+ compatible = "qcom,gsbi-v1.0.0";
+ cell-index = <5>;
+ reg = <0x1a200000 0x100>;
+ clocks = <&gcc GSBI5_H_CLK>;
+ clock-names = "iface";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ status = "disabled";
+
+ syscon-tcsr = <&tcsr>;
+
+ uart5: serial@1a240000 {
+ compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+ reg = <0x1a240000 0x1000>,
+ <0x1a200000 0x1000>;
+ interrupts = <0 154 0x0>;
+ clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+ };
+
+ i2c@1a280000 {
+ compatible = "qcom,i2c-qup-v1.1.1";
+ reg = <0x1a280000 0x1000>;
+ interrupts = <0 155 0>;
+
+ clocks = <&gcc GSBI5_QUP_CLK>, <&gcc GSBI5_H_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ spi@1a280000 {
+ compatible = "qcom,spi-qup-v1.1.1";
+ reg = <0x1a280000 0x1000>;
+ interrupts = <0 155 0>;
+
+ clocks = <&gcc GSBI5_QUP_CLK>, <&gcc GSBI5_H_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+
+ sata_phy: sata-phy@1b400000 {
+ compatible = "qcom,ipq806x-sata-phy";
+ reg = <0x1b400000 0x200>;
+
+ clocks = <&gcc SATA_PHY_CFG_CLK>;
+ clock-names = "cfg";
+
+ #phy-cells = <0>;
+ status = "disabled";
+ };
+
+ sata@29000000 {
+ compatible = "qcom,ipq806x-ahci", "generic-ahci";
+ reg = <0x29000000 0x180>;
+
+ interrupts = <0 209 0x0>;
+
+ clocks = <&gcc SFAB_SATA_S_H_CLK>,
+ <&gcc SATA_H_CLK>,
+ <&gcc SATA_A_CLK>,
+ <&gcc SATA_RXOOB_CLK>,
+ <&gcc SATA_PMALIVE_CLK>;
+ clock-names = "slave_face", "iface", "core",
+ "rxoob", "pmalive";
+
+ assigned-clocks = <&gcc SATA_RXOOB_CLK>, <&gcc SATA_PMALIVE_CLK>;
+ assigned-clock-rates = <100000000>, <100000000>;
+
+ phys = <&sata_phy>;
+ phy-names = "sata-phy";
+ status = "disabled";
+ };
+
+ qcom,ssbi@500000 {
+ compatible = "qcom,ssbi";
+ reg = <0x00500000 0x1000>;
+ qcom,controller-type = "pmic-arbiter";
+ };
+
+ gcc: clock-controller@900000 {
+ compatible = "qcom,gcc-ipq8064";
+ reg = <0x00900000 0x4000>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
+
+ tcsr: syscon@1a400000 {
+ compatible = "qcom,tcsr-ipq8064", "syscon";
+ reg = <0x1a400000 0x100>;
+ };
+
+ tsens: tsens-ipq806x {
+ compatible = "qcom,ipq806x-tsens";
+ reg = <0x900000 0x3678>, <0x700000 0x420>;
+ reg-names = "tsens_physical", "tsens_eeprom_physical";
+ interrupts = <0 178 0>;
+ qcom,sensors = <11>;
+ qcom,tsens_factor = <1000>;
+ qcom,slope = <1176 1176 1154 1176 1111 1132 1132 1199 1132 1199 1132>;
+ };
+
+ qcom,msm-thermal {
+ compatible = "qcom,msm-thermal";
+ qcom,sensor-id = <0>;
+ qcom,poll-ms = <250>;
+ qcom,limit-temp = <105>;
+ qcom,temp-hysteresis = <10>;
+ qcom,freq-step = <2>;
+ qcom,core-limit-temp = <115>;
+ qcom,core-temp-hysteresis = <10>;
+ qcom,core-control-mask = <0xe>;
+ };
+
+ sfpb_mutex_block: syscon@1200600 {
+ compatible = "syscon";
+ reg = <0x01200600 0x100>;
+ };
+
+ hs_phy_1: phy@100f8800 {
+ compatible = "qcom,dwc3-hs-usb-phy";
+ reg = <0x100f8800 0x30>;
+ clocks = <&gcc USB30_1_UTMI_CLK>;
+ clock-names = "ref";
+ #phy-cells = <0>;
+
+ status = "disabled";
+ };
+
+ ss_phy_1: phy@100f8830 {
+ compatible = "qcom,dwc3-ss-usb-phy";
+ reg = <0x100f8830 0x30>;
+ clocks = <&gcc USB30_1_MASTER_CLK>;
+ clock-names = "ref";
+ #phy-cells = <0>;
+
+ status = "disabled";
+ };
+
+ hs_phy_0: phy@110f8800 {
+ compatible = "qcom,dwc3-hs-usb-phy";
+ reg = <0x110f8800 0x30>;
+ clocks = <&gcc USB30_0_UTMI_CLK>;
+ clock-names = "ref";
+ #phy-cells = <0>;
+
+ status = "disabled";
+ };
+
+ ss_phy_0: phy@110f8830 {
+ compatible = "qcom,dwc3-ss-usb-phy";
+ reg = <0x110f8830 0x30>;
+ clocks = <&gcc USB30_0_MASTER_CLK>;
+ clock-names = "ref";
+ #phy-cells = <0>;
+
+ status = "disabled";
+ };
+
+ usb3_0: usb30@0 {
+ compatible = "qcom,dwc3";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clocks = <&gcc USB30_0_MASTER_CLK>;
+ clock-names = "core";
+
+ ranges;
+
+ status = "disabled";
+ resets = <&gcc USB30_0_MASTER_RESET>;
+ reset-names = "usb30_mstr_rst";
+
+ dwc3@11000000 {
+ compatible = "snps,dwc3";
+ reg = <0x11000000 0xcd00>;
+ interrupts = <0 110 0x4>;
+ phys = <&hs_phy_0>, <&ss_phy_0>;
+ phy-names = "usb2-phy", "usb3-phy";
+ tx-fifo-resize;
+ dr_mode = "host";
+ };
+ };
+
+ usb3_1: usb30@1 {
+ compatible = "qcom,dwc3";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clocks = <&gcc USB30_1_MASTER_CLK>;
+ clock-names = "core";
+
+ ranges;
+
+ status = "disabled";
+
+ dwc3@10000000 {
+ compatible = "snps,dwc3";
+ reg = <0x10000000 0xcd00>;
+ interrupts = <0 205 0x4>;
+ phys = <&hs_phy_1>, <&ss_phy_1>;
+ phy-names = "usb2-phy", "usb3-phy";
+ tx-fifo-resize;
+ dr_mode = "host";
+ };
+ };
+
+ pcie0: pci@1b500000 {
+ compatible = "qcom,pcie-v0";
+ reg = <0x1b500000 0x1000
+ 0x1b502000 0x80
+ 0x1b600000 0x100
+ 0x0ff00000 0x100000>;
+ reg-names = "dbi", "elbi", "parf", "config";
+ device_type = "pci";
+ linux,pci-domain = <0>;
+ bus-range = <0x00 0xff>;
+ num-lanes = <1>;
+ #address-cells = <3>;
+ #size-cells = <2>;
+
+ ranges = <0x81000000 0 0x0fe00000 0x0fe00000 0 0x00100000 /* downstream I/O */
+ 0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */
+
+ interrupts = <GIC_SPI 35 IRQ_TYPE_NONE>;
+ interrupt-names = "msi";
+ #interrupt-cells = <1>;
+ interrupt-map-mask = <0 0 0 0x7>;
+ interrupt-map = <0 0 0 1 &intc 0 36 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
+ <0 0 0 2 &intc 0 37 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
+ <0 0 0 3 &intc 0 38 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
+ <0 0 0 4 &intc 0 39 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
+
+ clocks = <&gcc PCIE_A_CLK>,
+ <&gcc PCIE_H_CLK>,
+ <&gcc PCIE_PHY_CLK>,
+ <&gcc PCIE_AUX_CLK>,
+ <&gcc PCIE_ALT_REF_CLK>;
+ clock-names = "core", "iface", "phy", "aux", "ref";
+
+ assigned-clocks = <&gcc PCIE_ALT_REF_CLK>;
+ assigned-clock-rates = <100000000>;
+
+ resets = <&gcc PCIE_ACLK_RESET>,
+ <&gcc PCIE_HCLK_RESET>,
+ <&gcc PCIE_POR_RESET>,
+ <&gcc PCIE_PCI_RESET>,
+ <&gcc PCIE_PHY_RESET>,
+ <&gcc PCIE_EXT_RESET>;
+ reset-names = "axi", "ahb", "por", "pci", "phy", "ext";
+
+ pinctrl-0 = <&pcie0_pins>;
+ pinctrl-names = "default";
+
+ perst-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>;
+
+ status = "disabled";
+ };
+
+ pcie1: pci@1b700000 {
+ compatible = "qcom,pcie-v0";
+ reg = <0x1b700000 0x1000
+ 0x1b702000 0x80
+ 0x1b800000 0x100
+ 0x31f00000 0x100000>;
+ reg-names = "dbi", "elbi", "parf", "config";
+ device_type = "pci";
+ linux,pci-domain = <1>;
+ bus-range = <0x00 0xff>;
+ num-lanes = <1>;
+ #address-cells = <3>;
+ #size-cells = <2>;
+
+ ranges = <0x81000000 0 0x31e00000 0x31e00000 0 0x00100000 /* downstream I/O */
+ 0x82000000 0 0x2e000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */
+
+ interrupts = <GIC_SPI 57 IRQ_TYPE_NONE>;
+ interrupt-names = "msi";
+ #interrupt-cells = <1>;
+ interrupt-map-mask = <0 0 0 0x7>;
+ interrupt-map = <0 0 0 1 &intc 0 58 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
+ <0 0 0 2 &intc 0 59 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
+ <0 0 0 3 &intc 0 60 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
+ <0 0 0 4 &intc 0 61 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
+
+ clocks = <&gcc PCIE_1_A_CLK>,
+ <&gcc PCIE_1_H_CLK>,
+ <&gcc PCIE_1_PHY_CLK>,
+ <&gcc PCIE_1_AUX_CLK>,
+ <&gcc PCIE_1_ALT_REF_CLK>;
+ clock-names = "core", "iface", "phy", "aux", "ref";
+
+ assigned-clocks = <&gcc PCIE_1_ALT_REF_CLK>;
+ assigned-clock-rates = <100000000>;
+
+ resets = <&gcc PCIE_1_ACLK_RESET>,
+ <&gcc PCIE_1_HCLK_RESET>,
+ <&gcc PCIE_1_POR_RESET>,
+ <&gcc PCIE_1_PCI_RESET>,
+ <&gcc PCIE_1_PHY_RESET>,
+ <&gcc PCIE_1_EXT_RESET>;
+ reset-names = "axi", "ahb", "por", "pci", "phy", "ext";
+
+ pinctrl-0 = <&pcie1_pins>;
+ pinctrl-names = "default";
+
+ perst-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_LOW>;
+
+ status = "disabled";
+ };
+
+ pcie2: pci@1b900000 {
+ compatible = "qcom,pcie-v0";
+ reg = <0x1b900000 0x1000
+ 0x1b902000 0x80
+ 0x1ba00000 0x100
+ 0x35f00000 0x100000>;
+ reg-names = "dbi", "elbi", "parf", "config";
+ device_type = "pci";
+ linux,pci-domain = <2>;
+ bus-range = <0x00 0xff>;
+ num-lanes = <1>;
+ #address-cells = <3>;
+ #size-cells = <2>;
+
+ ranges = <0x81000000 0 0x35e00000 0x35e00000 0 0x00100000 /* downstream I/O */
+ 0x82000000 0 0x32000000 0x32000000 0 0x03e00000>; /* non-prefetchable memory */
+
+ interrupts = <GIC_SPI 71 IRQ_TYPE_NONE>;
+ interrupt-names = "msi";
+ #interrupt-cells = <1>;
+ interrupt-map-mask = <0 0 0 0x7>;
+ interrupt-map = <0 0 0 1 &intc 0 72 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
+ <0 0 0 2 &intc 0 73 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
+ <0 0 0 3 &intc 0 74 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
+ <0 0 0 4 &intc 0 75 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
+
+ clocks = <&gcc PCIE_2_A_CLK>,
+ <&gcc PCIE_2_H_CLK>,
+ <&gcc PCIE_2_PHY_CLK>,
+ <&gcc PCIE_2_AUX_CLK>,
+ <&gcc PCIE_2_ALT_REF_CLK>;
+ clock-names = "core", "iface", "phy", "aux", "ref";
+
+ assigned-clocks = <&gcc PCIE_2_ALT_REF_CLK>;
+ assigned-clock-rates = <100000000>;
+
+ resets = <&gcc PCIE_2_ACLK_RESET>,
+ <&gcc PCIE_2_HCLK_RESET>,
+ <&gcc PCIE_2_POR_RESET>,
+ <&gcc PCIE_2_PCI_RESET>,
+ <&gcc PCIE_2_PHY_RESET>,
+ <&gcc PCIE_2_EXT_RESET>;
+ reset-names = "axi", "ahb", "por", "pci", "phy", "ext";
+
+ pinctrl-0 = <&pcie2_pins>;
+ pinctrl-names = "default";
+
+ perst-gpio = <&qcom_pinmux 63 GPIO_ACTIVE_LOW>;
+
+ status = "disabled";
+ };
+
+ adm_dma: dma@18300000 {
+ compatible = "qcom,adm";
+ reg = <0x18300000 0x100000>;
+ interrupts = <0 170 0>;
+ #dma-cells = <1>;
+
+ clocks = <&gcc ADM0_CLK>, <&gcc ADM0_PBUS_CLK>;
+ clock-names = "core", "iface";
+
+ resets = <&gcc ADM0_RESET>,
+ <&gcc ADM0_PBUS_RESET>,
+ <&gcc ADM0_C0_RESET>,
+ <&gcc ADM0_C1_RESET>,
+ <&gcc ADM0_C2_RESET>;
+ reset-names = "clk", "pbus", "c0", "c1", "c2";
+ qcom,ee = <0>;
+
+ status = "disabled";
+ };
+
+ nand@1ac00000 {
+ compatible = "qcom,ebi2-nandc";
+ reg = <0x1ac00000 0x800>;
+
+ clocks = <&gcc EBI2_CLK>,
+ <&gcc EBI2_AON_CLK>;
+ clock-names = "core", "aon";
+
+ dmas = <&adm_dma 3>;
+ dma-names = "rxtx";
+ qcom,cmd-crci = <15>;
+ qcom,data-crci = <3>;
+
+ status = "disabled";
+ };
+
+ nss_common: syscon@03000000 {
+ compatible = "syscon";
+ reg = <0x03000000 0x0000FFFF>;
+ };
+
+ qsgmii_csr: syscon@1bb00000 {
+ compatible = "syscon";
+ reg = <0x1bb00000 0x000001FF>;
+ };
+
+ gmac0: ethernet@37000000 {
+ device_type = "network";
+ compatible = "qcom,ipq806x-gmac";
+ reg = <0x37000000 0x200000>;
+ interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+
+ qcom,nss-common = <&nss_common>;
+ qcom,qsgmii-csr = <&qsgmii_csr>;
+
+ clocks = <&gcc GMAC_CORE1_CLK>;
+ clock-names = "stmmaceth";
+
+ resets = <&gcc GMAC_CORE1_RESET>;
+ reset-names = "stmmaceth";
+
+ status = "disabled";
+ };
+
+ gmac1: ethernet@37200000 {
+ device_type = "network";
+ compatible = "qcom,ipq806x-gmac";
+ reg = <0x37200000 0x200000>;
+ interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+
+ qcom,nss-common = <&nss_common>;
+ qcom,qsgmii-csr = <&qsgmii_csr>;
+
+ clocks = <&gcc GMAC_CORE2_CLK>;
+ clock-names = "stmmaceth";
+
+ resets = <&gcc GMAC_CORE2_RESET>;
+ reset-names = "stmmaceth";
+
+ status = "disabled";
+ };
+
+ gmac2: ethernet@37400000 {
+ device_type = "network";
+ compatible = "qcom,ipq806x-gmac";
+ reg = <0x37400000 0x200000>;
+ interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+
+ qcom,nss-common = <&nss_common>;
+ qcom,qsgmii-csr = <&qsgmii_csr>;
+
+ clocks = <&gcc GMAC_CORE3_CLK>;
+ clock-names = "stmmaceth";
+
+ resets = <&gcc GMAC_CORE3_RESET>;
+ reset-names = "stmmaceth";
+
+ status = "disabled";
+ };
+
+ gmac3: ethernet@37600000 {
+ device_type = "network";
+ compatible = "qcom,ipq806x-gmac";
+ reg = <0x37600000 0x200000>;
+ interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+
+ qcom,nss-common = <&nss_common>;
+ qcom,qsgmii-csr = <&qsgmii_csr>;
+
+ clocks = <&gcc GMAC_CORE4_CLK>;
+ clock-names = "stmmaceth";
+
+ resets = <&gcc GMAC_CORE4_RESET>;
+ reset-names = "stmmaceth";
+
+ status = "disabled";
+ };
+ /* Temporary fixed regulator */
+ vsdcc_fixed: vsdcc-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "SDCC Power";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ sdcc1bam:dma@12402000 {
+ compatible = "qcom,bam-v1.3.0";
+ reg = <0x12402000 0x8000>;
+ interrupts = <0 98 0>;
+ clocks = <&gcc SDC1_H_CLK>;
+ clock-names = "bam_clk";
+ #dma-cells = <1>;
+ qcom,ee = <0>;
+ };
+
+ sdcc3bam:dma@12182000 {
+ compatible = "qcom,bam-v1.3.0";
+ reg = <0x12182000 0x8000>;
+ interrupts = <0 96 0>;
+ clocks = <&gcc SDC3_H_CLK>;
+ clock-names = "bam_clk";
+ #dma-cells = <1>;
+ qcom,ee = <0>;
+ };
+
+ amba {
+ compatible = "arm,amba-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ sdcc1: sdcc@12400000 {
+ status = "disabled";
+ compatible = "arm,pl18x", "arm,primecell";
+ arm,primecell-periphid = <0x00051180>;
+ reg = <0x12400000 0x2000>;
+ interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "cmd_irq";
+ clocks = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
+ clock-names = "mclk", "apb_pclk";
+ bus-width = <8>;
+ max-frequency = <48000000>;
+ non-removable;
+ cap-sd-highspeed;
+ cap-mmc-highspeed;
+ vmmc-supply = <&vsdcc_fixed>;
+ #dmas = <&sdcc1bam 2>, <&sdcc1bam 1>;
+ #dma-names = "tx", "rx";
+ };
+
+ sdcc3: sdcc@12180000 {
+ compatible = "arm,pl18x", "arm,primecell";
+ arm,primecell-periphid = <0x00051180>;
+ status = "disabled";
+ reg = <0x12180000 0x2000>;
+ interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "cmd_irq";
+ clocks = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
+ clock-names = "mclk", "apb_pclk";
+ bus-width = <8>;
+ cap-sd-highspeed;
+ cap-mmc-highspeed;
+ max-frequency = <192000000>;
+ #mmc-ddr-1_8v;
+ sd-uhs-sdr50;
+ vmmc-supply = <&vsdcc_fixed>;
+ #dmas = <&sdcc3bam 2>, <&sdcc3bam 1>;
+ #dma-names = "tx", "rx";
+ };
+ };
+
+ };
+
+ sfpb_mutex: sfpb-mutex {
+ compatible = "qcom,sfpb-mutex";
+ syscon = <&sfpb_mutex_block 4 4>;
+
+ #hwlock-cells = <1>;
+ };
+
+ smem {
+ compatible = "qcom,smem";
+ memory-region = <&smem>;
+ hwlocks = <&sfpb_mutex 3>;
+ };
+};
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index ff8b2c7d9b..2355fc7550 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -86,6 +86,19 @@ define Device/DniImage
endef
DEVICE_VARS += KERNEL_SIZE NETGEAR_BOARD_ID NETGEAR_HW_ID DEVICE_BLOCK_SIZE DEVICE_PAGE_SIZE
+define Device/TpSafeImage
+ PROFILES += $$(DEVICE_NAME)
+ FILESYSTEMS := squashfs
+ KERNEL_SUFFIX := -uImage
+ KERNEL = kernel-bin | append-dtb | uImage none
+ KERNEL_NAME := zImage
+ TPLINK_BOARD_NAME :=
+ IMAGES := factory.bin sysupgrade.bin
+ IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+ IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
+endef
+DEVICE_VARS += TPLINK_BOARD_NAME
+
define Device/AP148
$(call Device/FitImage)
$(call Device/UbiFit)
@@ -93,6 +106,8 @@ define Device/AP148
BLOCKSIZE := 128KiB
PAGESIZE := 2048
BOARD_NAME := ap148
+ DEVICE_TITLE := Qualcomm AP148
+ DEVICE_PACKAGES := ath10k-firmware-qca99x0
endef
define Device/AP148-legacy
@@ -102,6 +117,19 @@ define Device/AP148-legacy
BLOCKSIZE := 128KiB
PAGESIZE := 2048
BOARD_NAME := ap148
+ DEVICE_TITLE := Qualcomm AP148 (legacy)
+ DEVICE_PACKAGES := ath10k-firmware-qca99x0
+endef
+
+define Device/C2600
+ $(call Device/TpSafeImage)
+ DEVICE_DTS := qcom-ipq8064-c2600
+ BLOCKSIZE := 128KiB
+ PAGESIZE := 2048
+ BOARD_NAME := c2600
+ TPLINK_BOARD_NAME := C2600
+ DEVICE_TITLE := TP-Link Archer C2600
+ DEVICE_PACKAGES := ath10k-firmware-qca99x0
endef
define Device/D7800
@@ -113,6 +141,8 @@ define Device/D7800
BLOCKSIZE := 128KiB
PAGESIZE := 2048
BOARD_NAME := d7800
+ DEVICE_TITLE := Netgear Nighthawk X4 D7800
+ DEVICE_PACKAGES := ath10k-firmware-qca99x0
endef
define Device/DB149
@@ -120,6 +150,26 @@ define Device/DB149
DEVICE_DTS := qcom-ipq8064-db149
KERNEL_INSTALL := 1
BOARD_NAME := db149
+ DEVICE_TITLE := Qualcomm DB149
+ DEVICE_PACKAGES := ath10k-firmware-qca99x0
+endef
+
+define Device/EA8500
+ $(call Device/LegacyImage)
+ DEVICE_DTS := qcom-ipq8064-ea8500
+ PAGESIZE := 2048
+ BLOCKSIZE := 128KiB
+ KERNEL_SIZE := 3145728
+ FILESYSTEMS := squashfs
+ KERNEL = kernel-bin | append-dtb | uImage none | append-file $(KDIR)/root.dummy
+ PROFILES += $$(DEVICE_NAME)
+ BOARD_NAME := ea8500
+ IMAGES := factory.bin sysupgrade.tar
+ IMAGE/factory.bin := append-kernel 3145728 | append-ubi
+ IMAGE/sysupgrade.tar := sysupgrade-nand
+ DEVICE_VARS += DEVICE_DTS KERNEL_SIZE PAGESIZE BLOCKSIZE SUBPAGESIZE
+ DEVICE_TITLE := Linksys EA8500
+ DEVICE_PACKAGES := ath10k-firmware-qca99x0
endef
define Device/R7500
@@ -131,8 +181,23 @@ define Device/R7500
BLOCKSIZE := 128KiB
PAGESIZE := 2048
BOARD_NAME := r7500
+ DEVICE_TITLE := Netgear Nighthawk X4 R7500
+ DEVICE_PACKAGES := ath10k-firmware-qca99x0
+endef
+
+define Device/R7800
+ $(call Device/DniImage)
+ DEVICE_DTS := qcom-ipq8064-r7800
+ KERNEL_SIZE := 2097152
+ NETGEAR_BOARD_ID := R7800
+ NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
+ BLOCKSIZE := 128KiB
+ PAGESIZE := 2048
+ BOARD_NAME := r7800
+ DEVICE_TITLE := Netgear Nighthawk X4S R7800
+ DEVICE_PACKAGES := ath10k-firmware-qca9984
endef
-TARGET_DEVICES += AP148 AP148-legacy D7800 DB149 R7500
+TARGET_DEVICES += AP148 AP148-legacy C2600 D7800 DB149 EA8500 R7500 R7800
$(eval $(call BuildImage))
diff --git a/target/linux/ipq806x/patches-3.18/802-ARM-qcom-add-TPLink-C2600-device-tree.patch b/target/linux/ipq806x/patches-3.18/802-ARM-qcom-add-TPLink-C2600-device-tree.patch
new file mode 100644
index 0000000000..8952f3339d
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/802-ARM-qcom-add-TPLink-C2600-device-tree.patch
@@ -0,0 +1,425 @@
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -506,6 +506,7 @@
+ qcom-apq8084-ifc6540.dtb \
+ qcom-apq8084-mtp.dtb \
+ qcom-ipq8064-ap148.dtb \
++ qcom-ipq8064-c2600.dtb \
+ qcom-ipq8064-db149.dtb \
+ qcom-ipq8064-r7500.dtb \
+ qcom-ipq8064-d7800.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
+@@ -0,0 +1,412 @@
++#include "qcom-ipq8064-v1.0.dtsi"
++#include <dt-bindings/input/input.h>
++
++/ {
++ model = "TP-Link Archer C2600";
++ compatible = "tplink,c2600", "qcom,ipq8064";
++
++ memory@0 {
++ reg = <0x42000000 0x1e000000>;
++ device_type = "memory";
++ };
++
++ reserved-memory {
++ #address-cells = <1>;
++ #size-cells = <1>;
++ ranges;
++ rsvd@41200000 {
++ reg = <0x41200000 0x300000>;
++ no-map;
++ };
++ };
++
++ aliases {
++ serial0 = &uart4;
++ mdio-gpio0 = &mdio0;
++ };
++
++ chosen {
++ linux,stdout-path = "serial0:115200n8";
++ };
++
++ soc {
++ pinmux@800000 {
++ i2c4_pins: i2c4_pinmux {
++ pins = "gpio12", "gpio13";
++ function = "gsbi4";
++ bias-disable;
++ };
++
++ spi_pins: spi_pins {
++ mux {
++ pins = "gpio18", "gpio19", "gpio21";
++ function = "gsbi5";
++ drive-strength = <10>;
++ bias-none;
++ };
++ };
++
++ nand_pins: nand_pins {
++ mux {
++ pins = "gpio34", "gpio35", "gpio36",
++ "gpio37", "gpio38", "gpio39",
++ "gpio40", "gpio41", "gpio42",
++ "gpio43", "gpio44", "gpio45",
++ "gpio46", "gpio47";
++ function = "nand";
++ drive-strength = <10>;
++ bias-disable;
++ };
++
++ pullups {
++ pins = "gpio39";
++ bias-pull-up;
++ };
++
++ hold {
++ pins = "gpio40", "gpio41", "gpio42",
++ "gpio43", "gpio44", "gpio45",
++ "gpio46", "gpio47";
++ bias-bus-hold;
++ };
++ };
++
++ mdio0_pins: mdio0_pins {
++ mux {
++ pins = "gpio0", "gpio1";
++ function = "gpio";
++ drive-strength = <8>;
++ bias-disable;
++ };
++ };
++
++ rgmii2_pins: rgmii2_pins {
++ mux {
++ pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
++ "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
++ function = "rgmii2";
++ drive-strength = <8>;
++ bias-disable;
++ };
++ };
++ };
++
++ gsbi@16300000 {
++ qcom,mode = <GSBI_PROT_I2C_UART>;
++ status = "ok";
++ serial@16340000 {
++ status = "ok";
++ };
++ /*
++ * The i2c device on gsbi4 should not be enabled.
++ * On ipq806x designs gsbi4 i2c is meant for exclusive
++ * RPM usage. Turning this on in kernel manifests as
++ * i2c failure for the RPM.
++ */
++ };
++
++ gsbi5: gsbi@1a200000 {
++ qcom,mode = <GSBI_PROT_SPI>;
++ status = "ok";
++
++ spi4: spi@1a280000 {
++ status = "ok";
++ spi-max-frequency = <50000000>;
++
++ pinctrl-0 = <&spi_pins>;
++ pinctrl-names = "default";
++
++ cs-gpios = <&qcom_pinmux 20 0>;
++
++ flash: m25p80@0 {
++ compatible = "s25fl256s1";
++ #address-cells = <1>;
++ #size-cells = <1>;
++ spi-max-frequency = <50000000>;
++ reg = <0>;
++
++ SBL1@0 {
++ label = "SBL1";
++ reg = <0x0 0x20000>;
++ read-only;
++ };
++ MIBIB@20000 {
++ label = "MIBIB";
++ reg = <0x20000 0x20000>;
++ read-only;
++ };
++ SBL2@40000 {
++ label = "SBL2";
++ reg = <0x40000 0x20000>;
++ read-only;
++ };
++ SBL3@60000 {
++ label = "SBL3";
++ reg = <0x60000 0x30000>;
++ read-only;
++ };
++ DDRCONFIG@90000 {
++ label = "DDRCONFIG";
++ reg = <0x90000 0x10000>;
++ read-only;
++ };
++ SSD@a0000 {
++ label = "SSD";
++ reg = <0xa0000 0x10000>;
++ read-only;
++ };
++ TZ@b0000 {
++ label = "TZ";
++ reg = <0xb0000 0x30000>;
++ read-only;
++ };
++ RPM@e0000 {
++ label = "RPM";
++ reg = <0xe0000 0x20000>;
++ read-only;
++ };
++ fs-uboot@100000 {
++ label = "fs-uboot";
++ reg = <0x100000 0x70000>;
++ read-only;
++ };
++ uboot-env@170000 {
++ label = "uboot-env";
++ reg = <0x170000 0x40000>;
++ read-only;
++ };
++ radio@1b0000 {
++ label = "radio";
++ reg = <0x1b0000 0x40000>;
++ read-only;
++ };
++ os-image@1f0000 {
++ label = "os-image";
++ reg = <0x1f0000 0x200000>;
++ };
++ rootfs@3f0000 {
++ label = "rootfs";
++ reg = <0x3f0000 0x1b00000>;
++ };
++ defaultmac: default-mac@1ef0000 {
++ label = "default-mac";
++ reg = <0x1ef0000 0x00200>;
++ read-only;
++ };
++ pin@1ef0200 {
++ label = "pin";
++ reg = <0x1ef0200 0x00200>;
++ read-only;
++ };
++ product-info@1ef0400 {
++ label = "product-info";
++ reg = <0x1ef0400 0x0fc00>;
++ read-only;
++ };
++ partition-table@1f00000 {
++ label = "partition-table";
++ reg = <0x1f00000 0x10000>;
++ read-only;
++ };
++ soft-version@1f10000 {
++ label = "soft-version";
++ reg = <0x1f10000 0x10000>;
++ read-only;
++ };
++ support-list@1f20000 {
++ label = "support-list";
++ reg = <0x1f20000 0x10000>;
++ read-only;
++ };
++ profile@1f30000 {
++ label = "profile";
++ reg = <0x1f30000 0x10000>;
++ read-only;
++ };
++ default-config@1f40000 {
++ label = "default-config";
++ reg = <0x1f40000 0x10000>;
++ read-only;
++ };
++ user-config@1f50000 {
++ label = "user-config";
++ reg = <0x1f50000 0x40000>;
++ read-only;
++ };
++ qos-db@1f90000 {
++ label = "qos-db";
++ reg = <0x1f90000 0x40000>;
++ read-only;
++ };
++ usb-config@1fd0000 {
++ label = "usb-config";
++ reg = <0x1fd0000 0x10000>;
++ read-only;
++ };
++ log@1fe0000 {
++ label = "log";
++ reg = <0x1fe0000 0x20000>;
++ read-only;
++ };
++ };
++ };
++ };
++
++ phy@100f8800 { /* USB3 port 1 HS phy */
++ status = "ok";
++ };
++
++ phy@100f8830 { /* USB3 port 1 SS phy */
++ status = "ok";
++ };
++
++ phy@110f8800 { /* USB3 port 0 HS phy */
++ status = "ok";
++ };
++
++ phy@110f8830 { /* USB3 port 0 SS phy */
++ status = "ok";
++ };
++
++ usb30@0 {
++ status = "ok";
++ };
++
++ usb30@1 {
++ status = "ok";
++ };
++
++ pcie0: pci@1b500000 {
++ status = "ok";
++ phy-tx0-term-offset = <7>;
++ };
++
++ pcie1: pci@1b700000 {
++ status = "ok";
++ phy-tx0-term-offset = <7>;
++ };
++
++ mdio0: mdio {
++ compatible = "virtual,mdio-gpio";
++ #address-cells = <1>;
++ #size-cells = <0>;
++ gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
++ pinctrl-0 = <&mdio0_pins>;
++ pinctrl-names = "default";
++
++ phy0: ethernet-phy@0 {
++ device_type = "ethernet-phy";
++ reg = <0>;
++ qca,ar8327-initvals = <
++ 0x00004 0x7600000 /* PAD0_MODE */
++ 0x00008 0x1000000 /* PAD5_MODE */
++ 0x0000c 0x80 /* PAD6_MODE */
++ 0x000e4 0xaa545 /* MAC_POWER_SEL */
++ 0x000e0 0xc74164de /* SGMII_CTRL */
++ 0x0007c 0x4e /* PORT0_STATUS */
++ 0x00094 0x4e /* PORT6_STATUS */
++ >;
++ };
++
++ phy4: ethernet-phy@4 {
++ device_type = "ethernet-phy";
++ reg = <4>;
++ };
++ };
++
++ gmac1: ethernet@37200000 {
++ status = "ok";
++ phy-mode = "rgmii";
++ qcom,id = <1>;
++
++ pinctrl-0 = <&rgmii2_pins>;
++ pinctrl-names = "default";
++
++ mtd-mac-address = <&defaultmac 0x8>;
++ mtd-mac-address-increment = <1>;
++
++ fixed-link {
++ speed = <1000>;
++ full-duplex;
++ };
++ };
++
++ gmac2: ethernet@37400000 {
++ status = "ok";
++ phy-mode = "sgmii";
++ qcom,id = <2>;
++
++ mtd-mac-address = <&defaultmac 0x8>;
++
++ fixed-link {
++ speed = <1000>;
++ full-duplex;
++ };
++ };
++ };
++
++ gpio-keys {
++ compatible = "gpio-keys";
++
++ wifi {
++ label = "wifi";
++ gpios = <&qcom_pinmux 49 1>;
++ linux,code = <KEY_WLAN>;
++ };
++
++ reset {
++ label = "reset";
++ gpios = <&qcom_pinmux 64 1>;
++ linux,code = <KEY_RESTART>;
++ };
++
++ wps {
++ label = "wps";
++ gpios = <&qcom_pinmux 65 1>;
++ linux,code = <KEY_WPS_BUTTON>;
++ };
++ ledgeneral {
++ label = "ledgeneral";
++ gpios = <&qcom_pinmux 16 1>;
++ linux,code = <KEY_DOLLAR>;
++ };
++ };
++
++ gpio-leds {
++ compatible = "gpio-leds";
++
++ lan {
++ label = "lan:blue";
++ gpios = <&qcom_pinmux 6 0>;
++ };
++ usb4 {
++ label = "usb_4:blue";
++ gpios = <&qcom_pinmux 7 0>;
++ };
++ usb2 {
++ label = "usb_2:blue";
++ gpios = <&qcom_pinmux 8 0>;
++ };
++ wps {
++ label = "wps:blue";
++ gpios = <&qcom_pinmux 9 0>;
++ };
++ wan_blue {
++ label = "wan:blue";
++ gpios = <&qcom_pinmux 33 1>;
++ };
++ status {
++ label = "status:blue";
++ gpios = <&qcom_pinmux 53 0>;
++ default-state = "on";
++ };
++ ledgnr {
++ label = "ledgnr:blue";
++ gpios = <&qcom_pinmux 66 0>;
++ };
++ };
++};
++
++&adm_dma {
++ status = "ok";
++};
diff --git a/target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch b/target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
deleted file mode 100644
index 04f35b7ec7..0000000000
--- a/target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From fb7737e949e31d8a71acee6bbb670f32dbd2a2c0 Mon Sep 17 00:00:00 2001
-From: Suman Anna <s-anna@ti.com>
-Date: Wed, 4 Mar 2015 20:01:14 -0600
-Subject: [PATCH] hwspinlock/core: add device tree support
-
-This patch adds a new OF-friendly API of_hwspin_lock_get_id()
-for hwspinlock clients to use/request locks from a hwspinlock
-device instantiated through a device-tree blob. This new API
-can be used by hwspinlock clients to get the id for a specific
-lock using the phandle + args specifier, so that it can be
-requested using the available hwspin_lock_request_specific()
-API.
-
-Signed-off-by: Suman Anna <s-anna@ti.com>
-Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
-[small comment clarification]
-Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
----
- Documentation/hwspinlock.txt | 10 +++++
- drivers/hwspinlock/hwspinlock_core.c | 79 ++++++++++++++++++++++++++++++++++++
- include/linux/hwspinlock.h | 7 ++++
- 3 files changed, 96 insertions(+)
-
---- a/Documentation/hwspinlock.txt
-+++ b/Documentation/hwspinlock.txt
-@@ -48,6 +48,16 @@ independent, drivers.
- ids for predefined purposes.
- Should be called from a process context (might sleep).
-
-+ int of_hwspin_lock_get_id(struct device_node *np, int index);
-+ - retrieve the global lock id for an OF phandle-based specific lock.
-+ This function provides a means for DT users of a hwspinlock module
-+ to get the global lock id of a specific hwspinlock, so that it can
-+ be requested using the normal hwspin_lock_request_specific() API.
-+ The function returns a lock id number on success, -EPROBE_DEFER if
-+ the hwspinlock device is not yet registered with the core, or other
-+ error values.
-+ Should be called from a process context (might sleep).
-+
- int hwspin_lock_free(struct hwspinlock *hwlock);
- - free a previously-assigned hwspinlock; returns 0 on success, or an
- appropriate error code on failure (e.g. -EINVAL if the hwspinlock
---- a/drivers/hwspinlock/hwspinlock_core.c
-+++ b/drivers/hwspinlock/hwspinlock_core.c
-@@ -27,6 +27,7 @@
- #include <linux/hwspinlock.h>
- #include <linux/pm_runtime.h>
- #include <linux/mutex.h>
-+#include <linux/of.h>
-
- #include "hwspinlock_internal.h"
-
-@@ -257,6 +258,84 @@ void __hwspin_unlock(struct hwspinlock *
- }
- EXPORT_SYMBOL_GPL(__hwspin_unlock);
-
-+/**
-+ * of_hwspin_lock_simple_xlate - translate hwlock_spec to return a lock id
-+ * @bank: the hwspinlock device bank
-+ * @hwlock_spec: hwlock specifier as found in the device tree
-+ *
-+ * This is a simple translation function, suitable for hwspinlock platform
-+ * drivers that only has a lock specifier length of 1.
-+ *
-+ * Returns a relative index of the lock within a specified bank on success,
-+ * or -EINVAL on invalid specifier cell count.
-+ */
-+static inline int
-+of_hwspin_lock_simple_xlate(const struct of_phandle_args *hwlock_spec)
-+{
-+ if (WARN_ON(hwlock_spec->args_count != 1))
-+ return -EINVAL;
-+
-+ return hwlock_spec->args[0];
-+}
-+
-+/**
-+ * of_hwspin_lock_get_id() - get lock id for an OF phandle-based specific lock
-+ * @np: device node from which to request the specific hwlock
-+ * @index: index of the hwlock in the list of values
-+ *
-+ * This function provides a means for DT users of the hwspinlock module to
-+ * get the global lock id of a specific hwspinlock using the phandle of the
-+ * hwspinlock device, so that it can be requested using the normal
-+ * hwspin_lock_request_specific() API.
-+ *
-+ * Returns the global lock id number on success, -EPROBE_DEFER if the hwspinlock
-+ * device is not yet registered, -EINVAL on invalid args specifier value or an
-+ * appropriate error as returned from the OF parsing of the DT client node.
-+ */
-+int of_hwspin_lock_get_id(struct device_node *np, int index)
-+{
-+ struct of_phandle_args args;
-+ struct hwspinlock *hwlock;
-+ struct radix_tree_iter iter;
-+ void **slot;
-+ int id;
-+ int ret;
-+
-+ ret = of_parse_phandle_with_args(np, "hwlocks", "#hwlock-cells", index,
-+ &args);
-+ if (ret)
-+ return ret;
-+
-+ /* Find the hwspinlock device: we need its base_id */
-+ ret = -EPROBE_DEFER;
-+ rcu_read_lock();
-+ radix_tree_for_each_slot(slot, &hwspinlock_tree, &iter, 0) {
-+ hwlock = radix_tree_deref_slot(slot);
-+ if (unlikely(!hwlock))
-+ continue;
-+
-+ if (hwlock->bank->dev->of_node == args.np) {
-+ ret = 0;
-+ break;
-+ }
-+ }
-+ rcu_read_unlock();
-+ if (ret < 0)
-+ goto out;
-+
-+ id = of_hwspin_lock_simple_xlate(&args);
-+ if (id < 0 || id >= hwlock->bank->num_locks) {
-+ ret = -EINVAL;
-+ goto out;
-+ }
-+ id += hwlock->bank->base_id;
-+
-+out:
-+ of_node_put(args.np);
-+ return ret ? ret : id;
-+}
-+EXPORT_SYMBOL_GPL(of_hwspin_lock_get_id);
-+
- static int hwspin_lock_register_single(struct hwspinlock *hwlock, int id)
- {
- struct hwspinlock *tmp;
---- a/include/linux/hwspinlock.h
-+++ b/include/linux/hwspinlock.h
-@@ -26,6 +26,7 @@
- #define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */
-
- struct device;
-+struct device_node;
- struct hwspinlock;
- struct hwspinlock_device;
- struct hwspinlock_ops;
-@@ -66,6 +67,7 @@ int hwspin_lock_unregister(struct hwspin
- struct hwspinlock *hwspin_lock_request(void);
- struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
- int hwspin_lock_free(struct hwspinlock *hwlock);
-+int of_hwspin_lock_get_id(struct device_node *np, int index);
- int hwspin_lock_get_id(struct hwspinlock *hwlock);
- int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
- unsigned long *);
-@@ -120,6 +122,11 @@ void __hwspin_unlock(struct hwspinlock *
- {
- }
-
-+static inline int of_hwspin_lock_get_id(struct device_node *np, int index)
-+{
-+ return 0;
-+}
-+
- static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
- {
- return 0;
diff --git a/target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch b/target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
deleted file mode 100644
index 581b199d7f..0000000000
--- a/target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
+++ /dev/null
@@ -1,234 +0,0 @@
-From 19a0f61224d2d91860fa8291ab63cb104ee86bdd Mon Sep 17 00:00:00 2001
-From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
-Date: Tue, 24 Mar 2015 10:11:05 -0700
-Subject: [PATCH] hwspinlock: qcom: Add support for Qualcomm HW Mutex block
-
-Add driver for Qualcomm Hardware Mutex block found in many Qualcomm
-SoCs.
-
-Based on initial effort by Kumar Gala <galak@codeaurora.org>
-
-Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
-Reviewed-by: Andy Gross <agross@codeaurora.org>
-Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org>
-Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
----
- drivers/hwspinlock/Kconfig | 12 +++
- drivers/hwspinlock/Makefile | 1 +
- drivers/hwspinlock/qcom_hwspinlock.c | 181 +++++++++++++++++++++++++++++++++++
- 3 files changed, 194 insertions(+)
- create mode 100644 drivers/hwspinlock/qcom_hwspinlock.c
-
---- a/drivers/hwspinlock/Kconfig
-+++ b/drivers/hwspinlock/Kconfig
-@@ -18,6 +18,18 @@ config HWSPINLOCK_OMAP
-
- If unsure, say N.
-
-+config HWSPINLOCK_QCOM
-+ tristate "Qualcomm Hardware Spinlock device"
-+ depends on ARCH_QCOM
-+ select HWSPINLOCK
-+ select MFD_SYSCON
-+ help
-+ Say y here to support the Qualcomm Hardware Mutex functionality, which
-+ provides a synchronisation mechanism for the various processors on
-+ the SoC.
-+
-+ If unsure, say N.
-+
- config HSEM_U8500
- tristate "STE Hardware Semaphore functionality"
- depends on ARCH_U8500
---- a/drivers/hwspinlock/Makefile
-+++ b/drivers/hwspinlock/Makefile
-@@ -4,4 +4,5 @@
-
- obj-$(CONFIG_HWSPINLOCK) += hwspinlock_core.o
- obj-$(CONFIG_HWSPINLOCK_OMAP) += omap_hwspinlock.o
-+obj-$(CONFIG_HWSPINLOCK_QCOM) += qcom_hwspinlock.o
- obj-$(CONFIG_HSEM_U8500) += u8500_hsem.o
---- /dev/null
-+++ b/drivers/hwspinlock/qcom_hwspinlock.c
-@@ -0,0 +1,181 @@
-+/*
-+ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
-+ * Copyright (c) 2015, Sony Mobile Communications AB
-+ *
-+ * This software is licensed under the terms of the GNU General Public
-+ * License version 2, as published by the Free Software Foundation, and
-+ * may be copied, distributed, and modified under those terms.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/hwspinlock.h>
-+#include <linux/io.h>
-+#include <linux/kernel.h>
-+#include <linux/mfd/syscon.h>
-+#include <linux/module.h>
-+#include <linux/of.h>
-+#include <linux/of_device.h>
-+#include <linux/platform_device.h>
-+#include <linux/pm_runtime.h>
-+#include <linux/regmap.h>
-+
-+#include "hwspinlock_internal.h"
-+
-+#define QCOM_MUTEX_APPS_PROC_ID 1
-+#define QCOM_MUTEX_NUM_LOCKS 32
-+
-+static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
-+{
-+ struct regmap_field *field = lock->priv;
-+ u32 lock_owner;
-+ int ret;
-+
-+ ret = regmap_field_write(field, QCOM_MUTEX_APPS_PROC_ID);
-+ if (ret)
-+ return ret;
-+
-+ ret = regmap_field_read(field, &lock_owner);
-+ if (ret)
-+ return ret;
-+
-+ return lock_owner == QCOM_MUTEX_APPS_PROC_ID;
-+}
-+
-+static void qcom_hwspinlock_unlock(struct hwspinlock *lock)
-+{
-+ struct regmap_field *field = lock->priv;
-+ u32 lock_owner;
-+ int ret;
-+
-+ ret = regmap_field_read(field, &lock_owner);
-+ if (ret) {
-+ pr_err("%s: unable to query spinlock owner\n", __func__);
-+ return;
-+ }
-+
-+ if (lock_owner != QCOM_MUTEX_APPS_PROC_ID) {
-+ pr_err("%s: spinlock not owned by us (actual owner is %d)\n",
-+ __func__, lock_owner);
-+ }
-+
-+ ret = regmap_field_write(field, 0);
-+ if (ret)
-+ pr_err("%s: failed to unlock spinlock\n", __func__);
-+}
-+
-+static const struct hwspinlock_ops qcom_hwspinlock_ops = {
-+ .trylock = qcom_hwspinlock_trylock,
-+ .unlock = qcom_hwspinlock_unlock,
-+};
-+
-+static const struct of_device_id qcom_hwspinlock_of_match[] = {
-+ { .compatible = "qcom,sfpb-mutex" },
-+ { .compatible = "qcom,tcsr-mutex" },
-+ { }
-+};
-+MODULE_DEVICE_TABLE(of, qcom_hwspinlock_of_match);
-+
-+static int qcom_hwspinlock_probe(struct platform_device *pdev)
-+{
-+ struct hwspinlock_device *bank;
-+ struct device_node *syscon;
-+ struct reg_field field;
-+ struct regmap *regmap;
-+ size_t array_size;
-+ u32 stride;
-+ u32 base;
-+ int ret;
-+ int i;
-+
-+ syscon = of_parse_phandle(pdev->dev.of_node, "syscon", 0);
-+ if (!syscon) {
-+ dev_err(&pdev->dev, "no syscon property\n");
-+ return -ENODEV;
-+ }
-+
-+ regmap = syscon_node_to_regmap(syscon);
-+ if (IS_ERR(regmap))
-+ return PTR_ERR(regmap);
-+
-+ ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, &base);
-+ if (ret < 0) {
-+ dev_err(&pdev->dev, "no offset in syscon\n");
-+ return -EINVAL;
-+ }
-+
-+ ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 2, &stride);
-+ if (ret < 0) {
-+ dev_err(&pdev->dev, "no stride syscon\n");
-+ return -EINVAL;
-+ }
-+
-+ array_size = QCOM_MUTEX_NUM_LOCKS * sizeof(struct hwspinlock);
-+ bank = devm_kzalloc(&pdev->dev, sizeof(*bank) + array_size, GFP_KERNEL);
-+ if (!bank)
-+ return -ENOMEM;
-+
-+ platform_set_drvdata(pdev, bank);
-+
-+ for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
-+ field.reg = base + i * stride;
-+ field.lsb = 0;
-+ field.msb = 32;
-+
-+ bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
-+ regmap, field);
-+ }
-+
-+ pm_runtime_enable(&pdev->dev);
-+
-+ ret = hwspin_lock_register(bank, &pdev->dev, &qcom_hwspinlock_ops,
-+ 0, QCOM_MUTEX_NUM_LOCKS);
-+ if (ret)
-+ pm_runtime_disable(&pdev->dev);
-+
-+ return ret;
-+}
-+
-+static int qcom_hwspinlock_remove(struct platform_device *pdev)
-+{
-+ struct hwspinlock_device *bank = platform_get_drvdata(pdev);
-+ int ret;
-+
-+ ret = hwspin_lock_unregister(bank);
-+ if (ret) {
-+ dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret);
-+ return ret;
-+ }
-+
-+ pm_runtime_disable(&pdev->dev);
-+
-+ return 0;
-+}
-+
-+static struct platform_driver qcom_hwspinlock_driver = {
-+ .probe = qcom_hwspinlock_probe,
-+ .remove = qcom_hwspinlock_remove,
-+ .driver = {
-+ .name = "qcom_hwspinlock",
-+ .of_match_table = qcom_hwspinlock_of_match,
-+ },
-+};
-+
-+static int __init qcom_hwspinlock_init(void)
-+{
-+ return platform_driver_register(&qcom_hwspinlock_driver);
-+}
-+/* board init code might need to reserve hwspinlocks for predefined purposes */
-+postcore_initcall(qcom_hwspinlock_init);
-+
-+static void __exit qcom_hwspinlock_exit(void)
-+{
-+ platform_driver_unregister(&qcom_hwspinlock_driver);
-+}
-+module_exit(qcom_hwspinlock_exit);
-+
-+MODULE_LICENSE("GPL v2");
-+MODULE_DESCRIPTION("Hardware spinlock driver for Qualcomm SoCs");
diff --git a/target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch b/target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
deleted file mode 100644
index 70d5a58248..0000000000
--- a/target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From bd5717a4632cdecafe82d03de7dcb3b1876e2828 Mon Sep 17 00:00:00 2001
-From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
-Date: Fri, 26 Jun 2015 14:47:21 -0700
-Subject: [PATCH] hwspinlock: qcom: Correct msb in regmap_field
-
-msb of the regmap_field was mistakenly given the value 32, to set all bits
-in the regmap update mask; although incorrect this worked until 921cc294,
-where the mask calculation was corrected.
-
-Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
-Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
----
- drivers/hwspinlock/qcom_hwspinlock.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/hwspinlock/qcom_hwspinlock.c
-+++ b/drivers/hwspinlock/qcom_hwspinlock.c
-@@ -123,7 +123,7 @@ static int qcom_hwspinlock_probe(struct
- for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
- field.reg = base + i * stride;
- field.lsb = 0;
-- field.msb = 32;
-+ field.msb = 31;
-
- bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
- regmap, field);
diff --git a/target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch b/target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
deleted file mode 100644
index d22db2226e..0000000000
--- a/target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v2,1/2] soc: qcom: Add device tree binding for SMEM
-From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
-X-Patchwork-Id: 6202201
-Message-Id: <1428795178-24312-1-git-send-email-bjorn.andersson@sonymobile.com>
-To: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
- Mark Rutland <mark.rutland@arm.com>,
- Ian Campbell <ijc+devicetree@hellion.org.uk>,
- Kumar Gala <galak@codeaurora.org>, Jeffrey Hugo <jhugo@codeaurora.org>,
- Andry Gross <agross@codeaurora.org>
-Cc: <devicetree@vger.kernel.org>,
- linux-arm-msm <linux-arm-msm@vger.kernel.org>,
- <linux-kernel@vger.kernel.org>
-Date: Sat, 11 Apr 2015 16:32:57 -0700
-
-Add device tree binding documentation for the Qualcom Shared Memory
-manager.
-
-Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
-
----
-Changes since v1:
-- None
-
- .../devicetree/bindings/soc/qcom/qcom,smem.txt | 49 ++++++++++++++++++++++
- 1 file changed, 49 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
-@@ -0,0 +1,49 @@
-+Qualcomm Shared Memory binding
-+
-+This binding describes the Qualcomm Shared Memory, used to share data between
-+various subsystems and OSes in Qualcomm platforms.
-+
-+- compatible:
-+ Usage: required
-+ Value type: <stringlist>
-+ Definition: must be:
-+ "qcom,smem"
-+
-+- memory-region:
-+ Usage: required
-+ Value type: <prop-encoded-array>
-+ Definition: handle to memory reservation for main smem memory region.
-+
-+- reg:
-+ Usage: optional
-+ Value type: <prop-encoded-array>
-+ Definition: base address and size pair for any additional memory areas
-+ of the shared memory.
-+
-+- hwspinlocks:
-+ Usage: required
-+ Value type: <prop-encoded-array>
-+ Definition: reference to a hwspinlock used to protect allocations from
-+ the shared memory
-+
-+= EXAMPLE
-+
-+ reserved-memory {
-+ #address-cells = <1>;
-+ #size-cells = <1>;
-+ ranges;
-+
-+ smem_region: smem@fa00000 {
-+ reg = <0xfa00000 0x200000>;
-+ no-map;
-+ };
-+ };
-+
-+ smem@fa00000 {
-+ compatible = "qcom,smem";
-+
-+ memory-region = <&smem_region>;
-+ reg = <0xfc428000 0x4000>;
-+
-+ hwlocks = <&tcsr_mutex 3>;
-+ };
diff --git a/target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch b/target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
deleted file mode 100644
index 5598da26d8..0000000000
--- a/target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
+++ /dev/null
@@ -1,841 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v2,2/2] soc: qcom: Add Shared Memory Manager driver
-From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
-X-Patchwork-Id: 6202211
-Message-Id: <1428795178-24312-2-git-send-email-bjorn.andersson@sonymobile.com>
-To: Kumar Gala <galak@codeaurora.org>, Andy Gross <agross@codeaurora.org>,
- David Brown <davidb@codeaurora.org>, Jeffrey Hugo <jhugo@codeaurora.org>
-Cc: <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
- <linux-soc@vger.kernel.org>
-Date: Sat, 11 Apr 2015 16:32:58 -0700
-
-The Shared Memory Manager driver implements an interface for allocating
-and accessing items in the memory area shared among all of the
-processors in a Qualcomm platform.
-
-Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
-Reviewed-by: Andy Gross <agross@codeaurora.org>
-Tested-by: Andy Gross <agross@codeaurora.org>
-
----
-Changes since v1:
-- ioremapping the regions nocache
-- improved documentation of the two regions of partitions
-- corrected free space check in private allocator
-
- drivers/soc/qcom/Kconfig | 7 +
- drivers/soc/qcom/Makefile | 1 +
- drivers/soc/qcom/smem.c | 768 ++++++++++++++++++++++++++++++++++++++++++
- include/linux/soc/qcom/smem.h | 14 +
- 4 files changed, 790 insertions(+)
- create mode 100644 drivers/soc/qcom/smem.c
- create mode 100644 include/linux/soc/qcom/smem.h
-
---- a/drivers/soc/qcom/Kconfig
-+++ b/drivers/soc/qcom/Kconfig
-@@ -10,3 +10,10 @@ config QCOM_GSBI
- functions for connecting the underlying serial UART, SPI, and I2C
- devices to the output pins.
-
-+config QCOM_SMEM
-+ tristate "Qualcomm Shared Memory Manager (SMEM)"
-+ depends on ARCH_QCOM
-+ help
-+ Say y here to enable support for the Qualcomm Shared Memory Manager.
-+ The driver provides an interface to items in a heap shared among all
-+ processors in a Qualcomm platform.
---- a/drivers/soc/qcom/Makefile
-+++ b/drivers/soc/qcom/Makefile
-@@ -1 +1,2 @@
- obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o
-+obj-$(CONFIG_QCOM_SMEM) += smem.o
---- /dev/null
-+++ b/drivers/soc/qcom/smem.c
-@@ -0,0 +1,768 @@
-+/*
-+ * Copyright (c) 2015, Sony Mobile Communications AB.
-+ * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/hwspinlock.h>
-+#include <linux/io.h>
-+#include <linux/module.h>
-+#include <linux/of.h>
-+#include <linux/of_address.h>
-+#include <linux/platform_device.h>
-+#include <linux/slab.h>
-+#include <linux/soc/qcom/smem.h>
-+
-+/*
-+ * The Qualcomm shared memory system is a allocate only heap structure that
-+ * consists of one of more memory areas that can be accessed by the processors
-+ * in the SoC.
-+ *
-+ * All systems contains a global heap, accessible by all processors in the SoC,
-+ * with a table of contents data structure (@smem_header) at the beginning of
-+ * the main shared memory block.
-+ *
-+ * The global header contains metadata for allocations as well as a fixed list
-+ * of 512 entries (@smem_global_entry) that can be initialized to reference
-+ * parts of the shared memory space.
-+ *
-+ *
-+ * In addition to this global heap a set of "private" heaps can be set up at
-+ * boot time with access restrictions so that only certain processor pairs can
-+ * access the data.
-+ *
-+ * These partitions are referenced from an optional partition table
-+ * (@smem_ptable), that is found 4kB from the end of the main smem region. The
-+ * partition table entries (@smem_ptable_entry) lists the involved processors
-+ * (or hosts) and their location in the main shared memory region.
-+ *
-+ * Each partition starts with a header (@smem_partition_header) that identifies
-+ * the partition and holds properties for the two internal memory regions. The
-+ * two regions are cached and non-cached memory respectively. Each region
-+ * contain a link list of allocation headers (@smem_private_entry) followed by
-+ * their data.
-+ *
-+ * Items in the non-cached region are allocated from the start of the partition
-+ * while items in the cached region are allocated from the end. The free area
-+ * is hence the region between the cached and non-cached offsets.
-+ *
-+ *
-+ * To synchronize allocations in the shared memory heaps a remote spinlock must
-+ * be held - currently lock number 3 of the sfpb or tcsr is used for this on all
-+ * platforms.
-+ *
-+ */
-+
-+/**
-+ * struct smem_proc_comm - proc_comm communication struct (legacy)
-+ * @command: current command to be executed
-+ * @status: status of the currently requested command
-+ * @params: parameters to the command
-+ */
-+struct smem_proc_comm {
-+ u32 command;
-+ u32 status;
-+ u32 params[2];
-+};
-+
-+/**
-+ * struct smem_global_entry - entry to reference smem items on the heap
-+ * @allocated: boolean to indicate if this entry is used
-+ * @offset: offset to the allocated space
-+ * @size: size of the allocated space, 8 byte aligned
-+ * @aux_base: base address for the memory region used by this unit, or 0 for
-+ * the default region. bits 0,1 are reserved
-+ */
-+struct smem_global_entry {
-+ u32 allocated;
-+ u32 offset;
-+ u32 size;
-+ u32 aux_base; /* bits 1:0 reserved */
-+};
-+#define AUX_BASE_MASK 0xfffffffc
-+
-+/**
-+ * struct smem_header - header found in beginning of primary smem region
-+ * @proc_comm: proc_comm communication interface (legacy)
-+ * @version: array of versions for the various subsystems
-+ * @initialized: boolean to indicate that smem is initialized
-+ * @free_offset: index of the first unallocated byte in smem
-+ * @available: number of bytes available for allocation
-+ * @reserved: reserved field, must be 0
-+ * toc: array of references to items
-+ */
-+struct smem_header {
-+ struct smem_proc_comm proc_comm[4];
-+ u32 version[32];
-+ u32 initialized;
-+ u32 free_offset;
-+ u32 available;
-+ u32 reserved;
-+ struct smem_global_entry toc[];
-+};
-+
-+/**
-+ * struct smem_ptable_entry - one entry in the @smem_ptable list
-+ * @offset: offset, within the main shared memory region, of the partition
-+ * @size: size of the partition
-+ * @flags: flags for the partition (currently unused)
-+ * @host0: first processor/host with access to this partition
-+ * @host1: second processor/host with access to this partition
-+ * @reserved: reserved entries for later use
-+ */
-+struct smem_ptable_entry {
-+ u32 offset;
-+ u32 size;
-+ u32 flags;
-+ u16 host0;
-+ u16 host1;
-+ u32 reserved[8];
-+};
-+
-+/**
-+ * struct smem_ptable - partition table for the private partitions
-+ * @magic: magic number, must be SMEM_PTABLE_MAGIC
-+ * @version: version of the partition table
-+ * @num_entries: number of partitions in the table
-+ * @reserved: for now reserved entries
-+ * @entry: list of @smem_ptable_entry for the @num_entries partitions
-+ */
-+struct smem_ptable {
-+ u32 magic;
-+ u32 version;
-+ u32 num_entries;
-+ u32 reserved[5];
-+ struct smem_ptable_entry entry[];
-+};
-+#define SMEM_PTABLE_MAGIC 0x434f5424 /* "$TOC" */
-+
-+/**
-+ * struct smem_partition_header - header of the partitions
-+ * @magic: magic number, must be SMEM_PART_MAGIC
-+ * @host0: first processor/host with access to this partition
-+ * @host1: second processor/host with access to this partition
-+ * @size: size of the partition
-+ * @offset_free_uncached: offset to the first free byte of uncached memory in
-+ * this partition
-+ * @offset_free_cached: offset to the first free byte of cached memory in this
-+ * partition
-+ * @reserved: for now reserved entries
-+ */
-+struct smem_partition_header {
-+ u32 magic;
-+ u16 host0;
-+ u16 host1;
-+ u32 size;
-+ u32 offset_free_uncached;
-+ u32 offset_free_cached;
-+ u32 reserved[3];
-+};
-+#define SMEM_PART_MAGIC 0x54525024 /* "$PRT" */
-+
-+/**
-+ * struct smem_private_entry - header of each item in the private partition
-+ * @canary: magic number, must be SMEM_PRIVATE_CANARY
-+ * @item: identifying number of the smem item
-+ * @size: size of the data, including padding bytes
-+ * @padding_data: number of bytes of padding of data
-+ * @padding_hdr: number of bytes of padding between the header and the data
-+ * @reserved: for now reserved entry
-+ */
-+struct smem_private_entry {
-+ u16 canary;
-+ u16 item;
-+ u32 size; /* includes padding bytes */
-+ u16 padding_data;
-+ u16 padding_hdr;
-+ u32 reserved;
-+};
-+#define SMEM_PRIVATE_CANARY 0xa5a5
-+
-+/*
-+ * Item 3 of the global heap contains an array of versions for the various
-+ * software components in the SoC. We verify that the boot loader version is
-+ * what the expected version (SMEM_EXPECTED_VERSION) as a sanity check.
-+ */
-+#define SMEM_ITEM_VERSION 3
-+#define SMEM_MASTER_SBL_VERSION_INDEX 7
-+#define SMEM_EXPECTED_VERSION 11
-+
-+/*
-+ * The first 8 items are only to be allocated by the boot loader while
-+ * initializing the heap.
-+ */
-+#define SMEM_ITEM_LAST_FIXED 8
-+
-+/* Highest accepted item number, for both global and private heaps */
-+#define SMEM_ITEM_LAST 512
-+
-+/* Processor/host identifier for the application processor */
-+#define SMEM_HOST_APPS 0
-+
-+/* Max number of processors/hosts in a system */
-+#define SMEM_HOST_COUNT 7
-+
-+/**
-+ * struct smem_region - representation of a chunk of memory used for smem
-+ * @aux_base: identifier of aux_mem base
-+ * @virt_base: virtual base address of memory with this aux_mem identifier
-+ * @size: size of the memory region
-+ */
-+struct smem_region {
-+ u32 aux_base;
-+ void __iomem *virt_base;
-+ size_t size;
-+};
-+
-+/**
-+ * struct qcom_smem - device data for the smem device
-+ * @dev: device pointer
-+ * @hwlock: reference to a hwspinlock
-+ * @partitions: list of pointers to partitions affecting the current
-+ * processor/host
-+ * @num_regions: number of @regions
-+ * @regions: list of the memory regions defining the shared memory
-+ */
-+struct qcom_smem {
-+ struct device *dev;
-+
-+ struct hwspinlock *hwlock;
-+
-+ struct smem_partition_header *partitions[SMEM_HOST_COUNT];
-+
-+ unsigned num_regions;
-+ struct smem_region regions[0];
-+};
-+
-+/* Pointer to the one and only smem handle */
-+static struct qcom_smem *__smem;
-+
-+/* Timeout (ms) for the trylock of remote spinlocks */
-+#define HWSPINLOCK_TIMEOUT 1000
-+
-+static int qcom_smem_alloc_private(struct qcom_smem *smem,
-+ unsigned host,
-+ unsigned item,
-+ size_t size)
-+{
-+ struct smem_partition_header *phdr;
-+ struct smem_private_entry *hdr;
-+ size_t alloc_size;
-+ void *p;
-+
-+ /* We're not going to find it if there's no matching partition */
-+ if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
-+ return -ENOENT;
-+
-+ phdr = smem->partitions[host];
-+
-+ p = (void *)phdr + sizeof(*phdr);
-+ while (p < (void *)phdr + phdr->offset_free_uncached) {
-+ hdr = p;
-+
-+ if (hdr->canary != SMEM_PRIVATE_CANARY) {
-+ dev_err(smem->dev,
-+ "Found invalid canary in host %d partition\n",
-+ host);
-+ return -EINVAL;
-+ }
-+
-+ if (hdr->item == item)
-+ return -EEXIST;
-+
-+ p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
-+ }
-+
-+ /* Check that we don't grow into the cached region */
-+ alloc_size = sizeof(*hdr) + ALIGN(size, 8);
-+ if (p + alloc_size >= (void *)phdr + phdr->offset_free_cached) {
-+ dev_err(smem->dev, "Out of memory\n");
-+ return -ENOSPC;
-+ }
-+
-+ hdr = p;
-+ hdr->canary = SMEM_PRIVATE_CANARY;
-+ hdr->item = item;
-+ hdr->size = ALIGN(size, 8);
-+ hdr->padding_data = hdr->size - size;
-+ hdr->padding_hdr = 0;
-+
-+ /*
-+ * Ensure the header is written before we advance the free offset, so
-+ * that remote processors that does not take the remote spinlock still
-+ * gets a consistent view of the linked list.
-+ */
-+ wmb();
-+ phdr->offset_free_uncached += alloc_size;
-+
-+ return 0;
-+}
-+
-+static int qcom_smem_alloc_global(struct qcom_smem *smem,
-+ unsigned item,
-+ size_t size)
-+{
-+ struct smem_header *header;
-+ struct smem_global_entry *entry;
-+
-+ if (WARN_ON(item >= SMEM_ITEM_LAST))
-+ return -EINVAL;
-+
-+ header = smem->regions[0].virt_base;
-+ entry = &header->toc[item];
-+ if (entry->allocated)
-+ return -EEXIST;
-+
-+ size = ALIGN(size, 8);
-+ if (WARN_ON(size > header->available))
-+ return -ENOMEM;
-+
-+ entry->offset = header->free_offset;
-+ entry->size = size;
-+
-+ /*
-+ * Ensure the header is consistent before we mark the item allocated,
-+ * so that remote processors will get a consistent view of the item
-+ * even though they do not take the spinlock on read.
-+ */
-+ wmb();
-+ entry->allocated = 1;
-+
-+ header->free_offset += size;
-+ header->available -= size;
-+
-+ return 0;
-+}
-+
-+/**
-+ * qcom_smem_alloc - allocate space for a smem item
-+ * @host: remote processor id, or -1
-+ * @item: smem item handle
-+ * @size: number of bytes to be allocated
-+ *
-+ * Allocate space for a given smem item of size @size, given that the item is
-+ * not yet allocated.
-+ */
-+int qcom_smem_alloc(unsigned host, unsigned item, size_t size)
-+{
-+ unsigned long flags;
-+ int ret;
-+
-+ if (!__smem)
-+ return -EPROBE_DEFER;
-+
-+ if (item < SMEM_ITEM_LAST_FIXED) {
-+ dev_err(__smem->dev,
-+ "Rejecting allocation of static entry %d\n", item);
-+ return -EINVAL;
-+ }
-+
-+ ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
-+ HWSPINLOCK_TIMEOUT,
-+ &flags);
-+ if (ret)
-+ return ret;
-+
-+ ret = qcom_smem_alloc_private(__smem, host, item, size);
-+ if (ret == -ENOENT)
-+ ret = qcom_smem_alloc_global(__smem, item, size);
-+
-+ hwspin_unlock_irqrestore(__smem->hwlock, &flags);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL(qcom_smem_alloc);
-+
-+static int qcom_smem_get_global(struct qcom_smem *smem,
-+ unsigned item,
-+ void **ptr,
-+ size_t *size)
-+{
-+ struct smem_header *header;
-+ struct smem_region *area;
-+ struct smem_global_entry *entry;
-+ u32 aux_base;
-+ unsigned i;
-+
-+ if (WARN_ON(item >= SMEM_ITEM_LAST))
-+ return -EINVAL;
-+
-+ header = smem->regions[0].virt_base;
-+ entry = &header->toc[item];
-+ if (!entry->allocated)
-+ return -ENXIO;
-+
-+ if (ptr != NULL) {
-+ aux_base = entry->aux_base & AUX_BASE_MASK;
-+
-+ for (i = 0; i < smem->num_regions; i++) {
-+ area = &smem->regions[i];
-+
-+ if (area->aux_base == aux_base || !aux_base) {
-+ *ptr = area->virt_base + entry->offset;
-+ break;
-+ }
-+ }
-+ }
-+ if (size != NULL)
-+ *size = entry->size;
-+
-+ return 0;
-+}
-+
-+static int qcom_smem_get_private(struct qcom_smem *smem,
-+ unsigned host,
-+ unsigned item,
-+ void **ptr,
-+ size_t *size)
-+{
-+ struct smem_partition_header *phdr;
-+ struct smem_private_entry *hdr;
-+ void *p;
-+
-+ /* We're not going to find it if there's no matching partition */
-+ if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
-+ return -ENOENT;
-+
-+ phdr = smem->partitions[host];
-+
-+ p = (void *)phdr + sizeof(*phdr);
-+ while (p < (void *)phdr + phdr->offset_free_uncached) {
-+ hdr = p;
-+
-+ if (hdr->canary != SMEM_PRIVATE_CANARY) {
-+ dev_err(smem->dev,
-+ "Found invalid canary in host %d partition\n",
-+ host);
-+ return -EINVAL;
-+ }
-+
-+ if (hdr->item == item) {
-+ if (ptr != NULL)
-+ *ptr = p + sizeof(*hdr) + hdr->padding_hdr;
-+
-+ if (size != NULL)
-+ *size = hdr->size - hdr->padding_data;
-+
-+ return 0;
-+ }
-+
-+ p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
-+ }
-+
-+ return -ENOENT;
-+}
-+
-+/**
-+ * qcom_smem_get - resolve ptr of size of a smem item
-+ * @host: the remote processor, or -1
-+ * @item: smem item handle
-+ * @ptr: pointer to be filled out with address of the item
-+ * @size: pointer to be filled out with size of the item
-+ *
-+ * Looks up pointer and size of a smem item.
-+ */
-+int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size)
-+{
-+ unsigned long flags;
-+ int ret;
-+
-+ if (!__smem)
-+ return -EPROBE_DEFER;
-+
-+ ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
-+ HWSPINLOCK_TIMEOUT,
-+ &flags);
-+ if (ret)
-+ return ret;
-+
-+ ret = qcom_smem_get_private(__smem, host, item, ptr, size);
-+ if (ret == -ENOENT)
-+ ret = qcom_smem_get_global(__smem, item, ptr, size);
-+
-+ hwspin_unlock_irqrestore(__smem->hwlock, &flags);
-+ return ret;
-+
-+}
-+EXPORT_SYMBOL(qcom_smem_get);
-+
-+/**
-+ * qcom_smem_get_free_space - retrieve amont of free space in a partition
-+ * @host: the remote processor identifing a partition, or -1
-+ *
-+ * To be used by smem clients as a quick way to determine if any new
-+ * allocations has been made.
-+ */
-+int qcom_smem_get_free_space(unsigned host)
-+{
-+ struct smem_partition_header *phdr;
-+ struct smem_header *header;
-+ unsigned ret;
-+
-+ if (!__smem)
-+ return -EPROBE_DEFER;
-+
-+ if (host < SMEM_HOST_COUNT && __smem->partitions[host]) {
-+ phdr = __smem->partitions[host];
-+ ret = phdr->offset_free_uncached;
-+ } else {
-+ header = __smem->regions[0].virt_base;
-+ ret = header->available;
-+ }
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL(qcom_smem_get_free_space);
-+
-+static int qcom_smem_get_sbl_version(struct qcom_smem *smem)
-+{
-+ unsigned *versions;
-+ size_t size;
-+ int ret;
-+
-+ ret = qcom_smem_get_global(smem, SMEM_ITEM_VERSION,
-+ (void **)&versions, &size);
-+ if (ret < 0) {
-+ dev_err(smem->dev, "Unable to read the version item\n");
-+ return -ENOENT;
-+ }
-+
-+ if (size < sizeof(unsigned) * SMEM_MASTER_SBL_VERSION_INDEX) {
-+ dev_err(smem->dev, "Version item is too small\n");
-+ return -EINVAL;
-+ }
-+
-+ return versions[SMEM_MASTER_SBL_VERSION_INDEX];
-+}
-+
-+static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
-+ unsigned local_host)
-+{
-+ struct smem_partition_header *header;
-+ struct smem_ptable_entry *entry;
-+ struct smem_ptable *ptable;
-+ unsigned remote_host;
-+ int i;
-+
-+ ptable = smem->regions[0].virt_base + smem->regions[0].size - 4 * 1024;
-+ if (ptable->magic != SMEM_PTABLE_MAGIC)
-+ return 0;
-+
-+ if (ptable->version != 1) {
-+ dev_err(smem->dev,
-+ "Unsupported partition header version %d\n",
-+ ptable->version);
-+ return -EINVAL;
-+ }
-+
-+ for (i = 0; i < ptable->num_entries; i++) {
-+ entry = &ptable->entry[i];
-+
-+ if (entry->host0 != local_host && entry->host1 != local_host)
-+ continue;
-+
-+ if (!entry->offset)
-+ continue;
-+
-+ if (!entry->size)
-+ continue;
-+
-+ if (entry->host0 == local_host)
-+ remote_host = entry->host1;
-+ else
-+ remote_host = entry->host0;
-+
-+ if (smem->partitions[remote_host]) {
-+ dev_err(smem->dev,
-+ "Already found a partition for host %d\n",
-+ remote_host);
-+ return -EINVAL;
-+ }
-+
-+ header = smem->regions[0].virt_base + entry->offset;
-+
-+ if (header->magic != SMEM_PART_MAGIC) {
-+ dev_err(smem->dev,
-+ "Partition %d has invalid magic\n", i);
-+ return -EINVAL;
-+ }
-+
-+ if (header->host0 != local_host && header->host1 != local_host) {
-+ dev_err(smem->dev,
-+ "Partition %d hosts are invalid\n", i);
-+ return -EINVAL;
-+ }
-+
-+ if (header->host0 != remote_host && header->host1 != remote_host) {
-+ dev_err(smem->dev,
-+ "Partition %d hosts are invalid\n", i);
-+ return -EINVAL;
-+ }
-+
-+ if (header->size != entry->size) {
-+ dev_err(smem->dev,
-+ "Partition %d has invalid size\n", i);
-+ return -EINVAL;
-+ }
-+
-+ if (header->offset_free_uncached > header->size) {
-+ dev_err(smem->dev,
-+ "Partition %d has invalid free pointer\n", i);
-+ return -EINVAL;
-+ }
-+
-+ smem->partitions[remote_host] = header;
-+ }
-+
-+ return 0;
-+}
-+
-+static int qcom_smem_count_mem_regions(struct platform_device *pdev)
-+{
-+ struct resource *res;
-+ int num_regions = 0;
-+ int i;
-+
-+ for (i = 0; i < pdev->num_resources; i++) {
-+ res = &pdev->resource[i];
-+
-+ if (resource_type(res) == IORESOURCE_MEM)
-+ num_regions++;
-+ }
-+
-+ return num_regions;
-+}
-+
-+static int qcom_smem_probe(struct platform_device *pdev)
-+{
-+ struct smem_header *header;
-+ struct device_node *np;
-+ struct qcom_smem *smem;
-+ struct resource *res;
-+ struct resource r;
-+ size_t array_size;
-+ int num_regions = 0;
-+ int hwlock_id;
-+ u32 version;
-+ int ret;
-+ int i;
-+
-+ num_regions = qcom_smem_count_mem_regions(pdev) + 1;
-+
-+ array_size = num_regions * sizeof(struct smem_region);
-+ smem = devm_kzalloc(&pdev->dev, sizeof(*smem) + array_size, GFP_KERNEL);
-+ if (!smem)
-+ return -ENOMEM;
-+
-+ smem->dev = &pdev->dev;
-+ smem->num_regions = num_regions;
-+
-+ np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
-+ if (!np) {
-+ dev_err(&pdev->dev, "No memory-region specified\n");
-+ return -EINVAL;
-+ }
-+
-+ ret = of_address_to_resource(np, 0, &r);
-+ of_node_put(np);
-+ if (ret)
-+ return ret;
-+
-+ smem->regions[0].aux_base = (u32)r.start;
-+ smem->regions[0].size = resource_size(&r);
-+ smem->regions[0].virt_base = devm_ioremap_nocache(&pdev->dev,
-+ r.start,
-+ resource_size(&r));
-+ if (!smem->regions[0].virt_base)
-+ return -ENOMEM;
-+
-+ for (i = 1; i < num_regions; i++) {
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, i - 1);
-+
-+ smem->regions[i].aux_base = (u32)res->start;
-+ smem->regions[i].size = resource_size(res);
-+ smem->regions[i].virt_base = devm_ioremap_nocache(&pdev->dev,
-+ res->start,
-+ resource_size(res));
-+ if (!smem->regions[i].virt_base)
-+ return -ENOMEM;
-+ }
-+
-+ header = smem->regions[0].virt_base;
-+ if (header->initialized != 1 || header->reserved) {
-+ dev_err(&pdev->dev, "SMEM is not initilized by SBL\n");
-+ return -EINVAL;
-+ }
-+
-+ version = qcom_smem_get_sbl_version(smem);
-+ if (version >> 16 != SMEM_EXPECTED_VERSION) {
-+ dev_err(&pdev->dev, "Unsupported smem version 0x%x\n", version);
-+ return -EINVAL;
-+ }
-+
-+ ret = qcom_smem_enumerate_partitions(smem, SMEM_HOST_APPS);
-+ if (ret < 0)
-+ return ret;
-+
-+ hwlock_id = of_hwspin_lock_get_id(pdev->dev.of_node, 0);
-+ if (hwlock_id < 0) {
-+ dev_err(&pdev->dev, "failed to retrieve hwlock\n");
-+ return hwlock_id;
-+ }
-+
-+ smem->hwlock = hwspin_lock_request_specific(hwlock_id);
-+ if (!smem->hwlock)
-+ return -ENXIO;
-+
-+ __smem = smem;
-+
-+ return 0;
-+}
-+
-+static int qcom_smem_remove(struct platform_device *pdev)
-+{
-+ hwspin_lock_free(__smem->hwlock);
-+ __smem = NULL;
-+
-+ return 0;
-+}
-+
-+static const struct of_device_id qcom_smem_of_match[] = {
-+ { .compatible = "qcom,smem" },
-+ {}
-+};
-+MODULE_DEVICE_TABLE(of, qcom_smem_of_match);
-+
-+static struct platform_driver qcom_smem_driver = {
-+ .probe = qcom_smem_probe,
-+ .remove = qcom_smem_remove,
-+ .driver = {
-+ .name = "qcom_smem",
-+ .of_match_table = qcom_smem_of_match,
-+ .suppress_bind_attrs = true,
-+ },
-+};
-+
-+static int __init qcom_smem_init(void)
-+{
-+ return platform_driver_register(&qcom_smem_driver);
-+}
-+arch_initcall(qcom_smem_init);
-+
-+static void __exit qcom_smem_exit(void)
-+{
-+ platform_driver_unregister(&qcom_smem_driver);
-+}
-+module_exit(qcom_smem_exit)
-+
-+MODULE_AUTHOR("Bjorn Andersson <bjorn.andersson@sonymobile.com>");
-+MODULE_DESCRIPTION("Qualcomm Shared Memory Manager");
-+MODULE_LICENSE("GPLv2");
---- /dev/null
-+++ b/include/linux/soc/qcom/smem.h
-@@ -0,0 +1,14 @@
-+#ifndef __QCOM_SMEM_H__
-+#define __QCOM_SMEM_H__
-+
-+struct device_node;
-+struct qcom_smem;
-+
-+#define QCOM_SMEM_HOST_ANY -1
-+
-+int qcom_smem_alloc(unsigned host, unsigned item, size_t size);
-+int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size);
-+
-+int qcom_smem_get_free_space(unsigned host);
-+
-+#endif
diff --git a/target/linux/ipq806x/patches-4.1/136-clk-Add-safe-switch-hook.patch b/target/linux/ipq806x/patches-4.1/136-clk-Add-safe-switch-hook.patch
deleted file mode 100644
index b0d89a9681..0000000000
--- a/target/linux/ipq806x/patches-4.1/136-clk-Add-safe-switch-hook.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,04/13] clk: Add safe switch hook
-From: Stephen Boyd <sboyd@codeaurora.org>
-X-Patchwork-Id: 6063211
-Message-Id: <1426920332-9340-5-git-send-email-sboyd@codeaurora.org>
-To: Mike Turquette <mturquette@linaro.org>, Stephen Boyd <sboyd@codeaurora.org>
-Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
- linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
- Viresh Kumar <viresh.kumar@linaro.org>
-Date: Fri, 20 Mar 2015 23:45:23 -0700
-
-Sometimes clocks can't accept their parent source turning off
-while the source is reprogrammed to a different rate. Most
-notably CPU clocks require a way to switch away from the current
-PLL they're running on, reprogram that PLL to a new rate, and
-then switch back to the PLL with the new rate once they're done.
-Add a hook that drivers can implement allowing them to return a
-'safe parent' that they can switch their parent to while the
-upstream source is reprogrammed to support this.
-
-Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-
----
-This patch is good enough for Krait, but soon I'll need to
-support a "safe rate" where we ask a clock what rate it needs to be running
-at to be sure it's within voltage constraints. Right now safe parent
-handles that problem on Krait, but on other platforms it won't work.
-
- drivers/clk/clk.c | 61 ++++++++++++++++++++++++++++++++++++++------
- include/linux/clk-provider.h | 1 +
- 2 files changed, 54 insertions(+), 8 deletions(-)
-
---- a/drivers/clk/clk.c
-+++ b/drivers/clk/clk.c
-@@ -56,9 +56,12 @@ struct clk_core {
- struct clk_core **parents;
- u8 num_parents;
- u8 new_parent_index;
-+ u8 safe_parent_index;
- unsigned long rate;
- unsigned long req_rate;
-+ unsigned long old_rate;
- unsigned long new_rate;
-+ struct clk_core *safe_parent;
- struct clk_core *new_parent;
- struct clk_core *new_child;
- unsigned long flags;
-@@ -1596,7 +1599,8 @@ out:
- static void clk_calc_subtree(struct clk_core *clk, unsigned long new_rate,
- struct clk_core *new_parent, u8 p_index)
- {
-- struct clk_core *child;
-+ struct clk_core *child, *parent;
-+ struct clk_hw *parent_hw;
-
- clk->new_rate = new_rate;
- clk->new_parent = new_parent;
-@@ -1606,6 +1610,18 @@ static void clk_calc_subtree(struct clk_
- if (new_parent && new_parent != clk->parent)
- new_parent->new_child = clk;
-
-+ if (clk->ops->get_safe_parent) {
-+ parent_hw = clk->ops->get_safe_parent(clk->hw);
-+ if (parent_hw) {
-+ parent = parent_hw->core;
-+ p_index = clk_fetch_parent_index(clk, parent);
-+ clk->safe_parent_index = p_index;
-+ clk->safe_parent = parent;
-+ }
-+ } else {
-+ clk->safe_parent = NULL;
-+ }
-+
- hlist_for_each_entry(child, &clk->children, child_node) {
- child->new_rate = clk_recalc(child, new_rate);
- clk_calc_subtree(child, child->new_rate, NULL, 0);
-@@ -1710,14 +1726,43 @@ static struct clk_core *clk_propagate_ra
- unsigned long event)
- {
- struct clk_core *child, *tmp_clk, *fail_clk = NULL;
-+ struct clk_core *old_parent;
- int ret = NOTIFY_DONE;
-
-- if (clk->rate == clk->new_rate)
-+ if (clk->rate == clk->new_rate && event != POST_RATE_CHANGE)
- return NULL;
-
-+ switch (event) {
-+ case PRE_RATE_CHANGE:
-+ if (clk->safe_parent)
-+ clk->ops->set_parent(clk->hw, clk->safe_parent_index);
-+ clk->old_rate = clk->rate;
-+ break;
-+ case POST_RATE_CHANGE:
-+ if (clk->safe_parent) {
-+ old_parent = __clk_set_parent_before(clk,
-+ clk->new_parent);
-+ if (clk->ops->set_rate_and_parent) {
-+ clk->ops->set_rate_and_parent(clk->hw,
-+ clk->new_rate,
-+ clk->new_parent ?
-+ clk->new_parent->rate : 0,
-+ clk->new_parent_index);
-+ } else if (clk->ops->set_parent) {
-+ clk->ops->set_parent(clk->hw,
-+ clk->new_parent_index);
-+ }
-+ __clk_set_parent_after(clk, clk->new_parent,
-+ old_parent);
-+ }
-+ break;
-+ }
-+
- if (clk->notifier_count) {
-- ret = __clk_notify(clk, event, clk->rate, clk->new_rate);
-- if (ret & NOTIFY_STOP_MASK)
-+ if (event != POST_RATE_CHANGE || clk->old_rate != clk->rate)
-+ ret = __clk_notify(clk, event, clk->old_rate,
-+ clk->new_rate);
-+ if (ret & NOTIFY_STOP_MASK && event != POST_RATE_CHANGE)
- fail_clk = clk;
- }
-
-@@ -1763,7 +1808,8 @@ clk_change_rate(struct clk_core *clk, un
-
- old_rate = clk->rate;
-
-- if (clk->new_parent && clk->new_parent != clk->parent) {
-+ if (clk->new_parent && clk->new_parent != clk->parent &&
-+ !clk->safe_parent) {
- old_parent = __clk_set_parent_before(clk, clk->new_parent);
- trace_clk_set_parent(clk, clk->new_parent);
-
-@@ -1789,9 +1835,6 @@ clk_change_rate(struct clk_core *clk, un
-
- clk->rate = clk->new_rate;
-
-- if (clk->notifier_count && old_rate != clk->rate)
-- __clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate);
--
- /*
- * Use safe iteration, as change_rate can actually swap parents
- * for certain clock types.
-@@ -1851,6 +1894,8 @@ static int clk_core_set_rate_nolock(stru
-
- clk->req_rate = req_rate;
-
-+ clk_propagate_rate_change(top, POST_RATE_CHANGE);
-+
- return ret;
- }
-
---- a/include/linux/clk-provider.h
-+++ b/include/linux/clk-provider.h
-@@ -183,6 +183,7 @@ struct clk_ops {
- struct clk_hw **best_parent_hw);
- int (*set_parent)(struct clk_hw *hw, u8 index);
- u8 (*get_parent)(struct clk_hw *hw);
-+ struct clk_hw *(*get_safe_parent)(struct clk_hw *hw);
- int (*set_rate)(struct clk_hw *hw, unsigned long rate,
- unsigned long parent_rate);
- int (*set_rate_and_parent)(struct clk_hw *hw,
diff --git a/target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch b/target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
deleted file mode 100644
index 1f5eba8377..0000000000
--- a/target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
+++ /dev/null
@@ -1,367 +0,0 @@
-From 7e77aa188a7a7c4391856a9e5ef5ef58f769e679 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jogo@openwrt.org>
-Date: Sun, 9 Aug 2015 13:02:38 +0200
-Subject: [PATCH] ARM: qcom: add Netgear Nighthawk X4 R7500 device tree
-
-Signed-off-by: Jonas Gorski <jogo@openwrt.org>
----
- arch/arm/boot/dts/Makefile | 1 +
- arch/arm/boot/dts/qcom-ipq8064-r7500.dts | 370 +++++++++++++++++++++++++++++++
- 2 files changed, 371 insertions(+)
- create mode 100644 arch/arm/boot/dts/qcom-ipq8064-r7500.dts
-
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -452,6 +452,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
- qcom-apq8084-mtp.dtb \
- qcom-ipq8064-ap148.dtb \
- qcom-ipq8064-db149.dtb \
-+ qcom-ipq8064-r7500.dtb \
- qcom-msm8660-surf.dtb \
- qcom-msm8960-cdp.dtb \
- qcom-msm8974-sony-xperia-honami.dtb
---- /dev/null
-+++ b/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
-@@ -0,0 +1,342 @@
-+#include "qcom-ipq8064-v1.0.dtsi"
-+
-+#include <dt-bindings/input/input.h>
-+
-+/ {
-+ model = "Netgear Nighthawk X4 R7500";
-+ compatible = "netgear,r7500", "qcom,ipq8064";
-+
-+ memory@0 {
-+ reg = <0x42000000 0xe000000>;
-+ device_type = "memory";
-+ };
-+
-+ reserved-memory {
-+ #address-cells = <1>;
-+ #size-cells = <1>;
-+ ranges;
-+ rsvd@41200000 {
-+ reg = <0x41200000 0x300000>;
-+ no-map;
-+ };
-+ };
-+
-+ aliases {
-+ serial0 = &uart4;
-+ mdio-gpio0 = &mdio0;
-+ };
-+
-+ chosen {
-+ bootargs = "rootfstype=squashfs noinitrd";
-+ linux,stdout-path = "serial0:115200n8";
-+ };
-+
-+ soc {
-+ pinmux@800000 {
-+ i2c4_pins: i2c4_pinmux {
-+ pins = "gpio12", "gpio13";
-+ function = "gsbi4";
-+ bias-disable;
-+ };
-+
-+ nand_pins: nand_pins {
-+ mux {
-+ pins = "gpio34", "gpio35", "gpio36",
-+ "gpio37", "gpio38", "gpio39",
-+ "gpio40", "gpio41", "gpio42",
-+ "gpio43", "gpio44", "gpio45",
-+ "gpio46", "gpio47";
-+ function = "nand";
-+ drive-strength = <10>;
-+ bias-disable;
-+ };
-+ pullups {
-+ pins = "gpio39";
-+ bias-pull-up;
-+ };
-+ hold {
-+ pins = "gpio40", "gpio41", "gpio42",
-+ "gpio43", "gpio44", "gpio45",
-+ "gpio46", "gpio47";
-+ bias-bus-hold;
-+ };
-+ };
-+
-+ mdio0_pins: mdio0_pins {
-+ mux {
-+ pins = "gpio0", "gpio1";
-+ function = "gpio";
-+ drive-strength = <8>;
-+ bias-disable;
-+ };
-+ };
-+
-+ rgmii2_pins: rgmii2_pins {
-+ mux {
-+ pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
-+ "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
-+ function = "rgmii2";
-+ drive-strength = <8>;
-+ bias-disable;
-+ };
-+ };
-+ };
-+
-+ gsbi@16300000 {
-+ qcom,mode = <GSBI_PROT_I2C_UART>;
-+ status = "ok";
-+ serial@16340000 {
-+ status = "ok";
-+ };
-+ /*
-+ * The i2c device on gsbi4 should not be enabled.
-+ * On ipq806x designs gsbi4 i2c is meant for exclusive
-+ * RPM usage. Turning this on in kernel manifests as
-+ * i2c failure for the RPM.
-+ */
-+ };
-+
-+ sata-phy@1b400000 {
-+ status = "ok";
-+ };
-+
-+ sata@29000000 {
-+ status = "ok";
-+ };
-+
-+ phy@100f8800 { /* USB3 port 1 HS phy */
-+ status = "ok";
-+ };
-+
-+ phy@100f8830 { /* USB3 port 1 SS phy */
-+ status = "ok";
-+ };
-+
-+ phy@110f8800 { /* USB3 port 0 HS phy */
-+ status = "ok";
-+ };
-+
-+ phy@110f8830 { /* USB3 port 0 SS phy */
-+ status = "ok";
-+ };
-+
-+ usb30@0 {
-+ status = "ok";
-+ };
-+
-+ usb30@1 {
-+ status = "ok";
-+ };
-+
-+ pcie0: pci@1b500000 {
-+ status = "ok";
-+ };
-+
-+ pcie1: pci@1b700000 {
-+ status = "ok";
-+ };
-+
-+ nand@1ac00000 {
-+ status = "ok";
-+
-+ pinctrl-0 = <&nand_pins>;
-+ pinctrl-names = "default";
-+
-+ nand-ecc-strength = <4>;
-+ nand-bus-width = <8>;
-+
-+ #address-cells = <1>;
-+ #size-cells = <1>;
-+
-+ qcadata@0 {
-+ label = "qcadata";
-+ reg = <0x0000000 0x0c80000>;
-+ read-only;
-+ };
-+
-+ APPSBL@c80000 {
-+ label = "APPSBL";
-+ reg = <0x0c80000 0x0500000>;
-+ read-only;
-+ };
-+
-+ APPSBLENV@1180000 {
-+ label = "APPSBLENV";
-+ reg = <0x1180000 0x0080000>;
-+ read-only;
-+ };
-+
-+ art: art@1200000 {
-+ label = "art";
-+ reg = <0x1200000 0x0140000>;
-+ read-only;
-+ };
-+
-+ kernel@1340000 {
-+ label = "kernel";
-+ reg = <0x1340000 0x0200000>;
-+ };
-+
-+ ubi@1540000 {
-+ label = "ubi";
-+ reg = <0x1540000 0x1800000>;
-+ };
-+
-+ netgear@2d40000 {
-+ label = "netgear";
-+ reg = <0x2d40000 0x0c00000>;
-+ read-only;
-+ };
-+
-+ reserve@3940000 {
-+ label = "reserve";
-+ reg = <0x3940000 0x46c0000>;
-+ read-only;
-+ };
-+
-+ firmware@1340000 {
-+ label = "firmware";
-+ reg = <0x1340000 0x1a00000>;
-+ };
-+
-+ };
-+
-+ mdio0: mdio {
-+ compatible = "virtual,mdio-gpio";
-+ #address-cells = <1>;
-+ #size-cells = <0>;
-+ gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
-+ pinctrl-0 = <&mdio0_pins>;
-+ pinctrl-names = "default";
-+
-+ phy0: ethernet-phy@0 {
-+ device_type = "ethernet-phy";
-+ reg = <0>;
-+ qca,ar8327-initvals = <
-+ 0x00004 0x7600000 /* PAD0_MODE */
-+ 0x00008 0x1000000 /* PAD5_MODE */
-+ 0x0000c 0x80 /* PAD6_MODE */
-+ 0x000e4 0xaa545 /* MAC_POWER_SEL */
-+ 0x000e0 0xc74164de /* SGMII_CTRL */
-+ 0x0007c 0x4e /* PORT0_STATUS */
-+ 0x00094 0x4e /* PORT6_STATUS */
-+ >;
-+ };
-+
-+ phy4: ethernet-phy@4 {
-+ device_type = "ethernet-phy";
-+ reg = <4>;
-+ };
-+ };
-+
-+ gmac1: ethernet@37200000 {
-+ status = "ok";
-+ phy-mode = "rgmii";
-+ qcom,id = <1>;
-+
-+ pinctrl-0 = <&rgmii2_pins>;
-+ pinctrl-names = "default";
-+
-+ mtd-mac-address = <&art 6>;
-+
-+ fixed-link {
-+ speed = <1000>;
-+ full-duplex;
-+ };
-+ };
-+
-+ gmac2: ethernet@37400000 {
-+ status = "ok";
-+ phy-mode = "sgmii";
-+ qcom,id = <2>;
-+
-+ mtd-mac-address = <&art 0>;
-+
-+ fixed-link {
-+ speed = <1000>;
-+ full-duplex;
-+ };
-+ };
-+ };
-+
-+ gpio-keys {
-+ compatible = "gpio-keys";
-+
-+ wifi {
-+ label = "wifi";
-+ gpios = <&qcom_pinmux 6 1>;
-+ linux,code = <KEY_WLAN>;
-+ };
-+
-+ reset {
-+ label = "reset";
-+ gpios = <&qcom_pinmux 54 1>;
-+ linux,code = <KEY_RESTART>;
-+ };
-+
-+ wps {
-+ label = "wps";
-+ gpios = <&qcom_pinmux 65 1>;
-+ linux,code = <KEY_WPS_BUTTON>;
-+ };
-+ };
-+
-+ gpio-leds {
-+ compatible = "gpio-leds";
-+
-+ usb1 {
-+ label = "r7500:amber:usb1";
-+ gpios = <&qcom_pinmux 7 0>;
-+ };
-+
-+ usb3 {
-+ label = "r7500:amber:usb3";
-+ gpios = <&qcom_pinmux 8 0>;
-+ };
-+
-+ status {
-+ label = "r7500:amber:status";
-+ gpios = <&qcom_pinmux 9 0>;
-+ };
-+
-+ internet {
-+ label = "r7500:white:internet";
-+ gpios = <&qcom_pinmux 22 0>;
-+ };
-+
-+ wan {
-+ label = "r7500:white:wan";
-+ gpios = <&qcom_pinmux 23 0>;
-+ };
-+
-+ wps {
-+ label = "r7500:white:wps";
-+ gpios = <&qcom_pinmux 24 0>;
-+ };
-+
-+ esata {
-+ label = "r7500:white:esata";
-+ gpios = <&qcom_pinmux 26 0>;
-+ };
-+
-+ power {
-+ label = "r7500:white:power";
-+ gpios = <&qcom_pinmux 53 0>;
-+ default-state = "on";
-+ };
-+
-+ rfkill {
-+ label = "r7500:white:rfkill";
-+ gpios = <&qcom_pinmux 64 0>;
-+ };
-+
-+ wifi5g {
-+ label = "r7500:white:wifi5g";
-+ gpios = <&qcom_pinmux 67 0>;
-+ };
-+ };
-+};
-+
-+&adm_dma {
-+ status = "ok";
-+};
diff --git a/target/linux/ipq806x/patches-4.1/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch b/target/linux/ipq806x/patches-4.1/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
deleted file mode 100644
index dfe716953f..0000000000
--- a/target/linux/ipq806x/patches-4.1/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
+++ /dev/null
@@ -1,734 +0,0 @@
-From 2fbb18f85826a9ba308fedb2cf90d3a661a39fd7 Mon Sep 17 00:00:00 2001
-From: Stephen Boyd <sboyd@codeaurora.org>
-Date: Fri, 27 Mar 2015 00:16:14 -0700
-Subject: [PATCH] clk: qcom: Add support for NSS/GMAC clocks and resets
-
-Add the NSS/GMAC clocks and the TCM clock and NSS resets.
-
-Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
----
- drivers/clk/qcom/gcc-ipq806x.c | 594 ++++++++++++++++++++++++++-
- drivers/clk/qcom/gcc-ipq806x.c.rej | 50 +++
- include/dt-bindings/clock/qcom,gcc-ipq806x.h | 2 +
- include/dt-bindings/reset/qcom,gcc-ipq806x.h | 43 ++
- 4 files changed, 688 insertions(+), 1 deletion(-)
- create mode 100644 drivers/clk/qcom/gcc-ipq806x.c.rej
-
---- a/drivers/clk/qcom/gcc-ipq806x.c
-+++ b/drivers/clk/qcom/gcc-ipq806x.c
-@@ -220,12 +220,47 @@ static struct clk_regmap pll14_vote = {
- },
- };
-
-+#define NSS_PLL_RATE(f, _l, _m, _n, i) \
-+ { \
-+ .freq = f, \
-+ .l = _l, \
-+ .m = _m, \
-+ .n = _n, \
-+ .ibits = i, \
-+ }
-+
-+static struct pll_freq_tbl pll18_freq_tbl[] = {
-+ NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625),
-+ NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625),
-+};
-+
-+static struct clk_pll pll18 = {
-+ .l_reg = 0x31a4,
-+ .m_reg = 0x31a8,
-+ .n_reg = 0x31ac,
-+ .config_reg = 0x31b4,
-+ .mode_reg = 0x31a0,
-+ .status_reg = 0x31b8,
-+ .status_bit = 16,
-+ .post_div_shift = 16,
-+ .post_div_width = 1,
-+ .freq_tbl = pll18_freq_tbl,
-+ .clkr.hw.init = &(struct clk_init_data){
-+ .name = "pll18",
-+ .parent_names = (const char *[]){ "pxo" },
-+ .num_parents = 1,
-+ .ops = &clk_pll_ops,
-+ },
-+};
-+
- enum {
- P_PXO,
- P_PLL8,
- P_PLL3,
- P_PLL0,
- P_CXO,
-+ P_PLL14,
-+ P_PLL18,
- };
-
- static const struct parent_map gcc_pxo_pll8_map[] = {
-@@ -277,6 +312,22 @@ static const char *gcc_pxo_pll8_pll0_map
- "pll0_vote",
- };
-
-+static const struct parent_map gcc_pxo_pll8_pll14_pll18_pll0_map[] = {
-+ { P_PXO, 0 },
-+ { P_PLL8, 4 },
-+ { P_PLL0, 2 },
-+ { P_PLL14, 5 },
-+ { P_PLL18, 1 },
-+};
-+
-+static const char *gcc_pxo_pll8_pll14_pll18_pll0[] = {
-+ "pxo",
-+ "pll8_vote",
-+ "pll0_vote",
-+ "pll14",
-+ "pll18",
-+};
-+
- static struct freq_tbl clk_tbl_gsbi_uart[] = {
- { 1843200, P_PLL8, 2, 6, 625 },
- { 3686400, P_PLL8, 2, 12, 625 },
-@@ -2282,6 +2333,472 @@ static struct clk_branch ebi2_aon_clk =
- },
- };
-
-+static const struct freq_tbl clk_tbl_gmac[] = {
-+ { 133000000, P_PLL0, 1, 50, 301 },
-+ { 266000000, P_PLL0, 1, 127, 382 },
-+ { }
-+};
-+
-+static struct clk_dyn_rcg gmac_core1_src = {
-+ .ns_reg[0] = 0x3cac,
-+ .ns_reg[1] = 0x3cb0,
-+ .md_reg[0] = 0x3ca4,
-+ .md_reg[1] = 0x3ca8,
-+ .bank_reg = 0x3ca0,
-+ .mn[0] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .mn[1] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .s[0] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .s[1] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .p[0] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .p[1] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .mux_sel_bit = 0,
-+ .freq_tbl = clk_tbl_gmac,
-+ .clkr = {
-+ .enable_reg = 0x3ca0,
-+ .enable_mask = BIT(1),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "gmac_core1_src",
-+ .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+ .num_parents = 5,
-+ .ops = &clk_dyn_rcg_ops,
-+ },
-+ },
-+};
-+
-+static struct clk_branch gmac_core1_clk = {
-+ .halt_reg = 0x3c20,
-+ .halt_bit = 4,
-+ .hwcg_reg = 0x3cb4,
-+ .hwcg_bit = 6,
-+ .clkr = {
-+ .enable_reg = 0x3cb4,
-+ .enable_mask = BIT(4),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "gmac_core1_clk",
-+ .parent_names = (const char *[]){
-+ "gmac_core1_src",
-+ },
-+ .num_parents = 1,
-+ .ops = &clk_branch_ops,
-+ .flags = CLK_SET_RATE_PARENT,
-+ },
-+ },
-+};
-+
-+static struct clk_dyn_rcg gmac_core2_src = {
-+ .ns_reg[0] = 0x3ccc,
-+ .ns_reg[1] = 0x3cd0,
-+ .md_reg[0] = 0x3cc4,
-+ .md_reg[1] = 0x3cc8,
-+ .bank_reg = 0x3ca0,
-+ .mn[0] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .mn[1] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .s[0] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .s[1] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .p[0] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .p[1] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .mux_sel_bit = 0,
-+ .freq_tbl = clk_tbl_gmac,
-+ .clkr = {
-+ .enable_reg = 0x3cc0,
-+ .enable_mask = BIT(1),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "gmac_core2_src",
-+ .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+ .num_parents = 5,
-+ .ops = &clk_dyn_rcg_ops,
-+ },
-+ },
-+};
-+
-+static struct clk_branch gmac_core2_clk = {
-+ .halt_reg = 0x3c20,
-+ .halt_bit = 5,
-+ .hwcg_reg = 0x3cd4,
-+ .hwcg_bit = 6,
-+ .clkr = {
-+ .enable_reg = 0x3cd4,
-+ .enable_mask = BIT(4),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "gmac_core2_clk",
-+ .parent_names = (const char *[]){
-+ "gmac_core2_src",
-+ },
-+ .num_parents = 1,
-+ .ops = &clk_branch_ops,
-+ .flags = CLK_SET_RATE_PARENT,
-+ },
-+ },
-+};
-+
-+static struct clk_dyn_rcg gmac_core3_src = {
-+ .ns_reg[0] = 0x3cec,
-+ .ns_reg[1] = 0x3cf0,
-+ .md_reg[0] = 0x3ce4,
-+ .md_reg[1] = 0x3ce8,
-+ .bank_reg = 0x3ce0,
-+ .mn[0] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .mn[1] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .s[0] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .s[1] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .p[0] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .p[1] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .mux_sel_bit = 0,
-+ .freq_tbl = clk_tbl_gmac,
-+ .clkr = {
-+ .enable_reg = 0x3ce0,
-+ .enable_mask = BIT(1),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "gmac_core3_src",
-+ .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+ .num_parents = 5,
-+ .ops = &clk_dyn_rcg_ops,
-+ },
-+ },
-+};
-+
-+static struct clk_branch gmac_core3_clk = {
-+ .halt_reg = 0x3c20,
-+ .halt_bit = 6,
-+ .hwcg_reg = 0x3cf4,
-+ .hwcg_bit = 6,
-+ .clkr = {
-+ .enable_reg = 0x3cf4,
-+ .enable_mask = BIT(4),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "gmac_core3_clk",
-+ .parent_names = (const char *[]){
-+ "gmac_core3_src",
-+ },
-+ .num_parents = 1,
-+ .ops = &clk_branch_ops,
-+ .flags = CLK_SET_RATE_PARENT,
-+ },
-+ },
-+};
-+
-+static struct clk_dyn_rcg gmac_core4_src = {
-+ .ns_reg[0] = 0x3d0c,
-+ .ns_reg[1] = 0x3d10,
-+ .md_reg[0] = 0x3d04,
-+ .md_reg[1] = 0x3d08,
-+ .bank_reg = 0x3d00,
-+ .mn[0] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .mn[1] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .s[0] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .s[1] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .p[0] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .p[1] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .mux_sel_bit = 0,
-+ .freq_tbl = clk_tbl_gmac,
-+ .clkr = {
-+ .enable_reg = 0x3d00,
-+ .enable_mask = BIT(1),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "gmac_core4_src",
-+ .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+ .num_parents = 5,
-+ .ops = &clk_dyn_rcg_ops,
-+ },
-+ },
-+};
-+
-+static struct clk_branch gmac_core4_clk = {
-+ .halt_reg = 0x3c20,
-+ .halt_bit = 7,
-+ .hwcg_reg = 0x3d14,
-+ .hwcg_bit = 6,
-+ .clkr = {
-+ .enable_reg = 0x3d14,
-+ .enable_mask = BIT(4),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "gmac_core4_clk",
-+ .parent_names = (const char *[]){
-+ "gmac_core4_src",
-+ },
-+ .num_parents = 1,
-+ .ops = &clk_branch_ops,
-+ .flags = CLK_SET_RATE_PARENT,
-+ },
-+ },
-+};
-+
-+static const struct freq_tbl clk_tbl_nss_tcm[] = {
-+ { 266000000, P_PLL0, 3, 0, 0 },
-+ { 400000000, P_PLL0, 2, 0, 0 },
-+ { }
-+};
-+
-+static struct clk_dyn_rcg nss_tcm_src = {
-+ .ns_reg[0] = 0x3dc4,
-+ .ns_reg[1] = 0x3dc8,
-+ .bank_reg = 0x3dc0,
-+ .s[0] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .s[1] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .p[0] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 4,
-+ },
-+ .p[1] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 4,
-+ },
-+ .mux_sel_bit = 0,
-+ .freq_tbl = clk_tbl_nss_tcm,
-+ .clkr = {
-+ .enable_reg = 0x3dc0,
-+ .enable_mask = BIT(1),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "nss_tcm_src",
-+ .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+ .num_parents = 5,
-+ .ops = &clk_dyn_rcg_ops,
-+ },
-+ },
-+};
-+
-+static struct clk_branch nss_tcm_clk = {
-+ .halt_reg = 0x3c20,
-+ .halt_bit = 14,
-+ .clkr = {
-+ .enable_reg = 0x3dd0,
-+ .enable_mask = BIT(6) | BIT(4),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "nss_tcm_clk",
-+ .parent_names = (const char *[]){
-+ "nss_tcm_src",
-+ },
-+ .num_parents = 1,
-+ .ops = &clk_branch_ops,
-+ .flags = CLK_SET_RATE_PARENT,
-+ },
-+ },
-+};
-+
-+static const struct freq_tbl clk_tbl_nss[] = {
-+ { 110000000, P_PLL18, 1, 1, 5 },
-+ { 275000000, P_PLL18, 2, 0, 0 },
-+ { 550000000, P_PLL18, 1, 0, 0 },
-+ { 733000000, P_PLL18, 1, 0, 0 },
-+ { }
-+};
-+
-+static struct clk_dyn_rcg ubi32_core1_src_clk = {
-+ .ns_reg[0] = 0x3d2c,
-+ .ns_reg[1] = 0x3d30,
-+ .md_reg[0] = 0x3d24,
-+ .md_reg[1] = 0x3d28,
-+ .bank_reg = 0x3d20,
-+ .mn[0] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .mn[1] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .s[0] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .s[1] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .p[0] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .p[1] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .mux_sel_bit = 0,
-+ .freq_tbl = clk_tbl_nss,
-+ .clkr = {
-+ .enable_reg = 0x3d20,
-+ .enable_mask = BIT(1),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "ubi32_core1_src_clk",
-+ .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+ .num_parents = 5,
-+ .ops = &clk_dyn_rcg_ops,
-+ .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
-+ },
-+ },
-+};
-+
-+static struct clk_dyn_rcg ubi32_core2_src_clk = {
-+ .ns_reg[0] = 0x3d4c,
-+ .ns_reg[1] = 0x3d50,
-+ .md_reg[0] = 0x3d44,
-+ .md_reg[1] = 0x3d48,
-+ .bank_reg = 0x3d40,
-+ .mn[0] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .mn[1] = {
-+ .mnctr_en_bit = 8,
-+ .mnctr_reset_bit = 7,
-+ .mnctr_mode_shift = 5,
-+ .n_val_shift = 16,
-+ .m_val_shift = 16,
-+ .width = 8,
-+ },
-+ .s[0] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .s[1] = {
-+ .src_sel_shift = 0,
-+ .parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+ },
-+ .p[0] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .p[1] = {
-+ .pre_div_shift = 3,
-+ .pre_div_width = 2,
-+ },
-+ .mux_sel_bit = 0,
-+ .freq_tbl = clk_tbl_nss,
-+ .clkr = {
-+ .enable_reg = 0x3d40,
-+ .enable_mask = BIT(1),
-+ .hw.init = &(struct clk_init_data){
-+ .name = "ubi32_core2_src_clk",
-+ .parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+ .num_parents = 5,
-+ .ops = &clk_dyn_rcg_ops,
-+ .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
-+ },
-+ },
-+};
-+
- static struct clk_regmap *gcc_ipq806x_clks[] = {
- [PLL0] = &pll0.clkr,
- [PLL0_VOTE] = &pll0_vote,
-@@ -2291,6 +2808,7 @@ static struct clk_regmap *gcc_ipq806x_cl
- [PLL8_VOTE] = &pll8_vote,
- [PLL14] = &pll14.clkr,
- [PLL14_VOTE] = &pll14_vote,
-+ [PLL18] = &pll18.clkr,
- [GSBI1_UART_SRC] = &gsbi1_uart_src.clkr,
- [GSBI1_UART_CLK] = &gsbi1_uart_clk.clkr,
- [GSBI2_UART_SRC] = &gsbi2_uart_src.clkr,
-@@ -2390,6 +2908,18 @@ static struct clk_regmap *gcc_ipq806x_cl
- [PLL9] = &hfpll0.clkr,
- [PLL10] = &hfpll1.clkr,
- [PLL12] = &hfpll_l2.clkr,
-+ [GMAC_CORE1_CLK_SRC] = &gmac_core1_src.clkr,
-+ [GMAC_CORE1_CLK] = &gmac_core1_clk.clkr,
-+ [GMAC_CORE2_CLK_SRC] = &gmac_core2_src.clkr,
-+ [GMAC_CORE2_CLK] = &gmac_core2_clk.clkr,
-+ [GMAC_CORE3_CLK_SRC] = &gmac_core3_src.clkr,
-+ [GMAC_CORE3_CLK] = &gmac_core3_clk.clkr,
-+ [GMAC_CORE4_CLK_SRC] = &gmac_core4_src.clkr,
-+ [GMAC_CORE4_CLK] = &gmac_core4_clk.clkr,
-+ [UBI32_CORE1_CLK_SRC] = &ubi32_core1_src_clk.clkr,
-+ [UBI32_CORE2_CLK_SRC] = &ubi32_core2_src_clk.clkr,
-+ [NSSTCM_CLK_SRC] = &nss_tcm_src.clkr,
-+ [NSSTCM_CLK] = &nss_tcm_clk.clkr,
- };
-
- static const struct qcom_reset_map gcc_ipq806x_resets[] = {
-@@ -2508,6 +3038,48 @@ static const struct qcom_reset_map gcc_i
- [USB30_1_PHY_RESET] = { 0x3b58, 0 },
- [NSSFB0_RESET] = { 0x3b60, 6 },
- [NSSFB1_RESET] = { 0x3b60, 7 },
-+ [UBI32_CORE1_CLKRST_CLAMP_RESET] = { 0x3d3c, 3},
-+ [UBI32_CORE1_CLAMP_RESET] = { 0x3d3c, 2 },
-+ [UBI32_CORE1_AHB_RESET] = { 0x3d3c, 1 },
-+ [UBI32_CORE1_AXI_RESET] = { 0x3d3c, 0 },
-+ [UBI32_CORE2_CLKRST_CLAMP_RESET] = { 0x3d5c, 3 },
-+ [UBI32_CORE2_CLAMP_RESET] = { 0x3d5c, 2 },
-+ [UBI32_CORE2_AHB_RESET] = { 0x3d5c, 1 },
-+ [UBI32_CORE2_AXI_RESET] = { 0x3d5c, 0 },
-+ [GMAC_CORE1_RESET] = { 0x3cbc, 0 },
-+ [GMAC_CORE2_RESET] = { 0x3cdc, 0 },
-+ [GMAC_CORE3_RESET] = { 0x3cfc, 0 },
-+ [GMAC_CORE4_RESET] = { 0x3d1c, 0 },
-+ [GMAC_AHB_RESET] = { 0x3e24, 0 },
-+ [NSS_CH0_RST_RX_CLK_N_RESET] = { 0x3b60, 0 },
-+ [NSS_CH0_RST_TX_CLK_N_RESET] = { 0x3b60, 1 },
-+ [NSS_CH0_RST_RX_125M_N_RESET] = { 0x3b60, 2 },
-+ [NSS_CH0_HW_RST_RX_125M_N_RESET] = { 0x3b60, 3 },
-+ [NSS_CH0_RST_TX_125M_N_RESET] = { 0x3b60, 4 },
-+ [NSS_CH1_RST_RX_CLK_N_RESET] = { 0x3b60, 5 },
-+ [NSS_CH1_RST_TX_CLK_N_RESET] = { 0x3b60, 6 },
-+ [NSS_CH1_RST_RX_125M_N_RESET] = { 0x3b60, 7 },
-+ [NSS_CH1_HW_RST_RX_125M_N_RESET] = { 0x3b60, 8 },
-+ [NSS_CH1_RST_TX_125M_N_RESET] = { 0x3b60, 9 },
-+ [NSS_CH2_RST_RX_CLK_N_RESET] = { 0x3b60, 10 },
-+ [NSS_CH2_RST_TX_CLK_N_RESET] = { 0x3b60, 11 },
-+ [NSS_CH2_RST_RX_125M_N_RESET] = { 0x3b60, 12 },
-+ [NSS_CH2_HW_RST_RX_125M_N_RESET] = { 0x3b60, 13 },
-+ [NSS_CH2_RST_TX_125M_N_RESET] = { 0x3b60, 14 },
-+ [NSS_CH3_RST_RX_CLK_N_RESET] = { 0x3b60, 15 },
-+ [NSS_CH3_RST_TX_CLK_N_RESET] = { 0x3b60, 16 },
-+ [NSS_CH3_RST_RX_125M_N_RESET] = { 0x3b60, 17 },
-+ [NSS_CH3_HW_RST_RX_125M_N_RESET] = { 0x3b60, 18 },
-+ [NSS_CH3_RST_TX_125M_N_RESET] = { 0x3b60, 19 },
-+ [NSS_RST_RX_250M_125M_N_RESET] = { 0x3b60, 20 },
-+ [NSS_RST_TX_250M_125M_N_RESET] = { 0x3b60, 21 },
-+ [NSS_QSGMII_TXPI_RST_N_RESET] = { 0x3b60, 22 },
-+ [NSS_QSGMII_CDR_RST_N_RESET] = { 0x3b60, 23 },
-+ [NSS_SGMII2_CDR_RST_N_RESET] = { 0x3b60, 24 },
-+ [NSS_SGMII3_CDR_RST_N_RESET] = { 0x3b60, 25 },
-+ [NSS_CAL_PRBS_RST_N_RESET] = { 0x3b60, 26 },
-+ [NSS_LCKDT_RST_N_RESET] = { 0x3b60, 27 },
-+ [NSS_SRDS_N_RESET] = { 0x3b60, 28 },
- };
-
- static const struct regmap_config gcc_ipq806x_regmap_config = {
-@@ -2536,6 +3108,8 @@ static int gcc_ipq806x_probe(struct plat
- {
- struct clk *clk;
- struct device *dev = &pdev->dev;
-+ struct regmap *regmap;
-+ int ret;
-
- /* Temporary until RPM clocks supported */
- clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 25000000);
-@@ -2546,7 +3120,25 @@ static int gcc_ipq806x_probe(struct plat
- if (IS_ERR(clk))
- return PTR_ERR(clk);
-
-- return qcom_cc_probe(pdev, &gcc_ipq806x_desc);
-+ ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc);
-+ if (ret)
-+ return ret;
-+
-+ regmap = dev_get_regmap(dev, NULL);
-+ if (!regmap)
-+ return -ENODEV;
-+
-+ /* Setup PLL18 static bits */
-+ regmap_update_bits(regmap, 0x31a4, 0xffffffc0, 0x40000400);
-+ regmap_write(regmap, 0x31b0, 0x3080);
-+
-+ /* Set GMAC footswitch sleep/wakeup values */
-+ regmap_write(regmap, 0x3cb8, 8);
-+ regmap_write(regmap, 0x3cd8, 8);
-+ regmap_write(regmap, 0x3cf8, 8);
-+ regmap_write(regmap, 0x3d18, 8);
-+
-+ return 0;
- }
-
- static int gcc_ipq806x_remove(struct platform_device *pdev)
---- a/include/dt-bindings/reset/qcom,gcc-ipq806x.h
-+++ b/include/dt-bindings/reset/qcom,gcc-ipq806x.h
-@@ -129,4 +129,47 @@
- #define USB30_1_PHY_RESET 112
- #define NSSFB0_RESET 113
- #define NSSFB1_RESET 114
-+#define UBI32_CORE1_CLKRST_CLAMP_RESET 115
-+#define UBI32_CORE1_CLAMP_RESET 116
-+#define UBI32_CORE1_AHB_RESET 117
-+#define UBI32_CORE1_AXI_RESET 118
-+#define UBI32_CORE2_CLKRST_CLAMP_RESET 119
-+#define UBI32_CORE2_CLAMP_RESET 120
-+#define UBI32_CORE2_AHB_RESET 121
-+#define UBI32_CORE2_AXI_RESET 122
-+#define GMAC_CORE1_RESET 123
-+#define GMAC_CORE2_RESET 124
-+#define GMAC_CORE3_RESET 125
-+#define GMAC_CORE4_RESET 126
-+#define GMAC_AHB_RESET 127
-+#define NSS_CH0_RST_RX_CLK_N_RESET 128
-+#define NSS_CH0_RST_TX_CLK_N_RESET 129
-+#define NSS_CH0_RST_RX_125M_N_RESET 130
-+#define NSS_CH0_HW_RST_RX_125M_N_RESET 131
-+#define NSS_CH0_RST_TX_125M_N_RESET 132
-+#define NSS_CH1_RST_RX_CLK_N_RESET 133
-+#define NSS_CH1_RST_TX_CLK_N_RESET 134
-+#define NSS_CH1_RST_RX_125M_N_RESET 135
-+#define NSS_CH1_HW_RST_RX_125M_N_RESET 136
-+#define NSS_CH1_RST_TX_125M_N_RESET 137
-+#define NSS_CH2_RST_RX_CLK_N_RESET 138
-+#define NSS_CH2_RST_TX_CLK_N_RESET 139
-+#define NSS_CH2_RST_RX_125M_N_RESET 140
-+#define NSS_CH2_HW_RST_RX_125M_N_RESET 141
-+#define NSS_CH2_RST_TX_125M_N_RESET 142
-+#define NSS_CH3_RST_RX_CLK_N_RESET 143
-+#define NSS_CH3_RST_TX_CLK_N_RESET 144
-+#define NSS_CH3_RST_RX_125M_N_RESET 145
-+#define NSS_CH3_HW_RST_RX_125M_N_RESET 146
-+#define NSS_CH3_RST_TX_125M_N_RESET 147
-+#define NSS_RST_RX_250M_125M_N_RESET 148
-+#define NSS_RST_TX_250M_125M_N_RESET 149
-+#define NSS_QSGMII_TXPI_RST_N_RESET 150
-+#define NSS_QSGMII_CDR_RST_N_RESET 151
-+#define NSS_SGMII2_CDR_RST_N_RESET 152
-+#define NSS_SGMII3_CDR_RST_N_RESET 153
-+#define NSS_CAL_PRBS_RST_N_RESET 154
-+#define NSS_LCKDT_RST_N_RESET 155
-+#define NSS_SRDS_N_RESET 156
-+
- #endif
---- a/include/dt-bindings/clock/qcom,gcc-ipq806x.h
-+++ b/include/dt-bindings/clock/qcom,gcc-ipq806x.h
-@@ -289,5 +289,7 @@
- #define UBI32_CORE1_CLK 279
- #define UBI32_CORE2_CLK 280
- #define EBI2_AON_CLK 281
-+#define NSSTCM_CLK_SRC 282
-+#define NSSTCM_CLK 283
-
- #endif
diff --git a/target/linux/ipq806x/patches-4.1/701-stmmac_update_to_4.3.patch b/target/linux/ipq806x/patches-4.1/701-stmmac_update_to_4.3.patch
deleted file mode 100644
index 22450d4bbe..0000000000
--- a/target/linux/ipq806x/patches-4.1/701-stmmac_update_to_4.3.patch
+++ /dev/null
@@ -1,2355 +0,0 @@
---- a/drivers/net/ethernet/stmicro/Kconfig
-+++ b/drivers/net/ethernet/stmicro/Kconfig
-@@ -7,9 +7,7 @@ config NET_VENDOR_STMICRO
- default y
- depends on HAS_IOMEM
- ---help---
-- If you have a network (Ethernet) card belonging to this class, say Y
-- and read the Ethernet-HOWTO, available from
-- <http://www.tldp.org/docs.html#howto>.
-+ If you have a network (Ethernet) card belonging to this class, say Y.
-
- Note that the answer to this question doesn't directly affect the
- kernel: saying N will just cause the configurator to skip all
---- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
-+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
-@@ -16,6 +16,7 @@ if STMMAC_ETH
- config STMMAC_PLATFORM
- tristate "STMMAC Platform bus support"
- depends on STMMAC_ETH
-+ select MFD_SYSCON
- default y
- ---help---
- This selects the platform specific bus support for the stmmac driver.
-@@ -26,6 +27,95 @@ config STMMAC_PLATFORM
-
- If unsure, say N.
-
-+if STMMAC_PLATFORM
-+
-+config DWMAC_GENERIC
-+ tristate "Generic driver for DWMAC"
-+ default STMMAC_PLATFORM
-+ ---help---
-+ Generic DWMAC driver for platforms that don't require any
-+ platform specific code to function or is using platform
-+ data for setup.
-+
-+config DWMAC_IPQ806X
-+ tristate "QCA IPQ806x DWMAC support"
-+ default ARCH_QCOM
-+ depends on OF
-+ select MFD_SYSCON
-+ help
-+ Support for QCA IPQ806X DWMAC Ethernet.
-+
-+ This selects the IPQ806x SoC glue layer support for the stmmac
-+ device driver. This driver does not use any of the hardware
-+ acceleration features available on this SoC. Network devices
-+ will behave like standard non-accelerated ethernet interfaces.
-+
-+config DWMAC_LPC18XX
-+ tristate "NXP LPC18xx/43xx DWMAC support"
-+ default ARCH_LPC18XX
-+ depends on OF
-+ select MFD_SYSCON
-+ ---help---
-+ Support for NXP LPC18xx/43xx DWMAC Ethernet.
-+
-+config DWMAC_MESON
-+ tristate "Amlogic Meson dwmac support"
-+ default ARCH_MESON
-+ depends on OF
-+ help
-+ Support for Ethernet controller on Amlogic Meson SoCs.
-+
-+ This selects the Amlogic Meson SoC glue layer support for
-+ the stmmac device driver. This driver is used for Meson6 and
-+ Meson8 SoCs.
-+
-+config DWMAC_ROCKCHIP
-+ tristate "Rockchip dwmac support"
-+ default ARCH_ROCKCHIP
-+ depends on OF
-+ select MFD_SYSCON
-+ help
-+ Support for Ethernet controller on Rockchip RK3288 SoC.
-+
-+ This selects the Rockchip RK3288 SoC glue layer support for
-+ the stmmac device driver.
-+
-+config DWMAC_SOCFPGA
-+ tristate "SOCFPGA dwmac support"
-+ default ARCH_SOCFPGA
-+ depends on OF
-+ select MFD_SYSCON
-+ help
-+ Support for ethernet controller on Altera SOCFPGA
-+
-+ This selects the Altera SOCFPGA SoC glue layer support
-+ for the stmmac device driver. This driver is used for
-+ arria5 and cyclone5 FPGA SoCs.
-+
-+config DWMAC_STI
-+ tristate "STi GMAC support"
-+ default ARCH_STI
-+ depends on OF
-+ select MFD_SYSCON
-+ ---help---
-+ Support for ethernet controller on STi SOCs.
-+
-+ This selects STi SoC glue layer support for the stmmac
-+ device driver. This driver is used on for the STi series
-+ SOCs GMAC ethernet controller.
-+
-+config DWMAC_SUNXI
-+ tristate "Allwinner GMAC support"
-+ default ARCH_SUNXI
-+ depends on OF
-+ ---help---
-+ Support for Allwinner A20/A31 GMAC ethernet controllers.
-+
-+ This selects Allwinner SoC glue layer support for the
-+ stmmac device driver. This driver is used for A20/A31
-+ GMAC ethernet controller.
-+endif
-+
- config STMMAC_PCI
- tristate "STMMAC PCI bus support"
- depends on STMMAC_ETH && PCI
---- a/drivers/net/ethernet/stmicro/stmmac/Makefile
-+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
-@@ -4,9 +4,17 @@ stmmac-objs:= stmmac_main.o stmmac_ethto
- dwmac100_core.o dwmac100_dma.o enh_desc.o norm_desc.o \
- mmc_core.o stmmac_hwtstamp.o stmmac_ptp.o $(stmmac-y)
-
--obj-$(CONFIG_STMMAC_PLATFORM) += stmmac-platform.o
--stmmac-platform-objs:= stmmac_platform.o dwmac-meson.o dwmac-sunxi.o \
-- dwmac-sti.o dwmac-socfpga.o dwmac-rk.o
-+# Ordering matters. Generic driver must be last.
-+obj-$(CONFIG_STMMAC_PLATFORM) += stmmac-platform.o
-+obj-$(CONFIG_DWMAC_IPQ806X) += dwmac-ipq806x.o
-+obj-$(CONFIG_DWMAC_LPC18XX) += dwmac-lpc18xx.o
-+obj-$(CONFIG_DWMAC_MESON) += dwmac-meson.o
-+obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rk.o
-+obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-socfpga.o
-+obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o
-+obj-$(CONFIG_DWMAC_SUNXI) += dwmac-sunxi.o
-+obj-$(CONFIG_DWMAC_GENERIC) += dwmac-generic.o
-+stmmac-platform-objs:= stmmac_platform.o
-
- obj-$(CONFIG_STMMAC_PCI) += stmmac-pci.o
- stmmac-pci-objs:= stmmac_pci.o
---- /dev/null
-+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
-@@ -0,0 +1,81 @@
-+/*
-+ * Generic DWMAC platform driver
-+ *
-+ * Copyright (C) 2007-2011 STMicroelectronics Ltd
-+ * Copyright (C) 2015 Joachim Eastwood <manabian@gmail.com>
-+ *
-+ * This file is licensed under the terms of the GNU General Public
-+ * License version 2. This program is licensed "as is" without any
-+ * warranty of any kind, whether express or implied.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/of.h>
-+#include <linux/platform_device.h>
-+
-+#include "stmmac.h"
-+#include "stmmac_platform.h"
-+
-+static int dwmac_generic_probe(struct platform_device *pdev)
-+{
-+ struct plat_stmmacenet_data *plat_dat;
-+ struct stmmac_resources stmmac_res;
-+ int ret;
-+
-+ ret = stmmac_get_platform_resources(pdev, &stmmac_res);
-+ if (ret)
-+ return ret;
-+
-+ if (pdev->dev.of_node) {
-+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
-+ if (IS_ERR(plat_dat)) {
-+ dev_err(&pdev->dev, "dt configuration failed\n");
-+ return PTR_ERR(plat_dat);
-+ }
-+ } else {
-+ plat_dat = dev_get_platdata(&pdev->dev);
-+ if (!plat_dat) {
-+ dev_err(&pdev->dev, "no platform data provided\n");
-+ return -EINVAL;
-+ }
-+
-+ /* Set default value for multicast hash bins */
-+ plat_dat->multicast_filter_bins = HASH_TABLE_SIZE;
-+
-+ /* Set default value for unicast filter entries */
-+ plat_dat->unicast_filter_entries = 1;
-+ }
-+
-+ /* Custom initialisation (if needed) */
-+ if (plat_dat->init) {
-+ ret = plat_dat->init(pdev, plat_dat->bsp_priv);
-+ if (ret)
-+ return ret;
-+ }
-+
-+ return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
-+}
-+
-+static const struct of_device_id dwmac_generic_match[] = {
-+ { .compatible = "st,spear600-gmac"},
-+ { .compatible = "snps,dwmac-3.610"},
-+ { .compatible = "snps,dwmac-3.70a"},
-+ { .compatible = "snps,dwmac-3.710"},
-+ { .compatible = "snps,dwmac"},
-+ { }
-+};
-+MODULE_DEVICE_TABLE(of, dwmac_generic_match);
-+
-+static struct platform_driver dwmac_generic_driver = {
-+ .probe = dwmac_generic_probe,
-+ .remove = stmmac_pltfr_remove,
-+ .driver = {
-+ .name = STMMAC_RESOURCE_NAME,
-+ .pm = &stmmac_pltfr_pm_ops,
-+ .of_match_table = of_match_ptr(dwmac_generic_match),
-+ },
-+};
-+module_platform_driver(dwmac_generic_driver);
-+
-+MODULE_DESCRIPTION("Generic dwmac driver");
-+MODULE_LICENSE("GPL v2");
---- /dev/null
-+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
-@@ -0,0 +1,373 @@
-+/*
-+ * Qualcomm Atheros IPQ806x GMAC glue layer
-+ *
-+ * Copyright (C) 2015 The Linux Foundation
-+ *
-+ * 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 <linux/device.h>
-+#include <linux/platform_device.h>
-+#include <linux/phy.h>
-+#include <linux/regmap.h>
-+#include <linux/clk.h>
-+#include <linux/reset.h>
-+#include <linux/of_net.h>
-+#include <linux/mfd/syscon.h>
-+#include <linux/stmmac.h>
-+#include <linux/of_mdio.h>
-+#include <linux/module.h>
-+
-+#include "stmmac_platform.h"
-+
-+#define NSS_COMMON_CLK_GATE 0x8
-+#define NSS_COMMON_CLK_GATE_PTP_EN(x) BIT(0x10 + x)
-+#define NSS_COMMON_CLK_GATE_RGMII_RX_EN(x) BIT(0x9 + (x * 2))
-+#define NSS_COMMON_CLK_GATE_RGMII_TX_EN(x) BIT(0x8 + (x * 2))
-+#define NSS_COMMON_CLK_GATE_GMII_RX_EN(x) BIT(0x4 + x)
-+#define NSS_COMMON_CLK_GATE_GMII_TX_EN(x) BIT(0x0 + x)
-+
-+#define NSS_COMMON_CLK_DIV0 0xC
-+#define NSS_COMMON_CLK_DIV_OFFSET(x) (x * 8)
-+#define NSS_COMMON_CLK_DIV_MASK 0x7f
-+
-+#define NSS_COMMON_CLK_SRC_CTRL 0x14
-+#define NSS_COMMON_CLK_SRC_CTRL_OFFSET(x) (x)
-+/* Mode is coded on 1 bit but is different depending on the MAC ID:
-+ * MAC0: QSGMII=0 RGMII=1
-+ * MAC1: QSGMII=0 SGMII=0 RGMII=1
-+ * MAC2 & MAC3: QSGMII=0 SGMII=1
-+ */
-+#define NSS_COMMON_CLK_SRC_CTRL_RGMII(x) 1
-+#define NSS_COMMON_CLK_SRC_CTRL_SGMII(x) ((x >= 2) ? 1 : 0)
-+
-+#define NSS_COMMON_MACSEC_CTL 0x28
-+#define NSS_COMMON_MACSEC_CTL_EXT_BYPASS_EN(x) (1 << x)
-+
-+#define NSS_COMMON_GMAC_CTL(x) (0x30 + (x * 4))
-+#define NSS_COMMON_GMAC_CTL_CSYS_REQ BIT(19)
-+#define NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL BIT(16)
-+#define NSS_COMMON_GMAC_CTL_IFG_LIMIT_OFFSET 8
-+#define NSS_COMMON_GMAC_CTL_IFG_OFFSET 0
-+#define NSS_COMMON_GMAC_CTL_IFG_MASK 0x3f
-+
-+#define NSS_COMMON_CLK_DIV_RGMII_1000 1
-+#define NSS_COMMON_CLK_DIV_RGMII_100 9
-+#define NSS_COMMON_CLK_DIV_RGMII_10 99
-+#define NSS_COMMON_CLK_DIV_SGMII_1000 0
-+#define NSS_COMMON_CLK_DIV_SGMII_100 4
-+#define NSS_COMMON_CLK_DIV_SGMII_10 49
-+
-+#define QSGMII_PCS_MODE_CTL 0x68
-+#define QSGMII_PCS_MODE_CTL_AUTONEG_EN(x) BIT((x * 8) + 7)
-+
-+#define QSGMII_PCS_CAL_LCKDT_CTL 0x120
-+#define QSGMII_PCS_CAL_LCKDT_CTL_RST BIT(19)
-+
-+/* Only GMAC1/2/3 support SGMII and their CTL register are not contiguous */
-+#define QSGMII_PHY_SGMII_CTL(x) ((x == 1) ? 0x134 : \
-+ (0x13c + (4 * (x - 2))))
-+#define QSGMII_PHY_CDR_EN BIT(0)
-+#define QSGMII_PHY_RX_FRONT_EN BIT(1)
-+#define QSGMII_PHY_RX_SIGNAL_DETECT_EN BIT(2)
-+#define QSGMII_PHY_TX_DRIVER_EN BIT(3)
-+#define QSGMII_PHY_QSGMII_EN BIT(7)
-+#define QSGMII_PHY_PHASE_LOOP_GAIN_OFFSET 12
-+#define QSGMII_PHY_PHASE_LOOP_GAIN_MASK 0x7
-+#define QSGMII_PHY_RX_DC_BIAS_OFFSET 18
-+#define QSGMII_PHY_RX_DC_BIAS_MASK 0x3
-+#define QSGMII_PHY_RX_INPUT_EQU_OFFSET 20
-+#define QSGMII_PHY_RX_INPUT_EQU_MASK 0x3
-+#define QSGMII_PHY_CDR_PI_SLEW_OFFSET 22
-+#define QSGMII_PHY_CDR_PI_SLEW_MASK 0x3
-+#define QSGMII_PHY_TX_DRV_AMP_OFFSET 28
-+#define QSGMII_PHY_TX_DRV_AMP_MASK 0xf
-+
-+struct ipq806x_gmac {
-+ struct platform_device *pdev;
-+ struct regmap *nss_common;
-+ struct regmap *qsgmii_csr;
-+ uint32_t id;
-+ struct clk *core_clk;
-+ phy_interface_t phy_mode;
-+};
-+
-+static int get_clk_div_sgmii(struct ipq806x_gmac *gmac, unsigned int speed)
-+{
-+ struct device *dev = &gmac->pdev->dev;
-+ int div;
-+
-+ switch (speed) {
-+ case SPEED_1000:
-+ div = NSS_COMMON_CLK_DIV_SGMII_1000;
-+ break;
-+
-+ case SPEED_100:
-+ div = NSS_COMMON_CLK_DIV_SGMII_100;
-+ break;
-+
-+ case SPEED_10:
-+ div = NSS_COMMON_CLK_DIV_SGMII_10;
-+ break;
-+
-+ default:
-+ dev_err(dev, "Speed %dMbps not supported in SGMII\n", speed);
-+ return -EINVAL;
-+ }
-+
-+ return div;
-+}
-+
-+static int get_clk_div_rgmii(struct ipq806x_gmac *gmac, unsigned int speed)
-+{
-+ struct device *dev = &gmac->pdev->dev;
-+ int div;
-+
-+ switch (speed) {
-+ case SPEED_1000:
-+ div = NSS_COMMON_CLK_DIV_RGMII_1000;
-+ break;
-+
-+ case SPEED_100:
-+ div = NSS_COMMON_CLK_DIV_RGMII_100;
-+ break;
-+
-+ case SPEED_10:
-+ div = NSS_COMMON_CLK_DIV_RGMII_10;
-+ break;
-+
-+ default:
-+ dev_err(dev, "Speed %dMbps not supported in RGMII\n", speed);
-+ return -EINVAL;
-+ }
-+
-+ return div;
-+}
-+
-+static int ipq806x_gmac_set_speed(struct ipq806x_gmac *gmac, unsigned int speed)
-+{
-+ uint32_t clk_bits, val;
-+ int div;
-+
-+ switch (gmac->phy_mode) {
-+ case PHY_INTERFACE_MODE_RGMII:
-+ div = get_clk_div_rgmii(gmac, speed);
-+ clk_bits = NSS_COMMON_CLK_GATE_RGMII_RX_EN(gmac->id) |
-+ NSS_COMMON_CLK_GATE_RGMII_TX_EN(gmac->id);
-+ break;
-+
-+ case PHY_INTERFACE_MODE_SGMII:
-+ div = get_clk_div_sgmii(gmac, speed);
-+ clk_bits = NSS_COMMON_CLK_GATE_GMII_RX_EN(gmac->id) |
-+ NSS_COMMON_CLK_GATE_GMII_TX_EN(gmac->id);
-+ break;
-+
-+ default:
-+ dev_err(&gmac->pdev->dev, "Unsupported PHY mode: \"%s\"\n",
-+ phy_modes(gmac->phy_mode));
-+ return -EINVAL;
-+ }
-+
-+ /* Disable the clocks */
-+ regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val);
-+ val &= ~clk_bits;
-+ regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val);
-+
-+ /* Set the divider */
-+ regmap_read(gmac->nss_common, NSS_COMMON_CLK_DIV0, &val);
-+ val &= ~(NSS_COMMON_CLK_DIV_MASK
-+ << NSS_COMMON_CLK_DIV_OFFSET(gmac->id));
-+ val |= div << NSS_COMMON_CLK_DIV_OFFSET(gmac->id);
-+ regmap_write(gmac->nss_common, NSS_COMMON_CLK_DIV0, val);
-+
-+ /* Enable the clock back */
-+ regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val);
-+ val |= clk_bits;
-+ regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val);
-+
-+ return 0;
-+}
-+
-+static void *ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac)
-+{
-+ struct device *dev = &gmac->pdev->dev;
-+
-+ gmac->phy_mode = of_get_phy_mode(dev->of_node);
-+ if (gmac->phy_mode < 0) {
-+ dev_err(dev, "missing phy mode property\n");
-+ return ERR_PTR(-EINVAL);
-+ }
-+
-+ if (of_property_read_u32(dev->of_node, "qcom,id", &gmac->id) < 0) {
-+ dev_err(dev, "missing qcom id property\n");
-+ return ERR_PTR(-EINVAL);
-+ }
-+
-+ /* The GMACs are called 1 to 4 in the documentation, but to simplify the
-+ * code and keep it consistent with the Linux convention, we'll number
-+ * them from 0 to 3 here.
-+ */
-+ if (gmac->id < 0 || gmac->id > 3) {
-+ dev_err(dev, "invalid gmac id\n");
-+ return ERR_PTR(-EINVAL);
-+ }
-+
-+ gmac->core_clk = devm_clk_get(dev, "stmmaceth");
-+ if (IS_ERR(gmac->core_clk)) {
-+ dev_err(dev, "missing stmmaceth clk property\n");
-+ return gmac->core_clk;
-+ }
-+ clk_set_rate(gmac->core_clk, 266000000);
-+
-+ /* Setup the register map for the nss common registers */
-+ gmac->nss_common = syscon_regmap_lookup_by_phandle(dev->of_node,
-+ "qcom,nss-common");
-+ if (IS_ERR(gmac->nss_common)) {
-+ dev_err(dev, "missing nss-common node\n");
-+ return gmac->nss_common;
-+ }
-+
-+ /* Setup the register map for the qsgmii csr registers */
-+ gmac->qsgmii_csr = syscon_regmap_lookup_by_phandle(dev->of_node,
-+ "qcom,qsgmii-csr");
-+ if (IS_ERR(gmac->qsgmii_csr)) {
-+ dev_err(dev, "missing qsgmii-csr node\n");
-+ return gmac->qsgmii_csr;
-+ }
-+
-+ return NULL;
-+}
-+
-+static void ipq806x_gmac_fix_mac_speed(void *priv, unsigned int speed)
-+{
-+ struct ipq806x_gmac *gmac = priv;
-+
-+ ipq806x_gmac_set_speed(gmac, speed);
-+}
-+
-+static int ipq806x_gmac_probe(struct platform_device *pdev)
-+{
-+ struct plat_stmmacenet_data *plat_dat;
-+ struct stmmac_resources stmmac_res;
-+ struct device *dev = &pdev->dev;
-+ struct ipq806x_gmac *gmac;
-+ int val;
-+ void *err;
-+
-+ val = stmmac_get_platform_resources(pdev, &stmmac_res);
-+ if (val)
-+ return val;
-+
-+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
-+ if (IS_ERR(plat_dat))
-+ return PTR_ERR(plat_dat);
-+
-+ gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL);
-+ if (!gmac)
-+ return -ENOMEM;
-+
-+ gmac->pdev = pdev;
-+
-+ err = ipq806x_gmac_of_parse(gmac);
-+ if (IS_ERR(err)) {
-+ dev_err(dev, "device tree parsing error\n");
-+ return PTR_ERR(err);
-+ }
-+
-+ regmap_write(gmac->qsgmii_csr, QSGMII_PCS_CAL_LCKDT_CTL,
-+ QSGMII_PCS_CAL_LCKDT_CTL_RST);
-+
-+ /* Inter frame gap is set to 12 */
-+ val = 12 << NSS_COMMON_GMAC_CTL_IFG_OFFSET |
-+ 12 << NSS_COMMON_GMAC_CTL_IFG_LIMIT_OFFSET;
-+ /* We also initiate an AXI low power exit request */
-+ val |= NSS_COMMON_GMAC_CTL_CSYS_REQ;
-+ switch (gmac->phy_mode) {
-+ case PHY_INTERFACE_MODE_RGMII:
-+ val |= NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL;
-+ break;
-+ case PHY_INTERFACE_MODE_SGMII:
-+ val &= ~NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL;
-+ break;
-+ default:
-+ dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n",
-+ phy_modes(gmac->phy_mode));
-+ return -EINVAL;
-+ }
-+ regmap_write(gmac->nss_common, NSS_COMMON_GMAC_CTL(gmac->id), val);
-+
-+ /* Configure the clock src according to the mode */
-+ regmap_read(gmac->nss_common, NSS_COMMON_CLK_SRC_CTRL, &val);
-+ val &= ~(1 << NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id));
-+ switch (gmac->phy_mode) {
-+ case PHY_INTERFACE_MODE_RGMII:
-+ val |= NSS_COMMON_CLK_SRC_CTRL_RGMII(gmac->id) <<
-+ NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id);
-+ break;
-+ case PHY_INTERFACE_MODE_SGMII:
-+ val |= NSS_COMMON_CLK_SRC_CTRL_SGMII(gmac->id) <<
-+ NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id);
-+ break;
-+ default:
-+ dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n",
-+ phy_modes(gmac->phy_mode));
-+ return -EINVAL;
-+ }
-+ regmap_write(gmac->nss_common, NSS_COMMON_CLK_SRC_CTRL, val);
-+
-+ /* Enable PTP clock */
-+ regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val);
-+ val |= NSS_COMMON_CLK_GATE_PTP_EN(gmac->id);
-+ regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val);
-+
-+ if (gmac->phy_mode == PHY_INTERFACE_MODE_SGMII) {
-+ regmap_write(gmac->qsgmii_csr, QSGMII_PHY_SGMII_CTL(gmac->id),
-+ QSGMII_PHY_CDR_EN |
-+ QSGMII_PHY_RX_FRONT_EN |
-+ QSGMII_PHY_RX_SIGNAL_DETECT_EN |
-+ QSGMII_PHY_TX_DRIVER_EN |
-+ QSGMII_PHY_QSGMII_EN |
-+ 0x4 << QSGMII_PHY_PHASE_LOOP_GAIN_OFFSET |
-+ 0x3 << QSGMII_PHY_RX_DC_BIAS_OFFSET |
-+ 0x1 << QSGMII_PHY_RX_INPUT_EQU_OFFSET |
-+ 0x2 << QSGMII_PHY_CDR_PI_SLEW_OFFSET |
-+ 0xC << QSGMII_PHY_TX_DRV_AMP_OFFSET);
-+ }
-+
-+ plat_dat->has_gmac = true;
-+ plat_dat->bsp_priv = gmac;
-+ plat_dat->fix_mac_speed = ipq806x_gmac_fix_mac_speed;
-+
-+ return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
-+}
-+
-+static const struct of_device_id ipq806x_gmac_dwmac_match[] = {
-+ { .compatible = "qcom,ipq806x-gmac" },
-+ { }
-+};
-+MODULE_DEVICE_TABLE(of, ipq806x_gmac_dwmac_match);
-+
-+static struct platform_driver ipq806x_gmac_dwmac_driver = {
-+ .probe = ipq806x_gmac_probe,
-+ .remove = stmmac_pltfr_remove,
-+ .driver = {
-+ .name = "ipq806x-gmac-dwmac",
-+ .pm = &stmmac_pltfr_pm_ops,
-+ .of_match_table = ipq806x_gmac_dwmac_match,
-+ },
-+};
-+module_platform_driver(ipq806x_gmac_dwmac_driver);
-+
-+MODULE_AUTHOR("Mathieu Olivari <mathieu@codeaurora.org>");
-+MODULE_DESCRIPTION("Qualcomm Atheros IPQ806x DWMAC specific glue layer");
-+MODULE_LICENSE("Dual BSD/GPL");
---- /dev/null
-+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
-@@ -0,0 +1,86 @@
-+/*
-+ * DWMAC glue for NXP LPC18xx/LPC43xx Ethernet
-+ *
-+ * Copyright (C) 2015 Joachim Eastwood <manabian@gmail.com>
-+ *
-+ * This file is licensed under the terms of the GNU General Public
-+ * License version 2. This program is licensed "as is" without any
-+ * warranty of any kind, whether express or implied.
-+ */
-+
-+#include <linux/mfd/syscon.h>
-+#include <linux/module.h>
-+#include <linux/of.h>
-+#include <linux/of_net.h>
-+#include <linux/phy.h>
-+#include <linux/platform_device.h>
-+#include <linux/regmap.h>
-+#include <linux/stmmac.h>
-+
-+#include "stmmac_platform.h"
-+
-+/* Register defines for CREG syscon */
-+#define LPC18XX_CREG_CREG6 0x12c
-+# define LPC18XX_CREG_CREG6_ETHMODE_MASK 0x7
-+# define LPC18XX_CREG_CREG6_ETHMODE_MII 0x0
-+# define LPC18XX_CREG_CREG6_ETHMODE_RMII 0x4
-+
-+static int lpc18xx_dwmac_probe(struct platform_device *pdev)
-+{
-+ struct plat_stmmacenet_data *plat_dat;
-+ struct stmmac_resources stmmac_res;
-+ struct regmap *reg;
-+ u8 ethmode;
-+ int ret;
-+
-+ ret = stmmac_get_platform_resources(pdev, &stmmac_res);
-+ if (ret)
-+ return ret;
-+
-+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
-+ if (IS_ERR(plat_dat))
-+ return PTR_ERR(plat_dat);
-+
-+ plat_dat->has_gmac = true;
-+
-+ reg = syscon_regmap_lookup_by_compatible("nxp,lpc1850-creg");
-+ if (IS_ERR(reg)) {
-+ dev_err(&pdev->dev, "syscon lookup failed\n");
-+ return PTR_ERR(reg);
-+ }
-+
-+ if (plat_dat->interface == PHY_INTERFACE_MODE_MII) {
-+ ethmode = LPC18XX_CREG_CREG6_ETHMODE_MII;
-+ } else if (plat_dat->interface == PHY_INTERFACE_MODE_RMII) {
-+ ethmode = LPC18XX_CREG_CREG6_ETHMODE_RMII;
-+ } else {
-+ dev_err(&pdev->dev, "Only MII and RMII mode supported\n");
-+ return -EINVAL;
-+ }
-+
-+ regmap_update_bits(reg, LPC18XX_CREG_CREG6,
-+ LPC18XX_CREG_CREG6_ETHMODE_MASK, ethmode);
-+
-+ return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
-+}
-+
-+static const struct of_device_id lpc18xx_dwmac_match[] = {
-+ { .compatible = "nxp,lpc1850-dwmac" },
-+ { }
-+};
-+MODULE_DEVICE_TABLE(of, lpc18xx_dwmac_match);
-+
-+static struct platform_driver lpc18xx_dwmac_driver = {
-+ .probe = lpc18xx_dwmac_probe,
-+ .remove = stmmac_pltfr_remove,
-+ .driver = {
-+ .name = "lpc18xx-dwmac",
-+ .pm = &stmmac_pltfr_pm_ops,
-+ .of_match_table = lpc18xx_dwmac_match,
-+ },
-+};
-+module_platform_driver(lpc18xx_dwmac_driver);
-+
-+MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>");
-+MODULE_DESCRIPTION("DWMAC glue for LPC18xx/43xx Ethernet");
-+MODULE_LICENSE("GPL v2");
---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
-@@ -15,6 +15,7 @@
- #include <linux/ethtool.h>
- #include <linux/io.h>
- #include <linux/ioport.h>
-+#include <linux/module.h>
- #include <linux/platform_device.h>
- #include <linux/stmmac.h>
-
-@@ -46,24 +47,54 @@ static void meson6_dwmac_fix_mac_speed(v
- writel(val, dwmac->reg);
- }
-
--static void *meson6_dwmac_setup(struct platform_device *pdev)
-+static int meson6_dwmac_probe(struct platform_device *pdev)
- {
-+ struct plat_stmmacenet_data *plat_dat;
-+ struct stmmac_resources stmmac_res;
- struct meson_dwmac *dwmac;
- struct resource *res;
-+ int ret;
-+
-+ ret = stmmac_get_platform_resources(pdev, &stmmac_res);
-+ if (ret)
-+ return ret;
-+
-+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
-+ if (IS_ERR(plat_dat))
-+ return PTR_ERR(plat_dat);
-
- dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
- if (!dwmac)
-- return ERR_PTR(-ENOMEM);
-+ return -ENOMEM;
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- dwmac->reg = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(dwmac->reg))
-- return ERR_CAST(dwmac->reg);
-+ return PTR_ERR(dwmac->reg);
-+
-+ plat_dat->bsp_priv = dwmac;
-+ plat_dat->fix_mac_speed = meson6_dwmac_fix_mac_speed;
-
-- return dwmac;
-+ return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
- }
-
--const struct stmmac_of_data meson6_dwmac_data = {
-- .setup = meson6_dwmac_setup,
-- .fix_mac_speed = meson6_dwmac_fix_mac_speed,
-+static const struct of_device_id meson6_dwmac_match[] = {
-+ { .compatible = "amlogic,meson6-dwmac" },
-+ { }
- };
-+MODULE_DEVICE_TABLE(of, meson6_dwmac_match);
-+
-+static struct platform_driver meson6_dwmac_driver = {
-+ .probe = meson6_dwmac_probe,
-+ .remove = stmmac_pltfr_remove,
-+ .driver = {
-+ .name = "meson6-dwmac",
-+ .pm = &stmmac_pltfr_pm_ops,
-+ .of_match_table = meson6_dwmac_match,
-+ },
-+};
-+module_platform_driver(meson6_dwmac_driver);
-+
-+MODULE_AUTHOR("Beniamino Galvani <b.galvani@gmail.com>");
-+MODULE_DESCRIPTION("Amlogic Meson DWMAC glue layer");
-+MODULE_LICENSE("GPL v2");
---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
-@@ -22,17 +22,31 @@
- #include <linux/phy.h>
- #include <linux/of_net.h>
- #include <linux/gpio.h>
-+#include <linux/module.h>
- #include <linux/of_gpio.h>
- #include <linux/of_device.h>
-+#include <linux/platform_device.h>
- #include <linux/regulator/consumer.h>
- #include <linux/delay.h>
- #include <linux/mfd/syscon.h>
- #include <linux/regmap.h>
-
-+#include "stmmac_platform.h"
-+
-+struct rk_priv_data;
-+struct rk_gmac_ops {
-+ void (*set_to_rgmii)(struct rk_priv_data *bsp_priv,
-+ int tx_delay, int rx_delay);
-+ void (*set_to_rmii)(struct rk_priv_data *bsp_priv);
-+ void (*set_rgmii_speed)(struct rk_priv_data *bsp_priv, int speed);
-+ void (*set_rmii_speed)(struct rk_priv_data *bsp_priv, int speed);
-+};
-+
- struct rk_priv_data {
- struct platform_device *pdev;
- int phy_iface;
- struct regulator *regulator;
-+ const struct rk_gmac_ops *ops;
-
- bool clk_enabled;
- bool clock_input;
-@@ -60,103 +74,228 @@ struct rk_priv_data {
-
- #define RK3288_GRF_SOC_CON1 0x0248
- #define RK3288_GRF_SOC_CON3 0x0250
--#define RK3288_GRF_GPIO3D_E 0x01ec
--#define RK3288_GRF_GPIO4A_E 0x01f0
--#define RK3288_GRF_GPIO4B_E 0x01f4
-
- /*RK3288_GRF_SOC_CON1*/
--#define GMAC_PHY_INTF_SEL_RGMII (GRF_BIT(6) | GRF_CLR_BIT(7) | GRF_CLR_BIT(8))
--#define GMAC_PHY_INTF_SEL_RMII (GRF_CLR_BIT(6) | GRF_CLR_BIT(7) | GRF_BIT(8))
--#define GMAC_FLOW_CTRL GRF_BIT(9)
--#define GMAC_FLOW_CTRL_CLR GRF_CLR_BIT(9)
--#define GMAC_SPEED_10M GRF_CLR_BIT(10)
--#define GMAC_SPEED_100M GRF_BIT(10)
--#define GMAC_RMII_CLK_25M GRF_BIT(11)
--#define GMAC_RMII_CLK_2_5M GRF_CLR_BIT(11)
--#define GMAC_CLK_125M (GRF_CLR_BIT(12) | GRF_CLR_BIT(13))
--#define GMAC_CLK_25M (GRF_BIT(12) | GRF_BIT(13))
--#define GMAC_CLK_2_5M (GRF_CLR_BIT(12) | GRF_BIT(13))
--#define GMAC_RMII_MODE GRF_BIT(14)
--#define GMAC_RMII_MODE_CLR GRF_CLR_BIT(14)
-+#define RK3288_GMAC_PHY_INTF_SEL_RGMII (GRF_BIT(6) | GRF_CLR_BIT(7) | \
-+ GRF_CLR_BIT(8))
-+#define RK3288_GMAC_PHY_INTF_SEL_RMII (GRF_CLR_BIT(6) | GRF_CLR_BIT(7) | \
-+ GRF_BIT(8))
-+#define RK3288_GMAC_FLOW_CTRL GRF_BIT(9)
-+#define RK3288_GMAC_FLOW_CTRL_CLR GRF_CLR_BIT(9)
-+#define RK3288_GMAC_SPEED_10M GRF_CLR_BIT(10)
-+#define RK3288_GMAC_SPEED_100M GRF_BIT(10)
-+#define RK3288_GMAC_RMII_CLK_25M GRF_BIT(11)
-+#define RK3288_GMAC_RMII_CLK_2_5M GRF_CLR_BIT(11)
-+#define RK3288_GMAC_CLK_125M (GRF_CLR_BIT(12) | GRF_CLR_BIT(13))
-+#define RK3288_GMAC_CLK_25M (GRF_BIT(12) | GRF_BIT(13))
-+#define RK3288_GMAC_CLK_2_5M (GRF_CLR_BIT(12) | GRF_BIT(13))
-+#define RK3288_GMAC_RMII_MODE GRF_BIT(14)
-+#define RK3288_GMAC_RMII_MODE_CLR GRF_CLR_BIT(14)
-
- /*RK3288_GRF_SOC_CON3*/
--#define GMAC_TXCLK_DLY_ENABLE GRF_BIT(14)
--#define GMAC_TXCLK_DLY_DISABLE GRF_CLR_BIT(14)
--#define GMAC_RXCLK_DLY_ENABLE GRF_BIT(15)
--#define GMAC_RXCLK_DLY_DISABLE GRF_CLR_BIT(15)
--#define GMAC_CLK_RX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 7)
--#define GMAC_CLK_TX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 0)
-+#define RK3288_GMAC_TXCLK_DLY_ENABLE GRF_BIT(14)
-+#define RK3288_GMAC_TXCLK_DLY_DISABLE GRF_CLR_BIT(14)
-+#define RK3288_GMAC_RXCLK_DLY_ENABLE GRF_BIT(15)
-+#define RK3288_GMAC_RXCLK_DLY_DISABLE GRF_CLR_BIT(15)
-+#define RK3288_GMAC_CLK_RX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 7)
-+#define RK3288_GMAC_CLK_TX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 0)
-
--static void set_to_rgmii(struct rk_priv_data *bsp_priv,
-- int tx_delay, int rx_delay)
-+static void rk3288_set_to_rgmii(struct rk_priv_data *bsp_priv,
-+ int tx_delay, int rx_delay)
- {
- struct device *dev = &bsp_priv->pdev->dev;
-
- if (IS_ERR(bsp_priv->grf)) {
-- dev_err(dev, "%s: Missing rockchip,grf property\n", __func__);
-+ dev_err(dev, "Missing rockchip,grf property\n");
- return;
- }
-
- regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1,
-- GMAC_PHY_INTF_SEL_RGMII | GMAC_RMII_MODE_CLR);
-+ RK3288_GMAC_PHY_INTF_SEL_RGMII |
-+ RK3288_GMAC_RMII_MODE_CLR);
- regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON3,
-- GMAC_RXCLK_DLY_ENABLE | GMAC_TXCLK_DLY_ENABLE |
-- GMAC_CLK_RX_DL_CFG(rx_delay) |
-- GMAC_CLK_TX_DL_CFG(tx_delay));
-+ RK3288_GMAC_RXCLK_DLY_ENABLE |
-+ RK3288_GMAC_TXCLK_DLY_ENABLE |
-+ RK3288_GMAC_CLK_RX_DL_CFG(rx_delay) |
-+ RK3288_GMAC_CLK_TX_DL_CFG(tx_delay));
- }
-
--static void set_to_rmii(struct rk_priv_data *bsp_priv)
-+static void rk3288_set_to_rmii(struct rk_priv_data *bsp_priv)
- {
- struct device *dev = &bsp_priv->pdev->dev;
-
- if (IS_ERR(bsp_priv->grf)) {
-- dev_err(dev, "%s: Missing rockchip,grf property\n", __func__);
-+ dev_err(dev, "Missing rockchip,grf property\n");
- return;
- }
-
- regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1,
-- GMAC_PHY_INTF_SEL_RMII | GMAC_RMII_MODE);
-+ RK3288_GMAC_PHY_INTF_SEL_RMII | RK3288_GMAC_RMII_MODE);
- }
-
--static void set_rgmii_speed(struct rk_priv_data *bsp_priv, int speed)
-+static void rk3288_set_rgmii_speed(struct rk_priv_data *bsp_priv, int speed)
- {
- struct device *dev = &bsp_priv->pdev->dev;
-
- if (IS_ERR(bsp_priv->grf)) {
-- dev_err(dev, "%s: Missing rockchip,grf property\n", __func__);
-+ dev_err(dev, "Missing rockchip,grf property\n");
- return;
- }
-
- if (speed == 10)
-- regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1, GMAC_CLK_2_5M);
-+ regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1,
-+ RK3288_GMAC_CLK_2_5M);
- else if (speed == 100)
-- regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1, GMAC_CLK_25M);
-+ regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1,
-+ RK3288_GMAC_CLK_25M);
- else if (speed == 1000)
-- regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1, GMAC_CLK_125M);
-+ regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1,
-+ RK3288_GMAC_CLK_125M);
- else
- dev_err(dev, "unknown speed value for RGMII! speed=%d", speed);
- }
-
--static void set_rmii_speed(struct rk_priv_data *bsp_priv, int speed)
-+static void rk3288_set_rmii_speed(struct rk_priv_data *bsp_priv, int speed)
- {
- struct device *dev = &bsp_priv->pdev->dev;
-
- if (IS_ERR(bsp_priv->grf)) {
-- dev_err(dev, "%s: Missing rockchip,grf property\n", __func__);
-+ dev_err(dev, "Missing rockchip,grf property\n");
- return;
- }
-
- if (speed == 10) {
- regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1,
-- GMAC_RMII_CLK_2_5M | GMAC_SPEED_10M);
-+ RK3288_GMAC_RMII_CLK_2_5M |
-+ RK3288_GMAC_SPEED_10M);
- } else if (speed == 100) {
- regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON1,
-- GMAC_RMII_CLK_25M | GMAC_SPEED_100M);
-+ RK3288_GMAC_RMII_CLK_25M |
-+ RK3288_GMAC_SPEED_100M);
-+ } else {
-+ dev_err(dev, "unknown speed value for RMII! speed=%d", speed);
-+ }
-+}
-+
-+static const struct rk_gmac_ops rk3288_ops = {
-+ .set_to_rgmii = rk3288_set_to_rgmii,
-+ .set_to_rmii = rk3288_set_to_rmii,
-+ .set_rgmii_speed = rk3288_set_rgmii_speed,
-+ .set_rmii_speed = rk3288_set_rmii_speed,
-+};
-+
-+#define RK3368_GRF_SOC_CON15 0x043c
-+#define RK3368_GRF_SOC_CON16 0x0440
-+
-+/* RK3368_GRF_SOC_CON15 */
-+#define RK3368_GMAC_PHY_INTF_SEL_RGMII (GRF_BIT(9) | GRF_CLR_BIT(10) | \
-+ GRF_CLR_BIT(11))
-+#define RK3368_GMAC_PHY_INTF_SEL_RMII (GRF_CLR_BIT(9) | GRF_CLR_BIT(10) | \
-+ GRF_BIT(11))
-+#define RK3368_GMAC_FLOW_CTRL GRF_BIT(8)
-+#define RK3368_GMAC_FLOW_CTRL_CLR GRF_CLR_BIT(8)
-+#define RK3368_GMAC_SPEED_10M GRF_CLR_BIT(7)
-+#define RK3368_GMAC_SPEED_100M GRF_BIT(7)
-+#define RK3368_GMAC_RMII_CLK_25M GRF_BIT(3)
-+#define RK3368_GMAC_RMII_CLK_2_5M GRF_CLR_BIT(3)
-+#define RK3368_GMAC_CLK_125M (GRF_CLR_BIT(4) | GRF_CLR_BIT(5))
-+#define RK3368_GMAC_CLK_25M (GRF_BIT(4) | GRF_BIT(5))
-+#define RK3368_GMAC_CLK_2_5M (GRF_CLR_BIT(4) | GRF_BIT(5))
-+#define RK3368_GMAC_RMII_MODE GRF_BIT(6)
-+#define RK3368_GMAC_RMII_MODE_CLR GRF_CLR_BIT(6)
-+
-+/* RK3368_GRF_SOC_CON16 */
-+#define RK3368_GMAC_TXCLK_DLY_ENABLE GRF_BIT(7)
-+#define RK3368_GMAC_TXCLK_DLY_DISABLE GRF_CLR_BIT(7)
-+#define RK3368_GMAC_RXCLK_DLY_ENABLE GRF_BIT(15)
-+#define RK3368_GMAC_RXCLK_DLY_DISABLE GRF_CLR_BIT(15)
-+#define RK3368_GMAC_CLK_RX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 8)
-+#define RK3368_GMAC_CLK_TX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 0)
-+
-+static void rk3368_set_to_rgmii(struct rk_priv_data *bsp_priv,
-+ int tx_delay, int rx_delay)
-+{
-+ struct device *dev = &bsp_priv->pdev->dev;
-+
-+ if (IS_ERR(bsp_priv->grf)) {
-+ dev_err(dev, "%s: Missing rockchip,grf property\n", __func__);
-+ return;
-+ }
-+
-+ regmap_write(bsp_priv->grf, RK3368_GRF_SOC_CON15,
-+ RK3368_GMAC_PHY_INTF_SEL_RGMII |
-+ RK3368_GMAC_RMII_MODE_CLR);
-+ regmap_write(bsp_priv->grf, RK3368_GRF_SOC_CON16,
-+ RK3368_GMAC_RXCLK_DLY_ENABLE |
-+ RK3368_GMAC_TXCLK_DLY_ENABLE |
-+ RK3368_GMAC_CLK_RX_DL_CFG(rx_delay) |
-+ RK3368_GMAC_CLK_TX_DL_CFG(tx_delay));
-+}
-+
-+static void rk3368_set_to_rmii(struct rk_priv_data *bsp_priv)
-+{
-+ struct device *dev = &bsp_priv->pdev->dev;
-+
-+ if (IS_ERR(bsp_priv->grf)) {
-+ dev_err(dev, "%s: Missing rockchip,grf property\n", __func__);
-+ return;
-+ }
-+
-+ regmap_write(bsp_priv->grf, RK3368_GRF_SOC_CON15,
-+ RK3368_GMAC_PHY_INTF_SEL_RMII | RK3368_GMAC_RMII_MODE);
-+}
-+
-+static void rk3368_set_rgmii_speed(struct rk_priv_data *bsp_priv, int speed)
-+{
-+ struct device *dev = &bsp_priv->pdev->dev;
-+
-+ if (IS_ERR(bsp_priv->grf)) {
-+ dev_err(dev, "%s: Missing rockchip,grf property\n", __func__);
-+ return;
-+ }
-+
-+ if (speed == 10)
-+ regmap_write(bsp_priv->grf, RK3368_GRF_SOC_CON15,
-+ RK3368_GMAC_CLK_2_5M);
-+ else if (speed == 100)
-+ regmap_write(bsp_priv->grf, RK3368_GRF_SOC_CON15,
-+ RK3368_GMAC_CLK_25M);
-+ else if (speed == 1000)
-+ regmap_write(bsp_priv->grf, RK3368_GRF_SOC_CON15,
-+ RK3368_GMAC_CLK_125M);
-+ else
-+ dev_err(dev, "unknown speed value for RGMII! speed=%d", speed);
-+}
-+
-+static void rk3368_set_rmii_speed(struct rk_priv_data *bsp_priv, int speed)
-+{
-+ struct device *dev = &bsp_priv->pdev->dev;
-+
-+ if (IS_ERR(bsp_priv->grf)) {
-+ dev_err(dev, "%s: Missing rockchip,grf property\n", __func__);
-+ return;
-+ }
-+
-+ if (speed == 10) {
-+ regmap_write(bsp_priv->grf, RK3368_GRF_SOC_CON15,
-+ RK3368_GMAC_RMII_CLK_2_5M |
-+ RK3368_GMAC_SPEED_10M);
-+ } else if (speed == 100) {
-+ regmap_write(bsp_priv->grf, RK3368_GRF_SOC_CON15,
-+ RK3368_GMAC_RMII_CLK_25M |
-+ RK3368_GMAC_SPEED_100M);
- } else {
- dev_err(dev, "unknown speed value for RMII! speed=%d", speed);
- }
- }
-
-+static const struct rk_gmac_ops rk3368_ops = {
-+ .set_to_rgmii = rk3368_set_to_rgmii,
-+ .set_to_rmii = rk3368_set_to_rmii,
-+ .set_rgmii_speed = rk3368_set_rgmii_speed,
-+ .set_rmii_speed = rk3368_set_rmii_speed,
-+};
-+
- static int gmac_clk_init(struct rk_priv_data *bsp_priv)
- {
- struct device *dev = &bsp_priv->pdev->dev;
-@@ -165,46 +304,46 @@ static int gmac_clk_init(struct rk_priv_
-
- bsp_priv->mac_clk_rx = devm_clk_get(dev, "mac_clk_rx");
- if (IS_ERR(bsp_priv->mac_clk_rx))
-- dev_err(dev, "%s: cannot get clock %s\n",
-- __func__, "mac_clk_rx");
-+ dev_err(dev, "cannot get clock %s\n",
-+ "mac_clk_rx");
-
- bsp_priv->mac_clk_tx = devm_clk_get(dev, "mac_clk_tx");
- if (IS_ERR(bsp_priv->mac_clk_tx))
-- dev_err(dev, "%s: cannot get clock %s\n",
-- __func__, "mac_clk_tx");
-+ dev_err(dev, "cannot get clock %s\n",
-+ "mac_clk_tx");
-
- bsp_priv->aclk_mac = devm_clk_get(dev, "aclk_mac");
- if (IS_ERR(bsp_priv->aclk_mac))
-- dev_err(dev, "%s: cannot get clock %s\n",
-- __func__, "aclk_mac");
-+ dev_err(dev, "cannot get clock %s\n",
-+ "aclk_mac");
-
- bsp_priv->pclk_mac = devm_clk_get(dev, "pclk_mac");
- if (IS_ERR(bsp_priv->pclk_mac))
-- dev_err(dev, "%s: cannot get clock %s\n",
-- __func__, "pclk_mac");
-+ dev_err(dev, "cannot get clock %s\n",
-+ "pclk_mac");
-
- bsp_priv->clk_mac = devm_clk_get(dev, "stmmaceth");
- if (IS_ERR(bsp_priv->clk_mac))
-- dev_err(dev, "%s: cannot get clock %s\n",
-- __func__, "stmmaceth");
-+ dev_err(dev, "cannot get clock %s\n",
-+ "stmmaceth");
-
- if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RMII) {
- bsp_priv->clk_mac_ref = devm_clk_get(dev, "clk_mac_ref");
- if (IS_ERR(bsp_priv->clk_mac_ref))
-- dev_err(dev, "%s: cannot get clock %s\n",
-- __func__, "clk_mac_ref");
-+ dev_err(dev, "cannot get clock %s\n",
-+ "clk_mac_ref");
-
- if (!bsp_priv->clock_input) {
- bsp_priv->clk_mac_refout =
- devm_clk_get(dev, "clk_mac_refout");
- if (IS_ERR(bsp_priv->clk_mac_refout))
-- dev_err(dev, "%s: cannot get clock %s\n",
-- __func__, "clk_mac_refout");
-+ dev_err(dev, "cannot get clock %s\n",
-+ "clk_mac_refout");
- }
- }
-
- if (bsp_priv->clock_input) {
-- dev_info(dev, "%s: clock input from PHY\n", __func__);
-+ dev_info(dev, "clock input from PHY\n");
- } else {
- if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RMII)
- clk_set_rate(bsp_priv->clk_mac, 50000000);
-@@ -291,26 +430,25 @@ static int phy_power_on(struct rk_priv_d
- struct device *dev = &bsp_priv->pdev->dev;
-
- if (!ldo) {
-- dev_err(dev, "%s: no regulator found\n", __func__);
-+ dev_err(dev, "no regulator found\n");
- return -1;
- }
-
- if (enable) {
- ret = regulator_enable(ldo);
- if (ret)
-- dev_err(dev, "%s: fail to enable phy-supply\n",
-- __func__);
-+ dev_err(dev, "fail to enable phy-supply\n");
- } else {
- ret = regulator_disable(ldo);
- if (ret)
-- dev_err(dev, "%s: fail to disable phy-supply\n",
-- __func__);
-+ dev_err(dev, "fail to disable phy-supply\n");
- }
-
- return 0;
- }
-
--static void *rk_gmac_setup(struct platform_device *pdev)
-+static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev,
-+ const struct rk_gmac_ops *ops)
- {
- struct rk_priv_data *bsp_priv;
- struct device *dev = &pdev->dev;
-@@ -323,6 +461,7 @@ static void *rk_gmac_setup(struct platfo
- return ERR_PTR(-ENOMEM);
-
- bsp_priv->phy_iface = of_get_phy_mode(dev->of_node);
-+ bsp_priv->ops = ops;
-
- bsp_priv->regulator = devm_regulator_get_optional(dev, "phy");
- if (IS_ERR(bsp_priv->regulator)) {
-@@ -336,12 +475,11 @@ static void *rk_gmac_setup(struct platfo
-
- ret = of_property_read_string(dev->of_node, "clock_in_out", &strings);
- if (ret) {
-- dev_err(dev, "%s: Can not read property: clock_in_out.\n",
-- __func__);
-+ dev_err(dev, "Can not read property: clock_in_out.\n");
- bsp_priv->clock_input = true;
- } else {
-- dev_info(dev, "%s: clock input or output? (%s).\n",
-- __func__, strings);
-+ dev_info(dev, "clock input or output? (%s).\n",
-+ strings);
- if (!strcmp(strings, "input"))
- bsp_priv->clock_input = true;
- else
-@@ -351,22 +489,22 @@ static void *rk_gmac_setup(struct platfo
- ret = of_property_read_u32(dev->of_node, "tx_delay", &value);
- if (ret) {
- bsp_priv->tx_delay = 0x30;
-- dev_err(dev, "%s: Can not read property: tx_delay.", __func__);
-- dev_err(dev, "%s: set tx_delay to 0x%x\n",
-- __func__, bsp_priv->tx_delay);
-+ dev_err(dev, "Can not read property: tx_delay.");
-+ dev_err(dev, "set tx_delay to 0x%x\n",
-+ bsp_priv->tx_delay);
- } else {
-- dev_info(dev, "%s: TX delay(0x%x).\n", __func__, value);
-+ dev_info(dev, "TX delay(0x%x).\n", value);
- bsp_priv->tx_delay = value;
- }
-
- ret = of_property_read_u32(dev->of_node, "rx_delay", &value);
- if (ret) {
- bsp_priv->rx_delay = 0x10;
-- dev_err(dev, "%s: Can not read property: rx_delay.", __func__);
-- dev_err(dev, "%s: set rx_delay to 0x%x\n",
-- __func__, bsp_priv->rx_delay);
-+ dev_err(dev, "Can not read property: rx_delay.");
-+ dev_err(dev, "set rx_delay to 0x%x\n",
-+ bsp_priv->rx_delay);
- } else {
-- dev_info(dev, "%s: RX delay(0x%x).\n", __func__, value);
-+ dev_info(dev, "RX delay(0x%x).\n", value);
- bsp_priv->rx_delay = value;
- }
-
-@@ -376,13 +514,14 @@ static void *rk_gmac_setup(struct platfo
-
- /*rmii or rgmii*/
- if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RGMII) {
-- dev_info(dev, "%s: init for RGMII\n", __func__);
-- set_to_rgmii(bsp_priv, bsp_priv->tx_delay, bsp_priv->rx_delay);
-+ dev_info(dev, "init for RGMII\n");
-+ bsp_priv->ops->set_to_rgmii(bsp_priv, bsp_priv->tx_delay,
-+ bsp_priv->rx_delay);
- } else if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RMII) {
-- dev_info(dev, "%s: init for RMII\n", __func__);
-- set_to_rmii(bsp_priv);
-+ dev_info(dev, "init for RMII\n");
-+ bsp_priv->ops->set_to_rmii(bsp_priv);
- } else {
-- dev_err(dev, "%s: NO interface defined!\n", __func__);
-+ dev_err(dev, "NO interface defined!\n");
- }
-
- gmac_clk_init(bsp_priv);
-@@ -420,17 +559,68 @@ static void rk_fix_speed(void *priv, uns
- struct device *dev = &bsp_priv->pdev->dev;
-
- if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RGMII)
-- set_rgmii_speed(bsp_priv, speed);
-+ bsp_priv->ops->set_rgmii_speed(bsp_priv, speed);
- else if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RMII)
-- set_rmii_speed(bsp_priv, speed);
-+ bsp_priv->ops->set_rmii_speed(bsp_priv, speed);
- else
- dev_err(dev, "unsupported interface %d", bsp_priv->phy_iface);
- }
-
--const struct stmmac_of_data rk3288_gmac_data = {
-- .has_gmac = 1,
-- .fix_mac_speed = rk_fix_speed,
-- .setup = rk_gmac_setup,
-- .init = rk_gmac_init,
-- .exit = rk_gmac_exit,
-+static int rk_gmac_probe(struct platform_device *pdev)
-+{
-+ struct plat_stmmacenet_data *plat_dat;
-+ struct stmmac_resources stmmac_res;
-+ const struct rk_gmac_ops *data;
-+ int ret;
-+
-+ data = of_device_get_match_data(&pdev->dev);
-+ if (!data) {
-+ dev_err(&pdev->dev, "no of match data provided\n");
-+ return -EINVAL;
-+ }
-+
-+ ret = stmmac_get_platform_resources(pdev, &stmmac_res);
-+ if (ret)
-+ return ret;
-+
-+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
-+ if (IS_ERR(plat_dat))
-+ return PTR_ERR(plat_dat);
-+
-+ plat_dat->has_gmac = true;
-+ plat_dat->init = rk_gmac_init;
-+ plat_dat->exit = rk_gmac_exit;
-+ plat_dat->fix_mac_speed = rk_fix_speed;
-+
-+ plat_dat->bsp_priv = rk_gmac_setup(pdev, data);
-+ if (IS_ERR(plat_dat->bsp_priv))
-+ return PTR_ERR(plat_dat->bsp_priv);
-+
-+ ret = rk_gmac_init(pdev, plat_dat->bsp_priv);
-+ if (ret)
-+ return ret;
-+
-+ return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
-+}
-+
-+static const struct of_device_id rk_gmac_dwmac_match[] = {
-+ { .compatible = "rockchip,rk3288-gmac", .data = &rk3288_ops },
-+ { .compatible = "rockchip,rk3368-gmac", .data = &rk3368_ops },
-+ { }
- };
-+MODULE_DEVICE_TABLE(of, rk_gmac_dwmac_match);
-+
-+static struct platform_driver rk_gmac_dwmac_driver = {
-+ .probe = rk_gmac_probe,
-+ .remove = stmmac_pltfr_remove,
-+ .driver = {
-+ .name = "rk_gmac-dwmac",
-+ .pm = &stmmac_pltfr_pm_ops,
-+ .of_match_table = rk_gmac_dwmac_match,
-+ },
-+};
-+module_platform_driver(rk_gmac_dwmac_driver);
-+
-+MODULE_AUTHOR("Chen-Zhi (Roger Chen) <roger.chen@rock-chips.com>");
-+MODULE_DESCRIPTION("Rockchip RK3288 DWMAC specific glue layer");
-+MODULE_LICENSE("GPL");
---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
-@@ -175,31 +175,6 @@ static int socfpga_dwmac_setup(struct so
- return 0;
- }
-
--static void *socfpga_dwmac_probe(struct platform_device *pdev)
--{
-- struct device *dev = &pdev->dev;
-- int ret;
-- struct socfpga_dwmac *dwmac;
--
-- dwmac = devm_kzalloc(dev, sizeof(*dwmac), GFP_KERNEL);
-- if (!dwmac)
-- return ERR_PTR(-ENOMEM);
--
-- ret = socfpga_dwmac_parse_data(dwmac, dev);
-- if (ret) {
-- dev_err(dev, "Unable to parse OF data\n");
-- return ERR_PTR(ret);
-- }
--
-- ret = socfpga_dwmac_setup(dwmac);
-- if (ret) {
-- dev_err(dev, "couldn't setup SoC glue (%d)\n", ret);
-- return ERR_PTR(ret);
-- }
--
-- return dwmac;
--}
--
- static void socfpga_dwmac_exit(struct platform_device *pdev, void *priv)
- {
- struct socfpga_dwmac *dwmac = priv;
-@@ -257,9 +232,65 @@ static int socfpga_dwmac_init(struct pla
- return ret;
- }
-
--const struct stmmac_of_data socfpga_gmac_data = {
-- .setup = socfpga_dwmac_probe,
-- .init = socfpga_dwmac_init,
-- .exit = socfpga_dwmac_exit,
-- .fix_mac_speed = socfpga_dwmac_fix_mac_speed,
-+static int socfpga_dwmac_probe(struct platform_device *pdev)
-+{
-+ struct plat_stmmacenet_data *plat_dat;
-+ struct stmmac_resources stmmac_res;
-+ struct device *dev = &pdev->dev;
-+ int ret;
-+ struct socfpga_dwmac *dwmac;
-+
-+ ret = stmmac_get_platform_resources(pdev, &stmmac_res);
-+ if (ret)
-+ return ret;
-+
-+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
-+ if (IS_ERR(plat_dat))
-+ return PTR_ERR(plat_dat);
-+
-+ dwmac = devm_kzalloc(dev, sizeof(*dwmac), GFP_KERNEL);
-+ if (!dwmac)
-+ return -ENOMEM;
-+
-+ ret = socfpga_dwmac_parse_data(dwmac, dev);
-+ if (ret) {
-+ dev_err(dev, "Unable to parse OF data\n");
-+ return ret;
-+ }
-+
-+ ret = socfpga_dwmac_setup(dwmac);
-+ if (ret) {
-+ dev_err(dev, "couldn't setup SoC glue (%d)\n", ret);
-+ return ret;
-+ }
-+
-+ plat_dat->bsp_priv = dwmac;
-+ plat_dat->init = socfpga_dwmac_init;
-+ plat_dat->exit = socfpga_dwmac_exit;
-+ plat_dat->fix_mac_speed = socfpga_dwmac_fix_mac_speed;
-+
-+ ret = socfpga_dwmac_init(pdev, plat_dat->bsp_priv);
-+ if (ret)
-+ return ret;
-+
-+ return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
-+}
-+
-+static const struct of_device_id socfpga_dwmac_match[] = {
-+ { .compatible = "altr,socfpga-stmmac" },
-+ { }
- };
-+MODULE_DEVICE_TABLE(of, socfpga_dwmac_match);
-+
-+static struct platform_driver socfpga_dwmac_driver = {
-+ .probe = socfpga_dwmac_probe,
-+ .remove = stmmac_pltfr_remove,
-+ .driver = {
-+ .name = "socfpga-dwmac",
-+ .pm = &stmmac_pltfr_pm_ops,
-+ .of_match_table = socfpga_dwmac_match,
-+ },
-+};
-+module_platform_driver(socfpga_dwmac_driver);
-+
-+MODULE_LICENSE("GPL v2");
---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
-@@ -17,9 +17,11 @@
- #include <linux/stmmac.h>
- #include <linux/phy.h>
- #include <linux/mfd/syscon.h>
-+#include <linux/module.h>
- #include <linux/regmap.h>
- #include <linux/clk.h>
- #include <linux/of.h>
-+#include <linux/of_device.h>
- #include <linux/of_net.h>
-
- #include "stmmac_platform.h"
-@@ -127,6 +129,11 @@ struct sti_dwmac {
- struct device *dev;
- struct regmap *regmap;
- u32 speed;
-+ void (*fix_retime_src)(void *priv, unsigned int speed);
-+};
-+
-+struct sti_dwmac_of_data {
-+ void (*fix_retime_src)(void *priv, unsigned int speed);
- };
-
- static u32 phy_intf_sels[] = {
-@@ -221,8 +228,9 @@ static void stid127_fix_retime_src(void
- regmap_update_bits(dwmac->regmap, reg, STID127_RETIME_SRC_MASK, val);
- }
-
--static void sti_dwmac_ctrl_init(struct sti_dwmac *dwmac)
-+static int sti_dwmac_init(struct platform_device *pdev, void *priv)
- {
-+ struct sti_dwmac *dwmac = priv;
- struct regmap *regmap = dwmac->regmap;
- int iface = dwmac->interface;
- struct device *dev = dwmac->dev;
-@@ -240,28 +248,8 @@ static void sti_dwmac_ctrl_init(struct s
-
- val = (iface == PHY_INTERFACE_MODE_REVMII) ? 0 : ENMII;
- regmap_update_bits(regmap, reg, ENMII_MASK, val);
--}
--
--static int stix4xx_init(struct platform_device *pdev, void *priv)
--{
-- struct sti_dwmac *dwmac = priv;
-- u32 spd = dwmac->speed;
-
-- sti_dwmac_ctrl_init(dwmac);
--
-- stih4xx_fix_retime_src(priv, spd);
--
-- return 0;
--}
--
--static int stid127_init(struct platform_device *pdev, void *priv)
--{
-- struct sti_dwmac *dwmac = priv;
-- u32 spd = dwmac->speed;
--
-- sti_dwmac_ctrl_init(dwmac);
--
-- stid127_fix_retime_src(priv, spd);
-+ dwmac->fix_retime_src(priv, dwmac->speed);
-
- return 0;
- }
-@@ -333,34 +321,80 @@ static int sti_dwmac_parse_data(struct s
- return 0;
- }
-
--static void *sti_dwmac_setup(struct platform_device *pdev)
-+static int sti_dwmac_probe(struct platform_device *pdev)
- {
-+ struct plat_stmmacenet_data *plat_dat;
-+ const struct sti_dwmac_of_data *data;
-+ struct stmmac_resources stmmac_res;
- struct sti_dwmac *dwmac;
- int ret;
-
-+ data = of_device_get_match_data(&pdev->dev);
-+ if (!data) {
-+ dev_err(&pdev->dev, "No OF match data provided\n");
-+ return -EINVAL;
-+ }
-+
-+ ret = stmmac_get_platform_resources(pdev, &stmmac_res);
-+ if (ret)
-+ return ret;
-+
-+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
-+ if (IS_ERR(plat_dat))
-+ return PTR_ERR(plat_dat);
-+
- dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
- if (!dwmac)
-- return ERR_PTR(-ENOMEM);
-+ return -ENOMEM;
-
- ret = sti_dwmac_parse_data(dwmac, pdev);
- if (ret) {
- dev_err(&pdev->dev, "Unable to parse OF data\n");
-- return ERR_PTR(ret);
-+ return ret;
- }
-
-- return dwmac;
-+ dwmac->fix_retime_src = data->fix_retime_src;
-+
-+ plat_dat->bsp_priv = dwmac;
-+ plat_dat->init = sti_dwmac_init;
-+ plat_dat->exit = sti_dwmac_exit;
-+ plat_dat->fix_mac_speed = data->fix_retime_src;
-+
-+ ret = sti_dwmac_init(pdev, plat_dat->bsp_priv);
-+ if (ret)
-+ return ret;
-+
-+ return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
- }
-
--const struct stmmac_of_data stih4xx_dwmac_data = {
-- .fix_mac_speed = stih4xx_fix_retime_src,
-- .setup = sti_dwmac_setup,
-- .init = stix4xx_init,
-- .exit = sti_dwmac_exit,
-+static const struct sti_dwmac_of_data stih4xx_dwmac_data = {
-+ .fix_retime_src = stih4xx_fix_retime_src,
-+};
-+
-+static const struct sti_dwmac_of_data stid127_dwmac_data = {
-+ .fix_retime_src = stid127_fix_retime_src,
- };
-
--const struct stmmac_of_data stid127_dwmac_data = {
-- .fix_mac_speed = stid127_fix_retime_src,
-- .setup = sti_dwmac_setup,
-- .init = stid127_init,
-- .exit = sti_dwmac_exit,
-+static const struct of_device_id sti_dwmac_match[] = {
-+ { .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data},
-+ { .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data},
-+ { .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
-+ { .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
-+ { }
- };
-+MODULE_DEVICE_TABLE(of, sti_dwmac_match);
-+
-+static struct platform_driver sti_dwmac_driver = {
-+ .probe = sti_dwmac_probe,
-+ .remove = stmmac_pltfr_remove,
-+ .driver = {
-+ .name = "sti-dwmac",
-+ .pm = &stmmac_pltfr_pm_ops,
-+ .of_match_table = sti_dwmac_match,
-+ },
-+};
-+module_platform_driver(sti_dwmac_driver);
-+
-+MODULE_AUTHOR("Srinivas Kandagatla <srinivas.kandagatla@st.com>");
-+MODULE_DESCRIPTION("STMicroelectronics DWMAC Specific Glue layer");
-+MODULE_LICENSE("GPL");
---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
-@@ -18,7 +18,9 @@
-
- #include <linux/stmmac.h>
- #include <linux/clk.h>
-+#include <linux/module.h>
- #include <linux/phy.h>
-+#include <linux/platform_device.h>
- #include <linux/of_net.h>
- #include <linux/regulator/consumer.h>
-
-@@ -31,35 +33,6 @@ struct sunxi_priv_data {
- struct regulator *regulator;
- };
-
--static void *sun7i_gmac_setup(struct platform_device *pdev)
--{
-- struct sunxi_priv_data *gmac;
-- struct device *dev = &pdev->dev;
--
-- gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL);
-- if (!gmac)
-- return ERR_PTR(-ENOMEM);
--
-- gmac->interface = of_get_phy_mode(dev->of_node);
--
-- gmac->tx_clk = devm_clk_get(dev, "allwinner_gmac_tx");
-- if (IS_ERR(gmac->tx_clk)) {
-- dev_err(dev, "could not get tx clock\n");
-- return gmac->tx_clk;
-- }
--
-- /* Optional regulator for PHY */
-- gmac->regulator = devm_regulator_get_optional(dev, "phy");
-- if (IS_ERR(gmac->regulator)) {
-- if (PTR_ERR(gmac->regulator) == -EPROBE_DEFER)
-- return ERR_PTR(-EPROBE_DEFER);
-- dev_info(dev, "no regulator found\n");
-- gmac->regulator = NULL;
-- }
--
-- return gmac;
--}
--
- #define SUN7I_GMAC_GMII_RGMII_RATE 125000000
- #define SUN7I_GMAC_MII_RATE 25000000
-
-@@ -130,13 +103,76 @@ static void sun7i_fix_speed(void *priv,
- }
- }
-
--/* of_data specifying hardware features and callbacks.
-- * hardware features were copied from Allwinner drivers. */
--const struct stmmac_of_data sun7i_gmac_data = {
-- .has_gmac = 1,
-- .tx_coe = 1,
-- .fix_mac_speed = sun7i_fix_speed,
-- .setup = sun7i_gmac_setup,
-- .init = sun7i_gmac_init,
-- .exit = sun7i_gmac_exit,
-+static int sun7i_gmac_probe(struct platform_device *pdev)
-+{
-+ struct plat_stmmacenet_data *plat_dat;
-+ struct stmmac_resources stmmac_res;
-+ struct sunxi_priv_data *gmac;
-+ struct device *dev = &pdev->dev;
-+ int ret;
-+
-+ ret = stmmac_get_platform_resources(pdev, &stmmac_res);
-+ if (ret)
-+ return ret;
-+
-+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac);
-+ if (IS_ERR(plat_dat))
-+ return PTR_ERR(plat_dat);
-+
-+ gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL);
-+ if (!gmac)
-+ return -ENOMEM;
-+
-+ gmac->interface = of_get_phy_mode(dev->of_node);
-+
-+ gmac->tx_clk = devm_clk_get(dev, "allwinner_gmac_tx");
-+ if (IS_ERR(gmac->tx_clk)) {
-+ dev_err(dev, "could not get tx clock\n");
-+ return PTR_ERR(gmac->tx_clk);
-+ }
-+
-+ /* Optional regulator for PHY */
-+ gmac->regulator = devm_regulator_get_optional(dev, "phy");
-+ if (IS_ERR(gmac->regulator)) {
-+ if (PTR_ERR(gmac->regulator) == -EPROBE_DEFER)
-+ return -EPROBE_DEFER;
-+ dev_info(dev, "no regulator found\n");
-+ gmac->regulator = NULL;
-+ }
-+
-+ /* platform data specifying hardware features and callbacks.
-+ * hardware features were copied from Allwinner drivers. */
-+ plat_dat->tx_coe = 1;
-+ plat_dat->has_gmac = true;
-+ plat_dat->bsp_priv = gmac;
-+ plat_dat->init = sun7i_gmac_init;
-+ plat_dat->exit = sun7i_gmac_exit;
-+ plat_dat->fix_mac_speed = sun7i_fix_speed;
-+
-+ ret = sun7i_gmac_init(pdev, plat_dat->bsp_priv);
-+ if (ret)
-+ return ret;
-+
-+ return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
-+}
-+
-+static const struct of_device_id sun7i_dwmac_match[] = {
-+ { .compatible = "allwinner,sun7i-a20-gmac" },
-+ { }
- };
-+MODULE_DEVICE_TABLE(of, sun7i_dwmac_match);
-+
-+static struct platform_driver sun7i_dwmac_driver = {
-+ .probe = sun7i_gmac_probe,
-+ .remove = stmmac_pltfr_remove,
-+ .driver = {
-+ .name = "sun7i-dwmac",
-+ .pm = &stmmac_pltfr_pm_ops,
-+ .of_match_table = sun7i_dwmac_match,
-+ },
-+};
-+module_platform_driver(sun7i_dwmac_driver);
-+
-+MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>");
-+MODULE_DESCRIPTION("Allwinner sunxi DWMAC specific glue layer");
-+MODULE_LICENSE("GPL");
---- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
-@@ -73,7 +73,7 @@
- #define MMC_RX_OCTETCOUNT_G 0x00000188
- #define MMC_RX_BROADCASTFRAME_G 0x0000018c
- #define MMC_RX_MULTICASTFRAME_G 0x00000190
--#define MMC_RX_CRC_ERRROR 0x00000194
-+#define MMC_RX_CRC_ERROR 0x00000194
- #define MMC_RX_ALIGN_ERROR 0x00000198
- #define MMC_RX_RUN_ERROR 0x0000019C
- #define MMC_RX_JABBER_ERROR 0x000001A0
-@@ -196,7 +196,7 @@ void dwmac_mmc_read(void __iomem *ioaddr
- mmc->mmc_rx_octetcount_g += readl(ioaddr + MMC_RX_OCTETCOUNT_G);
- mmc->mmc_rx_broadcastframe_g += readl(ioaddr + MMC_RX_BROADCASTFRAME_G);
- mmc->mmc_rx_multicastframe_g += readl(ioaddr + MMC_RX_MULTICASTFRAME_G);
-- mmc->mmc_rx_crc_error += readl(ioaddr + MMC_RX_CRC_ERRROR);
-+ mmc->mmc_rx_crc_error += readl(ioaddr + MMC_RX_CRC_ERROR);
- mmc->mmc_rx_align_error += readl(ioaddr + MMC_RX_ALIGN_ERROR);
- mmc->mmc_rx_run_error += readl(ioaddr + MMC_RX_RUN_ERROR);
- mmc->mmc_rx_jabber_error += readl(ioaddr + MMC_RX_JABBER_ERROR);
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
-@@ -34,6 +34,14 @@
- #include <linux/ptp_clock_kernel.h>
- #include <linux/reset.h>
-
-+struct stmmac_resources {
-+ void __iomem *addr;
-+ const char *mac;
-+ int wol_irq;
-+ int lpi_irq;
-+ int irq;
-+};
-+
- struct stmmac_tx_info {
- dma_addr_t buf;
- bool map_as_page;
-@@ -135,9 +143,9 @@ void stmmac_ptp_unregister(struct stmmac
- int stmmac_resume(struct net_device *ndev);
- int stmmac_suspend(struct net_device *ndev);
- int stmmac_dvr_remove(struct net_device *ndev);
--struct stmmac_priv *stmmac_dvr_probe(struct device *device,
-- struct plat_stmmacenet_data *plat_dat,
-- void __iomem *addr);
-+int stmmac_dvr_probe(struct device *device,
-+ struct plat_stmmacenet_data *plat_dat,
-+ struct stmmac_resources *res);
- void stmmac_disable_eee_mode(struct stmmac_priv *priv);
- bool stmmac_eee_init(struct stmmac_priv *priv);
-
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -52,6 +52,7 @@
- #include "stmmac_ptp.h"
- #include "stmmac.h"
- #include <linux/reset.h>
-+#include <linux/of_mdio.h>
-
- #define STMMAC_ALIGN(x) L1_CACHE_ALIGN(x)
-
-@@ -816,18 +817,25 @@ static int stmmac_init_phy(struct net_de
- priv->speed = 0;
- priv->oldduplex = -1;
-
-- if (priv->plat->phy_bus_name)
-- snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
-- priv->plat->phy_bus_name, priv->plat->bus_id);
-- else
-- snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
-- priv->plat->bus_id);
-+ if (priv->plat->phy_node) {
-+ phydev = of_phy_connect(dev, priv->plat->phy_node,
-+ &stmmac_adjust_link, 0, interface);
-+ } else {
-+ if (priv->plat->phy_bus_name)
-+ snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
-+ priv->plat->phy_bus_name, priv->plat->bus_id);
-+ else
-+ snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
-+ priv->plat->bus_id);
-
-- snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
-- priv->plat->phy_addr);
-- pr_debug("stmmac_init_phy: trying to attach to %s\n", phy_id_fmt);
-+ snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
-+ priv->plat->phy_addr);
-+ pr_debug("stmmac_init_phy: trying to attach to %s\n",
-+ phy_id_fmt);
-
-- phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link, interface);
-+ phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link,
-+ interface);
-+ }
-
- if (IS_ERR_OR_NULL(phydev)) {
- pr_err("%s: Could not attach to PHY\n", dev->name);
-@@ -851,7 +859,7 @@ static int stmmac_init_phy(struct net_de
- * device as well.
- * Note: phydev->phy_id is the result of reading the UID PHY registers.
- */
-- if (phydev->phy_id == 0) {
-+ if (!priv->plat->phy_node && phydev->phy_id == 0) {
- phy_disconnect(phydev);
- return -ENODEV;
- }
-@@ -978,13 +986,11 @@ static int stmmac_init_rx_buffers(struct
- {
- struct sk_buff *skb;
-
-- skb = __netdev_alloc_skb(priv->dev, priv->dma_buf_sz + NET_IP_ALIGN,
-- flags);
-+ skb = __netdev_alloc_skb_ip_align(priv->dev, priv->dma_buf_sz, flags);
- if (!skb) {
- pr_err("%s: Rx init fails; skb is NULL\n", __func__);
- return -ENOMEM;
- }
-- skb_reserve(skb, NET_IP_ALIGN);
- priv->rx_skbuff[i] = skb;
- priv->rx_skbuff_dma[i] = dma_map_single(priv->device, skb->data,
- priv->dma_buf_sz,
-@@ -2803,16 +2809,15 @@ static int stmmac_hw_init(struct stmmac_
- * stmmac_dvr_probe
- * @device: device pointer
- * @plat_dat: platform data pointer
-- * @addr: iobase memory address
-+ * @res: stmmac resource pointer
- * Description: this is the main probe function used to
- * call the alloc_etherdev, allocate the priv structure.
- * Return:
-- * on success the new private structure is returned, otherwise the error
-- * pointer.
-+ * returns 0 on success, otherwise errno.
- */
--struct stmmac_priv *stmmac_dvr_probe(struct device *device,
-- struct plat_stmmacenet_data *plat_dat,
-- void __iomem *addr)
-+int stmmac_dvr_probe(struct device *device,
-+ struct plat_stmmacenet_data *plat_dat,
-+ struct stmmac_resources *res)
- {
- int ret = 0;
- struct net_device *ndev = NULL;
-@@ -2820,7 +2825,7 @@ struct stmmac_priv *stmmac_dvr_probe(str
-
- ndev = alloc_etherdev(sizeof(struct stmmac_priv));
- if (!ndev)
-- return ERR_PTR(-ENOMEM);
-+ return -ENOMEM;
-
- SET_NETDEV_DEV(ndev, device);
-
-@@ -2831,8 +2836,17 @@ struct stmmac_priv *stmmac_dvr_probe(str
- stmmac_set_ethtool_ops(ndev);
- priv->pause = pause;
- priv->plat = plat_dat;
-- priv->ioaddr = addr;
-- priv->dev->base_addr = (unsigned long)addr;
-+ priv->ioaddr = res->addr;
-+ priv->dev->base_addr = (unsigned long)res->addr;
-+
-+ priv->dev->irq = res->irq;
-+ priv->wol_irq = res->wol_irq;
-+ priv->lpi_irq = res->lpi_irq;
-+
-+ if (res->mac)
-+ memcpy(priv->dev->dev_addr, res->mac, ETH_ALEN);
-+
-+ dev_set_drvdata(device, priv->dev);
-
- /* Verify driver arguments */
- stmmac_verify_args();
-@@ -2947,7 +2961,7 @@ struct stmmac_priv *stmmac_dvr_probe(str
- }
- }
-
-- return priv;
-+ return 0;
-
- error_mdio_register:
- unregister_netdev(ndev);
-@@ -2960,7 +2974,7 @@ error_pclk_get:
- error_clk_get:
- free_netdev(ndev);
-
-- return ERR_PTR(ret);
-+ return ret;
- }
- EXPORT_SYMBOL_GPL(stmmac_dvr_probe);
-
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
-@@ -161,11 +161,16 @@ int stmmac_mdio_reset(struct mii_bus *bu
-
- if (!gpio_request(reset_gpio, "mdio-reset")) {
- gpio_direction_output(reset_gpio, active_low ? 1 : 0);
-- udelay(data->delays[0]);
-+ if (data->delays[0])
-+ msleep(DIV_ROUND_UP(data->delays[0], 1000));
-+
- gpio_set_value(reset_gpio, active_low ? 0 : 1);
-- udelay(data->delays[1]);
-+ if (data->delays[1])
-+ msleep(DIV_ROUND_UP(data->delays[1], 1000));
-+
- gpio_set_value(reset_gpio, active_low ? 1 : 0);
-- udelay(data->delays[2]);
-+ if (data->delays[2])
-+ msleep(DIV_ROUND_UP(data->delays[2], 1000));
- }
- }
- #endif
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
-@@ -163,7 +163,7 @@ static int stmmac_pci_probe(struct pci_d
- {
- struct stmmac_pci_info *info = (struct stmmac_pci_info *)id->driver_data;
- struct plat_stmmacenet_data *plat;
-- struct stmmac_priv *priv;
-+ struct stmmac_resources res;
- int i;
- int ret;
-
-@@ -214,19 +214,12 @@ static int stmmac_pci_probe(struct pci_d
-
- pci_enable_msi(pdev);
-
-- priv = stmmac_dvr_probe(&pdev->dev, plat, pcim_iomap_table(pdev)[i]);
-- if (IS_ERR(priv)) {
-- dev_err(&pdev->dev, "%s: main driver probe failed\n", __func__);
-- return PTR_ERR(priv);
-- }
-- priv->dev->irq = pdev->irq;
-- priv->wol_irq = pdev->irq;
--
-- pci_set_drvdata(pdev, priv->dev);
--
-- dev_dbg(&pdev->dev, "STMMAC PCI driver registration completed\n");
-+ memset(&res, 0, sizeof(res));
-+ res.addr = pcim_iomap_table(pdev)[i];
-+ res.wol_irq = pdev->irq;
-+ res.irq = pdev->irq;
-
-- return 0;
-+ return stmmac_dvr_probe(&pdev->dev, plat, &res);
- }
-
- /**
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-@@ -28,29 +28,11 @@
- #include <linux/of.h>
- #include <linux/of_net.h>
- #include <linux/of_device.h>
-+#include <linux/of_mdio.h>
-
- #include "stmmac.h"
- #include "stmmac_platform.h"
-
--static const struct of_device_id stmmac_dt_ids[] = {
-- /* SoC specific glue layers should come before generic bindings */
-- { .compatible = "rockchip,rk3288-gmac", .data = &rk3288_gmac_data},
-- { .compatible = "amlogic,meson6-dwmac", .data = &meson6_dwmac_data},
-- { .compatible = "allwinner,sun7i-a20-gmac", .data = &sun7i_gmac_data},
-- { .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data},
-- { .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data},
-- { .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
-- { .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
-- { .compatible = "altr,socfpga-stmmac", .data = &socfpga_gmac_data },
-- { .compatible = "st,spear600-gmac"},
-- { .compatible = "snps,dwmac-3.610"},
-- { .compatible = "snps,dwmac-3.70a"},
-- { .compatible = "snps,dwmac-3.710"},
-- { .compatible = "snps,dwmac"},
-- { /* sentinel */ }
--};
--MODULE_DEVICE_TABLE(of, stmmac_dt_ids);
--
- #ifdef CONFIG_OF
-
- /**
-@@ -122,37 +104,16 @@ static int dwmac1000_validate_ucast_entr
- * this function is to read the driver parameters from device-tree and
- * set some private fields that will be used by the main at runtime.
- */
--static int stmmac_probe_config_dt(struct platform_device *pdev,
-- struct plat_stmmacenet_data *plat,
-- const char **mac)
-+struct plat_stmmacenet_data *
-+stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
- {
- struct device_node *np = pdev->dev.of_node;
-+ struct plat_stmmacenet_data *plat;
- struct stmmac_dma_cfg *dma_cfg;
-- const struct of_device_id *device;
--
-- if (!np)
-- return -ENODEV;
-
-- device = of_match_device(stmmac_dt_ids, &pdev->dev);
-- if (!device)
-- return -ENODEV;
--
-- if (device->data) {
-- const struct stmmac_of_data *data = device->data;
-- plat->has_gmac = data->has_gmac;
-- plat->enh_desc = data->enh_desc;
-- plat->tx_coe = data->tx_coe;
-- plat->rx_coe = data->rx_coe;
-- plat->bugged_jumbo = data->bugged_jumbo;
-- plat->pmt = data->pmt;
-- plat->riwt_off = data->riwt_off;
-- plat->fix_mac_speed = data->fix_mac_speed;
-- plat->bus_setup = data->bus_setup;
-- plat->setup = data->setup;
-- plat->free = data->free;
-- plat->init = data->init;
-- plat->exit = data->exit;
-- }
-+ plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
-+ if (!plat)
-+ return ERR_PTR(-ENOMEM);
-
- *mac = of_get_mac_address(np);
- plat->interface = of_get_phy_mode(np);
-@@ -168,13 +129,24 @@ static int stmmac_probe_config_dt(struct
- /* Default to phy auto-detection */
- plat->phy_addr = -1;
-
-+ /* If we find a phy-handle property, use it as the PHY */
-+ plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
-+
-+ /* If phy-handle is not specified, check if we have a fixed-phy */
-+ if (!plat->phy_node && of_phy_is_fixed_link(np)) {
-+ if ((of_phy_register_fixed_link(np) < 0))
-+ return ERR_PTR(-ENODEV);
-+
-+ plat->phy_node = of_node_get(np);
-+ }
-+
- /* "snps,phy-addr" is not a standard property. Mark it as deprecated
- * and warn of its use. Remove this when phy node support is added.
- */
- if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
- dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
-
-- if (plat->phy_bus_name)
-+ if (plat->phy_node || plat->phy_bus_name)
- plat->mdio_bus_data = NULL;
- else
- plat->mdio_bus_data =
-@@ -194,6 +166,12 @@ static int stmmac_probe_config_dt(struct
- */
- plat->maxmtu = JUMBO_LEN;
-
-+ /* Set default value for multicast hash bins */
-+ plat->multicast_filter_bins = HASH_TABLE_SIZE;
-+
-+ /* Set default value for unicast filter entries */
-+ plat->unicast_filter_entries = 1;
-+
- /*
- * Currently only the properties needed on SPEAr600
- * are provided. All other properties should be added
-@@ -232,8 +210,10 @@ static int stmmac_probe_config_dt(struct
- if (of_find_property(np, "snps,pbl", NULL)) {
- dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
- GFP_KERNEL);
-- if (!dma_cfg)
-- return -ENOMEM;
-+ if (!dma_cfg) {
-+ of_node_put(np);
-+ return ERR_PTR(-ENOMEM);
-+ }
- plat->dma_cfg = dma_cfg;
- of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
- dma_cfg->fixed_burst =
-@@ -250,45 +230,34 @@ static int stmmac_probe_config_dt(struct
- pr_warn("force_sf_dma_mode is ignored if force_thresh_dma_mode is set.");
- }
-
-- return 0;
-+ return plat;
- }
- #else
--static int stmmac_probe_config_dt(struct platform_device *pdev,
-- struct plat_stmmacenet_data *plat,
-- const char **mac)
-+struct plat_stmmacenet_data *
-+stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
- {
-- return -ENOSYS;
-+ return ERR_PTR(-ENOSYS);
- }
- #endif /* CONFIG_OF */
-+EXPORT_SYMBOL_GPL(stmmac_probe_config_dt);
-
--/**
-- * stmmac_pltfr_probe - platform driver probe.
-- * @pdev: platform device pointer
-- * Description: platform_device probe function. It is to allocate
-- * the necessary platform resources, invoke custom helper (if required) and
-- * invoke the main probe function.
-- */
--static int stmmac_pltfr_probe(struct platform_device *pdev)
-+int stmmac_get_platform_resources(struct platform_device *pdev,
-+ struct stmmac_resources *stmmac_res)
- {
-- int ret = 0;
- struct resource *res;
-- struct device *dev = &pdev->dev;
-- void __iomem *addr = NULL;
-- struct stmmac_priv *priv = NULL;
-- struct plat_stmmacenet_data *plat_dat = NULL;
-- const char *mac = NULL;
-- int irq, wol_irq, lpi_irq;
-+
-+ memset(stmmac_res, 0, sizeof(*stmmac_res));
-
- /* Get IRQ information early to have an ability to ask for deferred
- * probe if needed before we went too far with resource allocation.
- */
-- irq = platform_get_irq_byname(pdev, "macirq");
-- if (irq < 0) {
-- if (irq != -EPROBE_DEFER) {
-- dev_err(dev,
-+ stmmac_res->irq = platform_get_irq_byname(pdev, "macirq");
-+ if (stmmac_res->irq < 0) {
-+ if (stmmac_res->irq != -EPROBE_DEFER) {
-+ dev_err(&pdev->dev,
- "MAC IRQ configuration information not found\n");
- }
-- return irq;
-+ return stmmac_res->irq;
- }
-
- /* On some platforms e.g. SPEAr the wake up irq differs from the mac irq
-@@ -298,82 +267,23 @@ static int stmmac_pltfr_probe(struct pla
- * In case the wake up interrupt is not passed from the platform
- * so the driver will continue to use the mac irq (ndev->irq)
- */
-- wol_irq = platform_get_irq_byname(pdev, "eth_wake_irq");
-- if (wol_irq < 0) {
-- if (wol_irq == -EPROBE_DEFER)
-+ stmmac_res->wol_irq = platform_get_irq_byname(pdev, "eth_wake_irq");
-+ if (stmmac_res->wol_irq < 0) {
-+ if (stmmac_res->wol_irq == -EPROBE_DEFER)
- return -EPROBE_DEFER;
-- wol_irq = irq;
-+ stmmac_res->wol_irq = stmmac_res->irq;
- }
-
-- lpi_irq = platform_get_irq_byname(pdev, "eth_lpi");
-- if (lpi_irq == -EPROBE_DEFER)
-+ stmmac_res->lpi_irq = platform_get_irq_byname(pdev, "eth_lpi");
-+ if (stmmac_res->lpi_irq == -EPROBE_DEFER)
- return -EPROBE_DEFER;
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- addr = devm_ioremap_resource(dev, res);
-- if (IS_ERR(addr))
-- return PTR_ERR(addr);
--
-- plat_dat = dev_get_platdata(&pdev->dev);
--
-- if (!plat_dat)
-- plat_dat = devm_kzalloc(&pdev->dev,
-- sizeof(struct plat_stmmacenet_data),
-- GFP_KERNEL);
-- if (!plat_dat) {
-- pr_err("%s: ERROR: no memory", __func__);
-- return -ENOMEM;
-- }
--
-- /* Set default value for multicast hash bins */
-- plat_dat->multicast_filter_bins = HASH_TABLE_SIZE;
-+ stmmac_res->addr = devm_ioremap_resource(&pdev->dev, res);
-
-- /* Set default value for unicast filter entries */
-- plat_dat->unicast_filter_entries = 1;
--
-- if (pdev->dev.of_node) {
-- ret = stmmac_probe_config_dt(pdev, plat_dat, &mac);
-- if (ret) {
-- pr_err("%s: main dt probe failed", __func__);
-- return ret;
-- }
-- }
--
-- /* Custom setup (if needed) */
-- if (plat_dat->setup) {
-- plat_dat->bsp_priv = plat_dat->setup(pdev);
-- if (IS_ERR(plat_dat->bsp_priv))
-- return PTR_ERR(plat_dat->bsp_priv);
-- }
--
-- /* Custom initialisation (if needed)*/
-- if (plat_dat->init) {
-- ret = plat_dat->init(pdev, plat_dat->bsp_priv);
-- if (unlikely(ret))
-- return ret;
-- }
--
-- priv = stmmac_dvr_probe(&(pdev->dev), plat_dat, addr);
-- if (IS_ERR(priv)) {
-- pr_err("%s: main driver probe failed", __func__);
-- return PTR_ERR(priv);
-- }
--
-- /* Copy IRQ values to priv structure which is now avaialble */
-- priv->dev->irq = irq;
-- priv->wol_irq = wol_irq;
-- priv->lpi_irq = lpi_irq;
--
-- /* Get MAC address if available (DT) */
-- if (mac)
-- memcpy(priv->dev->dev_addr, mac, ETH_ALEN);
--
-- platform_set_drvdata(pdev, priv->dev);
--
-- pr_debug("STMMAC platform driver registration completed");
--
-- return 0;
-+ return PTR_ERR_OR_ZERO(stmmac_res->addr);
- }
-+EXPORT_SYMBOL_GPL(stmmac_get_platform_resources);
-
- /**
- * stmmac_pltfr_remove
-@@ -381,7 +291,7 @@ static int stmmac_pltfr_probe(struct pla
- * Description: this function calls the main to free the net resources
- * and calls the platforms hook and release the resources (e.g. mem).
- */
--static int stmmac_pltfr_remove(struct platform_device *pdev)
-+int stmmac_pltfr_remove(struct platform_device *pdev)
- {
- struct net_device *ndev = platform_get_drvdata(pdev);
- struct stmmac_priv *priv = netdev_priv(ndev);
-@@ -390,11 +300,9 @@ static int stmmac_pltfr_remove(struct pl
- if (priv->plat->exit)
- priv->plat->exit(pdev, priv->plat->bsp_priv);
-
-- if (priv->plat->free)
-- priv->plat->free(pdev, priv->plat->bsp_priv);
--
- return ret;
- }
-+EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
-
- #ifdef CONFIG_PM_SLEEP
- /**
-@@ -438,21 +346,10 @@ static int stmmac_pltfr_resume(struct de
- }
- #endif /* CONFIG_PM_SLEEP */
-
--static SIMPLE_DEV_PM_OPS(stmmac_pltfr_pm_ops,
-- stmmac_pltfr_suspend, stmmac_pltfr_resume);
--
--static struct platform_driver stmmac_pltfr_driver = {
-- .probe = stmmac_pltfr_probe,
-- .remove = stmmac_pltfr_remove,
-- .driver = {
-- .name = STMMAC_RESOURCE_NAME,
-- .pm = &stmmac_pltfr_pm_ops,
-- .of_match_table = of_match_ptr(stmmac_dt_ids),
-- },
--};
--
--module_platform_driver(stmmac_pltfr_driver);
-+SIMPLE_DEV_PM_OPS(stmmac_pltfr_pm_ops, stmmac_pltfr_suspend,
-+ stmmac_pltfr_resume);
-+EXPORT_SYMBOL_GPL(stmmac_pltfr_pm_ops);
-
--MODULE_DESCRIPTION("STMMAC 10/100/1000 Ethernet PLATFORM driver");
-+MODULE_DESCRIPTION("STMMAC 10/100/1000 Ethernet platform support");
- MODULE_AUTHOR("Giuseppe Cavallaro <peppe.cavallaro@st.com>");
- MODULE_LICENSE("GPL");
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
-@@ -19,11 +19,15 @@
- #ifndef __STMMAC_PLATFORM_H__
- #define __STMMAC_PLATFORM_H__
-
--extern const struct stmmac_of_data meson6_dwmac_data;
--extern const struct stmmac_of_data sun7i_gmac_data;
--extern const struct stmmac_of_data stih4xx_dwmac_data;
--extern const struct stmmac_of_data stid127_dwmac_data;
--extern const struct stmmac_of_data socfpga_gmac_data;
--extern const struct stmmac_of_data rk3288_gmac_data;
-+#include "stmmac.h"
-+
-+struct plat_stmmacenet_data *
-+stmmac_probe_config_dt(struct platform_device *pdev, const char **mac);
-+
-+int stmmac_get_platform_resources(struct platform_device *pdev,
-+ struct stmmac_resources *stmmac_res);
-+
-+int stmmac_pltfr_remove(struct platform_device *pdev);
-+extern const struct dev_pm_ops stmmac_pltfr_pm_ops;
-
- #endif /* __STMMAC_PLATFORM_H__ */
---- a/include/linux/stmmac.h
-+++ b/include/linux/stmmac.h
-@@ -99,6 +99,7 @@ struct plat_stmmacenet_data {
- int phy_addr;
- int interface;
- struct stmmac_mdio_bus_data *mdio_bus_data;
-+ struct device_node *phy_node;
- struct stmmac_dma_cfg *dma_cfg;
- int clk_csr;
- int has_gmac;
-@@ -118,30 +119,8 @@ struct plat_stmmacenet_data {
- int rx_fifo_size;
- void (*fix_mac_speed)(void *priv, unsigned int speed);
- void (*bus_setup)(void __iomem *ioaddr);
-- void *(*setup)(struct platform_device *pdev);
-- void (*free)(struct platform_device *pdev, void *priv);
- int (*init)(struct platform_device *pdev, void *priv);
- void (*exit)(struct platform_device *pdev, void *priv);
-- void *custom_cfg;
-- void *custom_data;
- void *bsp_priv;
- };
--
--/* of_data for SoC glue layer device tree bindings */
--
--struct stmmac_of_data {
-- int has_gmac;
-- int enh_desc;
-- int tx_coe;
-- int rx_coe;
-- int bugged_jumbo;
-- int pmt;
-- int riwt_off;
-- void (*fix_mac_speed)(void *priv, unsigned int speed);
-- void (*bus_setup)(void __iomem *ioaddr);
-- void *(*setup)(struct platform_device *pdev);
-- void (*free)(struct platform_device *pdev, void *priv);
-- int (*init)(struct platform_device *pdev, void *priv);
-- void (*exit)(struct platform_device *pdev, void *priv);
--};
- #endif
diff --git a/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch b/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
deleted file mode 100644
index d385c9a36c..0000000000
--- a/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 5bf2dabde1fa3af0c9082b42b6847ef3fd198b13 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jogo@openwrt.org>
-Date: Sun, 9 Aug 2015 12:53:55 +0200
-Subject: [PATCH] stmac: platform: add support for retreiving mac from mtd
-
----
- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-@@ -116,6 +116,19 @@ stmmac_probe_config_dt(struct platform_d
- return ERR_PTR(-ENOMEM);
-
- *mac = of_get_mac_address(np);
-+ if (!*mac) {
-+ u8 mtd_mac[ETH_ALEN];
-+ int ret;
-+
-+ ret = of_get_mac_address_mtd(np, mtd_mac);
-+ if (ret == -EPROBE_DEFER)
-+ return ERR_PTR(ret);
-+
-+ if (is_valid_ether_addr(mtd_mac))
-+ *mac = devm_kmemdup(&pdev->dev, mtd_mac, ETH_ALEN,
-+ GFP_KERNEL);
-+ }
-+
- plat->interface = of_get_phy_mode(np);
-
- /* Get max speed of operation from device tree */
diff --git a/target/linux/ipq806x/patches-4.1/020-add-ap148-bootargs.patch b/target/linux/ipq806x/patches-4.4/020-add-ap148-bootargs.patch
index c0ad74c492..9c33bad5c1 100644
--- a/target/linux/ipq806x/patches-4.1/020-add-ap148-bootargs.patch
+++ b/target/linux/ipq806x/patches-4.4/020-add-ap148-bootargs.patch
@@ -1,6 +1,21 @@
--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -14,6 +14,14 @@
+@@ -4,14 +4,6 @@
+ model = "Qualcomm IPQ8064/AP148";
+ compatible = "qcom,ipq8064-ap148", "qcom,ipq8064";
+
+- aliases {
+- serial0 = &gsbi4_serial;
+- };
+-
+- chosen {
+- stdout-path = "serial0:115200n8";
+- };
+-
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+@@ -22,6 +14,14 @@
};
};
@@ -30,7 +45,7 @@
syscon-tcsr = <&tcsr>;
-- serial@16340000 {
+- gsbi4_serial: serial@16340000 {
+ uart4: serial@16340000 {
compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
reg = <0x16340000 0x1000>,
diff --git a/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch b/target/linux/ipq806x/patches-4.4/021-add-ap148-partitions.patch
index bfdb30fe14..bfdb30fe14 100644
--- a/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
+++ b/target/linux/ipq806x/patches-4.4/021-add-ap148-partitions.patch
diff --git a/target/linux/ipq806x/patches-4.1/022-add-db149-dts.patch b/target/linux/ipq806x/patches-4.4/022-add-db149-dts.patch
index 7d8c8e8a81..4d3e827b51 100644
--- a/target/linux/ipq806x/patches-4.1/022-add-db149-dts.patch
+++ b/target/linux/ipq806x/patches-4.4/022-add-db149-dts.patch
@@ -15,7 +15,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
-@@ -451,6 +451,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+@@ -506,6 +506,7 @@
qcom-apq8084-ifc6540.dtb \
qcom-apq8084-mtp.dtb \
qcom-ipq8064-ap148.dtb \
diff --git a/target/linux/ipq806x/patches-4.1/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch b/target/linux/ipq806x/patches-4.4/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
index 6b296377b6..b8c527b6ae 100644
--- a/target/linux/ipq806x/patches-4.1/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
+++ b/target/linux/ipq806x/patches-4.4/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
@@ -1,10 +1,9 @@
--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -46,15 +46,12 @@
- serial@16340000 {
+@@ -47,14 +47,12 @@
status = "ok";
};
--
+
- i2c4: i2c@16380000 {
- status = "ok";
-
@@ -14,17 +13,17 @@
- pinctrl-names = "default";
- };
+ /*
-+ * The i2c device on gsbi4 should not be enabled.
-+ * On ipq806x designs gsbi4 i2c is meant for exclusive
-+ * RPM usage. Turning this on in kernel manifests as
-+ * i2c failure for the RPM.
-+ */
++ * The i2c device on gsbi4 should not be enabled.
++ * On ipq806x designs gsbi4 i2c is meant for exclusive
++ * RPM usage. Turning this on in kernel manifests as
++ * i2c failure for the RPM.
++ */
};
gsbi5: gsbi@1a200000 {
--- a/drivers/clk/qcom/gcc-ipq806x.c
+++ b/drivers/clk/qcom/gcc-ipq806x.c
-@@ -807,7 +807,7 @@ static struct clk_rcg gsbi7_qup_src = {
+@@ -294,7 +294,7 @@
.parent_names = gcc_pxo_pll8,
.num_parents = 2,
.ops = &clk_rcg_ops,
@@ -33,8 +32,8 @@
},
},
};
-@@ -823,7 +823,7 @@ static struct clk_branch gsbi7_qup_clk =
- .parent_names = (const char *[]){ "gsbi7_qup_src" },
+@@ -312,7 +312,7 @@
+ },
.num_parents = 1,
.ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
@@ -42,9 +41,9 @@
},
},
};
-@@ -871,7 +871,7 @@ static struct clk_branch gsbi4_h_clk = {
+@@ -890,7 +890,7 @@
.hw.init = &(struct clk_init_data){
- .name = "gsbi4_h_clk",
+ .name = "gsbi1_h_clk",
.ops = &clk_branch_ops,
- .flags = CLK_IS_ROOT,
+ .flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED,
diff --git a/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch b/target/linux/ipq806x/patches-4.4/024-ap148-add-memory-node.patch
index f026ed9394..f026ed9394 100644
--- a/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch
+++ b/target/linux/ipq806x/patches-4.4/024-ap148-add-memory-node.patch
diff --git a/target/linux/ipq806x/patches-4.1/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch b/target/linux/ipq806x/patches-4.4/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch
index a126d69441..e1d317de47 100644
--- a/target/linux/ipq806x/patches-4.1/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch
+++ b/target/linux/ipq806x/patches-4.4/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch
@@ -22,12 +22,12 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+ compatible = "syscon";
+ reg = <0x01200600 0x100>;
+ };
- };
++ };
+
+ sfpb_mutex: sfpb-mutex {
+ compatible = "qcom,sfpb-mutex";
+ syscon = <&sfpb_mutex_block 4 4>;
+
+ #hwlock-cells = <1>;
-+ };
+ };
};
diff --git a/target/linux/ipq806x/patches-4.1/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch b/target/linux/ipq806x/patches-4.4/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch
index b55f17475e..06b14052ef 100644
--- a/target/linux/ipq806x/patches-4.1/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch
+++ b/target/linux/ipq806x/patches-4.4/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch
@@ -26,7 +26,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
@@ -341,4 +341,10 @@
#hwlock-cells = <1>;
- };
+ };
+
+ smem {
+ compatible = "qcom,smem";
diff --git a/target/linux/ipq806x/patches-4.1/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch b/target/linux/ipq806x/patches-4.4/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
index 5fc54134de..d80eb86056 100644
--- a/target/linux/ipq806x/patches-4.1/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
+++ b/target/linux/ipq806x/patches-4.4/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
@@ -1,23 +1,26 @@
-From 0501f76b138cf1dc11a313bb7a094da524b79337 Mon Sep 17 00:00:00 2001
+From 61e8e1b1af77f24339da3f0822a76fa65ed635c6 Mon Sep 17 00:00:00 2001
From: Mathieu Olivari <mathieu@codeaurora.org>
Date: Thu, 13 Aug 2015 09:53:14 -0700
-Subject: [PATCH 3/3] mtd: add SMEM parser for QCOM platforms
+Subject: [PATCH] mtd: add SMEM parser for QCOM platforms
On QCOM platforms using MTD devices storage (such as IPQ806x), SMEM is
used to store partition layout. This new parser can now be used to read
SMEM and use it to register an MTD layout according to its content.
Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+Signed-off-by: Ram Chandra Jangir <rjangi@codeaurora.org>
---
drivers/mtd/Kconfig | 7 ++
drivers/mtd/Makefile | 1 +
- drivers/mtd/qcom_smem_part.c | 231 +++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 239 insertions(+)
+ drivers/mtd/qcom_smem_part.c | 228 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 236 insertions(+)
create mode 100644 drivers/mtd/qcom_smem_part.c
+diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
+index a03ad29..debc887 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -195,6 +195,13 @@ config MTD_MYLOADER_PARTS
+@@ -190,6 +190,13 @@
You will still need the parsing functions to be called by the driver
for your particular device. It won't happen automatically.
@@ -31,9 +34,24 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
comment "User Modules And Translation Layers"
#
+diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
+index 99bb9a1..2a44a64 100644
+--- a/drivers/mtd/Makefile
++++ b/drivers/mtd/Makefile
+@@ -16,6 +16,7 @@
+ obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o
+ obj-$(CONFIG_MTD_BCM47XX_PARTS) += bcm47xxpart.o
+ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
++obj-$(CONFIG_MTD_QCOM_SMEM_PARTS) += qcom_smem_part.o
+
+ # 'Users' - code which presents functionality to userspace.
+ obj-$(CONFIG_MTD_BLKDEVS) += mtd_blkdevs.o
+diff --git a/drivers/mtd/qcom_smem_part.c b/drivers/mtd/qcom_smem_part.c
+new file mode 100644
+index 0000000..f9c1bca
--- /dev/null
+++ b/drivers/mtd/qcom_smem_part.c
-@@ -0,0 +1,231 @@
+@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
@@ -95,13 +113,12 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+
+static int qcom_smem_get_flash_blksz(u64 **smem_blksz)
+{
-+ int ret;
+ size_t size;
+
-+ ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_BLOCK_SIZE,
-+ (void **) smem_blksz, &size);
++ *smem_blksz = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_BLOCK_SIZE,
++ &size);
+
-+ if (ret < 0) {
++ if (IS_ERR(*smem_blksz)) {
+ pr_err("Unable to read flash blksz from SMEM\n");
+ return -ENOENT;
+ }
@@ -116,13 +133,12 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+
+static int qcom_smem_get_flash_type(u64 **smem_flash_type)
+{
-+ int ret;
+ size_t size;
+
-+ ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_TYPE,
-+ (void **) smem_flash_type, &size);
++ *smem_flash_type = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_TYPE,
++ &size);
+
-+ if (ret < 0) {
++ if (IS_ERR(*smem_flash_type)) {
+ pr_err("Unable to read flash type from SMEM\n");
+ return -ENOENT;
+ }
@@ -137,13 +153,12 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+
+static int qcom_smem_get_flash_partitions(struct smem_partition_table **pparts)
+{
-+ int ret;
+ size_t size;
+
-+ ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_AARM_PARTITION_TABLE,
-+ (void **) pparts, &size);
++ *pparts = qcom_smem_get(SMEM_HOST_APPS, SMEM_AARM_PARTITION_TABLE,
++ &size);
+
-+ if (ret < 0) {
++ if (IS_ERR(*pparts)) {
+ pr_err("Unable to read partition table from SMEM\n");
+ return -ENOENT;
+ }
@@ -265,13 +280,3 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mathieu Olivari <mathieu@codeaurora.org>");
+MODULE_DESCRIPTION("Parsing code for SMEM based partition tables");
---- a/drivers/mtd/Makefile
-+++ b/drivers/mtd/Makefile
-@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o
- obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o
- obj-$(CONFIG_MTD_BCM47XX_PARTS) += bcm47xxpart.o
- obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
-+obj-$(CONFIG_MTD_QCOM_SMEM_PARTS) += qcom_smem_part.o
-
- # 'Users' - code which presents functionality to userspace.
- obj-$(CONFIG_MTD_BLKDEVS) += mtd_blkdevs.o
diff --git a/target/linux/ipq806x/patches-4.4/100-usb-phy-Add-Qualcomm-DWC3-HS-SS-PHY-drivers.patch b/target/linux/ipq806x/patches-4.4/100-usb-phy-Add-Qualcomm-DWC3-HS-SS-PHY-drivers.patch
new file mode 100644
index 0000000000..68f2b39813
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/100-usb-phy-Add-Qualcomm-DWC3-HS-SS-PHY-drivers.patch
@@ -0,0 +1,510 @@
+--- a/drivers/phy/Kconfig
++++ b/drivers/phy/Kconfig
+@@ -390,4 +390,15 @@
+ Enable this to support the Broadcom Cygnus PCIe PHY.
+ If unsure, say N.
+
++config PHY_QCOM_DWC3
++ tristate "QCOM DWC3 USB PHY support"
++ depends on ARCH_QCOM
++ depends on HAS_IOMEM
++ depends on OF
++ select GENERIC_PHY
++ help
++ This option enables support for the Synopsis PHYs present inside the
++ Qualcomm USB3.0 DWC3 controller. This driver supports both HS and SS
++ PHY controllers.
++
+ endmenu
+--- a/drivers/phy/Makefile
++++ b/drivers/phy/Makefile
+@@ -48,3 +48,4 @@ obj-$(CONFIG_PHY_TUSB1210) +=
+ obj-$(CONFIG_PHY_BRCMSTB_SATA) += phy-brcmstb-sata.o
+ obj-$(CONFIG_PHY_PISTACHIO_USB) += phy-pistachio-usb.o
+ obj-$(CONFIG_PHY_CYGNUS_PCIE) += phy-bcm-cygnus-pcie.o
++obj-$(CONFIG_PHY_QCOM_DWC3) += phy-qcom-dwc3.o
+--- /dev/null
++++ b/drivers/phy/phy-qcom-dwc3.c
+@@ -0,0 +1,482 @@
++/* Copyright (c) 2013-2014, Code Aurora Forum. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/clk.h>
++#include <linux/err.h>
++#include <linux/io.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/phy/phy.h>
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++
++/**
++ * USB QSCRATCH Hardware registers
++ */
++#define QSCRATCH_GENERAL_CFG (0x08)
++#define HSUSB_PHY_CTRL_REG (0x10)
++
++/* PHY_CTRL_REG */
++#define HSUSB_CTRL_DMSEHV_CLAMP BIT(24)
++#define HSUSB_CTRL_USB2_SUSPEND BIT(23)
++#define HSUSB_CTRL_UTMI_CLK_EN BIT(21)
++#define HSUSB_CTRL_UTMI_OTG_VBUS_VALID BIT(20)
++#define HSUSB_CTRL_USE_CLKCORE BIT(18)
++#define HSUSB_CTRL_DPSEHV_CLAMP BIT(17)
++#define HSUSB_CTRL_COMMONONN BIT(11)
++#define HSUSB_CTRL_ID_HV_CLAMP BIT(9)
++#define HSUSB_CTRL_OTGSESSVLD_CLAMP BIT(8)
++#define HSUSB_CTRL_CLAMP_EN BIT(7)
++#define HSUSB_CTRL_RETENABLEN BIT(1)
++#define HSUSB_CTRL_POR BIT(0)
++
++/* QSCRATCH_GENERAL_CFG */
++#define HSUSB_GCFG_XHCI_REV BIT(2)
++
++/**
++ * USB QSCRATCH Hardware registers
++ */
++#define SSUSB_PHY_CTRL_REG (0x00)
++#define SSUSB_PHY_PARAM_CTRL_1 (0x04)
++#define SSUSB_PHY_PARAM_CTRL_2 (0x08)
++#define CR_PROTOCOL_DATA_IN_REG (0x0c)
++#define CR_PROTOCOL_DATA_OUT_REG (0x10)
++#define CR_PROTOCOL_CAP_ADDR_REG (0x14)
++#define CR_PROTOCOL_CAP_DATA_REG (0x18)
++#define CR_PROTOCOL_READ_REG (0x1c)
++#define CR_PROTOCOL_WRITE_REG (0x20)
++
++/* PHY_CTRL_REG */
++#define SSUSB_CTRL_REF_USE_PAD BIT(28)
++#define SSUSB_CTRL_TEST_POWERDOWN BIT(27)
++#define SSUSB_CTRL_LANE0_PWR_PRESENT BIT(24)
++#define SSUSB_CTRL_SS_PHY_EN BIT(8)
++#define SSUSB_CTRL_SS_PHY_RESET BIT(7)
++
++/* SSPHY control registers */
++#define SSPHY_CTRL_RX_OVRD_IN_HI(lane) (0x1006 + 0x100 * lane)
++#define SSPHY_CTRL_TX_OVRD_DRV_LO(lane) (0x1002 + 0x100 * lane)
++
++/* RX OVRD IN HI bits */
++#define RX_OVRD_IN_HI_RX_RESET_OVRD BIT(13)
++#define RX_OVRD_IN_HI_RX_RX_RESET BIT(12)
++#define RX_OVRD_IN_HI_RX_EQ_OVRD BIT(11)
++#define RX_OVRD_IN_HI_RX_EQ_MASK 0x0700
++#define RX_OVRD_IN_HI_RX_EQ_SHIFT 8
++#define RX_OVRD_IN_HI_RX_EQ_EN_OVRD BIT(7)
++#define RX_OVRD_IN_HI_RX_EQ_EN BIT(6)
++#define RX_OVRD_IN_HI_RX_LOS_FILTER_OVRD BIT(5)
++#define RX_OVRD_IN_HI_RX_LOS_FILTER_MASK 0x0018
++#define RX_OVRD_IN_HI_RX_RATE_OVRD BIT(2)
++#define RX_OVRD_IN_HI_RX_RATE_MASK 0x0003
++
++/* TX OVRD DRV LO register bits */
++#define TX_OVRD_DRV_LO_AMPLITUDE_MASK 0x007F
++#define TX_OVRD_DRV_LO_PREEMPH_MASK 0x3F80
++#define TX_OVRD_DRV_LO_PREEMPH_SHIFT 7
++#define TX_OVRD_DRV_LO_EN BIT(14)
++
++struct qcom_dwc3_usb_phy {
++ void __iomem *base;
++ struct device *dev;
++ struct phy *phy;
++
++ int (*phy_init)(struct qcom_dwc3_usb_phy *phy_dwc3);
++ int (*phy_exit)(struct qcom_dwc3_usb_phy *phy_dwc3);
++
++ struct clk *xo_clk;
++ struct clk *ref_clk;
++};
++
++/**
++ * Write register and read back masked value to confirm it is written
++ *
++ * @base - QCOM DWC3 PHY base virtual address.
++ * @offset - register offset.
++ * @mask - register bitmask specifying what should be updated
++ * @val - value to write.
++ */
++static inline void qcom_dwc3_phy_write_readback(
++ struct qcom_dwc3_usb_phy *phy_dwc3, u32 offset,
++ const u32 mask, u32 val)
++{
++ u32 write_val, tmp = readl(phy_dwc3->base + offset);
++
++ tmp &= ~mask; /* retain other bits */
++ write_val = tmp | val;
++
++ writel(write_val, phy_dwc3->base + offset);
++
++ /* Read back to see if val was written */
++ tmp = readl(phy_dwc3->base + offset);
++ tmp &= mask; /* clear other bits */
++
++ if (tmp != val)
++ dev_err(phy_dwc3->dev, "write: %x to QSCRATCH: %x FAILED\n",
++ val, offset);
++}
++
++static int wait_for_latch(void __iomem *addr)
++{
++ u32 retry = 10;
++
++ while (true) {
++ if (!readl(addr))
++ break;
++
++ if (--retry == 0)
++ return -ETIMEDOUT;
++
++ usleep_range(10, 20);
++ }
++
++ return 0;
++}
++
++/**
++ * Write SSPHY register
++ *
++ * @base - QCOM DWC3 PHY base virtual address.
++ * @addr - SSPHY address to write.
++ * @val - value to write.
++ */
++static int qcom_dwc3_ss_write_phycreg(void __iomem *base, u32 addr, u32 val)
++{
++ int ret;
++
++ writel(addr, base + CR_PROTOCOL_DATA_IN_REG);
++ writel(0x1, base + CR_PROTOCOL_CAP_ADDR_REG);
++
++ ret = wait_for_latch(base + CR_PROTOCOL_CAP_ADDR_REG);
++ if (ret)
++ goto err_wait;
++
++ writel(val, base + CR_PROTOCOL_DATA_IN_REG);
++ writel(0x1, base + CR_PROTOCOL_CAP_DATA_REG);
++
++ ret = wait_for_latch(base + CR_PROTOCOL_CAP_DATA_REG);
++ if (ret)
++ goto err_wait;
++
++ writel(0x1, base + CR_PROTOCOL_WRITE_REG);
++
++ ret = wait_for_latch(base + CR_PROTOCOL_WRITE_REG);
++
++err_wait:
++ return ret;
++}
++
++/**
++ * Read SSPHY register.
++ *
++ * @base - QCOM DWC3 PHY base virtual address.
++ * @addr - SSPHY address to read.
++ */
++static int qcom_dwc3_ss_read_phycreg(void __iomem *base, u32 addr, u32 *val)
++{
++ int ret;
++ bool first_read = true;
++
++ writel(addr, base + CR_PROTOCOL_DATA_IN_REG);
++ writel(0x1, base + CR_PROTOCOL_CAP_ADDR_REG);
++
++ ret = wait_for_latch(base + CR_PROTOCOL_CAP_ADDR_REG);
++ if (ret)
++ goto err_wait;
++
++ /*
++ * Due to hardware bug, first read of SSPHY register might be
++ * incorrect. Hence as workaround, SW should perform SSPHY register
++ * read twice, but use only second read and ignore first read.
++ */
++retry:
++ writel(0x1, base + CR_PROTOCOL_READ_REG);
++
++ ret = wait_for_latch(base + CR_PROTOCOL_READ_REG);
++ if (ret)
++ goto err_wait;
++
++ if (first_read) {
++ readl(base + CR_PROTOCOL_DATA_OUT_REG);
++ first_read = false;
++ goto retry;
++ }
++
++ *val = readl(base + CR_PROTOCOL_DATA_OUT_REG);
++
++err_wait:
++ return ret;
++}
++
++static int qcom_dwc3_phy_power_on(struct phy *phy)
++{
++ int ret;
++ struct qcom_dwc3_usb_phy *phy_dwc3 = phy_get_drvdata(phy);
++
++ ret = clk_prepare_enable(phy_dwc3->xo_clk);
++ if (ret)
++ return ret;
++
++ ret = clk_prepare_enable(phy_dwc3->ref_clk);
++ if (ret)
++ clk_disable_unprepare(phy_dwc3->xo_clk);
++
++ return ret;
++}
++
++static int qcom_dwc3_phy_power_off(struct phy *phy)
++{
++ struct qcom_dwc3_usb_phy *phy_dwc3 = phy_get_drvdata(phy);
++
++ clk_disable_unprepare(phy_dwc3->ref_clk);
++ clk_disable_unprepare(phy_dwc3->xo_clk);
++
++ return 0;
++}
++
++static int qcom_dwc3_hs_phy_init(struct qcom_dwc3_usb_phy *phy_dwc3)
++{
++ u32 val;
++
++ /*
++ * HSPHY Initialization: Enable UTMI clock, select 19.2MHz fsel
++ * enable clamping, and disable RETENTION (power-on default is ENABLED)
++ */
++ val = HSUSB_CTRL_DPSEHV_CLAMP | HSUSB_CTRL_DMSEHV_CLAMP |
++ HSUSB_CTRL_RETENABLEN | HSUSB_CTRL_COMMONONN |
++ HSUSB_CTRL_OTGSESSVLD_CLAMP | HSUSB_CTRL_ID_HV_CLAMP |
++ HSUSB_CTRL_DPSEHV_CLAMP | HSUSB_CTRL_UTMI_OTG_VBUS_VALID |
++ HSUSB_CTRL_UTMI_CLK_EN | HSUSB_CTRL_CLAMP_EN | 0x70;
++
++ /* use core clock if external reference is not present */
++ if (!phy_dwc3->xo_clk)
++ val |= HSUSB_CTRL_USE_CLKCORE;
++
++ writel(val, phy_dwc3->base + HSUSB_PHY_CTRL_REG);
++ usleep_range(2000, 2200);
++
++ /* Disable (bypass) VBUS and ID filters */
++ writel(HSUSB_GCFG_XHCI_REV, phy_dwc3->base + QSCRATCH_GENERAL_CFG);
++
++ return 0;
++}
++
++static int qcom_dwc3_ss_phy_init(struct qcom_dwc3_usb_phy *phy_dwc3)
++{
++ int ret;
++ u32 data = 0;
++
++ /* reset phy */
++ data = readl_relaxed(phy_dwc3->base + SSUSB_PHY_CTRL_REG);
++ writel_relaxed(data | SSUSB_CTRL_SS_PHY_RESET,
++ phy_dwc3->base + SSUSB_PHY_CTRL_REG);
++ usleep_range(2000, 2200);
++ writel_relaxed(data, phy_dwc3->base + SSUSB_PHY_CTRL_REG);
++
++ /* clear REF_PAD if we don't have XO clk */
++ if (!phy_dwc3->xo_clk)
++ data &= ~SSUSB_CTRL_REF_USE_PAD;
++ else
++ data |= SSUSB_CTRL_REF_USE_PAD;
++
++ writel_relaxed(data, phy_dwc3->base + SSUSB_PHY_CTRL_REG);
++ msleep(30);
++
++ data |= SSUSB_CTRL_SS_PHY_EN | SSUSB_CTRL_LANE0_PWR_PRESENT;
++ writel_relaxed(data, phy_dwc3->base + SSUSB_PHY_CTRL_REG);
++
++ /*
++ * Fix RX Equalization setting as follows
++ * LANE0.RX_OVRD_IN_HI. RX_EQ_EN set to 0
++ * LANE0.RX_OVRD_IN_HI.RX_EQ_EN_OVRD set to 1
++ * LANE0.RX_OVRD_IN_HI.RX_EQ set to 3
++ * LANE0.RX_OVRD_IN_HI.RX_EQ_OVRD set to 1
++ */
++ ret = qcom_dwc3_ss_read_phycreg(phy_dwc3->base,
++ SSPHY_CTRL_RX_OVRD_IN_HI(0), &data);
++ if (ret)
++ goto err_phy_trans;
++
++ data &= ~RX_OVRD_IN_HI_RX_EQ_EN;
++ data |= RX_OVRD_IN_HI_RX_EQ_EN_OVRD;
++ data &= ~RX_OVRD_IN_HI_RX_EQ_MASK;
++ data |= 0x3 << RX_OVRD_IN_HI_RX_EQ_SHIFT;
++ data |= RX_OVRD_IN_HI_RX_EQ_OVRD;
++ ret = qcom_dwc3_ss_write_phycreg(phy_dwc3->base,
++ SSPHY_CTRL_RX_OVRD_IN_HI(0), data);
++ if (ret)
++ goto err_phy_trans;
++
++ /*
++ * Set EQ and TX launch amplitudes as follows
++ * LANE0.TX_OVRD_DRV_LO.PREEMPH set to 22
++ * LANE0.TX_OVRD_DRV_LO.AMPLITUDE set to 127
++ * LANE0.TX_OVRD_DRV_LO.EN set to 1.
++ */
++ ret = qcom_dwc3_ss_read_phycreg(phy_dwc3->base,
++ SSPHY_CTRL_TX_OVRD_DRV_LO(0), &data);
++ if (ret)
++ goto err_phy_trans;
++
++ data &= ~TX_OVRD_DRV_LO_PREEMPH_MASK;
++ data |= 0x16 << TX_OVRD_DRV_LO_PREEMPH_SHIFT;
++ data &= ~TX_OVRD_DRV_LO_AMPLITUDE_MASK;
++ data |= 0x7f;
++ data |= TX_OVRD_DRV_LO_EN;
++ ret = qcom_dwc3_ss_write_phycreg(phy_dwc3->base,
++ SSPHY_CTRL_TX_OVRD_DRV_LO(0), data);
++ if (ret)
++ goto err_phy_trans;
++
++ /*
++ * Set the QSCRATCH PHY_PARAM_CTRL1 parameters as follows
++ * TX_FULL_SWING [26:20] amplitude to 127
++ * TX_DEEMPH_3_5DB [13:8] to 22
++ * LOS_BIAS [2:0] to 0x5
++ */
++ qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_PARAM_CTRL_1,
++ 0x07f03f07, 0x07f01605);
++
++err_phy_trans:
++ return ret;
++}
++
++static int qcom_dwc3_ss_phy_exit(struct qcom_dwc3_usb_phy *phy_dwc3)
++{
++ /* Sequence to put SSPHY in low power state:
++ * 1. Clear REF_PHY_EN in PHY_CTRL_REG
++ * 2. Clear REF_USE_PAD in PHY_CTRL_REG
++ * 3. Set TEST_POWERED_DOWN in PHY_CTRL_REG to enable PHY retention
++ * 4. Disable SSPHY ref clk
++ */
++ qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
++ SSUSB_CTRL_SS_PHY_EN, 0x0);
++ qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
++ SSUSB_CTRL_REF_USE_PAD, 0x0);
++ qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
++ 0x0, SSUSB_CTRL_TEST_POWERDOWN);
++
++ return 0;
++}
++
++static int qcom_dwc3_phy_init(struct phy *phy)
++{
++ struct qcom_dwc3_usb_phy *phy_dwc3 = phy_get_drvdata(phy);
++
++ if (phy_dwc3->phy_init)
++ return phy_dwc3->phy_init(phy_dwc3);
++
++ return 0;
++}
++
++static int qcom_dwc3_phy_exit(struct phy *phy)
++{
++ struct qcom_dwc3_usb_phy *phy_dwc3 = phy_get_drvdata(phy);
++
++ if (phy_dwc3->phy_exit)
++ return qcom_dwc3_ss_phy_exit(phy_dwc3);
++
++ return 0;
++}
++
++static struct phy_ops qcom_dwc3_phy_ops = {
++ .init = qcom_dwc3_phy_init,
++ .exit = qcom_dwc3_phy_exit,
++ .power_on = qcom_dwc3_phy_power_on,
++ .power_off = qcom_dwc3_phy_power_off,
++ .owner = THIS_MODULE,
++};
++
++static const struct of_device_id qcom_dwc3_phy_table[] = {
++ { .compatible = "qcom,dwc3-hs-usb-phy", },
++ { .compatible = "qcom,dwc3-ss-usb-phy", },
++ { /* Sentinel */ }
++};
++MODULE_DEVICE_TABLE(of, qcom_dwc3_phy_table);
++
++static int qcom_dwc3_phy_probe(struct platform_device *pdev)
++{
++ struct qcom_dwc3_usb_phy *phy_dwc3;
++ struct phy_provider *phy_provider;
++ struct resource *res;
++
++ phy_dwc3 = devm_kzalloc(&pdev->dev, sizeof(*phy_dwc3), GFP_KERNEL);
++ if (!phy_dwc3)
++ return -ENOMEM;
++
++ platform_set_drvdata(pdev, phy_dwc3);
++
++ phy_dwc3->dev = &pdev->dev;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ phy_dwc3->base = devm_ioremap_resource(phy_dwc3->dev, res);
++ if (IS_ERR(phy_dwc3->base))
++ return PTR_ERR(phy_dwc3->base);
++
++ phy_dwc3->ref_clk = devm_clk_get(phy_dwc3->dev, "ref");
++ if (IS_ERR(phy_dwc3->ref_clk)) {
++ dev_dbg(phy_dwc3->dev, "cannot get reference clock\n");
++ return PTR_ERR(phy_dwc3->ref_clk);
++ }
++
++ if (of_device_is_compatible(pdev->dev.of_node,
++ "qcom,dwc3-hs-usb-phy")) {
++ clk_set_rate(phy_dwc3->ref_clk, 60000000);
++ phy_dwc3->phy_init = qcom_dwc3_hs_phy_init;
++ } else if (of_device_is_compatible(pdev->dev.of_node,
++ "qcom,dwc3-ss-usb-phy")) {
++ phy_dwc3->phy_init = qcom_dwc3_ss_phy_init;
++ phy_dwc3->phy_exit = qcom_dwc3_ss_phy_exit;
++ clk_set_rate(phy_dwc3->ref_clk, 125000000);
++ } else {
++ dev_err(phy_dwc3->dev, "Unknown phy\n");
++ return -EINVAL;
++ }
++
++ phy_dwc3->xo_clk = devm_clk_get(phy_dwc3->dev, "xo");
++ if (IS_ERR(phy_dwc3->xo_clk)) {
++ dev_dbg(phy_dwc3->dev, "cannot get TCXO clock\n");
++ phy_dwc3->xo_clk = NULL;
++ }
++
++ phy_dwc3->phy = devm_phy_create(phy_dwc3->dev, NULL, &qcom_dwc3_phy_ops);
++
++ if (IS_ERR(phy_dwc3->phy))
++ return PTR_ERR(phy_dwc3->phy);
++
++ phy_set_drvdata(phy_dwc3->phy, phy_dwc3);
++
++ phy_provider = devm_of_phy_provider_register(phy_dwc3->dev,
++ of_phy_simple_xlate);
++
++ if (IS_ERR(phy_provider))
++ return PTR_ERR(phy_provider);
++
++ return 0;
++}
++
++static struct platform_driver qcom_dwc3_phy_driver = {
++ .probe = qcom_dwc3_phy_probe,
++ .driver = {
++ .name = "qcom-dwc3-usb-phy",
++ .owner = THIS_MODULE,
++ .of_match_table = qcom_dwc3_phy_table,
++ },
++};
++
++module_platform_driver(qcom_dwc3_phy_driver);
++
++MODULE_ALIAS("platform:phy-qcom-dwc3");
++MODULE_LICENSE("GPL v2");
++MODULE_AUTHOR("Andy Gross <agross@codeaurora.org>");
++MODULE_AUTHOR("Ivan T. Ivanov <iivanov@mm-sol.com>");
++MODULE_DESCRIPTION("DesignWare USB3 QCOM PHY driver");
diff --git a/target/linux/ipq806x/patches-4.4/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch b/target/linux/ipq806x/patches-4.4/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
new file mode 100644
index 0000000000..6e6f10d549
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
@@ -0,0 +1,125 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -92,5 +92,29 @@
+ sata@29000000 {
+ status = "ok";
+ };
++
++ phy@100f8800 { /* USB3 port 1 HS phy */
++ status = "ok";
++ };
++
++ phy@100f8830 { /* USB3 port 1 SS phy */
++ status = "ok";
++ };
++
++ phy@110f8800 { /* USB3 port 0 HS phy */
++ status = "ok";
++ };
++
++ phy@110f8830 { /* USB3 port 0 SS phy */
++ status = "ok";
++ };
++
++ usb30@0 {
++ status = "ok";
++ };
++
++ usb30@1 {
++ status = "ok";
++ };
+ };
+ };
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -333,6 +333,90 @@
+ compatible = "syscon";
+ reg = <0x01200600 0x100>;
+ };
++
++ hs_phy_1: phy@100f8800 {
++ compatible = "qcom,dwc3-hs-usb-phy";
++ reg = <0x100f8800 0x30>;
++ clocks = <&gcc USB30_1_UTMI_CLK>;
++ clock-names = "ref";
++ #phy-cells = <0>;
++
++ status = "disabled";
++ };
++
++ ss_phy_1: phy@100f8830 {
++ compatible = "qcom,dwc3-ss-usb-phy";
++ reg = <0x100f8830 0x30>;
++ clocks = <&gcc USB30_1_MASTER_CLK>;
++ clock-names = "ref";
++ #phy-cells = <0>;
++
++ status = "disabled";
++ };
++
++ hs_phy_0: phy@110f8800 {
++ compatible = "qcom,dwc3-hs-usb-phy";
++ reg = <0x110f8800 0x30>;
++ clocks = <&gcc USB30_0_UTMI_CLK>;
++ clock-names = "ref";
++ #phy-cells = <0>;
++
++ status = "disabled";
++ };
++
++ ss_phy_0: phy@110f8830 {
++ compatible = "qcom,dwc3-ss-usb-phy";
++ reg = <0x110f8830 0x30>;
++ clocks = <&gcc USB30_0_MASTER_CLK>;
++ clock-names = "ref";
++ #phy-cells = <0>;
++
++ status = "disabled";
++ };
++
++ usb3_0: usb30@0 {
++ compatible = "qcom,dwc3";
++ #address-cells = <1>;
++ #size-cells = <1>;
++ clocks = <&gcc USB30_0_MASTER_CLK>;
++ clock-names = "core";
++
++ ranges;
++
++ status = "disabled";
++
++ dwc3@11000000 {
++ compatible = "snps,dwc3";
++ reg = <0x11000000 0xcd00>;
++ interrupts = <0 110 0x4>;
++ phys = <&hs_phy_0>, <&ss_phy_0>;
++ phy-names = "usb2-phy", "usb3-phy";
++ tx-fifo-resize;
++ dr_mode = "host";
++ };
++ };
++
++ usb3_1: usb30@1 {
++ compatible = "qcom,dwc3";
++ #address-cells = <1>;
++ #size-cells = <1>;
++ clocks = <&gcc USB30_1_MASTER_CLK>;
++ clock-names = "core";
++
++ ranges;
++
++ status = "disabled";
++
++ dwc3@10000000 {
++ compatible = "snps,dwc3";
++ reg = <0x10000000 0xcd00>;
++ interrupts = <0 205 0x4>;
++ phys = <&hs_phy_1>, <&ss_phy_1>;
++ phy-names = "usb2-phy", "usb3-phy";
++ tx-fifo-resize;
++ dr_mode = "host";
++ };
++ };
+ };
+
+ sfpb_mutex: sfpb-mutex {
diff --git a/target/linux/ipq806x/patches-4.1/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch b/target/linux/ipq806x/patches-4.4/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
index 41f91fae7c..41f91fae7c 100644
--- a/target/linux/ipq806x/patches-4.1/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
+++ b/target/linux/ipq806x/patches-4.4/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
diff --git a/target/linux/ipq806x/patches-4.1/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch b/target/linux/ipq806x/patches-4.4/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
index dbf16a303a..ad1a1b9cb3 100644
--- a/target/linux/ipq806x/patches-4.1/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
+++ b/target/linux/ipq806x/patches-4.4/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
@@ -34,25 +34,25 @@ MAINTAINERS | 7 +
--- a/MAINTAINERS
+++ b/MAINTAINERS
-@@ -7599,6 +7599,13 @@ L: linux-pci@vger.kernel.org
- S: Maintained
- F: drivers/pci/host/*spear*
+@@ -8253,6 +8253,13 @@
+ F: Documentation/devicetree/bindings/pci/hisilicon-pcie.txt
+ F: drivers/pci/host/pcie-hisi.c
+PCIE DRIVER FOR QUALCOMM MSM
-+M: Stanimir Varbanov <svarbanov@mm-sol.com>
-+L: linux-pci@vger.kernel.org
-+L: linux-arm-msm@vger.kernel.org
-+S: Maintained
-+F: drivers/pci/host/*qcom*
++M: Stanimir Varbanov <svarbanov@mm-sol.com>
++L: linux-pci@vger.kernel.org
++L: linux-arm-msm@vger.kernel.org
++S: Maintained
++F: drivers/pci/host/*qcom*
+
PCMCIA SUBSYSTEM
P: Linux PCMCIA Team
L: linux-pcmcia@lists.infradead.org
--- a/drivers/pci/host/Kconfig
+++ b/drivers/pci/host/Kconfig
-@@ -125,4 +125,13 @@ config PCIE_IPROC_PLATFORM
- Say Y here if you want to use the Broadcom iProc PCIe controller
- through the generic platform bus interface
+@@ -173,4 +173,13 @@
+ help
+ Say Y here if you want PCIe controller support on HiSilicon HIP05 SoC
+config PCIE_QCOM
+ bool "Qualcomm PCIe controller"
@@ -66,7 +66,7 @@ MAINTAINERS | 7 +
endmenu
--- /dev/null
+++ b/drivers/pci/host/pcie-qcom.c
-@@ -0,0 +1,677 @@
+@@ -0,0 +1,676 @@
+/*
+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ *
@@ -613,8 +613,7 @@ MAINTAINERS | 7 +
+ return PCIBIOS_SUCCESSFUL;
+ }
+
-+ return dw_pcie_cfg_read(pp->dbi_base + (where & ~0x3), where,
-+ size, val);
++ return dw_pcie_cfg_read(pp->dbi_base + where, size, val);
+}
+
+static struct pcie_host_ops qcom_pcie_ops = {
@@ -648,7 +647,7 @@ MAINTAINERS | 7 +
+
+ pcie->version = (unsigned int)match->data;
+
-+ pcie->reset = devm_gpiod_get_optional(dev, "perst");
++ pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW);
+ if (IS_ERR(pcie->reset) && PTR_ERR(pcie->reset) == -EPROBE_DEFER)
+ return PTR_ERR(pcie->reset);
+
@@ -746,8 +745,8 @@ MAINTAINERS | 7 +
+MODULE_ALIAS("platform:qcom-pcie");
--- a/drivers/pci/host/Makefile
+++ b/drivers/pci/host/Makefile
-@@ -15,3 +15,4 @@ obj-$(CONFIG_PCI_LAYERSCAPE) += pci-laye
- obj-$(CONFIG_PCI_VERSATILE) += pci-versatile.o
- obj-$(CONFIG_PCIE_IPROC) += pcie-iproc.o
- obj-$(CONFIG_PCIE_IPROC_PLATFORM) += pcie-iproc-platform.o
+@@ -20,3 +20,4 @@
+ obj-$(CONFIG_PCIE_ALTERA) += pcie-altera.o
+ obj-$(CONFIG_PCIE_ALTERA_MSI) += pcie-altera-msi.o
+ obj-$(CONFIG_PCI_HISI) += pcie-hisi.o
+obj-$(CONFIG_PCIE_QCOM) += pcie-qcom.o
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.4/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 6ccb7d8080..1246bfeda9 100644
--- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.4/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -15,8 +15,8 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -91,5 +91,15 @@
- sata@29000000 {
+@@ -116,5 +116,15 @@
+ usb30@1 {
status = "ok";
};
+
@@ -97,9 +97,9 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
};
intc: interrupt-controller@2000000 {
-@@ -333,6 +363,144 @@
- compatible = "syscon";
- reg = <0x01200600 0x100>;
+@@ -417,6 +447,144 @@
+ dr_mode = "host";
+ };
};
+
+ pcie0: pci@1b500000 {
diff --git a/target/linux/ipq806x/patches-4.1/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch b/target/linux/ipq806x/patches-4.4/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
index e2d31354ed..e2d31354ed 100644
--- a/target/linux/ipq806x/patches-4.1/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
+++ b/target/linux/ipq806x/patches-4.4/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
diff --git a/target/linux/ipq806x/patches-4.1/114-pcie-add-ctlr-init.patch b/target/linux/ipq806x/patches-4.4/114-pcie-add-ctlr-init.patch
index c00abca753..6328113c06 100644
--- a/target/linux/ipq806x/patches-4.1/114-pcie-add-ctlr-init.patch
+++ b/target/linux/ipq806x/patches-4.4/114-pcie-add-ctlr-init.patch
@@ -223,9 +223,9 @@
+
+ writel(PCIE20_PLR_IATU_TYPE_CFG0, pcie->dbi + PCIE20_PLR_IATU_CTRL1);
+ writel(PCIE20_PLR_IATU_ENABLE, pcie->dbi + PCIE20_PLR_IATU_CTRL2);
-+ writel(pp->cfg0_mod_base, pcie->dbi + PCIE20_PLR_IATU_LBAR);
-+ writel((pp->cfg0_mod_base >> 32), pcie->dbi + PCIE20_PLR_IATU_UBAR);
-+ writel((pp->cfg0_mod_base + pp->cfg0_size - 1),
++ writel(pp->cfg0_base, pcie->dbi + PCIE20_PLR_IATU_LBAR);
++ writel((pp->cfg0_base >> 32), pcie->dbi + PCIE20_PLR_IATU_UBAR);
++ writel((pp->cfg0_base + pp->cfg0_size - 1),
+ pcie->dbi + PCIE20_PLR_IATU_LAR);
+ writel(busdev, pcie->dbi + PCIE20_PLR_IATU_LTAR);
+ writel(0, pcie->dbi + PCIE20_PLR_IATU_UTAR);
@@ -246,9 +246,9 @@
+
+ writel(PCIE20_PLR_IATU_TYPE_MEM, pcie->dbi + PCIE20_PLR_IATU_CTRL1);
+ writel(PCIE20_PLR_IATU_ENABLE, pcie->dbi + PCIE20_PLR_IATU_CTRL2);
-+ writel(pp->mem_mod_base, pcie->dbi + PCIE20_PLR_IATU_LBAR);
-+ writel((pp->mem_mod_base >> 32), pcie->dbi + PCIE20_PLR_IATU_UBAR);
-+ writel(pp->mem_mod_base + pp->mem_size - 1,
++ writel(pp->mem_base, pcie->dbi + PCIE20_PLR_IATU_LBAR);
++ writel((pp->mem_base >> 32), pcie->dbi + PCIE20_PLR_IATU_UBAR);
++ writel(pp->mem_base + pp->mem_size - 1,
+ pcie->dbi + PCIE20_PLR_IATU_LAR);
+ writel(pp->mem_bus_addr, pcie->dbi + PCIE20_PLR_IATU_LTAR);
+ writel(upper_32_bits(pp->mem_bus_addr),
diff --git a/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch b/target/linux/ipq806x/patches-4.4/115-add-pcie-aux-clk-dts.patch
index a99857e314..8ceace9523 100644
--- a/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
+++ b/target/linux/ipq806x/patches-4.4/115-add-pcie-aux-clk-dts.patch
@@ -1,6 +1,6 @@
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -392,15 +392,21 @@
+@@ -476,15 +476,21 @@
clocks = <&gcc PCIE_A_CLK>,
<&gcc PCIE_H_CLK>,
@@ -26,7 +26,7 @@
pinctrl-0 = <&pcie0_pins>;
pinctrl-names = "default";
-@@ -438,15 +444,21 @@
+@@ -522,15 +528,21 @@
clocks = <&gcc PCIE_1_A_CLK>,
<&gcc PCIE_1_H_CLK>,
@@ -52,7 +52,7 @@
pinctrl-0 = <&pcie1_pins>;
pinctrl-names = "default";
-@@ -484,15 +496,21 @@
+@@ -568,15 +580,21 @@
clocks = <&gcc PCIE_2_A_CLK>,
<&gcc PCIE_2_H_CLK>,
diff --git a/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch b/target/linux/ipq806x/patches-4.4/126-add-rpm-to-ipq8064-dts.patch
index 7daa93163b..7daa93163b 100644
--- a/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
+++ b/target/linux/ipq806x/patches-4.4/126-add-rpm-to-ipq8064-dts.patch
diff --git a/target/linux/ipq806x/patches-4.1/133-ARM-Add-Krait-L2-register-accessor-functions.patch b/target/linux/ipq806x/patches-4.4/133-ARM-Add-Krait-L2-register-accessor-functions.patch
index 36a92c858a..01bd7497d1 100644
--- a/target/linux/ipq806x/patches-4.1/133-ARM-Add-Krait-L2-register-accessor-functions.patch
+++ b/target/linux/ipq806x/patches-4.4/133-ARM-Add-Krait-L2-register-accessor-functions.patch
@@ -38,7 +38,7 @@ arch/arm/common/Kconfig | 3 ++
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
-@@ -9,6 +9,9 @@ config DMABOUNCE
+@@ -9,6 +9,9 @@
bool
select ZONE_DMA
@@ -50,7 +50,7 @@ arch/arm/common/Kconfig | 3 ++
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
-@@ -7,6 +7,7 @@ obj-y += firmware.o
+@@ -7,6 +7,7 @@
obj-$(CONFIG_ICST) += icst.o
obj-$(CONFIG_SA1111) += sa1111.o
obj-$(CONFIG_DMABOUNCE) += dmabounce.o
diff --git a/target/linux/ipq806x/patches-4.1/134-clk-mux-Split-out-register-accessors-for-reuse.patch b/target/linux/ipq806x/patches-4.4/134-clk-mux-Split-out-register-accessors-for-reuse.patch
index 3a475fba3d..acf5820e6c 100644
--- a/target/linux/ipq806x/patches-4.1/134-clk-mux-Split-out-register-accessors-for-reuse.patch
+++ b/target/linux/ipq806x/patches-4.4/134-clk-mux-Split-out-register-accessors-for-reuse.patch
@@ -1,15 +1,7 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,02/13] clk: mux: Split out register accessors for reuse
+From 4c28a15ea536281c8d619e5c6716ade914c79a6e Mon Sep 17 00:00:00 2001
From: Stephen Boyd <sboyd@codeaurora.org>
-X-Patchwork-Id: 6063111
-Message-Id: <1426920332-9340-3-git-send-email-sboyd@codeaurora.org>
-To: Mike Turquette <mturquette@linaro.org>, Stephen Boyd <sboyd@codeaurora.org>
-Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
- linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
- Viresh Kumar <viresh.kumar@linaro.org>
Date: Fri, 20 Mar 2015 23:45:21 -0700
+Subject: [PATCH 1/2] clk: mux: Split out register accessors for reuse
We want to reuse the logic in clk-mux.c for other clock drivers
that don't use readl as register accessors. Fortunately, there
@@ -20,15 +12,17 @@ that operate on an optional table and some flags so that other
drivers can use the same logic.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-
+Signed-off-by: Ram Chandra Jangir <rjangi@codeaurora.org>
---
-drivers/clk/clk-mux.c | 76 +++++++++++++++++++++++++++-----------------
+ drivers/clk/clk-mux.c | 74 +++++++++++++++++++++++++++-----------------
include/linux/clk-provider.h | 9 ++++--
- 2 files changed, 54 insertions(+), 31 deletions(-)
+ 2 files changed, 53 insertions(+), 30 deletions(-)
+diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
+index 7129c86..b03a34d 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
-@@ -29,35 +29,24 @@
+@@ -28,35 +28,24 @@
#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
@@ -37,7 +31,7 @@ drivers/clk/clk-mux.c | 76 +++++++++++++++++++++++++++-----------------
+ unsigned int *table, unsigned long flags)
{
- struct clk_mux *mux = to_clk_mux(hw);
- int num_parents = __clk_get_num_parents(hw->clk);
+ int num_parents = clk_hw_get_num_parents(hw);
- u32 val;
- /*
@@ -70,7 +64,7 @@ drivers/clk/clk-mux.c | 76 +++++++++++++++++++++++++++-----------------
val--;
if (val >= num_parents)
-@@ -65,24 +54,53 @@ static u8 clk_mux_get_parent(struct clk_
+@@ -64,24 +53,53 @@ static u8 clk_mux_get_parent(struct clk_hw *hw)
return val;
}
@@ -86,23 +80,23 @@ drivers/clk/clk-mux.c | 76 +++++++++++++++++++++++++++-----------------
- if (mux->table)
- index = mux->table[index];
+ /*
-+ * FIXME need a mux-specific flag to determine if val is bitwise or numeric
-+ * e.g. sys_clkin_ck's clksel field is 3 bits wide, but ranges from 0x1
-+ * to 0x7 (index starts at one)
-+ * OTOH, pmd_trace_clk_mux_ck uses a separate bit for each clock, so
-+ * val = 0x4 really means "bit 2, index starts at bit 0"
-+ */
++ * FIXME need a mux-specific flag to determine if val is bitwise or numeric
++ * e.g. sys_clkin_ck's clksel field is 3 bits wide, but ranges from 0x1
++ * to 0x7 (index starts at one)
++ * OTOH, pmd_trace_clk_mux_ck uses a separate bit for each clock, so
++ * val = 0x4 really means "bit 2, index starts at bit 0"
++ */
+ val = clk_readl(mux->reg) >> mux->shift;
+ val &= mux->mask;
-+
-+ return clk_mux_get_parent(hw, val, mux->table, mux->flags);
-+}
- else {
- if (mux->flags & CLK_MUX_INDEX_BIT)
- index = 1 << index;
++ return clk_mux_get_parent(hw, val, mux->table, mux->flags);
++}
++
+unsigned int clk_mux_reindex(u8 index, unsigned int *table,
-+ unsigned long flags)
++ unsigned long flags)
+{
+ unsigned int val = index;
@@ -114,8 +108,8 @@ drivers/clk/clk-mux.c | 76 +++++++++++++++++++++++++++-----------------
+ if (flags & CLK_MUX_INDEX_BIT)
+ val = 1 << index;
+
-+ if (flags & CLK_MUX_INDEX_ONE)
-+ val++;
++ if (flags & CLK_MUX_INDEX_ONE)
++ val++;
}
+ return val;
@@ -132,8 +126,8 @@ drivers/clk/clk-mux.c | 76 +++++++++++++++++++++++++++-----------------
+
if (mux->lock)
spin_lock_irqsave(mux->lock, flags);
-
-@@ -102,21 +120,21 @@ static int clk_mux_set_parent(struct clk
+ else
+@@ -105,7 +123,7 @@ static int clk_mux_set_parent(struct clk_hw *hw, u8 index)
}
const struct clk_ops clk_mux_ops = {
@@ -142,51 +136,49 @@ drivers/clk/clk-mux.c | 76 +++++++++++++++++++++++++++-----------------
.set_parent = clk_mux_set_parent,
.determine_rate = __clk_mux_determine_rate,
};
- EXPORT_SYMBOL_GPL(clk_mux_ops);
-
- const struct clk_ops clk_mux_ro_ops = {
-- .get_parent = clk_mux_get_parent,
-+ .get_parent = _clk_mux_get_parent,
- };
- EXPORT_SYMBOL_GPL(clk_mux_ro_ops);
-
- struct clk *clk_register_mux_table(struct device *dev, const char *name,
- const char **parent_names, u8 num_parents, unsigned long flags,
+@@ -120,7 +138,7 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name,
+ const char * const *parent_names, u8 num_parents,
+ unsigned long flags,
void __iomem *reg, u8 shift, u32 mask,
- u8 clk_mux_flags, u32 *table, spinlock_t *lock)
+ u8 clk_mux_flags, unsigned int *table, spinlock_t *lock)
{
struct clk_mux *mux;
struct clk *clk;
+diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
+index c56988a..b6b17b5 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
-@@ -409,7 +409,7 @@ void clk_unregister_divider(struct clk *
+@@ -432,7 +432,7 @@ void clk_unregister_divider(struct clk *clk);
struct clk_mux {
struct clk_hw hw;
void __iomem *reg;
- u32 *table;
-+ unsigned int *table;
++ unsigned int *table;
u32 mask;
u8 shift;
u8 flags;
-@@ -425,6 +425,11 @@ struct clk_mux {
+@@ -448,6 +448,11 @@ struct clk_mux {
extern const struct clk_ops clk_mux_ops;
extern const struct clk_ops clk_mux_ro_ops;
+unsigned int clk_mux_get_parent(struct clk_hw *hw, unsigned int val,
+ unsigned int *table, unsigned long flags);
+unsigned int clk_mux_reindex(u8 index, unsigned int *table,
-+ unsigned long flags);
++ unsigned long flags);
+
struct clk *clk_register_mux(struct device *dev, const char *name,
- const char **parent_names, u8 num_parents, unsigned long flags,
- void __iomem *reg, u8 shift, u8 width,
-@@ -433,7 +438,7 @@ struct clk *clk_register_mux(struct devi
- struct clk *clk_register_mux_table(struct device *dev, const char *name,
- const char **parent_names, u8 num_parents, unsigned long flags,
+ const char * const *parent_names, u8 num_parents,
+ unsigned long flags,
+@@ -458,7 +463,7 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name,
+ const char * const *parent_names, u8 num_parents,
+ unsigned long flags,
void __iomem *reg, u8 shift, u32 mask,
- u8 clk_mux_flags, u32 *table, spinlock_t *lock);
+ u8 clk_mux_flags, unsigned int *table, spinlock_t *lock);
void clk_unregister_mux(struct clk *clk);
+--
+2.7.2
+
diff --git a/target/linux/ipq806x/patches-4.1/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch b/target/linux/ipq806x/patches-4.4/135-clk-Avoid-sending-high-rates-to-downstream-clocks-du.patch
index 143e0795f0..5df0a5613e 100644
--- a/target/linux/ipq806x/patches-4.1/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch
+++ b/target/linux/ipq806x/patches-4.4/135-clk-Avoid-sending-high-rates-to-downstream-clocks-du.patch
@@ -1,16 +1,8 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3, 03/13] clk: Avoid sending high rates to downstream clocks during
- set_rate
+From 39d42ce5031d2a4f92fa203b87acfbab340b15a2 Mon Sep 17 00:00:00 2001
From: Stephen Boyd <sboyd@codeaurora.org>
-X-Patchwork-Id: 6063271
-Message-Id: <1426920332-9340-4-git-send-email-sboyd@codeaurora.org>
-To: Mike Turquette <mturquette@linaro.org>, Stephen Boyd <sboyd@codeaurora.org>
-Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
- linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
- Viresh Kumar <viresh.kumar@linaro.org>
Date: Fri, 20 Mar 2015 23:45:22 -0700
+Subject: [PATCH 2/2] clk: Avoid sending high rates to downstream clocks during
+ set_rate
If a clock is on and we call clk_set_rate() on it we may get into
a situation where the clock temporarily increases in rate
@@ -40,20 +32,22 @@ dividers if necessary. We assume that there isn't such a thing as
minimum rate requirements.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-
+Signed-off-by: Ram Chandra Jangir <rjangi@codeaurora.org>
---
-drivers/clk/clk.c | 34 ++++++++++++++++++++++------------
+ drivers/clk/clk.c | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
+index f13c3f4..8404c3c 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
-@@ -1744,21 +1744,24 @@ static struct clk_core *clk_propagate_ra
+@@ -1427,21 +1427,24 @@ static struct clk_core *clk_propagate_rate_change(struct clk_core *core,
* walk down a subtree and set the new rates notifying the rate
* change on the way
*/
--static void clk_change_rate(struct clk_core *clk)
+-static void clk_change_rate(struct clk_core *core)
+static void
-+clk_change_rate(struct clk_core *clk, unsigned long best_parent_rate)
++clk_change_rate(struct clk_core *core, unsigned long best_parent_rate)
{
struct clk_core *child;
struct hlist_node *tmp;
@@ -62,58 +56,58 @@ drivers/clk/clk.c | 34 ++++++++++++++++++++++------------
bool skip_set_rate = false;
struct clk_core *old_parent;
-- old_rate = clk->rate;
-+ hlist_for_each_entry(child, &clk->children, child_node) {
+- old_rate = core->rate;
++ hlist_for_each_entry(child, &core->children, child_node) {
+ /* Skip children who will be reparented to another clock */
-+ if (child->new_parent && child->new_parent != clk)
++ if (child->new_parent && child->new_parent != core)
+ continue;
+ if (child->new_rate > child->rate)
-+ clk_change_rate(child, clk->new_rate);
++ clk_change_rate(child, core->new_rate);
+ }
-- if (clk->new_parent)
-- best_parent_rate = clk->new_parent->rate;
-- else if (clk->parent)
-- best_parent_rate = clk->parent->rate;
-+ old_rate = clk->rate;
+- if (core->new_parent)
+- best_parent_rate = core->new_parent->rate;
+- else if (core->parent)
+- best_parent_rate = core->parent->rate;
++ old_rate = core->rate;
- if (clk->new_parent && clk->new_parent != clk->parent) {
- old_parent = __clk_set_parent_before(clk, clk->new_parent);
-@@ -1784,7 +1787,7 @@ static void clk_change_rate(struct clk_c
+ if (core->new_parent && core->new_parent != core->parent) {
+ old_parent = __clk_set_parent_before(core, core->new_parent);
+@@ -1467,7 +1470,7 @@ static void clk_change_rate(struct clk_core *core)
- trace_clk_set_rate_complete(clk, clk->new_rate);
+ trace_clk_set_rate_complete(core, core->new_rate);
-- clk->rate = clk_recalc(clk, best_parent_rate);
-+ clk->rate = clk->new_rate;
+- core->rate = clk_recalc(core, best_parent_rate);
++ core->rate = core->new_rate;
- if (clk->notifier_count && old_rate != clk->rate)
- __clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate);
-@@ -1797,12 +1800,13 @@ static void clk_change_rate(struct clk_c
+ if (core->notifier_count && old_rate != core->rate)
+ __clk_notify(core, POST_RATE_CHANGE, old_rate, core->rate);
+@@ -1483,12 +1486,13 @@ static void clk_change_rate(struct clk_core *core)
/* Skip children who will be reparented to another clock */
- if (child->new_parent && child->new_parent != clk)
+ if (child->new_parent && child->new_parent != core)
continue;
- clk_change_rate(child);
+ if (child->new_rate != child->rate)
-+ clk_change_rate(child, clk->new_rate);
++ clk_change_rate(child, core->new_rate);
}
- /* handle the new child who might not be in clk->children yet */
-- if (clk->new_child)
-- clk_change_rate(clk->new_child);
-+ if (clk->new_child && clk->new_child->new_rate != clk->new_child->rate)
-+ clk_change_rate(clk->new_child, clk->new_rate);
+ /* handle the new child who might not be in core->children yet */
+- if (core->new_child)
+- clk_change_rate(core->new_child);
++ if (core->new_child && core->new_child->new_rate != core->new_child->rate)
++ clk_change_rate(core->new_child, core->new_rate);
}
- static int clk_core_set_rate_nolock(struct clk_core *clk,
-@@ -1811,6 +1815,7 @@ static int clk_core_set_rate_nolock(stru
+ static int clk_core_set_rate_nolock(struct clk_core *core,
+@@ -1497,6 +1501,7 @@ static int clk_core_set_rate_nolock(struct clk_core *core,
struct clk_core *top, *fail_clk;
unsigned long rate = req_rate;
int ret = 0;
+ unsigned long parent_rate;
- if (!clk)
+ if (!core)
return 0;
-@@ -1836,8 +1841,13 @@ static int clk_core_set_rate_nolock(stru
+@@ -1522,8 +1527,13 @@ static int clk_core_set_rate_nolock(struct clk_core *core,
return -EBUSY;
}
@@ -126,5 +120,8 @@ drivers/clk/clk.c | 34 ++++++++++++++++++++++------------
- clk_change_rate(top);
+ clk_change_rate(top, parent_rate);
- clk->req_rate = req_rate;
+ core->req_rate = req_rate;
+--
+2.7.2
+
diff --git a/target/linux/ipq806x/patches-4.4/136-clk-Add-safe-switch-hook.patch b/target/linux/ipq806x/patches-4.4/136-clk-Add-safe-switch-hook.patch
new file mode 100644
index 0000000000..e969f6bca4
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/136-clk-Add-safe-switch-hook.patch
@@ -0,0 +1,158 @@
+From f7a00ea959be31f9b742042294a359d508edce94 Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <sboyd@codeaurora.org>
+Date: Fri, 20 Mar 2015 23:45:23 -0700
+Subject: [PATCH] clk: Add safe switch hook
+
+Sometimes clocks can't accept their parent source turning off
+while the source is reprogrammed to a different rate. Most
+notably CPU clocks require a way to switch away from the current
+PLL they're running on, reprogram that PLL to a new rate, and
+then switch back to the PLL with the new rate once they're done.
+Add a hook that drivers can implement allowing them to return a
+'safe parent' that they can switch their parent to while the
+upstream source is reprogrammed to support this.
+
+Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+Signed-off-by: Ram Chandra Jangir <rjangi@codeaurora.org>
+---
+ drivers/clk/clk.c | 61 ++++++++++++++++++++++++++++++++++++++------
+ include/linux/clk-provider.h | 1 +
+ 2 files changed, 54 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
+index 8404c3c..a29319a 100644
+--- a/drivers/clk/clk.c
++++ b/drivers/clk/clk.c
+@@ -51,9 +51,12 @@ struct clk_core {
+ struct clk_core **parents;
+ u8 num_parents;
+ u8 new_parent_index;
++ u8 safe_parent_index;
+ unsigned long rate;
+ unsigned long req_rate;
++ unsigned long old_rate;
+ unsigned long new_rate;
++ struct clk_core *safe_parent;
+ struct clk_core *new_parent;
+ struct clk_core *new_child;
+ unsigned long flags;
+@@ -1271,7 +1274,8 @@ out:
+ static void clk_calc_subtree(struct clk_core *core, unsigned long new_rate,
+ struct clk_core *new_parent, u8 p_index)
+ {
+- struct clk_core *child;
++ struct clk_core *child, *parent;
++ struct clk_hw *parent_hw;
+
+ core->new_rate = new_rate;
+ core->new_parent = new_parent;
+@@ -1281,6 +1285,18 @@ static void clk_calc_subtree(struct clk_core *core, unsigned long new_rate,
+ if (new_parent && new_parent != core->parent)
+ new_parent->new_child = core;
+
++ if (core->ops->get_safe_parent) {
++ parent_hw = core->ops->get_safe_parent(core->hw);
++ if (parent_hw) {
++ parent = parent_hw->core;
++ p_index = clk_fetch_parent_index(core, parent);
++ core->safe_parent_index = p_index;
++ core->safe_parent = parent;
++ }
++ } else {
++ core->safe_parent = NULL;
++ }
++
+ hlist_for_each_entry(child, &core->children, child_node) {
+ child->new_rate = clk_recalc(child, new_rate);
+ clk_calc_subtree(child, child->new_rate, NULL, 0);
+@@ -1393,14 +1409,43 @@ static struct clk_core *clk_propagate_rate_change(struct clk_core *core,
+ unsigned long event)
+ {
+ struct clk_core *child, *tmp_clk, *fail_clk = NULL;
++ struct clk_core *old_parent;
+ int ret = NOTIFY_DONE;
+
+- if (core->rate == core->new_rate)
++ if (core->rate == core->new_rate && event != POST_RATE_CHANGE)
+ return NULL;
+
++ switch (event) {
++ case PRE_RATE_CHANGE:
++ if (core->safe_parent)
++ core->ops->set_parent(core->hw, core->safe_parent_index);
++ core->old_rate = core->rate;
++ break;
++ case POST_RATE_CHANGE:
++ if (core->safe_parent) {
++ old_parent = __clk_set_parent_before(core,
++ core->new_parent);
++ if (core->ops->set_rate_and_parent) {
++ core->ops->set_rate_and_parent(core->hw,
++ core->new_rate,
++ core->new_parent ?
++ core->new_parent->rate : 0,
++ core->new_parent_index);
++ } else if (core->ops->set_parent) {
++ core->ops->set_parent(core->hw,
++ core->new_parent_index);
++ }
++ __clk_set_parent_after(core, core->new_parent,
++ old_parent);
++ }
++ break;
++ }
++
+ if (core->notifier_count) {
+- ret = __clk_notify(core, event, core->rate, core->new_rate);
+- if (ret & NOTIFY_STOP_MASK)
++ if (event != POST_RATE_CHANGE || core->old_rate != core->rate)
++ ret = __clk_notify(core, event, core->old_rate,
++ core->new_rate);
++ if (ret & NOTIFY_STOP_MASK && event != POST_RATE_CHANGE)
+ fail_clk = core;
+ }
+
+@@ -1446,7 +1491,8 @@ clk_change_rate(struct clk_core *core, unsigned long best_parent_rate)
+
+ old_rate = core->rate;
+
+- if (core->new_parent && core->new_parent != core->parent) {
++ if (core->new_parent && core->new_parent != core->parent &&
++ !core->safe_parent) {
+ old_parent = __clk_set_parent_before(core, core->new_parent);
+ trace_clk_set_parent(core, core->new_parent);
+
+@@ -1472,9 +1518,6 @@ clk_change_rate(struct clk_core *core, unsigned long best_parent_rate)
+
+ core->rate = core->new_rate;
+
+- if (core->notifier_count && old_rate != core->rate)
+- __clk_notify(core, POST_RATE_CHANGE, old_rate, core->rate);
+-
+ if (core->flags & CLK_RECALC_NEW_RATES)
+ (void)clk_calc_new_rates(core, core->new_rate);
+
+@@ -1537,6 +1580,8 @@ static int clk_core_set_rate_nolock(struct clk_core *core,
+
+ core->req_rate = req_rate;
+
++ clk_propagate_rate_change(top, POST_RATE_CHANGE);
++
+ return ret;
+ }
+
+diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
+index b6b17b5..5d49262 100644
+--- a/include/linux/clk-provider.h
++++ b/include/linux/clk-provider.h
+@@ -202,6 +202,7 @@ struct clk_ops {
+ struct clk_rate_request *req);
+ int (*set_parent)(struct clk_hw *hw, u8 index);
+ u8 (*get_parent)(struct clk_hw *hw);
++ struct clk_hw *(*get_safe_parent)(struct clk_hw *hw);
+ int (*set_rate)(struct clk_hw *hw, unsigned long rate,
+ unsigned long parent_rate);
+ int (*set_rate_and_parent)(struct clk_hw *hw,
+--
+2.7.2
+
diff --git a/target/linux/ipq806x/patches-4.1/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch b/target/linux/ipq806x/patches-4.4/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch
index 6fad6e8a0c..a1b1f4b1f7 100644
--- a/target/linux/ipq806x/patches-4.1/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch
+++ b/target/linux/ipq806x/patches-4.4/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch
@@ -28,14 +28,14 @@ I'd really like to get rid of __clk_hfpll_init_once() if possible...
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
-@@ -8,6 +8,7 @@ clk-qcom-y += clk-rcg2.o
+@@ -8,6 +8,7 @@
clk-qcom-y += clk-branch.o
clk-qcom-y += clk-regmap-divider.o
clk-qcom-y += clk-regmap-mux.o
+clk-qcom-y += clk-hfpll.o
clk-qcom-y += reset.o
+ clk-qcom-$(CONFIG_QCOM_GDSC) += gdsc.o
- obj-$(CONFIG_APQ_GCC_8084) += gcc-apq8084.o
--- /dev/null
+++ b/drivers/clk/qcom/clk-hfpll.c
@@ -0,0 +1,253 @@
@@ -86,7 +86,7 @@ I'd really like to get rid of __clk_hfpll_init_once() if possible...
+ u32 regval = hd->user_val;
+ unsigned long rate;
+
-+ rate = __clk_get_rate(hw->clk);
++ rate = clk_hw_get_rate(hw->clk);
+
+ /* Pick the right VCO. */
+ if (hd->user_vco_mask && rate > hd->low_vco_max_rate)
diff --git a/target/linux/ipq806x/patches-4.1/138-clk-qcom-Add-HFPLL-driver.patch b/target/linux/ipq806x/patches-4.4/138-clk-qcom-Add-HFPLL-driver.patch
index 4056784287..5a452dbcbc 100644
--- a/target/linux/ipq806x/patches-4.1/138-clk-qcom-Add-HFPLL-driver.patch
+++ b/target/linux/ipq806x/patches-4.4/138-clk-qcom-Add-HFPLL-driver.patch
@@ -73,7 +73,7 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+ };
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
-@@ -97,3 +97,11 @@ config MSM_MMCC_8974
+@@ -106,3 +106,11 @@
Support for the multimedia clock controller on msm8974 devices.
Say Y if you want to support multimedia devices such as display,
graphics, video encode/decode, camera, etc.
@@ -87,7 +87,7 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+ such as MSM8974, APQ8084, etc.
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
-@@ -22,3 +22,4 @@ obj-$(CONFIG_MSM_LCC_8960) += lcc-msm896
+@@ -23,3 +23,4 @@
obj-$(CONFIG_MSM_GCC_8974) += gcc-msm8974.o
obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8960.o
obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
diff --git a/target/linux/ipq806x/patches-4.1/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch b/target/linux/ipq806x/patches-4.4/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch
index ffcd462d12..5b191b5597 100644
--- a/target/linux/ipq806x/patches-4.1/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch
+++ b/target/linux/ipq806x/patches-4.4/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch
@@ -29,7 +29,7 @@ drivers/clk/qcom/gcc-ipq806x.c | 83 ++++++++++++++++++++++++++++++++++++++++++
#include "reset.h"
static struct clk_pll pll0 = {
-@@ -113,6 +114,85 @@ static struct clk_regmap pll8_vote = {
+@@ -113,6 +114,85 @@
},
};
@@ -100,8 +100,8 @@ drivers/clk/qcom/gcc-ipq806x.c | 83 ++++++++++++++++++++++++++++++++++++++++++
+};
+
+static struct clk_hfpll hfpll_l2 = {
-+ .d = &hfpll_l2_data,
-+ .clkr.hw.init = &(struct clk_init_data){
++ .d = &hfpll_l2_data,
++ .clkr.hw.init = &(struct clk_init_data){
+ .parent_names = (const char *[]){ "pxo" },
+ .num_parents = 1,
+ .name = "hfpll_l2",
@@ -115,10 +115,10 @@ drivers/clk/qcom/gcc-ipq806x.c | 83 ++++++++++++++++++++++++++++++++++++++++++
static struct clk_pll pll14 = {
.l_reg = 0x31c4,
.m_reg = 0x31c8,
-@@ -2307,6 +2387,9 @@ static struct clk_regmap *gcc_ipq806x_cl
- [USB_FS1_SYSTEM_CLK] = &usb_fs1_sys_clk.clkr,
- [EBI2_CLK] = &ebi2_clk.clkr,
- [EBI2_AON_CLK] = &ebi2_aon_clk.clkr,
+@@ -2837,6 +2917,9 @@
+ [UBI32_CORE2_CLK_SRC] = &ubi32_core2_src_clk.clkr,
+ [NSSTCM_CLK_SRC] = &nss_tcm_src.clkr,
+ [NSSTCM_CLK] = &nss_tcm_clk.clkr,
+ [PLL9] = &hfpll0.clkr,
+ [PLL10] = &hfpll1.clkr,
+ [PLL12] = &hfpll_l2.clkr,
diff --git a/target/linux/ipq806x/patches-4.1/140-clk-qcom-Add-support-for-Krait-clocks.patch b/target/linux/ipq806x/patches-4.4/140-clk-qcom-Add-support-for-Krait-clocks.patch
index 5fcc787c89..522482d841 100644
--- a/target/linux/ipq806x/patches-4.1/140-clk-qcom-Add-support-for-Krait-clocks.patch
+++ b/target/linux/ipq806x/patches-4.4/140-clk-qcom-Add-support-for-Krait-clocks.patch
@@ -30,7 +30,7 @@ drivers/clk/qcom/Kconfig | 4 ++
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
-@@ -105,3 +105,7 @@ config QCOM_HFPLL
+@@ -114,3 +114,7 @@
Support for the high-frequency PLLs present on Qualcomm devices.
Say Y if you want to support CPU frequency scaling on devices
such as MSM8974, APQ8084, etc.
@@ -40,13 +40,14 @@ drivers/clk/qcom/Kconfig | 4 ++
+ select KRAIT_L2_ACCESSORS
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
-@@ -8,6 +8,7 @@ clk-qcom-y += clk-rcg2.o
+@@ -8,6 +8,7 @@
clk-qcom-y += clk-branch.o
clk-qcom-y += clk-regmap-divider.o
clk-qcom-y += clk-regmap-mux.o
+clk-qcom-$(CONFIG_KRAIT_CLOCKS) += clk-krait.o
clk-qcom-y += clk-hfpll.o
clk-qcom-y += reset.o
+ clk-qcom-$(CONFIG_QCOM_GDSC) += gdsc.o
--- /dev/null
+++ b/drivers/clk/qcom/clk-krait.c
@@ -132,14 +133,14 @@ drivers/clk/qcom/Kconfig | 4 ++
+{
+ int i;
+ struct krait_mux_clk *mux = to_krait_mux_clk(hw);
-+ int num_parents = __clk_get_num_parents(hw->clk);
++ int num_parents = clk_hw_get_num_parents(hw->clk);
+
+ i = mux->safe_sel;
+ for (i = 0; i < num_parents; i++)
+ if (mux->safe_sel == mux->parent_map[i])
+ break;
+
-+ return __clk_get_hw(clk_get_parent_by_index(hw->clk, i));
++ return __clk_get_hw(clk_hw_get_parent_by_index(hw->clk, i));
+}
+
+static int krait_mux_enable(struct clk_hw *hw)
@@ -172,7 +173,7 @@ drivers/clk/qcom/Kconfig | 4 ++
+static long krait_div2_round_rate(struct clk_hw *hw, unsigned long rate,
+ unsigned long *parent_rate)
+{
-+ *parent_rate = __clk_round_rate(__clk_get_parent(hw->clk), rate * 2);
++ *parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw->clk), rate * 2);
+ return DIV_ROUND_UP(*parent_rate, 2);
+}
+
diff --git a/target/linux/ipq806x/patches-4.1/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch b/target/linux/ipq806x/patches-4.4/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch
index db4388812b..b2ddbc8a68 100644
--- a/target/linux/ipq806x/patches-4.1/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch
+++ b/target/linux/ipq806x/patches-4.4/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch
@@ -31,7 +31,7 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
--- a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
+++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
-@@ -21,10 +21,17 @@ PROPERTIES
+@@ -21,10 +21,17 @@
the register region. An optional second element specifies
the base address and size of the alias register region.
@@ -82,7 +82,7 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+ };
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
-@@ -106,6 +106,14 @@ config QCOM_HFPLL
+@@ -115,6 +115,14 @@
Say Y if you want to support CPU frequency scaling on devices
such as MSM8974, APQ8084, etc.
@@ -99,12 +99,14 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
select KRAIT_L2_ACCESSORS
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
-@@ -23,4 +23,5 @@ obj-$(CONFIG_MSM_LCC_8960) += lcc-msm896
- obj-$(CONFIG_MSM_GCC_8974) += gcc-msm8974.o
- obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8960.o
- obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
+@@ -9,6 +9,7 @@
+ clk-qcom-y += clk-regmap-divider.o
+ clk-qcom-y += clk-regmap-mux.o
+ clk-qcom-$(CONFIG_KRAIT_CLOCKS) += clk-krait.o
+obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o
- obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
+ clk-qcom-y += clk-hfpll.o
+ clk-qcom-y += reset.o
+ clk-qcom-$(CONFIG_QCOM_GDSC) += gdsc.o
--- /dev/null
+++ b/drivers/clk/qcom/kpss-xcc.c
@@ -0,0 +1,95 @@
diff --git a/target/linux/ipq806x/patches-4.1/142-clk-qcom-Add-Krait-clock-controller-driver.patch b/target/linux/ipq806x/patches-4.4/142-clk-qcom-Add-Krait-clock-controller-driver.patch
index 59fc44f1cb..f0e946781b 100644
--- a/target/linux/ipq806x/patches-4.1/142-clk-qcom-Add-Krait-clock-controller-driver.patch
+++ b/target/linux/ipq806x/patches-4.4/142-clk-qcom-Add-Krait-clock-controller-driver.patch
@@ -56,7 +56,7 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+ };
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
-@@ -114,6 +114,14 @@ config KPSS_XCC
+@@ -123,6 +123,14 @@
if you want to support CPU frequency scaling on devices such
as MSM8960, APQ8064, etc.
@@ -73,9 +73,9 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
select KRAIT_L2_ACCESSORS
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
-@@ -25,3 +25,4 @@ obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8
+@@ -26,3 +26,4 @@
+ obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8960.o
obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
- obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o
obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
+obj-$(CONFIG_KRAITCC) += krait-cc.o
--- /dev/null
diff --git a/target/linux/ipq806x/patches-4.1/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch b/target/linux/ipq806x/patches-4.4/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch
index fd37c05425..d4c43f412a 100644
--- a/target/linux/ipq806x/patches-4.1/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch
+++ b/target/linux/ipq806x/patches-4.4/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch
@@ -69,7 +69,7 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+ };
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
-@@ -146,6 +146,15 @@ config ARM_OMAP2PLUS_CPUFREQ
+@@ -95,6 +95,15 @@
depends on ARCH_OMAP2PLUS
default ARCH_OMAP2PLUS
@@ -87,11 +87,11 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
help
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
-@@ -66,6 +66,7 @@ obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ) += ki
+@@ -61,6 +61,7 @@
obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ) += omap-cpufreq.o
obj-$(CONFIG_ARM_PXA2xx_CPUFREQ) += pxa2xx-cpufreq.o
obj-$(CONFIG_PXA3xx) += pxa3xx-cpufreq.o
-+obj-$(CONFIG_ARM_QCOM_CPUFREQ) += qcom-cpufreq.o
++obj-$(CONFIG_ARM_QCOM_CPUFREQ) += qcom-cpufreq.o
obj-$(CONFIG_ARM_S3C24XX_CPUFREQ) += s3c24xx-cpufreq.o
obj-$(CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS) += s3c24xx-cpufreq-debugfs.o
obj-$(CONFIG_ARM_S3C2410_CPUFREQ) += s3c2410-cpufreq.o
diff --git a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch b/target/linux/ipq806x/patches-4.4/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
index aaf140126c..aaf140126c 100644
--- a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
+++ b/target/linux/ipq806x/patches-4.4/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
diff --git a/target/linux/ipq806x/patches-4.1/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch b/target/linux/ipq806x/patches-4.4/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch
index 84f856bbf6..f33c9e0d8c 100644
--- a/target/linux/ipq806x/patches-4.1/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch
+++ b/target/linux/ipq806x/patches-4.4/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch
@@ -21,7 +21,7 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
-@@ -198,6 +198,19 @@ config CPUFREQ_DT
+@@ -198,6 +198,19 @@
If in doubt, say N.
@@ -43,11 +43,11 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
endif
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
-@@ -14,6 +14,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE)
+@@ -13,6 +13,7 @@
obj-$(CONFIG_CPU_FREQ_GOV_COMMON) += cpufreq_governor.o
obj-$(CONFIG_CPUFREQ_DT) += cpufreq-dt.o
-+obj-$(CONFIG_GENERIC_CPUFREQ_KRAIT) += cpufreq-krait.o
++obj-$(CONFIG_GENERIC_CPUFREQ_KRAIT) += cpufreq-krait.o
##################################################################################
# x86 drivers.
@@ -446,7 +446,7 @@ Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+MODULE_LICENSE("GPL v2");
--- a/drivers/cpufreq/qcom-cpufreq.c
+++ b/drivers/cpufreq/qcom-cpufreq.c
-@@ -168,11 +168,8 @@ static int __init qcom_cpufreq_populate_
+@@ -168,11 +168,8 @@
static int __init qcom_cpufreq_driver_init(void)
{
diff --git a/target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch b/target/linux/ipq806x/patches-4.4/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
index 4f5c0efb7b..4f5c0efb7b 100644
--- a/target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
+++ b/target/linux/ipq806x/patches-4.4/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
diff --git a/target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch b/target/linux/ipq806x/patches-4.4/156-dmaengine-Add-ADM-driver.patch
index 29e8eaaec4..805f28f323 100644
--- a/target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch
+++ b/target/linux/ipq806x/patches-4.4/156-dmaengine-Add-ADM-driver.patch
@@ -35,9 +35,9 @@ drivers/dma/Kconfig | 10 +
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
-@@ -492,4 +492,14 @@ config QCOM_BAM_DMA
- Enable support for the QCOM BAM DMA controller. This controller
- provides DMA capabilities for a variety of on-chip devices.
+@@ -558,4 +558,14 @@
+ config DMA_ENGINE_RAID
+ bool
+config QCOM_ADM
+ tristate "Qualcomm ADM support"
@@ -955,8 +955,10 @@ drivers/dma/Kconfig | 10 +
+MODULE_LICENSE("GPL v2");
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
-@@ -54,3 +54,4 @@ obj-$(CONFIG_NBPFAXI_DMA) += nbpfaxi.o
- obj-$(CONFIG_DMA_SUN6I) += sun6i-dma.o
- obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o
+@@ -65,5 +65,6 @@
+ obj-$(CONFIG_TI_EDMA) += edma.o
obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
+ obj-$(CONFIG_ZX_DMA) += zx296702_dma.o
+obj-$(CONFIG_QCOM_ADM) += qcom_adm.o
+
+ obj-y += xilinx/
diff --git a/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-4.4/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
index 6f1013e32e..b8abd0a4b2 100644
--- a/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
+++ b/target/linux/ipq806x/patches-4.4/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -13,7 +13,7 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -643,6 +643,26 @@
+@@ -727,6 +727,26 @@
status = "disabled";
};
diff --git a/target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch b/target/linux/ipq806x/patches-4.4/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
index 088b8cb5a1..21fe405b90 100644
--- a/target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
+++ b/target/linux/ipq806x/patches-4.4/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
@@ -38,7 +38,7 @@ drivers/mtd/nand/nand_base.c | 6 +++++-
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -395,7 +395,11 @@ static int nand_default_block_markbad(st
+@@ -394,7 +394,11 @@
} else {
ops.len = ops.ooblen = 1;
}
@@ -53,7 +53,7 @@ drivers/mtd/nand/nand_base.c | 6 +++++-
if (chip->bbt_options & NAND_BBT_SCANLASTPAGE)
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
-@@ -423,7 +423,11 @@ static int scan_block_fast(struct mtd_in
+@@ -420,7 +420,11 @@
ops.oobbuf = buf;
ops.ooboffs = 0;
ops.datbuf = NULL;
@@ -68,7 +68,7 @@ drivers/mtd/nand/nand_base.c | 6 +++++-
/*
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
-@@ -116,6 +116,13 @@ struct nand_bbt_descr {
+@@ -116,6 +116,12 @@
#define NAND_BBT_NO_OOB_BBM 0x00080000
/*
@@ -76,8 +76,7 @@ drivers/mtd/nand/nand_base.c | 6 +++++-
+ * be used by controllers which can access BBM only when ECC is disabled, i.e,
+ * when in RAW access mode
+ */
-+#define NAND_BBT_ACCESS_BBM_RAW 0x00100000
-+
++#define NAND_BBT_ACCESS_BBM_RAW 0x00100000
+/*
* Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr
* was allocated dynamicaly and must be freed in nand_release(). Has no meaning
diff --git a/target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch b/target/linux/ipq806x/patches-4.4/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
index 4be7ecb1b9..19e5f91812 100644
--- a/target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
+++ b/target/linux/ipq806x/patches-4.4/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
@@ -80,7 +80,7 @@ drivers/mtd/nand/Kconfig | 7 +
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
-@@ -530,4 +530,11 @@ config MTD_NAND_HISI504
+@@ -546,4 +546,11 @@
help
Enables support for NAND controller on Hisilicon SoC Hip04.
@@ -2015,10 +2015,10 @@ drivers/mtd/nand/Kconfig | 7 +
+MODULE_LICENSE("GPL v2");
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
-@@ -52,5 +52,6 @@ obj-$(CONFIG_MTD_NAND_XWAY) += xway_nan
- obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH) += bcm47xxnflash/
+@@ -55,5 +55,6 @@
obj-$(CONFIG_MTD_NAND_SUNXI) += sunxi_nand.o
obj-$(CONFIG_MTD_NAND_HISI504) += hisi504_nand.o
-+obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nandc.o
+ obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcmnand/
++obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nandc.o
nand-objs := nand_base.o nand_bbt.o nand_timings.o
diff --git a/target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch b/target/linux/ipq806x/patches-4.4/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
index 6530eb1c86..6530eb1c86 100644
--- a/target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
+++ b/target/linux/ipq806x/patches-4.4/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
diff --git a/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch b/target/linux/ipq806x/patches-4.4/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
index 6bdd5e05cc..4fc8a8ce90 100644
--- a/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
+++ b/target/linux/ipq806x/patches-4.4/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
@@ -26,7 +26,7 @@ arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -663,6 +663,22 @@
+@@ -747,6 +747,22 @@
status = "disabled";
};
diff --git a/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch b/target/linux/ipq806x/patches-4.4/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
index da1ec46c4e..9de3d8fe81 100644
--- a/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
+++ b/target/linux/ipq806x/patches-4.4/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
@@ -54,7 +54,7 @@ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
};
gsbi@16300000 {
-@@ -101,5 +123,19 @@
+@@ -126,5 +148,19 @@
status = "ok";
phy-tx0-term-offset = <7>;
};
diff --git a/target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch b/target/linux/ipq806x/patches-4.4/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
index 9005de4eb5..706028259d 100644
--- a/target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
+++ b/target/linux/ipq806x/patches-4.4/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
@@ -1,6 +1,6 @@
--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -132,6 +132,8 @@
+@@ -157,6 +157,8 @@
nand-ecc-strength = <4>;
nand-bus-width = <8>;
diff --git a/target/linux/ipq806x/patches-4.4/167-ARM-qcom_rpm_fix_support_for_smb208.patch b/target/linux/ipq806x/patches-4.4/167-ARM-qcom_rpm_fix_support_for_smb208.patch
new file mode 100644
index 0000000000..8da70340de
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/167-ARM-qcom_rpm_fix_support_for_smb208.patch
@@ -0,0 +1,50 @@
+
+In commit "regulator: qcom: Rework to single platform device" the smb208 regulator
+used in IPQ8064 was left out.
+
+Add it to that new framework and update Docs accordingly.
+
+Signed-off-by: Adrian Panella <ianchi74@outlook.com>
+
+--- a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
++++ b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
+@@ -59,6 +59,7 @@ Regulator nodes are identified by their
+ "qcom,rpm-pm8058-regulators"
+ "qcom,rpm-pm8901-regulators"
+ "qcom,rpm-pm8921-regulators"
++ "qcom,rpm-smb208-regulators"
+
+ - vdd_l0_l1_lvs-supply:
+ - vdd_l2_l11_l12-supply:
+@@ -156,6 +157,9 @@ pm8921:
+ l29, lvs1, lvs2, lvs3, lvs4, lvs5, lvs6, lvs7, usb-switch, hdmi-switch,
+ ncp
+
++smb208:
++ s1a, s1b, s2a, s2b
++
+ The content of each sub-node is defined by the standard binding for regulators -
+ see regulator.txt - with additional custom properties described below:
+
+--- a/drivers/regulator/qcom_rpm-regulator.c
++++ b/drivers/regulator/qcom_rpm-regulator.c
+@@ -869,10 +869,19 @@ static const struct rpm_regulator_data r
+ { }
+ };
+
++static const struct rpm_regulator_data rpm_smb208_regulators[] = {
++ { "s1a", QCOM_RPM_SMB208_S1a, &smb208_smps, "vin_s1a" },
++ { "s1b", QCOM_RPM_SMB208_S1b, &smb208_smps, "vin_s1b" },
++ { "s2a", QCOM_RPM_SMB208_S2a, &smb208_smps, "vin_s2a" },
++ { "s2b", QCOM_RPM_SMB208_S2b, &smb208_smps, "vin_s2b" },
++ { }
++};
++
+ static const struct of_device_id rpm_of_match[] = {
+ { .compatible = "qcom,rpm-pm8058-regulators", .data = &rpm_pm8058_regulators },
+ { .compatible = "qcom,rpm-pm8901-regulators", .data = &rpm_pm8901_regulators },
+ { .compatible = "qcom,rpm-pm8921-regulators", .data = &rpm_pm8921_regulators },
++ { .compatible = "qcom,rpm-smb208-regulators", .data = &rpm_smb208_regulators },
+ { }
+ };
+ MODULE_DEVICE_TABLE(of, rpm_of_match);
diff --git a/target/linux/ipq806x/patches-4.4/168-ARM-qcom-add-smb208-DT.patch b/target/linux/ipq806x/patches-4.4/168-ARM-qcom-add-smb208-DT.patch
new file mode 100644
index 0000000000..ef81ed2e55
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/168-ARM-qcom-add-smb208-DT.patch
@@ -0,0 +1,143 @@
+Change DT to use new smb208 regulator driver.
+
+Signed-off-by: Adrian Panella <ianchi74@outlook.com>
+
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -167,45 +167,37 @@
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+- smb208_s1a: smb208-s1a {
+- compatible = "qcom,rpm-smb208";
+- reg = <QCOM_RPM_SMB208_S1a>;
+-
+- regulator-min-microvolt = <1050000>;
+- regulator-max-microvolt = <1150000>;
++ regulators {
++ compatible = "qcom,rpm-smb208-regulators";
+
+- qcom,switch-mode-frequency = <1200000>;
+-
+- };
++ smb208_s1a: s1a {
++ regulator-min-microvolt = <1050000>;
++ regulator-max-microvolt = <1150000>;
+
+- smb208_s1b: smb208-s1b {
+- compatible = "qcom,rpm-smb208";
+- reg = <QCOM_RPM_SMB208_S1b>;
++ qcom,switch-mode-frequency = <1200000>;
+
+- regulator-min-microvolt = <1050000>;
+- regulator-max-microvolt = <1150000>;
+-
+- qcom,switch-mode-frequency = <1200000>;
+- };
++ };
+
+- smb208_s2a: smb208-s2a {
+- compatible = "qcom,rpm-smb208";
+- reg = <QCOM_RPM_SMB208_S2a>;
++ smb208_s1b: s1b {
++ regulator-min-microvolt = <1050000>;
++ regulator-max-microvolt = <1150000>;
+
+- regulator-min-microvolt = < 800000>;
+- regulator-max-microvolt = <1250000>;
++ qcom,switch-mode-frequency = <1200000>;
++ };
+
+- qcom,switch-mode-frequency = <1200000>;
+- };
++ smb208_s2a: s2a {
++ regulator-min-microvolt = < 800000>;
++ regulator-max-microvolt = <1250000>;
+
+- smb208_s2b: smb208-s2b {
+- compatible = "qcom,rpm-smb208";
+- reg = <QCOM_RPM_SMB208_S2b>;
++ qcom,switch-mode-frequency = <1200000>;
++ };
+
+- regulator-min-microvolt = < 800000>;
+- regulator-max-microvolt = <1250000>;
++ smb208_s2b: s2b {
++ regulator-min-microvolt = < 800000>;
++ regulator-max-microvolt = <1250000>;
+
+- qcom,switch-mode-frequency = <1200000>;
++ qcom,switch-mode-frequency = <1200000>;
++ };
+ };
+ };
+
+--- a/arch/arm/boot/dts/qcom-ipq8065.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8065.dtsi
+@@ -311,45 +311,37 @@
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+- smb208_s1a: smb208-s1a {
+- compatible = "qcom,rpm-smb208";
+- reg = <QCOM_RPM_SMB208_S1a>;
+-
+- regulator-min-microvolt = <1050000>;
+- regulator-max-microvolt = <1150000>;
++ regulators {
++ compatible = "qcom,rpm-smb208-regulators";
+
+- qcom,switch-mode-frequency = <1200000>;
+-
+- };
++ smb208_s1a: s1a {
++ regulator-min-microvolt = <1050000>;
++ regulator-max-microvolt = <1150000>;
+
+- smb208_s1b: smb208-s1b {
+- compatible = "qcom,rpm-smb208";
+- reg = <QCOM_RPM_SMB208_S1b>;
++ qcom,switch-mode-frequency = <1200000>;
+
+- regulator-min-microvolt = <1050000>;
+- regulator-max-microvolt = <1150000>;
+-
+- qcom,switch-mode-frequency = <1200000>;
+- };
++ };
+
+- smb208_s2a: smb208-s2a {
+- compatible = "qcom,rpm-smb208";
+- reg = <QCOM_RPM_SMB208_S2a>;
++ smb208_s1b: s1b {
++ regulator-min-microvolt = <1050000>;
++ regulator-max-microvolt = <1150000>;
+
+- regulator-min-microvolt = < 800000>;
+- regulator-max-microvolt = <1275000>;
++ qcom,switch-mode-frequency = <1200000>;
++ };
+
+- qcom,switch-mode-frequency = <1400000>;
+- };
++ smb208_s2a: s2a {
++ regulator-min-microvolt = < 800000>;
++ regulator-max-microvolt = <1275000>;
+
+- smb208_s2b: smb208-s2b {
+- compatible = "qcom,rpm-smb208";
+- reg = <QCOM_RPM_SMB208_S2b>;
++ qcom,switch-mode-frequency = <1400000>;
++ };
+
+- regulator-min-microvolt = < 800000>;
+- regulator-max-microvolt = <1275000>;
++ smb208_s2b: s2b {
++ regulator-min-microvolt = < 800000>;
++ regulator-max-microvolt = <1275000>;
+
+- qcom,switch-mode-frequency = <1400000>;
++ qcom,switch-mode-frequency = <1400000>;
++ };
+ };
+ };
diff --git a/target/linux/ipq806x/patches-4.1/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch b/target/linux/ipq806x/patches-4.4/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
index 18b7a80b12..c0281ff070 100644
--- a/target/linux/ipq806x/patches-4.1/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
+++ b/target/linux/ipq806x/patches-4.4/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
@@ -33,7 +33,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -320,7 +320,7 @@ config ARCH_MULTIPLATFORM
+@@ -323,7 +323,7 @@
select ARCH_WANT_OPTIONAL_GPIOLIB
select ARM_HAS_SG_CHAIN
select ARM_PATCH_PHYS_VIRT
@@ -44,7 +44,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
select GENERIC_CLOCKEVENTS
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
-@@ -248,9 +248,11 @@ MACHINE := arch/arm/mach-$(word 1,$(mac
+@@ -256,9 +256,11 @@
else
MACHINE :=
endif
diff --git a/target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch b/target/linux/ipq806x/patches-4.4/302-mtd-qcom-smem-rename-rootfs-ubi.patch
index 471a87ba68..8890a91731 100644
--- a/target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch
+++ b/target/linux/ipq806x/patches-4.4/302-mtd-qcom-smem-rename-rootfs-ubi.patch
@@ -1,6 +1,6 @@
--- a/drivers/mtd/qcom_smem_part.c
+++ b/drivers/mtd/qcom_smem_part.c
-@@ -192,6 +192,10 @@ static int parse_qcom_smem_partitions(st
+@@ -189,6 +189,10 @@ static int parse_qcom_smem_partitions(st
m_part->size = le32_to_cpu(s_part->size) * (*smem_blksz);
m_part->offset = le32_to_cpu(s_part->start) * (*smem_blksz);
diff --git a/target/linux/ipq806x/patches-4.4/400-dsa-add-qca.patch b/target/linux/ipq806x/patches-4.4/400-dsa-add-qca.patch
new file mode 100644
index 0000000000..f1bdf1aa6f
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/400-dsa-add-qca.patch
@@ -0,0 +1,1521 @@
+From patchwork Fri May 29 01:42:16 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [1/7] net: dsa: add new driver for ar8xxx family
+From: Mathieu Olivari <mathieu@codeaurora.org>
+X-Patchwork-Id: 477523
+X-Patchwork-Delegate: davem@davemloft.net
+Message-Id: <1432863742-18427-2-git-send-email-mathieu@codeaurora.org>
+To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
+ ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
+ davem@davemloft.net, mathieu@codeaurora.org, andrew@lunn.ch,
+ f.fainelli@gmail.com, linux@roeck-us.net, gang.chen.5i5j@gmail.com,
+ jiri@resnulli.us, leitec@staticky.com, fabf@skynet.be,
+ alexander.h.duyck@intel.com, pavel.nakonechny@skitlab.ru,
+ joe@perches.com, sfeldma@gmail.com, nbd@openwrt.org, juhosg@openwrt.org
+Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
+ netdev@vger.kernel.org
+Date: Thu, 28 May 2015 18:42:16 -0700
+
+This patch contains initial init & registration code for QCA8337. It
+will detect a QCA8337 switch, if present and declared in DT/platform.
+
+Each port will be represented through a standalone net_device interface,
+as for other DSA switches. CPU can communicate with any of the ports by
+setting an IP@ on ethN interface. Ports cannot communicate with each
+other just yet.
+
+Link status will be reported through polling, and we don't use any
+encapsulation.
+
+Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+---
+ drivers/net/dsa/Kconfig | 7 ++
+ drivers/net/dsa/Makefile | 1 +
+ drivers/net/dsa/ar8xxx.c | 303 +++++++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/dsa/ar8xxx.h | 82 +++++++++++++
+ net/dsa/dsa.c | 1 +
+ 5 files changed, 394 insertions(+)
+ create mode 100644 drivers/net/dsa/ar8xxx.c
+ create mode 100644 drivers/net/dsa/ar8xxx.h
+
+diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
+index 7ad0a4d..2aae541 100644
+--- a/drivers/net/dsa/Kconfig
++++ b/drivers/net/dsa/Kconfig
+@@ -65,4 +65,11 @@ config NET_DSA_BCM_SF2
+ This enables support for the Broadcom Starfighter 2 Ethernet
+ switch chips.
+
++config NET_DSA_AR8XXX
++ tristate "Qualcomm Atheros AR8XXX Ethernet switch family support"
++ depends on NET_DSA
++ ---help---
++ This enables support for the Qualcomm Atheros AR8XXX Ethernet
++ switch chips.
++
+ endmenu
+diff --git a/drivers/net/dsa/Makefile b/drivers/net/dsa/Makefile
+index e2d51c4..7647687 100644
+--- a/drivers/net/dsa/Makefile
++++ b/drivers/net/dsa/Makefile
+@@ -14,3 +14,4 @@ ifdef CONFIG_NET_DSA_MV88E6171
+ mv88e6xxx_drv-y += mv88e6171.o
+ endif
+ obj-$(CONFIG_NET_DSA_BCM_SF2) += bcm_sf2.o
++obj-$(CONFIG_NET_DSA_AR8XXX) += ar8xxx.o
+diff --git a/drivers/net/dsa/ar8xxx.c b/drivers/net/dsa/ar8xxx.c
+new file mode 100644
+index 0000000..4ce3ffc
+--- /dev/null
++++ b/drivers/net/dsa/ar8xxx.c
+@@ -0,0 +1,303 @@
++/*
++ * Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
++ * Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/module.h>
++#include <linux/phy.h>
++#include <linux/netdevice.h>
++#include <net/dsa.h>
++#include <linux/phy.h>
++#include <linux/of_net.h>
++
++#include "ar8xxx.h"
++
++u32
++ar8xxx_mii_read32(struct mii_bus *bus, int phy_id, int regnum)
++{
++ u16 lo, hi;
++
++ lo = bus->read(bus, phy_id, regnum);
++ hi = bus->read(bus, phy_id, regnum + 1);
++
++ return (hi << 16) | lo;
++}
++
++void
++ar8xxx_mii_write32(struct mii_bus *bus, int phy_id, int regnum, u32 val)
++{
++ u16 lo, hi;
++
++ lo = val & 0xffff;
++ hi = (u16)(val >> 16);
++
++ bus->write(bus, phy_id, regnum, lo);
++ bus->write(bus, phy_id, regnum + 1, hi);
++}
++
++u32 ar8xxx_read(struct dsa_switch *ds, int reg)
++{
++ struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev);
++ u16 r1, r2, page;
++ u32 val;
++
++ split_addr((u32)reg, &r1, &r2, &page);
++
++ mutex_lock(&bus->mdio_lock);
++
++ bus->write(bus, 0x18, 0, page);
++ wait_for_page_switch();
++ val = ar8xxx_mii_read32(bus, 0x10 | r2, r1);
++
++ mutex_unlock(&bus->mdio_lock);
++
++ return val;
++}
++
++void ar8xxx_write(struct dsa_switch *ds, int reg, u32 val)
++{
++ struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev);
++ u16 r1, r2, page;
++
++ split_addr((u32)reg, &r1, &r2, &page);
++
++ mutex_lock(&bus->mdio_lock);
++
++ bus->write(bus, 0x18, 0, page);
++ wait_for_page_switch();
++ ar8xxx_mii_write32(bus, 0x10 | r2, r1, val);
++
++ mutex_unlock(&bus->mdio_lock);
++}
++
++u32
++ar8xxx_rmw(struct dsa_switch *ds, int reg, u32 mask, u32 val)
++{
++ struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev);
++ u16 r1, r2, page;
++ u32 ret;
++
++ split_addr((u32)reg, &r1, &r2, &page);
++
++ mutex_lock(&bus->mdio_lock);
++
++ bus->write(bus, 0x18, 0, page);
++ wait_for_page_switch();
++
++ ret = ar8xxx_mii_read32(bus, 0x10 | r2, r1);
++ ret &= ~mask;
++ ret |= val;
++ ar8xxx_mii_write32(bus, 0x10 | r2, r1, ret);
++
++ mutex_unlock(&bus->mdio_lock);
++
++ return ret;
++}
++
++static char *ar8xxx_probe(struct device *host_dev, int sw_addr)
++{
++ struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
++ u32 phy_id;
++
++ if (!bus)
++ return NULL;
++
++ /* sw_addr is irrelevant as the switch occupies the MDIO bus from
++ * addresses 0 to 4 (PHYs) and 16-23 (for MDIO 32bits protocol). So
++ * we'll probe address 0 to see if we see the right switch family.
++ */
++ phy_id = mdiobus_read(bus, 0, MII_PHYSID1) << 16;
++ phy_id |= mdiobus_read(bus, 0, MII_PHYSID2);
++
++ switch (phy_id) {
++ case PHY_ID_QCA8337:
++ return "QCA8337";
++ default:
++ return NULL;
++ }
++}
++
++static int ar8xxx_set_pad_ctrl(struct dsa_switch *ds, int port, int mode)
++{
++ int reg;
++
++ switch (port) {
++ case 0:
++ reg = AR8327_REG_PORT0_PAD_CTRL;
++ break;
++ case 6:
++ reg = AR8327_REG_PORT6_PAD_CTRL;
++ break;
++ default:
++ pr_err("Can't set PAD_CTRL on port %d\n", port);
++ return -EINVAL;
++ }
++
++ /* DSA only supports 1 CPU port for now, so we'll take the assumption
++ * that P0 is connected to the CPU master_dev.
++ */
++ switch (mode) {
++ case PHY_INTERFACE_MODE_RGMII:
++ ar8xxx_write(ds, reg,
++ AR8327_PORT_PAD_RGMII_EN |
++ AR8327_PORT_PAD_RGMII_TX_DELAY(3) |
++ AR8327_PORT_PAD_RGMII_RX_DELAY(3));
++
++ /* According to the datasheet, RGMII delay is enabled through
++ * PORT5_PAD_CTRL for all ports, rather than individual port
++ * registers
++ */
++ ar8xxx_write(ds, AR8327_REG_PORT5_PAD_CTRL,
++ AR8327_PORT_PAD_RGMII_RX_DELAY_EN);
++ break;
++ default:
++ pr_err("xMII mode %d not supported\n", mode);
++ return -EINVAL;
++ }
++
++ return 0;
++}
++
++static int ar8xxx_setup(struct dsa_switch *ds)
++{
++ struct net_device *netdev = ds->dst->pd->of_netdev;
++ int ret, i, phy_mode;
++
++ /* Initialize CPU port pad mode (xMII type, delays...) */
++ phy_mode = of_get_phy_mode(netdev->dev.parent->of_node);
++ if (phy_mode < 0) {
++ pr_err("Can't find phy-mode for master device\n");
++ return phy_mode;
++ }
++
++ ret = ar8xxx_set_pad_ctrl(ds, 0, phy_mode);
++ if (ret < 0)
++ return ret;
++
++ /* Disable forwarding by default on all ports */
++ for (i = 0; i < AR8327_NUM_PORTS; i++)
++ ar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(i),
++ AR8327_PORT_LOOKUP_MEMBER, 0);
++
++ /* Setup connection between CPU ports & PHYs */
++ for (i = 0; i < DSA_MAX_PORTS; i++) {
++ /* CPU port gets connected to all PHYs in the switch */
++ if (dsa_is_cpu_port(ds, i)) {
++ ar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(0),
++ AR8327_PORT_LOOKUP_MEMBER,
++ ds->phys_port_mask << 1);
++ }
++
++ /* Invividual PHYs gets connected to CPU port only */
++ if (ds->phys_port_mask & BIT(i)) {
++ ar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(phy_to_port(i)),
++ AR8327_PORT_LOOKUP_MEMBER, BIT(0));
++ }
++ }
++
++ return 0;
++}
++
++static int ar8xxx_set_addr(struct dsa_switch *ds, u8 *addr)
++{
++ return 0;
++}
++
++static int ar8xxx_phy_read(struct dsa_switch *ds, int phy, int regnum)
++{
++ struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev);
++
++ return mdiobus_read(bus, phy, regnum);
++}
++
++static int
++ar8xxx_phy_write(struct dsa_switch *ds, int phy, int regnum, u16 val)
++{
++ struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev);
++
++ return mdiobus_write(bus, phy, regnum, val);
++}
++
++static void ar8xxx_poll_link(struct dsa_switch *ds)
++{
++ int i = 0;
++ struct net_device *dev;
++
++ while ((dev = ds->ports[i++]) != NULL) {
++ u32 status;
++ int link;
++ int speed;
++ int duplex;
++
++ status = ar8xxx_read(ds, AR8327_REG_PORT_STATUS(i));
++ link = !!(status & AR8XXX_PORT_STATUS_LINK_UP);
++ duplex = !!(status & AR8XXX_PORT_STATUS_DUPLEX);
++
++ switch (status & AR8XXX_PORT_STATUS_SPEED) {
++ case AR8XXX_PORT_SPEED_10M:
++ speed = 10;
++ break;
++ case AR8XXX_PORT_SPEED_100M:
++ speed = 100;
++ break;
++ case AR8XXX_PORT_SPEED_1000M:
++ speed = 1000;
++ break;
++ default:
++ speed = 0;
++ }
++
++ if (!link) {
++ /* This poll happens every ~1s, so we don't want to
++ * print the status every time. Only when the device
++ * transitions from Link UP to Link DOWN
++ */
++ if (netif_carrier_ok(dev))
++ netif_carrier_off(dev);
++ continue;
++ } else {
++ /* Same thing here. But we detect a Link UP event */
++ if (!netif_carrier_ok(dev))
++ netif_carrier_on(dev);
++ continue;
++ }
++ }
++}
++
++static struct dsa_switch_driver ar8xxx_switch_driver = {
++ .tag_protocol = DSA_TAG_PROTO_NONE,
++ .probe = ar8xxx_probe,
++ .setup = ar8xxx_setup,
++ .set_addr = ar8xxx_set_addr,
++ .poll_link = ar8xxx_poll_link,
++ .phy_read = ar8xxx_phy_read,
++ .phy_write = ar8xxx_phy_write,
++};
++
++static int __init ar8xxx_init(void)
++{
++ register_switch_driver(&ar8xxx_switch_driver);
++ return 0;
++}
++module_init(ar8xxx_init);
++
++static void __exit ar8xxx_cleanup(void)
++{
++ unregister_switch_driver(&ar8xxx_switch_driver);
++}
++module_exit(ar8xxx_cleanup);
++
++MODULE_AUTHOR("Mathieu Olivari <mathieu@codeaurora.org>");
++MODULE_DESCRIPTION("Driver for AR8XXX ethernet switch family");
++MODULE_LICENSE("GPL");
++MODULE_ALIAS("platform:ar8xxx");
+diff --git a/drivers/net/dsa/ar8xxx.h b/drivers/net/dsa/ar8xxx.h
+new file mode 100644
+index 0000000..a29b6d3
+--- /dev/null
++++ b/drivers/net/dsa/ar8xxx.h
+@@ -0,0 +1,82 @@
++/*
++ * Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
++ * Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#ifndef __AR8XXX_H
++#define __AR8XXX_H
++
++#include <linux/delay.h>
++
++#define AR8327_NUM_PORTS 7
++
++#define PHY_ID_QCA8337 0x004dd036
++
++#define AR8327_REG_PORT0_PAD_CTRL 0x004
++#define AR8327_REG_PORT5_PAD_CTRL 0x008
++#define AR8327_REG_PORT6_PAD_CTRL 0x00c
++#define AR8327_PORT_PAD_RGMII_EN BIT(26)
++#define AR8327_PORT_PAD_RGMII_TX_DELAY(x) ((0x8 + (x & 0x3)) << 22)
++#define AR8327_PORT_PAD_RGMII_RX_DELAY(x) ((0x10 + (x & 0x3)) << 20)
++#define AR8327_PORT_PAD_RGMII_RX_DELAY_EN BIT(24)
++#define AR8327_PORT_PAD_SGMII_EN BIT(7)
++
++#define AR8327_REG_PORT_STATUS(_i) (0x07c + (_i) * 4)
++#define AR8XXX_PORT_STATUS_SPEED GENMASK(2, 0)
++#define AR8XXX_PORT_STATUS_SPEED_S 0
++#define AR8XXX_PORT_STATUS_TXMAC BIT(2)
++#define AR8XXX_PORT_STATUS_RXMAC BIT(3)
++#define AR8XXX_PORT_STATUS_TXFLOW BIT(4)
++#define AR8XXX_PORT_STATUS_RXFLOW BIT(5)
++#define AR8XXX_PORT_STATUS_DUPLEX BIT(6)
++#define AR8XXX_PORT_STATUS_LINK_UP BIT(8)
++#define AR8XXX_PORT_STATUS_LINK_AUTO BIT(9)
++#define AR8XXX_PORT_STATUS_LINK_PAUSE BIT(10)
++
++#define AR8327_PORT_LOOKUP_CTRL(_i) (0x660 + (_i) * 0xc)
++#define AR8327_PORT_LOOKUP_MEMBER GENMASK(6, 0)
++#define AR8327_PORT_LOOKUP_IN_MODE GENMASK(9, 8)
++#define AR8327_PORT_LOOKUP_IN_MODE_S 8
++#define AR8327_PORT_LOOKUP_STATE GENMASK(18, 16)
++#define AR8327_PORT_LOOKUP_STATE_S 16
++#define AR8327_PORT_LOOKUP_LEARN BIT(20)
++#define AR8327_PORT_LOOKUP_ING_MIRROR_EN BIT(25)
++
++/* port speed */
++enum {
++ AR8XXX_PORT_SPEED_10M = 0,
++ AR8XXX_PORT_SPEED_100M = 1,
++ AR8XXX_PORT_SPEED_1000M = 2,
++ AR8XXX_PORT_SPEED_ERR = 3,
++};
++
++static inline void
++split_addr(u32 regaddr, u16 *r1, u16 *r2, u16 *page)
++{
++ regaddr >>= 1;
++ *r1 = regaddr & 0x1e;
++
++ regaddr >>= 5;
++ *r2 = regaddr & 0x7;
++
++ regaddr >>= 3;
++ *page = regaddr & 0x1ff;
++}
++
++static inline void
++wait_for_page_switch(void)
++{
++ udelay(5);
++}
++
++#endif /* __AR8XXX_H */
+diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
+index e6f6cc3..fffb9aa 100644
+--- a/net/dsa/dsa.c
++++ b/net/dsa/dsa.c
+@@ -893,6 +893,7 @@ static SIMPLE_DEV_PM_OPS(dsa_pm_ops, dsa_suspend, dsa_resume);
+
+ static const struct of_device_id dsa_of_match_table[] = {
+ { .compatible = "brcm,bcm7445-switch-v4.0" },
++ { .compatible = "qca,ar8xxx", },
+ { .compatible = "marvell,dsa", },
+ {}
+ };
+
+From patchwork Fri May 29 01:42:17 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [2/7] net: dsa: ar8xxx: add ethtool hw statistics support
+From: Mathieu Olivari <mathieu@codeaurora.org>
+X-Patchwork-Id: 477524
+X-Patchwork-Delegate: davem@davemloft.net
+Message-Id: <1432863742-18427-3-git-send-email-mathieu@codeaurora.org>
+To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
+ ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
+ davem@davemloft.net, mathieu@codeaurora.org, andrew@lunn.ch,
+ f.fainelli@gmail.com, linux@roeck-us.net, gang.chen.5i5j@gmail.com,
+ jiri@resnulli.us, leitec@staticky.com, fabf@skynet.be,
+ alexander.h.duyck@intel.com, pavel.nakonechny@skitlab.ru,
+ joe@perches.com, sfeldma@gmail.com, nbd@openwrt.org, juhosg@openwrt.org
+Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
+ netdev@vger.kernel.org
+Date: Thu, 28 May 2015 18:42:17 -0700
+
+MIB counters can now be reported through each switch port by using
+"ethtool -S".
+
+Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+---
+ drivers/net/dsa/ar8xxx.c | 106 +++++++++++++++++++++++++++++++++++++++++++----
+ drivers/net/dsa/ar8xxx.h | 47 +++++++++++++++++++++
+ 2 files changed, 146 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/dsa/ar8xxx.c b/drivers/net/dsa/ar8xxx.c
+index 4ce3ffc..2f0fa4d 100644
+--- a/drivers/net/dsa/ar8xxx.c
++++ b/drivers/net/dsa/ar8xxx.c
+@@ -22,6 +22,55 @@
+
+ #include "ar8xxx.h"
+
++#define MIB_DESC(_s, _o, _n) \
++ { \
++ .size = (_s), \
++ .offset = (_o), \
++ .name = (_n), \
++ }
++
++static const struct ar8xxx_mib_desc ar8327_mib[] = {
++ MIB_DESC(1, 0x00, "RxBroad"),
++ MIB_DESC(1, 0x04, "RxPause"),
++ MIB_DESC(1, 0x08, "RxMulti"),
++ MIB_DESC(1, 0x0c, "RxFcsErr"),
++ MIB_DESC(1, 0x10, "RxAlignErr"),
++ MIB_DESC(1, 0x14, "RxRunt"),
++ MIB_DESC(1, 0x18, "RxFragment"),
++ MIB_DESC(1, 0x1c, "Rx64Byte"),
++ MIB_DESC(1, 0x20, "Rx128Byte"),
++ MIB_DESC(1, 0x24, "Rx256Byte"),
++ MIB_DESC(1, 0x28, "Rx512Byte"),
++ MIB_DESC(1, 0x2c, "Rx1024Byte"),
++ MIB_DESC(1, 0x30, "Rx1518Byte"),
++ MIB_DESC(1, 0x34, "RxMaxByte"),
++ MIB_DESC(1, 0x38, "RxTooLong"),
++ MIB_DESC(2, 0x3c, "RxGoodByte"),
++ MIB_DESC(2, 0x44, "RxBadByte"),
++ MIB_DESC(1, 0x4c, "RxOverFlow"),
++ MIB_DESC(1, 0x50, "Filtered"),
++ MIB_DESC(1, 0x54, "TxBroad"),
++ MIB_DESC(1, 0x58, "TxPause"),
++ MIB_DESC(1, 0x5c, "TxMulti"),
++ MIB_DESC(1, 0x60, "TxUnderRun"),
++ MIB_DESC(1, 0x64, "Tx64Byte"),
++ MIB_DESC(1, 0x68, "Tx128Byte"),
++ MIB_DESC(1, 0x6c, "Tx256Byte"),
++ MIB_DESC(1, 0x70, "Tx512Byte"),
++ MIB_DESC(1, 0x74, "Tx1024Byte"),
++ MIB_DESC(1, 0x78, "Tx1518Byte"),
++ MIB_DESC(1, 0x7c, "TxMaxByte"),
++ MIB_DESC(1, 0x80, "TxOverSize"),
++ MIB_DESC(2, 0x84, "TxByte"),
++ MIB_DESC(1, 0x8c, "TxCollision"),
++ MIB_DESC(1, 0x90, "TxAbortCol"),
++ MIB_DESC(1, 0x94, "TxMultiCol"),
++ MIB_DESC(1, 0x98, "TxSingleCol"),
++ MIB_DESC(1, 0x9c, "TxExcDefer"),
++ MIB_DESC(1, 0xa0, "TxDefer"),
++ MIB_DESC(1, 0xa4, "TxLateCol"),
++};
++
+ u32
+ ar8xxx_mii_read32(struct mii_bus *bus, int phy_id, int regnum)
+ {
+@@ -184,6 +233,10 @@ static int ar8xxx_setup(struct dsa_switch *ds)
+ if (ret < 0)
+ return ret;
+
++ /* Enable MIB counters */
++ ar8xxx_reg_set(ds, AR8327_REG_MIB, AR8327_MIB_CPU_KEEP);
++ ar8xxx_write(ds, AR8327_REG_MODULE_EN, AR8327_MODULE_EN_MIB);
++
+ /* Disable forwarding by default on all ports */
+ for (i = 0; i < AR8327_NUM_PORTS; i++)
+ ar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(i),
+@@ -228,6 +281,42 @@ ar8xxx_phy_write(struct dsa_switch *ds, int phy, int regnum, u16 val)
+ return mdiobus_write(bus, phy, regnum, val);
+ }
+
++static void ar8xxx_get_strings(struct dsa_switch *ds, int phy, uint8_t *data)
++{
++ int i;
++
++ for (i = 0; i < ARRAY_SIZE(ar8327_mib); i++) {
++ strncpy(data + i * ETH_GSTRING_LEN, ar8327_mib[i].name,
++ ETH_GSTRING_LEN);
++ }
++}
++
++static void ar8xxx_get_ethtool_stats(struct dsa_switch *ds, int phy,
++ uint64_t *data)
++{
++ const struct ar8xxx_mib_desc *mib;
++ uint32_t reg, i, port;
++ u64 hi;
++
++ port = phy_to_port(phy);
++
++ for (i = 0; i < ARRAY_SIZE(ar8327_mib); i++) {
++ mib = &ar8327_mib[i];
++ reg = AR8327_PORT_MIB_COUNTER(port) + mib->offset;
++
++ data[i] = ar8xxx_read(ds, reg);
++ if (mib->size == 2) {
++ hi = ar8xxx_read(ds, reg + 4);
++ data[i] |= hi << 32;
++ }
++ }
++}
++
++static int ar8xxx_get_sset_count(struct dsa_switch *ds)
++{
++ return ARRAY_SIZE(ar8327_mib);
++}
++
+ static void ar8xxx_poll_link(struct dsa_switch *ds)
+ {
+ int i = 0;
+@@ -275,13 +364,16 @@ static void ar8xxx_poll_link(struct dsa_switch *ds)
+ }
+
+ static struct dsa_switch_driver ar8xxx_switch_driver = {
+- .tag_protocol = DSA_TAG_PROTO_NONE,
+- .probe = ar8xxx_probe,
+- .setup = ar8xxx_setup,
+- .set_addr = ar8xxx_set_addr,
+- .poll_link = ar8xxx_poll_link,
+- .phy_read = ar8xxx_phy_read,
+- .phy_write = ar8xxx_phy_write,
++ .tag_protocol = DSA_TAG_PROTO_NONE,
++ .probe = ar8xxx_probe,
++ .setup = ar8xxx_setup,
++ .set_addr = ar8xxx_set_addr,
++ .poll_link = ar8xxx_poll_link,
++ .phy_read = ar8xxx_phy_read,
++ .phy_write = ar8xxx_phy_write,
++ .get_strings = ar8xxx_get_strings,
++ .get_ethtool_stats = ar8xxx_get_ethtool_stats,
++ .get_sset_count = ar8xxx_get_sset_count,
+ };
+
+ static int __init ar8xxx_init(void)
+diff --git a/drivers/net/dsa/ar8xxx.h b/drivers/net/dsa/ar8xxx.h
+index a29b6d3..7c7a125 100644
+--- a/drivers/net/dsa/ar8xxx.h
++++ b/drivers/net/dsa/ar8xxx.h
+@@ -18,6 +18,12 @@
+
+ #include <linux/delay.h>
+
++struct ar8xxx_mib_desc {
++ unsigned int size;
++ unsigned int offset;
++ const char *name;
++};
++
+ #define AR8327_NUM_PORTS 7
+
+ #define PHY_ID_QCA8337 0x004dd036
+@@ -31,6 +37,14 @@
+ #define AR8327_PORT_PAD_RGMII_RX_DELAY_EN BIT(24)
+ #define AR8327_PORT_PAD_SGMII_EN BIT(7)
+
++#define AR8327_REG_MODULE_EN 0x030
++#define AR8327_MODULE_EN_MIB BIT(0)
++#define AR8327_MODULE_EN_ACL BIT(1)
++#define AR8327_MODULE_EN_L3 BIT(2)
++
++#define AR8327_REG_MIB 0x034
++#define AR8327_MIB_CPU_KEEP BIT(20)
++
+ #define AR8327_REG_PORT_STATUS(_i) (0x07c + (_i) * 4)
+ #define AR8XXX_PORT_STATUS_SPEED GENMASK(2, 0)
+ #define AR8XXX_PORT_STATUS_SPEED_S 0
+@@ -52,6 +66,8 @@
+ #define AR8327_PORT_LOOKUP_LEARN BIT(20)
+ #define AR8327_PORT_LOOKUP_ING_MIRROR_EN BIT(25)
+
++#define AR8327_PORT_MIB_COUNTER(_i) (0x1000 + (_i) * 0x100)
++
+ /* port speed */
+ enum {
+ AR8XXX_PORT_SPEED_10M = 0,
+@@ -60,6 +76,25 @@ enum {
+ AR8XXX_PORT_SPEED_ERR = 3,
+ };
+
++static inline int port_to_phy(int port)
++{
++ if (port >= 1 && port <= 6)
++ return port - 1;
++
++ return -1;
++}
++
++static inline int phy_to_port(int phy)
++{
++ if (phy < 5)
++ return phy + 1;
++
++ return -1;
++}
++
++u32
++ar8xxx_rmw(struct dsa_switch *ds, int reg, u32 mask, u32 val);
++
+ static inline void
+ split_addr(u32 regaddr, u16 *r1, u16 *r2, u16 *page)
+ {
+@@ -79,4 +114,16 @@ wait_for_page_switch(void)
+ udelay(5);
+ }
+
++static inline void
++ar8xxx_reg_set(struct dsa_switch *ds, int reg, u32 val)
++{
++ ar8xxx_rmw(ds, reg, 0, val);
++}
++
++static inline void
++ar8xxx_reg_clear(struct dsa_switch *ds, int reg, u32 val)
++{
++ ar8xxx_rmw(ds, reg, val, 0);
++}
++
+ #endif /* __AR8XXX_H */
+
+From patchwork Fri May 29 01:42:18 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [3/7] net: dsa: ar8xxx: add regmap support
+From: Mathieu Olivari <mathieu@codeaurora.org>
+X-Patchwork-Id: 477522
+X-Patchwork-Delegate: davem@davemloft.net
+Message-Id: <1432863742-18427-4-git-send-email-mathieu@codeaurora.org>
+To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
+ ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
+ davem@davemloft.net, mathieu@codeaurora.org, andrew@lunn.ch,
+ f.fainelli@gmail.com, linux@roeck-us.net, gang.chen.5i5j@gmail.com,
+ jiri@resnulli.us, leitec@staticky.com, fabf@skynet.be,
+ alexander.h.duyck@intel.com, pavel.nakonechny@skitlab.ru,
+ joe@perches.com, sfeldma@gmail.com, nbd@openwrt.org, juhosg@openwrt.org
+Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
+ netdev@vger.kernel.org
+Date: Thu, 28 May 2015 18:42:18 -0700
+
+All switch registers can now be dumped using regmap/debugfs.
+
+\# cat /sys/kernel/debug/regmap/<mdiobus>/registers
+0000: 00001302
+0004: ...
+...
+
+Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+---
+ drivers/net/dsa/Kconfig | 1 +
+ drivers/net/dsa/ar8xxx.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/dsa/ar8xxx.h | 5 ++++
+ 3 files changed, 66 insertions(+)
+
+diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
+index 2aae541..17fb296 100644
+--- a/drivers/net/dsa/Kconfig
++++ b/drivers/net/dsa/Kconfig
+@@ -68,6 +68,7 @@ config NET_DSA_BCM_SF2
+ config NET_DSA_AR8XXX
+ tristate "Qualcomm Atheros AR8XXX Ethernet switch family support"
+ depends on NET_DSA
++ select REGMAP
+ ---help---
+ This enables support for the Qualcomm Atheros AR8XXX Ethernet
+ switch chips.
+diff --git a/drivers/net/dsa/ar8xxx.c b/drivers/net/dsa/ar8xxx.c
+index 2f0fa4d..327abd4 100644
+--- a/drivers/net/dsa/ar8xxx.c
++++ b/drivers/net/dsa/ar8xxx.c
+@@ -176,6 +176,57 @@ static char *ar8xxx_probe(struct device *host_dev, int sw_addr)
+ }
+ }
+
++static int ar8xxx_regmap_read(void *ctx, uint32_t reg, uint32_t *val)
++{
++ struct dsa_switch *ds = (struct dsa_switch *)ctx;
++
++ *val = ar8xxx_read(ds, reg);
++
++ return 0;
++}
++
++static int ar8xxx_regmap_write(void *ctx, uint32_t reg, uint32_t val)
++{
++ struct dsa_switch *ds = (struct dsa_switch *)ctx;
++
++ ar8xxx_write(ds, reg, val);
++
++ return 0;
++}
++
++static const struct regmap_range ar8xxx_readable_ranges[] = {
++ regmap_reg_range(0x0000, 0x00e4), /* Global control */
++ regmap_reg_range(0x0100, 0x0168), /* EEE control */
++ regmap_reg_range(0x0200, 0x0270), /* Parser control */
++ regmap_reg_range(0x0400, 0x0454), /* ACL */
++ regmap_reg_range(0x0600, 0x0718), /* Lookup */
++ regmap_reg_range(0x0800, 0x0b70), /* QM */
++ regmap_reg_range(0x0C00, 0x0c80), /* PKT */
++ regmap_reg_range(0x1000, 0x10ac), /* MIB - Port0 */
++ regmap_reg_range(0x1100, 0x11ac), /* MIB - Port1 */
++ regmap_reg_range(0x1200, 0x12ac), /* MIB - Port2 */
++ regmap_reg_range(0x1300, 0x13ac), /* MIB - Port3 */
++ regmap_reg_range(0x1400, 0x14ac), /* MIB - Port4 */
++ regmap_reg_range(0x1500, 0x15ac), /* MIB - Port5 */
++ regmap_reg_range(0x1600, 0x16ac), /* MIB - Port6 */
++
++};
++
++static struct regmap_access_table ar8xxx_readable_table = {
++ .yes_ranges = ar8xxx_readable_ranges,
++ .n_yes_ranges = ARRAY_SIZE(ar8xxx_readable_ranges),
++};
++
++struct regmap_config ar8xxx_regmap_config = {
++ .reg_bits = 16,
++ .val_bits = 32,
++ .reg_stride = 4,
++ .max_register = 0x16ac, /* end MIB - Port6 range */
++ .reg_read = ar8xxx_regmap_read,
++ .reg_write = ar8xxx_regmap_write,
++ .rd_table = &ar8xxx_readable_table,
++};
++
+ static int ar8xxx_set_pad_ctrl(struct dsa_switch *ds, int port, int mode)
+ {
+ int reg;
+@@ -219,9 +270,17 @@ static int ar8xxx_set_pad_ctrl(struct dsa_switch *ds, int port, int mode)
+
+ static int ar8xxx_setup(struct dsa_switch *ds)
+ {
++ struct ar8xxx_priv *priv = ds_to_priv(ds);
+ struct net_device *netdev = ds->dst->pd->of_netdev;
+ int ret, i, phy_mode;
+
++ /* Start by setting up the register mapping */
++ priv->regmap = devm_regmap_init(ds->master_dev, NULL, ds,
++ &ar8xxx_regmap_config);
++
++ if (IS_ERR(priv->regmap))
++ pr_warn("regmap initialization failed");
++
+ /* Initialize CPU port pad mode (xMII type, delays...) */
+ phy_mode = of_get_phy_mode(netdev->dev.parent->of_node);
+ if (phy_mode < 0) {
+@@ -365,6 +424,7 @@ static void ar8xxx_poll_link(struct dsa_switch *ds)
+
+ static struct dsa_switch_driver ar8xxx_switch_driver = {
+ .tag_protocol = DSA_TAG_PROTO_NONE,
++ .priv_size = sizeof(struct ar8xxx_priv),
+ .probe = ar8xxx_probe,
+ .setup = ar8xxx_setup,
+ .set_addr = ar8xxx_set_addr,
+diff --git a/drivers/net/dsa/ar8xxx.h b/drivers/net/dsa/ar8xxx.h
+index 7c7a125..98cc7ed 100644
+--- a/drivers/net/dsa/ar8xxx.h
++++ b/drivers/net/dsa/ar8xxx.h
+@@ -17,6 +17,11 @@
+ #define __AR8XXX_H
+
+ #include <linux/delay.h>
++#include <linux/regmap.h>
++
++struct ar8xxx_priv {
++ struct regmap *regmap;
++};
+
+ struct ar8xxx_mib_desc {
+ unsigned int size;
+
+From patchwork Fri May 29 01:42:19 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [4/7] net: dsa: add QCA tag support
+From: Mathieu Olivari <mathieu@codeaurora.org>
+X-Patchwork-Id: 477521
+X-Patchwork-Delegate: davem@davemloft.net
+Message-Id: <1432863742-18427-5-git-send-email-mathieu@codeaurora.org>
+To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
+ ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
+ davem@davemloft.net, mathieu@codeaurora.org, andrew@lunn.ch,
+ f.fainelli@gmail.com, linux@roeck-us.net, gang.chen.5i5j@gmail.com,
+ jiri@resnulli.us, leitec@staticky.com, fabf@skynet.be,
+ alexander.h.duyck@intel.com, pavel.nakonechny@skitlab.ru,
+ joe@perches.com, sfeldma@gmail.com, nbd@openwrt.org, juhosg@openwrt.org
+Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
+ netdev@vger.kernel.org
+Date: Thu, 28 May 2015 18:42:19 -0700
+
+QCA tags are used on QCA ar8xxx switch family. This change adds support
+for encap/decap using 2 bytes header mode.
+
+Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+---
+ include/net/dsa.h | 1 +
+ net/dsa/Kconfig | 3 +
+ net/dsa/Makefile | 1 +
+ net/dsa/dsa.c | 5 ++
+ net/dsa/dsa_priv.h | 2 +
+ net/dsa/slave.c | 5 ++
+ net/dsa/tag_qca.c | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 7 files changed, 175 insertions(+)
+ create mode 100644 net/dsa/tag_qca.c
+
+diff --git a/include/net/dsa.h b/include/net/dsa.h
+index fbca63b..64ddf6f 100644
+--- a/include/net/dsa.h
++++ b/include/net/dsa.h
+@@ -26,6 +26,7 @@ enum dsa_tag_protocol {
+ DSA_TAG_PROTO_TRAILER,
+ DSA_TAG_PROTO_EDSA,
+ DSA_TAG_PROTO_BRCM,
++ DSA_TAG_PROTO_QCA,
+ };
+
+ #define DSA_MAX_SWITCHES 4
+diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
+index ff7736f..4f3cce1 100644
+--- a/net/dsa/Kconfig
++++ b/net/dsa/Kconfig
+@@ -26,6 +26,9 @@ config NET_DSA_HWMON
+ via the hwmon sysfs interface and exposes the onboard sensors.
+
+ # tagging formats
++config NET_DSA_TAG_QCA
++ bool
++
+ config NET_DSA_TAG_BRCM
+ bool
+
+diff --git a/net/dsa/Makefile b/net/dsa/Makefile
+index da06ed1..9feb86c 100644
+--- a/net/dsa/Makefile
++++ b/net/dsa/Makefile
+@@ -3,6 +3,7 @@ obj-$(CONFIG_NET_DSA) += dsa_core.o
+ dsa_core-y += dsa.o slave.o
+
+ # tagging formats
++dsa_core-$(CONFIG_NET_DSA_TAG_QCA) += tag_qca.o
+ dsa_core-$(CONFIG_NET_DSA_TAG_BRCM) += tag_brcm.o
+ dsa_core-$(CONFIG_NET_DSA_TAG_DSA) += tag_dsa.o
+ dsa_core-$(CONFIG_NET_DSA_TAG_EDSA) += tag_edsa.o
+diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
+index fffb9aa..6010a7d 100644
+--- a/net/dsa/dsa.c
++++ b/net/dsa/dsa.c
+@@ -249,6 +249,11 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
+ dst->rcv = brcm_netdev_ops.rcv;
+ break;
+ #endif
++#ifdef CONFIG_NET_DSA_TAG_QCA
++ case DSA_TAG_PROTO_QCA:
++ dst->rcv = qca_netdev_ops.rcv;
++ break;
++#endif
+ case DSA_TAG_PROTO_NONE:
+ break;
+ default:
+diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
+index d5f1f9b..350c94b 100644
+--- a/net/dsa/dsa_priv.h
++++ b/net/dsa/dsa_priv.h
+@@ -74,5 +74,7 @@ extern const struct dsa_device_ops trailer_netdev_ops;
+ /* tag_brcm.c */
+ extern const struct dsa_device_ops brcm_netdev_ops;
+
++/* tag_qca.c */
++extern const struct dsa_device_ops qca_netdev_ops;
+
+ #endif
+diff --git a/net/dsa/slave.c b/net/dsa/slave.c
+index 04ffad3..cd8f552 100644
+--- a/net/dsa/slave.c
++++ b/net/dsa/slave.c
+@@ -925,6 +925,11 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
+ p->xmit = brcm_netdev_ops.xmit;
+ break;
+ #endif
++#ifdef CONFIG_NET_DSA_TAG_QCA
++ case DSA_TAG_PROTO_QCA:
++ p->xmit = qca_netdev_ops.xmit;
++ break;
++#endif
+ default:
+ p->xmit = dsa_slave_notag_xmit;
+ break;
+diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
+new file mode 100644
+index 0000000..8f02196
+--- /dev/null
++++ b/net/dsa/tag_qca.c
+@@ -0,0 +1,158 @@
++/*
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/etherdevice.h>
++#include "dsa_priv.h"
++
++#define QCA_HDR_LEN 2
++#define QCA_HDR_VERSION 0x2
++
++#define QCA_HDR_RECV_VERSION_MASK GENMASK(15, 14)
++#define QCA_HDR_RECV_VERSION_S 14
++#define QCA_HDR_RECV_PRIORITY_MASK GENMASK(13, 11)
++#define QCA_HDR_RECV_PRIORITY_S 11
++#define QCA_HDR_RECV_TYPE_MASK GENMASK(10, 6)
++#define QCA_HDR_RECV_TYPE_S 6
++#define QCA_HDR_RECV_FRAME_IS_TAGGED BIT(3)
++#define QCA_HDR_RECV_SOURCE_PORT_MASK GENMASK(2, 0)
++
++#define QCA_HDR_XMIT_VERSION_MASK GENMASK(15, 14)
++#define QCA_HDR_XMIT_VERSION_S 14
++#define QCA_HDR_XMIT_PRIORITY_MASK GENMASK(13, 11)
++#define QCA_HDR_XMIT_PRIORITY_S 11
++#define QCA_HDR_XMIT_CONTROL_MASK GENMASK(10, 8)
++#define QCA_HDR_XMIT_CONTROL_S 8
++#define QCA_HDR_XMIT_FROM_CPU BIT(7)
++#define QCA_HDR_XMIT_DP_BIT_MASK GENMASK(6, 0)
++
++static inline int reg_to_port(int reg)
++{
++ if (reg < 5)
++ return reg + 1;
++
++ return -1;
++}
++
++static inline int port_to_reg(int port)
++{
++ if (port >= 1 && port <= 6)
++ return port - 1;
++
++ return -1;
++}
++
++static netdev_tx_t qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
++{
++ struct dsa_slave_priv *p = netdev_priv(dev);
++ u16 *phdr, hdr;
++
++ dev->stats.tx_packets++;
++ dev->stats.tx_bytes += skb->len;
++
++ if (skb_cow_head(skb, 0) < 0)
++ goto out_free;
++
++ skb_push(skb, QCA_HDR_LEN);
++
++ memmove(skb->data, skb->data + QCA_HDR_LEN, 2 * ETH_ALEN);
++ phdr = (u16 *)(skb->data + 2 * ETH_ALEN);
++
++ /* Set the version field, and set destination port information */
++ hdr = QCA_HDR_VERSION << QCA_HDR_XMIT_VERSION_S |
++ QCA_HDR_XMIT_FROM_CPU |
++ 1 << reg_to_port(p->port);
++
++ *phdr = htons(hdr);
++
++ skb->dev = p->parent->dst->master_netdev;
++ dev_queue_xmit(skb);
++
++ return NETDEV_TX_OK;
++
++out_free:
++ kfree_skb(skb);
++ return NETDEV_TX_OK;
++}
++
++static int qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
++ struct packet_type *pt, struct net_device *orig_dev)
++{
++ struct dsa_switch_tree *dst = dev->dsa_ptr;
++ struct dsa_switch *ds;
++ u8 ver;
++ int port, phy;
++ __be16 *phdr, hdr;
++
++ if (unlikely(!dst))
++ goto out_drop;
++
++ skb = skb_unshare(skb, GFP_ATOMIC);
++ if (!skb)
++ goto out;
++
++ if (unlikely(!pskb_may_pull(skb, QCA_HDR_LEN)))
++ goto out_drop;
++
++ /* Ethernet is added by the switch between src addr and Ethertype
++ * At this point, skb->data points to ethertype so header should be
++ * right before
++ */
++ phdr = (__be16 *)(skb->data - 2);
++ hdr = ntohs(*phdr);
++
++ /* Make sure the version is correct */
++ ver = (hdr & QCA_HDR_RECV_VERSION_MASK) >> QCA_HDR_RECV_VERSION_S;
++ if (unlikely(ver != QCA_HDR_VERSION))
++ goto out_drop;
++
++ /* Remove QCA tag and recalculate checksum */
++ skb_pull_rcsum(skb, QCA_HDR_LEN);
++ memmove(skb->data - ETH_HLEN, skb->data - ETH_HLEN - QCA_HDR_LEN,
++ ETH_HLEN - QCA_HDR_LEN);
++
++ /* This protocol doesn't support cascading multiple switches so it's
++ * safe to assume the switch is first in the tree
++ */
++ ds = dst->ds[0];
++ if (!ds)
++ goto out_drop;
++
++ /* Get source port information */
++ port = (hdr & QCA_HDR_RECV_SOURCE_PORT_MASK);
++ phy = port_to_reg(port);
++ if (unlikely(phy < 0) || !ds->ports[phy])
++ goto out_drop;
++
++ /* Update skb & forward the frame accordingly */
++ skb_push(skb, ETH_HLEN);
++ skb->pkt_type = PACKET_HOST;
++ skb->dev = ds->ports[phy];
++ skb->protocol = eth_type_trans(skb, skb->dev);
++
++ skb->dev->stats.rx_packets++;
++ skb->dev->stats.rx_bytes += skb->len;
++
++ netif_receive_skb(skb);
++
++ return 0;
++
++out_drop:
++ kfree_skb(skb);
++out:
++ return 0;
++}
++
++const struct dsa_device_ops qca_netdev_ops = {
++ .xmit = qca_tag_xmit,
++ .rcv = qca_tag_rcv,
++};
+
+From patchwork Fri May 29 01:42:20 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [5/7] net: dsa: ar8xxx: enable QCA header support on AR8xxx
+From: Mathieu Olivari <mathieu@codeaurora.org>
+X-Patchwork-Id: 477527
+X-Patchwork-Delegate: davem@davemloft.net
+Message-Id: <1432863742-18427-6-git-send-email-mathieu@codeaurora.org>
+To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
+ ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
+ davem@davemloft.net, mathieu@codeaurora.org, andrew@lunn.ch,
+ f.fainelli@gmail.com, linux@roeck-us.net, gang.chen.5i5j@gmail.com,
+ jiri@resnulli.us, leitec@staticky.com, fabf@skynet.be,
+ alexander.h.duyck@intel.com, pavel.nakonechny@skitlab.ru,
+ joe@perches.com, sfeldma@gmail.com, nbd@openwrt.org, juhosg@openwrt.org
+Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
+ netdev@vger.kernel.org
+Date: Thu, 28 May 2015 18:42:20 -0700
+
+This change enable support for the QCA headers in QCA83337 driver.
+A 2 bytes header will be added by the switch on every incoming packet
+to identify the ingress port, and the DSA tagging code will add a
+similar 2 bytes header to control which port is used to send a
+particular packet.
+
+Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+---
+ drivers/net/dsa/Kconfig | 1 +
+ drivers/net/dsa/ar8xxx.c | 28 ++++++++++++++++++++++++++--
+ drivers/net/dsa/ar8xxx.h | 22 ++++++++++++++++++++++
+ 3 files changed, 49 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
+index 17fb296..fa8b484 100644
+--- a/drivers/net/dsa/Kconfig
++++ b/drivers/net/dsa/Kconfig
+@@ -68,6 +68,7 @@ config NET_DSA_BCM_SF2
+ config NET_DSA_AR8XXX
+ tristate "Qualcomm Atheros AR8XXX Ethernet switch family support"
+ depends on NET_DSA
++ select NET_DSA_TAG_QCA
+ select REGMAP
+ ---help---
+ This enables support for the Qualcomm Atheros AR8XXX Ethernet
+diff --git a/drivers/net/dsa/ar8xxx.c b/drivers/net/dsa/ar8xxx.c
+index 327abd4..4044614 100644
+--- a/drivers/net/dsa/ar8xxx.c
++++ b/drivers/net/dsa/ar8xxx.c
+@@ -292,15 +292,31 @@ static int ar8xxx_setup(struct dsa_switch *ds)
+ if (ret < 0)
+ return ret;
+
++ /* Enable CPU Port */
++ ar8xxx_reg_set(ds, AR8327_REG_GLOBAL_FW_CTRL0,
++ AR8327_GLOBAL_FW_CTRL0_CPU_PORT_EN);
++
+ /* Enable MIB counters */
+ ar8xxx_reg_set(ds, AR8327_REG_MIB, AR8327_MIB_CPU_KEEP);
+ ar8xxx_write(ds, AR8327_REG_MODULE_EN, AR8327_MODULE_EN_MIB);
+
++ /* Enable QCA header mode on Port 0 */
++ ar8xxx_write(ds, AR8327_REG_PORT_HDR_CTRL(0),
++ AR8327_PORT_HDR_CTRL_ALL << AR8327_PORT_HDR_CTRL_TX_S |
++ AR8327_PORT_HDR_CTRL_ALL << AR8327_PORT_HDR_CTRL_RX_S);
++
+ /* Disable forwarding by default on all ports */
+ for (i = 0; i < AR8327_NUM_PORTS; i++)
+ ar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(i),
+ AR8327_PORT_LOOKUP_MEMBER, 0);
+
++ /* Forward all unknown frames to CPU port for Linux processing */
++ ar8xxx_write(ds, AR8327_REG_GLOBAL_FW_CTRL1,
++ BIT(0) << AR8327_GLOBAL_FW_CTRL1_IGMP_DP_S |
++ BIT(0) << AR8327_GLOBAL_FW_CTRL1_BC_DP_S |
++ BIT(0) << AR8327_GLOBAL_FW_CTRL1_MC_DP_S |
++ BIT(0) << AR8327_GLOBAL_FW_CTRL1_UC_DP_S);
++
+ /* Setup connection between CPU ports & PHYs */
+ for (i = 0; i < DSA_MAX_PORTS; i++) {
+ /* CPU port gets connected to all PHYs in the switch */
+@@ -312,8 +328,16 @@ static int ar8xxx_setup(struct dsa_switch *ds)
+
+ /* Invividual PHYs gets connected to CPU port only */
+ if (ds->phys_port_mask & BIT(i)) {
+- ar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(phy_to_port(i)),
++ int phy = phy_to_port(i);
++
++ ar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(phy),
+ AR8327_PORT_LOOKUP_MEMBER, BIT(0));
++
++ /* Disable Auto-learning by default so the switch
++ * doesn't try to forward the frame to another port
++ */
++ ar8xxx_reg_clear(ds, AR8327_PORT_LOOKUP_CTRL(phy),
++ AR8327_PORT_LOOKUP_LEARN);
+ }
+ }
+
+@@ -423,7 +447,7 @@ static void ar8xxx_poll_link(struct dsa_switch *ds)
+ }
+
+ static struct dsa_switch_driver ar8xxx_switch_driver = {
+- .tag_protocol = DSA_TAG_PROTO_NONE,
++ .tag_protocol = DSA_TAG_PROTO_QCA,
+ .priv_size = sizeof(struct ar8xxx_priv),
+ .probe = ar8xxx_probe,
+ .setup = ar8xxx_setup,
+diff --git a/drivers/net/dsa/ar8xxx.h b/drivers/net/dsa/ar8xxx.h
+index 98cc7ed..e68b92a 100644
+--- a/drivers/net/dsa/ar8xxx.h
++++ b/drivers/net/dsa/ar8xxx.h
+@@ -62,6 +62,28 @@ struct ar8xxx_mib_desc {
+ #define AR8XXX_PORT_STATUS_LINK_AUTO BIT(9)
+ #define AR8XXX_PORT_STATUS_LINK_PAUSE BIT(10)
+
++#define AR8327_REG_PORT_HDR_CTRL(_i) (0x9c + (_i * 4))
++#define AR8327_PORT_HDR_CTRL_RX_MASK GENMASK(3, 2)
++#define AR8327_PORT_HDR_CTRL_RX_S 2
++#define AR8327_PORT_HDR_CTRL_TX_MASK GENMASK(1, 0)
++#define AR8327_PORT_HDR_CTRL_TX_S 0
++#define AR8327_PORT_HDR_CTRL_ALL 2
++#define AR8327_PORT_HDR_CTRL_MGMT 1
++#define AR8327_PORT_HDR_CTRL_NONE 0
++
++#define AR8327_REG_GLOBAL_FW_CTRL0 0x620
++#define AR8327_GLOBAL_FW_CTRL0_CPU_PORT_EN BIT(10)
++
++#define AR8327_REG_GLOBAL_FW_CTRL1 0x624
++#define AR8327_GLOBAL_FW_CTRL1_IGMP_DP_MASK GENMASK(30, 24)
++#define AR8327_GLOBAL_FW_CTRL1_IGMP_DP_S 24
++#define AR8327_GLOBAL_FW_CTRL1_BC_DP_MASK GENMASK(22, 16)
++#define AR8327_GLOBAL_FW_CTRL1_BC_DP_S 16
++#define AR8327_GLOBAL_FW_CTRL1_MC_DP_MASK GENMASK(14, 8)
++#define AR8327_GLOBAL_FW_CTRL1_MC_DP_S 8
++#define AR8327_GLOBAL_FW_CTRL1_UC_DP_MASK GENMASK(6, 0)
++#define AR8327_GLOBAL_FW_CTRL1_UC_DP_S 0
++
+ #define AR8327_PORT_LOOKUP_CTRL(_i) (0x660 + (_i) * 0xc)
+ #define AR8327_PORT_LOOKUP_MEMBER GENMASK(6, 0)
+ #define AR8327_PORT_LOOKUP_IN_MODE GENMASK(9, 8)
+
+From patchwork Fri May 29 01:42:21 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [6/7] net: dsa: ar8xxx: add support for second xMII interfaces
+ through DT
+From: Mathieu Olivari <mathieu@codeaurora.org>
+X-Patchwork-Id: 477525
+X-Patchwork-Delegate: davem@davemloft.net
+Message-Id: <1432863742-18427-7-git-send-email-mathieu@codeaurora.org>
+To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
+ ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
+ davem@davemloft.net, mathieu@codeaurora.org, andrew@lunn.ch,
+ f.fainelli@gmail.com, linux@roeck-us.net, gang.chen.5i5j@gmail.com,
+ jiri@resnulli.us, leitec@staticky.com, fabf@skynet.be,
+ alexander.h.duyck@intel.com, pavel.nakonechny@skitlab.ru,
+ joe@perches.com, sfeldma@gmail.com, nbd@openwrt.org, juhosg@openwrt.org
+Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
+ netdev@vger.kernel.org
+Date: Thu, 28 May 2015 18:42:21 -0700
+
+This patch is adding support for port6 specific options to device tree.
+They can be used to setup the second xMII interface, and connect it to
+one of the switch port.
+
+Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+---
+ drivers/net/dsa/ar8xxx.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+
+diff --git a/drivers/net/dsa/ar8xxx.c b/drivers/net/dsa/ar8xxx.c
+index 4044614..7559249 100644
+--- a/drivers/net/dsa/ar8xxx.c
++++ b/drivers/net/dsa/ar8xxx.c
+@@ -19,6 +19,7 @@
+ #include <net/dsa.h>
+ #include <linux/phy.h>
+ #include <linux/of_net.h>
++#include <linux/of_platform.h>
+
+ #include "ar8xxx.h"
+
+@@ -260,6 +261,9 @@ static int ar8xxx_set_pad_ctrl(struct dsa_switch *ds, int port, int mode)
+ ar8xxx_write(ds, AR8327_REG_PORT5_PAD_CTRL,
+ AR8327_PORT_PAD_RGMII_RX_DELAY_EN);
+ break;
++ case PHY_INTERFACE_MODE_SGMII:
++ ar8xxx_write(ds, reg, AR8327_PORT_PAD_SGMII_EN);
++ break;
+ default:
+ pr_err("xMII mode %d not supported\n", mode);
+ return -EINVAL;
+@@ -268,6 +272,48 @@ static int ar8xxx_set_pad_ctrl(struct dsa_switch *ds, int port, int mode)
+ return 0;
+ }
+
++static int ar8xxx_of_setup(struct dsa_switch *ds)
++{
++ struct device_node *dn = ds->pd->of_node;
++ const char *s_phymode;
++ int ret, mode;
++ u32 phy_id, ctrl;
++
++ /* If port6-phy-mode property exists, configure it accordingly */
++ if (!of_property_read_string(dn, "qca,port6-phy-mode", &s_phymode)) {
++ for (mode = 0; mode < PHY_INTERFACE_MODE_MAX; mode++)
++ if (!strcasecmp(s_phymode, phy_modes(mode)))
++ break;
++
++ if (mode == PHY_INTERFACE_MODE_MAX)
++ pr_err("Unknown phy-mode: \"%s\"\n", s_phymode);
++
++ ret = ar8xxx_set_pad_ctrl(ds, 6, mode);
++ if (ret < 0)
++ return ret;
++ }
++
++ /* If a phy ID is specified for PORT6 mac, connect them together */
++ if (!of_property_read_u32(dn, "qca,port6-phy-id", &phy_id)) {
++ ar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(6),
++ AR8327_PORT_LOOKUP_MEMBER, BIT(phy_to_port(phy_id)));
++ ar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(phy_to_port(phy_id)),
++ AR8327_PORT_LOOKUP_MEMBER, BIT(6));
++
++ /* We want the switch to be pass-through and act like a PHY on
++ * these ports. So BC/MC/UC & IGMP frames need to be accepted
++ */
++ ctrl = BIT(phy_to_port(phy_id)) | BIT(6);
++ ar8xxx_reg_set(ds, AR8327_REG_GLOBAL_FW_CTRL1,
++ ctrl << AR8327_GLOBAL_FW_CTRL1_IGMP_DP_S |
++ ctrl << AR8327_GLOBAL_FW_CTRL1_BC_DP_S |
++ ctrl << AR8327_GLOBAL_FW_CTRL1_MC_DP_S |
++ ctrl << AR8327_GLOBAL_FW_CTRL1_UC_DP_S);
++ }
++
++ return 0;
++}
++
+ static int ar8xxx_setup(struct dsa_switch *ds)
+ {
+ struct ar8xxx_priv *priv = ds_to_priv(ds);
+@@ -341,6 +387,10 @@ static int ar8xxx_setup(struct dsa_switch *ds)
+ }
+ }
+
++ ret = ar8xxx_of_setup(ds);
++ if (ret < 0)
++ return ret;
++
+ return 0;
+ }
+
+
+From patchwork Fri May 29 01:42:22 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [7/7] Documentation: devicetree: add ar8xxx binding
+From: Mathieu Olivari <mathieu@codeaurora.org>
+X-Patchwork-Id: 477528
+X-Patchwork-Delegate: davem@davemloft.net
+Message-Id: <1432863742-18427-8-git-send-email-mathieu@codeaurora.org>
+To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
+ ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
+ davem@davemloft.net, mathieu@codeaurora.org, andrew@lunn.ch,
+ f.fainelli@gmail.com, linux@roeck-us.net, gang.chen.5i5j@gmail.com,
+ jiri@resnulli.us, leitec@staticky.com, fabf@skynet.be,
+ alexander.h.duyck@intel.com, pavel.nakonechny@skitlab.ru,
+ joe@perches.com, sfeldma@gmail.com, nbd@openwrt.org, juhosg@openwrt.org
+Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
+ netdev@vger.kernel.org
+Date: Thu, 28 May 2015 18:42:22 -0700
+
+Add device-tree binding for ar8xxx switch families.
+
+Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+---
+ .../devicetree/bindings/net/dsa/qca-ar8xxx.txt | 70 ++++++++++++++++++++++
+ 1 file changed, 70 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/net/dsa/qca-ar8xxx.txt
+
+diff --git a/Documentation/devicetree/bindings/net/dsa/qca-ar8xxx.txt b/Documentation/devicetree/bindings/net/dsa/qca-ar8xxx.txt
+new file mode 100644
+index 0000000..f4fd3f1
+--- /dev/null
++++ b/Documentation/devicetree/bindings/net/dsa/qca-ar8xxx.txt
+@@ -0,0 +1,70 @@
++* Qualcomm Atheros AR8xxx switch family
++
++Required properties:
++
++- compatible: should be "qca,ar8xxx"
++- dsa,mii-bus: phandle to the MDIO bus controller, see dsa/dsa.txt
++- dsa,ethernet: phandle to the CPU network interface controller, see dsa/dsa.txt
++- #size-cells: must be 0
++- #address-cells: must be 2, see dsa/dsa.txt
++
++Subnodes:
++
++The integrated switch subnode should be specified according to the binding
++described in dsa/dsa.txt.
++
++Optional properties:
++
++- qca,port6-phy-mode: if specified, the driver will configure Port 6 in the
++ given phy-mode. See Documentation/devicetree/bindings/net/ethernet.txt for
++ the list of valid phy-mode.
++
++- qca,port6-phy-id: if specified, the driver will connect Port 6 to the PHY
++ given as a parameter. In this case, Port6 and the corresponding PHY will be
++ isolated from the rest of the switch. From a system perspective, they will
++ act as a regular PHY.
++
++Example:
++
++ dsa@0 {
++ compatible = "qca,ar8xxx";
++ #address-cells = <2>;
++ #size-cells = <0>;
++
++ dsa,ethernet = <&ethernet0>;
++ dsa,mii-bus = <&mii_bus0>;
++
++ switch@0 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ reg = <0 0>; /* MDIO address 0, switch 0 in tree */
++
++ qca,port6-phy-mode = "sgmii";
++ qca,port6-phy-id = <4>;
++
++ port@0 {
++ reg = <11>;
++ label = "cpu";
++ };
++
++ port@1 {
++ reg = <0>;
++ label = "lan1";
++ };
++
++ port@2 {
++ reg = <1>;
++ label = "lan2";
++ };
++
++ port@3 {
++ reg = <2>;
++ label = "lan3";
++ };
++
++ port@4 {
++ reg = <3>;
++ label = "lan4";
++ };
++ };
++ };
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.4/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 5126e9061e..102cd76b49 100644
--- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-4.4/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
};
gsbi@16300000 {
-@@ -135,6 +145,34 @@
+@@ -160,6 +170,34 @@
linux,part-probe = "qcom-smem";
};
@@ -58,7 +58,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+ 0x00004 0x7600000 /* PAD0_MODE */
+ 0x00008 0x1000000 /* PAD5_MODE */
+ 0x0000c 0x80 /* PAD6_MODE */
-+ 0x000e4 0xaa545 /* MAC_POWER_SEL */
++ 0x000e4 0x6a545 /* MAC_POWER_SEL */
+ 0x000e0 0xc74164de /* SGMII_CTRL */
+ 0x0007c 0x4e /* PORT0_STATUS */
+ 0x00094 0x4e /* PORT6_STATUS */
@@ -120,7 +120,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+ 0x00004 0x7600000 /* PAD0_MODE */
+ 0x00008 0x1000000 /* PAD5_MODE */
+ 0x0000c 0x80 /* PAD6_MODE */
-+ 0x000e4 0xaa545 /* MAC_POWER_SEL */
++ 0x000e4 0x6a545 /* MAC_POWER_SEL */
+ 0x000e0 0xc74164de /* SGMII_CTRL */
+ 0x0007c 0x4e /* PORT0_STATUS */
+ 0x00094 0x4e /* PORT6_STATUS */
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.4/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 37dfaabf05..691ebb66ba 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.4/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
};
gsbi@16300000 {
-@@ -173,6 +183,31 @@
+@@ -198,6 +208,31 @@
reg = <4>;
};
};
@@ -121,7 +121,7 @@ Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
};
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -679,6 +679,92 @@
+@@ -763,6 +763,92 @@
status = "disabled";
};
diff --git a/target/linux/ipq806x/patches-4.4/709-spi-qup-Fix-fifo-and-dma-support-for-IPQ806x.patch b/target/linux/ipq806x/patches-4.4/709-spi-qup-Fix-fifo-and-dma-support-for-IPQ806x.patch
new file mode 100644
index 0000000000..8c4718e2a6
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/709-spi-qup-Fix-fifo-and-dma-support-for-IPQ806x.patch
@@ -0,0 +1,134 @@
+From 16d2871830ff3fe12a6bff582549a9264adff278 Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjangi@codeaurora.org>
+Date: Tue, 10 May 2016 20:19:31 +0530
+Subject: [PATCH] spi: qup: Fix fifo and dma support for IPQ806x
+
+Signed-off-by: Ram Chandra Jangir <rjangi@codeaurora.org>
+---
+ drivers/spi/spi-qup.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 52 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
+index 810a7fa..0808017 100644
+--- a/drivers/spi/spi-qup.c
++++ b/drivers/spi/spi-qup.c
+@@ -24,6 +24,7 @@
+ #include <linux/spi/spi.h>
+ #include <linux/dmaengine.h>
+ #include <linux/dma-mapping.h>
++#include <linux/gpio.h>
+
+ #define QUP_CONFIG 0x0000
+ #define QUP_STATE 0x0004
+@@ -152,6 +153,7 @@ struct spi_qup {
+ int use_dma;
+ struct dma_slave_config rx_conf;
+ struct dma_slave_config tx_conf;
++ int mode;
+ };
+
+
+@@ -370,7 +372,8 @@ static int spi_qup_do_pio(struct spi_master *master, struct spi_transfer *xfer)
+ return ret;
+ }
+
+- spi_qup_fifo_write(qup, xfer);
++ if (qup->mode == QUP_IO_M_MODE_FIFO)
++ spi_qup_fifo_write(qup, xfer);
+
+ return 0;
+ }
+@@ -448,6 +451,7 @@ spi_qup_get_mode(struct spi_master *master, struct spi_transfer *xfer)
+ {
+ struct spi_qup *qup = spi_master_get_devdata(master);
+ u32 mode;
++ size_t dma_align = dma_get_cache_alignment();
+
+ qup->w_size = 4;
+
+@@ -458,6 +462,14 @@ spi_qup_get_mode(struct spi_master *master, struct spi_transfer *xfer)
+
+ qup->n_words = xfer->len / qup->w_size;
+
++ if (!IS_ERR_OR_NULL(master->dma_rx) &&
++ IS_ALIGNED((size_t)xfer->tx_buf, dma_align) &&
++ IS_ALIGNED((size_t)xfer->rx_buf, dma_align) &&
++ !is_vmalloc_addr(xfer->tx_buf) &&
++ !is_vmalloc_addr(xfer->rx_buf) &&
++ (xfer->len > 3*qup->in_blk_sz))
++ qup->use_dma = 1;
++
+ if (qup->n_words <= (qup->in_fifo_sz / sizeof(u32)))
+ mode = QUP_IO_M_MODE_FIFO;
+ else
+@@ -491,7 +503,7 @@ static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer)
+ return -EIO;
+ }
+
+- mode = spi_qup_get_mode(spi->master, xfer);
++ controller->mode = mode = spi_qup_get_mode(spi->master, xfer);
+ n_words = controller->n_words;
+
+ if (mode == QUP_IO_M_MODE_FIFO) {
+@@ -500,6 +512,7 @@ static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer)
+ /* must be zero for FIFO */
+ writel_relaxed(0, controller->base + QUP_MX_INPUT_CNT);
+ writel_relaxed(0, controller->base + QUP_MX_OUTPUT_CNT);
++ controller->use_dma = 0;
+ } else if (!controller->use_dma) {
+ writel_relaxed(n_words, controller->base + QUP_MX_INPUT_CNT);
+ writel_relaxed(n_words, controller->base + QUP_MX_OUTPUT_CNT);
+@@ -750,6 +763,38 @@ err_tx:
+ return ret;
+ }
+
++static void spi_qup_set_cs(struct spi_device *spi, bool val)
++{
++ struct spi_qup *controller;
++ u32 spi_ioc;
++ u32 spi_ioc_orig;
++
++ controller = spi_master_get_devdata(spi->master);
++ spi_ioc = readl_relaxed(controller->base + SPI_IO_CONTROL);
++ spi_ioc_orig = spi_ioc;
++ if (!val)
++ spi_ioc |= SPI_IO_C_FORCE_CS;
++ else
++ spi_ioc &= ~SPI_IO_C_FORCE_CS;
++
++ if (spi_ioc != spi_ioc_orig)
++ writel_relaxed(spi_ioc, controller->base + SPI_IO_CONTROL);
++}
++
++static int spi_qup_setup(struct spi_device *spi)
++{
++ if (spi->cs_gpio >= 0) {
++ if (spi->mode & SPI_CS_HIGH)
++ gpio_set_value(spi->cs_gpio, 0);
++ else
++ gpio_set_value(spi->cs_gpio, 1);
++
++ udelay(10);
++ }
++
++ return 0;
++}
++
+ static int spi_qup_probe(struct platform_device *pdev)
+ {
+ struct spi_master *master;
+@@ -846,6 +891,11 @@ static int spi_qup_probe(struct platform_device *pdev)
+ if (of_device_is_compatible(dev->of_node, "qcom,spi-qup-v1.1.1"))
+ controller->qup_v1 = 1;
+
++ if (!controller->qup_v1)
++ master->set_cs = spi_qup_set_cs;
++ else
++ master->setup = spi_qup_setup;
++
+ spin_lock_init(&controller->lock);
+ init_completion(&controller->done);
+
+--
+2.7.2
+
diff --git a/target/linux/ipq806x/patches-4.4/710-watchdog-qcom-set-WDT_BARK_TIME-register-offset-to-o.patch b/target/linux/ipq806x/patches-4.4/710-watchdog-qcom-set-WDT_BARK_TIME-register-offset-to-o.patch
new file mode 100644
index 0000000000..7573c963a7
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/710-watchdog-qcom-set-WDT_BARK_TIME-register-offset-to-o.patch
@@ -0,0 +1,43 @@
+From abc9f55079169806bcc31f29ec27f7df11c6184c Mon Sep 17 00:00:00 2001
+From: Ram Chandra Jangir <rjangi@codeaurora.org>
+Date: Thu, 4 Feb 2016 12:41:56 +0530
+Subject: [PATCH 2/2] watchdog: qcom: set WDT_BARK_TIME register offset to one
+ second less of bite time
+
+Currently WDT_BARK_TIME register offset is not configured with bark
+timeout during wdt_start,and it is taking bark timeout's default value.
+For some versions of TZ (secure mode) will consider a BARK the same
+as BITE and reset the board.
+
+So instead let's just configure the BARK time to be less than a second
+of the bite timeout so the board does not reset in this scenario
+
+Change-Id: Ie09850ad7e0470ed721e6924911ca2a81fd9ff8a
+Signed-off-by: Ram Chandra Jangir <rjangi@codeaurora.org>
+---
+ drivers/watchdog/qcom-wdt.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
+index 773dcfa..002274a 100644
+--- a/drivers/watchdog/qcom-wdt.c
++++ b/drivers/watchdog/qcom-wdt.c
+@@ -22,6 +22,7 @@
+
+ #define WDT_RST 0x38
+ #define WDT_EN 0x40
++#define WDT_BARK_TIME 0x4C
+ #define WDT_BITE_TIME 0x5C
+
+ struct qcom_wdt {
+@@ -44,6 +45,7 @@ static int qcom_wdt_start(struct watchdog_device *wdd)
+
+ writel(0, wdt->base + WDT_EN);
+ writel(1, wdt->base + WDT_RST);
++ writel((wdd->timeout - 1) * wdt->rate, wdt->base + WDT_BARK_TIME);
+ writel(wdd->timeout * wdt->rate, wdt->base + WDT_BITE_TIME);
+ writel(1, wdt->base + WDT_EN);
+ return 0;
+--
+2.7.2
+
diff --git a/target/linux/ipq806x/patches-4.1/710-stmmac-fix-ipq806x-DMA-configuration.patch b/target/linux/ipq806x/patches-4.4/711-stmmac-fix-ipq806x-DMA-configuration.patch
index c99f60768f..c99f60768f 100644
--- a/target/linux/ipq806x/patches-4.1/710-stmmac-fix-ipq806x-DMA-configuration.patch
+++ b/target/linux/ipq806x/patches-4.4/711-stmmac-fix-ipq806x-DMA-configuration.patch
diff --git a/target/linux/ipq806x/patches-4.4/800-devicetree.patch b/target/linux/ipq806x/patches-4.4/800-devicetree.patch
new file mode 100644
index 0000000000..0081a28885
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/800-devicetree.patch
@@ -0,0 +1,27 @@
+From 7e77aa188a7a7c4391856a9e5ef5ef58f769e679 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo@openwrt.org>
+Date: Sun, 9 Aug 2015 13:02:38 +0200
+Subject: [PATCH] ARM: qcom: add Netgear Nighthawk X4 R7500 device tree
+
+Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+---
+ arch/arm/boot/dts/Makefile | 1 +
+ arch/arm/boot/dts/qcom-ipq8064-r7500.dts | 370 +++++++++++++++++++++++++++++++
+ 2 files changed, 371 insertions(+)
+ create mode 100644 arch/arm/boot/dts/qcom-ipq8064-r7500.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -506,7 +506,12 @@
+ qcom-apq8084-ifc6540.dtb \
+ qcom-apq8084-mtp.dtb \
+ qcom-ipq8064-ap148.dtb \
++ qcom-ipq8064-c2600.dtb \
++ qcom-ipq8064-d7800.dtb \
+ qcom-ipq8064-db149.dtb \
++ qcom-ipq8064-ea8500.dtb \
++ qcom-ipq8064-r7500.dtb \
++ qcom-ipq8064-r7800.dtb \
+ qcom-msm8660-surf.dtb \
+ qcom-msm8960-cdp.dtb \
+ qcom-msm8974-sony-xperia-honami.dtb
diff --git a/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch b/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
new file mode 100644
index 0000000000..490886ee44
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
@@ -0,0 +1,185 @@
+Author: Adrian Panella <ianchi74@outlook.com>
+Date: Fri Jun 10 19:10:15 2016 -0500
+
+generic: Mangle bootloader's kernel arguments
+
+The command-line arguments provided by the boot loader will be
+appended to a new device tree property: bootloader-args.
+If there is a property "append-rootblock" in DT under /chosen
+and a root= option in bootloaders command line it will be parsed
+and added to DT bootargs with the form: <append-rootblock>XX.
+Only command line ATAG will be processed, the rest of the ATAGs
+sent by bootloader will be ignored.
+This is usefull in dual boot systems, to get the current root partition
+without afecting the rest of the system.
+
+
+Signed-off-by: Adrian Panella <ianchi74@outlook.com>
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -1927,6 +1927,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
+ The command-line arguments provided by the boot loader will be
+ appended to the the device tree bootargs property.
+
++config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE
++ bool "Append rootblock parsing bootloader's kernel arguments"
++ help
++ The command-line arguments provided by the boot loader will be
++ appended to a new device tree property: bootloader-args.
++ If there is a property "append-rootblock" in DT under /chosen
++ and a root= option in bootloaders command line it will be parsed
++ and added to DT bootargs with the form: <append-rootblock>XX.
++ Only command line ATAG will be processed, the rest of the ATAGs
++ sent by bootloader will be ignored.
++
+ endchoice
+
+ config CMDLINE
+--- a/arch/arm/boot/compressed/atags_to_fdt.c
++++ b/arch/arm/boot/compressed/atags_to_fdt.c
+@@ -3,6 +3,8 @@
+
+ #if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND)
+ #define do_extend_cmdline 1
++#elif defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++#define do_extend_cmdline 1
+ #else
+ #define do_extend_cmdline 0
+ #endif
+@@ -66,6 +68,59 @@ static uint32_t get_cell_size(const void
+ return cell_size;
+ }
+
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++
++static char *append_rootblock(char *dest, const char *str, int len, void *fdt)
++{
++ char *ptr, *end;
++ char *root="root=";
++ int i, l;
++ const char *rootblock;
++
++ //ARM doesn't have __HAVE_ARCH_STRSTR, so search manually
++ ptr = str - 1;
++
++ do {
++ ptr++;
++ //first find an 'r' at the begining or after a space
++ do {
++ ptr = strchr(ptr, 'r');
++ if(!ptr) return dest;
++
++ } while (ptr != str && *(ptr-1) != ' ');
++
++ //then check for the rest
++ for(i = 1; i <= 4; i++)
++ if(*(ptr+i) != *(root+i)) break;
++
++ } while (i != 5);
++
++ end = strchr(ptr, ' ');
++ end = end ? (end - 1) : (strchr(ptr, 0) - 1);
++
++ //find partition number (assumes format root=/dev/mtdXX | /dev/mtdblockXX | yy:XX )
++ for( i = 0; end >= ptr && *end >= '0' && *end <= '9'; end--, i++);
++ ptr = end + 1;
++
++ /* if append-rootblock property is set use it to append to command line */
++ rootblock = getprop(fdt, "/chosen", "append-rootblock", &l);
++ if(rootblock != NULL) {
++ if(*dest != ' ') {
++ *dest = ' ';
++ dest++;
++ len++;
++ }
++ if (len + l + i <= COMMAND_LINE_SIZE) {
++ memcpy(dest, rootblock, l);
++ dest += l - 1;
++ memcpy(dest, ptr, i);
++ dest += i;
++ }
++ }
++ return dest;
++}
++#endif
++
+ static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
+ {
+ char cmdline[COMMAND_LINE_SIZE];
+@@ -85,12 +134,21 @@ static void merge_fdt_bootargs(void *fdt
+
+ /* and append the ATAG_CMDLINE */
+ if (fdt_cmdline) {
++
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++ //save original bootloader args
++ //and append ubi.mtd with root partition number to current cmdline
++ setprop_string(fdt, "/chosen", "bootloader-args", fdt_cmdline);
++ ptr = append_rootblock(ptr, fdt_cmdline, len, fdt);
++
++#else
+ len = strlen(fdt_cmdline);
+ if (ptr - cmdline + len + 2 < COMMAND_LINE_SIZE) {
+ *ptr++ = ' ';
+ memcpy(ptr, fdt_cmdline, len);
+ ptr += len;
+ }
++#endif
+ }
+ *ptr = '\0';
+
+@@ -147,7 +205,9 @@ int atags_to_fdt(void *atag_list, void *
+ else
+ setprop_string(fdt, "/chosen", "bootargs",
+ atag->u.cmdline.cmdline);
+- } else if (atag->hdr.tag == ATAG_MEM) {
++ }
++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE
++ else if (atag->hdr.tag == ATAG_MEM) {
+ if (memcount >= sizeof(mem_reg_property)/4)
+ continue;
+ if (!atag->u.mem.size)
+@@ -186,6 +246,10 @@ int atags_to_fdt(void *atag_list, void *
+ setprop(fdt, "/memory", "reg", mem_reg_property,
+ 4 * memcount * memsize);
+ }
++#else
++
++ }
++#endif
+
+ return fdt_pack(fdt);
+ }
+--- a/init/main.c
++++ b/init/main.c
+@@ -88,6 +88,10 @@
+ #include <asm/sections.h>
+ #include <asm/cacheflush.h>
+
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++#include <linux/of.h>
++#endif
++
+ static int kernel_init(void *);
+
+ extern void init_IRQ(void);
+@@ -585,6 +589,18 @@ asmlinkage __visible void __init start_k
+ page_alloc_init();
+
+ pr_notice("Kernel command line: %s\n", boot_command_line);
++
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++ //Show bootloader's original command line for reference
++ if(of_chosen) {
++ const char *prop = of_get_property(of_chosen, "bootloader-args", NULL);
++ if(prop)
++ pr_notice("Bootloader command line (ignored): %s\n", prop);
++ else
++ pr_notice("Bootloader command line not present\n");
++ }
++#endif
++
+ parse_early_param();
+ after_dashes = parse_args("Booting kernel",
+ static_command_line, __start___param,
diff --git a/target/linux/ipq806x/profiles/00-default.mk b/target/linux/ipq806x/profiles/00-default.mk
new file mode 100644
index 0000000000..26bc8b502b
--- /dev/null
+++ b/target/linux/ipq806x/profiles/00-default.mk
@@ -0,0 +1,9 @@
+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))
diff --git a/target/linux/ipq806x/profiles/default.mk b/target/linux/ipq806x/profiles/default.mk
deleted file mode 100644
index 6469bcb5f1..0000000000
--- a/target/linux/ipq806x/profiles/default.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (c) 2014 The Linux Foundation. All rights reserved.
-# Copyright (C) 2009 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/Default
- NAME:=Default Profile (minimum package set)
- PACKAGES:= \
- kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
- kmod-usb3 kmod-usb-dwc3-qcom kmod-usb-phy-qcom-dwc3
-endef
-
-define Profile/Default/Description
- Default package set compatible with most boards.
-endef
-$(eval $(call Profile,Default))
diff --git a/target/linux/ipq806x/profiles/netgear.mk b/target/linux/ipq806x/profiles/netgear.mk
deleted file mode 100644
index 25258cdca3..0000000000
--- a/target/linux/ipq806x/profiles/netgear.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright (c) 2014 The Linux Foundation. All rights reserved.
-# Copyright (C) 2009 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/D7800
- NAME:=Netgear Nighthawk X4 D7800
- PACKAGES:= \
- kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
- kmod-usb3 kmod-usb-dwc3-qcom kmod-usb-phy-qcom-dwc3 \
- kmod-ath10k wpad-mini ath10k-firmware-qca99x0
-endef
-
-define Profile/D7800/Description
- Package set for the Netgear Nighthawk X4 D7800.
-endef
-
-define Profile/R7500
- NAME:=Netgear Nighthawk X4 R7500
- PACKAGES:= \
- kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
- kmod-usb3 kmod-usb-dwc3-qcom kmod-usb-phy-qcom-dwc3 \
- kmod-ath10k wpad-mini
-endef
-
-define Profile/R7500/Description
- Package set for the Netgear Nighthawk X4 R7500.
-endef
-$(eval $(call Profile,D7800))
-$(eval $(call Profile,R7500))
diff --git a/target/linux/lantiq/Makefile b/target/linux/lantiq/Makefile
index 7b79b68c42..af4295cbb8 100644
--- a/target/linux/lantiq/Makefile
+++ b/target/linux/lantiq/Makefile
@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
BOARD:=lantiq
BOARDNAME:=Lantiq
FEATURES:=squashfs
-SUBTARGETS=xway xrx200
-MAINTAINER:=John Crispin <blogic@openwrt.org>
+SUBTARGETS=xrx200 xway xway_legacy
+MAINTAINER:=John Crispin <john@phrozen.org>
KERNEL_PATCHVER:=4.4
diff --git a/target/linux/lantiq/base-files/etc/board.d/01_leds b/target/linux/lantiq/base-files/etc/board.d/01_leds
index 39b693ac19..4cca17f280 100755
--- a/target/linux/lantiq/base-files/etc/board.d/01_leds
+++ b/target/linux/lantiq/base-files/etc/board.d/01_leds
@@ -42,6 +42,19 @@ P2812HNUF*)
ARV7519RW22)
ucidef_set_led_netdev "lan" "lan" "arv7519rw22:green:lan" "eth0.1"
;;
+FRITZ7320)
+ ucidef_set_led_netdev "wifi" "wifi" "fritz7320:green:wlan" "wlan0"
+ ;;
+ARV4525PW)
+ ucidef_set_led_netdev "wifi" "wifi" "arv4525pw:green:wlan" "wlan0"
+ ;;
+WBMR300)
+ ucidef_set_led_switch "lan1" "LAN1" "wbmr300:green:lan1" "switch0" "0x08"
+ ucidef_set_led_switch "lan2" "LAN2" "wbmr300:green:lan2" "switch0" "0x04"
+ ucidef_set_led_switch "wan" "WAN" "wbmr300:green:wan" "switch0" "0x10"
+ ucidef_set_led_switch "lan3" "LAN3" "wbmr300:green:lan3" "switch0" "0x20"
+ ucidef_set_led_default "router" "router" "wbmr300:green:router" "1"
+ ;;
*)
;;
esac
diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
index b27b8026df..cafcb0e009 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -62,11 +62,20 @@ VG3503J)
ucidef_set_interface_lan 'eth0'
;;
+ARV4518PWR01*)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+
DGN3500*)
ucidef_add_switch "switch0" \
"3:lan:1" "2:lan:2" "1:lan:3" "0:lan:4" "5t@eth0"
;;
+FRITZ7360SL)
+ ucidef_add_switch "switch0" \
+ "4:lan:1" "2:lan:2" "0:lan:3" "1:lan:4" "6t@eth0"
+ ;;
+
GR7000)
ucidef_set_interface_wan "eth0"
;;
@@ -126,7 +135,8 @@ BTHOMEHUBV5A)
VGV7519)
lan_mac=$(mtd_get_mac_binary board_config 22)
wan_mac=$(macaddr_add "$lan_mac" 1)
- ucidef_set_interface_lan 'eth0'
+ ucidef_add_switch "switch0" \
+ "4:lan:1" "2:lan:2" "1:lan:3" "0:lan:4" "6t@eth0"
;;
VGV7510KW22)
@@ -135,6 +145,16 @@ VGV7510KW22)
ucidef_add_switch "switch0" \
"2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6t@eth0"
;;
+*)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+
+WBMR300)
+ lan_mac=$(mtd_get_mac_ascii ubootconfig ethaddr)
+ wan_mac="$lan_mac"
+ ucidef_add_switch "switch0" \
+ "2:lan:1" "3:lan:2" "5:lan:3" "4:wan:1" "6t@eth0"
+ ;;
esac
diff --git a/target/linux/lantiq/base-files/lib/upgrade/platform.sh b/target/linux/lantiq/base-files/lib/upgrade/platform.sh
index e876b11af5..c8fc617035 100755
--- a/target/linux/lantiq/base-files/lib/upgrade/platform.sh
+++ b/target/linux/lantiq/base-files/lib/upgrade/platform.sh
@@ -16,6 +16,8 @@ platform_check_image() {
case "$(get_magic_word "$1")" in
# uImage
2705) return 0;;
+ # AVM
+ 8112) return 0;;
# tplink
0200) return 0;;
*)
diff --git a/target/linux/lantiq/dts/ARV452CQW.dts b/target/linux/lantiq/dts/ARV452CQW.dts
index 57aa864693..2bace94b0d 100644
--- a/target/linux/lantiq/dts/ARV452CQW.dts
+++ b/target/linux/lantiq/dts/ARV452CQW.dts
@@ -152,19 +152,19 @@
#size-cells = <0>;
poll-interval = <100>;
+ rfkill {
+ label = "rfkill";
+ gpios = <&gpio 11 1>;
+ linux,code = <0xf7>;
+ };
wps {
label = "wps";
- gpios = <&gpio 11 1>;
+ gpios = <&gpio 29 1>;
linux,code = <0x101>;
};
- restart {
- label = "restart";
- gpios = <&gpio 12 1>;
- linux,code = <0x110>;
- };
reset {
label = "reset";
- gpios = <&gpio 28 1>;
+ gpios = <&gpio 30 1>;
linux,code = <0x198>;
};
};
diff --git a/target/linux/lantiq/dts/DGN3500.dtsi b/target/linux/lantiq/dts/DGN3500.dtsi
index 7854007e01..bc50e4ae65 100644
--- a/target/linux/lantiq/dts/DGN3500.dtsi
+++ b/target/linux/lantiq/dts/DGN3500.dtsi
@@ -168,7 +168,7 @@
#size-cells = <1>;
compatible = "jedec,spi-nor";
reg = <4 0>;
- spi-max-frequency = <1000000>;
+ spi-max-frequency = <20000000>;
partitions {
compatible = "fixed-partitions";
diff --git a/target/linux/lantiq/dts/EASY80920.dtsi b/target/linux/lantiq/dts/EASY80920.dtsi
index e8cbc42980..4e649976a2 100644
--- a/target/linux/lantiq/dts/EASY80920.dtsi
+++ b/target/linux/lantiq/dts/EASY80920.dtsi
@@ -145,7 +145,8 @@
gphy-xrx200 {
compatible = "lantiq,phy-xrx200";
- firmware = "lantiq/vr9_phy11g_a2x.bin";
+ firmware1 = "lantiq/vr9_phy11g_a1x.bin";
+ firmware2 = "lantiq/vr9_phy11g_a2x.bin";
phys = [ 00 01 ];
};
diff --git a/target/linux/lantiq/dts/EASY80920NAND.dts b/target/linux/lantiq/dts/EASY80920NAND.dts
index d7e04eef55..7e1811edc1 100644
--- a/target/linux/lantiq/dts/EASY80920NAND.dts
+++ b/target/linux/lantiq/dts/EASY80920NAND.dts
@@ -4,6 +4,10 @@
/include/ "EASY80920.dtsi"
/ {
+ chosen {
+ bootargs = "ubi.mtd=ubi ubi.block=0,rootfsA root=/dev/ubiblock0_1";
+ };
+
fpi@10000000 {
localbus@0 {
ranges = <0 0 0x4000000 0x3ffffff>;
@@ -22,17 +26,37 @@
partition@0 {
label = "uboot";
- reg = <0x00000 0x40000>;
+ reg = <0x00000 0x100000>; /* 1024 KB */
};
- partition@10000 {
+ partition@100000 {
label = "uboot_env";
- reg = <0x40000 0x40000>;
+ reg = <0x100000 0x40000>; /* 256 KB */
+ };
+
+ partition@140000 {
+ label = "ubootconfigB";
+ reg = <0x140000 0x40000>; /* 256 KB */
+ };
+
+ partition@180000 {
+ label = "gphyfirmware";
+ reg = <0x180000 0x40000>; /* 256 KB */
+ };
+
+ partition@1c0000 {
+ label = "ubi";
+ reg = <0x1c0000 0xc800000>;
+ };
+
+ partition@c9c0000 {
+ label = "calibration";
+ reg = <0xc9c0000 0x100000>;
};
- partition@20000 {
- label = "firmware";
- reg = <0x80000 0x3f80000>;
+ partition@cac0000 {
+ label = "res";
+ reg = <0xcac0000 0x13540000>;
};
};
};
diff --git a/target/linux/lantiq/dts/FRITZ7320.dts b/target/linux/lantiq/dts/FRITZ7320.dts
index 475da7ac8e..acb88b60a0 100644
--- a/target/linux/lantiq/dts/FRITZ7320.dts
+++ b/target/linux/lantiq/dts/FRITZ7320.dts
@@ -37,7 +37,7 @@
#address-cells = <1>;
#size-cells = <1>;
- partition@0 {
+ ath9k_cal: partition@0 {
label = "urlader";
reg = <0x00000 0x20000>;
read-only;
@@ -63,6 +63,14 @@
};
};
+ ath9k_eep {
+ compatible = "ath9k,eeprom";
+ ath,eep-flash = <&ath9k_cal 0x985>;
+ ath,device-id = /bits/ 16 <0xff1d 0x2d>;
+ ath,eep-endian;
+ ath,eep-swap;
+ };
+
gpio: pinmux@E100B10 {
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
diff --git a/target/linux/lantiq/dts/FRITZ7360SL.dts b/target/linux/lantiq/dts/FRITZ7360SL.dts
new file mode 100644
index 0000000000..e8fdc13cb3
--- /dev/null
+++ b/target/linux/lantiq/dts/FRITZ7360SL.dts
@@ -0,0 +1,217 @@
+/dts-v1/;
+
+/include/ "vr9.dtsi"
+
+/ {
+ model = "FRITZ7360SL - 1&1 HomeServer";
+
+ chosen {
+ bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+
+ leds {
+ boot = &power_green;
+ failsafe = &power_red;
+ running = &power_green;
+
+ internet = &info_green;
+ dsl = &power_green;
+ wifi = &wifi;
+ };
+ };
+
+ memory@0 {
+ reg = <0x0 0x8000000>;
+ };
+
+ fpi@10000000 {
+ localbus@0 {
+ nor-boot@0 {
+ compatible = "lantiq,nor";
+ bank-width = <2>;
+ reg = <0 0x0 0x1000000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ urlader: partition@0 {
+ label = "urlader";
+ reg = <0x00000 0x20000>;
+ read-only;
+ };
+
+ partition@20000 {
+ label = "firmware";
+ reg = <0x20000 0xf60000>;
+ };
+
+ partition@f80000 {
+ label = "tffs (1)";
+ reg = <0xf80000 0x40000>;
+ read-only;
+ };
+
+ partition@fc0000 {
+ label = "tffs (2)";
+ reg = <0xfc0000 0x40000>;
+ read-only;
+ };
+ };
+ };
+ };
+
+ gpio: pinmux@E100B10 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&state_default>;
+
+ state_default: pinmux {
+ mdio {
+ lantiq,groups = "mdio";
+ lantiq,function = "mdio";
+ };
+ phy-rst {
+ lantiq,pins = "io37", "io44";
+ lantiq,pull = <2>;
+ lantiq,open-drain;
+ lantiq,output = <1>;
+ };
+ pcie-rst {
+ lantiq,pins = "io38";
+ lantiq,pull = <0>;
+ lantiq,output = <1>;
+ };
+ };
+ };
+
+ ifxhcd@E101000 {
+ status = "okay";
+ lantiq,portmask = <0x3>;
+ };
+
+ ifxhcd@E106000 {
+ status = "okay";
+ };
+ };
+
+ ath9k_eep {
+ compatible = "ath9k,eeprom";
+ ath,eep-flash = <&urlader 0x985>;
+ ath,eep-endian;
+ ath,eep-swap;
+ ath,pci-slot = <0>;
+ };
+
+ gphy-xrx200 {
+ compatible = "lantiq,phy-xrx200";
+ firmware = "lantiq/vr9_phy11g_a2x.bin";
+ phys = [ 00 01 ];
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <100>;
+ dect {
+ label = "power";
+ gpios = <&gpio 1 0>;
+ linux,code = <0x102>;
+ };
+ wifi {
+ label = "wifi";
+ gpios = <&gpio 29 0>;
+ linux,code = <0x101>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ power_green: power {
+ label = "fritz7360sl:green:power";
+ gpios = <&gpio 32 1>;
+ default-state = "keep";
+ };
+ power_red: power2 {
+ label = "fritz7360sl:red:power";
+ gpios = <&gpio 33 1>;
+ };
+ info_red {
+ label = "fritz7360sl:red:info";
+ gpios = <&gpio 34 1>;
+ };
+ info_green: info_green {
+ label = "fritz7360sl:green:info";
+ gpios = <&gpio 47 1>;
+ };
+ wifi: wifi {
+ label = "fritz7360sl:green:wlan";
+ gpios = <&gpio 36 1>;
+ };
+ dect {
+ label = "fritz7360sl:green:dect";
+ gpios = <&gpio 35 1>;
+ };
+ };
+};
+
+&eth0 {
+ lan: interface@0 {
+ compatible = "lantiq,xrx200-pdi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ mac-address = [ 00 11 22 33 44 55 ];
+ lantiq,switch;
+
+ ethernet@0 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <0>;
+ phy-mode = "rmii";
+ phy-handle = <&phy0>;
+ // gpios = <&gpio 37 1>;
+ };
+ ethernet@1 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <1>;
+ phy-mode = "rmii";
+ phy-handle = <&phy1>;
+ // gpios = <&gpio 44 1>;
+ };
+ ethernet@2 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <2>;
+ phy-mode = "gmii";
+ phy-handle = <&phy11>;
+ };
+ ethernet@3 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <4>;
+ phy-mode = "gmii";
+ phy-handle = <&phy13>;
+ };
+ };
+
+ mdio@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "lantiq,xrx200-mdio";
+ phy0: ethernet-phy@0 {
+ reg = <0x00>;
+ compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
+ };
+ phy1: ethernet-phy@1 {
+ reg = <0x01>;
+ compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
+ };
+ phy11: ethernet-phy@11 {
+ reg = <0x11>;
+ compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
+ };
+ phy13: ethernet-phy@13 {
+ reg = <0x13>;
+ compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
+ };
+ };
+};
diff --git a/target/linux/lantiq/dts/VG3503J.dts b/target/linux/lantiq/dts/VG3503J.dts
index b4b3cf5aec..1aeb4f19f8 100644
--- a/target/linux/lantiq/dts/VG3503J.dts
+++ b/target/linux/lantiq/dts/VG3503J.dts
@@ -1,11 +1,185 @@
/dts-v1/;
-/include/ "VG3503J.dtsi"
+/include/ "vr9.dtsi"
/ {
+ model = "VG3503J - BT OpenReach VDSL Modem";
+
+ chosen {
+ bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+
+ leds {
+ boot = &power_green;
+ failsafe = &power_red;
+ running = &power_green;
+
+ internet = &dsl;
+ };
+ };
+
+ memory@0 {
+ reg = <0x0 0x2000000>;
+ };
+
+ fpi@10000000 {
+ localbus@0 {
+ ranges = <0 0 0x0 0x3ffffff>;
+ nor-boot@0 {
+ compatible = "lantiq,nor";
+ bank-width = <2>;
+ reg = <0 0x0 0x2000000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "uboot";
+ reg = <0x00000 0x20000>;
+ };
+
+ partition@20000 {
+ label = "kernel";
+ reg = <0x20000 0x300000>;
+ };
+
+ partition@1a0000 {
+ label = "rootfs";
+ reg = <0x320000 0x420000>;
+ };
+
+ partition@740000 {
+ label = "btagent";
+ reg = <0x740000 0x80000>;
+ };
+
+ partition@7c0000 {
+ label = "pri_bfocus_cfg";
+ reg = <0x7c0000 0x10000>;
+ };
+
+ partition@7d0000 {
+ label = "sec_bfocus_cfg";
+ reg = <0x7d0000 0x10000>;
+ };
+
+ partition@7e0000 {
+ label = "sysconfig";
+ reg = <0x7e0000 0x10000>;
+ };
+
+ partition@7f0000 {
+ label = "misc_cfg";
+ reg = <0x7f0000 0x10000>;
+ };
+ };
+ };
+ };
+
+ gpio: pinmux@E100B10 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&state_default>;
+
+ state_default: pinmux {
+ mdio {
+ lantiq,groups = "mdio";
+ lantiq,function = "mdio";
+ };
+ gphy-leds {
+ lantiq,groups = "gphy0 led0", "gphy0 led1",
+ "gphy0 led2", "gphy1 led0",
+ "gphy1 led1", "gphy1 led2";
+ lantiq,function = "gphy";
+ lantiq,pull = <2>;
+ lantiq,open-drain = <0>;
+ lantiq,output = <1>;
+ };
+ };
+ };
+ };
+
gphy-xrx200 {
compatible = "lantiq,phy-xrx200";
- firmware = "lantiq/vr9_phy22f_a1x.bin";
+ firmware1 = "lantiq/vr9_phy11g_a1x.bin"; /*VR9 1.1*/
+ firmware2 = "lantiq/vr9_phy11g_a2x.bin"; /*VR9 1.2*/
phys = [ 00 01 ];
};
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <100>;
+ reset {
+ label = "reset";
+ gpios = <&gpio 6 1>;
+ linux,code = <0x198>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ power_red: power2 {
+ label = "vg3503j:red:power";
+ gpios = <&gpio 14 1>;
+ };
+ dsl: dsl {
+ label = "vg3503j:green:dsl";
+ gpios = <&gpio 19 1>;
+ };
+ power_green: power {
+ label = "vg3503j:green:power";
+ gpios = <&gpio 28 1>;
+ default-state = "keep";
+ };
+ };
+};
+
+&eth0 {
+ interface@0 {
+ compatible = "lantiq,xrx200-pdi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ mac-address = [ 00 11 22 33 44 55 ];
+ lantiq,switch;
+ ethernet@2 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <2>;
+ phy-mode = "mii";
+ phy-handle = <&phy11>;
+ };
+ ethernet@4 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <4>;
+ phy-mode = "mii";
+ phy-handle = <&phy13>;
+ };
+ };
+
+ mdio@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "lantiq,xrx200-mdio";
+ phy11: ethernet-phy@11 {
+ reg = <0x11>;
+ compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
+ lantiq,led1h = <0x70>;
+ lantiq,led1l = <0x00>;
+ lantiq,led2h = <0x00>;
+ lantiq,led2l = <0x03>;
+ };
+ phy13: ethernet-phy@13 {
+ reg = <0x13>;
+ compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
+ lantiq,led1h = <0x70>;
+ lantiq,led1l = <0x00>;
+ lantiq,led2h = <0x00>;
+ lantiq,led2l = <0x03>;
+ };
+ };
};
diff --git a/target/linux/lantiq/dts/VG3503J.dtsi b/target/linux/lantiq/dts/VG3503J.dtsi
deleted file mode 100644
index f68d22cceb..0000000000
--- a/target/linux/lantiq/dts/VG3503J.dtsi
+++ /dev/null
@@ -1,176 +0,0 @@
-/include/ "vr9.dtsi"
-
-/ {
- model = "VG3503J - BT OpenReach VDSL Modem";
-
- chosen {
- bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
-
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
-
- internet = &dsl;
- };
- };
-
- memory@0 {
- reg = <0x0 0x2000000>;
- };
-
- fpi@10000000 {
- localbus@0 {
- ranges = <0 0 0x0 0x3ffffff>;
- nor-boot@0 {
- compatible = "lantiq,nor";
- bank-width = <2>;
- reg = <0 0x0 0x2000000>;
- #address-cells = <1>;
- #size-cells = <1>;
-
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "uboot";
- reg = <0x00000 0x20000>;
- };
-
- partition@20000 {
- label = "kernel";
- reg = <0x20000 0x300000>;
- };
-
- partition@1a0000 {
- label = "rootfs";
- reg = <0x320000 0x420000>;
- };
-
- partition@740000 {
- label = "btagent";
- reg = <0x740000 0x80000>;
- };
-
- partition@7c0000 {
- label = "pri_bfocus_cfg";
- reg = <0x7c0000 0x10000>;
- };
-
- partition@7d0000 {
- label = "sec_bfocus_cfg";
- reg = <0x7d0000 0x10000>;
- };
-
- partition@7e0000 {
- label = "sysconfig";
- reg = <0x7e0000 0x10000>;
- };
-
- partition@7f0000 {
- label = "misc_cfg";
- reg = <0x7f0000 0x10000>;
- };
- };
- };
- };
-
- gpio: pinmux@E100B10 {
- pinctrl-names = "default";
- pinctrl-0 = <&state_default>;
-
- state_default: pinmux {
- mdio {
- lantiq,groups = "mdio";
- lantiq,function = "mdio";
- };
- gphy-leds {
- lantiq,groups = "gphy0 led0", "gphy0 led1",
- "gphy0 led2", "gphy1 led0",
- "gphy1 led1", "gphy1 led2";
- lantiq,function = "gphy";
- lantiq,pull = <2>;
- lantiq,open-drain = <0>;
- lantiq,output = <1>;
- };
- };
- };
- };
-
- gpio-keys-polled {
- compatible = "gpio-keys-polled";
- #address-cells = <1>;
- #size-cells = <0>;
- poll-interval = <100>;
- reset {
- label = "reset";
- gpios = <&gpio 6 1>;
- linux,code = <0x198>;
- };
- };
-
- gpio-leds {
- compatible = "gpio-leds";
-
- power_red: power2 {
- label = "vg3503j:red:power";
- gpios = <&gpio 14 1>;
- };
- dsl: dsl {
- label = "vg3503j:green:dsl";
- gpios = <&gpio 19 1>;
- };
- power_green: power {
- label = "vg3503j:green:power";
- gpios = <&gpio 28 1>;
- default-state = "keep";
- };
- };
-};
-
-&eth0 {
- interface@0 {
- compatible = "lantiq,xrx200-pdi";
- #address-cells = <1>;
- #size-cells = <0>;
- reg = <0>;
- mac-address = [ 00 11 22 33 44 55 ];
- lantiq,switch;
- ethernet@2 {
- compatible = "lantiq,xrx200-pdi-port";
- reg = <2>;
- phy-mode = "mii";
- phy-handle = <&phy11>;
- };
- ethernet@4 {
- compatible = "lantiq,xrx200-pdi-port";
- reg = <4>;
- phy-mode = "mii";
- phy-handle = <&phy13>;
- };
- };
-
- mdio@0 {
- #address-cells = <1>;
- #size-cells = <0>;
- compatible = "lantiq,xrx200-mdio";
- phy11: ethernet-phy@11 {
- reg = <0x11>;
- compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
- lantiq,led1h = <0x70>;
- lantiq,led1l = <0x00>;
- lantiq,led2h = <0x00>;
- lantiq,led2l = <0x03>;
- };
- phy13: ethernet-phy@13 {
- reg = <0x13>;
- compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
- lantiq,led1h = <0x70>;
- lantiq,led1l = <0x00>;
- lantiq,led2h = <0x00>;
- lantiq,led2l = <0x03>;
- };
- };
-};
diff --git a/target/linux/lantiq/dts/VG3503J_V2.dts b/target/linux/lantiq/dts/VG3503J_V2.dts
deleted file mode 100644
index 005d5bc1ad..0000000000
--- a/target/linux/lantiq/dts/VG3503J_V2.dts
+++ /dev/null
@@ -1,11 +0,0 @@
-/dts-v1/;
-
-/include/ "VG3503J.dtsi"
-
-/ {
- gphy-xrx200 {
- compatible = "lantiq,phy-xrx200";
- firmware = "lantiq/vr9_phy22f_a2x.bin";
- phys = [ 00 01 ];
- };
-};
diff --git a/target/linux/lantiq/dts/VGV7510KW22.dtsi b/target/linux/lantiq/dts/VGV7510KW22.dtsi
index c9045fa7ef..1abdc20b1d 100644
--- a/target/linux/lantiq/dts/VGV7510KW22.dtsi
+++ b/target/linux/lantiq/dts/VGV7510KW22.dtsi
@@ -49,24 +49,12 @@
pinctrl-0 = <&state_default>;
state_default: pinmux {
- ip101a-rst {
- lantiq,pins = "io46";
- lantiq,output = <0>;
- lantiq,pull = <1>;
- };
gphy-leds {
- lantiq,groups = "gphy0 led1",
+ lantiq,groups = "gphy0 led0", "gphy0 led1",
"gphy1 led0", "gphy1 led1";
lantiq,function = "gphy";
lantiq,open-drain = <0>;
- lantiq,pull = <0>;
- lantiq,output = <1>;
- };
- stp {
- lantiq,groups = "stp";
- lantiq,function = "stp";
lantiq,pull = <2>;
- lantiq,open-drain = <0>;
lantiq,output = <1>;
};
mdio {
@@ -79,26 +67,9 @@
lantiq,pull = <0>;
lantiq,output = <1>;
};
- spi {
- lantiq,groups = "spi_di", "spi_do", "spi_clk";
- lantiq,function = "spi";
- };
};
};
- stp: stp@E100BB0 {
- compatible = "lantiq,gpio-stp-xway";
- reg = <0xE100BB0 0x40>;
- #gpio-cells = <2>;
- gpio-controller;
-
- lantiq,shadow = <0xff>;
- lantiq,groups = <0x1>;
- lantiq,dsl = <0x0>;
- lantiq,phy1 = <0x7>;
- lantiq,phy2 = <0x7>; /* enable gphy0 led2 = LAN2 LED */
- };
-
ifxhcd@E101000 {
status = "okay";
gpios = <&gpio 47 0>;
@@ -237,11 +208,33 @@
};
};
+ wan: interface@1 {
+ compatible = "lantiq,xrx200-pdi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ mtd-mac-address = <&boardconfig 0x16>;
+ mtd-mac-address-increment = <2>;
+ lantiq,wan;
+
+ ethernet@0 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <0>;
+ phy-mode = "mii";
+ phy-handle = <&phy1>;
+ };
+ };
+
mdio@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "lantiq,xrx200-mdio";
+ phy1: ethernet-phy@1 {
+ reg = <0x1>;
+ compatible = "ethernet-phy-id0243.0c54", "ethernet-phy-ieee802.3-c22";
+ };
+
phy11: ethernet-phy@11 {
reg = <0x11>;
compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
diff --git a/target/linux/lantiq/dts/VGV7519.dtsi b/target/linux/lantiq/dts/VGV7519.dtsi
index 95de6e56e7..ad6393e12e 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -23,54 +23,44 @@
};
fpi@10000000 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "lantiq,fpi", "simple-bus";
- ranges = <0x0 0x10000000 0xEEFFFFF>;
- reg = <0x10000000 0xEF00000>;
-
localbus@0 {
- #address-cells = <2>;
- #size-cells = <1>;
- compatible = "lantiq,localbus", "simple-bus";
+ nor-boot@0 {
+ compatible = "lantiq,nor";
+ bank-width = <2>;
+ reg = <0 0x0 0x800000>, <1 0x800000 0x800000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ boardconfig: partition@40000 {
+ label = "board_config";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+ };
+ };
};
gpio: pinmux@E100B10 {
- compatible = "lantiq,pinctrl-xr9";
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
- interrupt-parent = <&icu0>;
- interrupts = <166 135 66 40 41 42 38>;
-
- #gpio-cells = <2>;
- gpio-controller;
- reg = <0xE100B10 0xA0>;
-
state_default: pinmux {
stp {
lantiq,groups = "stp";
lantiq,function = "stp";
- };
- spi {
- lantiq,groups = "spi_di", "spi_do", "spi_clk";
- lantiq,function = "spi";
+ lantiq,open-drain = <0>;
+ lantiq,output = <1>;
+ lantiq,pull = <0>;
};
mdio {
lantiq,groups = "mdio";
lantiq,function = "mdio";
};
- gphy-leds_out {
- lantiq,pins = "io7", "io44";
- lantiq,pull = <0>;
- lantiq,output = <1>;
- };
- stp_out {
- lantiq,pins = "io4", "io5", "io6";
- lantiq,open-drain = <0>;
- lantiq,output = <1>;
- lantiq,pull = <0>;
- };
pci-rst {
lantiq,pins = "io21";
lantiq,open-drain = <0>;
@@ -109,19 +99,7 @@
pci@E105400 {
status = "okay";
- #address-cells = <3>;
- #size-cells = <2>;
- #interrupt-cells = <1>;
- compatible = "lantiq,pci-xway";
- bus-range = <0x0 0x0>;
- ranges = <0x2000000 0 0x8000000 0x8000000 0 0x2000000 /* pci memory */
- 0x1000000 0 0x00000000 0xAE00000 0 0x200000>; /* io space */
- reg = <0x7000000 0x8000 /* config space */
- 0xE105400 0x400>; /* pci bridge */
lantiq,bus-clock = <33333333>;
- /*lantiq,external-clock;*/
- lantiq,delay-hi = <0>; /* 0ns delay */
- lantiq,delay-lo = <0>; /* 0.0ns delay */
interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
interrupt-map = <
0x7000 0 0 1 &icu0 30 1 // slot 14, irq 30
@@ -243,7 +221,8 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
- mac-address = [ 00 11 22 33 44 55 ];
+ mtd-mac-address = <&boardconfig 0x16>;
+ lantiq,switch;
ethernet@0 {
compatible = "lantiq,xrx200-pdi-port";
@@ -276,8 +255,10 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
- mac-address = [ 00 11 22 33 44 56 ];
+ mtd-mac-address = <&boardconfig 0x16>;
+ mtd-mac-address-increment = <2>;
lantiq,wan;
+
ethernet@5 {
compatible = "lantiq,xrx200-pdi-port";
reg = <5>;
@@ -293,27 +274,22 @@
phy0: ethernet-phy@0 {
reg = <0x0>;
compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
- lantiq,c45-reg-init = <1 0 0 0>;
};
phy1: ethernet-phy@1 {
reg = <0x1>;
compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
- lantiq,c45-reg-init = <1 0 0 0>;
};
phy5: ethernet-phy@5 {
reg = <0x5>;
compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
- lantiq,c45-reg-init = <1 0 0 0>;
};
phy11: ethernet-phy@11 {
reg = <0x11>;
compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
- lantiq,c45-reg-init = <1 0 0 0>;
};
phy13: ethernet-phy@13 {
reg = <0x13>;
compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
- lantiq,c45-reg-init = <1 0 0 0>;
};
};
};
diff --git a/target/linux/lantiq/dts/VGV7519BRN.dts b/target/linux/lantiq/dts/VGV7519BRN.dts
index 4f56ba8974..b225acf57d 100644
--- a/target/linux/lantiq/dts/VGV7519BRN.dts
+++ b/target/linux/lantiq/dts/VGV7519BRN.dts
@@ -6,31 +6,62 @@
/ {
fpi@10000000 {
localbus@0 {
- nor-flash@0 {
- compatible = "lantiq,nor", "cfi-flash";
- bank-width = <2>;
- reg = <0 0x0 0x800000>, <1 0x800000 0x800000>;
- #address-cells = <1>;
- #size-cells = <1>;
-
+ nor-boot@0 {
partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
+ partition@0 {
+ label = "Boot";
+ reg = <0x00000 0x40000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "Certificate";
+ reg = <0x50000 0x10000>;
+ read-only;
+ };
+ partition@60000 {
+ label = "Special_Area";
+ reg = <0x60000 0x10000>;
+ read-only;
+ };
- partition@40000 {
- label = "board_config";
- reg = <0x40000 0x10000>;
+ partition@70000 {
+ label = " Reserve_0";
+ reg = <0x70000 0x10000>;
read-only;
};
+
partition@80000 {
- label = "firmware";
+ label = "Code_Image_0";
reg = <0x80000 0x780000>;
+ brnboot,root-id = <0x00>;
+ read-only;
+ };
+
+ partition@4000000 {
+ compatible = "brnboot,root-selector";
+ label = "Primary_Setting";
+ reg = <0x4000000 0x10000>;
+ read-only;
+ };
+
+ partition@4010000 {
+ label = "Configuration";
+ reg = <0x4010000 0x60000>;
read-only;
};
- partition@880000 {
- label = "rootfs_data";
- reg = <0x880000 0x780000>;
+
+ partition@4070000 {
+ label = " Reserve_1";
+ reg = <0x4070000 0x10000>;
+ read-only;
+ };
+
+ partition@4080000 {
+ label = "Code_Image_1";
+ reg = <0x4080000 0x780000>;
+ brnboot,root-id = <0x01>;
+ read-only;
};
};
};
diff --git a/target/linux/lantiq/dts/VGV7519NOR.dts b/target/linux/lantiq/dts/VGV7519NOR.dts
index 24a3d1666a..69b0a1f450 100644
--- a/target/linux/lantiq/dts/VGV7519NOR.dts
+++ b/target/linux/lantiq/dts/VGV7519NOR.dts
@@ -7,26 +7,11 @@
fpi@10000000 {
localbus@0 {
nor-boot@0 {
- compatible = "lantiq,nor";
- bank-width = <2>;
- reg = <0 0x0 0x800000>, <1 0x800000 0x800000>;
- #address-cells = <1>;
- #size-cells = <1>;
-
partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
partition@0 {
label = "uboot";
reg = <0x00000 0x40000>;
};
- partition@40000 {
- label = "board_config";
- reg = <0x40000 0x10000>;
- read-only;
- };
partition@60000 {
label = "uboot_env";
reg = <0x60000 0x10000>;
@@ -34,9 +19,6 @@
partition@80000 {
label = "firmware";
reg = <0x80000 0xf80000>;
- // 0x080000 - 0x01b0000 : kernel
- // 0x1b0000 - 0x1000000 : rootfs (squashfs)
- // 0x390000 - 0x1000000 : rootfs_data
};
};
};
diff --git a/target/linux/lantiq/dts/WBMR300.dts b/target/linux/lantiq/dts/WBMR300.dts
new file mode 100644
index 0000000000..824efb7cc0
--- /dev/null
+++ b/target/linux/lantiq/dts/WBMR300.dts
@@ -0,0 +1,303 @@
+/dts-v1/;
+
+/include/ "vr9.dtsi"
+
+/ {
+ model = "WBMR300 - Buffalo WBMR-300HPD";
+
+ chosen {
+ bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+
+ leds {
+ boot = &power_g;
+ failsafe = &diag_r;
+ running = &power_g;
+
+ dsl = &dsl;
+ internet = &router_g;
+ wifi = &wifi_g;
+ };
+ };
+
+ memory@0 {
+ reg = <0x0 0x4000000>;
+ };
+
+ fpi@10000000 {
+ gpio: pinmux@E100B10 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&state_default>;
+
+ state_default: pinmux {
+ mdio {
+ lantiq,groups = "mdio";
+ lantiq,function = "mdio";
+ };
+ phy-rst {
+ lantiq,pins = "io42";
+ lantiq,pull = <0>;
+ lantiq,open-drain = <0>;
+ lantiq,output = <1>;
+ };
+ pcie-rst {
+ lantiq,pins = "io38";
+ lantiq,pull = <0>;
+ lantiq,output = <1>;
+ };
+ };
+ pins_spi_default: pins_spi_default {
+ spi_in {
+ lantiq,groups = "spi_di";
+ lantiq,function = "spi";
+ };
+ spi_out {
+ lantiq,groups = "spi_do", "spi_clk",
+ "spi_cs4";
+ lantiq,function = "spi";
+ lantiq,output = <1>;
+ };
+ };
+ };
+
+ ifxhcd@E101000 {
+ status = "okay";
+ gpios = <&gpio 33 0>;
+ lantiq,portmask = <0x3>;
+ };
+
+ ifxhcd@E106000 {
+ status = "okay";
+ gpios = <&gpio 33 0>;
+ };
+ };
+
+ gphy-xrx200 {
+ compatible = "lantiq,phy-xrx200";
+ firmware = "lantiq/vr9_phy22f_a2x.bin";
+ phys = [ 00 01 ];
+ };
+
+ gpio_poweroff {
+ compatible = "gpio-poweroff";
+ gpios = <&gpio 6 1>;
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <100>;
+
+ power {
+ label = "power";
+ gpios = <&gpio 5 1>;
+ linux,code = <0x74>;
+ };
+
+ reset {
+ label = "reset";
+ gpios = <&gpio 7 1>;
+ linux,code = <0x198>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&gpio 31 1>;
+ linux,code = <0x211>;
+ };
+
+ auto {
+ label = "auto";
+ gpios = <&gpio 48 0>;
+ linux,code = <0x100>;
+ linux,input-type = <5>; /* EV_SW */
+ };
+
+ router {
+ label = "router";
+ gpios = <&gpio 2 0>;
+ linux,code = <0x100>;
+ linux,input-type = <5>; /* EV_SW */
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ diag_r: diag_r {
+ label = "wbmr300:red:diag";
+ gpios = <&gpio 0 0>;
+ default_state = "off";
+ };
+
+ wifi_g: wifi_g {
+ label = "wbmr300:green:wifi";
+ gpios = <&gpio 1 0>;
+ };
+
+ dsl: dsl {
+ label = "dsl";
+ gpios = <&gpio 4 0>;
+ };
+
+ router_y: router_y {
+ label = "wbmr300:yellow:router";
+ gpios = <&gpio 8 0>;
+ };
+
+ wifi_y: wifi_y {
+ label = "wbmr300:yellow:wifi";
+ gpios = <&gpio 9 0>;
+ };
+
+ lan1: lan1 {
+ label = "wbmr300:green:lan1";
+ gpios = <&gpio 11 0>;
+ };
+
+ wan: wan {
+ label = "wbmr300:green:wan";
+ gpios = <&gpio 12 0>;
+ };
+
+ lan3: lan3 {
+ label = "wbmr300:green:lan3";
+ gpios = <&gpio 15 0>;
+ };
+
+ lan2: lan2 {
+ label = "wbmr300:green:lan2";
+ gpios = <&gpio 33 0>;
+ };
+
+ internet_g: internet_g {
+ label = "wbmr300:green:internet";
+ gpios = <&gpio 34 0>;
+ };
+
+ internet_y: internet_y {
+ label = "wbmr300:yellow:internet";
+ gpios = <&gpio 35 0>;
+ };
+
+ router_g: router_g {
+ label = "wbmr300:green:router";
+ gpios = <&gpio 36 0>;
+ };
+
+ power_g: power_g {
+ label = "wbmr300:green:power";
+ gpios = <&gpio 49 0>;
+ };
+ };
+};
+
+&spi {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pins_spi_default>;
+
+ status = "ok";
+ m25p80@4 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <4 0>;
+ spi-max-frequency = <20000000>;
+
+ partition@0 {
+ reg = <0x0 0x10000>;
+ label = "u-boot";
+ read-only;
+ };
+
+ partition@10000 {
+ reg = <0x10000 0x10000>;
+ label = "gphyfirmware";
+ read-only;
+ };
+
+ partition@20000 {
+ reg = <0x20000 0x80000>;
+ label = "dsl_fw";
+ };
+
+ partition@de0000 {
+ reg = <0xa0000 0xf40000>;
+ label = "firmware";
+ };
+
+ partition@fe0000 {
+ reg = <0xfe0000 0x10000>;
+ label = "sysconfig";
+ read-only;
+ };
+
+ partition@ff0000 {
+ reg = <0xff0000 0x2000>;
+ label = "ubootconfig";
+ };
+
+ partition@ff3000 {
+ reg = <0xff3000 0x2000>;
+ label = "board_config";
+ read-only;
+ };
+ };
+};
+
+&eth0 {
+ lan: interface@0 {
+ compatible = "lantiq,xrx200-pdi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ lantiq,switch;
+
+ ethernet@1 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <4>;
+ phy-mode = "mii";
+ phy-handle = <&phy13>;
+ };
+ ethernet@2 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <5>;
+ phy-mode = "mii";
+ phy-handle = <&phy14>;
+ };
+ ethernet@3 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <2>;
+ phy-mode = "mii";
+ phy-handle = <&phy11>;
+ };
+ ethernet@4 {
+ compatible = "lantiq,xrx200-pdi-port";
+ reg = <3>;
+ phy-mode = "mii";
+ phy-handle = <&phy12>;
+ };
+ };
+
+ mdio@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "lantiq,xrx200-mdio";
+ phy11: ethernet-phy@11 {
+ reg = <0x11>;
+ compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
+ };
+ phy12: ethernet-phy@12 {
+ reg = <0x12>;
+ compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
+ };
+ phy13: ethernet-phy@13 {
+ reg = <0x13>;
+ compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
+ };
+ phy14: ethernet-phy@14 {
+ reg = <0x14>;
+ compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
+ };
+ };
+};
diff --git a/target/linux/lantiq/dts/amazonse.dtsi b/target/linux/lantiq/dts/amazonse.dtsi
index c0bba436d1..c586106359 100644
--- a/target/linux/lantiq/dts/amazonse.dtsi
+++ b/target/linux/lantiq/dts/amazonse.dtsi
@@ -45,7 +45,7 @@
compatible = "lantiq,eiu-xway";
reg = <0x101000 0x1000>;
interrupt-parent = <&icu0>;
- interrupts = <29 30 31>;
+ lantiq,eiu-irqs = <29 30 31>;
};
pmu0: pmu@102000 {
diff --git a/target/linux/lantiq/dts/ar9.dtsi b/target/linux/lantiq/dts/ar9.dtsi
index 9feb8a0e51..e67bcc2a10 100644
--- a/target/linux/lantiq/dts/ar9.dtsi
+++ b/target/linux/lantiq/dts/ar9.dtsi
@@ -50,7 +50,7 @@
compatible = "lantiq,eiu-xway";
reg = <0x101000 0x1000>;
interrupt-parent = <&icu0>;
- interrupts = <166 135 66 40 41 42>;
+ lantiq,eiu-irqs = <166 135 66 40 41 42>;
};
pmu0: pmu@102000 {
diff --git a/target/linux/lantiq/dts/danube.dtsi b/target/linux/lantiq/dts/danube.dtsi
index 0a75fd9d45..a785af4266 100644
--- a/target/linux/lantiq/dts/danube.dtsi
+++ b/target/linux/lantiq/dts/danube.dtsi
@@ -54,7 +54,7 @@
compatible = "lantiq,eiu-xway";
reg = <0x101000 0x1000>;
interrupt-parent = <&icu0>;
- interrupts = <166 135 66>;
+ lantiq,eiu-irqs = <166 135 66>;
};
pmu0: pmu@102000 {
diff --git a/target/linux/lantiq/dts/vr9.dtsi b/target/linux/lantiq/dts/vr9.dtsi
index aa34a5f3e7..15d73a50be 100644
--- a/target/linux/lantiq/dts/vr9.dtsi
+++ b/target/linux/lantiq/dts/vr9.dtsi
@@ -50,7 +50,7 @@
compatible = "lantiq,eiu-xway";
reg = <0x101000 0x1000>;
interrupt-parent = <&icu0>;
- interrupts = <166 135 66 40 41 42>;
+ lantiq,eiu-irqs = <166 135 66 40 41 42>;
};
pmu0: pmu@102000 {
diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile
index bc74e4f697..e0a28c227f 100644
--- a/target/linux/lantiq/image/Makefile
+++ b/target/linux/lantiq/image/Makefile
@@ -57,15 +57,6 @@ define Image/Build/squashfs
$(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image)
endef
-define Image/BuildNAND/squashfs
-
-ifneq ($($(PROFILE)_UBI_OPTS),)
- $(call prepare_generic_squashfs,$(KDIR)/root.$(1))
- $(call Image/Build/UbinizeImage,$(PROFILE),,squashfs,$($(PROFILE)_UBI_OPTS))
- $(call Image/Build/SysupgradeNAND,$(PROFILE),$(1),$(KDIR)/uImage-$(PROFILE))
-endif
-endef
-
DGN3500_SKERNEL=0x50000
DGN3500_SKERNEL_DECIMAL=327680
define Image/BuildDGN3500/squashfs
@@ -108,21 +99,6 @@ define Image/BuildEVA/squashfs
$(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image.eva)
endef
-define Image/BuildEVA/ubifs
-
-ifneq ($($(PROFILE)_UBIFS_OPTS),)
- $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubifs
-endif
-endef
-
-define Image/BuildEVA/ubi
-
-ifneq ($($(PROFILE)_UBI_OPTS),)
- $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubi
- $(CP) $(KDIR)/root-overlay.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs-overlay.ubi
-endif
-endef
-
define Image/BuildLoader/squashfs
dd if=$(KDIR)/loader-$(2).bin of=$(KDIR)/loader-$(2).bin.padded bs=3072k conv=sync
cat $(KDIR)/loader-$(2).bin.padded $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
@@ -148,85 +124,45 @@ define Image/Build/jffs2-256k
cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
endef
-define Image/Build/ubifs
-
-ifneq ($($(PROFILE)_UBIFS_OPTS),)
- $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubifs
-endif
-endef
-
-define Image/Build/ubi
-
-ifneq ($($(PROFILE)_UBI_OPTS),)
- $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubi
- $(CP) $(KDIR)/root-overlay.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs-overlay.ubi
-endif
-endef
-
-
-define Image/BuildNAND/ubifs
-
-ifneq ($($(PROFILE)_UBIFS_OPTS),)
-ifneq ($($(PROFILE)_UBI_OPTS),)
- $(call Image/Build/UbinizeImage,$(PROFILE),,ubifs,$($(PROFILE)_UBI_OPTS))
- $(call Image/Build/SysupgradeNAND,$(PROFILE),$(1),$(KDIR)/uImage-$(PROFILE))
-endif
-endif
-endef
-
-
-define Image/InstallKernel/Template
-
-ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
- $(INSTALL_DIR) $(TARGET_DIR)/boot
-
-ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE),)
- $(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage $(TARGET_DIR)/boot/
- ln -sf $(IMG_PREFIX)-$(1)-uImage $(TARGET_DIR)/boot/uImage
-endif
-
-ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE),)
- $(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-zImage $(TARGET_DIR)/boot/
- ln -sf $(IMG_PREFIX)-$(1)-zImage $(TARGET_DIR)/boot/zImage
-endif
-endif
-
-ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),)
- $(INSTALL_DIR) $(TARGET_DIR)/boot
-
-ifneq ($(1),)
- $(CP) $(KDIR)/$(1).dtb $(TARGET_DIR)/boot/
-endif
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+ define Image/BuildKernel/InitramfsTemplate
+ $(call PatchKernelLzma,$(1),-initramfs)
+ $(call MkImageLzma,$(1),-initramfs)
+ $(CP) $(KDIR)/uImage-$(1)-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage-initramfs
+ endef
endif
-endef
define Image/BuildKernel/Template
$(call PatchKernelLzma,$(1))
$(call MkImageLzma,$(1))
$(CP) $(KDIR)/uImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage
-ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
- $(call PatchKernelLzma,$(1),-initramfs)
- $(call MkImageLzma,$(1),-initramfs)
- $(CP) $(KDIR)/uImage-$(1)-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage-initramfs
-endif
+ $(Image/BuildKernel/InitramfsTemplate)
endef
-define Image/BuildKernelLoader/Template
- $(CP) $(KDIR)/loader-$(1).bin $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-loader
- $(CP) $(KDIR)/vmlinux-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+ define Image/BuildKernelLoader/InitramfsTemplate
$(CP) $(KDIR)/loader-initramfs-$(1).bin $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-initramfs-loader
$(CP) $(KDIR)/vmlinux-initramfs-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-initramfs
+ endef
endif
+
+define Image/BuildKernelLoader/Template
+ $(CP) $(KDIR)/loader-$(1).bin $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-loader
+ $(CP) $(KDIR)/vmlinux-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux
+ $(Image/BuildKernelLoader/InitramfsTemplate)
endef
-define Image/Prepare/Profile
- $(call PatchKernelLzma,$(1))
- $(call Image/BuildLoader/Template,$(1))
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+ define Image/Prepare/InitramfsTemplate
$(call PatchKernelLzma,$(1),-initramfs)
$(call Image/BuildLoader/Template,$(1),-initramfs)
+ endef
endif
+
+define Image/Prepare/Template
+ $(call PatchKernelLzma,$(1))
+ $(call Image/BuildLoader/Template,$(1))
+ $(Image/Prepare/InitramfsTemplate)
endef
define Image/BuildKernelEVA/Template
@@ -234,12 +170,6 @@ define Image/BuildKernelEVA/Template
$(call MkImageEVA,$(1))
$(CP) $(KDIR)/$(1).eva.align.64k $(BIN_DIR)/$(IMG_PREFIX)-$(1).eva.align.64k
$(CP) $(KDIR)/$(1).eva.align.128k $(BIN_DIR)/$(IMG_PREFIX)-$(1).eva.align.128k
-ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
- $(call PatchKernelLzma,$(1),-initramfs)
- $(call MkImageEVA,$(1),-initramfs)
- $(CP) $(KDIR)/$(1)-initramfs.eva.align.64k $(BIN_DIR)/$(IMG_PREFIX)-$(1)-initramfs.eva.align.64k
- $(CP) $(KDIR)/$(1)-initramfs.eva.align.128k $(BIN_DIR)/$(IMG_PREFIX)-$(1)-initramfs.eva.align.128k
-endif
endef
@@ -249,18 +179,6 @@ define Build/append-dtb
cat $@.dtb >> $@
endef
-define Build/tplink-fw
- mktplinkfw2 -c -B $(BOARD_ID) -s \
- -k $@ -o $@.new
- mv $@.new $@
-endef
-
-define Build/mktplinkfw2
- mktplinkfw2 -B $(BOARD_ID) -s -a 0x4 -j \
- -k $(word 1,$^) -r $(word 2,$^) \
- -o $@
-endef
-
define Build/mkbrncmdline
mkbrncmdline -i $@ -o $@.new BRN-BOOT
mv $@.new $@
@@ -270,6 +188,21 @@ define Build/mkbrnimg
mkbrnimg -s $(SIGNATURE) -m $(MAGIC) -p $(CRC32_POLY) -o $@ $(word 1,$^) $(word 2,$^)
endef
+define Build/fullimage
+ mkimage -A mips -O linux -C lzma -T filesystem -a 0x00 \
+ -e 0x00 -n 'LEDE RootFS' \
+ -d $(word 2,$^) $(word 2,$^).new
+
+ cat $(word 1,$^) $(word 2,$^).new > $@.tmp
+
+ mkimage -A mips -O linux -T multi -a 0x00 -C none \
+ -e 0x00 -n 'OpenWrt fullimage' \
+ -d $@.tmp $@
+
+ rm $(word 2,$^).new
+ rm $@.tmp
+endef
+
# Shared device definition: applies to every defined device
define Device/Default
PROFILES = Default $$(DEVICE_PROFILE)
@@ -279,172 +212,585 @@ define Device/Default
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
FILESYSTEMS := squashfs
DEVICE_PROFILE :=
- DEVICE_DTS :=
- IMAGES := sysupgrade.bin
- IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs
-endef
-DEVICE_VARS += DEVICE_PROFILE DEVICE_DTS
-
-define Device/lantiqTpLink
- KERNEL := kernel-bin | append-dtb | lzma
- KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | tplink-fw
+ DEVICE_DTS = $$(DEVICE_PROFILE)
+ IMAGE_SIZE :=
IMAGES := sysupgrade.bin
- IMAGE/sysupgrade.bin := mktplinkfw2
+ IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
endef
-DEVICE_VARS += BOARD_ID
+DEVICE_VARS += DEVICE_PROFILE DEVICE_DTS IMAGE_SIZE
define Device/lantiqBrnImage
KERNEL := kernel-bin | append-dtb | mkbrncmdline | lzma-no-dict
IMAGES := factory.bin
- IMAGE/factory.bin := mkbrnimg
+ IMAGE/factory.bin := mkbrnimg | check-size $$$$(IMAGE_SIZE)
endef
DEVICE_VARS += SIGNATURE MAGIC CRC32_POLY
-define lantiqTpLink
- define Device/$(1)
- $$(Device/lantiqTpLink)
- DEVICE_PROFILE := $(1)
- DEVICE_DTS := $(1)
- BOARD_ID := $(2)
- endef
- TARGET_DEVICES += $(1)
-endef
-
-define lantiqImage
- define Device/$(1)
- $$(Device/lantiqImage)
- DEVICE_PROFILE := $(1)
- DEVICE_DTS := $(if $(2),$(2),$(1))
- endef
- TARGET_DEVICES += $(1)
-endef
-
-define lantiqBrnImage
- define Device/$(1)
- $$(Device/lantiqBrnImage)
- DEVICE_PROFILE := $(1)
- DEVICE_DTS := $(1)
- SIGNATURE := $(2)
- MAGIC := $(3)
- CRC32_POLY := $(4)
- endef
- TARGET_DEVICES += $(1)
-endef
-
-ifeq ($(CONFIG_TARGET_lantiq_falcon),y)
-
-$(eval $(call lantiqImage,EASY98000NOR))
-$(eval $(call lantiqImage,EASY98000SFLASH))
+define Device/lantiqFullImage
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-offset 4 0
+ IMAGES := sysupgrade.bin fullimage.img
+ IMAGE/fullimage.img := fullimage | check-size $$$$(IMAGE_SIZE)
+endef
+
+ifeq ($(SUBTARGET),xway_legacy)
+
+define Device/ARV4520PW
+ DEVICE_PROFILE := ARV4520PW
+ IMAGE_SIZE := 3648k
+ DEVICE_TITLE := Easybox 800, WAV-281 - ARV4520PW
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-rt61-pci wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += ARV4520PW
+
+define Device/ARV4525PW
+ DEVICE_PROFILE := ARV4525PW
+ IMAGE_SIZE := 3776k
+ DEVICE_TITLE := Speedport W502V Typ A - ARV4525PW
+ DEVICE_PACKAGES := kmod-ath5k wpad-mini \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa
+endef
+TARGET_DEVICES += ARV4525PW
+
+define Device/ARV452CQW
+ DEVICE_PROFILE := ARV452CQW
+ IMAGE_SIZE := 3776k
+ DEVICE_TITLE := Easybox 801 - ARV452CQW
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube \
+ kmod-ath5k wpad-mini \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ swconfig
+endef
+TARGET_DEVICES += ARV452CQW
+
+define Device/ARV4518PWR01
+ DEVICE_PROFILE := ARV4518PWR01
+ IMAGE_SIZE := 3776k
+ DEVICE_TITLE := ARV4518PWR01
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ath5k wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += ARV4518PWR01
+
+define Device/ARV4518PWR01A
+ DEVICE_PROFILE := ARV4518PWR01A
+ IMAGE_SIZE := 3776k
+ DEVICE_TITLE := ARV4518PWR01A
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ath5k wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += ARV4518PWR01A
endif
-
-ifeq ($(CONFIG_TARGET_lantiq_ase),y)
-
-$(eval $(call lantiqImage,DGN1000B))
-
-endif
-
-
-ifeq ($(CONFIG_TARGET_lantiq_xway),y)
+ifeq ($(SUBTARGET),xway)
# Danube
+DEVICE_BTHOMEHUBV2B_UBIFS_OPTS:="-m 512 -e 15872 -c 1959"
+DEVICE_BTHOMEHUBV2B_UBI_OPTS:="-m 512 -p 16KiB -s 256"
+
Image/BuildKernel/Profile/BTHOMEHUBV2B=$(call Image/BuildKernel/Template,BTHOMEHUBV2B)
Image/Build/Profile/BTHOMEHUBV2B=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV2B)
-$(eval $(call lantiqImage,EASY50712))
-$(eval $(call lantiqImage,ACMP252))
-$(eval $(call lantiqImage,ARV4510PW))
-$(eval $(call lantiqImage,ARV4525PW))
-$(eval $(call lantiqImage,ARV7525PW))
-$(eval $(call lantiqImage,ARV4518PWR01))
-$(eval $(call lantiqImage,ARV4518PWR01A))
-$(eval $(call lantiqImage,ARV4519PW))
-$(eval $(call lantiqImage,ARV4520PW))
-$(eval $(call lantiqImage,ARV452CQW))
-$(eval $(call lantiqImage,ARV7510PW22))
-$(eval $(call lantiqImage,ARV7518PW))
-$(eval $(call lantiqImage,ARV7519PW))
-$(eval $(call lantiqImage,ARV752DPW))
-$(eval $(call lantiqImage,ARV752DPW22))
-$(eval $(call lantiqImage,ARV8539PW22))
-$(eval $(call lantiqImage,GIGASX76X))
+define LegacyDevice/BTHOMEHUBV2B
+ DEVICE_TITLE := BT Home Hub 2B
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
+ kmod-ltq-deu-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ath9k wpad-mini \
+ swconfig
+endef
+LEGACY_DEVICES += BTHOMEHUBV2B
+
+define Device/EASY50712
+ DEVICE_PROFILE := EASY50712
+ IMAGE_SIZE := 3776k
+ DEVICE_TITLE := Lantiq Danube - EASY50712
+endef
+TARGET_DEVICES += EASY50712
+
+define Device/ACMP252
+ DEVICE_PROFILE := ACMP252
+ IMAGE_SIZE := 14848k
+ DEVICE_TITLE := AudioCodes MediaPack MP-252
+ DEVICE_PACKAGES := kmod-rt2x00-pci wpad-mini \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-a kmod-ltq-ptm-danube \
+ ltq-adsl-app
+endef
+TARGET_DEVICES += ACMP252
+
+define Device/ARV4510PW
+ DEVICE_PROFILE := ARV4510PW
+ IMAGE_SIZE := 15616k
+ DEVICE_TITLE := Wippies, Elisa - ARV4510PW
+ DEVICE_PACKAGES := kmod-ledtrig-usbdev kmod-usb2-pci kmod-usb-uhci \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ltq-tapi kmod-ltq-vmmc \
+ kmod-rt2800-pci kmod-ath5k wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += ARV4510PW
+
+define Device/ARV7525PW
+ DEVICE_PROFILE := ARV7525PW
+ IMAGE_SIZE := 3776k
+ DEVICE_TITLE := Speedport W303V Typ A - ARV7525PW
+ DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa
+endef
+TARGET_DEVICES += ARV7525PW
+
+define Device/ARV4519PW
+ DEVICE_PROFILE := ARV4519PW
+ IMAGE_SIZE := 3776k
+ DEVICE_TITLE := Vodafone, Pirelli - ARV4519PW
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ swconfig
+endef
+TARGET_DEVICES += ARV4519PW
+
+define Device/ARV7510PW22
+ DEVICE_PROFILE := ARV7510PW22
+ IMAGE_SIZE := 31232k
+ DEVICE_TITLE := Astoria - ARV7510PW22
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ltq-tapi kmod-ltq-vmmc \
+ kmod-rt2800-pci wpad-mini \
+ kmod-usb-uhci kmod-usb2 kmod-usb2-pci \
+ swconfig
+endef
+TARGET_DEVICES += ARV7510PW22
+
+define Device/ARV7518PW
+ DEVICE_PROFILE := ARV7518PW
+ IMAGE_SIZE := 7872k
+ DEVICE_TITLE := Astoria - ARV7518PW
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ath9k wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += ARV7518PW
+
+define Device/ARV7519PW
+ DEVICE_PROFILE := ARV7519PW
+ IMAGE_SIZE := 15488k
+ DEVICE_TITLE := Astoria - ARV7519PW
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-rt2800-pci wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += ARV7519PW
+
+define Device/ARV752DPW
+ DEVICE_PROFILE := ARV752DPW
+ IMAGE_SIZE := 7872k
+ DEVICE_TITLE := Easybox 802 - ARV752DPW
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ltq-tapi kmod-ltq-vmmc \
+ kmod-rt2800-pci wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += ARV752DPW
+
+define Device/ARV752DPW22
+ DEVICE_PROFILE := ARV752DPW22
+ IMAGE_SIZE := 7616k
+ DEVICE_TITLE := Easybox 803 - ARV752DPW22
+ DEVICE_PACKAGES := kmod-usb2-pci kmod-usb-uhci kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ltq-tapi kmod-ltq-vmmc \
+ kmod-rt2800-pci wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += ARV752DPW22
+
+define Device/ARV8539PW22
+ DEVICE_PROFILE := ARV8539PW22
+ IMAGE_SIZE := 7616k
+ DEVICE_TITLE := Speedport W504V Typ A - ARV8539PW22
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ath9k wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += ARV8539PW22
+
+define Device/GIGASX76X
+ DEVICE_PROFILE := GIGASX76X
+ IMAGE_SIZE := 7680k
+ DEVICE_TITLE := Gigaset sx76x
+ DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
+ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
+ ltq-adsl-app ppp-mod-pppoe \
+ kmod-ath5k wpad-mini \
+ swconfig
+endef
+TARGET_DEVICES += GIGASX76X
+
# AR9
+DEVICE_BTHOMEHUBV3A_UBIFS_OPTS:="-m 512 -e 15872 -c 1959"
+DEVICE_BTHOMEHUBV3A_UBI_OPTS:="-m 512 -p 16KiB -s 256"
+
Image/BuildKernel/Profile/BTHOMEHUBV3A=$(call Image/BuildKernel/Template,BTHOMEHUBV3A)
Image/Build/Profile/BTHOMEHUBV3A=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV3A)
+define LegacyDevice/BTHOMEHUBV3A
+ DEVICE_TITLE := BT Home Hub 3A
+ DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
+ kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
+ kmod-ltq-deu-ar9 \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ath9k wpad-mini \
+ swconfig uboot-envtools
+endef
+LEGACY_DEVICES += BTHOMEHUBV3A
+
Image/BuildKernel/Profile/DGN3500=$(call Image/BuildKernel/Template,DGN3500)
Image/Build/Profile/DGN3500=$(call Image/BuildDGN3500/$(1),$(1),DGN3500)
+define LegacyDevice/DGN3500
+ DEVICE_TITLE := Netgear DGN3500
+ DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
+ kmod-ath9k wpad-mini \
+ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
+ kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ltq-deu-ar9 swconfig
+endef
+LEGACY_DEVICES += DGN3500
+
Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B)
Image/Build/Profile/DGN3500B=$(call Image/BuildDGN3500B/$(1),$(1),DGN3500B)
-$(eval $(call lantiqImage,WBMRA,WBMR))
-$(eval $(call lantiqImage,WBMRB,WBMR))
+define LegacyDevice/DGN3500B
+ DEVICE_TITLE := Netgear DGN3500B
+ DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
+ kmod-ath9k wpad-mini \
+ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
+ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ltq-deu-ar9 swconfig
+endef
+LEGACY_DEVICES += DGN3500B
+
+define Device/WBMRA
+ DEVICE_PROFILE := WBMRA
+ IMAGE_SIZE := 31488k
+ DEVICE_DTS := WBMR
+ DEVICE_TITLE := Buffalo WBMR-HP-G300H (A) - WBMR
+ DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
+ kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ath9k wpad hostapd-utils \
+ swconfig
+endef
+TARGET_DEVICES += WBMRA
+
+define Device/WBMRB
+ DEVICE_PROFILE := WBMRB
+ IMAGE_SIZE := 31488k
+ DEVICE_DTS := WBMR
+ DEVICE_TITLE := Buffalo WBMR-HP-G300H (B) - WBMR
+ DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
+ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
+ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ath9k wpad hostapd-utils \
+ swconfig
+endef
+TARGET_DEVICES += WBMRB
Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320)
Image/Build/Profile/FRITZ7320=$(call Image/BuildEVA/$(1),$(1),FRITZ7320)
-$(eval $(call lantiqImage,GR7000))
-$(eval $(call lantiqImage,H201L))
-$(eval $(call lantiqImage,P2601HNFX))
+define LegacyDevice/FRITZ7320
+ DEVICE_TITLE := 1&1 HomeServer - FRITZ7320
+ DEVICE_PACKAGES := kmod-ath9k wpad-mini \
+ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
+ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
+ ltq-adsl-app ppp-mod-pppoa \
+ kmod-ltq-deu-ar9 kmod-usb-dwc2 \
+ kmod-ath9k wpad-mini
+endef
+LEGACY_DEVICES += FRITZ7320
+
+define Device/GR7000
+ DEVICE_PROFILE := GR7000
+ IMAGE_SIZE := 7808k
+ DEVICE_TITLE := Aztech GR7000
+ DEVICE_PACKAGES := kmod-ltq-deu-ar9 kmod-usb-dwc2 swconfig
+endef
+TARGET_DEVICES += GR7000
+
+define Device/H201L
+ DEVICE_PROFILE := H201L
+ IMAGE_SIZE := 7808k
+ DEVICE_TITLE := ZTE H201L - H201L
+ DEVICE_PACKAGES := kmod-ath9k-htc wpad-mini \
+ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
+ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
+ ltq-adsl-app ppp-mod-pppoe \
+ kmod-ltq-deu-ar9 kmod-usb-dwc2 \
+ kmod-ltq-tapi kmod-ltq-vmmc \
+ swconfig
+endef
+TARGET_DEVICES += H201L
+
+define Device/P2601HNFX
+ DEVICE_PROFILE := P2601HNFX
+ IMAGE_SIZE := 15616k
+ DEVICE_TITLE := ZyXEL P-2601HN-Fx
+ DEVICE_PACKAGES := kmod-rt2800-usb wpad-mini \
+ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
+ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
+ ltq-adsl-app ppp-mod-pppoe \
+ kmod-ltq-deu-ar9 kmod-usb-dwc2 \
+ swconfig
+endef
+TARGET_DEVICES += P2601HNFX
+
endif
-ifeq ($(CONFIG_TARGET_lantiq_xrx200),y)
+ifeq ($(SUBTARGET),xrx200)
# VR9
+DEVICE_P2812HNUF1_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
+DEVICE_P2812HNUF1_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
+
Image/BuildKernel/Profile/P2812HNUF1=$(call Image/BuildKernel/Template,P2812HNUF1)
Image/Build/Profile/P2812HNUF1=$(call Image/BuildNAND/$(1),$(1),P2812HNUF1)
+define LegacyDevice/P2812HNUF1
+ DEVICE_TITLE := ZyXEL P-2812HNU-F1
+ DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
+endef
+LEGACY_DEVICES += P2812HNUF1
+
+DEVICE_P2812HNUF3_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
+DEVICE_P2812HNUF3_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
+
Image/BuildKernel/Profile/P2812HNUF3=$(call Image/BuildKernel/Template,P2812HNUF3)
Image/Build/Profile/P2812HNUF3=$(call Image/BuildNAND/$(1),$(1),P2812HNUF3)
-$(eval $(call lantiqImage,ARV7519RW22))
+define LegacyDevice/P2812HNUF3
+ DEVICE_TITLE := ZyXEL P-2812HNU-F3
+ DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
+endef
+LEGACY_DEVICES += P2812HNUF3
+
+define Device/ARV7519RW22
+ DEVICE_PROFILE := ARV7519RW22
+ IMAGE_SIZE := 31232k
+ DEVICE_TITLE := Livebox Astoria ARV7519RW22
+ DEVICE_PACKAGES := kmod-usb-dwc2
+endef
+TARGET_DEVICES += ARV7519RW22
+
+
+DEVICE_BTHOMEHUBV5A_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
+DEVICE_BTHOMEHUBV5A_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
Image/BuildKernel/Profile/BTHOMEHUBV5A=$(call Image/BuildKernel/Template,BTHOMEHUBV5A)
Image/Build/Profile/BTHOMEHUBV5A=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV5A)
-$(eval $(call lantiqImage,EASY80920NAND))
-$(eval $(call lantiqImage,EASY80920NOR))
+define LegacyDevice/BTHOMEHUBV5A
+ DEVICE_TITLE := BT Home Hub 5A
+ DEVICE_PACKAGES := kmod-ath9k kmod-ath10k wpad-mini kmod-usb-dwc2
+endef
+LEGACY_DEVICES += BTHOMEHUBV5A
+
+define Device/EASY80920NAND
+ $(Device/lantiqFullImage)
+ DEVICE_PROFILE := EASY80920NAND
+ IMAGE_SIZE := 64512k
+ DEVICE_TITLE := Lantiq VR9 - EASY80920NAND
+ DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
+endef
+TARGET_DEVICES += EASY80920NAND
+
+define Device/EASY80920NOR
+ DEVICE_PROFILE := EASY80920NOR
+ IMAGE_SIZE := 7936k
+ DEVICE_TITLE := Lantiq VR9 - EASY80920NOR
+ DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
+endef
+TARGET_DEVICES += EASY80920NOR
+
+
+DEVICE_FRITZ3370_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
+DEVICE_FRITZ3370_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
Image/BuildKernel/Profile/FRITZ3370=$(call Image/BuildKernelEVA/Template,FRITZ3370)
Image/Build/Profile/FRITZ3370=$(call Image/BuildEVA/$(1),$(1),FRITZ3370)
+define LegacyDevice/FRITZ3370
+ DEVICE_TITLE := Fritz!Box WLan - FRITZ3370
+ DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
+endef
+LEGACY_DEVICES += FRITZ3370
+
+Image/BuildKernel/Profile/FRITZ7360SL=$(call Image/BuildKernelEVA/Template,FRITZ7360SL)
+Image/Build/Profile/FRITZ7360SL=$(call Image/BuildEVA/$(1),$(1),FRITZ7360SL)
+
+define LegacyDevice/FRITZ7360SL
+ DEVICE_TITLE := 1&1 HomeServer - FRITZ7360SL
+ DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
+endef
+LEGACY_DEVICES += FRITZ7360L
+
+Image/Prepare/Profile/VG3503J=$(call Image/Prepare/Template,VG3503J)
Image/BuildKernel/Profile/VG3503J=$(call Image/BuildKernelLoader/Template,VG3503J)
Image/Build/Profile/VG3503J=$(call Image/BuildLoader/$(1),$(1),VG3503J)
-Image/BuildKernel/Profile/VG3503J_V2=$(call Image/BuildKernelLoader/Template,VG3503J_V2)
-Image/Build/Profile/VG3503J_V2=$(call Image/BuildLoader/$(1),$(1),VG3503J_V2)
+define LegacyDevice/VG3503J
+ DEVICE_TITLE := BT Openreak - ECI VDSL Modem
+endef
+LEGACY_DEVICES += VG3503J
+
+include tp-link.mk
-$(eval $(call lantiqTpLink,TDW8970,TD-W8970v1))
-$(eval $(call lantiqTpLink,TDW8980,TD-W8980v1))
-$(eval $(call lantiqTpLink,VR200v,ArcherVR200V))
-$(eval $(call lantiqImage,VGV7510KW22NOR))
-$(eval $(call lantiqBrnImage,VGV7510KW22BRN,BRNDA6431,0x12345678,0x04c11db7))
-$(eval $(call lantiqImage,VGV7519NOR))
-$(eval $(call lantiqBrnImage,VGV7519BRN,5D00008000,0x12345678,0x2083b8ed))
+define Device/WBMR300
+ DEVICE_PROFILE := WBMR300
+ IMAGE_SIZE := 15616k
+ DEVICE_TITLE := Buffalo WBMR-300HPD
+ DEVICE_PACKAGES := kmod-mt76 wpad-mini kmod-usb-dwc2
+endef
+TARGET_DEVICES += WBMR300
+
+define Device/VGV7510KW22NOR
+ DEVICE_PROFILE := VGV7510KW22NOR
+ IMAGE_SIZE := 15232k
+ DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (NOR)
+ DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
+endef
+TARGET_DEVICES += VGV7510KW22NOR
+
+define Device/VGV7510KW22BRN
+ $(Device/lantiqBrnImage)
+ DEVICE_PROFILE := VGV7510KW22BRN
+ IMAGE_SIZE := 7168k
+ SIGNATURE := 5D00008000
+ MAGIC := 0x12345678
+ CRC32_POLY := 0x2083b8ed
+ DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (BRN)
+ DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
+endef
+TARGET_DEVICES += VGV7510KW22BRN
-define Image/Prepare
- $(call Image/Prepare/Profile,$(PROFILE))
+define Device/VGV7519NOR
+ DEVICE_PROFILE := VGV7519NOR
+ IMAGE_SIZE := 15360k
+ DEVICE_TITLE := Experiabox 8 VGV7519
+ DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
endef
+TARGET_DEVICES += VGV7519NOR
+
+define Device/VGV7519BRN
+ $(Device/lantiqBrnImage)
+ DEVICE_PROFILE := VGV7519BRN
+ IMAGE_SIZE := 7168k
+ SIGNATURE := 5D00008000
+ MAGIC := 0x12345678
+ CRC32_POLY := 0x2083b8ed
+ DEVICE_TITLE := Experiabox 8 VGV7519 (BRN)
+ DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
+endef
+TARGET_DEVICES += VGV7519BRN
endif
+ifneq ($($(PROFILE)_UBI_OPTS),)
+ define Image/BuildNAND/squashfs
+ $(call prepare_generic_squashfs,$(KDIR)/root.$(1))
+ $(call Image/Build/UbinizeImage,$(2),,squashfs,$($(PROFILE)_UBI_OPTS))
+ $(call Image/Build/SysupgradeNAND,$(2),$(1),$(KDIR)/uImage-$(2))
+ endef
+
+ define Image/Build/ubifs
+ $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs.ubifs
+ endef
-define Image/BuildKernel
- $(call Image/BuildKernel/Profile/$(PROFILE))
+ define Image/Build/ubi
+ $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs.ubi
+ $(CP) $(KDIR)/root-overlay.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs-overlay.ubi
+ endef
+
+ define Image/BuildEVA/ubi
+ $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs.ubi
+ $(CP) $(KDIR)/root-overlay.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs-overlay.ubi
+ endef
+
+ifneq ($($(PROFILE)_UBIFS_OPTS),)
+ define Image/BuildNAND/ubifs
+ $(call Image/Build/UbinizeImage,$(2),,ubifs,$($(PROFILE)_UBI_OPTS))
+ $(call Image/Build/SysupgradeNAND,$(2),$(1),$(KDIR)/uImage-$(2))
+ endef
+
+ define Image/BuildEVA/ubifs
+ $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs.ubifs
+ endef
+endif
+endif
+
+define Image/Prepare/Profile
+ $(call Image/Prepare/Profile/$(1))
endef
-define Image/InstallKernel
- $(call Image/InstallKernel/Template/$(PROFILE))
+define Image/BuildKernel/Profile
+ $(call Image/BuildKernel/Profile/$(1))
endef
-define Image/Build
- $(call Image/Build/Profile/$(PROFILE),$(1))
+define Image/Build/Profile
+ $(call Image/Build/Profile/$(1),$(2))
endef
$(eval $(call BuildImage))
diff --git a/target/linux/lantiq/image/tp-link.mk b/target/linux/lantiq/image/tp-link.mk
new file mode 100644
index 0000000000..554419185f
--- /dev/null
+++ b/target/linux/lantiq/image/tp-link.mk
@@ -0,0 +1,48 @@
+define Build/tplink-fw
+ mktplinkfw2 -c -B $(BOARD_ID) -s \
+ -k $@ -o $@.new
+ mv $@.new $@
+endef
+
+define Build/mktplinkfw2
+ mktplinkfw2 -B $(BOARD_ID) -s -a 0x4 -j \
+ -k $(word 1,$^) -r $(word 2,$^) \
+ -o $@
+endef
+DEVICE_VARS += BOARD_ID
+
+define Device/lantiqTpLink
+ KERNEL := kernel-bin | append-dtb | lzma
+ KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | tplink-fw
+ IMAGES := sysupgrade.bin
+ IMAGE/sysupgrade.bin := mktplinkfw2 | check-size $$$$(IMAGE_SIZE)
+endef
+
+define Device/TDW8970
+ $(Device/lantiqTpLink)
+ DEVICE_PROFILE := TDW8970
+ BOARD_ID := TD-W8970v1
+ IMAGE_SIZE := 7680k
+ DEVICE_TITLE := TP-LINK TD-W8970
+ DEVICE_PACKAGES:= kmod-ath9k wpad-mini kmod-usb-dwc2 kmod-ledtrig-usbdev
+endef
+
+define Device/TDW8980
+ $(Device/lantiqTpLink)
+ DEVICE_PROFILE := TDW8980
+ BOARD_ID := TD-W8980v1
+ IMAGE_SIZE := 7680k
+ DEVICE_TITLE := TP-LINK TD-W8980
+ DEVICE_PACKAGES:= kmod-ath9k wpad-mini kmod-usb-dwc2 kmod-ledtrig-usbdev
+endef
+
+define Device/VR200v
+ $(Device/lantiqTpLink)
+ DEVICE_PROFILE := VR200v
+ BOARD_ID := ArcherVR200V
+ IMAGE_SIZE := 15808k
+ DEVICE_TITLE := TP-LINK Archer VR200v
+ DEVICE_PACKAGES:= kmod-usb-dwc2 kmod-ledtrig-usbdev
+endef
+TARGET_DEVICES += TDW8970 TDW8980 VR200v
+
diff --git a/target/linux/lantiq/patches-4.4/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch b/target/linux/lantiq/patches-4.4/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
index 93bb4275ec..3af676297d 100644
--- a/target/linux/lantiq/patches-4.4/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
+++ b/target/linux/lantiq/patches-4.4/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
@@ -163,8 +163,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ /* Clear all pending interrupts */
+ phy_read(phydev, MII_VR9_11G_ISTAT);
+
-+ vr9_gphy_mmd_write(phydev, 0x1e0, 0xc5);
-+ vr9_gphy_mmd_write(phydev, 0x1e1, 0x67);
++ vr9_gphy_mmd_write(phydev, 0x1e0, 0xc0);
++ vr9_gphy_mmd_write(phydev, 0x1e1, 0x00);
+ vr9_gphy_mmd_write(phydev, 0x1e2, 0x70);
+ vr9_gphy_mmd_write(phydev, 0x1e3, 0x03);
+ vr9_gphy_mmd_write(phydev, 0x1e4, 0x70);
diff --git a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
index 3250a9b441..07df336d2f 100644
--- a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
+++ b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
@@ -209,7 +209,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+};
--- /dev/null
+++ b/drivers/net/ethernet/lantiq_xrx200.c
-@@ -0,0 +1,1801 @@
+@@ -0,0 +1,1830 @@
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
@@ -234,6 +234,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/clk.h>
++#include <linux/if_vlan.h>
+#include <asm/delay.h>
+
+#include <linux/of_net.h>
@@ -248,14 +249,9 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+
+#define SW_POLLING
+#define SW_ROUTING
-+/* #define SW_PORTMAP */
+
+#ifdef SW_ROUTING
-+ #ifdef SW_PORTMAP
+#define XRX200_MAX_DEV 2
-+ #else
-+#define XRX200_MAX_DEV 2
-+ #endif
+#else
+#define XRX200_MAX_DEV 1
+#endif
@@ -435,6 +431,8 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ struct mii_bus *mii_bus;
+
+ struct xrx200_chan chan[XRX200_MAX_DMA];
++ u16 vlan_vid[XRX200_MAX_VLAN];
++ u16 vlan_port_map[XRX200_MAX_VLAN];
+
+ struct net_device *devs[XRX200_MAX_DEV];
+ int num_devs;
@@ -735,6 +733,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+static int xrx200sw_set_vlan_vid(struct switch_dev *dev, const struct switch_attr *attr,
+ struct switch_val *val)
+{
++ struct xrx200_hw *hw = container_of(dev, struct xrx200_hw, swdev);
+ int i;
+ struct xrx200_pce_table_entry tev;
+ struct xrx200_pce_table_entry tem;
@@ -749,6 +748,8 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ return -EINVAL;
+ }
+
++ hw->vlan_vid[val->port_vlan] = val->value.i;
++
+ tev.index = val->port_vlan;
+ xrx200_pce_table_entry_read(&tev);
+ tev.key[0] = val->value.i;
@@ -780,6 +781,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+
+static int xrx200sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *val)
+{
++ struct xrx200_hw *hw = container_of(dev, struct xrx200_hw, swdev);
+ int i, portmap, tagmap, untagged;
+ struct xrx200_pce_table_entry tem;
+
@@ -830,6 +832,10 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ tem.val[2] = tagmap;
+ xrx200_pce_table_entry_write(&tem);
+
++ ltq_switch_w32_mask(0, portmap, PCE_PMAP2);
++ ltq_switch_w32_mask(0, portmap, PCE_PMAP3);
++ hw->vlan_port_map[val->port_vlan] = portmap;
++
+ xrx200sw_fixup_pvids();
+
+ return 0;
@@ -1156,7 +1162,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ if (ret) {
+ netdev_err(dev,
+ "failed to allocate new rx buffer\n");
-+ return 0;
++ return;
+ }
+
+ skb_put(skb, len);
@@ -1258,11 +1264,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ u32 byte_offset;
+ int len;
+#ifdef SW_ROUTING
-+ #ifdef SW_PORTMAP
-+ u32 special_tag = (SPID_CPU_PORT << SPID_SHIFT) | PORT_MAP_SEL | PORT_MAP_EN | DPID_ENABLE;
-+ #else
+ u32 special_tag = (SPID_CPU_PORT << SPID_SHIFT) | DPID_ENABLE;
-+ #endif
+#endif
+
+ skb->dev = dev;
@@ -1274,12 +1276,27 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ return NETDEV_TX_BUSY;
+ }
+#ifdef SW_ROUTING
-+ #ifdef SW_PORTMAP
++ if (is_multicast_ether_addr(eth_hdr(skb)->h_dest)) {
++ u16 port_map = priv->port_map;
++ special_tag |= PORT_MAP_SEL | PORT_MAP_EN;
++ if (skb->protocol == htons(ETH_P_8021Q)) {
++ u16 vid;
++ int i;
++
++ if (!__vlan_get_tag(skb, &vid)) {
++ for (i = 0; i < XRX200_MAX_VLAN; i++) {
++ if (priv->hw->vlan_vid[i] != vid)
++ continue;
++ port_map = priv->hw->vlan_port_map[i];
++ break;
++ }
++ }
++ }
++ special_tag |= port_map << PORT_MAP_SHIFT;
++ }
+ special_tag |= priv->port_map << PORT_MAP_SHIFT;
-+ #else
+ if(priv->id)
+ special_tag |= (1 << DPID_SHIFT);
-+ #endif
+ if(skb_headroom(skb) < 4) {
+ struct sk_buff *tmp = skb_realloc_headroom(skb, 4);
+ dev_kfree_skb_any(skb);
@@ -1421,13 +1438,18 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+static void xrx200_mdio_link(struct net_device *dev)
+{
+ struct xrx200_priv *priv = netdev_priv(dev);
++ bool changed = false, link = false;
+ int i;
+
+ for (i = 0; i < priv->num_port; i++) {
+ if (!priv->port[i].phydev)
+ continue;
+
++ if (priv->port[i].phydev->link)
++ link = true;
++
+ if (priv->port[i].link != priv->port[i].phydev->link) {
++ changed = true;
+ xrx200_gmac_update(&priv->port[i]);
+ priv->port[i].link = priv->port[i].phydev->link;
+ netdev_info(dev, "port %d %s link\n",
@@ -1435,6 +1457,8 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ (priv->port[i].link)?("got"):("lost"));
+ }
+ }
++ if (changed && !link)
++ netif_carrier_off(dev);
+}
+
+static inline int xrx200_mdio_poll(struct mii_bus *bus)
@@ -1512,6 +1536,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ | SUPPORTED_TP);
+ phydev->advertising = phydev->supported;
+ port->phydev = phydev;
++ phydev->no_auto_carrier_off = true;
+
+ pr_info("%s: attached PHY [%s] (phy_addr=%s, irq=%d)\n",
+ dev->name, phydev->drv->name,
@@ -1694,9 +1719,9 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ xrx200_pci_microcode();
+
+ /* Default unknown Broadcat/Multicast/Unicast port maps */
-+ ltq_switch_w32(0x7f, PCE_PMAP1);
-+ ltq_switch_w32(0x7f, PCE_PMAP2);
-+ ltq_switch_w32(0x7f, PCE_PMAP3);
++ ltq_switch_w32(0x40, PCE_PMAP1);
++ ltq_switch_w32(0x40, PCE_PMAP2);
++ ltq_switch_w32(0x40, PCE_PMAP3);
+
+ /* RMON Counter Enable for all physical ports */
+ for (i = 0; i < 7; i++)
@@ -1736,6 +1761,10 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+ ltq_switch_w32_mask(0, PCE_INGRESS, PCE_PCTRL_REG(6, 0));
+ ltq_switch_w32_mask(0, BIT(3), MAC_CTRL_REG(6, 2));
+ ltq_switch_w32(1518 + 8 + 4 * 2, MAC_FLEN_REG);
++ xrx200sw_write_x(1, XRX200_BM_QUEUE_GCTRL_GL_MOD, 0);
++
++ for (i = 0; i < XRX200_MAX_VLAN; i++)
++ hw->vlan_vid[i] = i;
+}
+
+static void xrx200_hw_cleanup(struct xrx200_hw *hw)
@@ -2179,7 +2208,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+// XRX200_BM_GCTRL_P_SRES, /* Software Reset for PQM */
+// XRX200_BM_GCTRL_F_SRES, /* Software Reset for FSQM */
+// XRX200_BM_QUEUE_GCTRL, /* Queue Manager GlobalControl Register 0 */
-+// XRX200_BM_QUEUE_GCTRL_GL_MOD, /* WRED Mode Signal */
++ XRX200_BM_QUEUE_GCTRL_GL_MOD, /* WRED Mode Signal */
+// XRX200_BM_QUEUE_GCTRL_AQUI, /* Average Queue Update Interval */
+// XRX200_BM_QUEUE_GCTRL_AQWF, /* Average Queue Weight Factor */
+// XRX200_BM_QUEUE_GCTRL_QAVGEN, /* Queue Average Calculation Enable */
@@ -2835,7 +2864,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
+// {0x0124, 1, 1, 0x00}, /* XRX200_BM_GCTRL_P_SRES Software Reset for PQM */
+// {0x0124, 0, 1, 0x00}, /* XRX200_BM_GCTRL_F_SRES Software Reset for FSQM */
+// {0x0128, 0, 16, 0x00}, /* XRX200_BM_QUEUE_GCTRL Queue Manager GlobalControl Register 0 */
-+// {0x0128, 10, 1, 0x00}, /* XRX200_BM_QUEUE_GCTRL_GL_MOD WRED Mode Signal */
++ {0x0128, 10, 1, 0x00}, /* XRX200_BM_QUEUE_GCTRL_GL_MOD WRED Mode Signal */
+// {0x0128, 7, 3, 0x00}, /* XRX200_BM_QUEUE_GCTRL_AQUI Average Queue Update Interval */
+// {0x0128, 3, 4, 0x00}, /* XRX200_BM_QUEUE_GCTRL_AQWF Average Queue Weight Factor */
+// {0x0128, 2, 1, 0x00}, /* XRX200_BM_QUEUE_GCTRL_QAVGEN Queue Average Calculation Enable */
diff --git a/target/linux/lantiq/patches-4.4/0028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-4.4/0028-NET-lantiq-various-etop-fixes.patch
index 81eccf24bc..a236da1efa 100644
--- a/target/linux/lantiq/patches-4.4/0028-NET-lantiq-various-etop-fixes.patch
+++ b/target/linux/lantiq/patches-4.4/0028-NET-lantiq-various-etop-fixes.patch
@@ -104,7 +104,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+
+#define PMAC_HD_CTL_AS (1 << 19)
+#define PMAC_HD_CTL_RXSH (1 << 22)
-+
+
+/* Switch Enable (0=disable, 1=enable) */
+#define GCTL0_SE 0x80000000
+/* Disable MDIO auto polling (0=disable, 1=enable) */
@@ -124,7 +124,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+#define MDIO_XR9_REG_OFFSET 0
+#define MDIO_XR9_ADDR_OFFSET 5
+#define MDIO_XR9_WR_OFFSET 16
-
++
+#define LTQ_DMA_ETOP ((of_machine_is_compatible("lantiq,ase")) ? \
+ (INT_NUM_IM3_IRL0) : (INT_NUM_IM2_IRL0))
+
@@ -333,7 +333,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
- ltq_pmu_enable(PMU_PPE);
+ clk_enable(priv->clk_ppe);
-+
+
+- switch (priv->pldata->mii_mode) {
+ if (of_machine_is_compatible("lantiq,ar9")) {
+ ltq_etop_gbit_init(dev);
+ /* force the etops link to the gbit to MII */
@@ -342,8 +343,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ ltq_etop_w32_mask(MDIO_CFG_MASK, 0, LTQ_ETOP_MDIO_CFG);
+ ltq_etop_w32_mask(MAC_CFG_MASK, MAC_CFG_CGEN | MAC_CFG_DUPLEX |
+ MAC_CFG_SPEED | MAC_CFG_LINK, LTQ_ETOP_MAC_CFG);
-
-- switch (priv->pldata->mii_mode) {
++
+ switch (mii_mode) {
case PHY_INTERFACE_MODE_RMII:
- ltq_etop_w32_mask(ETOP_MII_MASK,
@@ -382,7 +382,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
- ltq_etop_w32(PPE32_CGEN, LQ_PPE32_ENET_MAC_CFG);
+ return 0;
+}
-+
+
+- ltq_dma_init_port(DMA_PORT_ETOP);
+static int
+ltq_etop_dma_init(struct net_device *dev)
+{
@@ -391,14 +392,21 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ int rx = priv->rx_irq - LTQ_DMA_ETOP;
+ int err;
- ltq_dma_init_port(DMA_PORT_ETOP);
-
- for (i = 0; i < MAX_DMA_CHAN; i++) {
- int irq = LTQ_DMA_CH0_INT + i;
- struct ltq_etop_chan *ch = &priv->ch[i];
--
++ ltq_dma_init_port(DMA_PORT_ETOP);
+
- ch->idx = ch->dma.nr = i;
--
++ priv->txch.dma.nr = tx;
++ ltq_dma_alloc_tx(&priv->txch.dma);
++ err = request_irq(priv->tx_irq, ltq_etop_dma_irq, 0, "eth_tx", priv);
++ if (err) {
++ netdev_err(dev, "failed to allocate tx irq\n");
++ goto err_out;
++ }
++ priv->txch.dma.irq = priv->tx_irq;
+
- if (IS_TX(i)) {
- ltq_dma_alloc_tx(&ch->dma);
- request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv);
@@ -410,15 +418,6 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
- return -ENOMEM;
- ch->dma.desc = 0;
- request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv);
-+ priv->txch.dma.nr = tx;
-+ ltq_dma_alloc_tx(&priv->txch.dma);
-+ err = request_irq(priv->tx_irq, ltq_etop_dma_irq, 0, "eth_tx", priv);
-+ if (err) {
-+ netdev_err(dev, "failed to allocate tx irq\n");
-+ goto err_out;
-+ }
-+ priv->txch.dma.irq = priv->tx_irq;
-+
+ priv->rxch.dma.nr = rx;
+ ltq_dma_alloc_rx(&priv->rxch.dma);
+ for (priv->rxch.dma.desc = 0; priv->rxch.dma.desc < LTQ_DESC_NUM;
@@ -656,12 +655,6 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
- phy_stop(priv->phydev);
- for (i = 0; i < MAX_DMA_CHAN; i++) {
- struct ltq_etop_chan *ch = &priv->ch[i];
--
-- if (!IS_RX(i) && !IS_TX(i))
-- continue;
-- napi_disable(&ch->napi);
-- ltq_dma_close(&ch->dma);
-- }
+ if (priv->phydev)
+ phy_stop(priv->phydev);
+ napi_disable(&priv->txch.napi);
@@ -671,7 +664,12 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ ltq_dma_close(&priv->txch.dma);
+ ltq_dma_close(&priv->rxch.dma);
+ spin_unlock_irqrestore(&priv->lock, flags);
-+
+
+- if (!IS_RX(i) && !IS_TX(i))
+- continue;
+- napi_disable(&ch->napi);
+- ltq_dma_close(&ch->dma);
+- }
return 0;
}
@@ -791,7 +789,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
-@@ -733,30 +943,61 @@ ltq_etop_probe(struct platform_device *p
+@@ -733,31 +943,62 @@ ltq_etop_probe(struct platform_device *p
goto err_out;
}
@@ -825,10 +823,19 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
priv->pdev = pdev;
- priv->pldata = dev_get_platdata(&pdev->dev);
priv->netdev = dev;
+- spin_lock_init(&priv->lock);
+ priv->tx_irq = irqres[0].start;
+ priv->rx_irq = irqres[1].start;
+ priv->mii_mode = of_get_phy_mode(pdev->dev.of_node);
-+
+
+- for (i = 0; i < MAX_DMA_CHAN; i++) {
+- if (IS_TX(i))
+- netif_napi_add(dev, &priv->ch[i].napi,
+- ltq_etop_poll_tx, 8);
+- else if (IS_RX(i))
+- netif_napi_add(dev, &priv->ch[i].napi,
+- ltq_etop_poll_rx, 32);
+- priv->ch[i].netdev = dev;
+ mac = of_get_mac_address(pdev->dev.of_node);
+ if (mac)
+ memcpy(priv->mac, mac, ETH_ALEN);
@@ -848,26 +855,18 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ priv->clk_ephycgu = clk_get(&pdev->dev, "ephycgu");
+ if (IS_ERR(priv->clk_ephycgu))
+ return PTR_ERR(priv->clk_ephycgu);
-+ }
-+
- spin_lock_init(&priv->lock);
+ }
-- for (i = 0; i < MAX_DMA_CHAN; i++) {
-- if (IS_TX(i))
-- netif_napi_add(dev, &priv->ch[i].napi,
-- ltq_etop_poll_tx, 8);
-- else if (IS_RX(i))
-- netif_napi_add(dev, &priv->ch[i].napi,
-- ltq_etop_poll_rx, 32);
-- priv->ch[i].netdev = dev;
-- }
++ spin_lock_init(&priv->lock);
++
+ netif_napi_add(dev, &priv->txch.napi, ltq_etop_poll_tx, 8);
+ netif_napi_add(dev, &priv->rxch.napi, ltq_etop_poll_rx, 32);
+ priv->txch.netdev = dev;
+ priv->rxch.netdev = dev;
-
++
err = register_netdev(dev);
if (err)
+ goto err_free;
@@ -785,31 +1026,22 @@ ltq_etop_remove(struct platform_device *
return 0;
}
diff --git a/target/linux/lantiq/patches-4.4/0030-GPIO-add-named-gpio-exports.patch b/target/linux/lantiq/patches-4.4/0030-GPIO-add-named-gpio-exports.patch
index 2e27918765..1148ec4e26 100644
--- a/target/linux/lantiq/patches-4.4/0030-GPIO-add-named-gpio-exports.patch
+++ b/target/linux/lantiq/patches-4.4/0030-GPIO-add-named-gpio-exports.patch
@@ -22,11 +22,13 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
#include "gpiolib.h"
-@@ -450,3 +452,69 @@ void of_gpiochip_remove(struct gpio_chip
+@@ -450,3 +452,73 @@ void of_gpiochip_remove(struct gpio_chip
gpiochip_remove_pin_ranges(chip);
of_node_put(chip->of_node);
}
+
++#ifdef CONFIG_GPIO_SYSFS
++
+static struct of_device_id gpio_export_ids[] = {
+ { .compatible = "gpio-export" },
+ { /* sentinel */ }
@@ -92,6 +94,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ return platform_driver_probe(&gpio_export_driver, of_gpio_export_probe);
+}
+device_initcall(of_gpio_export_init);
++
++#endif
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -122,6 +122,12 @@ static inline int gpio_export(unsigned g
diff --git a/target/linux/lantiq/patches-4.4/0034-reset-Fix-compile-when-reset-RESET_CONTROLLER-is-not.patch b/target/linux/lantiq/patches-4.4/0034-reset-Fix-compile-when-reset-RESET_CONTROLLER-is-not.patch
deleted file mode 100644
index ddbe134c1b..0000000000
--- a/target/linux/lantiq/patches-4.4/0034-reset-Fix-compile-when-reset-RESET_CONTROLLER-is-not.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From b1b9fca8c317afc3f2b78bb54f877e8a830a819d Mon Sep 17 00:00:00 2001
-From: John Crispin <blogic@openwrt.org>
-Date: Fri, 9 Aug 2013 18:47:27 +0200
-Subject: [PATCH 34/36] reset: Fix compile when reset RESET_CONTROLLER is not
- selected
-
-Drivers need to protect their reset api calls with #ifdef to avoid compile
-errors.
-
-This patch adds dummy wrappers in the same way that linux/of.h does it.
-
-Cc: linux-kernel@vger.kernel.org
-Cc: Philipp Zabel <p.zabel@pengutronix.de>
-Cc: Gabor Juhos <juhosg@openwrt.org>
----
- include/linux/reset-controller.h | 16 ++++++++++++++
- include/linux/reset.h | 43 ++++++++++++++++++++++++++++++++++++++
- 2 files changed, 59 insertions(+)
-
---- a/include/linux/reset-controller.h
-+++ b/include/linux/reset-controller.h
-@@ -48,7 +48,23 @@ struct reset_controller_dev {
- unsigned int nr_resets;
- };
-
-+#if defined(CONFIG_RESET_CONTROLLER)
-+
- int reset_controller_register(struct reset_controller_dev *rcdev);
- void reset_controller_unregister(struct reset_controller_dev *rcdev);
-
-+#else
-+
-+static inline int reset_controller_register(struct reset_controller_dev *rcdev)
-+{
-+ return -ENOSYS;
-+}
-+
-+void reset_controller_unregister(struct reset_controller_dev *rcdev)
-+{
-+
-+}
-+
-+#endif
-+
- #endif
diff --git a/target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
index 25852e2cca..7116b89230 100644
--- a/target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
+++ b/target/linux/lantiq/patches-4.4/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
@@ -51,7 +51,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
obj-$(CONFIG_XRX200_PHY_FW) += xrx200_phy_fw.o
--- /dev/null
+++ b/arch/mips/lantiq/xway/ath_eep.c
-@@ -0,0 +1,298 @@
+@@ -0,0 +1,307 @@
+/*
+ * Copyright (C) 2011 Luca Olivetti <luca@ventoso.org>
+ * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
@@ -104,6 +104,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ const __be32 *list;
+ const char *part;
+ phandle phandle;
++ u16 dev_ids[2] = { 0 };
+
+ if ((list = of_get_property(np, "ath,eep-flash", &i)) && i == 2 *
+ sizeof(*list) && (phandle = be32_to_cpup(list++)) &&
@@ -188,6 +189,14 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+
+ }
+
++ if (!of_property_read_u16_array(np, "ath,device-id", dev_ids, 2)) {
++ struct pci_dev *d = NULL;
++
++ while ((d = pci_get_device(PCI_VENDOR_ID_ATHEROS,
++ dev_ids[0], d)) != NULL)
++ d->device = dev_ids[1];
++ }
++
+ if (!of_property_read_u32(np, "ath,led-pin", &led_pin)) {
+ ath9k_pdata.led_pin = led_pin;
+ dev_info(&pdev->dev, "using led pin %d.\n", led_pin);
@@ -379,7 +388,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ eth_mac_set = mac_pton(str, eth_mac);
+ return !eth_mac_set;
+}
-+__setup("ethaddr=", setup_ethaddr);
++early_param("ethaddr", setup_ethaddr);
+
+int __init of_eth_mac_probe(struct platform_device *pdev)
+{
@@ -620,10 +629,10 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
goto err_hw;
- memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr));
-+ if (priv->mac)
++ memcpy(&mac.sa_data, ltq_get_eth_mac(), ETH_ALEN);
++
++ if (priv->mac && !is_valid_ether_addr(mac.sa_data))
+ memcpy(&mac.sa_data, priv->mac, ETH_ALEN);
-+ else
-+ memcpy(&mac.sa_data, ltq_get_eth_mac(), ETH_ALEN);
+
if (!is_valid_ether_addr(mac.sa_data)) {
pr_warn("etop: invalid MAC, using random\n");
diff --git a/target/linux/lantiq/patches-4.4/0042-arch-mips-increase-io_space_limit.patch b/target/linux/lantiq/patches-4.4/0042-arch-mips-increase-io_space_limit.patch
new file mode 100644
index 0000000000..14b417e690
--- /dev/null
+++ b/target/linux/lantiq/patches-4.4/0042-arch-mips-increase-io_space_limit.patch
@@ -0,0 +1,23 @@
+From 9807eb80a1b3bad7a4a89aa6566497bb1cadd6ef Mon Sep 17 00:00:00 2001
+From: John Crispin <john@phrozen.org>
+Date: Fri, 3 Jun 2016 13:12:20 +0200
+Subject: [PATCH] arch: mips: increase io_space_limit
+
+this value comes from x86 and breaks some pci devices
+
+Signed-off-by: John Crispin <john@phrozen.org>
+---
+ arch/mips/include/asm/io.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/mips/include/asm/io.h
++++ b/arch/mips/include/asm/io.h
+@@ -50,7 +50,7 @@
+
+ /* ioswab[bwlq], __mem_ioswab[bwlq] are defined in mangle-port.h */
+
+-#define IO_SPACE_LIMIT 0xffff
++#define IO_SPACE_LIMIT 0xffffffff
+
+ /*
+ * On MIPS I/O ports are memory mapped, so we access them using normal
diff --git a/target/linux/lantiq/patches-4.4/0047-irq-fixes.patch b/target/linux/lantiq/patches-4.4/0047-irq-fixes.patch
new file mode 100644
index 0000000000..9efa63d35a
--- /dev/null
+++ b/target/linux/lantiq/patches-4.4/0047-irq-fixes.patch
@@ -0,0 +1,78 @@
+--- a/arch/mips/lantiq/irq.c
++++ b/arch/mips/lantiq/irq.c
+@@ -67,7 +67,7 @@ int gic_present;
+ #endif
+
+ static int exin_avail;
+-static struct resource ltq_eiu_irq[MAX_EIU];
++static u32 ltq_eiu_irq[MAX_EIU];
+ static void __iomem *ltq_icu_membase[MAX_IM];
+ static void __iomem *ltq_eiu_membase;
+ static struct irq_domain *ltq_domain;
+@@ -76,7 +76,7 @@ static int ltq_perfcount_irq;
+ int ltq_eiu_get_irq(int exin)
+ {
+ if (exin < exin_avail)
+- return ltq_eiu_irq[exin].start;
++ return ltq_eiu_irq[exin];
+ return -1;
+ }
+
+@@ -128,7 +128,7 @@ static int ltq_eiu_settype(struct irq_da
+ int i;
+
+ for (i = 0; i < MAX_EIU; i++) {
+- if (d->hwirq == ltq_eiu_irq[i].start) {
++ if (d->hwirq == ltq_eiu_irq[i]) {
+ int val = 0;
+ int edge = 0;
+
+@@ -176,7 +176,7 @@ static unsigned int ltq_startup_eiu_irq(
+
+ ltq_enable_irq(d);
+ for (i = 0; i < MAX_EIU; i++) {
+- if (d->hwirq == ltq_eiu_irq[i].start) {
++ if (d->hwirq == ltq_eiu_irq[i]) {
+ /* by default we are low level triggered */
+ ltq_eiu_settype(d, IRQF_TRIGGER_LOW);
+ /* clear all pending */
+@@ -198,7 +198,7 @@ static void ltq_shutdown_eiu_irq(struct
+
+ ltq_disable_irq(d);
+ for (i = 0; i < MAX_EIU; i++) {
+- if (d->hwirq == ltq_eiu_irq[i].start) {
++ if (d->hwirq == ltq_eiu_irq[i]) {
+ /* disable */
+ ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) & ~BIT(i),
+ LTQ_EIU_EXIN_INEN);
+@@ -343,10 +343,10 @@ static int icu_map(struct irq_domain *d,
+ return 0;
+
+ for (i = 0; i < exin_avail; i++)
+- if (hw == ltq_eiu_irq[i].start)
++ if (hw == ltq_eiu_irq[i])
+ chip = &ltq_eiu_type;
+
+- irq_set_chip_and_handler(hw, chip, handle_level_irq);
++ irq_set_chip_and_handler(irq, chip, handle_level_irq);
+
+ return 0;
+ }
+@@ -441,14 +441,14 @@ int __init icu_of_init(struct device_nod
+ eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway");
+ if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
+ /* find out how many external irq sources we have */
+- exin_avail = of_irq_count(eiu_node);
++ exin_avail = of_property_count_u32_elems(eiu_node, "lantiq,eiu-irqs");
+
+ if (exin_avail > MAX_EIU)
+ exin_avail = MAX_EIU;
+
+- ret = of_irq_to_resource_table(eiu_node,
++ ret = of_property_read_u32_array(eiu_node, "lantiq,eiu-irqs",
+ ltq_eiu_irq, exin_avail);
+- if (ret != exin_avail)
++ if (ret)
+ panic("failed to load external irq resources");
+
+ if (!request_mem_region(res.start, resource_size(&res),
diff --git a/target/linux/lantiq/patches-4.4/0047-poweroff.patch b/target/linux/lantiq/patches-4.4/0047-poweroff.patch
new file mode 100644
index 0000000000..54249bba52
--- /dev/null
+++ b/target/linux/lantiq/patches-4.4/0047-poweroff.patch
@@ -0,0 +1,23 @@
+--- a/arch/mips/lantiq/xway/reset.c
++++ b/arch/mips/lantiq/xway/reset.c
+@@ -301,12 +301,6 @@ static void ltq_machine_halt(void)
+ unreachable();
+ }
+
+-static void ltq_machine_power_off(void)
+-{
+- local_irq_disable();
+- unreachable();
+-}
+-
+ static void ltq_usb_init(void)
+ {
+ /* Power for USB cores 1 & 2 */
+@@ -379,7 +373,6 @@ static int __init mips_reboot_setup(void
+
+ _machine_restart = ltq_machine_restart;
+ _machine_halt = ltq_machine_halt;
+- pm_power_off = ltq_machine_power_off;
+
+ return 0;
+ }
diff --git a/target/linux/lantiq/patches-4.4/0160-owrt-lantiq-multiple-flash.patch b/target/linux/lantiq/patches-4.4/0160-owrt-lantiq-multiple-flash.patch
index 087d923f7d..4c45e4f8a1 100644
--- a/target/linux/lantiq/patches-4.4/0160-owrt-lantiq-multiple-flash.patch
+++ b/target/linux/lantiq/patches-4.4/0160-owrt-lantiq-multiple-flash.patch
@@ -82,6 +82,7 @@
- if (!ltq_mtd->res) {
- dev_err(&pdev->dev, "failed to get memory resource\n");
- return -ENOENT;
+- }
+ for (i = 0; i < pdev->num_resources; i++) {
+ printk(KERN_NOTICE "lantiq nor flash device: %.8llx at %.8llx\n",
+ (unsigned long long)resource_size(&pdev->resource[i]),
@@ -94,14 +95,27 @@
+ dev_err(&pdev->dev, "Could not reserve memory region\n");
+ return -ENOMEM;
+ }
-+
+
+- ltq_mtd->map = devm_kzalloc(&pdev->dev, sizeof(struct map_info),
+- GFP_KERNEL);
+- if (!ltq_mtd->map)
+- return -ENOMEM;
+ ltq_mtd->map[i].name = ltq_map_name;
+ ltq_mtd->map[i].bankwidth = 2;
+ ltq_mtd->map[i].read = ltq_read16;
+ ltq_mtd->map[i].write = ltq_write16;
+ ltq_mtd->map[i].copy_from = ltq_copy_from;
+ ltq_mtd->map[i].copy_to = ltq_copy_to;
-+
+
+- if (of_find_property(pdev->dev.of_node, "lantiq,noxip", NULL))
+- ltq_mtd->map->phys = NO_XIP;
+- else
+- ltq_mtd->map->phys = ltq_mtd->res->start;
+- ltq_mtd->res->start;
+- ltq_mtd->map->size = resource_size(ltq_mtd->res);
+- ltq_mtd->map->virt = devm_ioremap_resource(&pdev->dev, ltq_mtd->res);
+- if (IS_ERR(ltq_mtd->map->virt))
+- return PTR_ERR(ltq_mtd->map->virt);
+ if (of_find_property(pdev->dev.of_node, "lantiq,noxip", NULL))
+ ltq_mtd->map[i].phys = NO_XIP;
+ else
@@ -111,18 +125,30 @@
+ ltq_mtd->map[i].size);
+ if (IS_ERR(ltq_mtd->map[i].virt))
+ return PTR_ERR(ltq_mtd->map[i].virt);
-+
+
+- ltq_mtd->map->name = ltq_map_name;
+- ltq_mtd->map->bankwidth = 2;
+- ltq_mtd->map->read = ltq_read16;
+- ltq_mtd->map->write = ltq_write16;
+- ltq_mtd->map->copy_from = ltq_copy_from;
+- ltq_mtd->map->copy_to = ltq_copy_to;
+ if (ltq_mtd->map[i].virt == NULL) {
+ dev_err(&pdev->dev, "Failed to ioremap flash region\n");
+ err = PTR_ERR(ltq_mtd->map[i].virt);
+ goto err_out;
+ }
-+
+
+- ltq_mtd->map->map_priv_1 = LTQ_NOR_PROBING;
+- ltq_mtd->mtd = do_map_probe("cfi_probe", ltq_mtd->map);
+- ltq_mtd->map->map_priv_1 = LTQ_NOR_NORMAL;
+ ltq_mtd->map[i].map_priv_1 = LTQ_NOR_PROBING;
+ for (type = rom_probe_types; !ltq_mtd->mtd[i] && *type; type++)
+ ltq_mtd->mtd[i] = do_map_probe(*type, &ltq_mtd->map[i]);
+ ltq_mtd->map[i].map_priv_1 = LTQ_NOR_NORMAL;
-+
+
+- if (!ltq_mtd->mtd) {
+- dev_err(&pdev->dev, "probing failed\n");
+- return -ENXIO;
+ if (!ltq_mtd->mtd[i]) {
+ dev_err(&pdev->dev, "probing failed\n");
+ return -ENXIO;
@@ -138,10 +164,7 @@
+ cfi->addr_unlock2 ^= 1;
}
-- ltq_mtd->map = devm_kzalloc(&pdev->dev, sizeof(struct map_info),
-- GFP_KERNEL);
-- if (!ltq_mtd->map)
-- return -ENOMEM;
+- ltq_mtd->mtd->dev.parent = &pdev->dev;
+ if (devices_found == 1) {
+ ltq_mtd->cmtd = ltq_mtd->mtd[0];
+ } else if (devices_found > 1) {
@@ -153,34 +176,6 @@
+ err = -ENXIO;
+ }
-- if (of_find_property(pdev->dev.of_node, "lantiq,noxip", NULL))
-- ltq_mtd->map->phys = NO_XIP;
-- else
-- ltq_mtd->map->phys = ltq_mtd->res->start;
-- ltq_mtd->res->start;
-- ltq_mtd->map->size = resource_size(ltq_mtd->res);
-- ltq_mtd->map->virt = devm_ioremap_resource(&pdev->dev, ltq_mtd->res);
-- if (IS_ERR(ltq_mtd->map->virt))
-- return PTR_ERR(ltq_mtd->map->virt);
--
-- ltq_mtd->map->name = ltq_map_name;
-- ltq_mtd->map->bankwidth = 2;
-- ltq_mtd->map->read = ltq_read16;
-- ltq_mtd->map->write = ltq_write16;
-- ltq_mtd->map->copy_from = ltq_copy_from;
-- ltq_mtd->map->copy_to = ltq_copy_to;
--
-- ltq_mtd->map->map_priv_1 = LTQ_NOR_PROBING;
-- ltq_mtd->mtd = do_map_probe("cfi_probe", ltq_mtd->map);
-- ltq_mtd->map->map_priv_1 = LTQ_NOR_NORMAL;
--
-- if (!ltq_mtd->mtd) {
-- dev_err(&pdev->dev, "probing failed\n");
-- return -ENXIO;
-- }
--
-- ltq_mtd->mtd->dev.parent = &pdev->dev;
--
- cfi = ltq_mtd->map->fldrv_priv;
- cfi->addr_unlock1 ^= 1;
- cfi->addr_unlock2 ^= 1;
diff --git a/target/linux/lantiq/patches-4.4/0400-xrx200-net-multi-phy.patch b/target/linux/lantiq/patches-4.4/0400-xrx200-net-multi-phy.patch
deleted file mode 100644
index a86fe8de40..0000000000
--- a/target/linux/lantiq/patches-4.4/0400-xrx200-net-multi-phy.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- a/drivers/net/ethernet/lantiq_xrx200.c
-+++ b/drivers/net/ethernet/lantiq_xrx200.c
-@@ -1209,13 +1209,18 @@ static void xrx200_gmac_update(struct xr
- static void xrx200_mdio_link(struct net_device *dev)
- {
- struct xrx200_priv *priv = netdev_priv(dev);
-+ bool changed = false, link = false;
- int i;
-
- for (i = 0; i < priv->num_port; i++) {
- if (!priv->port[i].phydev)
- continue;
-
-+ if (priv->port[i].phydev->link)
-+ link = true;
-+
- if (priv->port[i].link != priv->port[i].phydev->link) {
-+ changed = true;
- xrx200_gmac_update(&priv->port[i]);
- priv->port[i].link = priv->port[i].phydev->link;
- netdev_info(dev, "port %d %s link\n",
-@@ -1223,6 +1228,8 @@ static void xrx200_mdio_link(struct net_
- (priv->port[i].link)?("got"):("lost"));
- }
- }
-+ if (changed && !link)
-+ netif_carrier_off(dev);
- }
-
- static inline int xrx200_mdio_poll(struct mii_bus *bus)
-@@ -1300,6 +1307,7 @@ static int xrx200_mdio_probe(struct net_
- | SUPPORTED_TP);
- phydev->advertising = phydev->supported;
- port->phydev = phydev;
-+ phydev->no_auto_carrier_off = true;
-
- pr_info("%s: attached PHY [%s] (phy_addr=%s, irq=%d)\n",
- dev->name, phydev->drv->name,
diff --git a/target/linux/lantiq/xrx200/config-default b/target/linux/lantiq/xrx200/config-default
index 1c9f5ccb13..dc4e6084ed 100644
--- a/target/linux/lantiq/xrx200/config-default
+++ b/target/linux/lantiq/xrx200/config-default
@@ -1,40 +1,27 @@
CONFIG_ADM6996_PHY=y
CONFIG_AR8216_PHY=y
-# CONFIG_ARCH_HAS_SG_CHAIN is not set
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
-CONFIG_CPU_SUPPORTS_MSA=y
+CONFIG_AT803X_PHY=y
+CONFIG_CPU_MIPSR2_IRQ_EI=y
+CONFIG_CPU_MIPSR2_IRQ_VI=y
+CONFIG_CPU_RMAP=y
CONFIG_CRC16=y
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_LZO=y
CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_GPIO_DEVRES=y
-CONFIG_HAS_IOPORT_MAP=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
-CONFIG_HAVE_CC_STACKPROTECTOR=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HZ_PERIODIC=y
+CONFIG_ICPLUS_PHY=y
CONFIG_INPUT=y
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_POLLDEV=y
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_WORK=y
# CONFIG_ISDN is not set
CONFIG_LANTIQ_PHY=y
CONFIG_LANTIQ_XRX200=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-CONFIG_LIBFDT=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
+CONFIG_MIPS_MT=y
+# CONFIG_MIPS_MT_FPAFF is not set
+CONFIG_MIPS_MT_SMP=y
+CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND_PLATFORM=y
@@ -46,19 +33,27 @@ CONFIG_MTD_UBI_BLOCK=y
# CONFIG_MTD_UBI_FASTMAP is not set
# CONFIG_MTD_UBI_GLUEBI is not set
CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_NET_FLOW_LIMIT=y
CONFIG_NLS=y
-# CONFIG_NO_IOPORT_MAP is not set
-CONFIG_OF_ADDRESS_PCI=y
+CONFIG_NR_CPUS=2
CONFIG_PCIE_LANTIQ=y
-# CONFIG_RCU_STALL_COMMON is not set
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_GPIO=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_RCU_STALL_COMMON=y
+CONFIG_RFS_ACCEL=y
+CONFIG_RPS=y
CONFIG_RTL8306_PHY=y
CONFIG_RTL8366S_PHY=y
CONFIG_RTL8367B_PHY=y
CONFIG_RTL8367_PHY=y
-CONFIG_SPI=y
-CONFIG_SPI_LANTIQ=y
-CONFIG_SPI_MASTER=y
-CONFIG_SYS_SUPPORTS_MIPS16=y
+CONFIG_SMP=y
+CONFIG_SMP_UP=y
+CONFIG_SWCONFIG_LEDS=y
+CONFIG_SYNC_R4K=y
+CONFIG_SYS_SUPPORTS_SCHED_SMT=y
+CONFIG_SYS_SUPPORTS_SMP=y
+CONFIG_TREE_RCU=y
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
@@ -69,6 +64,7 @@ CONFIG_USB_COMMON=y
# CONFIG_USB_EHCI_HCD is not set
CONFIG_USB_SUPPORT=y
# CONFIG_USB_UHCI_HCD is not set
+CONFIG_XPS=y
CONFIG_XRX200_PHY_FW=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_ZLIB_INFLATE=y
diff --git a/target/linux/lantiq/xrx200/profiles/00-default.mk b/target/linux/lantiq/xrx200/profiles/00-default.mk
new file mode 100644
index 0000000000..26bc8b502b
--- /dev/null
+++ b/target/linux/lantiq/xrx200/profiles/00-default.mk
@@ -0,0 +1,9 @@
+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))
diff --git a/target/linux/lantiq/xrx200/profiles/arv.mk b/target/linux/lantiq/xrx200/profiles/arv.mk
deleted file mode 100644
index 3dc22c00da..0000000000
--- a/target/linux/lantiq/xrx200/profiles/arv.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-define Profile/VG3503J
- NAME:=BT Openreach - ECI VDSL Modem
-endef
-
-$(eval $(call Profile,VG3503J))
-
-define Profile/VG3503J_V2
- NAME:=BT Openreach - ECI VDSL Modem v2
-endef
-
-$(eval $(call Profile,VG3503J_V2))
-
-define Profile/VGV7510KW22NOR
- NAME:=o2 Box 6431 / Arcadyan VGV7510KW22 (NOR)
- PACKAGES:=kmod-rt2800-pci wpad-mini kmod-usb-dwc2
-endef
-
-$(eval $(call Profile,VGV7510KW22NOR))
-
-define Profile/VGV7510KW22BRN
- NAME:=o2 Box 6431 / Arcadyan VGV7510KW22 (BRN)
- PACKAGES:=kmod-rt2800-pci wpad-mini kmod-usb-dwc2
-endef
-
-$(eval $(call Profile,VGV7510KW22BRN))
-
-define Profile/VGV7519NOR
- NAME:=Experiabox 8 VGV7519
- PACKAGES:=kmod-rt2800-pci wpad-mini kmod-usb-dwc2
-endef
-
-$(eval $(call Profile,VGV7519NOR))
-
-define Profile/VGV7519BRN
- NAME:=Experiabox 8 VGV7519 (BRN)
- PACKAGES:=kmod-rt2800-pci wpad-mini kmod-usb-dwc2
-endef
-
-$(eval $(call Profile,VGV7519BRN))
-
-define Profile/ARV7519RW22
- NAME:=Livebox Astoria ARV7519RW22
- PACKAGES:=kmod-usb-dwc2
-endef
-
-$(eval $(call Profile,ARV7519RW22))
diff --git a/target/linux/lantiq/xrx200/profiles/avm.mk b/target/linux/lantiq/xrx200/profiles/avm.mk
deleted file mode 100644
index 89909b92e3..0000000000
--- a/target/linux/lantiq/xrx200/profiles/avm.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-define Profile/FRITZ3370
- NAME:=Fritz!Box WLan - FRITZ3370
- PACKAGES:=kmod-ath9k wpad-mini kmod-usb-dwc2
-endef
-
-FRITZ3370_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
-FRITZ3370_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
-
-$(eval $(call Profile,FRITZ3370))
diff --git a/target/linux/lantiq/xrx200/profiles/bt.mk b/target/linux/lantiq/xrx200/profiles/bt.mk
deleted file mode 100644
index a1083bbb6d..0000000000
--- a/target/linux/lantiq/xrx200/profiles/bt.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-define Profile/BTHOMEHUBV5A
- NAME:=BT Home Hub 5A
- PACKAGES:=kmod-ath9k kmod-ath10k wpad-mini kmod-usb-dwc2
-endef
-
-BTHOMEHUBV5A_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
-BTHOMEHUBV5A_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
-
-$(eval $(call Profile,BTHOMEHUBV5A))
diff --git a/target/linux/lantiq/xrx200/profiles/lantiq.mk b/target/linux/lantiq/xrx200/profiles/lantiq.mk
deleted file mode 100644
index 39c3bc6051..0000000000
--- a/target/linux/lantiq/xrx200/profiles/lantiq.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-define Profile/EASY80920NOR
- NAME:=Lantiq VR9 - EASY80920NOR
- PACKAGES:=kmod-ath9k wpad-mini kmod-usb-dwc2 dsl-vrx200-firmware-xdsl-a dsl-vrx200-firmware-xdsl-b-patch
-endef
-
-$(eval $(call Profile,EASY80920NOR))
-
-define Profile/EASY80920NAND
- NAME:=Lantiq VR9 - EASY80920NAND
- PACKAGES:=kmod-ath9k wpad-mini kmod-usb-dwc2 dsl-vrx200-firmware-xdsl-a dsl-vrx200-firmware-xdsl-b-patch
-endef
-
-$(eval $(call Profile,EASY80920NAND))
diff --git a/target/linux/lantiq/xrx200/profiles/tplink.mk b/target/linux/lantiq/xrx200/profiles/tplink.mk
deleted file mode 100644
index 2ac364e3fb..0000000000
--- a/target/linux/lantiq/xrx200/profiles/tplink.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-define Profile/TDW8970
- NAME:=TP-LINK TD-W8970
- PACKAGES:=kmod-ath9k wpad-mini kmod-usb-dwc2 kmod-ledtrig-usbdev dsl-vrx200-firmware-xdsl-a dsl-vrx200-firmware-xdsl-b-patch
-endef
-
-$(eval $(call Profile,TDW8970))
-
-define Profile/TDW8980
- NAME:=TP-LINK TD-W8980
- PACKAGES:=kmod-ath9k wpad-mini kmod-usb-dwc2 kmod-ledtrig-usbdev dsl-vrx200-firmware-xdsl-a dsl-vrx200-firmware-xdsl-b-patch
-endef
-
-$(eval $(call Profile,TDW8980))
-
-define Profile/VR200v
- NAME:=TP-LINK Archer VR200v
- PACKAGES:=kmod-usb-dwc2 kmod-ledtrig-usbdev dsl-vrx200-firmware-xdsl-a dsl-vrx200-firmware-xdsl-b-patch
-endef
-
-$(eval $(call Profile,VR200v))
diff --git a/target/linux/lantiq/xrx200/profiles/zyxel.mk b/target/linux/lantiq/xrx200/profiles/zyxel.mk
deleted file mode 100644
index f6995f946b..0000000000
--- a/target/linux/lantiq/xrx200/profiles/zyxel.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-define Profile/P2812HNUF1
- NAME:=ZyXEL P-2812HNU-F1
- PACKAGES:=kmod-rt2800-pci wpad-mini kmod-usb-dwc2
-endef
-
-P2812HNUF1_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
-P2812HNUF1_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
-
-$(eval $(call Profile,P2812HNUF1))
-
-define Profile/P2812HNUF3
- NAME:=ZyXEL P-2812HNU-F3
- PACKAGES:=kmod-rt2800-pci wpad-mini kmod-usb-dwc2
-endef
-
-P2812HNUF3_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
-P2812HNUF3_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
-
-$(eval $(call Profile,P2812HNUF3))
-
diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk
index 50abb24cb9..e112ea0996 100644
--- a/target/linux/lantiq/xrx200/target.mk
+++ b/target/linux/lantiq/xrx200/target.mk
@@ -13,6 +13,8 @@ DEFAULT_PACKAGES+=kmod-leds-gpio \
kmod-ltq-ptm-vr9 \
kmod-ltq-deu-vr9 \
ltq-vdsl-app \
+ dsl-vrx200-firmware-xdsl-a \
+ dsl-vrx200-firmware-xdsl-b-patch \
ppp-mod-pppoa \
swconfig
diff --git a/target/linux/lantiq/xway/profiles/00-default.mk b/target/linux/lantiq/xway/profiles/00-default.mk
new file mode 100644
index 0000000000..26bc8b502b
--- /dev/null
+++ b/target/linux/lantiq/xway/profiles/00-default.mk
@@ -0,0 +1,9 @@
+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))
diff --git a/target/linux/lantiq/xway/profiles/arv.mk b/target/linux/lantiq/xway/profiles/arv.mk
deleted file mode 100644
index 976cd194d0..0000000000
--- a/target/linux/lantiq/xway/profiles/arv.mk
+++ /dev/null
@@ -1,167 +0,0 @@
-define Profile/ARV4525PW
- NAME:=Speedport W502V Typ A - ARV4525PW
- PACKAGES:=kmod-ath5k wpad-mini \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa
-endef
-
-$(eval $(call Profile,ARV4525PW))
-
-define Profile/ARV8539PW22
- NAME:=Speedport W504V Typ A - ARV8539PW22
- PACKAGES:=kmod-ltq-hcd-danube \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ath9k wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,ARV8539PW22))
-
-define Profile/ARV7525PW
- NAME:=Speedport W303V Typ A - ARV7525PW
- PACKAGES:=kmod-rt2800-pci wpad-mini \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa
-endef
-
-$(eval $(call Profile,ARV7525PW))
-
-define Profile/ARV4518PWR01
- NAME:=ARV4518PWR01
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ath5k wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,ARV4518PWR01))
-
-define Profile/ARV4518PWR01A
- NAME:=ARV4518PWR01A
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ath5k wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,ARV4518PWR01A))
-
-define Profile/ARV4510PW
- NAME:=Wippies, Elisa - ARV4510PW
- PACKAGES:=kmod-ledtrig-usbdev kmod-usb2-pci kmod-usb-uhci \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ltq-tapi kmod-ltq-vmmc \
- kmod-rt2800-pci kmod-ath5k wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,ARV4510PW))
-
-define Profile/ARV4519PW
- NAME:=Vodafone, Pirelli - ARV4519PW
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- swconfig
-endef
-
-$(eval $(call Profile,ARV4519PW))
-
-define Profile/ARV7510PW22
- NAME:=Astoria - ARV7510PW22
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ltq-tapi kmod-ltq-vmmc \
- kmod-rt2800-pci wpad-mini \
- kmod-usb-uhci kmod-usb2 kmod-usb2-pci \
- swconfig
-endef
-
-$(eval $(call Profile,ARV7510PW22))
-
-define Profile/ARV7518PW
- NAME:=Astoria - ARV7518PW
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ath9k wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,ARV7518PW))
-
-define Profile/ARV7519PW
- NAME:=Astoria - ARV7519PW
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-rt2800-pci wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,ARV7519PW))
-
-define Profile/ARV4520PW
- NAME:=Easybox 800, WAV-281 - ARV4520PW
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-rt61-pci wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,ARV4520PW))
-
-define Profile/ARV452CQW
- NAME:=Easybox 801 - ARV452CQW
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ath5k wpad-mini \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- swconfig
-endef
-
-$(eval $(call Profile,ARV452CQW))
-
-define Profile/ARV752DPW
- NAME:=Easybox 802 - ARV752DPW
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ltq-tapi kmod-ltq-vmmc \
- kmod-rt2800-pci wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,ARV752DPW))
-
-define Profile/ARV752DPW22
- NAME:=Easybox 803 - ARV752DPW22
- PACKAGES:=kmod-usb2-pci kmod-usb-uhci kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ltq-tapi kmod-ltq-vmmc \
- kmod-rt2800-pci wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,ARV752DPW22))
diff --git a/target/linux/lantiq/xway/profiles/audiocodes.mk b/target/linux/lantiq/xway/profiles/audiocodes.mk
deleted file mode 100644
index 006cc50c13..0000000000
--- a/target/linux/lantiq/xway/profiles/audiocodes.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-define Profile/ACMP252
- NAME:=AudioCodes MediaPack MP-252
- PACKAGES:=kmod-rt2x00-pci wpad-mini \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-a kmod-ltq-ptm-danube \
- ltq-adsl-app
-endef
-
-$(eval $(call Profile,ACMP252))
diff --git a/target/linux/lantiq/xway/profiles/avm.mk b/target/linux/lantiq/xway/profiles/avm.mk
deleted file mode 100644
index 2922b0862e..0000000000
--- a/target/linux/lantiq/xway/profiles/avm.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-define Profile/FRITZ7320
- NAME:=1&1 HomeServer - FRITZ7320
- PACKAGES:=kmod-ath9k wpad-mini \
- kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
- kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ltq-deu-ar9 kmod-usb-dwc2
-endef
-
-$(eval $(call Profile,FRITZ7320))
diff --git a/target/linux/lantiq/xway/profiles/aztech.mk b/target/linux/lantiq/xway/profiles/aztech.mk
deleted file mode 100644
index 8f4887720e..0000000000
--- a/target/linux/lantiq/xway/profiles/aztech.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-define Profile/GR7000
- NAME:=Aztech GR7000
- PACKAGES:= \
- kmod-ltq-deu-ar9 kmod-usb-dwc2 \
- swconfig
-endef
-$(eval $(call Profile,GR7000))
diff --git a/target/linux/lantiq/xway/profiles/bt.mk b/target/linux/lantiq/xway/profiles/bt.mk
deleted file mode 100644
index 656d7f3089..0000000000
--- a/target/linux/lantiq/xway/profiles/bt.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-define Profile/BTHOMEHUBV2B
- NAME:=BT Home Hub 2B
- PACKAGES:=kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
- kmod-ltq-deu-danube \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ath9k wpad-mini \
- swconfig
-endef
-
-
-BTHOMEHUBV2B_UBIFS_OPTS:="-m 512 -e 15872 -c 1959"
-BTHOMEHUBV2B_UBI_OPTS:="-m 512 -p 16KiB -s 256"
-
-
-$(eval $(call Profile,BTHOMEHUBV2B))
-
-define Profile/BTHOMEHUBV3A
- NAME:=BT Home Hub 3A
- PACKAGES:=kmod-usb-dwc2 kmod-ledtrig-usbdev \
- kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
- kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
- kmod-ltq-deu-ar9 \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ath9k wpad-mini \
- swconfig uboot-envtools
-endef
-
-BTHOMEHUBV3A_UBIFS_OPTS:="-m 512 -e 15872 -c 1959"
-BTHOMEHUBV3A_UBI_OPTS:="-m 512 -p 16KiB -s 256"
-
-
-$(eval $(call Profile,BTHOMEHUBV3A))
diff --git a/target/linux/lantiq/xway/profiles/buffalo.mk b/target/linux/lantiq/xway/profiles/buffalo.mk
deleted file mode 100644
index 687975011a..0000000000
--- a/target/linux/lantiq/xway/profiles/buffalo.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-define Profile/WBMRA
- NAME:=Buffalo WBMR-HP-G300H (A) - WBMR
- PACKAGES:=kmod-usb-dwc2 kmod-ledtrig-usbdev \
- kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
- kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ath9k wpad hostapd-utils \
- swconfig
-endef
-
-$(eval $(call Profile,WBMRA))
-
-define Profile/WBMRB
- NAME:=Buffalo WBMR-HP-G300H (B) - WBMR
- PACKAGES:=kmod-usb-dwc2 kmod-ledtrig-usbdev \
- kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
- kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ath9k wpad hostapd-utils \
- swconfig
-endef
-
-$(eval $(call Profile,WBMRB))
diff --git a/target/linux/lantiq/xway/profiles/gigaset.mk b/target/linux/lantiq/xway/profiles/gigaset.mk
deleted file mode 100644
index c6259af972..0000000000
--- a/target/linux/lantiq/xway/profiles/gigaset.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-define Profile/GIGASX76X
- NAME:=Gigaset sx76x
- PACKAGES:= kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
- kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
- kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
- ltq-adsl-app ppp-mod-pppoe \
- kmod-ath5k wpad-mini \
- swconfig
-endef
-
-$(eval $(call Profile,GIGASX76X))
diff --git a/target/linux/lantiq/xway/profiles/lantiq.mk b/target/linux/lantiq/xway/profiles/lantiq.mk
deleted file mode 100644
index 800a9f6768..0000000000
--- a/target/linux/lantiq/xway/profiles/lantiq.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-define Profile/EASY50712
- NAME:=Lantiq Danube - EASY50712
-endef
-
-$(eval $(call Profile,EASY50712))
diff --git a/target/linux/lantiq/xway/profiles/netgear.mk b/target/linux/lantiq/xway/profiles/netgear.mk
deleted file mode 100644
index b30ffe66f7..0000000000
--- a/target/linux/lantiq/xway/profiles/netgear.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-define Profile/DGN3500
- NAME:=Netgear DGN3500
- PACKAGES:=kmod-usb-dwc2 kmod-ledtrig-usbdev \
- kmod-ath9k wpad-mini \
- kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
- kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ltq-deu-ar9 swconfig
-endef
-
-$(eval $(call Profile,DGN3500))
-
-define Profile/DGN3500B
- NAME:=Netgear DGN3500B
- PACKAGES:=kmod-usb-dwc2 kmod-ledtrig-usbdev \
- kmod-ath9k wpad-mini \
- kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
- kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
- ltq-adsl-app ppp-mod-pppoa \
- kmod-ltq-deu-ar9 swconfig
-endef
-
-$(eval $(call Profile,DGN3500B))
diff --git a/target/linux/lantiq/xway/profiles/zte.mk b/target/linux/lantiq/xway/profiles/zte.mk
deleted file mode 100644
index 7de0b26be1..0000000000
--- a/target/linux/lantiq/xway/profiles/zte.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-define Profile/H201L
- NAME:=ZTE H201L - H201L
- PACKAGES:=kmod-ath9k-htc wpad-mini \
- kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
- kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
- ltq-adsl-app ppp-mod-pppoe \
- kmod-ltq-deu-ar9 kmod-usb-dwc2 \
- kmod-ltq-tapi kmod-ltq-vmmc \
- swconfig
-endef
-
-$(eval $(call Profile,H201L))
diff --git a/target/linux/lantiq/xway/profiles/zyxel.mk b/target/linux/lantiq/xway/profiles/zyxel.mk
deleted file mode 100644
index a1177fbf1f..0000000000
--- a/target/linux/lantiq/xway/profiles/zyxel.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-define Profile/P2601HNFX
- NAME:=ZyXEL P-2601HN-Fx
- PACKAGES:= kmod-rt2800-usb wpad-mini \
- kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
- kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
- ltq-adsl-app ppp-mod-pppoe \
- kmod-ltq-deu-ar9 kmod-usb-dwc2 \
- swconfig
-endef
-$(eval $(call Profile,P2601HNFX))
diff --git a/target/linux/lantiq/xway_legacy/config-default b/target/linux/lantiq/xway_legacy/config-default
new file mode 100644
index 0000000000..b838106ddc
--- /dev/null
+++ b/target/linux/lantiq/xway_legacy/config-default
@@ -0,0 +1,29 @@
+CONFIG_ADM6996_PHY=y
+CONFIG_AR8216_PHY=y
+CONFIG_CRC16=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+# CONFIG_GPIO_SYSFS is not set
+# CONFIG_HW_RANDOM is not set
+CONFIG_INPUT=y
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_POLLDEV=y
+# CONFIG_ISDN is not set
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+# CONFIG_LEDS_TRIGGER_TIMER is not set
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+# CONFIG_MTD_PHYSMAP_OF is not set
+CONFIG_NLS=y
+CONFIG_RTL8306_PHY=y
+CONFIG_RTL8366S_PHY=y
+CONFIG_RTL8367B_PHY=y
+CONFIG_RTL8367_PHY=y
+CONFIG_USB=y
+CONFIG_USB_COMMON=y
+# CONFIG_USB_EHCI_HCD is not set
+CONFIG_USB_SUPPORT=y
+# CONFIG_USB_UHCI_HCD is not set
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_ZLIB_INFLATE=y
diff --git a/target/linux/lantiq/xway_legacy/profiles/00-default.mk b/target/linux/lantiq/xway_legacy/profiles/00-default.mk
new file mode 100644
index 0000000000..26bc8b502b
--- /dev/null
+++ b/target/linux/lantiq/xway_legacy/profiles/00-default.mk
@@ -0,0 +1,9 @@
+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))
diff --git a/target/linux/lantiq/xway_legacy/target.mk b/target/linux/lantiq/xway_legacy/target.mk
new file mode 100644
index 0000000000..2d9cc56d38
--- /dev/null
+++ b/target/linux/lantiq/xway_legacy/target.mk
@@ -0,0 +1,12 @@
+ARCH:=mips
+SUBTARGET:=xway_legacy
+BOARDNAME:=XWAY Legacy
+FEATURES:=squashfs atm mips16 ramdisk small_flash
+CPU_TYPE:=34kc
+CPU_SUBTYPE:=dsp
+
+DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug
+
+define Target/Description
+ Lantiq XWAY Legacy for old boards with small flash
+endef
diff --git a/target/linux/malta/be/target.mk b/target/linux/malta/be/target.mk
index 92ae58eb9d..ddb65f040d 100644
--- a/target/linux/malta/be/target.mk
+++ b/target/linux/malta/be/target.mk
@@ -1,5 +1,4 @@
ARCH:=mips
-ARCH_PACKAGES:=malta_mips
SUBTARGET:=be
BOARDNAME:=Big Endian
FEATURES:=ramdisk mips16
diff --git a/target/linux/malta/be64/target.mk b/target/linux/malta/be64/target.mk
index dad3a1c6c5..96c0b50916 100644
--- a/target/linux/malta/be64/target.mk
+++ b/target/linux/malta/be64/target.mk
@@ -1,5 +1,4 @@
ARCH:=mips64
-ARCH_PACKAGES:=malta_mips64
SUBTARGET:=be64
BOARDNAME:=Big Endian (64-bits)
FEATURES:=ramdisk
diff --git a/target/linux/malta/le/target.mk b/target/linux/malta/le/target.mk
index 35fcf4cfe1..12c860a50e 100644
--- a/target/linux/malta/le/target.mk
+++ b/target/linux/malta/le/target.mk
@@ -1,5 +1,4 @@
ARCH:=mipsel
-ARCH_PACKAGES:=malta_mipsel
SUBTARGET:=le
BOARDNAME:=Little Endian
FEATURES:=ramdisk mips16
diff --git a/target/linux/malta/le64/target.mk b/target/linux/malta/le64/target.mk
index 26b53c12bd..badea1945d 100644
--- a/target/linux/malta/le64/target.mk
+++ b/target/linux/malta/le64/target.mk
@@ -1,5 +1,4 @@
ARCH:=mips64el
-ARCH_PACKAGES:=malta_mipsel64
SUBTARGET:=le64
BOARDNAME:=Little Endian (64-bits)
FEATURES:=ramdisk
diff --git a/target/linux/oxnas/Makefile b/target/linux/oxnas/Makefile
index f4a01f189f..0ee349836f 100644
--- a/target/linux/oxnas/Makefile
+++ b/target/linux/oxnas/Makefile
@@ -21,8 +21,9 @@ include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += \
kmod-ata-core kmod-ata-oxnas-sata kmod-button-hotplug \
- kmod-input-gpio-keys-polled kmod-leds-gpio kmod-usb2-oxnas \
- uboot-envtools uboot-oxnas-ox820
+ kmod-input-gpio-keys-polled kmod-ledtrig-usbdev kmod-leds-gpio \
+ kmod-usb2-oxnas kmod-usb-storage uboot-envtools \
+ uboot-oxnas-ox820
KERNELNAME:=zImage dtbs
diff --git a/target/linux/oxnas/config-4.4 b/target/linux/oxnas/config-4.4
index 07ce8b2f64..23b20de4a3 100644
--- a/target/linux/oxnas/config-4.4
+++ b/target/linux/oxnas/config-4.4
@@ -192,9 +192,6 @@ CONFIG_I2C=y
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_BOARDINFO=y
CONFIG_ICPLUS_PHY=y
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-CONFIG_INET_UDP_DIAG=y
CONFIG_INPUT=y
# CONFIG_INPUT_MISC is not set
CONFIG_IOMMU_API=y
@@ -286,7 +283,6 @@ CONFIG_OF_PCI_IRQ=y
CONFIG_OF_RESERVED_MEM=y
CONFIG_OLD_SIGACTION=y
CONFIG_OLD_SIGSUSPEND3=y
-CONFIG_PACKET_DIAG=y
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_PCI=y
CONFIG_PCIEAER=y
@@ -346,7 +342,6 @@ CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_SG_SPLIT is not set
CONFIG_SMP=y
CONFIG_SMP_ON_UP=y
-CONFIG_SOCK_DIAG=y
CONFIG_SRCU=y
CONFIG_STMMAC_ETH=y
CONFIG_STMMAC_PLATFORM=y
diff --git a/target/linux/oxnas/image/Makefile b/target/linux/oxnas/image/Makefile
index 27da2da27c..27e21a5cba 100644
--- a/target/linux/oxnas/image/Makefile
+++ b/target/linux/oxnas/image/Makefile
@@ -14,23 +14,31 @@ KD20_UBIFS_OPTS = -m 2048 -e 126KiB -c 4096
POGOPLUG_PRO_UBIFS_OPTS = -m 2048 -e 126KiB -c 4096
POGOPLUG_V3_UBIFS_OPTS = -m 2048 -e 126KiB -c 4096
-DEVICE_VARS += DEVICE_DTS KERNEL_SIZE PAGESIZE BLOCKSIZE SUBPAGESIZE
+DEVICE_VARS += DTS KERNEL_SIZE PAGESIZE BLOCKSIZE SUBPAGESIZE
DEVICE_VARS += KERNEL_IN_UBI UBOOTENV_IN_UBI UBIFS_OPTS
KERNEL_LOADADDR := 0x60008000
-TARGET_DEVICES = akitio kd20 pogoplug-pro pogoplug-v3 stg212
+
+define Build/ubootable
+ (dd if="$(KDIR)/u-boot.bin" bs=128k conv=sync; \
+ dd if="$@" bs=128k conv=sync ) >> $@.new
+ @mv "$@.new" "$@"
+endef
define Device/Default
- KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
- KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL_DEPENDS = $$(wildcard $$(DTS_DIR)/ox820-$$(DTS).dts)
+ KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/ox820-$$(DTS).dtb
KERNEL_NAME := zImage
- KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | ubootable
+ KERNEL_SUFFIX := -uImage
+ KERNEL_INSTALL := 1
+ KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(DTS_DIR)/ox820-$$(DTS).dtb | ubootable
KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-u-boot-initramfs
+ KERNEL_INITRAMFS_SUFFIX := .bin
BLOCKSIZE := 128KiB
PAGESIZE := 2048
SUBPAGESIZE := 512
FILESYSTEMS := squashfs ubifs
- PROFILES := Default
+ PROFILES = Default $$(DTS)
IMAGES := ubinized.bin sysupgrade.tar
IMAGE/ubinized.bin := append-ubi
IMAGE/sysupgrade.tar := sysupgrade-nand
@@ -39,52 +47,39 @@ define Device/Default
endef
define Device/akitio
- PROFILES := Default AKITIO
- DEVICE_DTS := ox820-akitio
+ DTS := akitio
+ DEVICE_TITLE := Akitio MyCloud mini / Silverstone DC01
+ DEVICE_PACKAGES := kmod-i2c-gpio kmod-rtc-ds1307
endef
+TARGET_DEVICES += akitio
define Device/kd20
- PROFILES := Default KD20
- DEVICE_DTS := ox820-kd20
+ DTS := kd20
+ DEVICE_TITLE := Shuttle KD20
+ DEVICE_PACKAGES := kmod-usb3 kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper \
+ kmod-hwmon-core kmod-hwmon-gpiofan
endef
+TARGET_DEVICES += kd20
define Device/pogoplug-pro
- PROFILES := Default POGOPLUG_PRO
- DEVICE_DTS := ox820-pogoplug-pro
+ DTS := pogoplug-pro
+ DEVICE_TITLE := Cloud Engines Pogoplug Pro (with mPCIe)
endef
+TARGET_DEVICES += pogoplug-pro
define Device/pogoplug-v3
- PROFILES := Default POGOPLUG_V3
- DEVICE_DTS := ox820-pogoplug-v3
+ DTS := pogoplug-v3
+ DEVICE_TITLE := Cloud Engines Pogoplug V3 (no mPCIe)
endef
+TARGET_DEVICES += pogoplug-v3
define Device/stg212
- PROFILES := Default STG212
- DEVICE_DTS := ox820-stg212
+ DTS := stg212
+ DEVICE_TITLE := MitraStar STG-212
endef
+TARGET_DEVICES += stg212
VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
-define Build/ubootable
- (dd if="$(KDIR)/u-boot.bin" bs=128k conv=sync; \
- dd if="$@" bs=128k conv=sync ) >> $@.new
- @mv "$@.new" "$@"
-endef
-
-define Image/BuildKernel
- $(call Image/BuildKernel/Template/$(PROFILE))
-endef
-
-define Image/InstallKernel
- $(call Image/InstallKernel/Template/$(PROFILE))
-endef
-
-define Image/Build
- $(if $(Image/Build/$(1)), \
- $(call Image/Build/$(1),$(1)), \
- $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-$(1).img \
- )
-endef
-
$(eval $(call BuildImage))
diff --git a/target/linux/oxnas/modules.mk b/target/linux/oxnas/modules.mk
new file mode 100644
index 0000000000..7016398619
--- /dev/null
+++ b/target/linux/oxnas/modules.mk
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2016 LEDE project
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define KernelPackage/ata-oxnas-sata
+ SUBMENU:=$(BLOCK_MENU)
+ TITLE:=oxnas Serial ATA support
+ KCONFIG:=CONFIG_SATA_OXNAS
+ DEPENDS:=@TARGET_oxnas
+ FILES:=$(LINUX_DIR)/drivers/ata/sata_oxnas.ko
+ AUTOLOAD:=$(call AutoLoad,41,sata_oxnas,1)
+ $(call AddDepends/ata)
+endef
+
+define KernelPackage/ata-oxnas-sata/description
+ SATA support for OX934 core found in the OX82x/PLX782x SoCs
+endef
+
+$(eval $(call KernelPackage,ata-oxnas-sata))
+
+
+define KernelPackage/usb2-oxnas
+ SUBMENU:=$(BLOCK_MENU)
+ TITLE:=OXNAS USB controller driver
+ DEPENDS:=@TARGET_oxnas +kmod-usb2
+ KCONFIG:=CONFIG_USB_EHCI_OXNAS
+ FILES:=$(LINUX_DIR)/drivers/usb/host/ehci-oxnas.ko
+ AUTOLOAD:=$(call AutoLoad,55,ehci-oxnas,1)
+ $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb2-oxnas/description
+ This driver provides USB Device Controller support for the
+ EHCI USB host built-in to the PLXTECH NAS782x SoC
+endef
+
+$(eval $(call KernelPackage,usb2-oxnas))
diff --git a/target/linux/oxnas/patches-4.4/010-arm_introduce-dma-fiq-irq-broadcast.patch b/target/linux/oxnas/patches-4.4/010-arm_introduce-dma-fiq-irq-broadcast.patch
index b59c06e2ab..024675e599 100644
--- a/target/linux/oxnas/patches-4.4/010-arm_introduce-dma-fiq-irq-broadcast.patch
+++ b/target/linux/oxnas/patches-4.4/010-arm_introduce-dma-fiq-irq-broadcast.patch
@@ -4,15 +4,17 @@
#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
-+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
- #define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
+-#define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
- #define dmac_flush_range __glue(_CACHE,_dma_flush_range)
+-#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
++#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
++# define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
++# define dmac_flush_range __glue(_CACHE,_dma_flush_range)
+#else
-+#define __cpuc_flush_dcache_area __glue(fiq,_flush_kern_dcache_area)
++# define __cpuc_flush_dcache_area __glue(fiq,_flush_kern_dcache_area)
++# define dmac_flush_range __glue(fiq,_dma_flush_range)
++#endif
+
-+#define dmac_flush_range __glue(fiq,_dma_flush_range)
-+#endif /* CONFIG_DMA_CACHE_FIQ_BROADCAST */
#endif
#endif
@@ -38,15 +40,23 @@
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
-@@ -329,7 +329,11 @@ void flush_dcache_page(struct page *page
+@@ -319,6 +319,7 @@ void __sync_icache_dcache(pte_t pteval)
+ void flush_dcache_page(struct page *page)
+ {
+ struct address_space *mapping;
++ bool skip_broadcast = true;
+
+ /*
+ * The zero page is never written to, so never has any dirty
+@@ -329,7 +330,10 @@ void flush_dcache_page(struct page *page
mapping = page_mapping(page);
+- if (!cache_ops_need_broadcast() &&
+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
- if (!cache_ops_need_broadcast() &&
-+#else
-+ if (
++ skip_broadcast = !cache_ops_need_broadcast();
+#endif
++ if (skip_broadcast &&
mapping && !page_mapped(page))
clear_bit(PG_dcache_clean, &page->flags);
else {
@@ -56,13 +66,15 @@
#include <asm/glue-cache.h>
#ifndef MULTI_CACHE
+-#define dmac_map_area __glue(_CACHE,_dma_map_area)
+-#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
- #define dmac_map_area __glue(_CACHE,_dma_map_area)
- #define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
++# define dmac_map_area __glue(_CACHE,_dma_map_area)
++# define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
+#else
-+#define dmac_map_area __glue(fiq,_dma_map_area)
-+#define dmac_unmap_area __glue(fiq,_dma_unmap_area)
-+#endif /* CONFIG_DMA_CACHE_FIQ_BROADCAST */
++# define dmac_map_area __glue(fiq,_dma_map_area)
++# define dmac_unmap_area __glue(fiq,_dma_unmap_area)
++#endif
/*
* These are private to the dma-mapping API. Do not use directly.
diff --git a/target/linux/oxnas/profiles/00-default.mk b/target/linux/oxnas/profiles/00-default.mk
index 67f866ee80..fedf730088 100644
--- a/target/linux/oxnas/profiles/00-default.mk
+++ b/target/linux/oxnas/profiles/00-default.mk
@@ -7,11 +7,11 @@
define Profile/Default
NAME:=Default Profile
+ PRIORITY:=1
PACKAGES:=\
- kmod-usb-core kmod-usb3 kmod-ledtrig-usbdev \
- kmod-usb-storage \
- kmod-i2c-gpio kmod-rtc-pcf8563 kmod-rtc-ds1307 \
- kmod-gpio-beeper kmod-hwmon-core kmod-hwmon-gpiofan
+ kmod-i2c-gpio kmod-gpio-beeper kmod-hwmon-core \
+ kmod-hwmon-gpiofan kmod-rtc-pcf8563 kmod-rtc-ds1307 \
+ kmod-usb3
endef
define Profile/Default/Description
diff --git a/target/linux/oxnas/profiles/akitio.mk b/target/linux/oxnas/profiles/akitio.mk
deleted file mode 100644
index a10860101a..0000000000
--- a/target/linux/oxnas/profiles/akitio.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/AKITIO
- NAME:=Akitio MyCloud mini / Silverstone DC01
- PACKAGES:= \
- kmod-usb-storage kmod-i2c-gpio kmod-rtc-ds1307
-endef
-
-define Profile/AKITIO/Description
- Profile for the Akitio MyCloud mini aka. Silverstone DC01
-endef
-
-$(eval $(call Profile,AKITIO))
diff --git a/target/linux/oxnas/profiles/cloudengines.mk b/target/linux/oxnas/profiles/cloudengines.mk
deleted file mode 100644
index ed0a235254..0000000000
--- a/target/linux/oxnas/profiles/cloudengines.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/POGOPLUG_PRO
- NAME:=Cloud Engines Pogoplug Pro
-endef
-
-define Profile/POGOPLUG_PRO/Description
- Profile with built-in ox820 Pogoplug Pro device-tree
- (board with miniPCIe slot)
-endef
-
-define Profile/POGOPLUG_V3
- NAME:=Cloud Engines Pogoplug V3
-endef
-
-define Profile/POGOPLUG_V3/Description
- Profile with built-in ox820 Pogoplug V3 device-tree
- (board without miniPCIe slot)
-endef
-
-$(eval $(call Profile,POGOPLUG_PRO))
-$(eval $(call Profile,POGOPLUG_V3))
diff --git a/target/linux/oxnas/profiles/mitrastar.mk b/target/linux/oxnas/profiles/mitrastar.mk
deleted file mode 100644
index 1991c9b688..0000000000
--- a/target/linux/oxnas/profiles/mitrastar.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/STG212
- NAME:=MitraStar STG-212
-endef
-
-define Profile/STG212/Description
- Profile with built-in ox820 STG-212 device-tree
-endef
-
-$(eval $(call Profile,STG212))
diff --git a/target/linux/oxnas/profiles/shuttle.mk b/target/linux/oxnas/profiles/shuttle.mk
deleted file mode 100644
index a83935f9c5..0000000000
--- a/target/linux/oxnas/profiles/shuttle.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/KD20
- NAME:=Shuttle KD20
- PACKAGES:= \
- kmod-usb3 kmod-usb-storage kmod-i2c-gpio kmod-rtc-pcf8563 \
- kmod-gpio-beeper kmod-hwmon-core kmod-hwmon-gpiofan
-endef
-
-define Profile/KD20/Description
- Profile with built-in ox820 KD20 device-tree
-endef
-
-$(eval $(call Profile,KD20))
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 47e1e6a6a3..460253c9ff 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -46,6 +46,7 @@ all0239-3g|\
hw550-3g|\
mofi3500-3gn|\
sap-g3200u3|\
+sk-wb8|\
wf-2881)
set_usb_led "$board:green:usb"
;;
@@ -77,6 +78,13 @@ broadway)
set_usb_led "$board:red:diskmounted"
set_wifi_led "$board:red:wps_active"
;;
+c50)
+ ucidef_set_led_default "power" "power" "tp-link:blue:power" "0"
+ ucidef_set_led_netdev "lan" "lan" "tp-link:blue:lan" "eth0.2"
+ set_usb_led "tp-link:blue:usb"
+ ucidef_set_led_wlan "wlan2g" "wlan2g" "tp-link:blue:wlan2g" "phy1radio"
+ ucidef_set_led_wlan "wlan5g" "wlan5g" "tp-link:blue:wlan5g" "phy0radio"
+ ;;
cf-wr800n)
ucidef_set_led_netdev "lan" "lan" "$board:white:ethernet" eth0.1
set_wifi_led "$board:white:wifi"
@@ -185,7 +193,8 @@ miniembplug)
set_wifi_led "$board:red:wlan"
set_usb_led "$board:green:mobile"
;;
-miwifi-mini)
+miwifi-mini|\
+miwifi-nano)
ucidef_set_led_default "power" "power" "$board:red:status" "1"
;;
miwifi-nano)
@@ -287,6 +296,11 @@ y1s)
set_usb_led "$board:blue:usb"
set_wifi_led "$board:blue:wifi"
;;
+zbt-ape522ii)
+ ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$board:green:wlan2g4" "wlan1"
+ ucidef_set_led_netdev "sys1" "wlan1" "$board:green:sys1" "wlan1" "tx rx"
+ ucidef_set_led_netdev "sys2" "wlan0" "$board:green:sys2" "wlan0" "tx rx"
+ ;;
zbt-wa05)
ucidef_set_led_default "power" "power" "$board:blue:power" "1"
set_wifi_led "$board:blue:air"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index e7826d48b0..dbb5fb43e0 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -47,8 +47,10 @@ ramips_setup_interfaces()
linkits7688d | \
m2m|\
microwrt|\
+ mpr-a2|\
ncs601w|\
w150m|\
+ widora-neo|\
wnce2001|\
zte-q7)
ucidef_add_switch "switch0"
@@ -79,6 +81,7 @@ ramips_setup_interfaces()
pbr-m1|\
psg1208|\
sap-g3200u3|\
+ sk-wb8|\
wf-2881|\
whr-300hp2|\
whr-600d|\
@@ -110,6 +113,7 @@ ramips_setup_interfaces()
atp-52b|\
awm002-evb|\
awm003-evb|\
+ c50|\
dir-645|\
dir-860l-b1|\
f5d8235-v1|\
@@ -169,6 +173,10 @@ ramips_setup_interfaces()
wrh-300cr)
ucidef_set_interface_lan "eth0"
;;
+ duzun-dm06)
+ ucidef_add_switch "switch0" \
+ "1:lan" "0:wan" "6@eth0"
+ ;;
e1700|\
mt7620a_mt7530)
ucidef_add_switch "switch1" \
@@ -216,6 +224,7 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "0:wan" "6@eth0"
;;
+ zbt-ape522ii|\
zbt-we826|\
zbt-wr8305rt)
ucidef_add_switch "switch0" \
@@ -260,7 +269,6 @@ ramips_setup_macs()
freestation5|\
hlk-rm04|\
mpr-a1|\
- mpr-a2|\
psr-680w|\
sl-r7205|\
y1|\
@@ -307,6 +315,9 @@ ramips_setup_macs()
lan_mac=$(macaddr_setbit_la "$lan_mac")
wan_mac=$(mtd_get_mac_binary factory 32772)
;;
+ sk-wb8)
+ wan_mac=$(mtd_get_mac_binary factory 57350)
+ ;;
tew-691gr)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 3)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index c638d16a81..0c5abb2861 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -79,9 +79,13 @@ get_status_led() {
;;
awapn2403|\
dir-645|\
+ sk-wb8|\
wrh-300cr)
status_led="$board:green:wps"
;;
+ c50)
+ status_led="tp-link:blue:power"
+ ;;
cf-wr800n|\
psg1208)
status_led="$board:white:wps"
@@ -144,7 +148,8 @@ get_status_led() {
status_led="$board:amber:cpu"
;;
oy-0001|\
- sl-r7205)
+ sl-r7205|\
+ zbt-we826)
status_led="$board:green:wifi"
;;
psr-680w)
@@ -154,7 +159,8 @@ get_status_led() {
re6500|\
whr-1166d|\
whr-300hp2|\
- whr-600d)
+ whr-600d|\
+ widora-neo)
status_led="$board:orange:wifi"
;;
mzk-ex300np|\
@@ -191,7 +197,7 @@ get_status_led() {
;;
wsr-1166|\
wsr-600)
- status_led="$board:orange:diag"
+ status_led="$board:green:power"
;;
wrtnode2r | \
wrtnode2p | \
diff --git a/target/linux/ramips/base-files/etc/init.d/bootcount b/target/linux/ramips/base-files/etc/init.d/bootcount
new file mode 100755
index 0000000000..b93e3c96f1
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/init.d/bootcount
@@ -0,0 +1,11 @@
+#!/bin/sh /etc/rc.common
+. /lib/ramips.sh
+
+START=99
+
+start() {
+ local board=$(ramips_board_name)
+ if [ $board = "sk-wb8" ]; then
+ fw_setenv bootcount 0
+ fi
+}
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 0ac0f68bb5..10139d7fc6 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -82,6 +82,9 @@ ramips_board_detect() {
*"C20i")
name="c20i"
;;
+ *"C50")
+ name="c50"
+ ;;
*"Carambola")
name="carambola"
;;
@@ -151,6 +154,9 @@ ramips_board_detect() {
*"Dovado Tiny AC")
name="tiny-ac"
;;
+ *"DuZun DM06")
+ name="duzun-dm06"
+ ;;
*"E1700")
name="e1700"
;;
@@ -376,6 +382,9 @@ ramips_board_detect() {
*"RUT5XX")
name="rut5xx"
;;
+ *"SamKnows Whitebox 8")
+ name="sk-wb8"
+ ;;
*"SAP-G3200U3")
name="sap-g3200u3"
;;
@@ -433,6 +442,9 @@ ramips_board_detect() {
*"WHR-G300N")
name="whr-g300n"
;;
+ *"Widora-NEO")
+ name="widora-neo"
+ ;;
*"WiTi")
name="witi"
;;
@@ -511,6 +523,9 @@ ramips_board_detect() {
*"Y1S")
name="y1s"
;;
+ *"ZBT-APE522II")
+ name="zbt-ape522ii"
+ ;;
*"ZBT-WA05")
name="zbt-wa05"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 86ea4a33bd..e3bea004fa 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -50,6 +50,7 @@ platform_check_image() {
dir-620-a1|\
dir-620-d1|\
dir-810l|\
+ duzun-dm06|\
e1700|\
esr-9753|\
ex2700|\
@@ -112,6 +113,7 @@ platform_check_image() {
rt-n56u|\
rut5xx|\
sap-g3200u3|\
+ sk-wb8|\
sl-r7205|\
tew-691gr|\
tew-692gr|\
@@ -128,6 +130,7 @@ platform_check_image() {
whr-300hp2|\
whr-600d|\
whr-g300n|\
+ widora-neo|\
witi|\
wizfi630a|\
wl-330n|\
@@ -152,6 +155,7 @@ platform_check_image() {
x8|\
y1|\
y1s|\
+ zbt-ape522ii|\
zbt-wa05|\
zbt-we826|\
zbt-wg2626|\
@@ -179,7 +183,8 @@ platform_check_image() {
}
return 0
;;
- c20i)
+ c20i|\
+ c50)
[ "$magic" != "03000000" ] && {
echo "Invalid image type."
return 1
diff --git a/target/linux/ramips/dts/3G-6200N.dts b/target/linux/ramips/dts/3G-6200N.dts
index e5fa901330..cd2ba51d1a 100644
--- a/target/linux/ramips/dts/3G-6200N.dts
+++ b/target/linux/ramips/dts/3G-6200N.dts
@@ -6,15 +6,6 @@
compatible = "3G-6200N", "ralink,rt3050-soc";
model = "Edimax 3g-6200n";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -53,18 +44,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -102,8 +81,29 @@
linux,code = <0x100>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/3G-6200NL.dts b/target/linux/ramips/dts/3G-6200NL.dts
index 39f7f5d338..5ae43b81cb 100644
--- a/target/linux/ramips/dts/3G-6200NL.dts
+++ b/target/linux/ramips/dts/3G-6200NL.dts
@@ -6,15 +6,6 @@
compatible = "3G-6200NL", "ralink,rt3050-soc";
model = "Edimax 3g-6200nl";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -53,18 +44,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -86,8 +65,29 @@
linux,code = <0x211>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/3G150B.dts b/target/linux/ramips/dts/3G150B.dts
index 66f3e0d100..3d348ff0f3 100644
--- a/target/linux/ramips/dts/3G150B.dts
+++ b/target/linux/ramips/dts/3G150B.dts
@@ -6,78 +6,6 @@
compatible = "3G150B", "ralink,rt5350-soc";
model = "Tenda 3G150B";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
-
- gpio1: gpio@660 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf", "led";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- ralink,led-polarity = <1>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -116,3 +44,73 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf", "led";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+ ralink,led-polarity = <1>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/3G300M.dts b/target/linux/ramips/dts/3G300M.dts
index 87badf82a3..df770d83d5 100644
--- a/target/linux/ramips/dts/3G300M.dts
+++ b/target/linux/ramips/dts/3G300M.dts
@@ -6,53 +6,6 @@
compatible = "3G300M", "ralink,rt3052-soc";
model = "Tenda 3G300M";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -105,20 +58,65 @@
linux,code = <0x100>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
+&spi0 {
+ status = "okay";
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/A5-V11.dts b/target/linux/ramips/dts/A5-V11.dts
index 198acbaaa2..51eb005874 100644
--- a/target/linux/ramips/dts/A5-V11.dts
+++ b/target/linux/ramips/dts/A5-V11.dts
@@ -6,78 +6,6 @@
compatible = "A5-V11", "ralink,rt5350-soc";
model = "A5-V11";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "pm25lq032";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
-
- gpio1: gpio@660 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf", "led";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x1>;
- mediatek,portdisable = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -122,3 +50,73 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "pm25lq032";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf", "led";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x1>;
+ mediatek,portdisable = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/AI-BR100.dts b/target/linux/ramips/dts/AI-BR100.dts
index d53c8d2277..2c3293331a 100644
--- a/target/linux/ramips/dts/AI-BR100.dts
+++ b/target/linux/ramips/dts/AI-BR100.dts
@@ -6,80 +6,6 @@
compatible = "AI-BR100", "ralink,mt7620a-soc";
model = "Aigale Ai-BR100";
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x20000>;
- read-only;
- };
-
- partition@20000 {
- label = "u-boot-env";
- reg = <0x20000 0x10000>;
- read-only;
- };
-
- factory: partition@30000 {
- label = "factory";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- partition@40000 {
- label = "firmware";
- reg = <0x40000 0x7c0000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -107,3 +33,75 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0 0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x20000>;
+ read-only;
+ };
+
+ partition@20000 {
+ label = "u-boot-env";
+ reg = <0x20000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@30000 {
+ label = "factory";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "firmware";
+ reg = <0x40000 0x7c0000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/AIR3GII.dts b/target/linux/ramips/dts/AIR3GII.dts
index e89909ee2d..2b08895b49 100644
--- a/target/linux/ramips/dts/AIR3GII.dts
+++ b/target/linux/ramips/dts/AIR3GII.dts
@@ -6,69 +6,6 @@
compatible = "AIR3GII", "ralink,rt5350-soc";
model = "AirLive Air3GII";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q32b";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -96,3 +33,64 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q32b";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/ALL0239-3G.dts b/target/linux/ramips/dts/ALL0239-3G.dts
index 8a4ccc8ca5..d1d92e168c 100644
--- a/target/linux/ramips/dts/ALL0239-3G.dts
+++ b/target/linux/ramips/dts/ALL0239-3G.dts
@@ -6,14 +6,6 @@
compatible = "ALL0239-3G", "ralink,rt3052-soc";
model = "Allnet ALL0239-3G";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
cfi@1f000000 {
compatible = "cfi-flash";
@@ -47,19 +39,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- status = "okay";
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -108,8 +87,30 @@
linux,code = <0x211>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ status = "okay";
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/ALL0256N-4M.dts b/target/linux/ramips/dts/ALL0256N-4M.dts
index fe677a9d6d..1cfaed67bb 100644
--- a/target/linux/ramips/dts/ALL0256N-4M.dts
+++ b/target/linux/ramips/dts/ALL0256N-4M.dts
@@ -6,69 +6,6 @@
compatible = "ALL0256N", "ralink,rt3050-soc";
model = "Allnet ALL0256N";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3c8000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -101,3 +38,64 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3c8000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/ALL0256N-8M.dts b/target/linux/ramips/dts/ALL0256N-8M.dts
index 0d75abd725..074273d608 100644
--- a/target/linux/ramips/dts/ALL0256N-8M.dts
+++ b/target/linux/ramips/dts/ALL0256N-8M.dts
@@ -6,69 +6,6 @@
compatible = "ALL0256N", "ralink,rt3050-soc";
model = "Allnet ALL0256N";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -101,3 +38,64 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/ALL5002.dts b/target/linux/ramips/dts/ALL5002.dts
index 72aa789eca..14bbdcdf12 100644
--- a/target/linux/ramips/dts/ALL5002.dts
+++ b/target/linux/ramips/dts/ALL5002.dts
@@ -6,77 +6,6 @@
compatible = "ALL5002", "ralink,rt3352-soc";
model = "Allnet ALL5002";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l25635e";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x1fb0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
i2c-gpio {
compatible = "i2c-gpio";
gpios = <&gpio0 1 0 &gpio0 2 0>;
@@ -109,3 +38,72 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l25635e";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x1fb0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/ALL5003.dts b/target/linux/ramips/dts/ALL5003.dts
index 806eb26805..432dd516ff 100644
--- a/target/linux/ramips/dts/ALL5003.dts
+++ b/target/linux/ramips/dts/ALL5003.dts
@@ -6,77 +6,6 @@
compatible = "ALL5003", "ralink,rt5350-soc";
model = "Allnet ALL5003";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l25635e";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x1fb0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
i2c-gpio {
compatible = "i2c-gpio";
gpios = <&gpio0 1 0 &gpio0 2 0>;
@@ -109,3 +38,72 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l25635e";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x1fb0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/AR670W.dts b/target/linux/ramips/dts/AR670W.dts
index 5fefc81aff..c1eac43881 100644
--- a/target/linux/ramips/dts/AR670W.dts
+++ b/target/linux/ramips/dts/AR670W.dts
@@ -6,45 +6,6 @@
compatible = "AR670W", "ralink,rt2880-soc";
model = "Airlink101 AR670W";
- palmbus@300000 {
- gpio0: gpio@600 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi", "uartlite";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@400000 {
- status = "okay";
- mtd-mac-address = <&factory 0x2004>;
-
- port@0 {
- phy-handle = <&phy0>;
- phy-mode = "mii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy0: ethernet-phy@0 {
- phy-mode = "mii";
- reg = <0>;
- };
- };
- };
-
- wmac@480000 {
- status = "okay";
- ralink,mtd-eeprom = <&factory 0x2000>;
- };
-
cfi@bdc00000 {
compatible = "cfi-flash";
reg = <0xbc400000 0x800000>;
@@ -103,3 +64,40 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi", "uartlite";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x2004>;
+
+ port@0 {
+ phy-handle = <&phy0>;
+ phy-mode = "mii";
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy0: ethernet-phy@0 {
+ phy-mode = "mii";
+ reg = <0>;
+ };
+ };
+};
+
+&wmac {
+ status = "okay";
+ ralink,mtd-eeprom = <&factory 0x2000>;
+};
diff --git a/target/linux/ramips/dts/AR725W.dts b/target/linux/ramips/dts/AR725W.dts
index 3c5e0f573d..3b8cfb3be7 100644
--- a/target/linux/ramips/dts/AR725W.dts
+++ b/target/linux/ramips/dts/AR725W.dts
@@ -6,45 +6,6 @@
compatible = "AR725W", "ralink,rt2880-soc";
model = "Airlink101 AR725W";
- palmbus@300000 {
- gpio0: gpio@600 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi", "uartlite";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@400000 {
- status = "okay";
- mtd-mac-address = <&factory 0x4>;
-
- port@0 {
- phy-handle = <&phy0>;
- phy-mode = "mii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy0: ethernet-phy@0 {
- phy-mode = "mii";
- reg = <0>;
- };
- };
- };
-
- wmac@480000 {
- status = "okay";
- ralink,mtd-eeprom = <&factory 0>;
- };
-
cfi@bdc00000 {
compatible = "cfi-flash";
reg = <0xbc400000 0x800000>;
@@ -113,3 +74,40 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi", "uartlite";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x4>;
+
+ port@0 {
+ phy-handle = <&phy0>;
+ phy-mode = "mii";
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy0: ethernet-phy@0 {
+ phy-mode = "mii";
+ reg = <0>;
+ };
+ };
+};
+
+&wmac {
+ status = "okay";
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/ASL26555-16M.dts b/target/linux/ramips/dts/ASL26555-16M.dts
index 3c6c667b52..56f3c9d99c 100644
--- a/target/linux/ramips/dts/ASL26555-16M.dts
+++ b/target/linux/ramips/dts/ASL26555-16M.dts
@@ -6,91 +6,6 @@
compatible = "ASL26555", "ralink,rt3050-soc";
model = "Alpha ASL26555";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25sl12801";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "uboot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "uboot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xf80000>;
- };
-
- partition@fd0000 {
- label = "cert";
- reg = <0xfd0000 0x10000>;
- read-only;
- };
-
- partition@fe0000 {
- label = "langpack";
- reg = <0xfe0000 0x10000>;
- read-only;
- };
-
- devdata: partition@ff0000 {
- label = "devdata";
- reg = <0xff0000 0x10000>;
- read-only;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&devdata 0x4004>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x1e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&devdata 0x4000>;
- };
-
- otg@101c0000 {
- status = "okay";
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -154,3 +69,86 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25sl12801";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "uboot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "uboot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf80000>;
+ };
+
+ partition@fd0000 {
+ label = "cert";
+ reg = <0xfd0000 0x10000>;
+ read-only;
+ };
+
+ partition@fe0000 {
+ label = "langpack";
+ reg = <0xfe0000 0x10000>;
+ read-only;
+ };
+
+ devdata: partition@ff0000 {
+ label = "devdata";
+ reg = <0xff0000 0x10000>;
+ read-only;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&devdata 0x4004>;
+};
+
+&esw {
+ mediatek,portmap = <0x1e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&devdata 0x4000>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/ASL26555-8M.dts b/target/linux/ramips/dts/ASL26555-8M.dts
index 0860c5ed77..0dbc1dd337 100644
--- a/target/linux/ramips/dts/ASL26555-8M.dts
+++ b/target/linux/ramips/dts/ASL26555-8M.dts
@@ -6,85 +6,6 @@
compatible = "ASL26555", "ralink,rt3050-soc";
model = "Alpha ASL26555";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25sl064p";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "uboot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- ubootenv: partition@30000 {
- label = "uboot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- partition@40000 {
- label = "rgdb";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x790000>;
- };
-
- partition@7e0000 {
- label = "cert";
- reg = <0x7e0000 0x10000>;
- read-only;
- };
-
- partition@7f0000 {
- label = "langpack";
- reg = <0x7f0000 0x10000>;
- read-only;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&ubootenv 0x4004>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x1e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&ubootenv 0x4000>;
- };
-
- otg@101c0000 {
- status = "okay";
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -148,3 +69,80 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25sl064p";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "uboot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ ubootenv: partition@30000 {
+ label = "uboot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "rgdb";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x790000>;
+ };
+
+ partition@7e0000 {
+ label = "cert";
+ reg = <0x7e0000 0x10000>;
+ read-only;
+ };
+
+ partition@7f0000 {
+ label = "langpack";
+ reg = <0x7f0000 0x10000>;
+ read-only;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&ubootenv 0x4004>;
+};
+
+&esw {
+ mediatek,portmap = <0x1e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&ubootenv 0x4000>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/ATP-52B.dts b/target/linux/ramips/dts/ATP-52B.dts
index f0a53a11a9..c15d3a4645 100644
--- a/target/linux/ramips/dts/ATP-52B.dts
+++ b/target/linux/ramips/dts/ATP-52B.dts
@@ -6,15 +6,6 @@
compatible = "ATP-52B", "ralink,rt3052-soc";
model = "Argus ATP-52B";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -77,20 +68,30 @@
linux,code = <0x198>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- otg@101c0000 {
- status = "okay";
- };
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/AWAPN2403.dts b/target/linux/ramips/dts/AWAPN2403.dts
index 7a5f73392a..7babe42d56 100644
--- a/target/linux/ramips/dts/AWAPN2403.dts
+++ b/target/linux/ramips/dts/AWAPN2403.dts
@@ -6,61 +6,6 @@
compatible = "AWAPN2403", "ralink,rt3052-soc";
model = "AsiaRF AWAPN2403";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -83,3 +28,56 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/AWM002-4M.dtsi b/target/linux/ramips/dts/AWM002-4M.dtsi
index 4c9f57cf3d..69d25bb5d4 100644
--- a/target/linux/ramips/dts/AWM002-4M.dtsi
+++ b/target/linux/ramips/dts/AWM002-4M.dtsi
@@ -3,13 +3,9 @@
/ {
compatible = "AWM002", "ralink,rt5350-soc";
model = "AsiaRF AWM002";
+};
- palmbus@10000000 {
- spi@b00 {
- m25p80@0 {
- compatible = "jedec,spi-nor";
- linux,modalias = "m25p80", "mx25l3205d";
- };
- };
- };
+&m25p80 {
+ compatible = "jedec,spi-nor";
+ linux,modalias = "m25p80", "mx25l3205d";
};
diff --git a/target/linux/ramips/dts/AWM002-8M.dtsi b/target/linux/ramips/dts/AWM002-8M.dtsi
index 9fb35c105a..1e6970ddec 100644
--- a/target/linux/ramips/dts/AWM002-8M.dtsi
+++ b/target/linux/ramips/dts/AWM002-8M.dtsi
@@ -3,13 +3,9 @@
/ {
compatible = "AWM002", "ralink,rt5350-soc";
model = "AsiaRF AWM002";
+};
- palmbus@10000000 {
- spi@b00 {
- m25p80@0 {
- compatible = "jedec,spi-nor";
- linux,modalias = "m25p80", "mx25l6405d";
- };
- };
- };
+&m25p80 {
+ compatible = "jedec,spi-nor";
+ linux,modalias = "m25p80", "mx25l6405d";
};
diff --git a/target/linux/ramips/dts/AWM002-EVB-4M.dts b/target/linux/ramips/dts/AWM002-EVB-4M.dts
index ef2f83c778..e125232557 100644
--- a/target/linux/ramips/dts/AWM002-EVB-4M.dts
+++ b/target/linux/ramips/dts/AWM002-EVB-4M.dts
@@ -5,14 +5,6 @@
/ {
model = "AsiaRF AWM002 EVB";
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -51,3 +43,11 @@
};
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/AWM002-EVB-8M.dts b/target/linux/ramips/dts/AWM002-EVB-8M.dts
index 563090ec0e..f2f91bb3d9 100644
--- a/target/linux/ramips/dts/AWM002-EVB-8M.dts
+++ b/target/linux/ramips/dts/AWM002-EVB-8M.dts
@@ -5,14 +5,6 @@
/ {
model = "AsiaRF AWM002 EVB";
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -51,3 +43,11 @@
};
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/AWM002.dtsi b/target/linux/ramips/dts/AWM002.dtsi
index 3e57b724a1..9ff64917ea 100644
--- a/target/linux/ramips/dts/AWM002.dtsi
+++ b/target/linux/ramips/dts/AWM002.dtsi
@@ -4,75 +4,73 @@
compatible = "AWM002", "ralink,rt5350-soc";
model = "AsiaRF AWM002";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
+ gpio-leds {
+ compatible = "gpio-leds";
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- reg = <0 0>;
- compatible = "jedec,spi-nor";
- spi-max-frequency = <10000000>;
+ ld1 {
+ label = "awm002:green:ld1";
+ gpios = <&gpio0 0 1>;
+ };
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
+ ld2 {
+ label = "awm002:green:ld2";
+ gpios = <&gpio0 1 1>;
+ };
+ };
+};
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
+&spi0 {
+ status = "okay";
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
+ m25p80: m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0>;
+ compatible = "jedec,spi-nor";
+ spi-max-frequency = <10000000>;
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x1fb0000>;
- };
- };
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
};
- };
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag";
- ralink,function = "gpio";
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
};
- };
- esw@10110000 {
- mediatek,portmap = <0x3f>;
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- ehci@101c0000 {
- status = "okay";
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x1fb0000>;
+ };
};
+};
- ohci@101c1000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag";
+ ralink,function = "gpio";
+ };
};
+};
- gpio-leds {
- compatible = "gpio-leds";
+&esw {
+ mediatek,portmap = <0x3f>;
+};
- ld1 {
- label = "awm002:green:ld1";
- gpios = <&gpio0 0 1>;
- };
+&ehci {
+ status = "okay";
+};
- ld2 {
- label = "awm002:green:ld2";
- gpios = <&gpio0 1 1>;
- };
- };
+&ohci {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/AWM003-EVB.dts b/target/linux/ramips/dts/AWM003-EVB.dts
index 02fa97255c..13e6964ccc 100644
--- a/target/linux/ramips/dts/AWM003-EVB.dts
+++ b/target/linux/ramips/dts/AWM003-EVB.dts
@@ -11,23 +11,6 @@
reg = <0x0 0x4000000>;
};
- palmbus@10000000 {
- spi@b00 {
- m25p80@0 {
- compatible = "jedec,spi-nor";
- linux,modalias = "m25p80", "mx25l6405d";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -66,3 +49,16 @@
};
};
};
+
+&m25p80 {
+ compatible = "jedec,spi-nor";
+ linux,modalias = "m25p80", "mx25l6405d";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/ArcherC20i.dts b/target/linux/ramips/dts/ArcherC20i.dts
index 7d830b3182..e7a7b07346 100644
--- a/target/linux/ramips/dts/ArcherC20i.dts
+++ b/target/linux/ramips/dts/ArcherC20i.dts
@@ -10,109 +10,107 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
+ gpio-leds {
+ compatible = "gpio-leds";
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+ };
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x20000>;
+ read-only;
+ };
+
+ partition@20000 {
+ label = "firmware";
+ reg = <0x20000 0x7a0000>;
};
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x20000>;
- read-only;
- };
-
- partition@20000 {
- label = "firmware";
- reg = <0x20000 0x7a0000>;
- };
-
- partition@7c0000 {
- label = "config";
- reg = <0x7c0000 0x10000>;
- };
-
- rom: partition@7d0000 {
- label = "rom";
- reg = <0x7d0000 0x10000>;
- };
-
- partition@7e0000 {
- label = "romfile";
- reg = <0x7e0000 0x10000>;
- };
-
- radio: partition@7f0000 {
- label = "radio";
- reg = <0x7f0000 0x10000>;
- };
- };
+ partition@7c0000 {
+ label = "config";
+ reg = <0x7c0000 0x10000>;
+ };
+
+ rom: partition@7d0000 {
+ label = "rom";
+ reg = <0x7d0000 0x10000>;
+ };
+
+ partition@7e0000 {
+ label = "romfile";
+ reg = <0x7e0000 0x10000>;
+ };
+
+ radio: partition@7f0000 {
+ label = "radio";
+ reg = <0x7f0000 0x10000>;
};
};
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
- ralink,function = "gpio";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
+ ralink,function = "gpio";
};
};
+};
- ethernet@10100000 {
+&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&ephy_pins>;
mtd-mac-address = <&rom 0xf100>;
mediatek,portmap = "wllll";
};
- ehci@101c0000 {
- status = "okay";
- };
+&ehci {
+ status = "okay";
+};
- ohci@101c1000 {
- status = "okay";
- };
+&ohci {
+ status = "okay";
+};
- gsw@10110000 {
- mediatek,port4 = "ephy";
- };
+&gsw {
+ mediatek,port4 = "ephy";
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&radio 0>;
- };
+&wmac {
+ ralink,mtd-eeprom = <&radio 0>;
+};
- pcie@10140000 {
- status = "okay";
+&pcie {
+ status = "okay";
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&radio 32768>;
- mediatek,2ghz = <0>;
- };
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&radio 32768>;
+ mediatek,2ghz = <0>;
};
};
-
- gpio-leds {
- compatible = "gpio-leds";
- };
-
- gpio-keys-polled {
- compatible = "gpio-keys-polled";
- #address-cells = <1>;
- #size-cells = <0>;
- poll-interval = <20>;
- };
};
diff --git a/target/linux/ramips/dts/ArcherC50.dts b/target/linux/ramips/dts/ArcherC50.dts
new file mode 100644
index 0000000000..4fc8ff481d
--- /dev/null
+++ b/target/linux/ramips/dts/ArcherC50.dts
@@ -0,0 +1,156 @@
+/dts-v1/;
+
+#include "mt7620a.dtsi"
+
+/ {
+ compatible = "ralink,mt7620a-soc";
+ model = "TP-Link Archer C50";
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ lan {
+ label = "tp-link:blue:lan";
+ gpios = <&gpio0 1 1>;
+ };
+
+ power {
+ label = "tp-link:blue:power";
+ gpios = <&gpio0 7 0>;
+ };
+
+ usb {
+ label = "tp-link:blue:usb";
+ gpios = <&gpio0 9 1>;
+ };
+
+ wlan5g {
+ label = "tp-link:blue:wlan5g";
+ gpios = <&gpio0 11 1>;
+ };
+
+ wlan2g {
+ label = "tp-link:blue:wlan2g";
+ gpios = <&gpio3 0 1>;
+ };
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio0 13 1>;
+ linux,code = <0x198>;
+ };
+
+ rfkill {
+ label = "rfkill";
+ gpios = <&gpio0 2 1>;
+ linux,code = <0xf7>;
+ }; };
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x20000>;
+ read-only;
+ };
+
+ partition@20000 {
+ label = "firmware";
+ reg = <0x20000 0x7a0000>;
+ };
+
+ partition@7c0000 {
+ label = "config";
+ reg = <0x7c0000 0x10000>;
+ };
+
+ rom: partition@7d0000 {
+ label = "rom";
+ reg = <0x7d0000 0x10000>;
+ };
+
+ partition@7e0000 {
+ label = "romfile";
+ reg = <0x7e0000 0x10000>;
+ };
+
+ radio: partition@7f0000 {
+ label = "radio";
+ reg = <0x7f0000 0x10000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&rom 0xf100>;
+ mediatek,portmap = "wllll";
+ };
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&radio 0>;
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&radio 32768>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/BC2.dts b/target/linux/ramips/dts/BC2.dts
index 9161a55323..5ae10a31a0 100644
--- a/target/linux/ramips/dts/BC2.dts
+++ b/target/linux/ramips/dts/BC2.dts
@@ -6,15 +6,6 @@
compatible = "BC2", "ralink,rt3052-soc";
model = "NexAira BC2";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -68,20 +59,29 @@
linux,code = <0x198>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
- otg@101c0000 {
- status = "okay";
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/BR-6425.dts b/target/linux/ramips/dts/BR-6425.dts
index ec66667f88..b871ead992 100644
--- a/target/linux/ramips/dts/BR-6425.dts
+++ b/target/linux/ramips/dts/BR-6425.dts
@@ -6,15 +6,6 @@
compatible = "BR-6425", "ralink,rt3052-soc";
model = "Edimax BR-6425";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -24,18 +15,6 @@
#size-cells = <1>;
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -69,3 +48,24 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+/* mtd-mac-address = <&factory 0x4>; */
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+/* ralink,mtd-eeprom = <&factory 0>; */
+};
diff --git a/target/linux/ramips/dts/BR-6475ND.dts b/target/linux/ramips/dts/BR-6475ND.dts
index 6211e4319e..f437ac165c 100644
--- a/target/linux/ramips/dts/BR-6475ND.dts
+++ b/target/linux/ramips/dts/BR-6475ND.dts
@@ -6,77 +6,45 @@
compatible = "BR-6475ND", "ralink,rt3883-soc";
model = "Edimax BR-6475nD";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- palmbus@10000000 {
- timer@100 {
- status = "okay";
- };
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <100>;
- gpio1: gpio@638 {
- status = "okay";
+ reset {
+ label = "reset";
+ gpios = <&gpio0 7 1>;
+ linux,code = <0x198>;
};
- uartlite@c00 {
- status = "okay";
+ rfkill {
+ label = "rfkill";
+ gpios = <&gpio0 9 1>;
+ linux,input-type = <5>;
+ linux,code = <0xf7>;
};
};
- ethernet@10100000 {
- status = "okay";
- mtd-mac-address = <&devdata 0x0d>;
+ gpio-leds {
+ compatible = "gpio-leds";
- port@0 {
- mediatek,fixed-link = <1000 1 1 1>;
+ power {
+ label = "br-6475nd:green:power";
+ gpios = <&gpio0 10 1>;
};
- };
- wmac@10180000 {
- status = "okay";
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pci@10140000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&pci_pins>;
-
- pci_pins: pci {
- pci {
- ralink,group = "pci";
- ralink,function = "pci-fnc";
- };
+ wlan {
+ label = "br-6475nd:amber:wlan";
+ gpios = <&gpio0 11 1>;
};
- host-bridge {
- pci-bridge@1 {
- status = "okay";
-
- wmac@0,0 {
- ralink,5ghz = <0>;
- compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
- reg = < 0x10000 0 0 0 0 >;
- ralink,eeprom = "rt2x00pci_1_0.eeprom";
- };
- };
+ wlan_5ghz {
+ label = "br-6475nd:amber:wlan_5ghz";
+ gpios = <&gpio0 14 1>;
};
};
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
nor-flash@1c000000 {
compatible = "cfi-flash";
reg = <0x1c000000 0x800000>;
@@ -126,58 +94,88 @@
realtek,extif0 = <1 0 1 1 1 1 1 1 2>;
};
- gpio-keys-polled {
- compatible = "gpio-keys-polled";
- #address-cells = <1>;
+ /* Unclear if this is the correct gpio setup; the USB ports are
+ unpopulated on a stock BR-6475nD, even though the hardware exists
+ and the headers are there. */
+ /*
+ gpio_export {
+ compatible = "gpio-export";
#size-cells = <0>;
- poll-interval = <100>;
- reset {
- label = "reset";
- gpios = <&gpio0 7 1>;
- linux,code = <0x198>;
+ usb {
+ gpio-export,name="usb";
+ gpio-export,output=<0>;
+ gpios = <&gpio0 19 0>;
};
+ };
+ */
+};
- rfkill {
- label = "rfkill";
- gpios = <&gpio0 9 1>;
- linux,input-type = <5>;
- linux,code = <0xf7>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "jtag", "uartf";
+ ralink,function = "gpio";
};
};
+};
- gpio-leds {
- compatible = "gpio-leds";
+&timer {
+ status = "okay";
+};
- power {
- label = "br-6475nd:green:power";
- gpios = <&gpio0 10 1>;
- };
+&gpio1 {
+ status = "okay";
+};
- wlan {
- label = "br-6475nd:amber:wlan";
- gpios = <&gpio0 11 1>;
- };
+&uartlite {
+ status = "okay";
+};
- wlan_5ghz {
- label = "br-6475nd:amber:wlan_5ghz";
- gpios = <&gpio0 14 1>;
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&devdata 0x0d>;
+
+ port@0 {
+ mediatek,fixed-link = <1000 1 1 1>;
+ };
+};
+
+&wmac {
+ status = "okay";
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pci {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pci_pins>;
+
+ pci_pins: pci {
+ pci {
+ ralink,group = "pci";
+ ralink,function = "pci-fnc";
};
};
- /* Unclear if this is the correct gpio setup; the USB ports are
- unpopulated on a stock BR-6475nD, even though the hardware exists
- and the headers are there. */
- /*
- gpio_export {
- compatible = "gpio-export";
- #size-cells = <0>;
+ host-bridge {
+ pci-bridge@1 {
+ status = "okay";
- usb {
- gpio-export,name="usb";
- gpio-export,output=<0>;
- gpios = <&gpio0 19 0>;
+ wmac@0,0 {
+ ralink,5ghz = <0>;
+ compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
+ reg = < 0x10000 0 0 0 0 >;
+ ralink,eeprom = "rt2x00pci_1_0.eeprom";
+ };
};
};
- */
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/BROADWAY.dts b/target/linux/ramips/dts/BROADWAY.dts
index 40cb985e25..790dcc0467 100644
--- a/target/linux/ramips/dts/BROADWAY.dts
+++ b/target/linux/ramips/dts/BROADWAY.dts
@@ -6,15 +6,6 @@
compatible = "BROADWAY", "ralink,rt3052-soc";
model = "Hauppauge Broadway";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -85,8 +64,29 @@
linux,code = <0x198>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/CARAMBOLA.dts b/target/linux/ramips/dts/CARAMBOLA.dts
index 5ff60c3af6..e38c49f957 100644
--- a/target/linux/ramips/dts/CARAMBOLA.dts
+++ b/target/linux/ramips/dts/CARAMBOLA.dts
@@ -10,15 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -51,25 +42,34 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
+ i2c-gpio {
+ compatible = "i2c-gpio";
+ gpios = <&gpio0 1 0 &gpio0 2 0>;
+ i2c-gpio,delay-us = <10>;
};
+};
- esw@10110000 {
- mediatek,portmap = <0x3f>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
- otg@101c0000 {
- status = "okay";
- };
+&esw {
+ mediatek,portmap = <0x3f>;
+};
- i2c-gpio {
- compatible = "i2c-gpio";
- gpios = <&gpio0 1 0 &gpio0 2 0>;
- i2c-gpio,delay-us = <10>;
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/CF-WR800N.dts b/target/linux/ramips/dts/CF-WR800N.dts
index 9d9e0df056..913f142f35 100644
--- a/target/linux/ramips/dts/CF-WR800N.dts
+++ b/target/linux/ramips/dts/CF-WR800N.dts
@@ -10,77 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "ephy", "wled", "spi refclk", "i2c";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -113,3 +42,72 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "ephy", "wled", "spi refclk", "i2c";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/CS-QR10.dts b/target/linux/ramips/dts/CS-QR10.dts
index ddd480ff85..c3cb711a05 100644
--- a/target/linux/ramips/dts/CS-QR10.dts
+++ b/target/linux/ramips/dts/CS-QR10.dts
@@ -6,131 +6,15 @@
compatible = "ralink,mt7620a-soc";
model = "Planex CS-QR10";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- i2c@900 {
- status = "okay";
- };
-
- i2s: i2s@a00 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&pcm_i2s_pins>;
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
-
- pcm@2000 {
- status = "okay";
- };
-
- gdma@2800 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi refclk", "rgmii1";
- ralink,function = "gpio";
- };
- wdt {
- ralink,group = "wdt";
- ralink,function = "wdt refclk";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- gsw@10110000 {
- ralink,port4 = "ephy";
- };
-
- sdhci@10130000 {
- status = "okay";
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
sound {
compatible = "mediatek,mt7620-audio-wm8960";
model = "mt7620-wm8960";
i2s-controller = <&i2s>;
audio-routing =
- "Ext Spk", "SPK_LP",
- "Ext Spk", "SPK_LN",
- "Ext Spk", "SPK_RP",
- "Ext Spk", "SPK_RN";
+ "Ext Spk", "SPK_LP",
+ "Ext Spk", "SPK_LN",
+ "Ext Spk", "SPK_RP",
+ "Ext Spk", "SPK_RN";
};
gpio-leds {
@@ -161,3 +45,117 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&i2c {
+ status = "okay";
+};
+
+&i2s {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pcm_i2s_pins>;
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pcm {
+ status = "okay";
+};
+
+&gdma {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi refclk", "rgmii1";
+ ralink,function = "gpio";
+ };
+ wdt {
+ ralink,group = "wdt";
+ ralink,function = "wdt refclk";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&gsw {
+ ralink,port4 = "ephy";
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/CY-SWR1100.dts b/target/linux/ramips/dts/CY-SWR1100.dts
index 2120dc7dcd..031d8f0052 100644
--- a/target/linux/ramips/dts/CY-SWR1100.dts
+++ b/target/linux/ramips/dts/CY-SWR1100.dts
@@ -6,68 +6,6 @@
compatible = "CY-SWR1100", "ralink,rt3883-soc";
model = "Samsung CY-SWR1100";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- port@0 {
- mediatek,fixed-link = <1000 1 1 1>;
- phy-mode = "rgmii";
- };
- };
-
- pci@10140000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&pci_pins>;
-
- pci_pins: pci {
- pci {
- ralink,group = "pci";
- ralink,function = "pci-fnc";
- };
- };
-
- host-bridge {
- pci-bridge@1 {
- status = "okay";
-
- wmac@0,0 {
- ralink,5ghz = <0>;
- compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
- reg = < 0x10000 0 0 0 0 >;
- ralink,eeprom = "rt2x00pci_1_0.eeprom";
- };
- };
- };
- };
-
- wmac@10180000 {
- status = "okay";
- ralink,2ghz = <0>;
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
nor-flash@1c000000 {
compatible = "cfi-flash";
reg = <0x1c000000 0x800000>;
@@ -150,3 +88,63 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ port@0 {
+ mediatek,fixed-link = <1000 1 1 1>;
+ phy-mode = "rgmii";
+ };
+};
+
+&pci {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pci_pins>;
+
+ pci_pins: pci {
+ pci {
+ ralink,group = "pci";
+ ralink,function = "pci-fnc";
+ };
+ };
+
+ host-bridge {
+ pci-bridge@1 {
+ status = "okay";
+
+ wmac@0,0 {
+ ralink,5ghz = <0>;
+ compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
+ reg = < 0x10000 0 0 0 0 >;
+ ralink,eeprom = "rt2x00pci_1_0.eeprom";
+ };
+ };
+ };
+};
+
+&wmac {
+ status = "okay";
+ ralink,2ghz = <0>;
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/D105.dts b/target/linux/ramips/dts/D105.dts
index cf631ea7ba..2e86d1edac 100644
--- a/target/linux/ramips/dts/D105.dts
+++ b/target/linux/ramips/dts/D105.dts
@@ -6,15 +6,6 @@
compatible = "D105", "ralink,rt3050-soc";
model = "Huawei D105";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -73,20 +64,29 @@
linux,code = <0x198>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
- otg@101c0000 {
- status = "okay";
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/DAP-1350.dts b/target/linux/ramips/dts/DAP-1350.dts
index e983372dab..4628544fb6 100644
--- a/target/linux/ramips/dts/DAP-1350.dts
+++ b/target/linux/ramips/dts/DAP-1350.dts
@@ -10,15 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -57,18 +48,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&devdata 0x2e>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&devdata 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -118,8 +97,29 @@
linux,code = <0x101>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&devdata 0x2e>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&devdata 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/DB-WRT01.dts b/target/linux/ramips/dts/DB-WRT01.dts
index 14c48e215c..4560dc5ca8 100644
--- a/target/linux/ramips/dts/DB-WRT01.dts
+++ b/target/linux/ramips/dts/DB-WRT01.dts
@@ -6,76 +6,6 @@
compatible = "ralink,mt7620a-soc";
model = "Planex DB-WRT01";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi refclk", "rgmii1";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- gsw@10110000 {
- mediatek,port4 = "ephy";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -98,3 +28,71 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi refclk", "rgmii1";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/DCS-930.dts b/target/linux/ramips/dts/DCS-930.dts
index 98779f0647..373973c3df 100644
--- a/target/linux/ramips/dts/DCS-930.dts
+++ b/target/linux/ramips/dts/DCS-930.dts
@@ -6,15 +6,6 @@
compatible = "DCS-930", "ralink,rt3050-soc";
model = "D-Link DCS-930";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x400000>;
@@ -94,20 +85,29 @@
linux,code = <0x198>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
- otg@101c0000 {
- status = "okay";
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/DCS-930L-B1.dts b/target/linux/ramips/dts/DCS-930L-B1.dts
index ad715c1313..133245cb74 100644
--- a/target/linux/ramips/dts/DCS-930L-B1.dts
+++ b/target/linux/ramips/dts/DCS-930L-B1.dts
@@ -6,73 +6,6 @@
compatible = "DCS-930L-B1", "ralink,rt5350-soc";
model = "D-Link DCS-930L B1";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf", "led";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -106,3 +39,68 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf", "led";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/DIR-300-B1.dts b/target/linux/ramips/dts/DIR-300-B1.dts
index 8772ed4576..4f0a7ffde7 100644
--- a/target/linux/ramips/dts/DIR-300-B1.dts
+++ b/target/linux/ramips/dts/DIR-300-B1.dts
@@ -6,15 +6,6 @@
compatible = "DIR-300-B1", "ralink,rt3050-soc";
model = "D-Link DIR-300 B1";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&devdata 0x4004>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&devdata 0x4000>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -107,3 +86,24 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&devdata 0x4004>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&devdata 0x4000>;
+};
diff --git a/target/linux/ramips/dts/DIR-300-B7.dts b/target/linux/ramips/dts/DIR-300-B7.dts
index ff6378a7cd..9b9a6a4592 100644
--- a/target/linux/ramips/dts/DIR-300-B7.dts
+++ b/target/linux/ramips/dts/DIR-300-B7.dts
@@ -6,62 +6,6 @@
compatible = "DIR-300-B7", "ralink,rt5350-soc";
model = "D-Link DIR-300 B7";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <0x17>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -94,10 +38,64 @@
linux,code = <0x211>;
};
};
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
- wmac@10180000 {
- status = "okay";
- ralink,led-polarity = <1>;
- ralink,mtd-eeprom = <&factory 0>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <0x17>;
+};
+
+&wmac {
+ status = "okay";
+ ralink,led-polarity = <1>;
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/DIR-320-B1.dts b/target/linux/ramips/dts/DIR-320-B1.dts
index 5d29d14959..102e06abf9 100644
--- a/target/linux/ramips/dts/DIR-320-B1.dts
+++ b/target/linux/ramips/dts/DIR-320-B1.dts
@@ -6,66 +6,6 @@
compatible = "DIR-320-B1", "ralink,rt5350-soc";
model = "D-Link DIR-320 B1";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <0x17>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -104,14 +44,6 @@
};
};
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c0000 {
- status = "okay";
- };
-
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
@@ -129,3 +61,69 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <0x17>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/DIR-600-B1.dts b/target/linux/ramips/dts/DIR-600-B1.dts
index 9d65bb1a6d..d45d3c5ccd 100644
--- a/target/linux/ramips/dts/DIR-600-B1.dts
+++ b/target/linux/ramips/dts/DIR-600-B1.dts
@@ -6,15 +6,6 @@
compatible = "DIR-600-B1", "ralink,rt3050-soc";
model = "D-Link DIR-600 B1";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&devdata 0x4004>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&devdata 0x4000>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -107,3 +86,24 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&devdata 0x4004>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&devdata 0x4000>;
+};
diff --git a/target/linux/ramips/dts/DIR-600-B2.dts b/target/linux/ramips/dts/DIR-600-B2.dts
index 4215e5b2ef..f0269cfa2e 100644
--- a/target/linux/ramips/dts/DIR-600-B2.dts
+++ b/target/linux/ramips/dts/DIR-600-B2.dts
@@ -6,15 +6,6 @@
compatible = "DIR-600-B2", "ralink,rt3050-soc";
model = "D-Link DIR-600 B2";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,14 +38,6 @@
};
};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&devdata 0x4000>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -103,3 +86,20 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&devdata 0x4000>;
+};
diff --git a/target/linux/ramips/dts/DIR-610-A1.dts b/target/linux/ramips/dts/DIR-610-A1.dts
index a0f41d3b82..9ec66b4b00 100644
--- a/target/linux/ramips/dts/DIR-610-A1.dts
+++ b/target/linux/ramips/dts/DIR-610-A1.dts
@@ -6,69 +6,6 @@
compatible = "DIR-610-A1", "ralink,rt5350-soc";
model = "D-Link DIR-610 A1";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- devdata: partition@30000 {
- label = "devdata";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&devdata 0x4004>;
- };
-
- esw@10110000 {
- status = "okay";
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <0x17>;
- };
-
- wmac@10180000 {
- status = "okay";
- ralink,led-polarity = <1>;
- ralink,mtd-eeprom = <&devdata 0x4000>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -102,3 +39,64 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ devdata: partition@30000 {
+ label = "devdata";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&devdata 0x4004>;
+};
+
+&esw {
+ status = "okay";
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <0x17>;
+};
+
+&wmac {
+ status = "okay";
+ ralink,led-polarity = <1>;
+ ralink,mtd-eeprom = <&devdata 0x4000>;
+};
diff --git a/target/linux/ramips/dts/DIR-615-D.dts b/target/linux/ramips/dts/DIR-615-D.dts
index 531f317def..cac9d2602c 100644
--- a/target/linux/ramips/dts/DIR-615-D.dts
+++ b/target/linux/ramips/dts/DIR-615-D.dts
@@ -6,15 +6,6 @@
compatible = "DIR-615-D", "ralink,rt3050-soc";
model = "D-Link DIR-615 D";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,14 +38,6 @@
};
};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&devdata 0x4000>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -103,3 +86,22 @@
};
};
};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&devdata 0x4000>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+
diff --git a/target/linux/ramips/dts/DIR-615-H1.dts b/target/linux/ramips/dts/DIR-615-H1.dts
index 6f3d94f0c9..d53c82609f 100644
--- a/target/linux/ramips/dts/DIR-615-H1.dts
+++ b/target/linux/ramips/dts/DIR-615-H1.dts
@@ -6,75 +6,6 @@
compatible = "DIR-615-H1", "ralink,rt3352-soc";
model = "D-Link DIR-615 H1";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
-
- rgmii {
- ralink,group = "rgmii";
- ralink,function = "rgmii";
- };
-
- mdio {
- ralink,group = "mdio";
- ralink,function = "mdio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -123,3 +54,70 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+
+ rgmii {
+ ralink,group = "rgmii";
+ ralink,function = "rgmii";
+ };
+
+ mdio {
+ ralink,group = "mdio";
+ ralink,function = "mdio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/DIR-620-A1.dts b/target/linux/ramips/dts/DIR-620-A1.dts
index df38f02c44..68a23465a6 100644
--- a/target/linux/ramips/dts/DIR-620-A1.dts
+++ b/target/linux/ramips/dts/DIR-620-A1.dts
@@ -6,15 +6,6 @@
compatible = "DIR-620-A1", "ralink,rt3050-soc";
model = "D-Link DIR-620 A1";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -111,8 +90,29 @@
gpios = <&gpio0 11 0>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/DIR-620-D1.dts b/target/linux/ramips/dts/DIR-620-D1.dts
index 783870180b..5cf330e66b 100644
--- a/target/linux/ramips/dts/DIR-620-D1.dts
+++ b/target/linux/ramips/dts/DIR-620-D1.dts
@@ -6,75 +6,6 @@
compatible = "DIR-620-D1", "ralink,rt3352-soc";
model = "D-Link DIR-620 D1";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
-
- rgmii {
- ralink,group = "rgmii";
- ralink,function = "rgmii";
- };
-
- mdio {
- ralink,group = "mdio";
- ralink,function = "mdio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -101,12 +32,79 @@
linux,code = <0x198>;
};
};
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
- ehci@101c0000 {
- status = "okay";
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
};
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+
+ rgmii {
+ ralink,group = "rgmii";
+ ralink,function = "rgmii";
+ };
- ohci@101c1000 {
- status = "okay";
+ mdio {
+ ralink,group = "mdio";
+ ralink,function = "mdio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/DIR-645.dts b/target/linux/ramips/dts/DIR-645.dts
index 9843b1fee5..d508297ac1 100644
--- a/target/linux/ramips/dts/DIR-645.dts
+++ b/target/linux/ramips/dts/DIR-645.dts
@@ -6,89 +6,6 @@
compatible = "DIR-645", "ralink,rt3883-soc";
model = "D-Link DIR-645";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <25000000>;
-
- partition@0 {
- label = "uboot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "uboot-env";
- reg = <0x30000 0x4000>;
- read-only;
- };
-
- factory: partition@34000 {
- label = "factory";
- reg = <0x34000 0x4000>;
- read-only;
- };
-
- partition@38000 {
- label = "nvram";
- reg = <0x38000 0x8000>;
- read-only;
- };
-
- partition@40000 {
- label = "devdata";
- reg = <0x40000 0x10000>;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
-
- port@0 {
- mediatek,fixed-link = <1000 1 1 0>;
- };
- };
-
- wmac@10180000 {
- ralink,5ghz = <0>;
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
rtl8367b {
compatible = "realtek,rtl8367b";
gpio-sda = <&gpio0 1 0>;
@@ -140,3 +57,84 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <25000000>;
+
+ partition@0 {
+ label = "uboot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "uboot-env";
+ reg = <0x30000 0x4000>;
+ read-only;
+ };
+
+ factory: partition@34000 {
+ label = "factory";
+ reg = <0x34000 0x4000>;
+ read-only;
+ };
+
+ partition@38000 {
+ label = "nvram";
+ reg = <0x38000 0x8000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "devdata";
+ reg = <0x40000 0x10000>;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+
+ port@0 {
+ mediatek,fixed-link = <1000 1 1 0>;
+ };
+};
+
+&wmac {
+ ralink,5ghz = <0>;
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/DIR-810L.dts b/target/linux/ramips/dts/DIR-810L.dts
index cebef080c1..1f9ad8a5d2 100644
--- a/target/linux/ramips/dts/DIR-810L.dts
+++ b/target/linux/ramips/dts/DIR-810L.dts
@@ -6,96 +6,6 @@
compatible = "dlink,dir-810l", "ralink,mt7620a-soc";
model = "D-Link DIR-810L";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- factory5g: partition@50000 {
- label = "factory5g";
- reg = <0x50000 0x10000>;
- read-only;
- };
-
- partition@60000 {
- label = "Wolf_Config";
- reg = <0x60000 0x10000>;
- read-only;
- };
-
- partition@70000 {
- label = "MyDlink";
- reg = <0x70000 0x80000>;
- read-only;
- };
-
- partition@e0000 {
- label = "Jffs2";
- reg = <0xe0000 0x80000>;
- read-only;
- };
-
- partition@170000 {
- label = "firmware";
- reg = <0x170000 0x690000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "mdio", "rgmii1", "i2c", "wled", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- mediatek,portmap = "llllw";
- };
-
- gsw@10110000 {
- mediatek,port4 = "ephy";
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -134,3 +44,91 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ factory5g: partition@50000 {
+ label = "factory5g";
+ reg = <0x50000 0x10000>;
+ read-only;
+ };
+
+ partition@60000 {
+ label = "Wolf_Config";
+ reg = <0x60000 0x10000>;
+ read-only;
+ };
+
+ partition@70000 {
+ label = "MyDlink";
+ reg = <0x70000 0x80000>;
+ read-only;
+ };
+
+ partition@e0000 {
+ label = "Jffs2";
+ reg = <0xe0000 0x80000>;
+ read-only;
+ };
+
+ partition@170000 {
+ label = "firmware";
+ reg = <0x170000 0x690000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "mdio", "rgmii1", "i2c", "wled", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+ mediatek,portmap = "llllw";
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+};
+
+&pcie {
+ status = "okay";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/DIR-860L-B1.dts b/target/linux/ramips/dts/DIR-860L-B1.dts
index a6add705ba..b6336d87d3 100644
--- a/target/linux/ramips/dts/DIR-860L-B1.dts
+++ b/target/linux/ramips/dts/DIR-860L-B1.dts
@@ -15,87 +15,6 @@
bootargs = "console=ttyS0,57600";
};
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x4000>;
- read-only;
- };
-
- radio: partition@34000 {
- label = "radio";
- reg = <0x34000 0x4000>;
- read-only;
- };
-
- factory: partition@38000 {
- label = "factory";
- reg = <0x38000 0x8000>;
- read-only;
- };
-
- partition@40000 {
- label = "defaults";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
- };
-
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&radio 0x2000>;
- mediatek,2ghz = <0>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&radio 0>;
- mediatek,5ghz = <0>;
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -127,3 +46,82 @@
poll-interval = <20>;
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x4000>;
+ read-only;
+ };
+
+ radio: partition@34000 {
+ label = "radio";
+ reg = <0x34000 0x4000>;
+ read-only;
+ };
+
+ factory: partition@38000 {
+ label = "factory";
+ reg = <0x38000 0x8000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "defaults";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&radio 0x2000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&radio 0>;
+ mediatek,5ghz = <0>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/DUZUN-DM06.dts b/target/linux/ramips/dts/DUZUN-DM06.dts
new file mode 100644
index 0000000000..946a421c3a
--- /dev/null
+++ b/target/linux/ramips/dts/DUZUN-DM06.dts
@@ -0,0 +1,155 @@
+/dts-v1/;
+
+/include/ "mt7628an.dtsi"
+
+/ {
+ compatible = "duzun,dm06-mt7628an", "mediatek,mt7628an-soc";
+ model = "DuZun DM06";
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x4000000>;
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <100>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio1 14 1>;
+ linux,code = <0x198>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&gpio1 6 1>;
+ linux,code = <0x211>;
+ };
+ };
+
+ sound {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "Audio-I2S";
+ simple-audio-card,format = "i2s";
+ simple-audio-card,bitclock-master = <&dailink0_master>;
+ simple-audio-card,frame-master = <&dailink0_master>;
+ simple-audio-card,widgets =
+ "Headphone", "Headphones";
+ simple-audio-card,routing =
+ "Headphones", "HP_L",
+ "Headphones", "HP_R";
+ simple-audio-card,mclk-fs = <256>;
+
+ simple-audio-card,cpu {
+ sound-dai = <&i2s>;
+ };
+
+ dailink0_master: simple-audio-card,codec {
+ sound-dai = <&codec>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wdt", "uart1";
+ ralink,function = "gpio";
+ };
+ };
+
+ i2s_pins: i2s {
+ i2s {
+ ralink,group = "i2s";
+ ralink,function = "i2s";
+ };
+ };
+
+ wm8960_mclk_pins: wm8960_mclk {
+ wm8960_mclk {
+ ralink,group = "refclk";
+ ralink,function = "reclk";
+ };
+ };
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&i2c {
+ status = "okay";
+
+ codec: wm8960@1a {
+ #sound-dai-cells = <0>;
+ compatible = "wlf,wm8960";
+ reg = <0x1a>;
+
+ wlf,shared-lrclk;
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x3>;
+ mediatek,portdisable = <0x3c>;
+};
+
+&i2s {
+ #sound-dai-cells = <0>;
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2s_pins>, <&wm8960_mclk_pins>;
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&gdma {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <60000000>;
+ m25p,chunked-io = <32>;
+ m25p,fast-read;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/E1700.dts b/target/linux/ramips/dts/E1700.dts
index fafe25d0a7..36126ab42b 100644
--- a/target/linux/ramips/dts/E1700.dts
+++ b/target/linux/ramips/dts/E1700.dts
@@ -16,109 +16,6 @@
compatible = "linksys,e1700", "ralink,mt7620a-soc";
model = "Linksys E1700";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "config";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- status = "okay";
- mtd-mac-address = <&factory 0x28>;
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
-
- port@5 {
- status = "okay";
- mediatek,fixed-link = <1000 1 1 1>;
- phy-mode = "rgmii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy0: ethernet-phy@0 {
- reg = <0>;
- phy-mode = "rgmii";
- };
-
- phy1: ethernet-phy@1 {
- reg = <1>;
- phy-mode = "rgmii";
- };
-
- phy2: ethernet-phy@2 {
- reg = <2>;
- phy-mode = "rgmii";
- };
-
- phy3: ethernet-phy@3 {
- reg = <3>;
- phy-mode = "rgmii";
- };
-
- phy4: ethernet-phy@4 {
- reg = <4>;
- phy-mode = "rgmii";
- };
-
- phy1f: ethernet-phy@1f {
- reg = <0x1f>;
- phy-mode = "rgmii";
- };
- };
- };
-
- gsw@10110000 {
- mediatek,port4 = "gmac";
- mediatek,mt7530 = <1>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -152,3 +49,104 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "config";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x28>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+
+ port@5 {
+ status = "okay";
+ mediatek,fixed-link = <1000 1 1 1>;
+ phy-mode = "rgmii";
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ phy-mode = "rgmii";
+ };
+
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ phy-mode = "rgmii";
+ };
+
+ phy2: ethernet-phy@2 {
+ reg = <2>;
+ phy-mode = "rgmii";
+ };
+
+ phy3: ethernet-phy@3 {
+ reg = <3>;
+ phy-mode = "rgmii";
+ };
+
+ phy4: ethernet-phy@4 {
+ reg = <4>;
+ phy-mode = "rgmii";
+ };
+
+ phy1f: ethernet-phy@1f {
+ reg = <0x1f>;
+ phy-mode = "rgmii";
+ };
+ };
+};
+
+&gsw {
+ mediatek,port4 = "gmac";
+ mediatek,mt7530 = <1>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/ESR-9753.dts b/target/linux/ramips/dts/ESR-9753.dts
index 2e9999280f..6869166787 100644
--- a/target/linux/ramips/dts/ESR-9753.dts
+++ b/target/linux/ramips/dts/ESR-9753.dts
@@ -6,15 +6,6 @@
compatible = "ESR-9753", "ralink,rt3052-soc";
model = "Senao / EnGenius ESR-9753";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -79,16 +70,25 @@
linux,code = <0x211>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
};
diff --git a/target/linux/ramips/dts/EX2700.dts b/target/linux/ramips/dts/EX2700.dts
index 099700c364..c711adc6b4 100644
--- a/target/linux/ramips/dts/EX2700.dts
+++ b/target/linux/ramips/dts/EX2700.dts
@@ -20,73 +20,6 @@
bootargs = "console=ttyS0,57600";
};
- palmbus@10000000 {
-
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- partition@40000 {
- label = "firmware";
- reg = <0x40000 0x3b0000>;
- };
-
- art: partition@3f0000 {
- label = "art";
- reg = <0x3f0000 0x10000>;
- read-only;
- };
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&art 0x0>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&art 0x1000>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- // spi refclk: pins 37, 38, 39
- // uartf: pins 8, 9, 10, 11, 12, 13, 14
- // i2c: pins 1, 2
- ralink,group = "i2c", "uartf", "spi refclk";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -146,3 +79,67 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "firmware";
+ reg = <0x40000 0x3b0000>;
+ };
+
+ art: partition@3f0000 {
+ label = "art";
+ reg = <0x3f0000 0x10000>;
+ read-only;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&art 0x0>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&art 0x1000>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ // spi refclk: pins 37, 38, 39
+ // uartf: pins 8, 9, 10, 11, 12, 13, 14
+ // i2c: pins 1, 2
+ ralink,group = "i2c", "uartf", "spi refclk";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/F5D8235_V1.dts b/target/linux/ramips/dts/F5D8235_V1.dts
index 85e64f11d0..dacdea6ca4 100644
--- a/target/linux/ramips/dts/F5D8235_V1.dts
+++ b/target/linux/ramips/dts/F5D8235_V1.dts
@@ -8,21 +8,6 @@
compatible = "F5D8235_V1", "ralink,rt2880-soc";
model = "Belkin F5D8235 v1";
- palmbus@300000 {
- gpio0: gpio@600 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -55,21 +40,6 @@
};
};
- ethernet@400000 {
- status = "okay";
- mtd-mac-address = <&factory 0x4>;
-
- port@0 {
- mediatek,fixed-link = <1000 1 1 1>;
- };
- };
-
- /* FIXME: no u-boot partition and 0x40000@uboot is out of boundaries */
-/* wmac@480000 {
- status = "okay";
- ralink,mtd-eeprom = <&u-boot 0x40000>;
- };
-*/
rtl8366s {
compatible = "realtek,rtl8366s";
gpio-sda = <&gpio0 1 0>;
@@ -109,3 +79,33 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x4>;
+
+ port@0 {
+ mediatek,fixed-link = <1000 1 1 1>;
+ };
+};
+
+/* FIXME: no u-boot partition and 0x40000@uboot is out of boundaries */
+/*&wmac {
+ status = "okay";
+ ralink,mtd-eeprom = <&u-boot 0x40000>;
+};
+*/
+
diff --git a/target/linux/ramips/dts/F5D8235_V2.dts b/target/linux/ramips/dts/F5D8235_V2.dts
index d1e2143b40..084ca0f25a 100644
--- a/target/linux/ramips/dts/F5D8235_V2.dts
+++ b/target/linux/ramips/dts/F5D8235_V2.dts
@@ -6,15 +6,6 @@
compatible = "F5D8235_V2", "ralink,rt3052-soc";
model = "Belkin F5D8235 v2";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -45,22 +36,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&uboot 0x40004>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&uboot 0x40000>;
- };
-
- otg@101c0000 {
- status = "okay";
- };
-
rtl8366rb {
compatible = "rtl8366rb";
gpio-sda = <&gpio0 1 0>;
@@ -116,3 +91,28 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&uboot 0x40004>;
+};
+
+&esw {
+ mediatek,portmap = <0x3f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&uboot 0x40000>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/F7C027.dts b/target/linux/ramips/dts/F7C027.dts
index 98b3d5a0a9..6214c85d03 100644
--- a/target/linux/ramips/dts/F7C027.dts
+++ b/target/linux/ramips/dts/F7C027.dts
@@ -6,82 +6,6 @@
compatible = "F7C027", "ralink,rt5350-soc";
model = "Belkin F7C027";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l12805d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x770000>;
- };
-
- partition@7c0000 {
- label = "firmware2";
- reg = <0x7c0000 0x770000>;
- };
-
- partition@f30000 {
- label = "belkin_settings";
- reg = <0xf30000 0xa0000>;
- };
-
- partition@fd0000 {
- label = "unknown";
- reg = <0xfd0000 0x10000>;
- };
-
- partition@fe0000 {
- label = "nvram";
- reg = <0xfe0000 0x10000>;
- };
-
- partition@ff0000 {
- label = "user_factory";
- reg = <0xff0000 0x10000>;
- };
- };
- };
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -131,3 +55,77 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l12805d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x770000>;
+ };
+
+ partition@7c0000 {
+ label = "firmware2";
+ reg = <0x7c0000 0x770000>;
+ };
+
+ partition@f30000 {
+ label = "belkin_settings";
+ reg = <0xf30000 0xa0000>;
+ };
+
+ partition@fd0000 {
+ label = "unknown";
+ reg = <0xfd0000 0x10000>;
+ };
+
+ partition@fe0000 {
+ label = "nvram";
+ reg = <0xfe0000 0x10000>;
+ };
+
+ partition@ff0000 {
+ label = "user_factory";
+ reg = <0xff0000 0x10000>;
+ };
+ };
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/FIREWRT.dts b/target/linux/ramips/dts/FIREWRT.dts
index e7cfb11744..4299b68a34 100644
--- a/target/linux/ramips/dts/FIREWRT.dts
+++ b/target/linux/ramips/dts/FIREWRT.dts
@@ -15,74 +15,6 @@
bootargs = "console=ttyS0,57600";
};
- sdhci@10130000 {
- status = "okay";
- };
-
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
- };
-
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0000>;
- mediatek,5ghz = <0>;
- };
- };
- };
-
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0xe000>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -110,13 +42,79 @@
linux,code = <116>;
};
};
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,5ghz = <0>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0xe000>;
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "wdt", "rgmii2";
- ralink,function = "gpio";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wdt", "rgmii2";
+ ralink,function = "gpio";
};
};
};
diff --git a/target/linux/ramips/dts/FONERA20N.dts b/target/linux/ramips/dts/FONERA20N.dts
index f5578eef4d..b7eb91ea7b 100644
--- a/target/linux/ramips/dts/FONERA20N.dts
+++ b/target/linux/ramips/dts/FONERA20N.dts
@@ -6,15 +6,6 @@
compatible = "FONERA20N", "ralink,rt3052-soc";
model = "La Fonera 2.0N";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -85,50 +76,59 @@
linux,input-type = <5>; /* EV_SW */
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
-
- port@0 {
- compatible = "swconfig,port";
- swconfig,segment = "lan";
- swconfig,portmap = <0 4>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
- port@1 {
- compatible = "swconfig,port";
- swconfig,segment = "lan";
- swconfig,portmap = <1 3>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
- port@2 {
- compatible = "swconfig,port";
- swconfig,segment = "lan";
- swconfig,portmap = <2 2>;
- };
+ port@0 {
+ compatible = "swconfig,port";
+ swconfig,segment = "lan";
+ swconfig,portmap = <0 4>;
+ };
- port@3 {
- compatible = "swconfig,port";
- swconfig,segment = "lan";
- swconfig,portmap = <3 1>;
- };
+ port@1 {
+ compatible = "swconfig,port";
+ swconfig,segment = "lan";
+ swconfig,portmap = <1 3>;
+ };
- port@4 {
- compatible = "swconfig,port";
- swconfig,segment = "wan";
- swconfig,portmap = <4 0>;
- };
+ port@2 {
+ compatible = "swconfig,port";
+ swconfig,segment = "lan";
+ swconfig,portmap = <2 2>;
};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
+ port@3 {
+ compatible = "swconfig,port";
+ swconfig,segment = "lan";
+ swconfig,portmap = <3 1>;
};
- otg@101c0000 {
- status = "okay";
+ port@4 {
+ compatible = "swconfig,port";
+ swconfig,segment = "wan";
+ swconfig,portmap = <4 0>;
};
};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/FREESTATION5.dts b/target/linux/ramips/dts/FREESTATION5.dts
index 28e4aff629..425eb2adbe 100644
--- a/target/linux/ramips/dts/FREESTATION5.dts
+++ b/target/linux/ramips/dts/FREESTATION5.dts
@@ -10,15 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -51,22 +42,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x01>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- otg@101c0000 {
- status = "okay";
- };
-
gpio-export {
compatible = "gpio-export";
@@ -100,3 +75,28 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x01>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/GL-MT300A.dts b/target/linux/ramips/dts/GL-MT300A.dts
index b7c346cc4e..5edb7ca487 100644
--- a/target/linux/ramips/dts/GL-MT300A.dts
+++ b/target/linux/ramips/dts/GL-MT300A.dts
@@ -10,109 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "w25q128";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xf80000>;
- };
-
- partition@ff0000 {
- label = "art";
- reg = <0xff0000 0x10000>;
- };
- };
- };
- };
-
- sdhci@10130000 {
- status = "okay";
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4000>;
- ralink,port-map = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
-
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "wled","ephy","uartf","i2c";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -162,3 +59,104 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "w25q128";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf80000>;
+ };
+
+ partition@ff0000 {
+ label = "art";
+ reg = <0xff0000 0x10000>;
+ };
+ };
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4000>;
+ ralink,port-map = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wled","ephy","uartf","i2c";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/GL-MT300N.dts b/target/linux/ramips/dts/GL-MT300N.dts
index d24415774f..341a8f6462 100644
--- a/target/linux/ramips/dts/GL-MT300N.dts
+++ b/target/linux/ramips/dts/GL-MT300N.dts
@@ -1,112 +1,15 @@
/dts-v1/;
-#include "mt7620n.dtsi"
+#include "mt7620a.dtsi"
/ {
- compatible = "GL-MT300N", "ralink,mt7620n-soc";
+ compatible = "GL-MT300N", "ralink,mt7620a-soc";
model = "GL-MT300N";
chosen {
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "w25q128";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xf80000>;
- };
-
- partition@ff0000 {
- label = "art";
- reg = <0xff0000 0x10000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4000>;
- ralink,port-map = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
-
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "wled","ephy","i2c";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -151,3 +54,98 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "w25q128";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf80000>;
+ };
+
+ partition@ff0000 {
+ label = "art";
+ reg = <0xff0000 0x10000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4000>;
+ ralink,port-map = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wled","ephy","i2c";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/GL-MT750.dts b/target/linux/ramips/dts/GL-MT750.dts
index 93c38079c2..c59ffb3756 100644
--- a/target/linux/ramips/dts/GL-MT750.dts
+++ b/target/linux/ramips/dts/GL-MT750.dts
@@ -10,109 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "w25q128";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xf80000>;
- };
-
- partition@ff0000 {
- label = "art";
- reg = <0xff0000 0x10000>;
- };
- };
- };
- };
-
- sdhci@10130000 {
- status = "okay";
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4000>;
- ralink,port-map = "llllw";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
-
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "wled","ephy","uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -157,3 +54,104 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "w25q128";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf80000>;
+ };
+
+ partition@ff0000 {
+ label = "art";
+ reg = <0xff0000 0x10000>;
+ };
+ };
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4000>;
+ ralink,port-map = "llllw";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wled","ephy","uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/HC5861.dts b/target/linux/ramips/dts/HC5861.dts
index fbf0e90ea5..3e812f691d 100644
--- a/target/linux/ramips/dts/HC5861.dts
+++ b/target/linux/ramips/dts/HC5861.dts
@@ -6,44 +6,6 @@
compatible = "HC5861", "ralink,mt7620a-soc";
model = "HiWiFi HC5861";
- ethernet@10100000 {
- status = "okay";
- mtd-mac-address = <&factory 0x4>;
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
- mediatek,portmap = "wllll";
-
- port@4 {
- status = "okay";
- phy-handle = <&phy4>;
- phy-mode = "rgmii";
- };
-
- port@5 {
- status = "okay";
- phy-handle = <&phy5>;
- phy-mode = "rgmii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy4: ethernet-phy@4 {
- reg = <4>;
- phy-mode = "rgmii";
- };
-
- phy5: ethernet-phy@5 {
- reg = <5>;
- phy-mode = "rgmii";
- };
- };
- };
-
- gsw@10110000 {
- mediatek,port4 = "gmac";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -90,3 +52,41 @@
};
};
};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x4>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+ mediatek,portmap = "wllll";
+
+ port@4 {
+ status = "okay";
+ phy-handle = <&phy4>;
+ phy-mode = "rgmii";
+ };
+
+ port@5 {
+ status = "okay";
+ phy-handle = <&phy5>;
+ phy-mode = "rgmii";
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy4: ethernet-phy@4 {
+ reg = <4>;
+ phy-mode = "rgmii";
+ };
+
+ phy5: ethernet-phy@5 {
+ reg = <5>;
+ phy-mode = "rgmii";
+ };
+ };
+};
+
+&gsw {
+ mediatek,port4 = "gmac";
+};
diff --git a/target/linux/ramips/dts/HC5XXX.dtsi b/target/linux/ramips/dts/HC5XXX.dtsi
index 5b38326032..d55d5b65cd 100644
--- a/target/linux/ramips/dts/HC5XXX.dtsi
+++ b/target/linux/ramips/dts/HC5XXX.dtsi
@@ -5,116 +5,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- sysc@0 {
- ralink,gpiomux = "i2c", "jtag";
- ralink,uartmux = "gpio";
- ralink,wdtmux = <1>;
- };
-
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xf80000>;
- };
-
- partition@fd0000 {
- label = "hwf_config";
- reg = <0xfd0000 0x10000>;
- };
-
- bdinfo: partition@fe0000 {
- label = "bdinfo";
- reg = <0xfe0000 0x10000>;
- };
-
- partition@ff0000 {
- label = "backup";
- reg = <0xff0000 0x10000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
-
- sdhci@10130000 {
- status = "okay";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "uartf", "wled", "nd_sd";
- ralink,function = "gpio";
- };
-
- pa {
- ralink,group = "pa";
- ralink,function = "pa";
- };
- };
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -139,3 +29,111 @@
};
};
};
+
+&sysc {
+ ralink,gpiomux = "i2c", "jtag";
+ ralink,uartmux = "gpio";
+ ralink,wdtmux = <1>;
+};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf80000>;
+ };
+
+ partition@fd0000 {
+ label = "hwf_config";
+ reg = <0xfd0000 0x10000>;
+ };
+
+ bdinfo: partition@fe0000 {
+ label = "bdinfo";
+ reg = <0xfe0000 0x10000>;
+ };
+
+ partition@ff0000 {
+ label = "backup";
+ reg = <0xff0000 0x10000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "uartf", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+
+ pa {
+ ralink,group = "pa";
+ ralink,function = "pa";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/HG255D.dts b/target/linux/ramips/dts/HG255D.dts
index 392464f4bd..ee385097b2 100644
--- a/target/linux/ramips/dts/HG255D.dts
+++ b/target/linux/ramips/dts/HG255D.dts
@@ -6,15 +6,6 @@
compatible = "HG255D", "ralink,rt3052-soc";
model = "HuaWei HG255D";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x1000000>;
@@ -111,20 +102,29 @@
linux,code = <0xf7>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
- otg@101c0000 {
- status = "okay";
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/HLKRM04.dts b/target/linux/ramips/dts/HLKRM04.dts
index 0352546bf0..2f4e43548f 100644
--- a/target/linux/ramips/dts/HLKRM04.dts
+++ b/target/linux/ramips/dts/HLKRM04.dts
@@ -15,78 +15,6 @@
bootargs = "console=ttyS1,57600";
};
- palmbus@10000000 {
- uart@500 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag";
- ralink,function = "gpio";
- };
-
- uartf_gpio {
- ralink,group = "uartf";
- ralink,function = "gpio uartf";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-export {
compatible = "gpio-export";
#size-cells = <0>;
@@ -123,3 +51,73 @@
};
};
};
+
+&uart {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag";
+ ralink,function = "gpio";
+ };
+
+ uartf_gpio {
+ ralink,group = "uartf";
+ ralink,function = "gpio uartf";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/HPM.dts b/target/linux/ramips/dts/HPM.dts
index d0ff882db2..000750fa12 100644
--- a/target/linux/ramips/dts/HPM.dts
+++ b/target/linux/ramips/dts/HPM.dts
@@ -10,78 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- compatible = "jedec,spi-nor";
- spi-max-frequency = <25000000>;
- reg = <0>;
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- reg = <0x0 0x0030000>;
- label = "u-boot";
- read-only;
- };
-
- partition@30000 {
- reg = <0x00030000 0x00010000>;
- label = "config";
- read-only;
- };
-
- factory: partition@40000 {
- reg = <0x00040000 0x00010000>;
- label = "factory";
- read-only;
- };
-
- partition@50000 {
- reg = <0x00050000 0x00fb0000>;
- label = "firmware";
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- phy-handle = <&phy0>;
- phy-mode = "rgmii";
- mtd-mac-address = <&factory 0x28>;
-
- mdio-bus {
- status = "okay";
-
- phy0: ethernet-phy@4 {
- reg = <4>;
- };
- };
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -147,3 +75,73 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ compatible = "jedec,spi-nor";
+ spi-max-frequency = <25000000>;
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ reg = <0x0 0x0030000>;
+ label = "u-boot";
+ read-only;
+ };
+
+ partition@30000 {
+ reg = <0x00030000 0x00010000>;
+ label = "config";
+ read-only;
+ };
+
+ factory: partition@40000 {
+ reg = <0x00040000 0x00010000>;
+ label = "factory";
+ read-only;
+ };
+
+ partition@50000 {
+ reg = <0x00050000 0x00fb0000>;
+ label = "firmware";
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ phy-handle = <&phy0>;
+ phy-mode = "rgmii";
+ mtd-mac-address = <&factory 0x28>;
+
+ mdio-bus {
+ status = "okay";
+
+ phy0: ethernet-phy@4 {
+ reg = <4>;
+ };
+ };
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/HT-TM02.dts b/target/linux/ramips/dts/HT-TM02.dts
index 52bcf860ea..bfa3536a29 100644
--- a/target/linux/ramips/dts/HT-TM02.dts
+++ b/target/linux/ramips/dts/HT-TM02.dts
@@ -6,78 +6,6 @@
compatible = "HT-TM02", "ralink,rt5350-soc";
model = "HooToo HT-TM02";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x10>;
- mediatek,portdisable = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -112,3 +40,73 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x10>;
+ mediatek,portdisable = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/HW550-3G.dts b/target/linux/ramips/dts/HW550-3G.dts
index 5d5f864ddb..0efa8d0f54 100644
--- a/target/linux/ramips/dts/HW550-3G.dts
+++ b/target/linux/ramips/dts/HW550-3G.dts
@@ -6,15 +6,6 @@
compatible = "HW550-3G", "ralink,rt3052-soc";
model = "Aztech HW550-3G";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -107,8 +86,29 @@
linux,code = <0x211>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/IP2202.dts b/target/linux/ramips/dts/IP2202.dts
index d4ac50b01f..50d5532a2d 100644
--- a/target/linux/ramips/dts/IP2202.dts
+++ b/target/linux/ramips/dts/IP2202.dts
@@ -6,15 +6,6 @@
compatible = "IP2202", "ralink,rt3052-soc";
model = "Poray IP2202";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,14 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -81,8 +64,25 @@
linux,code = <0x198>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/JHR-N805R.dts b/target/linux/ramips/dts/JHR-N805R.dts
index 2c9dde78bc..0688c3ab02 100644
--- a/target/linux/ramips/dts/JHR-N805R.dts
+++ b/target/linux/ramips/dts/JHR-N805R.dts
@@ -6,65 +6,6 @@
compatible = "JHR-N805R", "ralink,rt3050-soc";
model = "JCG JHR-N805R";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x2e>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -87,3 +28,60 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x2e>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/JHR-N825R.dts b/target/linux/ramips/dts/JHR-N825R.dts
index 3bcb9e9ef4..1e9acdf113 100644
--- a/target/linux/ramips/dts/JHR-N825R.dts
+++ b/target/linux/ramips/dts/JHR-N825R.dts
@@ -6,15 +6,6 @@
compatible = "JHR-N825R", "ralink,rt3052-soc";
model = "JCG JHR-N825R";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x2e>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
system {
@@ -79,3 +58,24 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x2e>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/JHR-N926R.dts b/target/linux/ramips/dts/JHR-N926R.dts
index f637ab2570..1a63656ed9 100644
--- a/target/linux/ramips/dts/JHR-N926R.dts
+++ b/target/linux/ramips/dts/JHR-N926R.dts
@@ -6,15 +6,6 @@
compatible = "JHR-N926R", "ralink,rt3052-soc";
model = "JCG JHR-N926R";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x2e>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -125,3 +104,24 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x2e>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/LINKIT7688.dts b/target/linux/ramips/dts/LINKIT7688.dts
index 43ff78bc73..09a8c987f7 100644
--- a/target/linux/ramips/dts/LINKIT7688.dts
+++ b/target/linux/ramips/dts/LINKIT7688.dts
@@ -19,128 +19,6 @@
reg = <0x0 0x8000000>;
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "gpio";
- ralink,function = "gpio";
- };
-
- perst {
- ralink,group = "perst";
- ralink,function = "gpio";
- };
-
- refclk {
- ralink,group = "refclk";
- ralink,function = "gpio";
- };
-
- i2s {
- ralink,group = "i2s";
- ralink,function = "gpio";
- };
-
- spis {
- ralink,group = "spis";
- ralink,function = "gpio";
- };
-
- wled_kn {
- ralink,group = "wled_kn";
- ralink,function = "gpio";
- };
-
- wled_an {
- ralink,group = "wled_an";
- ralink,function = "wled_an";
- };
-
- wdt {
- ralink,group = "wdt";
- ralink,function = "gpio";
- };
- };
- };
-
- wmac@10300000 {
- status = "okay";
- };
-
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- pinctrl-names = "default";
- pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l25635e";
- spi-max-frequency = <40000000>;
- m25p,chunked-io = <31>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x1fb0000>;
- };
- };
-
- spidev@1 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "spidev";
- reg = <1 0>;
- spi-max-frequency = <40000000>;
- };
- };
-
- i2c@900 {
- status = "okay";
- };
-
- uart1@d00 {
- status = "okay";
- };
-
- uart2@e00 {
- status = "okay";
- };
-
- pwm@5000 {
- status = "okay";
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- sdhci@10130000 {
- status = "okay";
- mediatek,cd-high;
- };
-
bootstrap {
compatible = "mediatek,linkit";
@@ -149,7 +27,7 @@
gpio-leds {
compatible = "gpio-leds";
-
+
wifi {
label = "mediatek:orange:wifi";
gpios = <&wgpio 0 0>;
@@ -162,7 +40,7 @@
#address-cells = <1>;
#size-cells = <0>;
poll-interval = <20>;
-
+
wps {
label = "reset";
gpios = <&gpio1 6 1>;
@@ -177,5 +55,128 @@
gpio-controller;
#gpio-cells = <2>;
};
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "gpio";
+ ralink,function = "gpio";
+ };
+
+ perst {
+ ralink,group = "perst";
+ ralink,function = "gpio";
+ };
+
+ refclk {
+ ralink,group = "refclk";
+ ralink,function = "gpio";
+ };
+
+ i2s {
+ ralink,group = "i2s";
+ ralink,function = "gpio";
+ };
+
+ spis {
+ ralink,group = "spis";
+ ralink,function = "gpio";
+ };
+
+ wled_kn {
+ ralink,group = "wled_kn";
+ ralink,function = "gpio";
+ };
+
+ wled_an {
+ ralink,group = "wled_an";
+ ralink,function = "wled_an";
+ };
+
+ wdt {
+ ralink,group = "wdt";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&wmac {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l25635e";
+ spi-max-frequency = <40000000>;
+ m25p,chunked-io = <31>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x1fb0000>;
+ };
+ };
+
+ spidev@1 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "linux,spidev";
+ reg = <1>;
+ spi-max-frequency = <40000000>;
+ };
+};
+
+&i2c {
+ status = "okay";
+};
+
+&uart1 {
+ status = "okay";
+};
+
+&uart2 {
+ status = "okay";
+};
+
+&pwm {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&sdhci {
+ status = "okay";
+ mediatek,cd-high;
+};
+&wmac {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/M2M.dts b/target/linux/ramips/dts/M2M.dts
index fcc8c04de8..22ec534a2a 100644
--- a/target/linux/ramips/dts/M2M.dts
+++ b/target/linux/ramips/dts/M2M.dts
@@ -10,53 +10,6 @@
bootargs = "console=ttyS0,57600n8 root=/dev/mtdblock5";
};
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "Bootloader";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "Config";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "Factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -89,24 +42,69 @@
linux,code = <0x198>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
+&spi0 {
+ status = "okay";
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "Bootloader";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
- ehci@101c0000 {
- status = "okay";
- };
+ partition@30000 {
+ label = "Config";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "Factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- ohci@101c1000 {
- status = "okay";
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
};
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0x0>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0x0>;
+};
diff --git a/target/linux/ramips/dts/M3.dts b/target/linux/ramips/dts/M3.dts
index 11eb9b59f5..9b6ed89142 100644
--- a/target/linux/ramips/dts/M3.dts
+++ b/target/linux/ramips/dts/M3.dts
@@ -6,62 +6,6 @@
compatible = "M3", "ralink,rt5350-soc";
model = "Poray M3";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q32";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <1>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -90,17 +34,71 @@
linux,input-type = <5>;
};
};
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- ralink,led-polarity = <1>;
- };
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q32";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- ehci@101c0000 {
- status = "okay";
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
};
+};
- ohci@101c1000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <1>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+ ralink,led-polarity = <1>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/M4-4M.dts b/target/linux/ramips/dts/M4-4M.dts
index 329148ed44..0502714c3b 100644
--- a/target/linux/ramips/dts/M4-4M.dts
+++ b/target/linux/ramips/dts/M4-4M.dts
@@ -6,62 +6,6 @@
compatible = "M4", "ralink,rt5350-soc";
model = "Poray M4";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "pm25lq032";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <1>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -83,12 +27,66 @@
linux,code = <0x198>;
};
};
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "pm25lq032";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
- ehci@101c0000 {
- status = "okay";
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
};
+};
- ohci@101c1000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <1>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/M4-8M.dts b/target/linux/ramips/dts/M4-8M.dts
index ec7d3849f7..16ee184ed2 100644
--- a/target/linux/ramips/dts/M4-8M.dts
+++ b/target/linux/ramips/dts/M4-8M.dts
@@ -6,62 +6,6 @@
compatible = "M4", "ralink,rt5350-soc";
model = "Poray M4";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "gd25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <1>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -83,17 +27,71 @@
linux,code = <0x198>;
};
};
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- ralink,led-polarity = <1>;
- };
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "gd25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- ehci@101c0000 {
- status = "okay";
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
};
+};
- ohci@101c1000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <1>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+ ralink,led-polarity = <1>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/MINIEMBPLUG.dts b/target/linux/ramips/dts/MINIEMBPLUG.dts
index eb980d59ac..eefac574c1 100644
--- a/target/linux/ramips/dts/MINIEMBPLUG.dts
+++ b/target/linux/ramips/dts/MINIEMBPLUG.dts
@@ -6,15 +6,6 @@
compatible = "MINIEMBPLUG", "ralink,rt5350-soc";
model = "Omnima MiniEMBPlug";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -59,62 +50,73 @@
linux,code = <0x211>;
};
};
+};
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
};
+ };
+};
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
};
- };
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
};
+};
- otg@101c0000 {
- status = "okay";
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/MINIEMBWIFI.dts b/target/linux/ramips/dts/MINIEMBWIFI.dts
index aa621c807d..1240adede0 100644
--- a/target/linux/ramips/dts/MINIEMBWIFI.dts
+++ b/target/linux/ramips/dts/MINIEMBWIFI.dts
@@ -6,15 +6,6 @@
compatible = "MINIEMBWIFI", "ralink,rt3052-soc";
model = "Omnima MiniEMBWiFi";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -73,20 +64,29 @@
reg = <0x50000 0x7b0000>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
- otg@101c0000 {
- status = "okay";
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/MIWIFI-MINI.dts b/target/linux/ramips/dts/MIWIFI-MINI.dts
index e499f4e2a4..e9ad3750b7 100644
--- a/target/linux/ramips/dts/MIWIFI-MINI.dts
+++ b/target/linux/ramips/dts/MIWIFI-MINI.dts
@@ -10,117 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xf80000>;
- };
-
- partition@fd0000 {
- label = "crash";
- reg = <0xfd0000 0x10000>;
- };
-
- partition@fe0000 {
- label = "reserved";
- reg = <0xfe0000 0x10000>;
- read-only;
- };
-
- partition@ff0000 {
- label = "Bdata";
- reg = <0xff0000 0x10000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
-
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "rgmii1";
- ralink,function = "gpio";
- };
-
- pa {
- ralink,group = "pa";
- ralink,function = "pa";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -153,3 +42,112 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf80000>;
+ };
+
+ partition@fd0000 {
+ label = "crash";
+ reg = <0xfd0000 0x10000>;
+ };
+
+ partition@fe0000 {
+ label = "reserved";
+ reg = <0xfe0000 0x10000>;
+ read-only;
+ };
+
+ partition@ff0000 {
+ label = "Bdata";
+ reg = <0xff0000 0x10000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "rgmii1";
+ ralink,function = "gpio";
+ };
+
+ pa {
+ ralink,group = "pa";
+ ralink,function = "pa";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/MIWIFI-NANO.dts b/target/linux/ramips/dts/MIWIFI-NANO.dts
index d305ee49be..6906ef30ad 100644
--- a/target/linux/ramips/dts/MIWIFI-NANO.dts
+++ b/target/linux/ramips/dts/MIWIFI-NANO.dts
@@ -15,15 +15,6 @@
reg = <0x0 0x4000000>;
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "refclk", "wled", "gpio";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -41,51 +32,56 @@
label = "miwifi-nano:amber:radio";
gpios = <&gpio1 12 1>;
default-state = "1";
-
};
};
+};
-
- wmac@10300000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "refclk", "wled_an", "gpio";
+ ralink,function = "gpio";
+ };
};
+};
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
- m25p,chunked-io = <32>;
+&wmac {
+ status = "okay";
+};
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+ m25p,chunked-io = <32>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
};
};
};
diff --git a/target/linux/ramips/dts/MLW221.dts b/target/linux/ramips/dts/MLW221.dts
index 2238113739..670a36aadb 100644
--- a/target/linux/ramips/dts/MLW221.dts
+++ b/target/linux/ramips/dts/MLW221.dts
@@ -6,87 +6,6 @@
compatible = "mlw221", "ralink,mt7620n-soc";
model = "Kingston MLW221";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl129p1";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xf60000>;
- };
-
- partition@fb0000 {
- label = "user-config";
- reg = <0xfb0000 0x50000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "i2c", "ephy", "wled";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -120,3 +39,82 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl129p1";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf60000>;
+ };
+
+ partition@fb0000 {
+ label = "user-config";
+ reg = <0xfb0000 0x50000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "i2c", "ephy", "wled";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/MLWG2.dts b/target/linux/ramips/dts/MLWG2.dts
index 4535446577..c9f61c735f 100644
--- a/target/linux/ramips/dts/MLWG2.dts
+++ b/target/linux/ramips/dts/MLWG2.dts
@@ -6,87 +6,6 @@
compatible = "mlwg2", "ralink,mt7620n-soc";
model = "Kingston MLWG2";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xf60000>;
- };
-
- partition@fb0000 {
- label = "user-config";
- reg = <0xfb0000 0x50000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "i2c", "ephy", "wled";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -120,3 +39,82 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf60000>;
+ };
+
+ partition@fb0000 {
+ label = "user-config";
+ reg = <0xfb0000 0x50000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "i2c", "ephy", "wled";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/MOFI3500-3GN.dts b/target/linux/ramips/dts/MOFI3500-3GN.dts
index b500da44d1..633f20a750 100644
--- a/target/linux/ramips/dts/MOFI3500-3GN.dts
+++ b/target/linux/ramips/dts/MOFI3500-3GN.dts
@@ -6,15 +6,6 @@
compatible = "MOFI3500-3GN", "ralink,rt3052-soc";
model = "MoFi Network MOFI3500-3GN";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,10 +38,6 @@
};
};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -99,13 +86,26 @@
linux,code = <0x211>;
};
};
+};
- wmac@10180000 {
- status = "okay";
- ralink,mtd-eeprom = <&factory 0>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- otg@101c0000 {
- status = "okay";
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ status = "okay";
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/MPRA1.dts b/target/linux/ramips/dts/MPRA1.dts
index 181c7ec0e3..d9baed732a 100644
--- a/target/linux/ramips/dts/MPRA1.dts
+++ b/target/linux/ramips/dts/MPRA1.dts
@@ -6,77 +6,6 @@
compatible = "MPRA1", "ralink,rt5350-soc";
model = "HAME MPR-A1";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
-
- gpio1: gpio@660 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf", "led";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -121,3 +50,72 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf", "led";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/MPRA2.dts b/target/linux/ramips/dts/MPRA2.dts
index 5f3e3a4264..84f5dda3a6 100644
--- a/target/linux/ramips/dts/MPRA2.dts
+++ b/target/linux/ramips/dts/MPRA2.dts
@@ -6,73 +6,6 @@
compatible = "MPRA2", "ralink,rt5350-soc";
model = "HAME MPR-A2";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -117,3 +50,69 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x1>;
+ mediatek,portdisable = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/MR-102N.dts b/target/linux/ramips/dts/MR-102N.dts
index 286282a6e5..6546601f15 100644
--- a/target/linux/ramips/dts/MR-102N.dts
+++ b/target/linux/ramips/dts/MR-102N.dts
@@ -6,15 +6,6 @@
compatible = "MR-102N", "ralink,rt3052-soc";
model = "AXIMCom MR-102N";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -57,20 +48,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- status = "okay";
- #mediatek,portmap = <0x3e>;
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -108,8 +85,32 @@
linux,code = <0x211>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ status = "okay";
+ #mediatek,portmap = <0x3e>;
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/MT7620a.dts b/target/linux/ramips/dts/MT7620a.dts
index d3553349fc..7bf38976f6 100644
--- a/target/linux/ramips/dts/MT7620a.dts
+++ b/target/linux/ramips/dts/MT7620a.dts
@@ -6,122 +6,120 @@
compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
model = "Ralink MT7620a + MT7610e evaluation board";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
+ gpio-keys-polled {
+ compatible = "gpio-keys";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+
+ s2 {
+ label = "S2";
+ gpios = <&gpio0 1 1>;
+ linux,code = <0x100>;
};
- };
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf";
- ralink,function = "gpio";
- };
+ s3 {
+ label = "S3";
+ gpios = <&gpio0 2 1>;
+ linux,code = <0x101>;
};
};
+};
- ethernet@10100000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
- mediatek,portmap = "llllw";
+&spi0 {
+ status = "okay";
- port@4 {
- status = "okay";
- phy-mode = "rgmii";
- phy-handle = <&phy4>;
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
};
- port@5 {
- status = "okay";
- phy-mode = "rgmii";
- phy-handle = <&phy5>;
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
};
- mdio-bus {
- status = "okay";
-
- phy4: ethernet-phy@4 {
- reg = <4>;
- phy-mode = "rgmii";
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- phy5: ethernet-phy@5 {
- reg = <5>;
- phy-mode = "rgmii";
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
};
};
+};
- gsw@10110000 {
- mediatek,port4 = "gmac";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
+
+&ethernet {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+ mediatek,portmap = "llllw";
- sdhci@10130000 {
+ port@4 {
status = "okay";
+ phy-mode = "rgmii";
+ phy-handle = <&phy4>;
};
- pcie@10140000 {
+ port@5 {
status = "okay";
+ phy-mode = "rgmii";
+ phy-handle = <&phy5>;
};
- gpio-keys-polled {
- compatible = "gpio-keys";
- #address-cells = <1>;
- #size-cells = <0>;
- poll-interval = <20>;
+ mdio-bus {
+ status = "okay";
- s2 {
- label = "S2";
- gpios = <&gpio0 1 1>;
- linux,code = <0x100>;
+ phy4: ethernet-phy@4 {
+ reg = <4>;
+ phy-mode = "rgmii";
};
- s3 {
- label = "S3";
- gpios = <&gpio0 2 1>;
- linux,code = <0x101>;
+ phy5: ethernet-phy@5 {
+ reg = <5>;
+ phy-mode = "rgmii";
};
};
+};
- ehci@101c0000 {
- status = "okay";
- };
+&gsw {
+ mediatek,port4 = "gmac";
+};
- ohci@101c1000 {
- status = "okay";
- };
+&sdhci {
+ status = "okay";
+};
+
+&pcie {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/MT7620a_MT7530.dts b/target/linux/ramips/dts/MT7620a_MT7530.dts
index d5d5d77401..5885ed045d 100644
--- a/target/linux/ramips/dts/MT7620a_MT7530.dts
+++ b/target/linux/ramips/dts/MT7620a_MT7530.dts
@@ -5,115 +5,113 @@
/ {
compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
model = "Ralink MT7620a + MT7530 evaluation board";
+};
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
};
- };
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf";
- ralink,function = "gpio";
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
};
- };
-
- ethernet@10100000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
- mediatek,portmap = "llllw";
- port@5 {
- status = "okay";
- mediatek,fixed-link = <1000 1 1 1>;
- phy-mode = "rgmii";
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
};
- mdio-bus {
- status = "okay";
-
- phy0: ethernet-phy@0 {
- reg = <0>;
- phy-mode = "rgmii";
- };
-
- phy1: ethernet-phy@1 {
- reg = <1>;
- phy-mode = "rgmii";
- };
-
- phy2: ethernet-phy@2 {
- reg = <2>;
- phy-mode = "rgmii";
- };
-
- phy3: ethernet-phy@3 {
- reg = <3>;
- phy-mode = "rgmii";
- };
-
- phy4: ethernet-phy@4 {
- reg = <4>;
- phy-mode = "rgmii";
- };
-
- phy1f: ethernet-phy@1f {
- reg = <0x1f>;
- phy-mode = "rgmii";
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
};
};
+};
- gsw@10110000 {
- mediatek,port4 = "gmac";
- mediatek,mt7530 = <1>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- pcie@10140000 {
- status = "okay";
- };
+&ethernet {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+ mediatek,portmap = "llllw";
- ehci@101c0000 {
+ port@5 {
status = "okay";
+ mediatek,fixed-link = <1000 1 1 1>;
+ phy-mode = "rgmii";
};
- ohci@101c1000 {
+ mdio-bus {
status = "okay";
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ phy-mode = "rgmii";
+ };
+
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ phy-mode = "rgmii";
+ };
+
+ phy2: ethernet-phy@2 {
+ reg = <2>;
+ phy-mode = "rgmii";
+ };
+
+ phy3: ethernet-phy@3 {
+ reg = <3>;
+ phy-mode = "rgmii";
+ };
+
+ phy4: ethernet-phy@4 {
+ reg = <4>;
+ phy-mode = "rgmii";
+ };
+
+ phy1f: ethernet-phy@1f {
+ reg = <0x1f>;
+ phy-mode = "rgmii";
+ };
};
};
+
+&gsw {
+ mediatek,port4 = "gmac";
+ mediatek,mt7530 = <1>;
+};
+
+&pcie {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/MT7620a_MT7610e.dts b/target/linux/ramips/dts/MT7620a_MT7610e.dts
index 696d4d05ca..52ceddcbc8 100644
--- a/target/linux/ramips/dts/MT7620a_MT7610e.dts
+++ b/target/linux/ramips/dts/MT7620a_MT7610e.dts
@@ -6,67 +6,6 @@
compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
model = "Ralink MT7620A evaluation board";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <1000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- ethernet@10100000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mediatek,portmap = "llllw";
- };
-
- gsw@10110000 {
- mediatek,port4 = "ephy";
- };
-
- sdhci@10130000 {
- status = "okay";
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
gpio-keys-polled {
compatible = "gpio-keys";
#address-cells = <1>;
@@ -86,3 +25,62 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <1000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&ethernet {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mediatek,portmap = "llllw";
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&pcie {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/MT7620a_V22SG.dts b/target/linux/ramips/dts/MT7620a_V22SG.dts
index 8dff80d40a..a3e206e5dd 100644
--- a/target/linux/ramips/dts/MT7620a_V22SG.dts
+++ b/target/linux/ramips/dts/MT7620a_V22SG.dts
@@ -6,64 +6,6 @@
compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
model = "Ralink MT7620a V22SG High Power evaluation board";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf", "spi";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
- mediatek,portmap = "llllw";
-
- port@4 {
- status = "okay";
- phy-handle = <&phy4>;
- phy-mode = "rgmii";
- };
-
- port@5 {
- status = "okay";
- phy-handle = <&phy5>;
- phy-mode = "rgmii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy4: ethernet-phy@4 {
- reg = <4>;
- phy-mode = "rgmii";
- };
-
- phy5: ethernet-phy@5 {
- reg = <5>;
- phy-mode = "rgmii";
- };
- };
- };
-
- gsw@10110000 {
- mediatek,port4 = "gmac";
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -112,3 +54,61 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "spi";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+ mediatek,portmap = "llllw";
+
+ port@4 {
+ status = "okay";
+ phy-handle = <&phy4>;
+ phy-mode = "rgmii";
+ };
+
+ port@5 {
+ status = "okay";
+ phy-handle = <&phy5>;
+ phy-mode = "rgmii";
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy4: ethernet-phy@4 {
+ reg = <4>;
+ phy-mode = "rgmii";
+ };
+
+ phy5: ethernet-phy@5 {
+ reg = <5>;
+ phy-mode = "rgmii";
+ };
+ };
+};
+
+&gsw {
+ mediatek,port4 = "gmac";
+};
+
+&pcie {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/MT7621.dts b/target/linux/ramips/dts/MT7621.dts
index 341d8f2a70..4013f3c7b5 100644
--- a/target/linux/ramips/dts/MT7621.dts
+++ b/target/linux/ramips/dts/MT7621.dts
@@ -15,23 +15,6 @@
bootargs = "console=ttyS0,57600";
};
- sdhci@10130000 {
- status = "okay";
- };
-
- xhci@1E1C0000 {
- status = "okay";
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
- ralink,function = "gpio";
- };
- };
- };
-
nand@1e003000 {
partition@0 {
label = "uboot";
@@ -54,3 +37,20 @@
};
};
};
+
+&sdhci {
+ status = "okay";
+};
+
+&xhci {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/MT7628.dts b/target/linux/ramips/dts/MT7628.dts
index 25359f7e7c..a4b066cfd5 100644
--- a/target/linux/ramips/dts/MT7628.dts
+++ b/target/linux/ramips/dts/MT7628.dts
@@ -10,56 +10,58 @@
device_type = "memory";
reg = <0x0 0x2000000>;
};
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag";
- ralink,function = "gpio";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag";
+ ralink,function = "gpio";
};
};
+};
- wmac@10300000 {
- status = "okay";
- };
+&wmac {
+ status = "okay";
+};
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
+&spi0 {
+ status = "okay";
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <10000000>;
- m25p,chunked-io = <32>;
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+ m25p,chunked-io = <32>;
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
};
};
};
+
+&wmac {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/MZK-750DHP.dts b/target/linux/ramips/dts/MZK-750DHP.dts
index 40439ba7a0..01fe2a1e24 100644
--- a/target/linux/ramips/dts/MZK-750DHP.dts
+++ b/target/linux/ramips/dts/MZK-750DHP.dts
@@ -6,89 +6,6 @@
compatible = "ralink,mt7620a-soc";
model = "Planex MZK-750DHP";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi refclk", "rgmii1", "nd_sd";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- gsw@10110000 {
- mediatek,port4 = "ephy";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
-
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -127,3 +44,84 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi refclk", "rgmii1", "nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/MZK-DP150N.dts b/target/linux/ramips/dts/MZK-DP150N.dts
index 10afc065ce..86f82ba59a 100644
--- a/target/linux/ramips/dts/MZK-DP150N.dts
+++ b/target/linux/ramips/dts/MZK-DP150N.dts
@@ -6,76 +6,6 @@
compatible = "MZK-DP150N", "ralink,rt5350-soc";
model = "Planex MZK-DP150N";
- palmbus@10000000 {
- gpio1: gpio@660 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "uboot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "uboot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
-
- spidev@1 {
- compatible = "linux,spidev";
- spi-max-frequency = <10000000>;
- reg = <1>;
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "jtag", "uartf", "led";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x17>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- ralink,led-polarity = <1>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -98,3 +28,73 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "uboot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "uboot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&spi1 {
+ spidev@0 {
+ compatible = "linux,spidev";
+ spi-max-frequency = <10000000>;
+ reg = <0>;
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "jtag", "uartf", "led";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x17>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+ ralink,led-polarity = <1>;
+};
diff --git a/target/linux/ramips/dts/MZK-EX300NP.dts b/target/linux/ramips/dts/MZK-EX300NP.dts
index 1386f5f606..05c79d3faf 100644
--- a/target/linux/ramips/dts/MZK-EX300NP.dts
+++ b/target/linux/ramips/dts/MZK-EX300NP.dts
@@ -6,77 +6,6 @@
compatible = "ralink,mt7620a-soc";
model = "Planex MZK-EX300NP";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x730000>;
- };
-
- partition@780000 {
- label = "Udata";
- reg = <0x780000 0x80000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "spi refclk", "rgmii1", "wled";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -130,3 +59,72 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x730000>;
+ };
+
+ partition@780000 {
+ label = "Udata";
+ reg = <0x780000 0x80000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "spi refclk", "rgmii1", "wled";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/MZK-EX750NP.dts b/target/linux/ramips/dts/MZK-EX750NP.dts
index 64fe3aa2f3..565b4356f0 100644
--- a/target/linux/ramips/dts/MZK-EX750NP.dts
+++ b/target/linux/ramips/dts/MZK-EX750NP.dts
@@ -6,90 +6,6 @@
compatible = "ralink,mt7620a-soc";
model = "Planex MZK-EX750NP";
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x730000>;
- };
-
- partition@780000 {
- label = "Udata";
- reg = <0x780000 0x80000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "uartf", "nd_sd", "rgmii2", "wled";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
-
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -148,3 +64,85 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x730000>;
+ };
+
+ partition@780000 {
+ label = "Udata";
+ reg = <0x780000 0x80000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "uartf", "nd_sd", "rgmii2", "wled";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/MZK-W300NH2.dts b/target/linux/ramips/dts/MZK-W300NH2.dts
index c953805f3f..987d6a7c0d 100644
--- a/target/linux/ramips/dts/MZK-W300NH2.dts
+++ b/target/linux/ramips/dts/MZK-W300NH2.dts
@@ -6,15 +6,6 @@
compatible = "MZK-W300NH2", "ralink,rt3052-soc";
model = "Planex MZK-W300NH2";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -53,18 +44,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -109,3 +88,24 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/MZK-WDPR.dts b/target/linux/ramips/dts/MZK-WDPR.dts
index ae77fa3b51..ff26b153b6 100644
--- a/target/linux/ramips/dts/MZK-WDPR.dts
+++ b/target/linux/ramips/dts/MZK-WDPR.dts
@@ -10,15 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -58,22 +49,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- otg@101c0000 {
- status = "okay";
- };
-
gpio-export {
compatible = "gpio-export";
@@ -84,3 +59,28 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/MicroWRT.dts b/target/linux/ramips/dts/MicroWRT.dts
index 40fcadbd1c..07e01550a7 100644
--- a/target/linux/ramips/dts/MicroWRT.dts
+++ b/target/linux/ramips/dts/MicroWRT.dts
@@ -10,84 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x20000>;
- read-only;
- };
-
- partition@20000 {
- label = "u-boot-env";
- reg = <0x20000 0x10000>;
- read-only;
- };
-
- factory: partition@30000 {
- label = "factory";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- partition@40000 {
- label = "firmware";
- reg = <0x40000 0xfc0000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "wled", "i2c", "wdt", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -107,3 +29,79 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x20000>;
+ read-only;
+ };
+
+ partition@20000 {
+ label = "u-boot-env";
+ reg = <0x20000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@30000 {
+ label = "factory";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "firmware";
+ reg = <0x40000 0xfc0000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&pcie {
+ status = "okay";
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "wled", "i2c", "wdt", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/NA930.dts b/target/linux/ramips/dts/NA930.dts
index 9b54d72d53..4093932a50 100644
--- a/target/linux/ramips/dts/NA930.dts
+++ b/target/linux/ramips/dts/NA930.dts
@@ -10,34 +10,6 @@
bootargs = "console=ttyS1,57600";
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "rgmii2", "spi", "ephy";
- ralink,function = "gpio";
- };
-
- uartf_gpio {
- ralink,group = "uartf";
- ralink,function = "gpio uartf";
- };
- };
- };
-
- palmbus@10000000 {
- uart@500 {
- status = "okay";
- };
-
- gpio@638 {
- status = "okay";
- };
-
- gpio@660 {
- status = "okay";
- };
- };
-
nand {
#address-cells = <1>;
#size-cells = <1>;
@@ -67,39 +39,6 @@
};
};
- ethernet@10100000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii1_pins &mdio_pins>;
- mediatek,portmap = "llllw";
-
- port@4 {
- status = "okay";
- phy-handle = <&phy4>;
- phy-mode = "rgmii";
- };
-
- port@5 {
- status = "okay";
- phy-handle = <&phy5>;
- phy-mode = "rgmii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy4: ethernet-phy@4 {
- reg = <4>;
- phy-mode = "rgmii";
- };
-
- phy5: ethernet-phy@5 {
- reg = <5>;
- phy-mode = "rgmii";
- };
- };
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -159,16 +98,75 @@
gpios = <&gpio0 13 0>;
};
};
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "rgmii2", "spi", "ephy";
+ ralink,function = "gpio";
+ };
+
+ uartf_gpio {
+ ralink,group = "uartf";
+ ralink,function = "gpio uartf";
+ };
+ };
+};
+
+&uart {
+ status = "okay";
+};
- gsw@10110000 {
- mediatek,port4 = "gmac";
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&ethernet {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii1_pins &mdio_pins>;
+ mediatek,portmap = "llllw";
+
+ port@4 {
+ status = "okay";
+ phy-handle = <&phy4>;
+ phy-mode = "rgmii";
};
- ehci@101c0000 {
+ port@5 {
status = "okay";
+ phy-handle = <&phy5>;
+ phy-mode = "rgmii";
};
- ohci@101c1000 {
+ mdio-bus {
status = "okay";
+
+ phy4: ethernet-phy@4 {
+ reg = <4>;
+ phy-mode = "rgmii";
+ };
+
+ phy5: ethernet-phy@5 {
+ reg = <5>;
+ phy-mode = "rgmii";
+ };
};
};
+
+&gsw {
+ mediatek,port4 = "gmac";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/NBG-419N.dts b/target/linux/ramips/dts/NBG-419N.dts
index d1ad8189ca..59ab665da7 100644
--- a/target/linux/ramips/dts/NBG-419N.dts
+++ b/target/linux/ramips/dts/NBG-419N.dts
@@ -6,15 +6,6 @@
compatible = "NBG-419N", "ralink,rt3052-soc";
model = "ZyXEL NBG-419N";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -92,3 +71,24 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/NCS601W.dts b/target/linux/ramips/dts/NCS601W.dts
index 65ef3c5a91..1942b0f908 100644
--- a/target/linux/ramips/dts/NCS601W.dts
+++ b/target/linux/ramips/dts/NCS601W.dts
@@ -5,71 +5,69 @@
/ {
compatible = "NCS601W", "ralink,rt5350-soc";
model = "Wansview NCS601W";
+};
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
+&spi0 {
+ status = "okay";
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
};
};
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
- ehci@101c0000 {
- status = "okay";
- };
+&ehci {
+ status = "okay";
+};
- ohci@101c1000 {
- status = "okay";
- };
+&ohci {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/NW718.dts b/target/linux/ramips/dts/NW718.dts
index ec8c017edb..06c6b0d62d 100644
--- a/target/linux/ramips/dts/NW718.dts
+++ b/target/linux/ramips/dts/NW718.dts
@@ -6,65 +6,6 @@
compatible = "NW718", "ralink,rt3050-soc";
model = "Netcore NW718";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <25000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "config";
- reg = <0x30000 0x20000>;
- read-only;
- };
-
- factory: partition@50000 {
- label = "factory";
- reg = <0x50000 0x10000>;
- read-only;
- };
-
- partition@60000 {
- label = "firmware";
- reg = <0x60000 0x3a0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -102,8 +43,65 @@
linux,code = <0x211>;
};
};
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <25000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "config";
+ reg = <0x30000 0x20000>;
+ read-only;
+ };
+
+ factory: partition@50000 {
+ label = "factory";
+ reg = <0x50000 0x10000>;
+ read-only;
+ };
+
+ partition@60000 {
+ label = "firmware";
+ reg = <0x60000 0x3a0000>;
+ };
+ };
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/OY-0001.dts b/target/linux/ramips/dts/OY-0001.dts
index facd8d02af..6bf1ad6be7 100644
--- a/target/linux/ramips/dts/OY-0001.dts
+++ b/target/linux/ramips/dts/OY-0001.dts
@@ -10,76 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
-
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mediatek,portmap = "llllw";
- };
-
- gsw@10110000 {
- mediatek,port4 = "ephy";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -94,22 +24,6 @@
};
};
- sdhci@10130000 {
- status = "okay";
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -123,3 +37,86 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mediatek,portmap = "llllw";
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&pcie {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/PBR-M1.dts b/target/linux/ramips/dts/PBR-M1.dts
index 9703a1bcb3..ac77cd5c6a 100644
--- a/target/linux/ramips/dts/PBR-M1.dts
+++ b/target/linux/ramips/dts/PBR-M1.dts
@@ -15,61 +15,8 @@
bootargs = "console=ttyS0,115200";
};
- sdhci@10130000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&sdhci_pins>;
- };
-
- xhci@1E1C0000 {
- status = "okay";
- };
-
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
-
- };
- };
-
- i2c@900 {
- compatible = "ralink,i2c-mt7621";
- reg = <0x900 0x100>;
- #address-cells = <1>;
- #size-cells = <0>;
- pinctrl-names = "default";
- pinctrl-0 = <&i2c_pins>;
+ palmbus: palmbus@1E000000 {
+ i2c: i2c@900 {
status = "okay";
pcf8563: rtc@51 {
@@ -80,32 +27,6 @@
};
};
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0000>;
- mediatek,5ghz = <0>;
- };
- };
- };
-
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0xe000>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -175,13 +96,87 @@
compatible = "gpio-beeper";
gpios = <&gpio0 26 1>;
};
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "wdt", "rgmii2", "jtag", "mdio";
- ralink,function = "gpio";
- };
+&sdhci {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdhci_pins>;
+};
+
+&xhci {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,5ghz = <0>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0xe000>;
+};
+
+
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wdt", "rgmii2", "jtag", "mdio";
+ ralink,function = "gpio";
};
};
};
diff --git a/target/linux/ramips/dts/PSG1208.dts b/target/linux/ramips/dts/PSG1208.dts
index 915aa10024..dc1adc4c73 100644
--- a/target/linux/ramips/dts/PSG1208.dts
+++ b/target/linux/ramips/dts/PSG1208.dts
@@ -6,85 +6,6 @@
compatible = "PSG1208", "ralink,mt7620a-soc";
model = "Phicomm PSG1208";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@20000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@30000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@40000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- pcie@10140000 {
- status = "okay";
-
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -112,3 +33,80 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@20000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@30000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/PSR-680W.dts b/target/linux/ramips/dts/PSR-680W.dts
index f8531e99b5..c4c4522afc 100644
--- a/target/linux/ramips/dts/PSR-680W.dts
+++ b/target/linux/ramips/dts/PSR-680W.dts
@@ -10,15 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -51,18 +42,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -84,8 +63,29 @@
linux,code = <0x198>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/PWH2004.dts b/target/linux/ramips/dts/PWH2004.dts
index 26cf58e770..51f43928f4 100644
--- a/target/linux/ramips/dts/PWH2004.dts
+++ b/target/linux/ramips/dts/PWH2004.dts
@@ -6,15 +6,6 @@
compatible = "PWH2004", "ralink,rt3052-soc";
model = "Prolink PWH2004";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -73,12 +64,21 @@
linux,code = <0x198>;
};
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
};
diff --git a/target/linux/ramips/dts/PX-4885-4M.dts b/target/linux/ramips/dts/PX-4885-4M.dts
index ddf7d7df1b..fb2b14cdc1 100644
--- a/target/linux/ramips/dts/PX-4885-4M.dts
+++ b/target/linux/ramips/dts/PX-4885-4M.dts
@@ -2,42 +2,38 @@
#include "PX-4885.dtsi"
-/ {
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
+&spi0 {
+ status = "okay";
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x20000>;
- read-only;
- };
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x20000>;
+ read-only;
+ };
- partition@20000 {
- label = "devdata";
- reg = <0x20000 0x20000>;
- read-only;
- };
+ partition@20000 {
+ label = "devdata";
+ reg = <0x20000 0x20000>;
+ read-only;
+ };
- factory: partition@40000 {
- label = "devconf";
- reg = <0x40000 0x10000>;
- read-only;
- };
+ factory: partition@40000 {
+ label = "devconf";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
};
};
};
diff --git a/target/linux/ramips/dts/PX-4885-8M.dts b/target/linux/ramips/dts/PX-4885-8M.dts
index 062e1b3258..6367a5eb2d 100644
--- a/target/linux/ramips/dts/PX-4885-8M.dts
+++ b/target/linux/ramips/dts/PX-4885-8M.dts
@@ -2,42 +2,38 @@
#include "PX-4885.dtsi"
-/ {
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
+&spi0 {
+ status = "okay";
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x20000>;
- read-only;
- };
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x20000>;
+ read-only;
+ };
- partition@20000 {
- label = "devdata";
- reg = <0x20000 0x20000>;
- read-only;
- };
+ partition@20000 {
+ label = "devdata";
+ reg = <0x20000 0x20000>;
+ read-only;
+ };
- factory: partition@40000 {
- label = "devconf";
- reg = <0x40000 0x10000>;
- read-only;
- };
+ factory: partition@40000 {
+ label = "devconf";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
};
};
};
diff --git a/target/linux/ramips/dts/PX-4885.dtsi b/target/linux/ramips/dts/PX-4885.dtsi
index 7d846afdb5..b135b5747b 100644
--- a/target/linux/ramips/dts/PX-4885.dtsi
+++ b/target/linux/ramips/dts/PX-4885.dtsi
@@ -4,27 +4,6 @@
compatible = "PX-4885", "ralink,rt5350-soc";
model = "7Links PX-4885";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -52,3 +31,24 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/RE6500.dts b/target/linux/ramips/dts/RE6500.dts
index 9887c2868b..39205c41ac 100644
--- a/target/linux/ramips/dts/RE6500.dts
+++ b/target/linux/ramips/dts/RE6500.dts
@@ -15,79 +15,6 @@
bootargs = "console=ttyS0,57600";
};
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uart2", "uart3", "rgmii2";
- ralink,function = "gpio";
- };
- };
- };
-
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0000>;
- mediatek,2ghz = <0>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,5ghz = <0>;
- };
- };
- };
-
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0x2e>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -121,3 +48,74 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uart2", "uart3", "rgmii2";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,5ghz = <0>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x2e>;
+};
diff --git a/target/linux/ramips/dts/RP-N53.dts b/target/linux/ramips/dts/RP-N53.dts
index cb0f28a533..c661be3a28 100644
--- a/target/linux/ramips/dts/RP-N53.dts
+++ b/target/linux/ramips/dts/RP-N53.dts
@@ -6,89 +6,6 @@
compatible = "asus,rp-n53", "ralink,mt7620a-soc";
model = "Asus RP-N53";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
-
- i2c@900 {
- status = "okay";
- };
-
- i2s@a00 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&pcm_i2s_pins>;
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
-
- pcm@2000 {
- status = "okay";
- };
-
- gdma@2800 {
- status = "okay";
- };
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "mdio", "rgmii1";
- ralink,function = "gpio";
- };
- };
- };
-
- gsw@10110000 {
- mediatek,port4 = "ephy";
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -164,3 +81,84 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&i2c {
+ status = "okay";
+};
+
+&i2s {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pcm_i2s_pins>;
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pcm {
+ status = "okay";
+};
+
+&gdma {
+ status = "okay";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "mdio", "rgmii1";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+};
+
+&pcie {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/RT-G32-B1.dts b/target/linux/ramips/dts/RT-G32-B1.dts
index 3f5c0c1135..ab8e3fdad3 100644
--- a/target/linux/ramips/dts/RT-G32-B1.dts
+++ b/target/linux/ramips/dts/RT-G32-B1.dts
@@ -6,65 +6,6 @@
compatible = "RT-G32-B1", "ralink,rt3050-soc";
model = "Asus RT-G32 B1";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "devdata";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- devconf: partition@40000 {
- label = "devconf";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&devconf 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&devconf 0>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -84,3 +25,60 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "devdata";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ devconf: partition@40000 {
+ label = "devconf";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&devconf 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&devconf 0>;
+};
diff --git a/target/linux/ramips/dts/RT-N10-PLUS.dts b/target/linux/ramips/dts/RT-N10-PLUS.dts
index 2ce6b598a7..43535d417b 100644
--- a/target/linux/ramips/dts/RT-N10-PLUS.dts
+++ b/target/linux/ramips/dts/RT-N10-PLUS.dts
@@ -38,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&devconf 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&devconf 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -78,3 +66,15 @@
};
};
};
+
+&ethernet {
+ mtd-mac-address = <&devconf 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&devconf 0>;
+};
diff --git a/target/linux/ramips/dts/RT-N13U.dts b/target/linux/ramips/dts/RT-N13U.dts
index 49a83149b6..14cff67855 100644
--- a/target/linux/ramips/dts/RT-N13U.dts
+++ b/target/linux/ramips/dts/RT-N13U.dts
@@ -6,15 +6,6 @@
compatible = "RT-N13U", "ralink,rt3052-soc";
model = "Asus RT-N13U";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -79,20 +70,29 @@
linux,code = <0x211>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
- otg@101c0000 {
- status = "okay";
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/RT-N14U.dts b/target/linux/ramips/dts/RT-N14U.dts
index 38ab1b13e0..05263e165d 100644
--- a/target/linux/ramips/dts/RT-N14U.dts
+++ b/target/linux/ramips/dts/RT-N14U.dts
@@ -6,78 +6,6 @@
compatible = "asus,rt-n14u", "ralink,mt7620n-soc";
model = "Asus RT-N14U";
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "ephy", "wled", "i2c";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -126,3 +54,73 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "ephy", "wled", "i2c";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/RT-N15.dts b/target/linux/ramips/dts/RT-N15.dts
index 638aba7413..d5bcbe3409 100644
--- a/target/linux/ramips/dts/RT-N15.dts
+++ b/target/linux/ramips/dts/RT-N15.dts
@@ -8,21 +8,6 @@
compatible = "RT-N15", "ralink,rt2880-soc";
model = "Asus RT-N15";
- palmbus@300000 {
- gpio0: gpio@600 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartlite", "mdio";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -55,34 +40,12 @@
};
};
- ethernet@400000 {
- status = "okay";
- mtd-mac-address = <&factory 0x4>;
-
- port@0 {
- mediatek,fixed-link = <1000 1 1 1>;
- };
-
- mdio-bus {
- status = "okay";
-
- phy0: ethernet-phy@0 {
- phy-mode = "mii";
- reg = <0>;
- };
- };
- };
-
rtl8366s {
compatible = "realtek,rtl8366s";
gpio-sda = <&gpio0 1 0>;
gpio-sck = <&gpio0 2 0>;
};
- wmac@480000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -111,3 +74,38 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartlite", "mdio";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x4>;
+
+ port@0 {
+ mediatek,fixed-link = <1000 1 1 1>;
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy0: ethernet-phy@0 {
+ phy-mode = "mii";
+ reg = <0>;
+ };
+ };
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/RT-N56U.dts b/target/linux/ramips/dts/RT-N56U.dts
index ce4ed70c69..d3a1f1bbfb 100644
--- a/target/linux/ramips/dts/RT-N56U.dts
+++ b/target/linux/ramips/dts/RT-N56U.dts
@@ -6,68 +6,6 @@
compatible = "RT-N56U", "ralink,rt3883-soc";
model = "Asus RT-N56U";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
-
- port@0 {
- mediatek,fixed-link = <1000 1 1 1>;
- };
- };
-
- pci@10140000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&pci_pins>;
-
- pci_pins: pci {
- pci {
- ralink,group = "pci";
- ralink,function = "pci-fnc";
- };
- };
-
- host-bridge {
- pci-bridge@1 {
- status = "okay";
-
- wmac@0,0 {
- compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
- reg = < 0x10000 0 0 0 0 >;
- ralink,eeprom = "rt2x00pci_1_0.eeprom";
- };
- };
- };
- };
-
- wmac@10180000 {
- status = "okay";
- ralink,2ghz = <0>;
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
nor-flash@1c000000 {
compatible = "cfi-flash";
reg = <0x1c000000 0x800000>;
@@ -149,3 +87,63 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+
+ port@0 {
+ mediatek,fixed-link = <1000 1 1 1>;
+ };
+};
+
+&pci {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pci_pins>;
+
+ pci_pins: pci {
+ pci {
+ ralink,group = "pci";
+ ralink,function = "pci-fnc";
+ };
+ };
+
+ host-bridge {
+ pci-bridge@1 {
+ status = "okay";
+
+ wmac@0,0 {
+ compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
+ reg = < 0x10000 0 0 0 0 >;
+ ralink,eeprom = "rt2x00pci_1_0.eeprom";
+ };
+ };
+ };
+};
+
+&wmac {
+ status = "okay";
+ ralink,2ghz = <0>;
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts b/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts
index f33451f659..6c45d7a56e 100644
--- a/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts
+++ b/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts
@@ -6,78 +6,6 @@
compatible = "RT5350F-OLINUXINO-EVB", "ralink,rt5350-soc";
model = "Olimex RT5350F-OLinuXino-EVB";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
-
- gpio1: gpio@660 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <0x17>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
@@ -100,3 +28,73 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <0x17>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dts b/target/linux/ramips/dts/RT5350F-OLINUXINO.dts
index 8c2ea5bc4f..e59b418121 100644
--- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dts
+++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dts
@@ -5,76 +5,74 @@
/ {
compatible = "RT5350F-OLINUXINO", "ralink,rt5350-soc";
model = "Olimex RT5350F-OLinuXino";
+};
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
+&spi0 {
+ status = "okay";
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
};
- gpio1: gpio@660 {
- status = "okay";
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
};
};
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
+&gpio1 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <0x17>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <0x17>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
- ehci@101c0000 {
- status = "okay";
- };
+&ehci {
+ status = "okay";
+};
- ohci@101c1000 {
- status = "okay";
- };
+&ohci {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/RUT5XX.dts b/target/linux/ramips/dts/RUT5XX.dts
index f70a04d04a..85c26d96be 100644
--- a/target/linux/ramips/dts/RUT5XX.dts
+++ b/target/linux/ramips/dts/RUT5XX.dts
@@ -6,65 +6,6 @@
compatible = "RUT5XX", "ralink,rt3050-soc";
model = "Teltonika RUT5XX";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "n25q128a13";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -86,8 +27,65 @@
linux,code = <0x198>;
};
};
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "n25q128a13";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/SAP-G3200U3.dts b/target/linux/ramips/dts/SAP-G3200U3.dts
index 343742b5dd..d6f2f30576 100644
--- a/target/linux/ramips/dts/SAP-G3200U3.dts
+++ b/target/linux/ramips/dts/SAP-G3200U3.dts
@@ -15,76 +15,6 @@
bootargs = "console=ttyS0,57600";
};
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x1000>;
- read-only;
- };
-
- partition@31000 {
- label = "config";
- reg = <0x31000 0xf000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0000>;
- mediatek,5ghz = <0>;
- };
- };
- };
-
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0xe006>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -112,13 +42,81 @@
linux,code = <0xf7>;
};
};
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x1000>;
+ read-only;
+ };
+
+ partition@31000 {
+ label = "config";
+ reg = <0x31000 0xf000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,5ghz = <0>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0xe006>;
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "uart3", "jtag";
- ralink,function = "gpio";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "uart3", "jtag";
+ ralink,function = "gpio";
};
};
};
diff --git a/target/linux/ramips/dts/SK-WB8.dts b/target/linux/ramips/dts/SK-WB8.dts
new file mode 100644
index 0000000000..1fed89e11e
--- /dev/null
+++ b/target/linux/ramips/dts/SK-WB8.dts
@@ -0,0 +1,124 @@
+/dts-v1/;
+
+#include "mt7621.dtsi"
+
+/ {
+ compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";
+ model = "SamKnows Whitebox 8";
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x8000000>;
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,57600";
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ wps {
+ label = "sk-wb8:green:wps";
+ gpios = <&gpio1 14 1>;
+ };
+
+ usb {
+ label = "sk-wb8:green:usb";
+ gpios = <&gpio1 15 1>;
+ };
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+ wps {
+ label = "wps";
+ gpios = <&gpio1 11 1>;
+ linux,code = <0x211>;
+ };
+ reset {
+ label = "reset";
+ gpios = <&gpio1 9 1>;
+ linux,code = <0x198>;
+ };
+ };
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+
+ partition@e30000 {
+ label = "recovery";
+ reg = <0xe30000 0x1d0000>;
+ };
+
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,5ghz = <0>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0xe000>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/SL-R7205.dts b/target/linux/ramips/dts/SL-R7205.dts
index 0b09665495..f5884fbecd 100644
--- a/target/linux/ramips/dts/SL-R7205.dts
+++ b/target/linux/ramips/dts/SL-R7205.dts
@@ -6,15 +6,6 @@
compatible = "SL-R7205", "ralink,rt3052-soc";
model = "Skyline SL-R7205 Wireless 3G Router";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -86,8 +65,29 @@
linux,code = <0x211>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/TEW-691GR.dts b/target/linux/ramips/dts/TEW-691GR.dts
index 73e342278d..750c24fbe9 100644
--- a/target/linux/ramips/dts/TEW-691GR.dts
+++ b/target/linux/ramips/dts/TEW-691GR.dts
@@ -6,42 +6,6 @@
compatible = "TEW-691GR", "ralink,rt3883-soc";
model = "TRENDnet TEW-691GR";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
-
- port@0 {
- phy-handle = <&phy0>;
- phy-mode = "rgmii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy0: ethernet-phy@0 {
- reg = <0>;
- };
- };
- };
-
- wmac@10180000 {
- ralink,5ghz = <0>;
- };
-
nor-flash@1c000000 {
compatible = "cfi-flash";
reg = <0x1c000000 0x800000>;
@@ -107,3 +71,37 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+
+ port@0 {
+ phy-handle = <&phy0>;
+ phy-mode = "rgmii";
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ };
+ };
+};
+
+&wmac {
+ ralink,5ghz = <0>;
+};
diff --git a/target/linux/ramips/dts/TEW-692GR.dts b/target/linux/ramips/dts/TEW-692GR.dts
index 760ea83125..5bba8a50b8 100644
--- a/target/linux/ramips/dts/TEW-692GR.dts
+++ b/target/linux/ramips/dts/TEW-692GR.dts
@@ -6,62 +6,6 @@
compatible = "TEW-692GR", "ralink,rt3883-soc";
model = "TRENDnet TEW-692GR";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- status = "okay";
- mtd-mac-address = <&factory 0x28>;
-
- port@0 {
- phy-handle = <&phy0>;
- phy-mode = "rgmii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy0: ethernet-phy@0 {
- reg = <0>;
- };
- };
- };
-
- pci@10140000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&pci_pins>;
-
- pci_pins: pci {
- pci {
- ralink,group = "pci";
- ralink,function = "pci-fnc";
- };
- };
-
- host-bridge {
- pci-bridge@1 {
- status = "okay";
- };
- };
- };
-
- wmac@10180000 {
- ralink,5ghz = <0>;
- };
-
nor-flash@1c000000 {
compatible = "cfi-flash";
reg = <0x1c000000 0x800000>;
@@ -126,3 +70,57 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x28>;
+
+ port@0 {
+ phy-handle = <&phy0>;
+ phy-mode = "rgmii";
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ };
+ };
+};
+
+&pci {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pci_pins>;
+
+ pci_pins: pci {
+ pci {
+ ralink,group = "pci";
+ ralink,function = "pci-fnc";
+ };
+ };
+
+ host-bridge {
+ pci-bridge@1 {
+ status = "okay";
+ };
+ };
+};
+
+&wmac {
+ ralink,5ghz = <0>;
+};
diff --git a/target/linux/ramips/dts/TINY-AC.dts b/target/linux/ramips/dts/TINY-AC.dts
index c1ad65a728..6a21247767 100644
--- a/target/linux/ramips/dts/TINY-AC.dts
+++ b/target/linux/ramips/dts/TINY-AC.dts
@@ -10,120 +10,6 @@
bootargs = "console=ttyS0,57600";
};
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
- mediatek,portmap = "llllw";
-
- port@4 {
- status = "okay";
- phy-mode = "rgmii";
- phy-handle = <&phy4>;
- };
-
- port@5 {
- status = "okay";
- phy-mode = "rgmii";
- phy-handle = <&phy5>;
- };
-
- mdio-bus {
- status = "okay";
-
- phy4: ethernet-phy@4 {
- reg = <4>;
- phy-mode = "rgmii";
- };
-
- phy5: ethernet-phy@5 {
- reg = <5>;
- phy-mode = "rgmii";
- };
- };
- };
-
- gsw@10110000 {
- mediatek,port4 = "gmac";
- mediatek,mt7530 = <1>;
-
- };
-
- wmac@10180000 {
- ralink,eeprom = "rt2x00pci_1_0.eeprom";
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "uartf", "nd_sd", "wled";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -164,3 +50,114 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+ mediatek,portmap = "llllw";
+
+ port@4 {
+ status = "okay";
+ phy-mode = "rgmii";
+ phy-handle = <&phy4>;
+ };
+
+ port@5 {
+ status = "okay";
+ phy-mode = "rgmii";
+ phy-handle = <&phy5>;
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy4: ethernet-phy@4 {
+ reg = <4>;
+ phy-mode = "rgmii";
+ };
+
+ phy5: ethernet-phy@5 {
+ reg = <5>;
+ phy-mode = "rgmii";
+ };
+ };
+};
+
+&gsw {
+ mediatek,port4 = "gmac";
+ mediatek,mt7530 = <1>;
+};
+
+&wmac {
+ ralink,eeprom = "rt2x00pci_1_0.eeprom";
+};
+
+&pcie {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "uartf", "nd_sd", "wled";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/UBNT-ERX.dts b/target/linux/ramips/dts/UBNT-ERX.dts
index ec31a37f0b..713519d5d9 100644
--- a/target/linux/ramips/dts/UBNT-ERX.dts
+++ b/target/linux/ramips/dts/UBNT-ERX.dts
@@ -17,30 +17,6 @@
bootargs = "console=ttyS0,57600";
};
- palmbus@1E000000 {
- spi@b00 {
- /* This board has 2Mb spi flash soldered in and visible
- from manufacturer's firmware.
- But this SoC shares spi and nand pins,
- and current driver does't handle this sharing well */
- status = "disabled";
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <1>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "spi";
- reg = <0x0 0x200000>;
- read-only;
- };
- };
- };
- };
-
nand@1e003000 {
status = "okay";
@@ -78,27 +54,6 @@
};
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0x22>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "uart2", "uart3", "i2c", "pcie", "rgmii2", "jtag";
- ralink,function = "gpio";
- };
- };
- };
-
- sdhci@1E130000 {
- status = "disabled";
- };
-
- pcie@1e140000 {
- status = "disabled";
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -112,3 +67,46 @@
};
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x22>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "uart2", "uart3", "i2c", "pcie", "rgmii2", "jtag";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&sdhci {
+ status = "disabled";
+};
+
+&pcie {
+ status = "disabled";
+};
+
+&spi0 {
+ /* This board has 2Mb spi flash soldered in and visible
+ from manufacturer's firmware.
+ But this SoC shares spi and nand pins,
+ and current driver does't handle this sharing well */
+ status = "disabled";
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <1>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "spi";
+ reg = <0x0 0x200000>;
+ read-only;
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/UR-326N4G.dts b/target/linux/ramips/dts/UR-326N4G.dts
index 4e64783005..d90d77c061 100644
--- a/target/linux/ramips/dts/UR-326N4G.dts
+++ b/target/linux/ramips/dts/UR-326N4G.dts
@@ -6,15 +6,6 @@
compatible = "UR-326N4G", "ralink,rt3052-soc";
model = "UPVEL UR-326N4G";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4004>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -106,8 +85,29 @@
linux,code = <0x32>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4004>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/UR-336UN.dts b/target/linux/ramips/dts/UR-336UN.dts
index 869e4311d6..e0325a7c56 100644
--- a/target/linux/ramips/dts/UR-336UN.dts
+++ b/target/linux/ramips/dts/UR-336UN.dts
@@ -6,15 +6,6 @@
compatible = "UR-336UN", "ralink,rt3052-soc";
model = "UPVEL UR-336UN";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -24,20 +15,6 @@
#size-cells = <1>;
};
- /* FIXME: no partitions defined */
-/* ethernet@10100000 {
- mtd-mac-address = <&factory 0x4004>;
- };
-*/
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- /* FIXME: no partitions defined */
-/* wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-*/
gpio-leds {
compatible = "gpio-leds";
@@ -85,8 +62,31 @@
linux,code = <0x32>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+/* FIXME: no partitions defined */
+/*&ethernet {
+ mtd-mac-address = <&factory 0x4004>;
+};
+*/
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+/* FIXME: no partitions defined */
+/*&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+*/
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/V11STFE.dts b/target/linux/ramips/dts/V11STFE.dts
index 9cf3300ba0..6f7a5cbdfd 100644
--- a/target/linux/ramips/dts/V11STFE.dts
+++ b/target/linux/ramips/dts/V11STFE.dts
@@ -6,21 +6,7 @@
compatible = "V11ST-FE", "ralink,rt2880-soc";
model = "Ralink V11ST-FE";
- palmbus@300000 {
- gpio0: gpio@600 {
- status = "okay";
- };
- };
-
- ethernet@400000 {
- status = "okay";
- };
-
- wmac@480000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pci@10140000 {
+ pci@440000 {
status = "okay";
host-bridge {
@@ -83,3 +69,15 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&ethernet {
+ status = "okay";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/V22RW-2X2.dts b/target/linux/ramips/dts/V22RW-2X2.dts
index 8b4325a09a..602e170e60 100644
--- a/target/linux/ramips/dts/V22RW-2X2.dts
+++ b/target/linux/ramips/dts/V22RW-2X2.dts
@@ -6,15 +6,6 @@
compatible = "V22RW-2X2", "ralink,rt3052-soc";
model = "Ralink AP-RT3052-V22RW-2X2";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,14 +38,6 @@
};
};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -87,8 +70,25 @@
linux,code = <0x211>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/VOCORE.dtsi b/target/linux/ramips/dts/VOCORE.dtsi
index df4461a56f..bb8a458831 100644
--- a/target/linux/ramips/dts/VOCORE.dtsi
+++ b/target/linux/ramips/dts/VOCORE.dtsi
@@ -4,45 +4,6 @@
compatible = "VoCore", "ralink,rt5350-soc";
model = "VoCore";
- palmbus@10000000 {
- gpio1: gpio@660 {
- status = "okay";
- };
-
- i2c@900 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "jtag", "uartf", "led";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x17>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-export {
compatible = "gpio-export";
#size-cells = <0>;
@@ -186,6 +147,44 @@
};
};
+&gpio1 {
+ status = "okay";
+};
+
+&i2c {
+ status = "okay";
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "jtag", "uartf", "led";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x11>;
+ mediatek,portdisable = <0x2e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
&spi1 {
status = "okay";
diff --git a/target/linux/ramips/dts/W150M.dts b/target/linux/ramips/dts/W150M.dts
index e336f70245..679db60af4 100644
--- a/target/linux/ramips/dts/W150M.dts
+++ b/target/linux/ramips/dts/W150M.dts
@@ -6,15 +6,6 @@
compatible = "W150M", "ralink,rt3050-soc";
model = "Tenda W150M";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -99,16 +90,25 @@
linux,code = <0x100>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
};
diff --git a/target/linux/ramips/dts/W306R_V20.dts b/target/linux/ramips/dts/W306R_V20.dts
index 421dea046c..79ae23dd63 100644
--- a/target/linux/ramips/dts/W306R_V20.dts
+++ b/target/linux/ramips/dts/W306R_V20.dts
@@ -38,27 +38,6 @@
};
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -86,3 +65,24 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/W502U.dts b/target/linux/ramips/dts/W502U.dts
index e95cf53d32..739817022b 100644
--- a/target/linux/ramips/dts/W502U.dts
+++ b/target/linux/ramips/dts/W502U.dts
@@ -10,15 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -51,18 +42,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -95,8 +74,29 @@
linux,code = <0x211>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WCR150GN.dts b/target/linux/ramips/dts/WCR150GN.dts
index 71134a3b20..541836b218 100644
--- a/target/linux/ramips/dts/WCR150GN.dts
+++ b/target/linux/ramips/dts/WCR150GN.dts
@@ -6,15 +6,6 @@
compatible = "WCR150GN", "ralink,rt3050-soc";
model = "Sparklan WCR-150GN";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -79,20 +70,29 @@
linux,code = <0x198>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
- otg@101c0000 {
- status = "okay";
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/WF-2881.dts b/target/linux/ramips/dts/WF-2881.dts
index d33436c64a..050bc2e7cc 100644
--- a/target/linux/ramips/dts/WF-2881.dts
+++ b/target/linux/ramips/dts/WF-2881.dts
@@ -11,12 +11,6 @@
reg = <0x0 0x8000000>;
};
- palmbus@1E000000 {
- spi@b00 {
- status="disabled";
- };
- };
-
chosen {
bootargs = "console=ttyS0,57600";
};
@@ -54,32 +48,6 @@
};
};
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0000>;
- mediatek,5ghz = <0>;
- };
- };
- };
-
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0xe006>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -106,13 +74,43 @@
linux,code = <0x198>;
};
};
+};
+
+&spi0 {
+ status="disabled";
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,5ghz = <0>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0xe006>;
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "uart3", "jtag";
- ralink,function = "gpio";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "uart3", "jtag";
+ ralink,function = "gpio";
};
};
};
diff --git a/target/linux/ramips/dts/WHR-1166D.dts b/target/linux/ramips/dts/WHR-1166D.dts
index 5a523b7d73..0c0f62728c 100644
--- a/target/linux/ramips/dts/WHR-1166D.dts
+++ b/target/linux/ramips/dts/WHR-1166D.dts
@@ -6,98 +6,6 @@
compatible = "ralink,mt7620a-soc";
model = "Buffalo WHR-1166D";
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf", "wled", "nd_sd";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii1_pins &mdio_pins>;
-
- port@5 {
- status = "okay";
- phy-handle = <&phy5>;
- phy-mode = "rgmii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy5: ethernet-phy@5 {
- reg = <5>;
- phy-mode = "rgmii";
- };
- };
- };
-
- gsw@10110000 {
- mediatek,port4 = "ephy";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
-
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 32768>;
- mediatek,2ghz = <0>;
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -170,3 +78,93 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii1_pins &mdio_pins>;
+
+ port@5 {
+ status = "okay";
+ phy-handle = <&phy5>;
+ phy-mode = "rgmii";
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy5: ethernet-phy@5 {
+ reg = <5>;
+ phy-mode = "rgmii";
+ };
+ };
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 32768>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/WHR-300HP2.dts b/target/linux/ramips/dts/WHR-300HP2.dts
index 89ae89e343..acd4ce47e5 100644
--- a/target/linux/ramips/dts/WHR-300HP2.dts
+++ b/target/linux/ramips/dts/WHR-300HP2.dts
@@ -6,76 +6,6 @@
compatible = "ralink,mt7620a-soc";
model = "Buffalo WHR-300HP2";
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
- ralink,function = "gpio";
- };
-
- pa {
- ralink,group = "pa";
- ralink,function = "pa";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mediatek,portmap = "llllw";
- };
-
- gsw@10110000 {
- mediatek,port4 = "ephy";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -148,3 +78,71 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+
+ pa {
+ ralink,group = "pa";
+ ralink,function = "pa";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mediatek,portmap = "llllw";
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/WHR-600D.dts b/target/linux/ramips/dts/WHR-600D.dts
index e3d94c0aab..7d26f32b97 100644
--- a/target/linux/ramips/dts/WHR-600D.dts
+++ b/target/linux/ramips/dts/WHR-600D.dts
@@ -6,76 +6,6 @@
compatible = "ralink,mt7620a-soc";
model = "Buffalo WHR-600D";
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l6405d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- gsw@10110000 {
- mediatek,port4 = "ephy";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pcie@10140000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -148,3 +78,71 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l6405d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&gsw {
+ mediatek,port4 = "ephy";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WHR-G300N.dts b/target/linux/ramips/dts/WHR-G300N.dts
index e3eee41ceb..4f80f2db1a 100644
--- a/target/linux/ramips/dts/WHR-G300N.dts
+++ b/target/linux/ramips/dts/WHR-G300N.dts
@@ -6,15 +6,6 @@
compatible = "WHR-G300N", "ralink,rt3052-soc";
model = "Buffalo WHR-G300N";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -24,15 +15,6 @@
#size-cells = <1>;
};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- /* FIXME: no partitions defined */
-/* wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-*/
gpio-leds {
compatible = "gpio-leds";
@@ -83,3 +65,22 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+/* FIXME: no partitions defined */
+/*&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+*/
diff --git a/target/linux/ramips/dts/WIDORA-NEO.dts b/target/linux/ramips/dts/WIDORA-NEO.dts
new file mode 100644
index 0000000000..406b5ca099
--- /dev/null
+++ b/target/linux/ramips/dts/WIDORA-NEO.dts
@@ -0,0 +1,169 @@
+/dts-v1/;
+
+#include "mt7628an.dtsi"
+
+/ {
+ compatible = "mediatek,widora-neo", "mediatek,mt7628an-soc";
+ model = "Widora-NEO";
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x8000000>;
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ wifi {
+ label = "widora:orange:wifi";
+ gpios = <&wgpio 0 0>;
+ default-state = "on";
+ };
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+
+ wps {
+ label = "reset";
+ gpios = <&gpio1 6 1>;
+ linux,code = <0x211>;
+ };
+ };
+
+ wgpio: gpio-wifi {
+ compatible = "mediatek,gpio-wifi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "gpio";
+ ralink,function = "gpio";
+ };
+
+ perst {
+ ralink,group = "perst";
+ ralink,function = "gpio";
+ };
+
+ refclk {
+ ralink,group = "refclk";
+ ralink,function = "gpio";
+ };
+
+ i2s {
+ ralink,group = "i2s";
+ ralink,function = "gpio";
+ };
+
+ spis {
+ ralink,group = "spis";
+ ralink,function = "gpio";
+ };
+
+ wled_kn {
+ ralink,group = "wled_kn";
+ ralink,function = "gpio";
+ };
+
+ wled_an {
+ ralink,group = "wled_an";
+ ralink,function = "wled_an";
+ };
+
+ wdt {
+ ralink,group = "wdt";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+
+&spi0 {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <40000000>;
+ m25p,chunked-io = <31>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x0fb0000>;
+ };
+ };
+
+ spidev@1 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "linux,spidev";
+ reg = <1>;
+ spi-max-frequency = <40000000>;
+ };
+};
+
+&i2c {
+ status = "okay";
+};
+
+&uart1 {
+ status = "okay";
+};
+
+&uart2 {
+ status = "okay";
+};
+
+&pwm {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&sdhci {
+ status = "okay";
+ mediatek,cd-low;
+};
+
+&wmac {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WITI.dts b/target/linux/ramips/dts/WITI.dts
index 78e2bc9602..bffd4ff7a9 100644
--- a/target/linux/ramips/dts/WITI.dts
+++ b/target/linux/ramips/dts/WITI.dts
@@ -15,57 +15,8 @@
bootargs = "console=ttyS0,57600";
};
- sdhci@10130000 {
- status = "okay";
- };
-
- xhci@1E1C0000 {
- status = "okay";
- };
-
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
-
+ palmbus: palmbus@1E000000 {
i2c@900 {
- compatible = "ralink,i2c-mt7621";
- reg = <0x900 0x100>;
- #address-cells = <1>;
- #size-cells = <0>;
- pinctrl-names = "default";
- pinctrl-0 = <&i2c_pins>;
status = "okay";
pcf8563: rtc@51 {
@@ -76,34 +27,6 @@
};
};
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- mtd-mac-address = <&factory 0xe000>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0000>;
- mediatek,5ghz = <0>;
- mtd-mac-address = <&factory 0xe000>;
- };
- };
- };
-
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0xe000>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -116,13 +39,85 @@
linux,code = <0x198>;
};
};
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "wdt", "rgmii2", "jtag", "mdio";
- ralink,function = "gpio";
- };
+
+&sdhci {
+ status = "okay";
+};
+
+&xhci {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ mtd-mac-address = <&factory 0xe000>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,5ghz = <0>;
+ mtd-mac-address = <&factory 0xe000>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0xe000>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wdt", "rgmii2", "jtag", "mdio";
+ ralink,function = "gpio";
};
};
};
diff --git a/target/linux/ramips/dts/WIZARD8800.dts b/target/linux/ramips/dts/WIZARD8800.dts
index 7e9efe1f6e..bbfa61085d 100644
--- a/target/linux/ramips/dts/WIZARD8800.dts
+++ b/target/linux/ramips/dts/WIZARD8800.dts
@@ -5,79 +5,77 @@
/ {
compatible = "WIZARD8800", "ralink,rt5350-soc";
model = "EASYACC WI-STOR WIZARD 8800";
+};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
- palmbus@10000000 {
- gpio1@638 {
- status = "okay";
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q32";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
};
- gpio2@660 {
- status = "okay";
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
};
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q32";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
};
- };
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
+};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- ehci@101c0000 {
- status = "okay";
- };
+&esw {
+ mediatek,portmap = <0x2f>;
+};
- ohci@101c1000 {
- status = "okay";
- };
+&ehci {
+ status = "okay";
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&ohci {
+ status = "okay";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
};
diff --git a/target/linux/ramips/dts/WIZFI630A.dts b/target/linux/ramips/dts/WIZFI630A.dts
index 11b44b4f72..0f7ede54df 100644
--- a/target/linux/ramips/dts/WIZFI630A.dts
+++ b/target/linux/ramips/dts/WIZFI630A.dts
@@ -10,116 +10,6 @@
bootargs = "console=ttyS1,115200";
};
- palmbus@10000000 {
- gpio1: gpio@660 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "uboot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "uboot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
-
- uart@500 {
- compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
- reg = <0x500 0x100>;
- resets = <&rstctrl 12>;
- reset-names = "uart";
- interrupt-parent = <&intc>;
- interrupts = <5>;
- reg-shift = <2>;
- pinctrl-names = "default";
- pinctrl-0 = <&uartf_pins>;
- status = "okay";
- };
-
- uartlite@c00 {
- compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
- reg = <0xc00 0x100>;
- resets = <&rstctrl 19>;
- reset-names = "uartl";
- interrupt-parent = <&intc>;
- interrupts = <12>;
- reg-shift = <2>;
- pinctrl-names = "default";
- pinctrl-0 = <&uartlite_pins>;
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag" ;
- ralink,function = "gpio";
- };
- };
-
- uartf_gpio_pins: uartf_gpio {
- uartf_gpio {
- ralink,group = "uartf";
- ralink,function = "uartf";
- };
- };
-
- uartlite_pins: uartlite {
- uart {
- ralink,group = "uartlite";
- ralink,function = "uartlite";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x17>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-export {
compatible = "gpio-export";
#size-cells = <0>;
@@ -180,3 +70,115 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ #size-cells = <1>;
+ label = "uboot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ #size-cells = <1>;
+ label = "uboot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ #size-cells = <1>;
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ #size-cells = <1>;
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&uart {
+ compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+ reg = <0x500 0x100>;
+ resets = <&rstctrl 12>;
+ reset-names = "uart";
+ interrupt-parent = <&intc>;
+ interrupts = <5>;
+ reg-shift = <2>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&uartf_pins>;
+ status = "okay";
+};
+
+&uartlite {
+ compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+ reg = <0xc00 0x100>;
+ resets = <&rstctrl 19>;
+ reset-names = "uartl";
+ interrupt-parent = <&intc>;
+ interrupts = <12>;
+ reg-shift = <2>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&uartlite_pins>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag" ;
+ ralink,function = "gpio";
+ };
+ };
+
+ uartf_gpio_pins: uartf_gpio {
+ uartf_gpio {
+ ralink,group = "uartf";
+ ralink,function = "uartf";
+ };
+ };
+
+ uartlite_pins: uartlite {
+ uart {
+ ralink,group = "uartlite";
+ ralink,function = "uartlite";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x17>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WL-330N.dts b/target/linux/ramips/dts/WL-330N.dts
index 00563d46c2..d3cd74b2ab 100644
--- a/target/linux/ramips/dts/WL-330N.dts
+++ b/target/linux/ramips/dts/WL-330N.dts
@@ -6,65 +6,6 @@
compatible = "WL-330N", "ralink,rt3050-soc";
model = "Asus WL-330N";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -98,3 +39,60 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/WL-330N3G.dts b/target/linux/ramips/dts/WL-330N3G.dts
index f38496ecb8..9290673419 100644
--- a/target/linux/ramips/dts/WL-330N3G.dts
+++ b/target/linux/ramips/dts/WL-330N3G.dts
@@ -6,65 +6,6 @@
compatible = "WL-330N3G", "ralink,rt3050-soc";
model = "Asus WL-330N3G";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -102,8 +43,65 @@
linux,code = <0x198>;
};
};
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WL-341V3.dts b/target/linux/ramips/dts/WL-341V3.dts
index 47226b47d9..5f9e1dd924 100644
--- a/target/linux/ramips/dts/WL-341V3.dts
+++ b/target/linux/ramips/dts/WL-341V3.dts
@@ -38,27 +38,6 @@
};
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&boardnvram 0xffa0>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&boardnvram 0xfd70>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -116,8 +95,29 @@
linux,code = <0x211>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&boardnvram 0xffa0>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&boardnvram 0xfd70>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WL-351.dts b/target/linux/ramips/dts/WL-351.dts
index 605c73b460..ecda696732 100644
--- a/target/linux/ramips/dts/WL-351.dts
+++ b/target/linux/ramips/dts/WL-351.dts
@@ -6,15 +6,6 @@
compatible = "WL-351", "ralink,rt3052-soc";
model = "Sitecom WL-351 v1 002";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,30 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3f>;
- ralink,fct2 = <0x0002500c>;
- /*
- * ext phy base addr 31, rx/tx clock skew 0,
- * turbo mii off, rgmi 3.3v off, port 5 polling off
- * port5: enabled, gige, full-duplex, rx/tx-flow-control
- * port6: enabled, gige, full-duplex, rx/tx-flow-control
- */
- ralink,fpa2 = <0x1f003fff>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- otg@101c0000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -115,3 +82,36 @@
gpio-sck = <&gpio0 2 0>;
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x3f>;
+ ralink,fct2 = <0x0002500c>;
+ /*
+ * ext phy base addr 31, rx/tx clock skew 0,
+ * turbo mii off, rgmi 3.3v off, port 5 polling off
+ * port5: enabled, gige, full-duplex, rx/tx-flow-control
+ * port6: enabled, gige, full-duplex, rx/tx-flow-control
+ */
+ ralink,fpa2 = <0x1f003fff>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WLI-TX4-AG300N.dts b/target/linux/ramips/dts/WLI-TX4-AG300N.dts
index ca0e125d73..70521a71ed 100644
--- a/target/linux/ramips/dts/WLI-TX4-AG300N.dts
+++ b/target/linux/ramips/dts/WLI-TX4-AG300N.dts
@@ -8,12 +8,6 @@
compatible = "WLI-TX4-AG300N", "ralink,rt2880-soc";
model = "Buffalo WLI-TX4-AG300N";
- palmbus@300000 {
- gpio0: gpio@600 {
- status = "okay";
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -46,19 +40,6 @@
};
};
- ethernet@400000 {
- status = "okay";
- mtd-mac-address = <&factory 0x4>;
-
- port@0 {
- mediatek,fixed-link = <1000 1 1 1>;
- };
- };
-
- wmac@480000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -103,3 +84,20 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x4>;
+
+ port@0 {
+ mediatek,fixed-link = <1000 1 1 1>;
+ };
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/WMR-300.dts b/target/linux/ramips/dts/WMR-300.dts
index 8ea16d27da..02fbdc598a 100644
--- a/target/linux/ramips/dts/WMR-300.dts
+++ b/target/linux/ramips/dts/WMR-300.dts
@@ -6,66 +6,6 @@
compatible = "buffalo,wmr-300", "ralink,mt7620n-soc";
model = "Buffalo WMR-300";
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "i2c", "ephy";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -104,3 +44,61 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "i2c", "ephy";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/WNCE2001.dts b/target/linux/ramips/dts/WNCE2001.dts
index 02acba5771..2dc39ce142 100644
--- a/target/linux/ramips/dts/WNCE2001.dts
+++ b/target/linux/ramips/dts/WNCE2001.dts
@@ -10,78 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l3205d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- factory: partition@30000 {
- label = "factory";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- partition@40000 {
- label = "config";
- reg = <0x40000 0x20000>;
- read-only;
- };
-
- partition@60000 {
- label = "language";
- reg = <0x60000 0x30000>;
- read-only;
- };
-
- partition@90000 {
- label = "pot";
- reg = <0x90000 0x10000>;
- read-only;
- };
-
- partition@a0000 {
- label = "checksum";
- reg = <0xa0000 0x10000>;
- };
-
- partition@b0000 {
- label = "firmware";
- reg = <0xb0000 0x350000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -137,3 +65,73 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l3205d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ factory: partition@30000 {
+ label = "factory";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "config";
+ reg = <0x40000 0x20000>;
+ read-only;
+ };
+
+ partition@60000 {
+ label = "language";
+ reg = <0x60000 0x30000>;
+ read-only;
+ };
+
+ partition@90000 {
+ label = "pot";
+ reg = <0x90000 0x10000>;
+ read-only;
+ };
+
+ partition@a0000 {
+ label = "checksum";
+ reg = <0xa0000 0x10000>;
+ };
+
+ partition@b0000 {
+ label = "firmware";
+ reg = <0xb0000 0x350000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/WNDR3700V5.dts b/target/linux/ramips/dts/WNDR3700V5.dts
index 7b208490f5..9d3d0d5396 100644
--- a/target/linux/ramips/dts/WNDR3700V5.dts
+++ b/target/linux/ramips/dts/WNDR3700V5.dts
@@ -15,78 +15,6 @@
bootargs = "console=ttyS0,57600 maxcpus=2";
};
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "mx25l12805d";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@f30000 {
- label = "factory";
- reg = <0xf30000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
- };
-
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0004>;
- mediatek,2ghz = <0>;
- };
- };
-
- pcie2 {
- mt76@2,0 {
- reg = <0x1000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8004>;
- mediatek,5ghz = <0>;
- };
- };
- };
-
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0x0000000c>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "rgmii2", "mdio", "wdt";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -137,3 +65,73 @@
};
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "mx25l12805d";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@f30000 {
+ label = "factory";
+ reg = <0xf30000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0004>;
+ mediatek,2ghz = <0>;
+ };
+ };
+
+ pcie2 {
+ mt76@2,0 {
+ reg = <0x1000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8004>;
+ mediatek,5ghz = <0>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x0000000c>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "rgmii2", "mdio", "wdt";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/WR512-3GN-4M.dts b/target/linux/ramips/dts/WR512-3GN-4M.dts
index 884ffa781b..45e1463bf0 100644
--- a/target/linux/ramips/dts/WR512-3GN-4M.dts
+++ b/target/linux/ramips/dts/WR512-3GN-4M.dts
@@ -6,15 +6,6 @@
compatible = "WR512-3GN", "ralink,rt3052-soc";
model = "WR512-3GN-like router";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,14 +38,6 @@
};
};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -102,8 +85,25 @@
linux,code = <0x32>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WR512-3GN-8M.dts b/target/linux/ramips/dts/WR512-3GN-8M.dts
index 15cb018c44..7e9a0c25ed 100644
--- a/target/linux/ramips/dts/WR512-3GN-8M.dts
+++ b/target/linux/ramips/dts/WR512-3GN-8M.dts
@@ -6,15 +6,6 @@
compatible = "WR512-3GN", "ralink,rt3052-soc";
model = "WR512-3GN-like router";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,14 +38,6 @@
};
};
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -102,8 +85,25 @@
linux,code = <0x32>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WR6202.dts b/target/linux/ramips/dts/WR6202.dts
index 49f934d40c..534d78d3fa 100644
--- a/target/linux/ramips/dts/WR6202.dts
+++ b/target/linux/ramips/dts/WR6202.dts
@@ -10,15 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -84,22 +75,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- otg@101c0000 {
- status = "okay";
- };
-
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
@@ -111,3 +86,28 @@
};
};
};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WRH-300CR.dts b/target/linux/ramips/dts/WRH-300CR.dts
index 6e8de7fdba..aece2e6884 100644
--- a/target/linux/ramips/dts/WRH-300CR.dts
+++ b/target/linux/ramips/dts/WRH-300CR.dts
@@ -6,88 +6,7 @@
compatible = "elecom,wrh-300cr", "ralink,mt7620n-soc";
model = "ELECOM WRH-300CR";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "mx25l12805d";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "recover";
- reg = <0x50000 0x1c0000>;
- read-only;
- };
-
- partition@210000 {
- label = "firmware";
- reg = <0x210000 0xdf0000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x2e>;
- mediatek,portmap = "llllw";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "i2c", "ephy", "wled";
- ralink,function = "gpio";
- };
- };
- };
-
- gpio-leds {
+ gpio-leds {
compatible = "gpio-leds";
wps {
@@ -125,3 +44,82 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l12805d";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "recover";
+ reg = <0x50000 0x1c0000>;
+ read-only;
+ };
+
+ partition@210000 {
+ label = "firmware";
+ reg = <0x210000 0xdf0000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x2e>;
+ mediatek,portmap = "llllw";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "i2c", "ephy", "wled";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/WRTNODE.dts b/target/linux/ramips/dts/WRTNODE.dts
index 15ff019718..04f5836d0a 100644
--- a/target/linux/ramips/dts/WRTNODE.dts
+++ b/target/linux/ramips/dts/WRTNODE.dts
@@ -6,88 +6,86 @@
compatible = "wrtnode", "ralink,mt7620n-soc";
model = "WRTNODE";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
+ gpio-leds {
+ compatible = "gpio-leds";
- gpio2: gpio@660 {
- status = "okay";
+ indicator {
+ label = "wrtnode:blue:indicator";
+ gpios = <&gpio1 14 1>;
};
+ };
+};
- gpio3: gpio@688 {
- status = "okay";
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
};
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
};
- };
- ehci@101c0000 {
- status = "okay";
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- ohci@101c1000 {
- status = "okay";
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
+&ehci {
+ status = "okay";
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&ohci {
+ status = "okay";
+};
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf", "spi refclk";
- ralink,function = "gpio";
- };
- };
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
- gpio-leds {
- compatible = "gpio-leds";
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
- indicator {
- label = "wrtnode:blue:indicator";
- gpios = <&gpio1 14 1>;
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf", "spi refclk";
+ ralink,function = "gpio";
};
};
};
diff --git a/target/linux/ramips/dts/WRTNODE2.dtsi b/target/linux/ramips/dts/WRTNODE2.dtsi
index 118cfe9671..0242314dfb 100644
--- a/target/linux/ramips/dts/WRTNODE2.dtsi
+++ b/target/linux/ramips/dts/WRTNODE2.dtsi
@@ -5,89 +5,85 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- spi-max-frequency = <10000000>;
- m25p,chunked-io = <32>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x1fb0000>;
- };
- };
-
-
- spidev@1 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "spidev";
- reg = <1 0>;
- linux,modalias = "spidev", "spidev";
- spi-max-frequency = <10000000>;
- };
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio0 5 1>;
+ linux,code = <0x198>;
};
+ };
+};
- uart1@d00 {
- status = "okay";
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <10000000>;
+ m25p,chunked-io = <32>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
};
- i2c@900 {
- status = "okay";
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
};
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- ralink,port-map = "llllw";
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x1fb0000>;
+ };
};
- sdhci@10130000 {
- status = "okay";
+ spidev@1 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "linux,spidev";
+ reg = <1>;
+ spi-max-frequency = <10000000>;
};
+};
- pcie@10140000 {
- status = "okay";
- };
+&uart1 {
+ status = "okay";
+};
+&i2c {
+ status = "okay";
+};
- gpio-keys-polled {
- compatible = "gpio-keys-polled";
- #address-cells = <1>;
- #size-cells = <0>;
- poll-interval = <20>;
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ ralink,port-map = "llllw";
+};
- reset {
- label = "reset";
- gpios = <&gpio0 5 1>;
- linux,code = <0x198>;
- };
- };
+&sdhci {
+ status = "okay";
+};
+&pcie {
+ status = "okay";
};
+&wmac {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/WRTNODE2P.dts b/target/linux/ramips/dts/WRTNODE2P.dts
index 26c2d29bbb..94c21a4249 100644
--- a/target/linux/ramips/dts/WRTNODE2P.dts
+++ b/target/linux/ramips/dts/WRTNODE2P.dts
@@ -6,15 +6,6 @@
compatible = "mediatek,wrtnode2p", "mediatek,mt7628an-soc";
model = "WRTnode2P";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "gpio", "jtag";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -25,3 +16,11 @@
};
};
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "gpio", "jtag";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/WRTNODE2R.dts b/target/linux/ramips/dts/WRTNODE2R.dts
index d88fadfa4a..1c25770e76 100644
--- a/target/linux/ramips/dts/WRTNODE2R.dts
+++ b/target/linux/ramips/dts/WRTNODE2R.dts
@@ -6,15 +6,6 @@
compatible = "mediatek,wrtnode2r", "mediatek,mt7628an-soc";
model = "WRTnode2R";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "gpio", "wled_an";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -25,3 +16,11 @@
};
};
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "gpio", "wled_an";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/WSR-1166.dts b/target/linux/ramips/dts/WSR-1166.dts
index 9743cee652..8f9991f4a7 100644
--- a/target/linux/ramips/dts/WSR-1166.dts
+++ b/target/linux/ramips/dts/WSR-1166.dts
@@ -15,58 +15,6 @@
bootargs = "console=ttyS0,57600";
};
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xf90000>;
- };
-
- partition@fe0000 {
- label = "board_data";
- reg = <0xfe0000 0x20000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -161,26 +109,76 @@
compatible = "gpio-poweroff";
gpios = <&gpio0 0 1>;
};
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf90000>;
+ };
+
+ partition@fe0000 {
+ label = "board_data";
+ reg = <0xfe0000 0x20000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0000>;
- mediatek,5ghz = <0>;
- };
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,5ghz = <0>;
};
};
};
diff --git a/target/linux/ramips/dts/WSR-600.dts b/target/linux/ramips/dts/WSR-600.dts
index 949572c263..2d08b9369b 100644
--- a/target/linux/ramips/dts/WSR-600.dts
+++ b/target/linux/ramips/dts/WSR-600.dts
@@ -15,53 +15,6 @@
bootargs = "console=ttyS0,57600";
};
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -157,3 +110,48 @@
gpios = <&gpio1 11 1>;
};
};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/WT1520-4M.dts b/target/linux/ramips/dts/WT1520-4M.dts
index d7cbe666d7..9f3d6a7448 100644
--- a/target/linux/ramips/dts/WT1520-4M.dts
+++ b/target/linux/ramips/dts/WT1520-4M.dts
@@ -2,42 +2,38 @@
#include "WT1520.dtsi"
-/ {
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
+&spi0 {
+ status = "okay";
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
};
};
};
diff --git a/target/linux/ramips/dts/WT1520-8M.dts b/target/linux/ramips/dts/WT1520-8M.dts
index 3b10991c1a..48b62bef4f 100644
--- a/target/linux/ramips/dts/WT1520-8M.dts
+++ b/target/linux/ramips/dts/WT1520-8M.dts
@@ -2,42 +2,38 @@
#include "WT1520.dtsi"
-/ {
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
+&spi0 {
+ status = "okay";
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "s25fl064k";
- spi-max-frequency = <10000000>;
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "s25fl064k";
+ spi-max-frequency = <10000000>;
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
};
};
};
diff --git a/target/linux/ramips/dts/WT1520.dtsi b/target/linux/ramips/dts/WT1520.dtsi
index b2ce18dad6..8cbf99fde2 100644
--- a/target/linux/ramips/dts/WT1520.dtsi
+++ b/target/linux/ramips/dts/WT1520.dtsi
@@ -12,37 +12,35 @@
chosen {
bootargs = "console=ttyS1,57600";
};
+};
- palmbus@10000000 {
- uart@500 {
- pinctrl-names = "default";
- pinctrl-0 = <&uartf_pins>;
- status = "okay";
- };
- };
+&uart {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uartf_pins>;
+ status = "okay";
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "jtag";
- ralink,function = "gpio";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "jtag";
+ ralink,function = "gpio";
};
};
+};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
- ehci@101c0000 {
- status = "okay";
- };
+&ehci {
+ status = "okay";
+};
- ohci@101c1000 {
- status = "okay";
- };
+&ohci {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/WT3020-4M.dts b/target/linux/ramips/dts/WT3020-4M.dts
index 9014e0c002..f611cdfce9 100644
--- a/target/linux/ramips/dts/WT3020-4M.dts
+++ b/target/linux/ramips/dts/WT3020-4M.dts
@@ -6,78 +6,6 @@
compatible = "wt3020", "ralink,mt7620n-soc";
model = "Nexx WT3020";
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q32";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x3b0000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -100,3 +28,73 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q32";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x3b0000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/WT3020-8M.dts b/target/linux/ramips/dts/WT3020-8M.dts
index b329883f21..3c6230726c 100644
--- a/target/linux/ramips/dts/WT3020-8M.dts
+++ b/target/linux/ramips/dts/WT3020-8M.dts
@@ -6,78 +6,6 @@
compatible = "wt3020", "ralink,mt7620n-soc";
model = "Nexx WT3020";
- palmbus@10000000 {
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -100,3 +28,73 @@
};
};
};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/WZR-AGL300NH.dts b/target/linux/ramips/dts/WZR-AGL300NH.dts
index 3d52efd2bb..23fba7cb8f 100644
--- a/target/linux/ramips/dts/WZR-AGL300NH.dts
+++ b/target/linux/ramips/dts/WZR-AGL300NH.dts
@@ -8,19 +8,12 @@
compatible = "WZR-AGL300NH", "ralink,rt2880-soc";
model = "Buffalo WZR-AGL300NH";
- palmbus@300000 {
- gpio0: gpio@600 {
- status = "okay";
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartlite", "mdio";
- ralink,function = "gpio";
- };
- };
+ pci@440000 {
+ compatible = "ralink,rt288x-pci";
+ reg = <0x00440000 0x20000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ status = "ok";
};
cfi@1f000000 {
@@ -55,34 +48,12 @@
};
};
- ethernet@400000 {
- status = "okay";
- mtd-mac-address = <&factory 0x4>;
-
- port@0 {
- mediatek,fixed-link = <1000 1 1 1>;
- };
-
- mdio-bus {
- status = "okay";
-
- phy0: ethernet-phy@0 {
- phy-mode = "mii";
- reg = <0>;
- };
- };
- };
-
rtl8366s {
compatible = "realtek,rtl8366s";
gpio-sda = <&gpio0 1 0>;
gpio-sck = <&gpio0 2 0>;
};
- wmac@480000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -131,13 +102,39 @@
gpios = <&gpio0 13 1>;
};
};
+};
+&gpio0 {
+ status = "okay";
+};
- pcibus0: pci@00440000 {
- compatible = "ralink,rt288x-pci";
- reg = <0x00440000 0x20000>;
- #address-cells = <1>;
- #size-cells = <1>;
- status = "ok";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartlite", "mdio";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x4>;
+
+ port@0 {
+ mediatek,fixed-link = <1000 1 1 1>;
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy0: ethernet-phy@0 {
+ phy-mode = "mii";
+ reg = <0>;
+ };
+ };
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
diff --git a/target/linux/ramips/dts/X5.dts b/target/linux/ramips/dts/X5.dts
index 314c7c6435..86f5c635f1 100644
--- a/target/linux/ramips/dts/X5.dts
+++ b/target/linux/ramips/dts/X5.dts
@@ -6,62 +6,6 @@
compatible = "X5", "ralink,rt5350-soc";
model = "Poray X5";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "gd25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <1>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -122,17 +66,71 @@
gpios = <&gpio0 18 0>;
};
};
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- ralink,led-polarity = <1>;
- };
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "gd25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- ehci@101c0000 {
- status = "okay";
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
};
+};
- ohci@101c1000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <1>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+ ralink,led-polarity = <1>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/X8.dts b/target/linux/ramips/dts/X8.dts
index 42a34c5d4d..733bbb55d4 100644
--- a/target/linux/ramips/dts/X8.dts
+++ b/target/linux/ramips/dts/X8.dts
@@ -6,62 +6,6 @@
compatible = "X8", "ralink,rt5350-soc";
model = "Poray X8";
- palmbus@10000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "gd25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "jtag", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x2f>;
- mediatek,led_polarity = <1>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -83,17 +27,71 @@
linux,code = <0x198>;
};
};
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- ralink,led-polarity = <1>;
- };
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "gd25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
- ehci@101c0000 {
- status = "okay";
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
};
+};
- ohci@101c1000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "jtag", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+ mediatek,portmap = <0x2f>;
+ mediatek,led_polarity = <1>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+ ralink,led-polarity = <1>;
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/XDXRN502J.dts b/target/linux/ramips/dts/XDXRN502J.dts
index c941d7801b..34a29cc74b 100644
--- a/target/linux/ramips/dts/XDXRN502J.dts
+++ b/target/linux/ramips/dts/XDXRN502J.dts
@@ -6,15 +6,6 @@
compatible = "XDXRN502J", "ralink,rt3052-soc";
model = "XDX RN502J";
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
- ralink,function = "gpio";
- };
- };
- };
-
cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
@@ -47,18 +38,6 @@
};
};
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x28>;
- };
-
- esw@10110000 {
- mediatek,portmap = <0x3e>;
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -85,8 +64,29 @@
linux,code = <0x198>;
};
};
+};
- otg@101c0000 {
- status = "okay";
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+ ralink,function = "gpio";
+ };
};
};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+ mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/Y1.dts b/target/linux/ramips/dts/Y1.dts
index 3248c7683e..ac9b7d56c0 100644
--- a/target/linux/ramips/dts/Y1.dts
+++ b/target/linux/ramips/dts/Y1.dts
@@ -6,13 +6,6 @@
compatible = "lenovo,Y1", "ralink,mt7620a-soc";
model = "Lenovo Y1";
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -47,3 +40,10 @@
};
};
};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
diff --git a/target/linux/ramips/dts/Y1.dtsi b/target/linux/ramips/dts/Y1.dtsi
index ff9600d64d..201f48b626 100644
--- a/target/linux/ramips/dts/Y1.dtsi
+++ b/target/linux/ramips/dts/Y1.dtsi
@@ -4,106 +4,104 @@
chosen {
bootargs = "console=ttyS0,115200";
};
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio0 11 1>;
+ linux,code = <0x198>;
+ };
+ };
+};
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
+&gpio0 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q128";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
};
- gpio2: gpio@660 {
- status = "okay";
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
};
- gpio3: gpio@688 {
- status = "okay";
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
};
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q128";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
};
};
+};
- ehci@101c0000 {
- status = "okay";
- };
+&ehci {
+ status = "okay";
+};
- ohci@101c1000 {
- status = "okay";
- };
+&ohci {
+ status = "okay";
+};
- pcie@10140000 {
- status = "okay";
+&pcie {
+ status = "okay";
- pcie-bridge {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
};
};
+};
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "uartf", "wled", "nd_sd";
- ralink,function = "gpio";
- };
-
- pa {
- ralink,group = "pa";
- ralink,function = "pa";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "uartf", "wled", "nd_sd";
+ ralink,function = "gpio";
};
- };
- gpio-keys-polled {
- compatible = "gpio-keys-polled";
- #address-cells = <1>;
- #size-cells = <0>;
- poll-interval = <20>;
-
- reset {
- label = "reset";
- gpios = <&gpio0 11 1>;
- linux,code = <0x198>;
+ pa {
+ ralink,group = "pa";
+ ralink,function = "pa";
};
};
};
diff --git a/target/linux/ramips/dts/Y1S.dts b/target/linux/ramips/dts/Y1S.dts
index 7679e0a721..cfa5e2123a 100644
--- a/target/linux/ramips/dts/Y1S.dts
+++ b/target/linux/ramips/dts/Y1S.dts
@@ -6,40 +6,6 @@
compatible = "lenovo,Y1S", "ralink,mt7620a-soc";
model = "Lenovo Y1S";
- ethernet@10100000 {
- status = "okay";
- mtd-mac-address = <&factory 0x4>;
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
- mediatek,portmap = "wllll";
-
- port@4 {
- status = "okay";
- phy-handle = <&phy4>;
- phy-mode = "rgmii";
- };
-
- port@5 {
- status = "okay";
- phy-handle = <&phy5>;
- phy-mode = "rgmii";
- };
-
- mdio-bus {
- status = "okay";
-
- phy4: ethernet-phy@4 {
- reg = <4>;
- phy-mode = "rgmii";
- };
-
- phy5: ethernet-phy@5 {
- reg = <5>;
- phy-mode = "rgmii";
- };
- };
- };
-
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
@@ -61,10 +27,6 @@
};
};
- gsw@10110000 {
- mediatek,port4 = "gmac";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -104,3 +66,41 @@
};
};
};
+
+&ethernet {
+ status = "okay";
+ mtd-mac-address = <&factory 0x4>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+ mediatek,portmap = "wllll";
+
+ port@4 {
+ status = "okay";
+ phy-handle = <&phy4>;
+ phy-mode = "rgmii";
+ };
+
+ port@5 {
+ status = "okay";
+ phy-handle = <&phy5>;
+ phy-mode = "rgmii";
+ };
+
+ mdio-bus {
+ status = "okay";
+
+ phy4: ethernet-phy@4 {
+ reg = <4>;
+ phy-mode = "rgmii";
+ };
+
+ phy5: ethernet-phy@5 {
+ reg = <5>;
+ phy-mode = "rgmii";
+ };
+ };
+};
+
+&gsw {
+ mediatek,port4 = "gmac";
+};
diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts b/target/linux/ramips/dts/YOUKU-YK1.dts
index fa2610e8a2..a9c13e50b6 100644
--- a/target/linux/ramips/dts/YOUKU-YK1.dts
+++ b/target/linux/ramips/dts/YOUKU-YK1.dts
@@ -6,93 +6,6 @@
compatible = "YOUKU-YK1", "ralink,mt7620a-soc";
model = "YOUKU YK1";
- palmbus@10000000 {
-
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "w25q256";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x1fb0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- sdhci@b0130000 {
- status = "okay";
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
wan {
@@ -125,3 +38,87 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q256";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x1fb0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/ZBT-APE522II.dts b/target/linux/ramips/dts/ZBT-APE522II.dts
new file mode 100644
index 0000000000..eff27c2a15
--- /dev/null
+++ b/target/linux/ramips/dts/ZBT-APE522II.dts
@@ -0,0 +1,143 @@
+/dts-v1/;
+
+#include "mt7620a.dtsi"
+
+/ {
+ compatible = "zbtlink,zbt-ape522ii", "ralink,mt7620a-soc";
+ model = "ZBT-APE522II";
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ sys1 {
+ label = "zbt-ape522ii:green:sys1";
+ gpios = <&gpio0 11 1>;
+ };
+
+ sys2 {
+ label = "zbt-ape522ii:green:sys2";
+ gpios = <&gpio0 12 1>;
+ };
+
+ sys3 {
+ label = "zbt-ape522ii:green:sys3";
+ gpios = <&gpio0 9 1>;
+ };
+
+ sys4 {
+ label = "zbt-ape522ii:green:sys4";
+ gpios = <&gpio0 14 1>;
+ };
+
+ wlan2g4 {
+ label = "zbt-ape522ii:green:wlan2g4";
+ gpios = <&gpio3 0 1>;
+ };
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio0 2 0>;
+ linux,code = <0x198>;
+ };
+ };
+};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xf80000>;
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pcie {
+ status = "okay";
+
+ pcie-bridge {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wled", "i2c", "uartf", "wdt";
+ ralink,function = "gpio";
+ };
+
+ pa {
+ ralink,group = "pa";
+ ralink,function = "pa";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/ZBT-WA05.dts b/target/linux/ramips/dts/ZBT-WA05.dts
index 82b0c8e64f..c2d51c300a 100644
--- a/target/linux/ramips/dts/ZBT-WA05.dts
+++ b/target/linux/ramips/dts/ZBT-WA05.dts
@@ -10,82 +10,6 @@
bootargs = "console=ttyS0,115200";
};
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio2: gpio@660 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- en25q64@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x760000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "i2c", "spi refclk", "wled";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -118,3 +42,77 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ en25q64@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x760000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "i2c", "spi refclk", "wled";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/ZBT-WE826.dts b/target/linux/ramips/dts/ZBT-WE826.dts
index b0e4d75c67..75c99a7fdc 100644
--- a/target/linux/ramips/dts/ZBT-WE826.dts
+++ b/target/linux/ramips/dts/ZBT-WE826.dts
@@ -3,122 +3,120 @@
#include "mt7620a.dtsi"
/ {
- compatible = "zbtlink,zbt-we826", "ralink,mt7620a-soc";
- model = "ZBT-WE826";
-
- chosen {
- bootargs = "console=ttyS0,115200";
- };
-
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- en25q128@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "w25q128";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
- };
- };
- };
-
- sdhci@10130000 {
- status = "okay";
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- ralink,port-map = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- default {
- ralink,group = "i2c", "uartf", "wled", "spi refclk", "pa";
- ralink,function = "gpio";
- };
- };
- };
-
- gpio-leds {
- compatible = "gpio-leds";
- power {
- label = "zbt-we826:green:power";
- gpios = <&gpio1 14 0>;
- };
- usb {
- label = "zbt-we826:green:usb";
- gpios = <&gpio1 15 0>;
- };
- air {
- label = "zbt-we826:green:wifi";
- gpios = <&gpio3 0 1>;
- };
- };
-
- gpio-keys-polled {
- compatible = "gpio-keys-polled";
- #address-cells = <1>;
- #size-cells = <0>;
- poll-interval = <20>;
- reset {
- label = "reset";
- gpios = <&gpio0 1 1>;
- linux,code = <0x198>;
- };
- };
-
- pcie@10140000 {
- status = "okay";
- };
+ compatible = "zbtlink,zbt-we826", "ralink,mt7620a-soc";
+ model = "ZBT-WE826";
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+ power {
+ label = "zbt-we826:green:power";
+ gpios = <&gpio1 14 0>;
+ };
+ usb {
+ label = "zbt-we826:green:usb";
+ gpios = <&gpio1 15 0>;
+ };
+ air {
+ label = "zbt-we826:green:wifi";
+ gpios = <&gpio3 0 1>;
+ };
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+ reset {
+ label = "reset";
+ gpios = <&gpio0 1 1>;
+ linux,code = <0x198>;
+ };
+ };
+};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ en25q128@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "w25q128";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ ralink,port-map = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "i2c", "uartf", "wled", "spi refclk", "pa";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
};
diff --git a/target/linux/ramips/dts/ZBT-WG2626.dts b/target/linux/ramips/dts/ZBT-WG2626.dts
index b18f4c1db8..b599d7b49b 100644
--- a/target/linux/ramips/dts/ZBT-WG2626.dts
+++ b/target/linux/ramips/dts/ZBT-WG2626.dts
@@ -15,85 +15,12 @@
bootargs = "console=ttyS0,115200";
};
- sdhci@10130000 {
- status = "okay";
- };
-
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
-
- };
- };
-
+ palmbus: palmbus@1E000000 {
i2c@900 {
- compatible = "ralink,i2c-mt7621";
- reg = <0x900 0x100>;
- #address-cells = <1>;
- #size-cells = <0>;
- pinctrl-names = "default";
- pinctrl-0 = <&i2c_pins>;
status = "okay";
};
};
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0000>;
- mediatek,5ghz = <0>;
- };
- };
- };
-
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0xe000>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -115,13 +42,79 @@
gpios = <&gpio0 24 1>;
};
};
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,5ghz = <0>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0xe000>;
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio";
- ralink,function = "gpio";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio";
+ ralink,function = "gpio";
};
};
};
diff --git a/target/linux/ramips/dts/ZBT-WG3526.dts b/target/linux/ramips/dts/ZBT-WG3526.dts
index 30b508c533..538a7d8632 100644
--- a/target/linux/ramips/dts/ZBT-WG3526.dts
+++ b/target/linux/ramips/dts/ZBT-WG3526.dts
@@ -15,85 +15,12 @@
bootargs = "console=ttyS0,115200";
};
- sdhci@10130000 {
- status = "okay";
- };
-
- palmbus@1E000000 {
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0xfb0000>;
- };
-
- };
- };
-
+ palmbus: palmbus@1E000000 {
i2c@900 {
- compatible = "ralink,i2c-mt7621";
- reg = <0x900 0x100>;
- #address-cells = <1>;
- #size-cells = <0>;
- pinctrl-names = "default";
- pinctrl-0 = <&i2c_pins>;
status = "okay";
};
};
- pcie@1e140000 {
- status = "okay";
-
- pcie0 {
- mt76@0,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x0000>;
- mediatek,5ghz = <0>;
- };
- };
-
- pcie1 {
- mt76@1,0 {
- reg = <0x0000 0 0 0 0>;
- device_type = "pci";
- mediatek,mtd-eeprom = <&factory 0x8000>;
- mediatek,2ghz = <0>;
- };
- };
- };
-
- ethernet@1e100000 {
- mtd-mac-address = <&factory 0xe000>;
- };
-
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -115,13 +42,79 @@
gpios = <&gpio0 24 1>;
};
};
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+
+ pcie0 {
+ mt76@0,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ mediatek,5ghz = <0>;
+ };
+ };
+
+ pcie1 {
+ mt76@1,0 {
+ reg = <0x0000 0 0 0 0>;
+ device_type = "pci";
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ mediatek,2ghz = <0>;
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0xe000>;
+};
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio";
- ralink,function = "gpio";
- };
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio";
+ ralink,function = "gpio";
};
};
};
diff --git a/target/linux/ramips/dts/ZBT-WR8305RT.dts b/target/linux/ramips/dts/ZBT-WR8305RT.dts
index afbde2a67b..694b7cfa96 100644
--- a/target/linux/ramips/dts/ZBT-WR8305RT.dts
+++ b/target/linux/ramips/dts/ZBT-WR8305RT.dts
@@ -6,83 +6,6 @@
compatible = "zbtlink,zbt-wr8305rt", "ralink,mt7620n-soc";
model = "Zbtlink ZBT-WR8305RT";
- palmbus@10000000 {
- gpio1: gpio@638 {
- status = "okay";
- };
-
- gpio3: gpio@688 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
- ethernet@10100000 {
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "llllw";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- pinctrl {
- state_default: pinctrl0 {
- ephy {
- ralink,group = "ephy";
- ralink,function = "ephy";
- };
-
- default {
- ralink,group = "i2c", "uartf", "spi refclk", "wled";
- ralink,function = "gpio";
- };
- };
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -115,3 +38,78 @@
};
};
};
+
+&gpio1 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "llllw";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ ephy {
+ ralink,group = "ephy";
+ ralink,function = "ephy";
+ };
+
+ default {
+ ralink,group = "i2c", "uartf", "spi refclk", "wled";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/ZTE-Q7.dts b/target/linux/ramips/dts/ZTE-Q7.dts
index 78a948c2e9..2c4c2e5712 100644
--- a/target/linux/ramips/dts/ZTE-Q7.dts
+++ b/target/linux/ramips/dts/ZTE-Q7.dts
@@ -6,84 +6,6 @@
compatible = "ZTE-Q7", "ralink,mt7620a-soc";
model = "ZTE Q7";
- palmbus@10000000 {
- gpio0: gpio@600 {
- status = "okay";
- };
-
- gpio1: gpio@638 {
- status = "okay";
- };
-
- spi@b00 {
- status = "okay";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <0 0>;
- linux,modalias = "m25p80", "en25q64";
- spi-max-frequency = <10000000>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x30000>;
- read-only;
- };
-
- partition@30000 {
- label = "u-boot-env";
- reg = <0x30000 0x10000>;
- read-only;
- };
-
- factory: partition@40000 {
- label = "factory";
- reg = <0x40000 0x10000>;
- read-only;
- };
-
- partition@50000 {
- label = "firmware";
- reg = <0x50000 0x7b0000>;
- };
- };
- };
- };
-
- pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
- ralink,function = "gpio";
- };
- };
- };
-
- ethernet@10100000 {
- pinctrl-names = "default";
- pinctrl-0 = <&ephy_pins>;
- mtd-mac-address = <&factory 0x4>;
- mediatek,portmap = "wllll";
- };
-
- wmac@10180000 {
- ralink,mtd-eeprom = <&factory 0>;
- };
-
- sdhci@10130000 {
- status = "okay";
- };
-
- ehci@101c0000 {
- status = "okay";
- };
-
- ohci@101c1000 {
- status = "okay";
- };
-
gpio-leds {
compatible = "gpio-leds";
@@ -111,3 +33,79 @@
};
};
};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "en25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_pins>;
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/dts/mt7620a.dtsi b/target/linux/ramips/dts/mt7620a.dtsi
index 0310bd4d2e..ccadbe40db 100644
--- a/target/linux/ramips/dts/mt7620a.dtsi
+++ b/target/linux/ramips/dts/mt7620a.dtsi
@@ -26,7 +26,7 @@
serial0 = &uartlite;
};
- palmbus@10000000 {
+ palmbus: palmbus@10000000 {
compatible = "palmbus";
reg = <0x10000000 0x200000>;
ranges = <0x0 0x10000000 0x1FFFFF>;
@@ -34,12 +34,12 @@
#address-cells = <1>;
#size-cells = <1>;
- sysc@0 {
+ sysc: sysc@0 {
compatible = "ralink,mt7620a-sysc", "ralink,rt3050-sysc";
reg = <0x0 0x100>;
};
- timer@100 {
+ timer: timer@100 {
compatible = "ralink,mt7620a-timer", "ralink,rt2880-timer";
reg = <0x100 0x20>;
@@ -47,7 +47,7 @@
interrupts = <1>;
};
- watchdog@120 {
+ watchdog: watchdog@120 {
compatible = "ralink,mt7620a-wdt", "ralink,rt2880-wdt";
reg = <0x120 0x10>;
@@ -72,7 +72,7 @@
interrupts = <2>;
};
- memc@300 {
+ memc: memc@300 {
compatible = "ralink,mt7620a-memc", "ralink,rt3050-memc";
reg = <0x300 0x100>;
@@ -83,7 +83,7 @@
interrupts = <3>;
};
- uart@500 {
+ uart: uart@500 {
compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
reg = <0x500 0x100>;
@@ -175,7 +175,7 @@
status = "disabled";
};
- i2c@900 {
+ i2c: i2c@900 {
compatible = "link,mt7620a-i2c", "ralink,rt2880-i2c";
reg = <0x900 0x100>;
@@ -191,7 +191,7 @@
pinctrl-0 = <&i2c_pins>;
};
- i2s@a00 {
+ i2s: i2s@a00 {
compatible = "ralink,mt7620a-i2s";
reg = <0xa00 0x100>;
@@ -232,7 +232,7 @@
reset-names = "spi";
#address-cells = <1>;
- #size-cells = <1>;
+ #size-cells = <0>;
status = "disabled";
@@ -256,7 +256,7 @@
pinctrl-0 = <&uartlite_pins>;
};
- systick@d00 {
+ systick: systick@d00 {
compatible = "ralink,mt7620a-systick", "ralink,cevt-systick";
reg = <0xd00 0x10>;
@@ -267,7 +267,7 @@
interrupts = <7>;
};
- pcm@2000 {
+ pcm: pcm@2000 {
compatible = "ralink,mt7620a-pcm";
reg = <0x2000 0x800>;
@@ -281,7 +281,7 @@
};
gdma: gdma@2800 {
- compatible = "ralink,mt7620a-gdma", "ralink,rt2880-gdma";
+ compatible = "ralink,mt7620a-gdma", "ralink,rt3883-gdma";
reg = <0x2800 0x800>;
resets = <&rstctrl 14>;
@@ -298,7 +298,7 @@
};
};
- pinctrl {
+ pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
@@ -396,15 +396,23 @@
#reset-cells = <1>;
};
+ clkctrl: clkctrl {
+ compatible = "ralink,rt2880-clock";
+ #clock-cells = <1>;
+ };
+
usbphy: usbphy {
compatible = "mediatek,mt7620-usbphy";
#phy-cells = <1>;
resets = <&rstctrl 22 &rstctrl 25>;
reset-names = "host", "device";
+
+ clocks = <&clkctrl 22 &clkctrl 25>;
+ clock-names = "host", "device";
};
- ethernet@10100000 {
+ ethernet: ethernet@10100000 {
compatible = "mediatek,mt7620-eth";
reg = <0x10100000 0x10000>;
@@ -452,7 +460,7 @@
interrupts = <17>;
};
- sdhci@10130000 {
+ sdhci: sdhci@10130000 {
compatible = "ralink,mt7620-sdhci";
reg = <0x10130000 0x4000>;
@@ -462,7 +470,7 @@
status = "disabled";
};
- ehci@101c0000 {
+ ehci: ehci@101c0000 {
compatible = "generic-ehci";
reg = <0x101c0000 0x1000>;
@@ -475,7 +483,7 @@
status = "disabled";
};
- ohci@101c1000 {
+ ohci: ohci@101c1000 {
compatible = "generic-ohci";
reg = <0x101c1000 0x1000>;
@@ -488,7 +496,7 @@
status = "disabled";
};
- pcie@10140000 {
+ pcie: pcie@10140000 {
compatible = "mediatek,mt7620-pci";
reg = <0x10140000 0x100
0x10142000 0x100>;
@@ -499,6 +507,9 @@
resets = <&rstctrl 26>;
reset-names = "pcie0";
+ clocks = <&clkctrl 26>;
+ clock-names = "pcie0";
+
interrupt-parent = <&cpuintc>;
interrupts = <4>;
@@ -525,7 +536,7 @@
};
};
- wmac@10180000 {
+ wmac: wmac@10180000 {
compatible = "ralink,rt7620-wmac", "ralink,rt2880-wmac";
reg = <0x10180000 0x40000>;
diff --git a/target/linux/ramips/dts/mt7620n.dtsi b/target/linux/ramips/dts/mt7620n.dtsi
index 6c5d66eaa8..f1593acd93 100644
--- a/target/linux/ramips/dts/mt7620n.dtsi
+++ b/target/linux/ramips/dts/mt7620n.dtsi
@@ -26,7 +26,7 @@
serial0 = &uartlite;
};
- palmbus@10000000 {
+ palmbus: palmbus@10000000 {
compatible = "palmbus";
reg = <0x10000000 0x200000>;
ranges = <0x0 0x10000000 0x1FFFFF>;
@@ -34,12 +34,12 @@
#address-cells = <1>;
#size-cells = <1>;
- sysc@0 {
+ sysc: sysc@0 {
compatible = "ralink,mt7620a-sysc", "ralink,rt3050-sysc";
reg = <0x0 0x100>;
};
- timer@100 {
+ timer: timer@100 {
compatible = "ralink,mt7620a-timer", "ralink,rt2880-timer";
reg = <0x100 0x20>;
@@ -47,7 +47,7 @@
interrupts = <1>;
};
- watchdog@120 {
+ watchdog: watchdog@120 {
compatible = "ralink,mt7620a-wdt", "ralink,rt2880-wdt";
reg = <0x120 0x10>;
@@ -72,7 +72,7 @@
interrupts = <2>;
};
- memc@300 {
+ memc: memc@300 {
compatible = "ralink,mt7620a-memc", "ralink,rt3050-memc";
reg = <0x300 0x100>;
@@ -184,7 +184,7 @@
reset-names = "spi";
#address-cells = <1>;
- #size-cells = <1>;
+ #size-cells = <0>;
status = "disabled";
@@ -208,7 +208,7 @@
pinctrl-0 = <&uartlite_pins>;
};
- systick@d00 {
+ systick: systick@d00 {
compatible = "ralink,mt7620a-systick", "ralink,cevt-systick";
reg = <0xd00 0x10>;
@@ -220,7 +220,7 @@
};
};
- pinctrl {
+ pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
@@ -255,15 +255,23 @@
#reset-cells = <1>;
};
+ clkctrl: clkctrl {
+ compatible = "ralink,rt2880-clock";
+ #clock-cells = <1>;
+ };
+
usbphy: usbphy {
compatible = "mediatek,mt7620-usbphy";
#phy-cells = <1>;
resets = <&rstctrl 22 &rstctrl 25>;
reset-names = "host", "device";
+
+ clocks = <&clkctrl 22 &clkctrl 25>;
+ clock-names = "host", "device";
};
- ethernet@10100000 {
+ ethernet: ethernet@10100000 {
compatible = "mediatek,mt7620-eth";
reg = <0x10100000 0x10000>;
@@ -298,7 +306,7 @@
mediatek,port4 = "gmac";
};
- ehci@101c0000 {
+ ehci: ehci@101c0000 {
compatible = "generic-ehci";
reg = <0x101c0000 0x1000>;
@@ -311,7 +319,7 @@
status = "disabled";
};
- ohci@101c1000 {
+ ohci: ohci@101c1000 {
compatible = "generic-ohci";
reg = <0x101c1000 0x1000>;
@@ -324,7 +332,7 @@
status = "disabled";
};
- wmac@10180000 {
+ wmac: wmac@10180000 {
compatible = "ralink,rt7620-wmac", "ralink,rt2880-wmac";
reg = <0x10180000 0x40000>;
diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi
index 71d833d69e..7a9d79a88b 100644
--- a/target/linux/ramips/dts/mt7621.dtsi
+++ b/target/linux/ramips/dts/mt7621.dtsi
@@ -42,7 +42,7 @@
clock-frequency = <50000000>;
};
- palmbus@1E000000 {
+ palmbus: palmbus@1E000000 {
compatible = "palmbus";
reg = <0x1E000000 0x100000>;
ranges = <0x0 0x1E000000 0x0FFFFF>;
@@ -50,12 +50,12 @@
#address-cells = <1>;
#size-cells = <1>;
- sysc@0 {
+ sysc: sysc@0 {
compatible = "mtk,mt7621-sysc";
reg = <0x0 0x100>;
};
- wdt@100 {
+ wdt: wdt@100 {
compatible = "mtk,mt7621-wdt";
reg = <0x100 0x100>;
};
@@ -89,17 +89,17 @@
};
};
- memc@5000 {
+ memc: memc@5000 {
compatible = "mtk,mt7621-memc";
reg = <0x300 0x100>;
};
- cpc@1fbf0000 {
+ cpc: cpc@1fbf0000 {
compatible = "mtk,mt7621-cpc";
reg = <0x1fbf0000 0x8000>;
};
- mc@1fbf8000 {
+ mc: mc@1fbf8000 {
compatible = "mtk,mt7621-mc";
reg = <0x1fbf8000 0x8000>;
};
@@ -109,6 +109,7 @@
reg = <0xc00 0x100>;
clocks = <&sysclock>;
+ clock-frequency = <50000000>;
interrupt-parent = <&gic>;
interrupts = <GIC_SHARED 26 IRQ_TYPE_LEVEL_HIGH>;
@@ -118,7 +119,7 @@
no-loopback-test;
};
- spi@b00 {
+ spi0: spi@b00 {
status = "okay";
compatible = "ralink,mt7621-spi";
@@ -138,14 +139,48 @@
m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
- reg = <0 0>;
+ reg = <0>;
spi-max-frequency = <10000000>;
m25p,chunked-io = <32>;
};
};
+
+ gdma: gdma@2800 {
+ compatible = "ralink,rt3883-gdma";
+ reg = <0x2800 0x800>;
+
+ resets = <&rstctrl 14>;
+ reset-names = "dma";
+
+ interrupt-parent = <&gic>;
+ interrupts = <0 13 4>;
+
+ #dma-cells = <1>;
+ #dma-channels = <16>;
+ #dma-requests = <16>;
+
+ status = "disabled";
+ };
+
+ hsdma: hsdma@7000 {
+ compatible = "mediatek,mt7621-hsdma";
+ reg = <0x7000 0x1000>;
+
+ resets = <&rstctrl 5>;
+ reset-names = "hsdma";
+
+ interrupt-parent = <&gic>;
+ interrupts = <0 11 4>;
+
+ #dma-cells = <1>;
+ #dma-channels = <1>;
+ #dma-requests = <1>;
+
+ status = "disabled";
+ };
};
- pinctrl {
+ pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
@@ -241,7 +276,12 @@
#reset-cells = <1>;
};
- sdhci@1E130000 {
+ clkctrl: clkctrl {
+ compatible = "ralink,rt2880-clock";
+ #clock-cells = <1>;
+ };
+
+ sdhci: sdhci@1E130000 {
compatible = "ralink,mt7620-sdhci";
reg = <0x1E130000 0x4000>;
@@ -249,7 +289,7 @@
interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>;
};
- xhci@1E1C0000 {
+ xhci: xhci@1E1C0000 {
status = "okay";
compatible = "mediatek,mt8173-xhci";
@@ -279,7 +319,7 @@
};
};
- nand@1e003000 {
+ nand: nand@1e003000 {
status = "disabled";
compatible = "mtk,mt7621-nand";
@@ -290,7 +330,7 @@
#size-cells = <1>;
};
- ethernet@1e100000 {
+ ethernet: ethernet@1e100000 {
compatible = "mediatek,mt7621-eth";
reg = <0x1e100000 0x10000>;
@@ -323,7 +363,7 @@
interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
};
- pcie@1e140000 {
+ pcie: pcie@1e140000 {
compatible = "mediatek,mt7621-pci";
reg = <0x1e140000 0x100
0x1e142000 0x100>;
@@ -349,6 +389,11 @@
status = "okay";
+ resets = <&rstctrl 24 &rstctrl 25 &rstctrl 26>;
+ reset-names = "pcie0", "pcie1", "pcie2";
+ clocks = <&clkctrl 24 &clkctrl 25 &clkctrl 26>;
+ clock-names = "pcie0", "pcie1", "pcie2";
+
pcie0 {
reg = <0x0000 0 0 0 0>;
diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi
index 98496e325d..6d5ed95e49 100644
--- a/target/linux/ramips/dts/mt7628an.dtsi
+++ b/target/linux/ramips/dts/mt7628an.dtsi
@@ -24,7 +24,7 @@
compatible = "mti,cpu-interrupt-controller";
};
- palmbus@10000000 {
+ palmbus: palmbus@10000000 {
compatible = "palmbus";
reg = <0x10000000 0x200000>;
ranges = <0x0 0x10000000 0x1FFFFF>;
@@ -32,12 +32,12 @@
#address-cells = <1>;
#size-cells = <1>;
- sysc@0 {
+ sysc: sysc@0 {
compatible = "ralink,mt7620a-sysc";
reg = <0x0 0x100>;
};
- watchdog@120 {
+ watchdog: watchdog@120 {
compatible = "ralink,mt7628an-wdt", "mtk,mt7621-wdt";
reg = <0x120 0x10>;
@@ -66,7 +66,7 @@
0x80 0x78>;
};
- memc@300 {
+ memc: memc@300 {
compatible = "ralink,mt7620a-memc", "ralink,rt3050-memc";
reg = <0x300 0x100>;
@@ -109,7 +109,7 @@
};
};
- i2c@900 {
+ i2c: i2c@900 {
compatible = "mediatek,mt7628-i2c";
reg = <0x900 0x100>;
@@ -125,7 +125,7 @@
pinctrl-0 = <&i2c_pins>;
};
- i2s@a00 {
+ i2s: i2s@a00 {
compatible = "ralink,mt7620a-i2s";
reg = <0xa00 0x100>;
@@ -142,7 +142,7 @@
status = "disabled";
};
- spi@b00 {
+ spi0: spi@b00 {
compatible = "ralink,mt7621-spi";
reg = <0xb00 0x100>;
@@ -166,6 +166,8 @@
reg-io-width = <4>;
no-loopback-test;
+ clock-frequency = <40000000>;
+
resets = <&rstctrl 12>;
reset-names = "uartl";
@@ -176,7 +178,7 @@
pinctrl-0 = <&uart0_pins>;
};
- uart1@d00 {
+ uart1: uart1@d00 {
compatible = "ns16550a";
reg = <0xd00 0x100>;
@@ -184,6 +186,8 @@
reg-io-width = <4>;
no-loopback-test;
+ clock-frequency = <40000000>;
+
resets = <&rstctrl 19>;
reset-names = "uart1";
@@ -204,6 +208,8 @@
reg-io-width = <4>;
no-loopback-test;
+ clock-frequency = <40000000>;
+
resets = <&rstctrl 20>;
reset-names = "uart2";
@@ -216,7 +222,7 @@
status = "disabled";
};
- pwm@5000 {
+ pwm: pwm@5000 {
compatible = "mediatek,mt7628-pwm";
reg = <0x5000 0x1000>;
@@ -229,7 +235,7 @@
status = "disabled";
};
- pcm@2000 {
+ pcm: pcm@2000 {
compatible = "ralink,mt7620a-pcm";
reg = <0x2000 0x800>;
@@ -243,7 +249,7 @@
};
gdma: gdma@2800 {
- compatible = "ralink,mt7620a-gdma", "ralink,rt2880-gdma";
+ compatible = "ralink,rt3883-gdma";
reg = <0x2800 0x800>;
resets = <&rstctrl 14>;
@@ -260,7 +266,7 @@
};
};
- pinctrl {
+ pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
@@ -344,6 +350,11 @@
#reset-cells = <1>;
};
+ clkctrl: clkctrl {
+ compatible = "ralink,rt2880-clock";
+ #clock-cells = <1>;
+ };
+
usbphy: usbphy@10120000 {
compatible = "ralink,mt7628an-usbphy", "mediatek,mt7620-usbphy";
reg = <0x10120000 0x4000>;
@@ -351,9 +362,11 @@
resets = <&rstctrl 22 &rstctrl 25>;
reset-names = "host", "device";
+ clocks = <&clkctrl 22 &clkctrl 25>;
+ clock-names = "host", "device";
};
- sdhci@10130000 {
+ sdhci: sdhci@10130000 {
compatible = "ralink,mt7620-sdhci";
reg = <0x10130000 0x4000>;
@@ -366,7 +379,7 @@
status = "disabled";
};
- ehci@101c0000 {
+ ehci: ehci@101c0000 {
compatible = "generic-ehci";
reg = <0x101c0000 0x1000>;
@@ -377,7 +390,7 @@
interrupts = <18>;
};
- ohci@101c1000 {
+ ohci: ohci@101c1000 {
compatible = "generic-ohci";
reg = <0x101c1000 0x1000>;
@@ -388,7 +401,7 @@
interrupts = <18>;
};
- ethernet@10100000 {
+ ethernet: ethernet@10100000 {
compatible = "ralink,rt5350-eth";
reg = <0x10100000 0x10000>;
@@ -402,7 +415,7 @@
};
esw: esw@10110000 {
- compatible = "ralink,rt3050-esw";
+ compatible = "mediatek,mt7628-esw", "ralink,rt3050-esw";
reg = <0x10110000 0x8000>;
resets = <&rstctrl 23>;
@@ -412,7 +425,7 @@
interrupts = <17>;
};
- pcie@10140000 {
+ pcie: pcie@10140000 {
compatible = "mediatek,mt7620-pci";
reg = <0x10140000 0x100
0x10142000 0x100>;
@@ -420,12 +433,14 @@
#address-cells = <3>;
#size-cells = <2>;
- resets = <&rstctrl 26>;
- reset-names = "pcie0";
-
interrupt-parent = <&cpuintc>;
interrupts = <4>;
+ resets = <&rstctrl 26 &rstctrl 27>;
+ reset-names = "pcie0", "pcie1";
+ clocks = <&clkctrl 26 &clkctrl 27>;
+ clock-names = "pcie0", "pcie1";
+
status = "disabled";
device_type = "pci";
diff --git a/target/linux/ramips/dts/rt2880.dtsi b/target/linux/ramips/dts/rt2880.dtsi
index 603eed871b..ad882547f7 100644
--- a/target/linux/ramips/dts/rt2880.dtsi
+++ b/target/linux/ramips/dts/rt2880.dtsi
@@ -24,7 +24,7 @@
compatible = "mti,cpu-interrupt-controller";
};
- palmbus@300000 {
+ palmbus: palmbus@300000 {
compatible = "palmbus";
reg = <0x300000 0x200000>;
ranges = <0x0 0x300000 0x1FFFFF>;
@@ -32,12 +32,12 @@
#address-cells = <1>;
#size-cells = <1>;
- sysc@0 {
+ sysc: sysc@0 {
compatible = "ralink,rt2880-sysc";
reg = <0x000 0x100>;
};
- timer@100 {
+ timer: timer@100 {
compatible = "ralink,rt2880-timer";
reg = <0x100 0x20>;
@@ -47,7 +47,7 @@
status = "disabled";
};
- watchdog@120 {
+ watchdog: watchdog@120 {
compatible = "ralink,rt2880-wdt";
reg = <0x120 0x10>;
};
@@ -63,7 +63,7 @@
interrupts = <2>;
};
- memc@300 {
+ memc: memc@300 {
compatible = "ralink,rt2880-memc";
reg = <0x300 0x100>;
};
@@ -125,7 +125,7 @@
};
};
- pinctrl {
+ pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
@@ -158,7 +158,12 @@
#reset-cells = <1>;
};
- ethernet@400000 {
+ clkctrl: clkctrl {
+ compatible = "ralink,rt2880-clock";
+ #clock-cells = <1>;
+ };
+
+ ethernet: ethernet@400000 {
compatible = "ralink,rt2880-eth";
reg = <0x00400000 0x10000>;
@@ -186,7 +191,7 @@
};
};
- wmac@480000 {
+ wmac: wmac@480000 {
compatible = "ralink,rt2880-wmac";
reg = <0x480000 0x40000>;
diff --git a/target/linux/ramips/dts/rt3050.dtsi b/target/linux/ramips/dts/rt3050.dtsi
index 3aecba6345..ed88ac12ec 100644
--- a/target/linux/ramips/dts/rt3050.dtsi
+++ b/target/linux/ramips/dts/rt3050.dtsi
@@ -25,7 +25,7 @@
compatible = "mti,cpu-interrupt-controller";
};
- palmbus@10000000 {
+ palmbus: palmbus@10000000 {
compatible = "palmbus";
reg = <0x10000000 0x200000>;
ranges = <0x0 0x10000000 0x1FFFFF>;
@@ -33,12 +33,12 @@
#address-cells = <1>;
#size-cells = <1>;
- sysc@0 {
+ sysc: sysc@0 {
compatible = "ralink,rt3050-sysc";
reg = <0x0 0x100>;
};
- timer@100 {
+ timer: timer@100 {
compatible = "ralink,rt3050-timer", "ralink,rt2880-timer";
reg = <0x100 0x20>;
@@ -46,7 +46,7 @@
interrupts = <1>;
};
- watchdog@120 {
+ watchdog: watchdog@120 {
compatible = "ralink,rt3050-wdt", "ralink,rt2880-wdt";
reg = <0x120 0x10>;
@@ -71,7 +71,7 @@
interrupts = <2>;
};
- memc@300 {
+ memc: memc@300 {
compatible = "ralink,rt3050-memc";
reg = <0x300 0x100>;
@@ -82,7 +82,7 @@
interrupts = <3>;
};
- uart@500 {
+ uart: uart@500 {
compatible = "ralink,rt3050-uart", "ralink,rt2880-uart", "ns16550a";
reg = <0x500 0x100>;
@@ -149,6 +149,23 @@
status = "disabled";
};
+ gdma: gdma@700 {
+ compatible = "ralink,rt305x-gdma";
+ reg = <0x700 0x100>;
+
+ resets = <&rstctrl 14>;
+ reset-names = "dma";
+
+ interrupt-parent = <&intc>;
+ interrupts = <7>;
+
+ #dma-cells = <1>;
+ #dma-channels = <8>;
+ #dma-requests = <8>;
+
+ status = "disabled";
+ };
+
spi0: spi@b00 {
compatible = "ralink,rt3050-spi", "ralink,rt2880-spi";
reg = <0xb00 0x100>;
@@ -182,7 +199,7 @@
};
};
- pinctrl {
+ pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
@@ -215,7 +232,20 @@
#reset-cells = <1>;
};
- ethernet@10100000 {
+ clkctrl: clkctrl {
+ compatible = "ralink,rt2880-clock";
+ #clock-cells = <1>;
+ };
+
+ usbphy: usbphy {
+ compatible = "ralink,rt3050-usbphy";
+ resets = <&rstctrl 22>;
+ reset-names = "host";
+ clocks = <&clkctrl 18>;
+ clock-names = "host";
+ };
+
+ ethernet: ethernet@10100000 {
compatible = "ralink,rt3050-eth";
reg = <0x10100000 0x10000>;
@@ -239,7 +269,7 @@
interrupts = <17>;
};
- wmac@10180000 {
+ wmac: wmac@10180000 {
compatible = "ralink,rt3050-wmac", "ralink,rt2880-wmac";
reg = <0x10180000 0x40000>;
@@ -249,7 +279,7 @@
ralink,eeprom = "soc_wmac.eeprom";
};
- otg@101c0000 {
+ otg: otg@101c0000 {
compatible = "ralink,rt3050-otg", "snps,dwc2";
reg = <0x101c0000 0x40000>;
diff --git a/target/linux/ramips/dts/rt3352.dtsi b/target/linux/ramips/dts/rt3352.dtsi
index a22af42112..0bb28ec833 100644
--- a/target/linux/ramips/dts/rt3352.dtsi
+++ b/target/linux/ramips/dts/rt3352.dtsi
@@ -26,7 +26,7 @@
serial0 = &uartlite;
};
- palmbus@10000000 {
+ palmbus: palmbus@10000000 {
compatible = "palmbus";
reg = <0x10000000 0x200000>;
ranges = <0x0 0x10000000 0x1FFFFF>;
@@ -34,12 +34,12 @@
#address-cells = <1>;
#size-cells = <1>;
- sysc@0 {
+ sysc: sysc@0 {
compatible = "ralink,rt3352-sysc", "ralink,rt3050-sysc";
reg = <0x0 0x100>;
};
- timer@100 {
+ timer: timer@100 {
compatible = "ralink,rt3352-timer", "ralink,rt2880-timer";
reg = <0x100 0x20>;
@@ -47,7 +47,7 @@
interrupts = <1>;
};
- watchdog@120 {
+ watchdog: watchdog@120 {
compatible = "ralink,rt3352-wdt", "ralink,rt2880-wdt";
reg = <0x120 0x10>;
@@ -69,7 +69,7 @@
interrupts = <2>;
};
- memc@300 {
+ memc: memc@300 {
compatible = "ralink,rt3352-memc", "ralink,rt3050-memc";
reg = <0x300 0x100>;
@@ -80,7 +80,7 @@
interrupts = <3>;
};
- uart@500 {
+ uart: uart@500 {
compatible = "ralink,rt3352-uart", "ralink,rt2880-uart", "ns16550a";
reg = <0x500 0x100>;
@@ -165,7 +165,7 @@
compatible = "ralink,rt3352-spi", "ralink,rt2880-spi";
reg = <0xb40 0x60>;
#address-cells = <1>;
- #size-cells = <1>;
+ #size-cells = <0>;
resets = <&rstctrl 18>;
reset-names = "spi";
@@ -191,9 +191,26 @@
pinctrl-names = "default";
pinctrl-0 = <&uartlite_pins>;
};
+
+ gdma: gdma@2800 {
+ compatible = "ralink,rt3883-gdma";
+ reg = <0x2800 0x800>;
+
+ resets = <&rstctrl 14>;
+ reset-names = "dma";
+
+ interrupt-parent = <&intc>;
+ interrupts = <7>;
+
+ #dma-cells = <1>;
+ #dma-channels = <16>;
+ #dma-requests = <16>;
+
+ status = "disabled";
+ };
};
- pinctrl {
+ pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
@@ -229,7 +246,12 @@
#reset-cells = <1>;
};
- ethernet@10100000 {
+ clkctrl: clkctrl {
+ compatible = "ralink,rt2880-clock";
+ #clock-cells = <1>;
+ };
+
+ ethernet: ethernet@10100000 {
compatible = "ralink,rt3352-eth", "ralink,rt3050-eth";
reg = <0x10100000 0x10000>;
@@ -259,9 +281,11 @@
resets = <&rstctrl 22 &rstctrl 25>;
reset-names = "host", "device";
+ clocks = <&clkctrl 18 &clkctrl 20>;
+ clock-names = "host", "device";
};
- wmac@10180000 {
+ wmac: wmac@10180000 {
compatible = "ralink,rt3352-wmac", "ralink,rt2880-wmac";
reg = <0x10180000 0x40000>;
@@ -271,7 +295,7 @@
ralink,eeprom = "soc_wmac.eeprom";
};
- ehci@101c0000 {
+ ehci: ehci@101c0000 {
compatible = "generic-ehci";
reg = <0x101c0000 0x1000>;
@@ -284,7 +308,7 @@
status = "disabled";
};
- ohci@101c1000 {
+ ohci: ohci@101c1000 {
compatible = "generic-ohci";
reg = <0x101c1000 0x1000>;
diff --git a/target/linux/ramips/dts/rt3883.dtsi b/target/linux/ramips/dts/rt3883.dtsi
index 9f0c96f15f..041b0633d3 100644
--- a/target/linux/ramips/dts/rt3883.dtsi
+++ b/target/linux/ramips/dts/rt3883.dtsi
@@ -26,7 +26,7 @@
compatible = "mti,cpu-interrupt-controller";
};
- palmbus@10000000 {
+ palmbus: palmbus@10000000 {
compatible = "palmbus";
reg = <0x10000000 0x200000>;
ranges = <0x0 0x10000000 0x1FFFFF>;
@@ -34,12 +34,12 @@
#address-cells = <1>;
#size-cells = <1>;
- sysc@0 {
+ sysc: sysc@0 {
compatible = "ralink,rt3883-sysc", "ralink,rt3050-sysc";
reg = <0x0 0x100>;
};
- timer@100 {
+ timer: timer@100 {
compatible = "ralink,rt3883-timer", "ralink,rt2880-timer";
reg = <0x100 0x20>;
@@ -47,7 +47,7 @@
interrupts = <1>;
};
- watchdog@120 {
+ watchdog: watchdog@120 {
compatible = "ralink,rt3883-wdt", "ralink,rt2880-wdt";
reg = <0x120 0x10>;
@@ -72,7 +72,7 @@
interrupts = <2>;
};
- memc@300 {
+ memc: memc@300 {
compatible = "ralink,rt3883-memc", "ralink,rt3050-memc";
reg = <0x300 0x100>;
@@ -83,7 +83,7 @@
interrupts = <3>;
};
- uart@500 {
+ uart: uart@500 {
compatible = "ralink,rt3883-uart", "ralink,rt2880-uart", "ns16550a";
reg = <0x500 0x100>;
@@ -211,9 +211,26 @@
pinctrl-names = "default";
pinctrl-0 = <&uartlite_pins>;
};
+
+ gdma: gdma@2800 {
+ compatible = "ralink,rt3883-gdma";
+ reg = <0x2800 0x800>;
+
+ resets = <&rstctrl 14>;
+ reset-names = "dma";
+
+ interrupt-parent = <&intc>;
+ interrupts = <7>;
+
+ #dma-cells = <1>;
+ #dma-channels = <16>;
+ #dma-requests = <16>;
+
+ status = "disabled";
+ };
};
- pinctrl {
+ pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
@@ -244,7 +261,7 @@
};
};
- ethernet@10100000 {
+ ethernet: ethernet@10100000 {
compatible = "ralink,rt3883-eth";
reg = <0x10100000 0x10000>;
@@ -272,7 +289,12 @@
#reset-cells = <1>;
};
- pci@10140000 {
+ clkctrl: clkctrl {
+ compatible = "ralink,rt2880-clock";
+ #clock-cells = <1>;
+ };
+
+ pci: pci@10140000 {
compatible = "ralink,rt3883-pci";
reg = <0x10140000 0x20000>;
#address-cells = <1>;
@@ -364,9 +386,11 @@
resets = <&rstctrl 22 &rstctrl 25>;
reset-names = "host", "device";
+ clocks = <&clkctrl 22 &clkctrl 25>;
+ clock-names = "host", "device";
};
- wmac@10180000 {
+ wmac: wmac@10180000 {
compatible = "ralink,rt3883-wmac", "ralink,rt2880-wmac";
reg = <0x10180000 0x40000>;
@@ -376,7 +400,7 @@
ralink,eeprom = "soc_wmac.eeprom";
};
- ehci@101c0000 {
+ ehci: ehci@101c0000 {
compatible = "generic-ehci";
reg = <0x101c0000 0x1000>;
@@ -389,7 +413,7 @@
status = "disabled";
};
- ohci@101c1000 {
+ ohci: ohci@101c1000 {
compatible = "generic-ohci";
reg = <0x101c1000 0x1000>;
diff --git a/target/linux/ramips/dts/rt5350.dtsi b/target/linux/ramips/dts/rt5350.dtsi
index 93c95c8605..1027519c98 100644
--- a/target/linux/ramips/dts/rt5350.dtsi
+++ b/target/linux/ramips/dts/rt5350.dtsi
@@ -26,7 +26,7 @@
serial0 = &uartlite;
};
- palmbus@10000000 {
+ palmbus: palmbus@10000000 {
compatible = "palmbus";
reg = <0x10000000 0x200000>;
ranges = <0x0 0x10000000 0x1FFFFF>;
@@ -34,12 +34,12 @@
#address-cells = <1>;
#size-cells = <1>;
- sysc@0 {
+ sysc: sysc@0 {
compatible = "ralink,rt5350-sysc", "ralink,rt3050-sysc";
reg = <0x0 0x100>;
};
- timer@100 {
+ timer: timer@100 {
compatible = "ralink,rt5350-timer", "ralink,rt2880-timer";
reg = <0x100 0x20>;
@@ -47,7 +47,7 @@
interrupts = <1>;
};
- watchdog@120 {
+ watchdog: watchdog@120 {
compatible = "ralink,rt5350-wdt", "ralink,rt2880-wdt";
reg = <0x120 0x10>;
@@ -72,7 +72,7 @@
interrupts = <2>;
};
- memc@300 {
+ memc: memc@300 {
compatible = "ralink,rt5350-memc", "ralink,rt3050-memc";
reg = <0x300 0x100>;
@@ -83,7 +83,7 @@
interrupts = <3>;
};
- uart@500 {
+ uart: uart@500 {
compatible = "ralink,rt5350-uart", "ralink,rt2880-uart", "ns16550a";
reg = <0x500 0x100>;
@@ -137,7 +137,7 @@
status = "disabled";
};
- i2c@900 {
+ i2c: i2c@900 {
compatible = "link,rt5350-i2c", "ralink,rt2880-i2c";
reg = <0x900 0x100>;
@@ -161,7 +161,7 @@
reset-names = "spi";
#address-cells = <1>;
- #size-cells = <1>;
+ #size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi_pins>;
@@ -201,16 +201,33 @@
reg-shift = <2>;
};
- systick@d00 {
+ systick: systick@d00 {
compatible = "ralink,rt5350-systick", "ralink,cevt-systick";
reg = <0xd00 0x10>;
interrupt-parent = <&cpuintc>;
interrupts = <7>;
};
+
+ gdma: gdma@2800 {
+ compatible = "ralink,rt3883-gdma";
+ reg = <0x2800 0x800>;
+
+ resets = <&rstctrl 14>;
+ reset-names = "dma";
+
+ interrupt-parent = <&intc>;
+ interrupts = <7>;
+
+ #dma-cells = <1>;
+ #dma-channels = <16>;
+ #dma-requests = <16>;
+
+ status = "disabled";
+ };
};
- pinctrl {
+ pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
@@ -267,15 +284,22 @@
#reset-cells = <1>;
};
+ clkctrl: clkctrl {
+ compatible = "ralink,rt2880-clock";
+ #clock-cells = <1>;
+ };
+
usbphy: usbphy {
compatible = "ralink,rt3352-usbphy";
#phy-cells = <1>;
resets = <&rstctrl 22 &rstctrl 25>;
reset-names = "host", "device";
+ clocks = <&clkctrl 18>;
+ clock-names = "host";
};
- ethernet@10100000 {
+ ethernet: ethernet@10100000 {
compatible = "ralink,rt5350-eth";
reg = <0x10100000 0x10000>;
@@ -289,7 +313,7 @@
};
esw: esw@10110000 {
- compatible = "ralink,rt3050-esw";
+ compatible = "ralink,rt5350-esw", "ralink,rt3050-esw";
reg = <0x10110000 0x8000>;
resets = <&rstctrl 23>;
@@ -299,7 +323,7 @@
interrupts = <17>;
};
- wmac@10180000 {
+ wmac: wmac@10180000 {
compatible = "ralink,rt5350-wmac", "ralink,rt2880-wmac";
reg = <0x10180000 0x40000>;
@@ -309,7 +333,7 @@
ralink,eeprom = "soc_wmac.eeprom";
};
- ehci@101c0000 {
+ ehci: ehci@101c0000 {
compatible = "generic-ehci";
reg = <0x101c0000 0x1000>;
@@ -320,7 +344,7 @@
interrupts = <18>;
};
- ohci@101c1000 {
+ ohci: ohci@101c1000 {
compatible = "generic-ohci";
reg = <0x101c1000 0x1000>;
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 09c0ec27a0..b1afb82c00 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -2,180 +2,414 @@
# MT7620A Profiles
#
-# sign trednet / UMedia images
-define BuildFirmware/UMedia/squashfs
- $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3))
- if [ -e "$(call sysupname,$(1),$(2))" ]; then \
- fix-u-media-header -T 0x46 -B $(4) \
- -i $(call sysupname,$(1),$(2)) \
- -o $(call imgname,$(1),$(2))-factory.bin; \
- fi
-endef
-BuildFirmware/UMedia/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
-
-# $(1): (ignored)
-# $(2): lowercase board name
-# $(3): uppercase board name (must match DTS filename w/o extension)
-# $(4): erase block size
-# $(5): hardware id for mkdniimg
-# $(6): maximum image size
-define BuildFirmware/Netgear/squashfs
- $(call PatchKernelLzmaDtb,$(2),$(3))
- # Pad kernel to eraseblock boundary, minus 2 uImage headers (=128 bytes):
- # bs = (eraseblock * (1 + (128 + kernelsize)/eraseblock)) - 128
- dd if=$(KDIR)/vmlinux-$(2).bin.lzma \
- of=$(KDIR)/vmlinux-$(2).bin.lzma.tmp \
- bs=`expr \( $(4) \* \( 1 + \( 128 + \`wc -c < $(KDIR)/vmlinux-$(2).bin.lzma\` \) / $(4) \) \) - 128` \
- count=1 conv=sync
-
- $(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma.tmp,$(KDIR)/vmlinux-$(2).uImage)
- cat ex2700-fakeroot.uImage >> $(KDIR)/vmlinux-$(2).uImage
- $(call MkImageSysupgrade/squashfs,squashfs,$(2),$(6))
+define Build/tplink-header
+ $(STAGING_DIR_HOST)/bin/mktplinkfw2 -a 0x4 -V "ver. 2.0" -B $(1) \
+ -o $@.new -k $@ && mv $@.new $@
+endef
+
+define Build/pad-kernel-ex2700
+ cp $@ $@.tmp && dd if=/dev/zero bs=64 count=1 >> $@.tmp \
+ && dd if=$@.tmp of=$@.new bs=64k conv=sync && truncate -s -64 $@.new \
+ && cat ex2700-fakeroot.uImage >> $@.new && rm $@.tmp && mv $@.new $@
+endef
+define Build/netgear-header
$(STAGING_DIR_HOST)/bin/mkdniimg \
- -B $(3) -H $(5) -v OpenWrt \
- -i $(call imgname,squashfs,$(2))-sysupgrade.bin \
- -o $(call imgname,squashfs,$(2))-factory.bin
-endef
-
-define MkImageTpl/squashfs
- $(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-$(if $(4),$(4),sysupgrade).bin)
- -$(STAGING_DIR_HOST)/bin/mktplinkfw2 -V "ver. 2.0" -B "$(2)" -j \
- -o $(KDIR)/$(output_name) \
- -k $(KDIR)/vmlinux-$(1)$(4).bin.lzma \
- -r $(KDIR)/root.$(1) && \
- $(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name)
-endef
-define MkImageTpl/initramfs
- $(eval output_name=$(IMG_PREFIX)-$(2)-$(1).bin)
- -$(STAGING_DIR_HOST)/bin/mktplinkfw2 -V "ver. 2.0" -B "$(2)" -c \
- -o $(KDIR)/$(output_name) \
- -k $(KDIR)/vmlinux-$(1).bin.lzma && \
- $(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name)
-endef
-define BuildFirmware/OF/tplink
- $(call PatchKernelLzmaDtb,$(1),$(2),$(4))
- $(call MkImageTpl/$(1),$(1),$(2),$(4),$(5))
-endef
-define BuildFirmware/OF/tplink/initramfs
- $(call PatchKernelLzmaDtb,$(2),$(3),-initramfs)
- $(call MkImageTpl/$(1),$(1),$(2),$(4),$(5))
-endef
-BuildFirmware/Tplink/squashfs=$(call BuildFirmware/OF/tplink,$(1),$(2),$(3),$(4))
-BuildFirmware/Tplink/initramfs=$(call BuildFirmware/OF/tplink/initramfs,$(1),$(2),$(3),$(4))
-
-define BuildFirmware/WRH-300CR/squashfs
- $(call BuildFirmware/Default16M/squashfs,$(1),$(2),$(3))
- cp $(call sysupname,$(1),$(2)) $(KDIR)/v_0.0.0.bin
+ $(1) -v OpenWrt -i $@ \
+ -o $@.new && mv $@.new $@
+endef
+
+define Build/poray-header
+ mkporayfw $(1) \
+ -f $@ \
+ -o $@.new; \
+ mv $@.new $@
+endef
+
+define Build/umedia-header
+ fix-u-media-header -T 0x46 -B $(1) -i $@ -o $@.new && mv $@.new $@
+endef
+
+define Build/elecom-header
+ cp $@ $(KDIR)/v_0.0.0.bin
( \
$(STAGING_DIR_HOST)/bin/md5sum $(KDIR)/v_0.0.0.bin | \
sed 's/ .*//' && \
echo 458 \
) | $(STAGING_DIR_HOST)/bin/md5sum | \
sed 's/ .*//' > $(KDIR)/v_0.0.0.md5
- $(STAGING_DIR_HOST)/bin/tar -cf $(call imgname,$(1),$(2))-factory.bin -C $(KDIR) v_0.0.0.bin v_0.0.0.md5
+ $(STAGING_DIR_HOST)/bin/tar -cf $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5
+endef
+
+define Device/ArcherC20i
+ DTS := ArcherC20i
+ KERNEL := $(KERNEL_DTB)
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC20i -c
+ IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC20i -j -r $(KDIR)/root.squashfs
+ DEVICE_TITLE := TP-Link ArcherC20i
endef
-BuildFirmware/WRH-300CR/initramfs=$(call BuildFirmware/Default16M/initramfs,$(1),$(2),$(3))
+TARGET_DEVICES += ArcherC20i
+define Device/ArcherC50
+ DTS := ArcherC50
+ KERNEL := $(KERNEL_DTB)
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC50 -c
+ IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC50 -j -r $(KDIR)/root.squashfs
+ DEVICE_TITLE := TP-Link ArcherC50
+endef
+TARGET_DEVICES += ArcherC50
-Image/Build/Profile/E1700=$(call BuildFirmware/UMedia/$(1),$(1),e1700,E1700,0x013326)
ex2700_mtd_size=3866624
-Image/Build/Profile/EX2700=$(call BuildFirmware/Netgear/$(1),$(1),ex2700,EX2700,65536,29764623+4+0+32+2x2+0,$(ex2700_mtd_size))
-Image/Build/Profile/MT7620a=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a,MT7620a)
-Image/Build/Profile/MT7620a_MT7610e=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7610e,MT7620a_MT7610e)
-Image/Build/Profile/MT7620a_MT7530=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7530,MT7620a_MT7530)
-Image/Build/Profile/MT7620a_V22SG=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_v22sg,MT7620a_V22SG)
+define Device/ex2700
+ DTS := EX2700
+ IMAGE_SIZE := $(ex2700_mtd_size)
+ IMAGES += factory.bin
+ KERNEL := $(KERNEL_DTB) | uImage lzma | pad-kernel-ex2700
+ IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | netgear-header -B EX2700 -H 29764623+4+0+32+2x2+0
+ DEVICE_TITLE := Netgear EX2700
+endef
+TARGET_DEVICES += ex2700
+
+define Device/wt3020-4M
+ DTS := WT3020-4M
+ IMAGE_SIZE := $(ralink_default_fw_size_4M)
+ IMAGES += factory.bin
+ IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | poray-header -B WT3020 -F 4M
+ DEVICE_TITLE := Nexx WT3020 (4MB)
+endef
+TARGET_DEVICES += wt3020-4M
+
+define Device/wt3020-8M
+ DTS := WT3020-8M
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ IMAGES += factory.bin
+ IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | poray-header -B WT3020 -F 8M
+ DEVICE_TITLE := Nexx WT3020 (8MB)
+endef
+TARGET_DEVICES += wt3020-8M
+
+define Device/wrh-300cr
+ DTS := WRH-300CR
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ IMAGES += factory.bin
+ IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | elecom-header
+ DEVICE_TITLE := Elecom WRH-300CR
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
+endef
+TARGET_DEVICES += wrh-300cr
+
+define Device/e1700
+ DTS := E1700
+ IMAGES += factory.bin
+ IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x013326
+ DEVICE_TITLE := Linksys E1700
+endef
+TARGET_DEVICES += e1700
+
br100_mtd_size=8126464
-Image/Build/Profile/AI-BR100=$(call BuildFirmware/CustomFlash/$(1),$(1),ai-br100,AI-BR100,$(br100_mtd_size),Ai-BR)
-Image/Build/Profile/RP-N53=$(call BuildFirmware/Default8M/$(1),$(1),rp-n53,RP-N53)
+define Device/ai-br100
+ DTS := AI-BR100
+ IMAGE_SIZE := $(br100_mtd_size)
+ DEVICE_TITLE := Aigale Ai-BR100
+ DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci
+endef
+TARGET_DEVICES += ai-br100
+
whr_300hp2_mtd_size=7012352
-Image/Build/Profile/WHR300HP2=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-300hp2,WHR-300HP2,$(whr_300hp2_mtd_size))
-Image/Build/Profile/WHR600D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-600d,WHR-600D,$(whr_300hp2_mtd_size))
+define Device/whr-300hp2
+ DTS := WHR-300HP2
+ IMAGE_SIZE := $(whr_300hp2_mtd_size)
+ DEVICE_TITLE := Buffalo WHR-300HP2
+endef
+TARGET_DEVICES += whr-300hp2
+
+define Device/whr-600d
+ DTS := WHR-600D
+ IMAGE_SIZE := $(whr_300hp2_mtd_size)
+ DEVICE_TITLE := Buffalo WHR-600D
+endef
+TARGET_DEVICES += whr-600d
+
whr_1166d_mtd_size=15400960
-Image/Build/Profile/WHR1166D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-1166d,WHR-1166D,$(whr_1166d_mtd_size))
+define Device/whr-1166d
+ DTS := WHR-1166D
+ IMAGE_SIZE := $(whr_1166d_mtd_size)
+ DEVICE_TITLE := Buffalo WHR-1166D
+endef
+TARGET_DEVICES += whr-1166d
+
dlink810l_mtd_size=6881280
-Image/Build/Profile/CF-WR800N=$(call BuildFirmware/Default8M/$(1),$(1),cf-wr800n,CF-WR800N)
-Image/Build/Profile/CS-QR10=$(call BuildFirmware/Default8M/$(1),$(1),cs-qr10,CS-QR10)
-Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
+define Device/dir-810l
+ DTS := DIR-810L
+ IMAGE_SIZE := $(dlink810l_mtd_size)
+ DEVICE_TITLE := D-Link DIR-810L
+endef
+TARGET_DEVICES += dir-810l
+
na930_mtd_size=20971520
-Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
-Image/Build/Profile/DB-WRT01=$(call BuildFirmware/Default8M/$(1),$(1),db-wrt01,DB-WRT01)
-Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
-Image/Build/Profile/MZK-EX300NP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-ex300np,MZK-EX300NP)
-Image/Build/Profile/MZK-EX750NP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-ex750np,MZK-EX750NP)
-Image/Build/Profile/HC5661=$(call BuildFirmware/Default16M/$(1),$(1),hc5661,HC5661)
-Image/Build/Profile/HC5761=$(call BuildFirmware/Default16M/$(1),$(1),hc5761,HC5761)
-Image/Build/Profile/HC5861=$(call BuildFirmware/Default16M/$(1),$(1),hc5861,HC5861)
-Image/Build/Profile/OY-0001=$(call BuildFirmware/Default16M/$(1),$(1),oy-0001,OY-0001)
-Image/Build/Profile/PSG1208=$(call BuildFirmware/Default8M/$(1),$(1),psg1208,PSG1208)
-Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),y1,Y1)
-Image/Build/Profile/Y1S=$(call BuildFirmware/Default16M/$(1),$(1),y1s,Y1S)
-Image/Build/Profile/MLW221=$(call BuildFirmware/Default16M/$(1),$(1),mlw221,MLW221)
-Image/Build/Profile/MLWG2=$(call BuildFirmware/Default16M/$(1),$(1),mlwg2,MLWG2)
-Image/Build/Profile/WMR-300=$(call BuildFirmware/Default8M/$(1),$(1),wmr-300,WMR-300)
-Image/Build/Profile/RT-N14U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n14u,RT-N14U)
-Image/Build/Profile/WRH-300CR=$(call BuildFirmware/WRH-300CR/$(1),$(1),wrh-300cr,WRH-300CR)
-Image/Build/Profile/WRTNODE=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode,WRTNODE)
-Image/Build/Profile/WT3020=$(call BuildFirmware/PorayDualSize/$(1),$(1),wt3020,WT3020)
-Image/Build/Profile/MIWIFI-MINI=$(call BuildFirmware/Default16M/$(1),$(1),miwifi-mini,MIWIFI-MINI)
-Image/Build/Profile/GL-MT300A=$(call BuildFirmware/Default16M/$(1),$(1),gl-mt300a,GL-MT300A)
-Image/Build/Profile/GL-MT300N=$(call BuildFirmware/Default16M/$(1),$(1),gl-mt300n,GL-MT300N)
-Image/Build/Profile/GL-MT750=$(call BuildFirmware/Default16M/$(1),$(1),gl-mt750,GL-MT750)
-Image/Build/Profile/ZTE-Q7=$(call BuildFirmware/Default8M/$(1),$(1),zte-q7,ZTE-Q7)
-Image/Build/Profile/YOUKU-YK1=$(call BuildFirmware/Default16M/$(1),$(1),youku-yk1,YOUKU-YK1)
-Image/Build/Profile/ZBT-WA05=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wa05,ZBT-WA05)
-Image/Build/Profile/ZBT-WE826=$(call BuildFirmware/Default16M/$(1),$(1),zbt-we826,ZBT-WE826)
-Image/Build/Profile/ZBT-WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wr8305rt,ZBT-WR8305RT)
-Image/Build/Profile/ArcherC20i=$(call BuildFirmware/Tplink/$(1),$(1),ArcherC20i,ArcherC20i)
+define Device/na930
+ DTS := NA930
+ IMAGE_SIZE := $(na930_mtd_size)
+ DEVICE_TITLE := Sercomm NA930
+endef
+TARGET_DEVICES += na930
+
microwrt_mtd_size=16515072
-Image/Build/Profile/MicroWRT=$(call BuildFirmware/CustomFlash/$(1),$(1),microwrt,MicroWRT,$(microwrt_mtd_size))
-Image/Build/Profile/TINY-AC=$(call BuildFirmware/Default8M/$(1),$(1),tiny-ac,TINY-AC)
-
-
-define Image/Build/Profile/Default
- $(call Image/Build/Profile/E1700,$(1))
- $(call Image/Build/Profile/EX2700,$(1))
- $(call Image/Build/Profile/MT7620a,$(1))
- $(call Image/Build/Profile/MT7620a_MT7610e,$(1))
- $(call Image/Build/Profile/MT7620a_MT7530,$(1))
- $(call Image/Build/Profile/MT7620a_V22SG,$(1))
- $(call Image/Build/Profile/AI-BR100,$(1))
- $(call Image/Build/Profile/CF-WR800N,$(1))
- $(call Image/Build/Profile/CS-QR10,$(1))
- $(call Image/Build/Profile/RP-N53,$(1))
- $(call Image/Build/Profile/DIR-810L,$(1))
- $(call Image/Build/Profile/WHR300HP2,$(1))
- $(call Image/Build/Profile/WHR600D,$(1))
- $(call Image/Build/Profile/WHR1166D,$(1))
- $(call Image/Build/Profile/DB-WRT01,$(1))
- $(call Image/Build/Profile/MZK-750DHP,$(1))
- $(call Image/Build/Profile/MZK-EX300NP,$(1))
- $(call Image/Build/Profile/MZK-EX750NP,$(1))
- $(call Image/Build/Profile/NA930,$(1))
- $(call Image/Build/Profile/HC5661,$(1))
- $(call Image/Build/Profile/HC5761,$(1))
- $(call Image/Build/Profile/HC5861,$(1))
- $(call Image/Build/Profile/OY-0001,$(1))
- $(call Image/Build/Profile/PSG1208,$(1))
- $(call Image/Build/Profile/Y1,$(1))
- $(call Image/Build/Profile/Y1S,$(1))
- $(call Image/Build/Profile/MLW221,$(1))
- $(call Image/Build/Profile/MLWG2,$(1))
- $(call Image/Build/Profile/WMR-300,$(1))
- $(call Image/Build/Profile/RT-N14U,$(1))
- $(call Image/Build/Profile/WRH-300CR,$(1))
- $(call Image/Build/Profile/WRTNODE,$(1))
- $(call Image/Build/Profile/WT3020,$(1))
- $(call Image/Build/Profile/MIWIFI-MINI,$(1))
- $(call Image/Build/Profile/GL-MT300A,$(1))
- $(call Image/Build/Profile/GL-MT300N,$(1))
- $(call Image/Build/Profile/GL-MT750,$(1))
- $(call Image/Build/Profile/ZTE-Q7,$(1))
- $(call Image/Build/Profile/YOUKU-YK1,$(1))
- $(call Image/Build/Profile/ZBT-WA05,$(1))
- $(call Image/Build/Profile/ZBT-WE826,$(1))
- $(call Image/Build/Profile/ZBT-WR8305RT,$(1))
- $(call Image/Build/Profile/ArcherC20i,$(1))
- $(call Image/Build/Profile/MicroWRT,$(1))
- $(call Image/Build/Profile/TINY-AC,$(1))
+define Device/microwrt
+ DTS := MicroWRT
+ IMAGE_SIZE := $(microwrt_mtd_size)
+ DEVICE_TITLE := Microduino MicroWRT
+endef
+TARGET_DEVICES += microwrt
+
+define Device/mt7620a
+ DTS := MT7620a
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := MediaTek MT7620a EVB
+endef
+TARGET_DEVICES += mt7620a
+
+define Device/mt7620a_mt7610e
+ DTS := MT7620a_MT7610e
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := MediaTek MT7620a + MT7610e EVB
+endef
+TARGET_DEVICES += mt7620a_mt7610e
+
+define Device/mt7620a_mt7530
+ DTS := MT7620a_MT7530
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := MediaTek MT7620a + MT7530 EVB
+endef
+TARGET_DEVICES += mt7620a_mt7530
+
+define Device/mt7620a_v22sg
+ DTS := MT7620a_V22SG
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := MediaTek MT7620a V22SG
+endef
+TARGET_DEVICES += mt7620a_v22sg
+
+define Device/rp-n53
+ DTS := RP-N53
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Asus RP-N53
+endef
+TARGET_DEVICES += rp-n53
+
+define Device/cf-wr800n
+ DTS := CF-WR800N
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Comfast CF-WR800N
+endef
+TARGET_DEVICES += cf-wr800n
+
+define Device/cs-qr10
+ DTS := CS-QR10
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Planex CS-QR10
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-i2c-core kmod-i2c-ralink kmod-sound-core kmod-sound-mtk kmod-sdhci-mt7620
+endef
+TARGET_DEVICES += cs-qr10
+
+define Device/db-wrt01
+ DTS := DB-WRT01
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Planex DB-WRT01
+endef
+TARGET_DEVICES += db-wrt01
+
+define Device/mzk-750dhp
+ DTS := MZK-750DHP
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Planex MZK-750DHP
+ DEVICE_PACKAGES := kmod-mt76
+endef
+TARGET_DEVICES += mzk-750dhp
+
+define Device/mzk-ex300np
+ DTS := MZK-EX300NP
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Planex MZK-EX300NP
+endef
+TARGET_DEVICES += mzk-ex300np
+
+define Device/mzk-ex750np
+ DTS := MZK-EX750NP
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Planex MZK-EX750NP
+ DEVICE_PACKAGES := kmod-mt76
+endef
+TARGET_DEVICES += mzk-ex750np
+
+define Device/hc5661
+ DTS := HC5661
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := HiWiFi HC5661
+ DEVICE_PACKAGES := kmod-usb2 kmod-sdhci kmod-sdhci-mt7620 kmod-ledtrig-usbdev
+endef
+TARGET_DEVICES += hc5661
+
+define Device/hc5761
+ DTS := HC5761
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := HiWiFi HC5761
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci kmod-sdhci-mt7620 kmod-ledtrig-usbdev
+endef
+TARGET_DEVICES += hc5761
+
+define Device/hc5861
+ DTS := HC5861
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := HiWiFi HC5861
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci kmod-sdhci-mt7620 kmod-ledtrig-usbdev
+endef
+TARGET_DEVICES += hc5861
+
+define Device/oy-0001
+ DTS := OY-0001
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Oh Yeah OY-0001
+endef
+TARGET_DEVICES += oy-0001
+
+define Device/psg1208
+ DTS := PSG1208
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Phicomm PSG1208
+ DEVICE_PACKAGES := kmod-mt76
+endef
+TARGET_DEVICES += psg1208
+
+define Device/y1
+ DTS := Y1
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Lenovo Y1
+endef
+TARGET_DEVICES += y1
+
+define Device/y1s
+ DTS := Y1S
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Lenovo Y1S
+endef
+TARGET_DEVICES += y1s
+
+define Device/mlw221
+ DTS := MLW221
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Kingston MLW221
+endef
+TARGET_DEVICES += mlw221
+
+define Device/mlwg2
+ DTS := MLWG2
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Kingston MLWG2
+endef
+TARGET_DEVICES += mlwg2
+
+define Device/wmr-300
+ DTS := WMR-300
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Buffalo WMR-300
+endef
+TARGET_DEVICES += wmr-300
+
+define Device/rt-n14u
+ DTS := RT-N14U
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Asus RT-N14u
+endef
+TARGET_DEVICES += rt-n14u
+
+define Device/wrtnode
+ DTS := WRTNODE
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := WRTNode
+endef
+TARGET_DEVICES += wrtnode
+
+define Device/miwifi-mini
+ DTS := MIWIFI-MINI
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Xiaomi MiWiFi Mini
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
+endef
+TARGET_DEVICES += miwifi-mini
+
+define Device/gl-mt300a
+ DTS := GL-MT300A
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := GL-Inet GL-MT300A
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76
+endef
+TARGET_DEVICES += gl-mt300a
+
+define Device/gl-mt300n
+ DTS := GL-MT300N
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := GL-Inet GL-MT300N
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76
+endef
+TARGET_DEVICES += gl-mt300n
+
+define Device/gl-mt750
+ DTS := GL-MT750
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := GL-Inet GL-MT750
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76
+endef
+TARGET_DEVICES += gl-mt750
+
+define Device/zte-q7
+ DTS := ZTE-Q7
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := ZTE Q7
+endef
+TARGET_DEVICES += zte-q7
+
+define Device/youku-yk1
+ DTS := YOUKU-YK1
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := YOUKU YK1
+endef
+TARGET_DEVICES += youku-yk1
+
+define Device/zbt-ape522ii
+ DTS := ZBT-APE522II
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Zbtlink ZBT-APE522II
+ DEVICE_PACKAGES := kmod-mt76
+endef
+TARGET_DEVICES += zbt-ape522ii
+
+define Device/zbt-wa05
+ DTS := ZBT-WA05
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Zbtlink ZBT-WA05
+endef
+TARGET_DEVICES += zbt-wa05
+
+define Device/zbt-we826
+ DTS := ZBT-WE826
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Zbtlink ZBT-WE826
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 kmod-sdhci-mt7620
+endef
+TARGET_DEVICES += zbt-we826
+
+define Device/zbt-wr8305rt
+ DTS := ZBT-WR8305RT
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Zbtlink ZBT-WR8305RT
+endef
+TARGET_DEVICES += zbt-wr8305rt
+
+define Device/tiny-ac
+ DTS := TINY-AC
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := Dovado Tiny AC
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
endef
+TARGET_DEVICES += tiny-ac
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 1b8d3dae87..31752446ac 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -36,17 +36,20 @@ endef
define Device/mt7621
DTS := MT7621
IMAGE_SIZE := $(ralink_default_fw_size_4M)
+ DEVICE_TITLE := MediaTek MT7621 EVB
endef
TARGET_DEVICES += mt7621
define Device/wsr-600
DTS := WSR-600
IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Buffalo WSR-600
endef
TARGET_DEVICES += wsr-600
define Device/re6500
DTS := RE6500
+ DEVICE_TITLE := Linksys RE6500
endef
TARGET_DEVICES += re6500
@@ -54,6 +57,7 @@ define Device/wsr-1166
DTS := WSR-1166
IMAGE/sysupgrade.bin := trx | pad-rootfs
IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Buffalo WSR-1166
endef
TARGET_DEVICES += wsr-1166
@@ -71,47 +75,64 @@ define Device/dir-860l-b1
seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
check-size $$$$(IMAGE_SIZE)
+ DEVICE_TITLE := D-Link DIR-860L B1
endef
TARGET_DEVICES += dir-860l-b1
define Device/firewrt
DTS := FIREWRT
IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Firefly FireWRT
+ DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev
endef
TARGET_DEVICES += firewrt
define Device/pbr-m1
DTS := PBR-M1
IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := PBR-M1
+ DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
+ kmod-rtc-pcf8563 kmod-i2c-mt7621
endef
TARGET_DEVICES += pbr-m1
define Device/sap-g3200u3
DTS := SAP-G3200U3
+ DEVICE_TITLE := STORYLiNK SAP-G3200U3
+ DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev
endef
TARGET_DEVICES += sap-g3200u3
define Device/witi
DTS := WITI
IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := MQmaker WiTi
+ DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
+ kmod-rtc-pcf8563 kmod-i2c-mt7621
endef
TARGET_DEVICES += witi
define Device/wndr3700v5
DTS := WNDR3700V5
IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Netgear WNDR3700v5
+ DEVICE_PACKAGES := kmod-usb3
endef
TARGET_DEVICES += wndr3700v5
define Device/zbt-wg2626
DTS := ZBT-WG2626
IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := ZBT WG2626
+ DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci
endef
TARGET_DEVICES += zbt-wg2626
define Device/zbt-wg3526
DTS := ZBT-WG3526
IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := ZBT WG3526
+ DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci
endef
TARGET_DEVICES += zbt-wg3526
@@ -123,6 +144,8 @@ define Device/wf-2881
IMAGE_SIZE := 132382720
KERNEL := $(KERNEL_DTB) | pad-offset 131072 64 | uImage lzma
IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
+ DEVICE_TITLE := NETIS WF-2881
+ DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev
endef
TARGET_DEVICES += wf-2881
@@ -135,9 +158,19 @@ define Device/ubnt-erx
KERNEL_INITRAMFS := $$(KERNEL) | check-size $$(KERNEL_SIZE) | \
ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
IMAGE/sysupgrade.tar := sysupgrade-nand
+ DEVICE_TITLE := Ubiquiti EdgeRouter X
+ DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2800-pci -kmod-cfg80211 -wpad-mini -iwinfo
endef
TARGET_DEVICES += ubnt-erx
+define Device/sk-wb8
+ DTS := SK-WB8
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := SamKnows Whitebox 8
+ DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev uboot-envtools
+endef
+TARGET_DEVICES += sk-wb8
+
# FIXME: is this still needed?
define Image/Prepare
#define Build/Compile
diff --git a/target/linux/ramips/image/mt7628.mk b/target/linux/ramips/image/mt7628.mk
index 1e6b06c82c..fa7d1e77f2 100644
--- a/target/linux/ramips/image/mt7628.mk
+++ b/target/linux/ramips/image/mt7628.mk
@@ -2,16 +2,34 @@
# MT7628 Profiles
#
-Image/Build/Profile/MIWIFI-NANO=$(call BuildFirmware/Default16M/$(1),$(1),miwifi-nano,MIWIFI-NANO)
-Image/Build/Profile/MT7628=$(call BuildFirmware/Default4M/$(1),$(1),mt7628,MT7628)
-Image/Build/Profile/WRTNODE2P=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode2p,WRTNODE2P)
+define Device/mt7628
+ DTS := MT7628
+ IMAGE_SIZE := $(ralink_default_fw_size_4M)
+ DEVICE_TITLE := MediaTek MT7628 EVB
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+TARGET_DEVICES += mt7628
+
+define Device/miwifi-nano
+ DTS := MIWIFI-NANO
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Xiaomi MiWiFi Nano
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+TARGET_DEVICES += miwifi-nano
-define Image/Build/Profile/Default
- $(call Image/Build/Profile/MIWIFI-NANO,$(1))
- $(call Image/Build/Profile/MT7628,$(1))
- $(call Image/Build/Profile/WRTNODE2P,$(1))
+define Device/wrtnode2p
+ DTS := WRTNODE2P
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := WRTnode 2P
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
endef
+TARGET_DEVICES += wrtnode2p
-define Image/Build/Profile/MiwifiNano
- $(call Image/Build/Profile/MIWIFI-NANO,$(1))
+define Device/duzun-dm06
+ DTS := DUZUN-DM06
+ IMAGE_SIZE := $(ralink_default_fw_size_8M)
+ DEVICE_TITLE := DuZun DM06
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
endef
+TARGET_DEVICES += duzun-dm06
diff --git a/target/linux/ramips/image/mt7688.mk b/target/linux/ramips/image/mt7688.mk
index 45991d0874..ffd92d21c6 100644
--- a/target/linux/ramips/image/mt7688.mk
+++ b/target/linux/ramips/image/mt7688.mk
@@ -2,10 +2,26 @@
# MT7688 Profiles
#
-Image/Build/Profile/LinkIt7688=$(call BuildFirmware/Default32M/$(1),$(1),LinkIt7688,LINKIT7688)
-Image/Build/Profile/WRTNODE2R=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode2r,WRTNODE2R)
+define Device/LinkIt7688
+ DTS := LINKIT7688
+ IMAGE_SIZE := $(ralink_default_fw_size_32M)
+ DEVICE_TITLE := MediaTek LinkIt Smart 7688
+ DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools
+endef
+TARGET_DEVICES += LinkIt7688
+
+define Device/wrtnode2r
+ DTS := WRTNODE2R
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := WRTnode 2R
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
+endef
+TARGET_DEVICES += wrtnode2r
-define Image/Build/Profile/Default
- $(call Image/Build/Profile/LinkIt7688,$(1))
- $(call Image/Build/Profile/WRTNODE2R,$(1))
+define Device/widora-neo
+ DTS := WIDORA-NEO
+ IMAGE_SIZE := $(ralink_default_fw_size_16M)
+ DEVICE_TITLE := Widora-NEO
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
endef
+TARGET_DEVICES += widora-neo
diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk
index 475e634a63..8fb5595671 100644
--- a/target/linux/ramips/image/rt288x.mk
+++ b/target/linux/ramips/image/rt288x.mk
@@ -2,58 +2,70 @@
# RT288X Profiles
#
-# Airlink101 AR670W -- LZMA without uImage header
-define BuildFirmware/AR670W/squashfs
- $(call PatchKernelLzmaDtb,$(2),$(3),$(5))
+define Build/gemtek-header
+ mkheader_gemtek $@ $@.new $(1) && mv $@.new $@
+endef
- $(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-$(if $(4),$(4),sysupgrade).bin)
- $(eval factory_name=$(IMG_PREFIX)-$(2)-$(1)-factory.bin)
+define Build/airlink-header
+ mkwrgimg -i $@ \
+ -d "/dev/mtdblock/2" \
+ -s "wrgn16a_airlink_ar670w" \
+ -o $@.new && mv $@.new $@
+endef
- ( dd if=$(KDIR)/vmlinux-$(2).bin.lzma bs=65536 \
- conv=sync; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/$(output_name)
+define Device/ar670w
+ DTS := AR670W
+ DEVICE_TITLE := Airlink AR670W
+ IMAGE_SIZE := $(ralink_default_fw_size_4M)
+ KERNEL := $(KERNEL_DTB)
+ IMAGES += factory.bin
+ IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | gemtek-header ar725w
+endef
+TARGET_DEVICES += ar725w
- $(call prepare_generic_squashfs,$(KDIR)/$(output_name))
+define Device/ar725w
+ DTS := AR725W
+ DEVICE_TITLE := Gemtek AR725W
+ IMAGES += factory.bin
+ IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | gemtek-header ar725w
+endef
+TARGET_DEVICES += ar725w
- if [ `stat -c%s "$(KDIR)/$(output_name)"` \
- -gt $(ralink_default_fw_size_4M) ]; then \
- echo "Warning: $(KDIR)/$(output_name) is too big" >&2; \
- else \
- mkwrgimg -i $(KDIR)/$(output_name) \
- -d "/dev/mtdblock/2" \
- -s "wrgn16a_airlink_ar670w" \
- -o $(BIN_DIR)/$(factory_name); \
- $(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name); \
- fi
+belkin_f5d8235v1_mtd_size=7929856
+define Device/f5d8235v1
+ DTS := F5D8235_V1
+ IMAGE_SIZE := $(belkin_f5d8235v1_mtd_size)
+ DEVICE_TITLE := Belkin F5D8235 V1
+ DEVICE_PACKAGES := kmod-switch-rtl8366s
endef
+TARGET_DEVICES += f5d8235v1
-define BuildFirmware/Gemtek/squashfs
- $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
- if [ -e "$(call sysupname,$(1),$(2))" ]; then \
- mkheader_gemtek "$(call sysupname,$(1),$(2))" \
- "$(call imgname,$(1),$(2))-factory.bin" $(2) || \
- rm -f "$(call imgname,$(1),$(2))-factory.bin"; \
- fi
+define Device/rt-n15
+ DTS := RT-N15
+ IMAGE_SIZE := $(ralink_default_fw_size_4M)
+ DEVICE_TITLE := Asus RT-N15
+ DEVICE_PACKAGES := kmod-switch-rtl8366s
endef
-BuildFirmware/Gemtek/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+TARGET_DEVICES += rt-n15
+define Device/v11st-fe
+ DTS := V11STFE
+ IMAGE_SIZE := $(ralink_default_fw_size_4M)
+ DEVICE_TITLE := Ralink V11ST-FE
+endef
+TARGET_DEVICES += v11st-fe
-Image/Build/Profile/AR670W=$(call BuildFirmware/AR670W/$(1),$(1),ar670w,AR670W)
-Image/Build/Profile/AR725W=$(call BuildFirmware/Gemtek/$(1),$(1),ar725w,AR725W)
-# 0x790000
-belkin_f5d8235v1_mtd_size=7929856
-Image/Build/Profile/F5D8235V1=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235v1,F5D8235_V1,$(belkin_f5d8235v1_mtd_size))
-Image/Build/Profile/RTN15=$(call BuildFirmware/Default4M/$(1),$(1),rt-n15,RT-N15)
-Image/Build/Profile/V11STFE=$(call BuildFirmware/Default4M/$(1),$(1),v11st-fe,V11STFE)
-Image/Build/Profile/WLITX4AG300N=$(call BuildFirmware/Default4M/$(1),$(1),wli-tx4-ag300n,WLI-TX4-AG300N)
-Image/Build/Profile/WZRAGL300NH=$(call BuildFirmware/Default4M/$(1),$(1),wzr-agl300nh,WZR-AGL300NH)
-
-
-define Image/Build/Profile/Default
- $(call Image/Build/Profile/AR670W,$(1))
- $(call Image/Build/Profile/AR725W,$(1))
- $(call Image/Build/Profile/F5D8235V1,$(1))
- $(call Image/Build/Profile/RTN15,$(1))
- $(call Image/Build/Profile/V11STFE,$(1))
- $(call Image/Build/Profile/WLITX4AG300N,$(1))
- $(call Image/Build/Profile/WZRAGL300NH,$(1))
+define Device/wli-tx4-ag300n
+ DTS := WLI-TX4-AG300N
+ IMAGE_SIZE := $(ralink_default_fw_size_4M)
+ DEVICE_TITLE := Buffalo WLI-TX4-AG300N
+endef
+TARGET_DEVICES += wli-tx4-ag300n
+
+define Device/wzr-agl300nh
+ DTS := WZR-AGL300NH
+ IMAGE_SIZE := $(ralink_default_fw_size_4M)
+ DEVICE_TITLE := Buffalo WZR-AGL300NH
+ DEVICE_PACKAGES := kmod-switch-rtl8366s
endef
+TARGET_DEVICES += wzr-agl300nh
diff --git a/target/linux/ramips/modules.mk b/target/linux/ramips/modules.mk
index 665dc41ae8..370d0ccfdc 100644
--- a/target/linux/ramips/modules.mk
+++ b/target/linux/ramips/modules.mk
@@ -1,11 +1,31 @@
#
-# Copyright (C) 2006-2012 OpenWrt.org
+# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
OTHER_MENU:=Other modules
+
+define KernelPackage/pwm-mediatek
+ SUBMENU:=Other modules
+ TITLE:=MT7628 PWM
+ DEPENDS:=@(TARGET_ramips_mt7628||TARGET_ramips_mt7688)
+ KCONFIG:= \
+ CONFIG_PWM=y \
+ CONFIG_PWM_MEDIATEK \
+ CONFIG_PWM_SYSFS=y
+ FILES:= \
+ $(LINUX_DIR)/drivers/pwm/pwm-mediatek.ko
+ AUTOLOAD:=$(call AutoProbe,pwm-mediatek)
+endef
+
+define KernelPackage/pwm-mediatek/description
+ Kernel modules for MediaTek Pulse Width Modulator
+endef
+
+$(eval $(call KernelPackage,pwm-mediatek))
+
define KernelPackage/sdhci-mt7620
SUBMENU:=Other modules
TITLE:=MT7620 SDCI
@@ -56,15 +76,14 @@ $(eval $(call KernelPackage,i2c-mt7621))
define KernelPackage/sound-mt7620
TITLE:=MT7620 PCM/I2S Alsa Driver
- DEPENDS:=@TARGET_ramips_mt7620 +kmod-sound-soc-core +kmod-regmap @BROKEN
+ DEPENDS:=@TARGET_ramips_mt7620 +kmod-sound-soc-core +kmod-regmap @!TARGET_ramips_rt288x
KCONFIG:= \
- CONFIG_SND_MT7620_SOC_I2S \
- CONFIG_SND_MT7620_SOC_WM8960
+ CONFIG_SND_RALINK_SOC_I2S \
+ CONFIG_SND_SOC_WM8960
FILES:= \
- $(LINUX_DIR)/sound/soc/ralink/snd-soc-mt7620-i2s.ko \
- $(LINUX_DIR)/sound/soc/ralink/snd-soc-mt7620-wm8960.ko \
+ $(LINUX_DIR)/sound/soc/ralink/snd-soc-ralink-i2s.ko \
$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8960.ko
- AUTOLOAD:=$(call AutoLoad,90,snd-soc-wm8960 snd-soc-mt7620-i2s snd-soc-mt7620-wm8960)
+ AUTOLOAD:=$(call AutoLoad,90,snd-soc-wm8960 snd-soc-ralink-i2s)
$(call AddDepends/sound)
endef
diff --git a/target/linux/ramips/mt7620/config-4.4 b/target/linux/ramips/mt7620/config-4.4
index 4bc890ca84..cd90484e1e 100644
--- a/target/linux/ramips/mt7620/config-4.4
+++ b/target/linux/ramips/mt7620/config-4.4
@@ -180,7 +180,6 @@ CONFIG_SCHED_HRTICK=y
# CONFIG_SCHED_INFO is not set
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_FSL is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SOC_MT7620=y
diff --git a/target/linux/ramips/mt7620/profiles/00-default.mk b/target/linux/ramips/mt7620/profiles/00-default.mk
index 6c7d721444..a498e2bd22 100644
--- a/target/linux/ramips/mt7620/profiles/00-default.mk
+++ b/target/linux/ramips/mt7620/profiles/00-default.mk
@@ -7,9 +7,8 @@
define Profile/Default
NAME:=Default Profile
- PACKAGES:=\
- kmod-usb-core kmod-usb2 kmod-usb-ohci \
- kmod-ledtrig-usbdev
+ PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+ PRIORITY:=1
endef
define Profile/Default/Description
diff --git a/target/linux/ramips/mt7620/profiles/aigale.mk b/target/linux/ramips/mt7620/profiles/aigale.mk
deleted file mode 100644
index 629a378cae..0000000000
--- a/target/linux/ramips/mt7620/profiles/aigale.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/AI-BR100
- NAME:=Aigale Ai-BR100
- PACKAGES:=kmod-usb-ohci kmod-usb2
-endef
-
-define Profile/AI-BR100/Description
- Default package set for Aigale Ai-BR100.
-endef
-$(eval $(call Profile,AI-BR100))
diff --git a/target/linux/ramips/mt7620/profiles/dovado.mk b/target/linux/ramips/mt7620/profiles/dovado.mk
deleted file mode 100644
index 34bc74a2df..0000000000
--- a/target/linux/ramips/mt7620/profiles/dovado.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/TINY-AC
- NAME:=Dovado Tiny AC
- PACKAGES:=\
- kmod-usb-core kmod-usb2 kmod-usb-ohci
-endef
-
-define Profile/TINY-AC/Description
- Support for Dovado Tiny AC router
-endef
-$(eval $(call Profile,TINY-AC))
diff --git a/target/linux/ramips/mt7620/profiles/elecom.mk b/target/linux/ramips/mt7620/profiles/elecom.mk
deleted file mode 100644
index 5c84c92715..0000000000
--- a/target/linux/ramips/mt7620/profiles/elecom.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/WRH-300CR
- NAME:=ELECOM WRH-300CR
- PACKAGES:=\
- kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-usb-storage \
- kmod-scsi-core kmod-fs-ext4 block-mount
-endef
-
-define Profile/WRH-300CR/Description
- Package set optimized for the ELECOM WRH-300CR.
-endef
-$(eval $(call Profile,WRH-300CR))
diff --git a/target/linux/ramips/mt7620/profiles/gli.mk b/target/linux/ramips/mt7620/profiles/gli.mk
deleted file mode 100644
index ae220d5adf..0000000000
--- a/target/linux/ramips/mt7620/profiles/gli.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/GL-MT300A
- NAME:=GL-MT300A
- PACKAGES:=kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci kmod-mt76
-endef
-
-define Profile/GL-MT300A/Description
- Support for gl-mt300a Router
-endef
-$(eval $(call Profile,GL-MT300A))
-
-define Profile/GL-MT300N
- NAME:=GL-MT300N
- PACKAGES:=kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci kmod-mt76
-endef
-
-define Profile/GL-MT300N/Description
- Support for gl-mt300n Router
-endef
-$(eval $(call Profile,GL-MT300N))
-
-define Profile/GL-MT750
- NAME:=GL-MT750
- PACKAGES:=kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci kmod-mt76 kmod-mt7610e
-endef
-
-define Profile/GL-MT750/Description
- Support for gl-mt750 Router
-endef
-$(eval $(call Profile,GL-MT750))
diff --git a/target/linux/ramips/mt7620/profiles/hiwifi.mk b/target/linux/ramips/mt7620/profiles/hiwifi.mk
deleted file mode 100644
index 5baa85ae88..0000000000
--- a/target/linux/ramips/mt7620/profiles/hiwifi.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/HC5661
- NAME:=HiWiFi HC5661
- PACKAGES:=\
- kmod-usb-core kmod-usb-dwc2 kmod-usb2 \
- kmod-mmc-spi kmod-sdhci kmod-sdhci-mt7620 \
- kmod-ledtrig-usbdev
-endef
-
-define Profile/HC5661/Description
- Support HiWiFi HC5661 model(J1S)
-endef
-$(eval $(call Profile,HC5661))
-
-
-define Profile/HC5761
- NAME:=HiWiFi HC5761
- PACKAGES:=\
- kmod-usb-core kmod-usb-dwc2 kmod-usb2 \
- kmod-mmc-spi kmod-sdhci kmod-sdhci-mt7620 \
- kmod-ledtrig-usbdev
-endef
-
-define Profile/HC5761/Description
- Support HiWiFi HC5761 model(J2)
-endef
-$(eval $(call Profile,HC5761))
-
-
-define Profile/HC5861
- NAME:=HiWiFi HC5861
- PACKAGES:=\
- kmod-usb-core kmod-usb-dwc2 kmod-usb2 \
- kmod-mmc-spi kmod-sdhci kmod-sdhci-mt7620 \
- kmod-ledtrig-usbdev
-endef
-
-define Profile/HC5861/Description
- Support HiWiFi HC5861 model(J3)
-endef
-$(eval $(call Profile,HC5861))
diff --git a/target/linux/ramips/mt7620/profiles/linksys.mk b/target/linux/ramips/mt7620/profiles/linksys.mk
deleted file mode 100644
index d8a2df4593..0000000000
--- a/target/linux/ramips/mt7620/profiles/linksys.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/E1700
- NAME:=Linksys E1700
- PACKAGES:=swconfig
-endef
-
-define Profile/E1700/Description
- Package set compatible with the Linksys E1700.
-endef
-$(eval $(call Profile,E1700))
diff --git a/target/linux/ramips/mt7620/profiles/mediatek.mk b/target/linux/ramips/mt7620/profiles/mediatek.mk
deleted file mode 100644
index 4f6703ebf5..0000000000
--- a/target/linux/ramips/mt7620/profiles/mediatek.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Copyright (C) 2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/MT7620a
- NAME:=MT7620a EVB
-endef
-
-define Profile/MT7620a/Description
- Default package set compatible with MT7620a eval board
-endef
-$(eval $(call Profile,MT7620a))
diff --git a/target/linux/ramips/mt7620/profiles/microduino.mk b/target/linux/ramips/mt7620/profiles/microduino.mk
deleted file mode 100644
index b68a269841..0000000000
--- a/target/linux/ramips/mt7620/profiles/microduino.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/MicroWRT
- NAME:=Microduino MicroWRT
- PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci
-endef
-
-define Profile/MicroWRT/Description
- Package set compatible with MicroWRT
-endef
-$(eval $(call Profile,MicroWRT))
diff --git a/target/linux/ramips/mt7620/profiles/netgear.mk b/target/linux/ramips/mt7620/profiles/netgear.mk
deleted file mode 100644
index d1b073abc2..0000000000
--- a/target/linux/ramips/mt7620/profiles/netgear.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/EX2700
- NAME:=Netgear EX2700
- PACKAGES:=-kmod-usb-core -kmod-usb2 -kmod-usb-ohci -kmod-ledtrig-usbdev
-endef
-
-define Profile/EX2700/Description
- Support for Netgear EX2700
-endef
-$(eval $(call Profile,EX2700))
diff --git a/target/linux/ramips/mt7620/profiles/phicomm.mk b/target/linux/ramips/mt7620/profiles/phicomm.mk
deleted file mode 100644
index e083a4c975..0000000000
--- a/target/linux/ramips/mt7620/profiles/phicomm.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/PSG1208
- NAME:=Phicomm PSG1208
- PACKAGES:=kmod-mt76
-endef
-
-define Profile/PSG1208/Description
- Default package set for Phicomm PSG1208.
-endef
-$(eval $(call Profile,PSG1208))
diff --git a/target/linux/ramips/mt7620/profiles/planex.mk b/target/linux/ramips/mt7620/profiles/planex.mk
deleted file mode 100644
index f461aeb211..0000000000
--- a/target/linux/ramips/mt7620/profiles/planex.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/CS-QR10
- NAME:=Planex CS-QR10
- PACKAGES:=\
- kmod-usb-core kmod-usb2 kmod-usb-ohci \
- i2c-core kmod-i2c-ralink kmod-sound-core kmod-sound-mtk \
- kmod-sdhci-mt7620
-endef
-
-define Profile/CS-QR10/Description
- Package set optimized for the Planex CS-QR10.
-endef
-$(eval $(call Profile,CS-QR10))
-
-
-define Profile/MZK-750DHP
- NAME:=Planex MZK-750DHP
- PACKAGES:= kmod-mt76 kmod-mt7610e
-endef
-
-define Profile/MZK-750DHP/Description
- Package set optimized for the Planex MZK-750DHP.
-endef
-$(eval $(call Profile,MZK-750DHP))
-
-
-define Profile/MZK-EX300NP
- NAME:=Planex MZK-EX300NP
- PACKAGES:=
-endef
-
-define Profile/MZK-EX300NP/Description
- Package set optimized for the Planex MZK-EX300NP.
-endef
-$(eval $(call Profile,MZK-EX300NP))
-
-
-define Profile/MZK-EX750NP
- NAME:=Planex MZK-EX750NP
- PACKAGES:= kmod-mt76 kmod-mt7610e
-endef
-
-define Profile/MZK-EX750NP/Description
- Package set optimized for the Planex MZK-EX750NP.
-endef
-$(eval $(call Profile,MZK-EX750NP))
diff --git a/target/linux/ramips/mt7620/profiles/xiaomi.mk b/target/linux/ramips/mt7620/profiles/xiaomi.mk
deleted file mode 100644
index 84835784e1..0000000000
--- a/target/linux/ramips/mt7620/profiles/xiaomi.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/MIWIFI-MINI
- NAME:=Xiaomi MiWiFi Mini
- PACKAGES:=\
- kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci
-endef
-
-define Profile/MIWIFI-MINI/Description
- Support for Xiaomi MiWiFi Mini routers
-endef
-$(eval $(call Profile,MIWIFI-MINI))
diff --git a/target/linux/ramips/mt7620/profiles/zbt.mk b/target/linux/ramips/mt7620/profiles/zbt.mk
deleted file mode 100644
index c33048f4ab..0000000000
--- a/target/linux/ramips/mt7620/profiles/zbt.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/ZBT-WE826
- NAME:=ZBT-WE826 Device
- PACKAGES:=\
- kmod-scsi-core kmod-scsi-generic kmod-mmc kmod-sdhci \
- block-mount kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \
- kmod-mt76
-endef
-
-define Profile/ZBT-WE826/Description
- Support for ZBT WE-826-(B,T) routers
-endef
-$(eval $(call Profile,ZBT-WE826))
diff --git a/target/linux/ramips/mt7620/target.mk b/target/linux/ramips/mt7620/target.mk
index 99763b046a..08c775c97b 100644
--- a/target/linux/ramips/mt7620/target.mk
+++ b/target/linux/ramips/mt7620/target.mk
@@ -4,7 +4,6 @@
SUBTARGET:=mt7620
BOARDNAME:=MT7620 based boards
-ARCH_PACKAGES:=ramips_24kec
FEATURES+=usb
CPU_TYPE:=24kec
CPU_SUBTYPE:=dsp
diff --git a/target/linux/ramips/mt7621/config-4.4 b/target/linux/ramips/mt7621/config-4.4
index 862c8e977e..58568c8114 100644
--- a/target/linux/ramips/mt7621/config-4.4
+++ b/target/linux/ramips/mt7621/config-4.4
@@ -218,7 +218,8 @@ CONFIG_SCHED_HRTICK=y
CONFIG_SCHED_SMT=y
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_FSL is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_NR_UARTS=3
+CONFIG_SERIAL_8250_RUNTIME_UARTS=3
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SMP=y
CONFIG_SMP_UP=y
diff --git a/target/linux/ramips/mt7621/profiles/00-default.mk b/target/linux/ramips/mt7621/profiles/00-default.mk
index fb04ba788c..24e51f4ef5 100644
--- a/target/linux/ramips/mt7621/profiles/00-default.mk
+++ b/target/linux/ramips/mt7621/profiles/00-default.mk
@@ -7,6 +7,7 @@
define Profile/Default
NAME:=Default Profile
+ PRIORITY:=1
PACKAGES:=\
kmod-usb-core kmod-usb3 \
kmod-ledtrig-usbdev
diff --git a/target/linux/ramips/mt7621/profiles/firefly.mk b/target/linux/ramips/mt7621/profiles/firefly.mk
deleted file mode 100644
index 979752780b..0000000000
--- a/target/linux/ramips/mt7621/profiles/firefly.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/FIREWRT
- NAME:=Firefly FireWRT
- PACKAGES:=\
- kmod-usb-core kmod-usb3 kmod-usb-hid \
- kmod-ledtrig-usbdev
-endef
-
-define Profile/FIREWRT/Description
- Package set compatible with the Firefly FireWRT board.
-endef
-$(eval $(call Profile,FIREWRT))
diff --git a/target/linux/ramips/mt7621/profiles/linksys.mk b/target/linux/ramips/mt7621/profiles/linksys.mk
deleted file mode 100644
index fb447c9e05..0000000000
--- a/target/linux/ramips/mt7621/profiles/linksys.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/RE6500
- NAME:=Linksys RE6500
-endef
-
-define Profile/RE6500/Description
- Package set compatible with the Linksys RE6500 board.
-endef
-$(eval $(call Profile,RE6500))
diff --git a/target/linux/ramips/mt7621/profiles/misc.mk b/target/linux/ramips/mt7621/profiles/misc.mk
deleted file mode 100644
index 06a9d44c88..0000000000
--- a/target/linux/ramips/mt7621/profiles/misc.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/PBR-M1
- NAME:=PBR-M1 Device
- FEATURES+=rtc
- PACKAGES:=\
- kmod-usb-core kmod-usb3 kmod-usb-hid \
- kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
- kmod-rtc-pcf8563
-endef
-
-define Profile/PBR-M1/Description
- Default package set compatible with most boards.
-endef
-$(eval $(call Profile,PBR-M1))
diff --git a/target/linux/ramips/mt7621/profiles/mqmaker.mk b/target/linux/ramips/mt7621/profiles/mqmaker.mk
deleted file mode 100644
index 0b01ab9122..0000000000
--- a/target/linux/ramips/mt7621/profiles/mqmaker.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/WITI
- NAME:=MQmaker WiTi
- FEATURES+=rtc
- PACKAGES:=\
- kmod-usb-core kmod-usb3 kmod-usb-hid \
- kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
- kmod-rtc-pcf8563 kmod-i2c-mt7621
-endef
-
-define Profile/WITI/Description
- Package set compatible with MQmaker WiTi board.
-endef
-$(eval $(call Profile,WITI))
diff --git a/target/linux/ramips/mt7621/profiles/netgear.mk b/target/linux/ramips/mt7621/profiles/netgear.mk
deleted file mode 100644
index 05802a252f..0000000000
--- a/target/linux/ramips/mt7621/profiles/netgear.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/WNDR3700V5
- NAME:=Netgear WNDR3700v5
- PACKAGES:=\
- kmod-usb-core kmod-usb3
-endef
-
-define Profile/WNDR3700V5/Description
- Package set compatible with the Netgear WNDR3700v5.
-endef
-$(eval $(call Profile,WNDR3700V5))
diff --git a/target/linux/ramips/mt7621/profiles/netis.mk b/target/linux/ramips/mt7621/profiles/netis.mk
deleted file mode 100644
index 39b524f534..0000000000
--- a/target/linux/ramips/mt7621/profiles/netis.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/WF-2881
- NAME:=NETIS WF-2881
- PACKAGES:=\
- kmod-usb-core kmod-usb3 kmod-usb-hid \
- kmod-ledtrig-usbdev
-endef
-
-define Profile/WF-2881/Description
- Package set compatible with the NETIS WF-2881 board.
-endef
-
-#-m <min io size> -e <LEB size> -c <Eraseblocks count>
-WF-2881_UBIFS_OPTS:="-m 2048 -e 129024 -c 1024"
-WF-2881_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
-
-$(eval $(call Profile,WF-2881))
diff --git a/target/linux/ramips/mt7621/profiles/storylink.mk b/target/linux/ramips/mt7621/profiles/storylink.mk
deleted file mode 100644
index 9ca4a2f743..0000000000
--- a/target/linux/ramips/mt7621/profiles/storylink.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/SAP-G3200U3
- NAME:=STORYLiNK SAP-G3200U3
- PACKAGES:=\
- kmod-usb-core kmod-usb3 kmod-usb-hid \
- kmod-ledtrig-usbdev
-endef
-
-define Profile/SAP-G3200U3/Description
- Package set compatible with the STORYLiNK SAP-G3200U3 board.
-endef
-$(eval $(call Profile,SAP-G3200U3))
diff --git a/target/linux/ramips/mt7621/profiles/ubnt.mk b/target/linux/ramips/mt7621/profiles/ubnt.mk
deleted file mode 100644
index 3f1af02c57..0000000000
--- a/target/linux/ramips/mt7621/profiles/ubnt.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/UBNT-ERX
- NAME:=Ubiquiti EdgeRouter X
- FEATURES+=nand -usb
- PACKAGES:=-kmod-mt76 -kmod-rt2800-pci -kmod-cfg80211 \
- -wpad-mini -iwinfo
-endef
-
-define Profile/UBNT-ERX/Description
- Package set compatible with the Ubiquiti EdgeRouter X
-endef
-$(eval $(call Profile,UBNT-ERX))
diff --git a/target/linux/ramips/mt7621/profiles/zbt.mk b/target/linux/ramips/mt7621/profiles/zbt.mk
deleted file mode 100644
index 453687d4c5..0000000000
--- a/target/linux/ramips/mt7621/profiles/zbt.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/ZBT-WG2626
- NAME:=ZBT-WG2626 Device
- PACKAGES:=\
- kmod-usb-core kmod-usb3 \
- kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci
-endef
-
-define Profile/ZBT-WG2626/Description
- Package set for ZBT-WG2626 device
-endef
-$(eval $(call Profile,ZBT-WG2626))
-
-
-define Profile/ZBT-WG3526
- NAME:=ZBT-WG3526 Device
- PACKAGES:=\
- kmod-usb-core kmod-usb3 \
- kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci
-endef
-
-define Profile/ZBT-WG3526/Description
- Package set for ZBT-WG3526 device
-endef
-$(eval $(call Profile,ZBT-WG3526))
diff --git a/target/linux/ramips/mt7621/target.mk b/target/linux/ramips/mt7621/target.mk
index a0a7afc969..7e175435b3 100644
--- a/target/linux/ramips/mt7621/target.mk
+++ b/target/linux/ramips/mt7621/target.mk
@@ -4,11 +4,9 @@
SUBTARGET:=mt7621
BOARDNAME:=MT7621 based boards
-ARCH_PACKAGES:=ramips_1004kc
-FEATURES+=usb
+FEATURES+=usb rtc
CPU_TYPE:=1004kc
CPU_SUBTYPE:=dsp
-CFLAGS:=-Os -pipe -mmt -mips32r2 -mtune=1004kc
DEFAULT_PACKAGES += kmod-mt76
diff --git a/target/linux/ramips/mt7628/config-4.4 b/target/linux/ramips/mt7628/config-4.4
index ef282b5f00..6b04457f17 100644
--- a/target/linux/ramips/mt7628/config-4.4
+++ b/target/linux/ramips/mt7628/config-4.4
@@ -177,8 +177,8 @@ CONFIG_SCHED_HRTICK=y
# CONFIG_SCHED_INFO is not set
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_FSL is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_RT288X=y
+CONFIG_SERIAL_8250_NR_UARTS=3
+CONFIG_SERIAL_8250_RUNTIME_UARTS=3
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SOC_MT7620=y
# CONFIG_SOC_MT7621 is not set
diff --git a/target/linux/ramips/mt7628/profiles/00-default.mk b/target/linux/ramips/mt7628/profiles/00-default.mk
index 6c7d721444..d0472a9f36 100644
--- a/target/linux/ramips/mt7628/profiles/00-default.mk
+++ b/target/linux/ramips/mt7628/profiles/00-default.mk
@@ -7,9 +7,8 @@
define Profile/Default
NAME:=Default Profile
- PACKAGES:=\
- kmod-usb-core kmod-usb2 kmod-usb-ohci \
- kmod-ledtrig-usbdev
+ PRIORITY:=1
+ PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
endef
define Profile/Default/Description
diff --git a/target/linux/ramips/mt7628/profiles/xiaomi.mk b/target/linux/ramips/mt7628/profiles/xiaomi.mk
deleted file mode 100644
index 18e53c44b7..0000000000
--- a/target/linux/ramips/mt7628/profiles/xiaomi.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/MiwifiNano
- NAME:=Xiaomi MiWiFi Nano
- PACKAGES:=\
- kmod-usb-core kmod-usb2 kmod-usb-ohci \
- kmod-ledtrig-usbdev
-endef
-
-define Profile/Default/Description
- Image for Xiaomi MiWiFi Nano
-endef
-$(eval $(call Profile,MiwifiNano))
diff --git a/target/linux/ramips/mt7628/target.mk b/target/linux/ramips/mt7628/target.mk
index 8263a1bed8..61d7f0707c 100644
--- a/target/linux/ramips/mt7628/target.mk
+++ b/target/linux/ramips/mt7628/target.mk
@@ -4,7 +4,6 @@
SUBTARGET:=mt7628
BOARDNAME:=MT7628 based boards
-ARCH_PACKAGES:=ramips_24kec
FEATURES+=usb
CPU_TYPE:=24kec
CPU_SUBTYPE:=dsp
diff --git a/target/linux/ramips/mt7688/profiles/00-default.mk b/target/linux/ramips/mt7688/profiles/00-default.mk
index 6c7d721444..d0472a9f36 100644
--- a/target/linux/ramips/mt7688/profiles/00-default.mk
+++ b/target/linux/ramips/mt7688/profiles/00-default.mk
@@ -7,9 +7,8 @@
define Profile/Default
NAME:=Default Profile
- PACKAGES:=\
- kmod-usb-core kmod-usb2 kmod-usb-ohci \
- kmod-ledtrig-usbdev
+ PRIORITY:=1
+ PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
endef
define Profile/Default/Description
diff --git a/target/linux/ramips/mt7688/profiles/01-mediatek.mk b/target/linux/ramips/mt7688/profiles/01-mediatek.mk
deleted file mode 100644
index 1ef824dba6..0000000000
--- a/target/linux/ramips/mt7688/profiles/01-mediatek.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/LinkIt7688
- NAME:=LinkIt7688
- PACKAGES:=\
- kmod-usb-core kmod-usb2 kmod-usb-ohci \
- uboot-envtools kmod-ledtrig-netdev
-endef
-
-define Profile/LinkIt7688/Description
- Default package set compatible with LinkIt Smart7688 dev board.
-endef
-$(eval $(call Profile,LinkIt7688))
diff --git a/target/linux/ramips/mt7688/target.mk b/target/linux/ramips/mt7688/target.mk
index 2713d5260c..a501a64136 100644
--- a/target/linux/ramips/mt7688/target.mk
+++ b/target/linux/ramips/mt7688/target.mk
@@ -4,7 +4,6 @@
SUBTARGET:=mt7688
BOARDNAME:=MT7688 based boards
-ARCH_PACKAGES:=ramips_24kec
FEATURES+=usb
CPU_TYPE:=24kec
CPU_SUBTYPE:=dsp
diff --git a/target/linux/ramips/patches-4.4/0043-spi-add-mt7621-support.patch b/target/linux/ramips/patches-4.4/0043-spi-add-mt7621-support.patch
index 73fe51c841..8a78bda840 100644
--- a/target/linux/ramips/patches-4.4/0043-spi-add-mt7621-support.patch
+++ b/target/linux/ramips/patches-4.4/0043-spi-add-mt7621-support.patch
@@ -38,7 +38,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
obj-$(CONFIG_SPI_OC_TINY) += spi-oc-tiny.o
--- /dev/null
+++ b/drivers/spi/spi-mt7621.c
-@@ -0,0 +1,480 @@
+@@ -0,0 +1,483 @@
+/*
+ * spi-mt7621.c -- MediaTek MT7621 SPI controller driver
+ *
@@ -240,6 +240,9 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ if (!buf)
+ continue;
+
++ if (t->speed_hz < speed)
++ speed = t->speed_hz;
++
+ if (WARN_ON(len + t->len > 36)) {
+ status = -EIO;
+ goto msg_done;
diff --git a/target/linux/ramips/patches-4.4/0044-i2c-MIPS-adds-ralink-I2C-driver.patch b/target/linux/ramips/patches-4.4/0044-i2c-MIPS-adds-ralink-I2C-driver.patch
index 31854eff4b..21872082dd 100644
--- a/target/linux/ramips/patches-4.4/0044-i2c-MIPS-adds-ralink-I2C-driver.patch
+++ b/target/linux/ramips/patches-4.4/0044-i2c-MIPS-adds-ralink-I2C-driver.patch
@@ -45,12 +45,13 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+};
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
-@@ -806,6 +806,10 @@ config I2C_RK3X
+@@ -806,6 +806,11 @@ config I2C_RK3X
This driver can also be built as a module. If so, the module will
be called i2c-rk3x.
+config I2C_RALINK
+ tristate "Ralink I2C Controller"
++ depends on RALINK && !SOC_MT7621
+ select OF_I2C
+
config HAVE_S3C2410_I2C
@@ -68,11 +69,12 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
obj-$(CONFIG_I2C_RK3X) += i2c-rk3x.o
--- /dev/null
+++ b/drivers/i2c/busses/i2c-ralink.c
-@@ -0,0 +1,327 @@
+@@ -0,0 +1,435 @@
+/*
+ * drivers/i2c/busses/i2c-ralink.c
+ *
+ * Copyright (C) 2013 Steven Liu <steven_liu@mediatek.com>
++ * Copyright (C) 2016 Michael Lee <igvtee@gmail.com>
+ *
+ * Improve driver for i2cdetect from i2c-tools to detect i2c devices on the bus.
+ * (C) 2014 Sittisak <sittisaks@hotmail.com>
@@ -101,8 +103,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+#include <linux/i2c.h>
+#include <linux/io.h>
+#include <linux/err.h>
-+
-+#include <asm/mach-ralink/ralink_regs.h>
++#include <linux/clk.h>
+
+#define REG_CONFIG_REG 0x00
+#define REG_CLKDIV_REG 0x04
@@ -113,191 +114,250 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+#define REG_STATUS_REG 0x18
+#define REG_STARTXFR_REG 0x1C
+#define REG_BYTECNT_REG 0x20
-+#define REG_SM0CFG2 0x28
-+#define REG_SM0CTL0 0x40
+
++/* REG_CONFIG_REG */
++#define I2C_ADDRLEN_OFFSET 5
++#define I2C_DEVADLEN_OFFSET 2
++#define I2C_ADDRLEN_MASK 0x3
++#define I2C_ADDR_DIS BIT(1)
++#define I2C_DEVADDR_DIS BIT(0)
++#define I2C_ADDRLEN_8 (7 << I2C_ADDRLEN_OFFSET)
++#define I2C_DEVADLEN_7 (6 << I2C_DEVADLEN_OFFSET)
++#define I2C_CONF_DEFAULT (I2C_ADDRLEN_8 | I2C_DEVADLEN_7)
++
++/* REG_CLKDIV_REG */
++#define I2C_CLKDIV_MASK 0xffff
++
++/* REG_DEVADDR_REG */
++#define I2C_DEVADDR_MASK 0x7f
++
++/* REG_ADDR_REG */
++#define I2C_ADDR_MASK 0xff
++
++/* REG_STATUS_REG */
+#define I2C_STARTERR BIT(4)
+#define I2C_ACKERR BIT(3)
+#define I2C_DATARDY BIT(2)
+#define I2C_SDOEMPTY BIT(1)
+#define I2C_BUSY BIT(0)
+
-+#define I2C_DEVADLEN_7 (6 << 2)
-+#define I2C_ADDRDIS BIT(1)
++/* REG_STARTXFR_REG */
++#define NOSTOP_CMD BIT(2)
++#define NODATA_CMD BIT(1)
++#define READ_CMD BIT(0)
+
-+#define CLKDIV_VALUE 200 // clock rate is 40M, 40M / (200*2) = 100k (standard i2c bus rate).
-+//#define CLKDIV_VALUE 50 // clock rate is 40M, 40M / (50*2) = 400k (fast i2c bus rate).
-+
-+#define READ_CMD 0x01
-+#define WRITE_CMD 0x00
-+#define READ_BLOCK 64
-+
-+#define SM0CTL0_OD BIT(31)
-+#define SM0CTL0_VTRIG BIT(28)
-+#define SM0CTL0_OUTHI BIT(6)
-+#define SM0CTL0_STRETCH BIT(1)
-+#define SM0CTL0_DEFAULT (SM0CTL0_OD | SM0CTL0_VTRIG | SM0CTL0_OUTHI | SM0CTL0_STRETCH)
++/* REG_BYTECNT_REG */
++#define BYTECNT_MAX 64
++#define SET_BYTECNT(x) (x - 1)
+
+/* timeout waiting for I2C devices to respond (clock streching) */
-+#define RT_I2C_TIMEOUT (msecs_to_jiffies(1000))
-+
-+enum {
-+ I2C_TYPE_RALINK,
-+ I2C_TYPE_MEDIATEK,
++#define TIMEOUT_MS 1000
++#define DELAY_INTERVAL_US 100
++
++struct rt_i2c {
++ void __iomem *base;
++ struct clk *clk;
++ struct device *dev;
++ struct i2c_adapter adap;
++ u32 cur_clk;
++ u32 clk_div;
++ u32 flags;
+};
+
-+static void __iomem *membase;
-+static struct i2c_adapter *adapter;
-+static int hw_type;
-+
-+static void rt_i2c_w32(u32 val, unsigned reg)
++static void rt_i2c_w32(struct rt_i2c *i2c, u32 val, unsigned reg)
+{
-+ iowrite32(val, membase + reg);
++ iowrite32(val, i2c->base + reg);
+}
+
-+static u32 rt_i2c_r32(unsigned reg)
++static u32 rt_i2c_r32(struct rt_i2c *i2c, unsigned reg)
+{
-+ return ioread32(membase + reg);
++ return ioread32(i2c->base + reg);
+}
+
-+static inline int rt_i2c_get_ack(void)
++static int poll_down_timeout(void __iomem *addr, u32 mask)
+{
-+ return (rt_i2c_r32(REG_STATUS_REG) & I2C_ACKERR) ? -EIO : 0;
-+}
-+
-+static inline int rt_i2c_wait_rx_done(void)
-+{
-+ unsigned long timeout;
-+
-+ timeout = jiffies + RT_I2C_TIMEOUT;
++ unsigned long timeout = jiffies + msecs_to_jiffies(TIMEOUT_MS);
+
+ do {
-+ if (time_after(jiffies, timeout))
-+ return (-ETIMEDOUT);
++ if (!(readl_relaxed(addr) & mask))
++ return 0;
+
-+ } while (!(rt_i2c_r32(REG_STATUS_REG) & I2C_DATARDY));
++ usleep_range(DELAY_INTERVAL_US, DELAY_INTERVAL_US + 50);
++ } while (time_before(jiffies, timeout));
+
-+ return 0;
++ return (readl_relaxed(addr) & mask) ? -EAGAIN : 0;
+}
+
-+static inline int rt_i2c_wait_idle(void)
++static int rt_i2c_wait_idle(struct rt_i2c *i2c)
+{
-+ unsigned long timeout;
++ int ret;
+
-+ timeout = jiffies + RT_I2C_TIMEOUT;
++ ret = poll_down_timeout(i2c->base + REG_STATUS_REG, I2C_BUSY);
++ if (ret < 0)
++ dev_dbg(i2c->dev, "idle err(%d)\n", ret);
+
-+ do {
-+ if (time_after(jiffies, timeout)) {
-+ printk("i2c-read line busy\n");
-+ return 1;
-+ }
-+ } while (rt_i2c_r32(REG_STATUS_REG) & I2C_BUSY);
-+
-+ return 0;
++ return ret;
+}
+
-+static inline int rt_i2c_wait_tx_done(void)
++static int poll_up_timeout(void __iomem *addr, u32 mask)
+{
-+ unsigned long timeout;
-+
-+ timeout = jiffies + RT_I2C_TIMEOUT;
++ unsigned long timeout = jiffies + msecs_to_jiffies(TIMEOUT_MS);
++ u32 status;
+
+ do {
-+ if (time_after(jiffies, timeout))
-+ return (-ETIMEDOUT);
++ status = readl_relaxed(addr);
+
-+ } while (!(rt_i2c_r32(REG_STATUS_REG) & I2C_SDOEMPTY));
++ /* check error status */
++ if (status & I2C_STARTERR)
++ return -EAGAIN;
++ else if (status & I2C_ACKERR)
++ return -ENXIO;
++ else if (status & mask)
++ return 0;
+
-+ return 0;
++ usleep_range(DELAY_INTERVAL_US, DELAY_INTERVAL_US + 50);
++ } while (time_before(jiffies, timeout));
++
++ return -ETIMEDOUT;
+}
+
-+static int rt_i2c_handle_msg(struct i2c_adapter *a, struct i2c_msg* msg)
++static int rt_i2c_wait_rx_done(struct rt_i2c *i2c)
+{
-+ int i = 0, j = 0, pos = 0;
-+ int nblock = msg->len / READ_BLOCK;
-+ int rem = msg->len % READ_BLOCK;
-+ int ret = 0;
-+
-+ if (msg->flags & I2C_M_TEN) {
-+ printk("10 bits addr not supported\n");
-+ return -EINVAL;
-+ }
-+
-+ if (msg->flags & I2C_M_RD) {
-+ for (i = 0; i < nblock; i++) {
-+ if (rt_i2c_wait_idle())
-+ return -ETIMEDOUT;
-+ rt_i2c_w32(READ_BLOCK - 1, REG_BYTECNT_REG);
-+ rt_i2c_w32(READ_CMD, REG_STARTXFR_REG);
-+ for (j = 0; j < READ_BLOCK; j++) {
-+ if (rt_i2c_wait_rx_done() < 0)
-+ ret = rt_i2c_wait_rx_done();
-+ if (rt_i2c_get_ack() < 0)
-+ ret = rt_i2c_get_ack();
-+ msg->buf[pos++] = rt_i2c_r32(REG_DATAIN_REG);
-+ }
-+ }
-+
-+ if (rt_i2c_wait_idle())
-+ return -ETIMEDOUT;
-+ if (rem) {
-+ rt_i2c_w32(rem - 1, REG_BYTECNT_REG);
-+ rt_i2c_w32(READ_CMD, REG_STARTXFR_REG);
-+ }
-+ for (i = 0; i < rem; i++) {
-+ if (rt_i2c_wait_rx_done() < 0)
-+ ret = rt_i2c_wait_rx_done();
-+ if (rt_i2c_get_ack() < 0)
-+ ret = rt_i2c_get_ack();
++ int ret;
+
-+ msg->buf[pos++] = rt_i2c_r32(REG_DATAIN_REG);
-+ }
-+ } else {
-+ if (rt_i2c_wait_idle())
-+ return -ETIMEDOUT;
-+ rt_i2c_w32(msg->len - 1, REG_BYTECNT_REG);
-+ for (i = 0; i < msg->len; i++) {
-+ rt_i2c_w32(msg->buf[i], REG_DATAOUT_REG);
-+ rt_i2c_w32(WRITE_CMD, REG_STARTXFR_REG);
-+
-+ if (rt_i2c_wait_tx_done() < 0)
-+ ret = rt_i2c_wait_tx_done();
-+ if (rt_i2c_get_ack() < 0)
-+ ret = rt_i2c_get_ack();
-+ }
-+ }
++ ret = poll_up_timeout(i2c->base + REG_STATUS_REG, I2C_DATARDY);
++ if (ret < 0)
++ dev_dbg(i2c->dev, "rx err(%d)\n", ret);
+
+ return ret;
+}
+
-+static int rt_i2c_master_xfer(struct i2c_adapter *a, struct i2c_msg *m, int n)
++static int rt_i2c_wait_tx_done(struct rt_i2c *i2c)
+{
-+ int i = 0;
-+ int ret = 0;
++ int ret;
+
-+ if (rt_i2c_wait_idle())
-+ return -ETIMEDOUT;
++ ret = poll_up_timeout(i2c->base + REG_STATUS_REG, I2C_SDOEMPTY);
++ if (ret < 0)
++ dev_dbg(i2c->dev, "tx err(%d)\n", ret);
+
-+ device_reset(a->dev.parent);
++ return ret;
++}
+
-+ rt_i2c_w32(m->addr, REG_DEVADDR_REG);
-+ rt_i2c_w32(I2C_DEVADLEN_7 | I2C_ADDRDIS, REG_CONFIG_REG);
-+ if (hw_type == I2C_TYPE_RALINK) {
-+ rt_i2c_w32(CLKDIV_VALUE, REG_CLKDIV_REG);
-+ } else {
-+ rt_i2c_w32((CLKDIV_VALUE << 16) | SM0CTL0_DEFAULT, REG_SM0CTL0);
-+ rt_i2c_w32(1, REG_SM0CFG2);
-+ }
++static void rt_i2c_reset(struct rt_i2c *i2c)
++{
++ device_reset(i2c->adap.dev.parent);
++ barrier();
++ rt_i2c_w32(i2c, i2c->clk_div, REG_CLKDIV_REG);
++}
++
++static void rt_i2c_dump_reg(struct rt_i2c *i2c)
++{
++ dev_dbg(i2c->dev, "conf %08x, clkdiv %08x, devaddr %08x, " \
++ "addr %08x, dataout %08x, datain %08x, " \
++ "status %08x, startxfr %08x, bytecnt %08x\n",
++ rt_i2c_r32(i2c, REG_CONFIG_REG),
++ rt_i2c_r32(i2c, REG_CLKDIV_REG),
++ rt_i2c_r32(i2c, REG_DEVADDR_REG),
++ rt_i2c_r32(i2c, REG_ADDR_REG),
++ rt_i2c_r32(i2c, REG_DATAOUT_REG),
++ rt_i2c_r32(i2c, REG_DATAIN_REG),
++ rt_i2c_r32(i2c, REG_STATUS_REG),
++ rt_i2c_r32(i2c, REG_STARTXFR_REG),
++ rt_i2c_r32(i2c, REG_BYTECNT_REG));
++}
+
-+ for (i = 0; i < n && !ret; i++) {
-+ ret = rt_i2c_handle_msg(a, &m[i]);
++static int rt_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
++ int num)
++{
++ struct rt_i2c *i2c;
++ struct i2c_msg *pmsg;
++ unsigned char addr;
++ int i, j, ret;
++ u32 cmd;
++
++ i2c = i2c_get_adapdata(adap);
++
++ for (i = 0; i < num; i++) {
++ pmsg = &msgs[i];
++ if (i == (num - 1))
++ cmd = 0;
++ else
++ cmd = NOSTOP_CMD;
++
++ dev_dbg(i2c->dev, "addr: 0x%x, len: %d, flags: 0x%x, stop: %d\n",
++ pmsg->addr, pmsg->len, pmsg->flags,
++ (cmd == 0)? 1 : 0);
++
++ /* wait hardware idle */
++ if ((ret = rt_i2c_wait_idle(i2c)))
++ goto err_timeout;
++
++ if (pmsg->flags & I2C_M_TEN) {
++ rt_i2c_w32(i2c, I2C_CONF_DEFAULT, REG_CONFIG_REG);
++ /* 10 bits address */
++ addr = 0x78 | ((pmsg->addr >> 8) & 0x03);
++ rt_i2c_w32(i2c, addr & I2C_DEVADDR_MASK,
++ REG_DEVADDR_REG);
++ rt_i2c_w32(i2c, pmsg->addr & I2C_ADDR_MASK,
++ REG_ADDR_REG);
++ } else {
++ rt_i2c_w32(i2c, I2C_CONF_DEFAULT | I2C_ADDR_DIS,
++ REG_CONFIG_REG);
++ /* 7 bits address */
++ rt_i2c_w32(i2c, pmsg->addr & I2C_DEVADDR_MASK,
++ REG_DEVADDR_REG);
++ }
+
-+ if (ret < 0) {
-+ return ret;
++ /* buffer length */
++ if (pmsg->len == 0)
++ cmd |= NODATA_CMD;
++ else
++ rt_i2c_w32(i2c, SET_BYTECNT(pmsg->len),
++ REG_BYTECNT_REG);
++
++ j = 0;
++ if (pmsg->flags & I2C_M_RD) {
++ cmd |= READ_CMD;
++ /* start transfer */
++ barrier();
++ rt_i2c_w32(i2c, cmd, REG_STARTXFR_REG);
++ do {
++ /* wait */
++ if ((ret = rt_i2c_wait_rx_done(i2c)))
++ goto err_timeout;
++ /* read data */
++ if (pmsg->len)
++ pmsg->buf[j] = rt_i2c_r32(i2c,
++ REG_DATAIN_REG);
++ j++;
++ } while (j < pmsg->len);
++ } else {
++ do {
++ /* write data */
++ if (pmsg->len)
++ rt_i2c_w32(i2c, pmsg->buf[j],
++ REG_DATAOUT_REG);
++ /* start transfer */
++ if (j == 0) {
++ barrier();
++ rt_i2c_w32(i2c, cmd, REG_STARTXFR_REG);
++ }
++ /* wait */
++ if ((ret = rt_i2c_wait_tx_done(i2c)))
++ goto err_timeout;
++ j++;
++ } while (j < pmsg->len);
+ }
+ }
++ /* the return value is number of executed messages */
++ ret = i;
++
++ return ret;
+
-+ return n;
++err_timeout:
++ rt_i2c_dump_reg(i2c);
++ rt_i2c_reset(i2c);
++ return ret;
+}
+
+static u32 rt_i2c_func(struct i2c_adapter *a)
@@ -311,60 +371,110 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+};
+
+static const struct of_device_id i2c_rt_dt_ids[] = {
-+ { .compatible = "ralink,rt2880-i2c", .data = (void *) I2C_TYPE_RALINK },
-+ { .compatible = "mediatek,mt7628-i2c", .data = (void *) I2C_TYPE_MEDIATEK },
++ { .compatible = "ralink,rt2880-i2c" },
+ { /* sentinel */ }
+};
+
+MODULE_DEVICE_TABLE(of, i2c_rt_dt_ids);
+
++static struct i2c_adapter_quirks rt_i2c_quirks = {
++ .max_write_len = BYTECNT_MAX,
++ .max_read_len = BYTECNT_MAX,
++};
++
++static int rt_i2c_init(struct rt_i2c *i2c)
++{
++ u32 reg;
++
++ /* i2c_sclk = periph_clk / ((2 * clk_div) + 5) */
++ i2c->clk_div = (clk_get_rate(i2c->clk) - (5 * i2c->cur_clk)) /
++ (2 * i2c->cur_clk);
++ if (i2c->clk_div < 8)
++ i2c->clk_div = 8;
++ if (i2c->clk_div > I2C_CLKDIV_MASK)
++ i2c->clk_div = I2C_CLKDIV_MASK;
++
++ /* check support combinde/repeated start message */
++ rt_i2c_w32(i2c, NOSTOP_CMD, REG_STARTXFR_REG);
++ reg = rt_i2c_r32(i2c, REG_STARTXFR_REG) & NOSTOP_CMD;
++
++ rt_i2c_reset(i2c);
++
++ return reg;
++}
++
+static int rt_i2c_probe(struct platform_device *pdev)
+{
-+ struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ struct resource *res;
++ struct rt_i2c *i2c;
++ struct i2c_adapter *adap;
+ const struct of_device_id *match;
-+ int ret;
++ int ret, restart;
+
+ match = of_match_device(i2c_rt_dt_ids, &pdev->dev);
-+ hw_type = (int) match->data;
+
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(&pdev->dev, "no memory resource found\n");
+ return -ENODEV;
+ }
+
-+ adapter = devm_kzalloc(&pdev->dev, sizeof(struct i2c_adapter), GFP_KERNEL);
-+ if (!adapter) {
++ i2c = devm_kzalloc(&pdev->dev, sizeof(struct rt_i2c), GFP_KERNEL);
++ if (!i2c) {
+ dev_err(&pdev->dev, "failed to allocate i2c_adapter\n");
+ return -ENOMEM;
+ }
+
-+ membase = devm_ioremap_resource(&pdev->dev, res);
-+ if (IS_ERR(membase))
-+ return PTR_ERR(membase);
-+
-+ strlcpy(adapter->name, dev_name(&pdev->dev), sizeof(adapter->name));
-+ adapter->owner = THIS_MODULE;
-+ adapter->nr = pdev->id;
-+ adapter->timeout = HZ;
-+ adapter->algo = &rt_i2c_algo;
-+ adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
-+ adapter->dev.parent = &pdev->dev;
-+ adapter->dev.of_node = pdev->dev.of_node;
-+
-+ ret = i2c_add_numbered_adapter(adapter);
-+ if (ret)
-+ return ret;
++ i2c->base = devm_ioremap_resource(&pdev->dev, res);
++ if (IS_ERR(i2c->base))
++ return PTR_ERR(i2c->base);
+
-+ platform_set_drvdata(pdev, adapter);
++ i2c->clk = devm_clk_get(&pdev->dev, NULL);
++ if (IS_ERR(i2c->clk)) {
++ dev_err(&pdev->dev, "no clock defined\n");
++ return -ENODEV;
++ }
++ clk_prepare_enable(i2c->clk);
++ i2c->dev = &pdev->dev;
++
++ if (of_property_read_u32(pdev->dev.of_node,
++ "clock-frequency", &i2c->cur_clk))
++ i2c->cur_clk = 100000;
++
++ adap = &i2c->adap;
++ adap->owner = THIS_MODULE;
++ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
++ adap->algo = &rt_i2c_algo;
++ adap->retries = 3;
++ adap->dev.parent = &pdev->dev;
++ i2c_set_adapdata(adap, i2c);
++ adap->dev.of_node = pdev->dev.of_node;
++ strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
++ adap->quirks = &rt_i2c_quirks;
++
++ platform_set_drvdata(pdev, i2c);
++
++ restart = rt_i2c_init(i2c);
++
++ ret = i2c_add_adapter(adap);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "failed to add adapter\n");
++ clk_disable_unprepare(i2c->clk);
++ return ret;
++ }
+
-+ dev_info(&pdev->dev, "loaded\n");
++ dev_info(&pdev->dev, "clock %uKHz, re-start %ssupport\n",
++ i2c->cur_clk/1000, restart ? "" : "not ");
+
-+ return 0;
++ return ret;
+}
+
+static int rt_i2c_remove(struct platform_device *pdev)
+{
-+ platform_set_drvdata(pdev, NULL);
++ struct rt_i2c *i2c = platform_get_drvdata(pdev);
++
++ i2c_del_adapter(&i2c->adap);
++ clk_disable_unprepare(i2c->clk);
+
+ return 0;
+}
@@ -389,8 +499,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+{
+ platform_driver_unregister(&rt_i2c_driver);
+}
-+
-+module_exit (i2c_rt_exit);
++module_exit(i2c_rt_exit);
+
+MODULE_AUTHOR("Steven Liu <steven_liu@mediatek.com>");
+MODULE_DESCRIPTION("Ralink I2c host driver");
diff --git a/target/linux/ramips/patches-4.4/0045-i2c-add-mt7621-driver.patch b/target/linux/ramips/patches-4.4/0045-i2c-add-mt7621-driver.patch
index 044991594b..df8b3a4431 100644
--- a/target/linux/ramips/patches-4.4/0045-i2c-add-mt7621-driver.patch
+++ b/target/linux/ramips/patches-4.4/0045-i2c-add-mt7621-driver.patch
@@ -13,12 +13,13 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
-@@ -810,6 +810,10 @@ config I2C_RALINK
- tristate "Ralink I2C Controller"
+@@ -811,6 +811,11 @@ config I2C_RALINK
+ depends on RALINK && !SOC_MT7621
select OF_I2C
+config I2C_MT7621
-+ tristate "MT7621 I2C Controller"
++ tristate "MT7621/MT7628 I2C Controller"
++ depends on RALINK && (SOC_MT7620 || SOC_MT7621)
+ select OF_I2C
+
config HAVE_S3C2410_I2C
@@ -36,11 +37,12 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
obj-$(CONFIG_I2C_RK3X) += i2c-rk3x.o
--- /dev/null
+++ b/drivers/i2c/busses/i2c-mt7621.c
-@@ -0,0 +1,303 @@
+@@ -0,0 +1,433 @@
+/*
+ * drivers/i2c/busses/i2c-mt7621.c
+ *
+ * Copyright (C) 2013 Steven Liu <steven_liu@mediatek.com>
++ * Copyright (C) 2016 Michael Lee <igvtee@gmail.com>
+ *
+ * Improve driver for i2cdetect from i2c-tools to detect i2c devices on the bus.
+ * (C) 2014 Sittisak <sittisaks@hotmail.com>
@@ -65,276 +67,405 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/platform_device.h>
++#include <linux/of_platform.h>
+#include <linux/i2c.h>
+#include <linux/io.h>
+#include <linux/err.h>
++#include <linux/clk.h>
++
++#define REG_SM0CFG0 0x08
++#define REG_SM0DOUT 0x10
++#define REG_SM0DIN 0x14
++#define REG_SM0ST 0x18
++#define REG_SM0AUTO 0x1C
++#define REG_SM0CFG1 0x20
++#define REG_SM0CFG2 0x28
++#define REG_SM0CTL0 0x40
++#define REG_SM0CTL1 0x44
++#define REG_SM0D0 0x50
++#define REG_SM0D1 0x54
++#define REG_PINTEN 0x5C
++#define REG_PINTST 0x60
++#define REG_PINTCL 0x64
++
++/* REG_SM0CFG0 */
++#define I2C_DEVADDR_MASK 0x7f
++
++/* REG_SM0ST */
++#define I2C_DATARDY BIT(2)
++#define I2C_SDOEMPTY BIT(1)
++#define I2C_BUSY BIT(0)
++
++/* REG_SM0AUTO */
++#define READ_CMD BIT(0)
++
++/* REG_SM0CFG1 */
++#define BYTECNT_MAX 64
++#define SET_BYTECNT(x) (x - 1)
++
++/* REG_SM0CFG2 */
++#define AUTOMODE_EN BIT(0)
++
++/* REG_SM0CTL0 */
++#define ODRAIN_HIGH_SM0 BIT(31)
++#define VSYNC_SHIFT 28
++#define VSYNC_MASK 0x3
++#define VSYNC_PULSE (0x1 << VSYNC_SHIFT)
++#define VSYNC_RISING (0x2 << VSYNC_SHIFT)
++#define CLK_DIV_SHIFT 16
++#define CLK_DIV_MASK 0xfff
++#define DEG_CNT_SHIFT 8
++#define DEG_CNT_MASK 0xff
++#define WAIT_HIGH BIT(6)
++#define DEG_EN BIT(5)
++#define CS_STATUA BIT(4)
++#define SCL_STATUS BIT(3)
++#define SDA_STATUS BIT(2)
++#define SM0_EN BIT(1)
++#define SCL_STRECH BIT(0)
++
++/* REG_SM0CTL1 */
++#define ACK_SHIFT 16
++#define ACK_MASK 0xff
++#define PGLEN_SHIFT 8
++#define PGLEN_MASK 0x7
++#define SM0_MODE_SHIFT 4
++#define SM0_MODE_MASK 0x7
++#define SM0_MODE_START 0x1
++#define SM0_MODE_WRITE 0x2
++#define SM0_MODE_STOP 0x3
++#define SM0_MODE_READ_NACK 0x4
++#define SM0_MODE_READ_ACK 0x5
++#define SM0_TRI_BUSY BIT(0)
++
++/* timeout waiting for I2C devices to respond (clock streching) */
++#define TIMEOUT_MS 1000
++#define DELAY_INTERVAL_US 100
++
++struct mtk_i2c {
++ void __iomem *base;
++ struct clk *clk;
++ struct device *dev;
++ struct i2c_adapter adap;
++ u32 cur_clk;
++ u32 clk_div;
++ u32 flags;
++};
+
-+#include <asm/mach-ralink/ralink_regs.h>
-+
-+#define REG_CONFIG_REG 0x00
-+#define REG_CLKDIV_REG 0x04
-+#define REG_DEVADDR_REG 0x08
-+#define REG_ADDR_REG 0x0C
-+#define REG_DATAOUT_REG 0x10
-+#define REG_DATAIN_REG 0x14
-+#define REG_STATUS_REG 0x18
-+#define REG_STARTXFR_REG 0x1C
-+#define REG_BYTECNT_REG 0x20
-+#define REG_SM0_IS_AUTOMODE 0x28
-+#define REG_SM0CTL0 0x40
-+
-+
-+#define I2C_STARTERR 0x10
-+#define I2C_ACKERR 0x08
-+#define I2C_DATARDY 0x04
-+#define I2C_SDOEMPTY 0x02
-+#define I2C_BUSY 0x01
-+
-+/* I2C_CFG register bit field */
-+#define I2C_CFG_ADDRLEN_8 (7<<5) /* 8 bits */
-+#define I2C_CFG_DEVADLEN_7 (6<<2)
-+#define I2C_CFG_ADDRDIS BIT(1)
-+#define I2C_CFG_DEVADDIS BIT(0)
-+
-+#define I2C_CFG_DEFAULT (I2C_CFG_ADDRLEN_8 | \
-+ I2C_CFG_DEVADLEN_7 | \
-+ I2C_CFG_ADDRDIS)
-+
-+#define I2C_RETRY 0x1000
-+
-+#define CLKDIV_VALUE 333
-+#define i2c_busy_loop (CLKDIV_VALUE*30)
-+
-+#define READ_CMD 0x01
-+#define WRITE_CMD 0x00
-+#define READ_BLOCK 16
-+
-+#define SM0_ODRAIN BIT(31)
-+#define SM0_VSYNC_MODE BIT(28)
-+#define SM0_CLK_DIV (CLKDIV_VALUE << 16)
-+#define SM0_WAIT_LEVEL BIT(6)
-+#define SM0_EN BIT(1)
-+
-+#define SM0_CFG_DEFUALT (SM0_ODRAIN | SM0_VSYNC_MODE | \
-+ SM0_CLK_DIV | SM0_WAIT_LEVEL | \
-+ SM0_EN)
-+/***********************************************************/
-+
-+static void __iomem *membase;
-+static struct i2c_adapter *adapter;
-+
-+static void rt_i2c_w32(u32 val, unsigned reg)
++static void mtk_i2c_w32(struct mtk_i2c *i2c, u32 val, unsigned reg)
+{
-+ iowrite32(val, membase + reg);
++ iowrite32(val, i2c->base + reg);
+}
+
-+static u32 rt_i2c_r32(unsigned reg)
++static u32 mtk_i2c_r32(struct mtk_i2c *i2c, unsigned reg)
+{
-+ return ioread32(membase + reg);
++ return ioread32(i2c->base + reg);
+}
+
-+static void mt7621_i2c_reset(struct i2c_adapter *a)
++static int poll_down_timeout(void __iomem *addr, u32 mask)
+{
-+ device_reset(a->dev.parent);
++ unsigned long timeout = jiffies + msecs_to_jiffies(TIMEOUT_MS);
++
++ do {
++ if (!(readl_relaxed(addr) & mask))
++ return 0;
++
++ usleep_range(DELAY_INTERVAL_US, DELAY_INTERVAL_US + 50);
++ } while (time_before(jiffies, timeout));
++
++ return (readl_relaxed(addr) & mask) ? -EAGAIN : 0;
+}
-+static void mt7621_i2c_enable(struct i2c_msg *msg)
++
++static int mtk_i2c_wait_idle(struct mtk_i2c *i2c)
+{
-+ rt_i2c_w32(msg->addr,REG_DEVADDR_REG);
-+ rt_i2c_w32(0,REG_ADDR_REG);
++ int ret;
++
++ ret = poll_down_timeout(i2c->base + REG_SM0ST, I2C_BUSY);
++ if (ret < 0)
++ dev_dbg(i2c->dev, "idle err(%d)\n", ret);
++
++ return ret;
+}
+
-+static void i2c_master_init(struct i2c_adapter *a)
++static int poll_up_timeout(void __iomem *addr, u32 mask)
+{
-+ mt7621_i2c_reset(a);
-+ rt_i2c_w32(I2C_CFG_DEFAULT,REG_CONFIG_REG);
-+ rt_i2c_w32(SM0_CFG_DEFUALT,REG_SM0CTL0);
-+ rt_i2c_w32(1,REG_SM0_IS_AUTOMODE);//auto mode
-+}
++ unsigned long timeout = jiffies + msecs_to_jiffies(TIMEOUT_MS);
++ u32 status;
+
++ do {
++ status = readl_relaxed(addr);
++ if (status & mask)
++ return 0;
++ usleep_range(DELAY_INTERVAL_US, DELAY_INTERVAL_US + 50);
++ } while (time_before(jiffies, timeout));
+
-+static inline int rt_i2c_wait_rx_done(void)
-+{
-+ int i=0;
-+ while((!(rt_i2c_r32(REG_STATUS_REG) & I2C_DATARDY)) && (i<i2c_busy_loop))
-+ i++;
-+ if(i>=i2c_busy_loop){
-+ pr_err("err,wait for idle timeout");
-+ return -ETIMEDOUT;
-+ }
-+ return 0;
++ return -ETIMEDOUT;
+}
+
-+static inline int rt_i2c_wait_idle(void)
++static int mtk_i2c_wait_rx_done(struct mtk_i2c *i2c)
+{
-+ int i=0;
-+ while((rt_i2c_r32(REG_STATUS_REG) & I2C_BUSY) && (i<i2c_busy_loop))
-+ i++;
-+ if(i>=i2c_busy_loop){
-+ pr_err("err,wait for idle timeout");
-+ return -ETIMEDOUT;
-+ }
-+ return 0;
++ int ret;
++
++ ret = poll_up_timeout(i2c->base + REG_SM0ST, I2C_DATARDY);
++ if (ret < 0)
++ dev_dbg(i2c->dev, "rx err(%d)\n", ret);
++
++ return ret;
+}
+
-+static inline int rt_i2c_wait_tx_done(void)
++static int mtk_i2c_wait_tx_done(struct mtk_i2c *i2c)
+{
-+ int i=0;
-+ while((!(rt_i2c_r32(REG_STATUS_REG) & I2C_SDOEMPTY)) && (i<i2c_busy_loop))
-+ i++;
-+ if(i>=i2c_busy_loop){
-+ pr_err("err,wait for idle timeout");
-+ return -ETIMEDOUT;
-+ }
-+ return 0;
++ int ret;
++
++ ret = poll_up_timeout(i2c->base + REG_SM0ST, I2C_SDOEMPTY);
++ if (ret < 0)
++ dev_dbg(i2c->dev, "tx err(%d)\n", ret);
++
++ return ret;
+}
+
-+static int rt_i2c_handle_msg(struct i2c_adapter *a, struct i2c_msg* msg)
++static void mtk_i2c_reset(struct mtk_i2c *i2c)
+{
-+ int i = 0, j = 0, pos = 0;
-+ int nblock = msg->len / READ_BLOCK;
-+ int rem = msg->len % READ_BLOCK;
++ u32 reg;
++ device_reset(i2c->adap.dev.parent);
++ barrier();
+
-+ if (msg->flags & I2C_M_TEN) {
-+ printk("10 bits addr not supported\n");
-+ return -EINVAL;
-+ }
++ /* ctrl0 */
++ reg = ODRAIN_HIGH_SM0 | VSYNC_PULSE | (i2c->clk_div << CLK_DIV_SHIFT) |
++ WAIT_HIGH | SM0_EN;
++ mtk_i2c_w32(i2c, reg, REG_SM0CTL0);
+
-+ if (msg->flags & I2C_M_RD) {
-+ for (i = 0; i < nblock; i++) {
-+ if (rt_i2c_wait_idle())
-+ goto err_timeout;
-+ rt_i2c_w32(READ_BLOCK - 1, REG_BYTECNT_REG);
-+ rt_i2c_w32(READ_CMD, REG_STARTXFR_REG);
-+ for (j = 0; j < READ_BLOCK; j++) {
-+ if (rt_i2c_wait_rx_done())
-+ goto err_timeout;
-+ msg->buf[pos++] = rt_i2c_r32(REG_DATAIN_REG);
-+ }
-+ }
++ /* auto mode */
++ mtk_i2c_w32(i2c, AUTOMODE_EN, REG_SM0CFG2);
++}
++
++static void mtk_i2c_dump_reg(struct mtk_i2c *i2c)
++{
++ dev_dbg(i2c->dev, "cfg0 %08x, dout %08x, din %08x, " \
++ "status %08x, auto %08x, cfg1 %08x, " \
++ "cfg2 %08x, ctl0 %08x, ctl1 %08x\n",
++ mtk_i2c_r32(i2c, REG_SM0CFG0),
++ mtk_i2c_r32(i2c, REG_SM0DOUT),
++ mtk_i2c_r32(i2c, REG_SM0DIN),
++ mtk_i2c_r32(i2c, REG_SM0ST),
++ mtk_i2c_r32(i2c, REG_SM0AUTO),
++ mtk_i2c_r32(i2c, REG_SM0CFG1),
++ mtk_i2c_r32(i2c, REG_SM0CFG2),
++ mtk_i2c_r32(i2c, REG_SM0CTL0),
++ mtk_i2c_r32(i2c, REG_SM0CTL1));
++}
+
-+ if (rt_i2c_wait_idle())
-+ goto err_timeout;
-+ rt_i2c_w32(rem - 1, REG_BYTECNT_REG);
-+ rt_i2c_w32(READ_CMD, REG_STARTXFR_REG);
-+
-+ for (i = 0; i < rem; i++) {
-+ if (rt_i2c_wait_rx_done())
-+ goto err_timeout;
-+ msg->buf[pos++] = rt_i2c_r32(REG_DATAIN_REG);
++static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
++ int num)
++{
++ struct mtk_i2c *i2c;
++ struct i2c_msg *pmsg;
++ int i, j, ret;
++ u32 cmd;
++
++ i2c = i2c_get_adapdata(adap);
++
++ for (i = 0; i < num; i++) {
++ pmsg = &msgs[i];
++ cmd = 0;
++
++ dev_dbg(i2c->dev, "addr: 0x%x, len: %d, flags: 0x%x\n",
++ pmsg->addr, pmsg->len, pmsg->flags);
++
++ /* wait hardware idle */
++ if ((ret = mtk_i2c_wait_idle(i2c)))
++ goto err_timeout;
++
++ if (pmsg->flags & I2C_M_TEN) {
++ dev_dbg(i2c->dev, "10 bits addr not supported\n");
++ return -EINVAL;
++ } else {
++ /* 7 bits address */
++ mtk_i2c_w32(i2c, pmsg->addr & I2C_DEVADDR_MASK,
++ REG_SM0CFG0);
+ }
-+ } else {
-+ if (rt_i2c_wait_idle())
-+ goto err_timeout;
-+ rt_i2c_w32(msg->len - 1, REG_BYTECNT_REG);
-+ for (i = 0; i < msg->len; i++) {
-+ rt_i2c_w32(msg->buf[i], REG_DATAOUT_REG);
-+ if(i == 0)
-+ rt_i2c_w32(WRITE_CMD, REG_STARTXFR_REG);
-+
-+ if (rt_i2c_wait_tx_done())
-+ goto err_timeout;
++
++ /* buffer length */
++ if (pmsg->len == 0) {
++ dev_dbg(i2c->dev, "length is 0\n");
++ return -EINVAL;
++ } else
++ mtk_i2c_w32(i2c, SET_BYTECNT(pmsg->len),
++ REG_SM0CFG1);
++
++ j = 0;
++ if (pmsg->flags & I2C_M_RD) {
++ cmd |= READ_CMD;
++ /* start transfer */
++ barrier();
++ mtk_i2c_w32(i2c, cmd, REG_SM0AUTO);
++ do {
++ /* wait */
++ if ((ret = mtk_i2c_wait_rx_done(i2c)))
++ goto err_timeout;
++ /* read data */
++ if (pmsg->len)
++ pmsg->buf[j] = mtk_i2c_r32(i2c,
++ REG_SM0DIN);
++ j++;
++ } while (j < pmsg->len);
++ } else {
++ do {
++ /* write data */
++ if (pmsg->len)
++ mtk_i2c_w32(i2c, pmsg->buf[j],
++ REG_SM0DOUT);
++ /* start transfer */
++ if (j == 0) {
++ barrier();
++ mtk_i2c_w32(i2c, cmd, REG_SM0AUTO);
++ }
++ /* wait */
++ if ((ret = mtk_i2c_wait_tx_done(i2c)))
++ goto err_timeout;
++ j++;
++ } while (j < pmsg->len);
+ }
+ }
++ /* the return value is number of executed messages */
++ ret = i;
+
-+ return 0;
-+err_timeout:
-+ return -ETIMEDOUT;
-+}
++ return ret;
+
-+static int rt_i2c_master_xfer(struct i2c_adapter *a, struct i2c_msg *m, int n)
-+{
-+ int i = 0;
-+ int ret = 0;
-+ i2c_master_init(a);
-+ mt7621_i2c_enable(m);
-+
-+ for (i = 0; i != n && ret==0; i++) {
-+ ret = rt_i2c_handle_msg(a, &m[i]);
-+ if (ret)
-+ return ret;
-+ }
-+ return i;
++err_timeout:
++ mtk_i2c_dump_reg(i2c);
++ mtk_i2c_reset(i2c);
++ return ret;
+}
+
-+static u32 rt_i2c_func(struct i2c_adapter *a)
++static u32 mtk_i2c_func(struct i2c_adapter *a)
+{
+ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
-+static const struct i2c_algorithm rt_i2c_algo = {
-+ .master_xfer = rt_i2c_master_xfer,
-+ .functionality = rt_i2c_func,
++static const struct i2c_algorithm mtk_i2c_algo = {
++ .master_xfer = mtk_i2c_master_xfer,
++ .functionality = mtk_i2c_func,
+};
+
-+static int rt_i2c_probe(struct platform_device *pdev)
++static const struct of_device_id i2c_mtk_dt_ids[] = {
++ { .compatible = "mediatek,mt7621-i2c" },
++ { /* sentinel */ }
++};
++
++MODULE_DEVICE_TABLE(of, i2c_mtk_dt_ids);
++
++static struct i2c_adapter_quirks mtk_i2c_quirks = {
++ .max_write_len = BYTECNT_MAX,
++ .max_read_len = BYTECNT_MAX,
++};
++
++static void mtk_i2c_init(struct mtk_i2c *i2c)
++{
++ i2c->clk_div = clk_get_rate(i2c->clk) / i2c->cur_clk;
++ if (i2c->clk_div > CLK_DIV_MASK)
++ i2c->clk_div = CLK_DIV_MASK;
++
++ mtk_i2c_reset(i2c);
++}
++
++static int mtk_i2c_probe(struct platform_device *pdev)
+{
-+ struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ struct resource *res;
++ struct mtk_i2c *i2c;
++ struct i2c_adapter *adap;
++ const struct of_device_id *match;
+ int ret;
+
-+ adapter = devm_kzalloc(&pdev->dev,sizeof(struct i2c_adapter), GFP_KERNEL);
-+ if (!adapter) {
++ match = of_match_device(i2c_mtk_dt_ids, &pdev->dev);
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_err(&pdev->dev, "no memory resource found\n");
++ return -ENODEV;
++ }
++
++ i2c = devm_kzalloc(&pdev->dev, sizeof(struct mtk_i2c), GFP_KERNEL);
++ if (!i2c) {
+ dev_err(&pdev->dev, "failed to allocate i2c_adapter\n");
+ return -ENOMEM;
+ }
-+ membase = devm_ioremap_resource(&pdev->dev, res);
-+ if (IS_ERR(membase))
-+ return PTR_ERR(membase);
-+
-+ strlcpy(adapter->name, dev_name(&pdev->dev), sizeof(adapter->name));
-+
-+ adapter->owner = THIS_MODULE;
-+ adapter->nr = pdev->id;
-+ adapter->timeout = HZ;
-+ adapter->algo = &rt_i2c_algo;
-+ adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
-+ adapter->dev.parent = &pdev->dev;
-+ adapter->dev.of_node = pdev->dev.of_node;
-+
-+ platform_set_drvdata(pdev, adapter);
-+
-+ ret = i2c_add_numbered_adapter(adapter);
-+ if (ret)
++
++ i2c->base = devm_ioremap_resource(&pdev->dev, res);
++ if (IS_ERR(i2c->base))
++ return PTR_ERR(i2c->base);
++
++ i2c->clk = devm_clk_get(&pdev->dev, NULL);
++ if (IS_ERR(i2c->clk)) {
++ dev_err(&pdev->dev, "no clock defined\n");
++ return -ENODEV;
++ }
++ clk_prepare_enable(i2c->clk);
++ i2c->dev = &pdev->dev;
++
++ if (of_property_read_u32(pdev->dev.of_node,
++ "clock-frequency", &i2c->cur_clk))
++ i2c->cur_clk = 100000;
++
++ adap = &i2c->adap;
++ adap->owner = THIS_MODULE;
++ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
++ adap->algo = &mtk_i2c_algo;
++ adap->retries = 3;
++ adap->dev.parent = &pdev->dev;
++ i2c_set_adapdata(adap, i2c);
++ adap->dev.of_node = pdev->dev.of_node;
++ strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
++ adap->quirks = &mtk_i2c_quirks;
++
++ platform_set_drvdata(pdev, i2c);
++
++ mtk_i2c_init(i2c);
++
++ ret = i2c_add_adapter(adap);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "failed to add adapter\n");
++ clk_disable_unprepare(i2c->clk);
+ return ret;
++ }
+
-+ dev_info(&pdev->dev,"loaded");
++ dev_info(&pdev->dev, "clock %uKHz, re-start not support\n",
++ i2c->cur_clk/1000);
+
-+ return 0;
++ return ret;
+}
+
-+static int rt_i2c_remove(struct platform_device *pdev)
++static int mtk_i2c_remove(struct platform_device *pdev)
+{
-+ platform_set_drvdata(pdev, NULL);
-+ return 0;
-+}
++ struct mtk_i2c *i2c = platform_get_drvdata(pdev);
+
-+static const struct of_device_id i2c_rt_dt_ids[] = {
-+ { .compatible = "ralink,i2c-mt7621", },
-+ { /* sentinel */ }
-+};
++ i2c_del_adapter(&i2c->adap);
++ clk_disable_unprepare(i2c->clk);
+
-+MODULE_DEVICE_TABLE(of, i2c_rt_dt_ids);
++ return 0;
++}
+
-+static struct platform_driver rt_i2c_driver = {
-+ .probe = rt_i2c_probe,
-+ .remove = rt_i2c_remove,
++static struct platform_driver mtk_i2c_driver = {
++ .probe = mtk_i2c_probe,
++ .remove = mtk_i2c_remove,
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "i2c-mt7621",
-+ .of_match_table = i2c_rt_dt_ids,
++ .of_match_table = i2c_mtk_dt_ids,
+ },
+};
+
-+static int __init i2c_rt_init (void)
++static int __init i2c_mtk_init (void)
+{
-+ return platform_driver_register(&rt_i2c_driver);
++ return platform_driver_register(&mtk_i2c_driver);
+}
++subsys_initcall(i2c_mtk_init);
+
-+static void __exit i2c_rt_exit (void)
++static void __exit i2c_mtk_exit (void)
+{
-+ platform_driver_unregister(&rt_i2c_driver);
++ platform_driver_unregister(&mtk_i2c_driver);
+}
-+module_init (i2c_rt_init);
-+module_exit (i2c_rt_exit);
++module_exit(i2c_mtk_exit);
+
+MODULE_AUTHOR("Steven Liu <steven_liu@mediatek.com>");
+MODULE_DESCRIPTION("MT7621 I2c host driver");
diff --git a/target/linux/ramips/patches-4.4/0047-DMA-ralink-add-rt2880-dma-engine.patch b/target/linux/ramips/patches-4.4/0047-DMA-ralink-add-rt2880-dma-engine.patch
index 3362d4b5fc..d100a082e7 100644
--- a/target/linux/ramips/patches-4.4/0047-DMA-ralink-add-rt2880-dma-engine.patch
+++ b/target/linux/ramips/patches-4.4/0047-DMA-ralink-add-rt2880-dma-engine.patch
@@ -14,13 +14,19 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
-@@ -40,6 +40,12 @@ config ASYNC_TX_ENABLE_CHANNEL_SWITCH
+@@ -40,6 +40,18 @@ config ASYNC_TX_ENABLE_CHANNEL_SWITCH
config ARCH_HAS_ASYNC_TX_FIND_CHANNEL
bool
+config DMA_RALINK
+ tristate "RALINK DMA support"
-+ depends on RALINK && SOC_MT7620
++ depends on RALINK && !SOC_RT288X
++ select DMA_ENGINE
++ select DMA_VIRTUAL_CHANNELS
++
++config MTK_HSDMA
++ tristate "MTK HSDMA support"
++ depends on RALINK && SOC_MT7621
+ select DMA_ENGINE
+ select DMA_VIRTUAL_CHANNELS
+
@@ -29,16 +35,17 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
-@@ -65,5 +65,6 @@ obj-$(CONFIG_TI_DMA_CROSSBAR) += ti-dma-
+@@ -65,5 +65,7 @@ obj-$(CONFIG_TI_DMA_CROSSBAR) += ti-dma-
obj-$(CONFIG_TI_EDMA) += edma.o
obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
obj-$(CONFIG_ZX_DMA) += zx296702_dma.o
+obj-$(CONFIG_DMA_RALINK) += ralink-gdma.o
++obj-$(CONFIG_MTK_HSDMA) += mtk-hsdma.o
obj-y += xilinx/
--- /dev/null
+++ b/drivers/dma/ralink-gdma.c
-@@ -0,0 +1,577 @@
+@@ -0,0 +1,928 @@
+/*
+ * Copyright (C) 2013, Lars-Peter Clausen <lars@metafoo.de>
+ * GDMA4740 DMAC support
@@ -48,10 +55,6 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
-+ * You should have received a copy of the GNU General Public License along
-+ * with this program; if not, write to the Free Software Foundation, Inc.,
-+ * 675 Mass Ave, Cambridge, MA 02139, USA.
-+ *
+ */
+
+#include <linux/dmaengine.h>
@@ -65,11 +68,11 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+#include <linux/spinlock.h>
+#include <linux/irq.h>
+#include <linux/of_dma.h>
++#include <linux/reset.h>
++#include <linux/of_device.h>
+
+#include "virt-dma.h"
+
-+#define GDMA_NR_CHANS 16
-+
+#define GDMA_REG_SRC_ADDR(x) (0x00 + (x) * 0x10)
+#define GDMA_REG_DST_ADDR(x) (0x04 + (x) * 0x10)
+
@@ -84,7 +87,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+#define GDMA_REG_CTRL0_BURST_SHIFT 3
+#define GDMA_REG_CTRL0_DONE_INT BIT(2)
+#define GDMA_REG_CTRL0_ENABLE BIT(1)
-+#define GDMA_REG_CTRL0_HW_MODE 0
++#define GDMA_REG_CTRL0_SW_MODE BIT(0)
+
+#define GDMA_REG_CTRL1(x) (0x0c + (x) * 0x10)
+#define GDMA_REG_CTRL1_SEG_MASK 0xf
@@ -109,16 +112,39 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+#define GDMA_REG_GCT_VER_SHIFT 1
+#define GDMA_REG_GCT_ARBIT_RR BIT(0)
+
++#define GDMA_REG_REQSTS 0x2a0
++#define GDMA_REG_ACKSTS 0x2a4
++#define GDMA_REG_FINSTS 0x2a8
++
++/* for RT305X gdma registers */
++#define GDMA_RT305X_CTRL0_REQ_MASK 0xf
++#define GDMA_RT305X_CTRL0_SRC_REQ_SHIFT 12
++#define GDMA_RT305X_CTRL0_DST_REQ_SHIFT 8
++
++#define GDMA_RT305X_CTRL1_FAIL BIT(4)
++#define GDMA_RT305X_CTRL1_NEXT_MASK 0x7
++#define GDMA_RT305X_CTRL1_NEXT_SHIFT 1
++
++#define GDMA_RT305X_STATUS_INT 0x80
++#define GDMA_RT305X_STATUS_SIGNAL 0x84
++#define GDMA_RT305X_GCT 0x88
++
++/* for MT7621 gdma registers */
++#define GDMA_REG_PERF_START(x) (0x230 + (x) * 0x8)
++#define GDMA_REG_PERF_END(x) (0x234 + (x) * 0x8)
++
+enum gdma_dma_transfer_size {
+ GDMA_TRANSFER_SIZE_4BYTE = 0,
+ GDMA_TRANSFER_SIZE_8BYTE = 1,
+ GDMA_TRANSFER_SIZE_16BYTE = 2,
+ GDMA_TRANSFER_SIZE_32BYTE = 3,
++ GDMA_TRANSFER_SIZE_64BYTE = 4,
+};
+
+struct gdma_dma_sg {
-+ dma_addr_t addr;
-+ unsigned int len;
++ dma_addr_t src_addr;
++ dma_addr_t dst_addr;
++ u32 len;
+};
+
+struct gdma_dma_desc {
@@ -127,6 +153,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ enum dma_transfer_direction direction;
+ bool cyclic;
+
++ u32 residue;
+ unsigned int num_sgs;
+ struct gdma_dma_sg sg[];
+};
@@ -134,9 +161,10 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+struct gdma_dmaengine_chan {
+ struct virt_dma_chan vchan;
+ unsigned int id;
++ unsigned int slave_id;
+
+ dma_addr_t fifo_addr;
-+ unsigned int transfer_shift;
++ enum gdma_dma_transfer_size burst_size;
+
+ struct gdma_dma_desc *desc;
+ unsigned int next_sg;
@@ -144,10 +172,22 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+
+struct gdma_dma_dev {
+ struct dma_device ddev;
++ struct device_dma_parameters dma_parms;
++ struct gdma_data *data;
+ void __iomem *base;
-+ struct clk *clk;
++ struct tasklet_struct task;
++ volatile unsigned long chan_issued;
++ atomic_t cnt;
++
++ struct gdma_dmaengine_chan chan[];
++};
+
-+ struct gdma_dmaengine_chan chan[GDMA_NR_CHANS];
++struct gdma_data
++{
++ int chancnt;
++ u32 done_int_reg;
++ void (*init)(struct gdma_dma_dev *dma_dev);
++ int (*start_transfer)(struct gdma_dmaengine_chan *chan);
+};
+
+static struct gdma_dma_dev *gdma_dma_chan_get_dev(
@@ -176,21 +216,9 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+static inline void gdma_dma_write(struct gdma_dma_dev *dma_dev,
+ unsigned reg, uint32_t val)
+{
-+ //printk("gdma --> %p = 0x%08X\n", dma_dev->base + reg, val);
+ writel(val, dma_dev->base + reg);
+}
+
-+static inline void gdma_dma_write_mask(struct gdma_dma_dev *dma_dev,
-+ unsigned int reg, uint32_t val, uint32_t mask)
-+{
-+ uint32_t tmp;
-+
-+ tmp = gdma_dma_read(dma_dev, reg);
-+ tmp &= ~mask;
-+ tmp |= val;
-+ gdma_dma_write(dma_dev, reg, tmp);
-+}
-+
+static struct gdma_dma_desc *gdma_dma_alloc_desc(unsigned int num_sgs)
+{
+ return kzalloc(sizeof(struct gdma_dma_desc) +
@@ -199,58 +227,54 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+
+static enum gdma_dma_transfer_size gdma_dma_maxburst(u32 maxburst)
+{
-+ if (maxburst <= 7)
++ if (maxburst < 2)
+ return GDMA_TRANSFER_SIZE_4BYTE;
-+ else if (maxburst <= 15)
++ else if (maxburst < 4)
+ return GDMA_TRANSFER_SIZE_8BYTE;
-+ else if (maxburst <= 31)
++ else if (maxburst < 8)
+ return GDMA_TRANSFER_SIZE_16BYTE;
-+
-+ return GDMA_TRANSFER_SIZE_32BYTE;
++ else if (maxburst < 16)
++ return GDMA_TRANSFER_SIZE_32BYTE;
++ else
++ return GDMA_TRANSFER_SIZE_64BYTE;
+}
+
-+static int gdma_dma_slave_config(struct dma_chan *c,
-+ const struct dma_slave_config *config)
++static int gdma_dma_config(struct dma_chan *c,
++ struct dma_slave_config *config)
+{
+ struct gdma_dmaengine_chan *chan = to_gdma_dma_chan(c);
+ struct gdma_dma_dev *dma_dev = gdma_dma_chan_get_dev(chan);
-+ enum gdma_dma_transfer_size transfer_size;
-+ uint32_t flags;
-+ uint32_t ctrl0, ctrl1;
++
++ if (config->device_fc) {
++ dev_err(dma_dev->ddev.dev, "not support flow controller\n");
++ return -EINVAL;
++ }
+
+ switch (config->direction) {
+ case DMA_MEM_TO_DEV:
-+ ctrl1 = 32 << GDMA_REG_CTRL1_SRC_REQ_SHIFT;
-+ ctrl1 |= config->slave_id << GDMA_REG_CTRL1_DST_REQ_SHIFT;
-+ flags = GDMA_REG_CTRL0_DST_ADDR_FIXED;
-+ transfer_size = gdma_dma_maxburst(config->dst_maxburst);
++ if (config->dst_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) {
++ dev_err(dma_dev->ddev.dev, "only support 4 byte buswidth\n");
++ return -EINVAL;
++ }
++ chan->slave_id = config->slave_id;
+ chan->fifo_addr = config->dst_addr;
++ chan->burst_size = gdma_dma_maxburst(config->dst_maxburst);
+ break;
-+
+ case DMA_DEV_TO_MEM:
-+ ctrl1 = config->slave_id << GDMA_REG_CTRL1_SRC_REQ_SHIFT;
-+ ctrl1 |= 32 << GDMA_REG_CTRL1_DST_REQ_SHIFT;
-+ flags = GDMA_REG_CTRL0_SRC_ADDR_FIXED;
-+ transfer_size = gdma_dma_maxburst(config->src_maxburst);
++ if (config->src_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) {
++ dev_err(dma_dev->ddev.dev, "only support 4 byte buswidth\n");
++ return -EINVAL;
++ }
++ chan->slave_id = config->slave_id;
+ chan->fifo_addr = config->src_addr;
++ chan->burst_size = gdma_dma_maxburst(config->src_maxburst);
+ break;
-+
+ default:
++ dev_err(dma_dev->ddev.dev, "direction type %d error\n",
++ config->direction);
+ return -EINVAL;
+ }
+
-+ chan->transfer_shift = 1 + transfer_size;
-+
-+ ctrl0 = flags | GDMA_REG_CTRL0_HW_MODE;
-+ ctrl0 |= GDMA_REG_CTRL0_DONE_INT;
-+
-+ ctrl1 &= ~(GDMA_REG_CTRL1_NEXT_MASK << GDMA_REG_CTRL1_NEXT_SHIFT);
-+ ctrl1 |= chan->id << GDMA_REG_CTRL1_NEXT_SHIFT;
-+ ctrl1 |= GDMA_REG_CTRL1_FAIL;
-+ ctrl1 &= ~GDMA_REG_CTRL1_CONTINOUS;
-+ gdma_dma_write(dma_dev, GDMA_REG_CTRL0(chan->id), ctrl0);
-+ gdma_dma_write(dma_dev, GDMA_REG_CTRL1(chan->id), ctrl1);
-+
+ return 0;
+}
+
@@ -258,108 +282,271 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+{
+ struct gdma_dmaengine_chan *chan = to_gdma_dma_chan(c);
+ struct gdma_dma_dev *dma_dev = gdma_dma_chan_get_dev(chan);
-+ unsigned long flags;
++ unsigned long flags, timeout;
+ LIST_HEAD(head);
++ int i = 0;
+
+ spin_lock_irqsave(&chan->vchan.lock, flags);
-+ gdma_dma_write_mask(dma_dev, GDMA_REG_CTRL0(chan->id), 0,
-+ GDMA_REG_CTRL0_ENABLE);
+ chan->desc = NULL;
++ clear_bit(chan->id, &dma_dev->chan_issued);
+ vchan_get_all_descriptors(&chan->vchan, &head);
+ spin_unlock_irqrestore(&chan->vchan.lock, flags);
+
+ vchan_dma_desc_free_list(&chan->vchan, &head);
+
++ /* wait dma transfer complete */
++ timeout = jiffies + msecs_to_jiffies(5000);
++ while (gdma_dma_read(dma_dev, GDMA_REG_CTRL0(chan->id)) &
++ GDMA_REG_CTRL0_ENABLE) {
++ if (time_after_eq(jiffies, timeout)) {
++ dev_err(dma_dev->ddev.dev, "chan %d wait timeout\n",
++ chan->id);
++ /* restore to init value */
++ gdma_dma_write(dma_dev, GDMA_REG_CTRL0(chan->id), 0);
++ break;
++ }
++ cpu_relax();
++ i++;
++ }
++
++ if (i)
++ dev_dbg(dma_dev->ddev.dev, "terminate chan %d loops %d\n",
++ chan->id, i);
++
+ return 0;
+}
+
-+static int gdma_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
-+ unsigned long arg)
++static void rt305x_dump_reg(struct gdma_dma_dev *dma_dev, int id)
+{
-+ struct dma_slave_config *config = (struct dma_slave_config *)arg;
-+
-+ switch (cmd) {
-+ case DMA_SLAVE_CONFIG:
-+ return gdma_dma_slave_config(chan, config);
-+ case DMA_TERMINATE_ALL:
-+ return gdma_dma_terminate_all(chan);
-+ default:
-+ return -ENOSYS;
-+ }
++ dev_dbg(dma_dev->ddev.dev, "chan %d, src %08x, dst %08x, ctr0 %08x, " \
++ "ctr1 %08x, intr %08x, signal %08x\n", id,
++ gdma_dma_read(dma_dev, GDMA_REG_SRC_ADDR(id)),
++ gdma_dma_read(dma_dev, GDMA_REG_DST_ADDR(id)),
++ gdma_dma_read(dma_dev, GDMA_REG_CTRL0(id)),
++ gdma_dma_read(dma_dev, GDMA_REG_CTRL1(id)),
++ gdma_dma_read(dma_dev, GDMA_RT305X_STATUS_INT),
++ gdma_dma_read(dma_dev, GDMA_RT305X_STATUS_SIGNAL));
+}
+
-+static int gdma_dma_start_transfer(struct gdma_dmaengine_chan *chan)
++static int rt305x_gdma_start_transfer(struct gdma_dmaengine_chan *chan)
+{
+ struct gdma_dma_dev *dma_dev = gdma_dma_chan_get_dev(chan);
+ dma_addr_t src_addr, dst_addr;
-+ struct virt_dma_desc *vdesc;
+ struct gdma_dma_sg *sg;
++ uint32_t ctrl0, ctrl1;
+
-+ gdma_dma_write_mask(dma_dev, GDMA_REG_CTRL0(chan->id), 0,
-+ GDMA_REG_CTRL0_ENABLE);
++ /* verify chan is already stopped */
++ ctrl0 = gdma_dma_read(dma_dev, GDMA_REG_CTRL0(chan->id));
++ if (unlikely(ctrl0 & GDMA_REG_CTRL0_ENABLE)) {
++ dev_err(dma_dev->ddev.dev, "chan %d is start(%08x).\n",
++ chan->id, ctrl0);
++ rt305x_dump_reg(dma_dev, chan->id);
++ return -EINVAL;
++ }
+
-+ if (!chan->desc) {
-+ vdesc = vchan_next_desc(&chan->vchan);
-+ if (!vdesc)
-+ return 0;
-+ chan->desc = to_gdma_dma_desc(vdesc);
-+ chan->next_sg = 0;
++ sg = &chan->desc->sg[chan->next_sg];
++ if (chan->desc->direction == DMA_MEM_TO_DEV) {
++ src_addr = sg->src_addr;
++ dst_addr = chan->fifo_addr;
++ ctrl0 = GDMA_REG_CTRL0_DST_ADDR_FIXED | \
++ (8 << GDMA_RT305X_CTRL0_SRC_REQ_SHIFT) | \
++ (chan->slave_id << GDMA_RT305X_CTRL0_DST_REQ_SHIFT);
++ } else if (chan->desc->direction == DMA_DEV_TO_MEM) {
++ src_addr = chan->fifo_addr;
++ dst_addr = sg->dst_addr;
++ ctrl0 = GDMA_REG_CTRL0_SRC_ADDR_FIXED | \
++ (chan->slave_id << GDMA_RT305X_CTRL0_SRC_REQ_SHIFT) | \
++ (8 << GDMA_RT305X_CTRL0_DST_REQ_SHIFT);
++ } else if (chan->desc->direction == DMA_MEM_TO_MEM) {
++ /*
++ * TODO: memcpy function have bugs. sometime it will copy
++ * more 8 bytes data when using dmatest verify.
++ */
++ src_addr = sg->src_addr;
++ dst_addr = sg->dst_addr;
++ ctrl0 = GDMA_REG_CTRL0_SW_MODE | \
++ (8 << GDMA_REG_CTRL1_SRC_REQ_SHIFT) | \
++ (8 << GDMA_REG_CTRL1_DST_REQ_SHIFT);
++ } else {
++ dev_err(dma_dev->ddev.dev, "direction type %d error\n",
++ chan->desc->direction);
++ return -EINVAL;
+ }
+
-+ if (chan->next_sg == chan->desc->num_sgs)
-+ chan->next_sg = 0;
++ ctrl0 |= (sg->len << GDMA_REG_CTRL0_TX_SHIFT) | \
++ (chan->burst_size << GDMA_REG_CTRL0_BURST_SHIFT) | \
++ GDMA_REG_CTRL0_DONE_INT | GDMA_REG_CTRL0_ENABLE;
++ ctrl1 = chan->id << GDMA_REG_CTRL1_NEXT_SHIFT;
+
-+ sg = &chan->desc->sg[chan->next_sg];
++ chan->next_sg++;
++ gdma_dma_write(dma_dev, GDMA_REG_SRC_ADDR(chan->id), src_addr);
++ gdma_dma_write(dma_dev, GDMA_REG_DST_ADDR(chan->id), dst_addr);
++ gdma_dma_write(dma_dev, GDMA_REG_CTRL1(chan->id), ctrl1);
++
++ /* make sure next_sg is update */
++ wmb();
++ gdma_dma_write(dma_dev, GDMA_REG_CTRL0(chan->id), ctrl0);
+
++ return 0;
++}
++
++static void rt3883_dump_reg(struct gdma_dma_dev *dma_dev, int id)
++{
++ dev_dbg(dma_dev->ddev.dev, "chan %d, src %08x, dst %08x, ctr0 %08x, " \
++ "ctr1 %08x, unmask %08x, done %08x, " \
++ "req %08x, ack %08x, fin %08x\n", id,
++ gdma_dma_read(dma_dev, GDMA_REG_SRC_ADDR(id)),
++ gdma_dma_read(dma_dev, GDMA_REG_DST_ADDR(id)),
++ gdma_dma_read(dma_dev, GDMA_REG_CTRL0(id)),
++ gdma_dma_read(dma_dev, GDMA_REG_CTRL1(id)),
++ gdma_dma_read(dma_dev, GDMA_REG_UNMASK_INT),
++ gdma_dma_read(dma_dev, GDMA_REG_DONE_INT),
++ gdma_dma_read(dma_dev, GDMA_REG_REQSTS),
++ gdma_dma_read(dma_dev, GDMA_REG_ACKSTS),
++ gdma_dma_read(dma_dev, GDMA_REG_FINSTS));
++}
++
++static int rt3883_gdma_start_transfer(struct gdma_dmaengine_chan *chan)
++{
++ struct gdma_dma_dev *dma_dev = gdma_dma_chan_get_dev(chan);
++ dma_addr_t src_addr, dst_addr;
++ struct gdma_dma_sg *sg;
++ uint32_t ctrl0, ctrl1;
++
++ /* verify chan is already stopped */
++ ctrl0 = gdma_dma_read(dma_dev, GDMA_REG_CTRL0(chan->id));
++ if (unlikely(ctrl0 & GDMA_REG_CTRL0_ENABLE)) {
++ dev_err(dma_dev->ddev.dev, "chan %d is start(%08x).\n",
++ chan->id, ctrl0);
++ rt3883_dump_reg(dma_dev, chan->id);
++ return -EINVAL;
++ }
++
++ sg = &chan->desc->sg[chan->next_sg];
+ if (chan->desc->direction == DMA_MEM_TO_DEV) {
-+ src_addr = sg->addr;
++ src_addr = sg->src_addr;
+ dst_addr = chan->fifo_addr;
-+ } else {
++ ctrl0 = GDMA_REG_CTRL0_DST_ADDR_FIXED;
++ ctrl1 = (32 << GDMA_REG_CTRL1_SRC_REQ_SHIFT) | \
++ (chan->slave_id << GDMA_REG_CTRL1_DST_REQ_SHIFT);
++ } else if (chan->desc->direction == DMA_DEV_TO_MEM) {
+ src_addr = chan->fifo_addr;
-+ dst_addr = sg->addr;
++ dst_addr = sg->dst_addr;
++ ctrl0 = GDMA_REG_CTRL0_SRC_ADDR_FIXED;
++ ctrl1 = (chan->slave_id << GDMA_REG_CTRL1_SRC_REQ_SHIFT) | \
++ (32 << GDMA_REG_CTRL1_DST_REQ_SHIFT) | \
++ GDMA_REG_CTRL1_COHERENT;
++ } else if (chan->desc->direction == DMA_MEM_TO_MEM) {
++ src_addr = sg->src_addr;
++ dst_addr = sg->dst_addr;
++ ctrl0 = GDMA_REG_CTRL0_SW_MODE;
++ ctrl1 = (32 << GDMA_REG_CTRL1_SRC_REQ_SHIFT) | \
++ (32 << GDMA_REG_CTRL1_DST_REQ_SHIFT) | \
++ GDMA_REG_CTRL1_COHERENT;
++ } else {
++ dev_err(dma_dev->ddev.dev, "direction type %d error\n",
++ chan->desc->direction);
++ return -EINVAL;
+ }
++
++ ctrl0 |= (sg->len << GDMA_REG_CTRL0_TX_SHIFT) | \
++ (chan->burst_size << GDMA_REG_CTRL0_BURST_SHIFT) | \
++ GDMA_REG_CTRL0_DONE_INT | GDMA_REG_CTRL0_ENABLE;
++ ctrl1 |= chan->id << GDMA_REG_CTRL1_NEXT_SHIFT;
++
++ chan->next_sg++;
+ gdma_dma_write(dma_dev, GDMA_REG_SRC_ADDR(chan->id), src_addr);
+ gdma_dma_write(dma_dev, GDMA_REG_DST_ADDR(chan->id), dst_addr);
-+ gdma_dma_write_mask(dma_dev, GDMA_REG_CTRL0(chan->id),
-+ (sg->len << GDMA_REG_CTRL0_TX_SHIFT) | GDMA_REG_CTRL0_ENABLE,
-+ GDMA_REG_CTRL0_TX_MASK << GDMA_REG_CTRL0_TX_SHIFT);
-+ chan->next_sg++;
-+ gdma_dma_write_mask(dma_dev, GDMA_REG_CTRL1(chan->id), 0, GDMA_REG_CTRL1_MASK);
++ gdma_dma_write(dma_dev, GDMA_REG_CTRL1(chan->id), ctrl1);
++
++ /* make sure next_sg is update */
++ wmb();
++ gdma_dma_write(dma_dev, GDMA_REG_CTRL0(chan->id), ctrl0);
+
+ return 0;
+}
+
-+static void gdma_dma_chan_irq(struct gdma_dmaengine_chan *chan)
++static inline int gdma_start_transfer(struct gdma_dma_dev *dma_dev,
++ struct gdma_dmaengine_chan *chan)
++{
++ return dma_dev->data->start_transfer(chan);
++}
++
++static int gdma_next_desc(struct gdma_dmaengine_chan *chan)
++{
++ struct virt_dma_desc *vdesc;
++
++ vdesc = vchan_next_desc(&chan->vchan);
++ if (!vdesc) {
++ chan->desc = NULL;
++ return 0;
++ }
++ chan->desc = to_gdma_dma_desc(vdesc);
++ chan->next_sg = 0;
++
++ return 1;
++}
++
++static void gdma_dma_chan_irq(struct gdma_dma_dev *dma_dev,
++ struct gdma_dmaengine_chan *chan)
+{
-+ spin_lock(&chan->vchan.lock);
-+ if (chan->desc) {
-+ if (chan->desc && chan->desc->cyclic) {
-+ vchan_cyclic_callback(&chan->desc->vdesc);
++ struct gdma_dma_desc *desc;
++ unsigned long flags;
++ int chan_issued;
++
++ chan_issued = 0;
++ spin_lock_irqsave(&chan->vchan.lock, flags);
++ desc = chan->desc;
++ if (desc) {
++ if (desc->cyclic) {
++ vchan_cyclic_callback(&desc->vdesc);
++ if (chan->next_sg == desc->num_sgs)
++ chan->next_sg = 0;
++ chan_issued = 1;
+ } else {
-+ if (chan->next_sg == chan->desc->num_sgs) {
-+ chan->desc = NULL;
-+ vchan_cookie_complete(&chan->desc->vdesc);
-+ }
++ desc->residue -= desc->sg[chan->next_sg - 1].len;
++ if (chan->next_sg == desc->num_sgs) {
++ list_del(&desc->vdesc.node);
++ vchan_cookie_complete(&desc->vdesc);
++ chan_issued = gdma_next_desc(chan);
++ } else
++ chan_issued = 1;
+ }
-+ }
-+ gdma_dma_start_transfer(chan);
-+ spin_unlock(&chan->vchan.lock);
++ } else
++ dev_dbg(dma_dev->ddev.dev, "chan %d no desc to complete\n",
++ chan->id);
++ if (chan_issued)
++ set_bit(chan->id, &dma_dev->chan_issued);
++ spin_unlock_irqrestore(&chan->vchan.lock, flags);
+}
+
+static irqreturn_t gdma_dma_irq(int irq, void *devid)
+{
+ struct gdma_dma_dev *dma_dev = devid;
-+ uint32_t unmask, done;
++ u32 done, done_reg;
+ unsigned int i;
+
-+ unmask = gdma_dma_read(dma_dev, GDMA_REG_UNMASK_INT);
-+ gdma_dma_write(dma_dev, GDMA_REG_UNMASK_INT, unmask);
-+ done = gdma_dma_read(dma_dev, GDMA_REG_DONE_INT);
++ done_reg = dma_dev->data->done_int_reg;
++ done = gdma_dma_read(dma_dev, done_reg);
++ if (unlikely(!done))
++ return IRQ_NONE;
++
++ /* clean done bits */
++ gdma_dma_write(dma_dev, done_reg, done);
+
-+ for (i = 0; i < GDMA_NR_CHANS; ++i)
-+ if (done & BIT(i))
-+ gdma_dma_chan_irq(&dma_dev->chan[i]);
-+ gdma_dma_write(dma_dev, GDMA_REG_DONE_INT, done);
++ i = 0;
++ while (done) {
++ if (done & 0x1) {
++ gdma_dma_chan_irq(dma_dev, &dma_dev->chan[i]);
++ atomic_dec(&dma_dev->cnt);
++ }
++ done >>= 1;
++ i++;
++ }
++
++ /* start only have work to do */
++ if (dma_dev->chan_issued)
++ tasklet_schedule(&dma_dev->task);
+
+ return IRQ_HANDLED;
+}
@@ -367,18 +554,25 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+static void gdma_dma_issue_pending(struct dma_chan *c)
+{
+ struct gdma_dmaengine_chan *chan = to_gdma_dma_chan(c);
++ struct gdma_dma_dev *dma_dev = gdma_dma_chan_get_dev(chan);
+ unsigned long flags;
+
+ spin_lock_irqsave(&chan->vchan.lock, flags);
-+ if (vchan_issue_pending(&chan->vchan) && !chan->desc)
-+ gdma_dma_start_transfer(chan);
++ if (vchan_issue_pending(&chan->vchan) && !chan->desc) {
++ if (gdma_next_desc(chan)) {
++ set_bit(chan->id, &dma_dev->chan_issued);
++ tasklet_schedule(&dma_dev->task);
++ } else
++ dev_dbg(dma_dev->ddev.dev, "chan %d no desc to issue\n",
++ chan->id);
++ }
+ spin_unlock_irqrestore(&chan->vchan.lock, flags);
+}
+
+static struct dma_async_tx_descriptor *gdma_dma_prep_slave_sg(
-+ struct dma_chan *c, struct scatterlist *sgl,
-+ unsigned int sg_len, enum dma_transfer_direction direction,
-+ unsigned long flags, void *context)
++ struct dma_chan *c, struct scatterlist *sgl,
++ unsigned int sg_len, enum dma_transfer_direction direction,
++ unsigned long flags, void *context)
+{
+ struct gdma_dmaengine_chan *chan = to_gdma_dma_chan(c);
+ struct gdma_dma_desc *desc;
@@ -386,12 +580,30 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ unsigned int i;
+
+ desc = gdma_dma_alloc_desc(sg_len);
-+ if (!desc)
++ if (!desc) {
++ dev_err(c->device->dev, "alloc sg decs error\n");
+ return NULL;
++ }
++ desc->residue = 0;
+
+ for_each_sg(sgl, sg, sg_len, i) {
-+ desc->sg[i].addr = sg_dma_address(sg);
++ if (direction == DMA_MEM_TO_DEV)
++ desc->sg[i].src_addr = sg_dma_address(sg);
++ else if (direction == DMA_DEV_TO_MEM)
++ desc->sg[i].dst_addr = sg_dma_address(sg);
++ else {
++ dev_err(c->device->dev, "direction type %d error\n",
++ direction);
++ goto free_desc;
++ }
++
++ if (unlikely(sg_dma_len(sg) > GDMA_REG_CTRL0_TX_MASK)) {
++ dev_err(c->device->dev, "sg len too large %d\n",
++ sg_dma_len(sg));
++ goto free_desc;
++ }
+ desc->sg[i].len = sg_dma_len(sg);
++ desc->residue += sg_dma_len(sg);
+ }
+
+ desc->num_sgs = sg_len;
@@ -399,12 +611,60 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ desc->cyclic = false;
+
+ return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
++
++free_desc:
++ kfree(desc);
++ return NULL;
++}
++
++static struct dma_async_tx_descriptor * gdma_dma_prep_dma_memcpy(
++ struct dma_chan *c, dma_addr_t dest, dma_addr_t src,
++ size_t len, unsigned long flags)
++{
++ struct gdma_dmaengine_chan *chan = to_gdma_dma_chan(c);
++ struct gdma_dma_desc *desc;
++ unsigned int num_periods, i;
++ size_t xfer_count;
++
++ if (len <= 0)
++ return NULL;
++
++ chan->burst_size = gdma_dma_maxburst(len >> 2);
++
++ xfer_count = GDMA_REG_CTRL0_TX_MASK;
++ num_periods = DIV_ROUND_UP(len, xfer_count);
++
++ desc = gdma_dma_alloc_desc(num_periods);
++ if (!desc) {
++ dev_err(c->device->dev, "alloc memcpy decs error\n");
++ return NULL;
++ }
++ desc->residue = len;
++
++ for (i = 0; i < num_periods; i++) {
++ desc->sg[i].src_addr = src;
++ desc->sg[i].dst_addr = dest;
++ if (len > xfer_count) {
++ desc->sg[i].len = xfer_count;
++ } else {
++ desc->sg[i].len = len;
++ }
++ src += desc->sg[i].len;
++ dest += desc->sg[i].len;
++ len -= desc->sg[i].len;
++ }
++
++ desc->num_sgs = num_periods;
++ desc->direction = DMA_MEM_TO_MEM;
++ desc->cyclic = false;
++
++ return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
+}
+
+static struct dma_async_tx_descriptor *gdma_dma_prep_dma_cyclic(
+ struct dma_chan *c, dma_addr_t buf_addr, size_t buf_len,
+ size_t period_len, enum dma_transfer_direction direction,
-+ unsigned long flags, void *context)
++ unsigned long flags)
+{
+ struct gdma_dmaengine_chan *chan = to_gdma_dma_chan(c);
+ struct gdma_dma_desc *desc;
@@ -413,14 +673,30 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ if (buf_len % period_len)
+ return NULL;
+
-+ num_periods = buf_len / period_len;
++ if (period_len > GDMA_REG_CTRL0_TX_MASK) {
++ dev_err(c->device->dev, "cyclic len too large %d\n",
++ period_len);
++ return NULL;
++ }
+
++ num_periods = buf_len / period_len;
+ desc = gdma_dma_alloc_desc(num_periods);
-+ if (!desc)
++ if (!desc) {
++ dev_err(c->device->dev, "alloc cyclic decs error\n");
+ return NULL;
++ }
++ desc->residue = buf_len;
+
+ for (i = 0; i < num_periods; i++) {
-+ desc->sg[i].addr = buf_addr;
++ if (direction == DMA_MEM_TO_DEV)
++ desc->sg[i].src_addr = buf_addr;
++ else if (direction == DMA_DEV_TO_MEM)
++ desc->sg[i].dst_addr = buf_addr;
++ else {
++ dev_err(c->device->dev, "direction type %d error\n",
++ direction);
++ goto free_desc;
++ }
+ desc->sg[i].len = period_len;
+ buf_addr += period_len;
+ }
@@ -430,28 +706,10 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ desc->cyclic = true;
+
+ return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
-+}
+
-+static size_t gdma_dma_desc_residue(struct gdma_dmaengine_chan *chan,
-+ struct gdma_dma_desc *desc, unsigned int next_sg)
-+{
-+ struct gdma_dma_dev *dma_dev = gdma_dma_chan_get_dev(chan);
-+ unsigned int residue, count;
-+ unsigned int i;
-+
-+ residue = 0;
-+
-+ for (i = next_sg; i < desc->num_sgs; i++)
-+ residue += desc->sg[i].len;
-+
-+ if (next_sg != 0) {
-+ count = gdma_dma_read(dma_dev, GDMA_REG_CTRL0(chan->id));
-+ count >>= GDMA_REG_CTRL0_CURR_SHIFT;
-+ count &= GDMA_REG_CTRL0_CURR_MASK;
-+ residue += count << chan->transfer_shift;
-+ }
-+
-+ return residue;
++free_desc:
++ kfree(desc);
++ return NULL;
+}
+
+static enum dma_status gdma_dma_tx_status(struct dma_chan *c,
@@ -461,30 +719,32 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ struct virt_dma_desc *vdesc;
+ enum dma_status status;
+ unsigned long flags;
++ struct gdma_dma_desc *desc;
+
+ status = dma_cookie_status(c, cookie, state);
-+ if (status == DMA_SUCCESS || !state)
++ if (status == DMA_COMPLETE || !state)
+ return status;
+
+ spin_lock_irqsave(&chan->vchan.lock, flags);
-+ vdesc = vchan_find_desc(&chan->vchan, cookie);
-+ if (cookie == chan->desc->vdesc.tx.cookie) {
-+ state->residue = gdma_dma_desc_residue(chan, chan->desc,
-+ chan->next_sg);
-+ } else if (vdesc) {
-+ state->residue = gdma_dma_desc_residue(chan,
-+ to_gdma_dma_desc(vdesc), 0);
-+ } else {
-+ state->residue = 0;
-+ }
++ desc = chan->desc;
++ if (desc && (cookie == desc->vdesc.tx.cookie)) {
++ /*
++ * We never update edesc->residue in the cyclic case, so we
++ * can tell the remaining room to the end of the circular
++ * buffer.
++ */
++ if (desc->cyclic)
++ state->residue = desc->residue -
++ ((chan->next_sg - 1) * desc->sg[0].len);
++ else
++ state->residue = desc->residue;
++ } else if ((vdesc = vchan_find_desc(&chan->vchan, cookie)))
++ state->residue = to_gdma_dma_desc(vdesc)->residue;
+ spin_unlock_irqrestore(&chan->vchan.lock, flags);
+
-+ return status;
-+}
++ dev_dbg(c->device->dev, "tx residue %d bytes\n", state->residue);
+
-+static int gdma_dma_alloc_chan_resources(struct dma_chan *c)
-+{
-+ return 0;
++ return status;
+}
+
+static void gdma_dma_free_chan_resources(struct dma_chan *c)
@@ -497,87 +757,192 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ kfree(container_of(vdesc, struct gdma_dma_desc, vdesc));
+}
+
-+static struct dma_chan *
-+of_dma_xlate_by_chan_id(struct of_phandle_args *dma_spec,
-+ struct of_dma *ofdma)
++static void gdma_dma_tasklet(unsigned long arg)
+{
-+ struct gdma_dma_dev *dma_dev = ofdma->of_dma_data;
-+ unsigned int request = dma_spec->args[0];
++ struct gdma_dma_dev *dma_dev = (struct gdma_dma_dev *)arg;
++ struct gdma_dmaengine_chan *chan;
++ static unsigned int last_chan;
++ unsigned int i, chan_mask;
++
++ /* record last chan to round robin all chans */
++ i = last_chan;
++ chan_mask = dma_dev->data->chancnt - 1;
++ do {
++ /*
++ * on mt7621. when verify with dmatest with all
++ * channel is enable. we need to limit only two
++ * channel is working at the same time. otherwise the
++ * data will have problem.
++ */
++ if (atomic_read(&dma_dev->cnt) >= 2) {
++ last_chan = i;
++ break;
++ }
+
-+ if (request >= GDMA_NR_CHANS)
-+ return NULL;
++ if (test_and_clear_bit(i, &dma_dev->chan_issued)) {
++ chan = &dma_dev->chan[i];
++ if (chan->desc) {
++ atomic_inc(&dma_dev->cnt);
++ gdma_start_transfer(dma_dev, chan);
++ } else
++ dev_dbg(dma_dev->ddev.dev, "chan %d no desc to issue\n", chan->id);
++
++ if (!dma_dev->chan_issued)
++ break;
++ }
++
++ i = (i + 1) & chan_mask;
++ } while (i != last_chan);
++}
++
++static void rt305x_gdma_init(struct gdma_dma_dev *dma_dev)
++{
++ uint32_t gct;
++
++ /* all chans round robin */
++ gdma_dma_write(dma_dev, GDMA_RT305X_GCT, GDMA_REG_GCT_ARBIT_RR);
+
-+ return dma_get_slave_channel(&(dma_dev->chan[request].vchan.chan));
++ gct = gdma_dma_read(dma_dev, GDMA_RT305X_GCT);
++ dev_info(dma_dev->ddev.dev, "revision: %d, channels: %d\n",
++ (gct >> GDMA_REG_GCT_VER_SHIFT) & GDMA_REG_GCT_VER_MASK,
++ 8 << ((gct >> GDMA_REG_GCT_CHAN_SHIFT) &
++ GDMA_REG_GCT_CHAN_MASK));
+}
+
++static void rt3883_gdma_init(struct gdma_dma_dev *dma_dev)
++{
++ uint32_t gct;
++
++ /* all chans round robin */
++ gdma_dma_write(dma_dev, GDMA_REG_GCT, GDMA_REG_GCT_ARBIT_RR);
++
++ gct = gdma_dma_read(dma_dev, GDMA_REG_GCT);
++ dev_info(dma_dev->ddev.dev, "revision: %d, channels: %d\n",
++ (gct >> GDMA_REG_GCT_VER_SHIFT) & GDMA_REG_GCT_VER_MASK,
++ 8 << ((gct >> GDMA_REG_GCT_CHAN_SHIFT) &
++ GDMA_REG_GCT_CHAN_MASK));
++}
++
++static struct gdma_data rt305x_gdma_data = {
++ .chancnt = 8,
++ .done_int_reg = GDMA_RT305X_STATUS_INT,
++ .init = rt305x_gdma_init,
++ .start_transfer = rt305x_gdma_start_transfer,
++};
++
++static struct gdma_data rt3883_gdma_data = {
++ .chancnt = 16,
++ .done_int_reg = GDMA_REG_DONE_INT,
++ .init = rt3883_gdma_init,
++ .start_transfer = rt3883_gdma_start_transfer,
++};
++
++static const struct of_device_id gdma_of_match_table[] = {
++ { .compatible = "ralink,rt305x-gdma", .data = &rt305x_gdma_data },
++ { .compatible = "ralink,rt3883-gdma", .data = &rt3883_gdma_data },
++ { },
++};
++
+static int gdma_dma_probe(struct platform_device *pdev)
+{
++ const struct of_device_id *match;
+ struct gdma_dmaengine_chan *chan;
+ struct gdma_dma_dev *dma_dev;
+ struct dma_device *dd;
+ unsigned int i;
+ struct resource *res;
-+ uint32_t gct;
+ int ret;
+ int irq;
++ void __iomem *base;
++ struct gdma_data *data;
+
++ ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
++ if (ret)
++ return ret;
+
-+ dma_dev = devm_kzalloc(&pdev->dev, sizeof(*dma_dev), GFP_KERNEL);
-+ if (!dma_dev)
++ match = of_match_device(gdma_of_match_table, &pdev->dev);
++ if (!match)
+ return -EINVAL;
++ data = (struct gdma_data *) match->data;
+
-+ dd = &dma_dev->ddev;
++ dma_dev = devm_kzalloc(&pdev->dev, sizeof(*dma_dev) +
++ (sizeof(struct gdma_dmaengine_chan) * data->chancnt),
++ GFP_KERNEL);
++ if (!dma_dev) {
++ dev_err(&pdev->dev, "alloc dma device failed\n");
++ return -EINVAL;
++ }
++ dma_dev->data = data;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ dma_dev->base = devm_ioremap_resource(&pdev->dev, res);
-+ if (IS_ERR(dma_dev->base))
-+ return PTR_ERR(dma_dev->base);
++ base = devm_ioremap_resource(&pdev->dev, res);
++ if (IS_ERR(base))
++ return PTR_ERR(base);
++ dma_dev->base = base;
++ tasklet_init(&dma_dev->task, gdma_dma_tasklet, (unsigned long)dma_dev);
++
++ irq = platform_get_irq(pdev, 0);
++ if (irq < 0) {
++ dev_err(&pdev->dev, "failed to get irq\n");
++ return -EINVAL;
++ }
++ ret = devm_request_irq(&pdev->dev, irq, gdma_dma_irq,
++ 0, dev_name(&pdev->dev), dma_dev);
++ if (ret) {
++ dev_err(&pdev->dev, "failed to request irq\n");
++ return ret;
++ }
++
++ device_reset(&pdev->dev);
+
++ dd = &dma_dev->ddev;
++ dma_cap_set(DMA_MEMCPY, dd->cap_mask);
+ dma_cap_set(DMA_SLAVE, dd->cap_mask);
+ dma_cap_set(DMA_CYCLIC, dd->cap_mask);
-+ dd->device_alloc_chan_resources = gdma_dma_alloc_chan_resources;
+ dd->device_free_chan_resources = gdma_dma_free_chan_resources;
-+ dd->device_tx_status = gdma_dma_tx_status;
-+ dd->device_issue_pending = gdma_dma_issue_pending;
++ dd->device_prep_dma_memcpy = gdma_dma_prep_dma_memcpy;
+ dd->device_prep_slave_sg = gdma_dma_prep_slave_sg;
+ dd->device_prep_dma_cyclic = gdma_dma_prep_dma_cyclic;
-+ dd->device_control = gdma_dma_control;
++ dd->device_config = gdma_dma_config;
++ dd->device_terminate_all = gdma_dma_terminate_all;
++ dd->device_tx_status = gdma_dma_tx_status;
++ dd->device_issue_pending = gdma_dma_issue_pending;
++
++ dd->src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);
++ dd->dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);
++ dd->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
++ dd->residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT;
++
+ dd->dev = &pdev->dev;
-+ dd->chancnt = GDMA_NR_CHANS;
++ dd->dev->dma_parms = &dma_dev->dma_parms;
++ dma_set_max_seg_size(dd->dev, GDMA_REG_CTRL0_TX_MASK);
+ INIT_LIST_HEAD(&dd->channels);
+
-+ for (i = 0; i < dd->chancnt; i++) {
++ for (i = 0; i < data->chancnt; i++) {
+ chan = &dma_dev->chan[i];
+ chan->id = i;
+ chan->vchan.desc_free = gdma_dma_desc_free;
+ vchan_init(&chan->vchan, dd);
+ }
+
++ /* init hardware */
++ data->init(dma_dev);
++
+ ret = dma_async_device_register(dd);
-+ if (ret)
++ if (ret) {
++ dev_err(&pdev->dev, "failed to register dma device\n");
+ return ret;
++ }
+
+ ret = of_dma_controller_register(pdev->dev.of_node,
+ of_dma_xlate_by_chan_id, dma_dev);
-+ if (ret)
-+ goto err_unregister;
-+
-+ irq = platform_get_irq(pdev, 0);
-+ ret = request_irq(irq, gdma_dma_irq, 0, dev_name(&pdev->dev), dma_dev);
-+ if (ret)
++ if (ret) {
++ dev_err(&pdev->dev, "failed to register of dma controller\n");
+ goto err_unregister;
++ }
+
-+ gdma_dma_write(dma_dev, GDMA_REG_UNMASK_INT, 0);
-+ gdma_dma_write(dma_dev, GDMA_REG_DONE_INT, BIT(dd->chancnt) - 1);
-+
-+ gct = gdma_dma_read(dma_dev, GDMA_REG_GCT);
-+ dev_info(&pdev->dev, "revision: %d, channels: %d\n",
-+ (gct >> GDMA_REG_GCT_VER_SHIFT) & GDMA_REG_GCT_VER_MASK,
-+ 8 << ((gct >> GDMA_REG_GCT_CHAN_SHIFT) & GDMA_REG_GCT_CHAN_MASK));
+ platform_set_drvdata(pdev, dma_dev);
+
-+ gdma_dma_write(dma_dev, GDMA_REG_GCT, GDMA_REG_GCT_ARBIT_RR);
-+
+ return 0;
+
+err_unregister:
@@ -588,34 +953,27 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+static int gdma_dma_remove(struct platform_device *pdev)
+{
+ struct gdma_dma_dev *dma_dev = platform_get_drvdata(pdev);
-+ int irq = platform_get_irq(pdev, 0);
+
-+ free_irq(irq, dma_dev);
++ tasklet_kill(&dma_dev->task);
+ of_dma_controller_free(pdev->dev.of_node);
+ dma_async_device_unregister(&dma_dev->ddev);
+
+ return 0;
+}
+
-+static const struct of_device_id gdma_of_match_table[] = {
-+ { .compatible = "ralink,rt2880-gdma" },
-+ { },
-+};
-+
+static struct platform_driver gdma_dma_driver = {
+ .probe = gdma_dma_probe,
+ .remove = gdma_dma_remove,
+ .driver = {
+ .name = "gdma-rt2880",
-+ .owner = THIS_MODULE,
+ .of_match_table = gdma_of_match_table,
+ },
+};
+module_platform_driver(gdma_dma_driver);
+
+MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
-+MODULE_DESCRIPTION("GDMA4740 DMA driver");
-+MODULE_LICENSE("GPLv2");
++MODULE_DESCRIPTION("Ralink/MTK DMA driver");
++MODULE_LICENSE("GPL v2");
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -496,6 +496,7 @@ static inline void dma_set_unmap(struct
@@ -626,3 +984,773 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
#else
static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx,
struct dmaengine_unmap_data *unmap)
+--- /dev/null
++++ b/drivers/dma/mtk-hsdma.c
+@@ -0,0 +1,767 @@
++/*
++ * Copyright (C) 2015, Michael Lee <igvtee@gmail.com>
++ * MTK HSDMA support
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License as published by the
++ * Free Software Foundation; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ */
++
++#include <linux/dmaengine.h>
++#include <linux/dma-mapping.h>
++#include <linux/err.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/slab.h>
++#include <linux/spinlock.h>
++#include <linux/irq.h>
++#include <linux/of_dma.h>
++#include <linux/reset.h>
++#include <linux/of_device.h>
++
++#include "virt-dma.h"
++
++#define HSDMA_BASE_OFFSET 0x800
++
++#define HSDMA_REG_TX_BASE 0x00
++#define HSDMA_REG_TX_CNT 0x04
++#define HSDMA_REG_TX_CTX 0x08
++#define HSDMA_REG_TX_DTX 0x0c
++#define HSDMA_REG_RX_BASE 0x100
++#define HSDMA_REG_RX_CNT 0x104
++#define HSDMA_REG_RX_CRX 0x108
++#define HSDMA_REG_RX_DRX 0x10c
++#define HSDMA_REG_INFO 0x200
++#define HSDMA_REG_GLO_CFG 0x204
++#define HSDMA_REG_RST_CFG 0x208
++#define HSDMA_REG_DELAY_INT 0x20c
++#define HSDMA_REG_FREEQ_THRES 0x210
++#define HSDMA_REG_INT_STATUS 0x220
++#define HSDMA_REG_INT_MASK 0x228
++#define HSDMA_REG_SCH_Q01 0x280
++#define HSDMA_REG_SCH_Q23 0x284
++
++#define HSDMA_DESCS_MAX 0xfff
++#define HSDMA_DESCS_NUM 8
++#define HSDMA_DESCS_MASK (HSDMA_DESCS_NUM - 1)
++#define HSDMA_NEXT_DESC(x) (((x) + 1) & HSDMA_DESCS_MASK)
++
++/* HSDMA_REG_INFO */
++#define HSDMA_INFO_INDEX_MASK 0xf
++#define HSDMA_INFO_INDEX_SHIFT 24
++#define HSDMA_INFO_BASE_MASK 0xff
++#define HSDMA_INFO_BASE_SHIFT 16
++#define HSDMA_INFO_RX_MASK 0xff
++#define HSDMA_INFO_RX_SHIFT 8
++#define HSDMA_INFO_TX_MASK 0xff
++#define HSDMA_INFO_TX_SHIFT 0
++
++/* HSDMA_REG_GLO_CFG */
++#define HSDMA_GLO_TX_2B_OFFSET BIT(31)
++#define HSDMA_GLO_CLK_GATE BIT(30)
++#define HSDMA_GLO_BYTE_SWAP BIT(29)
++#define HSDMA_GLO_MULTI_DMA BIT(10)
++#define HSDMA_GLO_TWO_BUF BIT(9)
++#define HSDMA_GLO_32B_DESC BIT(8)
++#define HSDMA_GLO_BIG_ENDIAN BIT(7)
++#define HSDMA_GLO_TX_DONE BIT(6)
++#define HSDMA_GLO_BT_MASK 0x3
++#define HSDMA_GLO_BT_SHIFT 4
++#define HSDMA_GLO_RX_BUSY BIT(3)
++#define HSDMA_GLO_RX_DMA BIT(2)
++#define HSDMA_GLO_TX_BUSY BIT(1)
++#define HSDMA_GLO_TX_DMA BIT(0)
++
++#define HSDMA_BT_SIZE_16BYTES (0 << HSDMA_GLO_BT_SHIFT)
++#define HSDMA_BT_SIZE_32BYTES (1 << HSDMA_GLO_BT_SHIFT)
++#define HSDMA_BT_SIZE_64BYTES (2 << HSDMA_GLO_BT_SHIFT)
++#define HSDMA_BT_SIZE_128BYTES (3 << HSDMA_GLO_BT_SHIFT)
++
++#define HSDMA_GLO_DEFAULT (HSDMA_GLO_MULTI_DMA | \
++ HSDMA_GLO_RX_DMA | HSDMA_GLO_TX_DMA | HSDMA_BT_SIZE_32BYTES)
++
++/* HSDMA_REG_RST_CFG */
++#define HSDMA_RST_RX_SHIFT 16
++#define HSDMA_RST_TX_SHIFT 0
++
++/* HSDMA_REG_DELAY_INT */
++#define HSDMA_DELAY_INT_EN BIT(15)
++#define HSDMA_DELAY_PEND_OFFSET 8
++#define HSDMA_DELAY_TIME_OFFSET 0
++#define HSDMA_DELAY_TX_OFFSET 16
++#define HSDMA_DELAY_RX_OFFSET 0
++
++#define HSDMA_DELAY_INIT(x) (HSDMA_DELAY_INT_EN | \
++ ((x) << HSDMA_DELAY_PEND_OFFSET))
++#define HSDMA_DELAY(x) ((HSDMA_DELAY_INIT(x) << \
++ HSDMA_DELAY_TX_OFFSET) | HSDMA_DELAY_INIT(x))
++
++/* HSDMA_REG_INT_STATUS */
++#define HSDMA_INT_DELAY_RX_COH BIT(31)
++#define HSDMA_INT_DELAY_RX_INT BIT(30)
++#define HSDMA_INT_DELAY_TX_COH BIT(29)
++#define HSDMA_INT_DELAY_TX_INT BIT(28)
++#define HSDMA_INT_RX_MASK 0x3
++#define HSDMA_INT_RX_SHIFT 16
++#define HSDMA_INT_RX_Q0 BIT(16)
++#define HSDMA_INT_TX_MASK 0xf
++#define HSDMA_INT_TX_SHIFT 0
++#define HSDMA_INT_TX_Q0 BIT(0)
++
++/* tx/rx dma desc flags */
++#define HSDMA_PLEN_MASK 0x3fff
++#define HSDMA_DESC_DONE BIT(31)
++#define HSDMA_DESC_LS0 BIT(30)
++#define HSDMA_DESC_PLEN0(_x) (((_x) & HSDMA_PLEN_MASK) << 16)
++#define HSDMA_DESC_TAG BIT(15)
++#define HSDMA_DESC_LS1 BIT(14)
++#define HSDMA_DESC_PLEN1(_x) ((_x) & HSDMA_PLEN_MASK)
++
++/* align 4 bytes */
++#define HSDMA_ALIGN_SIZE 3
++/* align size 128bytes */
++#define HSDMA_MAX_PLEN 0x3f80
++
++struct hsdma_desc {
++ u32 addr0;
++ u32 flags;
++ u32 addr1;
++ u32 unused;
++};
++
++struct mtk_hsdma_sg {
++ dma_addr_t src_addr;
++ dma_addr_t dst_addr;
++ u32 len;
++};
++
++struct mtk_hsdma_desc {
++ struct virt_dma_desc vdesc;
++ unsigned int num_sgs;
++ struct mtk_hsdma_sg sg[1];
++};
++
++struct mtk_hsdma_chan {
++ struct virt_dma_chan vchan;
++ unsigned int id;
++ dma_addr_t desc_addr;
++ int tx_idx;
++ int rx_idx;
++ struct hsdma_desc *tx_ring;
++ struct hsdma_desc *rx_ring;
++ struct mtk_hsdma_desc *desc;
++ unsigned int next_sg;
++};
++
++struct mtk_hsdam_engine {
++ struct dma_device ddev;
++ struct device_dma_parameters dma_parms;
++ void __iomem *base;
++ struct tasklet_struct task;
++ volatile unsigned long chan_issued;
++
++ struct mtk_hsdma_chan chan[1];
++};
++
++static inline struct mtk_hsdam_engine *mtk_hsdma_chan_get_dev(
++ struct mtk_hsdma_chan *chan)
++{
++ return container_of(chan->vchan.chan.device, struct mtk_hsdam_engine,
++ ddev);
++}
++
++static inline struct mtk_hsdma_chan *to_mtk_hsdma_chan(struct dma_chan *c)
++{
++ return container_of(c, struct mtk_hsdma_chan, vchan.chan);
++}
++
++static inline struct mtk_hsdma_desc *to_mtk_hsdma_desc(
++ struct virt_dma_desc *vdesc)
++{
++ return container_of(vdesc, struct mtk_hsdma_desc, vdesc);
++}
++
++static inline u32 mtk_hsdma_read(struct mtk_hsdam_engine *hsdma, u32 reg)
++{
++ return readl(hsdma->base + reg);
++}
++
++static inline void mtk_hsdma_write(struct mtk_hsdam_engine *hsdma,
++ unsigned reg, u32 val)
++{
++ writel(val, hsdma->base + reg);
++}
++
++static void mtk_hsdma_reset_chan(struct mtk_hsdam_engine *hsdma,
++ struct mtk_hsdma_chan *chan)
++{
++ chan->tx_idx = 0;
++ chan->rx_idx = HSDMA_DESCS_NUM - 1;
++
++ mtk_hsdma_write(hsdma, HSDMA_REG_TX_CTX, chan->tx_idx);
++ mtk_hsdma_write(hsdma, HSDMA_REG_RX_CRX, chan->rx_idx);
++
++ mtk_hsdma_write(hsdma, HSDMA_REG_RST_CFG,
++ 0x1 << (chan->id + HSDMA_RST_TX_SHIFT));
++ mtk_hsdma_write(hsdma, HSDMA_REG_RST_CFG,
++ 0x1 << (chan->id + HSDMA_RST_RX_SHIFT));
++}
++
++static void hsdma_dump_reg(struct mtk_hsdam_engine *hsdma)
++{
++ dev_dbg(hsdma->ddev.dev, "tbase %08x, tcnt %08x, " \
++ "tctx %08x, tdtx: %08x, rbase %08x, " \
++ "rcnt %08x, rctx %08x, rdtx %08x\n",
++ mtk_hsdma_read(hsdma, HSDMA_REG_TX_BASE),
++ mtk_hsdma_read(hsdma, HSDMA_REG_TX_CNT),
++ mtk_hsdma_read(hsdma, HSDMA_REG_TX_CTX),
++ mtk_hsdma_read(hsdma, HSDMA_REG_TX_DTX),
++ mtk_hsdma_read(hsdma, HSDMA_REG_RX_BASE),
++ mtk_hsdma_read(hsdma, HSDMA_REG_RX_CNT),
++ mtk_hsdma_read(hsdma, HSDMA_REG_RX_CRX),
++ mtk_hsdma_read(hsdma, HSDMA_REG_RX_DRX));
++
++ dev_dbg(hsdma->ddev.dev, "info %08x, glo %08x, delay %08x, " \
++ "intr_stat %08x, intr_mask %08x\n",
++ mtk_hsdma_read(hsdma, HSDMA_REG_INFO),
++ mtk_hsdma_read(hsdma, HSDMA_REG_GLO_CFG),
++ mtk_hsdma_read(hsdma, HSDMA_REG_DELAY_INT),
++ mtk_hsdma_read(hsdma, HSDMA_REG_INT_STATUS),
++ mtk_hsdma_read(hsdma, HSDMA_REG_INT_MASK));
++}
++
++static void hsdma_dump_desc(struct mtk_hsdam_engine *hsdma,
++ struct mtk_hsdma_chan *chan)
++{
++ struct hsdma_desc *tx_desc;
++ struct hsdma_desc *rx_desc;
++ int i;
++
++ dev_dbg(hsdma->ddev.dev, "tx idx: %d, rx idx: %d\n",
++ chan->tx_idx, chan->rx_idx);
++
++ for (i = 0; i < HSDMA_DESCS_NUM; i++) {
++ tx_desc = &chan->tx_ring[i];
++ rx_desc = &chan->rx_ring[i];
++
++ dev_dbg(hsdma->ddev.dev, "%d tx addr0: %08x, flags %08x, " \
++ "tx addr1: %08x, rx addr0 %08x, flags %08x\n",
++ i, tx_desc->addr0, tx_desc->flags, \
++ tx_desc->addr1, rx_desc->addr0, rx_desc->flags);
++ }
++}
++
++static void mtk_hsdma_reset(struct mtk_hsdam_engine *hsdma,
++ struct mtk_hsdma_chan *chan)
++{
++ int i;
++
++ /* disable dma */
++ mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, 0);
++
++ /* disable intr */
++ mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, 0);
++
++ /* init desc value */
++ for (i = 0; i < HSDMA_DESCS_NUM; i++) {
++ chan->tx_ring[i].addr0 = 0;
++ chan->tx_ring[i].flags = HSDMA_DESC_LS0 |
++ HSDMA_DESC_DONE;
++ }
++ for (i = 0; i < HSDMA_DESCS_NUM; i++) {
++ chan->rx_ring[i].addr0 = 0;
++ chan->rx_ring[i].flags = 0;
++ }
++
++ /* reset */
++ mtk_hsdma_reset_chan(hsdma, chan);
++
++ /* enable intr */
++ mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, HSDMA_INT_RX_Q0);
++
++ /* enable dma */
++ mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, HSDMA_GLO_DEFAULT);
++}
++
++static int mtk_hsdma_terminate_all(struct dma_chan *c)
++{
++ struct mtk_hsdma_chan *chan = to_mtk_hsdma_chan(c);
++ struct mtk_hsdam_engine *hsdma = mtk_hsdma_chan_get_dev(chan);
++ unsigned long timeout;
++ LIST_HEAD(head);
++
++ spin_lock_bh(&chan->vchan.lock);
++ chan->desc = NULL;
++ clear_bit(chan->id, &hsdma->chan_issued);
++ vchan_get_all_descriptors(&chan->vchan, &head);
++ spin_unlock_bh(&chan->vchan.lock);
++
++ vchan_dma_desc_free_list(&chan->vchan, &head);
++
++ /* wait dma transfer complete */
++ timeout = jiffies + msecs_to_jiffies(2000);
++ while (mtk_hsdma_read(hsdma, HSDMA_REG_GLO_CFG) &
++ (HSDMA_GLO_RX_BUSY | HSDMA_GLO_TX_BUSY)) {
++ if (time_after_eq(jiffies, timeout)) {
++ hsdma_dump_desc(hsdma, chan);
++ mtk_hsdma_reset(hsdma, chan);
++ dev_err(hsdma->ddev.dev, "timeout, reset it\n");
++ break;
++ }
++ cpu_relax();
++ }
++
++ return 0;
++}
++
++static int mtk_hsdma_start_transfer(struct mtk_hsdam_engine *hsdma,
++ struct mtk_hsdma_chan *chan)
++{
++ dma_addr_t src, dst;
++ size_t len, tlen;
++ struct hsdma_desc *tx_desc, *rx_desc;
++ struct mtk_hsdma_sg *sg;
++ unsigned int i;
++ int rx_idx;
++
++ sg = &chan->desc->sg[0];
++ len = sg->len;
++ chan->desc->num_sgs = DIV_ROUND_UP(len, HSDMA_MAX_PLEN);
++
++ /* tx desc */
++ src = sg->src_addr;
++ for (i = 0; i < chan->desc->num_sgs; i++) {
++ if (len > HSDMA_MAX_PLEN)
++ tlen = HSDMA_MAX_PLEN;
++ else
++ tlen = len;
++
++ if (i & 0x1) {
++ tx_desc->addr1 = src;
++ tx_desc->flags |= HSDMA_DESC_PLEN1(tlen);
++ } else {
++ tx_desc = &chan->tx_ring[chan->tx_idx];
++ tx_desc->addr0 = src;
++ tx_desc->flags = HSDMA_DESC_PLEN0(tlen);
++
++ /* update index */
++ chan->tx_idx = HSDMA_NEXT_DESC(chan->tx_idx);
++ }
++
++ src += tlen;
++ len -= tlen;
++ }
++ if (i & 0x1)
++ tx_desc->flags |= HSDMA_DESC_LS0;
++ else
++ tx_desc->flags |= HSDMA_DESC_LS1;
++
++ /* rx desc */
++ rx_idx = HSDMA_NEXT_DESC(chan->rx_idx);
++ len = sg->len;
++ dst = sg->dst_addr;
++ for (i = 0; i < chan->desc->num_sgs; i++) {
++ rx_desc = &chan->rx_ring[rx_idx];
++ if (len > HSDMA_MAX_PLEN)
++ tlen = HSDMA_MAX_PLEN;
++ else
++ tlen = len;
++
++ rx_desc->addr0 = dst;
++ rx_desc->flags = HSDMA_DESC_PLEN0(tlen);
++
++ dst += tlen;
++ len -= tlen;
++
++ /* update index */
++ rx_idx = HSDMA_NEXT_DESC(rx_idx);
++ }
++
++ /* make sure desc and index all up to date */
++ wmb();
++ mtk_hsdma_write(hsdma, HSDMA_REG_TX_CTX, chan->tx_idx);
++
++ return 0;
++}
++
++static int gdma_next_desc(struct mtk_hsdma_chan *chan)
++{
++ struct virt_dma_desc *vdesc;
++
++ vdesc = vchan_next_desc(&chan->vchan);
++ if (!vdesc) {
++ chan->desc = NULL;
++ return 0;
++ }
++ chan->desc = to_mtk_hsdma_desc(vdesc);
++ chan->next_sg = 0;
++
++ return 1;
++}
++
++static void mtk_hsdma_chan_done(struct mtk_hsdam_engine *hsdma,
++ struct mtk_hsdma_chan *chan)
++{
++ struct mtk_hsdma_desc *desc;
++ int chan_issued;
++
++ chan_issued = 0;
++ spin_lock_bh(&chan->vchan.lock);
++ desc = chan->desc;
++ if (likely(desc)) {
++ if (chan->next_sg == desc->num_sgs) {
++ list_del(&desc->vdesc.node);
++ vchan_cookie_complete(&desc->vdesc);
++ chan_issued = gdma_next_desc(chan);
++ }
++ } else
++ dev_dbg(hsdma->ddev.dev, "no desc to complete\n");
++
++ if (chan_issued)
++ set_bit(chan->id, &hsdma->chan_issued);
++ spin_unlock_bh(&chan->vchan.lock);
++}
++
++static irqreturn_t mtk_hsdma_irq(int irq, void *devid)
++{
++ struct mtk_hsdam_engine *hsdma = devid;
++ u32 status;
++
++ status = mtk_hsdma_read(hsdma, HSDMA_REG_INT_STATUS);
++ if (unlikely(!status))
++ return IRQ_NONE;
++
++ if (likely(status & HSDMA_INT_RX_Q0))
++ tasklet_schedule(&hsdma->task);
++ else
++ dev_dbg(hsdma->ddev.dev, "unhandle irq status %08x\n",
++ status);
++ /* clean intr bits */
++ mtk_hsdma_write(hsdma, HSDMA_REG_INT_STATUS, status);
++
++ return IRQ_HANDLED;
++}
++
++static void mtk_hsdma_issue_pending(struct dma_chan *c)
++{
++ struct mtk_hsdma_chan *chan = to_mtk_hsdma_chan(c);
++ struct mtk_hsdam_engine *hsdma = mtk_hsdma_chan_get_dev(chan);
++
++ spin_lock_bh(&chan->vchan.lock);
++ if (vchan_issue_pending(&chan->vchan) && !chan->desc) {
++ if (gdma_next_desc(chan)) {
++ set_bit(chan->id, &hsdma->chan_issued);
++ tasklet_schedule(&hsdma->task);
++ } else
++ dev_dbg(hsdma->ddev.dev, "no desc to issue\n");
++ }
++ spin_unlock_bh(&chan->vchan.lock);
++}
++
++static struct dma_async_tx_descriptor * mtk_hsdma_prep_dma_memcpy(
++ struct dma_chan *c, dma_addr_t dest, dma_addr_t src,
++ size_t len, unsigned long flags)
++{
++ struct mtk_hsdma_chan *chan = to_mtk_hsdma_chan(c);
++ struct mtk_hsdma_desc *desc;
++
++ if (len <= 0)
++ return NULL;
++
++ desc = kzalloc(sizeof(struct mtk_hsdma_desc), GFP_ATOMIC);
++ if (!desc) {
++ dev_err(c->device->dev, "alloc memcpy decs error\n");
++ return NULL;
++ }
++
++ desc->sg[0].src_addr = src;
++ desc->sg[0].dst_addr = dest;
++ desc->sg[0].len = len;
++
++ return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
++}
++
++static enum dma_status mtk_hsdma_tx_status(struct dma_chan *c,
++ dma_cookie_t cookie, struct dma_tx_state *state)
++{
++ return dma_cookie_status(c, cookie, state);
++}
++
++static void mtk_hsdma_free_chan_resources(struct dma_chan *c)
++{
++ vchan_free_chan_resources(to_virt_chan(c));
++}
++
++static void mtk_hsdma_desc_free(struct virt_dma_desc *vdesc)
++{
++ kfree(container_of(vdesc, struct mtk_hsdma_desc, vdesc));
++}
++
++static void mtk_hsdma_tx(struct mtk_hsdam_engine *hsdma)
++{
++ struct mtk_hsdma_chan *chan;
++
++ if (test_and_clear_bit(0, &hsdma->chan_issued)) {
++ chan = &hsdma->chan[0];
++ if (chan->desc) {
++ mtk_hsdma_start_transfer(hsdma, chan);
++ } else
++ dev_dbg(hsdma->ddev.dev,"chan 0 no desc to issue\n");
++ }
++}
++
++static void mtk_hsdma_rx(struct mtk_hsdam_engine *hsdma)
++{
++ struct mtk_hsdma_chan *chan;
++ int next_idx, drx_idx, cnt;
++
++ chan = &hsdma->chan[0];
++ next_idx = HSDMA_NEXT_DESC(chan->rx_idx);
++ drx_idx = mtk_hsdma_read(hsdma, HSDMA_REG_RX_DRX);
++
++ cnt = (drx_idx - next_idx) & HSDMA_DESCS_MASK;
++ if (!cnt)
++ return;
++
++ chan->next_sg += cnt;
++ chan->rx_idx = (chan->rx_idx + cnt) & HSDMA_DESCS_MASK;
++
++ /* update rx crx */
++ wmb();
++ mtk_hsdma_write(hsdma, HSDMA_REG_RX_CRX, chan->rx_idx);
++
++ mtk_hsdma_chan_done(hsdma, chan);
++}
++
++static void mtk_hsdma_tasklet(unsigned long arg)
++{
++ struct mtk_hsdam_engine *hsdma = (struct mtk_hsdam_engine *)arg;
++
++ mtk_hsdma_rx(hsdma);
++ mtk_hsdma_tx(hsdma);
++}
++
++static int mtk_hsdam_alloc_desc(struct mtk_hsdam_engine *hsdma,
++ struct mtk_hsdma_chan *chan)
++{
++ int i;
++
++ chan->tx_ring = dma_alloc_coherent(hsdma->ddev.dev,
++ 2 * HSDMA_DESCS_NUM * sizeof(*chan->tx_ring),
++ &chan->desc_addr, GFP_ATOMIC | __GFP_ZERO);
++ if (!chan->tx_ring)
++ goto no_mem;
++
++ chan->rx_ring = &chan->tx_ring[HSDMA_DESCS_NUM];
++
++ /* init tx ring value */
++ for (i = 0; i < HSDMA_DESCS_NUM; i++)
++ chan->tx_ring[i].flags = HSDMA_DESC_LS0 | HSDMA_DESC_DONE;
++
++ return 0;
++no_mem:
++ return -ENOMEM;
++}
++
++static void mtk_hsdam_free_desc(struct mtk_hsdam_engine *hsdma,
++ struct mtk_hsdma_chan *chan)
++{
++ if (chan->tx_ring) {
++ dma_free_coherent(hsdma->ddev.dev,
++ 2 * HSDMA_DESCS_NUM * sizeof(*chan->tx_ring),
++ chan->tx_ring, chan->desc_addr);
++ chan->tx_ring = NULL;
++ chan->rx_ring = NULL;
++ }
++}
++
++static int mtk_hsdma_init(struct mtk_hsdam_engine *hsdma)
++{
++ struct mtk_hsdma_chan *chan;
++ int ret;
++ u32 reg;
++
++ /* init desc */
++ chan = &hsdma->chan[0];
++ ret = mtk_hsdam_alloc_desc(hsdma, chan);
++ if (ret)
++ return ret;
++
++ /* tx */
++ mtk_hsdma_write(hsdma, HSDMA_REG_TX_BASE, chan->desc_addr);
++ mtk_hsdma_write(hsdma, HSDMA_REG_TX_CNT, HSDMA_DESCS_NUM);
++ /* rx */
++ mtk_hsdma_write(hsdma, HSDMA_REG_RX_BASE, chan->desc_addr +
++ (sizeof(struct hsdma_desc) * HSDMA_DESCS_NUM));
++ mtk_hsdma_write(hsdma, HSDMA_REG_RX_CNT, HSDMA_DESCS_NUM);
++ /* reset */
++ mtk_hsdma_reset_chan(hsdma, chan);
++
++ /* enable rx intr */
++ mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, HSDMA_INT_RX_Q0);
++
++ /* enable dma */
++ mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, HSDMA_GLO_DEFAULT);
++
++ /* hardware info */
++ reg = mtk_hsdma_read(hsdma, HSDMA_REG_INFO);
++ dev_info(hsdma->ddev.dev, "rx: %d, tx: %d\n",
++ (reg >> HSDMA_INFO_RX_SHIFT) & HSDMA_INFO_RX_MASK,
++ (reg >> HSDMA_INFO_TX_SHIFT) & HSDMA_INFO_TX_MASK);
++
++ hsdma_dump_reg(hsdma);
++
++ return ret;
++}
++
++static void mtk_hsdma_uninit(struct mtk_hsdam_engine *hsdma)
++{
++ struct mtk_hsdma_chan *chan;
++
++ /* disable dma */
++ mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, 0);
++
++ /* disable intr */
++ mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, 0);
++
++ /* free desc */
++ chan = &hsdma->chan[0];
++ mtk_hsdam_free_desc(hsdma, chan);
++
++ /* tx */
++ mtk_hsdma_write(hsdma, HSDMA_REG_TX_BASE, 0);
++ mtk_hsdma_write(hsdma, HSDMA_REG_TX_CNT, 0);
++ /* rx */
++ mtk_hsdma_write(hsdma, HSDMA_REG_RX_BASE, 0);
++ mtk_hsdma_write(hsdma, HSDMA_REG_RX_CNT, 0);
++ /* reset */
++ mtk_hsdma_reset_chan(hsdma, chan);
++}
++
++static const struct of_device_id mtk_hsdma_of_match[] = {
++ { .compatible = "mediatek,mt7621-hsdma" },
++ { },
++};
++
++static int mtk_hsdma_probe(struct platform_device *pdev)
++{
++ const struct of_device_id *match;
++ struct mtk_hsdma_chan *chan;
++ struct mtk_hsdam_engine *hsdma;
++ struct dma_device *dd;
++ struct resource *res;
++ int ret;
++ int irq;
++ void __iomem *base;
++
++ ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
++ if (ret)
++ return ret;
++
++ match = of_match_device(mtk_hsdma_of_match, &pdev->dev);
++ if (!match)
++ return -EINVAL;
++
++ hsdma = devm_kzalloc(&pdev->dev, sizeof(*hsdma), GFP_KERNEL);
++ if (!hsdma) {
++ dev_err(&pdev->dev, "alloc dma device failed\n");
++ return -EINVAL;
++ }
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ base = devm_ioremap_resource(&pdev->dev, res);
++ if (IS_ERR(base))
++ return PTR_ERR(base);
++ hsdma->base = base + HSDMA_BASE_OFFSET;
++ tasklet_init(&hsdma->task, mtk_hsdma_tasklet, (unsigned long)hsdma);
++
++ irq = platform_get_irq(pdev, 0);
++ if (irq < 0) {
++ dev_err(&pdev->dev, "failed to get irq\n");
++ return -EINVAL;
++ }
++ ret = devm_request_irq(&pdev->dev, irq, mtk_hsdma_irq,
++ 0, dev_name(&pdev->dev), hsdma);
++ if (ret) {
++ dev_err(&pdev->dev, "failed to request irq\n");
++ return ret;
++ }
++
++ device_reset(&pdev->dev);
++
++ dd = &hsdma->ddev;
++ dma_cap_set(DMA_MEMCPY, dd->cap_mask);
++ dd->copy_align = HSDMA_ALIGN_SIZE;
++ dd->device_free_chan_resources = mtk_hsdma_free_chan_resources;
++ dd->device_prep_dma_memcpy = mtk_hsdma_prep_dma_memcpy;
++ dd->device_terminate_all = mtk_hsdma_terminate_all;
++ dd->device_tx_status = mtk_hsdma_tx_status;
++ dd->device_issue_pending = mtk_hsdma_issue_pending;
++ dd->dev = &pdev->dev;
++ dd->dev->dma_parms = &hsdma->dma_parms;
++ dma_set_max_seg_size(dd->dev, HSDMA_MAX_PLEN);
++ INIT_LIST_HEAD(&dd->channels);
++
++ chan = &hsdma->chan[0];
++ chan->id = 0;
++ chan->vchan.desc_free = mtk_hsdma_desc_free;
++ vchan_init(&chan->vchan, dd);
++
++ /* init hardware */
++ ret = mtk_hsdma_init(hsdma);
++ if (ret) {
++ dev_err(&pdev->dev, "failed to alloc ring descs\n");
++ return ret;
++ }
++
++ ret = dma_async_device_register(dd);
++ if (ret) {
++ dev_err(&pdev->dev, "failed to register dma device\n");
++ return ret;
++ }
++
++ ret = of_dma_controller_register(pdev->dev.of_node,
++ of_dma_xlate_by_chan_id, hsdma);
++ if (ret) {
++ dev_err(&pdev->dev, "failed to register of dma controller\n");
++ goto err_unregister;
++ }
++
++ platform_set_drvdata(pdev, hsdma);
++
++ return 0;
++
++err_unregister:
++ dma_async_device_unregister(dd);
++ return ret;
++}
++
++static int mtk_hsdma_remove(struct platform_device *pdev)
++{
++ struct mtk_hsdam_engine *hsdma = platform_get_drvdata(pdev);
++
++ mtk_hsdma_uninit(hsdma);
++
++ of_dma_controller_free(pdev->dev.of_node);
++ dma_async_device_unregister(&hsdma->ddev);
++
++ return 0;
++}
++
++static struct platform_driver mtk_hsdma_driver = {
++ .probe = mtk_hsdma_probe,
++ .remove = mtk_hsdma_remove,
++ .driver = {
++ .name = "hsdma-mt7621",
++ .of_match_table = mtk_hsdma_of_match,
++ },
++};
++module_platform_driver(mtk_hsdma_driver);
++
++MODULE_AUTHOR("Michael Lee <igvtee@gmail.com>");
++MODULE_DESCRIPTION("MTK HSDMA driver");
++MODULE_LICENSE("GPL v2");
diff --git a/target/linux/ramips/patches-4.4/0082-MIPS-ralink-fix-MT7628-pinmux-typos.patch b/target/linux/ramips/patches-4.4/0082-MIPS-ralink-fix-MT7628-pinmux-typos.patch
new file mode 100644
index 0000000000..d57630ecd5
--- /dev/null
+++ b/target/linux/ramips/patches-4.4/0082-MIPS-ralink-fix-MT7628-pinmux-typos.patch
@@ -0,0 +1,32 @@
+From d7146829c9da24e285cb1b1f2156b5b3e2d40c07 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Thu, 19 May 2016 22:07:34 +0200
+Subject: [PATCH] MIPS: ralink: fix MT7628 pinmux typos
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Cc: john@phrozen.org
+Cc: linux-mips@linux-mips.org
+Cc: linux-kernel@vger.kernel.org
+Patchwork: https://patchwork.linux-mips.org/patch/13306/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+---
+ arch/mips/ralink/mt7620.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/mips/ralink/mt7620.c
++++ b/arch/mips/ralink/mt7620.c
+@@ -223,9 +223,9 @@ static struct rt2880_pmx_func wled_an_gr
+ #define MT7628_GPIO_MODE_GPIO 0
+
+ static struct rt2880_pmx_group mt7628an_pinmux_data[] = {
+- GRP_G("pmw1", pwm1_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ GRP_G("pwm1", pwm1_grp_mt7628, MT7628_GPIO_MODE_MASK,
+ 1, MT7628_GPIO_MODE_PWM1),
+- GRP_G("pmw0", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ GRP_G("pwm0", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK,
+ 1, MT7628_GPIO_MODE_PWM0),
+ GRP_G("uart2", uart2_grp_mt7628, MT7628_GPIO_MODE_MASK,
+ 1, MT7628_GPIO_MODE_UART2),
diff --git a/target/linux/ramips/patches-4.4/0083-MIPS-ralink-fix-MT7628-wled_an-pinmux-gpio.patch b/target/linux/ramips/patches-4.4/0083-MIPS-ralink-fix-MT7628-wled_an-pinmux-gpio.patch
new file mode 100644
index 0000000000..2e3c231322
--- /dev/null
+++ b/target/linux/ramips/patches-4.4/0083-MIPS-ralink-fix-MT7628-wled_an-pinmux-gpio.patch
@@ -0,0 +1,35 @@
+From 07b50db6e685172a41b9978aebffb2438166d9b6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Thu, 19 May 2016 22:07:35 +0200
+Subject: [PATCH] MIPS: ralink: fix MT7628 wled_an pinmux gpio
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Cc: john@phrozen.org
+Cc: linux-mips@linux-mips.org
+Cc: linux-kernel@vger.kernel.org
+Patchwork: https://patchwork.linux-mips.org/patch/13307/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+---
+ arch/mips/ralink/mt7620.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/arch/mips/ralink/mt7620.c
++++ b/arch/mips/ralink/mt7620.c
+@@ -196,10 +196,10 @@ static struct rt2880_pmx_func wled_kn_gr
+ };
+
+ static struct rt2880_pmx_func wled_an_grp_mt7628[] = {
+- FUNC("rsvd", 3, 35, 1),
+- FUNC("rsvd", 2, 35, 1),
+- FUNC("gpio", 1, 35, 1),
+- FUNC("wled_an", 0, 35, 1),
++ FUNC("rsvd", 3, 44, 1),
++ FUNC("rsvd", 2, 44, 1),
++ FUNC("gpio", 1, 44, 1),
++ FUNC("wled_an", 0, 44, 1),
+ };
+
+ #define MT7628_GPIO_MODE_MASK 0x3
diff --git a/target/linux/ramips/patches-4.4/0084-MIPS-ralink-add-MT7628-EPHY-LEDs-pinmux-support.patch b/target/linux/ramips/patches-4.4/0084-MIPS-ralink-add-MT7628-EPHY-LEDs-pinmux-support.patch
new file mode 100644
index 0000000000..b22f99ddd1
--- /dev/null
+++ b/target/linux/ramips/patches-4.4/0084-MIPS-ralink-add-MT7628-EPHY-LEDs-pinmux-support.patch
@@ -0,0 +1,151 @@
+From 2b436a351803f38d0c8ca9c26103472c8aaeb599 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Thu, 19 May 2016 22:07:36 +0200
+Subject: [PATCH] MIPS: ralink: add MT7628 EPHY LEDs pinmux support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Cc: john@phrozen.org
+Cc: linux-mips@linux-mips.org
+Cc: linux-kernel@vger.kernel.org
+Patchwork: https://patchwork.linux-mips.org/patch/13308/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+---
+ arch/mips/ralink/mt7620.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 100 insertions(+)
+
+--- a/arch/mips/ralink/mt7620.c
++++ b/arch/mips/ralink/mt7620.c
+@@ -188,6 +188,41 @@ static struct rt2880_pmx_func gpio_grp_m
+ FUNC("gpio", 0, 11, 1),
+ };
+
++static struct rt2880_pmx_func p4led_kn_grp_mt7628[] = {
++ FUNC("jtag", 3, 30, 1),
++ FUNC("util", 2, 30, 1),
++ FUNC("gpio", 1, 30, 1),
++ FUNC("p4led_kn", 0, 30, 1),
++};
++
++static struct rt2880_pmx_func p3led_kn_grp_mt7628[] = {
++ FUNC("jtag", 3, 31, 1),
++ FUNC("util", 2, 31, 1),
++ FUNC("gpio", 1, 31, 1),
++ FUNC("p3led_kn", 0, 31, 1),
++};
++
++static struct rt2880_pmx_func p2led_kn_grp_mt7628[] = {
++ FUNC("jtag", 3, 32, 1),
++ FUNC("util", 2, 32, 1),
++ FUNC("gpio", 1, 32, 1),
++ FUNC("p2led_kn", 0, 32, 1),
++};
++
++static struct rt2880_pmx_func p1led_kn_grp_mt7628[] = {
++ FUNC("jtag", 3, 33, 1),
++ FUNC("util", 2, 33, 1),
++ FUNC("gpio", 1, 33, 1),
++ FUNC("p1led_kn", 0, 33, 1),
++};
++
++static struct rt2880_pmx_func p0led_kn_grp_mt7628[] = {
++ FUNC("jtag", 3, 34, 1),
++ FUNC("rsvd", 2, 34, 1),
++ FUNC("gpio", 1, 34, 1),
++ FUNC("p0led_kn", 0, 34, 1),
++};
++
+ static struct rt2880_pmx_func wled_kn_grp_mt7628[] = {
+ FUNC("rsvd", 3, 35, 1),
+ FUNC("rsvd", 2, 35, 1),
+@@ -195,6 +230,41 @@ static struct rt2880_pmx_func wled_kn_gr
+ FUNC("wled_kn", 0, 35, 1),
+ };
+
++static struct rt2880_pmx_func p4led_an_grp_mt7628[] = {
++ FUNC("jtag", 3, 39, 1),
++ FUNC("util", 2, 39, 1),
++ FUNC("gpio", 1, 39, 1),
++ FUNC("p4led_an", 0, 39, 1),
++};
++
++static struct rt2880_pmx_func p3led_an_grp_mt7628[] = {
++ FUNC("jtag", 3, 40, 1),
++ FUNC("util", 2, 40, 1),
++ FUNC("gpio", 1, 40, 1),
++ FUNC("p3led_an", 0, 40, 1),
++};
++
++static struct rt2880_pmx_func p2led_an_grp_mt7628[] = {
++ FUNC("jtag", 3, 41, 1),
++ FUNC("util", 2, 41, 1),
++ FUNC("gpio", 1, 41, 1),
++ FUNC("p2led_an", 0, 41, 1),
++};
++
++static struct rt2880_pmx_func p1led_an_grp_mt7628[] = {
++ FUNC("jtag", 3, 42, 1),
++ FUNC("util", 2, 42, 1),
++ FUNC("gpio", 1, 42, 1),
++ FUNC("p1led_an", 0, 42, 1),
++};
++
++static struct rt2880_pmx_func p0led_an_grp_mt7628[] = {
++ FUNC("jtag", 3, 43, 1),
++ FUNC("rsvd", 2, 43, 1),
++ FUNC("gpio", 1, 43, 1),
++ FUNC("p0led_an", 0, 43, 1),
++};
++
+ static struct rt2880_pmx_func wled_an_grp_mt7628[] = {
+ FUNC("rsvd", 3, 44, 1),
+ FUNC("rsvd", 2, 44, 1),
+@@ -204,7 +274,17 @@ static struct rt2880_pmx_func wled_an_gr
+
+ #define MT7628_GPIO_MODE_MASK 0x3
+
++#define MT7628_GPIO_MODE_P4LED_KN 58
++#define MT7628_GPIO_MODE_P3LED_KN 56
++#define MT7628_GPIO_MODE_P2LED_KN 54
++#define MT7628_GPIO_MODE_P1LED_KN 52
++#define MT7628_GPIO_MODE_P0LED_KN 50
+ #define MT7628_GPIO_MODE_WLED_KN 48
++#define MT7628_GPIO_MODE_P4LED_AN 42
++#define MT7628_GPIO_MODE_P3LED_AN 40
++#define MT7628_GPIO_MODE_P2LED_AN 38
++#define MT7628_GPIO_MODE_P1LED_AN 36
++#define MT7628_GPIO_MODE_P0LED_AN 34
+ #define MT7628_GPIO_MODE_WLED_AN 32
+ #define MT7628_GPIO_MODE_PWM1 30
+ #define MT7628_GPIO_MODE_PWM0 28
+@@ -251,8 +331,28 @@ static struct rt2880_pmx_group mt7628an_
+ 1, MT7628_GPIO_MODE_GPIO),
+ GRP_G("wled_an", wled_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
+ 1, MT7628_GPIO_MODE_WLED_AN),
++ GRP_G("p0led_an", p0led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P0LED_AN),
++ GRP_G("p1led_an", p1led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P1LED_AN),
++ GRP_G("p2led_an", p2led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P2LED_AN),
++ GRP_G("p3led_an", p3led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P3LED_AN),
++ GRP_G("p4led_an", p4led_an_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P4LED_AN),
+ GRP_G("wled_kn", wled_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
+ 1, MT7628_GPIO_MODE_WLED_KN),
++ GRP_G("p0led_kn", p0led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P0LED_KN),
++ GRP_G("p1led_kn", p1led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P1LED_KN),
++ GRP_G("p2led_kn", p2led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P2LED_KN),
++ GRP_G("p3led_kn", p3led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P3LED_KN),
++ GRP_G("p4led_kn", p4led_kn_grp_mt7628, MT7628_GPIO_MODE_MASK,
++ 1, MT7628_GPIO_MODE_P4LED_KN),
+ { 0 }
+ };
+
diff --git a/target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch b/target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch
index abefb4566d..cc4c2a152d 100644
--- a/target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch
+++ b/target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch
@@ -600,7 +600,7 @@ Signed-off-by: Michael Lee <igvtee@gmail.com>
+#endif
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -0,0 +1,1607 @@
+@@ -0,0 +1,1587 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
@@ -1400,20 +1400,6 @@ Signed-off-by: Michael Lee <igvtee@gmail.com>
+ return NETDEV_TX_OK;
+}
+
-+static inline void fe_rx_vlan(struct sk_buff *skb)
-+{
-+ struct ethhdr *ehdr;
-+ u16 vlanid;
-+
-+ if (!__vlan_get_tag(skb, &vlanid)) {
-+ /* pop the vlan tag */
-+ ehdr = (struct ethhdr *)skb->data;
-+ memmove(skb->data + VLAN_HLEN, ehdr, ETH_ALEN * 2);
-+ skb_pull(skb, VLAN_HLEN);
-+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlanid);
-+ }
-+}
-+
+static int fe_poll_rx(struct napi_struct *napi, int budget,
+ struct fe_priv *priv, u32 rx_intr)
+{
@@ -1427,7 +1413,6 @@ Signed-off-by: Michael Lee <igvtee@gmail.com>
+ u8 *data, *new_data;
+ struct fe_rx_dma *rxd, trxd;
+ int done = 0, pad;
-+ bool rx_vlan = netdev->features & NETIF_F_HW_VLAN_CTAG_RX;
+
+ if (netdev->features & NETIF_F_RXCSUM)
+ checksum_bit = soc->checksum_bit;
@@ -1483,8 +1468,6 @@ Signed-off-by: Michael Lee <igvtee@gmail.com>
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
+ else
+ skb_checksum_none_assert(skb);
-+ if (rx_vlan)
-+ fe_rx_vlan(skb);
+ skb->protocol = eth_type_trans(skb, netdev);
+
+ stats->rx_packets++;
@@ -2098,10 +2081,7 @@ Signed-off-by: Michael Lee <igvtee@gmail.com>
+
+ if (soc->init_data)
+ soc->init_data(soc, netdev);
-+ /* fake NETIF_F_HW_VLAN_CTAG_RX for good GRO performance */
-+ netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
-+ netdev->vlan_features = netdev->hw_features &
-+ ~(NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX);
++ netdev->vlan_features = netdev->hw_features & ~NETIF_F_HW_VLAN_CTAG_TX;
+ netdev->features |= netdev->hw_features;
+
+ /* fake rx vlan filter func. to support tx vlan offload func */
diff --git a/target/linux/ramips/patches-4.4/0509-net-next-mediatek-add-support-for-mt7621.patch b/target/linux/ramips/patches-4.4/0509-net-next-mediatek-add-support-for-mt7621.patch
index 9f32d00b44..6920545f0c 100644
--- a/target/linux/ramips/patches-4.4/0509-net-next-mediatek-add-support-for-mt7621.patch
+++ b/target/linux/ramips/patches-4.4/0509-net-next-mediatek-add-support-for-mt7621.patch
@@ -21,7 +21,7 @@ Signed-off-by: Michael Lee <igvtee@gmail.com>
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/soc_mt7621.c
-@@ -0,0 +1,186 @@
+@@ -0,0 +1,185 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
@@ -146,8 +146,7 @@ Signed-off-by: Michael Lee <igvtee@gmail.com>
+
+ /* mt7621 doesn't have txcsum config */
+ mt7621_rxcsum_config((dev->features & NETIF_F_RXCSUM));
-+ mt7621_rxvlan_config((dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
-+ (priv->flags & FE_FLAG_RX_VLAN_CTAG));
++ mt7621_rxvlan_config(priv->flags & FE_FLAG_RX_VLAN_CTAG);
+
+ return 0;
+}
diff --git a/target/linux/ramips/patches-4.4/0513-net-mediatek-add-swconfig-driver-for-gsw_mt762x.patch b/target/linux/ramips/patches-4.4/0513-net-mediatek-add-swconfig-driver-for-gsw_mt762x.patch
index bbad8cc523..3076e16400 100644
--- a/target/linux/ramips/patches-4.4/0513-net-mediatek-add-swconfig-driver-for-gsw_mt762x.patch
+++ b/target/linux/ramips/patches-4.4/0513-net-mediatek-add-swconfig-driver-for-gsw_mt762x.patch
@@ -858,7 +858,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+#endif
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1308,8 +1308,13 @@ static int __init fe_init(struct net_dev
+@@ -1291,8 +1291,13 @@ static int __init fe_init(struct net_dev
}
err = fe_hw_init(dev);
diff --git a/target/linux/ramips/patches-4.4/0601-net-mediatke-add-phy_ethtool_ioctl-support.patch b/target/linux/ramips/patches-4.4/0601-net-mediatke-add-phy_ethtool_ioctl-support.patch
index 369afa97de..11cf7ee588 100644
--- a/target/linux/ramips/patches-4.4/0601-net-mediatke-add-phy_ethtool_ioctl-support.patch
+++ b/target/linux/ramips/patches-4.4/0601-net-mediatke-add-phy_ethtool_ioctl-support.patch
@@ -10,7 +10,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1344,6 +1344,9 @@ static int fe_do_ioctl(struct net_device
+@@ -1327,6 +1327,9 @@ static int fe_do_ioctl(struct net_device
return -ENODEV;
switch (cmd) {
diff --git a/target/linux/ramips/patches-4.4/0721-asoc-enable-wm8960-kconfig.patch b/target/linux/ramips/patches-4.4/0721-asoc-enable-wm8960-kconfig.patch
new file mode 100644
index 0000000000..6272b71607
--- /dev/null
+++ b/target/linux/ramips/patches-4.4/0721-asoc-enable-wm8960-kconfig.patch
@@ -0,0 +1,11 @@
+--- a/sound/soc/codecs/Kconfig
++++ b/sound/soc/codecs/Kconfig
+@@ -825,7 +825,7 @@ config SND_SOC_WM8955
+ tristate
+
+ config SND_SOC_WM8960
+- tristate
++ tristate "Wolfson Microelectronics WM8960 CODEC"
+
+ config SND_SOC_WM8961
+ tristate
diff --git a/target/linux/ramips/rt288x/config-4.4 b/target/linux/ramips/rt288x/config-4.4
index 9c86e80da5..94e4cdde53 100644
--- a/target/linux/ramips/rt288x/config-4.4
+++ b/target/linux/ramips/rt288x/config-4.4
@@ -164,7 +164,6 @@ CONFIG_SCHED_HRTICK=y
# CONFIG_SCHED_INFO is not set
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_FSL is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_SOC_MT7620 is not set
diff --git a/target/linux/ramips/rt288x/profiles/00-default.mk b/target/linux/ramips/rt288x/profiles/00-default.mk
deleted file mode 100644
index 583610a65a..0000000000
--- a/target/linux/ramips/rt288x/profiles/00-default.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/Default
- NAME:=Default Profile
- PACKAGES:=kmod-switch-rtl8366s kmod-swconfig swconfig
-endef
-
-define Profile/Default/Description
- Default package set compatible with most boards.
-endef
-$(eval $(call Profile,Default))
diff --git a/target/linux/ramips/rt288x/profiles/asus.mk b/target/linux/ramips/rt288x/profiles/asus.mk
deleted file mode 100644
index aa6fb4d6be..0000000000
--- a/target/linux/ramips/rt288x/profiles/asus.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/RTN15
- NAME:=Asus RT-N15
- PACKAGES:=kmod-switch-rtl8366s kmod-swconfig swconfig
-endef
-
-define Profile/RTN15/Description
- Package set for Asus RT-N15 board
-endef
-$(eval $(call Profile,RTN15))
diff --git a/target/linux/ramips/rt288x/profiles/belkin.mk b/target/linux/ramips/rt288x/profiles/belkin.mk
deleted file mode 100644
index 4a0c62dd5e..0000000000
--- a/target/linux/ramips/rt288x/profiles/belkin.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright (C) 2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/F5D8235V1
- NAME:=Belkin F5D8235 V1
- PACKAGES:=kmod-switch-rtl8366s kmod-swconfig swconfig
-endef
-
-define Profile/F5D8235V1/Description
- Package set for Belkin F5D8235 V1
-endef
-$(eval $(call Profile,F5D8235V1))
diff --git a/target/linux/ramips/rt305x/config-4.4 b/target/linux/ramips/rt305x/config-4.4
index 4c14e3724c..9911d9249e 100644
--- a/target/linux/ramips/rt305x/config-4.4
+++ b/target/linux/ramips/rt305x/config-4.4
@@ -166,7 +166,6 @@ CONFIG_SCHED_HRTICK=y
# CONFIG_SCHED_INFO is not set
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_FSL is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_SOC_MT7620 is not set
diff --git a/target/linux/ramips/rt305x/profiles/00-default.mk b/target/linux/ramips/rt305x/profiles/00-default.mk
index a905d1ed80..f2d1a52052 100644
--- a/target/linux/ramips/rt305x/profiles/00-default.mk
+++ b/target/linux/ramips/rt305x/profiles/00-default.mk
@@ -7,6 +7,7 @@
define Profile/Default
NAME:=Default Profile
+ PRIORITY:=1
PACKAGES:=\
kmod-usb-core kmod-usb-dwc2 \
kmod-ledtrig-usbdev
diff --git a/target/linux/ramips/rt305x/target.mk b/target/linux/ramips/rt305x/target.mk
index b97554fc7c..633925999e 100644
--- a/target/linux/ramips/rt305x/target.mk
+++ b/target/linux/ramips/rt305x/target.mk
@@ -4,7 +4,6 @@
SUBTARGET:=rt305x
BOARDNAME:=RT3x5x/RT5350 based boards
-ARCH_PACKAGES:=ramips_24kec
FEATURES+=usb ramdisk
CPU_TYPE:=24kec
CPU_SUBTYPE:=dsp
diff --git a/target/linux/ramips/rt3883/config-4.4 b/target/linux/ramips/rt3883/config-4.4
index b25face30c..26f0fd9cdb 100644
--- a/target/linux/ramips/rt3883/config-4.4
+++ b/target/linux/ramips/rt3883/config-4.4
@@ -174,7 +174,6 @@ CONFIG_SCHED_HRTICK=y
# CONFIG_SCHED_INFO is not set
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_FSL is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_SOC_MT7620 is not set
diff --git a/target/linux/ramips/rt3883/profiles/00-default.mk b/target/linux/ramips/rt3883/profiles/00-default.mk
index 7007c5d920..c99029d7b1 100644
--- a/target/linux/ramips/rt3883/profiles/00-default.mk
+++ b/target/linux/ramips/rt3883/profiles/00-default.mk
@@ -7,6 +7,7 @@
define Profile/Default
NAME:=Default Profile
+ PRIORITY:=1
PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
endef
diff --git a/target/linux/ramips/rt3883/target.mk b/target/linux/ramips/rt3883/target.mk
index 96c9e93a71..7a2cec99a1 100644
--- a/target/linux/ramips/rt3883/target.mk
+++ b/target/linux/ramips/rt3883/target.mk
@@ -4,7 +4,6 @@
SUBTARGET:=rt3883
BOARDNAME:=RT3662/RT3883 based boards
-ARCH_PACKAGES:=ramips_24kec
FEATURES+=usb pci
CPU_TYPE:=74kc
CPU_SUBTYPE:=dsp2
diff --git a/target/linux/realview/Makefile b/target/linux/realview/Makefile
index e7a1220f60..c4f7a72e39 100644
--- a/target/linux/realview/Makefile
+++ b/target/linux/realview/Makefile
@@ -14,7 +14,7 @@ CPU_TYPE:=mpcore
CPU_SUBTYPE:=vfp
MAINTAINER:=Florian Fainelli <florian@openwrt.org>
-KERNEL_PATCHVER:=3.18
+KERNEL_PATCHVER:=4.4
DEVICE_TYPE:=developerboard
diff --git a/target/linux/realview/config-4.4 b/target/linux/realview/config-4.4
new file mode 100644
index 0000000000..767f480425
--- /dev/null
+++ b/target/linux/realview/config-4.4
@@ -0,0 +1,297 @@
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAS_BARRIERS=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+# CONFIG_ARCH_HAS_SG_CHAIN is not set
+CONFIG_ARCH_HAS_TICK_BROADCAST=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_REALVIEW=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+CONFIG_ARM=y
+CONFIG_ARM_AMBA=y
+# CONFIG_ARM_CHARLCD is not set
+# CONFIG_ARM_CPU_SUSPEND is not set
+CONFIG_ARM_GIC=y
+CONFIG_ARM_HEAVY_MB=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_PMU=y
+# CONFIG_ARM_SP805_WATCHDOG is not set
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+CONFIG_ARM_TIMER_SP804=y
+CONFIG_ARM_VIRT_EXT=y
+CONFIG_ATAGS=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BOUNCE=y
+CONFIG_CACHE_L2X0=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_MMIO=y
+# CONFIG_CLK_SP810 is not set
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="console=ttyAMA0 mem=128M"
+CONFIG_CMDLINE_FROM_BOOTLOADER=y
+CONFIG_COMMON_CLK=y
+CONFIG_COMMON_CLK_VERSATILE=y
+CONFIG_CPU_32v6=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV6=y
+CONFIG_CPU_ABRT_EV7=y
+# CONFIG_CPU_ARM926T is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_CPU_CACHE_V6=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_CPU_HAS_ASID=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+CONFIG_CPU_PABRT_V6=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_RMAP=y
+CONFIG_CPU_TLB_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_V6=y
+CONFIG_CPU_V6K=y
+CONFIG_CPU_V7=y
+CONFIG_CRC16=y
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DMA_CACHE_RWFO=y
+CONFIG_DNOTIFY=y
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+CONFIG_EXT4_FS=y
+CONFIG_FB=y
+CONFIG_FB_ARMCLCD=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_FB_CMDLINE=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_FRAME_POINTER=y
+CONFIG_FS_MBCACHE=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+# CONFIG_HAVE_ARCH_BITREVERSE is not set
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_HAVE_ARCH_PFN_VALID is not set
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_ARM_SCU=y
+CONFIG_HAVE_ARM_TWD=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_BPF_JIT=y
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_HW_BREAKPOINT=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZ4=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_PATA_PLATFORM=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_PERF_REGS=y
+CONFIG_HAVE_PERF_USER_STACK_DUMP=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_SMP=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_TCM=y
+CONFIG_HAVE_UID16=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HOTPLUG_CPU=y
+CONFIG_HZ_FIXED=0
+CONFIG_HZ_PERIODIC=y
+CONFIG_ICST=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_IOMMU_HELPER=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_WORK=y
+CONFIG_JBD2=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_LEDS_VERSATILE=y
+CONFIG_LOCK_SPIN_ON_OWNER=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_MACH_REALVIEW_EB=y
+CONFIG_MACH_REALVIEW_PB1176=y
+CONFIG_MACH_REALVIEW_PB11MP=y
+CONFIG_MACH_REALVIEW_PBA8=y
+CONFIG_MACH_REALVIEW_PBX=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_MDIO_BOARDINFO=y
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+CONFIG_MMC=y
+CONFIG_MMC_ARMMMCI=y
+CONFIG_MMC_BLOCK=y
+CONFIG_MODULES_TREE_LOOKUP=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MULTI_IRQ_HANDLER=y
+CONFIG_MUTEX_SPIN_ON_OWNER=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_MACH_MEMORY_H=y
+# CONFIG_NEON is not set
+CONFIG_NET_FLOW_LIMIT=y
+CONFIG_NLS=y
+CONFIG_NO_BOOTMEM=y
+CONFIG_NR_CPUS=4
+# CONFIG_OF is not set
+CONFIG_OLD_SIGACTION=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_OUTER_CACHE=y
+CONFIG_OUTER_CACHE_SYNC=y
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PCI_DOMAINS_GENERIC is not set
+# CONFIG_PCI_SYSCALL is not set
+CONFIG_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHYLIB=y
+CONFIG_PHYS_OFFSET=0x00000000
+# CONFIG_PL310_ERRATA_588369 is not set
+# CONFIG_PL310_ERRATA_727915 is not set
+CONFIG_PL310_ERRATA_753970=y
+# CONFIG_PL310_ERRATA_769419 is not set
+CONFIG_PLAT_VERSATILE=y
+CONFIG_PLAT_VERSATILE_CLCD=y
+CONFIG_PLAT_VERSATILE_SCHED_CLOCK=y
+CONFIG_RATIONAL=y
+CONFIG_RCU_STALL_COMMON=y
+# CONFIG_REALVIEW_DT is not set
+# CONFIG_REALVIEW_EB_A9MP is not set
+CONFIG_REALVIEW_EB_ARM11MP=y
+CONFIG_REALVIEW_EB_ARM11MP_REVB=y
+CONFIG_REALVIEW_PB1176_SECURE_FLASH=y
+CONFIG_RFS_ACCEL=y
+CONFIG_RPS=y
+CONFIG_RWSEM_SPIN_ON_OWNER=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_SCHED_HRTICK=y
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SERIAL_8250 is not set
+# CONFIG_SERIAL_AMBA_PL010 is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SMC91X=y
+CONFIG_SMP=y
+CONFIG_SMP_ON_UP=y
+CONFIG_SMSC911X=y
+# CONFIG_SMSC911X_ARCH_HOOKS is not set
+CONFIG_SMSC_PHY=y
+CONFIG_SND=y
+# CONFIG_SND_COMPRESS_OFFLOAD is not set
+# CONFIG_SND_DRIVERS is not set
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SOC_BUS=y
+CONFIG_SOC_REALVIEW=y
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+CONFIG_SPARSEMEM=y
+CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SRCU=y
+# CONFIG_SWAP is not set
+CONFIG_SWIOTLB=y
+CONFIG_SWP_EMULATE=y
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TREE_RCU=y
+CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h"
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_XPS=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_BCJ=y
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_ZLIB_INFLATE=y
diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
index e102759925..1251361b3e 100644
--- a/tools/e2fsprogs/Makefile
+++ b/tools/e2fsprogs/Makefile
@@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=e2fsprogs
-PKG_VERSION:=1.42.13
-PKG_MD5SUM:=bc759fc62666786f5436e2075beb3265
+PKG_VERSION:=1.43.1
+PKG_MD5SUM:=1775f3f0eed9dee1c5f39e08d1964a97
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -23,6 +23,7 @@ HOST_CFLAGS += $(FPIC)
HOST_CONFIGURE_ARGS += \
--disable-elf-shlibs \
+ --enable-libuuid \
--disable-tls \
--disable-nls
diff --git a/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch b/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch
index 9f6e7b1cef..2a7842f655 100644
--- a/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch
+++ b/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch
@@ -8,4 +8,4 @@
+@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG=
@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_MAN= e4defrag.8
- @IMAGER_CMT@E2IMAGE_PROG= e2image
+ @LINUX_CMT@E4CRYPT_PROG = e4crypt
diff --git a/tools/e2fsprogs/patches/003-openbsd-compat.patch b/tools/e2fsprogs/patches/003-openbsd-compat.patch
index ded0ecad77..492b8a8860 100644
--- a/tools/e2fsprogs/patches/003-openbsd-compat.patch
+++ b/tools/e2fsprogs/patches/003-openbsd-compat.patch
@@ -1,6 +1,6 @@
--- a/lib/blkid/getsize.c
+++ b/lib/blkid/getsize.c
-@@ -25,6 +25,9 @@
+@@ -29,6 +29,9 @@
#include <fcntl.h>
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
@@ -10,13 +10,3 @@
#endif
#ifdef HAVE_LINUX_FD_H
#include <linux/fd.h>
---- a/lib/quota/mkquota.c
-+++ b/lib/quota/mkquota.c
-@@ -8,6 +8,7 @@
- #include <sys/stat.h>
- #include <unistd.h>
- #include <errno.h>
-+#include <stdint.h>
- #include <string.h>
- #include <fcntl.h>
-
diff --git a/tools/e2fsprogs/patches/004-freebsd-compat.patch b/tools/e2fsprogs/patches/004-freebsd-compat.patch
index c6435d4919..d102e1cd9c 100644
--- a/tools/e2fsprogs/patches/004-freebsd-compat.patch
+++ b/tools/e2fsprogs/patches/004-freebsd-compat.patch
@@ -1,6 +1,6 @@
--- a/lib/ext2fs/tdb.c
+++ b/lib/ext2fs/tdb.c
-@@ -56,7 +56,9 @@
+@@ -58,7 +58,9 @@ Last Changed Date: 2007-06-22 13:36:10 -
#include <utime.h>
#endif
#include <sys/stat.h>
diff --git a/tools/e2fsprogs/patches/005-darwin-compat.patch b/tools/e2fsprogs/patches/005-darwin-compat.patch
index c5d0e28c55..d84aa121ca 100644
--- a/tools/e2fsprogs/patches/005-darwin-compat.patch
+++ b/tools/e2fsprogs/patches/005-darwin-compat.patch
@@ -20,4 +20,3 @@
#ifndef HAVE___U8
#define HAVE___U8
#ifdef __U8_TYPEDEF
-
diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c
index 9b9ebf526c..213e6729a4 100644
--- a/tools/firmware-utils/src/mktplinkfw2.c
+++ b/tools/firmware-utils/src/mktplinkfw2.c
@@ -185,6 +185,13 @@ static struct board_info boards[] = {
.layout_id = "16Mltq",
.hdr_ver = 2,
}, {
+ .id = "ArcherC50",
+ .hw_id = 0xc7500001,
+ .hw_rev = 69,
+ .layout_id = "8Mmtk",
+ .hdr_ver = 3,
+ .endian_swap = true,
+ }, {
/* terminating entry */
}
};
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 77a894b237..2e204aa233 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -105,6 +105,8 @@ static const uint8_t md5_salt[16] = {
/** Vendor information for CPE210/220/510/520 */
static const char cpe510_vendor[] = "CPE510(TP-LINK|UN|N300-5):1.0\r\n";
+/** Vendor information for C2600 */
+static const char c2600_vendor[] = "";
/**
The flash partition table for CPE210/220/510/520;
@@ -128,6 +130,39 @@ static const struct flash_partition_entry cpe510_partitions[] = {
};
/**
+ The flash partition table for C2600;
+ it is the same as the one used by the stock images.
+*/
+static const struct flash_partition_entry c2600_partitions[] = {
+ {"SBL1", 0x00000, 0x20000},
+ {"MIBIB", 0x20000, 0x20000},
+ {"SBL2", 0x40000, 0x20000},
+ {"SBL3", 0x60000, 0x30000},
+ {"DDRCONFIG", 0x90000, 0x10000},
+ {"SSD", 0xa0000, 0x10000},
+ {"TZ", 0xb0000, 0x30000},
+ {"RPM", 0xe0000, 0x20000},
+ {"fs-uboot", 0x100000, 0x70000},
+ {"uboot-env", 0x170000, 0x40000},
+ {"radio", 0x1b0000, 0x40000},
+ {"os-image", 0x1f0000, 0x200000},
+ {"file-system", 0x3f0000, 0x1b00000},
+ {"default-mac", 0x1ef0000, 0x00200},
+ {"pin", 0x1ef0200, 0x00200},
+ {"product-info", 0x1ef0400, 0x0fc00},
+ {"partition-table", 0x1f00000, 0x10000},
+ {"soft-version", 0x1f10000, 0x10000},
+ {"support-list", 0x1f20000, 0x10000},
+ {"profile", 0x1f30000, 0x10000},
+ {"default-config", 0x1f40000, 0x10000},
+ {"user-config", 0x1f50000, 0x40000},
+ {"qos-db", 0x1f90000, 0x40000},
+ {"usb-config", 0x1fd0000, 0x10000},
+ {"log", 0x1fe0000, 0x20000},
+ {NULL, 0, 0}
+};
+
+/**
The support list for CPE210/220/510/520
*/
static const char cpe510_support_list[] =
@@ -141,6 +176,13 @@ static const char cpe510_support_list[] =
"CPE220(TP-LINK|UN|N300-2):1.0\r\n"
"CPE220(TP-LINK|UN|N300-2):1.1\r\n";
+/**
+ The support list for C2600
+*/
+static const char c2600_support_list[] =
+ "SupportList:\r\n"
+ "{product_name:Archer C2600,product_ver:1.0.0,special_id:00000000}\r\n";
+
#define error(_ret, _errno, _str, ...) \
do { \
fprintf(stderr, _str ": %s\n", ## __VA_ARGS__, \
@@ -240,14 +282,14 @@ static struct image_partition_entry make_soft_version(uint32_t rev) {
}
/** Generates the support-list partition */
-static struct image_partition_entry make_support_list(const char *support_list) {
+static struct image_partition_entry make_support_list(const char *support_list, bool trailzero) {
size_t len = strlen(support_list);
struct image_partition_entry entry = alloc_image_partition("support-list", len + 9);
put32(entry.data, len);
memset(entry.data+4, 0, 4);
memcpy(entry.data+8, support_list, len);
- entry.data[len+8] = '\xff';
+ entry.data[len+8] = trailzero ? '\x00' : '\xff';
return entry;
}
@@ -436,6 +478,37 @@ static void * generate_sysupgrade_image(const struct flash_partition_entry *flas
return image;
}
+static void * generate_sysupgrade_image_c2600(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) {
+ const struct flash_partition_entry *flash_os_image = &flash_parts[11];
+ const struct flash_partition_entry *flash_file_system = &flash_parts[12];
+
+ const struct image_partition_entry *image_os_image = &image_parts[3];
+ const struct image_partition_entry *image_file_system = &image_parts[4];
+
+ assert(strcmp(flash_os_image->name, "os-image") == 0);
+ assert(strcmp(flash_file_system->name, "file-system") == 0);
+
+ assert(strcmp(image_os_image->name, "os-image") == 0);
+ assert(strcmp(image_file_system->name, "file-system") == 0);
+
+ if (image_os_image->size > flash_os_image->size)
+ error(1, 0, "kernel image too big (more than %u bytes)", (unsigned)flash_os_image->size);
+ if (image_file_system->size > flash_file_system->size)
+ error(1, 0, "rootfs image too big (more than %u bytes)", (unsigned)flash_file_system->size);
+
+ *len = flash_file_system->base - flash_os_image->base + image_file_system->size;
+
+ uint8_t *image = malloc(*len);
+ if (!image)
+ error(1, errno, "malloc");
+
+ memset(image, 0xff, *len);
+
+ memcpy(image, image_os_image->data, image_os_image->size);
+ memcpy(image + flash_file_system->base - flash_os_image->base, image_file_system->data, image_file_system->size);
+
+ return image;
+}
/** Generates an image for CPE210/220/510/520 and writes it to a file */
static void do_cpe510(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) {
@@ -443,7 +516,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char *
parts[0] = make_partition_table(cpe510_partitions);
parts[1] = make_soft_version(rev);
- parts[2] = make_support_list(cpe510_support_list);
+ parts[2] = make_support_list(cpe510_support_list,false);
parts[3] = read_file("os-image", kernel_image, false);
parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof);
@@ -470,6 +543,39 @@ static void do_cpe510(const char *output, const char *kernel_image, const char *
free_image_partition(parts[i]);
}
+/** Generates an image for C2600 and writes it to a file */
+static void do_c2600(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) {
+ struct image_partition_entry parts[6] = {};
+
+ parts[0] = make_partition_table(c2600_partitions);
+ parts[1] = make_soft_version(rev);
+ parts[2] = make_support_list(c2600_support_list,true);
+ parts[3] = read_file("os-image", kernel_image, false);
+ parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof);
+
+ size_t len;
+ void *image;
+ if (sysupgrade)
+ image = generate_sysupgrade_image_c2600(c2600_partitions, parts, &len);
+ else
+ image = generate_factory_image(c2600_vendor, parts, &len);
+
+ FILE *file = fopen(output, "wb");
+ if (!file)
+ error(1, errno, "unable to open output file");
+
+ if (fwrite(image, len, 1, file) != 1)
+ error(1, 0, "unable to write output file");
+
+ fclose(file);
+
+ free(image);
+
+ size_t i;
+ for (i = 0; parts[i].name; i++)
+ free_image_partition(parts[i]);
+}
+
/** Usage output */
static void usage(const char *argv0) {
@@ -552,6 +658,8 @@ int main(int argc, char *argv[]) {
if (strcmp(board, "CPE510") == 0)
do_cpe510(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade);
+ else if (strcmp(board, "C2600") == 0)
+ do_c2600(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade);
else
error(1, 0, "unsupported board %s", board);