From 90eaa19f4e676892a524b607e46e18eb481d335a Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Mon, 2 Dec 2019 05:55:49 -0800 Subject: [PATCH] ath79: update upsteam --- target/linux/ath79/Makefile | 2 +- .../base-files/etc/board.d/03_gpio_switches | 36 - .../etc/hotplug.d/firmware/10-ath9k-eeprom | 226 --- .../etc/hotplug.d/firmware/11-ath10k-caldata | 197 --- .../etc/hotplug.d/ieee80211/00-wifi-migration | 52 + .../etc/hotplug.d/ieee80211/00-wmac-migration | 36 - .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 36 - .../etc/uci-defaults/04_led_migration | 16 - target/linux/ath79/config-4.14 | 9 + target/linux/ath79/config-4.19 | 7 + .../ath79/dts/ar1022_iodata_wn-ag300dgr.dts | 17 +- .../ath79/dts/ar1022_sitecom_wlr-7100.dts | 172 ++ .../ath79/dts/ar7161_adtran_bsap1800-v2.dts | 9 + .../ath79/dts/ar7161_adtran_bsap1840.dts | 9 + .../ath79/dts/ar7161_adtran_bsap1880.dtsi | 100 ++ .../linux/ath79/dts/ar7161_aruba_ap-105.dts | 192 +++ .../dts/ar7161_buffalo_wzr-hp-ag300h.dts | 17 +- .../ath79/dts/ar7161_dlink_dir-825-b1.dts | 31 +- .../linux/ath79/dts/ar7161_jjplus_ja76pf2.dts | 16 +- .../ath79/dts/ar7161_netgear_wndr3700.dtsi | 21 +- .../ath79/dts/ar7161_netgear_wndr3800.dts | 1 - .../ath79/dts/ar7161_netgear_wndr3800ch.dts | 36 + .../ath79/dts/ar7161_ubnt_routerstation.dtsi | 13 +- .../ath79/dts/ar7240_buffalo_whr-g301n.dts | 14 +- .../ath79/dts/ar7240_netgear_wnr1000-v2.dts | 204 +++ .../ath79/dts/ar7240_netgear_wnr612-v2.dts | 3 +- .../ath79/dts/ar7240_netgear_wnr612-v2.dtsi | 36 +- target/linux/ath79/dts/ar7240_on_n150r.dts | 3 +- .../ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi | 7 +- target/linux/ath79/dts/ar7241.dtsi | 2 +- .../ath79/dts/ar7241_netgear_wnr2000-v3.dts | 208 +++ .../ath79/dts/ar7241_netgear_wnr2200-16m.dts | 34 + .../ath79/dts/ar7241_netgear_wnr2200-8m.dts | 34 + .../ath79/dts/ar7241_netgear_wnr2200.dtsi | 207 +++ target/linux/ath79/dts/ar7241_tplink.dtsi | 7 +- .../ath79/dts/ar7241_tplink_tl-mr3x20.dtsi | 2 +- .../ath79/dts/ar7241_tplink_tl-wr842n-v1.dts | 7 +- .../linux/ath79/dts/ar7241_ubnt_airrouter.dts | 17 +- target/linux/ath79/dts/ar7241_ubnt_unifi.dts | 31 +- target/linux/ath79/dts/ar7241_ubnt_xm.dtsi | 27 +- .../ath79/dts/ar7241_ubnt_xm_outdoor.dtsi | 11 +- target/linux/ath79/dts/ar7242.dtsi | 4 +- .../linux/ath79/dts/ar7242_avm_fritz300e.dts | 15 +- .../ath79/dts/ar7242_buffalo_bhr-4grv.dts | 11 +- .../ath79/dts/ar7242_buffalo_wzr-bhr.dtsi | 22 +- .../dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts | 14 +- .../ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts | 20 +- .../ath79/dts/ar7242_tplink_tl-wr2543-v1.dts | 15 +- target/linux/ath79/dts/ar724x.dtsi | 10 +- .../ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts | 13 +- .../dts/ar9132_tplink_tl-wr1043nd-v1.dts | 18 +- .../ath79/dts/ar9132_tplink_tl-wr941-v2.dts | 5 +- target/linux/ath79/dts/ar9330.dtsi | 16 +- .../ath79/dts/ar9330_glinet_gl-ar150.dts | 18 +- target/linux/ath79/dts/ar9330_pqi_air-pen.dts | 16 +- .../ath79/dts/ar9331_8dev_carambola2.dts | 135 ++ .../ath79/dts/ar9331_alfa-network_ap121f.dts | 138 ++ .../dts/ar9331_dptechnics_dpt-module.dts | 69 - .../linux/ath79/dts/ar9331_dragino_ms14.dts | 90 - .../dts/ar9331_embeddedwireless_dorin.dts | 20 +- .../linux/ath79/dts/ar9331_etactica_eg200.dts | 13 +- target/linux/ath79/dts/ar9331_onion_omega.dts | 69 - .../linux/ath79/dts/ar9331_pisen_ts-d084.dts | 116 ++ .../linux/ath79/dts/ar9331_pisen_wmm003n.dts | 3 +- .../ath79/dts/ar9331_tplink_tl-mr3020-v1.dts | 23 +- .../ath79/dts/ar9331_tplink_tl-mr3040-v2.dts | 12 +- .../dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi | 20 +- .../ath79/dts/ar9331_tplink_tl-wr710n-v1.dts | 5 +- .../dts/ar9331_tplink_tl-wr741nd-v4.dtsi | 19 +- target/linux/ath79/dts/ar9341_pcs_cr3000.dts | 14 +- .../linux/ath79/dts/ar9341_pisen_wmb001n.dts | 225 +++ target/linux/ath79/dts/ar9341_tplink.dtsi | 115 ++ .../ath79/dts/ar9341_tplink_tl-mr3420-v2.dts | 87 + .../ath79/dts/ar9341_tplink_tl-wr841-v8.dts | 126 +- .../ath79/dts/ar9341_tplink_tl-wr842n-v2.dts | 139 +- .../linux/ath79/dts/ar9342_iodata_etg3-r.dts | 18 +- .../linux/ath79/dts/ar9342_ubnt_lap-120.dts | 2 +- .../ath79/dts/ar9342_ubnt_nanobeam-ac.dts | 2 +- .../dts/ar9342_ubnt_nanostation-ac-loco.dts | 2 +- .../ath79/dts/ar9342_ubnt_nanostation-ac.dts | 5 +- target/linux/ath79/dts/ar9342_ubnt_wa.dtsi | 7 +- target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 22 +- target/linux/ath79/dts/ar9344.dtsi | 2 +- .../ath79/dts/ar9344_aerohive_hiveap-121.dts | 238 +++ .../ath79/dts/ar9344_comfast_cf-e120a-v3.dts | 25 +- .../ath79/dts/ar9344_dlink_dir-825-c1.dts | 25 +- .../ath79/dts/ar9344_dlink_dir-835-a1.dts | 19 +- .../linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi | 1 - .../linux/ath79/dts/ar9344_netgear_wndr.dtsi | 290 ++++ .../ath79/dts/ar9344_netgear_wndr3700-v4.dts | 9 + .../ath79/dts/ar9344_netgear_wndr4300.dts | 9 + .../linux/ath79/dts/ar9344_ocedo_raccoon.dts | 23 +- target/linux/ath79/dts/ar9344_pcs_cap324.dts | 19 +- target/linux/ath79/dts/ar9344_pcs_cr5000.dts | 19 +- target/linux/ath79/dts/ar9344_qihoo_c301.dts | 236 +++ target/linux/ath79/dts/ar9344_tplink_cpe.dtsi | 113 ++ .../ath79/dts/ar9344_tplink_cpe210-v1.dts | 13 + .../ath79/dts/ar9344_tplink_cpe220-v2.dts | 13 + .../ath79/dts/ar9344_tplink_cpe510-v1.dts | 13 + .../ath79/dts/ar9344_tplink_cpe510-v2.dts | 9 + .../ath79/dts/ar9344_tplink_cpe510-v3.dts | 9 + .../ath79/dts/ar9344_tplink_cpe610-v1.dts | 36 + .../ath79/dts/ar9344_tplink_cpe_1port.dtsi | 48 + .../ath79/dts/ar9344_tplink_cpe_2port.dtsi | 74 + .../ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts | 89 + ...00.dts => ar9344_tplink_tl-wdr3600-v1.dts} | 4 +- ...00.dts => ar9344_tplink_tl-wdr4300-v1.dts} | 4 +- .../ath79/dts/ar9344_tplink_tl-wdr4300.dtsi | 191 +-- .../ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi | 125 ++ .../ath79/dts/ar9344_tplink_wbs210-v2.dts | 13 + .../ath79/dts/ar9344_tplink_wbs510-v1.dts | 13 + .../ath79/dts/ar9344_tplink_wbs510-v2.dts | 13 + .../linux/ath79/dts/ar9344_wd_mynet-n750.dts | 218 +++ .../ar9344_wd_mynet-wifi-rangeextender.dts | 20 +- .../ath79/dts/ar9344_winchannel_wb2000.dts | 3 +- .../ath79/dts/ar9344_zbtlink_zbt-wd323.dts | 164 ++ target/linux/ath79/dts/ar934x.dtsi | 40 +- target/linux/ath79/dts/ath79.dtsi | 4 +- .../ath79/dts/qca9531_comfast_cf-e313ac.dts | 148 ++ .../ath79/dts/qca9531_comfast_cf-e314n-v2.dts | 154 ++ .../linux/ath79/dts/qca9531_comfast_cf-e5.dts | 11 +- .../ath79/dts/qca9531_engenius_ews511ap.dts | 25 +- .../dts/qca9531_glinet_gl-ar300m-lite.dts | 19 +- .../dts/qca9531_glinet_gl-ar300m-nand.dts | 32 +- .../dts/qca9531_glinet_gl-ar300m-nor.dts | 8 +- .../ath79/dts/qca9531_glinet_gl-ar300m.dtsi | 59 +- .../ath79/dts/qca9531_glinet_gl-ar300m16.dts | 17 + .../ath79/dts/qca9531_glinet_gl-ar750.dts | 143 ++ .../ath79/dts/qca9531_glinet_gl-x750.dts | 7 +- .../dts/qca9531_tplink_archer-d50-v1.dts | 195 +++ .../ath79/dts/qca9531_tplink_tl-wr810n-v1.dts | 3 - .../linux/ath79/dts/qca9531_yuncore_a770.dts | 12 +- .../ath79/dts/qca9533_comfast_cf-e110n-v2.dts | 15 +- .../ath79/dts/qca9533_tplink_cpe210-v2.dts | 2 +- .../ath79/dts/qca9533_tplink_cpe210-v3.dts | 2 +- .../ath79/dts/qca9533_tplink_cpe210.dtsi | 120 +- .../ath79/dts/qca9533_tplink_cpe220-v3.dts | 33 + .../ath79/dts/qca9533_tplink_cpexxx.dtsi | 130 ++ .../ath79/dts/qca9533_tplink_tl-wr810n-v2.dts | 3 - .../ath79/dts/qca9533_tplink_tl-wr841-v10.dts | 16 + .../ath79/dts/qca9533_tplink_tl-wr841-v11.dts | 24 +- .../dts/qca9533_tplink_tl-wr841-v11.dtsi | 25 + .../ath79/dts/qca9533_tplink_tl-wr841-v12.dts | 9 + .../ath79/dts/qca9533_tplink_tl-wr841-v9.dts | 11 +- .../ath79/dts/qca9533_tplink_tl-wr841.dtsi | 11 +- .../ath79/dts/qca9533_tplink_tl-wr842n-v3.dts | 171 ++ .../linux/ath79/dts/qca9533_ubnt_acb-isp.dts | 15 +- target/linux/ath79/dts/qca953x.dtsi | 65 +- .../ath79/dts/qca953x_tplink_tl-wr810n.dtsi | 6 +- target/linux/ath79/dts/qca9557.dtsi | 118 +- .../ath79/dts/qca9557_buffalo_bhr-4grv2.dts | 14 +- .../ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi | 15 +- .../dts/qca9557_iodata_wn-ac1600dgr2.dts | 4 +- .../dts/qca9558_comfast_cf-wr650ac-v1.dts | 79 + .../dts/qca9558_comfast_cf-wr650ac-v2.dts | 79 + .../ath79/dts/qca9558_comfast_cf-wr650ac.dtsi | 98 ++ .../ath79/dts/qca9558_devolo_dvl1200e.dts | 15 +- .../ath79/dts/qca9558_devolo_dvl1200i.dts | 16 +- .../ath79/dts/qca9558_devolo_dvl1750c.dts | 19 +- .../ath79/dts/qca9558_devolo_dvl1750e.dts | 16 +- .../ath79/dts/qca9558_devolo_dvl1750i.dts | 16 +- .../ath79/dts/qca9558_devolo_dvl1750x.dts | 50 + .../ath79/dts/qca9558_devolo_dvl1xxx.dtsi | 4 + .../ath79/dts/qca9558_engenius_ecb1750.dts | 146 ++ .../ath79/dts/qca9558_engenius_epg5000.dts | 13 +- .../qca9558_librerouter_librerouter-v1.dts | 29 +- .../ath79/dts/qca9558_netgear_ex7300.dtsi | 23 +- .../linux/ath79/dts/qca9558_ocedo_koala.dts | 16 +- .../linux/ath79/dts/qca9558_ocedo_ursus.dts | 6 +- .../ath79/dts/qca9558_openmesh_om5p-ac-v2.dts | 7 +- ...r-c7.dtsi => qca9558_tplink_archer-c.dtsi} | 20 +- .../ath79/dts/qca9558_tplink_archer-c5-v1.dts | 18 +- .../ath79/dts/qca9558_tplink_archer-c7-v1.dts | 18 +- .../ath79/dts/qca9558_tplink_archer-c7-v2.dts | 18 +- .../ath79/dts/qca9558_tplink_re350k-v1.dts | 18 +- .../ath79/dts/qca9558_tplink_re355-v1.dts | 9 + .../ath79/dts/qca9558_tplink_re450-v1.dts | 9 + .../linux/ath79/dts/qca9558_tplink_rex5x.dtsi | 181 ++ .../dts/qca9558_tplink_tl-wdr4900-v2.dts | 7 +- .../ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi | 11 +- .../dts/qca9558_tplink_tl-wr1045nd-v2.dts | 9 + .../dts/qca9558_tplink_tl-wr941n-v7-cn.dts | 1 + .../ath79/dts/qca9558_trendnet_tew-823dru.dts | 215 +++ .../linux/ath79/dts/qca9558_zyxel_nbg6716.dts | 300 ++++ .../linux/ath79/dts/qca9561_avm_fritz4020.dts | 26 +- .../dts/qca9561_tplink_archer-c25-v1.dts | 202 +++ .../dts/qca9561_tplink_archer-c58-v1.dts | 69 - .../dts/qca9561_tplink_archer-c59-v1.dts | 81 +- .../dts/qca9561_tplink_archer-c59-v2.dts | 86 + .../ath79/dts/qca9561_tplink_archer-c5x.dtsi | 84 +- .../dts/qca9561_tplink_archer-c60-v1.dts | 56 + .../dts/qca9561_tplink_archer-c60-v2.dts | 62 + .../ath79/dts/qca9561_tplink_archer-c6x.dtsi | 110 ++ .../ath79/dts/qca9561_xiaomi_mi-router-4q.dts | 3 +- .../ath79/dts/qca9563_dlink_dir-842-c.dtsi | 145 ++ .../ath79/dts/qca9563_dlink_dir-842-c1.dts | 41 + .../ath79/dts/qca9563_dlink_dir-842-c2.dts | 49 + .../ath79/dts/qca9563_dlink_dir-842-c3.dts | 41 + .../ath79/dts/qca9563_dlink_dir-859-a1.dts | 21 +- .../dts/qca9563_elecom_wrc-1750ghbk2-i.dts | 6 +- .../dts/qca9563_elecom_wrc-300ghbk2-i.dts | 6 +- .../ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi | 14 +- .../dts/qca9563_glinet_gl-ar750s-nor-nand.dts | 18 + .../dts/qca9563_glinet_gl-ar750s-nor.dts | 18 + ...750s.dts => qca9563_glinet_gl-ar750s.dtsi} | 121 +- .../linux/ath79/dts/qca9563_nec_wg1200cr.dts | 14 +- .../linux/ath79/dts/qca9563_nec_wg800hp.dts | 12 +- .../linux/ath79/dts/qca9563_phicomm_k2t.dts | 3 +- .../ath79/dts/qca9563_rosinson_wr818.dts | 19 +- .../ath79/dts/qca9563_tplink_archer-a7-v5.dts | 17 +- .../ath79/dts/qca9563_tplink_archer-c2-v3.dts | 20 +- .../dts/qca9563_tplink_archer-c6-v2-us.dts | 130 ++ .../ath79/dts/qca9563_tplink_archer-c6-v2.dts | 117 +- .../ath79/dts/qca9563_tplink_archer-c7-v4.dts | 21 +- .../ath79/dts/qca9563_tplink_archer-c7-v5.dts | 13 +- .../dts/qca9563_tplink_archer-x6-v2.dtsi | 123 +- .../dts/qca9563_tplink_archer-x7-v5.dtsi | 31 +- .../ath79/dts/qca9563_tplink_re450-v2.dts | 12 +- .../dts/qca9563_tplink_tl-wr1043n-v5.dts | 74 + .../ath79/dts/qca9563_tplink_tl-wr1043n.dtsi | 85 +- .../dts/qca9563_tplink_tl-wr1043nd-v4.dts | 76 +- .../ath79/dts/qca9563_ubnt_unifiac-lite.dts | 2 +- .../ath79/dts/qca9563_ubnt_unifiac-lite.dtsi | 8 +- .../ath79/dts/qca9563_ubnt_unifiac-lr.dts | 9 + .../ath79/dts/qca9563_ubnt_unifiac-pro.dtsi | 8 +- .../linux/ath79/dts/qca9563_ubnt_unifiac.dtsi | 22 +- .../linux/ath79/dts/qca9563_yuncore_a782.dts | 32 + .../ath79/dts/qca9563_yuncore_xd4200.dts | 32 + .../ath79/dts/qca9563_yuncore_xd4200.dtsi | 122 ++ target/linux/ath79/dts/qca956x.dtsi | 66 +- .../ath79/dts/tp9343_tplink_tl-wr940n-v3.dts | 9 + .../ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi | 69 + .../ath79/dts/tp9343_tplink_tl-wr940n-v4.dts | 71 + .../ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts | 9 + .../ath79/dts/tp9343_tplink_tl-wr94x.dtsi | 93 ++ .../files/drivers/mtd/nand/raw/ar934x_nand.c | 1481 +++++++++++++++++ .../ethernet/atheros/ag71xx/ag71xx_ethtool.c | 40 +- .../net/ethernet/atheros/ag71xx/ag71xx_main.c | 25 +- .../net/ethernet/atheros/ag71xx/ag71xx_phy.c | 4 +- .../base-files/etc/board.d/01_leds | 180 +- .../base-files/etc/board.d/02_network | 275 +-- .../base-files/etc/board.d/03_gpio_switches | 76 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 142 ++ .../etc/hotplug.d/firmware/11-ath10k-caldata | 167 ++ .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 45 + .../generic/base-files/etc/init.d/bootcount | 16 + .../etc/uci-defaults/04_led_migration | 39 + .../etc/uci-defaults/09_fix-checksum | 15 + .../base-files/lib/functions/k2t.sh | 0 .../base-files/lib/upgrade/platform.sh | 14 +- target/linux/ath79/generic/config-default | 12 +- target/linux/ath79/image/Makefile | 4 + .../bin/pisen_wmb001n_factory-header.bin | Bin 0 -> 288 bytes target/linux/ath79/image/common-buffalo.mk | 16 +- target/linux/ath79/image/common-netgear.mk | 21 +- target/linux/ath79/image/common-tp-link.mk | 16 +- target/linux/ath79/image/common-yuncore.mk | 12 + target/linux/ath79/image/generic-tp-link.mk | 486 ++++-- target/linux/ath79/image/generic-ubnt.mk | 344 ++-- target/linux/ath79/image/generic.mk | 754 +++++++-- target/linux/ath79/image/nand.mk | 174 +- target/linux/ath79/image/tiny-netgear.mk | 38 +- target/linux/ath79/image/tiny-tp-link.mk | 147 +- target/linux/ath79/image/tiny.mk | 8 +- .../ath79/nand/base-files/etc/board.d/01_leds | 23 + .../nand/base-files/etc/board.d/02_network | 60 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 36 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 26 + .../nand/base-files/etc/init.d/bootcount | 13 + .../nand/base-files/lib/upgrade/glinet.sh | 90 + .../nand/base-files/lib/upgrade/platform.sh | 29 + target/linux/ath79/nand/config-default | 20 +- .../linux/ath79/nand/profiles/00-default.mk | 2 +- target/linux/ath79/nand/target.mk | 7 +- .../0038-at803x-disable-delays.patch | 27 + .../0038-at803x-disable-delays.patch | 27 + .../408-mtd-redboot_partition_scan.patch | 44 + .../440-mtd-ar934x-nand-driver.patch | 25 + .../ath79/tiny/base-files/etc/board.d/01_leds | 85 + .../tiny/base-files/etc/board.d/02_network | 96 ++ .../etc/hotplug.d/firmware/10-ath9k-eeprom | 38 + .../tiny/base-files/lib/upgrade/platform.sh | 20 + target/linux/ath79/tiny/config-default | 9 - 283 files changed, 13499 insertions(+), 3357 deletions(-) delete mode 100755 target/linux/ath79/base-files/etc/board.d/03_gpio_switches delete mode 100644 target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom delete mode 100644 target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata create mode 100644 target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration delete mode 100644 target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration delete mode 100644 target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac delete mode 100644 target/linux/ath79/base-files/etc/uci-defaults/04_led_migration create mode 100644 target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts create mode 100644 target/linux/ath79/dts/ar7161_adtran_bsap1800-v2.dts create mode 100644 target/linux/ath79/dts/ar7161_adtran_bsap1840.dts create mode 100644 target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi create mode 100644 target/linux/ath79/dts/ar7161_aruba_ap-105.dts create mode 100644 target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts create mode 100644 target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts create mode 100644 target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts create mode 100644 target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts create mode 100644 target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts create mode 100644 target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi create mode 100644 target/linux/ath79/dts/ar9331_8dev_carambola2.dts create mode 100644 target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts delete mode 100644 target/linux/ath79/dts/ar9331_dptechnics_dpt-module.dts delete mode 100644 target/linux/ath79/dts/ar9331_dragino_ms14.dts delete mode 100644 target/linux/ath79/dts/ar9331_onion_omega.dts create mode 100644 target/linux/ath79/dts/ar9331_pisen_ts-d084.dts create mode 100644 target/linux/ath79/dts/ar9341_pisen_wmb001n.dts create mode 100644 target/linux/ath79/dts/ar9341_tplink.dtsi create mode 100644 target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts create mode 100644 target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts create mode 100644 target/linux/ath79/dts/ar9344_netgear_wndr.dtsi create mode 100644 target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts create mode 100644 target/linux/ath79/dts/ar9344_netgear_wndr4300.dts create mode 100644 target/linux/ath79/dts/ar9344_qihoo_c301.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe.dtsi create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe210-v1.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe220-v2.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe510-v1.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe610-v1.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi create mode 100644 target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi create mode 100644 target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts rename target/linux/ath79/dts/{ar9344_tplink_tl-wdr3600.dts => ar9344_tplink_tl-wdr3600-v1.dts} (56%) rename target/linux/ath79/dts/{ar9344_tplink_tl-wdr4300.dts => ar9344_tplink_tl-wdr4300-v1.dts} (56%) create mode 100644 target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi create mode 100644 target/linux/ath79/dts/ar9344_tplink_wbs210-v2.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_wbs510-v1.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_wbs510-v2.dts create mode 100644 target/linux/ath79/dts/ar9344_wd_mynet-n750.dts create mode 100644 target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts create mode 100644 target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts create mode 100644 target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts create mode 100644 target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts create mode 100644 target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts create mode 100644 target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi create mode 100644 target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10.dts create mode 100644 target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dtsi create mode 100644 target/linux/ath79/dts/qca9533_tplink_tl-wr841-v12.dts create mode 100644 target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts create mode 100644 target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts create mode 100644 target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts create mode 100644 target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi create mode 100644 target/linux/ath79/dts/qca9558_devolo_dvl1750x.dts create mode 100644 target/linux/ath79/dts/qca9558_engenius_ecb1750.dts rename target/linux/ath79/dts/{qca9558_tplink_archer-c7.dtsi => qca9558_tplink_archer-c.dtsi} (93%) create mode 100644 target/linux/ath79/dts/qca9558_tplink_re355-v1.dts create mode 100644 target/linux/ath79/dts/qca9558_tplink_re450-v1.dts create mode 100644 target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi create mode 100644 target/linux/ath79/dts/qca9558_tplink_tl-wr1045nd-v2.dts create mode 100644 target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts create mode 100644 target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts create mode 100644 target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts create mode 100644 target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts create mode 100644 target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts create mode 100644 target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts create mode 100644 target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi create mode 100644 target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi create mode 100644 target/linux/ath79/dts/qca9563_dlink_dir-842-c1.dts create mode 100644 target/linux/ath79/dts/qca9563_dlink_dir-842-c2.dts create mode 100644 target/linux/ath79/dts/qca9563_dlink_dir-842-c3.dts create mode 100644 target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts create mode 100644 target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts rename target/linux/ath79/dts/{qca9563_glinet_gl-ar750s.dts => qca9563_glinet_gl-ar750s.dtsi} (61%) create mode 100644 target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts create mode 100644 target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts create mode 100644 target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts create mode 100644 target/linux/ath79/dts/qca9563_yuncore_a782.dts create mode 100644 target/linux/ath79/dts/qca9563_yuncore_xd4200.dts create mode 100644 target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi create mode 100644 target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dts create mode 100644 target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi create mode 100644 target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts create mode 100644 target/linux/ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts create mode 100644 target/linux/ath79/dts/tp9343_tplink_tl-wr94x.dtsi create mode 100644 target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c rename target/linux/ath79/{ => generic}/base-files/etc/board.d/01_leds (59%) rename target/linux/ath79/{ => generic}/base-files/etc/board.d/02_network (63%) create mode 100755 target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches create mode 100644 target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom create mode 100644 target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata create mode 100644 target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac create mode 100755 target/linux/ath79/generic/base-files/etc/init.d/bootcount create mode 100644 target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration create mode 100644 target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum rename target/linux/ath79/{ => generic}/base-files/lib/functions/k2t.sh (100%) rename target/linux/ath79/{ => generic}/base-files/lib/upgrade/platform.sh (76%) create mode 100644 target/linux/ath79/image/bin/pisen_wmb001n_factory-header.bin create mode 100644 target/linux/ath79/image/common-yuncore.mk create mode 100755 target/linux/ath79/nand/base-files/etc/board.d/01_leds create mode 100755 target/linux/ath79/nand/base-files/etc/board.d/02_network create mode 100644 target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom create mode 100644 target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata create mode 100755 target/linux/ath79/nand/base-files/etc/init.d/bootcount create mode 100644 target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh create mode 100644 target/linux/ath79/nand/base-files/lib/upgrade/platform.sh create mode 100644 target/linux/ath79/patches-4.14/0038-at803x-disable-delays.patch create mode 100644 target/linux/ath79/patches-4.19/0038-at803x-disable-delays.patch create mode 100644 target/linux/ath79/patches-4.19/408-mtd-redboot_partition_scan.patch create mode 100644 target/linux/ath79/patches-4.19/440-mtd-ar934x-nand-driver.patch create mode 100755 target/linux/ath79/tiny/base-files/etc/board.d/01_leds create mode 100755 target/linux/ath79/tiny/base-files/etc/board.d/02_network create mode 100644 target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom create mode 100644 target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh diff --git a/target/linux/ath79/Makefile b/target/linux/ath79/Makefile index 82f6317ac..cfdf8c87e 100644 --- a/target/linux/ath79/Makefile +++ b/target/linux/ath79/Makefile @@ -8,7 +8,7 @@ SUBTARGETS:=generic nand tiny FEATURES:=ramdisk -KERNEL_PATCHVER:=4.14 +KERNEL_PATCHVER:=4.19 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/ath79/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/base-files/etc/board.d/03_gpio_switches deleted file mode 100755 index 6a51a7979..000000000 --- a/target/linux/ath79/base-files/etc/board.d/03_gpio_switches +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2018 OpenWrt.org -# - -. /lib/functions/uci-defaults.sh - -board_config_update - -board=$(board_name) - -case "$board" in -comfast,cf-e5) - ucidef_add_gpio_switch "lte_power" "LTE Power" "14" "1" - ucidef_add_gpio_switch "lte_wakeup" "LTE Wakeup" "11" "1" - ucidef_add_gpio_switch "lte_poweroff" "LTE Poweroff" "1" "1" - ucidef_add_gpio_switch "lte_reset" "LTE Reset" "12" "1" - ;; -dlink,dir-825-c1|\ -dlink,dir-835-a1) - ucidef_add_gpio_switch "wan_led_auto" "WAN LED Auto" "20" "0" - ;; -librerouter,librerouter-v1) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "1" "0" - ;; -ubnt,nanostation-ac) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3" - ;; -ubnt,acb-isp) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" - ;; -esac - -board_config_flush - -exit 0 diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom deleted file mode 100644 index 90f8ca96d..000000000 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ /dev/null @@ -1,226 +0,0 @@ -#!/bin/sh - -[ -e /lib/firmware/$FIRMWARE ] && exit 0 - -. /lib/functions.sh -. /lib/functions/system.sh - -ath9k_eeprom_die() { - echo "ath9k eeprom: " "$*" - exit 1 -} - -ath9k_eeprom_extract() { - local part=$1 - local offset=$2 - local count=$3 - local mtd - - mtd=$(find_mtd_chardev $part) - [ -n "$mtd" ] || \ - ath9k_eeprom_die "no mtd device found for partition $part" - - dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ - ath9k_eeprom_die "failed to extract from $mtd" -} - -ath9k_eeprom_extract_reverse() { - local part=$1 - local offset=$2 - local count=$3 - local mtd - local reversed - local caldata - - mtd=$(find_mtd_chardev "$part") - reversed=$(hexdump -v -s $offset -n $count -e '/1 "%02x "' $mtd) - - for byte in $reversed; do - caldata="\x${byte}${caldata}" - done - - printf "%b" "$caldata" > /lib/firmware/$FIRMWARE -} - -xor() { - local val - local ret="0x$1" - local retlen=${#1} - - shift - while [ -n "$1" ]; do - val="0x$1" - ret=$((ret ^ val)) - shift - done - - printf "%0${retlen}x" "$ret" -} - -ath9k_patch_fw_mac() { - local mac=$1 - local mac_offset=$2 - local chksum_offset=$3 - local xor_mac - local xor_fw_mac - local xor_fw_chksum - - [ -z "$mac" -o -z "$mac_offset" ] && return - - [ -n "$chksum_offset" ] && { - xor_mac=${mac//:/} - xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}" - - xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE) - xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}" - - xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE) - xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac) - - printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \ - dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$chksum_offset count=2 - } - - macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=$mac_offset count=1 -} - -ath9k_patch_fw_mac_crc() { - local mac=$1 - local mac_offset=$2 - local chksum_offset=$((mac_offset - 10)) - - ath9k_patch_fw_mac "${mac}" "${mac_offset}" "${chksum_offset}" -} - -board=$(board_name) - -case "$FIRMWARE" in -"ath9k-eeprom-ahb-18100000.wmac.bin") - case $board in - avm,fritz4020) - ath9k_eeprom_extract_reverse "urlader" 5441 1088 - ;; - dlink,dir-825-c1|\ - dlink,dir-835-a1) - ath9k_eeprom_extract "art" 4096 1088 - ath9k_patch_fw_mac_crc $(mtd_get_mac_text "mac" 4) 2 - ;; - dlink,dir-859-a1) - ath9k_eeprom_extract "art" 4096 1088 - ath9k_patch_fw_mac $(mtd_get_mac_ascii devdata "wlan24mac") 2 - ;; - engenius,epg5000|\ - iodata,wn-ac1167dgr|\ - iodata,wn-ac1600dgr|\ - iodata,wn-ac1600dgr2|\ - iodata,wn-ag300dgr) - ath9k_eeprom_extract "art" 4096 1088 - ath9k_patch_fw_mac $(mtd_get_mac_ascii u-boot-env ethaddr) 2 - ;; - nec,wg1200cr) - ath9k_eeprom_extract "art" 4096 1088 - ath9k_patch_fw_mac $(mtd_get_mac_ascii devdata wlan24mac) 2 - ;; - nec,wg800hp) - ath9k_eeprom_extract "art" 4096 1088 - ath9k_patch_fw_mac $(mtd_get_mac_text board_data 1664) 2 - ;; - *) - ath9k_eeprom_die "board $board is not supported yet" - ;; - esac - ;; -"ath9k-eeprom-pci-0000:00:00.0.bin") - case $board in - avm,fritz300e) - ath9k_eeprom_extract_reverse "urloader" 5441 1088 - ;; - buffalo,whr-g301n|\ - buffalo,wzr-hp-g302h-a1a0|\ - tplink,tl-wr841-v5|\ - tplink,tl-wr941-v4) - ath9k_eeprom_extract "art" 4096 3768 - ;; - buffalo,wzr-hp-g450h) - ath9k_eeprom_extract "ART" 4096 1088 - ;; - dlink,dir-825-c1|\ - dlink,dir-835-a1) - ath9k_eeprom_extract "art" 20480 1088 - ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "mac" 24) 1) 2 - ;; - ocedo,raccoon|\ - tplink,tl-wdr3600|\ - tplink,tl-wdr4300|\ - tplink,tl-wdr4900-v2|\ - winchannel,wb2000) - ath9k_eeprom_extract "art" 20480 1088 - ;; - netgear,wnr612-v2|\ - on,n150r|\ - pcs,cap324|\ - tplink,tl-mr3220-v1|\ - tplink,tl-mr3420-v1|\ - tplink,tl-wr2543-v1|\ - tplink,tl-wr740n-v1|\ - tplink,tl-wr740n-v3|\ - tplink,tl-wr741-v1|\ - tplink,tl-wr743nd-v1|\ - tplink,tl-wr841-v7|\ - tplink,tl-wr842n-v1|\ - ubnt,airrouter|\ - ubnt,bullet-m|\ - ubnt,nano-m|\ - ubnt,rocket-m) - ath9k_eeprom_extract "art" 4096 4096 - ;; - pqi,air-pen) - ath9k_eeprom_extract "art" 4096 2002 - ;; - ubnt,unifi) - ath9k_eeprom_extract "art" 4096 2048 - ;; - wd,mynet-wifi-rangeextender) - ath9k_eeprom_extract "art" 4096 4096 - ath9k_patch_fw_mac_crc $(nvram get wl0_hwaddr) "$mac" 2 - ;; - *) - ath9k_eeprom_die "board $board is not supported yet" - ;; - esac - ;; -"ath9k-eeprom-pci-0000:00:11.0.bin") - case $board in - buffalo,wzr-hp-ag300h|\ - netgear,wndr3700|\ - netgear,wndr3700v2|\ - netgear,wndr3800) - ath9k_eeprom_extract "art" 4096 3768 - ;; - dlink,dir-825-b1) - ath9k_eeprom_extract "caldata" 4096 3768 - ath9k_patch_fw_mac_crc $(mtd_get_mac_text "caldata" 65440) 524 - ;; - *) - ath9k_eeprom_die "board $board is not supported yet" - ;; - esac - ;; -"ath9k-eeprom-pci-0000:00:12.0.bin") - case $board in - buffalo,wzr-hp-ag300h|\ - netgear,wndr3700|\ - netgear,wndr3700v2|\ - netgear,wndr3800) - ath9k_eeprom_extract "art" 20480 3768 - ;; - dlink,dir-825-b1) - ath9k_eeprom_extract "caldata" 20480 3768 - ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 65460) 1) 524 - ;; - *) - ath9k_eeprom_die "board $board is not supported yet" - ;; - esac - ;; -esac diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata deleted file mode 100644 index fc3f7142b..000000000 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ /dev/null @@ -1,197 +0,0 @@ -#!/bin/sh - -. /lib/functions/k2t.sh - -# xor multiple hex values of the same length -xor() { - local val - local ret="0x$1" - local retlen=${#1} - - shift - while [ -n "$1" ]; do - val="0x$1" - ret=$((ret ^ val)) - shift - done - - printf "%0${retlen}x" "$ret" -} - -ath10kcal_die() { - echo "ath10cal: " "$*" - exit 1 -} - -ath10kcal_from_file() { - local source=$1 - local offset=$2 - local count=$3 - - dd if=$source of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ - ath10kcal_die "failed to extract calibration data from $source" -} - -ath10kcal_extract() { - local part=$1 - local offset=$2 - local count=$3 - local mtd - - mtd=$(find_mtd_chardev $part) - [ -n "$mtd" ] || \ - ath10kcal_die "no mtd device found for partition $part" - - dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ - ath10kcal_die "failed to extract calibration data from $mtd" -} - -ath10kcal_patch_mac() { - local mac=$1 - - [ -z "$mac" ] && return - - macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=6 count=1 -} - -ath10kcal_patch_mac_crc() { - local mac=$1 - local mac_offset=6 - local chksum_offset=2 - local xor_mac - local xor_fw_mac - local xor_fw_chksum - - xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE) - xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}" - - ath10kcal_patch_mac "$mac" && { - xor_mac=${mac//:/} - xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}" - - xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE) - xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac) - - printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \ - dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$chksum_offset count=2 - } -} - -[ -e /lib/firmware/$FIRMWARE ] && exit 0 - -. /lib/functions.sh -. /lib/functions/system.sh - -board=$(board_name) - -case "$FIRMWARE" in -"ath10k/cal-pci-0000:00:00.0.bin") - case $board in - devolo,dvl1200e|\ - devolo,dvl1200i|\ - devolo,dvl1750c|\ - devolo,dvl1750e|\ - devolo,dvl1750i) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0) -1) - ;; - dlink,dir-859-a1) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac") - ;; - elecom,wrc-1750ghbk2-i) - ath10kcal_extract "ART" 20480 2116 - ;; - engenius,epg5000|\ - iodata,wn-ac1167dgr|\ - iodata,wn-ac1600dgr2) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) - ;; - engenius,ews511ap|\ - glinet,gl-ar750s|\ - glinet,gl-x750|\ - tplink,re450-v2) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) - ;; - nec,wg800hp) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac_crc $(mtd_get_mac_text board_data 2176) - ;; - ocedo,koala|\ - ocedo,ursus) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac $(mtd_get_mac_binary art 12) - ;; - openmesh,om5p-ac-v2) - ath10kcal_extract "ART" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) - ;; - tplink,archer-c2-v3) - ath10kcal_extract "ART" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -1) - ;; - tplink,archer-c5-v1|\ - tplink,archer-c7-v2) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1) - ;; - tplink,archer-a7-v5|\ - tplink,archer-c7-v4|\ - tplink,archer-c7-v5) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -1) - ;; - tplink,re350k-v1) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +2) - ;; - ubnt,unifiac-lite|\ - ubnt,unifiac-mesh|\ - ubnt,unifiac-mesh-pro|\ - ubnt,lap-120|\ - ubnt,nanobeam-ac|\ - ubnt,nanostation-ac|\ - ubnt,nanostation-ac-loco|\ - ubnt,unifiac-pro) - ath10kcal_extract "EEPROM" 20480 2116 - ;; - yuncore,a770) - ath10kcal_extract "art" 20480 2116 - ;; - esac - ;; -"ath10k/pre-cal-pci-0000:00:00.0.bin") - case $board in - nec,wg1200cr) - ath10kcal_extract "art" 20480 12064 - ath10kcal_patch_mac_crc $(mtd_get_mac_ascii devdata wlan5mac) - ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ - /lib/firmware/ath10k/QCA9888/hw2.0/board.bin - ;; - netgear,ex6400|\ - netgear,ex7300) - ath10kcal_extract "caldata" 20480 12064 - ath10kcal_patch_mac $(mtd_get_mac_binary caldata 12) - ;; - phicomm,k2t) - ath10kcal_extract "art" 20480 12064 - ath10kcal_patch_mac_crc $(k2t_get_mac "5g_mac") - ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ - /lib/firmware/ath10k/QCA9888/hw2.0/board.bin - ;; - tplink,archer-c58-v1|\ - tplink,archer-c59-v1|\ - tplink,archer-c6-v2) - ath10kcal_extract "art" 20480 12064 - ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary mac 8) -1) - ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ - /lib/firmware/ath10k/QCA9888/hw2.0/board.bin - ;; - esac - ;; -*) - exit 1 - ;; -esac diff --git a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration new file mode 100644 index 000000000..b0a5d79f9 --- /dev/null +++ b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration @@ -0,0 +1,52 @@ +#!/bin/sh + +WIFI_PATH_CHANGED=0 + +. /lib/functions.sh + +migrate_wifi_path() { + local section="$1" + local path + + config_get path ${section} path + case ${path} in + "pci0000:01/0000:01:00.0") + board=$(board_name) + + case "$board" in + tplink,archer-c7-v1|\ + tplink,archer-c7-v2|\ + zyxel,nbg6716) + path="pci0000:00/0000:00:00.0" + WIFI_PATH_CHANGED=1 + ;; + *) + return 0 + ;; + esac + ;; + "platform/ahb/ahb:apb/18100000.wmac"|\ + "platform/ar933x_wmac"|\ + "platform/ar934x_wmac"|\ + "platform/qca953x_wmac"|\ + "platform/qca955x_wmac"|\ + "platform/qca956x_wmac") + path="platform/ahb/18100000.wmac" + WIFI_PATH_CHANGED=1 + ;; + *) + return 0 + ;; + esac + + uci set wireless.${section}.path=${path} +} + +[ "${ACTION}" = "add" ] && { + [ ! -e /etc/config/wireless ] && return 0 + + config_load wireless + config_foreach migrate_wifi_path wifi-device + + [ "${WIFI_PATH_CHANGED}" = "1" ] && uci commit wireless +} diff --git a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration deleted file mode 100644 index b051daf98..000000000 --- a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -WMAC_PATH_CHANGED=0 - -. /lib/functions.sh - -migrate_wmac_path() { - local section="$1" - local path - - config_get path ${section} path - case ${path} in - "platform/qca955x_wmac") - path="platform/ahb/ahb:apb/18100000.wmac" - WMAC_PATH_CHANGED=1 - ;; - "platform/ar933x_wmac") - path="platform/ahb/18100000.wmac" - WMAC_PATH_CHANGED=1 - ;; - *) - return 0 - ;; - esac - - uci set wireless.${section}.path=${path} -} - -[ "${ACTION}" = "add" ] && { - [ ! -e /etc/config/wireless ] && return 0 - - config_load wireless - config_foreach migrate_wmac_path wifi-device - - [ "${WMAC_PATH_CHANGED}" = "1" ] && uci commit wireless -} diff --git a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac deleted file mode 100644 index 2da2e8bfb..000000000 --- a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/ash - -[ "$ACTION" == "add" ] || exit 0 - -PHYNBR=${DEVPATH##*/phy} - -[ -n $PHYNBR ] || exit 0 - -. /lib/functions.sh -. /lib/functions/system.sh -. /lib/functions/k2t.sh - -board=$(board_name) - -case "$board" in - iodata,wn-ag300dgr) - # There is no eeprom data for 5 GHz wlan in "art" partition - # which would allow to patch the macaddress - [ "$PHYNBR" -eq 1 ] && \ - echo $(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1) > /sys${DEVPATH}/macaddress - ;; - iodata,wn-ac1600dgr) - # There is no eeprom data for 5 GHz wlan in "art" partition - # which would allow to patch the macaddress - [ "$PHYNBR" -eq 0 ] && \ - echo $(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1) > /sys${DEVPATH}/macaddress - ;; - phicomm,k2t) - # The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address - [ "$PHYNBR" -eq 1 ] && \ - echo $(k2t_get_mac "lan_mac") > /sys${DEVPATH}/macaddress - ;; - *) - ;; -esac - diff --git a/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration deleted file mode 100644 index 2ca87ccb3..000000000 --- a/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh -. /lib/functions/migrations.sh - -board=$(board_name) - -case "$board" in -engenius,epg5000) - migrate_leds ":wlan-2g=:wlan2g" ":wlan-5g=:wlan5g" - ;; -esac - -migrations_apply system - -exit 0 diff --git a/target/linux/ath79/config-4.14 b/target/linux/ath79/config-4.14 index 5a2c685d4..1ff3f1272 100644 --- a/target/linux/ath79/config-4.14 +++ b/target/linux/ath79/config-4.14 @@ -27,6 +27,7 @@ CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_ATH79=y CONFIG_ATH79_WDT=y +CONFIG_BLK_MQ_PCI=y CONFIG_CEVT_R4K=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y @@ -179,12 +180,20 @@ CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set CONFIG_OF=y CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y CONFIG_OF_MDIO=y CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PCI=y +CONFIG_PCI_AR71XX=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 diff --git a/target/linux/ath79/config-4.19 b/target/linux/ath79/config-4.19 index 6cdbb968c..be5e46ac7 100644 --- a/target/linux/ath79/config-4.19 +++ b/target/linux/ath79/config-4.19 @@ -20,6 +20,7 @@ CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_ATH79=y CONFIG_ATH79_WDT=y +CONFIG_BLK_MQ_PCI=y CONFIG_CEVT_R4K=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y @@ -167,6 +168,7 @@ CONFIG_MTD_PARSER_CYBERTAN=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPLIT_LZMA_FW=y +CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_TPLINK_PARTS=y @@ -184,6 +186,11 @@ CONFIG_OF_IRQ=y CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y CONFIG_OF_NET=y +CONFIG_PCI=y +CONFIG_PCI_AR71XX=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 diff --git a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts index 5ad8196a1..536432e25 100644 --- a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts +++ b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts @@ -11,16 +11,16 @@ model = "I-O DATA WN-AG300DGR"; aliases { - led-boot = &router; - led-failsafe = &router; - led-running = &router; - led-upgrade = &router; + led-boot = &led_router; + led-failsafe = &led_router; + led-running = &led_router; + led-upgrade = &led_router; }; leds { compatible = "gpio-leds"; - router: router { + led_router: router { label = "wn-ag300dgr:green:router"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -55,8 +55,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; eco { label = "eco"; @@ -109,9 +108,10 @@ }; &spi { - num-cs = <1>; status = "okay"; + num-cs = <1>; + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; @@ -213,5 +213,6 @@ &wmac { status = "okay"; + qca,no-eeprom; }; diff --git a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts new file mode 100644 index 000000000..c08a1277c --- /dev/null +++ b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts @@ -0,0 +1,172 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + model = "Sitecom WLR-7100 v1 002 (X7 AC1200)"; + compatible = "sitecom,wlr-7100", "qca,ar9344"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + wlan2g { + label = "2.4GHz"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wlan5g { + label = "5GHz"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + ops { + label = "wlr-7100:white:ops"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "wlr-7100:amber:power"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "wlr-7100:blue:wlan2g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x06000000 0x00000101 0x00001616>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + + qca,ar8327-initvals = < + 0x04 0x87a00000 /* PORT0 PAD Mode */ + 0x0c 0x01000000 /* PORT6 PAD Mode */ + 0x10 0x80000000 /* PWS_REG_VALUE */ + 0x7c 0x000000fe /* PORT0_STATUS */ + 0x94 0x000000fe /* PORT6_STATUS */ + >; + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + }; +}; + +&ref { + clock-frequency = <25000000>; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + uenv: partition@30000 { + label = "u-boot-env"; + reg = <0x030000 0x010000>; + read-only; + }; + + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x040000 0x750000>; + }; + + partition@790000 { + label = "backup"; + reg = <0x790000 0x010000>; + read-only; + }; + + partition@7a0000 { + label = "storage"; + reg = <0x7a0000 0x050000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; diff --git a/target/linux/ath79/dts/ar7161_adtran_bsap1800-v2.dts b/target/linux/ath79/dts/ar7161_adtran_bsap1800-v2.dts new file mode 100644 index 000000000..1745ac76f --- /dev/null +++ b/target/linux/ath79/dts/ar7161_adtran_bsap1800-v2.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar7161_adtran_bsap1880.dtsi" + +/ { + model = "Adtran/Bluesocket BSAP-1800 v2"; + compatible = "adtran,bsap1800-v2", "qca,ar7161"; +}; diff --git a/target/linux/ath79/dts/ar7161_adtran_bsap1840.dts b/target/linux/ath79/dts/ar7161_adtran_bsap1840.dts new file mode 100644 index 000000000..38b87a1e3 --- /dev/null +++ b/target/linux/ath79/dts/ar7161_adtran_bsap1840.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar7161_adtran_bsap1880.dtsi" + +/ { + model = "Adtran/Bluesocket BSAP-1840"; + compatible = "adtran,bsap1840", "qca,ar7161"; +}; diff --git a/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi b/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi new file mode 100644 index 000000000..f5dfa7791 --- /dev/null +++ b/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7100.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_yellow; + led-running = &led_status_green; + led-upgrade = &led_status_yellow; + }; + + leds { + compatible = "gpio-leds"; + + wlan5g { + label = "bluesocket:green:wifi5g"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan2g { + label = "bluesocket:green:wifi2g"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_status_green: status_green { + label = "bluesocket:green:status"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + led_status_yellow: status_yellow { + label = "bluesocket:yellow:status"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x1>; + + phy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + + phy-mode = "rgmii-id"; + phy-handle = <&phy0>; +}; + +&pcie0 { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + compatible = "ecoscentric,redboot-fis-partitions"; + }; + }; +}; + +&uart { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts new file mode 100644 index 000000000..d2a56f83c --- /dev/null +++ b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts @@ -0,0 +1,192 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7100.dtsi" + +/ { + compatible = "aruba,ap-105", "qca,ar7161"; + model = "Aruba AP-105"; + + chosen { + bootargs = "console=ttyS0,9600"; + }; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; + label-mac-device = ð0; + }; + + extosc: ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-output-names = "ref"; + clock-frequency = <40000000>; + }; + + leds { + compatible = "gpio-leds"; + + led_power_green: power_green { + label = "ap-105:green:power"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + led_power_red: power_red { + label = "ap-105:red:power"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + wifi_2g_red { + label = "ap-105:red:wlan2g"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + wifi_5g_red { + label = "ap-105:red:wlan5g"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wifi_2g_green { + label = "ap-105:green:wlan2g"; + gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi_5g_green { + label = "ap-105:green:wlan5g"; + gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + }; + + i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + scl-gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + + /* can be removed on 4.19 */ + gpios = <&gpio 5 GPIO_ACTIVE_LOW>, + <&gpio 4 GPIO_ACTIVE_LOW>; + + #address-cells = <1>; + #size-cells = <0>; + + tpm@29 { + compatible = "atmel,at97sc3203s"; + reg = <0x29>; + + /* triggering it, will also kill system */ + reset-gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie0 { + status = "okay"; + + ath9k0: wifi@0,11 { /* 2.4 GHz */ + compatible = "pci168c,0029"; + mtd-mac-address = <&hwinfo 0x1c>; + mtd-mac-address-increment = <1>; + reg = <0x8800 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + }; + + ath9k1: wifi@0,12 { /* 5 GHz */ + compatible = "pci168c,0029"; + mtd-mac-address = <&hwinfo 0x1c>; + mtd-mac-address-increment = <2>; + reg = <0x9000 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&uart { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x1>; + + phy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&hwinfo 0x1c>; + + pll-data = <0x00110000 0x00001099 0x00991099>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + reg = <0x40000 0xfa0000>; + compatible = "denx,uimage"; + }; + + hwinfo: partition@fe0000 { + label = "hwinfo"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + partition@ff0000 { + label = "u-boot-env"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts index df22eb8dc..2e00de888 100644 --- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts @@ -11,9 +11,9 @@ model = "Buffalo WZR-HP-AG300H/WZR-600DHP"; aliases { - led-boot = &diag; - led-failsafe = &diag; - led-upgrade = &diag; + led-boot = &led_diag; + led-failsafe = &led_diag; + led-upgrade = &led_diag; }; chosen { @@ -27,19 +27,18 @@ clock-frequency = <40000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; - diag: diag { + led_diag: diag { label = "buffalo:red:diag"; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; }; }; ath9k-leds { - // those leds are indeed attached to the wifi chips - compatible = "gpio-leds"; + band2g_a { label = "buffalo:amber:band2g"; gpios = <&ath9k0 1 GPIO_ACTIVE_LOW>; @@ -81,8 +80,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { linux,code = ; @@ -229,6 +227,7 @@ &spi { status = "okay"; + num-cs = <2>; cs-gpios = <0>, <0>; diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts index da1992197..92de193ab 100644 --- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts +++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts @@ -11,10 +11,10 @@ model = "D-Link DIR825B1"; aliases { - led-boot = &orange_power; - led-failsafe = &orange_power; - led-running = &blue_power; - led-upgrade = &orange_power; + led-boot = &led_power_orange; + led-failsafe = &led_power_orange; + led-running = &led_power_blue; + led-upgrade = &led_power_orange; }; chosen { @@ -30,35 +30,36 @@ leds { compatible = "gpio-leds"; - blue_usb { + + usb { label = "d-link:blue:usb"; gpios = <&gpio 0 GPIO_ACTIVE_LOW>; trigger-sources = <&usb_ochi_port>, <&usb_echi_port>; linux,default-trigger = "usbport"; }; - orange_power: orange_power { + led_power_orange: power_orange { label = "d-link:orange:power"; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; default-state = "on"; }; - blue_power: blue_power { + led_power_blue: power_blue { label = "d-link:blue:power"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; }; - blue_wps { + wps { label = "d-link:blue:wps"; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; }; - orange_planet { + planet_orange { label = "d-link:orange:planet"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; }; - blue_planet { + planet_blue { label = "d-link:blue:planet"; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; }; @@ -81,21 +82,18 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; linux,code = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; }; wps { label = "wps"; linux,code = ; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; }; }; @@ -120,7 +118,6 @@ }; }; - &usb1 { #address-cells = <1>; #size-cells = <0>; @@ -177,6 +174,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -222,9 +220,9 @@ }; }; - ð0 { status = "okay"; + pll-data = <0x11110000 0x00001099 0x00991099>; fixed-link { @@ -235,6 +233,7 @@ ð1 { status = "okay"; + pll-data = <0x11110000 0x00001099 0x00991099>; phy-handle = <&phy4>; diff --git a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts index 76f140fa5..cce95d7de 100644 --- a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts +++ b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts @@ -20,10 +20,10 @@ }; aliases { - led-boot = &d2; - led-failsafe = &d2; - led-running = &d2; - led-upgrade = &d2; + led-boot = &led_d2; + led-failsafe = &led_d2; + led-running = &led_d2; + led-upgrade = &led_d2; }; extosc: ref { @@ -36,7 +36,7 @@ leds { compatible = "gpio-leds"; - d2: d2 { + led_d2: d2 { label = "ja76pf2:green:d2"; gpios = <&gpio 5 GPIO_ACTIVE_LOW>; }; @@ -53,8 +53,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; sw1 { label = "sw1"; @@ -106,12 +105,13 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <104000000>; + spi-max-frequency = <25000000>; partitions { #address-cells = <1>; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dtsi b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dtsi index b1c4d87bc..7d842af06 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dtsi +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dtsi @@ -8,10 +8,11 @@ / { aliases { - led-boot = &power_orange; - led-failsafe = &power_orange; - led-running = &power_green; - led-upgrade = &power_orange; + led-boot = &led_power_orange; + led-failsafe = &led_power_orange; + led-running = &led_power_green; + led-upgrade = &led_power_orange; + label-mac-device = ð0; }; chosen { @@ -36,7 +37,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wps { @@ -44,12 +45,12 @@ gpios = <&gpio 0 GPIO_ACTIVE_LOW>; }; - power_green: power_green { + led_power_green: power_green { label = "netgear:green:power"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; }; - power_orange: power_orange { + led_power_orange: power_orange { label = "netgear:orange:power"; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -68,6 +69,7 @@ ath9k-leds { compatible = "gpio-leds"; + wlan2g { label = "netgear:green:wlan2g"; gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>; @@ -81,8 +83,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; wps { label = "wps"; @@ -105,6 +106,7 @@ rtl8366s { compatible = "realtek,rtl8366s"; + gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>; gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>; @@ -177,6 +179,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts index 589d0ec84..0959bf4d9 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts @@ -33,4 +33,3 @@ read-only; }; }; - diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts new file mode 100644 index 000000000..84a859b8c --- /dev/null +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar7161_netgear_wndr3700.dtsi" + +/ { + compatible = "netgear,wndr3800ch", "qca,ar7161"; + model = "Netgear WNDR3800CH"; +}; + +&partitions { + partition@0 { + label = "u-boot"; + reg = <0x000000 0x050000>; + read-only; + }; + + partition@50000 { + label = "u-boot-env"; + reg = <0x050000 0x020000>; + read-only; + }; + + partition@70000 { + label = "firmware"; + reg = <0x070000 0xf80000>; + compatible = "netgear,uimage"; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; +}; + diff --git a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi index 6e4361f10..4f52e3cc4 100644 --- a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi +++ b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi @@ -12,10 +12,10 @@ }; aliases { - led-boot = &rf; - led-failsafe = &rf; - led-running = &rf; - led-upgrade = &rf; + led-boot = &led_rf; + led-failsafe = &led_rf; + led-running = &led_rf; + led-upgrade = &led_rf; }; extosc: ref { @@ -28,15 +28,14 @@ leds { compatible = "gpio-leds"; - rf: rf_green { + led_rf: rf_green { label = "ubnt:green:rf"; gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; }; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "sw4"; diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts index 042219b23..a2d3a9943 100644 --- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts +++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts @@ -11,14 +11,13 @@ model = "Buffalo WHR-G301N"; aliases { - led-boot = &diag; - led-failsafe = &diag; - led-upgrade = &diag; + led-boot = &led_diag; + led-failsafe = &led_diag; + led-upgrade = &led_diag; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; router_on { label = "router_on"; @@ -51,7 +50,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; pinctrl-names = "default"; pinctrl-0 = <&switch_led_pins>; @@ -61,7 +60,7 @@ gpios = <&gpio 0 GPIO_ACTIVE_LOW>; }; - diag: diag { + led_diag: diag { label = "whr-g301n:red:diag"; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; }; @@ -110,6 +109,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts new file mode 100644 index 000000000..c231f4721 --- /dev/null +++ b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts @@ -0,0 +1,204 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7240.dtsi" + +/ { + compatible = "netgear,wnr1000-v2", "qca,ar7240"; + model = "Netgear WNR1000 v2"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power_amber; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; + label-mac-device = ð1; + }; + + ath9k-keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + wps { + label = "wps"; + linux,code = ; + gpios = <&ath9k 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&ath9k 7 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + rfkill { + label = "rfkill"; + linux,code = ; + gpios = <&ath9k 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins &clks_disable_pins>; + + led_power_green: power_green { + label = "netgear:green:power"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + led_power_amber: power_amber { + label = "netgear:amber:power"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + wan_green { + label = "netgear:green:wan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "netgear:amber:wan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + lan1_green { + label = "netgear:green:lan1"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan1_amber { + label = "netgear:amber:lan1"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + lan2_green { + label = "netgear:green:lan2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan2_amber { + label = "netgear:amber:lan2"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + lan3_green { + label = "netgear:green:lan3"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan3_amber { + label = "netgear:amber:lan3"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + lan4_green { + label = "netgear:green:lan4"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + lan4_amber { + label = "netgear:amber:lan4"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wps_green { + label = "netgear:green:wps"; + gpios = <&ath9k 5 GPIO_ACTIVE_LOW>; + }; + + wlan_blue { + label = "netgear:blue:wlan"; + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x3a0000>; + compatible = "netgear,uimage"; + }; + + art: partition@3f0000 { + label = "art"; + reg = <0x3f0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x6>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,002b"; + reg = <0x0000 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&uart { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts index b3ceecf93..41dbe709a 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts @@ -4,7 +4,6 @@ #include "ar7240_netgear_wnr612-v2.dtsi" / { - model = "Netgear WNR612 v2"; compatible = "netgear,wnr612-v2", "qca,ar7240"; + model = "Netgear WNR612 v2"; }; - diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi index 8e934429a..4ce7a0ec3 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi @@ -8,13 +8,14 @@ / { aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ð1; }; - keys { + ath9k-keys { compatible = "gpio-keys-polled"; poll-interval = <20>; @@ -28,7 +29,11 @@ leds { compatible = "gpio-leds"; - power: power { + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins &clks_disable_pins>; + + led_power: power { label = "netgear:green:power"; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; }; @@ -47,8 +52,12 @@ label = "netgear:green:wan"; gpios = <&gpio 17 GPIO_ACTIVE_LOW>; }; + }; - wlan: wlan { + ath9k-leds { + compatible = "gpio-leds"; + + wlan { label = "netgear:green:wlan"; gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; @@ -58,6 +67,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -70,7 +80,7 @@ #address-cells = <1>; #size-cells = <1>; - uboot: partition@0 { + partition@0 { reg = <0x0 0x40000>; label = "u-boot"; read-only; @@ -87,7 +97,7 @@ label = "firmware"; }; - partition@3f0000 { + art: partition@3f0000 { reg = <0x3f0000 0x10000>; label = "art"; read-only; @@ -99,15 +109,13 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + mtd-mac-address = <&art 0x0>; }; ð1 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + mtd-mac-address = <&art 0x6>; }; &pcie { @@ -116,6 +124,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,002b"; reg = <0x0000 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; diff --git a/target/linux/ath79/dts/ar7240_on_n150r.dts b/target/linux/ath79/dts/ar7240_on_n150r.dts index a318846a8..832227621 100644 --- a/target/linux/ath79/dts/ar7240_on_n150r.dts +++ b/target/linux/ath79/dts/ar7240_on_n150r.dts @@ -4,7 +4,6 @@ #include "ar7240_netgear_wnr612-v2.dtsi" / { - model = "ON Network N150R"; compatible = "on,n150r", "qca,ar7240"; + model = "ON Network N150R"; }; - diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi index b7db74d93..147fcad66 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi @@ -11,11 +11,11 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; + label-mac-device = &ath9k; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -32,7 +32,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; pinctrl-names = "default"; pinctrl-0 = <&switch_led_pins>; @@ -86,6 +86,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { diff --git a/target/linux/ath79/dts/ar7241.dtsi b/target/linux/ath79/dts/ar7241.dtsi index 155826610..8f0eb3b27 100644 --- a/target/linux/ath79/dts/ar7241.dtsi +++ b/target/linux/ath79/dts/ar7241.dtsi @@ -78,7 +78,7 @@ }; ð1 { - compatible = "qca,ar7241-eth", "syscon", "simple-mfd"; + compatible = "qca,ar7241-eth", "syscon"; pll-data = <0x00110000 0x00001099 0x00991099>; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts new file mode 100644 index 000000000..4d080c82f --- /dev/null +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts @@ -0,0 +1,208 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7241.dtsi" + +/ { + compatible = "netgear,wnr2000-v3", "qca,ar7241"; + model = "Netgear WNR2000 v3"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power_amber; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; + label-mac-device = ð1; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + }; + + ath9k-keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&ath9k 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + rfkill { + label = "rfkill"; + linux,code = ; + gpios = <&ath9k 9 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins &clks_disable_pins>; + + wan_green { + label = "netgear:green:wan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "netgear:amber:wan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + lan1_green { + label = "netgear:green:lan1"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan1_amber { + label = "netgear:amber:lan1"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + lan2_green { + label = "netgear:green:lan2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan2_amber { + label = "netgear:amber:lan2"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + lan3_green { + label = "netgear:green:lan3"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan3_amber { + label = "netgear:amber:lan3"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + lan4_green { + label = "netgear:green:lan4"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + lan4_amber { + label = "netgear:amber:lan4"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + wps_green { + label = "netgear:green:wps"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + led_power_green: power_green { + label = "netgear:green:power"; + gpios = <&ath9k 3 GPIO_ACTIVE_LOW>; + }; + + led_power_amber: power_amber { + label = "netgear:amber:power"; + gpios = <&ath9k 2 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + wlan_blue { + label = "netgear:blue:wlan"; + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x3a0000>; + compatible = "netgear,uimage"; + }; + + art: partition@3f0000 { + label = "art"; + reg = <0x3f0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + status = "okay"; + + compatible = "qca,ar7241-eth", "syscon", "simple-mfd"; + mtd-mac-address = <&art 0x6>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,002e"; + reg = <0x0000 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&uart { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts new file mode 100644 index 000000000..d182b58c0 --- /dev/null +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar7241_netgear_wnr2200.dtsi" + +/ { + compatible = "netgear,wnr2200-16m", "qca,ar7241"; + model = "Netgear WNR2200 (16M)"; +}; + +&partitions { + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfa0000>; + compatible = "netgear,uimage"; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; +}; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts new file mode 100644 index 000000000..e926c1789 --- /dev/null +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar7241_netgear_wnr2200.dtsi" + +/ { + compatible = "netgear,wnr2200-8m", "qca,ar7241"; + model = "Netgear WNR2200 (8M)"; +}; + +&partitions { + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x7a0000>; + compatible = "netgear,uimage"; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x10000>; + read-only; + }; +}; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi new file mode 100644 index 000000000..4c5ae697d --- /dev/null +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi @@ -0,0 +1,207 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7241.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power_amber; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; + label-mac-device = ð1; + }; + + ath9k-keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + wps { + label = "wps"; + linux,code = ; + gpios = <&ath9k 5 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&ath9k 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + rfkill { + label = "rfkill"; + linux,code = ; + gpios = <&ath9k 3 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins &clks_disable_pins>; + + wan_green { + label = "netgear:green:wan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "netgear:amber:wan"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + lan1_green { + label = "netgear:green:lan1"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan1_amber { + label = "netgear:amber:lan1"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + lan2_green { + label = "netgear:green:lan2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan2_amber { + label = "netgear:amber:lan2"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + lan3_green { + label = "netgear:green:lan3"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan3_amber { + label = "netgear:amber:lan3"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + lan4_green { + label = "netgear:green:lan4"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + lan4_amber { + label = "netgear:amber:lan4"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + wps_green { + label = "netgear:green:wps"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + usb_green { + label = "netgear:green:usb"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port>; + linux,default-trigger = "usbport"; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + led_power_green: power_green { + label = "netgear:green:power"; + gpios = <&ath9k 2 GPIO_ACTIVE_LOW>; + }; + + led_power_amber: power_amber { + label = "netgear:amber:power"; + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + wlan_blue { + label = "netgear:blue:wlan"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + status = "okay"; + + compatible = "qca,ar7241-eth", "syscon", "simple-mfd"; + mtd-mac-address = <&art 0x6>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,002e"; + reg = <0x0000 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + + usb_power { + gpio-hog; + line-name = "netgear:power:usb"; + gpios = <4 GPIO_ACTIVE_HIGH>; + output-high; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&usb { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; diff --git a/target/linux/ath79/dts/ar7241_tplink.dtsi b/target/linux/ath79/dts/ar7241_tplink.dtsi index fa6ba7192..09a239f67 100644 --- a/target/linux/ath79/dts/ar7241_tplink.dtsi +++ b/target/linux/ath79/dts/ar7241_tplink.dtsi @@ -11,11 +11,11 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; + label-mac-device = &ath9k; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -32,7 +32,7 @@ }; }; - gpio_leds: gpio-leds { + leds: leds { compatible = "gpio-leds"; led_system: system { @@ -49,6 +49,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-mr3x20.dtsi b/target/linux/ath79/dts/ar7241_tplink_tl-mr3x20.dtsi index 04403637b..9d4f3f202 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-mr3x20.dtsi +++ b/target/linux/ath79/dts/ar7241_tplink_tl-mr3x20.dtsi @@ -15,7 +15,7 @@ }; }; -&gpio_leds { +&leds { led3g { label = "tp-link:green:3g"; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts index 282446b1e..64833bf2c 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts @@ -15,11 +15,11 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; + label-mac-device = &ath9k; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; rfkill { label = "rfkill"; @@ -36,7 +36,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -95,6 +95,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts index 9e38bf808..ad2762e20 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts @@ -8,16 +8,17 @@ model = "Ubiquiti AirRouter"; aliases { - led-boot = &globe; - led-failsafe = &globe; - led-running = &globe; - led-upgrade = &globe; + led-boot = &led_globe; + led-failsafe = &led_globe; + led-running = &led_globe; + led-upgrade = &led_globe; + label-mac-device = &wifi; }; - airrouter-leds { + leds { compatible = "gpio-leds"; - globe: globe { + led_globe: globe { label = "ubnt:green:globe"; gpios = <&gpio 0 GPIO_ACTIVE_LOW>; }; @@ -30,9 +31,9 @@ }; &usb_phy { - status = "okay"; + status = "okay"; }; &usb { - status = "okay"; + status = "okay"; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts index 27aec88cc..5f12fd581 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts @@ -11,10 +11,11 @@ model = "Ubiquiti UniFi AP"; aliases { - led-boot = &dome_green; - led-failsafe = &dome_green; - led-running = &dome_green; - led-upgrade = &dome_green; + led-boot = &led_dome_green; + led-failsafe = &led_dome_green; + led-running = &led_dome_green; + led-upgrade = &led_dome_green; + label-mac-device = &wifi; }; extosc: ref { @@ -24,8 +25,8 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; + reset { linux,code = ; gpios = <&gpio 12 GPIO_ACTIVE_LOW>; @@ -35,12 +36,13 @@ leds { compatible = "gpio-leds"; - dome_green: dome-green { + + led_dome_green: dome_green { label = "ubnt:green:dome"; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; }; - dome-orange { + dome_orange { label = "ubnt:orange:dome"; gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; }; @@ -57,6 +59,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -75,30 +78,30 @@ read-only; }; - partition@1 { + partition@40000 { label = "u-boot-env"; reg = <0x040000 0x010000>; }; - partition@2 { + partition@50000 { compatible = "denx,uimage"; label = "firmware"; reg = <0x050000 0x750000>; }; - partition@3 { + partition@7a0000 { label = "board_config"; reg = <0x7a0000 0x010000>; read-only; }; - partition@4 { + partition@7b0000 { label = "cfg"; reg = <0x7b0000 0x040000>; read-only; }; - art: partition@5 { + art: partition@7f0000 { label = "art"; reg = <0x7f0000 0x010000>; read-only; @@ -110,7 +113,7 @@ &pcie { status = "okay"; - wifi@0,0 { + wifi: wifi@0,0 { reg = <0x0000 0 0 0 0>; qca,no-eeprom; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi b/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi index 546657522..e2b653b3a 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_xm.dtsi @@ -9,15 +9,9 @@ compatible = "ubnt,xm", "qca,ar7241"; model = "Ubiquiti Networks XM (rev 1.0) board"; -/* extosc: ref { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <40000000>; - }; -*/ keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; + reset { linux,code = ; gpios = <&gpio 12 GPIO_ACTIVE_LOW>; @@ -30,12 +24,9 @@ status = "okay"; }; -/*&pll { - clocks = <&extosc>; -};*/ - &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -54,30 +45,30 @@ read-only; }; - partition@1 { + partition@40000 { label = "u-boot-env"; reg = <0x040000 0x010000>; }; - partition@2 { + partition@50000 { compatible = "denx,uimage"; label = "firmware"; reg = <0x050000 0x750000>; }; - partition@3 { + partition@7a0000 { label = "board_config"; reg = <0x7a0000 0x010000>; read-only; }; - partition@4 { + partition@7b0000 { label = "cfg"; reg = <0x7b0000 0x040000>; read-only; }; - art: partition@5 { + art: partition@7f0000 { label = "art"; reg = <0x7f0000 0x010000>; read-only; @@ -89,7 +80,7 @@ &pcie { status = "okay"; - wifi@0,0 { + wifi: wifi@0,0 { reg = <0x0000 0 0 0 0>; qca,no-eeprom; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi b/target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi index c773f1aac..75116edc5 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_xm_outdoor.dtsi @@ -1,18 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include -#include - #include "ar7241_ubnt_xm.dtsi" / { aliases { - led-boot = &link4; - led-failsafe = &link4; + led-boot = &led_link4; + led-failsafe = &led_link4; + label-mac-device = &wifi; }; leds { compatible = "gpio-leds"; + link1 { label = "ubnt:red:link1"; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; @@ -28,7 +27,7 @@ gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; }; - link4: link4 { + led_link4: link4 { label = "ubnt:green:link4"; gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; }; diff --git a/target/linux/ath79/dts/ar7242.dtsi b/target/linux/ath79/dts/ar7242.dtsi index 44eb0edfd..be28ae783 100644 --- a/target/linux/ath79/dts/ar7242.dtsi +++ b/target/linux/ath79/dts/ar7242.dtsi @@ -45,7 +45,7 @@ }; ð0 { - compatible = "qca,ar7242-eth", "syscon", "simple-mfd"; + compatible = "qca,ar7242-eth", "syscon"; pll-data = <0x16000000 0x00000101 0x00001616>; pll-reg = <0x4 0x2c 17>; @@ -72,7 +72,7 @@ }; ð1 { - compatible = "qca,ar7242-eth", "syscon", "simple-mfd"; + compatible = "qca,ar7242-eth", "syscon"; resets = <&rst 13>; reset-names = "mac"; diff --git a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts index 3621714d9..14c80963d 100644 --- a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts +++ b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts @@ -11,15 +11,15 @@ model = "AVM FRITZ!WLAN Repeater 300E"; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &ath9k; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { label = "wps"; @@ -32,7 +32,7 @@ leds { compatible = "gpio-leds"; - power: power { + led_power: power { label = "fritz300e:green:power"; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -96,6 +96,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { diff --git a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts index d2f40e556..d62878e50 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts @@ -8,10 +8,13 @@ model = "Buffalo BHR-4GRV"; }; -ð0 { - mtd-mac-address = <&ART 0x0>; +&leds { + sec_vpn { + label = "buffalo:orange:vpn"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; }; -&sec_vpn { - label = "buffalo:orange:vpn"; +ð0 { + mtd-mac-address = <&art 0x0>; }; diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi index 5165efa85..4a848cb89 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi @@ -8,9 +8,9 @@ / { aliases { - led-boot = &diag; - led-failsafe = &diag; - led-upgrade = &diag; + led-boot = &led_diag; + led-failsafe = &led_diag; + led-upgrade = &led_diag; }; extosc: ref { @@ -20,8 +20,7 @@ }; keys: keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; usb { label = "usb"; @@ -38,14 +37,10 @@ }; }; - leds { + leds: leds { compatible = "gpio-leds"; - sec_vpn: sec_vpn { - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - }; - - diag: diag { + led_diag: diag { label = "buffalo:red:diag"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; @@ -89,9 +84,9 @@ label = "u-boot-env"; }; - ART: partition@50000 { + art: partition@50000 { reg = <0x50000 0x10000>; - label = "ART"; + label = "art"; read-only; }; @@ -112,6 +107,7 @@ &spi { status = "okay"; + cs-gpios = <0>, <0>; num-cs = <2>; diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts index 97bfd0f84..71769ef9f 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts @@ -11,9 +11,9 @@ model = "Buffalo WZR-HP-G302H A1A0"; aliases { - led-boot = &diag; - led-failsafe = &diag; - led-upgrade = &diag; + led-boot = &led_diag; + led-failsafe = &led_diag; + led-upgrade = &led_diag; }; extosc: ref { @@ -23,8 +23,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -33,7 +32,7 @@ debounce-interval = <60>; }; - button_usb { + usb { label = "usb"; linux,code = ; gpios = <&gpio 7 GPIO_ACTIVE_LOW>; @@ -67,7 +66,7 @@ leds { compatible = "gpio-leds"; - diag: diag { + led_diag: diag { label = "buffalo:red:diag"; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; }; @@ -164,6 +163,7 @@ &spi { status = "okay"; + cs-gpios = <0>, <0>; num-cs = <2>; diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts index ea30a4d0d..16a617a25 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts @@ -1,15 +1,16 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "ar7242_buffalo_wzr-bhr.dtsi" / { compatible = "buffalo,wzr-hp-g450h", "qca,ar7242"; model = "Buffalo WZR-HP-G450H/WZR-450HP"; + aliases { + label-mac-device = ð0; + }; + ath9k-leds { compatible = "gpio-leds"; @@ -56,12 +57,15 @@ }; }; -ð0 { - mtd-mac-address = <&ART 0x1002>; +&leds { + sec_vpn { + label = "buffalo:orange:security"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; }; -&sec_vpn { - label = "buffalo:orange:security"; +ð0 { + mtd-mac-address = <&art 0x1002>; }; &pcie { @@ -70,7 +74,7 @@ ath9k: wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&ART 0x1002>; + mtd-mac-address = <&art 0x1002>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; diff --git a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts index c42207e6c..e6ea8b68e 100644 --- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts +++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts @@ -11,10 +11,11 @@ model = "TP-Link TL-WR2543N/ND"; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_wps; + led-failsafe = &led_wps; + led-running = &led_wps; + led-upgrade = &led_wps; + label-mac-device = ð0; }; chosen { @@ -28,8 +29,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -49,7 +49,7 @@ leds { compatible = "gpio-leds"; - system: wps { + led_wps: wps { label = "tplink:green:wps"; gpios = <&gpio 0 GPIO_ACTIVE_LOW>; }; @@ -102,6 +102,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { diff --git a/target/linux/ath79/dts/ar724x.dtsi b/target/linux/ath79/dts/ar724x.dtsi index b2844bf17..95832d998 100644 --- a/target/linux/ath79/dts/ar724x.dtsi +++ b/target/linux/ath79/dts/ar724x.dtsi @@ -75,7 +75,15 @@ #pinctrl-cells = <2>; jtag_disable_pins: pinmux_jtag_disable_pins { - pinctrl-single,bits = <0x0 0x1 0x1>; + pinctrl-single,bits = <0x0 0x1 0x1>; + }; + + switch_led_disable_pins: pinmux_switch_led_disable_pins { + pinctrl-single,bits = <0x0 0x0 0xf8>; + }; + + clks_disable_pins: pinmux_clks_disable_pins { + pinctrl-single,bits = <0x0 0x0 0x81f00>; }; }; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts index 6551d0a7f..804b71170 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts @@ -11,10 +11,11 @@ model = "TP-Link TL-WA901ND v2"; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð0; }; extosc: ref { @@ -44,7 +45,7 @@ leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "tp-link:green:system"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; }; @@ -72,6 +73,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -125,6 +127,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts index f617d89c5..846e517de 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts @@ -11,10 +11,11 @@ model = "TP-Link TL-WR1043ND v1"; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð0; }; extosc: ref { @@ -26,14 +27,14 @@ keys { compatible = "gpio-keys"; - button0 { + reset { label = "reset"; linux,code = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; - button1 { + qss { label = "qss"; linux,code = ; gpios = <&gpio 7 GPIO_ACTIVE_LOW>; @@ -43,6 +44,7 @@ leds { compatible = "gpio-leds"; + usb { label = "tp-link:green:usb"; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; @@ -50,7 +52,7 @@ linux,default-trigger = "usbport"; }; - system: system { + led_system: system { label = "tp-link:green:system"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; linux,default-trigger = "heartbeat"; @@ -103,6 +105,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -150,6 +153,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts index 93b99beb6..1be4d6183 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts @@ -15,19 +15,20 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; + label-mac-device = ð0; }; keys { compatible = "gpio-keys"; - button0 { + reset { label = "reset"; linux,code = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; - button1 { + qss { label = "qss"; linux,code = ; gpios = <&gpio 7 GPIO_ACTIVE_LOW>; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 49c6f6985..64c135405 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -74,8 +74,8 @@ pinctrl-single,bits = <0x0 0x1 0x1>; }; - switch_led_pins: pinmux_switch_led_pins { - pinctrl-single,bits = <0x0 0x1f 0xf8>; + switch_led_disable_pins: pinmux_switch_led_disable_pins { + pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; @@ -86,6 +86,16 @@ #clock-cells = <1>; }; + wdt: wdt@18060008 { + compatible = "qca,ar7130-wdt"; + reg = <0x18060008 0x8>; + + interrupts = <4>; + + clocks = <&pll ATH79_CLK_AHB>; + clock-names = "wdt"; + }; + rst: reset-controller@1806001c { compatible = "qca,ar7100-reset"; reg = <0x1806001c 0x4>; @@ -192,7 +202,7 @@ }; ð1 { - compatible = "qca,ar9330-eth", "syscon", "simple-mfd"; + compatible = "qca,ar9330-eth", "syscon"; pll-data = <0x00110000 0x00001099 0x00991099>; phy-mode = "gmii"; diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index 53df36760..70754c905 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -12,15 +12,16 @@ aliases { serial0 = &uart; - led-boot = &wlan; - led-failsafe = &wlan; - led-upgrade = &wlan; + led-boot = &led_wlan; + led-failsafe = &led_wlan; + led-upgrade = &led_wlan; + label-mac-device = ð0; }; leds { compatible = "gpio-leds"; - wlan: wlan { + led_wlan: wlan { label = "gl-ar150:orange:wlan"; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0tpt"; @@ -38,8 +39,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; manual { label = "manual"; @@ -80,9 +80,10 @@ }; &spi { - num-chipselects = <1>; status = "okay"; + num-chipselects = <1>; + flash@0 { compatible = "jedec,spi-nor"; spi-max-frequency = <104000000>; @@ -111,7 +112,7 @@ }; art: partition@3 { - label = "ART"; + label = "art"; reg = <0xff0000 0x010000>; read-only; }; @@ -140,6 +141,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&art 0x0>; }; diff --git a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts index 06f728b26..92484f933 100644 --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts @@ -12,15 +12,15 @@ aliases { serial0 = &uart; - led-boot = &wlan; - led-failsafe = &wlan; - led-upgrade = &wlan; + led-boot = &led_wlan; + led-failsafe = &led_wlan; + led-upgrade = &led_wlan; }; leds { compatible = "gpio-leds"; - wlan: wlan { + led_wlan: wlan { label = "air-pen:blue:wlan"; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0tpt"; @@ -33,8 +33,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; wps { label = "wps"; @@ -70,9 +69,10 @@ }; &spi { - num-cs = <1>; status = "okay"; + num-cs = <1>; + flash@0 { compatible = "jedec,spi-nor"; spi-max-frequency = <104000000>; @@ -136,11 +136,13 @@ ð1 { status = "okay"; + compatible = "syscon", "simple-mfd"; }; &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&art 0x2>; }; diff --git a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts new file mode 100644 index 000000000..cc0320d65 --- /dev/null +++ b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9331.dtsi" + +/ { + model = "8devices Carambola2"; + compatible = "8dev,carambola2", "qca,ar9331"; + + aliases { + serial0 = &uart; + label-mac-device = &wmac; + }; + + leds { + compatible = "gpio-leds"; + + wlan { + label = "carambola2:green:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + eth0 { + label = "carambola2:orange:eth0"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + eth1 { + label = "carambola2:orange:eth1"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +&usb { + dr_mode = "host"; + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&spi { + num-chipselects = <0>; + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <104000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfa0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&art 0x0>; + + gmac-config { + device = <&gmac>; + + switch-phy-addr-swap = <1>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + status = "okay"; + mtd-mac-address = <&art 0x6>; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts new file mode 100644 index 000000000..971d158fa --- /dev/null +++ b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9331.dtsi" + +/ { + model = "ALFA Network AP121F"; + compatible = "alfa-network,ap121f", "qca,ar9331"; + + aliases { + label-mac-device = &wmac; + led-boot = &led_vpn; + led-failsafe = &led_vpn; + led-upgrade = &led_vpn; + serial0 = &uart; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + switch { + label = "switch"; + linux,code = ; + gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + lan { + label = "ap121f:green:lan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + led_vpn: vpn { + label = "ap121f:green:vpn"; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "ap121f:green:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + gmac-config { + device = <&gmac>; + switch-phy-addr-swap = <0>; + switch-phy-swap = <0>; + }; +}; + +ð1 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; + +&gpio { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x030000 0x010000>; + }; + + art: partition@40000 { + label = "art"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfb0000>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb { + status = "okay"; + dr_mode = "host"; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/ar9331_dptechnics_dpt-module.dts b/target/linux/ath79/dts/ar9331_dptechnics_dpt-module.dts deleted file mode 100644 index 971c92705..000000000 --- a/target/linux/ath79/dts/ar9331_dptechnics_dpt-module.dts +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; - -#include -#include - -#include "ar9331.dtsi" - -/ { - model = "DPTechnics DPT-Module"; - compatible = "dptechnics,dpt-module", "qca,ar9331"; - - aliases { - serial0 = &uart; - }; - - leds { - compatible = "gpio-leds"; - - system { - label = "dpt-module:green:system"; - gpios = <&gpio 27 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; - - button0 { - label = "reset"; - linux,code = ; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&ref { - clock-frequency = <25000000>; -}; - -&uart { - status = "okay"; -}; - -&gpio { - status = "okay"; -}; - -&usb { - dr_mode = "host"; - status = "okay"; -}; - -&usb_phy { - status = "okay"; -}; - -&spi { - num-chipselects = <1>; - status = "okay"; - - /* Winbond 25Q128FVSG SPI flash */ - flash@0 { - compatible = "winbond,w25q128", "jedec,spi-nor"; - spi-max-frequency = <104000000>; - reg = <0>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_dragino_ms14.dts b/target/linux/ath79/dts/ar9331_dragino_ms14.dts deleted file mode 100644 index 713fe4103..000000000 --- a/target/linux/ath79/dts/ar9331_dragino_ms14.dts +++ /dev/null @@ -1,90 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; - -#include -#include - -#include "ar9331.dtsi" - -/ { - model = "Dragino MS14 (Dragino 2)"; - compatible = "dragino,ms14", "qca,ar9331"; - - aliases { - serial0 = &uart; - }; - - leds { - compatible = "gpio-leds"; - - wlan { - label = "dragino2:red:wlan"; - gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; - }; - - lan { - label = "dragino2:red:lan"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - }; - - wan { - label = "dragino2:red:wan"; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - }; - - system { - label = "dragino2:red:system"; - gpios = <&gpio 28 GPIO_ACTIVE_HIGH>; - }; - }; - - keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; - - button0 { - label = "jumpstart"; - linux,code = ; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - }; - - button1 { - label = "reset"; - linux,code = ; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&ref { - clock-frequency = <25000000>; -}; - -&uart { - status = "okay"; -}; - -&gpio { - status = "okay"; -}; - -&usb { - dr_mode = "host"; - status = "okay"; -}; - -&usb_phy { - status = "okay"; -}; - -&spi { - num-chipselects = <1>; - status = "okay"; - - /* Winbond 25Q128BVFG SPI flash */ - flash@0 { - compatible = "winbond,w25q128", "jedec,spi-nor"; - spi-max-frequency = <104000000>; - reg = <0>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts index 43bec35fa..3489a972d 100644 --- a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts +++ b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts @@ -11,25 +11,24 @@ compatible = "embeddedwireless,dorin", "qca,ar9331"; aliases { - led-boot = &status; - led-failsafe = &status; - led-running = &status; - led-upgrade = &status; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; serial0 = &uart; }; leds { compatible = "gpio-leds"; - status: status { + led_status: status { label = "dorin:green:status"; gpios = <&gpio 21 GPIO_ACTIVE_LOW>; }; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; wps { label = "wps"; @@ -63,9 +62,10 @@ }; &spi { - num-chipselects = <1>; status = "okay"; + num-chipselects = <1>; + flash@0 { compatible = "jedec,spi-nor"; spi-max-frequency = <104000000>; @@ -94,7 +94,7 @@ }; art: partition@3 { - label = "ART"; + label = "art"; reg = <0xff0000 0x010000>; read-only; }; @@ -116,6 +116,6 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x1002>; }; diff --git a/target/linux/ath79/dts/ar9331_etactica_eg200.dts b/target/linux/ath79/dts/ar9331_etactica_eg200.dts index d566647a0..079cc8876 100644 --- a/target/linux/ath79/dts/ar9331_etactica_eg200.dts +++ b/target/linux/ath79/dts/ar9331_etactica_eg200.dts @@ -11,28 +11,32 @@ compatible = "etactica,eg200", "qca,ar9331"; aliases { + led-boot = &led_etactica; + led-failsafe = &led_etactica; + led-upgrade = &led_etactica; serial0 = &uart; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <50>; + compatible = "gpio-keys"; restore { - linux,code = ; + linux,code = ; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; }; }; leds { compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&switch_led_disable_pins>; modbus { label = "eg200:red:modbus"; gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; }; - etactica { + led_etactica: etactica { label = "eg200:red:etactica"; gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; }; @@ -123,5 +127,4 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x1002>; }; diff --git a/target/linux/ath79/dts/ar9331_onion_omega.dts b/target/linux/ath79/dts/ar9331_onion_omega.dts deleted file mode 100644 index 5d0fe33ee..000000000 --- a/target/linux/ath79/dts/ar9331_onion_omega.dts +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; - -#include -#include - -#include "ar9331.dtsi" - -/ { - model = "Onion Omega"; - compatible = "onion,omega", "qca,ar9331"; - - aliases { - serial0 = &uart; - }; - - leds { - compatible = "gpio-leds"; - - system { - label = "onion:amber:system"; - gpios = <&gpio 27 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; - - button0 { - label = "reset"; - linux,code = ; - gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&ref { - clock-frequency = <25000000>; -}; - -&uart { - status = "okay"; -}; - -&gpio { - status = "okay"; -}; - -&usb { - dr_mode = "host"; - status = "okay"; -}; - -&usb_phy { - status = "okay"; -}; - -&spi { - num-chipselects = <1>; - status = "okay"; - - /* Winbond 25Q128FVSG SPI flash */ - flash@0 { - compatible = "winbond,w25q128", "jedec,spi-nor"; - spi-max-frequency = <104000000>; - reg = <0>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts new file mode 100644 index 000000000..8b8e304c9 --- /dev/null +++ b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9331.dtsi" + +/ { + model = "Pisen TS-D084"; + compatible = "pisen,ts-d084", "qca,ar9331"; + + aliases { + serial0 = &uart; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = &wmac; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "ts-d084:blue:system"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + reg = <0x0 0x20000>; + label = "u-boot"; + read-only; + }; + + firmware: partition@20000 { + compatible = "tplink,firmware"; + reg = <0x20000 0x7d0000>; + label = "firmware"; + }; + + art: partition@7f0000 { + reg = <0x7f0000 0x10000>; + label = "art"; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&uboot 0x1fc00>; + + gmac-config { + device = <&gmac>; + + switch-phy-addr-swap = <0>; + switch-phy-swap = <0>; + }; +}; + +ð1 { + status = "okay"; + compatible = "syscon", "simple-mfd"; +}; + +&gpio { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&usb { + dr_mode = "host"; + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&uboot 0x1fc00>; +}; diff --git a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts index b3bc2e4c4..6fb11545a 100644 --- a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts +++ b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts @@ -19,8 +19,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts index 918237423..3cd5c130c 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts @@ -12,10 +12,11 @@ aliases { serial0 = &uart; - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_wps; + led-failsafe = &led_wps; + led-running = &led_wps; + led-upgrade = &led_wps; + label-mac-device = ð0; }; leds { @@ -32,7 +33,7 @@ gpios = <&gpio 17 GPIO_ACTIVE_LOW>; }; - system: wps { + led_wps: wps { label = "tp-link:green:wps"; gpios = <&gpio 26 GPIO_ACTIVE_LOW>; }; @@ -48,14 +49,14 @@ keys { compatible = "gpio-keys"; - button0 { + reset { label = "reset"; linux,code = ; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; debounce-interval = <60>; }; - button1 { + sw1 { label = "sw1"; linux,input-type = ; linux,code = ; @@ -63,7 +64,7 @@ debounce-interval = <60>; }; - button2 { + sw2 { label = "sw2"; linux,input-type = ; linux,code = ; @@ -112,9 +113,10 @@ }; &spi { - num-chipselects = <1>; status = "okay"; + num-chipselects = <1>; + /* Spansion S25FL032PIF SPI flash */ flash@0 { compatible = "jedec,spi-nor"; @@ -153,7 +155,6 @@ }; }; - ð0 { status = "okay"; @@ -168,11 +169,13 @@ ð1 { status = "okay"; + compatible = "syscon", "simple-mfd"; }; &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts index fe15157f8..e8a3dfbce 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts @@ -13,11 +13,15 @@ aliases { led-boot = &led_lan; led-failsafe = &led_lan; + label-mac-device = ð0; }; leds { compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&switch_led_disable_pins>; + wlan { label = "tp-link:green:wlan"; gpios = <&gpio 26 GPIO_ACTIVE_LOW>; @@ -38,8 +42,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -105,9 +108,10 @@ }; &spi { - num-chipselects = <1>; status = "okay"; + num-chipselects = <1>; + flash@0 { compatible = "jedec,spi-nor"; spi-max-frequency = <104000000>; @@ -153,11 +157,13 @@ ð1 { status = "okay"; + compatible = "syscon", "simple-mfd"; }; &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi index ffd3d71a6..a8e0331f0 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi @@ -9,15 +9,15 @@ / { aliases { serial0 = &uart; - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð0; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -30,7 +30,7 @@ leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "tl-wr703n:blue:system"; gpios = <&gpio 27 GPIO_ACTIVE_LOW>; }; @@ -43,11 +43,11 @@ regulator-max-microvolt = <5000000>; enable-active-high; }; - }; &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -66,7 +66,7 @@ read-only; }; - firmware: partition@20000 { + partition@20000 { compatible = "tplink,firmware"; reg = <0x20000 0x3d0000>; label = "firmware"; @@ -96,6 +96,7 @@ ð1 { status = "okay"; + compatible = "syscon", "simple-mfd"; }; @@ -119,6 +120,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts index 056e9fa51..49dd11469 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts @@ -16,11 +16,11 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; + label-mac-device = ð0; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -47,7 +47,6 @@ gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; enable-active-high; }; - }; &spi { diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi index 02c647c17..4fb06494a 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi @@ -12,15 +12,15 @@ aliases { serial0 = &uart; - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = &wmac; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -39,8 +39,9 @@ leds { compatible = "gpio-leds"; + pinctrl-names = "default"; - pinctrl-0 = <&switch_led_pins>; + pinctrl-0 = <&switch_led_disable_pins>; lan1 { label = "tp-link:green:lan1"; @@ -67,7 +68,7 @@ gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; }; - system: system { + led_system: system { label = "tp-link:green:system"; gpios = <&gpio 27 GPIO_ACTIVE_LOW>; }; @@ -87,6 +88,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -151,6 +153,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts index 9a0b084a7..222516f9b 100644 --- a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts +++ b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts @@ -12,15 +12,14 @@ aliases { serial0 = &uart; - led-boot = &status; - led-failsafe = &status; - led-running = &status; - led-upgrade = &status; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; @@ -43,7 +42,7 @@ leds { compatible = "gpio-leds"; - status: power { + led_power: power { label = "pcs:amber:power"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -140,7 +139,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x1002>; }; ð0 { diff --git a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts new file mode 100644 index 000000000..46b6053cc --- /dev/null +++ b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts @@ -0,0 +1,225 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9341.dtsi" + +/ { + model = "PISEN WMB001N"; + compatible = "pisen,wmb001n", "qca,ar9341"; + + aliases { + serial0 = &uart; + led-boot = &led_wifi; + led-failsafe = &led_wifi; + led-running = &led_wifi; + led-upgrade = &led_wifi; + }; + + i2c { + compatible = "i2c-gpio"; + pinctrl-names = "default"; + pinctrl-0 = <&pmx_i2c_gpio &pmx_i2s_spdif>; + + sda-gpios = <&gpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; + /* + * Pull-up resistor for scl is missing on this board. + * Following settings trick i2c-gpio to use output mode + * instead of open-drain for scl. + */ + i2c-gpio,scl-output-only; + i2c-gpio,scl-open-drain; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + vol_down { + label = "volume down"; + linux,code = ; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + vol_up { + label = "volume up"; + linux,code = ; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + volume1 { + label = "wmb001n:blue:volume1"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + + volume2 { + label = "wmb001n:blue:volume2"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + + volume3 { + label = "wmb001n:blue:volume3"; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + }; + + volume4 { + label = "wmb001n:blue:volume4"; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + }; + + volume5 { + label = "wmb001n:blue:volume5"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + }; + + led_wifi: wifi { + label = "wmb001n:blue:wifi"; + gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&fwpart1 &fwpart2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x0>; + label = "firmware"; + compatible = "openwrt,okli"; + }; + }; + }; +}; + +&pinmux { + pmx_i2c_gpio: pinmux_i2c_gpio { + pinctrl-single,bits = <0x10 0x0 0xff>, + <0x14 0x0 0xff>; + }; + + pmx_i2s_spdif: pinmux_i2s_spdif { + pinctrl-single,bits = <0x8 0x0e000000 0xff000000>, + <0xc 0x0f0c0d 0xffffff>, + <0x14 0x1900 0xff00>; + }; +}; + +&ref { + clock-frequency = <25000000>; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +&spi { + num-cs = <1>; + + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x0 0x10000>; + read-only; + }; + + partition@10000 { + label = "u-boot-env"; + reg = <0x10000 0x10000>; + read-only; + }; + + fwpart1: partition@20000 { + label = "fwpart1"; + reg = <0x20000 0xdc0000>; + }; + + partition@de0000 { + label = "loader"; + reg = <0xde0000 0x10000>; + }; + + fwpart2: partition@df0000 { + label = "fwpart2"; + reg = <0xdf0000 0x1f0000>; + }; + + partition@fe0000 { + label = "mib0"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + phy-handle = <&swphy4>; + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; + status = "okay"; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <0>; + }; +}; + +&usb { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/ar9341_tplink.dtsi b/target/linux/ath79/dts/ar9341_tplink.dtsi new file mode 100644 index 000000000..f99b6da67 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_tplink.dtsi @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9341.dtsi" + +/ { + aliases { + serial0 = &uart; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &wmac; + }; + + keys: keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + }; + + leds: leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tp-link:green:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan { + label = "tp-link:green:wlan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + qss { + label = "tp-link:green:qss"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "tp-link:green:wan"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "tp-link:green:lan1"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "tp-link:green:lan2"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "tp-link:green:lan3"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "tp-link:green:lan4"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ref { + clock-frequency = <25000000>; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <(-1)>; +}; + +ð1 { + mtd-mac-address = <&uboot 0x1fc00>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&uboot 0x1fc00>; +}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts new file mode 100644 index 000000000..f86438152 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9341_tplink.dtsi" + +/ { + model = "TP-Link TL-MR3420 v2"; + compatible = "tplink,tl-mr3420-v2", "qca,ar9341"; +}; + +&keys { + reset { + label = "Reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; +}; + +&leds { + usb { + label = "tp-link:green:usb"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port>; + linux,default-trigger = "usbport"; + }; +}; + +&gpio { + usb_power { + gpio-hog; + gpios = <4 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "tp-link:power:usb"; + }; +}; + +&spi { + num-cs = <1>; + + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0x3d0000>; + }; + + art: partition@3f0000 { + label = "art"; + reg = <0x3f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&usb { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts index ec89be531..3577e4994 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts @@ -1,102 +1,20 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "ar9341.dtsi" +#include "ar9341_tplink.dtsi" / { model = "TP-Link TL-WR841N/ND v8"; compatible = "tplink,tl-wr841-v8", "qca,ar9341"; - - aliases { - serial0 = &uart; - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; - }; - - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; - - pinctrl-names = "default"; - pinctrl-0 = <&jtag_disable_pins>; - - reset { - label = "Reset"; - linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - rfkill { - label = "WiFi"; - linux,code = ; - gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - - system: power { - label = "tp-link:green:power"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - wlan { - label = "tp-link:green:wlan"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - qss { - label = "tp-link:green:qss"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - }; - - wan { - label = "tp-link:green:wan"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - }; - - lan1 { - label = "tp-link:green:lan1"; - gpios = <&gpio 19 GPIO_ACTIVE_LOW>; - }; - - lan2 { - label = "tp-link:green:lan2"; - gpios = <&gpio 20 GPIO_ACTIVE_LOW>; - }; - - lan3 { - label = "tp-link:green:lan3"; - gpios = <&gpio 21 GPIO_ACTIVE_LOW>; - }; - - lan4 { - label = "tp-link:green:lan4"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - }; }; -&ref { - clock-frequency = <25000000>; -}; - -&uart { - status = "okay"; -}; - -&gpio { - status = "okay"; +&keys { + reset { + label = "Reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; }; &spi { @@ -134,31 +52,3 @@ }; }; }; - -ð0 { - status = "okay"; - - phy-handle = <&swphy0>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; -}; - -ð1 { - status = "okay"; - - mtd-mac-address = <&uboot 0x1fc00>; - - pll-data = <0x06000000 0x00000101 0x00001616>; - - gmac-config { - device = <&gmac>; - switch-phy-swap = <1>; - }; -}; - -&wmac { - status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts index c7a251cbf..d9b0ee86f 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts @@ -1,98 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "ar9341.dtsi" +#include "ar9341_tplink.dtsi" / { model = "TP-Link TL-WR842N/ND v2"; compatible = "tplink,tl-wr842n-v2", "qca,ar9341"; - aliases { - serial0 = &uart; - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; - }; - - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; - - pinctrl-names = "default"; - pinctrl-0 = <&jtag_disable_pins>; - - reset { - label = "Reset"; - linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - rfkill { - label = "WiFi"; - linux,code = ; - gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - - system: power { - label = "tp-link:green:power"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - wlan { - label = "tp-link:green:wlan"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - qss { - label = "tp-link:green:qss"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - }; - - wan { - label = "tp-link:green:wan"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - }; - - lan1 { - label = "tp-link:green:lan1"; - gpios = <&gpio 19 GPIO_ACTIVE_LOW>; - }; - - lan2 { - label = "tp-link:green:lan2"; - gpios = <&gpio 20 GPIO_ACTIVE_LOW>; - }; - - lan3 { - label = "tp-link:green:lan3"; - gpios = <&gpio 21 GPIO_ACTIVE_LOW>; - }; - - lan4 { - label = "tp-link:green:lan4"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - - usb { - label = "tp-link:green:usb"; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - trigger-sources = <&hub_port>; - linux,default-trigger = "usbport"; - }; - }; - gpio-export { compatible = "gpio-export"; @@ -104,23 +18,29 @@ }; }; -&ref { - clock-frequency = <25000000>; +&keys { + reset { + label = "Reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; }; -&uart { - status = "okay"; -}; - -&gpio { - status = "okay"; +&leds { + usb { + label = "tp-link:green:usb"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port>; + linux,default-trigger = "usbport"; + }; }; &spi { - num-cs = <1>; - status = "okay"; + num-cs = <1>; + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; @@ -167,31 +87,6 @@ status = "okay"; }; -ð0 { - status = "okay"; - - phy-handle = <&swphy0>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; -}; - ð1 { - status = "okay"; - phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; - phy-mode = "gmii"; - pll-data = <0x06000000 0x00000101 0x00001616>; - - gmac-config { - device = <&gmac>; - switch-phy-swap = <1>; - }; -}; - -&wmac { - status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts index 9fce43fd4..1ced60d5f 100644 --- a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts +++ b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts @@ -11,16 +11,16 @@ model = "I-O DATA ETG3-R"; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; leds { compatible = "gpio-leds"; - power: power { + led_power: power { label = "etg3-r:green:power"; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -33,8 +33,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -50,9 +49,10 @@ }; &spi { - num-cs = <1>; status = "okay"; + num-cs = <1>; + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; @@ -93,7 +93,7 @@ }; partition@7f0000 { - label = "ART"; + label = "art"; reg = <0x7f0000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts index 82f864b8e..757654eae 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts @@ -26,7 +26,7 @@ /* default for ar934x, except for 1000M and 10M */ pll-data = <0x06000000 0x00000101 0x00001313>; - mtd-mac-address = <&eeprom 0x0>; + mtd-mac-address = <&art 0x0>; phy-mode = "rgmii"; phy-handle = <&phy4>; diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts index 6e64c7faa..30d054dfe 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts @@ -51,7 +51,7 @@ /* default for ar934x, except for 1000M and 10M */ pll-data = <0x06000000 0x00000101 0x00001313>; - mtd-mac-address = <&eeprom 0x0>; + mtd-mac-address = <&art 0x0>; phy-mode = "rgmii"; phy-handle = <&phy4>; diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts index 9b26d1a62..89904721c 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts @@ -27,7 +27,7 @@ /* default for ar934x, except for 1000M and 10M */ pll-data = <0x06000000 0x00000101 0x00001313>; - mtd-mac-address = <&eeprom 0x0>; + mtd-mac-address = <&art 0x0>; phy-mode = "rgmii"; phy-handle = <&phy4>; diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts index 2ace37ad6..97597e5f1 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts @@ -58,7 +58,7 @@ /* default for ar934x, except for 1000M and 10M */ pll-data = <0x06000000 0x00000101 0x00001313>; - mtd-mac-address = <&eeprom 0x0>; + mtd-mac-address = <&art 0x0>; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -73,6 +73,5 @@ &wmac { status = "okay"; - mtd-cal-data = <&eeprom 0x1000>; - mtd-mac-address = <&eeprom 0x1002>; + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index df5cb4be6..2847d4098 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -75,8 +75,8 @@ read-only; }; - eeprom: partition@ff0000 { - label = "EEPROM"; + art: partition@ff0000 { + label = "art"; reg = <0xff0000 0x010000>; read-only; }; @@ -88,6 +88,5 @@ status = "okay"; qca,disable-5ghz; - mtd-cal-data = <&eeprom 0x1000>; - mtd-mac-address = <&eeprom 0x1002>; + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi index 84fc22215..cf24aba5a 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -10,10 +10,11 @@ model = "Ubiquiti Networks XW board"; aliases { - led-boot = &system; - led-running = &system; - led-upgrade = &system; - led-failsafe = &system; + led-boot = &led_link4; + led-running = &led_link4; + led-upgrade = &led_link4; + led-failsafe = &led_link4; + label-mac-device = &wmac; }; leds { @@ -34,7 +35,7 @@ gpios = <&gpio 13 GPIO_ACTIVE_LOW>; }; - system: link4 { + led_link4: link4 { label = "ubnt:green:link4"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; @@ -96,14 +97,14 @@ reg = <0x050000 0x760000>; }; - partition@fb0000 { + partition@7b0000 { label = "cfg"; reg = <0x7b0000 0x040000>; read-only; }; - eeprom: partition@ff0000 { - label = "EEPROM"; + art: partition@7f0000 { + label = "art"; reg = <0x7f0000 0x010000>; read-only; }; @@ -114,10 +115,9 @@ &wmac { status = "okay"; - mtd-cal-data = <&eeprom 0x1000>; - mtd-mac-address = <&eeprom 0x1002>; + mtd-cal-data = <&art 0x1000>; }; ð0 { - mtd-mac-address = <&eeprom 0x0>; + mtd-mac-address = <&art 0x0>; }; diff --git a/target/linux/ath79/dts/ar9344.dtsi b/target/linux/ath79/dts/ar9344.dtsi index 117c0b07a..de118e9a3 100644 --- a/target/linux/ath79/dts/ar9344.dtsi +++ b/target/linux/ath79/dts/ar9344.dtsi @@ -31,7 +31,7 @@ }; }; -&apb { +&ahb { pcie: pcie-controller@180c0000 { compatible = "qcom,ar9340-pci", "qcom,ar7240-pci"; #address-cells = <3>; diff --git a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts new file mode 100644 index 000000000..ede248759 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + compatible = "aerohive,hiveap-121", "qca,ar9344"; + model = "Aerohive HiveAP 121"; + + aliases { + led-boot = &led_power_white; + led-failsafe = &led_power_orange; + led-running = &led_power_white; + led-upgrade = &led_power_orange; + label-mac-device = ð0; + }; + + chosen { + bootargs = "console=ttyS0,9600"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + label = "hiveap-121:orange:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_power_white: power_white { + label = "hiveap-121:white:power"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + }; + + i2c { + compatible = "i2c-gpio"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH /* sda */ + &gpio 12 GPIO_ACTIVE_HIGH /* scl */ + >; + #address-cells = <1>; + #size-cells = <0>; + + tpm@29 { + compatible = "atmel,at97sc3204t"; + reg = <0x29>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + gpio_ext_lna0 { + gpio-hog; + gpios = <20 0>; + output-low; + line-name = "hiveap-121:ext:lna0"; + }; + + gpio_ext_lna1 { + gpio-hog; + gpios = <19 0>; + output-low; + line-name = "hiveap-121:ext:lna1"; + }; + + gpio_usb_power { + gpio-hog; + gpios = <15 0>; + output-high; + line-name = "hiveap-121:power:usb"; + }; +}; + +&usb { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,0030"; + reg = <0x0000 0 0 0 0>; + + mtd-mac-address = <&hw_info 0x0>; + mtd-mac-address-increment = <2>; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x80000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0x80000 0x10000>; + read-only; + }; + + hw_info: partition@90000 { + label = "hw-info"; + reg = <0x90000 0x10000>; + read-only; + }; + + partition@a0000 { + label = "boot-info"; + reg = <0xa0000 0x10000>; + read-only; + }; + + partition@b0000 { + label = "boot-sinfo"; + reg = <0xb0000 0x10000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + mtd-mac-address = <&hw_info 0x0>; + mtd-mac-address-increment = <1>; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot1"; + reg = <0x0 0x400000>; + read-only; + }; + + partition@400000 { + label = "u-boot-env1"; + reg = <0x400000 0x400000>; + read-only; + }; + + partition@800000 { + label = "kernel"; + reg = <0x800000 0x500000>; + }; + + partition@d00000 { + label = "ubi"; + reg = <0xd00000 0x6f00000>; + }; + + partition@2e00000 { + label = "wifi-info"; + reg = <0x7c00000 0x400000>; + read-only; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x06000000 0x00000101 0x00001313>; + + mtd-mac-address = <&hw_info 0x0>; + + phy-mode = "rgmii-id"; + phy-handle = <&phy0>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxd-delay = <1>; + rxdv-delay = <1>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts index b0fdce77a..66ac71826 100644 --- a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts +++ b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts @@ -12,9 +12,10 @@ aliases { serial0 = &uart; - led-boot = &wan; - led-failsafe = &wan; - led-upgrade = &wan; + led-boot = &led_wan; + led-failsafe = &led_wan; + led-upgrade = &led_wan; + label-mac-device = ð0; }; leds { @@ -23,7 +24,7 @@ pinctrl-names = "default"; pinctrl-0 = <&led_rssimediumhigh_pin>; - wan: wan { + led_wan: wan { label = "cf-e120a-v3:green:wan"; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; }; @@ -61,8 +62,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -74,13 +74,14 @@ }; &pinmux { - led_rssimediumhigh_pin: pinmux_rssimediumhigh_pin { - pinctrl-single,bits = <0x10 0x0 0xff>; - }; + led_rssimediumhigh_pin: pinmux_rssimediumhigh_pin { + pinctrl-single,bits = <0x10 0x0 0xff>; + }; }; &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -93,7 +94,7 @@ #address-cells = <1>; #size-cells = <1>; - uboot: partition@0 { + partition@0 { label = "u-boot"; reg = <0x000000 0x010000>; read-only; @@ -105,13 +106,13 @@ read-only; }; - firmware: partition@20000 { + partition@20000 { compatible = "denx,uimage"; label = "firmware"; reg = <0x020000 0x7d0000>; }; - nvram: partition@7f0000 { + partition@7f0000 { label = "nvram"; reg = <0x7f0000 0x010000>; read-only; diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts b/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts index 89603aaff..882ec5e13 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts +++ b/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts @@ -8,10 +8,10 @@ compatible = "dlink,dir-825-c1", "qca,ar9344"; aliases { - led-boot = &orange_power; - led-failsafe = &orange_power; - led-running = &blue_power; - led-upgrade = &orange_power; + led-boot = &led_power_orange; + led-failsafe = &led_power_orange; + led-running = &led_power_blue; + led-upgrade = &led_power_orange; serial0 = &uart; }; @@ -21,40 +21,40 @@ pinctrl-names = "default"; pinctrl-0 = <&enable_gpio_11>; - blue_power: blue_power { + led_power_blue: power_blue { label = "d-link:blue:power"; gpios = <&gpio 22 GPIO_ACTIVE_LOW>; }; - blue_usb { + usb { label = "d-link:blue:usb"; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; linux,default-trigger = "usbport"; trigger-sources = <&hub_port1>; }; - blue_wan { + wan_blue { label = "d-link:blue:wan"; gpios = <&gpio 18 GPIO_ACTIVE_LOW>; }; - blue_wlan2g { + wlan2g { label = "d-link:blue:wlan2g"; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; - blue_wps { + wps { label = "d-link:blue:wps"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; - orange_power: orange_power { + led_power_orange: power_orange { label = "d-link:orange:power"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; - orange_wan { + wan_orange { label = "d-link:orange:wan"; gpios = <&gpio 19 GPIO_ACTIVE_LOW>; }; @@ -63,7 +63,7 @@ leds-ath9k { compatible = "gpio-leds"; - blue_wlan5g { + wlan5g { label = "d-link:blue:wlan5g"; gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; @@ -76,4 +76,3 @@ pinctrl-single,bits = <0x8 0x0 0xff000000>; }; }; - diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts b/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts index 4f0c1e58e..48853a270 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts +++ b/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts @@ -8,40 +8,39 @@ compatible = "dlink,dir-835-a1", "qca,ar9344"; aliases { - led-boot = &orange_power; - led-failsafe = &orange_power; - led-running = &green_power; - led-upgrade = &orange_power; + led-boot = &led_power_orange; + led-failsafe = &led_power_orange; + led-running = &led_power_green; + led-upgrade = &led_power_orange; serial0 = &uart; }; leds { compatible = "gpio-leds"; - green_power: green_power { + led_power_green: power_green { label = "d-link:green:power"; gpios = <&gpio 22 GPIO_ACTIVE_LOW>; }; - green_wan { + wan_green { label = "d-link:green:wan"; gpios = <&gpio 18 GPIO_ACTIVE_LOW>; }; - green_wps { + wps { label = "d-link:green:wps"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; - orange_power: orange_power { + led_power_orange: power_orange { label = "d-link:orange:power"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; - orange_wan { + wan_orange { label = "d-link:orange:wan"; gpios = <&gpio 19 GPIO_ACTIVE_LOW>; }; }; }; - diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi index b49d3458f..2dd2297e8 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi +++ b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi @@ -148,4 +148,3 @@ status = "okay"; qca,no-eeprom; }; - diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi new file mode 100644 index 000000000..16a4e3f6e --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi @@ -0,0 +1,290 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power_amber; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + rfkill { + label = "rfkill"; + linux,code = ; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio_11>; + + led_power_green: power_green { + label = "netgear:green:power"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + led_power_amber: power_amber { + label = "netgear:amber:power"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + wan_green { + label = "netgear:green:wan"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "netgear:amber:wan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan2g_green { + label = "netgear:green:wlan2g"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g_blue { + label = "netgear:blue:wlan5g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wps_green { + label = "netgear:green:wps"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wps_amber { + label = "netgear:amber:wps"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + usb_green { + label = "netgear:green:usb"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port>; + linux,default-trigger = "usbport"; + }; + }; +}; + +&pinmux { + enable_gpio_11: pinmux_enable_gpio_11 { + pinctrl-single,bits = <0x8 0x0 0xff000000>; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x40000>; + }; + + art: partition@80000 { + label = "caldata"; + reg = <0x80000 0x40000>; + read-only; + }; + + partition@c0000 { + label = "pot"; + reg = <0xc0000 0x80000>; + }; + + partition@140000 { + label = "language"; + reg = <0x140000 0x200000>; + }; + + partition@340000 { + label = "config"; + reg = <0x340000 0x80000>; + }; + + partition@3c0000 { + label = "traffic_meter"; + reg = <0x3c0000 0x300000>; + }; + + kernel@6c0000 { + label = "kernel"; + reg = <0x6c0000 0x200000>; + }; + + ubi@8c0000 { + label = "ubi"; + reg = <0x8c0000 0x1700000>; + }; + + partition@6c0000 { + label = "firmware"; + reg = <0x6c0000 0x1900000>; + compatible = "netgear,uimage"; + }; + + partition@1fc0000 { + label = "caldata_backup"; + reg = <0x1fc0000 0x40000>; + read-only; + }; + + partition@2000000 { + label = "reserved"; + reg = <0x2000000 0x6000000>; + read-only; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&builtin_switch { + resets = <&rst 8>, <&rst 12>; + reset-names = "switch", "switch-analog"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x07600000 + 0x0c 0x01000000 + 0x10 0xc1000000 + 0x50 0xcc35cc35 + 0x54 0xcb37cb37 + 0x58 0x00000000 + 0x5c 0x00f3cf00 + 0x7c 0x0000007e + 0x94 0x0000007e + >; + }; +}; + +ð0 { + status = "okay"; + + /* default for ar934x, except for 1000M */ + pll-data = <0x06000000 0x00000101 0x00001616>; + + mtd-mac-address = <&art 0x0>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; +}; + +&gpio { + status = "okay"; + + lna0 { + gpio-hog; + line-name = "netgear:ext:lna0"; + gpios = <18 GPIO_ACTIVE_HIGH>; + output-high; + }; + + lna1 { + gpio-hog; + line-name = "netgear:ext:lna1"; + gpios = <19 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&wmac { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + qca,no-eeprom; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + mtd-mac-address = <&art 0xc>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + + usb_power { + gpio-hog; + line-name = "netgear:power:usb"; + gpios = <0 GPIO_ACTIVE_HIGH>; + output-high; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&usb { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&uart { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts b/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts new file mode 100644 index 000000000..8a38aeab5 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_netgear_wndr.dtsi" + +/ { + compatible = "netgear,wndr3700-v4", "qca,ar9344"; + model = "Netgear WNDR3700 v4"; +}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts b/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts new file mode 100644 index 000000000..9b57bb88a --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_netgear_wndr.dtsi" + +/ { + compatible = "netgear,wndr4300", "qca,ar9344"; + model = "Netgear WNDR4300"; +}; diff --git a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts index 0875c319b..e7186425f 100644 --- a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts +++ b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts @@ -15,10 +15,10 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; leds { @@ -36,7 +36,7 @@ linux,default-trigger = "phy0tpt"; }; - system: system { + led_system: system { label = "raccoon:blue:sys"; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; }; @@ -53,8 +53,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { linux,code = ; @@ -77,10 +76,10 @@ }; &spi { - num-cs = <1>; - status = "okay"; + num-cs = <1>; + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; @@ -162,18 +161,16 @@ phy0: ethernet-phy@0 { reg = <0>; - phy-mode = "rgmii"; }; }; ð0 { status = "okay"; - /* default for ar934x, except for 1000M */ - pll-data = <0x06000000 0x00000101 0x00001616>; + pll-data = <0x06000000 0x00000101 0x00001313>; mtd-mac-address = <&art 0x0>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; phy-handle = <&phy0>; }; diff --git a/target/linux/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts index 7a211e908..50a069cb6 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts @@ -12,15 +12,14 @@ aliases { serial0 = &uart; - led-boot = &status; - led-failsafe = &status; - led-running = &running; - led-upgrade = &status; + led-boot = &led_power_amber; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; @@ -36,12 +35,12 @@ leds { compatible = "gpio-leds"; - status: power_amber { + led_power_amber: power_amber { label = "pcs:amber:power"; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; }; - running: power_green { + led_power_green: power_green { label = "pcs:green:power"; gpios = <&gpio 12 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -84,10 +83,10 @@ }; &spi { - num-cs = <1>; - status = "okay"; + num-cs = <1>; + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; diff --git a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts index 0b4a0ea37..a43ac4e93 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts @@ -12,15 +12,14 @@ aliases { serial0 = &uart; - led-boot = &status; - led-failsafe = &status; - led-running = &status; - led-upgrade = &status; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; @@ -43,7 +42,7 @@ leds { compatible = "gpio-leds"; - status: power { + led_power: power { label = "pcs:amber:power"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>, <&gpio 4 GPIO_ACTIVE_LOW>; @@ -76,10 +75,10 @@ }; &spi { - num-cs = <1>; - status = "okay"; + num-cs = <1>; + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; @@ -177,7 +176,6 @@ phy-mode = "rgmii"; phy-handle = <&phy0>; - aliases { ag0 = ð1; }; @@ -222,5 +220,4 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x1002>; }; diff --git a/target/linux/ath79/dts/ar9344_qihoo_c301.dts b/target/linux/ath79/dts/ar9344_qihoo_c301.dts new file mode 100644 index 000000000..746c7f588 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_qihoo_c301.dts @@ -0,0 +1,236 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + model = "Qihoo 360 C301"; + compatible = "qihoo,c301"; + + aliases { + led-boot = &led_wlan_g; + led-failsafe = &led_wlan_o; + led-upgrade = &led_wlan_o; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + led_wlan_g: wlan_g { + label = "c301:green:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + led_wlan_o: wlan_o { + label = "c301:orange:wlan"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + reg_eth_led_vbus { + compatible = "regulator-fixed"; + regulator-name = "eth_led_vbus"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + gpio = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + reg_usb_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + gpio = <&gpio 19 GPIO_ACTIVE_HIGH>; + }; +}; + +&pinmux { + pmx_spi_cs1: pinmux_spi_cs1 { + pinctrl-single,bits = <0xc 0x07 0xff>; + }; + + pmx_led_switch: pinmux_led_switch { + pinctrl-single,bits = <0x0 0x2b2a2d00 0xffffff00>; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; + + gpio_ext_lna0 { + gpio-hog; + gpios = <14 0>; + output-high; + line-name = "c301:ext:lna0"; + }; + + gpio_ext_lna1 { + gpio-hog; + gpios = <15 0>; + output-high; + line-name = "c301:ext:lna1"; + }; +}; + +&builtin_switch { + pinctrl-names = "default"; + pinctrl-0 = <&pmx_led_switch>; +}; + +&spi { + pinctrl-names = "default"; + pinctrl-0 = <&pmx_spi_cs1>; + status = "okay"; + + num-cs = <2>; + cs-gpios= <0>, <0>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "devdata"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "devconf"; + reg = <0x60000 0x10000>; + read-only; + }; + + partition@70000 { + compatible = "seama"; + label = "firmware"; + reg = <0x70000 0xf60000>; + }; + + partition@fd0000 { + label = "warm_start"; + reg = <0xfd0000 0x10000>; + read-only; + }; + + partition@fe0000 { + label = "action_image_config"; + reg = <0xfe0000 0x10000>; + }; + + partition@ff0000 { + label = "radiocfg"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; + + flash@1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "firmware2"; + reg = <0x0 0xf00000>; + }; + + partition@f00000 { + label = "privatedata"; + reg = <0xf00000 0x100000>; + read-only; + }; + }; + }; +}; + +&usb { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + }; +}; + +&wmac { + status = "okay"; + qca,no-eeprom; +}; + +ð1 { + status = "okay"; + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + switch-only-mode = <1>; + }; +}; + +ð0 { + status = "okay"; + phy-handle = <&swphy0>; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi new file mode 100644 index 000000000..d002dfeb3 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + aliases { + label-mac-device = &wmac; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "partition-table"; + reg = <0x020000 0x010000>; + read-only; + }; + + info: partition@30000 { + label = "info"; + reg = <0x030000 0x010000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + reg = <0x040000 0x780000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x000000 0x200000>; + }; + + partition@200000 { + label = "rootfs"; + reg = <0x200000 0x580000>; + }; + }; + + partition@7c0000 { + label = "config"; + reg = <0x7c0000 0x030000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&info 0x08>; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&info 0x8>; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe210-v1.dts b/target/linux/ath79/dts/ar9344_tplink_cpe210-v1.dts new file mode 100644 index 000000000..95604f07c --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_cpe210-v1.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe_2port.dtsi" + +/ { + compatible = "tplink,cpe210-v1", "qca,ar9344"; + model = "TP-Link CPE210 v1"; +}; + +&led_link4 { + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe220-v2.dts b/target/linux/ath79/dts/ar9344_tplink_cpe220-v2.dts new file mode 100644 index 000000000..4a737378b --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_cpe220-v2.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe_2port.dtsi" + +/ { + compatible = "tplink,cpe220-v2", "qca,ar9344"; + model = "TP-Link CPE220 v2"; +}; + +&led_link4 { + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe510-v1.dts b/target/linux/ath79/dts/ar9344_tplink_cpe510-v1.dts new file mode 100644 index 000000000..483fdf4e6 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_cpe510-v1.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe_2port.dtsi" + +/ { + compatible = "tplink,cpe510-v1", "qca,ar9344"; + model = "TP-Link CPE510 v1"; +}; + +&led_link4 { + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts b/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts new file mode 100644 index 000000000..7348bf755 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe_1port.dtsi" + +/ { + compatible = "tplink,cpe510-v2", "qca,ar9344"; + model = "TP-Link CPE510 v2"; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts b/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts new file mode 100644 index 000000000..20a16c3d3 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe_1port.dtsi" + +/ { + compatible = "tplink,cpe510-v3", "qca,ar9344"; + model = "TP-Link CPE510 v3"; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe610-v1.dts b/target/linux/ath79/dts/ar9344_tplink_cpe610-v1.dts new file mode 100644 index 000000000..54ea399b7 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_cpe610-v1.dts @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe.dtsi" + +/ { + model = "TP-Link CPE610 v1"; + compatible = "tplink,cpe610-v1", "qca,ar9344"; + + aliases { + led-boot = &led_lan; + led-failsafe = &led_lan; + led-upgrade = &led_lan; + }; + + leds { + compatible = "gpio-leds"; + + led_lan: lan { + label = "tp-link:green:lan"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "tp-link:green:wlan5g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +ð1 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi new file mode 100644 index 000000000..653efdee1 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_cpe_1port.dtsi @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe.dtsi" + +/ { + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds { + compatible = "gpio-leds"; + + lan { + label = "tp-link:green:lan"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + link1 { + label = "tp-link:green:link1"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + link2 { + label = "tp-link:green:link2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + link3 { + label = "tp-link:green:link3"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_system: link4 { + label = "tp-link:green:link4"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð1 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi new file mode 100644 index 000000000..e97e49d71 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe.dtsi" + +/ { + aliases { + led-boot = &led_link4; + led-failsafe = &led_link4; + led-running = &led_link4; + led-upgrade = &led_link4; + }; + + leds { + compatible = "gpio-leds"; + + lan0 { + label = "tp-link:green:lan0"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "tp-link:green:lan1"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + link1 { + label = "tp-link:green:link1"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + link2 { + label = "tp-link:green:link2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + link3 { + label = "tp-link:green:link3"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_link4: link4 { + label = "tp-link:green:link4"; + }; + }; +}; + +&gpio { + gpio_ext_lna0 { + gpio-hog; + gpios = <18 0>; + output-high; + line-name = "tp-link:ext:lna0"; + }; + + gpio_ext_lna1 { + gpio-hog; + gpios = <19 0>; + output-high; + line-name = "tp-link:ext:lna1"; + }; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&info 0x8>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <0>; + switch-only-mode = <1>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts new file mode 100644 index 000000000..e709e6b54 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_tl-wdrxxxx.dtsi" + +/ { + model = "TP-Link TL-WDR3500 v1"; + compatible = "tplink,tl-wdr3500-v1", "qca,ar9344"; + + aliases { + label-mac-device = &wmac; + }; +}; + +&leds { + usb { + label = "tp-link:green:usb"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port>; + }; +}; + +&gpio { + usb_power { + gpio-hog; + gpios = <12 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "tp-link:power:usb"; + }; +}; + +&pinmux { + pmx_led_wan_lan: pinmux_led_wan_lan { + pinctrl-single,bits = <0x10 0x2c2d0000 0xffff0000>, + <0x14 0x292a2b 0xffffff>; + }; +}; + +&builtin_switch { + pinctrl-names = "default"; + pinctrl-0 = <&pmx_led_wan_lan>; +}; + +&usb { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&ath9k { + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <1>; +}; + +&wmac { + mtd-mac-address = <&uboot 0x1fc00>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <(-1)>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <0>; + switch-only-mode = <1>; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <2>; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3600.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3600-v1.dts similarity index 56% rename from target/linux/ath79/dts/ar9344_tplink_tl-wdr3600.dts rename to target/linux/ath79/dts/ar9344_tplink_tl-wdr3600-v1.dts index 9f708242f..42f40d52a 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3600.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3600-v1.dts @@ -4,6 +4,6 @@ #include "ar9344_tplink_tl-wdr4300.dtsi" / { - model = "TP-Link WDR3600"; - compatible = "tplink,tl-wdr3600", "qca,ar9344"; + model = "TP-Link TL-WDR3600 v1"; + compatible = "tplink,tl-wdr3600-v1", "qca,ar9344"; }; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1.dts similarity index 56% rename from target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dts rename to target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1.dts index ba6b4f846..f8f05d24b 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1.dts @@ -4,6 +4,6 @@ #include "ar9344_tplink_tl-wdr4300.dtsi" / { - model = "TP-Link WDR4300"; - compatible = "tplink,tl-wdr4300", "qca,ar9344"; + model = "TP-Link TL-WDR4300 v1"; + compatible = "tplink,tl-wdr4300-v1", "qca,ar9344"; }; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi index 6be197c0c..9ca96cc7c 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi @@ -1,155 +1,56 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include -#include - -#include "ar9344.dtsi" +#include "ar9344_tplink_tl-wdrxxxx.dtsi" / { aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; - }; - - leds { - compatible = "gpio-leds"; - - usb1 { - label = "tp-link:green:usb1"; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - trigger-sources = <&hub_port1>; - linux,default-trigger = "usbport"; - }; - - usb2 { - label = "tp-link:green:usb2"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - trigger-sources = <&hub_port2>; - linux,default-trigger = "usbport"; - }; - - wlan2g { - label = "tp-link:green:wlan2g"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - system: system { - label = "tp-link:green:system"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - qss { - label = "tp-link:green:qss"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - }; - }; - - ath9k-leds { - compatible = "gpio-leds"; - - wlan5g { - label = "tp-link:green:wlan5g"; - gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - }; - - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; - - reset { - linux,code = ; - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - wifi { - linux,code = ; - linux,input-type = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - }; - - gpio-export { - compatible = "gpio-export"; - - gpio_usb1_power { - gpio-export,name = "tp-link:power:usb1"; - gpio-export,output = <1>; - gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; - }; - - gpio_usb2_power { - gpio-export,name = "tp-link:power:usb2"; - gpio-export,output = <1>; - gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; - }; - - gpio_ext_lna0 { - gpio-export,name = "tp-link:ext:lna0"; - gpio-export,output = <1>; - gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; - }; - - gpio_ext_lna1 { - gpio-export,name = "tp-link:ext:lna1"; - gpio-export,output = <1>; - gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; - }; + label-mac-device = &ath9k; }; }; -&ref { - clock-frequency = <40000000>; -}; +&leds { + usb1 { + label = "tp-link:green:usb1"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port1>; + linux,default-trigger = "usbport"; + }; -&uart { - status = "okay"; + usb2 { + label = "tp-link:green:usb2"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port2>; + linux,default-trigger = "usbport"; + }; }; &gpio { - status = "okay"; -}; + lna0 { + gpio-hog; + gpios = <18 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "tp-link:ext:lna0"; + }; -&spi { - num-cs = <1>; + lna1 { + gpio-hog; + gpios = <19 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "tp-link:ext:lna1"; + }; - status = "okay"; + usb1_power { + gpio-hog; + gpios = <22 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "tp-link:power:usb1"; + }; - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - uboot: partition@0 { - label = "u-boot"; - reg = <0x000000 0x020000>; - read-only; - }; - - partition@20000 { - compatible = "tplink,firmware"; - label = "firmware"; - reg = <0x020000 0x7d0000>; - }; - - art: partition@7f0000 { - label = "art"; - reg = <0x7f0000 0x010000>; - read-only; - }; - }; + usb2_power { + gpio-hog; + gpios = <21 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "tp-link:power:usb2"; }; }; @@ -180,23 +81,11 @@ status = "okay"; }; -&pcie { - status = "okay"; - - ath9k: wifi@0,0 { - compatible = "pci168c,0033"; - reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&uboot 0x1fc00>; - qca,no-eeprom; - #gpio-cells = <2>; - gpio-controller; - }; +&ath9k { + mtd-mac-address = <&uboot 0x1fc00>; }; &wmac { - status = "okay"; - - mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; mtd-mac-address-increment = <(-1)>; }; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi new file mode 100644 index 000000000..124f4d50b --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "ar9344.dtsi" + +/ { + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds: leds { + compatible = "gpio-leds"; + + wlan2g { + label = "tp-link:green:wlan2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_system: system { + label = "tp-link:green:system"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + qss { + label = "tp-link:green:qss"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wlan5g { + label = "tp-link:green:wlan5g"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wifi { + linux,code = ; + linux,input-type = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0x7d0000>; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_wbs210-v2.dts b/target/linux/ath79/dts/ar9344_tplink_wbs210-v2.dts new file mode 100644 index 000000000..8c5535754 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_wbs210-v2.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe_2port.dtsi" + +/ { + compatible = "tplink,wbs210-v2", "qca,ar9344"; + model = "TP-Link WBS210 v2"; +}; + +&led_link4 { + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_wbs510-v1.dts b/target/linux/ath79/dts/ar9344_tplink_wbs510-v1.dts new file mode 100644 index 000000000..28ea727b3 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_wbs510-v1.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe_2port.dtsi" + +/ { + compatible = "tplink,wbs510-v1", "qca,ar9344"; + model = "TP-Link WBS510 v1"; +}; + +&led_link4 { + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_wbs510-v2.dts b/target/linux/ath79/dts/ar9344_tplink_wbs510-v2.dts new file mode 100644 index 000000000..8ce47a513 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_wbs510-v2.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_tplink_cpe_2port.dtsi" + +/ { + compatible = "tplink,wbs510-v2", "qca,ar9344"; + model = "TP-Link WBS510 v2"; +}; + +&led_link4 { + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; +}; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts new file mode 100644 index 000000000..48dcf1230 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + model = "Western Digital My Net N750"; + compatible = "wd,mynet-n750", "qca,ar9344"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + wifi { + label = "mynet-n750:blue:wireless"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + }; + + internet { + label = "mynet-n750:blue:internet"; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + + wps { + label = "mynet-n750:blue:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + led_power: power { + label = "mynet-n750:blue:power"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wps { + linux,code = ; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; + + gpio_ext_lna0 { + gpio-hog; + gpios = <15 0>; + output-high; + line-name = "mynet-n750:ext:lna0"; + }; + + gpio_ext_lna1 { + gpio-hog; + gpios = <18 0>; + output-high; + line-name = "mynet-n750:ext:lna1"; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "bootloader"; + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + label = "bdcfg"; + reg = <0x040000 0x10000>; + read-only; + }; + + partition@50000 { + label = "devdata"; + reg = <0x050000 0x10000>; + read-only; + }; + + partition@60000 { + label = "devconf"; + reg = <0x060000 0x10000>; + read-only; + }; + + partition@70000 { + compatible = "seama"; + label = "firmware"; + reg = <0x070000 0xf80000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&usb { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + #trigger-source-cells = <0>; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + hub_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + switch0@1f { + compatible = "qca,ar8327"; + reg = <0x1f>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x10 0x80000080 /* POWER_ON_STRIP */ + 0x50 0xc737c737 /* LED_CTRL0 */ + 0x54 0x00000000 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x0030c300 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + /* default for ar934x, except for 1000M */ + pll-data = <0x06000000 0x00000101 0x00001616>; + + phy-mode = "rgmii"; + fixed-link { + speed = <1000>; + full-duplex; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts index 1877cea3d..3df601a73 100644 --- a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts +++ b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts @@ -15,16 +15,16 @@ }; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; leds { compatible = "gpio-leds"; - power: power { + led_power: power { label = "mynet-wifi-rangeextender:blue:power"; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; /* LED has no off state. It's either on or it blinks */ @@ -58,26 +58,22 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <50>; + compatible = "gpio-keys"; reset { linux,code = ; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; }; band-switch { linux,code = ; gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; linux,input-type = ; - debounce-interval = <60>; }; wps { linux,code = ; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; }; }; }; @@ -91,10 +87,10 @@ }; &spi { - num-cs = <1>; - status = "okay"; + num-cs = <1>; + flash@0 { compatible = /* "s25fl064k", */ "jedec,spi-nor"; reg = <0>; diff --git a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts index 6895a22e1..4ee3ace82 100644 --- a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts +++ b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts @@ -59,8 +59,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <50>; + compatible = "gpio-keys"; reset { linux,code = ; diff --git a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts new file mode 100644 index 000000000..57312f6ff --- /dev/null +++ b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + model = "ZBT WD323"; + compatible = "zbtlink,zbt-wd323", "qca,ar9344"; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + i2c { + compatible = "i2c-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio15 &enable_gpio19>; + + sda-gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + scl-gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + + /* can be removed on 4.19 */ + gpios = <&gpio 19 GPIO_ACTIVE_LOW>, + <&gpio 15 GPIO_ACTIVE_LOW>; + + pcf8563: pcf8563@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + #clock-cells = <0>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio20_gpio22>; + + wifi { + label = "zbt-wd323:green:wifi"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + lan1 { + label = "zbt-wd323:orange:lan1"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "zbt-wd323:orange:lan2"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&wdt { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio21>; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; +}; + +&usb { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +ð0 { + status = "okay"; + phy-handle = <&swphy4>; + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + status = "okay"; + mtd-mac-address = <&art 0x6>; +}; + +&spi { + num-chipselects = <1>; + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <22000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot@0 { + reg = <0x0 0x40000>; + read-only; + }; + + uboot-env@40000 { + reg = <0x40000 0x10000>; + read-only; + }; + + firmware@50000 { + compatible = "denx,uimage"; + reg = <0x50000 0xfa0000>; + }; + + art: art@ff0000 { + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; +}; + +&pinmux { + enable_gpio15: pinmux_enable_gpio15 { + pinctrl-single,bits = <0xc 0x0 0xff000000>; + }; + + enable_gpio19: pinmux_enable_gpio19 { + pinctrl-single,bits = <0x10 0x0 0xff000000>; + }; + + enable_gpio20_gpio22: pinmux_enable_gpio20_gpio22 { + pinctrl-single,bits = <0x14 0x0 0xff00ff>; + }; + + enable_gpio21: pinmux_enable_gpio21 { + pinctrl-single,bits = <0x14 0x0 0xff00>; + }; +}; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index 691cbe13e..bb6c64745 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -38,7 +38,7 @@ }; }; - ahb { + ahb: ahb { compatible = "simple-bus"; ranges; @@ -133,18 +133,36 @@ #reset-cells = <1>; }; + }; - gmac: gmac@18070000 { - compatible = "qca,ar9340-gmac"; - reg = <0x18070000 0x14>; - }; + nand: nand@1b000200 { + compatible = "qca,ar934x-nand"; + reg = <0x1b000200 0xb8>; - wmac: wmac@18100000 { - compatible = "qca,ar9340-wmac"; - reg = <0x18100000 0x20000>; + interrupts = <21>; + interrupt-parent = <&miscintc>; - status = "disabled"; - }; + resets = <&rst 14>; + reset-names = "nand"; + + nand-ecc-mode = "hw"; + + #address-cells = <1>; + #size-cells = <0>; + + status = "disabled"; + }; + + gmac: gmac@18070000 { + compatible = "qca,ar9340-gmac"; + reg = <0x18070000 0x14>; + }; + + wmac: wmac@18100000 { + compatible = "qca,ar9340-wmac"; + reg = <0x18100000 0x20000>; + + status = "disabled"; }; usb: usb@1b000000 { @@ -240,7 +258,7 @@ }; ð1 { - compatible = "qca,ar9340-eth", "syscon", "simple-mfd"; + compatible = "qca,ar9340-eth", "syscon"; resets = <&rst 13>; reset-names = "mac"; diff --git a/target/linux/ath79/dts/ath79.dtsi b/target/linux/ath79/dts/ath79.dtsi index a57c58659..c35127202 100644 --- a/target/linux/ath79/dts/ath79.dtsi +++ b/target/linux/ath79/dts/ath79.dtsi @@ -43,7 +43,7 @@ eth0: eth@19000000 { status = "disabled"; - compatible = "qca,ath79-eth", "syscon", "simple-mfd"; + compatible = "qca,ath79-eth", "syscon"; reg = <0x19000000 0x200>; interrupts = <4>; @@ -66,7 +66,7 @@ eth1: eth@1a000000 { status = "disabled"; - compatible = "qca,ath79-eth", "syscon", "simple-mfd"; + compatible = "qca,ath79-eth", "syscon"; reg = <0x1a000000 0x200>; interrupts = <5>; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts new file mode 100644 index 000000000..433a7e9c5 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "comfast,cf-e313ac", "qca,qca9531"; + model = "COMFAST CF-E313AC"; + + aliases { + serial0 = &uart; + led-boot = &led_rssihigh; + led-failsafe = &led_rssihigh; + led-upgrade = &led_rssihigh; + label-mac-device = ð1; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + + wlan { + label = "cf-e313ac:green:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + lan { + label = "cf-e313ac:green:lan"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "cf-e313ac:green:wan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + rssilow { + label = "cf-e313ac:red:rssilow"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "cf-e313ac:red:rssimediumlow"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "cf-e313ac:green:rssimediumhigh"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_rssihigh: rssihigh { + label = "cf-e313ac:green:rssihigh"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x010000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x010000 0x010000>; + read-only; + }; + + partition@20000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x020000 0x7c0000>; + }; + + partition@7e0000 { + label = "config"; + reg = <0x7e0000 0x010000>; + read-only; + }; + + partition@7f0000 { + label = "nvram"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + status = "okay"; + phy-handle = <&swphy0>; + mtd-mac-address = <&art 0x1002>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + status = "okay"; + mtd-mac-address = <&art 0x0>; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts new file mode 100644 index 000000000..192b7112a --- /dev/null +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "comfast,cf-e314n-v2", "qca,qca9531"; + model = "COMFAST CF-E314N v2"; + + aliases { + serial0 = &uart; + led-boot = &led_rssihigh; + led-failsafe = &led_rssihigh; + led-upgrade = &led_rssihigh; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &led_rssilow_pin &led_rssimediumhigh_pin &led_rssihigh_pin>; + + wan { + label = "cf-e314n-v2:green:wan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "cf-e314n-v2:green:lan"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + rssilow { + label = "cf-e314n-v2:red:signal1"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "cf-e314n-v2:red:signal2"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "cf-e314n-v2:green:signal3"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_rssihigh: rssihigh { + label = "cf-e314n-v2:green:signal4"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "cf-e314n-v2:green:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&pinmux { + led_rssilow_pin: pinmux_rssilow_pin { + pinctrl-single,bits = <0x8 0x0 0xff000000>; + }; + + led_rssimediumhigh_pin: pinmux_rssimediumhigh_pin { + pinctrl-single,bits = <0xc 0x0 0x00ff0000>; + }; + + led_rssihigh_pin: pinmux_rssihigh_pin { + pinctrl-single,bits = <0x10 0x0 0x000000ff>; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x010000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x010000 0x010000>; + read-only; + }; + + partition@20000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x020000 0x7c0000>; + }; + + partition@7e0000 { + label = "configs"; + reg = <0x7e0000 0x010000>; + read-only; + }; + + partition@7f0000 { + label = "nvram"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; +}; + +ð1 { + status = "okay"; + mtd-mac-address = <&art 0x6>; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts index c181b32aa..74a3554bc 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts @@ -10,11 +10,14 @@ compatible = "comfast,cf-e5", "qca,qca9531"; model = "COMFAST CF-E5/E7"; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + aliases { + label-mac-device = ð0; + }; - button0 { + keys { + compatible = "gpio-keys"; + + reset { label = "reset"; linux,code = ; gpios = <&gpio 17 GPIO_ACTIVE_LOW>; diff --git a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts index 62b6a766f..242dccdcf 100644 --- a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts +++ b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts @@ -10,10 +10,16 @@ compatible = "engenius,ews511ap", "qca,qca9531"; model = "EnGenius EWS511AP"; - keys { - compatible = "gpio-keys-polled"; + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; - poll-interval = <20>; pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; @@ -24,17 +30,10 @@ }; }; - aliases { - led-boot = &power_led; - led-failsafe = &power_led; - led-running = &power_led; - led-upgrade = &power_led; - }; - leds { compatible = "gpio-leds"; - power_led: power { + led_power: power { label = "ews511ap:amber:power"; gpios = <&gpio 0 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -92,6 +91,7 @@ &spi { status = "okay"; + num-cs = <0>; flash@0 { @@ -118,6 +118,7 @@ art: partition@50000 { label = "art"; reg = <0x050000 0x010000>; + read-only; }; partition@60000 { @@ -131,6 +132,7 @@ ð0 { status = "okay"; + phy-handle = <&swphy4>; }; @@ -140,5 +142,6 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts index fba08e429..0eeda5c3c 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts @@ -1,13 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /dts-v1/; -#include "qca9531_glinet_gl-ar300m-nor.dts" +#include "qca9531_glinet_gl-ar300m.dtsi" / { compatible = "glinet,gl-ar300m-lite", "qca,qca9531"; model = "GL.iNet GL-AR300M-Lite"; }; -// GL-AR300M-Lite has different LED colors than the non-Lite version +/delete-node/ &nand_flash; + +&nor_firmware { + compatible = "denx,uimage"; + label = "firmware"; +}; + +// "Disable" unpopulated GMAC1 + +ð1 { + compatible = "syscon", "simple-mfd"; +}; &led_status { label = "gl-ar300m-lite:red:status"; @@ -19,4 +32,4 @@ &led_wlan { label = "gl-ar300m-lite:green:wlan"; -}; \ No newline at end of file +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts index 26c30f2b7..00f9f5c82 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /dts-v1/; #include "qca9531_glinet_gl-ar300m.dtsi" @@ -7,28 +9,10 @@ model = "GL.iNet GL-AR300M (NAND)"; }; -&spi { - num-cs = <1>; - - flash@1 { - compatible = "spinand,mt29f"; - reg = <1>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "kernel"; - reg = <0x000000 0x0200000>; - }; - - partition@1 { - label = "ubi"; - reg = <0x200000 0x7e00000>; - }; - }; - }; +&nand_kernel { + label = "kernel"; +}; + +&nand_ubi { + label = "ubi"; }; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts index 02196cf9c..34f48f5f6 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts @@ -1,11 +1,13 @@ /dts-v1/; -#include -#include - #include "qca9531_glinet_gl-ar300m.dtsi" / { compatible = "glinet,gl-ar300m-nor", "qca,qca9531"; model = "GL.iNet GL-AR300M (NOR)"; }; + +&nor_firmware { + compatible = "denx,uimage"; + label = "firmware"; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi index ceb2bfa0f..72bc2a646 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi @@ -11,27 +11,28 @@ led-failsafe = &led_status; led-running = &led_status; led-upgrade = &led_status; + label-mac-device = ð0; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; + pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; - button0 { + reset { label = "reset"; linux,code = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; }; - button1 { + right { label = "button right"; linux,code = ; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; }; - button3 { + left { label = "button left"; linux,code = ; gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; @@ -41,7 +42,7 @@ leds { compatible = "gpio-leds"; - // Colors from non-Lite versions + // Colors for non-Lite versions led_status: status { label = "gl-ar300m:green:status"; @@ -59,6 +60,13 @@ linux,default-trigger = "phy0tpt"; }; }; + + i2c: i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + }; }; &pcie0 { @@ -67,10 +75,12 @@ &spi { status = "okay"; - num-cs = <0>; + + num-cs = <2>; + cs-gpios = <0>, <0>; flash@0 { - compatible = "winbond,w25q128", "jedec,spi-nor"; + compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <25000000>; @@ -85,20 +95,42 @@ read-only; }; - partition@1 { + partition@40000 { label = "u-boot-env"; reg = <0x040000 0x010000>; }; - partition@2 { - compatible = "denx,uimage"; - label = "firmware"; + nor_firmware: partition@50000 { + label = "nor_firmware"; reg = <0x050000 0xfa0000>; }; - art: partition@3 { + art: partition@ff0000 { label = "art"; reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; + + nand_flash: flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + nand_kernel: partition@0 { + label = "nand_kernel"; + reg = <0x000000 0x400000>; + }; + + nand_ubi: partition@400000 { + label = "nand_ubi"; + reg = <0x400000 0x7c00000>; }; }; }; @@ -132,5 +164,4 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x1002>; }; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts new file mode 100644 index 000000000..328b667f7 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "qca9531_glinet_gl-ar300m.dtsi" + +/ { + compatible = "glinet,gl-ar300m16", "qca,qca9531"; + model = "GL.iNet GL-AR300M16"; +}; + +/delete-node/ &nand_flash; + +&nor_firmware { + compatible = "denx,uimage"; + label = "firmware"; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts new file mode 100644 index 000000000..269779212 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts @@ -0,0 +1,143 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "glinet,gl-ar750", "qca,qca9531"; + model = "GL.iNet GL-AR750"; + + aliases { + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + mode { + label = "mode"; + linux,code = ; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "gl-ar750:white:power"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "gl-ar750:white:wlan2g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "gl-ar750:white:wlan5g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + scl-gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + device_type = "pci"; + }; +}; + +&uart { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <0>; + + 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 = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + art: partition@50000 { + label = "art"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x060000 0xfa0000>; + }; + }; + }; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; +}; + +ð1 { + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts index 79cd51673..c845b5465 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts @@ -11,13 +11,12 @@ model = "GL.iNet GL-X750"; keys { - compatible = "gpio-keys-polled"; + compatible = "gpio-keys"; - poll-interval = <20>; pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; - button0 { + reset { label = "reset"; linux,code = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; @@ -108,6 +107,7 @@ art: partition@50000 { label = "art"; reg = <0x050000 0x010000>; + read-only; }; partition@60000 { @@ -133,5 +133,4 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x1002>; }; diff --git a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts new file mode 100644 index 000000000..130944f4f --- /dev/null +++ b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts @@ -0,0 +1,195 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "tplink,archer-d50-v1", "qca,qca9531"; + model = "TP-Link Archer D50 v1"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = &wmac; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + wlan2g { + label = "tp-link:white:wlan2g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "tp-link:white:wlan5g"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + qss { + label = "tp-link:white:qss"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "tp-link:white:wan"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "tp-link:white:lan"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "tp-link:white:usb"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port0>; + linux,default-trigger = "usbport"; + }; + + internet { + label = "tp-link:white:internet"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_system: system { + label = "tp-link:white:system"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + rfkill { + label = "RFKILL button"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + 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 = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0x7a0000>; + }; + + partition@7c0000 { + label = "config"; + reg = <0x7c0000 0x010000>; + read-only; + }; + + romfile: partition@7d0000 { + label = "romfile"; + reg = <0x7d0000 0x010000>; + read-only; + }; + + partition@7e0000 { + label = "rom"; + reg = <0x7e0000 0x010000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð1 { + mtd-mac-address = <&romfile 0xf100>; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&romfile 0xf100>; + mtd-mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&romfile 0xf100>; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,003c"; + reg = <0x0000 0 0 0 0>; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts index 7d77352f8..eccfc4860 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca953x_tplink_tl-wr810n.dtsi" / { diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts b/target/linux/ath79/dts/qca9531_yuncore_a770.dts index 18ad6307a..1caae75f1 100644 --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts @@ -8,13 +8,13 @@ / { model = "YunCore A770"; - compatible = "yuncore,a770", "qca,qca9533"; + compatible = "yuncore,a770", "qca,qca9531"; aliases { - led-boot = &status; - led-failsafe = &status; - led-running = &status; - led-upgrade = &status; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; }; chosen { @@ -40,7 +40,7 @@ gpios = <&gpio 16 GPIO_ACTIVE_LOW>; }; - status: status { + led_status: status { label = "a770:green:status"; gpios = <&gpio 12 GPIO_ACTIVE_LOW>; default-state = "keep"; diff --git a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts index 4bada9345..0d0134268 100644 --- a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts +++ b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts @@ -12,9 +12,9 @@ aliases { serial0 = &uart; - led-boot = &wan; - led-failsafe = &wan; - led-upgrade = &wan; + led-boot = &led_wan; + led-failsafe = &led_wan; + led-upgrade = &led_wan; }; leds { @@ -23,7 +23,7 @@ pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins &led_rssilow_pin &led_rssimediumhigh_pin &led_rssihigh_pin>; - wan: wan { + led_wan: wan { label = "cf-e110n-v2:green:wan"; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; }; @@ -65,8 +65,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -93,6 +92,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -138,12 +138,14 @@ ð0 { status = "okay"; + mtd-mac-address = <&art 0x0>; phy-handle = <&swphy4>; }; ð1 { status = "okay"; + mtd-mac-address = <&art 0x1002>; gmac-config { @@ -153,6 +155,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&art 0x6>; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe210-v2.dts b/target/linux/ath79/dts/qca9533_tplink_cpe210-v2.dts index e8273ba24..020dae67a 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpe210-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_cpe210-v2.dts @@ -5,5 +5,5 @@ / { compatible = "tplink,cpe210-v2", "qca,qca9533"; - model = "TP-LINK CPE210 v2"; + model = "TP-Link CPE210 v2"; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe210-v3.dts b/target/linux/ath79/dts/qca9533_tplink_cpe210-v3.dts index cf1f728d0..fd24ecc2d 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpe210-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_cpe210-v3.dts @@ -5,5 +5,5 @@ / { compatible = "tplink,cpe210-v3", "qca,qca9533"; - model = "TP-LINK CPE210 v3"; + model = "TP-Link CPE210 v3"; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi b/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi index ee1f90449..cb329a9a6 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_cpe210.dtsi @@ -1,125 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include +#include "qca9533_tplink_cpexxx.dtsi" -#include "qca953x.dtsi" - -/ { - chosen { - bootargs = "console=ttyS0,115200n8"; +&leds { + lan { + label = "tp-link:green:lan"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; }; - - aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; - }; - - leds { - compatible = "gpio-leds"; - - lan { - label = "tp-link:green:lan"; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - }; - - link1 { - label = "tp-link:green:link1"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - }; - - link2 { - label = "tp-link:green:link2"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - }; - - link3 { - label = "tp-link:green:link3"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - }; - - system: link4 { - label = "tp-link:green:link4"; - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; - }; - }; - -}; - -&uart { - status = "okay"; -}; - -&spi { - status = "okay"; - num-cs = <1>; - - flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - uboot: partition@0 { - label = "u-boot"; - reg = <0x000000 0x020000>; - read-only; - }; - - partition@20000 { - label = "partition-table"; - reg = <0x020000 0x10000>; - read-only; - }; - - info: partition@30000 { - label = "product-info"; - reg = <0x030000 0x10000>; - read-only; - }; - - partition@40000 { - label = "firmware"; - reg = <0x040000 0x780000>; - compatible = "tplink,firmware"; - }; - - config: partition@7c0000 { - label = "config"; - reg = <0x7c0000 0x30000>; - read-only; - }; - - ART: partition@7f0000 { - label = "ART"; - reg = <0x7f0000 0x10000>; - read-only; - }; - }; - }; -}; - -ð0 { - status = "okay"; - phy-handle = <&swphy4>; - mtd-mac-address = <&info 0x8>; }; ð1 { compatible = "syscon", "simple-mfd"; }; - -&wmac { - status = "okay"; - mtd-cal-data = <&ART 0x1000>; - mtd-mac-address = <&info 0x8>; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts new file mode 100644 index 000000000..dd90eb1c7 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_tplink_cpexxx.dtsi" + +/ { + compatible = "tplink,cpe220-v3", "qca,qca9533"; + model = "TP-Link CPE220 v3"; +}; + +&leds { + lan0 { + label = "tp-link:green:lan0"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "tp-link:green:lan1"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&info 0x8>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <0>; + switch-only-mode = <1>; + }; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi new file mode 100644 index 000000000..50d34c7c9 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_link4; + led-failsafe = &led_link4; + led-running = &led_link4; + led-upgrade = &led_link4; + label-mac-device = &wmac; + }; + + leds: leds { + compatible = "gpio-leds"; + + link1 { + label = "tp-link:green:link1"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + link2 { + label = "tp-link:green:link2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + link3 { + label = "tp-link:green:link3"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_link4: link4 { + label = "tp-link:green:link4"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "partition-table"; + reg = <0x020000 0x010000>; + read-only; + }; + + info: partition@30000 { + label = "info"; + reg = <0x030000 0x010000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + reg = <0x040000 0x780000>; + compatible = "tplink,firmware"; + }; + + config: partition@7c0000 { + label = "config"; + reg = <0x7c0000 0x030000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&info 0x8>; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&info 0x8>; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr810n-v2.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr810n-v2.dts index a98228d35..497fdd6ba 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr810n-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr810n-v2.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca953x_tplink_tl-wr810n.dtsi" / { diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10.dts new file mode 100644 index 000000000..9d6a32352 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_tplink_tl-wr841.dtsi" + +/ { + compatible = "tplink,tl-wr841-v10", "qca,qca9533"; + model = "TP-Link TL-WR841N/ND v10"; + + aliases { + led-boot = &led_qss; + led-failsafe = &led_qss; + led-running = &led_qss; + led-upgrade = &led_qss; + }; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts index 29fca8b3a..6c91757ce 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts @@ -1,31 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "qca9533_tplink_tl-wr841.dtsi" +#include "qca9533_tplink_tl-wr841-v11.dtsi" / { compatible = "tplink,tl-wr841-v11", "qca,qca9533"; model = "TP-Link TL-WR841N/ND v11"; - - aliases { - led-boot = &system_led; - led-failsafe = &system_led; - led-running = &system_led; - led-upgrade = &system_led; - }; -}; - -&gpio_leds { - system_led: system { - label = "tp-link:green:system"; - gpios = <&gpio 1 GPIO_ACTIVE_LOW>; - }; - - wan_orange { - label = "tp-link:orange:wan"; - gpios = <&gpio 2 GPIO_ACTIVE_LOW>; - }; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dtsi new file mode 100644 index 000000000..ca9598100 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dtsi @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_tplink_tl-wr841.dtsi" + +/ { + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; +}; + +&leds { + led_system: system { + label = "tp-link:green:system"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + wan_orange { + label = "tp-link:orange:wan"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v12.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v12.dts new file mode 100644 index 000000000..1b7db6199 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v12.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_tplink_tl-wr841-v11.dtsi" + +/ { + compatible = "tplink,tl-wr841-v12", "qca,qca9533"; + model = "TP-Link TL-WR841N/ND v12"; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v9.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v9.dts index a3284226a..6de3ab36b 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v9.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v9.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca9533_tplink_tl-wr841.dtsi" / { @@ -11,9 +8,9 @@ model = "TP-Link TL-WR841N/ND v9"; aliases { - led-boot = &qss_led; - led-failsafe = &qss_led; - led-running = &qss_led; - led-upgrade = &qss_led; + led-boot = &led_qss; + led-failsafe = &led_qss; + led-running = &led_qss; + led-upgrade = &led_qss; }; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi index 34f242ac5..e3d244ee7 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi @@ -11,7 +11,11 @@ bootargs = "console=ttyS0,115200n8"; }; - gpio_leds: leds { + aliases { + label-mac-device = &wmac; + }; + + leds: leds { compatible = "gpio-leds"; wifi { @@ -20,7 +24,7 @@ linux,default-trigger = "phy0tpt"; }; - qss_led: qss { + led_qss: qss { label = "tp-link:green:qss"; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; }; @@ -76,6 +80,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -115,6 +120,7 @@ ð0 { status = "okay"; + phy-handle = <&swphy4>; mtd-mac-address = <&uboot 0x1fc00>; @@ -123,6 +129,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts new file mode 100644 index 000000000..497b0cd26 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "tplink,tl-wr842n-v3", "qca,qca9533"; + model = "TP-Link TL-WR842N v3"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ð1; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tp-link:green:power"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi { + label = "tp-link:green:wlan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + qss { + label = "tp-link:green:qss"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wan_green { + label = "tp-link:green:wan"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + wan_red { + label = "tp-link:red:wan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "tp-link:green:lan1"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "tp-link:green:lan2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "tp-link:green:lan3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "tp-link:green:lan4"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "tp-link:green:usb"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + rfkill { + label = "RFKILL button"; + linux,code = ; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0xfd0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð1 { + mtd-mac-address = <&uboot 0x1fc00>; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&uboot 0x1fc00>; +}; diff --git a/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts b/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts index 3bdaa8ba9..ded95f3a1 100644 --- a/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts +++ b/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts @@ -10,6 +10,10 @@ compatible = "ubnt,acb-isp", "qca,qca9533"; model = "Ubiquiti airCube ISP"; + aliases { + label-mac-device = &wmac; + }; + keys { compatible = "gpio-keys"; @@ -60,8 +64,8 @@ read-only; }; - eeprom: partition@ff0000 { - label = "EEPROM"; + art: partition@ff0000 { + label = "art"; reg = <0xff0000 0x010000>; read-only; }; @@ -75,13 +79,13 @@ ð0 { status = "okay"; - mtd-mac-address = <&eeprom 0x0>; + mtd-mac-address = <&art 0x0>; phy-handle = <&swphy4>; }; ð1 { status = "okay"; - mtd-mac-address = <&eeprom 0x6>; + mtd-mac-address = <&art 0x6>; gmac-config { device = <&gmac>; @@ -90,6 +94,5 @@ &wmac { status = "okay"; - mtd-cal-data = <&eeprom 0x1000>; - mtd-mac-address = <&eeprom 0x1002>; + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi index 44f05a5f4..f127d4d01 100644 --- a/target/linux/ath79/dts/qca953x.dtsi +++ b/target/linux/ath79/dts/qca953x.dtsi @@ -143,43 +143,43 @@ qca,ddr-wb-channels = <&ddr_ctrl 4>, <&ddr_ctrl 3>; }; }; + }; - pcie0: pcie-controller@180c0000 { - compatible = "qcom,ar7240-pci"; - #address-cells = <3>; - #size-cells = <2>; - bus-range = <0x0 0x0>; - reg = <0x180c0000 0x1000>, /* CRP */ - <0x180f0000 0x100>, /* CTRL */ - <0x14000000 0x1000>; /* CFG */ - reg-names = "crp_base", "ctrl_base", "cfg_base"; - ranges = <0x2000000 0 0x10000000 0x10000000 0 0x04000000 /* pci memory */ - 0x1000000 0 0x00000000 0x0000000 0 0x000001>; /* io space */ - interrupt-parent = <&intc2>; - interrupts = <1>; + gmac: gmac@18070000 { + compatible = "qca,ar9330-gmac"; + reg = <0x18070000 0x4>; + }; - interrupt-controller; - #interrupt-cells = <1>; + pcie0: pcie-controller@180c0000 { + compatible = "qcom,ar7240-pci"; + #address-cells = <3>; + #size-cells = <2>; + bus-range = <0x0 0x0>; + reg = <0x180c0000 0x1000>, /* CRP */ + <0x180f0000 0x100>, /* CTRL */ + <0x14000000 0x1000>; /* CFG */ + reg-names = "crp_base", "ctrl_base", "cfg_base"; + ranges = <0x2000000 0 0x10000000 0x10000000 0 0x04000000 /* pci memory */ + 0x1000000 0 0x00000000 0x0000000 0 0x000001>; /* io space */ + interrupt-parent = <&intc2>; + interrupts = <1>; - interrupt-map-mask = <0 0 0 1>; - interrupt-map = <0 0 0 0 &pcie0 0>; - status = "disabled"; - }; + interrupt-controller; + #interrupt-cells = <1>; - gmac: gmac@18070000 { - compatible = "qca,ar9330-gmac"; - reg = <0x18070000 0x4>; - }; + interrupt-map-mask = <0 0 0 1>; + interrupt-map = <0 0 0 0 &pcie0 0>; + status = "disabled"; + }; - wmac: wmac@18100000 { - compatible = "qca,qca9530-wmac"; - reg = <0x18100000 0x20000>; + wmac: wmac@18100000 { + compatible = "qca,qca9530-wmac"; + reg = <0x18100000 0x20000>; - interrupt-parent = <&intc2>; - interrupts = <0>; + interrupt-parent = <&intc2>; + interrupts = <0>; - status = "disabled"; - }; + status = "disabled"; }; usb0: usb@1b000000 { @@ -212,9 +212,7 @@ #address-cells = <1>; #size-cells = <0>; }; - }; - }; &cpuintc { @@ -237,7 +235,6 @@ phy-mode = "mii"; }; - &mdio1 { status = "okay"; resets = <&rst 23>; @@ -274,7 +271,7 @@ ð1 { status = "okay"; - compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; + compatible = "qca,qca9530-eth", "syscon"; resets = <&rst 13>; reset-names = "mac"; diff --git a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi index d4faee750..c5fd7166a 100644 --- a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi +++ b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi @@ -16,9 +16,10 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; + label-mac-device = ð1; }; - gpio_leds: leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -61,6 +62,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -100,6 +102,7 @@ ð0 { status = "okay"; + phy-handle = <&swphy4>; mtd-mac-address = <&uboot 0x1fc00>; @@ -108,6 +111,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/qca9557.dtsi b/target/linux/ath79/dts/qca9557.dtsi index fefb91c39..d5d3f0254 100644 --- a/target/linux/ath79/dts/qca9557.dtsi +++ b/target/linux/ath79/dts/qca9557.dtsi @@ -176,65 +176,83 @@ #reset-cells = <1>; }; + }; - pcie0: pcie-controller@180c0000 { - compatible = "qcom,ar7240-pci"; - #address-cells = <3>; - #size-cells = <2>; - bus-range = <0x0 0x0>; - reg = <0x180c0000 0x1000>, /* CRP */ - <0x180f0000 0x100>, /* CTRL */ - <0x14000000 0x1000>; /* CFG */ - reg-names = "crp_base", "ctrl_base", "cfg_base"; - ranges = <0x2000000 0 0x10000000 0x10000000 0 0x02000000 /* pci memory */ - 0x1000000 0 0x00000000 0x0000000 0 0x000001>; /* io space */ - interrupt-parent = <&intc2>; - interrupts = <1>; + nand: nand@1b800200 { + compatible = "qca,ar934x-nand"; + reg = <0x1b800200 0xb8>; - interrupt-controller; - #interrupt-cells = <1>; + interrupts = <21>; + interrupt-parent = <&miscintc>; - interrupt-map-mask = <0 0 0 1>; - interrupt-map = <0 0 0 0 &pcie0 0>; - status = "disabled"; - }; + resets = <&rst 14>; + reset-names = "nand"; - pcie1: pcie-controller@18250000 { - compatible = "qcom,ar7240-pci"; - #address-cells = <3>; - #size-cells = <2>; - bus-range = <0x0 0x0>; - reg = <0x18250000 0x1000>, /* CRP */ - <0x18280000 0x100>, /* CTRL */ - <0x16000000 0x1000>; /* CFG */ - reg-names = "crp_base", "ctrl_base", "cfg_base"; - ranges = <0x2000000 0 0x12000000 0x12000000 0 0x02000000 /* pci memory */ - 0x1000000 0 0x00000000 0x0000001 0 0x000001>; /* io space */ - interrupt-parent = <&intc3>; - interrupts = <0>; + nand-ecc-mode = "hw"; - interrupt-controller; - #interrupt-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; - interrupt-map-mask = <0 0 0 1>; - interrupt-map = <0 0 0 0 &pcie1 0>; - status = "disabled"; - }; + status = "disabled"; + }; - gmac: gmac@18070000 { - compatible = "qca,qca9550-gmac"; - reg = <0x18070000 0x14>; - }; + gmac: gmac@18070000 { + compatible = "qca,qca9550-gmac"; + reg = <0x18070000 0x58>; + }; - wmac: wmac@18100000 { - compatible = "qca,qca9550-wmac"; - reg = <0x18100000 0x10000>; + pcie0: pcie-controller@180c0000 { + compatible = "qcom,ar7240-pci"; + #address-cells = <3>; + #size-cells = <2>; + bus-range = <0x0 0x0>; + reg = <0x180c0000 0x1000>, /* CRP */ + <0x180f0000 0x100>, /* CTRL */ + <0x14000000 0x1000>; /* CFG */ + reg-names = "crp_base", "ctrl_base", "cfg_base"; + ranges = <0x2000000 0 0x10000000 0x10000000 0 0x02000000 /* pci memory */ + 0x1000000 0 0x00000000 0x0000000 0 0x000001>; /* io space */ + interrupt-parent = <&intc2>; + interrupts = <1>; - interrupt-parent = <&intc2>; - interrupts = <0>; + interrupt-controller; + #interrupt-cells = <1>; - status = "disabled"; - }; + interrupt-map-mask = <0 0 0 1>; + interrupt-map = <0 0 0 0 &pcie0 0>; + status = "disabled"; + }; + + wmac: wmac@18100000 { + compatible = "qca,qca9550-wmac"; + reg = <0x18100000 0x10000>; + + interrupt-parent = <&intc2>; + interrupts = <0>; + + status = "disabled"; + }; + + pcie1: pcie-controller@18250000 { + compatible = "qcom,ar7240-pci"; + #address-cells = <3>; + #size-cells = <2>; + bus-range = <0x0 0x0>; + reg = <0x18250000 0x1000>, /* CRP */ + <0x18280000 0x100>, /* CTRL */ + <0x16000000 0x1000>; /* CFG */ + reg-names = "crp_base", "ctrl_base", "cfg_base"; + ranges = <0x2000000 0 0x12000000 0x12000000 0 0x02000000 /* pci memory */ + 0x1000000 0 0x00000000 0x0000001 0 0x000001>; /* io space */ + interrupt-parent = <&intc3>; + interrupts = <0>; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-map-mask = <0 0 0 1>; + interrupt-map = <0 0 0 0 &pcie1 0>; + status = "disabled"; }; usb0: usb@1b000000 { @@ -271,7 +289,7 @@ phys = <&usb_phy1>; status = "disabled"; - }; + }; spi: spi@1f000000 { compatible = "qca,ar9557-spi", "qca,ar7100-spi"; diff --git a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts index 995ecb3b7..be1ebac41 100644 --- a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts +++ b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts @@ -11,10 +11,10 @@ model = "Buffalo BHR-4GRV2"; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; chosen { @@ -24,7 +24,7 @@ leds { compatible = "gpio-leds"; - power: power { + led_power: power { label = "bhr-4grv2:green:power"; gpios = <&gpio 19 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -47,8 +47,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -69,6 +68,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi index 86b97437e..970a144db 100644 --- a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi +++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi @@ -8,10 +8,10 @@ / { aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; chosen { @@ -21,7 +21,7 @@ leds: leds { compatible = "gpio-leds"; - power: power { + led_power: power { label = "iodata:green:power"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -51,8 +51,7 @@ }; keys: keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; eco { label = "eco"; @@ -95,6 +94,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -195,5 +195,6 @@ &wmac { status = "okay"; + qca,no-eeprom; }; diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts b/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts index 37ae8fe01..c8cde8b81 100644 --- a/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts +++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts @@ -7,8 +7,8 @@ #include "qca9557_iodata_wn-ac-dgr.dtsi" / { - compatible = "iodata,wn-ac1600dgr2", "qca,qca9557"; - model = "I-O DATA WN-AC1600DGR2"; + compatible = "iodata,wn-ac1600dgr2", "iodata,wn-ac1600dgr3", "qca,qca9557"; + model = "I-O DATA WN-AC1600DGR2/DGR3"; }; &leds { diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts new file mode 100644 index 000000000..045806fa6 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca9558_comfast_cf-wr650ac.dtsi" + +/ { + compatible = "comfast,cf-wr650ac-v1", "qca,qca9558"; + model = "Comfast CF-WR650AC v1"; + + leds { + compatible = "gpio-leds"; + + wps { + label = "cf-wr650ac-v1:blue:wps"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + network { + label = "cf-wr650ac-v1:blue:network"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "cf-wr650ac-v1:blue:wlan2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "cf-wr650ac-v1:blue:wlan5"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + art: partition@20000 { + label = "art"; + reg = <0x020000 0x010000>; + read-only; + }; + + partition@30000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x030000 0xfc0000>; + }; + + partition@ff0000 { + label = "nvram"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts new file mode 100644 index 000000000..67ed1f886 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca9558_comfast_cf-wr650ac.dtsi" + +/ { + compatible = "comfast,cf-wr650ac-v2", "qca,qca9558"; + model = "Comfast CF-WR650AC v2"; + + leds { + compatible = "gpio-leds"; + + wps { + label = "cf-wr650ac-v2:blue:wps"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + network { + label = "cf-wr650ac-v2:blue:network"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "cf-wr650ac-v2:blue:wlan2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "cf-wr650ac-v2:blue:wlan5"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + art: partition@40000 { + label = "art"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x050000 0xfa0000>; + }; + + partition@ff0000 { + label = "nvram"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi new file mode 100644 index 000000000..39fae74b8 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca9557.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + hw_margin_ms = <500>; + always-running; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + switch0@1f { + compatible = "qca,ar8327"; + reg = <0x1f>; + qca,ar8327-initvals = < + 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ + 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ + 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0xa6000000 0x00000101 0x00001616>; + mtd-mac-address = <&art 0x0>; + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +ð1 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001616>; + mtd-mac-address = <&art 0x6>; + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x18>; +}; + +// This node is required for the Ethernet ports to work correctly. +&gpio { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts index 3bca23cc5..4828a5e0f 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca9558_devolo_dvl1xxx.dtsi" / { @@ -11,22 +8,22 @@ model = "devolo WiFi pro 1200e"; aliases { - led-boot = &status_blue; - led-failsafe = &status_red; - led-running = &status_blue; - led-upgrade = &status_red; + led-boot = &led_status_blue; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; }; leds { compatible = "gpio-leds"; - status_blue: status_blue { + led_status_blue: status_blue { label = "dvl1200e:blue:status"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; default-state = "on"; }; - status_red: status_red { + led_status_red: status_red { label = "dvl1200e:red:status"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1200i.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1200i.dts index 5900d8b48..61e6a665b 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1200i.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1200i.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca9558_devolo_dvl1xxx.dtsi" / { @@ -11,22 +8,22 @@ model = "devolo WiFi pro 1200i"; aliases { - led-boot = &status_blue; - led-failsafe = &status_red; - led-running = &status_blue; - led-upgrade = &status_red; + led-boot = &led_status_blue; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; }; leds { compatible = "gpio-leds"; - status_blue: status_blue { + led_status_blue: status_blue { label = "dvl1200i:blue:status"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; default-state = "on"; }; - status_red: status_red { + led_status_red: status_red { label = "dvl1200i:red:status"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; @@ -40,6 +37,7 @@ ð0 { pll-data = <0xbe000000 0x80000101 0x80001313>; + phy-mode = "rgmii-id"; }; &gmac_config { diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750c.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750c.dts index b5a295440..bd57f34e5 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750c.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750c.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca9558_devolo_dvl1xxx.dtsi" / { @@ -11,22 +8,22 @@ model = "devolo WiFi pro 1750c"; aliases { - led-boot = &status_blue; - led-failsafe = &status_red; - led-running = &status_blue; - led-upgrade = &status_red; + led-boot = &led_status_blue; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; }; leds { compatible = "gpio-leds"; - status_blue: status_blue { + led_status_blue: status_blue { label = "dvl1750c:blue:status"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; default-state = "on"; }; - status_red: status_red { + led_status_red: status_red { label = "dvl1750c:red:status"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; @@ -38,6 +35,10 @@ }; }; +ð0 { + phy-mode = "rgmii-id"; +}; + &gmac_config { rxdv-delay = <3>; rxd-delay = <3>; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts index 2570eb7ce..9e50d9ffe 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca9558_devolo_dvl1xxx.dtsi" / { @@ -11,10 +8,10 @@ model = "devolo WiFi pro 1750e"; aliases { - led-boot = &status_blue; - led-failsafe = &status_red; - led-running = &status_blue; - led-upgrade = &status_red; + led-boot = &led_status_blue; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; }; keys { @@ -37,13 +34,13 @@ leds { compatible = "gpio-leds"; - status_blue: status_blue { + led_status_blue: status_blue { label = "dvl1750e:blue:status"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; default-state = "on"; }; - status_red: status_red { + led_status_red: status_red { label = "dvl1750e:red:status"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; @@ -54,7 +51,6 @@ gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; }; - gpio_export { compatible = "gpio-export"; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750i.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750i.dts index bd3702eb3..c088a0b6f 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750i.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750i.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca9558_devolo_dvl1xxx.dtsi" / { @@ -11,22 +8,22 @@ model = "devolo WiFi pro 1750i"; aliases { - led-boot = &status_blue; - led-failsafe = &status_red; - led-running = &status_blue; - led-upgrade = &status_red; + led-boot = &led_status_blue; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; }; leds { compatible = "gpio-leds"; - status_blue: status_blue { + led_status_blue: status_blue { label = "dvl1750i:blue:status"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; default-state = "on"; }; - status_red: status_red { + led_status_red: status_red { label = "dvl1750i:red:status"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; @@ -40,6 +37,7 @@ ð0 { pll-data = <0xbe000000 0x80000101 0x80001313>; + phy-mode = "rgmii-id"; }; &gmac_config { diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750x.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750x.dts new file mode 100644 index 000000000..2263292e4 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750x.dts @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9558_devolo_dvl1xxx.dtsi" + +/ { + compatible = "devolo,dvl1750x", "qca,qca9558"; + model = "devolo WiFi pro 1750x"; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_red; + led-upgrade = &led_status_red; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: status_red { + /* This LED is not visible on the external casing. */ + label = "dvl1750x:red:status"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "dvl1750x:green:wlan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + beeper { + compatible = "gpio-beeper"; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + }; +}; + +ð0 { + pll-data = <0xbe000000 0x80000101 0x80001313>; + phy-mode = "rgmii-id"; +}; + +&gmac_config { + rxdv-delay = <3>; + rxd-delay = <3>; + txen-delay = <3>; + txd-delay = <3>; + rgmii-enabled = <1>; +}; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi index 9937186b1..ea752661b 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi @@ -56,6 +56,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -115,6 +116,7 @@ mtd-mac-address = <&art 0x00>; phy-handle = <&phy4>; + phy-mode = "rgmii-rxid"; pll-data = <0xae000000 0x80000101 0x80001313>; gmac_config: gmac-config { @@ -137,12 +139,14 @@ ð1 { mtd-mac-address = <&art 0x00>; mtd-mac-address-increment = <1>; + phy-handle = <&phy1>; pll-data = <0x03000101 0x00000101 0x00001313>; }; &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&art 0x00>; mtd-mac-address-increment = <(-2)>; diff --git a/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts b/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts new file mode 100644 index 000000000..7953ed132 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca9557.dtsi" + +/ { + compatible = "engenius,ecb1750", "qca,qca9557"; + model = "EnGenius ECB1750"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_power_orange; + led-running = &led_power_orange; + led-upgrade = &led_power_orange; + }; + + leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + label = "ecb1750:orange:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "ecb1750:blue:wlan2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "ecb1750:blue:wlan5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + lan { + label = "ecb1750:blue:lan"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xf50000>; + }; + + partition@fa0000 { + label = "userconfig"; + reg = <0xfa0000 0x050000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + at803x-disable-smarteee; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x9a000000 0x80000101 0x80001313>; + + phy-handle = <&phy5>; + phy-mode = "rgmii"; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxd-delay = <3>; + rxdv-delay = <3>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts index 6179150fd..72179f1da 100644 --- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts +++ b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts @@ -15,16 +15,16 @@ }; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; leds { compatible = "gpio-leds"; - power: power { + led_power: power { label = "epg5000:amber:power"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -54,8 +54,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { label = "reset"; diff --git a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts index 9e2f67977..5c01126bc 100644 --- a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts +++ b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts @@ -15,16 +15,16 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "librerouter-v1:green:system"; gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; default-state = "on"; @@ -40,10 +40,9 @@ label = "librerouter-v1:blue:status"; gpios = <&gpio 20 GPIO_ACTIVE_LOW>; }; - }; - button { + keys { compatible = "gpio-keys"; reset { @@ -52,7 +51,6 @@ gpios = <&gpio 17 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; - }; watchdog { @@ -62,7 +60,6 @@ hw_margin_ms = <1000>; always-running; }; - }; &pcie0 { @@ -113,6 +110,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -152,8 +150,8 @@ reg = <0xfd0000 0x20000>; }; - ART: partition@ff0000 { - label = "ART"; + art: partition@ff0000 { + label = "art"; reg = <0xff0000 0x010000>; read-only; }; @@ -184,10 +182,9 @@ status = "okay"; pll-data = <0xa6000000 0x00000101 0x00001616>; - mtd-mac-address = <&ART 0x0>; + mtd-mac-address = <&art 0x0>; phy-handle = <&phy0>; - }; ð1 { @@ -195,7 +192,7 @@ phy-mode = "sgmii"; pll-data = <0x03000101 0x00000101 0x00001616>; - mtd-mac-address = <&ART 0x6>; + mtd-mac-address = <&art 0x6>; fixed-link { speed = <1000>; @@ -206,6 +203,6 @@ &wmac { status = "okay"; - mtd-cal-data = <&ART 0x1000>; - mtd-mac-address = <&ART 0xc>; + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0xc>; }; diff --git a/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi b/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi index 21c25a571..170563b6a 100644 --- a/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi +++ b/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi @@ -12,10 +12,11 @@ }; aliases { - led-boot = &power_green; - led-failsafe = &power_amber; - led-running = &power_green; - led-upgrade = &power_amber; + led-boot = &led_power_green; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; + label-mac-device = ð0; }; led_spi { @@ -23,8 +24,8 @@ #address-cells = <1>; #size-cells = <0>; - gpio-sck = <&gpio 18 GPIO_ACTIVE_HIGH>; - gpio-mosi = <&gpio 15 GPIO_ACTIVE_HIGH>; + sck-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; num-chipselects = <0>; led_gpio: led_gpio@0 { @@ -33,7 +34,6 @@ gpio-controller; #gpio-cells = <2>; registers-number = <1>; - lines-initial-states = /bits/ 8 <0xff>; spi-max-frequency = <500000>; gpio_latch_bit { @@ -48,12 +48,12 @@ leds { compatible = "gpio-leds"; - power_green: power_green { + led_power_green: power_green { label = "netgear:green:power"; gpios = <&gpio 19 GPIO_ACTIVE_LOW>; }; - power_amber: power_amber { + led_power_amber: power_amber { label = "netgear:amber:power"; gpios = <&gpio 20 GPIO_ACTIVE_LOW>; }; @@ -135,6 +135,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -216,7 +217,7 @@ mtd-mac-address = <&caldata 0x00>; phy-handle = <&phy4>; - phy-mode = "rgmii"; + phy-mode = "rgmii-rxid"; - pll-data = <0x83000000 0x80000101 0x80001313>; + pll-data = <0x86000000 0x80000101 0x80001313>; }; diff --git a/target/linux/ath79/dts/qca9558_ocedo_koala.dts b/target/linux/ath79/dts/qca9558_ocedo_koala.dts index 23835492a..5e3abdbbb 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_koala.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_koala.dts @@ -15,10 +15,11 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð0; }; leds { @@ -42,15 +43,14 @@ linux,default-trigger = "phy0tpt"; }; - system: system { + led_system: system { label = "koala:blue:sys"; gpios = <&gpio 19 GPIO_ACTIVE_LOW>; }; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; reset { label = "reset"; @@ -142,8 +142,6 @@ phy5: ethernet-phy@5 { reg = <5>; - phy-mode = "rgmii-rxid"; - at803x-disable-smarteee; }; }; diff --git a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts index 1a92da394..5ae2e2bbb 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts @@ -28,9 +28,7 @@ gpios = <&gpio 15 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; - }; - }; &pcie1 { @@ -125,8 +123,10 @@ ð0 { status = "okay"; mtd-mac-address = <&art 0x00>; + + phy-mode = "rgmii-rxid"; phy-handle = <&phy1>; - pll-data = <0xa6000000 0x80000101 0x80001313>; + pll-data = <0x8e000000 0x80000101 0x80001313>; gmac_config: gmac-config { device = <&gmac>; diff --git a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts index 1e3cf40f7..83e76e463 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts @@ -42,10 +42,9 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; - button0 { + reset { label = "reset"; linux,code = ; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; @@ -123,7 +122,7 @@ }; partition@3 { - label = "ART"; + label = "art"; reg = <0xff0000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7.dtsi b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi similarity index 93% rename from target/linux/ath79/dts/qca9558_tplink_archer-c7.dtsi rename to target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi index 343d318e0..3defa554d 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi @@ -12,16 +12,17 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð1; }; - gpio_leds: leds { + leds: leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "tp-link:green:system"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -41,7 +42,7 @@ linux,default-trigger = "usbport"; }; - led_wlan2g: wlan2g { + wlan2g { label = "tp-link:green:wlan2g"; gpios = <&gpio 12 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; @@ -53,7 +54,7 @@ }; }; - gpio_keys: keys { + keys: keys { compatible = "gpio-keys"; reset { @@ -78,7 +79,6 @@ gpio-export,output = <1>; gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; }; - }; }; @@ -126,6 +126,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -188,6 +189,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts index 05368bd7d..261f65575 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts @@ -1,17 +1,14 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "qca9558_tplink_archer-c7.dtsi" +#include "qca9558_tplink_archer-c.dtsi" / { compatible = "tplink,archer-c5-v1", "qca,qca9558"; model = "TP-Link Archer C5 v1"; }; -&gpio_keys { +&keys { rfkill { gpios = <&gpio 23 GPIO_ACTIVE_LOW>; linux,code = ; @@ -20,7 +17,7 @@ }; }; -&gpio_leds { +&leds { wlan5g { label = "tp-link:green:wlan5g"; gpios = <&gpio 17 GPIO_ACTIVE_LOW>; @@ -29,17 +26,20 @@ }; &mtdparts { - uboot: u-boot@0 { + uboot: partition@0 { + label = "u-boot"; reg = <0x000000 0x020000>; read-only; }; - firmware@20000 { + partition@20000 { + label = "firmware"; reg = <0x020000 0xfd0000>; compatible = "tplink,firmware"; }; - art: art@ff0000 { + art: partition@ff0000 { + label = "art"; reg = <0xff0000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts index c26695d24..098835998 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts @@ -1,17 +1,14 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "qca9558_tplink_archer-c7.dtsi" +#include "qca9558_tplink_archer-c.dtsi" / { compatible = "tplink,archer-c7-v1", "qca,qca9558"; model = "TP-Link Archer C7 v1"; }; -&gpio_keys { +&keys { rfkill { gpios = <&gpio 13 GPIO_ACTIVE_LOW>; linux,code = ; @@ -20,7 +17,7 @@ }; }; -&gpio_leds { +&leds { wlan5g { label = "tp-link:green:wlan5g"; gpios = <&gpio 17 GPIO_ACTIVE_LOW>; @@ -29,17 +26,20 @@ }; &mtdparts { - uboot: u-boot@0 { + uboot: partition@0 { + label = "u-boot"; reg = <0x000000 0x020000>; read-only; }; - firmware@20000 { + partition@20000 { + label = "firmware"; compatible = "tplink,firmware"; reg = <0x020000 0x7d0000>; }; - art: art@7f0000 { + art: partition@7f0000 { + label = "art"; reg = <0x7f0000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts index afc1b14b8..7040d9b52 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts @@ -1,17 +1,14 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "qca9558_tplink_archer-c7.dtsi" +#include "qca9558_tplink_archer-c.dtsi" / { compatible = "tplink,archer-c7-v2", "qca,qca9558"; model = "TP-Link Archer C7 v2"; }; -&gpio_keys { +&keys { rfkill { gpios = <&gpio 23 GPIO_ACTIVE_LOW>; linux,code = ; @@ -20,7 +17,7 @@ }; }; -&gpio_leds { +&leds { wlan5g { label = "tp-link:green:wlan5g"; gpios = <&gpio 17 GPIO_ACTIVE_LOW>; @@ -29,17 +26,20 @@ }; &mtdparts { - uboot: u-boot@0 { + uboot: partition@0 { + label = "u-boot"; reg = <0x000000 0x020000>; read-only; }; - firmware@20000 { + partition@20000 { + label = "firmware"; reg = <0x020000 0xfd0000>; compatible = "tplink,firmware"; }; - art: art@ff0000 { + art: partition@ff0000 { + label = "art"; reg = <0xff0000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts index 056b513d7..a78a9d5be 100644 --- a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts @@ -11,10 +11,10 @@ compatible = "tplink,re350k-v1", "qca,qca9558"; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; mdio-gpio0 = &mdio2; }; @@ -50,30 +50,30 @@ leds { compatible = "gpio-leds"; - power: power { + led_power: power { label = "tp-link:green:power"; gpios = <&gpio 12 GPIO_ACTIVE_LOW>; default-state = "on"; }; - wlan2g-green { + wlan2g_green { label = "tp-link:green:wlan2g"; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; }; - wlan2g-red { + wlan2g_red { label = "tp-link:red:wlan2g"; gpios = <&gpio 21 GPIO_ACTIVE_LOW>; }; - wlan5g-green { + wlan5g_green { label = "tp-link:green:wlan5g"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; - wlan5g-red { + wlan5g_red { label = "tp-link:red:wlan5g"; gpios = <&gpio 22 GPIO_ACTIVE_LOW>; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_re355-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re355-v1.dts new file mode 100644 index 000000000..4f017786d --- /dev/null +++ b/target/linux/ath79/dts/qca9558_tplink_re355-v1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9558_tplink_rex5x.dtsi" + +/ { + compatible = "tplink,re355-v1", "qca,qca9558"; + model = "TP-Link RE355 v1"; +}; diff --git a/target/linux/ath79/dts/qca9558_tplink_re450-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re450-v1.dts new file mode 100644 index 000000000..b9b1bd18b --- /dev/null +++ b/target/linux/ath79/dts/qca9558_tplink_re450-v1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9558_tplink_rex5x.dtsi" + +/ { + compatible = "tplink,re450-v1", "qca,qca9558"; + model = "TP-Link RE450 v1"; +}; diff --git a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi new file mode 100644 index 000000000..2bc0f38f0 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi @@ -0,0 +1,181 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca9557.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + mdio-gpio0 = &mdio2; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tp-link:blue:power"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "tp-link:blue:wlan2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "tp-link:blue:wlan5g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + lan_link { + label = "tp-link:green:lan_link"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + + lan_data { + label = "tp-link:green:lan_data"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wps_blue { + label = "tp-link:blue:wps"; + gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + }; + + wps_red { + label = "tp-link:red:wps"; + gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + leds { + label = "LED control button"; + linux,code = ; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + mdio2: mdio { + compatible = "virtual,mdio-gpio"; + + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>, /* MDC */ + <&gpio 1 GPIO_ACTIVE_HIGH>; /* MDIO */ + #address-cells = <1>; + #size-cells = <0>; + + phy0: ethernet-phy@4 { + reg = <4>; + reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0x5e0000>; + }; + + partition@600000 { + label = "partition-table"; + reg = <0x600000 0x010000>; + read-only; + }; + + info: partition@610000 { + label = "info"; + reg = <0x610000 0x020000>; + read-only; + }; + + partition@630000 { + label = "config"; + reg = <0x630000 0x1c0000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&info 0x8>; + pll-data = <0xa6000000 0x00000101 0x00001616>; + phy-handle = <&phy0>; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&info 0x8>; + mtd-mac-address-increment = <(-1)>; +}; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts index 3cc2d790d..4f6d39e92 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts @@ -19,9 +19,10 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; + label-mac-device = ð1; }; - gpio_leds: leds { + leds { compatible = "gpio-leds"; led_system: system { @@ -56,7 +57,7 @@ }; }; - ath9k-leds { + ath9k-leds { compatible = "gpio-leds"; wlan5g { @@ -144,6 +145,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -224,6 +226,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&uboot 0x1fc00>; mtd-mac-address-increment = <(-1)>; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi index 61d4aec62..4c3a3230f 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi @@ -12,16 +12,17 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = &wmac; }; leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "tp-link:green:system"; gpios = <&gpio 19 GPIO_ACTIVE_LOW>; linux,default-trigger = "heartbeat"; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1045nd-v2.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wr1045nd-v2.dts new file mode 100644 index 000000000..879b55549 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1045nd-v2.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9558_tplink_tl-wr1043nd.dtsi" + +/ { + compatible = "tplink,tl-wr1045nd-v2", "qca,qca9557"; + model = "TP-Link TL-WR1045ND v2"; +}; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts index c33fe7404..13dacc2ff 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts @@ -19,6 +19,7 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; + label-mac-device = ð0; }; leds { diff --git a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts new file mode 100644 index 000000000..4bacf4723 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts @@ -0,0 +1,215 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca9557.dtsi" + +/ { + compatible = "trendnet,tew-823dru", "qca,qca9558"; + model = "TRENDNET TEW-823DRU"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + leds { + compatible = "gpio-leds"; + + power_orange { + label = "trendnet:orange:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power_green { + label = "trendnet:green:power"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + planet_green { + label = "trendnet:green:planet"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + planet_orange { + label = "trendnet:orange:planet"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + partition@30000 { + label = "nvram"; + reg = <0x030000 0x010000>; + read-only; + }; + + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x040000 0xef0000>; + }; + + partition@f30000 { + label = "lang"; + reg = <0xf30000 0x030000>; + read-only; + }; + + partition@f60000 { + label = "my-dlink"; + reg = <0xf60000 0x080000>; + read-only; + }; + + partition@fe0000 { + label = "mac"; + reg = <0xfe0000 0x010000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */ + 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy0>; + pll-data = <0x56000000 0x00000101 0x00001616>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +ð1 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001616>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts new file mode 100644 index 000000000..5a896d52b --- /dev/null +++ b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts @@ -0,0 +1,300 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca9557.dtsi" + +/ { + compatible = "zyxel,nbg6716", "qca,qca9558"; + model = "ZyXEL NBG6716"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "nbg6716:white:power"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "nbg6716:white:internet"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + usb1 { + label = "nbg6716:white:usb1"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port0>; + }; + + usb2 { + label = "nbg6716:white:usb2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port1>; + }; + + wifi2 { + label = "nbg6716:white:wifi2"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5 { + label = "nbg6716:white:wifi5"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "nbg6716:white:wps"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wifi { + label = "WiFi button"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + usb1 { + label = "USB1 eject button"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + usb2 { + label = "USB2 eject button"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&gpio { + usb_power { + gpio-hog; + gpios = <16 0>; + output-high; + line-name = "nbg6716:power:usb"; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + uboot_env: partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + art: partition@50000 { + label = "art"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + label = "nbu"; + reg = <0x060000 0xfa0000>; + }; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "zyxel_rfsd"; + reg = <0x0 0x200000>; + }; + + partition@200000 { + label = "romd"; + reg = <0x200000 0x200000>; + }; + + partition@400000 { + label = "header"; + reg = <0x400000 0x100000>; + }; + + firmware@500000 { + label = "firmware"; + reg = <0x500000 0x7b00000>; + }; + + partition@500000 { + label = "kernel"; + reg = <0x500000 0x400000>; + }; + + partition@900000 { + label = "ubi"; + reg = <0x900000 0x7700000>; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <17>; + phy-mode = "rgmii-id"; + }; + + switch0@1f { + compatible = "qca,ar8327"; + reg = <0x1f>; + qca,ar8327-initvals = < + 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ + 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ + 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x50 0xffb7ffb7 /* LED_CTRL0 */ + 0x54 0xffb7ffb7 /* LED_CTRL1 */ + 0x58 0xffb7ffb7 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; +}; + +&mdio1 { + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <1>; + phy-mode = "sgmii"; + }; +}; + + +ð0 { + status = "okay"; + + pll-data = <0xa6000000 0x00000101 0x00001616>; + phy-handle = <&phy0>; + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +ð1 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001616>; + phy-handle = <&phy1>; + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gpio { + status = "okay"; +}; + +&wmac { + status = "okay"; +}; + +&pcie1 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + qcom,ath10k-calibration-variant = "ZyXEL-NBG6716"; + }; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb0 { + status = "okay"; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + +}; + +&usb1 { + status = "okay"; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts index 9d548353e..641225259 100644 --- a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts +++ b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts @@ -11,10 +11,10 @@ model = "AVM FRITZ!Box 4020"; aliases { - led-boot = &power; - led-failsafe = &info_red; - led-running = &power; - led-upgrade = &info_red; + led-boot = &led_power; + led-failsafe = &led_info_red; + led-running = &led_power; + led-upgrade = &led_info_red; }; chosen { @@ -26,8 +26,8 @@ #address-cells = <1>; #size-cells = <0>; - gpio-sck = <&gpio 20 GPIO_ACTIVE_HIGH>; - gpio-mosi = <&gpio 19 GPIO_ACTIVE_HIGH>; + sck-gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; num-chipselects = <0>; led_gpio: led_gpio@0 { @@ -36,7 +36,6 @@ gpio-controller; #gpio-cells = <2>; registers-number = <1>; - lines-initial-states = /bits/ 8 <0xff>; spi-max-frequency = <10000000>; gpio_latch_bit { @@ -51,7 +50,7 @@ leds { compatible = "gpio-leds"; - power: power { + led_power: power { label = "fritz4020:green:power"; gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -78,23 +77,22 @@ gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; }; - info_red: info_red { + led_info_red: info_red { label = "fritz4020:red:info"; gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>; }; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; - wps_button { + wps { label = "WPS button"; linux,code = ; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; }; - wlan_button { + wlan { label = "WLAN button"; linux,code = ; gpios = <&gpio 21 GPIO_ACTIVE_LOW>; @@ -112,6 +110,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -171,5 +170,6 @@ &wmac { status = "okay"; + qca,no-eeprom; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts new file mode 100644 index 000000000..f894fc867 --- /dev/null +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts @@ -0,0 +1,202 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + compatible = "tplink,archer-c25-v1", "qca,qca9561"; + model = "TP-Link Archer C25 v1"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ð0; + }; + + led_spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + num-chipselects = <1>; + + led_gpio: led_gpio@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <1>; + spi-max-frequency = <10000000>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wifi { + label = "WiFi button"; + linux,code = ; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tp-link:green:power"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wps { + label = "tp-link:green:wps"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "tp-link:green:wlan2g"; + gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "tp-link:green:wlan5g"; + gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wan_green { + label = "tp-link:green:wan"; + gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "tp-link:amber:wan"; + gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "tp-link:green:lan1"; + gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "tp-link:green:lan2"; + gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "tp-link:green:lan3"; + gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "tp-link:green:lan4"; + gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "factory-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x010000>; + read-only; + }; + + partition@30000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x030000 0x7a0000>; + }; + + config: partition@7d0000 { + label = "config"; + reg = <0x7d0000 0x010000>; + read-only; + }; + + info: partition@7e0000 { + label = "info"; + reg = <0x7e0000 0x010000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-mode = "mii"; + phy-handle = <&swphy4>; + + mtd-mac-address = <&info 0x8>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&info 0x8>; + mtd-mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&info 0x8>; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts index fdc5713fa..db2e38bbc 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts @@ -1,63 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca9561_tplink_archer-c5x.dtsi" / { compatible = "tplink,archer-c58-v1", "qca,qca9560"; model = "TP-Link Archer C58 v1"; - - aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; - }; - - leds { - compatible = "gpio-leds"; - - power: power { - label = "tp-link:green:power"; - gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - wlan2g { - label = "tp-link:green:wlan2g"; - gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - wlan5g { - label = "tp-link:green:wlan5g"; - gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - wan_green { - label = "tp-link:green:wan"; - gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>; - }; - - wan_amber { - label = "tp-link:amber:wan"; - gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>; - }; - - lan { - label = "tp-link:green:lan"; - gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>; - }; - - wps { - label = "tp-link:green:wps"; - gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; - }; - }; }; &spi { @@ -106,20 +54,3 @@ }; }; }; - -ð0 { - status = "okay"; - mtd-mac-address = <&mac 0x8>; - mtd-mac-address-increment = <1>; -}; - -ð1 { - status = "okay"; - mtd-mac-address = <&mac 0x8>; -}; - -&wmac { - status = "okay"; - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&mac 0x8>; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts index 6ac5f3811..773b071a3 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts @@ -1,69 +1,19 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca9561_tplink_archer-c5x.dtsi" / { compatible = "tplink,archer-c59-v1", "qca,qca9560"; model = "TP-Link Archer C59 v1"; +}; - aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; - }; - - leds { - compatible = "gpio-leds"; - - power: power { - label = "tp-link:green:power"; - gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - wlan2g { - label = "tp-link:green:wlan2g"; - gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - wlan5g { - label = "tp-link:green:wlan5g"; - gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - wan_green { - label = "tp-link:green:wan"; - gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>; - }; - - wan_amber { - label = "tp-link:amber:wan"; - gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>; - }; - - lan { - label = "tp-link:green:lan"; - gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>; - }; - - wps { - label = "tp-link:green:wps"; - gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; - }; - - usb { - label = "tp-link:green:usb"; - gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>; - linux,default-trigger = "usbport"; - trigger-sources = <&hub_port>; - }; +&leds { + usb { + label = "tp-link:green:usb"; + gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port>; }; }; @@ -128,20 +78,3 @@ }; }; }; - -ð0 { - status = "okay"; - mtd-mac-address = <&mac 0x8>; - mtd-mac-address-increment = <1>; -}; - -ð1 { - status = "okay"; - mtd-mac-address = <&mac 0x8>; -}; - -&wmac { - status = "okay"; - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&mac 0x8>; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts new file mode 100644 index 000000000..e70afbffd --- /dev/null +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9561_tplink_archer-c5x.dtsi" + +/ { + compatible = "tplink,archer-c59-v2", "qca,qca9560"; + model = "TP-Link Archer C59 v2"; +}; + +&leds { + usb { + label = "tp-link:green:usb"; + gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port>; + }; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy0 { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 = "factory-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x010000>; + read-only; + }; + + mac: partition@30000 { + label = "mac"; + reg = <0x030000 0x010000>; + read-only; + }; + + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x040000 0xe10000>; + }; + + partition@e50000 { + label = "tplink"; + reg = <0xe50000 0x1a0000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi index dc56bf682..00cd413bd 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi @@ -8,6 +8,14 @@ / { compatible = "tplink,archer-c5x", "qca,qca9560"; + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ð1; + }; + chosen { bootargs = "console=ttyS0,115200n8"; }; @@ -17,8 +25,8 @@ #address-cells = <1>; #size-cells = <0>; - gpio-sck = <&gpio 18 GPIO_ACTIVE_HIGH>; - gpio-mosi = <&gpio 17 GPIO_ACTIVE_HIGH>; + sck-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; cs-gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; num-chipselects = <1>; @@ -32,23 +40,64 @@ }; }; - keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + leds: leds { + compatible = "gpio-leds"; - wps_button { + led_power: power { + label = "tp-link:green:power"; + gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "tp-link:green:wlan2g"; + gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "tp-link:green:wlan5g"; + gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wan_green { + label = "tp-link:green:wan"; + gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "tp-link:amber:wan"; + gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "tp-link:green:lan"; + gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "tp-link:green:wps"; + gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { label = "WPS button"; linux,code = ; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; }; - wifi_button { + wifi { label = "WiFi button"; linux,code = ; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; }; - reset_button { + reset { label = "Reset button"; linux,code = ; gpios = <&gpio 21 GPIO_ACTIVE_LOW>; @@ -69,7 +118,6 @@ gpio-export,output = <1>; gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; }; - }; }; @@ -86,9 +134,14 @@ }; ð0 { + status = "okay"; + phy-mode = "mii"; phy-handle = <&swphy0>; + mtd-mac-address = <&mac 0x8>; + mtd-mac-address-increment = <1>; + gmac-config { device = <&gmac>; @@ -96,3 +149,16 @@ switch-phy-swap = <1>; }; }; + +ð1 { + status = "okay"; + + mtd-mac-address = <&mac 0x8>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&mac 0x8>; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts new file mode 100644 index 000000000..85e456bb4 --- /dev/null +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9561_tplink_archer-c6x.dtsi" + +/ { + compatible = "tplink,archer-c60-v1", "qca,qca9561"; + model = "TP-Link Archer C60 v1"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x010000>; + read-only; + }; + + mac: partition@10000 { + label = "mac"; + reg = <0x010000 0x010000>; + read-only; + }; + + partition@20000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x020000 0x7c0000>; + }; + + partition@7e0000 { + label = "tplink"; + reg = <0x7e0000 0x010000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts new file mode 100644 index 000000000..29f916734 --- /dev/null +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9561_tplink_archer-c6x.dtsi" + +/ { + compatible = "tplink,archer-c60-v2", "qca,qca9561"; + model = "TP-Link Archer C60 v2"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 = "factory-boot"; + reg = <0x000000 0x01fb00>; + read-only; + }; + + mac: partition@1fb00 { + label = "mac"; + reg = <0x01fb00 0x000500>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x010000>; + read-only; + }; + + partition@30000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x030000 0x7a0000>; + }; + + partition@7d0000 { + label = "tplink"; + reg = <0x7d0000 0x020000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi new file mode 100644 index 000000000..719a9d065 --- /dev/null +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + wifi { + label = "WiFi button"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tp-link:green:power"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "tp-link:green:wlan2g"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "tp-link:green:wlan5g"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wan_green { + label = "tp-link:green:wan"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "tp-link:amber:wan"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "tp-link:green:lan"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "tp-link:green:wps"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-mode = "mii"; + phy-handle = <&swphy4>; + + mtd-mac-address = <&mac 0x8>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&mac 0x8>; + mtd-mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&mac 0x8>; +}; diff --git a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts index 8b8818c82..e4c737b8f 100644 --- a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts +++ b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts @@ -22,8 +22,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <100>; + compatible = "gpio-keys"; reset { label = "Reset button"; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi b/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi new file mode 100644 index 000000000..ac8fe3ae0 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi @@ -0,0 +1,145 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + wps { + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + // Pull up on boot - otherwise the reset button won't work + reset-button { + gpio-hog; + output-high; + gpios = <11 GPIO_ACTIVE_LOW>; + line-name = "reset-button"; + }; +}; + +&uart { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <30000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x10000>; + read-only; + }; + + partition@50000 { + label = "devdata"; + reg = <0x050000 0x10000>; + read-only; + }; + + partition@60000 { + label = "devconf"; + reg = <0x060000 0x10000>; + read-only; + }; + + partition@70000 { + label = "misc"; + reg = <0x070000 0x10000>; + read-only; + }; + + partition@80000 { + compatible = "seama"; + label = "firmware"; + reg = <0x080000 0xf50000>; + }; + + art: partition@fd0000 { + label = "art"; + reg = <0xfd0000 0x010000>; + read-only; + }; + + partition@fe0000 { + label = "reserved"; + reg = <0xfe0000 0x20000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x50 0xcc35cc35 /* LED_CTRL0 */ + 0x54 0xcb37cb37 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x00f3cf00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&wmac { + status = "okay"; + qca,no-eeprom; +}; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c1.dts b/target/linux/ath79/dts/qca9563_dlink_dir-842-c1.dts new file mode 100644 index 000000000..4df4e8a96 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c1.dts @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_dlink_dir-842-c.dtsi" + +/ { + compatible = "dlink,dir-842-c1", "qca,qca9563"; + model = "D-Link DIR-842 C1"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + wps { + label = "dir-842-c1:green:wps"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "dir-842-c1:green:power"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + internet { + label = "dir-842-c1:green:internet"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "dir-842-c1:green:wlan"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c2.dts b/target/linux/ath79/dts/qca9563_dlink_dir-842-c2.dts new file mode 100644 index 000000000..b86ea29a9 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c2.dts @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_dlink_dir-842-c.dtsi" + +/ { + compatible = "dlink,dir-842-c2", "qca,qca9563"; + model = "D-Link DIR-842 C2"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + wps { + label = "dir-842-c2:green:wps"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "dir-842-c2:green:power"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + internet { + label = "dir-842-c2:green:internet"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "dir-842-c2:green:wlan"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c3.dts b/target/linux/ath79/dts/qca9563_dlink_dir-842-c3.dts new file mode 100644 index 000000000..205fd8f60 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c3.dts @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_dlink_dir-842-c.dtsi" + +/ { + compatible = "dlink,dir-842-c3", "qca,qca9563"; + model = "D-Link DIR-842 C3"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + wps { + label = "dir-842-c3:green:wps"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "dir-842-c3:green:power"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + internet { + label = "dir-842-c3:green:internet"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "dir-842-c3:green:wlan"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts index 23b4cc512..8502bed4c 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts +++ b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts @@ -11,10 +11,10 @@ compatible = "dlink,dir-859-a1", "qca,qca9563"; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; chosen { @@ -29,7 +29,7 @@ gpios = <&gpio 8 GPIO_ACTIVE_LOW>; }; - power: power { + led_power: power { label = "dir-859-a1:green:power"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; @@ -47,11 +47,10 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; wps { - linux,code = ; + linux,code = ; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; @@ -88,10 +87,10 @@ }; &spi { - num-cs = <1>; - status = "okay"; + num-cs = <1>; + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; @@ -149,6 +148,7 @@ phy0: ethernet-phy@0 { reg = <0>; phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ @@ -173,5 +173,6 @@ &wmac { status = "okay"; + qca,no-eeprom; }; diff --git a/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts b/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts index 287dee6bb..0152f62cd 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts @@ -12,7 +12,7 @@ }; &leds { - power: power { + led_power: power { label = "elecom:blue:power"; gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; default-state = "on"; @@ -44,8 +44,8 @@ read-only; }; - ART: partition@ff0000 { - label = "ART"; + art: partition@ff0000 { + label = "art"; reg = <0xff0000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts index c823f4a34..7ebd15342 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts @@ -12,7 +12,7 @@ }; &leds { - power: power { + led_power: power { label = "elecom:white:power"; gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; default-state = "on"; @@ -38,8 +38,8 @@ read-only; }; - ART: partition@7f0000 { - label = "ART"; + art: partition@7f0000 { + label = "art"; reg = <0x7f0000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi b/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi index 8d5bbe180..f04304ee4 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi @@ -12,10 +12,10 @@ }; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; }; leds: leds { @@ -37,7 +37,7 @@ debounce-interval = <60>; }; - button_wps { + wps { label = "wps"; gpios = <&gpio 5 GPIO_ACTIVE_LOW>; linux,code = ; @@ -111,7 +111,7 @@ pll-data = <0x03000101 0x00000101 0x00001919>; - mtd-mac-address = <&ART 0x1002>; + mtd-mac-address = <&art 0x1002>; mtd-mac-address-increment = <(-1)>; phy-mode = "sgmii"; phy-handle = <&phy0>; @@ -123,5 +123,5 @@ &wmac { status = "okay"; - mtd-cal-data = <&ART 0x1000>; + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts new file mode 100644 index 000000000..92d1fb9ba --- /dev/null +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "qca9563_glinet_gl-ar750s.dtsi" + +/ { + compatible = "glinet,gl-ar750s-nor-nand", "qca,qca9563"; + model = "GL.iNet GL-AR750S (NOR/NAND)"; +}; + +&nor_kernel { + label = "kernel"; +}; + +&nand_ubi { + label = "ubi"; +}; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts new file mode 100644 index 000000000..bb33abd63 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "qca9563_glinet_gl-ar750s.dtsi" + +/ { + compatible = "glinet,gl-ar750s-nor", "qca,qca9563"; + model = "GL.iNet GL-AR750S (NOR)"; +}; + +/delete-node/ &nor_kernel; +/delete-node/ &nor_reserved; + +&nor_firmware { + compatible = "denx,uimage"; + label = "firmware"; +}; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi similarity index 61% rename from target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts rename to target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi index 439acaae8..8250db55a 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dts +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /dts-v1/; #include @@ -15,15 +16,16 @@ }; aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ð0; }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; + pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; @@ -44,36 +46,45 @@ leds { compatible = "gpio-leds"; - power: power { + led_power: power { label = "gl-ar750s:green:power"; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; default-state = "keep"; }; - wlan2g { + led_wlan2g: wlan2g { label = "gl-ar750s:green:wlan2g"; gpios = <&gpio 19 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; }; - wlan5g { + led_wlan5g: wlan5g { label = "gl-ar750s:green:wlan5g"; gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0tpt"; }; }; + + i2c: i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 5 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 21 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + }; }; &spi { status = "okay"; - num-cs = <0>; - flash@0 { + num-cs = <2>; + cs-gpios = <0>, <0>; + + flash_nor: flash@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <25000000>; - partitions { + nor_partitions: partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; @@ -92,42 +103,63 @@ art: partition@50000 { label = "art"; reg = <0x050000 0x010000>; + read-only; }; - partition@60000 { - compatible = "denx,uimage"; - label = "firmware"; + nor_firmware: partition@60000 { + label = "nor_firmware"; reg = <0x060000 0xfa0000>; }; + + nor_kernel: partition_alt@60000 { + label = "nor_kernel"; + reg = <0x060000 0x400000>; + }; + + nor_reserved: parition_alt@460000 { + label = "nor_reserved"; + reg = <0x460000 0xba0000>; + }; + }; + }; + + flash_nand: flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + nand_partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + nand_ubi: partition@0 { + label = "nand_ubi"; + reg = <0x000000 0x8000000>; + }; }; }; }; -&pcie { +ð0 { status = "okay"; + + phy-handle = <&phy0>; + mtd-mac-address = <&art 0x0>; }; -&uart { - status = "okay"; -}; - -&usb0 { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - - hub_port: port@1 { - reg = <1>; - #trigger-source-cells = <0>; +&gpio { + usb_vbus { + gpio-hog; + gpios = <7 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "usb-vbus"; }; }; -&usb_phy0 { - status = "okay"; -}; - &mdio0 { status = "okay"; + phy-mask = <0>; phy0: ethernet-phy@0 { @@ -140,15 +172,32 @@ }; }; -ð0 { +&pcie { status = "okay"; +}; - mtd-mac-address = <&art 0x0>; - phy-handle = <&phy0>; +&uart { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; }; &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x1002>; }; diff --git a/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts b/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts index 8c356bd75..68b10647b 100644 --- a/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts +++ b/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts @@ -15,23 +15,23 @@ }; aliases { - led-boot = &power_green; - led-failsafe = &power_red; - led-running = &power_green; - led-upgrade = &power_green; + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; }; leds { compatible = "gpio-leds"; /* other LEDs are connected to ath10k (QCA9888) gpiochip */ - power_green: power_green { + led_power_green: power_green { label = "wg1200cr:green:power"; gpios = <&gpio 5 GPIO_ACTIVE_LOW>; default-state = "on"; }; - power_red: power_red { + led_power_red: power_red { label = "wg1200cr:red:power"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; }; @@ -74,6 +74,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -172,5 +173,6 @@ &wmac { status = "okay"; + qca,no-eeprom; }; diff --git a/target/linux/ath79/dts/qca9563_nec_wg800hp.dts b/target/linux/ath79/dts/qca9563_nec_wg800hp.dts index 9cba99b6a..2efedcffe 100644 --- a/target/linux/ath79/dts/qca9563_nec_wg800hp.dts +++ b/target/linux/ath79/dts/qca9563_nec_wg800hp.dts @@ -15,10 +15,10 @@ }; aliases { - led-boot = &power_green; - led-failsafe = &power_red; - led-running = &power_green; - led-upgrade = &power_green; + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; }; leds { @@ -41,12 +41,12 @@ gpios = <&gpio 8 GPIO_ACTIVE_LOW>; }; - power_red: power_red { + led_power_red: power_red { label = "wg800hp:red:power"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; - power_green: power_green { + led_power_green: power_green { label = "wg800hp:green:power"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; default-state = "on"; diff --git a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts index d819a76fd..cb5c01b01 100644 --- a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts +++ b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts @@ -41,8 +41,7 @@ }; keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; + compatible = "gpio-keys"; reset { linux,code = ; diff --git a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts index cf0ec1bfa..028324410 100644 --- a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts +++ b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts @@ -8,23 +8,23 @@ / { model = "ROSINSON WR818"; - compatible = "rosinson,wr818", "qca,qca9560"; + compatible = "rosinson,wr818", "qca,qca9563"; chosen { bootargs = "console=ttyS0,115200n8"; }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; - gpio_leds: leds { + leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "wr818:red:system"; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; }; @@ -57,10 +57,10 @@ }; &spi { - num-cs = <1>; - status = "okay"; + num-cs = <1>; + flash@0 { compatible = "jedec,spi-nor"; reg = <0>; @@ -129,6 +129,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts b/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts index a9174df4f..db6e5fb7f 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts @@ -8,7 +8,7 @@ model = "TP-Link Archer A7 v5"; }; -&gpio_keys { +&keys { reset { label = "Reset button"; linux,code = ; @@ -18,40 +18,43 @@ }; &mtdparts { - factory-uboot@0 { + partition@0 { label = "factory-uboot"; reg = <0x000000 0x020000>; read-only; }; - uboot: u-boot@20000 { + uboot: partition@20000 { label = "u-boot"; reg = <0x020000 0x020000>; read-only; }; - firmware@40000 { + partition@40000 { label = "firmware"; reg = <0x040000 0xec0000>; compatible = "denx,uimage"; }; - info: info@f40000 { + info: partition@f40000 { label = "info"; reg = <0xf40000 0x020000>; + read-only; }; - config: config@f60000 { + config: partition@f60000 { label = "config"; reg = <0xf60000 0x050000>; + read-only; }; partition@fc0000 { label = "partition-table"; reg = <0xfc0000 0x010000>; + read-only; }; - art: art@ff0000 { + art: partition@ff0000 { label = "art"; reg = <0xff0000 0x010000>; read-only; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts index c106a63eb..7852bed1f 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts @@ -15,16 +15,16 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; - gpio_leds: leds { + leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "tp-link:green:system"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -103,6 +103,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -124,6 +125,7 @@ partition@20000 { label = "uboot"; reg = <0x020000 0x10000>; + read-only; }; partition@30000 { @@ -133,13 +135,13 @@ }; info: partition@7e0000 { - label = "product-info"; + label = "info"; reg = <0x7e0000 0x010000>; read-only; }; art: partition@7f0000 { - label = "ART"; + label = "art"; reg = <0x7f0000 0x010000>; read-only; }; @@ -158,6 +160,7 @@ phy0: ethernet-phy@0 { reg = <0>; phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ @@ -180,6 +183,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts new file mode 100644 index 000000000..3a6f00bf4 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_tplink_archer-x6-v2.dtsi" + +/ { + compatible = "tplink,archer-c6-v2-us", "qca,qca9563"; + model = "TP-Link Archer C6 v2 (US) / A6 v2 (US/TW)"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tp-link:green:power"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "tp-link:green:wlan2g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "tp-link:green:wlan5g"; + gpios = <&gpio 9 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + lan { + label = "tp-link:green:lan"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "tp-link:green:wan"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + wan_fail { + label = "tp-link:amber:wan"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "tp-link:green:wps"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "factory-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + mac: partition@20000 { + label = "mac"; + reg = <0x020000 0x010000>; + read-only; + }; + + partition@30000 { + label = "u-boot"; + reg = <0x030000 0x020000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xf80000>; + }; + + partition@fd0000 { + label = "tplink"; + reg = <0xfd0000 0x020000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts index 5caec6fab..e7ceec9b3 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts @@ -5,5 +5,120 @@ / { compatible = "tplink,archer-c6-v2", "qca,qca9563"; - model = "TP-Link Archer C6 v2"; + model = "TP-Link Archer C6 v2 (EU/RU/JP)"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tp-link:green:power"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "tp-link:green:wlan2g"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "tp-link:green:wlan5g"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + lan { + label = "tp-link:green:lan"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "tp-link:green:wan"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + wan_fail { + label = "tp-link:amber:wan"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "tp-link:green:wps"; + gpios = <&gpio 9 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + mac: partition@20000 { + label = "mac"; + reg = <0x020000 0x010000>; + read-only; + }; + + partition@30000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x030000 0x7a0000>; + }; + + partition@7d0000 { + label = "tplink"; + reg = <0x7d0000 0x020000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts index db8869cf1..dcdd7bcf3 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts @@ -15,10 +15,11 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð0; }; led_spi { @@ -26,8 +27,8 @@ #address-cells = <1>; #size-cells = <0>; - gpio-sck = <&gpio 15 GPIO_ACTIVE_HIGH>; // 74HC595 SRCLK (Serial Clock) - gpio-mosi = <&gpio 14 GPIO_ACTIVE_HIGH>; // 74HC595 SER (Serial) + sck-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; // 74HC595 SRCLK (Serial Clock) + mosi-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; // 74HC595 SER (Serial) cs-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; // 74HC595 RCLK (Register Clock) num-chipselects = <1>; @@ -60,7 +61,7 @@ leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "tp-link:green:system"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -145,7 +146,6 @@ debounce-interval = <60>; }; }; - }; &pcie { @@ -192,6 +192,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -223,7 +224,7 @@ }; info: partition@f00000 { - label = "config"; + label = "info"; reg = <0xf00000 0x0f0000>; read-only; }; @@ -245,6 +246,7 @@ phy0: ethernet-phy@0 { reg = <0>; phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; qca,ar8327-initvals = < 0x04 0x80080080 /* PORT0 PAD MODE CTRL */ @@ -266,6 +268,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts index c51ae20d2..7e735adbd 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts @@ -8,20 +8,13 @@ model = "TP-Link Archer C7 v5"; }; -&gpio_keys { +&keys { reset { label = "Reset button"; linux,code = ; gpios = <&gpio 5 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; - - wps { - label = "WPS button"; - linux,code = ; - gpios = <&gpio 2 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; }; &mtdparts { @@ -40,6 +33,7 @@ partition@40000 { label = "partition-table"; reg = <0x040000 0x010000>; + read-only; }; art: partition@50000 { @@ -51,11 +45,13 @@ info: partition@60000 { label = "info"; reg = <0x060000 0x020000>; + read-only; }; partition@80000 { label = "user-config"; reg = <0x080000 0x040000>; + read-only; }; partition@c0000 { @@ -67,5 +63,6 @@ partition@ff0000 { label = "default-config"; reg = <0xff0000 0x010000>; + read-only; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi b/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi index 37ab16453..367f826b9 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include #include @@ -7,76 +6,13 @@ #include "qca956x.dtsi" / { + aliases { + label-mac-device = ð0; + }; + chosen { bootargs = "console=ttyS0,115200n8"; }; - - aliases { - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; - }; - - leds { - compatible = "gpio-leds"; - - power: power { - label = "tp-link:green:power"; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - wlan2g { - label = "tp-link:green:wlan2g"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - wlan5g { - label = "tp-link:green:wlan5g"; - gpios = <&gpio 19 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - lan { - label = "tp-link:green:lan"; - gpios = <&gpio 20 GPIO_ACTIVE_LOW>; - }; - - wan { - label = "tp-link:green:wan"; - gpios = <&gpio 7 GPIO_ACTIVE_LOW>; - }; - - wan_fail { - label = "tp-link:amber:wan"; - gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - }; - - wps { - label = "tp-link:green:wps"; - gpios = <&gpio 9 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "Reset button"; - linux,code = ; - gpios = <&gpio 5 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - wps { - label = "WPS button"; - linux,code = ; - gpios = <&gpio 6 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - }; }; &pcie { @@ -91,53 +27,6 @@ status = "okay"; }; -&spi { - status = "okay"; - num-cs = <1>; - - 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 = "u-boot"; - reg = <0x000000 0x020000>; - read-only; - }; - - mac: partition@20000 { - label = "mac"; - reg = <0x020000 0x010000>; - read-only; - }; - - partition@30000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x030000 0x7a0000>; - }; - - partition@7d0000 { - label = "tplink"; - reg = <0x7d0000 0x020000>; - read-only; - }; - - art: partition@7f0000 { - label = "art"; - reg = <0x7f0000 0x010000>; - read-only; - }; - }; - }; -}; - &mdio0 { status = "okay"; @@ -146,6 +35,7 @@ phy0: ethernet-phy@0 { reg = <0>; phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ @@ -158,8 +48,9 @@ status = "okay"; phy-mode = "sgmii"; - mtd-mac-address = <&mac 0x8>; phy-handle = <&phy0>; + + mtd-mac-address = <&mac 0x8>; }; &wmac { diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi index ba75cfc4d..3049c8bc2 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi @@ -12,16 +12,17 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð0; }; - gpio_leds: leds { + leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "tp-link:green:system"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; default-state = "on"; @@ -40,7 +41,7 @@ linux,default-trigger = "phy0tpt"; }; - led_wlan2g: wlan2g { + wlan2g { label = "tp-link:green:wlan2g"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; @@ -82,7 +83,7 @@ }; }; - gpio_keys: keys { + keys: keys { compatible = "gpio-keys"; wps { @@ -133,6 +134,7 @@ &spi { status = "okay"; + num-cs = <1>; flash@0 { @@ -156,15 +158,15 @@ phy0: ethernet-phy@0 { reg = <0>; phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; qca,ar8327-initvals = < - 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ - 0x50 0xcc35cc35 /* LED_CTRL0 */ - 0x54 0xcb37cb37 /* LED_CTRL1 */ - 0x58 0x00000000 /* LED_CTRL2 */ - 0x5c 0x00f3cf00 /* LED_CTRL3 */ + 0x04 0x80080080 /* PORT0 PAD MODE CTRL */ + 0x08 0x00000000 /* PORT5 PAD MODE CTRL */ + 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */ + 0x10 0x00000080 /* POWER_ON_STRIP */ 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x00000200 /* PORT6_STATUS */ >; }; }; @@ -181,6 +183,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts index ad55a55e5..464be7344 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts @@ -15,17 +15,17 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; mdio-gpio0 = &mdio2; }; leds { compatible = "gpio-leds"; - system: power { + led_power: power { label = "tp-link:blue:power"; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; }; @@ -156,7 +156,7 @@ }; info: partition@610000 { - label = "product-info"; + label = "info"; reg = <0x610000 0x020000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts new file mode 100644 index 000000000..b4c7e9b45 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_tplink_tl-wr1043n.dtsi" + +/ { + compatible = "tplink,tl-wr1043n-v5", "qca,qca9563"; + model = "TP-Link TL-WR1043N v5"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 = "factory-uboot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x020000>; + read-only; + }; + + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x040000 0xec0000>; + }; + + info: partition@f00000 { + label = "info"; + reg = <0xf00000 0x020000>; + read-only; + }; + + partition@f20000 { + label = "config"; + reg = <0xf20000 0x0a0000>; + read-only; + }; + + partition@fc0000 { + label = "partition-table"; + reg = <0xfc0000 0x010000>; + read-only; + }; + + partition@fd0000 { + label = "logs"; + reg = <0xfd0000 0x020000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi index fc23ee1dd..ba56cf23b 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi @@ -12,16 +12,17 @@ }; aliases { - led-boot = &system; - led-failsafe = &system; - led-running = &system; - led-upgrade = &system; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = &wmac; }; - gpio_leds: leds { + leds: leds { compatible = "gpio-leds"; - system: system { + led_system: system { label = "tp-link:green:system"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; linux,default-trigger = "heartbeat"; @@ -86,17 +87,6 @@ debounce-interval = <60>; }; }; - - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - - gpio_usb_power { - gpio-export,name = "tp-link:power:usb"; - gpio-export,output = <1>; - gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; - }; - }; }; &uart { @@ -107,65 +97,6 @@ status = "okay"; }; -&spi { - status = "okay"; - num-cs = <1>; - - 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 = "u-boot"; - reg = <0x000000 0x020000>; - read-only; - }; - - partition@20000 { - compatible = "tplink,firmware"; - label = "firmware"; - reg = <0x020000 0xf30000>; - }; - - info: partition@f50000 { - label = "product-info"; - reg = <0xf50000 0x020000>; - read-only; - }; - - partition@f70000 { - label = "config"; - reg = <0xf70000 0x050000>; - read-only; - }; - - partition@fc0000 { - label = "partition-table"; - reg = <0xfc0000 0x010000>; - read-only; - }; - - partition@fd0000 { - label = "logs"; - reg = <0xfd0000 0x020000>; - read-only; - }; - - art: partition@ff0000 { - label = "ART"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; - }; -}; - &mdio0 { status = "okay"; @@ -173,6 +104,7 @@ phy0: ethernet-phy@0 { reg = <0>; phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ @@ -191,6 +123,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts index e51bb7f83..9e220539d 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts @@ -1,17 +1,85 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - #include "qca9563_tplink_tl-wr1043n.dtsi" / { compatible = "tplink,tl-wr1043nd-v4", "qca,qca9563"; model = "TP-Link TL-WR1043ND v4"; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + gpio_usb_power { + gpio-export,name = "tp-link:power:usb"; + gpio-export,output = <1>; + gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; + }; + }; }; -&gpio_leds { +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0xf30000>; + }; + + info: partition@f50000 { + label = "info"; + reg = <0xf50000 0x020000>; + read-only; + }; + + partition@f70000 { + label = "config"; + reg = <0xf70000 0x050000>; + read-only; + }; + + partition@fc0000 { + label = "partition-table"; + reg = <0xfc0000 0x010000>; + read-only; + }; + + partition@fd0000 { + label = "logs"; + reg = <0xfd0000 0x020000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&leds { usb { label = "tp-link:green:usb"; gpios = <&gpio 7 GPIO_ACTIVE_LOW>; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts index a3ae7089d..7b9fa0701 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts @@ -5,5 +5,5 @@ / { compatible = "ubnt,unifiac-lite", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-LITE/LR"; + model = "Ubiquiti UniFi-AC-LITE"; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi index 6fe43453e..8248e060c 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi @@ -2,6 +2,12 @@ #include "qca9563_ubnt_unifiac.dtsi" +/ { + aliases { + label-mac-device = ð0; + }; +}; + &mdio0 { status = "okay"; @@ -15,6 +21,6 @@ ð0 { status = "okay"; - mtd-mac-address = <&eeprom 0x0>; + mtd-mac-address = <&art 0x0>; phy-handle = <&phy4>; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts new file mode 100644 index 000000000..a1e542ada --- /dev/null +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_ubnt_unifiac-lite.dtsi" + +/ { + compatible = "ubnt,unifiac-lr", "qca,qca9563"; + model = "Ubiquiti UniFi-AC-LR"; +}; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi index f21814355..5a0cf4bad 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi @@ -2,6 +2,12 @@ #include "qca9563_ubnt_unifiac.dtsi" +/ { + aliases { + label-mac-device = ð0; + }; +}; + &mdio0 { status = "okay"; phy-mask = <0>; @@ -19,6 +25,6 @@ ð0 { status = "okay"; - mtd-mac-address = <&eeprom 0x0>; + mtd-mac-address = <&art 0x0>; phy-handle = <&phy0>; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index 3ee43a6d4..bfad3ff30 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -6,6 +6,13 @@ #include "qca956x.dtsi" / { + aliases { + led-boot = &led_white; + led-failsafe = &led_white; + led-running = &led_blue; + led-upgrade = &led_blue; + }; + chosen { bootargs = "console=ttyS0,115200n8"; }; @@ -13,18 +20,15 @@ leds { compatible = "gpio-leds"; - wifi_ac { + led_white: led_white { label = "ubnt:white:dome"; gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "phy0tpt"; }; - wifi_n { + led_blue: led_blue { label = "ubnt:blue:dome"; gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "phy1tpt"; }; - }; keys { @@ -100,8 +104,8 @@ read-only; }; - eeprom: partition@ff0000 { - label = "EEPROM"; + art: partition@ff0000 { + label = "art"; reg = <0xff0000 0x010000>; read-only; }; @@ -111,6 +115,6 @@ &wmac { status = "okay"; - mtd-cal-data = <&eeprom 0x1000>; - mtd-mac-address = <&eeprom 0x0>; + + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca9563_yuncore_a782.dts b/target/linux/ath79/dts/qca9563_yuncore_a782.dts new file mode 100644 index 000000000..27360bbe9 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_yuncore_a782.dts @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_yuncore_xd4200.dtsi" + +/ { + compatible = "yuncore,a782", "qca,qca9563"; + model = "YunCore A782"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "a782:red:system"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + wlan2g { + label = "a782:green:wlan2g"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dts b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dts new file mode 100644 index 000000000..ab8d85588 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dts @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_yuncore_xd4200.dtsi" + +/ { + compatible = "yuncore,xd4200", "qca,qca9563"; + model = "YunCore XD4200"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "xd4200:blue:system"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + wlan2g { + label = "xd4200:blue:wlan2g"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi new file mode 100644 index 000000000..2f7964de9 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -0,0 +1,122 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + aliases { + label-mac-device = ð0; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + mtd-mac-address = <&art 0x0>; + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&gpio { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x50 0xcf37cf37 /* LED_CTRL0 */ + 0x54 0xcf37cf37 /* LED_CTRL1 */ + 0x58 0xcf37cf37 /* LED_CTRL2 */ + 0x5c 0x0000c300 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,0056"; + reg = <0x0000 0 0 0 0>; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfa0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/qca956x.dtsi b/target/linux/ath79/dts/qca956x.dtsi index a9437fce0..ee645aa02 100644 --- a/target/linux/ath79/dts/qca956x.dtsi +++ b/target/linux/ath79/dts/qca956x.dtsi @@ -137,38 +137,43 @@ #reset-cells = <1>; }; + }; - wmac: wmac@18100000 { - compatible = "qca,qca9560-wmac"; - reg = <0x18100000 0x10000>; + gmac: gmac@18070000 { + compatible = "qca,qca9560-gmac"; + reg = <0x18070000 0x64>; + }; - interrupt-parent = <&cpuintc>; - interrupts = <2>; + wmac: wmac@18100000 { + compatible = "qca,qca9560-wmac"; + reg = <0x18100000 0x10000>; - status = "disabled"; - }; + interrupt-parent = <&cpuintc>; + interrupts = <2>; - pcie: pcie-controller@18250000 { - compatible = "qcom,ar7240-pci"; - #address-cells = <3>; - #size-cells = <2>; - bus-range = <0x0 0x0>; - reg = <0x18250000 0x1000>, /* CRP */ - <0x18280000 0x100>, /* CTRL */ - <0x16000000 0x1000>; /* CFG */ - reg-names = "crp_base", "ctrl_base", "cfg_base"; - ranges = <0x2000000 0 0x12000000 0x12000000 0 0x02000000 /* pci memory */ - 0x1000000 0 0x00000000 0x0000000 0 0x000001>; /* io space */ - interrupt-parent = <&intc3>; - interrupts = <0>; + status = "disabled"; + }; - interrupt-controller; - #interrupt-cells = <1>; + pcie: pcie-controller@18250000 { + compatible = "qcom,ar7240-pci"; + #address-cells = <3>; + #size-cells = <2>; + bus-range = <0x0 0x0>; + reg = <0x18250000 0x1000>, /* CRP */ + <0x18280000 0x100>, /* CTRL */ + <0x16000000 0x1000>; /* CFG */ + reg-names = "crp_base", "ctrl_base", "cfg_base"; + ranges = <0x2000000 0 0x12000000 0x12000000 0 0x02000000 /* pci memory */ + 0x1000000 0 0x00000000 0x0000000 0 0x000001>; /* io space */ + interrupt-parent = <&intc3>; + interrupts = <0>; - interrupt-map-mask = <0 0 0 1>; - interrupt-map = <0 0 0 0 &pcie 0>; - status = "disabled"; - }; + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-map-mask = <0 0 0 1>; + interrupt-map = <0 0 0 0 &pcie 0>; + status = "disabled"; }; usb0: usb@1b000000 { @@ -221,11 +226,6 @@ #address-cells = <1>; #size-cells = <0>; }; - - gmac: gmac@18070000 { - compatible = "qca,qca9560-gmac"; - reg = <0x18070000 0x64>; - }; }; usb_phy0: usb-phy { @@ -257,7 +257,7 @@ }; ð0 { - compatible = "qca,qca9560-eth", "syscon", "simple-mfd"; + compatible = "qca,qca9560-eth", "syscon"; pll-data = <0x03000000 0x00000101 0x00001919>; pll-reg = <0 0x48 0>; @@ -300,7 +300,7 @@ }; ð1 { - compatible = "qca,qca9560-eth", "syscon", "simple-mfd"; + compatible = "qca,qca9560-eth", "syscon"; phy-mode = "gmii"; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dts new file mode 100644 index 000000000..171cc6096 --- /dev/null +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "tp9343_tplink_tl-wr940n-v3.dtsi" + +/ { + compatible = "tplink,tl-wr940n-v3", "qca,tp9343"; + model = "TP-Link TL-WR940N v3"; +}; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi new file mode 100644 index 000000000..f5543e4f8 --- /dev/null +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "tp9343_tplink_tl-wr94x.dtsi" + +/ { + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "tp-link:blue:system"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + qss { + label = "tp-link:blue:qss"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "tp-link:blue:wlan"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wan_blue { + label = "tp-link:blue:wan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wan_red { + label = "tp-link:red:wan"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + + lan1 { + label = "tp-link:blue:lan1"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "tp-link:blue:lan2"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "tp-link:blue:lan3"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "tp-link:blue:lan4"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð1 { + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <(-1)>; +}; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts new file mode 100644 index 000000000..54e355530 --- /dev/null +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "tp9343_tplink_tl-wr94x.dtsi" + +/ { + compatible = "tplink,tl-wr940n-v4", "qca,tp9343"; + model = "TP-Link TL-WR940N v4"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "tp-link:blue:system"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + qss { + label = "tp-link:blue:qss"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "tp-link:blue:wlan"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wan_blue { + label = "tp-link:blue:wan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wan_red { + label = "tp-link:red:wan"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + + lan1 { + label = "tp-link:blue:lan1"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "tp-link:blue:lan2"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "tp-link:blue:lan3"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "tp-link:blue:lan4"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð1 { + mtd-mac-address = <&uboot 0x1fc00>; +}; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts new file mode 100644 index 000000000..121267f60 --- /dev/null +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "tp9343_tplink_tl-wr940n-v3.dtsi" + +/ { + compatible = "tplink,tl-wr941nd-v6", "qca,tp9343"; + model = "TP-Link TL-WR941ND v6"; +}; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr94x.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wr94x.dtsi new file mode 100644 index 000000000..c6bb8a241 --- /dev/null +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr94x.dtsi @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + label-mac-device = &wmac; + }; + + keys { + compatible = "gpio-keys"; + + wifi { + label = "WiFi button"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0x3d0000>; + }; + + art: partition@3f0000 { + label = "art"; + reg = <0x3f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-mode = "mii"; + phy-handle = <&swphy4>; + + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <1>; +}; + +ð1 { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&uboot 0x1fc00>; +}; diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c new file mode 100644 index 000000000..58198e446 --- /dev/null +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c @@ -0,0 +1,1481 @@ +/* + * Driver for the built-in NAND controller of the Atheros AR934x SoCs + * + * Copyright (C) 2011-2013 Gabor Juhos + * + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define AR934X_NFC_DRIVER_NAME "ar934x-nand" + +#define AR934X_NFC_REG_CMD 0x00 +#define AR934X_NFC_REG_CTRL 0x04 +#define AR934X_NFC_REG_STATUS 0x08 +#define AR934X_NFC_REG_INT_MASK 0x0c +#define AR934X_NFC_REG_INT_STATUS 0x10 +#define AR934X_NFC_REG_ECC_CTRL 0x14 +#define AR934X_NFC_REG_ECC_OFFSET 0x18 +#define AR934X_NFC_REG_ADDR0_0 0x1c +#define AR934X_NFC_REG_ADDR0_1 0x24 +#define AR934X_NFC_REG_ADDR1_0 0x20 +#define AR934X_NFC_REG_ADDR1_1 0x28 +#define AR934X_NFC_REG_SPARE_SIZE 0x30 +#define AR934X_NFC_REG_PROTECT 0x38 +#define AR934X_NFC_REG_LOOKUP_EN 0x40 +#define AR934X_NFC_REG_LOOKUP(_x) (0x44 + (_i) * 4) +#define AR934X_NFC_REG_DMA_ADDR 0x64 +#define AR934X_NFC_REG_DMA_COUNT 0x68 +#define AR934X_NFC_REG_DMA_CTRL 0x6c +#define AR934X_NFC_REG_MEM_CTRL 0x80 +#define AR934X_NFC_REG_DATA_SIZE 0x84 +#define AR934X_NFC_REG_READ_STATUS 0x88 +#define AR934X_NFC_REG_TIME_SEQ 0x8c +#define AR934X_NFC_REG_TIMINGS_ASYN 0x90 +#define AR934X_NFC_REG_TIMINGS_SYN 0x94 +#define AR934X_NFC_REG_FIFO_DATA 0x98 +#define AR934X_NFC_REG_TIME_MODE 0x9c +#define AR934X_NFC_REG_DMA_ADDR_OFFS 0xa0 +#define AR934X_NFC_REG_FIFO_INIT 0xb0 +#define AR934X_NFC_REG_GEN_SEQ_CTRL 0xb4 + +#define AR934X_NFC_CMD_CMD_SEQ_S 0 +#define AR934X_NFC_CMD_CMD_SEQ_M 0x3f +#define AR934X_NFC_CMD_SEQ_1C 0x00 +#define AR934X_NFC_CMD_SEQ_ERASE 0x0e +#define AR934X_NFC_CMD_SEQ_12 0x0c +#define AR934X_NFC_CMD_SEQ_1C1AXR 0x21 +#define AR934X_NFC_CMD_SEQ_S 0x24 +#define AR934X_NFC_CMD_SEQ_1C3AXR 0x27 +#define AR934X_NFC_CMD_SEQ_1C5A1CXR 0x2a +#define AR934X_NFC_CMD_SEQ_18 0x32 +#define AR934X_NFC_CMD_INPUT_SEL_SIU 0 +#define AR934X_NFC_CMD_INPUT_SEL_DMA BIT(6) +#define AR934X_NFC_CMD_ADDR_SEL_0 0 +#define AR934X_NFC_CMD_ADDR_SEL_1 BIT(7) +#define AR934X_NFC_CMD_CMD0_S 8 +#define AR934X_NFC_CMD_CMD0_M 0xff +#define AR934X_NFC_CMD_CMD1_S 16 +#define AR934X_NFC_CMD_CMD1_M 0xff +#define AR934X_NFC_CMD_CMD2_S 24 +#define AR934X_NFC_CMD_CMD2_M 0xff + +#define AR934X_NFC_CTRL_ADDR_CYCLE0_M 0x7 +#define AR934X_NFC_CTRL_ADDR_CYCLE0_S 0 +#define AR934X_NFC_CTRL_SPARE_EN BIT(3) +#define AR934X_NFC_CTRL_INT_EN BIT(4) +#define AR934X_NFC_CTRL_ECC_EN BIT(5) +#define AR934X_NFC_CTRL_BLOCK_SIZE_S 6 +#define AR934X_NFC_CTRL_BLOCK_SIZE_M 0x3 +#define AR934X_NFC_CTRL_BLOCK_SIZE_32 0 +#define AR934X_NFC_CTRL_BLOCK_SIZE_64 1 +#define AR934X_NFC_CTRL_BLOCK_SIZE_128 2 +#define AR934X_NFC_CTRL_BLOCK_SIZE_256 3 +#define AR934X_NFC_CTRL_PAGE_SIZE_S 8 +#define AR934X_NFC_CTRL_PAGE_SIZE_M 0x7 +#define AR934X_NFC_CTRL_PAGE_SIZE_256 0 +#define AR934X_NFC_CTRL_PAGE_SIZE_512 1 +#define AR934X_NFC_CTRL_PAGE_SIZE_1024 2 +#define AR934X_NFC_CTRL_PAGE_SIZE_2048 3 +#define AR934X_NFC_CTRL_PAGE_SIZE_4096 4 +#define AR934X_NFC_CTRL_PAGE_SIZE_8192 5 +#define AR934X_NFC_CTRL_PAGE_SIZE_16384 6 +#define AR934X_NFC_CTRL_CUSTOM_SIZE_EN BIT(11) +#define AR934X_NFC_CTRL_IO_WIDTH_8BITS 0 +#define AR934X_NFC_CTRL_IO_WIDTH_16BITS BIT(12) +#define AR934X_NFC_CTRL_LOOKUP_EN BIT(13) +#define AR934X_NFC_CTRL_PROT_EN BIT(14) +#define AR934X_NFC_CTRL_WORK_MODE_ASYNC 0 +#define AR934X_NFC_CTRL_WORK_MODE_SYNC BIT(15) +#define AR934X_NFC_CTRL_ADDR0_AUTO_INC BIT(16) +#define AR934X_NFC_CTRL_ADDR1_AUTO_INC BIT(17) +#define AR934X_NFC_CTRL_ADDR_CYCLE1_M 0x7 +#define AR934X_NFC_CTRL_ADDR_CYCLE1_S 18 +#define AR934X_NFC_CTRL_SMALL_PAGE BIT(21) + +#define AR934X_NFC_DMA_CTRL_DMA_START BIT(7) +#define AR934X_NFC_DMA_CTRL_DMA_DIR_WRITE 0 +#define AR934X_NFC_DMA_CTRL_DMA_DIR_READ BIT(6) +#define AR934X_NFC_DMA_CTRL_DMA_MODE_SG BIT(5) +#define AR934X_NFC_DMA_CTRL_DMA_BURST_S 2 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_0 0 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_1 1 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_2 2 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_3 3 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_4 4 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_5 5 +#define AR934X_NFC_DMA_CTRL_ERR_FLAG BIT(1) +#define AR934X_NFC_DMA_CTRL_DMA_READY BIT(0) + +#define AR934X_NFC_INT_DEV_RDY(_x) BIT(4 + (_x)) +#define AR934X_NFC_INT_CMD_END BIT(1) + +#define AR934X_NFC_ECC_CTRL_ERR_THRES_S 8 +#define AR934X_NFC_ECC_CTRL_ERR_THRES_M 0x1f +#define AR934X_NFC_ECC_CTRL_ECC_CAP_S 5 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_M 0x7 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_2 0 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_4 1 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_6 2 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_8 3 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_10 4 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_12 5 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_14 6 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_16 7 +#define AR934X_NFC_ECC_CTRL_ERR_OVER BIT(2) +#define AR934X_NFC_ECC_CTRL_ERR_UNCORRECT BIT(1) +#define AR934X_NFC_ECC_CTRL_ERR_CORRECT BIT(0) + +#define AR934X_NFC_ECC_OFFS_OFSET_M 0xffff + +/* default timing values */ +#define AR934X_NFC_TIME_SEQ_DEFAULT 0x7fff +#define AR934X_NFC_TIMINGS_ASYN_DEFAULT 0x22 +#define AR934X_NFC_TIMINGS_SYN_DEFAULT 0xf + +#define AR934X_NFC_ID_BUF_SIZE 8 +#define AR934X_NFC_DEV_READY_TIMEOUT 25 /* msecs */ +#define AR934X_NFC_DMA_READY_TIMEOUT 25 /* msecs */ +#define AR934X_NFC_DONE_TIMEOUT 1000 +#define AR934X_NFC_DMA_RETRIES 20 + +#define AR934X_NFC_USE_IRQ true +#define AR934X_NFC_IRQ_MASK AR934X_NFC_INT_DEV_RDY(0) + +#define AR934X_NFC_GENSEQ_SMALL_PAGE_READ 0x30043 + +#undef AR934X_NFC_DEBUG_DATA +#undef AR934X_NFC_DEBUG + +struct mtd_info; +struct mtd_partition; +struct ar934x_nfc; + +struct ar934x_nfc { + struct nand_chip nand_chip; + struct device *parent; + void __iomem *base; + bool swap_dma; + int irq; + wait_queue_head_t irq_waitq; + + bool spurious_irq_expected; + u32 irq_status; + + u32 ctrl_reg; + u32 ecc_ctrl_reg; + u32 ecc_offset_reg; + u32 ecc_thres; + u32 ecc_oob_pos; + + bool small_page; + unsigned int addr_count0; + unsigned int addr_count1; + + u8 *buf; + dma_addr_t buf_dma; + unsigned int buf_size; + int buf_index; + + bool read_id; + + int erase1_page_addr; + + int rndout_page_addr; + int rndout_read_cmd; + + int seqin_page_addr; + int seqin_column; + int seqin_read_cmd; + + struct reset_control *rst; +}; + +static inline __printf(2, 3) +void _nfc_dbg(struct ar934x_nfc *nfc, const char *fmt, ...) +{ +} + +#ifdef AR934X_NFC_DEBUG +#define nfc_dbg(_nfc, fmt, ...) \ + dev_info((_nfc)->parent, fmt, ##__VA_ARGS__) +#else +#define nfc_dbg(_nfc, fmt, ...) \ + _nfc_dbg((_nfc), fmt, ##__VA_ARGS__) +#endif /* AR934X_NFC_DEBUG */ + +#ifdef AR934X_NFC_DEBUG_DATA +static void nfc_debug_data(const char *label, void *data, int len) +{ + print_hex_dump(KERN_WARNING, label, DUMP_PREFIX_OFFSET, 16, 1, + data, len, 0); +} +#else +static inline void nfc_debug_data(const char *label, void *data, int len) {} +#endif /* AR934X_NFC_DEBUG_DATA */ + +static void ar934x_nfc_restart(struct ar934x_nfc *nfc); + +static inline bool is_all_ff(u8 *buf, int len) +{ + while (len--) + if (buf[len] != 0xff) + return false; + + return true; +} + +static inline void ar934x_nfc_wr(struct ar934x_nfc *nfc, unsigned reg, u32 val) +{ + __raw_writel(val, nfc->base + reg); +} + +static inline u32 ar934x_nfc_rr(struct ar934x_nfc *nfc, unsigned reg) +{ + return __raw_readl(nfc->base + reg); +} + +static inline struct ar934x_nfc *mtd_to_ar934x_nfc(struct mtd_info *mtd) +{ + struct nand_chip *chip = mtd_to_nand(mtd); + + return container_of(chip, struct ar934x_nfc, nand_chip); +} + +static struct mtd_info *ar934x_nfc_to_mtd(struct ar934x_nfc *nfc) +{ + return nand_to_mtd(&nfc->nand_chip); +} + +static inline bool ar934x_nfc_use_irq(struct ar934x_nfc *nfc) +{ + return AR934X_NFC_USE_IRQ; +} + +static inline void ar934x_nfc_write_cmd_reg(struct ar934x_nfc *nfc, u32 cmd_reg) +{ + wmb(); + + ar934x_nfc_wr(nfc, AR934X_NFC_REG_CMD, cmd_reg); + /* flush write */ + ar934x_nfc_rr(nfc, AR934X_NFC_REG_CMD); +} + +static bool __ar934x_nfc_dev_ready(struct ar934x_nfc *nfc) +{ + u32 status; + + status = ar934x_nfc_rr(nfc, AR934X_NFC_REG_STATUS); + return (status & 0xff) == 0xff; +} + +static inline bool __ar934x_nfc_is_dma_ready(struct ar934x_nfc *nfc) +{ + u32 status; + + status = ar934x_nfc_rr(nfc, AR934X_NFC_REG_DMA_CTRL); + return (status & AR934X_NFC_DMA_CTRL_DMA_READY) != 0; +} + +static int ar934x_nfc_wait_dev_ready(struct ar934x_nfc *nfc) +{ + unsigned long timeout; + + timeout = jiffies + msecs_to_jiffies(AR934X_NFC_DEV_READY_TIMEOUT); + do { + if (__ar934x_nfc_dev_ready(nfc)) + return 0; + } while time_before(jiffies, timeout); + + nfc_dbg(nfc, "timeout waiting for device ready, status:%08x int:%08x\n", + ar934x_nfc_rr(nfc, AR934X_NFC_REG_STATUS), + ar934x_nfc_rr(nfc, AR934X_NFC_REG_INT_STATUS)); + return -ETIMEDOUT; +} + +static int ar934x_nfc_wait_dma_ready(struct ar934x_nfc *nfc) +{ + unsigned long timeout; + + timeout = jiffies + msecs_to_jiffies(AR934X_NFC_DMA_READY_TIMEOUT); + do { + if (__ar934x_nfc_is_dma_ready(nfc)) + return 0; + } while time_before(jiffies, timeout); + + nfc_dbg(nfc, "timeout waiting for DMA ready, dma_ctrl:%08x\n", + ar934x_nfc_rr(nfc, AR934X_NFC_REG_DMA_CTRL)); + return -ETIMEDOUT; +} + +static int ar934x_nfc_wait_irq(struct ar934x_nfc *nfc) +{ + long timeout; + int ret; + + timeout = wait_event_timeout(nfc->irq_waitq, + (nfc->irq_status & AR934X_NFC_IRQ_MASK) != 0, + msecs_to_jiffies(AR934X_NFC_DEV_READY_TIMEOUT)); + + ret = 0; + if (!timeout) { + ar934x_nfc_wr(nfc, AR934X_NFC_REG_INT_MASK, 0); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_INT_STATUS, 0); + /* flush write */ + ar934x_nfc_rr(nfc, AR934X_NFC_REG_INT_STATUS); + + nfc_dbg(nfc, + "timeout waiting for interrupt, status:%08x\n", + nfc->irq_status); + ret = -ETIMEDOUT; + } + + nfc->irq_status = 0; + return ret; +} + +static int ar934x_nfc_wait_done(struct ar934x_nfc *nfc) +{ + int ret; + + if (ar934x_nfc_use_irq(nfc)) + ret = ar934x_nfc_wait_irq(nfc); + else + ret = ar934x_nfc_wait_dev_ready(nfc); + + if (ret) + return ret; + + return ar934x_nfc_wait_dma_ready(nfc); +} + +static int ar934x_nfc_alloc_buf(struct ar934x_nfc *nfc, unsigned size) +{ + nfc->buf = dma_alloc_coherent(nfc->parent, size, + &nfc->buf_dma, GFP_KERNEL); + if (nfc->buf == NULL) { + dev_err(nfc->parent, "no memory for DMA buffer\n"); + return -ENOMEM; + } + + nfc->buf_size = size; + nfc_dbg(nfc, "buf:%p size:%u\n", nfc->buf, nfc->buf_size); + + return 0; +} + +static void ar934x_nfc_free_buf(struct ar934x_nfc *nfc) +{ + dma_free_coherent(nfc->parent, nfc->buf_size, nfc->buf, nfc->buf_dma); +} + +static void ar934x_nfc_get_addr(struct ar934x_nfc *nfc, int column, + int page_addr, u32 *addr0, u32 *addr1) +{ + u32 a0, a1; + + a0 = 0; + a1 = 0; + + if (column == -1) { + /* ERASE1 */ + a0 = (page_addr & 0xffff) << 16; + a1 = (page_addr >> 16) & 0xf; + } else if (page_addr != -1) { + /* SEQIN, READ0, etc.. */ + + /* TODO: handle 16bit bus width */ + if (nfc->small_page) { + a0 = column & 0xff; + a0 |= (page_addr & 0xff) << 8; + a0 |= ((page_addr >> 8) & 0xff) << 16; + a0 |= ((page_addr >> 16) & 0xff) << 24; + } else { + a0 = column & 0x0FFF; + a0 |= (page_addr & 0xffff) << 16; + + if (nfc->addr_count0 > 4) + a1 = (page_addr >> 16) & 0xf; + } + } + + *addr0 = a0; + *addr1 = a1; +} + +static void ar934x_nfc_send_cmd(struct ar934x_nfc *nfc, unsigned command) +{ + u32 cmd_reg; + + cmd_reg = AR934X_NFC_CMD_INPUT_SEL_SIU | AR934X_NFC_CMD_ADDR_SEL_0 | + AR934X_NFC_CMD_SEQ_1C; + cmd_reg |= (command & AR934X_NFC_CMD_CMD0_M) << AR934X_NFC_CMD_CMD0_S; + + ar934x_nfc_wr(nfc, AR934X_NFC_REG_INT_STATUS, 0); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_CTRL, nfc->ctrl_reg); + + ar934x_nfc_write_cmd_reg(nfc, cmd_reg); + ar934x_nfc_wait_dev_ready(nfc); +} + +static int ar934x_nfc_do_rw_command(struct ar934x_nfc *nfc, int column, + int page_addr, int len, u32 cmd_reg, + u32 ctrl_reg, bool write) +{ + u32 addr0, addr1; + u32 dma_ctrl; + int dir; + int err; + int retries = 0; + + WARN_ON(len & 3); + + if (WARN_ON(len > nfc->buf_size)) + dev_err(nfc->parent, "len=%d > buf_size=%d", len, + nfc->buf_size); + + if (write) { + dma_ctrl = AR934X_NFC_DMA_CTRL_DMA_DIR_WRITE; + dir = DMA_TO_DEVICE; + } else { + dma_ctrl = AR934X_NFC_DMA_CTRL_DMA_DIR_READ; + dir = DMA_FROM_DEVICE; + } + + ar934x_nfc_get_addr(nfc, column, page_addr, &addr0, &addr1); + + dma_ctrl |= AR934X_NFC_DMA_CTRL_DMA_START | + (AR934X_NFC_DMA_CTRL_DMA_BURST_3 << + AR934X_NFC_DMA_CTRL_DMA_BURST_S); + + cmd_reg |= AR934X_NFC_CMD_INPUT_SEL_DMA | AR934X_NFC_CMD_ADDR_SEL_0; + ctrl_reg |= AR934X_NFC_CTRL_INT_EN; + + nfc_dbg(nfc, "%s a0:%08x a1:%08x len:%x cmd:%08x dma:%08x ctrl:%08x\n", + (write) ? "write" : "read", + addr0, addr1, len, cmd_reg, dma_ctrl, ctrl_reg); + +retry: + ar934x_nfc_wr(nfc, AR934X_NFC_REG_INT_STATUS, 0); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_ADDR0_0, addr0); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_ADDR0_1, addr1); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_DMA_ADDR, nfc->buf_dma); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_DMA_COUNT, len); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_DATA_SIZE, len); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_CTRL, ctrl_reg); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_DMA_CTRL, dma_ctrl); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_ECC_CTRL, nfc->ecc_ctrl_reg); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_ECC_OFFSET, nfc->ecc_offset_reg); + + if (ar934x_nfc_use_irq(nfc)) { + ar934x_nfc_wr(nfc, AR934X_NFC_REG_INT_MASK, + AR934X_NFC_IRQ_MASK); + /* flush write */ + ar934x_nfc_rr(nfc, AR934X_NFC_REG_INT_MASK); + } + + ar934x_nfc_write_cmd_reg(nfc, cmd_reg); + err = ar934x_nfc_wait_done(nfc); + if (err) { + dev_dbg(nfc->parent, "%s operation stuck at page %d\n", + (write) ? "write" : "read", page_addr); + + ar934x_nfc_restart(nfc); + if (retries++ < AR934X_NFC_DMA_RETRIES) + goto retry; + + dev_err(nfc->parent, "%s operation failed on page %d\n", + (write) ? "write" : "read", page_addr); + } + + return err; +} + +static int ar934x_nfc_send_readid(struct ar934x_nfc *nfc, unsigned command) +{ + u32 cmd_reg; + int err; + + nfc_dbg(nfc, "readid, cmd:%02x\n", command); + + cmd_reg = AR934X_NFC_CMD_SEQ_1C1AXR; + cmd_reg |= (command & AR934X_NFC_CMD_CMD0_M) << AR934X_NFC_CMD_CMD0_S; + + err = ar934x_nfc_do_rw_command(nfc, -1, -1, AR934X_NFC_ID_BUF_SIZE, + cmd_reg, nfc->ctrl_reg, false); + + nfc_debug_data("[id] ", nfc->buf, AR934X_NFC_ID_BUF_SIZE); + + return err; +} + +static int ar934x_nfc_send_read(struct ar934x_nfc *nfc, unsigned command, + int column, int page_addr, int len) +{ + u32 cmd_reg; + int err; + + nfc_dbg(nfc, "read, column=%d page=%d len=%d\n", + column, page_addr, len); + + cmd_reg = (command & AR934X_NFC_CMD_CMD0_M) << AR934X_NFC_CMD_CMD0_S; + + if (nfc->small_page) { + cmd_reg |= AR934X_NFC_CMD_SEQ_18; + } else { + cmd_reg |= NAND_CMD_READSTART << AR934X_NFC_CMD_CMD1_S; + cmd_reg |= AR934X_NFC_CMD_SEQ_1C5A1CXR; + } + + err = ar934x_nfc_do_rw_command(nfc, column, page_addr, len, + cmd_reg, nfc->ctrl_reg, false); + + nfc_debug_data("[data] ", nfc->buf, len); + + return err; +} + +static void ar934x_nfc_send_erase(struct ar934x_nfc *nfc, unsigned command, + int column, int page_addr) +{ + u32 addr0, addr1; + u32 ctrl_reg; + u32 cmd_reg; + + ar934x_nfc_get_addr(nfc, column, page_addr, &addr0, &addr1); + + ctrl_reg = nfc->ctrl_reg; + if (nfc->small_page) { + /* override number of address cycles for the erase command */ + ctrl_reg &= ~(AR934X_NFC_CTRL_ADDR_CYCLE0_M << + AR934X_NFC_CTRL_ADDR_CYCLE0_S); + ctrl_reg &= ~(AR934X_NFC_CTRL_ADDR_CYCLE1_M << + AR934X_NFC_CTRL_ADDR_CYCLE1_S); + ctrl_reg &= ~(AR934X_NFC_CTRL_SMALL_PAGE); + ctrl_reg |= (nfc->addr_count0 + 1) << + AR934X_NFC_CTRL_ADDR_CYCLE0_S; + } + + cmd_reg = NAND_CMD_ERASE1 << AR934X_NFC_CMD_CMD0_S; + cmd_reg |= command << AR934X_NFC_CMD_CMD1_S; + cmd_reg |= AR934X_NFC_CMD_SEQ_ERASE; + + nfc_dbg(nfc, "erase page %d, a0:%08x a1:%08x cmd:%08x ctrl:%08x\n", + page_addr, addr0, addr1, cmd_reg, ctrl_reg); + + ar934x_nfc_wr(nfc, AR934X_NFC_REG_INT_STATUS, 0); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_CTRL, ctrl_reg); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_ADDR0_0, addr0); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_ADDR0_1, addr1); + + ar934x_nfc_write_cmd_reg(nfc, cmd_reg); + ar934x_nfc_wait_dev_ready(nfc); +} + +static int ar934x_nfc_send_write(struct ar934x_nfc *nfc, unsigned command, + int column, int page_addr, int len) +{ + u32 cmd_reg; + + nfc_dbg(nfc, "write, column=%d page=%d len=%d\n", + column, page_addr, len); + + nfc_debug_data("[data] ", nfc->buf, len); + + cmd_reg = NAND_CMD_SEQIN << AR934X_NFC_CMD_CMD0_S; + cmd_reg |= command << AR934X_NFC_CMD_CMD1_S; + cmd_reg |= AR934X_NFC_CMD_SEQ_12; + + return ar934x_nfc_do_rw_command(nfc, column, page_addr, len, + cmd_reg, nfc->ctrl_reg, true); +} + +static void ar934x_nfc_read_status(struct ar934x_nfc *nfc) +{ + u32 cmd_reg; + u32 status; + + cmd_reg = NAND_CMD_STATUS << AR934X_NFC_CMD_CMD0_S; + cmd_reg |= AR934X_NFC_CMD_SEQ_S; + + ar934x_nfc_wr(nfc, AR934X_NFC_REG_INT_STATUS, 0); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_CTRL, nfc->ctrl_reg); + + ar934x_nfc_write_cmd_reg(nfc, cmd_reg); + ar934x_nfc_wait_dev_ready(nfc); + + status = ar934x_nfc_rr(nfc, AR934X_NFC_REG_READ_STATUS); + + nfc_dbg(nfc, "read status, cmd:%08x status:%02x\n", + cmd_reg, (status & 0xff)); + + if (nfc->swap_dma) + nfc->buf[0 ^ 3] = status; + else + nfc->buf[0] = status; +} + +static void ar934x_nfc_cmdfunc(struct mtd_info *mtd, unsigned int command, + int column, int page_addr) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + struct nand_chip *nand = &nfc->nand_chip; + + nfc->read_id = false; + if (command != NAND_CMD_PAGEPROG) + nfc->buf_index = 0; + + switch (command) { + case NAND_CMD_RESET: + ar934x_nfc_send_cmd(nfc, command); + break; + + case NAND_CMD_READID: + nfc->read_id = true; + ar934x_nfc_send_readid(nfc, command); + break; + + case NAND_CMD_READ0: + case NAND_CMD_READ1: + if (nfc->small_page) { + ar934x_nfc_send_read(nfc, command, column, page_addr, + mtd->writesize + mtd->oobsize); + } else { + ar934x_nfc_send_read(nfc, command, 0, page_addr, + mtd->writesize + mtd->oobsize); + nfc->buf_index = column; + nfc->rndout_page_addr = page_addr; + nfc->rndout_read_cmd = command; + } + break; + + case NAND_CMD_READOOB: + if (nfc->small_page) + ar934x_nfc_send_read(nfc, NAND_CMD_READOOB, + column, page_addr, + mtd->oobsize); + else + ar934x_nfc_send_read(nfc, NAND_CMD_READ0, + mtd->writesize, page_addr, + mtd->oobsize); + break; + + case NAND_CMD_RNDOUT: + if (WARN_ON(nfc->small_page)) + break; + + /* emulate subpage read */ + ar934x_nfc_send_read(nfc, nfc->rndout_read_cmd, 0, + nfc->rndout_page_addr, + mtd->writesize + mtd->oobsize); + nfc->buf_index = column; + break; + + case NAND_CMD_ERASE1: + nfc->erase1_page_addr = page_addr; + break; + + case NAND_CMD_ERASE2: + ar934x_nfc_send_erase(nfc, command, -1, nfc->erase1_page_addr); + break; + + case NAND_CMD_STATUS: + ar934x_nfc_read_status(nfc); + break; + + case NAND_CMD_SEQIN: + if (nfc->small_page) { + /* output read command */ + if (column >= mtd->writesize) { + column -= mtd->writesize; + nfc->seqin_read_cmd = NAND_CMD_READOOB; + } else if (column < 256) { + nfc->seqin_read_cmd = NAND_CMD_READ0; + } else { + column -= 256; + nfc->seqin_read_cmd = NAND_CMD_READ1; + } + } else { + nfc->seqin_read_cmd = NAND_CMD_READ0; + } + nfc->seqin_column = column; + nfc->seqin_page_addr = page_addr; + break; + + case NAND_CMD_PAGEPROG: + if (nand->ecc.mode == NAND_ECC_HW) { + /* the data is already written */ + break; + } + + if (nfc->small_page) + ar934x_nfc_send_cmd(nfc, nfc->seqin_read_cmd); + + ar934x_nfc_send_write(nfc, command, nfc->seqin_column, + nfc->seqin_page_addr, + nfc->buf_index); + break; + + default: + dev_err(nfc->parent, + "unsupported command: %x, column:%d page_addr=%d\n", + command, column, page_addr); + break; + } +} + +static int ar934x_nfc_dev_ready(struct mtd_info *mtd) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + + return __ar934x_nfc_dev_ready(nfc); +} + +static u8 ar934x_nfc_read_byte(struct mtd_info *mtd) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + u8 data; + + WARN_ON(nfc->buf_index >= nfc->buf_size); + + if (nfc->swap_dma || nfc->read_id) + data = nfc->buf[nfc->buf_index ^ 3]; + else + data = nfc->buf[nfc->buf_index]; + + nfc->buf_index++; + + return data; +} + +static void ar934x_nfc_write_buf(struct mtd_info *mtd, const u8 *buf, int len) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + int i; + + WARN_ON(nfc->buf_index + len > nfc->buf_size); + + if (nfc->swap_dma) { + for (i = 0; i < len; i++) { + nfc->buf[nfc->buf_index ^ 3] = buf[i]; + nfc->buf_index++; + } + } else { + for (i = 0; i < len; i++) { + nfc->buf[nfc->buf_index] = buf[i]; + nfc->buf_index++; + } + } +} + +static void ar934x_nfc_read_buf(struct mtd_info *mtd, u8 *buf, int len) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + int buf_index; + int i; + + WARN_ON(nfc->buf_index + len > nfc->buf_size); + + buf_index = nfc->buf_index; + + if (nfc->swap_dma || nfc->read_id) { + for (i = 0; i < len; i++) { + buf[i] = nfc->buf[buf_index ^ 3]; + buf_index++; + } + } else { + for (i = 0; i < len; i++) { + buf[i] = nfc->buf[buf_index]; + buf_index++; + } + } + + nfc->buf_index = buf_index; +} + +static inline void ar934x_nfc_enable_hwecc(struct ar934x_nfc *nfc) +{ + nfc->ctrl_reg |= AR934X_NFC_CTRL_ECC_EN; + nfc->ctrl_reg &= ~AR934X_NFC_CTRL_CUSTOM_SIZE_EN; +} + +static inline void ar934x_nfc_disable_hwecc(struct ar934x_nfc *nfc) +{ + nfc->ctrl_reg &= ~AR934X_NFC_CTRL_ECC_EN; + nfc->ctrl_reg |= AR934X_NFC_CTRL_CUSTOM_SIZE_EN; +} + +static int ar934x_nfc_read_oob(struct mtd_info *mtd, struct nand_chip *chip, + int page) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + int err; + + nfc_dbg(nfc, "read_oob: page:%d\n", page); + + err = ar934x_nfc_send_read(nfc, NAND_CMD_READ0, mtd->writesize, page, + mtd->oobsize); + if (err) + return err; + + memcpy(chip->oob_poi, nfc->buf, mtd->oobsize); + + return 0; +} + +static int ar934x_nfc_write_oob(struct mtd_info *mtd, struct nand_chip *chip, + int page) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + + nfc_dbg(nfc, "write_oob: page:%d\n", page); + + memcpy(nfc->buf, chip->oob_poi, mtd->oobsize); + + return ar934x_nfc_send_write(nfc, NAND_CMD_PAGEPROG, mtd->writesize, + page, mtd->oobsize); +} + +static int ar934x_nfc_read_page_raw(struct mtd_info *mtd, + struct nand_chip *chip, u8 *buf, + int oob_required, int page) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + int len; + int err; + + nfc_dbg(nfc, "read_page_raw: page:%d oob:%d\n", page, oob_required); + + len = mtd->writesize; + if (oob_required) + len += mtd->oobsize; + + err = ar934x_nfc_send_read(nfc, NAND_CMD_READ0, 0, page, len); + if (err) + return err; + + memcpy(buf, nfc->buf, mtd->writesize); + + if (oob_required) + memcpy(chip->oob_poi, &nfc->buf[mtd->writesize], mtd->oobsize); + + return 0; +} + +static int ar934x_nfc_read_page(struct mtd_info *mtd, struct nand_chip *chip, + u8 *buf, int oob_required, int page) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + u32 ecc_ctrl; + int max_bitflips = 0; + bool ecc_failed; + bool ecc_corrected; + int err; + + nfc_dbg(nfc, "read_page: page:%d oob:%d\n", page, oob_required); + + ar934x_nfc_enable_hwecc(nfc); + err = ar934x_nfc_send_read(nfc, NAND_CMD_READ0, 0, page, + mtd->writesize); + ar934x_nfc_disable_hwecc(nfc); + + if (err) + return err; + + /* TODO: optimize to avoid memcpy */ + memcpy(buf, nfc->buf, mtd->writesize); + + /* read the ECC status */ + ecc_ctrl = ar934x_nfc_rr(nfc, AR934X_NFC_REG_ECC_CTRL); + ecc_failed = ecc_ctrl & AR934X_NFC_ECC_CTRL_ERR_UNCORRECT; + ecc_corrected = ecc_ctrl & AR934X_NFC_ECC_CTRL_ERR_CORRECT; + + if (oob_required || ecc_failed) { + err = ar934x_nfc_send_read(nfc, NAND_CMD_READ0, mtd->writesize, + page, mtd->oobsize); + if (err) + return err; + + if (oob_required) + memcpy(chip->oob_poi, nfc->buf, mtd->oobsize); + } + + if (ecc_failed) { + /* + * The hardware ECC engine reports uncorrectable errors + * on empty pages. Check the ECC bytes and the data. If + * both contains 0xff bytes only, dont report a failure. + * + * TODO: prebuild a buffer with 0xff bytes and use memcmp + * for better performance? + */ + if (!is_all_ff(&nfc->buf[nfc->ecc_oob_pos], chip->ecc.total) || + !is_all_ff(buf, mtd->writesize)) + mtd->ecc_stats.failed++; + } else if (ecc_corrected) { + /* + * The hardware does not report the exact count of the + * corrected bitflips, use assumptions based on the + * threshold. + */ + if (ecc_ctrl & AR934X_NFC_ECC_CTRL_ERR_OVER) { + /* + * The number of corrected bitflips exceeds the + * threshold. Assume the maximum. + */ + max_bitflips = chip->ecc.strength * chip->ecc.steps; + } else { + max_bitflips = nfc->ecc_thres * chip->ecc.steps; + } + + mtd->ecc_stats.corrected += max_bitflips; + } + + return max_bitflips; +} + +static int ar934x_nfc_write_page_raw(struct mtd_info *mtd, + struct nand_chip *chip, const u8 *buf, + int oob_required, int page) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + int len; + + nfc_dbg(nfc, "write_page_raw: page:%d oob:%d\n", page, oob_required); + + memcpy(nfc->buf, buf, mtd->writesize); + len = mtd->writesize; + + if (oob_required) { + memcpy(&nfc->buf[mtd->writesize], chip->oob_poi, mtd->oobsize); + len += mtd->oobsize; + } + + return ar934x_nfc_send_write(nfc, NAND_CMD_PAGEPROG, 0, page, len); +} + +static int ar934x_nfc_write_page(struct mtd_info *mtd, struct nand_chip *chip, + const u8 *buf, int oob_required, int page) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + int err; + + nfc_dbg(nfc, "write_page: page:%d oob:%d\n", page, oob_required); + + /* write OOB first */ + if (oob_required && + !is_all_ff(chip->oob_poi, mtd->oobsize)) { + err = ar934x_nfc_write_oob(mtd, chip, page); + if (err) + return err; + } + + /* TODO: optimize to avoid memcopy */ + memcpy(nfc->buf, buf, mtd->writesize); + + ar934x_nfc_enable_hwecc(nfc); + err = ar934x_nfc_send_write(nfc, NAND_CMD_PAGEPROG, 0, page, + mtd->writesize); + ar934x_nfc_disable_hwecc(nfc); + + return err; +} + +static int ar934x_nfc_hw_reset_assert(struct ar934x_nfc *nfc) { + reset_control_assert(nfc->rst); + udelay(250); +} + +static int ar934x_nfc_hw_reset_deassert(struct ar934x_nfc *nfc) { + reset_control_deassert(nfc->rst); + udelay(250); +} + +static int ar934x_nfc_hw_init(struct ar934x_nfc *nfc) +{ + ar934x_nfc_hw_reset_assert(nfc); + ar934x_nfc_hw_reset_deassert(nfc); + /* + * setup timings + * TODO: make it configurable via platform data or DT + */ + ar934x_nfc_wr(nfc, AR934X_NFC_REG_TIME_SEQ, + AR934X_NFC_TIME_SEQ_DEFAULT); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_TIMINGS_ASYN, + AR934X_NFC_TIMINGS_ASYN_DEFAULT); + ar934x_nfc_wr(nfc, AR934X_NFC_REG_TIMINGS_SYN, + AR934X_NFC_TIMINGS_SYN_DEFAULT); + + /* disable WP on all chips, and select chip 0 */ + ar934x_nfc_wr(nfc, AR934X_NFC_REG_MEM_CTRL, 0xff00); + + ar934x_nfc_wr(nfc, AR934X_NFC_REG_DMA_ADDR_OFFS, 0); + + /* initialize Control register */ + nfc->ctrl_reg = AR934X_NFC_CTRL_CUSTOM_SIZE_EN; + ar934x_nfc_wr(nfc, AR934X_NFC_REG_CTRL, nfc->ctrl_reg); + + if (nfc->small_page) { + /* Setup generic sequence register for small page reads. */ + ar934x_nfc_wr(nfc, AR934X_NFC_REG_GEN_SEQ_CTRL, + AR934X_NFC_GENSEQ_SMALL_PAGE_READ); + } + + return 0; +} + +static void ar934x_nfc_restart(struct ar934x_nfc *nfc) +{ + u32 ctrl_reg; + + ctrl_reg = nfc->ctrl_reg; + ar934x_nfc_hw_init(nfc); + nfc->ctrl_reg = ctrl_reg; + + ar934x_nfc_send_cmd(nfc, NAND_CMD_RESET); +} + +static irqreturn_t ar934x_nfc_irq_handler(int irq, void *data) +{ + struct ar934x_nfc *nfc = data; + u32 status; + + status = ar934x_nfc_rr(nfc, AR934X_NFC_REG_INT_STATUS); + + ar934x_nfc_wr(nfc, AR934X_NFC_REG_INT_STATUS, 0); + /* flush write */ + ar934x_nfc_rr(nfc, AR934X_NFC_REG_INT_STATUS); + + status &= ar934x_nfc_rr(nfc, AR934X_NFC_REG_INT_MASK); + if (status) { + nfc_dbg(nfc, "got IRQ, status:%08x\n", status); + + nfc->irq_status = status; + nfc->spurious_irq_expected = true; + wake_up(&nfc->irq_waitq); + } else { + if (nfc->spurious_irq_expected) + nfc->spurious_irq_expected = false; + else + dev_warn(nfc->parent, "spurious interrupt\n"); + } + + return IRQ_HANDLED; +} + +static int ar934x_nfc_init_tail(struct mtd_info *mtd) +{ + struct ar934x_nfc *nfc = mtd_to_ar934x_nfc(mtd); + struct nand_chip *chip = &nfc->nand_chip; + u32 ctrl; + u32 t; + int err; + + switch (mtd->oobsize) { + case 16: + case 64: + case 128: + ar934x_nfc_wr(nfc, AR934X_NFC_REG_SPARE_SIZE, mtd->oobsize); + break; + + default: + dev_err(nfc->parent, "unsupported OOB size: %d bytes\n", + mtd->oobsize); + return -ENXIO; + } + + ctrl = AR934X_NFC_CTRL_CUSTOM_SIZE_EN; + + switch (mtd->erasesize / mtd->writesize) { + case 32: + t = AR934X_NFC_CTRL_BLOCK_SIZE_32; + break; + + case 64: + t = AR934X_NFC_CTRL_BLOCK_SIZE_64; + break; + + case 128: + t = AR934X_NFC_CTRL_BLOCK_SIZE_128; + break; + + case 256: + t = AR934X_NFC_CTRL_BLOCK_SIZE_256; + break; + + default: + dev_err(nfc->parent, "unsupported block size: %u\n", + mtd->erasesize / mtd->writesize); + return -ENXIO; + } + + ctrl |= t << AR934X_NFC_CTRL_BLOCK_SIZE_S; + + switch (mtd->writesize) { + case 256: + nfc->small_page = 1; + t = AR934X_NFC_CTRL_PAGE_SIZE_256; + break; + + case 512: + nfc->small_page = 1; + t = AR934X_NFC_CTRL_PAGE_SIZE_512; + break; + + case 1024: + t = AR934X_NFC_CTRL_PAGE_SIZE_1024; + break; + + case 2048: + t = AR934X_NFC_CTRL_PAGE_SIZE_2048; + break; + + case 4096: + t = AR934X_NFC_CTRL_PAGE_SIZE_4096; + break; + + case 8192: + t = AR934X_NFC_CTRL_PAGE_SIZE_8192; + break; + + case 16384: + t = AR934X_NFC_CTRL_PAGE_SIZE_16384; + break; + + default: + dev_err(nfc->parent, "unsupported write size: %d bytes\n", + mtd->writesize); + return -ENXIO; + } + + ctrl |= t << AR934X_NFC_CTRL_PAGE_SIZE_S; + + if (nfc->small_page) { + ctrl |= AR934X_NFC_CTRL_SMALL_PAGE; + + if (chip->chipsize > (32 << 20)) { + nfc->addr_count0 = 4; + nfc->addr_count1 = 3; + } else if (chip->chipsize > (2 << 16)) { + nfc->addr_count0 = 3; + nfc->addr_count1 = 2; + } else { + nfc->addr_count0 = 2; + nfc->addr_count1 = 1; + } + } else { + if (chip->chipsize > (128 << 20)) { + nfc->addr_count0 = 5; + nfc->addr_count1 = 3; + } else if (chip->chipsize > (8 << 16)) { + nfc->addr_count0 = 4; + nfc->addr_count1 = 2; + } else { + nfc->addr_count0 = 3; + nfc->addr_count1 = 1; + } + } + + ctrl |= nfc->addr_count0 << AR934X_NFC_CTRL_ADDR_CYCLE0_S; + ctrl |= nfc->addr_count1 << AR934X_NFC_CTRL_ADDR_CYCLE1_S; + + nfc->ctrl_reg = ctrl; + ar934x_nfc_wr(nfc, AR934X_NFC_REG_CTRL, nfc->ctrl_reg); + + ar934x_nfc_free_buf(nfc); + err = ar934x_nfc_alloc_buf(nfc, mtd->writesize + mtd->oobsize); + + return err; +} + +static int ar934x_nfc_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *oobregion) +{ + if (section) + return -ERANGE; + + oobregion->offset = 20; + oobregion->length = 28; + + return 0; +} + +static int ar934x_nfc_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *oobregion) +{ + switch (section) { + case 0: + oobregion->offset = 4; + oobregion->length = 16; + return 0; + case 1: + oobregion->offset = 48; + oobregion->length = 16; + return 0; + default: + return -ERANGE; + } +} + +static const struct mtd_ooblayout_ops ar934x_nfc_ecclayout_ops = { + .ecc = ar934x_nfc_ooblayout_ecc, + .free = ar934x_nfc_ooblayout_free, +}; + +static int ar934x_nfc_setup_hwecc(struct ar934x_nfc *nfc) +{ + struct nand_chip *nand = &nfc->nand_chip; + struct mtd_info *mtd = nand_to_mtd(nand); + u32 ecc_cap; + u32 ecc_thres; + struct mtd_oob_region oobregion; + + switch (mtd->writesize) { + case 2048: + /* + * Writing a subpage separately is not supported, because + * the controller only does ECC on full-page accesses. + */ + nand->options = NAND_NO_SUBPAGE_WRITE; + + nand->ecc.size = 512; + nand->ecc.bytes = 7; + nand->ecc.strength = 4; + mtd_set_ooblayout(mtd, &ar934x_nfc_ecclayout_ops); + break; + + default: + dev_err(nfc->parent, + "hardware ECC is not available for %d byte pages\n", + mtd->writesize); + return -EINVAL; + } + + BUG_ON(!mtd->ooblayout->ecc); + + switch (nand->ecc.strength) { + case 4: + ecc_cap = AR934X_NFC_ECC_CTRL_ECC_CAP_4; + ecc_thres = 4; + break; + + default: + dev_err(nfc->parent, "unsupported ECC strength %u\n", + nand->ecc.strength); + return -EINVAL; + } + + nfc->ecc_thres = ecc_thres; + mtd->ooblayout->ecc(mtd, 0, &oobregion); + nfc->ecc_oob_pos = oobregion.offset; + + nfc->ecc_ctrl_reg = ecc_cap << AR934X_NFC_ECC_CTRL_ECC_CAP_S; + nfc->ecc_ctrl_reg |= ecc_thres << AR934X_NFC_ECC_CTRL_ERR_THRES_S; + + nfc->ecc_offset_reg = mtd->writesize + nfc->ecc_oob_pos; + + nand->ecc.read_page = ar934x_nfc_read_page; + nand->ecc.read_page_raw = ar934x_nfc_read_page_raw; + nand->ecc.write_page = ar934x_nfc_write_page; + nand->ecc.write_page_raw = ar934x_nfc_write_page_raw; + nand->ecc.read_oob = ar934x_nfc_read_oob; + nand->ecc.write_oob = ar934x_nfc_write_oob; + + return 0; +} + +static int ar934x_nfc_attach_chip(struct nand_chip *nand) +{ + struct mtd_info *mtd = nand_to_mtd(nand); + struct ar934x_nfc *nfc = nand_get_controller_data(nand); + struct device *dev = mtd->dev.parent; + int ret; + + ret = ar934x_nfc_init_tail(mtd); + if (ret) + return ret; + + if (nand->ecc.mode == NAND_ECC_HW) { + ret = ar934x_nfc_setup_hwecc(nfc); + if (ret) + return ret; + } else if (nand->ecc.mode != NAND_ECC_SOFT) { + dev_err(dev, "unknown ECC mode %d\n", nand->ecc.mode); + return -EINVAL; + } else if ((nand->ecc.algo != NAND_ECC_BCH) && + (nand->ecc.algo != NAND_ECC_HAMMING)) { + dev_err(dev, "unknown software ECC algo %d\n", nand->ecc.algo); + return -EINVAL; + } + + return 0; +} + +static u64 ar934x_nfc_dma_mask = DMA_BIT_MASK(32); + +static void ar934x_nfc_cmd_ctrl(struct mtd_info *mtd, int dat, + unsigned int ctrl) +{ + WARN_ON(dat != NAND_CMD_NONE); +} + +static const struct nand_controller_ops ar934x_nfc_controller_ops = { + .attach_chip = ar934x_nfc_attach_chip, +}; + +static int ar934x_nfc_probe(struct platform_device *pdev) +{ + struct ar934x_nfc *nfc; + struct resource *res; + struct mtd_info *mtd; + struct nand_chip *nand; + int ret; + + pdev->dev.dma_mask = &ar934x_nfc_dma_mask; + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { + dev_err(&pdev->dev, "failed to get I/O memory\n"); + return -EINVAL; + } + + nfc = devm_kzalloc(&pdev->dev, sizeof(struct ar934x_nfc), GFP_KERNEL); + if (!nfc) { + dev_err(&pdev->dev, "failed to allocate driver data\n"); + return -ENOMEM; + } + + nfc->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(nfc->base)) { + dev_err(&pdev->dev, "failed to remap I/O memory\n"); + return PTR_ERR(nfc->base); + } + + nfc->irq = platform_get_irq(pdev, 0); + if (nfc->irq < 0) { + dev_err(&pdev->dev, "no IRQ resource specified\n"); + return -EINVAL; + } + + init_waitqueue_head(&nfc->irq_waitq); + ret = devm_request_irq(&pdev->dev, nfc->irq, ar934x_nfc_irq_handler, + 0, AR934X_NFC_DRIVER_NAME, nfc); + if (ret) { + dev_err(&pdev->dev, "devm_request_irq failed, err:%d\n", ret); + return ret; + } + + nfc->rst = devm_reset_control_get(&pdev->dev, "nand"); + if (IS_ERR(nfc->rst)) { + dev_err(&pdev->dev, "Failed to get reset\n"); + return PTR_ERR(nfc->rst); + } + + nfc->parent = &pdev->dev; + nfc->swap_dma = of_property_read_bool(pdev->dev.of_node, + "qca,nand-swap-dma"); + + nand = &nfc->nand_chip; + mtd = nand_to_mtd(nand); + + mtd->owner = THIS_MODULE; + mtd->dev.parent = &pdev->dev; + mtd->name = AR934X_NFC_DRIVER_NAME; + + nand_set_controller_data(nand, nfc); + nand_set_flash_node(nand, pdev->dev.of_node); + nand->chip_delay = 25; + nand->dev_ready = ar934x_nfc_dev_ready; + nand->cmdfunc = ar934x_nfc_cmdfunc; + nand->cmd_ctrl = ar934x_nfc_cmd_ctrl; /* dummy */ + nand->read_byte = ar934x_nfc_read_byte; + nand->write_buf = ar934x_nfc_write_buf; + nand->read_buf = ar934x_nfc_read_buf; + nand->ecc.mode = NAND_ECC_HW; /* default */ + platform_set_drvdata(pdev, nfc); + + ret = ar934x_nfc_alloc_buf(nfc, AR934X_NFC_ID_BUF_SIZE); + if (ret) + return ret; + + ret = ar934x_nfc_hw_init(nfc); + if (ret) { + dev_err(&pdev->dev, "hardware init failed, err:%d\n", ret); + goto err_free_buf; + } + + nand->dummy_controller.ops = &ar934x_nfc_controller_ops; + ret = nand_scan(mtd, 1); + if (ret) { + dev_err(&pdev->dev, "nand_scan failed, err:%d\n", ret); + goto err_free_buf; + } + + ret = mtd_device_register(mtd, NULL, 0); + if (ret) { + dev_err(&pdev->dev, "unable to register mtd, err:%d\n", ret); + goto err_free_buf; + } + + return 0; + +err_free_buf: + ar934x_nfc_free_buf(nfc); + return ret; +} + +static int ar934x_nfc_remove(struct platform_device *pdev) +{ + struct ar934x_nfc *nfc; + struct mtd_info *mtd; + + nfc = platform_get_drvdata(pdev); + if (nfc) { + mtd = ar934x_nfc_to_mtd(nfc); + nand_release(mtd); + ar934x_nfc_free_buf(nfc); + } + + return 0; +} + +static const struct of_device_id ar934x_nfc_match[] = { + { .compatible = "qca," AR934X_NFC_DRIVER_NAME }, + {}, +}; + +MODULE_DEVICE_TABLE(of, ar934x_nfc_match); + +static struct platform_driver ar934x_nfc_driver = { + .probe = ar934x_nfc_probe, + .remove = ar934x_nfc_remove, + .driver = { + .name = AR934X_NFC_DRIVER_NAME, + .owner = THIS_MODULE, + .of_match_table = ar934x_nfc_match, + }, +}; + +module_platform_driver(ar934x_nfc_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gabor Juhos "); +MODULE_DESCRIPTION("Atheros AR934x NAND Flash Controller driver"); +MODULE_ALIAS("platform:" AR934X_NFC_DRIVER_NAME); diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c index 6f37fda38..2cd7b1be8 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c @@ -13,30 +13,6 @@ #include "ag71xx.h" -static int ag71xx_ethtool_get_settings(struct net_device *dev, - struct ethtool_cmd *cmd) -{ - struct ag71xx *ag = netdev_priv(dev); - struct phy_device *phydev = ag->phy_dev; - - if (!phydev) - return -ENODEV; - - return phy_ethtool_ioctl(phydev, cmd); -} - -static int ag71xx_ethtool_set_settings(struct net_device *dev, - struct ethtool_cmd *cmd) -{ - struct ag71xx *ag = netdev_priv(dev); - struct phy_device *phydev = ag->phy_dev; - - if (!phydev) - return -ENODEV; - - return phy_ethtool_ioctl(phydev, cmd); -} - static u32 ag71xx_ethtool_get_msglevel(struct net_device *dev) { struct ag71xx *ag = netdev_priv(dev); @@ -108,13 +84,25 @@ static int ag71xx_ethtool_set_ringparam(struct net_device *dev, return err; } +static int ag71xx_ethtool_nway_reset(struct net_device *dev) +{ + struct ag71xx *ag = netdev_priv(dev); + struct phy_device *phydev = ag->phy_dev; + + if (!phydev) + return -ENODEV; + + return genphy_restart_aneg(phydev); +} + struct ethtool_ops ag71xx_ethtool_ops = { - .set_settings = ag71xx_ethtool_set_settings, - .get_settings = ag71xx_ethtool_get_settings, .get_msglevel = ag71xx_ethtool_get_msglevel, .set_msglevel = ag71xx_ethtool_set_msglevel, .get_ringparam = ag71xx_ethtool_get_ringparam, .set_ringparam = ag71xx_ethtool_set_ringparam, + .get_link_ksettings = phy_ethtool_get_link_ksettings, + .set_link_ksettings = phy_ethtool_set_link_ksettings, .get_link = ethtool_op_get_link, .get_ts_info = ethtool_op_get_ts_info, + .nway_reset = ag71xx_ethtool_nway_reset, }; diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 8cff56a11..0924b81b9 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -130,7 +130,7 @@ static void ag71xx_ring_tx_init(struct ag71xx *ag) { struct ag71xx_ring *ring = &ag->tx_ring; int ring_size = BIT(ring->order); - int ring_mask = ring_size - 1; + int ring_mask = BIT(ring->order) - 1; int i; for (i = 0; i < ring_size; i++) { @@ -277,14 +277,14 @@ static int ag71xx_rings_init(struct ag71xx *ag) return -ENOMEM; tx->descs_cpu = dma_alloc_coherent(&ag->pdev->dev, ring_size * AG71XX_DESC_SIZE, - &tx->descs_dma, GFP_ATOMIC); + &tx->descs_dma, GFP_KERNEL); if (!tx->descs_cpu) { kfree(tx->buf); tx->buf = NULL; return -ENOMEM; } - rx->buf = &tx->buf[BIT(tx->order)]; + rx->buf = &tx->buf[tx_size]; rx->descs_cpu = ((void *)tx->descs_cpu) + tx_size * AG71XX_DESC_SIZE; rx->descs_dma = tx->descs_dma + tx_size * AG71XX_DESC_SIZE; @@ -581,6 +581,7 @@ static void ath79_mii0_ctrl_set_if(struct ag71xx *ag) mii_if = AR71XX_MII0_CTRL_IF_GMII; break; case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: mii_if = AR71XX_MII0_CTRL_IF_RGMII; break; case PHY_INTERFACE_MODE_RMII: @@ -603,6 +604,7 @@ static void ath79_mii1_ctrl_set_if(struct ag71xx *ag) mii_if = AR71XX_MII1_CTRL_IF_RMII; break; case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: mii_if = AR71XX_MII1_CTRL_IF_RGMII; break; default: @@ -763,10 +765,6 @@ static int ag71xx_hw_enable(struct ag71xx *ag) static void ag71xx_hw_disable(struct ag71xx *ag) { - unsigned long flags; - - spin_lock_irqsave(&ag->lock, flags); - netif_stop_queue(ag->dev); ag71xx_hw_stop(ag); @@ -775,8 +773,6 @@ static void ag71xx_hw_disable(struct ag71xx *ag) napi_disable(&ag->napi); del_timer_sync(&ag->oom_timer); - spin_unlock_irqrestore(&ag->lock, flags); - ag71xx_rings_cleanup(ag); } @@ -946,18 +942,9 @@ err_drop: static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct ag71xx *ag = netdev_priv(dev); - int ret; + switch (cmd) { - case SIOCETHTOOL: - if (ag->phy_dev == NULL) - break; - - spin_lock_irq(&ag->lock); - ret = phy_ethtool_ioctl(ag->phy_dev, (void *) ifr->ifr_data); - spin_unlock_irq(&ag->lock); - return ret; - case SIOCSIFHWADDR: if (copy_from_user (dev->dev_addr, ifr->ifr_data, sizeof(dev->dev_addr))) diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c index f9df38d53..ac1af2686 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c @@ -75,8 +75,8 @@ int ag71xx_phy_connect(struct ag71xx *ag) if (!ag->phy_dev) { dev_err(&ag->pdev->dev, - "Could not connect to PHY device\n"); - return -ENODEV; + "Could not connect to PHY device. Deferring probe.\n"); + return -EPROBE_DEFER; } dev_info(&ag->pdev->dev, "connected to PHY at %s [uid=%08x, driver=%s]\n", diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds similarity index 59% rename from target/linux/ath79/base-files/etc/board.d/01_leds rename to target/linux/ath79/generic/base-files/etc/board.d/01_leds index af26425da..5561677ec 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -8,6 +8,13 @@ board=$(board_name) boardname="${board##*,}" case "$board" in +8dev,carambola2) + ucidef_set_led_netdev "lan" "LAN" "$boardname:orange:eth0" "eth0" + ucidef_set_led_switch "wan" "WAN" "$boardname:orange:eth1" "switch0" "0x04" + ;; +alfa-network,ap121f) + ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" + ;; avm,fritz300e) ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" ucidef_set_rssimon "wlan0" "200000" "1" @@ -18,18 +25,11 @@ avm,fritz300e) ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi4" "wlan0" "80" "100" ;; avm,fritz4020) - ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x1E" ;; -buffalo,whr-g301n) - ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" - ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x02" - ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x04" - ucidef_set_led_switch "lan3" "LAN3" "$boardname:green:lan3" "switch0" "0x08" - ucidef_set_led_switch "lan4" "LAN4" "$boardname:green:lan4" "switch0" "0x10" - ;; comfast,cf-e110n-v2) - ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" + ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1" ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x02" ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt" ucidef_set_rssimon "wlan0" "200000" "1" @@ -39,7 +39,7 @@ comfast,cf-e110n-v2) ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100" ;; comfast,cf-e120a-v3) - ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" + ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1" ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x04" ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100" @@ -47,45 +47,73 @@ comfast,cf-e120a-v3) ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100" ;; +comfast,cf-e313ac) + ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x02" + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100" + ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100" + ;; +comfast,cf-e314n-v2) + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" + ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100" + ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100" + ;; comfast,cf-e5) ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x02" - ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth0" + ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth1" ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:blue:rssi0" "wlan0" "1" "100" ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:blue:rssi1" "wlan0" "33" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:blue:rssi2" "wlan0" "66" "100" ;; +dlink,dir-842-c1|\ +dlink,dir-842-c2|\ +dlink,dir-842-c3|\ dlink,dir-859-a1) ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20" ;; +engenius,ecb1750) + ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0" + ;; engenius,ews511ap) - ucidef_set_led_netdev "lan1" "LAN1" "$boardname:blue:lan1" "eth0" - ucidef_set_led_netdev "lan2" "LAN2" "$boardname:blue:lan2" "eth1" + ucidef_set_led_netdev "lan1" "LAN1" "$boardname:blue:lan1" "eth1" + ucidef_set_led_netdev "lan2" "LAN2" "$boardname:blue:lan2" "eth0" ;; etactica,eg200) ucidef_set_led_netdev "lan" "LAN" "$boardname:red:eth0" "eth0" ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" "33" - ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" "ignore" ;; glinet,gl-ar150) - ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x02" ;; -glinet,gl-ar300m-nand|\ -glinet,gl-ar300m-nor) - ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth1" - ;; glinet,gl-ar300m-lite) ucidef_set_led_netdev "lan" "LAN" "gl-ar300m-lite:green:lan" "eth0" ;; -glinet,gl-x750) - ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" +glinet,gl-ar300m16) + ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0" ;; -netgear,wnr612-v2|\ -on,n150r) - ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0" - ucidef_set_led_switch "lan1" "LAN1" "netgear:green:lan1" "switch0" "0x02" "0x0f" - ucidef_set_led_switch "lan2" "LAN2" "netgear:green:lan2" "switch0" "0x04" "0x0f" +glinet,gl-x750) + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" + ;; +netgear,wnr2200-8m|\ +netgear,wnr2200-16m) + ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0" + ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" "switch0" "0x02" "0x04" + ucidef_set_led_switch "lan2green" "LAN2 (green)" "netgear:green:lan2" "switch0" "0x04" "0x04" + ucidef_set_led_switch "lan3green" "LAN3 (green)" "netgear:green:lan3" "switch0" "0x08" "0x04" + ucidef_set_led_switch "lan4green" "LAN4 (green)" "netgear:green:lan4" "switch0" "0x10" "0x04" + ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" "switch0" "0x02" "0x02" + ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" "switch0" "0x04" "0x02" + ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" "switch0" "0x08" "0x02" + ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" "switch0" "0x10" "0x02" ;; pcs,cap324) ucidef_set_led_netdev "lan" "LAN" "pcs:lan:green" "eth0" @@ -97,6 +125,9 @@ pcs,cr3000) ucidef_set_led_switch "lan3" "LAN3" "pcs:blue:lan3" "switch0" "0x10" ucidef_set_led_switch "lan4" "LAN4" "pcs:blue:lan4" "switch0" "0x02" ;; +qihoo,c301) + ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt" + ;; tplink,archer-a7-v5|\ tplink,archer-c7-v4|\ tplink,archer-c7-v5) @@ -107,22 +138,55 @@ tplink,archer-c7-v5) ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x20" ;; tplink,archer-c2-v3|\ -tplink,tl-wr1043nd-v4) +tplink,tl-wr1043nd-v4|\ +tplink,tl-wr1043n-v5) ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x20" ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04" ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" ;; -tplink,archer-c58-v1|\ -tplink,archer-c59-v1) - ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x1E" - ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0" - ;; -tplink,archer-c6-v2) +tplink,archer-c6-v2|\ +tplink,archer-c6-v2-us) ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x3C" ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x02" ;; +tplink,archer-c25-v1|\ +tplink,tl-wr842n-v3) + ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04" + ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" + ;; +tplink,archer-c58-v1|\ +tplink,archer-c59-v1|\ +tplink,archer-c59-v2|\ +tplink,archer-c60-v1|\ +tplink,archer-c60-v2) + ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x1E" + ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" + ;; +tplink,archer-d50-v1) + ucidef_set_led_switch "lan" "LAN" "tp-link:white:lan" "switch0" "0x1c" + ucidef_set_led_switch "wan_data" "WAN Data" "tp-link:white:internet" "switch0" "0x02" "" "tx rx" + ucidef_set_led_switch "wan_link" "WAN Link" "tp-link:white:wan" "switch0" "0x02" "" "link" + ;; +tplink,cpe210-v1|\ +tplink,cpe220-v2|\ +tplink,cpe220-v3|\ +tplink,cpe510-v1|\ +tplink,wbs210-v2|\ +tplink,wbs510-v1|\ +tplink,wbs510-v2) + ucidef_set_led_netdev "lan0" "LAN0" "tp-link:green:lan0" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "30" "100" + ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100" + ;; tplink,cpe210-v2|\ tplink,cpe210-v3) ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" @@ -132,43 +196,33 @@ tplink,cpe210-v3) ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100" ;; +tplink,cpe510-v2|\ +tplink,cpe510-v3) + ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13" + ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13" + ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13" + ;; +tplink,cpe610-v1) + ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" + ;; +tplink,re355-v1|\ +tplink,re450-v1|\ tplink,re450-v2) ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx" ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link" ;; -tplink,tl-mr3020-v1|\ -tplink,tl-mr3040-v2) - ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" - ;; -tplink,tl-wr740n-v1|\ -tplink,tl-wr740n-v3|\ -tplink,tl-wr741-v1|\ -tplink,tl-wr743nd-v1|\ -tplink,tl-wr841-v5|\ -tplink,tl-wr941-v4) - ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0" - ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02" - ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04" - ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08" - ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10" - ;; -tplink,tl-wr740n-v4|\ -tplink,tl-wr741nd-v4|\ -tplink,tl-wr841-v8|\ tplink,tl-wr842n-v2) - ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0" + ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04" ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10" ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" ;; -tplink,tl-wr841-v9|\ -tplink,tl-wr841-v11) - ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0" - ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" - ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" - ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04" - ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" +trendnet,tew-823dru) + ucidef_set_led_netdev "wan" "WAN" "trendnet:green:planet" "eth0" ;; ubnt,bullet-m|\ ubnt,bullet-m-xw|\ @@ -197,9 +251,13 @@ wd,mynet-wifi-rangeextender) ucidef_set_led_rssi "rssihigh" "RSSIMAX" "$boardname:blue:rssi-max" "wlan0" "66" "100" ;; yuncore,a770) - ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x10" ;; +zbtlink,zbt-wd323) + ucidef_set_led_switch "lan1" "LAN1" "zbt-wd323:orange:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "zbt-wd323:orange:lan2" "switch0" "0x08" + ;; esac board_config_flush diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network similarity index 63% rename from target/linux/ath79/base-files/etc/board.d/02_network rename to target/linux/ath79/generic/base-files/etc/board.d/02_network index 2f4fb62a5..e811f85f0 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -9,27 +9,34 @@ ath79_setup_interfaces() local board="$1" case "$board" in + adtran,bsap1800-v2|\ + adtran,bsap1840|\ + alfa-network,ap121f|\ + aruba,ap-105|\ avm,fritz300e|\ devolo,dvl1200i|\ devolo,dvl1750c|\ devolo,dvl1750i|\ - glinet,ar300m-lite|\ + devolo,dvl1750x|\ + engenius,ecb1750|\ + glinet,gl-ar300m-lite|\ netgear,ex6400|\ netgear,ex7300|\ ocedo,koala|\ ocedo,raccoon|\ pcs,cap324|\ + pisen,ts-d084|\ + pisen,wmb001n|\ pisen,wmm003n|\ - pqi,air-pen|\ tplink,cpe210-v2|\ tplink,cpe210-v3|\ + tplink,cpe510-v2|\ + tplink,cpe510-v3|\ + tplink,cpe610-v1|\ tplink,re350k-v1|\ + tplink,re355-v1|\ + tplink,re450-v1|\ tplink,re450-v2|\ - tplink,tl-mr10u|\ - tplink,tl-mr3020-v1|\ - tplink,tl-mr3040-v2|\ - tplink,tl-wa901nd-v2|\ - tplink,tl-wr703n|\ ubnt,bullet-m|\ ubnt,bullet-m-xw|\ ubnt,lap-120|\ @@ -37,6 +44,7 @@ ath79_setup_interfaces() ubnt,nanostation-ac-loco|\ ubnt,rocket-m|\ ubnt,unifiac-lite|\ + ubnt,unifiac-lr|\ ubnt,unifiac-mesh|\ ubnt,unifi|\ wd,mynet-wifi-rangeextender|\ @@ -46,21 +54,28 @@ ath79_setup_interfaces() avm,fritz4020|\ pcs,cr3000|\ tplink,archer-c58-v1|\ - tplink,archer-c59-v1) - ucidef_set_interface_wan "eth0" + tplink,archer-c59-v1|\ + tplink,archer-c59-v2) + ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ - "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2" + "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2" ;; buffalo,bhr-4grv|\ buffalo,wzr-hp-g450h) ucidef_add_switch "switch0" \ "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" ;; - buffalo,bhr-4grv2) + buffalo,bhr-4grv2|\ + trendnet,tew-823dru) ucidef_add_switch "switch0" \ "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth0" ;; - buffalo,wzr-hp-ag300h) + buffalo,wzr-hp-ag300h|\ + tplink,archer-c25-v1|\ + tplink,tl-wdr3500-v1|\ + tplink,tl-wr842n-v1|\ + tplink,tl-wr842n-v3|\ + ubnt,airrouter) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" @@ -69,17 +84,25 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:1" "3:lan:4" "4:lan:3" "5:lan:2" "2:wan" ;; - comfast,cf-e5|\ - glinet,gl-ar150|\ - glinet,gl-ar300m-nand|\ - glinet,gl-ar300m-nor|\ - glinet,gl-x750|\ - tplink,tl-wr810n-v1|\ - tplink,tl-wr810n-v2|\ - ubnt,routerstation|\ - yuncore,a770) + comfast,cf-e110n-v2|\ + comfast,cf-e120a-v3|\ + comfast,cf-e314n-v2|\ + tplink,cpe210-v1|\ + tplink,cpe220-v2|\ + tplink,cpe220-v3|\ + tplink,cpe510-v1|\ + tplink,wbs210-v2|\ + tplink,wbs510-v1|\ + tplink,wbs510-v2|\ + ubnt,nanostation-m|\ + ubnt,routerstation) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; + comfast,cf-wr650ac-v1|\ + comfast,cf-wr650ac-v2) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1" + ;; devolo,dvl1200e|\ devolo,dvl1750e|\ ocedo,ursus) @@ -92,10 +115,14 @@ ath79_setup_interfaces() ;; dlink,dir-825-c1|\ dlink,dir-835-a1|\ + dlink,dir-842-c1|\ + dlink,dir-842-c2|\ + dlink,dir-842-c3|\ dlink,dir-859-a1|\ engenius,epg5000|\ tplink,archer-c2-v3|\ - tplink,tl-wr1043nd-v4) + tplink,tl-wr1043nd-v4|\ + tplink,tl-wr1043n-v5) ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" ;; @@ -114,27 +141,32 @@ ath79_setup_interfaces() etactica,eg200) ucidef_set_interface_lan "eth0" "dhcp" ;; - glinet,gl-ar750s) + glinet,gl-ar750) + ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ - "0@eth0" "2:lan:2" "3:lan:1" "1:wan" + "0@eth0" "1:lan" "2:lan" ;; iodata,etg3-r|\ iodata,wn-ac1167dgr|\ iodata,wn-ac1600dgr|\ iodata,wn-ac1600dgr2|\ iodata,wn-ag300dgr|\ - pcs,cr5000) + pcs,cr5000|\ + sitecom,wlr-7100|\ + wd,mynet-n750) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" - ;; + ;; librerouter,librerouter-v1) ucidef_add_switch "switch0" \ "0@eth0" "5:wan" "6@eth1" "4:lan" - ;; + ;; nec,wg1200cr|\ ubnt,nanostation-ac|\ ubnt,unifiac-mesh-pro|\ - ubnt,unifiac-pro) + ubnt,unifiac-pro|\ + yuncore,a782|\ + yuncore,xd4200) ucidef_add_switch "switch0" \ "0@eth0" "2:lan" "3:wan" ;; @@ -144,8 +176,9 @@ ath79_setup_interfaces() ;; netgear,wndr3700|\ netgear,wndr3700v2|\ - netgear,wndr3800) - ucidef_set_interfaces_lan_wan "eth0" "eth1" + netgear,wndr3800|\ + netgear,wndr3800ch) + ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0" ucidef_add_switch_attr "switch0" "blinkrate" 2 @@ -153,21 +186,35 @@ ath79_setup_interfaces() ucidef_add_switch_port_attr "switch0" 2 led 9 ucidef_add_switch_port_attr "switch0" 5 led 2 ;; - netgear,wnr612-v2|\ - on,n150r|\ - tplink,tl-wr841-v7) + netgear,wnr2200-8m|\ + netgear,wnr2200-16m) ucidef_set_interface_wan "eth0" ucidef_add_switch "switch0" \ - "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" + "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" ;; phicomm,k2t) ucidef_add_switch "switch0" \ "0@eth0" "3:lan:1" "5:lan:2" "4:wan" ;; + qihoo,c301) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan" "3:lan" + ;; rosinson,wr818) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:wan" ;; + tplink,archer-a7-v5|\ + tplink,archer-c6-v2|\ + tplink,archer-c6-v2-us|\ + tplink,archer-c7-v4|\ + tplink,archer-c7-v5|\ + tplink,tl-wdr3600-v1|\ + tplink,tl-wdr4300-v1) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" + ;; tplink,archer-c5-v1|\ tplink,archer-c7-v1|\ tplink,archer-c7-v2|\ @@ -175,32 +222,28 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan" ;; - buffalo,whr-g301n|\ - tplink,tl-mr3220-v1|\ - tplink,tl-mr3420-v1|\ - tplink,tl-wr841-v9|\ - tplink,tl-wr841-v11|\ - ubnt,airrouter) - ucidef_set_interface_wan "eth0" + tplink,archer-c60-v1|\ + tplink,archer-c60-v2) + ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ - "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" + "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" ;; - tplink,archer-a7-v5|\ - tplink,archer-c6-v2|\ - tplink,archer-c7-v4|\ - tplink,archer-c7-v5|\ - tplink,tl-wdr3600|\ - tplink,tl-wdr4300|\ - tplink,tl-wr941n-v7-cn) + tplink,archer-d50-v1) ucidef_add_switch "switch0" \ - "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" + "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "1:wan" + ;; + tplink,tl-wr842n-v2) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ;; tplink,tl-wr1043nd-v1) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" ;; tplink,tl-wr1043nd-v2|\ - tplink,tl-wr1043nd-v3) + tplink,tl-wr1043nd-v3|\ + tplink,tl-wr1045nd-v2) ucidef_add_switch "switch0" \ "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0" ;; @@ -208,37 +251,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0" ;; - tplink,tl-wr740n-v1|\ - tplink,tl-wr740n-v3|\ - tplink,tl-wr741-v1|\ - tplink,tl-wr743nd-v1|\ - tplink,tl-wr841-v5|\ - tplink,tl-wr941-v4) - ucidef_set_interface_wan "eth0" - ucidef_add_switch "switch0" \ - "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" - ;; - tplink,tl-wr710n-v1) - ucidef_set_interface_wan "eth0" - ucidef_add_switch "switch0" \ - "0@eth1" "3:lan" - ;; - tplink,tl-wr740n-v4|\ - tplink,tl-wr741nd-v4|\ - tplink,tl-wr841-v8|\ - tplink,tl-wr842n-v1|\ - tplink,tl-wr842n-v2) - ucidef_set_interface_wan "eth0" - ucidef_add_switch "switch0" \ - "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" - ;; - tplink,tl-wr941-v2) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" - ;; ubnt,acb-isp) - ucidef_set_interface_wan "eth0" + ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ - "0@eth1" "2:lan:1" "3:lan:3" "4:lan:2" + "0@eth0" "2:lan:1" "3:lan:3" "4:lan:2" ;; ubnt,routerstation-pro) ucidef_set_interface_wan "eth0" @@ -249,10 +265,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "5:lan" "1:wan" ;; + zbtlink,zbt-wd323|\ xiaomi,mi-router-4q) - ucidef_set_interface_wan "eth0" + ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ - "0@eth1" "3:lan:1" "4:lan:2" + "0@eth0" "3:lan:1" "4:lan:2" ;; *) ucidef_set_interfaces_lan_wan "eth0" "eth1" @@ -265,41 +282,64 @@ ath79_setup_macs() local board="$1" case "$board" in + adtran,bsap1800-v2|\ + adtran,bsap1840) + lan_mac=$(mtd_get_mac_binary "Board data" 2) + label_mac=$lan_mac + ;; + alfa-network,ap121f|\ + ubnt,airrouter|\ + ubnt,bullet-m|\ + ubnt,nanostation-m|\ + ubnt,rocket-m|\ + ubnt,unifi) + label_mac=$(mtd_get_mac_binary art 0x1002) + ;; avm,fritz300e) lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) + label_mac=$(fritz_tffs -n macwlan -i $(find_mtd_part "tffs (1)")) ;; avm,fritz4020) lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) wan_mac=$(fritz_tffs -n macb -i $(find_mtd_part "tffs (1)")) ;; dlink,dir-825-b1) - lan_mac=$(mtd_get_mac_text "caldata" 65440) - wan_mac=$(mtd_get_mac_text "caldata" 65460) + lan_mac=$(mtd_get_mac_text "caldata" 0xffa0) + wan_mac=$(mtd_get_mac_text "caldata" 0xffb4) ;; dlink,dir-825-c1|\ dlink,dir-835-a1) - lan_mac=$(mtd_get_mac_text "mac" 4) - wan_mac=$(mtd_get_mac_text "mac" 24) + lan_mac=$(mtd_get_mac_text "mac" 0x4) + wan_mac=$(mtd_get_mac_text "mac" 0x18) + ;; + dlink,dir-842-c1|\ + dlink,dir-842-c2|\ + dlink,dir-842-c3|\ + nec,wg1200cr) + lan_mac=$(mtd_get_mac_ascii devdata "lanmac") + wan_mac=$(mtd_get_mac_ascii devdata "wanmac") + label_mac=$lan_mac ;; dlink,dir-859-a1|\ - nec,wg1200cr) + qihoo,c301|\ + wd,mynet-n750) lan_mac=$(mtd_get_mac_ascii devdata "lanmac") wan_mac=$(mtd_get_mac_ascii devdata "wanmac") ;; elecom,wrc-1750ghbk2-i|\ elecom,wrc-300ghbk2-i) - wan_mac=$(macaddr_add "$(mtd_get_mac_binary ART 4098)" -2) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" -2) ;; - engenius,epg5000|\ - iodata,wn-ac1167dgr|\ - iodata,wn-ac1600dgr|\ - iodata,wn-ac1600dgr2|\ - iodata,wn-ag300dgr) + engenius,ecb1750) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + label_mac=$(mtd_get_mac_ascii u-boot-env athaddr) + ;; + engenius,epg5000) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) ;; engenius,ews511ap) - lan_mac=$(mtd_get_mac_text "u-boot-env" 233) + lan_mac=$(mtd_get_mac_text "u-boot-env" 0xe9) eth1_mac=$(macaddr_add "$lan_mac" 1) ucidef_set_interface "eth0" ifname "eth0" protocol "none" macaddr "$lan_mac" ucidef_set_interface "eth1" ifname "eth1" protocol "none" macaddr "$eth1_mac" @@ -307,45 +347,55 @@ ath79_setup_macs() iodata,etg3-r) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" -1) + label_mac=$wan_mac + ;; + iodata,wn-ac1167dgr|\ + iodata,wn-ac1600dgr|\ + iodata,wn-ac1600dgr2|\ + iodata,wn-ag300dgr) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) + label_mac=$wan_mac ;; jjplus,ja76pf2) wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n alias/ethaddr) lan_mac=$(macaddr_add "$wan_mac" 1) ;; nec,wg800hp) - lan_mac=$(mtd_get_mac_text board_data 640) - wan_mac=$(mtd_get_mac_text board_data 1152) + lan_mac=$(mtd_get_mac_text board_data 0x280) + wan_mac=$(mtd_get_mac_text board_data 0x480) + label_mac=$wan_mac ;; netgear,wndr3700|\ netgear,wndr3700v2|\ netgear,wndr3800) - lan_mac=$(macaddr_setbit_la "$(mtd_get_mac_binary art 0)") + lan_mac=$(macaddr_setbit_la "$(mtd_get_mac_binary art 0x0)") ;; phicomm,k2t) lan_mac=$(k2t_get_mac "lan_mac") wan_mac=$(k2t_get_mac "wan_mac") ;; rosinson,wr818) - wan_mac=$(mtd_get_mac_binary factory 0) + wan_mac=$(mtd_get_mac_binary factory 0x0) lan_mac=$(macaddr_setbit_la "$wan_mac") ;; + sitecom,wlr-7100) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) + label_mac=$lan_mac + ;; tplink,archer-a7-v5|\ - tplink,archer-c7-v5) - base_mac=$(mtd_get_mac_binary info 8) + tplink,archer-c7-v4|\ + tplink,archer-c7-v5|\ + tplink,tl-wr1043nd-v4|\ + tplink,tl-wr1043n-v5) + base_mac=$(mtd_get_mac_binary info 0x8) wan_mac=$(macaddr_add "$base_mac" 1) ;; - tplink,archer-c7-v4) - base_mac=$(mtd_get_mac_binary config 8) - wan_mac=$(macaddr_add "$base_mac" 1) - ;; - tplink,tl-wr1043nd-v4) - base_mac=$(mtd_get_mac_binary product-info 8) - wan_mac=$(macaddr_add "$base_mac" 1) - ;; - tplink,tl-wr941-v2|\ - tplink,tl-wr941n-v7-cn) - base_mac=$(mtd_get_mac_binary u-boot 130048) - wan_mac=$(macaddr_add "$base_mac" 1) + trendnet,tew-823dru) + lan_mac=$(mtd_get_mac_text mac 0x4) + wan_mac=$(mtd_get_mac_text mac 0x18) + label_mac=$wan_mac ;; ubnt,routerstation|\ ubnt,routerstation-pro) @@ -359,6 +409,7 @@ ath79_setup_macs() [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac } board_config_update diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches new file mode 100755 index 000000000..967e2c768 --- /dev/null +++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches @@ -0,0 +1,76 @@ +#!/bin/sh +# +# Copyright (C) 2018 OpenWrt.org +# + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) + +case "$board" in +adtran,bsap1800-v2|\ +adtran,bsap1840) + ucidef_add_gpio_switch "wifi1_ext_a" "5GHz External Antenna A" "489" "1" + ucidef_add_gpio_switch "wifi1_int_a" "5GHz Internal Antenna A" "493" + ucidef_add_gpio_switch "wifi1_ext_b" "5GHz External Antenna B" "494" "1" + ucidef_add_gpio_switch "wifi1_int_b" "5GHz Internal Antenna B" "495" + ucidef_add_gpio_switch "wifi1_ext_c" "5GHz External Antenna C" "496" "1" + ucidef_add_gpio_switch "wifi1_int_c" "5GHz Internal Antenna C" "497" + ucidef_add_gpio_switch "wifi0_ext_a" "2.4GHz External Antenna A" "505" "1" + ucidef_add_gpio_switch "wifi0_int_a" "2.4GHz Internal Antenna A" "506" + ucidef_add_gpio_switch "wifi0_ext_b" "2.4GHz External Antenna B" "507" "1" + ucidef_add_gpio_switch "wifi0_int_b" "2.4GHz Internal Antenna B" "508" + ucidef_add_gpio_switch "wifi0_ext_c" "2.4GHz External Antenna C" "509" "1" + ucidef_add_gpio_switch "wifi0_int_c" "2.4GHz Internal Antenna C" "510" + ;; +comfast,cf-e5) + ucidef_add_gpio_switch "lte_power" "LTE Power" "14" "1" + ucidef_add_gpio_switch "lte_wakeup" "LTE Wakeup" "11" "1" + ucidef_add_gpio_switch "lte_poweroff" "LTE Poweroff" "1" "1" + ucidef_add_gpio_switch "lte_reset" "LTE Reset" "12" "1" + ;; +dlink,dir-825-c1|\ +dlink,dir-835-a1) + ucidef_add_gpio_switch "wan_led_auto" "WAN LED Auto" "20" "0" + ;; +librerouter,librerouter-v1) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "1" "0" + ;; +tplink,archer-c25-v1) + ucidef_add_gpio_switch "led_control" "LED control" "21" "0" + ucidef_add_gpio_switch "led_reset" "LED reset" "19" "1" + ;; +tplink,cpe210-v1|\ +tplink,cpe220-v2|\ +tplink,cpe220-v3|\ +tplink,cpe510-v1|\ +tplink,wbs210-v2|\ +tplink,wbs510-v1|\ +tplink,wbs510-v2) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20" + ;; +ubnt,nanostation-ac) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3" + ;; +ubnt,nanostation-m) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8" + ;; +ubnt,nanostation-m-xw) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2" + ;; +ubnt,acb-isp) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" + ;; +zbtlink,zbt-wd323) + ucidef_add_gpio_switch "io0" "IO#0" "0" + ucidef_add_gpio_switch "io1" "IO#1" "1" + ucidef_add_gpio_switch "io2" "IO#2" "2" + ucidef_add_gpio_switch "io14" "IO#14" "14" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom new file mode 100644 index 000000000..f04fb64fc --- /dev/null +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -0,0 +1,142 @@ +#!/bin/sh + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 + +. /lib/functions/caldata.sh + +board=$(board_name) + +case "$FIRMWARE" in +"ath9k-eeprom-ahb-18100000.wmac.bin") + case $board in + avm,fritz4020) + caldata_extract_reverse "urlader" 0x1541 0x440 + ;; + dlink,dir-825-c1|\ + dlink,dir-835-a1) + caldata_extract "art" 0x1000 0x440 + ath9k_patch_mac $(mtd_get_mac_text "mac" 0x4) + ;; + dlink,dir-842-c1|\ + dlink,dir-842-c2|\ + dlink,dir-842-c3|\ + dlink,dir-859-a1|\ + nec,wg1200cr|\ + wd,mynet-n750) + caldata_extract "art" 0x1000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac") + ;; + engenius,ecb1750) + caldata_extract "art" 0x1000 0x440 + ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env "athaddr") +1) + ;; + engenius,epg5000|\ + iodata,wn-ac1167dgr|\ + iodata,wn-ac1600dgr|\ + iodata,wn-ac1600dgr2|\ + iodata,wn-ag300dgr|\ + sitecom,wlr-7100) + caldata_extract "art" 0x1000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr) + ;; + nec,wg800hp) + caldata_extract "art" 0x1000 0x440 + ath9k_patch_mac $(mtd_get_mac_text board_data 0x680) + ;; + qihoo,c301) + caldata_extract "radiocfg" 0x1000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac") + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; +"ath9k-eeprom-pci-0000:00:00.0.bin") + case $board in + avm,fritz300e) + caldata_extract_reverse "urloader" 0x1541 0x440 + ;; + buffalo,wzr-hp-g302h-a1a0) + caldata_extract "art" 0x1000 0xeb8 + ;; + buffalo,wzr-hp-g450h) + caldata_extract "art" 0x1000 0x440 + ;; + dlink,dir-825-c1|\ + dlink,dir-835-a1) + caldata_extract "art" 0x5000 0x440 + ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1) + ;; + ocedo,raccoon|\ + tplink,tl-wdr3500-v1|\ + tplink,tl-wdr3600-v1|\ + tplink,tl-wdr4300-v1|\ + tplink,tl-wdr4900-v2|\ + winchannel,wb2000) + caldata_extract "art" 0x5000 0x440 + ;; + netgear,wnr2200-8m|\ + netgear,wnr2200-16m|\ + pcs,cap324|\ + tplink,tl-wr2543-v1|\ + tplink,tl-wr842n-v1|\ + ubnt,airrouter|\ + ubnt,bullet-m|\ + ubnt,nanostation-m|\ + ubnt,rocket-m) + caldata_extract "art" 0x1000 0x1000 + ;; + ubnt,unifi) + caldata_extract "art" 0x1000 0x800 + ;; + wd,mynet-n750) + caldata_extract "art" 0x5000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac") + ;; + wd,mynet-wifi-rangeextender) + caldata_extract "art" 0x1000 0x1000 + ath9k_patch_mac $(nvram get wl0_hwaddr) + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; +"ath9k-eeprom-pci-0000:00:11.0.bin") + case $board in + buffalo,wzr-hp-ag300h|\ + netgear,wndr3700|\ + netgear,wndr3700v2|\ + netgear,wndr3800|\ + netgear,wndr3800ch) + caldata_extract "art" 0x1000 0xeb8 + ;; + dlink,dir-825-b1) + caldata_extract "caldata" 0x1000 0xeb8 + ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; +"ath9k-eeprom-pci-0000:00:12.0.bin") + case $board in + buffalo,wzr-hp-ag300h|\ + netgear,wndr3700|\ + netgear,wndr3700v2|\ + netgear,wndr3800|\ + netgear,wndr3800ch) + caldata_extract "art" 0x5000 0xeb8 + ;; + dlink,dir-825-b1) + caldata_extract "caldata" 0x5000 0xeb8 + ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; +esac diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata new file mode 100644 index 000000000..062caf6ad --- /dev/null +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -0,0 +1,167 @@ +#!/bin/sh + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 + +. /lib/functions/caldata.sh +. /lib/functions/k2t.sh + +board=$(board_name) + +case "$FIRMWARE" in +"ath10k/cal-pci-0000:00:00.0.bin") + case $board in + comfast,cf-wr650ac-v1|\ + comfast,cf-wr650ac-v2|\ + ubnt,unifiac-lite|\ + ubnt,unifiac-lr|\ + ubnt,unifiac-mesh|\ + ubnt,unifiac-mesh-pro|\ + ubnt,lap-120|\ + ubnt,nanobeam-ac|\ + ubnt,nanostation-ac|\ + ubnt,nanostation-ac-loco|\ + ubnt,unifiac-pro|\ + yuncore,a770) + caldata_extract "art" 0x5000 0x844 + ;; + devolo,dvl1200e|\ + devolo,dvl1200i|\ + devolo,dvl1750c|\ + devolo,dvl1750e|\ + devolo,dvl1750i|\ + devolo,dvl1750x) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1) + ;; + dlink,dir-859-a1) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac") + ;; + elecom,wrc-1750ghbk2-i) + caldata_extract "art" 0x5000 0x844 + ;; + engenius,ecb1750) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(mtd_get_mac_ascii u-boot-env athaddr) + ;; + engenius,epg5000|\ + iodata,wn-ac1167dgr|\ + iodata,wn-ac1600dgr2|\ + sitecom,wlr-7100) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) + ;; + engenius,ews511ap) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) + ;; + glinet,gl-ar750) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1) + ;; + glinet,gl-x750) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2) + ;; + nec,wg800hp) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(mtd_get_mac_text board_data 0x880) + ;; + ocedo,koala|\ + ocedo,ursus) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(mtd_get_mac_binary art 0xc) + ;; + openmesh,om5p-ac-v2) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) + ;; + qihoo,c301) + caldata_extract "radiocfg" 0x5000 0x844 + ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac) + ;; + tplink,archer-a7-v5|\ + tplink,archer-c2-v3|\ + tplink,archer-c7-v4|\ + tplink,archer-c7-v5|\ + tplink,archer-c25-v1) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1) + ;; + tplink,archer-c5-v1|\ + tplink,archer-c7-v2) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x1fc00) -1) + ;; + tplink,archer-d50-v1) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) +2) + ;; + tplink,re350k-v1) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary config 0x10008) +2) + ;; + tplink,re355-v1|\ + tplink,re450-v1) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2) + ;; + tplink,re450-v2) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) + ;; + esac + ;; +"ath10k/pre-cal-pci-0000:00:00.0.bin") + case $board in + comfast,cf-e313ac) + caldata_extract "art" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_binary art 0x6) + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin + ;; + dlink,dir-842-c1|\ + dlink,dir-842-c2|\ + dlink,dir-842-c3|\ + nec,wg1200cr) + caldata_extract "art" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac) + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + ;; + netgear,ex6400|\ + netgear,ex7300) + caldata_extract "caldata" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_binary caldata 0xc) + ;; + phicomm,k2t) + caldata_extract "art" 0x5000 0x2f20 + ath10k_patch_mac $(k2t_get_mac "5g_mac") + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + ;; + tplink,archer-c58-v1|\ + tplink,archer-c59-v1|\ + tplink,archer-c59-v2|\ + tplink,archer-c60-v1|\ + tplink,archer-c60-v2|\ + tplink,archer-c6-v2|\ + tplink,archer-c6-v2-us) + caldata_extract "art" 0x5000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x8) -1) + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + ;; + yuncore,a782|\ + yuncore,xd4200) + caldata_extract "art" 0x5000 0x2f20 + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + ;; + esac + ;; +*) + exit 1 + ;; +esac diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac new file mode 100644 index 000000000..8c8b7932b --- /dev/null +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -0,0 +1,45 @@ +#!/bin/ash + +[ "$ACTION" = "add" ] || exit 0 + +PHYNBR=${DEVPATH##*/phy} + +[ -n $PHYNBR ] || exit 0 + +. /lib/functions.sh +. /lib/functions/system.sh +. /lib/functions/k2t.sh + +board=$(board_name) + +case "$board" in + adtran,bsap1800-v2|\ + adtran,bsap1840) + macaddr_add "$(mtd_get_mac_binary 'Board data' 2)" $(($PHYNBR * 8 + 1)) > /sys${DEVPATH}/macaddress + ;; + iodata,wn-ac1600dgr) + # There is no eeprom data for 5 GHz wlan in "art" partition + # which would allow to patch the macaddress + [ "$PHYNBR" -eq 0 ] && \ + macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress + ;; + iodata,wn-ag300dgr) + # There is no eeprom data for 5 GHz wlan in "art" partition + # which would allow to patch the macaddress + [ "$PHYNBR" -eq 1 ] && \ + macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress + ;; + phicomm,k2t) + # The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address + [ "$PHYNBR" -eq 1 ] && \ + k2t_get_mac "lan_mac" > /sys${DEVPATH}/macaddress + ;; + trendnet,tew-823dru) + # set the 2.4G interface mac address to LAN MAC + [ "$PHYNBR" -eq 1 ] && \ + mtd_get_mac_text mac 4 > /sys${DEVPATH}/macaddress + # set the 5G interface mac address to WAN MAC + 1 + [ "$PHYNBR" -eq 0 ] && \ + macaddr_add "$(mtd_get_mac_text mac 0x18)" 1 > /sys${DEVPATH}/macaddress + ;; +esac diff --git a/target/linux/ath79/generic/base-files/etc/init.d/bootcount b/target/linux/ath79/generic/base-files/etc/init.d/bootcount new file mode 100755 index 000000000..7807559d8 --- /dev/null +++ b/target/linux/ath79/generic/base-files/etc/init.d/bootcount @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common + +START=99 + +boot() { + case $(board_name) in + adtran,bsap1800-v2|\ + adtran,bsap1840) + fconfig -s -w -d $(find_mtd_part "RedBoot config") -n boot_cntb -x 0 + ;; + qihoo,c301) + local n=$(fw_printenv activeregion | cut -d = -f 2) + fw_setenv "image${n}trynum" 0 + ;; + esac +} diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration new file mode 100644 index 000000000..b23e5f7db --- /dev/null +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration @@ -0,0 +1,39 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/migrations.sh + +board=$(board_name) +boardonly="${board##*,}" + +case "$board" in +engenius,epg5000) + migrate_leds ":wlan-2g=:wlan2g" ":wlan-5g=:wlan5g" + ;; +tplink,archer-c25-v1|\ +tplink,archer-c58-v1|\ +tplink,archer-c59-v1|\ +tplink,archer-c59-v2|\ +tplink,archer-c60-v1|\ +tplink,archer-c60-v2|\ +tplink,archer-c7-v4|\ +tplink,archer-c7-v5) + migrate_leds "^$boardonly:=tp-link:" + ;; +tplink,archer-c7-v2) + migrate_leds ":blue:=:green:" + ;; +tplink,re355-v1) + migrate_leds "re355:=tp-link:" + ;; +tplink,re450-v1) + migrate_leds "re450:=tp-link:" + ;; +wd,mynet-n750) + migrate_leds "wd:=mynet-n750:" + ;; +esac + +migrations_apply system + +exit 0 diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum new file mode 100644 index 000000000..22c9483e7 --- /dev/null +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum @@ -0,0 +1,15 @@ +#!/bin/sh +. /lib/functions.sh + +fix_seama_header() { + local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd) + [ "$kernel_size" ] && mtd -c 0x$kernel_size fixseama firmware +} + +board=$(board_name) + +case "$board" in +qihoo,c301) + fix_seama_header + ;; +esac diff --git a/target/linux/ath79/base-files/lib/functions/k2t.sh b/target/linux/ath79/generic/base-files/lib/functions/k2t.sh similarity index 100% rename from target/linux/ath79/base-files/lib/functions/k2t.sh rename to target/linux/ath79/generic/base-files/lib/functions/k2t.sh diff --git a/target/linux/ath79/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh similarity index 76% rename from target/linux/ath79/base-files/lib/upgrade/platform.sh rename to target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index c2fe08154..10756abba 100644 --- a/target/linux/ath79/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -14,7 +14,7 @@ redboot_fis_do_upgrade() { if [ "$magic" = "4349" ]; then local kern_length=0x$(dd if="$sysup_file" bs=2 skip=1 count=4 2>/dev/null) - [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR" + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP" dd if="$sysup_file" bs=64k skip=1 2>/dev/null | \ mtd -r $append -F$kern_part:$kern_length:0x80060000,rootfs write - $kern_part:rootfs @@ -22,7 +22,7 @@ redboot_fis_do_upgrade() { local board_dir=$(tar tf $sysup_file | grep -m 1 '^sysupgrade-.*/$') local kern_length=$(tar xf $sysup_file ${board_dir}kernel -O | wc -c) - [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR" + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP" tar xf $sysup_file ${board_dir}kernel ${board_dir}root -O | \ mtd -r $append -F$kern_part:$kern_length:0x80060000,rootfs write - $kern_part:rootfs @@ -40,15 +40,19 @@ platform_do_upgrade() { local board=$(board_name) case "$board" in + adtran,bsap1800-v2|\ + adtran,bsap1840) + redboot_fis_do_upgrade "$1" vmlinux_2 + ;; jjplus,ja76pf2) - redboot_fis_do_upgrade "$ARGV" linux + echo "Sysupgrade disabled due bug FS#2428" ;; ubnt,routerstation|\ ubnt,routerstation-pro) - redboot_fis_do_upgrade "$ARGV" kernel + echo "Sysupgrade disabled due bug FS#2428" ;; *) - default_do_upgrade "$ARGV" + default_do_upgrade "$1" ;; esac } diff --git a/target/linux/ath79/generic/config-default b/target/linux/ath79/generic/config-default index 313ab8604..20da0b8ba 100644 --- a/target/linux/ath79/generic/config-default +++ b/target/linux/ath79/generic/config-default @@ -1,5 +1,4 @@ CONFIG_AT803X_PHY=y -CONFIG_BLK_MQ_PCI=y CONFIG_GPIO_WATCHDOG=y CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y CONFIG_INTEL_XWAY_PHY=y @@ -8,16 +7,8 @@ CONFIG_LEDS_RESET=y CONFIG_MARVELL_PHY=y CONFIG_MICREL_PHY=y CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2 +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-3 CONFIG_MTD_SPLIT_EVA_FW=y -CONFIG_OF_ADDRESS_PCI=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_PCI=y -CONFIG_PCI_AR71XX=y -CONFIG_PCI_AR724X=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y CONFIG_PHY_AR7100_USB=y CONFIG_PHY_AR7200_USB=y CONFIG_REGULATOR=y @@ -26,4 +17,5 @@ CONFIG_RTL8366RB_PHY=y CONFIG_RTL8366S_PHY=y CONFIG_RTL8366_SMI=y CONFIG_RTL8367_PHY=y +CONFIG_VITESSE_PHY=y CONFIG_WATCHDOG_CORE=y diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index 734f27e68..24768ef5e 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -36,6 +36,10 @@ define Build/loader-okli mv "$@.new" "$@" endef +define Build/append-loader-okli + cat "$(KDIR)/loader-$(word 1,$(1)).$(LOADER_TYPE)" >> "$@" +endef + define Build/relocate-kernel rm -rf $@.relocate $(CP) ../../generic/image/relocate $@.relocate diff --git a/target/linux/ath79/image/bin/pisen_wmb001n_factory-header.bin b/target/linux/ath79/image/bin/pisen_wmb001n_factory-header.bin new file mode 100644 index 0000000000000000000000000000000000000000..99e1e8a2dbe0a9be31483970e75cecc4547f73d8 GIT binary patch literal 288 scmcb03j!F>z>E-v)OJP&j&NTm0|P@pG}+<7EiFh%EJ?-f7eSyD0F=883jhEB literal 0 HcmV?d00001 diff --git a/target/linux/ath79/image/common-buffalo.mk b/target/linux/ath79/image/common-buffalo.mk index 8870af691..d62b7eea9 100644 --- a/target/linux/ath79/image/common-buffalo.mk +++ b/target/linux/ath79/image/common-buffalo.mk @@ -1,11 +1,3 @@ -define Build/buffalo-tftp-header - ( \ - echo -n -e "# Airstation Public Fmt1" | dd bs=32 count=1 conv=sync; \ - dd if=$@; \ - ) > $@.new - mv $@.new $@ -endef - define Build/buffalo-tag $(eval product=$(word 1,$(1))) $(eval hwver=$(word 2,$(1))) @@ -18,4 +10,10 @@ define Build/buffalo-tag mv $@.new $@ endef - +define Build/buffalo-tftp-header + ( \ + echo -n -e "# Airstation Public Fmt1" | dd bs=32 count=1 conv=sync; \ + dd if=$@; \ + ) > $@.new + mv $@.new $@ +endef diff --git a/target/linux/ath79/image/common-netgear.mk b/target/linux/ath79/image/common-netgear.mk index 9b7993629..8311222a9 100644 --- a/target/linux/ath79/image/common-netgear.mk +++ b/target/linux/ath79/image/common-netgear.mk @@ -1,5 +1,15 @@ DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID +define Build/netgear-rootfs + mkimage \ + -A mips -O linux -T filesystem -C none \ + -M $(NETGEAR_KERNEL_MAGIC) \ + -n '$(VERSION_DIST) filesystem' \ + -d $(IMAGE_ROOTFS) $@.fs + cat $@.fs >> $@ + rm -rf $@.fs +endef + define Build/netgear-squashfs rm -rf $@.fs $@.squashfs mkdir -p $@.fs/image @@ -19,21 +29,12 @@ define Build/netgear-squashfs rm -rf $@.squashfs $@.fs endef -define Build/netgear-rootfs - mkimage \ - -A mips -O linux -T filesystem -C none \ - -M $(NETGEAR_KERNEL_MAGIC) \ - -n '$(VERSION_DIST) filesystem' \ - -d $(IMAGE_ROOTFS) $@.fs - cat $@.fs >> $@ - rm -rf $@.fs -endef - define Build/netgear-uImage $(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC)) endef define Device/netgear_ath79 + DEVICE_VENDOR := NETGEAR KERNEL := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma IMAGES += factory.img IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE) diff --git a/target/linux/ath79/image/common-tp-link.mk b/target/linux/ath79/image/common-tp-link.mk index 6efff6322..bda81a3e2 100644 --- a/target/linux/ath79/image/common-tp-link.mk +++ b/target/linux/ath79/image/common-tp-link.mk @@ -48,6 +48,7 @@ define Build/uImageArcher endef define Device/tplink + DEVICE_VENDOR := TP-Link TPLINK_HWREV := 0x1 TPLINK_HEADER_VERSION := 1 LOADER_TYPE := gz @@ -82,19 +83,19 @@ endef define Device/tplink-8m $(Device/tplink-nolzma) TPLINK_FLASHLAYOUT := 8M - IMAGE_SIZE := 7936k + IMAGE_SIZE := 8000k endef define Device/tplink-8mlzma $(Device/tplink) TPLINK_FLASHLAYOUT := 8Mlzma - IMAGE_SIZE := 7936k + IMAGE_SIZE := 8000k endef define Device/tplink-16mlzma $(Device/tplink) TPLINK_FLASHLAYOUT := 16Mlzma - IMAGE_SIZE := 15872k + IMAGE_SIZE := 16192k endef define Device/tplink-safeloader @@ -109,3 +110,12 @@ define Device/tplink-safeloader-uimage $(Device/tplink-safeloader) KERNEL := kernel-bin | append-dtb | lzma | uImageArcher lzma endef + +define Device/tplink-loader-okli + $(Device/tplink-safeloader) + LOADER_TYPE := elf + LOADER_FLASH_OFFS := 0x43000 + COMPILE := loader-$(1).elf + COMPILE/loader-$(1).elf := loader-okli-compile + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288 +endef diff --git a/target/linux/ath79/image/common-yuncore.mk b/target/linux/ath79/image/common-yuncore.mk new file mode 100644 index 000000000..a71d930d8 --- /dev/null +++ b/target/linux/ath79/image/common-yuncore.mk @@ -0,0 +1,12 @@ +define Build/yuncore-tftp-header-16m + ( \ + echo -n -e \ + "YUNCOREsetenv bootcmd \"bootm 0x9f050000 || bootm 0x9fe80000\"" \ + "&& saveenv" \ + "&& erase 0x9f050000 +0xfa0000" \ + "&& cp.b 0x800600c0 0x9f050000 0xfa0000" |\ + dd bs=192 count=1 conv=sync; \ + dd if=$@; \ + ) > $@.new + mv $@.new $@ +endef diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index ecc34b88e..f5e1a9041 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -4,8 +4,9 @@ define Device/tplink_archer-a7-v5 $(Device/tplink-safeloader-uimage) ATH_SOC := qca9563 IMAGE_SIZE := 15104k - DEVICE_TITLE := TP-Link Archer A7 v5 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_MODEL := Archer A7 + DEVICE_VARIANT := v5 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct TPLINK_BOARD_ID := ARCHER-A7-V5 BOARDNAME := ARCHER-A7-V5 SUPPORTED_DEVICES += archer-a7-v5 @@ -16,17 +17,42 @@ define Device/tplink_archer-c2-v3 $(Device/tplink-safeloader-uimage) ATH_SOC := qca9563 IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link Archer C2 v3 + DEVICE_MODEL := Archer C2 + DEVICE_VARIANT := v3 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct TPLINK_BOARD_ID := ARCHER-C2-V3 endef TARGET_DEVICES += tplink_archer-c2-v3 +define Device/tplink_archer-c25-v1 + $(Device/tplink-safeloader-uimage) + ATH_SOC := qca9561 + IMAGE_SIZE := 7808k + DEVICE_MODEL := Archer C25 + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := ARCHER-C25-V1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct + SUPPORTED_DEVICES += archer-c25-v1 +endef +TARGET_DEVICES += tplink_archer-c25-v1 + +define Device/tplink_archer-c5-v1 + $(Device/tplink-16mlzma) + ATH_SOC := qca9558 + DEVICE_MODEL := Archer C5 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct + TPLINK_HWID := 0xc5000001 + SUPPORTED_DEVICES += archer-c5 +endef +TARGET_DEVICES += tplink_archer-c5-v1 + define Device/tplink_archer-c58-v1 $(Device/tplink-safeloader-uimage) ATH_SOC := qca9561 IMAGE_SIZE := 7936k - DEVICE_TITLE := TP-Link Archer C58 v1 + DEVICE_MODEL := Archer C58 + DEVICE_VARIANT := v1 TPLINK_BOARD_ID := ARCHER-C58-V1 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct SUPPORTED_DEVICES += archer-c58-v1 @@ -37,48 +63,94 @@ define Device/tplink_archer-c59-v1 $(Device/tplink-safeloader-uimage) ATH_SOC := qca9561 IMAGE_SIZE := 14528k - DEVICE_TITLE := TP-Link Archer C59 v1 + DEVICE_MODEL := Archer C59 + DEVICE_VARIANT := v1 TPLINK_BOARD_ID := ARCHER-C59-V1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca9888-ct + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca9888-ct SUPPORTED_DEVICES += archer-c59-v1 endef TARGET_DEVICES += tplink_archer-c59-v1 +define Device/tplink_archer-c59-v2 + $(Device/tplink-safeloader-uimage) + ATH_SOC := qca9561 + IMAGE_SIZE := 14400k + DEVICE_MODEL := Archer C59 + DEVICE_VARIANT := v2 + TPLINK_BOARD_ID := ARCHER-C59-V2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca9888-ct + SUPPORTED_DEVICES += archer-c59-v2 +endef +TARGET_DEVICES += tplink_archer-c59-v2 + define Device/tplink_archer-c6-v2 $(Device/tplink-safeloader-uimage) ATH_SOC := qca9563 IMAGE_SIZE := 7808k - DEVICE_TITLE := TP-Link Archer C6 v2 + DEVICE_MODEL := Archer C6 + DEVICE_VARIANT := v2 (EU/RU/JP) TPLINK_BOARD_ID := ARCHER-C6-V2 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct endef TARGET_DEVICES += tplink_archer-c6-v2 -define Device/tplink_archer-c5-v1 - $(Device/tplink-16mlzma) - ATH_SOC := qca9558 - DEVICE_TITLE := TP-Link Archer C5 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct - TPLINK_HWID := 0xc5000001 - SUPPORTED_DEVICES += archer-c5 +define Device/tplink_archer-c6-v2-us + $(Device/tplink-safeloader-uimage) + ATH_SOC := qca9563 + IMAGE_SIZE := 15872k + DEVICE_MODEL := Archer C6 + DEVICE_VARIANT := v2 (US) + DEVICE_ALT0_VENDOR := TP-Link + DEVICE_ALT0_MODEL := Archer A6 + DEVICE_ALT0_VARIANT := v2 (US/TW) + TPLINK_BOARD_ID := ARCHER-C6-V2-US + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct endef -TARGET_DEVICES += tplink_archer-c5-v1 +TARGET_DEVICES += tplink_archer-c6-v2-us + +define Device/tplink_archer-c60-v1 + $(Device/tplink-safeloader-uimage) + ATH_SOC := qca9561 + IMAGE_SIZE := 7936k + DEVICE_MODEL := Archer C60 + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := ARCHER-C60-V1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct + SUPPORTED_DEVICES += archer-c60-v1 +endef +TARGET_DEVICES += tplink_archer-c60-v1 + +define Device/tplink_archer-c60-v2 + $(Device/tplink-safeloader-uimage) + ATH_SOC := qca9561 + IMAGE_SIZE := 7808k + DEVICE_MODEL := Archer C60 + DEVICE_VARIANT := v2 + TPLINK_BOARD_ID := ARCHER-C60-V2 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct + SUPPORTED_DEVICES += archer-c60-v2 +endef +TARGET_DEVICES += tplink_archer-c60-v2 define Device/tplink_archer-c7-v1 $(Device/tplink-8mlzma) ATH_SOC := qca9558 - DEVICE_TITLE := TP-Link Archer C7 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_MODEL := Archer C7 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x75000001 + SUPPORTED_DEVICES += archer-c7 endef TARGET_DEVICES += tplink_archer-c7-v1 define Device/tplink_archer-c7-v2 $(Device/tplink-16mlzma) ATH_SOC := qca9558 - DEVICE_TITLE := TP-Link Archer C7 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_MODEL := Archer C7 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct TPLINK_HWID := 0xc7000002 + SUPPORTED_DEVICES += archer-c7 IMAGES += factory-us.bin factory-eu.bin IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU @@ -89,8 +161,9 @@ define Device/tplink_archer-c7-v4 $(Device/tplink-safeloader-uimage) ATH_SOC := qca9563 IMAGE_SIZE := 15104k - DEVICE_TITLE := TP-Link Archer C7 v4 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_MODEL := Archer C7 + DEVICE_VARIANT := v4 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct TPLINK_BOARD_ID := ARCHER-C7-V4 BOARDNAME := ARCHER-C7-V4 SUPPORTED_DEVICES += archer-c7-v4 @@ -101,19 +174,55 @@ define Device/tplink_archer-c7-v5 $(Device/tplink-safeloader-uimage) ATH_SOC := qca9563 IMAGE_SIZE := 15360k - DEVICE_TITLE := TP-Link Archer C7 v5 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_MODEL := Archer C7 + DEVICE_VARIANT := v5 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct TPLINK_BOARD_ID := ARCHER-C7-V5 BOARDNAME := ARCHER-C7-V5 SUPPORTED_DEVICES += archer-c7-v5 endef TARGET_DEVICES += tplink_archer-c7-v5 +define Device/tplink_archer-d50-v1 + ATH_SOC := qca9531 + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := Archer D50 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct + BOARDNAME := ARCHER-D50-V1 + IMAGE_SIZE := 7808k + TPLINK_HWID := 0xC1200001 + TPLINK_HWREV := 0x00000046 + TPLINK_FLASHLAYOUT := 8Mqca + TPLINK_HWREVADD := 0x00000000 + TPLINK_HVERSION := 3 + KERNEL := kernel-bin | append-dtb | lzma + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | \ + tplink-v2-header -s -V "ver. 1.0" + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := tplink-v2-image -s -V "ver. 2.0" | \ + append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += tplink_archer-d50-v1 + +define Device/tplink_cpe210-v1 + $(Device/tplink-loader-okli) + ATH_SOC := ar9344 + IMAGE_SIZE := 7680k + DEVICE_MODEL := CPE210 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := rssileds + TPLINK_BOARD_ID := CPE210 + SUPPORTED_DEVICES += cpe210 +endef +TARGET_DEVICES += tplink_cpe210-v1 + define Device/tplink_cpe210-v2 $(Device/tplink-safeloader) ATH_SOC := qca9533 IMAGE_SIZE := 7680k - DEVICE_TITLE := TP-Link CPE210 v2 + DEVICE_MODEL := CPE210 + DEVICE_VARIANT := v2 TPLINK_BOARD_ID := CPE210V2 DEVICE_PACKAGES := rssileds LOADER_TYPE := elf @@ -125,7 +234,8 @@ define Device/tplink_cpe210-v3 $(Device/tplink-safeloader) ATH_SOC := qca9533 IMAGE_SIZE := 7680k - DEVICE_TITLE := TP-Link CPE210 v3 + DEVICE_MODEL := CPE210 + DEVICE_VARIANT := v3 DEVICE_PACKAGES := rssileds TPLINK_BOARD_ID := CPE210V3 LOADER_TYPE := elf @@ -133,11 +243,81 @@ define Device/tplink_cpe210-v3 endef TARGET_DEVICES += tplink_cpe210-v3 +define Device/tplink_cpe220-v2 + $(Device/tplink-loader-okli) + ATH_SOC := ar9344 + IMAGE_SIZE := 7680k + DEVICE_MODEL := CPE220 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := rssileds + TPLINK_BOARD_ID := CPE220V2 +endef +TARGET_DEVICES += tplink_cpe220-v2 + +define Device/tplink_cpe220-v3 + $(Device/tplink-safeloader) + ATH_SOC := qca9533 + IMAGE_SIZE := 7680k + DEVICE_MODEL := CPE220 + DEVICE_VARIANT := v3 + DEVICE_PACKAGES := rssileds + TPLINK_BOARD_ID := CPE220V3 + LOADER_TYPE := elf +endef +TARGET_DEVICES += tplink_cpe220-v3 + +define Device/tplink_cpe510-v1 + $(Device/tplink-loader-okli) + ATH_SOC := ar9344 + IMAGE_SIZE := 7680k + DEVICE_MODEL := CPE510 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := rssileds + TPLINK_BOARD_ID := CPE510 + SUPPORTED_DEVICES += cpe510 +endef +TARGET_DEVICES += tplink_cpe510-v1 + +define Device/tplink_cpe510-v2 + $(Device/tplink-loader-okli) + ATH_SOC := ar9344 + IMAGE_SIZE := 7680k + DEVICE_MODEL := CPE510 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := rssileds + TPLINK_BOARD_ID := CPE510V2 + SUPPORTED_DEVICES += cpe510-v2 +endef +TARGET_DEVICES += tplink_cpe510-v2 + +define Device/tplink_cpe510-v3 + $(Device/tplink-loader-okli) + ATH_SOC := ar9344 + IMAGE_SIZE := 7680k + DEVICE_MODEL := CPE510 + DEVICE_VARIANT := v3 + DEVICE_PACKAGES := rssileds + TPLINK_BOARD_ID := CPE510V3 + SUPPORTED_DEVICES += cpe510-v3 +endef +TARGET_DEVICES += tplink_cpe510-v3 + +define Device/tplink_cpe610-v1 + $(Device/tplink-loader-okli) + ATH_SOC := ar9344 + IMAGE_SIZE := 7680k + DEVICE_MODEL := CPE610 + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := CPE610V1 +endef +TARGET_DEVICES += tplink_cpe610-v1 + define Device/tplink_re350k-v1 $(Device/tplink-safeloader) ATH_SOC := qca9558 IMAGE_SIZE := 13760k - DEVICE_TITLE := TP-Link RE350K v1 + DEVICE_MODEL := RE350K + DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct TPLINK_BOARD_ID := RE350K-V1 TPLINK_HWID := 0x0 @@ -145,11 +325,39 @@ define Device/tplink_re350k-v1 endef TARGET_DEVICES += tplink_re350k-v1 +define Device/tplink_rex5x-v1 + $(Device/tplink-safeloader) + ATH_SOC := qca9558 + IMAGE_SIZE := 6016k + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + TPLINK_HWID := 0x0 + TPLINK_HWREV := 0 +endef + +define Device/tplink_re355-v1 + $(Device/tplink_rex5x-v1) + DEVICE_MODEL := RE355 + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := RE355 + SUPPORTED_DEVICES += re355 +endef +TARGET_DEVICES += tplink_re355-v1 + +define Device/tplink_re450-v1 + $(Device/tplink_rex5x-v1) + DEVICE_MODEL := RE450 + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := RE450 + SUPPORTED_DEVICES += re450 +endef +TARGET_DEVICES += tplink_re450-v1 + define Device/tplink_re450-v2 $(Device/tplink-safeloader) ATH_SOC := qca9563 IMAGE_SIZE := 6016k - DEVICE_TITLE := TP-Link RE450 v2 + DEVICE_MODEL := RE450 + DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct TPLINK_HWID := 0x0 TPLINK_HWREV := 0 @@ -158,31 +366,45 @@ define Device/tplink_re450-v2 endef TARGET_DEVICES += tplink_re450-v2 -define Device/tplink_tl-wdr3600 +define Device/tplink_tl-wdr3500-v1 $(Device/tplink-8mlzma) ATH_SOC := ar9344 - DEVICE_TITLE := TP-Link TL-WDR3600 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-WDR3500 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + TPLINK_HWID := 0x35000001 + SUPPORTED_DEVICES += tl-wdr3500 +endef +TARGET_DEVICES += tplink_tl-wdr3500-v1 + +define Device/tplink_tl-wdr3600-v1 + $(Device/tplink-8mlzma) + ATH_SOC := ar9344 + DEVICE_MODEL := TL-WDR3600 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x36000001 SUPPORTED_DEVICES += tl-wdr4300 endef -TARGET_DEVICES += tplink_tl-wdr3600 +TARGET_DEVICES += tplink_tl-wdr3600-v1 -define Device/tplink_tl-wdr4300 +define Device/tplink_tl-wdr4300-v1 $(Device/tplink-8mlzma) ATH_SOC := ar9344 - DEVICE_TITLE := TP-Link TL-WDR4300 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-WDR4300 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x43000001 SUPPORTED_DEVICES += tl-wdr4300 endef -TARGET_DEVICES += tplink_tl-wdr4300 +TARGET_DEVICES += tplink_tl-wdr4300-v1 define Device/tplink_tl-wdr4900-v2 $(Device/tplink-8mlzma) ATH_SOC := qca9558 - DEVICE_TITLE := TP-Link TL-WDR4900 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-WDR4900 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x49000002 endef TARGET_DEVICES += tplink_tl-wdr4900-v2 @@ -190,64 +412,20 @@ TARGET_DEVICES += tplink_tl-wdr4900-v2 define Device/tplink_tl-wr1043nd-v1 $(Device/tplink-8m) ATH_SOC := ar9132 - DEVICE_TITLE := TP-Link TL-WR1043N/ND v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-WR1043N/ND + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x10430001 SUPPORTED_DEVICES += tl-wr1043nd endef TARGET_DEVICES += tplink_tl-wr1043nd-v1 -define Device/tplink_tl-wr810n-v1 - $(Device/tplink-8mlzma) - ATH_SOC := qca9531 - DEVICE_TITLE := TP-Link TL-WR810N v1 - TPLINK_HWID := 0x8100001 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += tplink_tl-wr810n-v1 - -define Device/tplink_tl-wr810n-v2 - $(Device/tplink-8mlzma) - ATH_SOC := qca9533 - DEVICE_TITLE := TP-Link TL-WR810N v2 - TPLINK_HWID := 0x8100002 -endef -TARGET_DEVICES += tplink_tl-wr810n-v2 - -define Device/tplink_tl-wr710n-v1 - $(Device/tplink-8mlzma) - ATH_SOC := ar9331 - DEVICE_TITLE := TP-Link TL-WR710N v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea2 kmod-usb-ledtrig-usbport - TPLINK_HWID := 0x07100001 - SUPPORTED_DEVICES += tl-wr710n -endef -TARGET_DEVICES += tplink_tl-wr710n-v1 - -define Device/tplink_tl-wr842n-v1 - $(Device/tplink-8m) - ATH_SOC := ar7241 - DEVICE_TITLE := TP-Link TL-WR842N/ND v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - TPLINK_HWID := 0x8420001 -endef -TARGET_DEVICES += tplink_tl-wr842n-v1 - -define Device/tplink_tl-wr842n-v2 - $(Device/tplink-8mlzma) - ATH_SOC := ar9341 - DEVICE_TITLE := TP-Link TL-WR842N/ND v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - TPLINK_HWID := 0x8420002 - SUPPORTED_DEVICES += tl-wr842n-v2 -endef -TARGET_DEVICES += tplink_tl-wr842n-v2 - define Device/tplink_tl-wr1043nd-v2 $(Device/tplink-8mlzma) ATH_SOC := qca9558 - DEVICE_TITLE := TP-Link TL-WR1043N/ND v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-WR1043N/ND + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x10430002 SUPPORTED_DEVICES += tl-wr1043nd-v2 endef @@ -256,10 +434,11 @@ TARGET_DEVICES += tplink_tl-wr1043nd-v2 define Device/tplink_tl-wr1043nd-v3 $(Device/tplink-8mlzma) ATH_SOC := qca9558 - DEVICE_TITLE := TP-Link TL-WR1043N/ND v3 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-WR1043N/ND + DEVICE_VARIANT := v3 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x10430003 - SUPPORTED_DEVICES += tl-wr1043nd-v3 + SUPPORTED_DEVICES += tl-wr1043nd-v2 endef TARGET_DEVICES += tplink_tl-wr1043nd-v3 @@ -267,19 +446,42 @@ define Device/tplink_tl-wr1043nd-v4 $(Device/tplink-safeloader) ATH_SOC := qca9563 IMAGE_SIZE := 15552k - DEVICE_TITLE := TP-Link TL-WR1043N/ND v4 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-WR1043N/ND + DEVICE_VARIANT := v4 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x10430004 TPLINK_BOARD_ID := TLWR1043NDV4 SUPPORTED_DEVICES += tl-wr1043nd-v4 endef TARGET_DEVICES += tplink_tl-wr1043nd-v4 +define Device/tplink_tl-wr1043n-v5 + $(Device/tplink-safeloader-uimage) + ATH_SOC := qca9563 + IMAGE_SIZE := 15104k + DEVICE_MODEL := TL-WR1043N + DEVICE_VARIANT := v5 + TPLINK_BOARD_ID := TLWR1043NV5 + SUPPORTED_DEVICES += tl-wr1043n-v5 +endef +TARGET_DEVICES += tplink_tl-wr1043n-v5 + +define Device/tplink_tl-wr1045nd-v2 + $(Device/tplink-8mlzma) + ATH_SOC := qca9558 + DEVICE_MODEL := TL-WR1045ND + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + TPLINK_HWID := 0x10450002 +endef +TARGET_DEVICES += tplink_tl-wr1045nd-v2 + define Device/tplink_tl-wr2543-v1 $(Device/tplink-8mlzma) ATH_SOC := ar7242 - DEVICE_TITLE := TP-Link TL-WR2543N/ND v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-WR2543N/ND + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x25430001 IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade -v 3.13.99 | \ append-metadata | check-size $$$$(IMAGE_SIZE) @@ -287,3 +489,99 @@ define Device/tplink_tl-wr2543-v1 SUPPORTED_DEVICES += tl-wr2543-v1 endef TARGET_DEVICES += tplink_tl-wr2543-v1 + +define Device/tplink_tl-wr710n-v1 + $(Device/tplink-8mlzma) + ATH_SOC := ar9331 + DEVICE_MODEL := TL-WR710N + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-usb-ledtrig-usbport + TPLINK_HWID := 0x07100001 + SUPPORTED_DEVICES += tl-wr710n +endef +TARGET_DEVICES += tplink_tl-wr710n-v1 + +define Device/tplink_tl-wr810n-v1 + $(Device/tplink-8mlzma) + ATH_SOC := qca9531 + DEVICE_MODEL := TL-WR810N + DEVICE_VARIANT := v1 + TPLINK_HWID := 0x8100001 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += tplink_tl-wr810n-v1 + +define Device/tplink_tl-wr810n-v2 + $(Device/tplink-8mlzma) + ATH_SOC := qca9533 + DEVICE_MODEL := TL-WR810N + DEVICE_VARIANT := v2 + TPLINK_HWID := 0x8100002 +endef +TARGET_DEVICES += tplink_tl-wr810n-v2 + +define Device/tplink_tl-wr842n-v1 + $(Device/tplink-8m) + ATH_SOC := ar7241 + DEVICE_MODEL := TL-WR842N/ND + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + TPLINK_HWID := 0x8420001 +endef +TARGET_DEVICES += tplink_tl-wr842n-v1 + +define Device/tplink_tl-wr842n-v2 + $(Device/tplink-8mlzma) + ATH_SOC := ar9341 + DEVICE_MODEL := TL-WR842N/ND + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + TPLINK_HWID := 0x8420002 + SUPPORTED_DEVICES += tl-wr842n-v2 +endef +TARGET_DEVICES += tplink_tl-wr842n-v2 + +define Device/tplink_tl-wr842n-v3 + $(Device/tplink-16mlzma) + ATH_SOC := qca9533 + DEVICE_MODEL := TL-WR842N + DEVICE_VARIANT := v3 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + TPLINK_HWID := 0x8420003 + SUPPORTED_DEVICES += tl-wr842n-v3 +endef +TARGET_DEVICES += tplink_tl-wr842n-v3 + +define Device/tplink_wbs210-v2 + $(Device/tplink-loader-okli) + ATH_SOC := ar9344 + IMAGE_SIZE := 7680k + DEVICE_MODEL := WBS210 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := rssileds + TPLINK_BOARD_ID := WBS210V2 +endef +TARGET_DEVICES += tplink_wbs210-v2 + +define Device/tplink_wbs510-v1 + $(Device/tplink-loader-okli) + ATH_SOC := ar9344 + IMAGE_SIZE := 7680k + DEVICE_MODEL := WBS510 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := rssileds + TPLINK_BOARD_ID := WBS510 + SUPPORTED_DEVICES += wbs510 +endef +TARGET_DEVICES += tplink_wbs510-v1 + +define Device/tplink_wbs510-v2 + $(Device/tplink-loader-okli) + ATH_SOC := ar9344 + IMAGE_SIZE := 7680k + DEVICE_MODEL := WBS510 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := rssileds + TPLINK_BOARD_ID := WBS510V2 +endef +TARGET_DEVICES += tplink_wbs510-v2 diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index b189d6677..19dbe2eb8 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -34,8 +34,8 @@ endef # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x) # UBNT_VERSION e.g. one of (6.0.0, 8.5.0) define Device/ubnt - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - IMAGE_SIZE := 7552k + DEVICE_VENDOR := Ubiquiti + DEVICE_PACKAGES := kmod-usb2 UBNT_BOARD := XM UBNT_VERSION := 6.0.0 IMAGES += factory.bin @@ -43,17 +43,9 @@ define Device/ubnt append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | mkubntimage-split endef -define Device/ubnt-xm - $(Device/ubnt) - DEVICE_PACKAGES += kmod-usb-ohci rssileds - UBNT_TYPE := XM - UBNT_CHIP := ar7240 - ATH_SOC := ar7241 - KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma -endef - define Device/ubnt-bz $(Device/ubnt) + IMAGE_SIZE := 7448k UBNT_TYPE := BZ UBNT_CHIP := ar7240 ATH_SOC := ar7241 @@ -61,6 +53,7 @@ endef define Device/ubnt-wa $(Device/ubnt) + IMAGE_SIZE := 15744k UBNT_TYPE := WA UBNT_CHIP := ar934x UBNT_BOARD := WA @@ -68,8 +61,21 @@ define Device/ubnt-wa ATH_SOC := ar9342 endef +define Device/ubnt-xm + $(Device/ubnt) + DEVICE_VARIANT := XM + DEVICE_PACKAGES += kmod-usb-ohci + IMAGE_SIZE := 7448k + UBNT_TYPE := XM + UBNT_CHIP := ar7240 + ATH_SOC := ar7241 + KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma +endef + define Device/ubnt-xw $(Device/ubnt) + DEVICE_VARIANT := XW + IMAGE_SIZE := 7552k UBNT_TYPE := XW UBNT_CHIP := ar934x UBNT_BOARD := XM @@ -78,166 +84,176 @@ define Device/ubnt-xw ATH_SOC := ar9342 endef -define Device/ubnt_airrouter - $(Device/ubnt-xm) - DEVICE_TITLE := Ubiquiti AirRouter - SUPPORTED_DEVICES += airrouter -endef -TARGET_DEVICES += ubnt_airrouter - -define Device/ubnt_bullet-m - $(Device/ubnt-xm) - DEVICE_TITLE := Ubiquiti Bullet-M - SUPPORTED_DEVICES += bullet-m -endef -TARGET_DEVICES += ubnt_bullet-m - -define Device/ubnt_bullet-m-xw - $(Device/ubnt-xw) - DEVICE_TITLE := Ubiquiti Bullet-M (XW) - SUPPORTED_DEVICES += bullet-m-xw -endef -TARGET_DEVICES += ubnt_bullet-m-xw - -define Device/ubnt_rocket-m - $(Device/ubnt-xm) - DEVICE_TITLE := Ubiquiti Rocket-M - SUPPORTED_DEVICES += rocket-m -endef -TARGET_DEVICES += ubnt_rocket-m - -define Device/ubnt_nanostation-m - $(Device/ubnt-xm) - DEVICE_TITLE := Ubiquiti Nanostation M - SUPPORTED_DEVICES += nano-m -endef -TARGET_DEVICES += ubnt_nanostation-m - -define Device/ubnt_nanostation-m-xw - $(Device/ubnt-xw) - DEVICE_TITLE := Ubiquiti Nanostation M (XW) - SUPPORTED_DEVICES += nano-m-xw -endef -TARGET_DEVICES += ubnt_nanostation-m-xw - -define Device/ubnt_lap-120 - $(Device/ubnt-wa) - DEVICE_TITLE := Ubiquiti LiteAP ac (LAP-120) - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct - IMAGE_SIZE := 15744k - IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split -endef -TARGET_DEVICES += ubnt_lap-120 - -define Device/ubnt_nanobeam-ac - $(Device/ubnt-wa) - DEVICE_TITLE := Ubiquiti NanoBeam AC - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct - IMAGE_SIZE := 15744k - IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split -endef -TARGET_DEVICES += ubnt_nanobeam-ac - -define Device/ubnt_nanostation-ac - $(Device/ubnt-wa) - DEVICE_TITLE := Ubiquiti Nanostation AC - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct - IMAGE_SIZE := 15744k - IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split -endef -TARGET_DEVICES += ubnt_nanostation-ac - -define Device/ubnt_nanostation-ac-loco - $(Device/ubnt-wa) - DEVICE_TITLE := Ubiquiti Nanostation AC loco - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct - IMAGE_SIZE := 15744k - IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split -endef -TARGET_DEVICES += ubnt_nanostation-ac-loco - -define Device/ubnt_unifi - $(Device/ubnt-bz) - DEVICE_TITLE := Ubiquiti UniFi - SUPPORTED_DEVICES += unifi -endef -TARGET_DEVICES += ubnt_unifi - -define Device/ubnt_unifiac - ATH_SOC := qca9563 - IMAGE_SIZE := 7744k - DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct -endef - - -define Device/ubnt_unifiac-lite - $(Device/ubnt_unifiac) - DEVICE_TITLE := Ubiquiti UniFi AC-Lite - SUPPORTED_DEVICES += ubnt-unifiac-lite -endef -TARGET_DEVICES += ubnt_unifiac-lite - -define Device/ubnt_unifiac-mesh - $(Device/ubnt_unifiac) - DEVICE_TITLE := Ubiquiti UniFi AC-Mesh - SUPPORTED_DEVICES += ubnt-unifiac-mesh -endef -TARGET_DEVICES += ubnt_unifiac-mesh - -define Device/ubnt_unifiac-mesh-pro - $(Device/ubnt_unifiac) - DEVICE_TITLE := Ubiquiti UniFi AC-Mesh Pro - SUPPORTED_DEVICES += ubnt-unifiac-mesh-pro -endef -TARGET_DEVICES += ubnt_unifiac-mesh-pro - -define Device/ubnt_unifiac-pro - $(Device/ubnt_unifiac) - DEVICE_TITLE := Ubiquiti UniFi AC-Pro - DEVICE_PACKAGES += kmod-usb-core kmod-usb2 - SUPPORTED_DEVICES += ubnt-unifiac-pro -endef -TARGET_DEVICES += ubnt_unifiac-pro - -define Device/ubnt_routerstation_common - DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci kmod-usb2 fconfig - ATH_SOC := ar7161 - IMAGE_SIZE := 16128k - IMAGES += factory.bin - IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | check-size $$$$(IMAGE_SIZE) - IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE) -# IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata - KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE) - KERNEL_INITRAMFS := kernel-bin | append-dtb -endef - -define Device/ubnt_routerstation - $(Device/ubnt_routerstation_common) - DEVICE_TITLE := Ubiquiti RouterStation - UBNT_BOARD := RS - UBNT_TYPE := RSx - UBNT_CHIP := ar7100 - DEVICE_PACKAGES += -swconfig -endef -TARGET_DEVICES += ubnt_routerstation - -define Device/ubnt_routerstation-pro - $(Device/ubnt_routerstation_common) - DEVICE_TITLE := Ubiquiti RouterStation Pro - UBNT_BOARD := RSPRO - UBNT_TYPE := RSPRO - UBNT_CHIP := ar7100pro -endef -TARGET_DEVICES += ubnt_routerstation-pro - define Device/ubnt_acb-isp $(Device/ubnt) ATH_SOC := qca9533 IMAGE_SIZE := 15744k - DEVICE_TITLE := Ubiquiti airCube ISP + DEVICE_MODEL := airCube ISP UBNT_BOARD := ACB-ISP UBNT_TYPE := ACB UBNT_CHIP := qca9533 IMAGES := sysupgrade.bin endef TARGET_DEVICES += ubnt_acb-isp + +define Device/ubnt_airrouter + $(Device/ubnt-xm) + DEVICE_MODEL := AirRouter + SUPPORTED_DEVICES += airrouter +endef +TARGET_DEVICES += ubnt_airrouter + +define Device/ubnt_bullet-m + $(Device/ubnt-xm) + DEVICE_MODEL := Bullet-M + DEVICE_PACKAGES += rssileds + SUPPORTED_DEVICES += bullet-m +endef +TARGET_DEVICES += ubnt_bullet-m + +define Device/ubnt_bullet-m-xw + $(Device/ubnt-xw) + DEVICE_MODEL := Bullet-M + DEVICE_PACKAGES += rssileds + SUPPORTED_DEVICES += bullet-m-xw +endef +TARGET_DEVICES += ubnt_bullet-m-xw + +define Device/ubnt_lap-120 + $(Device/ubnt-wa) + DEVICE_MODEL := LiteAP ac + DEVICE_VARIANT := LAP-120 + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split +endef +TARGET_DEVICES += ubnt_lap-120 + +define Device/ubnt_nanobeam-ac + $(Device/ubnt-wa) + DEVICE_MODEL := NanoBeam AC + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct rssileds + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split +endef +TARGET_DEVICES += ubnt_nanobeam-ac + +define Device/ubnt_nanostation-ac + $(Device/ubnt-wa) + DEVICE_MODEL := Nanostation AC + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct rssileds + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split +endef +TARGET_DEVICES += ubnt_nanostation-ac + +define Device/ubnt_nanostation-ac-loco + $(Device/ubnt-wa) + DEVICE_MODEL := Nanostation AC loco + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split +endef +TARGET_DEVICES += ubnt_nanostation-ac-loco + +define Device/ubnt_nanostation-m + $(Device/ubnt-xm) + DEVICE_MODEL := Nanostation M + DEVICE_PACKAGES += rssileds + SUPPORTED_DEVICES += nanostation-m +endef +TARGET_DEVICES += ubnt_nanostation-m + +define Device/ubnt_nanostation-m-xw + $(Device/ubnt-xw) + DEVICE_MODEL := Nanostation M + DEVICE_PACKAGES += rssileds + SUPPORTED_DEVICES += nanostation-m-xw +endef +TARGET_DEVICES += ubnt_nanostation-m-xw + +define Device/ubnt_rocket-m + $(Device/ubnt-xm) + DEVICE_MODEL := Rocket-M + DEVICE_PACKAGES += rssileds + SUPPORTED_DEVICES += rocket-m +endef +TARGET_DEVICES += ubnt_rocket-m + +define Device/ubnt_routerstation_common + DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci kmod-usb2 fconfig + DEVICE_VENDOR := Ubiquiti + ATH_SOC := ar7161 + IMAGE_SIZE := 16128k + IMAGES := factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | check-size $$$$(IMAGE_SIZE) + KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE) + KERNEL_INITRAMFS := kernel-bin | append-dtb +endef + +define Device/ubnt_routerstation + $(Device/ubnt_routerstation_common) + DEVICE_MODEL := RouterStation + UBNT_BOARD := RS + UBNT_TYPE := RSx + UBNT_CHIP := ar7100 + DEVICE_PACKAGES += -swconfig + SUPPORTED_DEVICES += routerstation +endef +TARGET_DEVICES += ubnt_routerstation + +define Device/ubnt_routerstation-pro + $(Device/ubnt_routerstation_common) + DEVICE_MODEL := RouterStation Pro + UBNT_BOARD := RSPRO + UBNT_TYPE := RSPRO + UBNT_CHIP := ar7100pro + SUPPORTED_DEVICES += routerstation-pro +endef +TARGET_DEVICES += ubnt_routerstation-pro + +define Device/ubnt_unifi + $(Device/ubnt-bz) + DEVICE_MODEL := UniFi + SUPPORTED_DEVICES += unifi +endef +TARGET_DEVICES += ubnt_unifi + +define Device/ubnt_unifiac + DEVICE_VENDOR := Ubiquiti + ATH_SOC := qca9563 + IMAGE_SIZE := 7744k + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct +endef + +define Device/ubnt_unifiac-lite + $(Device/ubnt_unifiac) + DEVICE_MODEL := UniFi AC-Lite + SUPPORTED_DEVICES += unifiac-lite +endef +TARGET_DEVICES += ubnt_unifiac-lite + +define Device/ubnt_unifiac-lr + $(Device/ubnt_unifiac) + DEVICE_MODEL := UniFi AC-LR + SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite +endef +TARGET_DEVICES += ubnt_unifiac-lr + +define Device/ubnt_unifiac-mesh + $(Device/ubnt_unifiac) + DEVICE_MODEL := UniFi AC-Mesh + SUPPORTED_DEVICES += ubnt-unifiac-mesh +endef +TARGET_DEVICES += ubnt_unifiac-mesh + +define Device/ubnt_unifiac-mesh-pro + $(Device/ubnt_unifiac) + DEVICE_MODEL := UniFi AC-Mesh Pro + SUPPORTED_DEVICES += ubnt-unifiac-mesh-pro +endef +TARGET_DEVICES += ubnt_unifiac-mesh-pro + +define Device/ubnt_unifiac-pro + $(Device/ubnt_unifiac) + DEVICE_MODEL := UniFi AC-Pro + DEVICE_PACKAGES += kmod-usb2 + SUPPORTED_DEVICES += ubnt-unifiac-pro +endef +TARGET_DEVICES += ubnt_unifiac-pro diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 241c1e258..865126549 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1,25 +1,12 @@ include ./common-buffalo.mk include ./common-netgear.mk +include ./common-tp-link.mk +include ./common-yuncore.mk DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += KERNEL_INITRAMFS_PREFIX -define Build/cybertan-trx - @echo -n '' > $@-empty.bin - -$(STAGING_DIR_HOST)/bin/trx -o $@.new \ - -f $(IMAGE_KERNEL) -F $@-empty.bin \ - -x 32 -a 0x10000 -x -32 -f $@ - -mv "$@.new" "$@" - -rm $@-empty.bin -endef - -define Build/addpattern - -$(STAGING_DIR_HOST)/bin/addpattern -B $(ADDPATTERN_ID) \ - -v v$(ADDPATTERN_VERSION) -i $@ -o $@.new - -mv "$@.new" "$@" -endef - define Build/add-elecom-factory-initramfs $(eval edimax_model=$(word 1,$(1))) $(eval product=$(word 2,$(1))) @@ -42,6 +29,21 @@ define Build/add-elecom-factory-initramfs fi endef +define Build/addpattern + -$(STAGING_DIR_HOST)/bin/addpattern -B $(ADDPATTERN_ID) \ + -v v$(ADDPATTERN_VERSION) -i $@ -o $@.new + -mv "$@.new" "$@" +endef + +define Build/cybertan-trx + @echo -n '' > $@-empty.bin + -$(STAGING_DIR_HOST)/bin/trx -o $@.new \ + -f $(IMAGE_KERNEL) -F $@-empty.bin \ + -x 32 -a 0x10000 -x -32 -f $@ + -mv "$@.new" "$@" + -rm $@-empty.bin +endef + define Build/nec-enc $(STAGING_DIR_HOST)/bin/nec-enc \ -i $@ -o $@.new -k $(1) @@ -58,6 +60,18 @@ define Build/nec-fw mv $@.new $@ endef +define Build/pisen_wmb001n-factory + -[ -f "$@" ] && \ + mkdir -p "$@.tmp" && \ + cp "$(KDIR)/loader-$(word 1,$(1)).uImage" "$@.tmp/uImage" && \ + mv "$@" "$@.tmp/rootfs" && \ + cp "bin/pisen_wmb001n_factory-header.bin" "$@" && \ + $(TAR) -cp --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \ + $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \ + -C "$@.tmp" . | gzip -9n >> "$@" && \ + rm -rf "$@.tmp" +endef + define Device/seama KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma KERNEL_INITRAMFS := $$(KERNEL) | seama @@ -75,9 +89,66 @@ define Device/seama SEAMA_SIGNATURE := endef + +define Device/8dev_carambola2 + ATH_SOC := ar9331 + DEVICE_VENDOR := 8devices + DEVICE_MODEL := Carambola2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-chipidea2 + IMAGE_SIZE := 16000k + SUPPORTED_DEVICES += carambola2 +endef +TARGET_DEVICES += 8dev_carambola2 + +define Device/adtran_bsap1880 + ATH_SOC := ar7161 + DEVICE_VENDOR := Adtran/Bluesocket + DEVICE_PACKAGES += -swconfig -uboot-envtools fconfig + KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE) + KERNEL_INITRAMFS := kernel-bin | append-dtb + IMAGE_SIZE := 11200k + IMAGES += kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata +endef + +define Device/adtran_bsap1800-v2 + $(Device/adtran_bsap1880) + DEVICE_MODEL := BSAP-1800 + DEVICE_VARIANT := v2 +endef +TARGET_DEVICES += adtran_bsap1800-v2 + +define Device/adtran_bsap1840 + $(Device/adtran_bsap1880) + DEVICE_MODEL := BSAP-1840 +endef +TARGET_DEVICES += adtran_bsap1840 + +define Device/alfa-network_ap121f + ATH_SOC := ar9331 + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := AP121F + DEVICE_PACKAGES := kmod-usb2 kmod-usb-chipidea2 kmod-usb-storage -swconfig + IMAGE_SIZE := 16064k + SUPPORTED_DEVICES += ap121f +endef +TARGET_DEVICES += alfa-network_ap121f + +define Device/aruba_ap-105 + ATH_SOC := ar7161 + DEVICE_VENDOR := Aruba + DEVICE_MODEL := AP-105 + IMAGE_SIZE := 16000k + DEVICE_PACKAGES := kmod-i2c-core kmod-i2c-gpio kmod-tpm-i2c-atmel +endef +TARGET_DEVICES += aruba_ap-105 + define Device/avm_fritz300e ATH_SOC := ar7242 - DEVICE_TITLE := AVM FRITZ!WLAN Repeater 300E + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!WLAN Repeater 300E KERNEL := kernel-bin | append-dtb | lzma | eva-image KERNEL_INITRAMFS := $$(KERNEL) IMAGE_SIZE := 15232k @@ -90,7 +161,8 @@ TARGET_DEVICES += avm_fritz300e define Device/avm_fritz4020 ATH_SOC := qca9561 - DEVICE_TITLE := AVM FRITZ!Box 4020 + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!Box 4020 IMAGE_SIZE := 15232k KERNEL := kernel-bin | append-dtb | lzma | eva-image KERNEL_INITRAMFS := $$(KERNEL) @@ -104,8 +176,9 @@ TARGET_DEVICES += avm_fritz4020 define Device/buffalo_bhr-4grv ATH_SOC := ar7242 - DEVICE_TITLE := Buffalo BHR-4GRV - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := BHR-4GRV + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport IMAGE_SIZE := 32256k IMAGES += factory.bin tftp.bin IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) @@ -117,28 +190,32 @@ TARGET_DEVICES += buffalo_bhr-4grv define Device/buffalo_bhr-4grv2 ATH_SOC := qca9557 - DEVICE_TITLE := Buffalo BHR-4GRV2 + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := BHR-4GRV2 IMAGE_SIZE := 16000k endef TARGET_DEVICES += buffalo_bhr-4grv2 define Device/buffalo_wzr-hp-ag300h ATH_SOC := ar7161 - DEVICE_TITLE := Buffalo WZR-HP-AG300H - IMAGE_SIZE := 32256k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WZR-HP-AG300H + IMAGE_SIZE := 32320k IMAGES += factory.bin tftp.bin IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-AG300H 1.99 | buffalo-tag WZR-HP-AG300H 3 IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader SUPPORTED_DEVICES += wzr-hp-ag300h endef TARGET_DEVICES += buffalo_wzr-hp-ag300h define Device/buffalo_wzr-hp-g302h-a1a0 ATH_SOC := ar7242 - DEVICE_TITLE := Buffalo WZR-HP-G302H A1A0 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WZR-HP-G302H + DEVICE_VARIANT := A1A0 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport IMAGE_SIZE := 32128k IMAGES += factory.bin tftp.bin IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) @@ -150,8 +227,9 @@ TARGET_DEVICES += buffalo_wzr-hp-g302h-a1a0 define Device/buffalo_wzr-hp-g450h ATH_SOC := ar7242 - DEVICE_TITLE := Buffalo WZR-HP-G450H/WZR-450HP - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WZR-HP-G450H/WZR-450HP + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport IMAGE_SIZE := 32256k IMAGES += factory.bin tftp.bin IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) @@ -163,7 +241,9 @@ TARGET_DEVICES += buffalo_wzr-hp-g450h define Device/comfast_cf-e110n-v2 ATH_SOC := qca9533 - DEVICE_TITLE := COMFAST CF-E110N v2 + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-E110N + DEVICE_VARIANT := v2 DEVICE_PACKAGES := rssileds kmod-leds-gpio -swconfig -uboot-envtools IMAGE_SIZE := 16192k endef @@ -171,24 +251,68 @@ TARGET_DEVICES += comfast_cf-e110n-v2 define Device/comfast_cf-e120a-v3 ATH_SOC := ar9344 - DEVICE_TITLE := COMFAST CF-E120A v3 + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-E120A + DEVICE_VARIANT := v3 DEVICE_PACKAGES := rssileds kmod-leds-gpio -uboot-envtools IMAGE_SIZE := 8000k endef TARGET_DEVICES += comfast_cf-e120a-v3 +define Device/comfast_cf-e313ac + ATH_SOC := qca9531 + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-E313AC + DEVICE_PACKAGES := rssileds kmod-leds-gpio kmod-ath10k-ct ath10k-firmware-qca9888-ct \ + -swconfig -uboot-envtools + IMAGE_SIZE := 7936k +endef +TARGET_DEVICES += comfast_cf-e313ac + +define Device/comfast_cf-e314n-v2 + ATH_SOC := qca9531 + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-E314N + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := rssileds + IMAGE_SIZE := 7936k +endef +TARGET_DEVICES += comfast_cf-e314n-v2 + define Device/comfast_cf-e5 ATH_SOC := qca9531 - DEVICE_TITLE := COMFAST CF-E5/E7 - DEVICE_PACKAGES := rssileds kmod-leds-gpio kmod-usb-core kmod-usb2 kmod-usb-net \ + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-E5/E7 + DEVICE_PACKAGES := rssileds kmod-leds-gpio kmod-usb2 kmod-usb-net \ kmod-usb-net-qmi-wwan -swconfig -uboot-envtools IMAGE_SIZE := 16192k endef TARGET_DEVICES += comfast_cf-e5 +define Device/comfast_cf-wr650ac-v1 + ATH_SOC := qca9558 + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-WR650AC + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 16128k +endef +TARGET_DEVICES += comfast_cf-wr650ac-v1 + +define Device/comfast_cf-wr650ac-v2 + ATH_SOC := qca9558 + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-WR650AC + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += comfast_cf-wr650ac-v2 + define Device/devolo_dvl1200e ATH_SOC := qca9558 - DEVICE_TITLE := devolo WiFi pro 1200e + DEVICE_VENDOR := devolo + DEVICE_MODEL := WiFi pro 1200e DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct IMAGE_SIZE := 15936k endef @@ -196,7 +320,8 @@ TARGET_DEVICES += devolo_dvl1200e define Device/devolo_dvl1200i ATH_SOC := qca9558 - DEVICE_TITLE := devolo WiFi pro 1200i + DEVICE_VENDOR := devolo + DEVICE_MODEL := WiFi pro 1200i DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct IMAGE_SIZE := 15936k endef @@ -204,7 +329,8 @@ TARGET_DEVICES += devolo_dvl1200i define Device/devolo_dvl1750c ATH_SOC := qca9558 - DEVICE_TITLE := devolo WiFi pro 1750c + DEVICE_VENDOR := devolo + DEVICE_MODEL := WiFi pro 1750c DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct IMAGE_SIZE := 15936k endef @@ -212,7 +338,8 @@ TARGET_DEVICES += devolo_dvl1750c define Device/devolo_dvl1750e ATH_SOC := qca9558 - DEVICE_TITLE := devolo WiFi pro 1750e + DEVICE_VENDOR := devolo + DEVICE_MODEL := WiFi pro 1750e DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct IMAGE_SIZE := 15936k endef @@ -220,26 +347,40 @@ TARGET_DEVICES += devolo_dvl1750e define Device/devolo_dvl1750i ATH_SOC := qca9558 - DEVICE_TITLE := devolo WiFi pro 1750i + DEVICE_VENDOR := devolo + DEVICE_MODEL := WiFi pro 1750i DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct IMAGE_SIZE := 15936k endef TARGET_DEVICES += devolo_dvl1750i +define Device/devolo_dvl1750x + ATH_SOC := qca9558 + DEVICE_VENDOR := devolo + DEVICE_MODEL := WiFi pro 1750x + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 15936k +endef +TARGET_DEVICES += devolo_dvl1750x + define Device/dlink_dir-825-b1 ATH_SOC := ar7161 - DEVICE_TITLE := D-LINK DIR-825 B1 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-825 + DEVICE_VARIANT := B1 IMAGE_SIZE := 6208k IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader SUPPORTED_DEVICES += dir-825-b1 endef TARGET_DEVICES += dlink_dir-825-b1 define Device/dlink_dir-825-c1 ATH_SOC := ar9344 - DEVICE_TITLE := D-LINK DIR-825 C1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-825 + DEVICE_VARIANT := C1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader SUPPORTED_DEVICES += dir-825-c1 IMAGE_SIZE := 15936k IMAGES := factory.bin sysupgrade.bin @@ -252,8 +393,10 @@ TARGET_DEVICES += dlink_dir-825-c1 define Device/dlink_dir-835-a1 ATH_SOC := ar9344 - DEVICE_TITLE := D-LINK DIR-835 A1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-leds-reset kmod-owl-loader + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-835 + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := kmod-usb2 kmod-leds-reset kmod-owl-loader SUPPORTED_DEVICES += dir-835-a1 IMAGE_SIZE := 15936k IMAGES := factory.bin sysupgrade.bin @@ -264,12 +407,55 @@ define Device/dlink_dir-835-a1 endef TARGET_DEVICES += dlink_dir-835-a1 +define Device/dlink_dir-842-c + ATH_SOC := qca9563 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-842 + KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma + KERNEL_INITRAMFS := $$(KERNEL) | seama + IMAGES += factory.bin + SEAMA_MTDBLOCK := 5 + SEAMA_SIGNATURE := wrgac65_dlink.2015_dir842 + # 64 bytes offset: + # - 28 bytes seama_header + # - 36 bytes of META data (4-bytes aligned) + IMAGE/default := append-kernel | uImage lzma | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs + IMAGE/sysupgrade.bin := \ + $$(IMAGE/default) | seama | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := \ + $$(IMAGE/default) | pad-rootfs -x 64 | seama | seama-seal | check-size $$$$(IMAGE_SIZE) + IMAGE_SIZE := 15680k +endef + +define Device/dlink_dir-842-c1 + $(Device/dlink_dir-842-c) + DEVICE_VARIANT := C1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct +endef +TARGET_DEVICES += dlink_dir-842-c1 + +define Device/dlink_dir-842-c2 + $(Device/dlink_dir-842-c) + DEVICE_VARIANT := C2 + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9888-ct +endef +TARGET_DEVICES += dlink_dir-842-c2 + +define Device/dlink_dir-842-c3 + $(Device/dlink_dir-842-c) + DEVICE_VARIANT := C3 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct +endef +TARGET_DEVICES += dlink_dir-842-c3 + define Device/dlink_dir-859-a1 $(Device/seama) ATH_SOC := qca9563 - DEVICE_TITLE := D-LINK DIR-859 A1 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-859 + DEVICE_VARIANT := A1 IMAGE_SIZE := 15872k - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct SEAMA_SIGNATURE := wrgac37_dlink.2013gui_dir859 SUPPORTED_DEVICES += dir-859-a1 endef @@ -277,7 +463,8 @@ TARGET_DEVICES += dlink_dir-859-a1 define Device/elecom_wrc-1750ghbk2-i ATH_SOC := qca9563 - DEVICE_TITLE := ELECOM WRC-1750GHBK2-I/C + DEVICE_VENDOR := ELECOM + DEVICE_MODEL := WRC-1750GHBK2-I/C IMAGE_SIZE := 15808k KERNEL_INITRAMFS := $$(KERNEL) | pad-to 2 | \ add-elecom-factory-initramfs RN68 WRC-1750GHBK2 @@ -287,7 +474,8 @@ TARGET_DEVICES += elecom_wrc-1750ghbk2-i define Device/elecom_wrc-300ghbk2-i ATH_SOC := qca9563 - DEVICE_TITLE := ELECOM WRC-300GHBK2-I + DEVICE_VENDOR := ELECOM + DEVICE_MODEL := WRC-300GHBK2-I IMAGE_SIZE := 7616k KERNEL_INITRAMFS := $$(KERNEL) | pad-to 2 | \ add-elecom-factory-initramfs RN51 WRC-300GHBK2-I @@ -296,15 +484,30 @@ TARGET_DEVICES += elecom_wrc-300ghbk2-i define Device/embeddedwireless_dorin ATH_SOC := ar9331 - DEVICE_TITLE := Embedded Wireless Dorin + DEVICE_VENDOR := Embedded Wireless + DEVICE_MODEL := Dorin DEVICE_PACKAGES := kmod-usb-chipidea2 IMAGE_SIZE := 16000k endef TARGET_DEVICES += embeddedwireless_dorin +define Device/engenius_ecb1750 + ATH_SOC := qca9558 + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := ECB1750 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 15680k + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \ + senao-header -r 0x101 -p 0x6d -t 2 + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += engenius_ecb1750 + define Device/engenius_epg5000 ATH_SOC := qca9558 - DEVICE_TITLE := EnGenius EPG5000 + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EPG5000 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct kmod-usb2 IMAGE_SIZE := 14656k IMAGES += factory.dlf @@ -317,7 +520,8 @@ TARGET_DEVICES += engenius_epg5000 define Device/engenius_ews511ap ATH_SOC := qca9531 - DEVICE_TITLE := EnGenius EWS511AP + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EWS511AP DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct IMAGE_SIZE := 16000k endef @@ -325,16 +529,19 @@ TARGET_DEVICES += engenius_ews511ap define Device/etactica_eg200 ATH_SOC := ar9331 - DEVICE_TITLE := eTactica EG200 + DEVICE_VENDOR := eTactica + DEVICE_MODEL := EG200 DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-ledtrig-oneshot \ kmod-usb-serial kmod-usb-serial-ftdi kmod-usb-storage kmod-fs-ext4 + IMAGE_SIZE := 16000k SUPPORTED_DEVICES += rme-eg200 endef TARGET_DEVICES += etactica_eg200 define Device/glinet_gl-ar150 ATH_SOC := ar9330 - DEVICE_TITLE := GL.iNet GL-AR150 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AR150 DEVICE_PACKAGES := kmod-usb-chipidea2 IMAGE_SIZE := 16000k SUPPORTED_DEVICES += gl-ar150 @@ -343,118 +550,135 @@ TARGET_DEVICES += glinet_gl-ar150 define Device/glinet_gl-ar300m-common-nor ATH_SOC := qca9531 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + DEVICE_VENDOR := GL.iNet + DEVICE_PACKAGES := kmod-usb2 IMAGE_SIZE := 16000k SUPPORTED_DEVICES += gl-ar300m endef define Device/glinet_gl-ar300m-lite $(Device/glinet_gl-ar300m-common-nor) - DEVICE_TITLE := GL.iNet GL-AR300M-Lite + DEVICE_MODEL := GL-AR300M + DEVICE_VARIANT := Lite endef TARGET_DEVICES += glinet_gl-ar300m-lite -define Device/glinet_gl-ar300m-nor +define Device/glinet_gl-ar300m16 $(Device/glinet_gl-ar300m-common-nor) - DEVICE_TITLE := GL.iNet GL-AR300M + DEVICE_MODEL := GL-AR300M16 endef -TARGET_DEVICES += glinet_gl-ar300m-nor +TARGET_DEVICES += glinet_gl-ar300m16 -define Device/glinet_gl-ar750s - ATH_SOC := qca9563 - DEVICE_TITLE := GL.iNet GL-AR750S - DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct +define Device/glinet_gl-ar750 + ATH_SOC := qca9531 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AR750 + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9887-ct IMAGE_SIZE := 16000k - SUPPORTED_DEVICES += gl-ar750s + SUPPORTED_DEVICES += gl-ar750 endef -TARGET_DEVICES += glinet_gl-ar750s +TARGET_DEVICES += glinet_gl-ar750 define Device/glinet_gl-x750 ATH_SOC := qca9531 - DEVICE_TITLE := GL.iNet GL-X750 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9887-ct + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-X750 + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9887-ct IMAGE_SIZE := 16000k endef TARGET_DEVICES += glinet_gl-x750 define Device/iodata_etg3-r ATH_SOC := ar9342 - DEVICE_TITLE := I-O DATA ETG3-R + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := ETG3-R IMAGE_SIZE := 7680k + DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-basic endef TARGET_DEVICES += iodata_etg3-r define Device/iodata_wn-ac1167dgr ATH_SOC := qca9557 - DEVICE_TITLE := I-O DATA WN-AC1167DGR + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WN-AC1167DGR IMAGE_SIZE := 14656k IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \ senao-header -r 0x30a -p 0x61 -t 2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct endef TARGET_DEVICES += iodata_wn-ac1167dgr define Device/iodata_wn-ac1600dgr ATH_SOC := qca9557 - DEVICE_TITLE := I-O DATA WN-AC1600DGR + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WN-AC1600DGR IMAGE_SIZE := 14656k IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \ senao-header -r 0x30a -p 0x60 -t 2 -v 200 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct endef TARGET_DEVICES += iodata_wn-ac1600dgr define Device/iodata_wn-ac1600dgr2 ATH_SOC := qca9557 - DEVICE_TITLE := I-O DATA WN-AC1600DGR2 + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WN-AC1600DGR2/DGR3 IMAGE_SIZE := 14656k - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + IMAGES += dgr2-dgr3-factory.bin + IMAGE/dgr2-dgr3-factory.bin := \ + append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \ senao-header -r 0x30a -p 0x60 -t 2 -v 200 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct endef TARGET_DEVICES += iodata_wn-ac1600dgr2 define Device/iodata_wn-ag300dgr ATH_SOC := ar1022 - DEVICE_TITLE := I-O DATA WN-AG300DGR + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WN-AG300DGR IMAGE_SIZE := 15424k IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \ senao-header -r 0x30a -p 0x47 -t 2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + DEVICE_PACKAGES := kmod-usb2 endef TARGET_DEVICES += iodata_wn-ag300dgr define Device/jjplus_ja76pf2 ATH_SOC := ar7161 - DEVICE_TITLE := jjPlus JA76PF2 + DEVICE_VENDOR := jjPlus + DEVICE_MODEL := JA76PF2 DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-mini -uboot-envtools fconfig - IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE) -# IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata + IMAGES := kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE) KERNEL_INITRAMFS := kernel-bin | append-dtb IMAGE_SIZE := 16000k + SUPPORTED_DEVICES += ja76pf2 endef TARGET_DEVICES += jjplus_ja76pf2 define Device/librerouter_librerouter-v1 ATH_SOC := qca9558 - DEVICE_TITLE := LibreRouter v1 + DEVICE_VENDOR := Librerouter + DEVICE_MODEL := LibreRouter + DEVICE_VARIANT := v1 IMAGE_SIZE := 7936k - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + DEVICE_PACKAGES := kmod-usb2 endef TARGET_DEVICES += librerouter_librerouter-v1 define Device/nec_wg1200cr ATH_SOC := qca9563 - DEVICE_TITLE := NEC Aterm WG1200CR + DEVICE_VENDOR := NEC + DEVICE_MODEL := Aterm WG1200CR IMAGE_SIZE := 7616k SEAMA_MTDBLOCK := 6 SEAMA_SIGNATURE := wrgac72_necpf.2016gui_wg1200cr @@ -472,7 +696,8 @@ TARGET_DEVICES += nec_wg1200cr define Device/nec_wg800hp ATH_SOC := qca9563 - DEVICE_TITLE := NEC Aterm WG800HP + DEVICE_VENDOR := NEC + DEVICE_MODEL := Aterm WG800HP IMAGE_SIZE := 7104k IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ @@ -483,75 +708,7 @@ define Device/nec_wg800hp endef TARGET_DEVICES += nec_wg800hp -define Device/ocedo_koala - ATH_SOC := qca9558 - DEVICE_TITLE := OCEDO Koala - DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct - SUPPORTED_DEVICES += koala - IMAGE_SIZE := 7424k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) -endef -TARGET_DEVICES += ocedo_koala - -define Device/ocedo_raccoon - ATH_SOC := ar9344 - DEVICE_TITLE := OCEDO Raccoon - IMAGE_SIZE := 7424k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) -endef -TARGET_DEVICES += ocedo_raccoon - -define Device/ocedo_ursus - ATH_SOC := qca9558 - DEVICE_TITLE := OCEDO Ursus - DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct - IMAGE_SIZE := 7424k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) -endef -TARGET_DEVICES += ocedo_ursus - -define Device/openmesh_om5p-ac-v2 - ATH_SOC := qca9558 - DEVICE_TITLE := OpenMesh OM5P-AC v2 - DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct om-watchdog - IMAGE_SIZE := 7808k - SUPPORTED_DEVICES += om5p-acv2 -endef -TARGET_DEVICES += openmesh_om5p-ac-v2 - -define Device/pcs_cap324 - ATH_SOC := ar9344 - DEVICE_TITLE := PowerCloud Systems CAP324 - IMAGE_SIZE := 16000k - SUPPORTED_DEVICES += cap324 -endef -TARGET_DEVICES += pcs_cap324 - -define Device/pcs_cr3000 - ATH_SOC := ar9341 - DEVICE_TITLE := PowerCloud Systems CR3000 - IMAGE_SIZE := 7808k - SUPPORTED_DEVICES += cr3000 -endef -TARGET_DEVICES += pcs_cr3000 - -define Device/pcs_cr5000 - ATH_SOC := ar9344 - DEVICE_TITLE := PowerCloud Systems CR5000 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-core - IMAGE_SIZE := 7808k - SUPPORTED_DEVICES += cr5000 -endef -TARGET_DEVICES += pcs_cr5000 - -define Device/netgear_wndr3x00 - ATH_SOC := ar7161 - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader - $(Device/netgear_ath79) -endef - -define Device/netgear_ex7300_ex6400 +define Device/netgear_ex6400_ex7300 ATH_SOC := qca9558 NETGEAR_KERNEL_MAGIC := 0x27051956 NETGEAR_BOARD_ID := EX7300series @@ -563,20 +720,28 @@ define Device/netgear_ex7300_ex6400 endef define Device/netgear_ex6400 - $(Device/netgear_ex7300_ex6400) - DEVICE_TITLE := NETGEAR EX6400 + $(Device/netgear_ex6400_ex7300) + DEVICE_MODEL := EX6400 endef TARGET_DEVICES += netgear_ex6400 define Device/netgear_ex7300 - $(Device/netgear_ex7300_ex6400) - DEVICE_TITLE := NETGEAR EX7300 + $(Device/netgear_ex6400_ex7300) + DEVICE_MODEL := EX7300 endef TARGET_DEVICES += netgear_ex7300 +define Device/netgear_wndr3x00 + ATH_SOC := ar7161 + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader + $(Device/netgear_ath79) +endef + define Device/netgear_wndr3700 $(Device/netgear_wndr3x00) - DEVICE_TITLE := NETGEAR WNDR3700 + DEVICE_MODEL := WNDR3700 + DEVICE_VARIANT := v1 NETGEAR_KERNEL_MAGIC := 0x33373030 NETGEAR_BOARD_ID := WNDR3700 IMAGE_SIZE := 7680k @@ -588,55 +753,255 @@ TARGET_DEVICES += netgear_wndr3700 define Device/netgear_wndr3700v2 $(Device/netgear_wndr3x00) - DEVICE_TITLE := NETGEAR WNDR3700v2 + DEVICE_MODEL := WNDR3700 + DEVICE_VARIANT := v2 NETGEAR_KERNEL_MAGIC := 0x33373031 NETGEAR_BOARD_ID := WNDR3700v2 NETGEAR_HW_ID := 29763654+16+64 IMAGE_SIZE := 15872k - SUPPORTED_DEVICES += wndr3700v2 + SUPPORTED_DEVICES += wndr3700 endef TARGET_DEVICES += netgear_wndr3700v2 -define Device/pisen_wmm003n - $(Device/tplink-8mlzma) - ATH_SOC := ar9331 - DEVICE_TITLE := Pisen WMM003N (Cloud Easy Power) - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-chipidea2 - TPLINK_HWID := 0x07030101 -endef -TARGET_DEVICES += pisen_wmm003n - define Device/netgear_wndr3800 $(Device/netgear_wndr3x00) - DEVICE_TITLE := NETGEAR WNDR3800 + DEVICE_MODEL := WNDR3800 NETGEAR_KERNEL_MAGIC := 0x33373031 NETGEAR_BOARD_ID := WNDR3800 NETGEAR_HW_ID := 29763654+16+128 IMAGE_SIZE := 15872k - SUPPORTED_DEVICES += wndr3800 + SUPPORTED_DEVICES += wndr3700 endef TARGET_DEVICES += netgear_wndr3800 +define Device/netgear_wndr3800ch + $(Device/netgear_wndr3x00) + DEVICE_MODEL := WNDR3800CH + NETGEAR_KERNEL_MAGIC := 0x33373031 + NETGEAR_BOARD_ID := WNDR3800CH + NETGEAR_HW_ID := 29763654+16+128 + IMAGE_SIZE := 15872k + SUPPORTED_DEVICES += wndr3700 +endef +TARGET_DEVICES += netgear_wndr3800ch + +define Device/netgear_wnr2200_common + ATH_SOC := ar7241 + DEVICE_MODEL := WNR2200 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + NETGEAR_KERNEL_MAGIC := 0x32323030 + NETGEAR_BOARD_ID := wnr2200 + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | \ + append-rootfs | pad-rootfs + $(Device/netgear_ath79) +endef + +define Device/netgear_wnr2200-8m + $(Device/netgear_wnr2200_common) + DEVICE_VARIANT := 8M + NETGEAR_HW_ID := 29763600+08+64 + IMAGE_SIZE := 7808k + IMAGES += factory-NA.img + IMAGE/factory-NA.img := $$(IMAGE/default) | netgear-dni NA | \ + check-size $$$$(IMAGE_SIZE) + SUPPORTED_DEVICES += wnr2200 +endef +TARGET_DEVICES += netgear_wnr2200-8m + +define Device/netgear_wnr2200-16m + $(Device/netgear_wnr2200_common) + DEVICE_VARIANT := 16M + DEVICE_ALT0_VENDOR := NETGEAR + DEVICE_ALT0_MODEL := WNR2200 + DEVICE_ALT0_VARIANT := CN/RU + NETGEAR_HW_ID := + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += netgear_wnr2200-16m + +define Device/ocedo_koala + ATH_SOC := qca9558 + DEVICE_VENDOR := Ocedo + DEVICE_MODEL := Koala + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + SUPPORTED_DEVICES += koala + IMAGE_SIZE := 7424k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += ocedo_koala + +define Device/ocedo_raccoon + ATH_SOC := ar9344 + DEVICE_VENDOR := Ocedo + DEVICE_MODEL := Raccoon + IMAGE_SIZE := 7424k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += ocedo_raccoon + +define Device/ocedo_ursus + ATH_SOC := qca9558 + DEVICE_VENDOR := Ocedo + DEVICE_MODEL := Ursus + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 7424k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += ocedo_ursus + +define Device/openmesh_om5p-ac-v2 + ATH_SOC := qca9558 + DEVICE_VENDOR := OpenMesh + DEVICE_MODEL := OM5P-AC + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct om-watchdog + IMAGE_SIZE := 7808k + SUPPORTED_DEVICES += om5p-acv2 +endef +TARGET_DEVICES += openmesh_om5p-ac-v2 + +define Device/pcs_cap324 + ATH_SOC := ar9344 + DEVICE_VENDOR := PowerCloud Systems + DEVICE_MODEL := CAP324 + IMAGE_SIZE := 16000k + SUPPORTED_DEVICES += cap324 +endef +TARGET_DEVICES += pcs_cap324 + +define Device/pcs_cr3000 + ATH_SOC := ar9341 + DEVICE_VENDOR := PowerCloud Systems + DEVICE_MODEL := CR3000 + IMAGE_SIZE := 7808k + SUPPORTED_DEVICES += cr3000 +endef +TARGET_DEVICES += pcs_cr3000 + +define Device/pcs_cr5000 + ATH_SOC := ar9344 + DEVICE_VENDOR := PowerCloud Systems + DEVICE_MODEL := CR5000 + DEVICE_PACKAGES := kmod-usb2 + IMAGE_SIZE := 7808k + SUPPORTED_DEVICES += cr5000 +endef +TARGET_DEVICES += pcs_cr5000 + define Device/phicomm_k2t ATH_SOC := qca9563 - DEVICE_TITLE := Phicomm K2T + DEVICE_VENDOR := Phicomm + DEVICE_MODEL := K2T IMAGE_SIZE := 15744k IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) DEVICE_PACKAGES := kmod-leds-reset kmod-ath10k-ct ath10k-firmware-qca9888-ct endef TARGET_DEVICES += phicomm_k2t +define Device/pisen_ts-d084 + $(Device/tplink-8mlzma) + ATH_SOC := ar9331 + DEVICE_VENDOR := PISEN + DEVICE_MODEL := TS-D084 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-chipidea2 + TPLINK_HWID := 0x07030101 +endef +TARGET_DEVICES += pisen_ts-d084 + +define Device/pisen_wmb001n + ATH_SOC := ar9341 + DEVICE_VENDOR := PISEN + DEVICE_MODEL := WMB001N + IMAGE_SIZE := 14080k + DEVICE_PACKAGES := kmod-i2c-core kmod-i2c-gpio kmod-usb2 + LOADER_TYPE := bin + LOADER_FLASH_OFFS := 0x20000 + COMPILE := loader-$(1).bin loader-$(1).uImage + COMPILE/loader-$(1).bin := loader-okli-compile + COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | uImage lzma + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + IMAGES += factory.bin + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pisen_wmb001n-factory $(1) +endef +TARGET_DEVICES += pisen_wmb001n + +define Device/pisen_wmm003n + $(Device/tplink-8mlzma) + ATH_SOC := ar9331 + DEVICE_VENDOR := PISEN + DEVICE_MODEL := Cloud Easy Power (WMM003N) + DEVICE_PACKAGES := kmod-usb2 kmod-usb-chipidea2 + TPLINK_HWID := 0x07030101 +endef +TARGET_DEVICES += pisen_wmm003n + +define Device/qihoo_c301 + $(Device/seama) + ATH_SOC := ar9344 + DEVICE_VENDOR := Qihoo + DEVICE_MODEL := C301 + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct uboot-envtools + IMAGE_SIZE := 15744k + SEAMA_SIGNATURE := wrgac26_qihoo360_360rg + SUPPORTED_DEVICES += qihoo-c301 +endef +TARGET_DEVICES += qihoo_c301 + define Device/rosinson_wr818 ATH_SOC := qca9563 - DEVICE_TITLE := ROSINSON WR818 + DEVICE_VENDOR := Rosinson + DEVICE_MODEL := WR818 IMAGE_SIZE := 15872k - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport endef TARGET_DEVICES += rosinson_wr818 +define Device/sitecom_wlr-7100 + ATH_SOC := ar1022 + DEVICE_VENDOR := Sitecom + DEVICE_MODEL := WLR-7100 + DEVICE_VARIANT := v1 002 + DEVICE_PACKAGES := ath10k-firmware-qca988x kmod-ath10k kmod-usb2 + IMAGES += factory.dlf + IMAGE/factory.dlf := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \ + senao-header -r 0x222 -p 0x53 -t 2 + IMAGE_SIZE := 7488k +endef +TARGET_DEVICES += sitecom_wlr-7100 + +define Device/trendnet_tew-823dru + ATH_SOC := qca9558 + DEVICE_VENDOR := Trendnet + DEVICE_MODEL := TEW-823DRU + DEVICE_VARIANT := v1.0R + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct + SUPPORTED_DEVICES += tew-823dru + IMAGE_SIZE := 15296k + IMAGES := factory.bin sysupgrade.bin + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs + IMAGE/factory.bin := $$(IMAGE/default) | pad-offset $$$$(IMAGE_SIZE) 26 | \ + append-string 00AP135AR9558-RT-131129-00 | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += trendnet_tew-823dru + +define Device/wd_mynet-n750 + $(Device/seama) + ATH_SOC := ar9344 + DEVICE_VENDOR := Western Digital + DEVICE_MODEL := My Net N750 + IMAGE_SIZE := 15872k + DEVICE_PACKAGES := kmod-usb2 + SEAMA_SIGNATURE := wrgnd13_wd_av + SUPPORTED_DEVICES += mynet-n750 +endef +TARGET_DEVICES += wd_mynet-n750 + define Device/wd_mynet-wifi-rangeextender ATH_SOC := ar9344 - DEVICE_TITLE := Western Digital My Net Wi-Fi Range Extender + DEVICE_VENDOR := Western Digital + DEVICE_MODEL := My Net Wi-Fi Range Extender DEVICE_PACKAGES := rssileds nvram -swconfig IMAGE_SIZE := 7808k ADDPATTERN_ID := mynet-rext @@ -649,7 +1014,8 @@ TARGET_DEVICES += wd_mynet-wifi-rangeextender define Device/winchannel_wb2000 ATH_SOC := ar9344 - DEVICE_TITLE := Winchannel WB2000 + DEVICE_VENDOR := Winchannel + DEVICE_MODEL := WB2000 IMAGE_SIZE := 15872k DEVICE_PACKAGES := kmod-i2c-core kmod-i2c-gpio kmod-rtc-ds1307 kmod-usb2 kmod-usb-ledtrig-usbport endef @@ -657,15 +1023,51 @@ TARGET_DEVICES += winchannel_wb2000 define Device/xiaomi_mi-router-4q ATH_SOC := qca9561 - DEVICE_TITLE := Xiaomi Mi Router 4Q + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Mi Router 4Q IMAGE_SIZE := 14336k endef TARGET_DEVICES += xiaomi_mi-router-4q define Device/yuncore_a770 ATH_SOC := qca9531 - DEVICE_TITLE := YunCore A770 + DEVICE_VENDOR := YunCore + DEVICE_MODEL := A770 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct IMAGE_SIZE := 16000k + IMAGES += tftp.bin + IMAGE/tftp.bin := $$(IMAGE/sysupgrade.bin) | yuncore-tftp-header-16m endef TARGET_DEVICES += yuncore_a770 + +define Device/yuncore_a782 + ATH_SOC := qca9563 + DEVICE_VENDOR := YunCore + DEVICE_MODEL := A782 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct + IMAGE_SIZE := 16000k + IMAGES += tftp.bin + IMAGE/tftp.bin := $$(IMAGE/sysupgrade.bin) | yuncore-tftp-header-16m +endef +TARGET_DEVICES += yuncore_a782 + +define Device/yuncore_xd4200 + ATH_SOC := qca9563 + DEVICE_VENDOR := YunCore + DEVICE_MODEL := XD4200 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct + IMAGE_SIZE := 16000k + IMAGES += tftp.bin + IMAGE/tftp.bin := $$(IMAGE/sysupgrade.bin) | yuncore-tftp-header-16m +endef +TARGET_DEVICES += yuncore_xd4200 + +define Device/zbtlink_zbt-wd323 + ATH_SOC := ar9344 + DEVICE_VENDOR := ZBT + DEVICE_MODEL := WD323 + IMAGE_SIZE := 16000k + DEVICE_PACKAGES := kmod-usb2 kmod-i2c-core kmod-i2c-gpio kmod-rtc-pcf8563 \ + kmod-usb-serial kmod-usb-serial-cp210x uqmi +endef +TARGET_DEVICES += zbtlink_zbt-wd323 diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index eee419194..19c2d4214 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -1,13 +1,171 @@ -define Device/glinet_gl-ar300m-nand +include ./common-netgear.mk # for netgear-uImage + +# attention: only zlib compression is allowed for the boot fs +define Build/zyxel-buildkerneljffs + rm -rf $(KDIR_TMP)/zyxelnbg6716 + mkdir -p $(KDIR_TMP)/zyxelnbg6716/image/boot + cp $@ $(KDIR_TMP)/zyxelnbg6716/image/boot/vmlinux.lzma.uImage + $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \ + --big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \ + -o $@ \ + -d $(KDIR_TMP)/zyxelnbg6716/image + rm -rf $(KDIR_TMP)/zyxelnbg6716 +endef + +define Build/zyxel-factory + let \ + maxsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \ + let size="$$(stat -c%s $@)"; \ + if [ $$size -lt $$maxsize ]; then \ + $(STAGING_DIR_HOST)/bin/mkrasimage \ + -b $(RAS_BOARD) \ + -v $(RAS_VERSION) \ + -r $@ \ + -s $$maxsize \ + -o $@.new \ + -l 131072 \ + && mv $@.new $@ ; \ + fi +endef + +define Device/aerohive_hiveap-121 + ATH_SOC := ar9344 + DEVICE_VENDOR := Aerohive + DEVICE_MODEL := HiveAP 121 + DEVICE_PACKAGES := kmod-usb2 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 116m + KERNEL_SIZE := 5120k + UBINIZE_OPTS := -E 5 + SUPPORTED_DEVICES += hiveap-121 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += aerohive_hiveap-121 + +define Device/glinet_gl-ar300m-common-nand ATH_SOC := qca9531 - DEVICE_TITLE := GL-AR300M (NAND) - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-usb-ledtrig-usbport + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AR300M + DEVICE_PACKAGES := kmod-usb2 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 16000k + PAGESIZE := 2048 + VID_HDR_OFFSET := 2048 +endef + +define Device/glinet_gl-ar300m-nand + $(Device/glinet_gl-ar300m-common-nand) + DEVICE_VARIANT := NAND + BLOCKSIZE := 128k + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + SUPPORTED_DEVICES += glinet,gl-ar300m-nor +endef +TARGET_DEVICES += glinet_gl-ar300m-nand + +define Device/glinet_gl-ar300m-nor + $(Device/glinet_gl-ar300m-common-nand) + DEVICE_VARIANT := NOR + BLOCKSIZE := 64k + SUPPORTED_DEVICES += glinet,gl-ar300m-nand gl-ar300m +endef +TARGET_DEVICES += glinet_gl-ar300m-nor + +define Device/glinet_gl-ar750s-common + ATH_SOC := qca9563 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AR750S + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct \ + kmod-usb2 kmod-usb-storage block-mount + KERNEL_SIZE := 4096k + IMAGE_SIZE := 16000k + PAGESIZE := 2048 + VID_HDR_OFFSET := 2048 +endef + +define Device/glinet_gl-ar750s-nor-nand + $(Device/glinet_gl-ar750s-common) + DEVICE_VARIANT := NOR/NAND + BLOCKSIZE := 128k + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + SUPPORTED_DEVICES += glinet,gl-ar750s-nor +endef +TARGET_DEVICES += glinet_gl-ar750s-nor-nand + +define Device/glinet_gl-ar750s-nor + $(Device/glinet_gl-ar750s-common) + DEVICE_VARIANT := NOR + BLOCKSIZE := 64k + SUPPORTED_DEVICES += gl-ar750s glinet,gl-ar750s glinet,gl-ar750s-nor-nand +endef +TARGET_DEVICES += glinet_gl-ar750s-nor + +# fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff) +define Device/netgear_ath79_nand + DEVICE_VENDOR := NETGEAR + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport KERNEL_SIZE := 2048k BLOCKSIZE := 128k PAGESIZE := 2048 - VID_HDR_OFFSET := 512 - IMAGES += factory.ubi - IMAGE/sysupgrade.bin := sysupgrade-tar - IMAGE/factory.ubi := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + IMAGE_SIZE := 25600k + KERNEL := kernel-bin | append-dtb | lzma -d20 | \ + pad-offset $$(KERNEL_SIZE) 129 | \ + netgear-uImage lzma | append-string -e '\xff' | \ + append-uImage-fakehdr filesystem $$(NETGEAR_KERNEL_MAGIC) + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma + IMAGES := sysupgrade.bin factory.img + IMAGE/factory.img := append-kernel | append-ubi | netgear-dni | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata | check-size $$$$(IMAGE_SIZE) + UBINIZE_OPTS := -E 5 endef -TARGET_DEVICES += glinet_gl-ar300m-nand + +define Device/netgear_wndr3700-v4 + ATH_SOC := ar9344 + DEVICE_MODEL := WNDR3700 + DEVICE_VARIANT := v4 + NETGEAR_KERNEL_MAGIC := 0x33373033 + NETGEAR_BOARD_ID := WNDR3700v4 + NETGEAR_HW_ID := 29763948+128+128 + SUPPORTED_DEVICES += wndr3700v4 + $(Device/netgear_ath79_nand) +endef +TARGET_DEVICES += netgear_wndr3700-v4 + +define Device/netgear_wndr4300 + ATH_SOC := ar9344 + DEVICE_MODEL := WNDR4300 + NETGEAR_KERNEL_MAGIC := 0x33373033 + NETGEAR_BOARD_ID := WNDR4300 + NETGEAR_HW_ID := 29763948+0+128+128+2x2+3x3 + SUPPORTED_DEVICES += wndr4300 + $(Device/netgear_ath79_nand) +endef +TARGET_DEVICES += netgear_wndr4300 + +define Device/zyxel_nbg6716 + ATH_SOC := qca9558 + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := NBG6716 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct + RAS_BOARD := NBG6716 + RAS_ROOTFS_SIZE := 29696k + RAS_VERSION := "OpenWrt Linux-$(LINUX_VERSION)" + KERNEL_SIZE := 4096k + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL := kernel-bin | append-dtb | uImage none | \ + zyxel-buildkerneljffs | check-size 4096k + IMAGES := sysupgrade.tar sysupgrade-4M-Kernel.bin factory.bin + IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata + IMAGE/sysupgrade-4M-Kernel.bin/squashfs := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to 263192576 | gzip + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | zyxel-factory + UBINIZE_OPTS := -E 5 +endef +TARGET_DEVICES += zyxel_nbg6716 +DEVICE_VARS += RAS_ROOTFS_SIZE RAS_BOARD RAS_VERSION diff --git a/target/linux/ath79/image/tiny-netgear.mk b/target/linux/ath79/image/tiny-netgear.mk index 42d6cab8b..d257ddd0e 100644 --- a/target/linux/ath79/image/tiny-netgear.mk +++ b/target/linux/ath79/image/tiny-netgear.mk @@ -4,14 +4,15 @@ define Device/netgear_ar7240 ATH_SOC := ar7240 NETGEAR_KERNEL_MAGIC := 0x32303631 KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma - IMAGE_SIZE := 3904k + IMAGE_SIZE := 3712k IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs $(Device/netgear_ath79) endef define Device/netgear_wnr612-v2 $(Device/netgear_ar7240) - DEVICE_TITLE := Netgear WNR612v2 + DEVICE_MODEL := WNR612 + DEVICE_VARIANT := v2 DEVICE_DTS := ar7240_netgear_wnr612-v2 NETGEAR_BOARD_ID := REALWNR612V2 SUPPORTED_DEVICES += wnr612-v2 @@ -20,8 +21,39 @@ TARGET_DEVICES += netgear_wnr612-v2 define Device/on_n150r $(Device/netgear_ar7240) - DEVICE_TITLE := ON Network N150R + DEVICE_VENDOR := On Networks + DEVICE_MODEL := N150R NETGEAR_BOARD_ID := N150R SUPPORTED_DEVICES += n150r endef TARGET_DEVICES += on_n150r + +define Device/netgear_wnr1000-v2 + ATH_SOC := ar7240 + DEVICE_MODEL := WNR1000 + DEVICE_VARIANT := v2 + NETGEAR_KERNEL_MAGIC := 0x31303031 + NETGEAR_BOARD_ID := WNR1000V2 + NETGEAR_HW_ID := 29763331+4+32 + IMAGE_SIZE := 3712k + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs + SUPPORTED_DEVICES += wnr1000-v2 + $(Device/netgear_ath79) +endef +TARGET_DEVICES += netgear_wnr1000-v2 + +define Device/netgear_wnr2000-v3 + ATH_SOC := ar7241 + DEVICE_MODEL := WNR2000 + DEVICE_VARIANT := v3 + NETGEAR_KERNEL_MAGIC := 0x32303033 + NETGEAR_BOARD_ID := WNR2000V3 + NETGEAR_HW_ID := 29763551+04+32 + IMAGE_SIZE := 3712k + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs + IMAGES += factory-NA.img + IMAGE/factory-NA.img := $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE) + SUPPORTED_DEVICES += wnr2000-v3 + $(Device/netgear_ath79) +endef +TARGET_DEVICES += netgear_wnr2000-v3 diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk index fb8ab75cb..3fc933392 100644 --- a/target/linux/ath79/image/tiny-tp-link.mk +++ b/target/linux/ath79/image/tiny-tp-link.mk @@ -1,10 +1,9 @@ include ./common-tp-link.mk - define Device/tplink_tl-mr10u $(Device/tplink-4mlzma) ATH_SOC := ar9331 - DEVICE_TITLE := TP-Link TL-MR10U + DEVICE_MODEL := TL-MR10U DEVICE_PACKAGES := kmod-usb-chipidea2 TPLINK_HWID := 0x00100101 SUPPORTED_DEVICES += tl-mr10u @@ -13,9 +12,11 @@ TARGET_DEVICES += tplink_tl-mr10u define Device/tplink_tl-mr3020-v1 $(Device/tplink-4mlzma) + IMAGE_SIZE := 3840k ATH_SOC := ar9331 - DEVICE_TITLE := TP-Link TL-MR3020 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-MR3020 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x30200001 SUPPORTED_DEVICES += tl-mr3020 endef @@ -24,8 +25,9 @@ TARGET_DEVICES += tplink_tl-mr3020-v1 define Device/tplink_tl-mr3040-v2 $(Device/tplink-4mlzma) ATH_SOC := ar9331 - DEVICE_TITLE := TP-Link TL-MR3040 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea2 kmod-usb-ledtrig-usbport + DEVICE_MODEL := TL-MR3040 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x30400002 SUPPORTED_DEVICES += tl-mr3040-v2 endef @@ -34,9 +36,10 @@ TARGET_DEVICES += tplink_tl-mr3040-v2 define Device/tplink_tl-mr3220-v1 $(Device/tplink-4m) ATH_SOC := ar7241 - DEVICE_TITLE := TP-Link TL-MR3220 v1 + DEVICE_MODEL := TL-MR3220 + DEVICE_VARIANT := v1 TPLINK_HWID := 0x32200001 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += tl-mr3220-v1 endef TARGET_DEVICES += tplink_tl-mr3220-v1 @@ -44,17 +47,30 @@ TARGET_DEVICES += tplink_tl-mr3220-v1 define Device/tplink_tl-mr3420-v1 $(Device/tplink-4m) ATH_SOC := ar7241 - DEVICE_TITLE := TP-Link TL-MR3420 v1 + DEVICE_MODEL := TL-MR3420 + DEVICE_VARIANT := v1 TPLINK_HWID := 0x34200001 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += tl-mr3420-v1 endef TARGET_DEVICES += tplink_tl-mr3420-v1 +define Device/tplink_tl-mr3420-v2 + $(Device/tplink-4mlzma) + ATH_SOC := ar9341 + DEVICE_MODEL := TL-MR3420 + DEVICE_VARIANT := v2 + TPLINK_HWID := 0x34200002 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += tl-mr3420-v2 +endef +TARGET_DEVICES += tplink_tl-mr3420-v2 + define Device/tplink_tl-wa901nd-v2 $(Device/tplink-4m) ATH_SOC := ar9132 - DEVICE_TITLE := TP-Link TL-WA901ND v2 + DEVICE_MODEL := TL-WA901ND + DEVICE_VARIANT := v2 TPLINK_HWID := 0x09010002 endef TARGET_DEVICES += tplink_tl-wa901nd-v2 @@ -62,7 +78,7 @@ TARGET_DEVICES += tplink_tl-wa901nd-v2 define Device/tplink_tl-wr703n $(Device/tplink-4mlzma) ATH_SOC := ar9331 - DEVICE_TITLE := TP-Link TL-WR703N + DEVICE_MODEL := TL-WR703N DEVICE_PACKAGES := kmod-usb-chipidea2 TPLINK_HWID := 0x07030101 SUPPORTED_DEVICES += tl-wr703n @@ -72,7 +88,8 @@ TARGET_DEVICES += tplink_tl-wr703n define Device/tplink_tl-wr740n-v1 $(Device/tplink-4m) ATH_SOC := ar7240 - DEVICE_TITLE := TP-Link TL-WR740N v1/v2 + DEVICE_MODEL := TL-WR740N + DEVICE_VARIANT := v1/v2 TPLINK_HWID := 0x07400001 endef TARGET_DEVICES += tplink_tl-wr740n-v1 @@ -80,7 +97,8 @@ TARGET_DEVICES += tplink_tl-wr740n-v1 define Device/tplink_tl-wr740n-v3 $(Device/tplink-4m) ATH_SOC := ar7240 - DEVICE_TITLE := TP-Link TL-WR740N v3 + DEVICE_MODEL := TL-WR740N + DEVICE_VARIANT := v3 TPLINK_HWID := 0x07400003 endef TARGET_DEVICES += tplink_tl-wr740n-v3 @@ -88,7 +106,8 @@ TARGET_DEVICES += tplink_tl-wr740n-v3 define Device/tplink_tl-wr740n-v4 $(Device/tplink-4mlzma) ATH_SOC := ar9331 - DEVICE_TITLE := TP-Link TL-WR740N v4 + DEVICE_MODEL := TL-WR740N + DEVICE_VARIANT := v4 TPLINK_HWID := 0x07400004 SUPPORTED_DEVICES += tl-wr740n-v4 endef @@ -97,7 +116,8 @@ TARGET_DEVICES += tplink_tl-wr740n-v4 define Device/tplink_tl-wr741-v1 $(Device/tplink-4m) ATH_SOC := ar7240 - DEVICE_TITLE := TP-Link TL-WR741N/ND v1/v2 + DEVICE_MODEL := TL-WR741N/ND + DEVICE_VARIANT := v1/v2 TPLINK_HWID := 0x07410001 endef TARGET_DEVICES += tplink_tl-wr741-v1 @@ -105,7 +125,8 @@ TARGET_DEVICES += tplink_tl-wr741-v1 define Device/tplink_tl-wr741nd-v4 $(Device/tplink-4mlzma) ATH_SOC := ar9331 - DEVICE_TITLE := TP-Link TL-WR741N/ND v4 + DEVICE_MODEL := TL-WR741N/ND + DEVICE_VARIANT := v4 TPLINK_HWID := 0x07410004 SUPPORTED_DEVICES += tl-wr741n-v4 endef @@ -114,7 +135,8 @@ TARGET_DEVICES += tplink_tl-wr741nd-v4 define Device/tplink_tl-wr743nd-v1 $(Device/tplink-4m) ATH_SOC := ar7240 - DEVICE_TITLE := TP-Link TL-WR743ND v1 + DEVICE_MODEL := TL-WR743ND + DEVICE_VARIANT := v1 TPLINK_HWID := 0x07430001 endef TARGET_DEVICES += tplink_tl-wr743nd-v1 @@ -122,7 +144,8 @@ TARGET_DEVICES += tplink_tl-wr743nd-v1 define Device/tplink_tl-wr841-v5 $(Device/tplink-4m) ATH_SOC := ar7240 - DEVICE_TITLE := TP-Link TL-WR841N/ND v5/v6 + DEVICE_MODEL := TL-WR841N/ND + DEVICE_VARIANT := v5/v6 TPLINK_HWID := 0x08410005 endef TARGET_DEVICES += tplink_tl-wr841-v5 @@ -130,7 +153,8 @@ TARGET_DEVICES += tplink_tl-wr841-v5 define Device/tplink_tl-wr841-v7 $(Device/tplink-4m) ATH_SOC := ar7241 - DEVICE_TITLE := TP-Link TL-WR841N/ND v7 + DEVICE_MODEL := TL-WR841N/ND + DEVICE_VARIANT := v7 TPLINK_HWID := 0x08410007 SUPPORTED_DEVICES += tl-wr841-v7 endef @@ -139,7 +163,8 @@ TARGET_DEVICES += tplink_tl-wr841-v7 define Device/tplink_tl-wr841-v8 $(Device/tplink-4mlzma) ATH_SOC := ar9341 - DEVICE_TITLE := TP-Link TL-WR841N/ND v8 + DEVICE_MODEL := TL-WR841N/ND + DEVICE_VARIANT := v8 TPLINK_HWID := 0x08410008 SUPPORTED_DEVICES += tl-wr841n-v8 endef @@ -148,26 +173,81 @@ TARGET_DEVICES += tplink_tl-wr841-v8 define Device/tplink_tl-wr841-v9 $(Device/tplink-4mlzma) ATH_SOC := qca9533 - DEVICE_TITLE := TP-Link TL-WR841N/ND v9 + DEVICE_MODEL := TL-WR841N/ND + DEVICE_VARIANT := v9 TPLINK_HWID := 0x08410009 + SUPPORTED_DEVICES += tl-wr841n-v9 endef TARGET_DEVICES += tplink_tl-wr841-v9 +define Device/tplink_tl-wr841-v10 + $(Device/tplink-4mlzma) + ATH_SOC := qca9533 + DEVICE_MODEL := TL-WR841N/ND + DEVICE_VARIANT := v10 + TPLINK_HWID := 0x08410010 + SUPPORTED_DEVICES += tl-wr841n-v9 +endef +TARGET_DEVICES += tplink_tl-wr841-v10 + define Device/tplink_tl-wr841-v11 $(Device/tplink-4mlzma) ATH_SOC := qca9533 - DEVICE_TITLE := TP-Link TL-WR841N/ND v11 + DEVICE_MODEL := TL-WR841N/ND + DEVICE_VARIANT := v11 TPLINK_HWID := 0x08410011 + SUPPORTED_DEVICES += tl-wr841n-v11 IMAGES += factory-us.bin factory-eu.bin IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU endef TARGET_DEVICES += tplink_tl-wr841-v11 +define Device/tplink_tl-wr841-v12 + $(Device/tplink-4mlzma) + ATH_SOC := qca9533 + DEVICE_MODEL := TL-WR841N/ND + DEVICE_VARIANT := v12 + TPLINK_HWID := 0x08410012 + SUPPORTED_DEVICES += tl-wr841n-v11 + IMAGES += factory-us.bin factory-eu.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += tplink_tl-wr841-v12 + +define Device/tplink_tl-wr940n-v3 + $(Device/tplink-4mlzma) + ATH_SOC := tp9343 + DEVICE_MODEL := TL-WR940N + DEVICE_VARIANT := v3 + TPLINK_HWID := 0x09410006 + SUPPORTED_DEVICES += tl-wr941nd-v6 +endef +TARGET_DEVICES += tplink_tl-wr940n-v3 + +define Device/tplink_tl-wr940n-v4 + $(Device/tplink-4mlzma) + ATH_SOC := tp9343 + DEVICE_MODEL := TL-WR940N + DEVICE_VARIANT := v4 + TPLINK_HWID := 0x09400004 + SUPPORTED_DEVICES += tl-wr940n-v4 + IMAGES += factory-us.bin factory-eu.bin factory-br.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU + IMAGE/factory-br.bin := append-rootfs | mktplinkfw factory -C BR +endef +TARGET_DEVICES += tplink_tl-wr940n-v4 + define Device/tplink_tl-wr941-v2 $(Device/tplink-4m) ATH_SOC := ar9132 - DEVICE_TITLE := TP-Link TL-WR941N/ND v2/v3 + DEVICE_MODEL := TL-WR941ND + DEVICE_VARIANT := v2/v3 + DEVICE_ALT0_VENDOR := TP-Link + DEVICE_ALT0_MODEL := TL-WR941N + DEVICE_ALT0_VARIANT := v2/v3 TPLINK_HWID := 0x09410002 TPLINK_HWREV := 2 endef @@ -176,15 +256,30 @@ TARGET_DEVICES += tplink_tl-wr941-v2 define Device/tplink_tl-wr941-v4 $(Device/tplink-4m) ATH_SOC := ar7240 - DEVICE_TITLE := TP-Link TL-WR941N/ND v4 + DEVICE_MODEL := TL-WR941ND + DEVICE_VARIANT := v4 + DEVICE_ALT0_VENDOR := TP-Link + DEVICE_ALT0_MODEL := TL-WR941N + DEVICE_ALT0_VARIANT := v4 TPLINK_HWID := 0x09410004 endef TARGET_DEVICES += tplink_tl-wr941-v4 +define Device/tplink_tl-wr941nd-v6 + $(Device/tplink-4mlzma) + ATH_SOC := tp9343 + DEVICE_MODEL := TL-WR941ND + DEVICE_VARIANT := v6 + TPLINK_HWID := 0x09410006 + SUPPORTED_DEVICES += tl-wr941nd-v6 +endef +TARGET_DEVICES += tplink_tl-wr941nd-v6 + define Device/tplink_tl-wr941n-v7-cn $(Device/tplink-4mlzma) ATH_SOC := qca9558 - DEVICE_TITLE := TP-Link TL-WR941N v7 (CN) + DEVICE_MODEL := TL-WR941N + DEVICE_VARIANT := v7 (CN) TPLINK_HWID := 0x09410007 endef TARGET_DEVICES += tplink_tl-wr941n-v7-cn diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index bf7a5e140..8f867575a 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -2,7 +2,8 @@ include ./common-buffalo.mk define Device/buffalo_whr-g301n ATH_SOC := ar7240 - DEVICE_TITLE := Buffalo WHR-G301N + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WHR-G301N IMAGE_SIZE := 3712k IMAGES += factory.bin tftp.bin IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) @@ -14,8 +15,9 @@ TARGET_DEVICES += buffalo_whr-g301n define Device/pqi_air-pen ATH_SOC := ar9330 - DEVICE_TITLE := PQI Air-Pen - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + DEVICE_VENDOR := PQI + DEVICE_MODEL := Air-Pen + DEVICE_PACKAGES := kmod-usb2 IMAGE_SIZE := 7680k SUPPORTED_DEVICES += pqi-air-pen endef diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds new file mode 100755 index 000000000..49d400549 --- /dev/null +++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds @@ -0,0 +1,23 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) +boardname="${board##*,}" + +case "$board" in +glinet,gl-ar300m-nand|\ +glinet,gl-ar300m-nor) + ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0" + ;; +netgear,wndr3700-v4|\ +netgear,wndr4300) + ucidef_set_led_switch "wan-amber" "WAN (amber)" "netgear:amber:wan" "switch0" "0x20" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network new file mode 100755 index 000000000..f7e43addc --- /dev/null +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -0,0 +1,60 @@ +#!/bin/sh + +. /lib/functions/system.sh +. /lib/functions/uci-defaults.sh + +ath79_setup_interfaces() +{ + local board="$1" + + case "$board" in + aerohive,hiveap-121) + ucidef_set_interface_lan "eth0" + ;; + glinet,gl-ar750s-nor|\ + glinet,gl-ar750s-nor-nand) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:2" "3:lan:1" "1:wan" + ;; + netgear,wndr3700-v4|\ + netgear,wndr4300) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" + ;; + zyxel,nbg6716) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1" + ;; + *) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ;; + esac +} + +ath79_setup_macs() +{ + local board="$1" + + case "$board" in + netgear,wndr3700-v4|\ + netgear,wndr4300) + wan_mac=$(mtd_get_mac_binary caldata 0x6) + ;; + zyxel,nbg6716) + lan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) + wan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + +board_config_update +board=$(board_name) +ath79_setup_interfaces $board +ath79_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom new file mode 100644 index 000000000..25bafe67a --- /dev/null +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -0,0 +1,36 @@ +#!/bin/sh + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 + +. /lib/functions/caldata.sh + +board=$(board_name) + +case "$FIRMWARE" in +"ath9k-eeprom-ahb-18100000.wmac.bin") + case $board in + netgear,wndr3700-v4|\ + netgear,wndr4300) + caldata_extract "caldata" 0x1000 0x440 + ;; + zyxel,nbg6716) + caldata_extract "art" 0x1000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr) + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; +"ath9k-eeprom-pci-0000:00:00.0.bin") + case $board in + netgear,wndr3700-v4|\ + netgear,wndr4300) + caldata_extract "caldata" 0x5000 0x440 + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; +esac diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata new file mode 100644 index 000000000..9305f061f --- /dev/null +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -0,0 +1,26 @@ +#!/bin/sh + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 + +. /lib/functions/caldata.sh + +board=$(board_name) + +case "$FIRMWARE" in +"ath10k/cal-pci-0000:00:00.0.bin") + case $board in + glinet,gl-ar750s-nor|\ + glinet,gl-ar750s-nor-nand) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1) + ;; + zyxel,nbg6716) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) + ;; + esac + ;; +*) + exit 1 + ;; +esac diff --git a/target/linux/ath79/nand/base-files/etc/init.d/bootcount b/target/linux/ath79/nand/base-files/etc/init.d/bootcount new file mode 100755 index 000000000..c82386b55 --- /dev/null +++ b/target/linux/ath79/nand/base-files/etc/init.d/bootcount @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +# SPDX-License-Identifier: GPL-2.0 + +START=99 + +boot() { + case $(board_name) in + glinet,gl-ar300m-nand) + fw_setenv bootcount 0 + ;; + esac +} diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh b/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh new file mode 100644 index 000000000..86729f8f2 --- /dev/null +++ b/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2019 Jeff Kletsky +# + +glinet_using_boot_dev_switch() { + if [ "$(fw_printenv -n boot_dev 2>/dev/null)" = "on" ] ; then + >&2 echo "NOTE: boot_dev=on; use switch to control boot partition" + true + else + false + fi +} + +glinet_set_next_boot_nand() { + mkdir -p /var/lock + ! glinet_using_boot_dev_switch && \ + fw_setenv bootcount 0 && \ + >&2 echo "Next boot set for NAND" +} + +glinet_set_next_boot_nor() { + mkdir -p /var/lock + ! glinet_using_boot_dev_switch && \ + fw_setenv bootcount 3 && \ + >&2 echo "Next boot set for NOR" +} + +glinet_nand_nor_do_upgrade() { + set_next_boot_nand() { glinet_set_next_boot_nand; } + set_next_boot_nor() { glinet_set_next_boot_nor; } + nand_nor_do_upgrade "$1" +} + +nand_nor_do_upgrade() { + local upgrade_file="$1" + + local pn + local found="" + local err + + case "$(get_magic_long "$upgrade_file")" in + + "27051956") # U-Boot Image Magic + + for pn in "nor_${PART_NAME}" "$PART_NAME" ; do # firmware + if [ "$(find_mtd_index "$pn")" ] ; then + PART_NAME="$pn" + found="yes" + break + fi + done + if [ "$found" = "yes" ] ; then + >&2 echo "Running NOR upgrade" + default_do_upgrade "$upgrade_file" + # At this time, default_do_upgrade() exits on error + type set_next_boot_nor >/dev/null && set_next_boot_nor + else + >&2 echo "ERROR: UPGRADE FAILED: Unable to locate '$PART_NAME' or 'nor_${PART_NAME}'" + exit 1 + fi + ;; + + *) # otherwise a file that nand_do_upgrade can process + + for pn in "nand_${CI_KERNPART}" "$CI_KERNPART" ; do # kernel + if [ "$(find_mtd_index "$pn")" ] ; then + CI_KERNPART="$pn" + break + fi + done + for pn in "nand_${CI_UBIPART}" "$CI_UBIPART" ; do # ubi + if [ "$(find_mtd_index "$pn")" ] ; then + CI_UBIPART="$pn" + break + fi + done + for pn in "nand_${CI_ROOTPART}" "$CI_ROOTPART" ; do #rootfs + if [ "$(find_mtd_index "$pn")" ] ; then + CI_ROOTPART="$pn" + break + fi + done + >&2 echo "Running NAND upgrade" + # TODO: change order when NAND upgrade offers return + type set_next_boot_nand >/dev/null && set_next_boot_nand + nand_do_upgrade "$upgrade_file" + ;; + esac +} diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh new file mode 100644 index 000000000..15d88a361 --- /dev/null +++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh @@ -0,0 +1,29 @@ +# Copyright (C) 2011 OpenWrt.org + +PART_NAME=firmware + +REQUIRE_IMAGE_METADATA=1 +platform_check_image() { + return 0 +} + +RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + glinet,gl-ar300m-nand|\ + glinet,gl-ar300m-nor) + glinet_nand_nor_do_upgrade "$1" + ;; + glinet,gl-ar750s-nor|\ + glinet,gl-ar750s-nor-nand) + nand_nor_do_upgrade "$1" + ;; + *) + nand_do_upgrade "$1" + ;; + esac +} diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default index 738c29c9b..4742ad52d 100644 --- a/target/linux/ath79/nand/config-default +++ b/target/linux/ath79/nand/config-default @@ -1,14 +1,18 @@ -CONFIG_BCH=y CONFIG_MTD_NAND=y -CONFIG_MTD_NAND_BCH=y +CONFIG_MTD_NAND_AR934X=y +CONFIG_MTD_NAND_CORE=y CONFIG_MTD_NAND_ECC=y -CONFIG_MTD_NAND_ECC_BCH=y -CONFIG_MTD_SPINAND_MT29F=y -CONFIG_MTD_SPINAND_ONDIEECC=y +CONFIG_MTD_SPI_NAND=y CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BLOCK=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_BLOCK is not set # CONFIG_MTD_UBI_FASTMAP is not set # CONFIG_MTD_UBI_GLUEBI is not set -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -# CONFIG_UBIFS_FS is not set +# CONFIG_PCI_AR71XX is not set +# CONFIG_PHY_AR7100_USB is not set +CONFIG_PHY_AR7200_USB=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y diff --git a/target/linux/ath79/nand/profiles/00-default.mk b/target/linux/ath79/nand/profiles/00-default.mk index 06ab79038..6e618113a 100644 --- a/target/linux/ath79/nand/profiles/00-default.mk +++ b/target/linux/ath79/nand/profiles/00-default.mk @@ -8,7 +8,7 @@ define Profile/Default NAME:=Default Profile PACKAGES:= \ - kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport + kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport PRIORITY := 1 endef diff --git a/target/linux/ath79/nand/target.mk b/target/linux/ath79/nand/target.mk index 91afe675c..c565c9b2b 100644 --- a/target/linux/ath79/nand/target.mk +++ b/target/linux/ath79/nand/target.mk @@ -1,9 +1,10 @@ BOARDNAME := Generic devices with NAND flash -FEATURES += squashfs nand rtc + +FEATURES += squashfs nand DEFAULT_PACKAGES += wpad-basic define Target/Description - Build firmware for Atheros AR71xx/AR913x based boards with - NAND flash, e.g. Netgear WNDR4300. + Firmware for boards using Qualcomm Atheros, MIPS-based SoCs + in the ar72xx and subsequent series, with support for NAND flash endef diff --git a/target/linux/ath79/patches-4.14/0038-at803x-disable-delays.patch b/target/linux/ath79/patches-4.14/0038-at803x-disable-delays.patch new file mode 100644 index 000000000..cf05d0fc4 --- /dev/null +++ b/target/linux/ath79/patches-4.14/0038-at803x-disable-delays.patch @@ -0,0 +1,27 @@ +Until upstream commit 6d4cd041f0af("net: phy: at803x: disable delay +only for RGMII mode"), delays were not disabled on driver probe +for the Atheros AR803x PHYs, although the RX delay is enabled on +soft and hard reset. + +In addition, the TX delay setting is retained on soft-reset. + +This patch disables both delays on config init to align the behavior +with kernel 5.1 and higher. It can be safely dropped with kernel 5.1. + +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -320,6 +320,14 @@ static int at803x_config_init(struct phy + if (ret < 0) + return ret; + ++ /* Disable RX delay */ ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, ++ AT803X_DEBUG_RX_CLK_DLY_EN, 0); ++ ++ /* Disable TX delay */ ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, ++ AT803X_DEBUG_TX_CLK_DLY_EN, 0); ++ + if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID || + phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { + ret = at803x_enable_rx_delay(phydev); diff --git a/target/linux/ath79/patches-4.19/0038-at803x-disable-delays.patch b/target/linux/ath79/patches-4.19/0038-at803x-disable-delays.patch new file mode 100644 index 000000000..56325a831 --- /dev/null +++ b/target/linux/ath79/patches-4.19/0038-at803x-disable-delays.patch @@ -0,0 +1,27 @@ +Until upstream commit 6d4cd041f0af("net: phy: at803x: disable delay +only for RGMII mode"), delays were not disabled on driver probe +for the Atheros AR803x PHYs, although the RX delay is enabled on +soft and hard reset. + +In addition, the TX delay setting is retained on soft-reset. + +This patch disables both delays on config init to align the behavior +with kernel 5.1 and higher. It can be safely dropped with kernel 5.1. + +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -295,6 +295,14 @@ static int at803x_config_init(struct phy + if (ret < 0) + return ret; + ++ /* Disable RX delay */ ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, ++ AT803X_DEBUG_RX_CLK_DLY_EN, 0); ++ ++ /* Disable TX delay */ ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, ++ AT803X_DEBUG_TX_CLK_DLY_EN, 0); ++ + if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID || + phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { + ret = at803x_enable_rx_delay(phydev); diff --git a/target/linux/ath79/patches-4.19/408-mtd-redboot_partition_scan.patch b/target/linux/ath79/patches-4.19/408-mtd-redboot_partition_scan.patch new file mode 100644 index 000000000..cd41e7ceb --- /dev/null +++ b/target/linux/ath79/patches-4.19/408-mtd-redboot_partition_scan.patch @@ -0,0 +1,44 @@ +--- a/drivers/mtd/redboot.c ++++ b/drivers/mtd/redboot.c +@@ -76,12 +76,18 @@ static int parse_redboot_partitions(stru + static char nullstring[] = "unallocated"; + #endif + ++ buf = vmalloc(master->erasesize); ++ if (!buf) ++ return -ENOMEM; ++ ++ restart: + if ( directory < 0 ) { + offset = master->size + directory * master->erasesize; + while (mtd_block_isbad(master, offset)) { + if (!offset) { + nogood: + printk(KERN_NOTICE "Failed to find a non-bad block to check for RedBoot partition table\n"); ++ vfree(buf); + return -EIO; + } + offset -= master->erasesize; +@@ -94,10 +100,6 @@ static int parse_redboot_partitions(stru + goto nogood; + } + } +- buf = vmalloc(master->erasesize); +- +- if (!buf) +- return -ENOMEM; + + printk(KERN_NOTICE "Searching for RedBoot partition table in %s at offset 0x%lx\n", + master->name, offset); +@@ -170,6 +172,11 @@ static int parse_redboot_partitions(stru + } + if (i == numslots) { + /* Didn't find it */ ++ if (offset + master->erasesize < master->size) { ++ /* not at the end of the flash yet, maybe next block :) */ ++ directory++; ++ goto restart; ++ } + printk(KERN_NOTICE "No RedBoot partition table detected in %s\n", + master->name); + ret = 0; diff --git a/target/linux/ath79/patches-4.19/440-mtd-ar934x-nand-driver.patch b/target/linux/ath79/patches-4.19/440-mtd-ar934x-nand-driver.patch new file mode 100644 index 000000000..b74ad9074 --- /dev/null +++ b/target/linux/ath79/patches-4.19/440-mtd-ar934x-nand-driver.patch @@ -0,0 +1,25 @@ +--- a/drivers/mtd/nand/raw/Kconfig ++++ b/drivers/mtd/nand/raw/Kconfig +@@ -561,4 +561,12 @@ config MTD_NAND_TEGRA + is supported. Extra OOB bytes when using HW ECC are currently + not supported. + ++config MTD_NAND_AR934X ++ tristate "Support for NAND controller on Qualcomm Atheros AR934x/QCA955x SoCs" ++ depends on ATH79 || COMPILE_TEST ++ depends on HAS_IOMEM ++ help ++ Enables support for NAND controller on Qualcomm Atheros SoCs. ++ This controller is found on AR934x and QCA955x SoCs. ++ + endif # MTD_NAND +--- a/drivers/mtd/nand/raw/Makefile ++++ b/drivers/mtd/nand/raw/Makefile +@@ -57,6 +57,7 @@ obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcm + obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nandc.o + obj-$(CONFIG_MTD_NAND_MTK) += mtk_ecc.o mtk_nand.o + obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o ++obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o + + nand-objs := nand_base.o nand_bbt.o nand_timings.o nand_ids.o + nand-objs += nand_amd.o diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/01_leds b/target/linux/ath79/tiny/base-files/etc/board.d/01_leds new file mode 100755 index 000000000..03f135f0b --- /dev/null +++ b/target/linux/ath79/tiny/base-files/etc/board.d/01_leds @@ -0,0 +1,85 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) +boardname="${board##*,}" + +case "$board" in +buffalo,whr-g301n) + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" + ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "$boardname:green:lan3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "$boardname:green:lan4" "switch0" "0x10" + ;; +netgear,wnr1000-v2|\ +netgear,wnr2000-v3) + ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0" + ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" "switch0" "0x02" "0x04" + ucidef_set_led_switch "lan2green" "LAN2 (green)" "netgear:green:lan2" "switch0" "0x04" "0x04" + ucidef_set_led_switch "lan3green" "LAN3 (green)" "netgear:green:lan3" "switch0" "0x08" "0x04" + ucidef_set_led_switch "lan4green" "LAN4 (green)" "netgear:green:lan4" "switch0" "0x10" "0x04" + ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" "switch0" "0x02" "0x02" + ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" "switch0" "0x04" "0x02" + ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" "switch0" "0x08" "0x02" + ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" "switch0" "0x10" "0x02" + ;; +netgear,wnr612-v2|\ +on,n150r) + ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0" + ucidef_set_led_switch "lan1" "LAN1" "netgear:green:lan1" "switch0" "0x02" "0x0f" + ucidef_set_led_switch "lan2" "LAN2" "netgear:green:lan2" "switch0" "0x04" "0x0f" + ;; +tplink,tl-mr3020-v1|\ +tplink,tl-mr3040-v2) + ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" + ;; +tplink,tl-mr3420-v2|\ +tplink,tl-wr740n-v4|\ +tplink,tl-wr741nd-v4|\ +tplink,tl-wr841-v8) + ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04" + ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10" + ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" + ;; +tplink,tl-wr740n-v1|\ +tplink,tl-wr740n-v3|\ +tplink,tl-wr741-v1|\ +tplink,tl-wr743nd-v1|\ +tplink,tl-wr841-v5|\ +tplink,tl-wr941-v4) + ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0" + ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10" + ;; +tplink,tl-wr841-v9|\ +tplink,tl-wr841-v10|\ +tplink,tl-wr841-v11|\ +tplink,tl-wr841-v12) + ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04" + ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" + ;; +tplink,tl-wr940n-v3|\ +tplink,tl-wr940n-v4|\ +tplink,tl-wr941nd-v6) + ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04" + ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/02_network b/target/linux/ath79/tiny/base-files/etc/board.d/02_network new file mode 100755 index 000000000..b2616456e --- /dev/null +++ b/target/linux/ath79/tiny/base-files/etc/board.d/02_network @@ -0,0 +1,96 @@ +#!/bin/sh + +. /lib/functions/system.sh +. /lib/functions/uci-defaults.sh + +ath79_setup_interfaces() +{ + local board="$1" + + case "$board" in + buffalo,whr-g301n) + ucidef_set_interface_wan "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" + ;; + netgear,wnr1000-v2|\ + netgear,wnr2000-v3|\ + netgear,wnr612-v2|\ + on,n150r|\ + tplink,tl-wr740n-v1|\ + tplink,tl-wr740n-v3|\ + tplink,tl-wr741-v1|\ + tplink,tl-wr743nd-v1|\ + tplink,tl-wr841-v5|\ + tplink,tl-wr941-v4) + ucidef_set_interface_wan "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" + ;; + pqi,air-pen|\ + tplink,tl-mr10u|\ + tplink,tl-mr3020-v1|\ + tplink,tl-mr3040-v2|\ + tplink,tl-wa901nd-v2|\ + tplink,tl-wr703n) + ucidef_set_interface_lan "eth0" + ;; + tplink,tl-mr3220-v1|\ + tplink,tl-mr3420-v1|\ + tplink,tl-wr841-v7|\ + tplink,tl-wr841-v9|\ + tplink,tl-wr841-v10|\ + tplink,tl-wr841-v11|\ + tplink,tl-wr841-v12|\ + tplink,tl-wr940n-v3|\ + tplink,tl-wr940n-v4|\ + tplink,tl-wr941nd-v6) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" + ;; + tplink,tl-mr3420-v2|\ + tplink,tl-wr740n-v4|\ + tplink,tl-wr741nd-v4|\ + tplink,tl-wr841-v8) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" + ;; + tplink,tl-wr941-v2) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" + ;; + tplink,tl-wr941n-v7-cn) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" + ;; + *) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ;; + esac +} + +ath79_setup_macs() +{ + local board="$1" + + case "$board" in + tplink,tl-wr941-v2|\ + tplink,tl-wr941n-v7-cn) + base_mac=$(mtd_get_mac_binary u-boot 0x1fc00) + wan_mac=$(macaddr_add "$base_mac" 1) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + +board_config_update +board=$(board_name) +ath79_setup_interfaces $board +ath79_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom new file mode 100644 index 000000000..3da95cc16 --- /dev/null +++ b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -0,0 +1,38 @@ +#!/bin/sh + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 + +. /lib/functions/caldata.sh + +board=$(board_name) + +case "$FIRMWARE" in +"ath9k-eeprom-pci-0000:00:00.0.bin") + case $board in + buffalo,whr-g301n|\ + tplink,tl-wr841-v5|\ + tplink,tl-wr941-v4) + caldata_extract "art" 0x1000 0xeb8 + ;; + netgear,wnr1000-v2|\ + netgear,wnr2000-v3|\ + netgear,wnr612-v2|\ + on,n150r|\ + tplink,tl-mr3220-v1|\ + tplink,tl-mr3420-v1|\ + tplink,tl-wr740n-v1|\ + tplink,tl-wr740n-v3|\ + tplink,tl-wr741-v1|\ + tplink,tl-wr743nd-v1|\ + tplink,tl-wr841-v7) + caldata_extract "art" 0x1000 0x1000 + ;; + pqi,air-pen) + caldata_extract "art" 0x1000 0x7d2 + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; +esac diff --git a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh new file mode 100644 index 000000000..b02ab9a08 --- /dev/null +++ b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh @@ -0,0 +1,20 @@ +# +# Copyright (C) 2011 OpenWrt.org +# + +PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 + +platform_check_image() { + return 0 +} + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + *) + default_do_upgrade "$1" + ;; + esac +} diff --git a/target/linux/ath79/tiny/config-default b/target/linux/ath79/tiny/config-default index 9062ba11f..90cd5534c 100644 --- a/target/linux/ath79/tiny/config-default +++ b/target/linux/ath79/tiny/config-default @@ -1,17 +1,8 @@ -CONFIG_BLK_MQ_PCI=y CONFIG_LEDS_RESET=y CONFIG_NET_DSA=y CONFIG_NET_DSA_MV88E6060=y CONFIG_NET_DSA_TAG_TRAILER=y CONFIG_NET_SWITCHDEV=y -CONFIG_OF_ADDRESS_PCI=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_PCI=y -CONFIG_PCI_AR71XX=y -CONFIG_PCI_AR724X=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y CONFIG_PHY_AR7100_USB=y CONFIG_PHY_AR7200_USB=y CONFIG_REGULATOR=y