From 9cd0dc0dc996f6c49ea6307caeab6625e5184a00 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 15 Apr 2019 15:58:00 +0800 Subject: [PATCH] ramips: sync with upsteam target --- .../ramips/base-files/etc/board.d/01_leds | 55 +- .../ramips/base-files/etc/board.d/02_network | 72 ++- .../base-files/etc/board.d/03_gpio_switches | 7 + .../etc/hotplug.d/firmware/10-rt2x00-eeprom | 5 +- .../base-files/etc/init.d/set-irq-affinity | 31 ++ target/linux/ramips/base-files/lib/ramips.sh | 12 - .../ramips/base-files/lib/upgrade/platform.sh | 12 +- target/linux/ramips/dts/11ACNAS.dts | 2 +- target/linux/ramips/dts/3G-6200N.dts | 6 +- target/linux/ramips/dts/3G-6200NL.dts | 6 +- target/linux/ramips/dts/3G150B.dts | 4 +- target/linux/ramips/dts/3G300M.dts | 4 +- target/linux/ramips/dts/A5-V11.dts | 4 +- target/linux/ramips/dts/AC1200RM.dts | 4 +- target/linux/ramips/dts/AI-BR100.dts | 4 +- target/linux/ramips/dts/AIR3GII.dts | 4 +- target/linux/ramips/dts/ALL0256N.dtsi | 4 +- target/linux/ramips/dts/ALL5002.dts | 2 +- target/linux/ramips/dts/ALL5003.dts | 2 +- target/linux/ramips/dts/AP-MT7621A-V60.dts | 1 - target/linux/ramips/dts/AR670W.dts | 5 +- target/linux/ramips/dts/AR725W.dts | 4 +- target/linux/ramips/dts/ASL26555.dtsi | 4 +- target/linux/ramips/dts/ATP-52B.dts | 4 +- target/linux/ramips/dts/AWAPN2403.dts | 4 +- target/linux/ramips/dts/AWM002-EVB.dtsi | 4 +- target/linux/ramips/dts/AWUSFREE1.dts | 5 +- target/linux/ramips/dts/ArcherC2-v1.dts | 4 +- target/linux/ramips/dts/ArcherC20i.dts | 4 +- target/linux/ramips/dts/ArcherC20v1.dts | 4 +- target/linux/ramips/dts/ArcherC20v4.dts | 4 +- target/linux/ramips/dts/ArcherC50.dts | 4 +- target/linux/ramips/dts/ArcherC50V3.dts | 4 +- target/linux/ramips/dts/ArcherC50V4.dts | 99 ++++ target/linux/ramips/dts/ArcherMR200.dts | 4 +- target/linux/ramips/dts/BC2.dts | 4 +- target/linux/ramips/dts/BDCOM-WAP2100-SK.dts | 4 +- target/linux/ramips/dts/BOCCO.dts | 2 +- target/linux/ramips/dts/BR-6475ND.dts | 6 +- target/linux/ramips/dts/BR-6478AC-V2.dts | 6 +- target/linux/ramips/dts/BROADWAY.dts | 4 +- target/linux/ramips/dts/C108.dts | 4 +- target/linux/ramips/dts/CF-WR800N.dts | 4 +- target/linux/ramips/dts/CS-QR10.dts | 4 +- target/linux/ramips/dts/CY-SWR1100.dts | 4 +- target/linux/ramips/dts/D105.dts | 4 +- target/linux/ramips/dts/D240.dts | 4 +- target/linux/ramips/dts/DAP-1350.dts | 4 +- target/linux/ramips/dts/DAP-1522-A1.dts | 5 +- target/linux/ramips/dts/DB-WRT01.dts | 4 +- target/linux/ramips/dts/DCH-M225.dts | 4 +- target/linux/ramips/dts/DCS-930.dts | 4 +- target/linux/ramips/dts/DCS-930L-B1.dts | 4 +- target/linux/ramips/dts/DIR-300-B1.dts | 4 +- target/linux/ramips/dts/DIR-300-B7.dts | 4 +- target/linux/ramips/dts/DIR-320-B1.dts | 4 +- target/linux/ramips/dts/DIR-510L.dts | 142 +++++ target/linux/ramips/dts/DIR-600-B1.dts | 4 +- target/linux/ramips/dts/DIR-610-A1.dts | 4 +- target/linux/ramips/dts/DIR-615-D.dts | 4 +- target/linux/ramips/dts/DIR-615-H1.dts | 4 +- target/linux/ramips/dts/DIR-620-A1.dts | 4 +- target/linux/ramips/dts/DIR-620-D1.dts | 4 +- target/linux/ramips/dts/DIR-645.dts | 4 +- target/linux/ramips/dts/DIR-810L.dts | 4 +- target/linux/ramips/dts/DIR-860L-B1.dts | 5 +- target/linux/ramips/dts/DUZUN-DM06.dts | 3 +- target/linux/ramips/dts/DWR-116-A1.dts | 4 +- target/linux/ramips/dts/DWR-118-A1.dts | 4 +- target/linux/ramips/dts/DWR-118-A2.dts | 4 +- target/linux/ramips/dts/DWR-512-B.dts | 4 +- target/linux/ramips/dts/DWR-921-C1.dts | 4 +- target/linux/ramips/dts/E1700.dts | 4 +- target/linux/ramips/dts/ESR-9753.dts | 4 +- target/linux/ramips/dts/EW1200.dts | 5 +- target/linux/ramips/dts/EX2700.dts | 4 +- target/linux/ramips/dts/EX3700.dts | 4 +- target/linux/ramips/dts/EX6150.dts | 248 +++++++++ target/linux/ramips/dts/F5D8235_V1.dts | 4 +- target/linux/ramips/dts/F5D8235_V2.dts | 2 +- target/linux/ramips/dts/F7C027.dts | 4 +- target/linux/ramips/dts/F9K1109V1.dts | 71 +++ target/linux/ramips/dts/F9K110x.dtsi | 112 ++++ target/linux/ramips/dts/FIREWRT.dts | 5 +- target/linux/ramips/dts/FONERA20N.dts | 4 +- target/linux/ramips/dts/FREESTATION5.dts | 2 +- target/linux/ramips/dts/GB-PC1.dts | 8 +- target/linux/ramips/dts/GB-PC2.dts | 8 +- target/linux/ramips/dts/GHL-R-001.dts | 3 +- target/linux/ramips/dts/GL-MT300A.dts | 4 +- target/linux/ramips/dts/GL-MT300N-V2.dts | 5 +- target/linux/ramips/dts/GL-MT300N.dts | 4 +- target/linux/ramips/dts/GL-MT750.dts | 4 +- target/linux/ramips/dts/HC5661.dts | 2 +- target/linux/ramips/dts/HC5661A.dts | 5 +- target/linux/ramips/dts/HC5761.dts | 2 +- target/linux/ramips/dts/HC5861.dts | 9 +- target/linux/ramips/dts/HC5861B.dts | 5 +- target/linux/ramips/dts/HC5962.dts | 4 +- target/linux/ramips/dts/HC5X61.dtsi | 2 +- target/linux/ramips/dts/HG255D.dts | 4 +- target/linux/ramips/dts/HLKRM04.dts | 2 +- target/linux/ramips/dts/HPM.dts | 4 +- target/linux/ramips/dts/HT-TM02.dts | 4 +- target/linux/ramips/dts/HW550-3G.dts | 4 +- target/linux/ramips/dts/IP2202.dts | 4 +- target/linux/ramips/dts/JHR-N805R.dts | 4 +- target/linux/ramips/dts/JHR-N825R.dts | 4 +- target/linux/ramips/dts/JHR-N926R.dts | 4 +- target/linux/ramips/dts/K2G.dts | 4 +- target/linux/ramips/dts/K2P.dts | 5 +- target/linux/ramips/dts/LINKIT7688.dts | 5 +- target/linux/ramips/dts/LR-25G001.dts | 4 +- target/linux/ramips/dts/M2M.dts | 4 +- target/linux/ramips/dts/M3.dts | 4 +- target/linux/ramips/dts/M4.dtsi | 4 +- target/linux/ramips/dts/MAC1200RV2.dts | 3 +- target/linux/ramips/dts/MINIEMBPLUG.dts | 4 +- target/linux/ramips/dts/MINIEMBWIFI.dts | 4 +- target/linux/ramips/dts/MIR3G.dts | 16 +- .../linux/ramips/dts/{MIR4.dts => MIR3P.dts} | 121 +++-- target/linux/ramips/dts/MIWIFI-MINI.dts | 4 +- target/linux/ramips/dts/MIWIFI-NANO.dts | 5 +- target/linux/ramips/dts/MIWIFI-R3.dts | 175 ------- target/linux/ramips/dts/MLW221.dts | 4 +- target/linux/ramips/dts/MLWG2.dts | 4 +- target/linux/ramips/dts/MOFI3500-3GN.dts | 4 +- target/linux/ramips/dts/MPRA1.dts | 4 +- target/linux/ramips/dts/MPRA2.dts | 4 +- target/linux/ramips/dts/MR-102N.dts | 4 +- target/linux/ramips/dts/MT7620a.dts | 2 +- target/linux/ramips/dts/MT7620a_MT7610e.dts | 10 +- target/linux/ramips/dts/MT7620a_V22SG.dts | 2 +- target/linux/ramips/dts/MT7628.dts | 1 - target/linux/ramips/dts/MZK-750DHP.dts | 4 +- target/linux/ramips/dts/MZK-DP150N.dts | 4 +- target/linux/ramips/dts/MZK-EX300NP.dts | 4 +- target/linux/ramips/dts/MZK-EX750NP.dts | 4 +- target/linux/ramips/dts/MZK-W300NH2.dts | 4 +- target/linux/ramips/dts/MicroWRT.dts | 2 +- target/linux/ramips/dts/NA930.dts | 4 +- target/linux/ramips/dts/NBG-419N.dts | 4 +- target/linux/ramips/dts/NBG-419N2.dts | 4 +- target/linux/ramips/dts/NW718.dts | 4 +- target/linux/ramips/dts/Newifi-D1.dts | 10 +- target/linux/ramips/dts/Newifi-D2.dts | 5 +- target/linux/ramips/dts/OMEGA2.dtsi | 5 +- target/linux/ramips/dts/OY-0001.dts | 4 +- target/linux/ramips/dts/PBR-D1.dts | 5 +- target/linux/ramips/dts/PBR-M1.dts | 7 +- target/linux/ramips/dts/PSG1208.dts | 4 +- target/linux/ramips/dts/PSG1218.dtsi | 2 +- target/linux/ramips/dts/PSG1218A.dts | 2 +- target/linux/ramips/dts/PSG1218B.dts | 2 +- target/linux/ramips/dts/PSR-680W.dts | 4 +- target/linux/ramips/dts/PWH2004.dts | 4 +- target/linux/ramips/dts/PX-4885.dtsi | 4 +- target/linux/ramips/dts/R6120.dts | 42 +- target/linux/ramips/dts/R6220.dts | 4 +- target/linux/ramips/dts/R6350.dts | 4 +- target/linux/ramips/dts/RAK633.dts | 104 ++++ target/linux/ramips/dts/RB750Gr3.dts | 107 ++-- target/linux/ramips/dts/RBM11G.dts | 4 +- target/linux/ramips/dts/RBM33G.dts | 4 +- target/linux/ramips/dts/RE350.dts | 5 +- target/linux/ramips/dts/RE6500.dts | 5 +- target/linux/ramips/dts/RP-N53.dts | 4 +- target/linux/ramips/dts/RT-AC51U.dts | 4 +- target/linux/ramips/dts/RT-G32-B1.dts | 2 +- target/linux/ramips/dts/RT-N10-PLUS.dts | 4 +- target/linux/ramips/dts/RT-N12-PLUS.dts | 4 +- target/linux/ramips/dts/RT-N13U.dts | 4 +- target/linux/ramips/dts/RT-N14U.dts | 4 +- target/linux/ramips/dts/RT-N15.dts | 4 +- target/linux/ramips/dts/RT-N56U.dts | 4 +- target/linux/ramips/dts/RUT5XX.dts | 4 +- target/linux/ramips/dts/SAP-G3200U3.dts | 5 +- target/linux/ramips/dts/SK-WB8.dts | 5 +- target/linux/ramips/dts/SKW92A.dts | 5 +- target/linux/ramips/dts/SL-R7205.dts | 4 +- target/linux/ramips/dts/TEW-638APB-V2.dts | 4 +- target/linux/ramips/dts/TEW-691GR.dts | 4 +- target/linux/ramips/dts/TEW-692GR.dts | 4 +- target/linux/ramips/dts/TEW-714TRU.dts | 4 +- target/linux/ramips/dts/TINY-AC.dts | 4 +- target/linux/ramips/dts/TL-MR3020V3.dts | 5 +- target/linux/ramips/dts/TL-MR3420V5.dts | 4 +- target/linux/ramips/dts/TL-WA801NDV5.dts | 4 +- target/linux/ramips/dts/TL-WR802NV4.dts | 53 ++ target/linux/ramips/dts/TL-WR840NV4.dts | 4 +- target/linux/ramips/dts/TL-WR840NV5.dts | 5 +- target/linux/ramips/dts/TL-WR841NV13.dts | 4 +- target/linux/ramips/dts/TL-WR842NV5.dts | 4 +- target/linux/ramips/dts/TL-WR902ACV3.dts | 4 +- .../ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi | 89 ++++ target/linux/ramips/dts/TPLINK-8M.dtsi | 1 - target/linux/ramips/dts/TUBE-E4G.dts | 190 +++++++ target/linux/ramips/dts/Timecloud.dts | 5 +- target/linux/ramips/dts/U25AWF-H1.dts | 4 +- target/linux/ramips/dts/U35WF.dts | 4 +- target/linux/ramips/dts/U7621-06-256M-16M.dts | 1 - target/linux/ramips/dts/U7621-06-512M-64M.dts | 1 - target/linux/ramips/dts/U7621-06.dtsi | 4 +- target/linux/ramips/dts/U7628-01-128M-16M.dts | 1 - target/linux/ramips/dts/U7628-01.dtsi | 4 +- target/linux/ramips/dts/UBNT-ER-e50.dtsi | 3 +- target/linux/ramips/dts/UR-326N4G.dts | 4 +- target/linux/ramips/dts/UR-336UN.dts | 4 +- target/linux/ramips/dts/V11STFE.dts | 4 +- target/linux/ramips/dts/V22RW-2X2.dts | 4 +- target/linux/ramips/dts/VAR11N-300.dts | 4 +- target/linux/ramips/dts/VIXMINI.dts | 114 ++++ target/linux/ramips/dts/VOCORE.dtsi | 2 +- target/linux/ramips/dts/VOCORE2.dts | 3 +- target/linux/ramips/dts/VOCORE2LITE.dts | 3 +- target/linux/ramips/dts/VR500.dts | 5 +- target/linux/ramips/dts/W06.dts | 5 +- target/linux/ramips/dts/W150M.dts | 4 +- target/linux/ramips/dts/W2914NSV2.dts | 2 +- target/linux/ramips/dts/W2914NSV2.dtsi | 3 +- target/linux/ramips/dts/W306R_V20.dts | 4 +- target/linux/ramips/dts/W502U.dts | 4 +- target/linux/ramips/dts/WCR-1166DS.dts | 6 +- target/linux/ramips/dts/WCR150GN.dts | 4 +- target/linux/ramips/dts/WD03.dts | 4 +- target/linux/ramips/dts/WE1026-5G.dtsi | 4 +- target/linux/ramips/dts/WF-2881.dts | 4 +- target/linux/ramips/dts/WHR-1166D.dts | 4 +- target/linux/ramips/dts/WHR-300HP2.dts | 4 +- target/linux/ramips/dts/WHR-600D.dts | 4 +- target/linux/ramips/dts/WHR-G300N.dts | 15 +- target/linux/ramips/dts/WIDORA-NEO-16M.dts | 1 - target/linux/ramips/dts/WIDORA-NEO-32M.dts | 1 - target/linux/ramips/dts/WIDORA-NEO.dtsi | 4 +- target/linux/ramips/dts/WITI.dtsi | 3 +- target/linux/ramips/dts/WIZFI630A.dts | 4 +- target/linux/ramips/dts/WIZFI630S.dts | 193 +++++++ target/linux/ramips/dts/WL-330N.dts | 4 +- target/linux/ramips/dts/WL-330N3G.dts | 4 +- target/linux/ramips/dts/WL-351.dts | 4 +- target/linux/ramips/dts/WL-WN570HA1.dts | 5 +- target/linux/ramips/dts/WL-WN575A3.dts | 12 +- target/linux/ramips/dts/WLI-TX4-AG300N.dts | 4 +- target/linux/ramips/dts/WLR-6000.dts | 4 +- target/linux/ramips/dts/WMR-300.dts | 4 +- target/linux/ramips/dts/WN-AC1167GR.dts | 216 ++++++++ target/linux/ramips/dts/WN-AC733GR3.dts | 198 +++++++ target/linux/ramips/dts/WN-AX1167GR.dts | 5 +- target/linux/ramips/dts/WN-GX300GR.dts | 5 +- target/linux/ramips/dts/WN3000RPV3.dts | 4 +- target/linux/ramips/dts/WNCE2001.dts | 4 +- target/linux/ramips/dts/WNDR3700V5.dts | 5 +- target/linux/ramips/dts/WR1200JS.dts | 5 +- target/linux/ramips/dts/WR1201.dts | 5 +- target/linux/ramips/dts/WR512-3GN.dtsi | 4 +- target/linux/ramips/dts/WR6202.dts | 4 +- target/linux/ramips/dts/WRC-1167GHBK2-S.dts | 5 +- target/linux/ramips/dts/WRH-300CR.dts | 4 +- target/linux/ramips/dts/WRTNODE.dts | 2 +- target/linux/ramips/dts/WRTNODE2.dtsi | 3 +- target/linux/ramips/dts/WRTNODE2P.dts | 2 +- target/linux/ramips/dts/WRTNODE2R.dts | 14 +- target/linux/ramips/dts/WSR-1166.dts | 5 +- target/linux/ramips/dts/WSR-600.dts | 5 +- target/linux/ramips/dts/WT1520.dtsi | 2 +- target/linux/ramips/dts/WT3020.dtsi | 4 +- target/linux/ramips/dts/WZR-AGL300NH.dts | 4 +- target/linux/ramips/dts/X5.dts | 4 +- target/linux/ramips/dts/X8.dts | 4 +- target/linux/ramips/dts/XDXRN502J.dts | 4 +- target/linux/ramips/dts/Y1.dts | 2 +- target/linux/ramips/dts/Y1.dtsi | 2 +- target/linux/ramips/dts/Y1S.dts | 2 +- target/linux/ramips/dts/YOUKU-YK1.dts | 9 +- target/linux/ramips/dts/YOUKU-YK2.dts | 157 ++++++ target/linux/ramips/dts/ZBT-APE522II.dts | 4 +- target/linux/ramips/dts/ZBT-CPE102.dts | 4 +- target/linux/ramips/dts/ZBT-WA05.dts | 4 +- target/linux/ramips/dts/ZBT-WE1226.dts | 5 +- target/linux/ramips/dts/ZBT-WE1326.dts | 3 +- target/linux/ramips/dts/ZBT-WE2026.dts | 4 +- target/linux/ramips/dts/ZBT-WE3526.dts | 3 +- target/linux/ramips/dts/ZBT-WE826.dtsi | 4 +- target/linux/ramips/dts/ZBT-WG2626.dts | 5 +- target/linux/ramips/dts/ZBT-WG3526.dtsi | 5 +- target/linux/ramips/dts/ZBT-WR8305RT.dts | 4 +- target/linux/ramips/dts/ZL5900V2.dts | 4 +- target/linux/ramips/dts/ZTE-Q7.dts | 4 +- target/linux/ramips/dts/elecom_wrc-gst.dtsi | 5 +- target/linux/ramips/dts/ki_rb.dts | 5 +- target/linux/ramips/dts/kn.dts | 4 +- target/linux/ramips/dts/kn_rc.dts | 4 +- target/linux/ramips/dts/kn_rf.dts | 4 +- target/linux/ramips/dts/kn_st.dts | 115 +++++ target/linux/ramips/dts/kng_rc.dts | 4 +- target/linux/ramips/dts/mt7628an.dtsi | 1 + .../net/ethernet/mediatek/mtk_offload.c | 39 +- target/linux/ramips/image/Makefile | 2 + target/linux/ramips/image/mt7620.mk | 135 +++-- target/linux/ramips/image/mt7621.mk | 81 +-- target/linux/ramips/image/mt76x8.mk | 92 +++- target/linux/ramips/image/rt305x.mk | 7 + target/linux/ramips/image/rt3883.mk | 12 + target/linux/ramips/modules.mk | 2 +- target/linux/ramips/mt7620/config-4.14 | 1 - target/linux/ramips/mt7621/config-4.14 | 3 +- target/linux/ramips/mt76x8/config-4.14 | 3 +- .../0043-spi-add-mt7621-support.patch | 486 ++++++++---------- .../0048-asoc-add-mt7620-support.patch | 2 +- ...0-mt7620-export-chip-version-and-pkg.patch | 19 + ...or-enable-4B-opcodes-for-mx25l25635f.patch | 72 +++ .../patches-4.14/999-fix-m25p-shutdown.patch | 34 -- target/linux/ramips/rt288x/config-4.14 | 1 - target/linux/ramips/rt305x/config-4.14 | 1 - target/linux/ramips/rt3883/config-4.14 | 2 - 315 files changed, 3491 insertions(+), 1358 deletions(-) create mode 100755 target/linux/ramips/base-files/etc/init.d/set-irq-affinity create mode 100644 target/linux/ramips/dts/ArcherC50V4.dts create mode 100644 target/linux/ramips/dts/DIR-510L.dts create mode 100644 target/linux/ramips/dts/EX6150.dts create mode 100644 target/linux/ramips/dts/F9K1109V1.dts create mode 100644 target/linux/ramips/dts/F9K110x.dtsi rename target/linux/ramips/dts/{MIR4.dts => MIR3P.dts} (54%) delete mode 100644 target/linux/ramips/dts/MIWIFI-R3.dts create mode 100644 target/linux/ramips/dts/RAK633.dts create mode 100644 target/linux/ramips/dts/TL-WR802NV4.dts create mode 100644 target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi create mode 100644 target/linux/ramips/dts/TUBE-E4G.dts create mode 100644 target/linux/ramips/dts/VIXMINI.dts create mode 100644 target/linux/ramips/dts/WIZFI630S.dts create mode 100644 target/linux/ramips/dts/WN-AC1167GR.dts create mode 100644 target/linux/ramips/dts/WN-AC733GR3.dts create mode 100644 target/linux/ramips/dts/YOUKU-YK2.dts create mode 100644 target/linux/ramips/dts/kn_st.dts create mode 100644 target/linux/ramips/patches-4.14/300-mt7620-export-chip-version-and-pkg.patch create mode 100644 target/linux/ramips/patches-4.14/304-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch delete mode 100644 target/linux/ramips/patches-4.14/999-fix-m25p-shutdown.patch 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 1bdf50800..fa20ab071 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -38,6 +38,10 @@ alfa-network,ac1200rm) alfa-network,awusfree1) set_wifi_led "$boardname:blue:wlan" ;; +alfa-network,tube-e4g) + ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0" + ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" "eth0" + ;; all0256n-4M|\ all0256n-8M) ucidef_set_rssimon "wlan0" "200000" "1" @@ -60,6 +64,10 @@ bdcom,wap2100-sk|\ hiwifi,hc5861b) set_wifi_led "$boardname:green:wlan2g" ;; +belkin,f9k1109v1) + set_usb_led "$boardname:green:usb1" + ucidef_set_led_netdev "lan" "lan" "$boardname:blue:wps" "eth0" + ;; broadway) set_wifi_led "$boardname:red:wps_active" ;; @@ -188,6 +196,11 @@ ht-tm02) ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:lan" "eth0" set_wifi_led "$boardname:blue:wlan" ;; +iodata,wn-ac1167gr|\ +iodata,wn-ac733gr3) + ucidef_set_led_wlan "wlan5g" "WLAN5G" "$boardname:green:wlan5g" "phy0radio" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "$boardname:green:wlan2g" "phy1radio" + ;; kimax,u35wf) set_wifi_led "$boardname:blue:wifi" ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0" @@ -223,16 +236,6 @@ mikrotik,rbm11g) miniembplug) set_wifi_led "$boardname:red:wlan" ;; -mir3g) - ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08" - ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08" - ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08" - ;; -mir4) - ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x08" "0x08" - ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x01" "0x08" - ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x02" "0x08" - ;; mlw221|\ mlwg2) set_wifi_led "$boardname:blue:wifi" @@ -253,8 +256,8 @@ mzk-ex750np) ;; netgear,r6120) ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10" ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" "phy1tpt" ;; oy-0001) set_wifi_led "$boardname:green:wifi" @@ -280,6 +283,9 @@ netgear,r6350) ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2 set_wifi_led "$boardname:green:wifi" ;; +rakwireless,rak633) + set_wifi_led "$boardname:blue:wifi" + ;; re350-v1) ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0" ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1" @@ -341,7 +347,8 @@ tplink,c20-v4) ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" "wlan0" ;; -tplink,c50-v3) +tplink,c50-v3|\ +tplink,c50-v4) ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan2g" "phy0tpt" @@ -392,20 +399,31 @@ wavlink,wl-wn570ha1) ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan0" "85" "100" set_wifi_led "$boardname:green:wifi" ;; -we1026-5g-16m) - ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0" - set_wifi_led "we1026-5g:green:wifi" - ;; -wl-wn575a3) +wavlink,wl-wn575a3) ucidef_set_rssimon "wlan1" "200000" "1" ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49" ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84" ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100" ;; +we1026-5g-16m) + ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0" + set_wifi_led "we1026-5g:green:wifi" + ;; wrh-300cr) set_wifi_led "$boardname:green:wlan" ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0" ;; +xiaomi,mir3g) + ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08" + ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08" + ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08" + ;; +xiaomi,mir3p) + ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x10" "0x08" + ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x02" "0x08" + ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08" + ucidef_set_led_switch "lan3-amber" "LAN3 (amber)" "$boardname:amber:lan3" "switch0" "0x08" "0x08" + ;; xzwifi,creativebox-v1) ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10" ;; @@ -453,6 +471,9 @@ zyxel,keenetic-extra-ii) set_wifi_led "$boardname:green:wifi" ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01" ;; +zyxel,keenetic-start) + set_wifi_led "rt2800pci-phy0::radio" + ;; youku-yk1) set_wifi_led "$boardname:blue:air" ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10" 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 5811d9953..c2646876a 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -33,6 +33,7 @@ ramips_setup_interfaces() case $board in 11acnas|\ d-team,newifi-d2|\ + dir-615-h1|\ w2914nsv2|\ zbt-we2026) ucidef_add_switch "switch0" \ @@ -107,7 +108,6 @@ ramips_setup_interfaces() mtc,wr1201|\ mzk-750dhp|\ mzk-w300nh2|\ - netgear,r6120|\ nixcore-x1-8M|\ nixcore-x1-16M|\ oy-0001|\ @@ -123,13 +123,14 @@ ramips_setup_interfaces() unielec,u7621-06-512m-64m|\ vr500|\ wavlink,wl-wn570ha1|\ + wavlink,wl-wn575a3|\ wf-2881|\ whr-g300n|\ mqmaker,witi-256m|\ mqmaker,witi-512m|\ - wl-wn575a3|\ wndr3700v5|\ youku-yk1|\ + youku,yk-l2|\ zbt-ape522ii|\ zbt-we1326|\ zbtlink,zbt-we3526|\ @@ -147,6 +148,7 @@ ramips_setup_interfaces() "0:lan" "1:lan" "2:lan" "4:wan" "6@eth0" ;; alfa-network,awusfree1|\ + alfa-network,tube-e4g|\ cs-qr10|\ d105|\ dlink,dap-1522-a1|\ @@ -161,6 +163,7 @@ ramips_setup_interfaces() ravpower,wd03|\ tama,w06|\ tplink,tl-mr3020-v3|\ + tplink,tl-wr802n-v4|\ u25awf-h1|\ wli-tx4-ag300n|\ wmdr-143n|\ @@ -177,14 +180,6 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan:2" "2:lan:1" "3:lan:3" "4:lan" "0:wan" "6@eth0" ;; - mir3g) - ucidef_add_switch "switch0" \ - "2:lan:2" "3:lan:1" "1:wan" "6t@eth0" - ;; - mir4) - ucidef_add_switch "switch0" \ - "1:lan:1" "2:lan:2" "4:wan" "6t@eth0" - ;; psg1218b) ucidef_add_switch "switch0" \ "0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0" @@ -198,10 +193,12 @@ ramips_setup_interfaces() ;; ar670w|\ ar725w|\ + rakwireless,rak633|\ rt-ac51u) ucidef_add_switch "switch0" \ "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" ;; + belkin,f9k1109v1|\ rt-n15|\ wl-351) ucidef_add_switch "switch0" \ @@ -226,13 +223,14 @@ ramips_setup_interfaces() jhr-n805r|\ jhr-n825r|\ jhr-n926r|\ + mikrotik,rb750gr3|\ mikrotik,rbm33g|\ mzk-wdpr|\ - rb750gr3|\ rt-n14u|\ skylab,skw92a|\ tplink,c20-v4|\ tplink,c50-v3|\ + tplink,c50-v4|\ tplink,tl-mr3420-v5|\ tplink,tl-wr842n-v5|\ tl-wr840n-v4|\ @@ -324,6 +322,11 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "5:wan" "6@eth0" ;; + iodata,wn-ac1167gr|\ + iodata,wn-ac733gr3) + ucidef_add_switch "switch1" \ + "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" + ;; kn_rf) ucidef_add_switch "switch0" \ "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0" @@ -342,6 +345,10 @@ ramips_setup_interfaces() "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0" ucidef_set_interface_wan "usb0" ;; + netgear,r6120) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; hc5761) ucidef_add_switch "switch0" \ "1:lan" "4:lan" "0:wan" "6@eth0" @@ -360,6 +367,9 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5:wan" "6@eth0" ;; + dlink,dir-510l|\ + glinet,vixmini|\ + netgear,ex6150|\ re350-v1) ucidef_add_switch "switch0" \ "0:lan" "6@eth0" @@ -423,20 +433,32 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:wan" "6@eth0" ;; + wiznet,wizfi630s) + ucidef_add_switch "switch0" \ + "0:wan" "3:lan" "4:lan" "6@eth0" + ;; wt3020-4M|\ wt3020-8M) ucidef_add_switch "switch0" \ "4:lan" "0:wan" "6@eth0" ;; - xiaomi,miwifi-r3) + xiaomi,mir3g) ucidef_add_switch "switch0" \ - "1:lan" "4:lan" "0:wan" "6@eth0" + "2:lan:2" "3:lan:1" "1:wan" "6t@eth0" + ;; + xiaomi,mir3p) + ucidef_add_switch "switch0" \ + "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" ;; zbtlink,zbt-we1226|\ y1) ucidef_add_switch "switch0" \ "0:lan:2" "1:lan:1" "4:wan" "6@eth0" ;; + zyxel,keenetic-start) + ucidef_add_switch "switch0" \ + "0:lan:3" "1:lan:2" "2:lan:1" "3:lan:0" "4:wan" "6@eth0" + ;; *) RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"` if [ -n "${RT3X5X}" ]; then @@ -484,6 +506,10 @@ ramips_setup_macs() lan_mac=$(macaddr_setbit_la "$lan_mac") wan_mac=$(macaddr_add "$lan_mac" 1) ;; + belkin,f9k1109v1) + wan_mac=$(mtd_get_mac_ascii uboot-env HW_WAN_MAC) + lan_mac=$(mtd_get_mac_ascii uboot-env HW_LAN_MAC) + ;; br-6475nd) lan_mac=$(cat /sys/class/net/eth0/address) wan_mac=$(mtd_get_mac_binary devdata 7) @@ -500,6 +526,7 @@ ramips_setup_macs() lan_mac=$(mtd_get_mac_ascii factory lanmac) wan_mac=$(mtd_get_mac_ascii factory wanmac) ;; + dlink,dir-510l|\ dlink,dwr-116-a1|\ dlink,dwr-118-a1|\ dlink,dwr-118-a2|\ @@ -534,6 +561,10 @@ ramips_setup_macs() [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address) wan_mac=$(macaddr_add "$lan_mac" 1) ;; + iodata,wn-ac1167gr|\ + iodata,wn-ac733gr3) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" -1) + ;; iodata,wn-ax1167gr|\ iodata,wn-gx300gr) wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" 1) @@ -551,14 +582,6 @@ ramips_setup_macs() lan_mac=$(mtd_get_mac_binary factory_info 13) wan_mac=$(macaddr_add "$lan_mac" 1) ;; - mir3g) - lan_mac=$(mtd_get_mac_binary Factory 0xe006) - ;; - mir4) - lan_mac=$(mtd_get_mac_binary Factory 0xe006) - wan_mac=$(mtd_get_mac_binary Factory 0xe000) - ;; - xiaomi,miwifi-r3|\ miwifi-mini) wan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(macaddr_setbit_la "$wan_mac") @@ -640,6 +663,13 @@ ramips_setup_macs() wlr-6000) wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2) ;; + xiaomi,mir3g|\ + xiaomi,mir3p) + lan_mac=$(mtd_get_mac_binary Factory 0xe006) + ;; + zyxel,keenetic-start) + wan_mac=$(mtd_get_mac_binary factory 40) + ;; *) lan_mac=$(cat /sys/class/net/eth0/address) wan_mac=$(macaddr_add "$lan_mac" 1) diff --git a/target/linux/ramips/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/base-files/etc/board.d/03_gpio_switches index a847a64d6..80e3c4c41 100755 --- a/target/linux/ramips/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/base-files/etc/board.d/03_gpio_switches @@ -7,6 +7,13 @@ board_config_update board=$(board_name) case "$board" in +dlink,dir-510l) + ucidef_add_gpio_switch "usb_enable1" "USB 1A enable" "12" "0" + ucidef_add_gpio_switch "usb_enable05" "USB 0.5A enable" "13" "1" + ;; +mikrotik,rb750gr3) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "17" + ;; ubnt-erx) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "0" ;; diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom index 13a468725..fc044c123 100644 --- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom +++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @@ -15,7 +15,7 @@ rt2x00_eeprom_extract() { [ -n "$mtd" ] || \ rt2x00_eeprom_die "no mtd device found for partition $part" - dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ + dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ rt2x00_eeprom_die "failed to extract from $mtd" } @@ -39,7 +39,7 @@ rt2x00_eeprom_set_macaddr() { rt2x00_eeprom_die "invalid wlan mac address" macaddr_2bin $macaddr | dd of=/lib/firmware/$FIRMWARE \ - conv=notrunc bs=1 seek=4 count=6 2>/dev/null || \ + conv=notrunc oflag=seek_bytes bs=6 seek=4 count=1 2>/dev/null || \ rt2x00_eeprom_die "failed to write mac address to eeprom file" } @@ -54,6 +54,7 @@ board=$(board_name) case "$FIRMWARE" in "soc_wmac.eeprom") case $board in + dlink,dir-510l|\ dlink,dwr-116-a1|\ dlink,dwr-118-a1|\ dlink,dwr-118-a2|\ diff --git a/target/linux/ramips/base-files/etc/init.d/set-irq-affinity b/target/linux/ramips/base-files/etc/init.d/set-irq-affinity new file mode 100755 index 000000000..9a3afefa5 --- /dev/null +++ b/target/linux/ramips/base-files/etc/init.d/set-irq-affinity @@ -0,0 +1,31 @@ +#!/bin/sh /etc/rc.common + +START=99 + +get_irq() { + local name="$1" + grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,' +} + +set_irq_affinity() { + local name="$1" + local val="$2" + local irq="$(get_irq "$name")" + [ -n "$irq" ] || return + echo "$val" > "/proc/irq/$irq/smp_affinity" +} + +start() { + if grep -q 'processor.*: 2' /proc/cpuinfo; then + mask1=4 + mask2=8 + elif grep -q 'processor.*: 1' /proc/cpuinfo; then + mask1=2 + mask2=2 + else + return + fi + + set_irq_affinity mt76x2e $mask1 + set_irq_affinity mt7603e $mask2 +} diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 1bfa62d61..093303892 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -277,12 +277,6 @@ ramips_board_detect() { *"Mercury MAC1200R v2") name="mac1200rv2" ;; - *"Mi Router 3G") - name="mir3g" - ;; - *"Mi Router 4") - name="mir4" - ;; *"MicroWRT") name="microwrt" ;; @@ -418,9 +412,6 @@ ramips_board_detect() { *"R6220") name="r6220" ;; - *"RB750Gr3") - name="rb750gr3" - ;; *"RE350 v1") name="re350-v1" ;; @@ -589,9 +580,6 @@ ramips_board_detect() { *"WL-351 v1 002") name="wl-351" ;; - *"WL-WN575A3") - name="wl-wn575a3" - ;; *"WLI-TX4-AG300N") name="wli-tx4-ag300n" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 9c65c1042..7372a3793 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -13,6 +13,7 @@ platform_pre_upgrade() { local board=$(board_name) case "$board" in + mikrotik,rb750gr3|\ mikrotik,rbm11g|\ mikrotik,rbm33g) [ -z "$(rootfs_type)" ] && mtd erase firmware @@ -36,15 +37,18 @@ platform_do_upgrade() { case "$board" in hc5962|\ - mir3g|\ - mir4|\ r6220|\ netgear,r6350|\ - xiaomi,miwifi-r3|\ ubnt-erx|\ - ubnt-erx-sfp) + ubnt-erx-sfp|\ + xiaomi,mir3g|\ + xiaomi,mir3p) nand_do_upgrade "$ARGV" ;; + tplink,c50-v4) + MTD_ARGS="-t romfile" + default_do_upgrade "$ARGV" + ;; *) default_do_upgrade "$ARGV" ;; diff --git a/target/linux/ramips/dts/11ACNAS.dts b/target/linux/ramips/dts/11ACNAS.dts index 6516bb0c1..2b1556696 100644 --- a/target/linux/ramips/dts/11ACNAS.dts +++ b/target/linux/ramips/dts/11ACNAS.dts @@ -11,7 +11,7 @@ reg = <0x0 0x10000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { diff --git a/target/linux/ramips/dts/3G-6200N.dts b/target/linux/ramips/dts/3G-6200N.dts index d5b935e76..385981221 100644 --- a/target/linux/ramips/dts/3G-6200N.dts +++ b/target/linux/ramips/dts/3G-6200N.dts @@ -52,14 +52,14 @@ }; partition@50000 { - compatible = "denx,uimage"; + compatible = "edimax,uimage"; label = "firmware"; reg = <0x50000 0x390000>; }; }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -80,7 +80,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/3G-6200NL.dts b/target/linux/ramips/dts/3G-6200NL.dts index dfc5574f0..7742561e5 100644 --- a/target/linux/ramips/dts/3G-6200NL.dts +++ b/target/linux/ramips/dts/3G-6200NL.dts @@ -52,14 +52,14 @@ }; partition@50000 { - compatible = "denx,uimage"; + compatible = "edimax,uimage"; label = "firmware"; reg = <0x50000 0x390000>; }; }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_internet: internet { @@ -73,7 +73,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/3G150B.dts b/target/linux/ramips/dts/3G150B.dts index 2e3253232..9d1362551 100644 --- a/target/linux/ramips/dts/3G150B.dts +++ b/target/linux/ramips/dts/3G150B.dts @@ -16,7 +16,7 @@ led-upgrade = &led_ap; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_ap: ap { @@ -32,7 +32,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/3G300M.dts b/target/linux/ramips/dts/3G300M.dts index 788eba41a..a463890de 100644 --- a/target/linux/ramips/dts/3G300M.dts +++ b/target/linux/ramips/dts/3G300M.dts @@ -16,7 +16,7 @@ led-upgrade = &led_ap; }; - gpio-leds { + leds { compatible = "gpio-leds"; 3grouter { @@ -52,7 +52,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/A5-V11.dts b/target/linux/ramips/dts/A5-V11.dts index 8949a3ffe..707963d69 100644 --- a/target/linux/ramips/dts/A5-V11.dts +++ b/target/linux/ramips/dts/A5-V11.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; system { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/AC1200RM.dts b/target/linux/ramips/dts/AC1200RM.dts index 29f54be0f..388b088d9 100644 --- a/target/linux/ramips/dts/AC1200RM.dts +++ b/target/linux/ramips/dts/AC1200RM.dts @@ -50,7 +50,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -61,7 +61,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wlan2g { diff --git a/target/linux/ramips/dts/AI-BR100.dts b/target/linux/ramips/dts/AI-BR100.dts index b23ee9b52..8de4b5877 100644 --- a/target/linux/ramips/dts/AI-BR100.dts +++ b/target/linux/ramips/dts/AI-BR100.dts @@ -16,7 +16,7 @@ led-upgrade = &led_wlan; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/AIR3GII.dts b/target/linux/ramips/dts/AIR3GII.dts index 0a9dd544f..111119eea 100644 --- a/target/linux/ramips/dts/AIR3GII.dts +++ b/target/linux/ramips/dts/AIR3GII.dts @@ -9,7 +9,7 @@ compatible = "airlive,air3gii", "ralink,rt5350-soc"; model = "AirLive Air3GII"; - gpio-leds { + leds { compatible = "gpio-leds"; wlan { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ALL0256N.dtsi b/target/linux/ramips/dts/ALL0256N.dtsi index 0437b96b6..d31547c33 100644 --- a/target/linux/ramips/dts/ALL0256N.dtsi +++ b/target/linux/ramips/dts/ALL0256N.dtsi @@ -6,7 +6,7 @@ / { compatible = "allnet,all0256n", "ralink,rt3050-soc"; - gpio-leds { + leds { compatible = "gpio-leds"; rssilow { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ALL5002.dts b/target/linux/ramips/dts/ALL5002.dts index 616f7424a..a604ec151 100644 --- a/target/linux/ramips/dts/ALL5002.dts +++ b/target/linux/ramips/dts/ALL5002.dts @@ -30,7 +30,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; ld1 { diff --git a/target/linux/ramips/dts/ALL5003.dts b/target/linux/ramips/dts/ALL5003.dts index 050ff886e..8a3488a7e 100644 --- a/target/linux/ramips/dts/ALL5003.dts +++ b/target/linux/ramips/dts/ALL5003.dts @@ -30,7 +30,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; ld1 { diff --git a/target/linux/ramips/dts/AP-MT7621A-V60.dts b/target/linux/ramips/dts/AP-MT7621A-V60.dts index bd29e0b3f..b613c9c37 100644 --- a/target/linux/ramips/dts/AP-MT7621A-V60.dts +++ b/target/linux/ramips/dts/AP-MT7621A-V60.dts @@ -85,7 +85,6 @@ compatible = "mx25l6405d","jedec,spi-nor"; reg = <0 0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/AR670W.dts b/target/linux/ramips/dts/AR670W.dts index 3ee39c1eb..96e4a8cbe 100644 --- a/target/linux/ramips/dts/AR670W.dts +++ b/target/linux/ramips/dts/AR670W.dts @@ -39,13 +39,14 @@ }; partition@40000 { + compatible = "lzma"; reg = <0x40000 0x3c0000>; label = "firmware"; }; }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -59,7 +60,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; diff --git a/target/linux/ramips/dts/AR725W.dts b/target/linux/ramips/dts/AR725W.dts index b143f4523..5e3782ac2 100644 --- a/target/linux/ramips/dts/AR725W.dts +++ b/target/linux/ramips/dts/AR725W.dts @@ -51,7 +51,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -70,7 +70,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; diff --git a/target/linux/ramips/dts/ASL26555.dtsi b/target/linux/ramips/dts/ASL26555.dtsi index 860c2afee..d1c21f808 100644 --- a/target/linux/ramips/dts/ASL26555.dtsi +++ b/target/linux/ramips/dts/ASL26555.dtsi @@ -13,7 +13,7 @@ led-upgrade = &led_power_green; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -30,7 +30,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; eth { diff --git a/target/linux/ramips/dts/ATP-52B.dts b/target/linux/ramips/dts/ATP-52B.dts index 9fec757cf..2fa5c19d0 100644 --- a/target/linux/ramips/dts/ATP-52B.dts +++ b/target/linux/ramips/dts/ATP-52B.dts @@ -51,7 +51,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_run: run { @@ -65,7 +65,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/AWAPN2403.dts b/target/linux/ramips/dts/AWAPN2403.dts index 4d089437c..97f105a63 100644 --- a/target/linux/ramips/dts/AWAPN2403.dts +++ b/target/linux/ramips/dts/AWAPN2403.dts @@ -17,7 +17,7 @@ }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wps: wps { @@ -26,7 +26,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/AWM002-EVB.dtsi b/target/linux/ramips/dts/AWM002-EVB.dtsi index a2770d9ba..384b2efec 100644 --- a/target/linux/ramips/dts/AWM002-EVB.dtsi +++ b/target/linux/ramips/dts/AWM002-EVB.dtsi @@ -6,7 +6,7 @@ / { compatible = "asiarf,awm002-evb", "ralink,rt5350-soc"; - gpio-leds { + leds { compatible = "gpio-leds"; tx { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/AWUSFREE1.dts b/target/linux/ramips/dts/AWUSFREE1.dts index 3edafb333..4e5ce1cc7 100644 --- a/target/linux/ramips/dts/AWUSFREE1.dts +++ b/target/linux/ramips/dts/AWUSFREE1.dts @@ -52,7 +52,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -63,7 +63,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -129,7 +129,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/ArcherC2-v1.dts b/target/linux/ramips/dts/ArcherC2-v1.dts index 42f75dd75..921a50a56 100644 --- a/target/linux/ramips/dts/ArcherC2-v1.dts +++ b/target/linux/ramips/dts/ArcherC2-v1.dts @@ -29,7 +29,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { @@ -60,7 +60,7 @@ }; }; - gpio-keys { + keys { compatible = "gpio-keys"; reset_wps { diff --git a/target/linux/ramips/dts/ArcherC20i.dts b/target/linux/ramips/dts/ArcherC20i.dts index a4cd3bc56..cf715a413 100644 --- a/target/linux/ramips/dts/ArcherC20i.dts +++ b/target/linux/ramips/dts/ArcherC20i.dts @@ -13,7 +13,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { label = "c20i:blue:lan"; @@ -39,7 +39,7 @@ }; }; - gpio-keys { + keys { compatible = "gpio-keys"; rfkill { diff --git a/target/linux/ramips/dts/ArcherC20v1.dts b/target/linux/ramips/dts/ArcherC20v1.dts index 31a5b830e..39e33b8ff 100644 --- a/target/linux/ramips/dts/ArcherC20v1.dts +++ b/target/linux/ramips/dts/ArcherC20v1.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ArcherC20v4.dts b/target/linux/ramips/dts/ArcherC20v4.dts index f0ae2beba..aaafcc52f 100644 --- a/target/linux/ramips/dts/ArcherC20v4.dts +++ b/target/linux/ramips/dts/ArcherC20v4.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { @@ -55,7 +55,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ArcherC50.dts b/target/linux/ramips/dts/ArcherC50.dts index 1d8bb233b..b6f5bed0b 100644 --- a/target/linux/ramips/dts/ArcherC50.dts +++ b/target/linux/ramips/dts/ArcherC50.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ArcherC50V3.dts b/target/linux/ramips/dts/ArcherC50V3.dts index 423ac88c2..cc4e72819 100644 --- a/target/linux/ramips/dts/ArcherC50V3.dts +++ b/target/linux/ramips/dts/ArcherC50V3.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { diff --git a/target/linux/ramips/dts/ArcherC50V4.dts b/target/linux/ramips/dts/ArcherC50V4.dts new file mode 100644 index 000000000..37f388620 --- /dev/null +++ b/target/linux/ramips/dts/ArcherC50V4.dts @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "TPLINK-8M-SPLIT-UBOOT.dtsi" + +#include +#include + +/ { + compatible = "tplink,c50-v4", "mediatek,mt7628an-soc"; + model = "TP-Link Archer C50 v4"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "c50-v4:green:power"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + wlan2 { + label = "c50-v4:green:wlan2g"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + + wlan5 { + label = "c50-v4:green:wlan5g"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "c50-v4:green:lan"; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "c50-v4:green:wan"; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + }; + + wan_orange { + label = "c50-v4:orange:wan"; + gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "c50-v4:green:wps"; + gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "p0led_an", "p1led_an", "p2led_an", + "p3led_an", "p4led_an", "wdt", "wled_an"; + ralink,function = "gpio"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + mtd-mac-address = <&rom 0xf100>; + mtd-mac-address-increment = <(-1)>; + }; +}; diff --git a/target/linux/ramips/dts/ArcherMR200.dts b/target/linux/ramips/dts/ArcherMR200.dts index 99f3be2e0..ff00dbe95 100644 --- a/target/linux/ramips/dts/ArcherMR200.dts +++ b/target/linux/ramips/dts/ArcherMR200.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { @@ -74,7 +74,7 @@ }; }; - gpio-keys { + keys { compatible = "gpio-keys"; reset { diff --git a/target/linux/ramips/dts/BC2.dts b/target/linux/ramips/dts/BC2.dts index 5b9cec3f4..324909e82 100644 --- a/target/linux/ramips/dts/BC2.dts +++ b/target/linux/ramips/dts/BC2.dts @@ -46,7 +46,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -57,7 +57,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts b/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts index 745037de0..e71d14c6a 100644 --- a/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts +++ b/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts @@ -19,7 +19,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -40,7 +40,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/BOCCO.dts b/target/linux/ramips/dts/BOCCO.dts index e4c056116..6b6ac754e 100644 --- a/target/linux/ramips/dts/BOCCO.dts +++ b/target/linux/ramips/dts/BOCCO.dts @@ -9,7 +9,7 @@ compatible = "planex,cs-qr10", "ralink,mt7620a-soc"; model = "YUKAI Engineering BOCCO"; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/BR-6475ND.dts b/target/linux/ramips/dts/BR-6475ND.dts index ebb1475de..f7fb8b5c4 100644 --- a/target/linux/ramips/dts/BR-6475ND.dts +++ b/target/linux/ramips/dts/BR-6475ND.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -34,7 +34,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -88,7 +88,7 @@ }; partition@70000 { - compatible = "denx,uimage"; + compatible = "edimax,uimage"; reg = <0x00070000 0x00790000>; label = "firmware"; }; diff --git a/target/linux/ramips/dts/BR-6478AC-V2.dts b/target/linux/ramips/dts/BR-6478AC-V2.dts index d4304df32..5c90aa154 100644 --- a/target/linux/ramips/dts/BR-6478AC-V2.dts +++ b/target/linux/ramips/dts/BR-6478AC-V2.dts @@ -33,7 +33,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -44,7 +44,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -122,7 +122,7 @@ }; partition@70000 { - compatible = "denx,uimage"; + compatible = "edimax,uimage"; label = "firmware"; reg = <0x00070000 0x00790000>; }; diff --git a/target/linux/ramips/dts/BROADWAY.dts b/target/linux/ramips/dts/BROADWAY.dts index 3d4d6ef5f..353cfbf41 100644 --- a/target/linux/ramips/dts/BROADWAY.dts +++ b/target/linux/ramips/dts/BROADWAY.dts @@ -46,7 +46,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; diskmounted { @@ -62,7 +62,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/C108.dts b/target/linux/ramips/dts/C108.dts index d79e54a79..2d89d34ad 100644 --- a/target/linux/ramips/dts/C108.dts +++ b/target/linux/ramips/dts/C108.dts @@ -64,7 +64,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; sdcard { @@ -93,7 +93,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/CF-WR800N.dts b/target/linux/ramips/dts/CF-WR800N.dts index 0161075ba..65f44e43d 100644 --- a/target/linux/ramips/dts/CF-WR800N.dts +++ b/target/linux/ramips/dts/CF-WR800N.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; ethernet { @@ -39,7 +39,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/CS-QR10.dts b/target/linux/ramips/dts/CS-QR10.dts index f58e70f53..dadd37acb 100644 --- a/target/linux/ramips/dts/CS-QR10.dts +++ b/target/linux/ramips/dts/CS-QR10.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/CY-SWR1100.dts b/target/linux/ramips/dts/CY-SWR1100.dts index f1c04bf6a..afffee2bd 100644 --- a/target/linux/ramips/dts/CY-SWR1100.dts +++ b/target/linux/ramips/dts/CY-SWR1100.dts @@ -68,7 +68,7 @@ realtek,extif0 = <1 0 1 1 1 1 1 1 2>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -85,7 +85,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wps: wps { diff --git a/target/linux/ramips/dts/D105.dts b/target/linux/ramips/dts/D105.dts index 5ba479cd2..10732cc5e 100644 --- a/target/linux/ramips/dts/D105.dts +++ b/target/linux/ramips/dts/D105.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -69,7 +69,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/D240.dts b/target/linux/ramips/dts/D240.dts index ade2dd16f..2110959ee 100644 --- a/target/linux/ramips/dts/D240.dts +++ b/target/linux/ramips/dts/D240.dts @@ -70,7 +70,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -91,7 +91,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DAP-1350.dts b/target/linux/ramips/dts/DAP-1350.dts index c84d5b94d..06d490cac 100644 --- a/target/linux/ramips/dts/DAP-1350.dts +++ b/target/linux/ramips/dts/DAP-1350.dts @@ -63,7 +63,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power_blue: power { @@ -82,7 +82,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DAP-1522-A1.dts b/target/linux/ramips/dts/DAP-1522-A1.dts index bdd63ea96..56e3990bf 100644 --- a/target/linux/ramips/dts/DAP-1522-A1.dts +++ b/target/linux/ramips/dts/DAP-1522-A1.dts @@ -40,6 +40,7 @@ }; partition@40000 { + compatible = "wrg"; label = "firmware"; reg = <0x40000 0x3a0000>; }; @@ -52,7 +53,7 @@ gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -83,7 +84,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wps { diff --git a/target/linux/ramips/dts/DB-WRT01.dts b/target/linux/ramips/dts/DB-WRT01.dts index 27dce66e1..bb2c14e09 100644 --- a/target/linux/ramips/dts/DB-WRT01.dts +++ b/target/linux/ramips/dts/DB-WRT01.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DCH-M225.dts b/target/linux/ramips/dts/DCH-M225.dts index e8f71ae16..0644378ba 100644 --- a/target/linux/ramips/dts/DCH-M225.dts +++ b/target/linux/ramips/dts/DCH-M225.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/DCS-930.dts b/target/linux/ramips/dts/DCS-930.dts index 4f49fc3a8..1c44e28fe 100644 --- a/target/linux/ramips/dts/DCS-930.dts +++ b/target/linux/ramips/dts/DCS-930.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wifi { @@ -72,7 +72,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DCS-930L-B1.dts b/target/linux/ramips/dts/DCS-930L-B1.dts index 6ac80e4d6..0fff5e8b5 100644 --- a/target/linux/ramips/dts/DCS-930L-B1.dts +++ b/target/linux/ramips/dts/DCS-930L-B1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DIR-300-B1.dts b/target/linux/ramips/dts/DIR-300-B1.dts index 1f0ed7d82..8bc77e422 100644 --- a/target/linux/ramips/dts/DIR-300-B1.dts +++ b/target/linux/ramips/dts/DIR-300-B1.dts @@ -53,7 +53,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -70,7 +70,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; status { diff --git a/target/linux/ramips/dts/DIR-300-B7.dts b/target/linux/ramips/dts/DIR-300-B7.dts index 3fa57ac34..2b6af163b 100644 --- a/target/linux/ramips/dts/DIR-300-B7.dts +++ b/target/linux/ramips/dts/DIR-300-B7.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DIR-320-B1.dts b/target/linux/ramips/dts/DIR-320-B1.dts index 68f0108ae..040a22398 100644 --- a/target/linux/ramips/dts/DIR-320-B1.dts +++ b/target/linux/ramips/dts/DIR-320-B1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -35,7 +35,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DIR-510L.dts b/target/linux/ramips/dts/DIR-510L.dts new file mode 100644 index 000000000..885e64f9f --- /dev/null +++ b/target/linux/ramips/dts/DIR-510L.dts @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "dlink,dir-510l", "ralink,mt7620a-soc"; + model = "D-Link DIR-510L"; + + aliases { + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + chosen { + bootargs = "console=ttyS1,57600"; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status: status { + label = "dir-510l:green:status"; + gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; + }; + + status-red { + label = "dir-510l:red:status"; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + + }; +}; + +ðernet { + mediatek,portmap = "llllw"; +}; + +&uart { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "jboot"; + reg = <0x0 0x10000>; + read-only; + }; + + partition@10000 { + label = "recovery"; + reg = <0x10000 0x200000>; + read-only; + }; + + partition@210000 { + compatible = "amit,jimage"; + label = "firmware"; + reg = <0x210000 0xde0000>; + }; + + config: partition@ff0000 { + label = "config"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76x0e@0,0 { + reg = <0x0000 0 0 0 0>; + mtd-mac-address = <&config 0xe490>; + mtd-mac-address-increment = <(2)>; + mediatek,mtd-eeprom = <&config 0xe05d>; + }; +}; + +&gsw { + mediatek,port4 = "ephy"; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "i2c", "uartf"; + ralink,function = "gpio"; + }; + }; +}; + diff --git a/target/linux/ramips/dts/DIR-600-B1.dts b/target/linux/ramips/dts/DIR-600-B1.dts index 246ee81ef..a77bfd717 100644 --- a/target/linux/ramips/dts/DIR-600-B1.dts +++ b/target/linux/ramips/dts/DIR-600-B1.dts @@ -53,7 +53,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -70,7 +70,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; status { diff --git a/target/linux/ramips/dts/DIR-610-A1.dts b/target/linux/ramips/dts/DIR-610-A1.dts index ea58d41af..7a0323e21 100644 --- a/target/linux/ramips/dts/DIR-610-A1.dts +++ b/target/linux/ramips/dts/DIR-610-A1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DIR-615-D.dts b/target/linux/ramips/dts/DIR-615-D.dts index fbced8d13..5f8ea1b22 100644 --- a/target/linux/ramips/dts/DIR-615-D.dts +++ b/target/linux/ramips/dts/DIR-615-D.dts @@ -53,7 +53,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -70,7 +70,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; status { diff --git a/target/linux/ramips/dts/DIR-615-H1.dts b/target/linux/ramips/dts/DIR-615-H1.dts index c81978b7d..79d4717f5 100644 --- a/target/linux/ramips/dts/DIR-615-H1.dts +++ b/target/linux/ramips/dts/DIR-615-H1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status_green; }; - gpio-leds { + leds { compatible = "gpio-leds"; status { @@ -46,7 +46,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DIR-620-A1.dts b/target/linux/ramips/dts/DIR-620-A1.dts index 94f1bd6f9..24fdec8ed 100644 --- a/target/linux/ramips/dts/DIR-620-A1.dts +++ b/target/linux/ramips/dts/DIR-620-A1.dts @@ -53,7 +53,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -70,7 +70,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; status { diff --git a/target/linux/ramips/dts/DIR-620-D1.dts b/target/linux/ramips/dts/DIR-620-D1.dts index ea14b54d9..74fd4af75 100644 --- a/target/linux/ramips/dts/DIR-620-D1.dts +++ b/target/linux/ramips/dts/DIR-620-D1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/DIR-645.dts b/target/linux/ramips/dts/DIR-645.dts index ce4ed42cf..35d011ebb 100644 --- a/target/linux/ramips/dts/DIR-645.dts +++ b/target/linux/ramips/dts/DIR-645.dts @@ -23,7 +23,7 @@ realtek,extif1 = <1 0 1 1 1 1 1 1 2>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -40,7 +40,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; inet { diff --git a/target/linux/ramips/dts/DIR-810L.dts b/target/linux/ramips/dts/DIR-810L.dts index feecf789b..d728449a4 100644 --- a/target/linux/ramips/dts/DIR-810L.dts +++ b/target/linux/ramips/dts/DIR-810L.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power_green; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power_green: power { diff --git a/target/linux/ramips/dts/DIR-860L-B1.dts b/target/linux/ramips/dts/DIR-860L-B1.dts index a37d68ff3..c212e05a2 100644 --- a/target/linux/ramips/dts/DIR-860L-B1.dts +++ b/target/linux/ramips/dts/DIR-860L-B1.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; power { @@ -49,7 +49,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -74,7 +74,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/DUZUN-DM06.dts b/target/linux/ramips/dts/DUZUN-DM06.dts index ff9d6398a..7325e2c69 100644 --- a/target/linux/ramips/dts/DUZUN-DM06.dts +++ b/target/linux/ramips/dts/DUZUN-DM06.dts @@ -14,7 +14,7 @@ reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -110,7 +110,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <60000000>; - m25p,chunked-io = <32>; m25p,fast-read; partitions { diff --git a/target/linux/ramips/dts/DWR-116-A1.dts b/target/linux/ramips/dts/DWR-116-A1.dts index 793f9a120..6f76a6403 100644 --- a/target/linux/ramips/dts/DWR-116-A1.dts +++ b/target/linux/ramips/dts/DWR-116-A1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { diff --git a/target/linux/ramips/dts/DWR-118-A1.dts b/target/linux/ramips/dts/DWR-118-A1.dts index ab88553a0..4b373ecec 100644 --- a/target/linux/ramips/dts/DWR-118-A1.dts +++ b/target/linux/ramips/dts/DWR-118-A1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_internet; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { diff --git a/target/linux/ramips/dts/DWR-118-A2.dts b/target/linux/ramips/dts/DWR-118-A2.dts index 25c3c1232..e1d181a87 100644 --- a/target/linux/ramips/dts/DWR-118-A2.dts +++ b/target/linux/ramips/dts/DWR-118-A2.dts @@ -14,7 +14,7 @@ led-failsafe = &led_internet; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -31,7 +31,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { diff --git a/target/linux/ramips/dts/DWR-512-B.dts b/target/linux/ramips/dts/DWR-512-B.dts index d865ced70..a08ea5d03 100644 --- a/target/linux/ramips/dts/DWR-512-B.dts +++ b/target/linux/ramips/dts/DWR-512-B.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; sms { diff --git a/target/linux/ramips/dts/DWR-921-C1.dts b/target/linux/ramips/dts/DWR-921-C1.dts index 42687d4f0..92bcd54a4 100644 --- a/target/linux/ramips/dts/DWR-921-C1.dts +++ b/target/linux/ramips/dts/DWR-921-C1.dts @@ -14,7 +14,7 @@ led-failsafe = &led_sstrenghg; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -31,7 +31,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; sms { diff --git a/target/linux/ramips/dts/E1700.dts b/target/linux/ramips/dts/E1700.dts index 4560e3986..2ea7400a7 100644 --- a/target/linux/ramips/dts/E1700.dts +++ b/target/linux/ramips/dts/E1700.dts @@ -26,7 +26,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -43,7 +43,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/ESR-9753.dts b/target/linux/ramips/dts/ESR-9753.dts index 0680d0dcf..4b55af069 100644 --- a/target/linux/ramips/dts/ESR-9753.dts +++ b/target/linux/ramips/dts/ESR-9753.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/EW1200.dts b/target/linux/ramips/dts/EW1200.dts index 6fe6a123a..def47d519 100644 --- a/target/linux/ramips/dts/EW1200.dts +++ b/target/linux/ramips/dts/EW1200.dts @@ -31,7 +31,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -42,7 +42,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_run: run { @@ -70,7 +70,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/EX2700.dts b/target/linux/ramips/dts/EX2700.dts index 66a46d703..7d7b2220f 100644 --- a/target/linux/ramips/dts/EX2700.dts +++ b/target/linux/ramips/dts/EX2700.dts @@ -30,7 +30,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power_green: power_g { @@ -70,7 +70,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/EX3700.dts b/target/linux/ramips/dts/EX3700.dts index 0232ab441..d971909b2 100644 --- a/target/linux/ramips/dts/EX3700.dts +++ b/target/linux/ramips/dts/EX3700.dts @@ -22,7 +22,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power_green: power_g { @@ -62,7 +62,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/EX6150.dts b/target/linux/ramips/dts/EX6150.dts new file mode 100644 index 000000000..a5827f270 --- /dev/null +++ b/target/linux/ramips/dts/EX6150.dts @@ -0,0 +1,248 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "netgear,ex6150", "mediatek,mt7621-soc"; + model = "Netgear EX6150"; + + aliases { + led-boot = &power_green; + led-failsafe = &power_amber; + led-running = &power_green; + led-upgrade = &power_amber; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + leds { + compatible = "gpio-leds"; + + power_amber: power_amber { + label = "ex6150:amber:power"; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + }; + + power_green: power_green { + label = "ex6150:green:power"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "ex6150:green:wps"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + }; + + rightarrow { + label = "ex6150:blue:rightarrow"; + gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; + }; + + leftarrow { + label = "ex6150:blue:leftarrow"; + gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; + }; + + router_green { + label = "ex6150:green:router"; + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + router_red { + label = "ex6150:red:router"; + gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; + }; + + client_green { + label = "ex6150:green:client"; + gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + client_red { + label = "ex6150:red:client"; + gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + wps { + label = "wps"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + toggle { + label = "AP/Extender toggle"; + gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; + linux,code = ; + /* Active when switch is set to "Access Point" */ + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xe80000>; + }; + + partition@ed0000 { + label = "ML1"; + reg = <0xed0000 0x10000>; + read-only; + }; + + partition@ef0000 { + label = "ML2"; + reg = <0xef0000 0x20000>; + read-only; + }; + + partition@f10000 { + label = "ML3"; + reg = <0xf10000 0x20000>; + read-only; + }; + + partition@f30000 { + label = "ML4"; + reg = <0xf30000 0x20000>; + read-only; + }; + + partition@f50000 { + label = "ML5"; + reg = <0xf50000 0x20000>; + read-only; + }; + + partition@f70000 { + label = "ML6"; + reg = <0xf70000 0x20000>; + read-only; + }; + + partition@f90000 { + label = "ML7"; + reg = <0xf90000 0x20000>; + read-only; + }; + + partition@fb0000 { + label = "T_Meter1"; + reg = <0xfb0000 0x10000>; + read-only; + }; + + partition@fc0000 { + label = "T_Meter2"; + reg = <0xfc0000 0x10000>; + read-only; + }; + + partition@fd0000 { + label = "POT"; + reg = <0xfd0000 0x10000>; + read-only; + }; + + partition@fe0000 { + label = "board_data"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + partition@ff0000 { + label = "nvram"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&pcie1 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x00000004>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "sdhci", "rgmii2", "jtag"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/F5D8235_V1.dts b/target/linux/ramips/dts/F5D8235_V1.dts index 29e8f7db7..04728c582 100644 --- a/target/linux/ramips/dts/F5D8235_V1.dts +++ b/target/linux/ramips/dts/F5D8235_V1.dts @@ -100,7 +100,7 @@ realtek,green-ethernet-features; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -117,7 +117,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; internet { diff --git a/target/linux/ramips/dts/F5D8235_V2.dts b/target/linux/ramips/dts/F5D8235_V2.dts index 3a0a148ef..93725e933 100644 --- a/target/linux/ramips/dts/F5D8235_V2.dts +++ b/target/linux/ramips/dts/F5D8235_V2.dts @@ -57,7 +57,7 @@ gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>; }; - gpio-leds { + leds { compatible = "gpio-leds"; internet { diff --git a/target/linux/ramips/dts/F7C027.dts b/target/linux/ramips/dts/F7C027.dts index aab35ce3d..f3bf00e30 100644 --- a/target/linux/ramips/dts/F7C027.dts +++ b/target/linux/ramips/dts/F7C027.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status_orange; }; - gpio-leds { + leds { compatible = "gpio-leds"; status { @@ -40,7 +40,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/F9K1109V1.dts b/target/linux/ramips/dts/F9K1109V1.dts new file mode 100644 index 000000000..cdd2b6b71 --- /dev/null +++ b/target/linux/ramips/dts/F9K1109V1.dts @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "F9K110x.dtsi" + +#include +#include + +/ { + compatible = "belkin,f9k1109v1", "ralink,rt3883-soc"; + model = "Belkin F9K1109 Version 1.0"; + + aliases { + led-boot = &led_status_amber; + led-failsafe = &led_status_amber; + led-running = &led_status_blue; + led-upgrade = &led_status_amber; + }; + + leds { + compatible = "gpio-leds"; + + led_status_amber: internet_amber { + label = "f9k1109v1:amber:internet"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + + led_status_blue: internet_blue { + label = "f9k1109v1:blue:internet"; + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + }; + + usb1 { + label = "f9k1109v1:green:usb1"; + gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; + }; + + usb2 { + label = "f9k1109v1:green:usb2"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + + wps_amber { + label = "f9k1109v1:amber:wps"; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + }; + + wps_blue { + label = "f9k1109v1:blue:wps"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + reset { + label = "reset"; + gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; diff --git a/target/linux/ramips/dts/F9K110x.dtsi b/target/linux/ramips/dts/F9K110x.dtsi new file mode 100644 index 000000000..a34c3f360 --- /dev/null +++ b/target/linux/ramips/dts/F9K110x.dtsi @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rt3883.dtsi" + +#include +#include + +/ { + compatible = "ralink,rt3883-soc"; + + rtl8367b { + compatible = "realtek,rtl8367b"; + gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>; + gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>; + realtek,extif1 = <1 0 1 1 1 1 1 1 2>; + }; + +}; + +&gpio1 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7a0000>; + }; + + partition@7f0000 { + label = "user-cfg"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +ðernet { + port@0 { + mediatek,fixed-link = <1000 1 1 1>; + phy-mode = "rgmii"; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "jtag", "uartf"; + ralink,function = "gpio"; + }; + }; +}; + +&wmac { + status = "okay"; + ralink,mtd-eeprom = <&factory 0>; +}; + +&pci { + status = "okay"; +}; + +&pci1 { + status = "okay"; + + wifi@1,0 { + compatible = "pci1814,3091"; + reg = <0x10000 0 0 0 0>; + ralink,5ghz = <0>; + ralink,mtd-eeprom = <&factory 0x8000>; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/FIREWRT.dts b/target/linux/ramips/dts/FIREWRT.dts index 82b511cdb..2abc01b2a 100644 --- a/target/linux/ramips/dts/FIREWRT.dts +++ b/target/linux/ramips/dts/FIREWRT.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -34,7 +34,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -63,7 +63,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/FONERA20N.dts b/target/linux/ramips/dts/FONERA20N.dts index 2c8629be3..83ce17317 100644 --- a/target/linux/ramips/dts/FONERA20N.dts +++ b/target/linux/ramips/dts/FONERA20N.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wifi { @@ -74,7 +74,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/FREESTATION5.dts b/target/linux/ramips/dts/FREESTATION5.dts index 2f9d80ecc..b924229a7 100644 --- a/target/linux/ramips/dts/FREESTATION5.dts +++ b/target/linux/ramips/dts/FREESTATION5.dts @@ -64,7 +64,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; /* diff --git a/target/linux/ramips/dts/GB-PC1.dts b/target/linux/ramips/dts/GB-PC1.dts index 007879a7b..e09e9f75a 100644 --- a/target/linux/ramips/dts/GB-PC1.dts +++ b/target/linux/ramips/dts/GB-PC1.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -36,7 +36,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; system { @@ -71,8 +71,8 @@ m25p80@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; + spi-max-frequency = <80000000>; + m25p,fast-read; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/GB-PC2.dts b/target/linux/ramips/dts/GB-PC2.dts index b07613b7a..dff1b3d5f 100644 --- a/target/linux/ramips/dts/GB-PC2.dts +++ b/target/linux/ramips/dts/GB-PC2.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -36,7 +36,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; system { @@ -81,8 +81,8 @@ m25p80@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; + spi-max-frequency = <80000000>; + m25p,fast-read; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/GHL-R-001.dts b/target/linux/ramips/dts/GHL-R-001.dts index 8aef0dcce..59640a179 100644 --- a/target/linux/ramips/dts/GHL-R-001.dts +++ b/target/linux/ramips/dts/GHL-R-001.dts @@ -55,9 +55,10 @@ status = "okay"; flash@0 { - compatible = "jedec,spi-nor"; + compatible = "mx25l25635f", "jedec,spi-nor"; reg = <0>; spi-max-frequency = <25000000>; + m25p,fast-read; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/GL-MT300A.dts b/target/linux/ramips/dts/GL-MT300A.dts index ad23ece7e..2cea9d9be 100644 --- a/target/linux/ramips/dts/GL-MT300A.dts +++ b/target/linux/ramips/dts/GL-MT300A.dts @@ -13,7 +13,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -37,7 +37,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset { diff --git a/target/linux/ramips/dts/GL-MT300N-V2.dts b/target/linux/ramips/dts/GL-MT300N-V2.dts index 23669600a..e4220736d 100644 --- a/target/linux/ramips/dts/GL-MT300N-V2.dts +++ b/target/linux/ramips/dts/GL-MT300N-V2.dts @@ -25,7 +25,7 @@ reg = <0x0 0x8000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -45,7 +45,7 @@ }; }; - gpio-keys { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -105,7 +105,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/GL-MT300N.dts b/target/linux/ramips/dts/GL-MT300N.dts index 9d9d6274f..a30792cac 100644 --- a/target/linux/ramips/dts/GL-MT300N.dts +++ b/target/linux/ramips/dts/GL-MT300N.dts @@ -13,7 +13,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -32,7 +32,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset { diff --git a/target/linux/ramips/dts/GL-MT750.dts b/target/linux/ramips/dts/GL-MT750.dts index 8e2a968e4..11133a126 100644 --- a/target/linux/ramips/dts/GL-MT750.dts +++ b/target/linux/ramips/dts/GL-MT750.dts @@ -13,7 +13,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -32,7 +32,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset { diff --git a/target/linux/ramips/dts/HC5661.dts b/target/linux/ramips/dts/HC5661.dts index f07070510..091483a13 100644 --- a/target/linux/ramips/dts/HC5661.dts +++ b/target/linux/ramips/dts/HC5661.dts @@ -13,7 +13,7 @@ led-upgrade = &led_system; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { diff --git a/target/linux/ramips/dts/HC5661A.dts b/target/linux/ramips/dts/HC5661A.dts index 6dfac5061..25f1ff1a0 100644 --- a/target/linux/ramips/dts/HC5661A.dts +++ b/target/linux/ramips/dts/HC5661A.dts @@ -25,7 +25,7 @@ reg = <0x0 0x8000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -42,7 +42,7 @@ }; }; - gpio-keys { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -71,7 +71,6 @@ reg = <0>; linux,modalias = "m25p80", "w25q128"; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/HC5761.dts b/target/linux/ramips/dts/HC5761.dts index 31ed99ad0..dff129a93 100644 --- a/target/linux/ramips/dts/HC5761.dts +++ b/target/linux/ramips/dts/HC5761.dts @@ -13,7 +13,7 @@ led-upgrade = &led_system; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { diff --git a/target/linux/ramips/dts/HC5861.dts b/target/linux/ramips/dts/HC5861.dts index b9a613de7..b1d5ce4fa 100644 --- a/target/linux/ramips/dts/HC5861.dts +++ b/target/linux/ramips/dts/HC5861.dts @@ -13,7 +13,7 @@ led-upgrade = &led_system; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -103,10 +103,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&state_default { - gpio { - ralink,group = "uartf", "wled", "rgmii2", "ephy"; - ralink,function = "gpio"; - }; -}; diff --git a/target/linux/ramips/dts/HC5861B.dts b/target/linux/ramips/dts/HC5861B.dts index ef2d70613..5cc2634dc 100644 --- a/target/linux/ramips/dts/HC5861B.dts +++ b/target/linux/ramips/dts/HC5861B.dts @@ -25,7 +25,7 @@ reg = <0x0 0x8000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -38,7 +38,7 @@ }; }; - gpio-keys { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -66,7 +66,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/HC5962.dts b/target/linux/ramips/dts/HC5962.dts index 298502046..817b571d2 100644 --- a/target/linux/ramips/dts/HC5962.dts +++ b/target/linux/ramips/dts/HC5962.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -39,7 +39,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/HC5X61.dtsi b/target/linux/ramips/dts/HC5X61.dtsi index 8da05adee..09b303fd3 100644 --- a/target/linux/ramips/dts/HC5X61.dtsi +++ b/target/linux/ramips/dts/HC5X61.dtsi @@ -10,7 +10,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/HG255D.dts b/target/linux/ramips/dts/HG255D.dts index 961fd8f91..df8a72c8c 100644 --- a/target/linux/ramips/dts/HG255D.dts +++ b/target/linux/ramips/dts/HG255D.dts @@ -59,7 +59,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -95,7 +95,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <10>; diff --git a/target/linux/ramips/dts/HLKRM04.dts b/target/linux/ramips/dts/HLKRM04.dts index efbd51776..7b2791fa6 100644 --- a/target/linux/ramips/dts/HLKRM04.dts +++ b/target/linux/ramips/dts/HLKRM04.dts @@ -37,7 +37,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset { diff --git a/target/linux/ramips/dts/HPM.dts b/target/linux/ramips/dts/HPM.dts index d27eff8b8..7ccd07814 100644 --- a/target/linux/ramips/dts/HPM.dts +++ b/target/linux/ramips/dts/HPM.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -31,7 +31,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power { diff --git a/target/linux/ramips/dts/HT-TM02.dts b/target/linux/ramips/dts/HT-TM02.dts index d6954fe65..4e73c6988 100644 --- a/target/linux/ramips/dts/HT-TM02.dts +++ b/target/linux/ramips/dts/HT-TM02.dts @@ -16,7 +16,7 @@ led-upgrade = &led_wlan; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wlan: wlan { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/HW550-3G.dts b/target/linux/ramips/dts/HW550-3G.dts index fa5c4d72a..372d18e75 100644 --- a/target/linux/ramips/dts/HW550-3G.dts +++ b/target/linux/ramips/dts/HW550-3G.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -79,7 +79,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/IP2202.dts b/target/linux/ramips/dts/IP2202.dts index c9c04dc34..31478da69 100644 --- a/target/linux/ramips/dts/IP2202.dts +++ b/target/linux/ramips/dts/IP2202.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_run: run { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/JHR-N805R.dts b/target/linux/ramips/dts/JHR-N805R.dts index f633bb26e..702d779aa 100644 --- a/target/linux/ramips/dts/JHR-N805R.dts +++ b/target/linux/ramips/dts/JHR-N805R.dts @@ -16,7 +16,7 @@ led-upgrade = &led_system; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/JHR-N825R.dts b/target/linux/ramips/dts/JHR-N825R.dts index 12c5c90f2..4c0640b88 100644 --- a/target/linux/ramips/dts/JHR-N825R.dts +++ b/target/linux/ramips/dts/JHR-N825R.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { label = "jhr-n825r:red:power"; @@ -61,7 +61,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset_wps { diff --git a/target/linux/ramips/dts/JHR-N926R.dts b/target/linux/ramips/dts/JHR-N926R.dts index 5990c0652..941482859 100644 --- a/target/linux/ramips/dts/JHR-N926R.dts +++ b/target/linux/ramips/dts/JHR-N926R.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wlan1 { @@ -100,7 +100,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/K2G.dts b/target/linux/ramips/dts/K2G.dts index 96714944f..4ca522974 100644 --- a/target/linux/ramips/dts/K2G.dts +++ b/target/linux/ramips/dts/K2G.dts @@ -17,7 +17,7 @@ serial0 = &uartlite; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_blue: blue { @@ -36,7 +36,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/K2P.dts b/target/linux/ramips/dts/K2P.dts index 56d207c2d..0b330aa20 100644 --- a/target/linux/ramips/dts/K2P.dts +++ b/target/linux/ramips/dts/K2P.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; stat_r { @@ -44,7 +44,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -63,7 +63,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/LINKIT7688.dts b/target/linux/ramips/dts/LINKIT7688.dts index 23a59aef5..eaa75f407 100644 --- a/target/linux/ramips/dts/LINKIT7688.dts +++ b/target/linux/ramips/dts/LINKIT7688.dts @@ -35,7 +35,7 @@ status = "okay"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wifi: wifi { @@ -44,7 +44,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -104,7 +104,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <40000000>; - m25p,chunked-io = <31>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/LR-25G001.dts b/target/linux/ramips/dts/LR-25G001.dts index 2584457df..20974c93e 100644 --- a/target/linux/ramips/dts/LR-25G001.dts +++ b/target/linux/ramips/dts/LR-25G001.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { diff --git a/target/linux/ramips/dts/M2M.dts b/target/linux/ramips/dts/M2M.dts index 6c251af34..122c70e21 100644 --- a/target/linux/ramips/dts/M2M.dts +++ b/target/linux/ramips/dts/M2M.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,57600n8 root=/dev/mtdblock5"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wifi: wifi { @@ -34,7 +34,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/M3.dts b/target/linux/ramips/dts/M3.dts index bfc1f9057..1c894aff1 100644 --- a/target/linux/ramips/dts/M3.dts +++ b/target/linux/ramips/dts/M3.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/M4.dtsi b/target/linux/ramips/dts/M4.dtsi index 8a9548ef4..df8db131e 100644 --- a/target/linux/ramips/dts/M4.dtsi +++ b/target/linux/ramips/dts/M4.dtsi @@ -13,7 +13,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -22,7 +22,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MAC1200RV2.dts b/target/linux/ramips/dts/MAC1200RV2.dts index a260e7188..7d1362113 100644 --- a/target/linux/ramips/dts/MAC1200RV2.dts +++ b/target/linux/ramips/dts/MAC1200RV2.dts @@ -25,7 +25,7 @@ reg = <0x0 0x2000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { label = "mac1200rv2:green:status"; @@ -41,7 +41,6 @@ compatible = "jedec,spi-nor"; reg = <0 0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/MINIEMBPLUG.dts b/target/linux/ramips/dts/MINIEMBPLUG.dts index ccdea8000..5db1ce48a 100644 --- a/target/linux/ramips/dts/MINIEMBPLUG.dts +++ b/target/linux/ramips/dts/MINIEMBPLUG.dts @@ -9,7 +9,7 @@ compatible = "omnima,miniembplug", "ralink,rt5350-soc"; model = "Omnima MiniEMBPlug"; - gpio-leds { + leds { compatible = "gpio-leds"; wlan { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MINIEMBWIFI.dts b/target/linux/ramips/dts/MINIEMBWIFI.dts index 641b9004f..2f045c788 100644 --- a/target/linux/ramips/dts/MINIEMBWIFI.dts +++ b/target/linux/ramips/dts/MINIEMBWIFI.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MIR3G.dts b/target/linux/ramips/dts/MIR3G.dts index 40bcf884f..b0b63f808 100644 --- a/target/linux/ramips/dts/MIR3G.dts +++ b/target/linux/ramips/dts/MIR3G.dts @@ -10,10 +10,10 @@ model = "Xiaomi Mi Router 3G"; aliases { - led-boot = &led_status_blue; - led-failsafe = &led_status_blue; + led-boot = &led_status_yellow; + led-failsafe = &led_status_red; led-running = &led_status_blue; - led-upgrade = &led_status_blue; + led-upgrade = &led_status_yellow; }; memory@0 { @@ -25,10 +25,10 @@ bootargs = "console=ttyS0,115200n8"; }; - gpio-leds { + leds { compatible = "gpio-leds"; - status_red { + led_status_red: status_red { label = "mir3g:red:status"; gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; }; @@ -38,7 +38,7 @@ gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; }; - status_yellow { + led_status_yellow: status_yellow { label = "mir3g:yellow:status"; gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; }; @@ -59,7 +59,7 @@ }; }; - gpio-keys-polled { + button { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -70,7 +70,7 @@ }; }; - reg_usb_vbus: reg_usb_vbus { + reg_usb_vbus: regulator { compatible = "regulator-fixed"; regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; diff --git a/target/linux/ramips/dts/MIR4.dts b/target/linux/ramips/dts/MIR3P.dts similarity index 54% rename from target/linux/ramips/dts/MIR4.dts rename to target/linux/ramips/dts/MIR3P.dts index 6360c3c35..cd929e5e3 100644 --- a/target/linux/ramips/dts/MIR4.dts +++ b/target/linux/ramips/dts/MIR3P.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; #include "mt7621.dtsi" @@ -6,60 +7,65 @@ #include / { - compatible = "xiaomi,mir4", "mediatek,mt7621-soc"; - model = "Xiaomi Mi Router 4"; + compatible = "xiaomi,mir3p", "mediatek,mt7621-soc"; + model = "Xiaomi Mi Router 3 Pro"; aliases { - led-boot = &led_status_blue; - led-failsafe = &led_status_blue; + led-boot = &led_status_yellow; + led-failsafe = &led_status_red; led-running = &led_status_blue; - led-upgrade = &led_status_blue; + led-upgrade = &led_status_yellow; }; memory@0 { device_type = "memory"; - reg = <0x0 0x8000000>; + reg = <0x0 0x1c000000>, <0x20000000 0x04000000>; }; chosen { bootargs = "console=ttyS0,115200n8"; }; - gpio-leds { + leds { compatible = "gpio-leds"; - status_red { - label = "mir3g:red:status"; + led_status_red: status_red { + label = "mir3p:red:status"; gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; }; led_status_blue: status_blue { - label = "mir3g:blue:status"; + label = "mir3p:blue:status"; gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; }; - status_yellow { - label = "mir3g:yellow:status"; + led_status_yellow: status_yellow { + label = "mir3p:yellow:status"; gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; }; wan_amber { - label = "mir3g:amber:wan"; - gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; - }; - - lan1_amber { - label = "mir3g:amber:lan1"; + label = "mir3p:amber:wan"; gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; }; + lan3_amber { + label = "mir3p:amber:lan3"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + lan2_amber { - label = "mir3g:amber:lan2"; + label = "mir3p:amber:lan2"; gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; }; + + lan1_amber { + label = "mir3p:amber:lan1"; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + }; }; - gpio-keys-polled { + button { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -69,6 +75,19 @@ linux,code = ; }; }; + + reg_usb_vbus: regulator { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&xhci { + vbus-supply = <®_usb_vbus>; }; &nand { @@ -81,35 +100,35 @@ partition@0 { label = "Bootloader"; - reg = <0x0 0x80000>; + reg = <0x0 0x40000>; read-only; }; + partition@40000 { + label = "Config"; + reg = <0x40000 0x40000>; + }; + partition@80000 { - label = "Config"; - reg = <0x80000 0x40000>; - }; - - partition@c0000 { label = "Bdata"; - reg = <0xc0000 0x40000>; + reg = <0x80000 0x40000>; read-only; }; - factory: partition@100000 { + factory: partition@c0000 { label = "Factory"; - reg = <0x100000 0x40000>; + reg = <0x0c0000 0x40000>; read-only; }; + partition@100000 { + label = "crash"; + reg = <0x100000 0x40000>; + }; + partition@140000 { - label = "crash"; - reg = <0x140000 0x40000>; - }; - - partition@180000 { label = "crash_syslog"; - reg = <0x180000 0x40000>; + reg = <0x140000 0x80000>; }; partition@1c0000 { @@ -118,20 +137,7 @@ read-only; }; - /* uboot expects to find kernels at 0x200000 & 0x600000 - * referred to as system 1 & system 2 respectively. - * a kernel is considered suitable for handing control over - * if its linux magic number exists & uImage CRC are correct. - * If either of those conditions fail, a matching sys'n'_fail flag - * is set in uboot env & a restart performed in the hope that the - * alternate kernel is okay. - * if neither kernel checksums ok and both are marked failed, system 2 - * is booted anyway. - * - * Note uboot's tftp flash install writes the transferred - * image to both kernel partitions. - */ - + /* We keep stock xiaomi firmware (kernel0) here */ partition@200000 { label = "kernel_stock"; reg = <0x200000 0x400000>; @@ -142,17 +148,9 @@ reg = <0x600000 0x400000>; }; - /* ubi partition is the result of squashing - * next consecutive stock partitions: - * - rootfs0 (rootfs partition for stock kernel0), - * - rootfs1 (rootfs partition for stock failsafe kernel1), - * - overlay (used as ubi overlay in stock fw) - * resulting 117,5MiB space for packages. - */ - partition@a00000 { label = "ubi"; - reg = <0xa00000 0x7580000>; + reg = <0xa00000 0xf580000>; }; }; }; @@ -163,16 +161,15 @@ &pcie0 { wifi@0,0 { - compatible = "pci14c3,7603"; + compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x0000>; - ieee80211-freq-limit = <2400000 2500000>; }; }; &pcie1 { wifi@0,0 { - compatible = "pci14c3,7662"; + compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; @@ -181,7 +178,7 @@ ðernet { mtd-mac-address = <&factory 0xe000>; - mediatek,portmap = "lwlll"; + mediatek,portmap = "llllw"; }; &pinctrl { diff --git a/target/linux/ramips/dts/MIWIFI-MINI.dts b/target/linux/ramips/dts/MIWIFI-MINI.dts index e9f9c9663..e8ff02f2a 100644 --- a/target/linux/ramips/dts/MIWIFI-MINI.dts +++ b/target/linux/ramips/dts/MIWIFI-MINI.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_blue: blue { @@ -40,7 +40,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MIWIFI-NANO.dts b/target/linux/ramips/dts/MIWIFI-NANO.dts index 6aa300a7a..bad37e21f 100644 --- a/target/linux/ramips/dts/MIWIFI-NANO.dts +++ b/target/linux/ramips/dts/MIWIFI-NANO.dts @@ -25,7 +25,7 @@ reg = <0x0 0x4000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_blue: status_blue { @@ -42,7 +42,7 @@ }; }; - gpio-keys { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -79,7 +79,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/MIWIFI-R3.dts b/target/linux/ramips/dts/MIWIFI-R3.dts deleted file mode 100644 index c535a71c6..000000000 --- a/target/linux/ramips/dts/MIWIFI-R3.dts +++ /dev/null @@ -1,175 +0,0 @@ -/dts-v1/; - -#include "mt7620a.dtsi" - -#include -#include - -/ { - compatible = "xiaomi,miwifi-r3", "ralink,mt7620a-soc"; - model = "Xiaomi Mi Router R3"; - - aliases { - led-status = &led_status_blue; - }; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - - 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 = <&gpio1 6 GPIO_ACTIVE_HIGH>; - linux,code = ; - }; - }; - - gpio-leds { - compatible = "gpio-leds"; - - led_status_blue: blue { - label = "miwifi-r3:blue:status"; - gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; - }; - - yellow { - label = "miwifi-r3:yellow:status"; - gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; - }; - - red { - label = "miwifi-r3:red:status"; - gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; - }; - }; - - nand { - status = "okay"; - #address-cells = <1>; - #size-cells = <1>; - compatible = "mtk,mt7620-nand"; - - partition@0 { - label = "Bootloader"; - reg = <0x0 0x40000>; - read-only; - }; - - partition@40000 { - label = "Config"; - reg = <0x40000 0x40000>; - }; - - partition@80000 { - label = "Bdata"; - reg = <0x80000 0x40000>; - read-only; - }; - - factory: partition@0xc0000 { - label = "Factory"; - reg = <0xc0000 0x40000>; - read-only; - }; - - partition@100000 { - label = "crash"; - reg = <0x100000 0x40000>; - read-only; - }; - - partition@140000 { - label = "crash_syslog"; - reg = <0x140000 0x40000>; - read-only; - }; - - partition@180000 { - label = "reserved0"; - reg = <0x180000 0x80000>; - read-only; - }; - - partition@200000 { - label = "kernel0_rsvd"; - reg = <0x200000 0x400000>; - }; - - partition@600000 { - label = "kernel"; - reg = <0x600000 0x400000>; - }; - - /* ubi partition is the result of squashing - * next consequent stock partitions: - * - rootfs0 (rootfs partition for stock kernel0), - * - rootfs1 (rootfs partition for stock failsafe kernel1), - * - overlay (used as ubi overlay in stock fw) - * resulting 117,5MiB space for packages. - */ - partition@a00000 { - label = "ubi"; - reg = <0xa00000 0x7600000>; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - -ðernet { - pinctrl-names = "default"; - pinctrl-0 = <&ephy_pins>; - mtd-mac-address = <&factory 0x28>; - mediatek,portmap = "llllw"; -}; - -&wmac { - ralink,mtd-eeprom = <&factory 0>; -}; - -&pcie { - status = "okay"; -}; - -&pcie0 { - mt76@0,0 { - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; - }; -}; - -&pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "rgmii1"; - ralink,function = "gpio"; - }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; - }; -}; diff --git a/target/linux/ramips/dts/MLW221.dts b/target/linux/ramips/dts/MLW221.dts index e7b57f58c..815370e6f 100644 --- a/target/linux/ramips/dts/MLW221.dts +++ b/target/linux/ramips/dts/MLW221.dts @@ -16,7 +16,7 @@ led-upgrade = &led_system; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MLWG2.dts b/target/linux/ramips/dts/MLWG2.dts index 83c1a89db..f88af7189 100644 --- a/target/linux/ramips/dts/MLWG2.dts +++ b/target/linux/ramips/dts/MLWG2.dts @@ -16,7 +16,7 @@ led-upgrade = &led_system; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MOFI3500-3GN.dts b/target/linux/ramips/dts/MOFI3500-3GN.dts index 24c9eb700..d20f2d270 100644 --- a/target/linux/ramips/dts/MOFI3500-3GN.dts +++ b/target/linux/ramips/dts/MOFI3500-3GN.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -79,7 +79,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MPRA1.dts b/target/linux/ramips/dts/MPRA1.dts index cb6b49ef2..328351a55 100644 --- a/target/linux/ramips/dts/MPRA1.dts +++ b/target/linux/ramips/dts/MPRA1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_system; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MPRA2.dts b/target/linux/ramips/dts/MPRA2.dts index 22c0456d0..fedb5b061 100644 --- a/target/linux/ramips/dts/MPRA2.dts +++ b/target/linux/ramips/dts/MPRA2.dts @@ -16,7 +16,7 @@ led-upgrade = &led_system; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MR-102N.dts b/target/linux/ramips/dts/MR-102N.dts index c431ff143..ffb76e3bf 100644 --- a/target/linux/ramips/dts/MR-102N.dts +++ b/target/linux/ramips/dts/MR-102N.dts @@ -63,7 +63,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -84,7 +84,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MT7620a.dts b/target/linux/ramips/dts/MT7620a.dts index be96fa9de..9166fdc57 100644 --- a/target/linux/ramips/dts/MT7620a.dts +++ b/target/linux/ramips/dts/MT7620a.dts @@ -9,7 +9,7 @@ compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc"; model = "Ralink MT7620a + MT7610e evaluation board"; - gpio-keys-polled { + keys { compatible = "gpio-keys"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MT7620a_MT7610e.dts b/target/linux/ramips/dts/MT7620a_MT7610e.dts index 972b48af0..e0ae57a0d 100644 --- a/target/linux/ramips/dts/MT7620a_MT7610e.dts +++ b/target/linux/ramips/dts/MT7620a_MT7610e.dts @@ -9,7 +9,7 @@ compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc"; model = "Ralink MT7620A evaluation board"; - gpio-keys-polled { + keys { compatible = "gpio-keys"; poll-interval = <20>; @@ -89,3 +89,11 @@ &pcie { status = "okay"; }; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; diff --git a/target/linux/ramips/dts/MT7620a_V22SG.dts b/target/linux/ramips/dts/MT7620a_V22SG.dts index 4a88445f8..d2863ee75 100644 --- a/target/linux/ramips/dts/MT7620a_V22SG.dts +++ b/target/linux/ramips/dts/MT7620a_V22SG.dts @@ -9,7 +9,7 @@ compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc"; model = "Ralink MT7620a V22SG High Power evaluation board"; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MT7628.dts b/target/linux/ramips/dts/MT7628.dts index 313c63475..b4afc8ce9 100644 --- a/target/linux/ramips/dts/MT7628.dts +++ b/target/linux/ramips/dts/MT7628.dts @@ -32,7 +32,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/MZK-750DHP.dts b/target/linux/ramips/dts/MZK-750DHP.dts index f4376d705..a4a6c9b8b 100644 --- a/target/linux/ramips/dts/MZK-750DHP.dts +++ b/target/linux/ramips/dts/MZK-750DHP.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; wps { @@ -35,7 +35,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MZK-DP150N.dts b/target/linux/ramips/dts/MZK-DP150N.dts index ea3fc8aeb..41fb6e06d 100644 --- a/target/linux/ramips/dts/MZK-DP150N.dts +++ b/target/linux/ramips/dts/MZK-DP150N.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MZK-EX300NP.dts b/target/linux/ramips/dts/MZK-EX300NP.dts index 49046fdd0..6578d952c 100644 --- a/target/linux/ramips/dts/MZK-EX300NP.dts +++ b/target/linux/ramips/dts/MZK-EX300NP.dts @@ -16,7 +16,7 @@ led-upgrade = &led_wps; }; - gpio-leds { + leds { compatible = "gpio-leds"; wifi { @@ -50,7 +50,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MZK-EX750NP.dts b/target/linux/ramips/dts/MZK-EX750NP.dts index 08e34723f..497693d39 100644 --- a/target/linux/ramips/dts/MZK-EX750NP.dts +++ b/target/linux/ramips/dts/MZK-EX750NP.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -55,7 +55,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MZK-W300NH2.dts b/target/linux/ramips/dts/MZK-W300NH2.dts index a001598ed..ab749fc43 100644 --- a/target/linux/ramips/dts/MZK-W300NH2.dts +++ b/target/linux/ramips/dts/MZK-W300NH2.dts @@ -59,7 +59,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -78,7 +78,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/MicroWRT.dts b/target/linux/ramips/dts/MicroWRT.dts index 051ff8a0a..a010a9c62 100644 --- a/target/linux/ramips/dts/MicroWRT.dts +++ b/target/linux/ramips/dts/MicroWRT.dts @@ -13,7 +13,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/NA930.dts b/target/linux/ramips/dts/NA930.dts index 43fea5670..6d8591426 100644 --- a/target/linux/ramips/dts/NA930.dts +++ b/target/linux/ramips/dts/NA930.dts @@ -54,7 +54,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -77,7 +77,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; zwave { diff --git a/target/linux/ramips/dts/NBG-419N.dts b/target/linux/ramips/dts/NBG-419N.dts index 2f9c48c48..625e1616d 100644 --- a/target/linux/ramips/dts/NBG-419N.dts +++ b/target/linux/ramips/dts/NBG-419N.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/NBG-419N2.dts b/target/linux/ramips/dts/NBG-419N2.dts index 58361faa1..e150eff9e 100644 --- a/target/linux/ramips/dts/NBG-419N2.dts +++ b/target/linux/ramips/dts/NBG-419N2.dts @@ -57,7 +57,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -78,7 +78,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset { diff --git a/target/linux/ramips/dts/NW718.dts b/target/linux/ramips/dts/NW718.dts index 6db2e23c8..61af498fd 100644 --- a/target/linux/ramips/dts/NW718.dts +++ b/target/linux/ramips/dts/NW718.dts @@ -16,7 +16,7 @@ led-upgrade = &led_cpu; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_cpu: cpu { @@ -37,7 +37,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/Newifi-D1.dts b/target/linux/ramips/dts/Newifi-D1.dts index 37383fd3d..2c180585c 100644 --- a/target/linux/ramips/dts/Newifi-D1.dts +++ b/target/linux/ramips/dts/Newifi-D1.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; status-red { @@ -45,7 +45,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -82,10 +82,10 @@ status = "okay"; m25p80@0 { - compatible = "jedec,spi-nor"; + compatible = "mx25l25635f", "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; + spi-max-frequency = <25000000>; + m25p,fast-read; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/Newifi-D2.dts b/target/linux/ramips/dts/Newifi-D2.dts index 447701296..31fc42cde 100644 --- a/target/linux/ramips/dts/Newifi-D2.dts +++ b/target/linux/ramips/dts/Newifi-D2.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; power-amber { @@ -66,7 +66,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -102,7 +102,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/OMEGA2.dtsi b/target/linux/ramips/dts/OMEGA2.dtsi index adde7fcdd..e36602d6c 100644 --- a/target/linux/ramips/dts/OMEGA2.dtsi +++ b/target/linux/ramips/dts/OMEGA2.dtsi @@ -17,7 +17,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; system_led: system { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -109,7 +109,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <40000000>; - m25p,chunked-io = <31>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/OY-0001.dts b/target/linux/ramips/dts/OY-0001.dts index cc656d413..6b93b8d08 100644 --- a/target/linux/ramips/dts/OY-0001.dts +++ b/target/linux/ramips/dts/OY-0001.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: powerled { @@ -34,7 +34,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/PBR-D1.dts b/target/linux/ramips/dts/PBR-D1.dts index 5fe72bbc3..6d98a4492 100644 --- a/target/linux/ramips/dts/PBR-D1.dts +++ b/target/linux/ramips/dts/PBR-D1.dts @@ -29,7 +29,7 @@ reg = <0x0 0x8000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -46,7 +46,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -105,7 +105,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <40000000>; - m25p,chunked-io = <31>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/PBR-M1.dts b/target/linux/ramips/dts/PBR-M1.dts index f3b85d50a..e89a7ef93 100644 --- a/target/linux/ramips/dts/PBR-M1.dts +++ b/target/linux/ramips/dts/PBR-M1.dts @@ -37,7 +37,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -118,7 +118,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; @@ -146,7 +145,7 @@ partition@50000 { compatible = "denx,uimage"; label = "firmware"; - reg = <0x50000 0x1fb0000>; + reg = <0x50000 0xfb0000>; }; }; }; diff --git a/target/linux/ramips/dts/PSG1208.dts b/target/linux/ramips/dts/PSG1208.dts index de8d11abe..564b083f8 100644 --- a/target/linux/ramips/dts/PSG1208.dts +++ b/target/linux/ramips/dts/PSG1208.dts @@ -16,7 +16,7 @@ led-upgrade = &led_wps; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wps: wps { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/PSG1218.dtsi b/target/linux/ramips/dts/PSG1218.dtsi index 23f1dd753..33eabb6f7 100644 --- a/target/linux/ramips/dts/PSG1218.dtsi +++ b/target/linux/ramips/dts/PSG1218.dtsi @@ -6,7 +6,7 @@ / { compatible = "phicomm,psg1218", "ralink,mt7620a-soc"; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/PSG1218A.dts b/target/linux/ramips/dts/PSG1218A.dts index 767070dbb..2ae8871d8 100644 --- a/target/linux/ramips/dts/PSG1218A.dts +++ b/target/linux/ramips/dts/PSG1218A.dts @@ -13,7 +13,7 @@ led-upgrade = &led_blue; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_blue: blue { label = "psg1218a:blue:status"; diff --git a/target/linux/ramips/dts/PSG1218B.dts b/target/linux/ramips/dts/PSG1218B.dts index 8f735a7d9..f6445e8c4 100644 --- a/target/linux/ramips/dts/PSG1218B.dts +++ b/target/linux/ramips/dts/PSG1218B.dts @@ -13,7 +13,7 @@ led-upgrade = &led_blue; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_blue: blue { label = "psg1218b:blue:status"; diff --git a/target/linux/ramips/dts/PSR-680W.dts b/target/linux/ramips/dts/PSR-680W.dts index cdda066a2..260d0a144 100644 --- a/target/linux/ramips/dts/PSR-680W.dts +++ b/target/linux/ramips/dts/PSR-680W.dts @@ -57,7 +57,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wan: wan { @@ -66,7 +66,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/PWH2004.dts b/target/linux/ramips/dts/PWH2004.dts index 885589a2e..3280c93af 100644 --- a/target/linux/ramips/dts/PWH2004.dts +++ b/target/linux/ramips/dts/PWH2004.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wifi { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/PX-4885.dtsi b/target/linux/ramips/dts/PX-4885.dtsi index cbfd2d0f3..032a89cd1 100644 --- a/target/linux/ramips/dts/PX-4885.dtsi +++ b/target/linux/ramips/dts/PX-4885.dtsi @@ -13,7 +13,7 @@ led-upgrade = &led_wifi; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -24,7 +24,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wifi: wifi { diff --git a/target/linux/ramips/dts/R6120.dts b/target/linux/ramips/dts/R6120.dts index 052933b76..d263c7824 100644 --- a/target/linux/ramips/dts/R6120.dts +++ b/target/linux/ramips/dts/R6120.dts @@ -7,7 +7,7 @@ / { compatible = "netgear,r6120", "mediatek,mt7628an-soc"; - model = "Netgear AC1200 R6120"; + model = "Netgear R6120"; aliases { led-boot = &led_power; @@ -21,7 +21,7 @@ reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -32,7 +32,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { @@ -55,23 +55,36 @@ gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; }; - wlan5 { - label = "r6120:green:wlan5g"; + wan { + label = "r6120:green:wan"; gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; }; - wlan5_orange { - label = "r6120:orange:wlan5g"; + wan_orange { + label = "r6120:orange:wan"; gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; }; }; + + usb-regulator { + compatible = "regulator-fixed"; + + regulator-name = "USB-power"; + gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + + regulator-always-on; + }; }; &pinctrl { state_default: pinctrl0 { gpio { ralink,group = "p0led_an", "p1led_an", "p2led_an", - "p3led_an", "p4led_an", "wdt", "wled_an"; + "p3led_an", "p4led_an", "wdt", + "wled_an", "uart1"; ralink,function = "gpio"; }; }; @@ -84,7 +97,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; @@ -103,7 +115,7 @@ read-only; }; - nvram: partition@60000 { + partition@60000 { label = "nvram"; reg = <0x60000 0x30000>; read-only; @@ -126,12 +138,12 @@ &wmac { status = "okay"; - mtd-mac-address = <&nvram 0x100b0>; - mediatek,mtd-eeprom = <&factory 0x20000>; + mtd-mac-address = <&factory 0x4>; + mediatek,mtd-eeprom = <&factory 0x0>; }; ðernet { - mtd-mac-address = <&nvram 0x100b0>; + mtd-mac-address = <&factory 0x4>; }; &pcie { @@ -141,9 +153,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x28000>; + mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - mtd-mac-address = <&nvram 0x100b0>; + mtd-mac-address = <&factory 0x4>; mtd-mac-address-increment = <(2)>; }; }; diff --git a/target/linux/ramips/dts/R6220.dts b/target/linux/ramips/dts/R6220.dts index f9b27daf2..335351c82 100644 --- a/target/linux/ramips/dts/R6220.dts +++ b/target/linux/ramips/dts/R6220.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -56,7 +56,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/R6350.dts b/target/linux/ramips/dts/R6350.dts index b3f528154..e49a5decd 100644 --- a/target/linux/ramips/dts/R6350.dts +++ b/target/linux/ramips/dts/R6350.dts @@ -26,7 +26,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -52,7 +52,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/RAK633.dts b/target/linux/ramips/dts/RAK633.dts new file mode 100644 index 000000000..ac7218510 --- /dev/null +++ b/target/linux/ramips/dts/RAK633.dts @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "rakwireless,rak633", "mediatek,mt7628an-soc"; + model = "Rakwireless RAK633"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + leds { + compatible = "gpio-leds"; + + wifi { + label = "rak633:blue:wifi"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + wled_an { + ralink,group = "wled_an"; + ralink,function = "gpio"; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +&i2c { + status = "okay"; +}; + +&i2s { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&gdma { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&wmac { + status = "okay"; + ralink,mtd-eeprom = <&factory 0x4>; +}; diff --git a/target/linux/ramips/dts/RB750Gr3.dts b/target/linux/ramips/dts/RB750Gr3.dts index 6b18cce78..4a303eddd 100644 --- a/target/linux/ramips/dts/RB750Gr3.dts +++ b/target/linux/ramips/dts/RB750Gr3.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; #include "mt7621.dtsi" @@ -7,13 +8,13 @@ / { compatible = "mikrotik,rb750gr3", "mediatek,mt7621-soc"; - model = "MikroTik RB750Gr3"; + model = "MikroTik RouterBOARD 750Gr3"; aliases { - led-boot = &led_pwr; - led-failsafe = &led_pwr; - led-running = &led_pwr; - led-upgrade = &led_pwr; + led-boot = &led_usr; + led-failsafe = &led_usr; + led-running = &led_usr; + led-upgrade = &led_usr; }; memory@0 { @@ -22,52 +23,52 @@ }; chosen { - bootargs = "console=ttyS0,57600"; + bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; - led_pwr: pwr { + pwr { label = "rb750gr3:blue:pwr"; gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; + default-state = "on"; }; - usr { + led_usr: usr { label = "rb750gr3:green:usr"; gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; mode { label = "mode"; gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; - linux,code = ; + linux,code = ; }; - res { - label = "res"; + reset { + label = "reset"; gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; linux,code = ; }; }; + beeper { + compatible = "gpio-beeper"; + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + }; + gpio_export { compatible = "gpio-export"; #size-cells = <0>; - buzzer { - gpio-export,name = "buzzer"; - gpio-export,output = <0>; - gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; - }; - - usb { - gpio-export,name = "usb"; + usb_power { + gpio-export,name = "usb_power"; gpio-export,output = <1>; gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; }; @@ -77,11 +78,10 @@ &spi0 { status = "okay"; - m25p80@0 { + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; + spi-max-frequency = <20000000>; partitions { compatible = "fixed-partitions"; @@ -89,41 +89,62 @@ #size-cells = <1>; partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; + label = "RouterBoot"; + reg = <0x0 0x40000>; read-only; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader1"; + reg = <0x0 0xf000>; + read-only; + }; + + hard_config: partition@f000 { + label = "hard_config"; + reg = <0xf000 0x1000>; + read-only; + }; + + partition@10000 { + label = "bootloader2"; + reg = <0x10000 0xf000>; + read-only; + }; + + partition@20000 { + label = "soft_config"; + reg = <0x20000 0x1000>; + }; + + partition@30000 { + label = "bios"; + reg = <0x30000 0x1000>; + 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 { - compatible = "denx,uimage"; + partition@40000 { + compatible = "mikrotik,minor"; label = "firmware"; - reg = <0x50000 0xfb0000>; + reg = <0x040000 0xfc0000>; }; }; }; }; ðernet { - mtd-mac-address = <&factory 0xe000>; + mtd-mac-address = <&hard_config 0x0010>; mtd-mac-address-increment = <1>; }; &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "i2c", "uart2", "uart3", "pcie", "rgmii2", "jtag"; + /* via gpio7 (uart3 group) the PoE status can be read */ + ralink,group = "uart2", "uart3", "jtag", "wdt"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/RBM11G.dts b/target/linux/ramips/dts/RBM11G.dts index 4c0131649..ce8d7208f 100644 --- a/target/linux/ramips/dts/RBM11G.dts +++ b/target/linux/ramips/dts/RBM11G.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_usr: usr { @@ -59,7 +59,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; res { diff --git a/target/linux/ramips/dts/RBM33G.dts b/target/linux/ramips/dts/RBM33G.dts index 08c5ab1f3..f40c4f733 100644 --- a/target/linux/ramips/dts/RBM33G.dts +++ b/target/linux/ramips/dts/RBM33G.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_usr: usr { @@ -34,7 +34,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/RE350.dts b/target/linux/ramips/dts/RE350.dts index 38218b6c9..5414fe147 100644 --- a/target/linux/ramips/dts/RE350.dts +++ b/target/linux/ramips/dts/RE350.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -64,7 +64,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -101,7 +101,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/RE6500.dts b/target/linux/ramips/dts/RE6500.dts index 830dfe25a..de5c31060 100644 --- a/target/linux/ramips/dts/RE6500.dts +++ b/target/linux/ramips/dts/RE6500.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; wifi { @@ -39,7 +39,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -64,7 +64,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/RP-N53.dts b/target/linux/ramips/dts/RP-N53.dts index d73e7d184..2d2820ed7 100644 --- a/target/linux/ramips/dts/RP-N53.dts +++ b/target/linux/ramips/dts/RP-N53.dts @@ -9,7 +9,7 @@ compatible = "asus,rp-n53", "ralink,mt7620a-soc"; model = "Asus RP-N53"; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -38,7 +38,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; backlight { diff --git a/target/linux/ramips/dts/RT-AC51U.dts b/target/linux/ramips/dts/RT-AC51U.dts index b54e5b847..3e54ffdad 100644 --- a/target/linux/ramips/dts/RT-AC51U.dts +++ b/target/linux/ramips/dts/RT-AC51U.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -37,7 +37,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/RT-G32-B1.dts b/target/linux/ramips/dts/RT-G32-B1.dts index 581941c84..8f0544e7e 100644 --- a/target/linux/ramips/dts/RT-G32-B1.dts +++ b/target/linux/ramips/dts/RT-G32-B1.dts @@ -9,7 +9,7 @@ compatible = "asus,rt-g32-b1", "ralink,rt3050-soc"; model = "Asus RT-G32 B1"; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/RT-N10-PLUS.dts b/target/linux/ramips/dts/RT-N10-PLUS.dts index eaf32ece1..3b77a4ce3 100644 --- a/target/linux/ramips/dts/RT-N10-PLUS.dts +++ b/target/linux/ramips/dts/RT-N10-PLUS.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wps: wps { @@ -62,7 +62,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/RT-N12-PLUS.dts b/target/linux/ramips/dts/RT-N12-PLUS.dts index 401e403cf..83a7b6adf 100644 --- a/target/linux/ramips/dts/RT-N12-PLUS.dts +++ b/target/linux/ramips/dts/RT-N12-PLUS.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -44,7 +44,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/RT-N13U.dts b/target/linux/ramips/dts/RT-N13U.dts index f4a8720a0..c3a3d2346 100644 --- a/target/linux/ramips/dts/RT-N13U.dts +++ b/target/linux/ramips/dts/RT-N13U.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <10>; diff --git a/target/linux/ramips/dts/RT-N14U.dts b/target/linux/ramips/dts/RT-N14U.dts index 10ae9c047..834eb0ddf 100644 --- a/target/linux/ramips/dts/RT-N14U.dts +++ b/target/linux/ramips/dts/RT-N14U.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -47,7 +47,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/RT-N15.dts b/target/linux/ramips/dts/RT-N15.dts index 3cc929d51..4ed6c1ed4 100644 --- a/target/linux/ramips/dts/RT-N15.dts +++ b/target/linux/ramips/dts/RT-N15.dts @@ -61,7 +61,7 @@ gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -78,7 +78,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/RT-N56U.dts b/target/linux/ramips/dts/RT-N56U.dts index 39f6488ac..9c2a32a98 100644 --- a/target/linux/ramips/dts/RT-N56U.dts +++ b/target/linux/ramips/dts/RT-N56U.dts @@ -59,7 +59,7 @@ realtek,extif1 = <1 0 1 1 1 1 1 1 2>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -76,7 +76,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/RUT5XX.dts b/target/linux/ramips/dts/RUT5XX.dts index a7654c60b..52638f94e 100644 --- a/target/linux/ramips/dts/RUT5XX.dts +++ b/target/linux/ramips/dts/RUT5XX.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/SAP-G3200U3.dts b/target/linux/ramips/dts/SAP-G3200U3.dts index 1b2078990..d1d6a534b 100644 --- a/target/linux/ramips/dts/SAP-G3200U3.dts +++ b/target/linux/ramips/dts/SAP-G3200U3.dts @@ -18,7 +18,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -29,7 +29,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -54,7 +54,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/SK-WB8.dts b/target/linux/ramips/dts/SK-WB8.dts index 8f85c704c..9511432e1 100644 --- a/target/linux/ramips/dts/SK-WB8.dts +++ b/target/linux/ramips/dts/SK-WB8.dts @@ -24,7 +24,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wps: wps { @@ -40,7 +40,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; wps { @@ -63,7 +63,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/SKW92A.dts b/target/linux/ramips/dts/SKW92A.dts index 5aaf3ce16..dddb794a8 100644 --- a/target/linux/ramips/dts/SKW92A.dts +++ b/target/linux/ramips/dts/SKW92A.dts @@ -24,7 +24,7 @@ reg = <0x0 0x4000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: wps { @@ -38,7 +38,7 @@ }; }; - gpio-keys { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -75,7 +75,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/SL-R7205.dts b/target/linux/ramips/dts/SL-R7205.dts index 7c3d53aea..3d8a9ec46 100644 --- a/target/linux/ramips/dts/SL-R7205.dts +++ b/target/linux/ramips/dts/SL-R7205.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wifi: wifi { @@ -62,7 +62,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/TEW-638APB-V2.dts b/target/linux/ramips/dts/TEW-638APB-V2.dts index bacdb0b1f..a014b3280 100644 --- a/target/linux/ramips/dts/TEW-638APB-V2.dts +++ b/target/linux/ramips/dts/TEW-638APB-V2.dts @@ -53,7 +53,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -70,7 +70,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wps { diff --git a/target/linux/ramips/dts/TEW-691GR.dts b/target/linux/ramips/dts/TEW-691GR.dts index 8fee29b83..aeed7fbb2 100644 --- a/target/linux/ramips/dts/TEW-691GR.dts +++ b/target/linux/ramips/dts/TEW-691GR.dts @@ -52,7 +52,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -75,7 +75,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wps: wps { diff --git a/target/linux/ramips/dts/TEW-692GR.dts b/target/linux/ramips/dts/TEW-692GR.dts index 37b841c1d..03395a92d 100644 --- a/target/linux/ramips/dts/TEW-692GR.dts +++ b/target/linux/ramips/dts/TEW-692GR.dts @@ -52,7 +52,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -69,7 +69,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wps { diff --git a/target/linux/ramips/dts/TEW-714TRU.dts b/target/linux/ramips/dts/TEW-714TRU.dts index 4969aee4b..00e3d2df1 100644 --- a/target/linux/ramips/dts/TEW-714TRU.dts +++ b/target/linux/ramips/dts/TEW-714TRU.dts @@ -9,7 +9,7 @@ compatible = "trendnet,tew-714tru", "ralink,rt5350-soc"; model = "TRENDnet TEW714TRU"; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/TINY-AC.dts b/target/linux/ramips/dts/TINY-AC.dts index d5a232124..e36af1dc7 100644 --- a/target/linux/ramips/dts/TINY-AC.dts +++ b/target/linux/ramips/dts/TINY-AC.dts @@ -13,7 +13,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -29,7 +29,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/TL-MR3020V3.dts b/target/linux/ramips/dts/TL-MR3020V3.dts index aa9bcaf81..7a9ef4144 100644 --- a/target/linux/ramips/dts/TL-MR3020V3.dts +++ b/target/linux/ramips/dts/TL-MR3020V3.dts @@ -25,7 +25,7 @@ reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -48,7 +48,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -88,7 +88,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/TL-MR3420V5.dts b/target/linux/ramips/dts/TL-MR3420V5.dts index 80436b870..a528152d3 100644 --- a/target/linux/ramips/dts/TL-MR3420V5.dts +++ b/target/linux/ramips/dts/TL-MR3420V5.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { diff --git a/target/linux/ramips/dts/TL-WA801NDV5.dts b/target/linux/ramips/dts/TL-WA801NDV5.dts index ad9177617..fb944b07e 100644 --- a/target/linux/ramips/dts/TL-WA801NDV5.dts +++ b/target/linux/ramips/dts/TL-WA801NDV5.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -27,7 +27,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/TL-WR802NV4.dts b/target/linux/ramips/dts/TL-WR802NV4.dts new file mode 100644 index 000000000..668da700c --- /dev/null +++ b/target/linux/ramips/dts/TL-WR802NV4.dts @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "TPLINK-8M.dtsi" + +#include +#include + +/ { + compatible = "tplink,tl-wr802n-v4", "mediatek,mt7628an-soc"; + model = "TP-Link TL-WR802N v4"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tl-wr802n-v4:green:power"; + gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "refclk", "wdt"; + ralink,function = "gpio"; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xf100>; + mediatek,portmap = "l"; +}; diff --git a/target/linux/ramips/dts/TL-WR840NV4.dts b/target/linux/ramips/dts/TL-WR840NV4.dts index df892a0d2..5f5bb4fa4 100644 --- a/target/linux/ramips/dts/TL-WR840NV4.dts +++ b/target/linux/ramips/dts/TL-WR840NV4.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -27,7 +27,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { diff --git a/target/linux/ramips/dts/TL-WR840NV5.dts b/target/linux/ramips/dts/TL-WR840NV5.dts index 2d9b7e5c5..773839098 100644 --- a/target/linux/ramips/dts/TL-WR840NV5.dts +++ b/target/linux/ramips/dts/TL-WR840NV5.dts @@ -25,7 +25,7 @@ reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -36,7 +36,7 @@ }; }; /* LED used is dual-color,dual lead LED */ - gpio-leds { + leds { compatible = "gpio-leds"; led_power_green: power { @@ -58,7 +58,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/TL-WR841NV13.dts b/target/linux/ramips/dts/TL-WR841NV13.dts index a9a01fea2..3dea06328 100644 --- a/target/linux/ramips/dts/TL-WR841NV13.dts +++ b/target/linux/ramips/dts/TL-WR841NV13.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/TL-WR842NV5.dts b/target/linux/ramips/dts/TL-WR842NV5.dts index 9d1e39966..0610b2025 100644 --- a/target/linux/ramips/dts/TL-WR842NV5.dts +++ b/target/linux/ramips/dts/TL-WR842NV5.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -33,7 +33,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { diff --git a/target/linux/ramips/dts/TL-WR902ACV3.dts b/target/linux/ramips/dts/TL-WR902ACV3.dts index b78604128..1d634314c 100644 --- a/target/linux/ramips/dts/TL-WR902ACV3.dts +++ b/target/linux/ramips/dts/TL-WR902ACV3.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -45,7 +45,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { diff --git a/target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi b/target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi new file mode 100644 index 000000000..c62079ee5 --- /dev/null +++ b/target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "mt7628an.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "factory-uboot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "boot"; + reg = <0x30000 0x20000>; + read-only; + }; + + partition@50000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x50000 0x770000>; + }; + + partition@7c0000 { + label = "config"; + reg = <0x7c0000 0x10000>; + read-only; + }; + + rom: partition@7d0000 { + label = "rom"; + reg = <0x7d0000 0x10000>; + read-only; + }; + + partition@7e0000 { + label = "romfile"; + reg = <0x7e0000 0x10000>; + }; + + radio: partition@7f0000 { + label = "radio"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +&wmac { + status = "okay"; + mtd-mac-address = <&rom 0xf100>; + mediatek,mtd-eeprom = <&radio 0x0>; +}; + +ðernet { + mtd-mac-address = <&rom 0xf100>; + mediatek,portmap = "llllw"; +}; diff --git a/target/linux/ramips/dts/TPLINK-8M.dtsi b/target/linux/ramips/dts/TPLINK-8M.dtsi index 017f5acd6..9f7f7ccd6 100644 --- a/target/linux/ramips/dts/TPLINK-8M.dtsi +++ b/target/linux/ramips/dts/TPLINK-8M.dtsi @@ -18,7 +18,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/TUBE-E4G.dts b/target/linux/ramips/dts/TUBE-E4G.dts new file mode 100644 index 000000000..4097dc614 --- /dev/null +++ b/target/linux/ramips/dts/TUBE-E4G.dts @@ -0,0 +1,190 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "alfa-network,tube-e4g", "ralink,mt7620a-soc"; + model = "ALFA Network Tube-E4G"; + + aliases { + led-boot = &power; + led-failsafe = &power; + led-running = &power; + led-upgrade = &power; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + modem-enable { + gpio-export,name = "modem-enable"; + gpio-export,output = <1>; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + }; + + modem-rf-enable { + gpio-export,name = "modem-rf-enable"; + gpio-export,output = <1>; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + + sim-select { + gpio-export,name = "sim-select"; + gpio-export,output = <0>; + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + }; + + sim1-detect { + gpio-export,name = "sim1-detect"; + gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; + }; + + sim2-detect { + gpio-export,name = "sim2-detect"; + gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + 4g { + label = "tube-e4g:green:4g"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "tube-e4g:blue:lan"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + + power: power { + label = "tube-e4g:green:power"; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + sim1 { + label = "tube-e4g:green:sim1"; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + sim2 { + label = "tube-e4g:green:sim2"; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gsw { + mediatek,port4 = "ephy"; +}; + +&ohci { + status = "okay"; +}; + +&pcie { + status = "disabled"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "ephy", "nd_sd", "pcie", "uartf"; + ralink,function = "gpio"; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x1000>; + }; + + partition@31000 { + label = "config"; + reg = <0x31000 0xf000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&wmac { + status = "disabled"; +}; diff --git a/target/linux/ramips/dts/Timecloud.dts b/target/linux/ramips/dts/Timecloud.dts index 188aef226..1b8aa9d85 100644 --- a/target/linux/ramips/dts/Timecloud.dts +++ b/target/linux/ramips/dts/Timecloud.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; statw { @@ -39,7 +39,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -68,7 +68,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/U25AWF-H1.dts b/target/linux/ramips/dts/U25AWF-H1.dts index d4caa8a90..4b4d0b635 100644 --- a/target/linux/ramips/dts/U25AWF-H1.dts +++ b/target/linux/ramips/dts/U25AWF-H1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_wifi; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -27,7 +27,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wifi: wifi { diff --git a/target/linux/ramips/dts/U35WF.dts b/target/linux/ramips/dts/U35WF.dts index 854c9683f..d058b8394 100644 --- a/target/linux/ramips/dts/U35WF.dts +++ b/target/linux/ramips/dts/U35WF.dts @@ -16,7 +16,7 @@ led-upgrade = &led_wifi; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -27,7 +27,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wifi: wifi { diff --git a/target/linux/ramips/dts/U7621-06-256M-16M.dts b/target/linux/ramips/dts/U7621-06-256M-16M.dts index ae66bd365..e6cc4c920 100644 --- a/target/linux/ramips/dts/U7621-06-256M-16M.dts +++ b/target/linux/ramips/dts/U7621-06-256M-16M.dts @@ -56,7 +56,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <14000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/U7621-06-512M-64M.dts b/target/linux/ramips/dts/U7621-06-512M-64M.dts index 4b064b2b3..d710477c1 100644 --- a/target/linux/ramips/dts/U7621-06-512M-64M.dts +++ b/target/linux/ramips/dts/U7621-06-512M-64M.dts @@ -57,7 +57,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/U7621-06.dtsi b/target/linux/ramips/dts/U7621-06.dtsi index 2bfd4d71f..301edfe68 100644 --- a/target/linux/ramips/dts/U7621-06.dtsi +++ b/target/linux/ramips/dts/U7621-06.dtsi @@ -62,7 +62,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -73,7 +73,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { diff --git a/target/linux/ramips/dts/U7628-01-128M-16M.dts b/target/linux/ramips/dts/U7628-01-128M-16M.dts index 7b27bfb19..ac9fd503c 100644 --- a/target/linux/ramips/dts/U7628-01-128M-16M.dts +++ b/target/linux/ramips/dts/U7628-01-128M-16M.dts @@ -53,7 +53,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <12000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/U7628-01.dtsi b/target/linux/ramips/dts/U7628-01.dtsi index 3ba6b8e80..03da1f88f 100644 --- a/target/linux/ramips/dts/U7628-01.dtsi +++ b/target/linux/ramips/dts/U7628-01.dtsi @@ -51,7 +51,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset { @@ -61,7 +61,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/UBNT-ER-e50.dtsi b/target/linux/ramips/dts/UBNT-ER-e50.dtsi index b3949a39f..1d54713fe 100644 --- a/target/linux/ramips/dts/UBNT-ER-e50.dtsi +++ b/target/linux/ramips/dts/UBNT-ER-e50.dtsi @@ -15,7 +15,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -95,7 +95,6 @@ compatible = "jedec,spi-nor"; reg = <1>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/UR-326N4G.dts b/target/linux/ramips/dts/UR-326N4G.dts index 88cf96427..d67c2e0ec 100644 --- a/target/linux/ramips/dts/UR-326N4G.dts +++ b/target/linux/ramips/dts/UR-326N4G.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; 3g { @@ -82,7 +82,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/UR-336UN.dts b/target/linux/ramips/dts/UR-336UN.dts index 2ee1a8b87..937278db9 100644 --- a/target/linux/ramips/dts/UR-336UN.dts +++ b/target/linux/ramips/dts/UR-336UN.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; 3g { @@ -82,7 +82,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/V11STFE.dts b/target/linux/ramips/dts/V11STFE.dts index a8a569a8c..5007f271b 100644 --- a/target/linux/ramips/dts/V11STFE.dts +++ b/target/linux/ramips/dts/V11STFE.dts @@ -52,7 +52,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -63,7 +63,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { diff --git a/target/linux/ramips/dts/V22RW-2X2.dts b/target/linux/ramips/dts/V22RW-2X2.dts index df0fad3b2..df56c8081 100644 --- a/target/linux/ramips/dts/V22RW-2X2.dts +++ b/target/linux/ramips/dts/V22RW-2X2.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_security: security { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/VAR11N-300.dts b/target/linux/ramips/dts/VAR11N-300.dts index 1b9323130..cf4b7c54a 100644 --- a/target/linux/ramips/dts/VAR11N-300.dts +++ b/target/linux/ramips/dts/VAR11N-300.dts @@ -16,7 +16,7 @@ led-upgrade = &led_system; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/VIXMINI.dts b/target/linux/ramips/dts/VIXMINI.dts new file mode 100644 index 000000000..5a52fe2a1 --- /dev/null +++ b/target/linux/ramips/dts/VIXMINI.dts @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/{ + compatible = "glinet,vixmini", "mediatek,mt7628an-soc"; + model = "GL.iNet VIXMINI"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "vixmini:blue:power"; + default-state = "on"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "vixmini:white:wlan"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "wdt", "wled_an", "p1led_an"; + ralink,function = "gpio"; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&wmac { + status = "okay"; + + ralink,mtd-eeprom = <&factory 0x0>; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; diff --git a/target/linux/ramips/dts/VOCORE.dtsi b/target/linux/ramips/dts/VOCORE.dtsi index cee7e38ca..c5c26e77c 100644 --- a/target/linux/ramips/dts/VOCORE.dtsi +++ b/target/linux/ramips/dts/VOCORE.dtsi @@ -138,7 +138,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { diff --git a/target/linux/ramips/dts/VOCORE2.dts b/target/linux/ramips/dts/VOCORE2.dts index 8ecfd7737..a78d2cc73 100644 --- a/target/linux/ramips/dts/VOCORE2.dts +++ b/target/linux/ramips/dts/VOCORE2.dts @@ -15,7 +15,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -32,7 +32,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/VOCORE2LITE.dts b/target/linux/ramips/dts/VOCORE2LITE.dts index a09fa773f..db45a95a8 100644 --- a/target/linux/ramips/dts/VOCORE2LITE.dts +++ b/target/linux/ramips/dts/VOCORE2LITE.dts @@ -15,7 +15,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -32,7 +32,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/VR500.dts b/target/linux/ramips/dts/VR500.dts index 3538ef793..4d74f2c9c 100644 --- a/target/linux/ramips/dts/VR500.dts +++ b/target/linux/ramips/dts/VR500.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -34,7 +34,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -53,7 +53,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/W06.dts b/target/linux/ramips/dts/W06.dts index 8c3bbe405..55b117c19 100644 --- a/target/linux/ramips/dts/W06.dts +++ b/target/linux/ramips/dts/W06.dts @@ -14,7 +14,7 @@ reg = <0x0 0x4000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; wps { @@ -33,7 +33,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -73,7 +73,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/W150M.dts b/target/linux/ramips/dts/W150M.dts index 77e835558..e128580ec 100644 --- a/target/linux/ramips/dts/W150M.dts +++ b/target/linux/ramips/dts/W150M.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; 3grouter { @@ -87,7 +87,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/W2914NSV2.dts b/target/linux/ramips/dts/W2914NSV2.dts index 4c13122c1..bd8e80944 100644 --- a/target/linux/ramips/dts/W2914NSV2.dts +++ b/target/linux/ramips/dts/W2914NSV2.dts @@ -10,7 +10,7 @@ reg = <0x0 0x8000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { diff --git a/target/linux/ramips/dts/W2914NSV2.dtsi b/target/linux/ramips/dts/W2914NSV2.dtsi index 332473375..63cff0c10 100644 --- a/target/linux/ramips/dts/W2914NSV2.dtsi +++ b/target/linux/ramips/dts/W2914NSV2.dtsi @@ -10,7 +10,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -39,7 +39,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/W306R_V20.dts b/target/linux/ramips/dts/W306R_V20.dts index 2e1fd77c6..233a6d2e4 100644 --- a/target/linux/ramips/dts/W306R_V20.dts +++ b/target/linux/ramips/dts/W306R_V20.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_sys: sys { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/W502U.dts b/target/linux/ramips/dts/W502U.dts index 0de66af84..a53c47819 100644 --- a/target/linux/ramips/dts/W502U.dts +++ b/target/linux/ramips/dts/W502U.dts @@ -57,7 +57,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -73,7 +73,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WCR-1166DS.dts b/target/linux/ramips/dts/WCR-1166DS.dts index ca715c8ba..602ea8c5d 100644 --- a/target/linux/ramips/dts/WCR-1166DS.dts +++ b/target/linux/ramips/dts/WCR-1166DS.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -40,7 +40,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; router_o { @@ -126,7 +126,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; @@ -152,6 +151,7 @@ }; partition@50000 { + compatible = "openwrt,trx"; label = "firmware"; reg = <0x50000 0x7c0000>; }; diff --git a/target/linux/ramips/dts/WCR150GN.dts b/target/linux/ramips/dts/WCR150GN.dts index 90298bf82..b20967680 100644 --- a/target/linux/ramips/dts/WCR150GN.dts +++ b/target/linux/ramips/dts/WCR150GN.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; user { @@ -69,7 +69,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WD03.dts b/target/linux/ramips/dts/WD03.dts index c685aeaf6..bbb2ca3dc 100644 --- a/target/linux/ramips/dts/WD03.dts +++ b/target/linux/ramips/dts/WD03.dts @@ -13,7 +13,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; green-wifi { @@ -28,7 +28,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WE1026-5G.dtsi b/target/linux/ramips/dts/WE1026-5G.dtsi index e6c4b8c1b..e7e64e251 100644 --- a/target/linux/ramips/dts/WE1026-5G.dtsi +++ b/target/linux/ramips/dts/WE1026-5G.dtsi @@ -43,7 +43,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { label = "we1026-5g:green:lan"; @@ -63,7 +63,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset { diff --git a/target/linux/ramips/dts/WF-2881.dts b/target/linux/ramips/dts/WF-2881.dts index aeff06b42..bc9d6d722 100644 --- a/target/linux/ramips/dts/WF-2881.dts +++ b/target/linux/ramips/dts/WF-2881.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; usb { @@ -41,7 +41,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WHR-1166D.dts b/target/linux/ramips/dts/WHR-1166D.dts index ddfa768b9..9a6ca335a 100644 --- a/target/linux/ramips/dts/WHR-1166D.dts +++ b/target/linux/ramips/dts/WHR-1166D.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power_green; }; - gpio-leds { + leds { compatible = "gpio-leds"; power { @@ -55,7 +55,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WHR-300HP2.dts b/target/linux/ramips/dts/WHR-300HP2.dts index efcd65d63..8a79d6ab0 100644 --- a/target/linux/ramips/dts/WHR-300HP2.dts +++ b/target/linux/ramips/dts/WHR-300HP2.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power_green; }; - gpio-leds { + leds { compatible = "gpio-leds"; power { @@ -55,7 +55,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WHR-600D.dts b/target/linux/ramips/dts/WHR-600D.dts index c96bd6828..f4b5661ea 100644 --- a/target/linux/ramips/dts/WHR-600D.dts +++ b/target/linux/ramips/dts/WHR-600D.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power_green; }; - gpio-leds { + leds { compatible = "gpio-leds"; power { @@ -55,7 +55,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WHR-G300N.dts b/target/linux/ramips/dts/WHR-G300N.dts index f9756065c..3871b5549 100644 --- a/target/linux/ramips/dts/WHR-G300N.dts +++ b/target/linux/ramips/dts/WHR-G300N.dts @@ -10,10 +10,9 @@ model = "Buffalo WHR-G300N"; aliases { - led-boot = &led_router; - led-failsafe = &led_router; - led-running = &led_router; - led-upgrade = &led_router; + led-boot = &led_diag; + led-failsafe = &led_diag; + led-upgrade = &led_diag; }; cfi@1f000000 { @@ -59,15 +58,15 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; - diag { + led_diag: diag { label = "whr-g300n:red:diag"; gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; }; - led_router: router { + router { label = "whr-g300n:green:router"; gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; }; @@ -78,7 +77,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WIDORA-NEO-16M.dts b/target/linux/ramips/dts/WIDORA-NEO-16M.dts index 1c1049094..9ed6b1533 100644 --- a/target/linux/ramips/dts/WIDORA-NEO-16M.dts +++ b/target/linux/ramips/dts/WIDORA-NEO-16M.dts @@ -17,7 +17,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <40000000>; - m25p,chunked-io = <31>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WIDORA-NEO-32M.dts b/target/linux/ramips/dts/WIDORA-NEO-32M.dts index a9d0b6fc6..cfd6ba709 100644 --- a/target/linux/ramips/dts/WIDORA-NEO-32M.dts +++ b/target/linux/ramips/dts/WIDORA-NEO-32M.dts @@ -17,7 +17,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <40000000>; - m25p,chunked-io = <31>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WIDORA-NEO.dtsi b/target/linux/ramips/dts/WIDORA-NEO.dtsi index 4d2ebb20c..af3a1b1a1 100644 --- a/target/linux/ramips/dts/WIDORA-NEO.dtsi +++ b/target/linux/ramips/dts/WIDORA-NEO.dtsi @@ -22,7 +22,7 @@ reg = <0x0 0x8000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wifi: wifi { @@ -32,7 +32,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WITI.dtsi b/target/linux/ramips/dts/WITI.dtsi index 9e1e62fc3..6e474e90b 100644 --- a/target/linux/ramips/dts/WITI.dtsi +++ b/target/linux/ramips/dts/WITI.dtsi @@ -24,7 +24,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -47,7 +47,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WIZFI630A.dts b/target/linux/ramips/dts/WIZFI630A.dts index 45c080be6..f88d5ae63 100644 --- a/target/linux/ramips/dts/WIZFI630A.dts +++ b/target/linux/ramips/dts/WIZFI630A.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS1,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_run: run { @@ -44,7 +44,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WIZFI630S.dts b/target/linux/ramips/dts/WIZFI630S.dts new file mode 100644 index 000000000..13c8f68f1 --- /dev/null +++ b/target/linux/ramips/dts/WIZFI630S.dts @@ -0,0 +1,193 @@ +//SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "wiznet,wizfi630s", "mediatek,mt7628an-soc"; + model = "WIZnet WizFi630S"; + + chosen { + bootargs = "console=ttyS1,115200"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + aliases { + led-boot = &led_run; + led-failsafe = &led_run; + led-running = &led_run; + led-upgrade = &led_run; + serial0 = &uart1; + serial1 = &uartlite; + }; + + leds { + compatible = "gpio-leds"; + + led_run: run { + label = "wizfi630s:green:run"; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + }; + + ledwps { + label = "wizfi630s:green:wps"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + }; + + leduart1 { + label = "wizfi630s:green:uart1"; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + }; + + leduart2 { + label = "wizfi630s:green:uart2"; + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + + scm1 { + label = "SCM1"; + gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + scm2 { + label = "SCM2"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "gpio"; + ralink,function = "gpio"; + }; + + i2s { + ralink,group = "i2s"; + ralink,function = "gpio"; + }; + + wdt { + ralink,group = "wdt"; + ralink,function = "gpio"; + }; + + + i2c { + ralink,group = "i2c"; + ralink,function = "gpio"; + }; + + refclk { + ralink,group = "refclk"; + ralink,function = "gpio"; + }; + }; +}; + +&wmac { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + m25p,chunked-io = <31>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x1fb0000>; + }; + }; + }; +}; + +&i2c { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&pwm { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&esw { + mediatek,portmap = <0x3e>; +}; + +&sdhci { + status = "okay"; + mediatek,cd-high; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/WL-330N.dts b/target/linux/ramips/dts/WL-330N.dts index e747d6097..ee0cd0ad1 100644 --- a/target/linux/ramips/dts/WL-330N.dts +++ b/target/linux/ramips/dts/WL-330N.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; link { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WL-330N3G.dts b/target/linux/ramips/dts/WL-330N3G.dts index c562d9510..235c90fc4 100644 --- a/target/linux/ramips/dts/WL-330N3G.dts +++ b/target/linux/ramips/dts/WL-330N3G.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; 3g { @@ -35,7 +35,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WL-351.dts b/target/linux/ramips/dts/WL-351.dts index aefb4c74a..1b31bda73 100644 --- a/target/linux/ramips/dts/WL-351.dts +++ b/target/linux/ramips/dts/WL-351.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -72,7 +72,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WL-WN570HA1.dts b/target/linux/ramips/dts/WL-WN570HA1.dts index 14ca11560..a07490b85 100644 --- a/target/linux/ramips/dts/WL-WN570HA1.dts +++ b/target/linux/ramips/dts/WL-WN570HA1.dts @@ -17,7 +17,7 @@ reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -28,7 +28,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power { @@ -92,7 +92,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WL-WN575A3.dts b/target/linux/ramips/dts/WL-WN575A3.dts index deeb7bbfb..76923d5cf 100644 --- a/target/linux/ramips/dts/WL-WN575A3.dts +++ b/target/linux/ramips/dts/WL-WN575A3.dts @@ -17,7 +17,7 @@ reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -34,7 +34,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wifi-high { @@ -62,7 +62,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "i2c", "wled_an"; + ralink,group = "i2c", "wled_an", "gpio", "refclk", "wdt", "p0led_an"; ralink,function = "gpio"; }; }; @@ -83,11 +83,10 @@ &spi0 { status = "okay"; - m25p80@0 { + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; @@ -123,10 +122,9 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x4>; }; ðernet { - mtd-mac-address = <&factory 0x2e>; + mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/WLI-TX4-AG300N.dts b/target/linux/ramips/dts/WLI-TX4-AG300N.dts index 4a55a9212..dcd30eb60 100644 --- a/target/linux/ramips/dts/WLI-TX4-AG300N.dts +++ b/target/linux/ramips/dts/WLI-TX4-AG300N.dts @@ -55,7 +55,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -78,7 +78,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; diag { diff --git a/target/linux/ramips/dts/WLR-6000.dts b/target/linux/ramips/dts/WLR-6000.dts index 2eeb4748b..2b1f70765 100644 --- a/target/linux/ramips/dts/WLR-6000.dts +++ b/target/linux/ramips/dts/WLR-6000.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -27,7 +27,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/WMR-300.dts b/target/linux/ramips/dts/WMR-300.dts index 3b4551107..f0f1cc133 100644 --- a/target/linux/ramips/dts/WMR-300.dts +++ b/target/linux/ramips/dts/WMR-300.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status; }; - gpio-leds { + leds { compatible = "gpio-leds"; aoss1 { @@ -35,7 +35,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WN-AC1167GR.dts b/target/linux/ramips/dts/WN-AC1167GR.dts new file mode 100644 index 000000000..14c851a3a --- /dev/null +++ b/target/linux/ramips/dts/WN-AC1167GR.dts @@ -0,0 +1,216 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "iodata,wn-ac1167gr", "ralink,mt7620a-soc"; + model = "I-O DATA WN-AC1167GR"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "wn-ac1167gr:green:power"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "wn-ac1167gr:green:wlan2g"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + + notification { + label = "wn-ac1167gr:green:notification"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "wn-ac1167gr:green:wlan5g"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + wps { + label = "wps"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + auto { + label = "auto"; + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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 0x8000>; + read-only; + }; + + iNIC_rf: partition@48000 { + label = "iNIC_rf"; + reg = <0x48000 0x8000>; + read-only; + }; + + partition@50000 { + label = "NoUsed"; + reg = <0x50000 0x20000>; + read-only; + }; + + partition@70000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x70000 0x6b4000>; + }; + + partition@724000 { + label = "manufacture"; + reg = <0x724000 0x8c000>; + read-only; + }; + + partition@7b0000 { + label = "backup"; + reg = <0x7b0000 0x10000>; + read-only; + }; + + partition@7c0000 { + label = "storage"; + reg = <0x7c0000 0x40000>; + read-only; + }; + }; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii1_pins &mdio_pins>; + mtd-mac-address = <&Factory 0x4>; + + port@5 { + status = "okay"; + mediatek,fixed-link = <1000 1 1 1>; + phy-mode = "rgmii"; + }; + + mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + }; + + ethernet-phy@1 { + reg = <1>; + phy-mode = "rgmii"; + }; + + ethernet-phy@2 { + reg = <2>; + phy-mode = "rgmii"; + }; + + ethernet-phy@3 { + reg = <3>; + phy-mode = "rgmii"; + }; + + ethernet-phy@4 { + reg = <4>; + phy-mode = "rgmii"; + }; + + ethernet-phy@1f { + reg = <0x1f>; + phy-mode = "rgmii"; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "uartf"; + ralink,function = "gpio"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&iNIC_rf 0x0>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&wmac { + ralink,mtd-eeprom = <&Factory 0x0>; +}; diff --git a/target/linux/ramips/dts/WN-AC733GR3.dts b/target/linux/ramips/dts/WN-AC733GR3.dts new file mode 100644 index 000000000..ea837c4d3 --- /dev/null +++ b/target/linux/ramips/dts/WN-AC733GR3.dts @@ -0,0 +1,198 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "iodata,wn-ac733gr3", "ralink,mt7620a-soc"; + model = "I-O DATA WN-AC733GR3"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "wn-ac733gr3:green:power"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + notification { + label = "wn-ac733gr3:green:notification"; + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "wn-ac733gr3:green:wlan2g"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "wn-ac733gr3:green:wlan5g"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + router { + label = "router"; + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + auto { + label = "auto"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; + + rtl8367rb { + compatible = "realtek,rtl8367b"; + gpio-sda = <&gpio0 22 GPIO_ACTIVE_HIGH>; + gpio-sck = <&gpio0 23 GPIO_ACTIVE_HIGH>; + realtek,extif1 = <1 0 1 1 1 1 1 1 2>; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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 0x8000>; + read-only; + }; + + iNIC_rf: partition@48000 { + label = "iNIC_rf"; + reg = <0x48000 0x8000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x6d4000>; + }; + + partition@724000 { + label = "manufacture"; + reg = <0x724000 0x8c000>; + read-only; + }; + + partition@7b0000 { + label = "backup"; + reg = <0x7b0000 0x10000>; + read-only; + }; + + partition@7c0000 { + label = "storage"; + reg = <0x7c0000 0x40000>; + read-only; + }; + }; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii1_pins>; + mtd-mac-address = <&Factory 0x4>; + + port@5 { + status = "okay"; + mediatek,fixed-link = <1000 1 1 1>; + phy-mode = "rgmii"; + }; +}; + +&gpio0 { + rtl8367rb_reset { + gpio-hog; + gpios = <0 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "rtl8367rb-reset"; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "uartf", "mdio"; + ralink,function = "gpio"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&iNIC_rf 0x0>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&wmac { + ralink,mtd-eeprom = <&Factory 0x0>; +}; diff --git a/target/linux/ramips/dts/WN-AX1167GR.dts b/target/linux/ramips/dts/WN-AX1167GR.dts index 5163af167..cc7f7f240 100644 --- a/target/linux/ramips/dts/WN-AX1167GR.dts +++ b/target/linux/ramips/dts/WN-AX1167GR.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -39,7 +39,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -78,7 +78,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WN-GX300GR.dts b/target/linux/ramips/dts/WN-GX300GR.dts index 2fcfc9621..5399a4939 100644 --- a/target/linux/ramips/dts/WN-GX300GR.dts +++ b/target/linux/ramips/dts/WN-GX300GR.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -39,7 +39,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -78,7 +78,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WN3000RPV3.dts b/target/linux/ramips/dts/WN3000RPV3.dts index b22ce02d4..b067a4e44 100644 --- a/target/linux/ramips/dts/WN3000RPV3.dts +++ b/target/linux/ramips/dts/WN3000RPV3.dts @@ -22,7 +22,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power_green: power_g { @@ -72,7 +72,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WNCE2001.dts b/target/linux/ramips/dts/WNCE2001.dts index 0a578205e..3f0d93d8a 100644 --- a/target/linux/ramips/dts/WNCE2001.dts +++ b/target/linux/ramips/dts/WNCE2001.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power_green: power-green { @@ -44,7 +44,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WNDR3700V5.dts b/target/linux/ramips/dts/WNDR3700V5.dts index 92e7944f0..4ef0d70f1 100644 --- a/target/linux/ramips/dts/WNDR3700V5.dts +++ b/target/linux/ramips/dts/WNDR3700V5.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600 maxcpus=2"; }; - gpio-leds { + leds { compatible = "gpio-leds"; wps { @@ -39,7 +39,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -81,7 +81,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WR1200JS.dts b/target/linux/ramips/dts/WR1200JS.dts index 950a516a0..6fd087ca0 100644 --- a/target/linux/ramips/dts/WR1200JS.dts +++ b/target/linux/ramips/dts/WR1200JS.dts @@ -23,7 +23,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; internet { @@ -44,7 +44,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -75,7 +75,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WR1201.dts b/target/linux/ramips/dts/WR1201.dts index be2071749..08c9b2c18 100644 --- a/target/linux/ramips/dts/WR1201.dts +++ b/target/linux/ramips/dts/WR1201.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -51,7 +51,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -70,7 +70,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WR512-3GN.dtsi b/target/linux/ramips/dts/WR512-3GN.dtsi index f0612ab0b..5761b8b53 100644 --- a/target/linux/ramips/dts/WR512-3GN.dtsi +++ b/target/linux/ramips/dts/WR512-3GN.dtsi @@ -13,7 +13,7 @@ led-upgrade = &led_wps; }; - gpio-leds { + leds { compatible = "gpio-leds"; 3g { @@ -42,7 +42,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WR6202.dts b/target/linux/ramips/dts/WR6202.dts index b1030f5ae..26ec6de8f 100644 --- a/target/linux/ramips/dts/WR6202.dts +++ b/target/linux/ramips/dts/WR6202.dts @@ -13,7 +13,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; wps { @@ -27,7 +27,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WRC-1167GHBK2-S.dts b/target/linux/ramips/dts/WRC-1167GHBK2-S.dts index 4f0427050..9587b3769 100644 --- a/target/linux/ramips/dts/WRC-1167GHBK2-S.dts +++ b/target/linux/ramips/dts/WRC-1167GHBK2-S.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; wlan2g { @@ -59,7 +59,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -88,7 +88,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WRH-300CR.dts b/target/linux/ramips/dts/WRH-300CR.dts index 828200b68..eb6dbe6d1 100644 --- a/target/linux/ramips/dts/WRH-300CR.dts +++ b/target/linux/ramips/dts/WRH-300CR.dts @@ -16,7 +16,7 @@ led-upgrade = &led_wps; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_wps: wps { @@ -35,7 +35,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WRTNODE.dts b/target/linux/ramips/dts/WRTNODE.dts index e4cc3c587..a80881820 100644 --- a/target/linux/ramips/dts/WRTNODE.dts +++ b/target/linux/ramips/dts/WRTNODE.dts @@ -15,7 +15,7 @@ led-upgrade = &led_indicator; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_indicator: indicator { diff --git a/target/linux/ramips/dts/WRTNODE2.dtsi b/target/linux/ramips/dts/WRTNODE2.dtsi index 6758d271f..9bac82287 100644 --- a/target/linux/ramips/dts/WRTNODE2.dtsi +++ b/target/linux/ramips/dts/WRTNODE2.dtsi @@ -10,7 +10,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -29,7 +29,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WRTNODE2P.dts b/target/linux/ramips/dts/WRTNODE2P.dts index 522df7cd9..cd668d601 100644 --- a/target/linux/ramips/dts/WRTNODE2P.dts +++ b/target/linux/ramips/dts/WRTNODE2P.dts @@ -13,7 +13,7 @@ led-upgrade = &led_indicator; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_indicator: indicator { diff --git a/target/linux/ramips/dts/WRTNODE2R.dts b/target/linux/ramips/dts/WRTNODE2R.dts index ee1e2f91b..bfe533c0c 100644 --- a/target/linux/ramips/dts/WRTNODE2R.dts +++ b/target/linux/ramips/dts/WRTNODE2R.dts @@ -13,9 +13,12 @@ led-upgrade = &led_indicator; }; - gpio-leds { + leds { compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins>; + led_indicator: indicator { label = "wrtnode:blue:indicator"; gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; @@ -26,7 +29,14 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "i2c", "gpio", "wled_an"; + ralink,group = "gpio"; + ralink,function = "gpio"; + }; + }; + + led_pins: led { + gpio { + ralink,group = "wled_an"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/WSR-1166.dts b/target/linux/ramips/dts/WSR-1166.dts index bb0574535..ff033c41e 100644 --- a/target/linux/ramips/dts/WSR-1166.dts +++ b/target/linux/ramips/dts/WSR-1166.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; internet_g { @@ -69,7 +69,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -126,7 +126,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WSR-600.dts b/target/linux/ramips/dts/WSR-600.dts index 7eb75b964..0cdd79cdd 100644 --- a/target/linux/ramips/dts/WSR-600.dts +++ b/target/linux/ramips/dts/WSR-600.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -69,7 +69,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -126,7 +126,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/WT1520.dtsi b/target/linux/ramips/dts/WT1520.dtsi index 1a383876a..28d498bc8 100644 --- a/target/linux/ramips/dts/WT1520.dtsi +++ b/target/linux/ramips/dts/WT1520.dtsi @@ -11,7 +11,7 @@ reg = <0x0 0x2000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/WT3020.dtsi b/target/linux/ramips/dts/WT3020.dtsi index 67ded65bd..59558a2e9 100644 --- a/target/linux/ramips/dts/WT3020.dtsi +++ b/target/linux/ramips/dts/WT3020.dtsi @@ -13,7 +13,7 @@ led-upgrade = &led_power; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -24,7 +24,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/WZR-AGL300NH.dts b/target/linux/ramips/dts/WZR-AGL300NH.dts index ba42d2591..c6a90d426 100644 --- a/target/linux/ramips/dts/WZR-AGL300NH.dts +++ b/target/linux/ramips/dts/WZR-AGL300NH.dts @@ -61,7 +61,7 @@ gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <100>; @@ -84,7 +84,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_router: router { diff --git a/target/linux/ramips/dts/X5.dts b/target/linux/ramips/dts/X5.dts index 2cb53facb..7e3d8b6f0 100644 --- a/target/linux/ramips/dts/X5.dts +++ b/target/linux/ramips/dts/X5.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -40,7 +40,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/X8.dts b/target/linux/ramips/dts/X8.dts index 8edf4f703..3b6d60478 100644 --- a/target/linux/ramips/dts/X8.dts +++ b/target/linux/ramips/dts/X8.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -25,7 +25,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/XDXRN502J.dts b/target/linux/ramips/dts/XDXRN502J.dts index 7b33fcb3d..0cab20f8f 100644 --- a/target/linux/ramips/dts/XDXRN502J.dts +++ b/target/linux/ramips/dts/XDXRN502J.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wifi { @@ -67,7 +67,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/Y1.dts b/target/linux/ramips/dts/Y1.dts index 1538ba92c..87eb1bf4c 100644 --- a/target/linux/ramips/dts/Y1.dts +++ b/target/linux/ramips/dts/Y1.dts @@ -13,7 +13,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { diff --git a/target/linux/ramips/dts/Y1.dtsi b/target/linux/ramips/dts/Y1.dtsi index 9d171adbe..5d6c9922f 100644 --- a/target/linux/ramips/dts/Y1.dtsi +++ b/target/linux/ramips/dts/Y1.dtsi @@ -10,7 +10,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/Y1S.dts b/target/linux/ramips/dts/Y1S.dts index d2b917e80..6cdf0b5cd 100644 --- a/target/linux/ramips/dts/Y1S.dts +++ b/target/linux/ramips/dts/Y1S.dts @@ -34,7 +34,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power1 { diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts b/target/linux/ramips/dts/YOUKU-YK1.dts index 82540fb8d..5d90b17a0 100644 --- a/target/linux/ramips/dts/YOUKU-YK1.dts +++ b/target/linux/ramips/dts/YOUKU-YK1.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { label = "youku-yk1:blue:wan"; @@ -38,7 +38,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset { @@ -69,9 +69,10 @@ status = "okay"; m25p80@0 { - compatible = "jedec,spi-nor"; + compatible = "mx25l25635f", "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <10000000>; + spi-max-frequency = <25000000>; + m25p,fast-read; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/YOUKU-YK2.dts b/target/linux/ramips/dts/YOUKU-YK2.dts new file mode 100644 index 000000000..55fdf2f22 --- /dev/null +++ b/target/linux/ramips/dts/YOUKU-YK2.dts @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "youku,yk-l2", "mediatek,mt7621-soc"; + model = "Youku YK-L2"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_wps; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "yk-l2:blue:power"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led_wps: wps { + label = "yk-l2:blue:wps"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "yk-l2:blue:usb"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>; + linux,default-trigger = "usbport"; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&sdhci { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "pci14c3,7603"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + led { + led-active-low; + }; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "pci14c3,7662"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + led { + led-sources = <2>; + led-active-low; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "jtag", "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/ZBT-APE522II.dts b/target/linux/ramips/dts/ZBT-APE522II.dts index 231c1fd12..70ad0f0b5 100644 --- a/target/linux/ramips/dts/ZBT-APE522II.dts +++ b/target/linux/ramips/dts/ZBT-APE522II.dts @@ -13,7 +13,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; sys1 { @@ -42,7 +42,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ZBT-CPE102.dts b/target/linux/ramips/dts/ZBT-CPE102.dts index fce33e075..6f0213bf7 100644 --- a/target/linux/ramips/dts/ZBT-CPE102.dts +++ b/target/linux/ramips/dts/ZBT-CPE102.dts @@ -19,7 +19,7 @@ led-failsafe = &led_4g_0; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_4g_0: 4g-0 { @@ -38,7 +38,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ZBT-WA05.dts b/target/linux/ramips/dts/ZBT-WA05.dts index 417989468..21b56dcae 100644 --- a/target/linux/ramips/dts/ZBT-WA05.dts +++ b/target/linux/ramips/dts/ZBT-WA05.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -41,7 +41,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ZBT-WE1226.dts b/target/linux/ramips/dts/ZBT-WE1226.dts index 1a1a986eb..aace0042e 100644 --- a/target/linux/ramips/dts/ZBT-WE1226.dts +++ b/target/linux/ramips/dts/ZBT-WE1226.dts @@ -24,7 +24,7 @@ reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -35,7 +35,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -76,7 +76,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/ZBT-WE1326.dts b/target/linux/ramips/dts/ZBT-WE1326.dts index 8b1311480..0bb8b91be 100644 --- a/target/linux/ramips/dts/ZBT-WE1326.dts +++ b/target/linux/ramips/dts/ZBT-WE1326.dts @@ -18,7 +18,7 @@ reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -46,7 +46,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/ZBT-WE2026.dts b/target/linux/ramips/dts/ZBT-WE2026.dts index 30ed4f785..be8d13be9 100644 --- a/target/linux/ramips/dts/ZBT-WE2026.dts +++ b/target/linux/ramips/dts/ZBT-WE2026.dts @@ -20,7 +20,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -34,7 +34,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ZBT-WE3526.dts b/target/linux/ramips/dts/ZBT-WE3526.dts index ed86249bc..30c941c9c 100644 --- a/target/linux/ramips/dts/ZBT-WE3526.dts +++ b/target/linux/ramips/dts/ZBT-WE3526.dts @@ -24,7 +24,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -47,7 +47,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/ZBT-WE826.dtsi b/target/linux/ramips/dts/ZBT-WE826.dtsi index 4fa81b73e..0776ea7a7 100644 --- a/target/linux/ramips/dts/ZBT-WE826.dtsi +++ b/target/linux/ramips/dts/ZBT-WE826.dtsi @@ -17,7 +17,7 @@ bootargs = "console=ttyS0,115200"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { label = "zbt-we826:green:power"; @@ -35,7 +35,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; reset { diff --git a/target/linux/ramips/dts/ZBT-WG2626.dts b/target/linux/ramips/dts/ZBT-WG2626.dts index 938a14455..4ceee9bd6 100644 --- a/target/linux/ramips/dts/ZBT-WG2626.dts +++ b/target/linux/ramips/dts/ZBT-WG2626.dts @@ -31,7 +31,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -42,7 +42,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -63,7 +63,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/ZBT-WG3526.dtsi b/target/linux/ramips/dts/ZBT-WG3526.dtsi index 13443e0ff..0cf94d57d 100644 --- a/target/linux/ramips/dts/ZBT-WG3526.dtsi +++ b/target/linux/ramips/dts/ZBT-WG3526.dtsi @@ -28,7 +28,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -39,7 +39,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_status: status { @@ -60,7 +60,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/ZBT-WR8305RT.dts b/target/linux/ramips/dts/ZBT-WR8305RT.dts index eafe778cf..5292c70db 100644 --- a/target/linux/ramips/dts/ZBT-WR8305RT.dts +++ b/target/linux/ramips/dts/ZBT-WR8305RT.dts @@ -16,7 +16,7 @@ led-upgrade = &led_sys; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_sys: sys { @@ -37,7 +37,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ZL5900V2.dts b/target/linux/ramips/dts/ZL5900V2.dts index 026a524b3..d5d0ca372 100644 --- a/target/linux/ramips/dts/ZL5900V2.dts +++ b/target/linux/ramips/dts/ZL5900V2.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/ZTE-Q7.dts b/target/linux/ramips/dts/ZTE-Q7.dts index 51f912244..5b4c5ee04 100644 --- a/target/linux/ramips/dts/ZTE-Q7.dts +++ b/target/linux/ramips/dts/ZTE-Q7.dts @@ -16,7 +16,7 @@ led-upgrade = &led_status_blue; }; - gpio-leds { + leds { compatible = "gpio-leds"; statred { @@ -30,7 +30,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/elecom_wrc-gst.dtsi b/target/linux/ramips/dts/elecom_wrc-gst.dtsi index eb06b0478..40f16adb8 100644 --- a/target/linux/ramips/dts/elecom_wrc-gst.dtsi +++ b/target/linux/ramips/dts/elecom_wrc-gst.dtsi @@ -23,7 +23,7 @@ bootargs = "console=ttyS0,57600"; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power_green: power_green { @@ -47,7 +47,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -104,7 +104,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/ki_rb.dts b/target/linux/ramips/dts/ki_rb.dts index 818b4f8a0..56912a786 100644 --- a/target/linux/ramips/dts/ki_rb.dts +++ b/target/linux/ramips/dts/ki_rb.dts @@ -25,7 +25,7 @@ bootargs = "console=ttyS0,57600n8"; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -48,7 +48,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -94,7 +94,6 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/kn.dts b/target/linux/ramips/dts/kn.dts index 3619aae60..1f9928e59 100644 --- a/target/linux/ramips/dts/kn.dts +++ b/target/linux/ramips/dts/kn.dts @@ -53,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_power: power { @@ -74,7 +74,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/kn_rc.dts b/target/linux/ramips/dts/kn_rc.dts index 90f740c13..74396d1fc 100644 --- a/target/linux/ramips/dts/kn_rc.dts +++ b/target/linux/ramips/dts/kn_rc.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -42,7 +42,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/kn_rf.dts b/target/linux/ramips/dts/kn_rf.dts index aaa98e8bc..765629548 100644 --- a/target/linux/ramips/dts/kn_rf.dts +++ b/target/linux/ramips/dts/kn_rf.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -42,7 +42,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/kn_st.dts b/target/linux/ramips/dts/kn_st.dts new file mode 100644 index 000000000..16ab9567c --- /dev/null +++ b/target/linux/ramips/dts/kn_st.dts @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "rt5350.dtsi" + +#include +#include + +/ { + compatible = "zyxel,keenetic-start", "ralink,rt5350-soc"; + model = "ZyXEL Keenetic Start"; + + aliases { + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + leds { + compatible = "gpio-leds"; + + led_status: power { + label = "zyxel:green:power"; + gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; + }; + + internet { + label = "zyxel:green:internet"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x3b0000>; + }; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "jtag", "uartf"; + ralink,function = "gpio"; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + + +&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/kng_rc.dts b/target/linux/ramips/dts/kng_rc.dts index e8b152226..3d6d2c6f0 100644 --- a/target/linux/ramips/dts/kng_rc.dts +++ b/target/linux/ramips/dts/kng_rc.dts @@ -16,7 +16,7 @@ led-upgrade = &led_power_green; }; - gpio-leds { + leds { compatible = "gpio-leds"; wan { @@ -47,7 +47,7 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys"; poll-interval = <20>; diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi index 91f715c24..61016c8b4 100644 --- a/target/linux/ramips/dts/mt7628an.dtsi +++ b/target/linux/ramips/dts/mt7628an.dtsi @@ -232,6 +232,7 @@ pwm: pwm@5000 { compatible = "mediatek,mt7628-pwm"; reg = <0x5000 0x1000>; + #pwm-cells = <2>; resets = <&rstctrl 31>; reset-names = "pwm"; diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_offload.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_offload.c index 6e814ad72..6c23bbc03 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_offload.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_offload.c @@ -119,11 +119,11 @@ mtk_foe_set_mac(struct mtk_foe_entry *entry, u8 *smac, u8 *dmac) } static int -mtk_check_hashcollision(struct mtk_eth *eth, u32 hash) +mtk_check_entry_available(struct mtk_eth *eth, u32 hash) { struct mtk_foe_entry entry = ((struct mtk_foe_entry *)eth->foe_table)[hash]; - return (entry.bfib1.state != BIND)? 0:1; + return (entry.bfib1.state == BIND)? 0:1; } static void @@ -156,6 +156,12 @@ int mtk_flow_offload(struct mtk_eth *eth, if (otuple->l4proto != IPPROTO_TCP && otuple->l4proto != IPPROTO_UDP) return -EINVAL; + + if (type == FLOW_OFFLOAD_DEL) { + flow = NULL; + synchronize_rcu(); + return 0; + } switch (otuple->l3proto) { case AF_INET: @@ -174,30 +180,25 @@ int mtk_flow_offload(struct mtk_eth *eth, return -EINVAL; } - if (type == FLOW_OFFLOAD_DEL) { - orig.bfib1.state = INVALID; - reply.bfib1.state = INVALID; - flow = NULL; - goto write; + /* Two-way hash: when hash collision occurs, the hash value will be shifted to the next position. */ + if (!mtk_check_entry_available(eth, ohash)){ + if (!mtk_check_entry_available(eth, ohash + 1)) + return -EINVAL; + ohash += 1; + } + if (!mtk_check_entry_available(eth, rhash)){ + if (!mtk_check_entry_available(eth, rhash + 1)) + return -EINVAL; + rhash += 1; } - /* Two-way hash: when hash collision occurs, the hash value will be shifted to the next position. */ - if(mtk_check_hashcollision(eth, ohash)) - ohash += 1; - if(mtk_check_hashcollision(eth, rhash)) - rhash += 1; mtk_foe_set_mac(&orig, dest->eth_src, dest->eth_dest); mtk_foe_set_mac(&reply, src->eth_src, src->eth_dest); - -write: mtk_foe_write(eth, ohash, &orig); mtk_foe_write(eth, rhash, &reply); rcu_assign_pointer(eth->foe_flow_table[ohash], flow); rcu_assign_pointer(eth->foe_flow_table[rhash], flow); - if (type == FLOW_OFFLOAD_DEL) - synchronize_rcu(); - return 0; } @@ -383,8 +384,8 @@ static int mtk_ppe_start(struct mtk_eth *eth) mtk_w32(eth, 0x55555555, MTK_REG_PPE_DFT_CPORT); #endif - /* drop packets with TTL=0 */ - mtk_m32(eth, 0, MTK_PPE_GLO_CFG_TTL0_DROP, MTK_REG_PPE_GLO_CFG); + /* allow packets with TTL=0 */ + mtk_m32(eth, MTK_PPE_GLO_CFG_TTL0_DROP, 0, MTK_REG_PPE_GLO_CFG); /* send all traffic from gmac to the ppe */ mtk_m32(eth, 0xffff, 0x4444, MTK_GDMA_FWD_CFG(0)); diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 33c4f3132..6eef596ca 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -114,6 +114,7 @@ define Build/mkdlinkfw -k $(IMAGE_KERNEL) \ -r $(IMAGE_ROOTFS) \ -o $@ \ + $(if $(DLINK_IMAGE_OFFSET), -O $(DLINK_IMAGE_OFFSET)) \ -s $(DLINK_FIRMWARE_SIZE) endef @@ -122,6 +123,7 @@ define Build/mkdlinkfw-factory -m $(DLINK_ROM_ID) -f $(DLINK_FAMILY_MEMBER) \ -F $@ \ -o $@.new \ + $(if $(DLINK_IMAGE_OFFSET), -O $(DLINK_IMAGE_OFFSET)) \ -s $(DLINK_FIRMWARE_SIZE) mv $@.new $@ endef diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index f646437d7..da90568df 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -3,7 +3,7 @@ # DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION \ - DLINK_ROM_ID DLINK_FAMILY_MEMBER DLINK_FIRMWARE_SIZE + DLINK_ROM_ID DLINK_FAMILY_MEMBER DLINK_FIRMWARE_SIZE DLINK_IMAGE_OFFSET define Build/elecom-header cp $@ $(KDIR)/v_0.0.0.bin @@ -16,6 +16,25 @@ define Build/elecom-header -f $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5 endef +define Build/elx-header + $(eval hw_id=$(word 1,$(1))) + $(eval xor_pattern=$(word 2,$(1))) + ( \ + echo -ne "\x00\x00\x00\x00\x00\x00\x00\x03" | \ + dd bs=42 count=1 conv=sync; \ + hw_id="$(hw_id)"; \ + echo -ne "\x$${hw_id:0:2}\x$${hw_id:2:2}\x$${hw_id:4:2}\x$${hw_id:6:2}" | \ + dd bs=20 count=1 conv=sync; \ + echo -ne "$$(printf '%08x' $$(stat -c%s $@) | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \ + dd bs=8 count=1 conv=sync; \ + echo -ne "$$($(STAGING_DIR_HOST)/bin/mkhash md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \ + dd bs=58 count=1 conv=sync; \ + ) > $(KDIR)/tmp/$(DEVICE_NAME).header + $(call Build/xor-image,-p $(xor_pattern) -x) + cat $(KDIR)/tmp/$(DEVICE_NAME).header $@ > $@.new + mv $@.new $@ +endef + define Device/ai-br100 DTS := AI-BR100 IMAGE_SIZE := 7936k @@ -32,6 +51,24 @@ define Device/alfa-network_ac1200rm endef TARGET_DEVICES += alfa-network_ac1200rm +define Device/alfa-network_tube-e4g + DTS := TUBE-E4G + IMAGE_SIZE := 16064k + DEVICE_TITLE := ALFA Network Tube-E4G + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci uboot-envtools uqmi \ + -iwinfo -kmod-rt2800-pci -kmod-rt2800-soc -wpad-basic +endef +TARGET_DEVICES += alfa-network_tube-e4g + +define Device/amit_jboot + DLINK_IMAGE_OFFSET := 0x10000 + KERNEL := $(KERNEL_DTB) + IMAGES += factory.bin + IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata + IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory + DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-usb-ohci +endef + define Device/Archer TPLINK_HWREVADD := 0 TPLINK_HVERSION := 3 @@ -153,61 +190,59 @@ define Device/dir-810l endef TARGET_DEVICES += dir-810l +define Device/dlink_dir-510l + $(Device/amit_jboot) + DTS := DIR-510L + DEVICE_TITLE := D-Link DIR-510L + DEVICE_PACKAGES += kmod-mt76x0e + DLINK_ROM_ID := DLK6E3805001 + DLINK_FAMILY_MEMBER := 0x6E38 + DLINK_FIRMWARE_SIZE := 0xDE0000 + DLINK_IMAGE_OFFSET := 0x210000 +endef +TARGET_DEVICES += dlink_dir-510l + define Device/dlink_dwr-116-a1 + $(Device/amit_jboot) DTS := DWR-116-A1 DEVICE_TITLE := D-Link DWR-116 A1/A2 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci jboot-tools DLINK_ROM_ID := DLK6E3803001 DLINK_FAMILY_MEMBER := 0x6E38 DLINK_FIRMWARE_SIZE := 0x7E0000 - KERNEL := $(KERNEL_DTB) - IMAGES += factory.bin - IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata - IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory endef TARGET_DEVICES += dlink_dwr-116-a1 define Device/dlink_dwr-118-a1 + $(Device/amit_jboot) DTS := DWR-118-A1 DEVICE_TITLE := D-Link DWR-118 A1 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci jboot-tools kmod-mt76x0e + DEVICE_PACKAGES += kmod-mt76x0e DLINK_ROM_ID := DLK6E3811001 DLINK_FAMILY_MEMBER := 0x6E38 DLINK_FIRMWARE_SIZE := 0xFE0000 - KERNEL := $(KERNEL_DTB) - IMAGES += factory.bin - IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata - IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory endef TARGET_DEVICES += dlink_dwr-118-a1 define Device/dlink_dwr-118-a2 + $(Device/amit_jboot) DTS := DWR-118-A2 DEVICE_TITLE := D-Link DWR-118 A2 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci jboot-tools + DEVICE_PACKAGES += kmod-mt76x2 DLINK_ROM_ID := DLK6E3814001 DLINK_FAMILY_MEMBER := 0x6E38 DLINK_FIRMWARE_SIZE := 0xFE0000 - KERNEL := $(KERNEL_DTB) - IMAGES += factory.bin - IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata - IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory endef TARGET_DEVICES += dlink_dwr-118-a2 define Device/dlink_dwr-921-c1 + $(Device/amit_jboot) DTS := DWR-921-C1 IMAGE_SIZE := $(ralink_default_fw_size_16M) DEVICE_TITLE := D-Link DWR-921 C1 DLINK_ROM_ID := DLK6E2414001 DLINK_FAMILY_MEMBER := 0x6E24 DLINK_FIRMWARE_SIZE := 0xFE0000 - KERNEL := $(KERNEL_DTB) - IMAGES += factory.bin - IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata - IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory - DEVICE_PACKAGES := jboot-tools \ - kmod-usb2 kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi + DEVICE_PACKAGES += kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi endef TARGET_DEVICES += dlink_dwr-921-c1 @@ -220,18 +255,14 @@ endef TARGET_DEVICES += dlink_dwr-921-c3 define Device/dlink_dwr-922-e2 + $(Device/amit_jboot) DTS := DWR-922-E2 IMAGE_SIZE := $(ralink_default_fw_size_16M) DEVICE_TITLE := D-Link DWR-922 E2 DLINK_ROM_ID := DLK6E2414005 DLINK_FAMILY_MEMBER := 0x6E24 DLINK_FIRMWARE_SIZE := 0xFE0000 - KERNEL := $(KERNEL_DTB) - IMAGES += factory.bin - IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata - IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory - DEVICE_PACKAGES := jboot-tools \ - kmod-usb2 kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi + DEVICE_PACKAGES += kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi endef TARGET_DEVICES += dlink_dwr-922-e2 @@ -327,6 +358,30 @@ define Device/hc5861 endef TARGET_DEVICES += hc5861 +define Device/iodata_wn-ac1167gr + DTS := WN-AC1167GR + DEVICE_TITLE := I-O DATA WN-AC1167GR + IMAGE_SIZE := 6864k + IMAGES += factory.bin + IMAGE/factory.bin := \ + $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + elx-header 01040016 8844A2D168B45A2D + DEVICE_PACKAGES := kmod-mt76x2 +endef +TARGET_DEVICES += iodata_wn-ac1167gr + +define Device/iodata_wn-ac733gr3 + DTS := WN-AC733GR3 + DEVICE_TITLE := I-O DATA WN-AC733GR3 + IMAGE_SIZE := 6992k + IMAGES += factory.bin + IMAGE/factory.bin := \ + $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + elx-header 01040006 8844A2D168B45A2D + DEVICE_PACKAGES := kmod-mt76x0e kmod-switch-rtl8367b +endef +TARGET_DEVICES += iodata_wn-ac733gr3 + define Device/kimax_u35wf DTS := U35WF IMAGE_SIZE := 16064k @@ -378,16 +433,13 @@ endef TARGET_DEVICES += microwrt define Device/lava_lr-25g001 + $(Device/amit_jboot) DTS := LR-25G001 DEVICE_TITLE := LAVA LR-25G001 DLINK_ROM_ID := LVA6E3804001 DLINK_FAMILY_MEMBER := 0x6E38 DLINK_FIRMWARE_SIZE := 0xFE0000 - KERNEL := $(KERNEL_DTB) - IMAGES += factory.bin - IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata - IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory - DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-usb-ohci kmod-mt76x0e + DEVICE_PACKAGES += kmod-mt76x0e endef TARGET_DEVICES += lava_lr-25g001 @@ -431,6 +483,7 @@ TARGET_DEVICES += mt7620a_mt7530 define Device/mt7620a_mt7610e DTS := MT7620a_MT7610e DEVICE_TITLE := MediaTek MT7620a + MT7610e EVB + DEVICE_PACKAGES := kmod-mt76x0e SUPPORTED_DEVICES := mt7620a_mt7610e endef TARGET_DEVICES += mt7620a_mt7610e @@ -712,22 +765,6 @@ define Device/we1026-5g-16m endef TARGET_DEVICES += we1026-5g-16m -define Device/xiaomi_miwifi-r3 - DTS := MIWIFI-R3 - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 32768k - UBINIZE_OPTS := -E 5 - IMAGES += kernel1.bin rootfs0.bin - IMAGE/kernel1.bin := append-kernel | check-size $$$$(KERNEL_SIZE) - IMAGE/rootfs0.bin := append-ubi | check-size $$$$(IMAGE_SIZE) - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_TITLE := Xiaomi Mi Router R3 - DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci uboot-envtools -endef -TARGET_DEVICES += xiaomi_miwifi-r3 - define Device/zbt-ape522ii DTS := ZBT-APE522II DEVICE_TITLE := Zbtlink ZBT-APE522II diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 5798be96c..9e42404f6 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -88,7 +88,7 @@ define Device/11acnas DTS := 11ACNAS IMAGE_SIZE := $(ralink_default_fw_size_16M) DEVICE_TITLE := WeVO 11AC NAS Router - DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic endef TARGET_DEVICES += 11acnas @@ -235,7 +235,23 @@ define Device/k2p endef TARGET_DEVICES += k2p -define Device/mir3g +define Device/xiaomi_mir3p + DTS := MIR3P + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE:= 4096k + UBINIZE_OPTS := -E 5 + IMAGE_SIZE := $(ralink_default_fw_size_32M) + DEVICE_TITLE := Xiaomi Mi Router 3 Pro + IMAGES += factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE) + DEVICE_PACKAGES := \ + kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic uboot-envtools +endef +TARGET_DEVICES += xiaomi_mir3p + +define Device/xiaomi_mir3g DTS := MIR3G BLOCKSIZE := 128k PAGESIZE := 2048 @@ -248,31 +264,12 @@ define Device/mir3g IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata DEVICE_TITLE := Xiaomi Mi Router 3G SUPPORTED_DEVICES += R3G + SUPPORTED_DEVICES += mir3g DEVICE_PACKAGES := \ kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic \ uboot-envtools endef -TARGET_DEVICES += mir3g - -define Device/mir4 - DTS := MIR4 - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 32768k - UBINIZE_OPTS := -E 5 - IMAGES += kernel1.bin rootfs0.bin factory.bin - IMAGE/kernel1.bin := append-kernel - IMAGE/rootfs0.bin := append-ubi | check-size $$$$(IMAGE_SIZE) - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) |append-kernel | pad-to $$(KERNEL_SIZE)| append-ubi | check-size $$$$(IMAGE_SIZE) - DEVICE_TITLE := Xiaomi Mi Router 4 - SUPPORTED_DEVICES += R4 - DEVICE_PACKAGES := \ - kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-basic \ - uboot-envtools -endef -TARGET_DEVICES += mir4 +TARGET_DEVICES += xiaomi_mir3g define Device/mt7621 DTS := MT7621 @@ -302,7 +299,7 @@ TARGET_DEVICES += d-team_newifi-d2 define Device/pbr-m1 DTS := PBR-M1 - IMAGE_SIZE := $(ralink_default_fw_size_32M) + IMAGE_SIZE := $(ralink_default_fw_size_16M) DEVICE_TITLE := PBR-M1 DEVICE_PACKAGES := \ kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \ @@ -327,6 +324,17 @@ define Device/r6220 endef TARGET_DEVICES += r6220 +define Device/netgear_ex6150 + DTS := EX6150 + DEVICE_TITLE := Netgear EX6150 + DEVICE_PACKAGES := kmod-mt76x2 wpad-basic + NETGEAR_BOARD_ID := U12H318T00_NETGEAR + IMAGE_SIZE := 14848k + IMAGES += factory.chk + IMAGE/factory.chk := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | netgear-chk +endef +TARGET_DEVICES += netgear_ex6150 + define Device/netgear_r6350 DTS := R6350 BLOCKSIZE := 128k @@ -344,14 +352,6 @@ define Device/netgear_r6350 endef TARGET_DEVICES += netgear_r6350 -define Device/rb750gr3 - DTS := RB750Gr3 - IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := MikroTik RB750Gr3 - DEVICE_PACKAGES := kmod-usb3 uboot-envtools -endef -TARGET_DEVICES += rb750gr3 - define Device/MikroTik BLOCKSIZE := 64k IMAGE_SIZE := 16128k @@ -363,6 +363,14 @@ define Device/MikroTik append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef +define Device/mikrotik_rb750gr3 + $(Device/MikroTik) + DTS := RB750Gr3 + DEVICE_TITLE := MikroTik RouterBOARD RB750Gr3 + DEVICE_PACKAGES += kmod-gpio-beeper +endef +TARGET_DEVICES += mikrotik_rb750gr3 + define Device/mikrotik_rbm33g $(Device/MikroTik) DTS := RBM33G @@ -538,6 +546,15 @@ define Device/youhua_wr1200js endef TARGET_DEVICES += youhua_wr1200js +define Device/youku_yk-l2 + DTS := YOUKU-YK2 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Youku YK-L2 + DEVICE_PACKAGES := \ + kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic +endef +TARGET_DEVICES += youku_yk-l2 + define Device/wsr-1166 DTS := WSR-1166 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 3a2d8e3a5..571ddf3d5 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -2,17 +2,22 @@ # MT76x8 Profiles # -DEVICE_VARS += SERCOMM_KERNEL_OFFSET SERCOMM_HWID SERCOMM_HWVER SERCOMM_SWVER +DEVICE_VARS += SERCOMM_HWID SERCOMM_HWVER SERCOMM_SWVER -define Build/mksercommfw +define Build/sercom-seal $(STAGING_DIR_HOST)/bin/mksercommfw \ - $@ \ - $(SERCOMM_KERNEL_OFFSET) \ - $(SERCOMM_HWID) \ - $(SERCOMM_HWVER) \ - $(SERCOMM_SWVER) + -i $@ \ + -b $(SERCOMM_HWID) \ + -r $(SERCOMM_HWVER) \ + -v $(SERCOMM_SWVER) \ + $(1) endef +define Build/sercom-footer + $(call Build/sercom-seal,-f) +endef + + define Device/tplink TPLINK_FLASHLAYOUT := TPLINK_HWID := @@ -61,6 +66,14 @@ define Device/gl-mt300n-v2 endef TARGET_DEVICES += gl-mt300n-v2 +define Device/glinet_vixmini + DTS := VIXMINI + IMAGE_SIZE := 7872k + DEVICE_TITLE := GL.iNet VIXMINI + SUPPORTED_DEVICES += vixmini +endef +TARGET_DEVICES += glinet_vixmini + define Device/hc5661a DTS := HC5661A IMAGE_SIZE := $(ralink_default_fw_size_16M) @@ -114,16 +127,16 @@ define Device/netgear_r6120 DTS := R6120 BLOCKSIZE := 64k IMAGE_SIZE := $(ralink_default_fw_size_16M) - DEVICE_TITLE := Netgear AC1200 R6120 + DEVICE_TITLE := Netgear R6120 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci - SERCOMM_KERNEL_OFFSET := 0x90000 SERCOMM_HWID := CGQ SERCOMM_HWVER := A001 SERCOMM_SWVER := 0x0040 IMAGES += factory.img IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE)| append-rootfs | pad-rootfs IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory.img := $$(IMAGE/default) | mksercommfw + IMAGE/factory.img := pad-extra 576k | $$(IMAGE/default) | \ + sercom-footer | pad-to 128 | zip R6120.bin | sercom-seal endef TARGET_DEVICES += netgear_r6120 @@ -151,6 +164,13 @@ define Device/pbr-d1 endef TARGET_DEVICES += pbr-d1 +define Device/rakwireless_rak633 + DTS := RAK633 + DEVICE_TITLE := Rakwireless RAK633 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += rakwireless_rak633 + define Device/skylab_skw92a DTS := SKW92A IMAGE_SIZE := 16064k @@ -172,6 +192,19 @@ define Device/tplink_tl-wa801nd-v5 endef TARGET_DEVICES += tplink_tl-wa801nd-v5 +define Device/tplink_tl-wr802n-v4 + $(Device/tplink) + DTS := TL-WR802NV4 + IMAGE_SIZE := 7808k + DEVICE_TITLE := TP-Link TL-WR802N v4 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x08020004 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x4 + TPLINK_HVERSION := 3 +endef +TARGET_DEVICES += tplink_tl-wr802n-v4 + define Device/tl-wr840n-v4 $(Device/tplink) DTS := TL-WR840NV4 @@ -242,6 +275,21 @@ define Device/tplink_c50-v3 endef TARGET_DEVICES += tplink_c50-v3 +define Device/tplink_c50-v4 + $(Device/tplink) + DTS := ArcherC50V4 + IMAGE_SIZE := 7616k + DEVICE_TITLE := TP-Link ArcherC50 v4 + TPLINK_FLASHLAYOUT := 8MSUmtk + TPLINK_HWID := 0x001D589B + TPLINK_HWREV := 0x93 + TPLINK_HWREVADD := 0x2 + TPLINK_HVERSION := 3 + DEVICE_PACKAGES := kmod-mt76x2 + IMAGES := sysupgrade.bin +endef +TARGET_DEVICES += tplink_c50-v4 + define Device/tplink_tl-mr3020-v3 $(Device/tplink) DTS := TL-MR3020V3 @@ -332,6 +380,15 @@ define Device/wavlink_wl-wn570ha1 endef TARGET_DEVICES += wavlink_wl-wn570ha1 +define Device/wavlink_wl-wn575a3 + DTS := WL-WN575A3 + IMAGE_SIZE := $(ralink_default_fw_size_8M) + DEVICE_TITLE := Wavlink WL-WN575A3 + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += wl-wn575a3 +endef +TARGET_DEVICES += wavlink_wl-wn575a3 + define Device/wcr-1166ds DTS := WCR-1166DS BUFFALO_TAG_PLATFORM := MTK @@ -349,14 +406,6 @@ define Device/wcr-1166ds endef TARGET_DEVICES += wcr-1166ds -define Device/wl-wn575a3 - DTS := WL-WN575A3 - IMAGE_SIZE := $(ralink_default_fw_size_8M) - DEVICE_TITLE := Wavlink WL-WN575A3 - DEVICE_PACKAGES := kmod-mt76x2 -endef -TARGET_DEVICES += wl-wn575a3 - define Device/widora_neo-16m DTS := WIDORA-NEO-16M IMAGE_SIZE := $(ralink_default_fw_size_16M) @@ -374,6 +423,13 @@ define Device/widora_neo-32m endef TARGET_DEVICES += widora_neo-32m +define Device/wiznet_wizfi630s + DTS := WIZFI630S + IMAGE_SIZE := $(ralink_default_fw_size_32M) + DEVICE_TITLE := WIZnet WizFi630S +endef +TARGET_DEVICES += wiznet_wizfi630s + define Device/wrtnode2p DTS := WRTNODE2P IMAGE_SIZE := $(ralink_default_fw_size_16M) diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk index 163726e1e..c67384f07 100644 --- a/target/linux/ramips/image/rt305x.mk +++ b/target/linux/ramips/image/rt305x.mk @@ -910,6 +910,13 @@ define Device/kn endef TARGET_DEVICES += kn +define Device/zyxel_keenetic-start + DTS := kn_st + IMAGE_SIZE := $(ralink_default_fw_size_4M) + DEVICE_TITLE := ZyXEL Keenetic Start +endef +TARGET_DEVICES += zyxel_keenetic-start + define Device/zorlik_zl5900v2 DTS := ZL5900V2 DEVICE_TITLE := Zorlik ZL5900V2 diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk index abee533d0..41b2c3dd5 100644 --- a/target/linux/ramips/image/rt3883.mk +++ b/target/linux/ramips/image/rt3883.mk @@ -41,6 +41,18 @@ endef TARGET_DEVICES += dir-645 +define Device/belkin_f9k1109v1 + DTS := F9K1109V1 + BLOCKSIZE := 64k + DEVICE_TITLE := Belkin F9K1109 Version 1.0 + DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig + IMAGE_SIZE := 7224k + KERNEL := kernel-bin | patch-dtb | lzma -d16 | uImage lzma + # Stock firmware checks for this uImage image name during upload. + UIMAGE_NAME := N750F9K1103VB +endef +TARGET_DEVICES += belkin_f9k1109v1 + define Device/hpm DTS := HPM BLOCKSIZE := 64k diff --git a/target/linux/ramips/modules.mk b/target/linux/ramips/modules.mk index 88e83a487..b604110b1 100644 --- a/target/linux/ramips/modules.mk +++ b/target/linux/ramips/modules.mk @@ -116,7 +116,7 @@ $(eval $(call KernelPackage,hsdma-mtk)) define KernelPackage/sound-mt7620 TITLE:=MT7620 PCM/I2S Alsa Driver - DEPENDS:=@TARGET_ramips +kmod-sound-soc-core +kmod-regmap +kmod-dma-ralink @!TARGET_ramips_rt288x + DEPENDS:=@TARGET_ramips +kmod-sound-soc-core +kmod-regmap-i2c +kmod-dma-ralink @!TARGET_ramips_rt288x KCONFIG:= \ CONFIG_SND_RALINK_SOC_I2S \ CONFIG_SND_SIMPLE_CARD \ diff --git a/target/linux/ramips/mt7620/config-4.14 b/target/linux/ramips/mt7620/config-4.14 index e1a8e0c73..05f3963d4 100644 --- a/target/linux/ramips/mt7620/config-4.14 +++ b/target/linux/ramips/mt7620/config-4.14 @@ -158,7 +158,6 @@ CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 -CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_JIMAGE_FW=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_TPLINK_FW=y diff --git a/target/linux/ramips/mt7621/config-4.14 b/target/linux/ramips/mt7621/config-4.14 index 5f4d76624..b279c6987 100644 --- a/target/linux/ramips/mt7621/config-4.14 +++ b/target/linux/ramips/mt7621/config-4.14 @@ -24,6 +24,8 @@ CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_BLK_MQ_PCI=y CONFIG_BOARD_SCACHE=y CONFIG_BOUNCE=y +CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_CEVT_R4K=y # CONFIG_CEVT_SYSTICK_QUIRK is not set CONFIG_CLKDEV_LOOKUP=y @@ -97,7 +99,6 @@ CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set # CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_COMPILER_H=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y diff --git a/target/linux/ramips/mt76x8/config-4.14 b/target/linux/ramips/mt76x8/config-4.14 index 81e084893..5bcb94858 100644 --- a/target/linux/ramips/mt76x8/config-4.14 +++ b/target/linux/ramips/mt76x8/config-4.14 @@ -153,7 +153,6 @@ CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_M25P80=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y -CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_SPLIT_TRX_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y @@ -193,6 +192,8 @@ CONFIG_RALINK=y # CONFIG_RCU_STALL_COMMON is not set CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RESET_CONTROLLER=y # CONFIG_SCHED_INFO is not set # CONFIG_SCSI_DMA is not set diff --git a/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch b/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch index d9bc48d69..b607f2bdf 100644 --- a/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch +++ b/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch @@ -1,15 +1,45 @@ -From 87a5fcd57c577cd94b5b080deb98885077c13a42 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Sun, 27 Jul 2014 09:49:07 +0100 -Subject: [PATCH 43/53] spi: add mt7621 support +From cbd66c626e16743b05af807ad48012c0a097b9fb Mon Sep 17 00:00:00 2001 +From: Stefan Roese +Date: Mon, 25 Mar 2019 09:29:25 +0100 +Subject: [PATCH] spi: mt7621: Move SPI driver out of staging -Signed-off-by: John Crispin +This patch moves the MT7621 SPI driver, which is used on some Ralink / +MediaTek MT76xx MIPS SoC's, out of the staging directory. No changes to +the source code are done in this patch. + +This driver version was tested successfully on an MT7688 based platform +with an SPI NOR on CS0 and an SPI NAND on CS1 without any issues (so +far). + +This patch also documents the devicetree bindings for the MT7621 SPI +device driver. + +Signed-off-by: Stefan Roese +Cc: Rob Herring +Cc: Mark Brown +Cc: Greg Kroah-Hartman +Cc: NeilBrown +Cc: Sankalp Negi +Cc: Chuanhong Guo +Cc: John Crispin +Cc: Armando Miraglia +Signed-off-by: Mark Brown --- - drivers/spi/Kconfig | 6 + - drivers/spi/Makefile | 1 + - drivers/spi/spi-mt7621.c | 480 ++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 487 insertions(+) - create mode 100644 drivers/spi/spi-mt7621.c + .../devicetree/bindings/spi/spi-mt7621.txt | 26 ++++++ + drivers/spi/Kconfig | 6 ++ + drivers/spi/Makefile | 1 + + .../{staging/mt7621-spi => spi}/spi-mt7621.c | 83 +++++++++---------- + drivers/staging/Kconfig | 2 - + drivers/staging/Makefile | 1 - + drivers/staging/mt7621-spi/Kconfig | 6 -- + drivers/staging/mt7621-spi/Makefile | 1 - + drivers/staging/mt7621-spi/TODO | 5 -- + 9 files changed, 74 insertions(+), 57 deletions(-) + create mode 100644 Documentation/devicetree/bindings/spi/spi-mt7621.txt + rename drivers/{staging/mt7621-spi => spi}/spi-mt7621.c (88%) + delete mode 100644 drivers/staging/mt7621-spi/Kconfig + delete mode 100644 drivers/staging/mt7621-spi/Makefile + delete mode 100644 drivers/staging/mt7621-spi/TODO --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -38,45 +68,34 @@ Signed-off-by: John Crispin obj-$(CONFIG_SPI_OC_TINY) += spi-oc-tiny.o --- /dev/null +++ b/drivers/spi/spi-mt7621.c -@@ -0,0 +1,494 @@ -+/* -+ * spi-mt7621.c -- MediaTek MT7621 SPI controller driver -+ * -+ * Copyright (C) 2011 Sergiy -+ * Copyright (C) 2011-2013 Gabor Juhos -+ * Copyright (C) 2014-2015 Felix Fietkau -+ * -+ * Some parts are based on spi-orion.c: -+ * Author: Shadi Ammouri -+ * Copyright (C) 2007-2008 Marvell Ltd. -+ * -+ * 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 by the Free Software Foundation. -+ */ +@@ -0,0 +1,416 @@ ++// SPDX-License-Identifier: GPL-2.0 ++// ++// spi-mt7621.c -- MediaTek MT7621 SPI controller driver ++// ++// Copyright (C) 2011 Sergiy ++// Copyright (C) 2011-2013 Gabor Juhos ++// Copyright (C) 2014-2015 Felix Fietkau ++// ++// Some parts are based on spi-orion.c: ++// Author: Shadi Ammouri ++// Copyright (C) 2007-2008 Marvell Ltd. + -+#include -+#include +#include -+#include +#include +#include ++#include ++#include +#include +#include -+#include -+#include -+#include + -+#include ++#define DRIVER_NAME "spi-mt7621" + -+#define SPI_BPW_MASK(bits) BIT((bits) - 1) -+ -+#define DRIVER_NAME "spi-mt7621" +/* in usec */ -+#define RALINK_SPI_WAIT_MAX_LOOP 2000 ++#define RALINK_SPI_WAIT_MAX_LOOP 2000 + +/* SPISTAT register bit field */ -+#define SPISTAT_BUSY BIT(0) ++#define SPISTAT_BUSY BIT(0) + +#define MT7621_SPI_TRANS 0x00 +#define SPITRANS_BUSY BIT(16) @@ -87,32 +106,33 @@ Signed-off-by: John Crispin +#define SPI_CTL_TX_RX_CNT_MASK 0xff +#define SPI_CTL_START BIT(8) + -+#define MT7621_SPI_POLAR 0x38 +#define MT7621_SPI_MASTER 0x28 ++#define MASTER_MORE_BUFMODE BIT(2) ++#define MASTER_FULL_DUPLEX BIT(10) ++#define MASTER_RS_CLK_SEL GENMASK(27, 16) ++#define MASTER_RS_CLK_SEL_SHIFT 16 ++#define MASTER_RS_SLAVE_SEL GENMASK(31, 29) ++ +#define MT7621_SPI_MOREBUF 0x2c ++#define MT7621_SPI_POLAR 0x38 +#define MT7621_SPI_SPACE 0x3c + +#define MT7621_CPHA BIT(5) +#define MT7621_CPOL BIT(4) +#define MT7621_LSB_FIRST BIT(3) + -+#define RT2880_SPI_MODE_BITS (SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST | SPI_CS_HIGH) -+ -+struct mt7621_spi; -+ +struct mt7621_spi { -+ struct spi_master *master; ++ struct spi_controller *master; + void __iomem *base; + unsigned int sys_freq; + unsigned int speed; + struct clk *clk; -+ -+ struct mt7621_spi_ops *ops; ++ int pending_write; +}; + +static inline struct mt7621_spi *spidev_to_mt7621_spi(struct spi_device *spi) +{ -+ return spi_master_get_devdata(spi->master); ++ return spi_controller_get_devdata(spi->master); +} + +static inline u32 mt7621_spi_read(struct mt7621_spi *rs, u32 reg) @@ -125,29 +145,25 @@ Signed-off-by: John Crispin + iowrite32(val, rs->base + reg); +} + -+static void mt7621_spi_reset(struct mt7621_spi *rs, int duplex) -+{ -+ u32 master = mt7621_spi_read(rs, MT7621_SPI_MASTER); -+ -+ master |= 7 << 29; -+ master |= 1 << 2; -+#ifdef CONFIG_SOC_MT7620 -+ if (duplex) -+ master |= 1 << 10; -+ else -+#endif -+ master &= ~(1 << 10); -+ -+ mt7621_spi_write(rs, MT7621_SPI_MASTER, master); -+} -+ +static void mt7621_spi_set_cs(struct spi_device *spi, int enable) +{ + struct mt7621_spi *rs = spidev_to_mt7621_spi(spi); + int cs = spi->chip_select; + u32 polar = 0; ++ u32 master; ++ ++ /* ++ * Select SPI device 7, enable "more buffer mode" and disable ++ * full-duplex (only half-duplex really works on this chip ++ * reliably) ++ */ ++ master = mt7621_spi_read(rs, MT7621_SPI_MASTER); ++ master |= MASTER_RS_SLAVE_SEL | MASTER_MORE_BUFMODE; ++ master &= ~MASTER_FULL_DUPLEX; ++ mt7621_spi_write(rs, MT7621_SPI_MASTER, master); ++ ++ rs->pending_write = 0; + -+ mt7621_spi_reset(rs, cs); + if (enable) + polar = BIT(cs); + mt7621_spi_write(rs, MT7621_SPI_POLAR, polar); @@ -171,45 +187,36 @@ Signed-off-by: John Crispin + rate = 2; + + reg = mt7621_spi_read(rs, MT7621_SPI_MASTER); -+ reg &= ~(0xfff << 16); -+ reg |= (rate - 2) << 16; ++ reg &= ~MASTER_RS_CLK_SEL; ++ reg |= (rate - 2) << MASTER_RS_CLK_SEL_SHIFT; + rs->speed = speed; + + reg &= ~MT7621_LSB_FIRST; + if (spi->mode & SPI_LSB_FIRST) + reg |= MT7621_LSB_FIRST; + ++ /* ++ * This SPI controller seems to be tested on SPI flash only and some ++ * bits are swizzled under other SPI modes probably due to incorrect ++ * wiring inside the silicon. Only mode 0 works correctly. ++ */ + reg &= ~(MT7621_CPHA | MT7621_CPOL); -+ switch(spi->mode & (SPI_CPOL | SPI_CPHA)) { -+ case SPI_MODE_0: -+ break; -+ case SPI_MODE_1: -+ reg |= MT7621_CPHA; -+ break; -+ case SPI_MODE_2: -+ reg |= MT7621_CPOL; -+ break; -+ case SPI_MODE_3: -+ reg |= MT7621_CPOL | MT7621_CPHA; -+ break; -+ } ++ + mt7621_spi_write(rs, MT7621_SPI_MASTER, reg); + + return 0; +} + -+static inline int mt7621_spi_wait_till_ready(struct spi_device *spi) ++static inline int mt7621_spi_wait_till_ready(struct mt7621_spi *rs) +{ -+ struct mt7621_spi *rs = spidev_to_mt7621_spi(spi); + int i; + + for (i = 0; i < RALINK_SPI_WAIT_MAX_LOOP; i++) { + u32 status; + + status = mt7621_spi_read(rs, MT7621_SPI_TRANS); -+ if ((status & SPITRANS_BUSY) == 0) { ++ if ((status & SPITRANS_BUSY) == 0) + return 0; -+ } + cpu_relax(); + udelay(1); + } @@ -217,205 +224,157 @@ Signed-off-by: John Crispin + return -ETIMEDOUT; +} + -+static int mt7621_spi_transfer_half_duplex(struct spi_master *master, ++static void mt7621_spi_read_half_duplex(struct mt7621_spi *rs, ++ int rx_len, u8 *buf) ++{ ++ int tx_len; ++ ++ /* ++ * Combine with any pending write, and perform one or more half-duplex ++ * transactions reading 'len' bytes. Data to be written is already in ++ * MT7621_SPI_DATA. ++ */ ++ tx_len = rs->pending_write; ++ rs->pending_write = 0; ++ ++ while (rx_len || tx_len) { ++ int i; ++ u32 val = (min(tx_len, 4) * 8) << 24; ++ int rx = min(rx_len, 32); ++ ++ if (tx_len > 4) ++ val |= (tx_len - 4) * 8; ++ val |= (rx * 8) << 12; ++ mt7621_spi_write(rs, MT7621_SPI_MOREBUF, val); ++ ++ tx_len = 0; ++ ++ val = mt7621_spi_read(rs, MT7621_SPI_TRANS); ++ val |= SPI_CTL_START; ++ mt7621_spi_write(rs, MT7621_SPI_TRANS, val); ++ ++ mt7621_spi_wait_till_ready(rs); ++ ++ for (i = 0; i < rx; i++) { ++ if ((i % 4) == 0) ++ val = mt7621_spi_read(rs, MT7621_SPI_DATA0 + i); ++ *buf++ = val & 0xff; ++ val >>= 8; ++ } ++ ++ rx_len -= i; ++ } ++} ++ ++static inline void mt7621_spi_flush(struct mt7621_spi *rs) ++{ ++ mt7621_spi_read_half_duplex(rs, 0, NULL); ++} ++ ++static void mt7621_spi_write_half_duplex(struct mt7621_spi *rs, ++ int tx_len, const u8 *buf) ++{ ++ int len = rs->pending_write; ++ int val = 0; ++ ++ if (len & 3) { ++ val = mt7621_spi_read(rs, MT7621_SPI_OPCODE + (len & ~3)); ++ if (len < 4) { ++ val <<= (4 - len) * 8; ++ val = swab32(val); ++ } ++ } ++ ++ while (tx_len > 0) { ++ if (len >= 36) { ++ rs->pending_write = len; ++ mt7621_spi_flush(rs); ++ len = 0; ++ } ++ ++ val |= *buf++ << (8 * (len & 3)); ++ len++; ++ if ((len & 3) == 0) { ++ if (len == 4) ++ /* The byte-order of the opcode is weird! */ ++ val = swab32(val); ++ mt7621_spi_write(rs, MT7621_SPI_OPCODE + len - 4, val); ++ val = 0; ++ } ++ tx_len -= 1; ++ } ++ ++ if (len & 3) { ++ if (len < 4) { ++ val = swab32(val); ++ val >>= (4 - len) * 8; ++ } ++ mt7621_spi_write(rs, MT7621_SPI_OPCODE + (len & ~3), val); ++ } ++ ++ rs->pending_write = len; ++} ++ ++static int mt7621_spi_transfer_one_message(struct spi_controller *master, + struct spi_message *m) +{ -+ struct mt7621_spi *rs = spi_master_get_devdata(master); ++ struct mt7621_spi *rs = spi_controller_get_devdata(master); + struct spi_device *spi = m->spi; + unsigned int speed = spi->max_speed_hz; + struct spi_transfer *t = NULL; + int status = 0; -+ int i, len = 0; -+ int rx_len = 0; -+ u32 data[9] = { 0 }; -+ u32 val; + -+ mt7621_spi_wait_till_ready(spi); -+ -+ list_for_each_entry(t, &m->transfers, transfer_list) { -+ const u8 *buf = t->tx_buf; -+ -+ if (t->rx_buf) -+ rx_len += t->len; -+ -+ if (!buf) -+ continue; ++ mt7621_spi_wait_till_ready(rs); + ++ list_for_each_entry(t, &m->transfers, transfer_list) + if (t->speed_hz < speed) + speed = t->speed_hz; + -+ /* -+ * m25p80 might attempt to write more data than we can handle. -+ * truncate the message to what we can fit into the registers -+ */ -+ if (len + t->len > 36) -+ t->len = 36 - len; -+ -+ for (i = 0; i < t->len; i++, len++) -+ data[len / 4] |= buf[i] << (8 * (len & 3)); -+ } -+ -+ if (WARN_ON(rx_len > 32)) { -+ status = -EIO; -+ goto msg_done; -+ } -+ + if (mt7621_spi_prepare(spi, speed)) { + status = -EIO; + goto msg_done; + } -+ data[0] = swab32(data[0]); -+ if (len < 4) -+ data[0] >>= (4 - len) * 8; -+ -+ for (i = 0; i < len; i += 4) -+ mt7621_spi_write(rs, MT7621_SPI_OPCODE + i, data[i / 4]); -+ -+ val = (min_t(int, len, 4) * 8) << 24; -+ if (len > 4) -+ val |= (len - 4) * 8; -+ val |= (rx_len * 8) << 12; -+ mt7621_spi_write(rs, MT7621_SPI_MOREBUF, val); + ++ /* Assert CS */ + mt7621_spi_set_cs(spi, 1); + -+ val = mt7621_spi_read(rs, MT7621_SPI_TRANS); -+ val |= SPI_CTL_START; -+ mt7621_spi_write(rs, MT7621_SPI_TRANS, val); -+ -+ mt7621_spi_wait_till_ready(spi); -+ -+ mt7621_spi_set_cs(spi, 0); -+ -+ for (i = 0; i < rx_len; i += 4) -+ data[i / 4] = mt7621_spi_read(rs, MT7621_SPI_DATA0 + i); -+ -+ m->actual_length = len + rx_len; -+ -+ len = 0; ++ m->actual_length = 0; + list_for_each_entry(t, &m->transfers, transfer_list) { -+ u8 *buf = t->rx_buf; -+ -+ if (!buf) -+ continue; -+ -+ for (i = 0; i < t->len; i++, len++) -+ buf[i] = data[len / 4] >> (8 * (len & 3)); -+ } -+ -+msg_done: -+ m->status = status; -+ spi_finalize_current_message(master); -+ -+ return 0; -+} -+ -+#ifdef CONFIG_SOC_MT7620 -+static int mt7621_spi_transfer_full_duplex(struct spi_master *master, -+ struct spi_message *m) -+{ -+ struct mt7621_spi *rs = spi_master_get_devdata(master); -+ struct spi_device *spi = m->spi; -+ unsigned int speed = spi->max_speed_hz; -+ struct spi_transfer *t = NULL; -+ int status = 0; -+ int i, len = 0; -+ int rx_len = 0; -+ u32 data[9] = { 0 }; -+ u32 val = 0; -+ -+ mt7621_spi_wait_till_ready(spi); -+ -+ list_for_each_entry(t, &m->transfers, transfer_list) { -+ const u8 *buf = t->tx_buf; -+ -+ if (t->rx_buf) -+ rx_len += t->len; -+ -+ if (!buf) -+ continue; -+ -+ if (WARN_ON(len + t->len > 16)) { ++ if ((t->rx_buf) && (t->tx_buf)) { ++ /* ++ * This controller will shift some extra data out ++ * of spi_opcode if (mosi_bit_cnt > 0) && ++ * (cmd_bit_cnt == 0). So the claimed full-duplex ++ * support is broken since we have no way to read ++ * the MISO value during that bit. ++ */ + status = -EIO; + goto msg_done; ++ } else if (t->rx_buf) { ++ mt7621_spi_read_half_duplex(rs, t->len, t->rx_buf); ++ } else if (t->tx_buf) { ++ mt7621_spi_write_half_duplex(rs, t->len, t->tx_buf); + } -+ -+ for (i = 0; i < t->len; i++, len++) -+ data[len / 4] |= buf[i] << (8 * (len & 3)); -+ if (speed > t->speed_hz) -+ speed = t->speed_hz; ++ m->actual_length += t->len; + } + -+ if (WARN_ON(rx_len > 16)) { -+ status = -EIO; -+ goto msg_done; -+ } -+ -+ if (mt7621_spi_prepare(spi, speed)) { -+ status = -EIO; -+ goto msg_done; -+ } -+ -+ for (i = 0; i < len; i += 4) -+ mt7621_spi_write(rs, MT7621_SPI_DATA0 + i, data[i / 4]); -+ -+ val |= len * 8; -+ val |= (rx_len * 8) << 12; -+ mt7621_spi_write(rs, MT7621_SPI_MOREBUF, val); -+ -+ mt7621_spi_set_cs(spi, 1); -+ -+ val = mt7621_spi_read(rs, MT7621_SPI_TRANS); -+ val |= SPI_CTL_START; -+ mt7621_spi_write(rs, MT7621_SPI_TRANS, val); -+ -+ mt7621_spi_wait_till_ready(spi); -+ ++ /* Flush data and deassert CS */ ++ mt7621_spi_flush(rs); + mt7621_spi_set_cs(spi, 0); + -+ for (i = 0; i < rx_len; i += 4) -+ data[i / 4] = mt7621_spi_read(rs, MT7621_SPI_DATA4 + i); -+ -+ m->actual_length = rx_len; -+ -+ len = 0; -+ list_for_each_entry(t, &m->transfers, transfer_list) { -+ u8 *buf = t->rx_buf; -+ -+ if (!buf) -+ continue; -+ -+ for (i = 0; i < t->len; i++, len++) -+ buf[i] = data[len / 4] >> (8 * (len & 3)); -+ } -+ +msg_done: + m->status = status; + spi_finalize_current_message(master); + + return 0; +} -+#endif -+ -+static int mt7621_spi_transfer_one_message(struct spi_master *master, -+ struct spi_message *m) -+{ -+ struct spi_device *spi = m->spi; -+#ifdef CONFIG_SOC_MT7620 -+ int cs = spi->chip_select; -+ -+ if (cs) -+ return mt7621_spi_transfer_full_duplex(master, m); -+#endif -+ return mt7621_spi_transfer_half_duplex(master, m); -+} + +static int mt7621_spi_setup(struct spi_device *spi) +{ + struct mt7621_spi *rs = spidev_to_mt7621_spi(spi); + + if ((spi->max_speed_hz == 0) || -+ (spi->max_speed_hz > (rs->sys_freq / 2))) ++ (spi->max_speed_hz > (rs->sys_freq / 2))) + spi->max_speed_hz = (rs->sys_freq / 2); + + if (spi->max_speed_hz < (rs->sys_freq / 4097)) { @@ -433,26 +392,20 @@ Signed-off-by: John Crispin +}; +MODULE_DEVICE_TABLE(of, mt7621_spi_match); + -+static size_t mt7621_max_transfer_size(struct spi_device *spi) -+{ -+ return 32; -+} -+ +static int mt7621_spi_probe(struct platform_device *pdev) +{ + const struct of_device_id *match; -+ struct spi_master *master; ++ struct spi_controller *master; + struct mt7621_spi *rs; + void __iomem *base; + struct resource *r; + int status = 0; + struct clk *clk; -+ struct mt7621_spi_ops *ops; ++ int ret; + + match = of_match_device(mt7621_spi_match, &pdev->dev); + if (!match) + return -EINVAL; -+ ops = (struct mt7621_spi_ops *)match->data; + + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + base = devm_ioremap_resource(&pdev->dev, r); @@ -471,47 +424,47 @@ Signed-off-by: John Crispin + return status; + + master = spi_alloc_master(&pdev->dev, sizeof(*rs)); -+ if (master == NULL) { ++ if (!master) { + dev_info(&pdev->dev, "master allocation failed\n"); + return -ENOMEM; + } + -+ master->mode_bits = RT2880_SPI_MODE_BITS; -+ ++ master->mode_bits = SPI_LSB_FIRST; ++ master->flags = SPI_CONTROLLER_HALF_DUPLEX; + master->setup = mt7621_spi_setup; + master->transfer_one_message = mt7621_spi_transfer_one_message; + master->bits_per_word_mask = SPI_BPW_MASK(8); + master->dev.of_node = pdev->dev.of_node; + master->num_chipselect = 2; -+ master->max_transfer_size = mt7621_max_transfer_size; + + dev_set_drvdata(&pdev->dev, master); + -+ rs = spi_master_get_devdata(master); ++ rs = spi_controller_get_devdata(master); + rs->base = base; + rs->clk = clk; + rs->master = master; + rs->sys_freq = clk_get_rate(rs->clk); -+ rs->ops = ops; ++ rs->pending_write = 0; + dev_info(&pdev->dev, "sys_freq: %u\n", rs->sys_freq); + -+ device_reset(&pdev->dev); ++ ret = device_reset(&pdev->dev); ++ if (ret) { ++ dev_err(&pdev->dev, "SPI reset failed!\n"); ++ return ret; ++ } + -+ mt7621_spi_reset(rs, 0); -+ -+ return spi_register_master(master); ++ return devm_spi_register_controller(&pdev->dev, master); +} + +static int mt7621_spi_remove(struct platform_device *pdev) +{ -+ struct spi_master *master; ++ struct spi_controller *master; + struct mt7621_spi *rs; + + master = dev_get_drvdata(&pdev->dev); -+ rs = spi_master_get_devdata(master); ++ rs = spi_controller_get_devdata(master); + -+ clk_disable(rs->clk); -+ spi_unregister_master(master); ++ clk_disable_unprepare(rs->clk); + + return 0; +} @@ -521,7 +474,6 @@ Signed-off-by: John Crispin +static struct platform_driver mt7621_spi_driver = { + .driver = { + .name = DRIVER_NAME, -+ .owner = THIS_MODULE, + .of_match_table = mt7621_spi_match, + }, + .probe = mt7621_spi_probe, diff --git a/target/linux/ramips/patches-4.14/0048-asoc-add-mt7620-support.patch b/target/linux/ramips/patches-4.14/0048-asoc-add-mt7620-support.patch index 5f105c69e..1834e8853 100644 --- a/target/linux/ramips/patches-4.14/0048-asoc-add-mt7620-support.patch +++ b/target/linux/ramips/patches-4.14/0048-asoc-add-mt7620-support.patch @@ -1007,7 +1007,7 @@ Signed-off-by: John Crispin + if (ret) + goto err_debugfs; + -+ dev_info(i2s->dev, "mclk %luKHz\n", clk_get_rate(i2s->clk) / 1000000); ++ dev_info(i2s->dev, "mclk %luMHz\n", clk_get_rate(i2s->clk) / 1000000); + + return 0; + diff --git a/target/linux/ramips/patches-4.14/300-mt7620-export-chip-version-and-pkg.patch b/target/linux/ramips/patches-4.14/300-mt7620-export-chip-version-and-pkg.patch new file mode 100644 index 000000000..0cb1fede3 --- /dev/null +++ b/target/linux/ramips/patches-4.14/300-mt7620-export-chip-version-and-pkg.patch @@ -0,0 +1,19 @@ +--- a/arch/mips/include/asm/mach-ralink/mt7620.h ++++ b/arch/mips/include/asm/mach-ralink/mt7620.h +@@ -137,4 +137,16 @@ static inline int mt7620_get_eco(void) + return rt_sysc_r32(SYSC_REG_CHIP_REV) & CHIP_REV_ECO_MASK; + } + ++static inline int mt7620_get_chipver(void) ++{ ++ return (rt_sysc_r32(SYSC_REG_CHIP_REV) >> CHIP_REV_VER_SHIFT) & ++ CHIP_REV_VER_MASK; ++} ++ ++static inline int mt7620_get_pkg(void) ++{ ++ return (rt_sysc_r32(SYSC_REG_CHIP_REV) >> CHIP_REV_PKG_SHIFT) & ++ CHIP_REV_PKG_MASK; ++} ++ + #endif diff --git a/target/linux/ramips/patches-4.14/304-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch b/target/linux/ramips/patches-4.14/304-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch new file mode 100644 index 000000000..c8febaf73 --- /dev/null +++ b/target/linux/ramips/patches-4.14/304-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch @@ -0,0 +1,72 @@ +This hack can be dropped after the next stable release from +v5.x-tree. + +The problem was fixed upstream by + +commit 2bffa65da43e ("mtd: spi-nor: Add a post BFPT fixup for MX25L25635E") + +For reference see: + + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1098,6 +1098,7 @@ static const struct flash_info spi_nor_i + { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) }, + { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, + { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, ++ { "mx25l25635f", INFO(0xc22019, 0, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, + { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) }, + { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) }, + { "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, +@@ -1267,11 +1268,12 @@ static const struct flash_info spi_nor_i + { }, + }; + +-static const struct flash_info *spi_nor_read_id(struct spi_nor *nor) ++static const struct flash_info *spi_nor_read_id(struct spi_nor *nor, ++ const char *name) + { + int tmp; + u8 id[SPI_NOR_MAX_ID_LEN]; +- const struct flash_info *info; ++ const struct flash_info *info, *first_match = NULL; + + tmp = nor->read_reg(nor, SPINOR_OP_RDID, id, SPI_NOR_MAX_ID_LEN); + if (tmp < 0) { +@@ -1282,10 +1284,16 @@ static const struct flash_info *spi_nor_ + for (tmp = 0; tmp < ARRAY_SIZE(spi_nor_ids) - 1; tmp++) { + info = &spi_nor_ids[tmp]; + if (info->id_len) { +- if (!memcmp(info->id, id, info->id_len)) +- return &spi_nor_ids[tmp]; ++ if (!memcmp(info->id, id, info->id_len)) { ++ if (!name || !strcmp(name, info->name)) ++ return info; ++ if (!first_match) ++ first_match = info; ++ } + } + } ++ if (first_match) ++ return first_match; + dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n", + id[0], id[1], id[2]); + return ERR_PTR(-ENODEV); +@@ -2765,7 +2773,7 @@ int spi_nor_scan(struct spi_nor *nor, co + info = spi_nor_match_id(name); + /* Try to auto-detect if chip name wasn't specified or not found */ + if (!info) +- info = spi_nor_read_id(nor); ++ info = spi_nor_read_id(nor, NULL); + if (IS_ERR_OR_NULL(info)) + return -ENOENT; + +@@ -2776,7 +2784,7 @@ int spi_nor_scan(struct spi_nor *nor, co + if (name && info->id_len) { + const struct flash_info *jinfo; + +- jinfo = spi_nor_read_id(nor); ++ jinfo = spi_nor_read_id(nor, name); + if (IS_ERR(jinfo)) { + return PTR_ERR(jinfo); + } else if (jinfo != info) { diff --git a/target/linux/ramips/patches-4.14/999-fix-m25p-shutdown.patch b/target/linux/ramips/patches-4.14/999-fix-m25p-shutdown.patch deleted file mode 100644 index 0b825d61e..000000000 --- a/target/linux/ramips/patches-4.14/999-fix-m25p-shutdown.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c -index 24e1ea3..b1ff69a 100644 ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -313,6 +313,21 @@ static int m25p_remove(struct spi_device *spi) - return mtd_device_unregister(&flash->spi_nor.mtd); - } - -+static void m25p_shutdown(struct spi_device *spi) -+{ -+ struct m25p *flash = spi_get_drvdata(spi); -+ -+ if ((&flash->spi_nor)->addr_width > 3) { -+ printk(KERN_INFO "m25p80: exit 4-byte address mode\n"); -+ flash->command[0] = SPINOR_OP_EX4B; // exit 4-byte address mode: 0xe9 -+ spi_write(flash->spi, flash->command, 1); -+ flash->command[0] = 0x66; // enable reset -+ spi_write(flash->spi, flash->command, 1); -+ flash->command[0] = 0x99; // reset -+ spi_write(flash->spi, flash->command, 1); -+ } -+} -+ - /* - * Do NOT add to this array without reading the following: - * -@@ -387,6 +402,7 @@ static struct spi_driver m25p80_driver = { - .id_table = m25p_ids, - .probe = m25p_probe, - .remove = m25p_remove, -+ .shutdown = m25p_shutdown, - - /* REVISIT: many of these chips have deep power-down modes, which - * should clearly be entered on suspend() to minimize power use. diff --git a/target/linux/ramips/rt288x/config-4.14 b/target/linux/ramips/rt288x/config-4.14 index de4dffe88..9c713fd2b 100644 --- a/target/linux/ramips/rt288x/config-4.14 +++ b/target/linux/ramips/rt288x/config-4.14 @@ -144,7 +144,6 @@ CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_M25P80=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y -CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_LZMA_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_SPLIT_WRGG_FW=y diff --git a/target/linux/ramips/rt305x/config-4.14 b/target/linux/ramips/rt305x/config-4.14 index 346a8a881..1f00bdaae 100644 --- a/target/linux/ramips/rt305x/config-4.14 +++ b/target/linux/ramips/rt305x/config-4.14 @@ -135,7 +135,6 @@ CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 -CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_JIMAGE_FW=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y diff --git a/target/linux/ramips/rt3883/config-4.14 b/target/linux/ramips/rt3883/config-4.14 index 93d803e2e..046e3732e 100644 --- a/target/linux/ramips/rt3883/config-4.14 +++ b/target/linux/ramips/rt3883/config-4.14 @@ -149,8 +149,6 @@ CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 -CONFIG_MTD_SPLIT_FIRMWARE=y -CONFIG_MTD_SPLIT_JIMAGE_FW=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_NEED_DMA_MAP_STATE=y