From b8c337abe5015a2deddee0e5debc4be164fd80a0 Mon Sep 17 00:00:00 2001 From: lean Date: Sun, 3 Apr 2022 13:34:55 +0800 Subject: [PATCH] ath79: add kernel 5.15 support --- target/linux/ath79/Makefile | 3 +- .../etc/hotplug.d/ieee80211/00-wifi-migration | 2 + target/linux/ath79/config-5.10 | 3 +- target/linux/ath79/config-5.15 | 207 +++++ target/linux/ath79/dts/ar7100.dtsi | 6 + .../linux/ath79/dts/ar7161_aruba_ap-105.dts | 23 +- .../dts/ar7161_buffalo_wzr-hp-ag300h.dtsi | 28 +- target/linux/ath79/dts/ar7161_meraki_mr16.dts | 23 +- .../linux/ath79/dts/ar7161_netgear_wndr.dtsi | 11 +- .../ath79/dts/ar7161_netgear_wndr3700-v2.dts | 50 + .../ath79/dts/ar7161_netgear_wndr3700.dts | 48 + .../ath79/dts/ar7161_netgear_wndr3800.dts | 50 + .../ath79/dts/ar7161_netgear_wndr3800ch.dts | 49 + .../ath79/dts/ar7161_netgear_wndrmac-v1.dts | 50 + .../ath79/dts/ar7161_netgear_wndrmac-v2.dts | 50 + target/linux/ath79/dts/ar7240.dtsi | 3 + .../ath79/dts/ar7240_buffalo_whr-g301n.dts | 21 +- .../ath79/dts/ar7240_engenius_enh202-v1.dts | 16 +- .../ath79/dts/ar7240_netgear_wnr1000-v2.dts | 25 +- .../ath79/dts/ar7240_netgear_wnr612-v2.dtsi | 25 +- .../ath79/dts/ar7240_openmesh_om2p-v1.dts | 170 ++++ target/linux/ath79/dts/ar7240_tplink.dtsi | 13 +- .../linux/ath79/dts/ar7240_tplink_tl-wa.dtsi | 3 +- .../linux/ath79/dts/ar7240_tplink_tl-wr.dtsi | 10 +- target/linux/ath79/dts/ar7241.dtsi | 3 + .../ath79/dts/ar7241_netgear_wnr2000-v3.dts | 25 +- .../ath79/dts/ar7241_netgear_wnr2200-16m.dts | 34 + .../ath79/dts/ar7241_netgear_wnr2200-8m.dts | 34 + .../ath79/dts/ar7241_netgear_wnr2200.dtsi | 7 - target/linux/ath79/dts/ar7241_tplink.dtsi | 23 +- .../ath79/dts/ar7241_tplink_tl-wr842n-v1.dts | 23 +- .../dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts | 22 +- target/linux/ath79/dts/ar7241_ubnt_unifi.dts | 17 +- target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi | 5 +- target/linux/ath79/dts/ar7242.dtsi | 3 + .../ath79/dts/ar7242_buffalo_bhr-4grv.dts | 13 +- .../dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts | 16 +- .../ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts | 16 +- .../ath79/dts/ar7242_engenius_eap350-v1.dts | 18 +- .../ath79/dts/ar7242_engenius_ecb350-v1.dts | 18 +- target/linux/ath79/dts/ar7242_meraki_mr12.dts | 21 +- .../ath79/dts/ar7242_tplink_tl-wr2543-v1.dts | 16 +- .../ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts | 13 +- .../ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts | 22 +- target/linux/ath79/dts/ar7242_ubnt_sw.dtsi | 17 +- target/linux/ath79/dts/ar724x_ubnt_xm.dtsi | 20 +- .../dts/ar9132_buffalo_wzr-hp-g300nh.dtsi | 57 +- .../ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts | 16 +- .../dts/ar9132_tplink_tl-wr1043nd-v1.dts | 16 +- .../ath79/dts/ar9132_tplink_tl-wr941-v2.dts | 16 +- target/linux/ath79/dts/ar9330.dtsi | 3 + .../ath79/dts/ar9330_glinet_gl-ar150.dts | 19 +- .../linux/ath79/dts/ar9330_openmesh_om2p.dtsi | 20 +- target/linux/ath79/dts/ar9330_pqi_air-pen.dts | 20 +- .../linux/ath79/dts/ar9330_ziking_cpe46b.dts | 18 +- .../ath79/dts/ar9331_8dev_carambola2.dts | 20 +- .../ath79/dts/ar9331_alfa-network_ap121f.dtsi | 24 +- .../dts/ar9331_embeddedwireless_dorin.dts | 17 +- .../linux/ath79/dts/ar9331_etactica_eg200.dts | 13 +- target/linux/ath79/dts/ar9331_glinet_6408.dts | 31 + target/linux/ath79/dts/ar9331_glinet_6416.dts | 31 + .../linux/ath79/dts/ar9331_glinet_64xx.dtsi | 11 - .../linux/ath79/dts/ar9331_glinet_gl-mifi.dts | 16 +- .../ath79/dts/ar9331_glinet_gl-usb150.dts | 13 +- .../ath79/dts/ar9331_hak5_lan-turtle.dtsi | 20 +- .../dts/ar9331_hak5_wifi-pineapple-nano.dts | 13 +- ...sen_wpr003n.dts => ar9331_onion_omega.dts} | 113 ++- .../linux/ath79/dts/ar9331_pisen_ts-d084.dts | 16 +- .../linux/ath79/dts/ar9331_pisen_wmm003n.dts | 16 +- .../ath79/dts/ar9331_teltonika_rut230-v1.dts | 23 +- .../ath79/dts/ar9331_tplink_tl-mr3020-v1.dts | 16 +- .../ath79/dts/ar9331_tplink_tl-mr3040-v2.dts | 16 +- .../dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi | 16 +- .../ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi | 34 + .../ath79/dts/ar9331_tplink_tl-wr710n.dtsi | 9 - .../dts/ar9331_tplink_tl-wr741nd-v4.dtsi | 23 +- .../ath79/dts/ar9341_engenius_eap300-v2.dts | 13 +- .../dts/ar9341_engenius_ens202ext-v1.dts | 16 +- .../ath79/dts/ar9341_openmesh_om2p-hs.dtsi | 20 +- target/linux/ath79/dts/ar9341_pcs_cr3000.dts | 18 +- .../linux/ath79/dts/ar9341_pisen_wmb001n.dts | 13 +- target/linux/ath79/dts/ar9341_tplink.dtsi | 9 - .../ath79/dts/ar9341_tplink_tl-mr3420-v2.dts | 32 + .../linux/ath79/dts/ar9341_tplink_tl-wa.dtsi | 16 +- .../ath79/dts/ar9341_tplink_tl-wr841-v8.dts | 32 + .../ath79/dts/ar9341_tplink_tl-wr842n-v2.dts | 30 + ...9342_mikrotik_routerboard-912uag-2hpnd.dts | 28 +- .../ath79/dts/ar9342_ubnt_aircube-ac.dts | 15 +- .../ath79/dts/ar9342_ubnt_powerbeam-m2-xw.dts | 34 + ...xw.dts => ar9342_ubnt_powerbeam-m5-xw.dts} | 4 +- target/linux/ath79/dts/ar9342_ubnt_wa.dtsi | 12 +- .../linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi | 3 +- .../linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi | 3 +- target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 13 +- .../ath79/dts/ar9344_aerohive_hiveap-121.dts | 23 +- .../ath79/dts/ar9344_alfa-network_n5q.dts | 31 +- .../dts/ar9344_araknis_an-300-ap-i-n.dts | 120 +++ .../linux/ath79/dts/ar9344_atheros_db120.dts | 250 +++++ .../ath79/dts/ar9344_comfast_cf-e120a-v3.dts | 20 +- .../ath79/dts/ar9344_compex_wpj344-16m.dts | 13 +- .../ath79/dts/ar9344_devolo_dlan_wifi.dtsi | 15 +- .../dts/ar9344_embeddedwireless_balin.dts | 130 +++ .../ath79/dts/ar9344_engenius_eap600.dts | 23 +- .../ath79/dts/ar9344_engenius_ecb600.dts | 23 +- .../ath79/dts/ar9344_engenius_exx600.dtsi | 4 +- .../ar9344_mikrotik_routerboard-16m-nor.dtsi | 65 ++ .../ar9344_mikrotik_routerboard-lhg-5nd.dts | 91 ++ .../ar9344_mikrotik_routerboard-sxt-5n.dtsi | 1 - .../linux/ath79/dts/ar9344_netgear_r6100.dts | 231 +++++ .../linux/ath79/dts/ar9344_netgear_wndr.dtsi | 23 +- .../linux/ath79/dts/ar9344_ocedo_raccoon.dts | 40 +- .../ath79/dts/ar9344_openmesh_mr600.dtsi | 26 +- .../ath79/dts/ar9344_openmesh_om5p-an.dts | 230 +++++ .../linux/ath79/dts/ar9344_openmesh_om5p.dts | 20 +- target/linux/ath79/dts/ar9344_pcs_cap324.dts | 27 +- target/linux/ath79/dts/ar9344_pcs_cr5000.dts | 20 +- .../ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts | 18 +- .../ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts | 18 +- .../ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts | 13 +- .../ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts | 13 +- .../linux/ath79/dts/ar9344_samsung_wam250.dts | 18 +- .../dts/ar9344_teltonika_rut955-h7v3c0.dts | 8 +- .../ath79/dts/ar9344_teltonika_rut955.dts | 8 +- .../ath79/dts/ar9344_teltonika_rut9xx.dtsi | 15 +- target/linux/ath79/dts/ar9344_tplink_cpe.dtsi | 16 +- .../ath79/dts/ar9344_tplink_cpe_2port.dtsi | 3 +- .../ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts | 28 +- .../ath79/dts/ar9344_tplink_tl-wdr4300.dtsi | 21 +- .../ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts | 170 ++++ .../ath79/dts/ar9344_ubnt_unifi-ap-pro.dts | 13 +- .../linux/ath79/dts/ar9344_wd_mynet-n600.dts | 108 +++ .../linux/ath79/dts/ar9344_wd_mynet-n750.dts | 89 +- .../linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi | 88 ++ .../ath79/dts/ar9344_winchannel_wb2000.dts | 23 +- .../ath79/dts/ar9344_zbtlink_zbt-wd323.dts | 20 +- target/linux/ath79/dts/ar934x.dtsi | 3 + target/linux/ath79/dts/qca9531_8dev_lima.dts | 20 +- .../ath79/dts/qca9531_alfa-network_n2q.dts | 10 +- .../dts/qca9531_alfa-network_pi-wifi4.dts | 5 +- .../ath79/dts/qca9531_alfa-network_r36a.dts | 10 +- .../ath79/dts/qca9531_alfa-network_r36a.dtsi | 17 +- .../dts/qca9531_alfa-network_tube-2hq.dts | 65 ++ .../ath79/dts/qca9531_comfast_cf-e130n-v2.dts | 16 +- .../ath79/dts/qca9531_comfast_cf-e313ac.dts | 20 +- .../ath79/dts/qca9531_comfast_cf-e314n-v2.dts | 20 +- .../linux/ath79/dts/qca9531_comfast_cf-e5.dts | 20 +- .../ath79/dts/qca9531_comfast_cf-e560ac.dts | 23 +- .../ath79/dts/qca9531_comfast_cf-ew72.dts | 23 +- .../dts/qca9531_comfast_cf-wr752ac-v1.dts | 18 +- .../ath79/dts/qca9531_compex_wpj531-16m.dts | 20 +- .../ath79/dts/qca9531_dlink_dch-g020-a1.dts | 2 +- .../ath79/dts/qca9531_glinet_gl-ar300m.dtsi | 18 +- .../ath79/dts/qca9531_glinet_gl-ar750.dts | 18 +- .../ath79/dts/qca9531_glinet_gl-e750.dts | 13 +- .../ath79/dts/qca9531_glinet_gl-x300b.dts | 152 ++++ .../ath79/dts/qca9531_glinet_gl-x750.dts | 18 +- .../ath79/dts/qca9531_glinet_gl-xe300.dts | 168 ++++ .../ath79/dts/qca9531_joyit_jt-or750i.dts | 138 +++ .../ath79/dts/qca9531_letv_lba-047-ch.dts | 158 ++++ .../linux/ath79/dts/qca9531_qxwlan_e600g.dtsi | 18 +- target/linux/ath79/dts/qca9531_telco_t1.dts | 20 +- .../dts/qca9531_tplink_archer-d50-v1.dts | 21 +- .../ath79/dts/qca9531_tplink_tl-mr3420-v3.dts | 21 +- .../ath79/dts/qca9531_tplink_tl-mr6400-v1.dts | 23 +- .../dts/qca9531_tplink_tl-wr902ac-v1.dts | 18 +- .../linux/ath79/dts/qca9531_wallys_dr531.dts | 20 +- .../linux/ath79/dts/qca9531_yuncore_a770.dts | 20 +- .../ath79/dts/qca9533_comfast_cf-e110n-v2.dts | 27 +- .../dts/qca9533_mikrotik_routerboard-16m.dtsi | 1 - .../qca9533_mikrotik_routerboard-mapl-2nd.dts | 68 ++ .../qca9533_mikrotik_routerboard-wapr-2nd.dts | 8 + .../ath79/dts/qca9533_openmesh_om2p-v4.dtsi | 25 +- .../ath79/dts/qca9533_plasmacloud_pa300.dtsi | 23 +- .../linux/ath79/dts/qca9533_qca_ap143-16m.dts | 28 + .../linux/ath79/dts/qca9533_qca_ap143-8m.dts | 28 + target/linux/ath79/dts/qca9533_qca_ap143.dtsi | 6 - .../ath79/dts/qca9533_tplink_cpe220-v3.dts | 3 +- .../ath79/dts/qca9533_tplink_cpexxx.dtsi | 16 +- .../ath79/dts/qca9533_tplink_tl-wa801nd.dtsi | 16 +- .../dts/qca9533_tplink_tl-wa850re-v2.dts | 16 +- .../ath79/dts/qca9533_tplink_tl-wr802n.dtsi | 18 +- .../ath79/dts/qca9533_tplink_tl-wr841.dtsi | 21 +- .../dts/qca9533_tplink_tl-wr841hp-v3.dts | 21 +- .../ath79/dts/qca9533_tplink_tl-wr842n-v3.dts | 21 +- .../ath79/dts/qca9533_ubnt_aircube-isp.dts | 20 +- target/linux/ath79/dts/qca953x.dtsi | 7 +- .../ath79/dts/qca953x_tplink_tl-wr810n.dtsi | 21 +- .../linux/ath79/dts/qca9550_airtight_c-75.dts | 42 +- ...6_mikrotik_routerboard-wap-g-5hact2hnd.dts | 1 - .../linux/ath79/dts/qca9557_8dev_rambutan.dts | 20 +- .../dts/qca9557_araknis_an-500-ap-i-ac.dts | 105 +++ .../ath79/dts/qca9557_buffalo_bhr-4grv2.dts | 20 +- .../dts/qca9557_dongwon_dw02-412h-128m.dts | 12 + .../dts/qca9557_dongwon_dw02-412h-64m.dts | 12 + .../ath79/dts/qca9557_dongwon_dw02-412h.dtsi | 209 +++++ .../ath79/dts/qca9557_engenius_eap1200h.dts | 18 +- .../dts/qca9557_engenius_enstationac-v1.dts | 18 +- .../dts/qca9558_allnet_all-wap02860ac.dts | 18 +- .../dts/qca9558_araknis_an-700-ap-i-ac.dts | 104 +++ .../ath79/dts/qca9558_arris_sbr-ac1750.dts | 28 +- .../ath79/dts/qca9558_belkin_f9x-v2.dtsi | 18 +- .../dts/qca9558_comfast_cf-wr650ac-v1.dts | 35 + .../dts/qca9558_comfast_cf-wr650ac-v2.dts | 35 + .../ath79/dts/qca9558_comfast_cf-wr650ac.dtsi | 7 +- .../ath79/dts/qca9558_compex_wpj558-16m.dts | 143 +++ .../ath79/dts/qca9558_devolo_dvl1200e.dts | 5 +- .../ath79/dts/qca9558_devolo_dvl1750e.dts | 5 +- .../ath79/dts/qca9558_devolo_dvl1xxx.dtsi | 18 +- .../ath79/dts/qca9558_dlink_dap-2695-a1.dts | 91 +- .../ath79/dts/qca9558_domywifi_dw33d-nor.dts | 21 - .../ath79/dts/qca9558_domywifi_dw33d.dts | 55 +- .../ath79/dts/qca9558_jjplus_jwap230.dts | 183 ++++ .../qca9558_librerouter_librerouter-v1.dts | 27 +- ...58_mikrotik_routerboard-922uags-5hpacd.dts | 48 - .../dts/qca9558_mikrotik_routerboard-92x.dtsi | 48 + .../ath79/dts/qca9558_netgear_ex7300.dtsi | 20 +- .../linux/ath79/dts/qca9558_ocedo_koala.dts | 20 +- .../linux/ath79/dts/qca9558_ocedo_ursus.dts | 27 +- .../linux/ath79/dts/qca9558_openmesh_a60.dtsi | 25 +- .../linux/ath79/dts/qca9558_openmesh_mr.dtsi | 18 +- .../ath79/dts/qca9558_openmesh_mr900-v1.dts | 5 +- .../ath79/dts/qca9558_openmesh_mr900-v2.dts | 5 +- .../ath79/dts/qca9558_openmesh_om5p-ac-v1.dts | 216 +++++ .../ath79/dts/qca9558_openmesh_om5p-ac-v2.dts | 139 ++- .../linux/ath79/dts/qca9558_qxwlan_e558.dtsi | 18 +- .../ath79/dts/qca9558_tplink_archer-c.dtsi | 7 - .../ath79/dts/qca9558_tplink_archer-c5-v1.dts | 32 + .../ath79/dts/qca9558_tplink_archer-c7-v1.dts | 40 +- .../ath79/dts/qca9558_tplink_archer-c7-v2.dts | 55 ++ .../ath79/dts/qca9558_tplink_archer-d7-v1.dts | 21 +- .../dts/qca9558_tplink_archer-d7b-v1.dts | 21 +- .../ath79/dts/qca9558_tplink_re350k-v1.dts | 16 +- .../linux/ath79/dts/qca9558_tplink_rex5x.dtsi | 18 +- .../dts/qca9558_tplink_tl-wdr4900-v2.dts | 28 +- .../dts/qca9558_tplink_tl-wdr7500-v3-16MB.dts | 45 - .../dts/qca9558_tplink_tl-wdr7500-v3.dts | 32 + .../ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi | 21 +- .../dts/qca9558_tplink_tl-wr941n-v7-cn.dts | 16 +- .../ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts | 111 +++ .../dts/qca9558_ubnt_powerbeam-5ac-500.dts | 13 +- .../dts/qca9558_ubnt_rocket-5ac-lite.dts | 13 +- .../ath79/dts/qca9558_zyxel_emg2926_q10a.dts | 8 + target/linux/ath79/dts/qca955x.dtsi | 9 +- .../dts/qca9561_tplink_archer-c25-v1.dts | 21 +- .../dts/qca9561_tplink_archer-c58-v1.dts | 32 + .../dts/qca9561_tplink_archer-c59-v1.dts | 32 + .../dts/qca9561_tplink_archer-c59-v2.dts | 32 + .../ath79/dts/qca9561_tplink_archer-c5x.dtsi | 9 - .../dts/qca9561_tplink_archer-c60-v1.dts | 32 + .../dts/qca9561_tplink_archer-c60-v2.dts | 32 + .../dts/qca9561_tplink_archer-c60-v3.dts | 33 + .../ath79/dts/qca9561_tplink_archer-c6x.dtsi | 9 - .../dts/qca9561_tplink_eap225-wall-v2.dts | 16 +- .../dts/qca9561_tplink_tl-wdr6500-v2.dts | 147 --- .../ath79/dts/qca9561_xiaomi_mi-router-4q.dts | 25 +- .../linux/ath79/dts/qca9563_asus_rp-ac66.dts | 159 ++++ .../ath79/dts/qca9563_comfast_cf-e375ac.dts | 18 +- .../linux/ath79/dts/qca9563_compex_wpj563.dts | 13 +- .../dts/qca9563_elecom_wrc-1750ghbk2-i.dts | 20 + .../dts/qca9563_elecom_wrc-300ghbk2-i.dts | 20 + .../ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi | 3 - .../ath79/dts/qca9563_glinet_gl-ar750s.dtsi | 13 +- .../linux/ath79/dts/qca9563_netgear_wndr.dtsi | 23 +- .../ath79/dts/qca9563_qxwlan_e1700ac.dtsi | 13 +- .../ath79/dts/qca9563_rosinson_wr818.dts | 13 +- .../ath79/dts/qca9563_tplink_archer-a7-v5.dts | 26 + .../ath79/dts/qca9563_tplink_archer-c2-v3.dts | 16 +- .../dts/qca9563_tplink_archer-c6-v2-us.dts | 24 + .../ath79/dts/qca9563_tplink_archer-c6-v2.dts | 24 + .../ath79/dts/qca9563_tplink_archer-c7-v4.dts | 16 +- .../ath79/dts/qca9563_tplink_archer-c7-v5.dts | 26 + .../dts/qca9563_tplink_archer-x6-v2.dtsi | 11 - .../dts/qca9563_tplink_archer-x7-v5.dtsi | 5 - .../ath79/dts/qca9563_tplink_cpe710-v1.dts | 152 ++++ .../ath79/dts/qca9563_tplink_eap225-v1.dts | 51 ++ .../ath79/dts/qca9563_tplink_eap245-v3.dts | 16 +- .../dts/qca9563_tplink_eap2x5-1port.dtsi | 16 +- .../ath79/dts/qca9563_tplink_re450-v2.dts | 26 + .../ath79/dts/qca9563_tplink_re450-v3.dts | 26 + .../linux/ath79/dts/qca9563_tplink_re450.dtsi | 6 - .../ath79/dts/qca9563_tplink_re455-v1.dts | 26 + .../ath79/dts/qca9563_tplink_tl-wa1201-v2.dts | 161 ++++ .../dts/qca9563_tplink_tl-wpa8630-v1.dts | 18 +- .../ath79/dts/qca9563_tplink_tl-wpa8630.dtsi | 2 - .../dts/qca9563_tplink_tl-wpa8630p-v2-int.dts | 46 +- .../qca9563_tplink_tl-wpa8630p-v2.0-eu.dts | 46 +- .../qca9563_tplink_tl-wpa8630p-v2.1-eu.dts | 46 +- .../dts/qca9563_tplink_tl-wpa8630p-v2.dtsi | 37 - .../dts/qca9563_tplink_tl-wr1043n-v5.dts | 26 + .../ath79/dts/qca9563_tplink_tl-wr1043n.dtsi | 5 - .../dts/qca9563_tplink_tl-wr1043nd-v4.dts | 26 + .../ath79/dts/qca9563_ubnt_unifiac-lite.dtsi | 3 +- .../ath79/dts/qca9563_ubnt_unifiac-pro.dtsi | 3 +- .../linux/ath79/dts/qca9563_ubnt_unifiac.dtsi | 10 + .../ath79/dts/qca9563_xiaomi_aiot-ac2350.dts | 13 +- .../ath79/dts/qca9563_yuncore_xd4200.dtsi | 13 +- target/linux/ath79/dts/qca9563_zte_mf286.dts | 130 +++ target/linux/ath79/dts/qca9563_zte_mf286.dtsi | 158 ++++ target/linux/ath79/dts/qca9563_zte_mf286a.dts | 9 + .../linux/ath79/dts/qca9563_zte_mf286ar.dtsi | 134 +++ target/linux/ath79/dts/qca9563_zte_mf286r.dts | 9 + target/linux/ath79/dts/qca956x.dtsi | 6 + .../ath79/dts/qcn5502_netgear_ex7300-v2.dts | 255 ++++++ .../ath79/dts/qcn5502_tplink_archer-a9-v6.dts | 248 +++++ .../ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi | 5 +- .../ath79/dts/tp9343_tplink_tl-wr940n-v4.dts | 3 +- .../ath79/dts/tp9343_tplink_tl-wr940n-v6.dts | 3 +- .../ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts | 21 +- .../linux/ath79/dts/tp9343_tplink_tl-wx.dtsi | 18 +- .../files/arch/mips/ath79/pci-ath9k-fixup.c | 126 --- .../files/arch/mips/ath79/pci-ath9k-fixup.h | 6 - .../ath79/files/drivers/gpio/gpio-latch.c | 10 +- .../ath79/files/drivers/gpio/gpio-rb91x-key.c | 218 +++++ .../files/drivers/mtd/nand/raw/ar934x_nand.c | 28 - .../files/drivers/mtd/nand/raw/nand_rb4xx.c | 17 +- .../files/drivers/mtd/nand/raw/rb91x_nand.c | 27 +- .../net/ethernet/atheros/ag71xx/ag71xx.h | 4 - .../net/ethernet/atheros/ag71xx/ag71xx_main.c | 15 +- .../generic/base-files/etc/board.d/01_leds | 58 +- .../generic/base-files/etc/board.d/02_network | 67 +- .../base-files/etc/board.d/03_gpio_switches | 6 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 61 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 42 +- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 1 + .../base-files/lib/upgrade/platform.sh | 9 +- target/linux/ath79/generic/target.mk | 4 +- target/linux/ath79/image/Makefile | 25 +- target/linux/ath79/image/common-senao.mk | 10 +- target/linux/ath79/image/generic-tp-link.mk | 86 +- target/linux/ath79/image/generic-ubnt.mk | 26 +- target/linux/ath79/image/generic.mk | 270 +++++- target/linux/ath79/image/mikrotik.mk | 22 +- target/linux/ath79/image/nand.mk | 147 ++- target/linux/ath79/image/tiny.mk | 2 +- .../mikrotik/base-files/etc/board.d/01_leds | 12 +- .../base-files/etc/board.d/02_network | 7 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 2 + target/linux/ath79/mikrotik/config-default | 3 +- target/linux/ath79/mikrotik/target.mk | 2 +- .../ath79/nand/base-files/etc/board.d/01_leds | 11 + .../nand/base-files/etc/board.d/02_network | 35 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 5 +- .../etc/hotplug.d/ieee80211/10-fix-wifi-mac | 1 + .../base-files/lib/preinit/10_fix_eth_mac.sh | 1 + target/linux/ath79/nand/config-default | 2 + target/linux/ath79/nand/target.mk | 2 +- .../0004-phy-add-ath79-usb-phys.patch | 4 +- .../0032-MIPS-ath79-sanitize-symbols.patch | 2 +- ...or-use-4-bit-locking-for-MX25L12805D.patch | 2 +- ...or-support-mtd-name-from-device-tree.patch | 54 ++ .../910-unaligned_access_hacks.patch | 2 +- .../patches-5.10/920-mikrotik-rb4xx.patch | 2 +- .../patches-5.10/939-mikrotik-rb91x.patch | 19 + ...th79-add-support-for-booting-QCN550x.patch | 48 + ...ds-add-reset-controller-based-driver.patch | 186 ++++ .../0004-phy-add-ath79-usb-phys.patch | 333 +++++++ ...005-usb-add-more-OF-quirk-properties.patch | 24 + ...9-intc-add-irq-cascade-driver-for-QC.patch | 168 ++++ ...ip-irq-ath79-cpu-drop-OF-init-helper.patch | 23 + ...ngs-PCI-qcom-ar7100-adds-binding-doc.patch | 57 ++ .../0018-MIPS-pci-ar71xx-convert-to-OF.patch | 202 +++++ ...ngs-PCI-qcom-ar7240-adds-binding-doc.patch | 61 ++ .../0020-MIPS-pci-ar724x-convert-to-OF.patch | 205 +++++ .../0032-MIPS-ath79-sanitize-symbols.patch | 93 ++ .../0034-MIPS-ath79-ath9k-exports.patch | 27 + ...-MIPS-ath79-remove-irq-code-from-pci.patch | 139 +++ .../patches-5.15/0037-missing-registers.patch | 21 + ...9-add-missing-QCA955x-GMAC-registers.patch | 90 ++ ...S-ath79-export-UART1-reference-clock.patch | 52 ++ .../004-register_gpio_driver_earlier.patch | 18 + .../0040-ath79-sgmii-config.patch | 9 + ...ci-ar724x-add-QCA9550-reset-sequence.patch | 130 +++ ...or-support-mtd-name-from-device-tree.patch | 54 ++ .../404-mtd-cybertan-trx-parser.patch | 27 + .../408-mtd-redboot_partition_scan.patch | 45 + ...th79-Implement-the-spi_mem-interface.patch | 68 ++ .../420-net-use-downstream-ag71xx.patch | 29 + .../430-drivers-link-spi-before-mtd.patch | 12 + .../440-mtd-ar934x-nand-driver.patch | 25 + ...ath79-swizzle-pci-address-for-ar71xx.patch | 98 ++ .../900-mdio_bitbang_ignore_ta_value.patch | 32 + ...-prevent-rescheduling-during-command.patch | 61 ++ .../910-unaligned_access_hacks.patch | 855 ++++++++++++++++++ .../patches-5.15/920-mikrotik-rb4xx.patch | 76 ++ .../930-ar8216-make-reg-access-atomic.patch | 59 ++ .../patches-5.15/939-mikrotik-rb91x.patch | 68 ++ ...th79-add-support-for-booting-QCN550x.patch | 48 + 387 files changed, 14183 insertions(+), 1604 deletions(-) create mode 100644 target/linux/ath79/config-5.15 create mode 100644 target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts rename target/linux/ath79/dts/{ar9341_pisen_wpr003n.dts => ar9331_onion_omega.dts} (50%) create mode 100644 target/linux/ath79/dts/ar9342_ubnt_powerbeam-m2-xw.dts rename target/linux/ath79/dts/{ar9342_ubnt_powerbeam-m-xw.dts => ar9342_ubnt_powerbeam-m5-xw.dts} (81%) create mode 100644 target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts create mode 100644 target/linux/ath79/dts/ar9344_atheros_db120.dts create mode 100644 target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts create mode 100644 target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi create mode 100644 target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts create mode 100644 target/linux/ath79/dts/ar9344_netgear_r6100.dts create mode 100644 target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts create mode 100644 target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts create mode 100644 target/linux/ath79/dts/ar9344_wd_mynet-n600.dts create mode 100644 target/linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi create mode 100644 target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts create mode 100644 target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts create mode 100644 target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts create mode 100644 target/linux/ath79/dts/qca9533_mikrotik_routerboard-mapl-2nd.dts create mode 100644 target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts create mode 100644 target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts create mode 100644 target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts create mode 100644 target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi create mode 100644 target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts create mode 100644 target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts delete mode 100644 target/linux/ath79/dts/qca9558_domywifi_dw33d-nor.dts create mode 100644 target/linux/ath79/dts/qca9558_jjplus_jwap230.dts create mode 100644 target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts delete mode 100644 target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3-16MB.dts create mode 100644 target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts create mode 100644 target/linux/ath79/dts/qca9558_zyxel_emg2926_q10a.dts delete mode 100644 target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts create mode 100644 target/linux/ath79/dts/qca9563_asus_rp-ac66.dts create mode 100644 target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts create mode 100644 target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts create mode 100644 target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts delete mode 100644 target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi create mode 100644 target/linux/ath79/dts/qca9563_zte_mf286.dts create mode 100644 target/linux/ath79/dts/qca9563_zte_mf286.dtsi create mode 100644 target/linux/ath79/dts/qca9563_zte_mf286a.dts create mode 100644 target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi create mode 100644 target/linux/ath79/dts/qca9563_zte_mf286r.dts create mode 100644 target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts create mode 100644 target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts delete mode 100644 target/linux/ath79/files/arch/mips/ath79/pci-ath9k-fixup.c delete mode 100644 target/linux/ath79/files/arch/mips/ath79/pci-ath9k-fixup.h create mode 100644 target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c create mode 100644 target/linux/ath79/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch create mode 100644 target/linux/ath79/patches-5.10/940-ath79-add-support-for-booting-QCN550x.patch create mode 100644 target/linux/ath79/patches-5.15/0003-leds-add-reset-controller-based-driver.patch create mode 100644 target/linux/ath79/patches-5.15/0004-phy-add-ath79-usb-phys.patch create mode 100644 target/linux/ath79/patches-5.15/0005-usb-add-more-OF-quirk-properties.patch create mode 100644 target/linux/ath79/patches-5.15/0007-irqchip-irq-ath79-intc-add-irq-cascade-driver-for-QC.patch create mode 100644 target/linux/ath79/patches-5.15/0008-irqchip-irq-ath79-cpu-drop-OF-init-helper.patch create mode 100644 target/linux/ath79/patches-5.15/0017-dt-bindings-PCI-qcom-ar7100-adds-binding-doc.patch create mode 100644 target/linux/ath79/patches-5.15/0018-MIPS-pci-ar71xx-convert-to-OF.patch create mode 100644 target/linux/ath79/patches-5.15/0019-dt-bindings-PCI-qcom-ar7240-adds-binding-doc.patch create mode 100644 target/linux/ath79/patches-5.15/0020-MIPS-pci-ar724x-convert-to-OF.patch create mode 100644 target/linux/ath79/patches-5.15/0032-MIPS-ath79-sanitize-symbols.patch create mode 100644 target/linux/ath79/patches-5.15/0034-MIPS-ath79-ath9k-exports.patch create mode 100644 target/linux/ath79/patches-5.15/0036-MIPS-ath79-remove-irq-code-from-pci.patch create mode 100644 target/linux/ath79/patches-5.15/0037-missing-registers.patch create mode 100644 target/linux/ath79/patches-5.15/0038-MIPS-ath79-add-missing-QCA955x-GMAC-registers.patch create mode 100644 target/linux/ath79/patches-5.15/0039-MIPS-ath79-export-UART1-reference-clock.patch create mode 100644 target/linux/ath79/patches-5.15/004-register_gpio_driver_earlier.patch create mode 100644 target/linux/ath79/patches-5.15/0040-ath79-sgmii-config.patch create mode 100644 target/linux/ath79/patches-5.15/0062-MIPS-pci-ar724x-add-QCA9550-reset-sequence.patch create mode 100644 target/linux/ath79/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch create mode 100644 target/linux/ath79/patches-5.15/404-mtd-cybertan-trx-parser.patch create mode 100644 target/linux/ath79/patches-5.15/408-mtd-redboot_partition_scan.patch create mode 100644 target/linux/ath79/patches-5.15/410-spi-ath79-Implement-the-spi_mem-interface.patch create mode 100644 target/linux/ath79/patches-5.15/420-net-use-downstream-ag71xx.patch create mode 100644 target/linux/ath79/patches-5.15/430-drivers-link-spi-before-mtd.patch create mode 100644 target/linux/ath79/patches-5.15/440-mtd-ar934x-nand-driver.patch create mode 100644 target/linux/ath79/patches-5.15/470-MIPS-ath79-swizzle-pci-address-for-ar71xx.patch create mode 100644 target/linux/ath79/patches-5.15/900-mdio_bitbang_ignore_ta_value.patch create mode 100644 target/linux/ath79/patches-5.15/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch create mode 100644 target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch create mode 100644 target/linux/ath79/patches-5.15/920-mikrotik-rb4xx.patch create mode 100644 target/linux/ath79/patches-5.15/930-ar8216-make-reg-access-atomic.patch create mode 100644 target/linux/ath79/patches-5.15/939-mikrotik-rb91x.patch create mode 100644 target/linux/ath79/patches-5.15/940-ath79-add-support-for-booting-QCN550x.patch diff --git a/target/linux/ath79/Makefile b/target/linux/ath79/Makefile index 4063867ce..dd57d9fed 100644 --- a/target/linux/ath79/Makefile +++ b/target/linux/ath79/Makefile @@ -8,8 +8,7 @@ SUBTARGETS:=generic mikrotik nand tiny FEATURES:=ramdisk squashfs usbgadget -KERNEL_PATCHVER:=5.4 -KERNEL_TESTING_PATCHVER:=5.10 +KERNEL_PATCHVER:=5.10 include $(INCLUDE_DIR)/target.mk 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 index d2df0533f..f7393a0d0 100644 --- 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 @@ -14,8 +14,10 @@ migrate_wifi_path() { board=$(board_name) case "$board" in + tplink,archer-c5-v1|\ tplink,archer-c7-v1|\ tplink,archer-c7-v2|\ + zyxel,emg2926-q10a|\ zyxel,nbg6716) path="pci0000:00/0000:00:00.0" WIFI_PATH_CHANGED=1 diff --git a/target/linux/ath79/config-5.10 b/target/linux/ath79/config-5.10 index c95c07356..53f444c68 100644 --- a/target/linux/ath79/config-5.10 +++ b/target/linux/ath79/config-5.10 @@ -43,6 +43,7 @@ CONFIG_CSRC_R4K=y CONFIG_DMA_NONCOHERENT=y CONFIG_DTC=y CONFIG_EARLY_PRINTK=y +CONFIG_ETHERNET_PACKET_MANGLE=y CONFIG_FIXED_PHY=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_GENERIC_ATOMIC64=y @@ -73,6 +74,7 @@ CONFIG_GPIO_74X164=y CONFIG_GPIO_ATH79=y CONFIG_GPIO_GENERIC=y # CONFIG_GPIO_LATCH is not set +# CONFIG_GPIO_RB91X_KEY is not set CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y @@ -90,7 +92,6 @@ CONFIG_IRQ_WORK=y CONFIG_LEDS_GPIO=y # CONFIG_LEDS_RESET is not set CONFIG_LIBFDT=y -CONFIG_LLD_VERSION=0 CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_MDIO_BITBANG=y CONFIG_MDIO_BUS=y diff --git a/target/linux/ath79/config-5.15 b/target/linux/ath79/config-5.15 new file mode 100644 index 000000000..bdd31079c --- /dev/null +++ b/target/linux/ath79/config-5.15 @@ -0,0 +1,207 @@ +CONFIG_AF_UNIX_OOB=y +CONFIG_AG71XX=y +# CONFIG_AG71XX_DEBUG is not set +CONFIG_AG71XX_DEBUG_FS=y +CONFIG_AR8216_PHY=y +CONFIG_AR8216_PHY_LEDS=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MMAP_RND_BITS_MAX=15 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_AT803X_PHY=y +CONFIG_ATH79=y +CONFIG_ATH79_WDT=y +CONFIG_BINARY_PRINTF=y +CONFIG_BLK_MQ_PCI=y +CONFIG_CEVT_R4K=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="rootfstype=squashfs,jffs2" +CONFIG_CMDLINE_BOOL=y +# CONFIG_CMDLINE_OVERRIDE is not set +CONFIG_COMMON_CLK=y +# CONFIG_COMMON_CLK_BOSTON is not set +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_DIEI=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_RIXI=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +CONFIG_CPU_R4K_CACHE_TLB=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2 +CONFIG_CRYPTO_RNG2=y +CONFIG_CSRC_R4K=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_FIXED_PHY=y +CONFIG_FWNODE_MDIO=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_FIND_FIRST_BIT=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_LIB_ASHLDI3=y +CONFIG_GENERIC_LIB_ASHRDI3=y +CONFIG_GENERIC_LIB_CMPDI2=y +CONFIG_GENERIC_LIB_LSHRDI3=y +CONFIG_GENERIC_LIB_UCMPDI2=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_PINCTRL_GROUPS=y +CONFIG_GENERIC_PINMUX_FUNCTIONS=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_74X164=y +CONFIG_GPIO_ATH79=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y +# CONFIG_GPIO_LATCH is not set +# CONFIG_GPIO_RB91X_KEY is not set +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HZ_PERIODIC=y +CONFIG_IMAGE_CMDLINE_HACK=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_MIPS_CPU=y +CONFIG_IRQ_WORK=y +CONFIG_LEDS_GPIO=y +# CONFIG_LEDS_RESET is not set +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LTO_NONE=y +CONFIG_MDIO_BITBANG=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +CONFIG_MDIO_GPIO=y +CONFIG_MEMFD_CREATE=y +# CONFIG_MFD_RB4XX_CPLD is not set +CONFIG_MFD_SYSCON=y +CONFIG_MIGRATION=y +CONFIG_MIPS=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 +CONFIG_MIPS_CLOCK_VSYSCALL=y +# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set +# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set +# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_MIPS_CMDLINE_FROM_DTB=y +CONFIG_MIPS_EBPF_JIT=y +# CONFIG_MIPS_ELF_APPENDED_DTB is not set +CONFIG_MIPS_L1_CACHE_SHIFT=5 +CONFIG_MIPS_LD_CAN_LINK_VDSO=y +# CONFIG_MIPS_NO_APPENDED_DTB is not set +CONFIG_MIPS_RAW_APPENDED_DTB=y +CONFIG_MIPS_SPRAM=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +CONFIG_MTD_CFI_GEOMETRY=y +# CONFIG_MTD_CFI_I2 is not set +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set +CONFIG_MTD_PARSER_CYBERTAN=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_ELF_FW=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_SPLIT_WRGG_FW=y +CONFIG_MTD_VIRT_CONCAT=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_SELFTESTS=y +CONFIG_NET_SOCK_MSG=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NVMEM=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=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 +CONFIG_PHYLIB=y +# CONFIG_PHY_AR7100_USB is not set +# CONFIG_PHY_AR7200_USB is not set +# CONFIG_PHY_ATH79_USB is not set +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_PISTACHIO is not set +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_RATIONAL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGULATOR=y +CONFIG_RESET_ATH79=y +CONFIG_RESET_CONTROLLER=y +CONFIG_SERIAL_8250_NR_UARTS=1 +CONFIG_SERIAL_8250_RUNTIME_UARTS=1 +CONFIG_SERIAL_AR933X=y +CONFIG_SERIAL_AR933X_CONSOLE=y +CONFIG_SERIAL_AR933X_NR_UARTS=2 +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SPI=y +CONFIG_SPI_AR934X=y +CONFIG_SPI_ATH79=y +CONFIG_SPI_BITBANG=y +CONFIG_SPI_GPIO=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +# CONFIG_SPI_RB4XX is not set +CONFIG_SRCU=y +CONFIG_SWCONFIG=y +CONFIG_SWCONFIG_LEDS=y +CONFIG_SWPHY=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_MIPS16=y +CONFIG_SYS_SUPPORTS_ZBOOT=y +CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y +CONFIG_TARGET_ISA_REV=2 +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TINY_SRCU=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y diff --git a/target/linux/ath79/dts/ar7100.dtsi b/target/linux/ath79/dts/ar7100.dtsi index 86673cb5d..12ab7e503 100644 --- a/target/linux/ath79/dts/ar7100.dtsi +++ b/target/linux/ath79/dts/ar7100.dtsi @@ -146,6 +146,9 @@ has-synopsys-hc-bug; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; usb1: usb@1c000000 { @@ -159,6 +162,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; spi: spi@1f000000 { diff --git a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts index e24236324..8180e0d6b 100644 --- a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts +++ b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts @@ -103,8 +103,9 @@ ath9k0: wifi@0,11 { /* 2.4 GHz */ compatible = "pci168c,0029"; - mtd-mac-address = <&hwinfo 0x1c>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; reg = <0x8800 0 0 0 0>; #gpio-cells = <2>; gpio-controller; @@ -112,8 +113,9 @@ ath9k1: wifi@0,12 { /* 5 GHz */ compatible = "pci168c,0029"; - mtd-mac-address = <&hwinfo 0x1c>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; reg = <0x9000 0 0 0 0>; #gpio-cells = <2>; gpio-controller; @@ -132,7 +134,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&hwinfo 0x1c>; + nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cell-names = "mac-address"; pll-data = <0x00110000 0x00001099 0x00991099>; @@ -179,3 +182,13 @@ }; }; }; + +&hwinfo { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hwinfo_1c: macaddr@1c { + reg = <0x1c 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi index b8176dc05..35e083bc6 100644 --- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi @@ -75,24 +75,28 @@ compatible = "gpio-keys"; reset { + label = "reset"; linux,code = ; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; usb { + label = "usb"; linux,code = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; aoss { + label = "aoss"; linux,code = ; gpios = <&gpio 5 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; router_auto { + label = "router_auto"; linux,code = ; linux,input-type = ; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; @@ -100,6 +104,7 @@ }; router_off { + label = "router_off"; linux,code = ; linux,input-type = ; gpios = <&gpio 7 GPIO_ACTIVE_LOW>; @@ -107,6 +112,7 @@ }; movie_engine { + label = "movie_engine"; linux,code = ; linux,input-type = ; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; @@ -247,7 +253,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x120c>; + nvmem-cells = <&macaddr_art_120c>; + nvmem-cell-names = "mac-address"; fixed-link { speed = <1000>; @@ -258,8 +265,23 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x520c>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_520c>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; phy-handle = <&phy4>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_120c: macaddr@120c { + reg = <0x120c 0x6>; + }; + + macaddr_art_520c: macaddr@520c { + reg = <0x520c 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_meraki_mr16.dts b/target/linux/ath79/dts/ar7161_meraki_mr16.dts index afbf1e31f..d672364e5 100644 --- a/target/linux/ath79/dts/ar7161_meraki_mr16.dts +++ b/target/linux/ath79/dts/ar7161_meraki_mr16.dts @@ -81,8 +81,9 @@ compatible = "pci168c,0029"; reg = <0x8800 0 0 0 0>; qca,no-eeprom; - mtd-mac-address = <&config 0x66>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_66>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; #gpio-cells = <2>; gpio-controller; }; @@ -91,8 +92,9 @@ compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; qca,no-eeprom; - mtd-mac-address = <&config 0x66>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_config_66>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; #gpio-cells = <2>; gpio-controller; }; @@ -114,7 +116,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&config 0x66>; + nvmem-cells = <&macaddr_config_66>; + nvmem-cell-names = "mac-address"; pll-data = <0x00110000 0x00001099 0x00991099>; @@ -167,3 +170,13 @@ }; }; }; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_66: macaddr@66 { + reg = <0x66 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi index c7e83631c..afbccb801 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi @@ -12,7 +12,6 @@ led-failsafe = &led_power_orange; led-running = &led_power_green; led-upgrade = &led_power_orange; - label-mac-device = ð0; }; extosc: ref { @@ -153,8 +152,7 @@ ath9k0: wifi@0,11 { compatible = "pci168c,0029"; reg = <0x8800 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - qca,no-eeprom; + #gpio-cells = <2>; gpio-controller; @@ -181,8 +179,7 @@ ath9k1: wifi@0,12 { compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; - mtd-mac-address = <&art 0xc>; - qca,no-eeprom; + #gpio-cells = <2>; gpio-controller; }; @@ -209,8 +206,6 @@ pll-data = <0x11110000 0x00001099 0x00991099>; - mtd-mac-address = <&art 0x00>; - fixed-link { speed = <1000>; full-duplex; @@ -222,7 +217,5 @@ pll-data = <0x11110000 0x00001099 0x00991099>; - mtd-mac-address = <&art 0x06>; - phy-handle = <&phy4>; }; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts index 6d78c019d..351d5e036 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndr3700-v2", "qca,ar7161"; model = "Netgear WNDR3700 v2"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -33,3 +37,49 @@ read-only; }; }; + +&ath9k0 { + nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts index ad29d256f..eedd375cc 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndr3700", "qca,ar7161"; model = "Netgear WNDR3700"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -34,7 +38,15 @@ }; }; +&ath9k0 { + nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + &ath9k1 { + nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; + /* The original WNDR3700(v1) variant have four antennae dedicated * to the 5GHz radio as well. Again, two antennae are available for * each chain to switch between. The following configuration is the @@ -54,3 +66,39 @@ output-high; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts index 80b25492b..487b00b0d 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndr3800", "qca,ar7161"; model = "Netgear WNDR3800"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -34,3 +38,49 @@ read-only; }; }; + +&ath9k0 { + nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts index cc51aca8b..0c2eadae5 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndr3800ch", "qca,ar7161"; model = "Netgear WNDR3800CH"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -35,3 +39,48 @@ }; }; +&ath9k0 { + nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts index 8604414d1..88c3170c6 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndrmac-v1", "qca,ar7161"; model = "Netgear WNDRMAC v1"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -33,3 +37,49 @@ read-only; }; }; + +&ath9k0 { + nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts index bebd96c72..0536ecb05 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndrmac-v2", "qca,ar7161"; model = "Netgear WNDRMAC v2"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -34,3 +38,49 @@ read-only; }; }; + +&ath9k0 { + nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; +}; diff --git a/target/linux/ath79/dts/ar7240.dtsi b/target/linux/ath79/dts/ar7240.dtsi index 730c509d7..425d75f0d 100644 --- a/target/linux/ath79/dts/ar7240.dtsi +++ b/target/linux/ath79/dts/ar7240.dtsi @@ -29,6 +29,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; }; diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts index e5d7ea57f..cf51078bc 100644 --- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts +++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts @@ -153,14 +153,16 @@ }; ð0 { - mtd-mac-address = <&art 0x120c>; + nvmem-cells = <&macaddr_art_120c>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x120c>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_120c>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &pcie { @@ -170,7 +172,8 @@ compatible = "pci168c,002a"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - mtd-mac-address = <&art 0x120c>; + nvmem-cells = <&macaddr_art_120c>; + nvmem-cell-names = "mac-address"; #gpio-cells = <2>; gpio-controller; }; @@ -181,3 +184,13 @@ pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_120c: macaddr@120c { + reg = <0x120c 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts index c5a667b51..9a233c836 100644 --- a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts +++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts @@ -72,13 +72,15 @@ }; ð0 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &pcie { @@ -92,3 +94,13 @@ gpio-controller; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts index 7e1c87add..91b72cf1d 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts +++ b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts @@ -174,13 +174,15 @@ }; ð0 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &pcie { @@ -189,10 +191,25 @@ ath9k: wifi@0,0 { compatible = "pci168c,002b"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi index 7202e1d68..9bae95b55 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi @@ -107,13 +107,15 @@ }; ð0 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &pcie { @@ -122,10 +124,25 @@ ath9k: wifi@0,0 { compatible = "pci168c,002b"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts b/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts new file mode 100644 index 000000000..456724a75 --- /dev/null +++ b/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7240.dtsi" + +#include +#include + +/ { + compatible = "openmesh,om2p-v1", "qca,ar7240"; + model = "OpenMesh OM2P v1"; + + chosen { + /delete-property/ bootargs; + }; + + aliases { + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&switch_led_disable_pins>; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi_green { + label = "green:wifi"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi_red { + label = "red:wifi"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wifi_yellow { + label = "yellow:wifi"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan_blue { + label = "blue:lan"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + linux,mtd-name = "ar7240-nor0"; + + /* partitions are passed via bootloader */ + 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 0x040000>; + }; + + partition@80000 { + label = "custom"; + reg = <0x080000 0x140000>; + read-only; + }; + + partition@1c0000 { + label = "inactive"; + reg = <0x1c0000 0x700000>; + }; + + partition@8c0000 { + label = "inactive2"; + reg = <0x8c0000 0x700000>; + }; + + art: partition@fc0000 { + label = "ART"; + reg = <0xfc0000 0x040000>; + read-only; + }; + }; + }; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,002a"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7240_tplink.dtsi b/target/linux/ath79/dts/ar7240_tplink.dtsi index 4799fd79e..60cd38c22 100644 --- a/target/linux/ath79/dts/ar7240_tplink.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink.dtsi @@ -104,7 +104,8 @@ ath9k: wifi@0,0 { reg = <0x0000 0 0 0 0>; qca,no-eeprom; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; #gpio-cells = <2>; gpio-controller; }; @@ -115,3 +116,13 @@ pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi index e0ac582f9..2bded28ea 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi @@ -14,7 +14,8 @@ }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; &ath9k { diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi index bd6caacdf..9d896360d 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi @@ -30,13 +30,15 @@ }; ð0 { - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &ath9k { diff --git a/target/linux/ath79/dts/ar7241.dtsi b/target/linux/ath79/dts/ar7241.dtsi index 4044cdee0..ff7a61f92 100644 --- a/target/linux/ath79/dts/ar7241.dtsi +++ b/target/linux/ath79/dts/ar7241.dtsi @@ -36,6 +36,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; }; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts index de2b53622..290871d64 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts @@ -179,13 +179,15 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { compatible = "qca,ar7241-eth", "syscon", "simple-mfd"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &pcie { @@ -194,10 +196,25 @@ ath9k: wifi@0,0 { compatible = "pci168c,002e"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts index 3842238e5..f5c060d78 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wnr2200-16m", "qca,ar7241"; model = "Netgear WNR2200 (16M)"; + + aliases { + label-mac-device = ð1; + }; }; &partitions { @@ -33,3 +37,33 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&ath9k { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts index 4eb15e231..e47336e4d 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wnr2200-8m", "qca,ar7241"; model = "Netgear WNR2200 (8M)"; + + aliases { + label-mac-device = ð1; + }; }; &partitions { @@ -33,3 +37,33 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&ath9k { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi index e704ddd9f..6119af4a0 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi @@ -16,7 +16,6 @@ led-failsafe = &led_power_amber; led-running = &led_power_green; led-upgrade = &led_power_amber; - label-mac-device = ð1; }; ath9k-keys { @@ -154,14 +153,10 @@ ð0 { status = "okay"; - - mtd-mac-address = <&art 0x0>; }; ð1 { compatible = "qca,ar7241-eth", "syscon", "simple-mfd"; - - mtd-mac-address = <&art 0x6>; }; &pcie { @@ -170,8 +165,6 @@ 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; diff --git a/target/linux/ath79/dts/ar7241_tplink.dtsi b/target/linux/ath79/dts/ar7241_tplink.dtsi index 6d7f7515e..84a9a4f63 100644 --- a/target/linux/ath79/dts/ar7241_tplink.dtsi +++ b/target/linux/ath79/dts/ar7241_tplink.dtsi @@ -89,18 +89,31 @@ #gpio-cells = <2>; gpio-controller; qca,no-eeprom; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; }; ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; 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 ca1ad270c..df77ca0fd 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts @@ -135,18 +135,31 @@ #gpio-cells = <2>; gpio-controller; qca,no-eeprom; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; }; ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts index 68f83f7a6..9ccbdbd45 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts @@ -91,12 +91,32 @@ }; }; +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &wifi { ubnt,hsr; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts index 287e8cc7d..3c50e89d0 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts @@ -4,7 +4,7 @@ / { compatible = "ubnt,unifi", "qca,ar7241"; - model = "Ubiquiti UniFi"; + model = "Ubiquiti UniFi AP"; aliases { led-boot = &led_dome_green; @@ -80,6 +80,21 @@ }; }; +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + ð1 { compatible = "syscon", "simple-mfd"; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi index 73ded0f5b..d05ed080a 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi @@ -7,7 +7,7 @@ / { aliases { - label-mac-device = &wifi; + label-mac-device = ð0; }; extosc: ref { @@ -42,7 +42,4 @@ ð0 { status = "okay"; - - mtd-mac-address = <&art 0x0>; }; - diff --git a/target/linux/ath79/dts/ar7242.dtsi b/target/linux/ath79/dts/ar7242.dtsi index be28ae783..eda1b1630 100644 --- a/target/linux/ath79/dts/ar7242.dtsi +++ b/target/linux/ath79/dts/ar7242.dtsi @@ -36,6 +36,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; }; diff --git a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts index 3b2dc0ecf..dde912950 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts @@ -15,5 +15,16 @@ }; ð0 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; 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 111d06491..fa3c47354 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 @@ -192,7 +192,8 @@ pll-data = <0x1c000000 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x120c>; + nvmem-cells = <&macaddr_art_120c>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -204,7 +205,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,002a"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x120c>; + nvmem-cells = <&macaddr_art_120c>; + nvmem-cell-names = "mac-address"; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -229,3 +231,13 @@ #trigger-source-cells = <0>; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_120c: macaddr@120c { + reg = <0x120c 0x6>; + }; +}; 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 4f186c2c1..84d029b5d 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts @@ -64,7 +64,8 @@ }; ð0 { - mtd-mac-address = <&art 0x1002>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; }; &pcie { @@ -73,9 +74,20 @@ ath9k: wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x1002>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts index 436d8c128..745868580 100644 --- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts @@ -63,7 +63,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; phy-mode = "rgmii-id"; @@ -77,10 +78,21 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,002a"; reg = <0x0 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts index be9a19317..f1f86019d 100644 --- a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts @@ -63,7 +63,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; phy-mode = "rgmii-id"; @@ -77,10 +78,21 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,002a"; reg = <0x0 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7242_meraki_mr12.dts b/target/linux/ath79/dts/ar7242_meraki_mr12.dts index ea64b947e..5e82b5bb6 100644 --- a/target/linux/ath79/dts/ar7242_meraki_mr12.dts +++ b/target/linux/ath79/dts/ar7242_meraki_mr12.dts @@ -81,8 +81,9 @@ compatible = "pci168c,002a"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - mtd-mac-address = <&config 0x66>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_66>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; }; @@ -101,7 +102,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&config 0x66>; + nvmem-cells = <&macaddr_config_66>; + nvmem-cell-names = "mac-address"; pll-data = <0x02000000 0x00000101 0x00001313>; @@ -116,7 +118,8 @@ ð1 { status = "okay"; - mtd-mac-address = <&config 0x66>; + nvmem-cells = <&macaddr_config_66>; + nvmem-cell-names = "mac-address"; }; &spi { @@ -164,3 +167,13 @@ }; }; }; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_66: macaddr@66 { + reg = <0x66 0x6>; + }; +}; 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 01f4cb7fd..ae4867521 100644 --- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts +++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts @@ -157,7 +157,8 @@ #gpio-cells = <2>; gpio-controller; qca,no-eeprom; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; }; @@ -165,7 +166,8 @@ status = "okay"; phy-mode = "rgmii"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; fixed-link { @@ -173,3 +175,13 @@ full-duplex; }; }; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts index 85e85d841..b353e7602 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts @@ -67,10 +67,21 @@ phy-handle = <&phy0>; phy-mode = "rgmii"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; fixed-link { speed = <1000>; full-duplex; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts index b640badb3..0c2fe394d 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts @@ -114,11 +114,12 @@ ethernet-switch@1e { compatible = "brcm,bcm53128"; - #address-cells = <1>; - #size-cells = <0>; reg = <0x1e>; ports { + #address-cells = <1>; + #size-cells = <0>; + port0@0 { reg = <0>; label = "lan1"; @@ -169,7 +170,6 @@ full-duplex; }; }; - }; }; }; @@ -177,13 +177,25 @@ ð0 { status = "okay"; + phy-handle = <&phy0>; phy-mode = "rgmii-rxid"; pll-data = <0x16000000 0x00000101 0x00001313>; - mtd-mac-address = <&art 0x0>; - phy-handle = <&phy0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + fixed-link { speed = <1000>; full-duplex; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi index caae72c91..c776c8ef6 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi +++ b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi @@ -41,8 +41,8 @@ gpio_spi { compatible = "spi-gpio"; - #address-cells = <0x1>; - ranges; + #address-cells = <1>; + #size-cells = <0>; sck-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; mosi-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; @@ -131,5 +131,16 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi b/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi index 77dbfc4ac..341d0bad0 100644 --- a/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi +++ b/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi @@ -79,11 +79,27 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi index 9bd4656d8..7b0c09f68 100644 --- a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi +++ b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi @@ -17,16 +17,37 @@ clock-frequency = <40000000>; }; - gpio2: gpio-extender { - compatible = "nxp,74hc153-gpio"; + /* There is a GPIO driven NXP 74HC153 dual 4-way multiplexer on board + * used for buttons that are on top of the the device. + */ + mux: mux-controller { + compatible = "gpio-mux"; + #mux-control-cells = <0>; + + mux-gpios = <&gpio 9 GPIO_ACTIVE_HIGH>, /* s0 */ + <&gpio 11 GPIO_ACTIVE_HIGH>; /* s1 */ + }; + + gpio2: key-mux1 { + compatible = "gpio-cascade"; + mux-controls = <&mux>; + gpio-controller; #gpio-cells = <2>; - // GPIOs used by this node - gpio-s0 = <&gpio 9 GPIO_ACTIVE_HIGH>; - gpio-s1 = <&gpio 11 GPIO_ACTIVE_HIGH>; - gpio-1y = <&gpio 12 GPIO_ACTIVE_HIGH>; - gpio-2y = <&gpio 14 GPIO_ACTIVE_HIGH>; + // GPIOs used by this node, the mux pin + upstream-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; /* 1y */ + }; + + gpio3: key-mux2 { + compatible = "gpio-cascade"; + mux-controls = <&mux>; + + gpio-controller; + #gpio-cells = <2>; + + // GPIOs used by this node, the mux pin + upstream-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; /* 2y */ }; keys { @@ -64,21 +85,21 @@ usb { label = "usb"; linux,code = ; - gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; + gpios = <&gpio3 1 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; router_auto { label = "router_auto"; linux,code = ; - gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; + gpios = <&gpio3 2 GPIO_ACTIVE_HIGH>; debounce-interval = <60>; }; movie_on { label = "movie_on"; linux,code = ; - gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; + gpios = <&gpio3 3 GPIO_ACTIVE_HIGH>; debounce-interval = <60>; }; }; @@ -188,7 +209,8 @@ status = "disabled"; phy-mode = "rgmii"; - mtd-mac-address = <&art 0x1120c>; + nvmem-cells = <&macaddr_art_1120c>; + nvmem-cell-names = "mac-address"; fixed-link { speed = <1000>; @@ -215,7 +237,8 @@ resets = <&rst 13>; reset-names = "mac"; qca,mac-idx = <1>; - mtd-mac-address = <&art 0x1120c>; + nvmem-cells = <&macaddr_art_1120c>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -247,3 +270,13 @@ &usb_phy { status = "okay"; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1120c: macaddr@1120c { + reg = <0x1120c 0x6>; + }; +}; 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 606572aab..354213c44 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts @@ -118,7 +118,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy12>; }; @@ -127,5 +128,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; 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 3b406e4d8..12e417d3a 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts @@ -137,7 +137,8 @@ status = "okay"; phy-mode = "rgmii"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; fixed-link { speed = <1000>; @@ -149,5 +150,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; 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 821c2aec6..58586eb03 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts @@ -144,7 +144,8 @@ status = "okay"; phy-mode = "rmii"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; fixed-link { speed = <100>; @@ -155,5 +156,16 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 06e1cf460..aed8e205a 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -116,6 +116,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; spi: spi@1f000000 { diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index 6a13c1baf..b31d0f961 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -113,13 +113,15 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -133,5 +135,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi index 4f428cbb1..e010e5cad 100644 --- a/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi +++ b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi @@ -130,13 +130,15 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -144,3 +146,17 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts index 607ee5f6c..5383d6588 100644 --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts @@ -112,7 +112,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x1002>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -132,5 +133,20 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x2>; + nvmem-cells = <&macaddr_art_2>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_2: macaddr@2 { + reg = <0x2 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts b/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts index 19a739097..5801044f4 100644 --- a/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts +++ b/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts @@ -86,14 +86,16 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; }; &wmac { @@ -101,3 +103,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts index ba01d25d5..d99e0a422 100644 --- a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts +++ b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts @@ -103,7 +103,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -115,10 +116,25 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi index 7734f20e0..2be7cdb05 100644 --- a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi +++ b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi @@ -55,7 +55,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -95,10 +96,26 @@ reg = <0x030000 0x010000>; }; - art: partition@40000 { + partition@40000 { label = "art"; reg = <0x040000 0x010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; partition@50000 { @@ -121,5 +138,6 @@ &wmac { status = "okay"; - mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>; + nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts index 48bf4d159..de6b709b5 100644 --- a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts +++ b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts @@ -93,9 +93,10 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x1002>; - mtd-mac-address-increment-byte = <3>; - mtd-mac-address-increment = <0x40>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment-byte = <3>; + mac-address-increment = <0x40>; }; &mdio1 { @@ -107,3 +108,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_etactica_eg200.dts b/target/linux/ath79/dts/ar9331_etactica_eg200.dts index 95c8a10e0..402fca80a 100644 --- a/target/linux/ath79/dts/ar9331_etactica_eg200.dts +++ b/target/linux/ath79/dts/ar9331_etactica_eg200.dts @@ -63,7 +63,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -117,3 +118,13 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_glinet_6408.dts b/target/linux/ath79/dts/ar9331_glinet_6408.dts index 658fa1aa5..0d3b7d641 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6408.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6408.dts @@ -5,6 +5,10 @@ / { model = "GL.iNet 6408"; compatible = "glinet,6408", "qca,ar9331"; + + aliases { + label-mac-device = &wmac; + }; }; &spi { @@ -40,3 +44,30 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_glinet_6416.dts b/target/linux/ath79/dts/ar9331_glinet_6416.dts index 189563aaf..91b7cc0c1 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6416.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6416.dts @@ -5,6 +5,10 @@ / { model = "GL.iNet 6416"; compatible = "glinet,6416", "qca,ar9331"; + + aliases { + label-mac-device = &wmac; + }; }; &spi { @@ -40,3 +44,30 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi index 2f92123c3..8d003ce09 100644 --- a/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi +++ b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi @@ -6,10 +6,6 @@ #include / { - aliases { - label-mac-device = &wmac; - }; - keys { compatible = "gpio-keys"; @@ -48,8 +44,6 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - gmac-config { device = <&gmac>; @@ -60,8 +54,6 @@ ð1 { status = "okay"; - - mtd-mac-address = <&uboot 0x1fc00>; }; &usb { @@ -76,7 +68,4 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts index 7d6e7bd4a..e5460b299 100644 --- a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts +++ b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts @@ -121,7 +121,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -134,7 +135,8 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -142,3 +144,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts index d1c265471..6f332dd99 100644 --- a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts +++ b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts @@ -58,7 +58,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -117,3 +118,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi b/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi index 3f20843b0..69d974eb5 100644 --- a/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi +++ b/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi @@ -24,8 +24,9 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; gmac-config { device = <&gmac>; @@ -38,8 +39,9 @@ ð1 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &pinmux { @@ -90,3 +92,13 @@ &usb_phy { status = "okay"; }; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts index 62d5caeb9..0502d5d14 100644 --- a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts +++ b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts @@ -62,7 +62,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -119,3 +120,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9341_pisen_wpr003n.dts b/target/linux/ath79/dts/ar9331_onion_omega.dts similarity index 50% rename from target/linux/ath79/dts/ar9341_pisen_wpr003n.dts rename to target/linux/ath79/dts/ar9331_onion_omega.dts index 5473c5408..09e423419 100644 --- a/target/linux/ath79/dts/ar9341_pisen_wpr003n.dts +++ b/target/linux/ath79/dts/ar9331_onion_omega.dts @@ -1,43 +1,86 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "ar9341.dtsi" +#include "ar9331.dtsi" #include #include / { - model = "PISEN WPR003N"; - compatible = "pisen,wpr003n", "qca,ar9341"; + model = "Onion Omega"; + compatible = "onion,omega", "qca,ar9331"; aliases { - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; + serial0 = &uart; label-mac-device = &wmac; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; leds { compatible = "gpio-leds"; - led_power: power { - label = "blue:power"; - gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; - default-state = "on"; + led_system: system { + label = "amber:system"; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; }; - }; keys { compatible = "gpio-keys"; reset { - label = "Reset"; + label = "reset"; linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; debounce-interval = <60>; }; }; + + reg_usb_vbus: reg_usb_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&ref { + clock-frequency = <25000000>; +}; + +&usb { + status = "okay"; + + vbus-supply = <®_usb_vbus>; + dr_mode = "host"; +}; + +&usb_phy { + status = "okay"; +}; + +ð0 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; + + gmac-config { + device = <&gmac>; + switch-phy-addr-swap = <4>; + switch-phy-swap = <4>; + }; }; &spi { @@ -45,8 +88,8 @@ flash@0 { compatible = "jedec,spi-nor"; - reg = <0>; spi-max-frequency = <25000000>; + reg = <0>; partitions { compatible = "fixed-partitions"; @@ -74,33 +117,21 @@ }; }; -ð0 { - status = "okay"; - - phy-handle = <&swphy4>; - - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; -}; - -ð1 { - mtd-mac-address = <&uboot 0x1fc00>; - - gmac-config { - device = <&gmac>; - switch-phy-only_mode = <0>; - }; -}; - -&usb { - status = "okay"; -}; - -&usb_phy { - status = "okay"; -}; - &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts index 873762088..58ef4ab09 100644 --- a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts +++ b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts @@ -75,7 +75,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -102,5 +103,16 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts index 3a18249aa..f438567e5 100644 --- a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts +++ b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts @@ -83,7 +83,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -111,5 +112,16 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts index c394cf1cb..1858c7427 100644 --- a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts +++ b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts @@ -109,14 +109,16 @@ ð0 { status = "okay"; - mtd-mac-address = <&config 0x0>; + nvmem-cells = <&macaddr_config_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&config 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &spi { @@ -188,6 +190,17 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&config 0x0>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_config_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; +}; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; 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 7df4ed9a9..c420c1a4c 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts @@ -146,7 +146,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -165,5 +166,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; 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 6c353379b..619fd09ee 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts @@ -135,7 +135,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -154,5 +155,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; 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 e31640b87..5fda458fb 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 @@ -80,7 +80,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -110,5 +111,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi index 759e76529..61ef9fb99 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi @@ -2,6 +2,12 @@ #include "ar9331_tplink_tl-wr710n.dtsi" +/ { + aliases { + label-mac-device = ð0; + }; +}; + &spi { status = "okay"; @@ -35,3 +41,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi index 7d2cbeb95..329822ad1 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; - label-mac-device = ð0; }; keys { @@ -47,8 +46,6 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - gmac-config { device = <&gmac>; @@ -59,9 +56,6 @@ ð1 { status = "okay"; - - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; }; &usb { @@ -77,7 +71,4 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; }; 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 e460e4cd2..b74b8251c 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi @@ -121,8 +121,9 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; gmac-config { device = <&gmac>; @@ -135,13 +136,25 @@ ð1 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts index 8c87a7350..4a993c930 100644 --- a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts +++ b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts @@ -46,7 +46,8 @@ }; ð1 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -54,3 +55,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts index 5c81020cc..ec574ccf9 100644 --- a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts +++ b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts @@ -65,13 +65,15 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -84,3 +86,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi index 727064def..2dfdff03d 100644 --- a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi +++ b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi @@ -142,11 +142,13 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -154,3 +156,17 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts index 1d742a785..4e4daef1c 100644 --- a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts +++ b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts @@ -133,18 +133,30 @@ status = "okay"; phy-handle = <&swphy0>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { phy-handle = <&swphy4>; pll-data = <0x06000000 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; switch-phy-swap = <1>; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts index ffa52b437..23b5cf745 100644 --- a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts +++ b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts @@ -188,7 +188,8 @@ ð0 { status = "okay"; phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -213,3 +214,13 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9341_tplink.dtsi b/target/linux/ath79/dts/ar9341_tplink.dtsi index 26410bcc1..9c505f278 100644 --- a/target/linux/ath79/dts/ar9341_tplink.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = &wmac; }; leds: leds { @@ -80,14 +79,9 @@ 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>; @@ -96,7 +90,4 @@ &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 index 9adc9a1fa..f86c4423b 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts @@ -6,6 +6,10 @@ model = "TP-Link TL-MR3420 v2"; compatible = "tplink,tl-mr3420-v2", "qca,ar9341"; + aliases { + label-mac-device = &wmac; + }; + keys { compatible = "gpio-keys"; @@ -91,3 +95,31 @@ &usb_phy { status = "okay"; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi index 499ef9820..5d5b88c5f 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi @@ -54,7 +54,8 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -71,5 +72,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; 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 cd7532d27..d86571c53 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts @@ -6,6 +6,10 @@ model = "TP-Link TL-WR841N/ND v8"; compatible = "tplink,tl-wr841-v8", "qca,ar9341"; + aliases { + label-mac-device = &wmac; + }; + keys { compatible = "gpio-keys"; @@ -59,3 +63,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; 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 8c27fe197..5d20df926 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts @@ -6,6 +6,10 @@ model = "TP-Link TL-WR842N/ND v2"; compatible = "tplink,tl-wr842n-v2", "qca,ar9341"; + aliases { + label-mac-device = &wmac; + }; + keys { compatible = "gpio-keys"; @@ -93,6 +97,32 @@ status = "okay"; }; +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + ð1 { phy-handle = <&swphy4>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts index ee2c12b4e..b7ab1cacd 100644 --- a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts +++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts @@ -16,6 +16,13 @@ led-upgrade = &led_power; }; + gpio_key: gpio_key { + compatible = "mikrotik,gpio-rb91x-key"; + gpio-controller; + #gpio-cells = <2>; + gpio = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + gpio_latch: gpio_latch { compatible = "gpio-latch"; gpio-controller; @@ -27,7 +34,7 @@ <0>, /* Not connected */ <&gpio 13 GPIO_ACTIVE_HIGH>, <&gpio 14 GPIO_ACTIVE_HIGH>, - <&gpio 15 GPIO_ACTIVE_HIGH>, + <&gpio_key 0 GPIO_ACTIVE_HIGH>, <&gpio 11 GPIO_ACTIVE_LOW>; /* Latch Enable */ }; @@ -40,7 +47,8 @@ <&gpio_latch 6 GPIO_ACTIVE_HIGH>, /* Command Latch Enable (CLE) */ <&gpio_latch 7 GPIO_ACTIVE_HIGH>, /* Address Latch Enable (ALE) */ <&gpio 12 GPIO_ACTIVE_LOW>, /* Read/Write Enable (nRW) */ - <&gpio_latch 8 GPIO_ACTIVE_LOW>; /* Latch Enable (nLE) */ + <&gpio_latch 8 GPIO_ACTIVE_LOW>, /* Latch Enable (nLE) */ + <&gpio_key 2 GPIO_ACTIVE_HIGH>; /* Key poll disable */ partitions { compatible = "fixed-partitions"; @@ -64,6 +72,17 @@ }; }; + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + button@0 { + label = "reset"; + linux,code = ; + gpios = <&gpio_key 1 GPIO_ACTIVE_LOW>; + }; + }; + leds { compatible = "gpio-leds"; @@ -127,6 +146,10 @@ }; }; +&ref { + clock-frequency = <25000000>; +}; + &spi { status = "okay"; @@ -194,7 +217,6 @@ gmac-config { device = <&gmac>; rgmii-gmac0 = <1>; - rgmii-enabled = <1>; rxd-delay = <1>; txd-delay = <1>; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts index 01bc48762..15e23f242 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts @@ -15,7 +15,7 @@ reset { label = "reset"; linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; }; @@ -96,7 +96,8 @@ /* default for ar934x, except for 1000M and 10M */ pll-data = <0x06000000 0x00000101 0x00001313>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -111,3 +112,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m2-xw.dts b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m2-xw.dts new file mode 100644 index 000000000..046715b00 --- /dev/null +++ b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m2-xw.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9342_ubnt_xw.dtsi" + +/ { + compatible = "ubnt,powerbeam-m2-xw", "ubnt,xw", "qca,ar9342"; + model = "Ubiquiti PowerBeam M2 (XW)"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <4>; + + phy1: ethernet-phy@1 { + reg = <1>; + }; +}; + +ð0 { + status = "okay"; + + /* default for ar934x, except for 1000M and 10M */ + pll-data = <0x02000000 0x00000101 0x00001313>; + + phy-mode = "rgmii-id"; + phy-handle = <&phy1>; + + gmac-config { + device = <&gmac>; + rxd-delay = <3>; + rxdv-delay = <3>; + }; +}; diff --git a/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m-xw.dts b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m5-xw.dts similarity index 81% rename from target/linux/ath79/dts/ar9342_ubnt_powerbeam-m-xw.dts rename to target/linux/ath79/dts/ar9342_ubnt_powerbeam-m5-xw.dts index 6db058f88..e5a9af390 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m-xw.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m5-xw.dts @@ -3,8 +3,8 @@ #include "ar9342_ubnt_xw.dtsi" / { - compatible = "ubnt,powerbeam-m-xw", "ubnt,xw", "qca,ar9342"; - model = "Ubiquiti PowerBeam M (XW)"; + compatible = "ubnt,powerbeam-m5-xw", "ubnt,xw", "qca,ar9342"; + model = "Ubiquiti PowerBeam M5 (XW)"; }; &mdio0 { diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index ac036ccd8..ba0f7ad23 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -78,6 +78,16 @@ &wmac { status = "okay"; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi index 918b69c1d..045cbe898 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi @@ -18,7 +18,8 @@ /* default for ar934x, except for 1000M and 10M */ pll-data = <0x02000000 0x00000101 0x00001313>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; phy-handle = <&phy4>; diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi index f2e936bcc..2567c7775 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi @@ -26,7 +26,8 @@ /* default for ar934x, except for 1000M and 10M */ pll-data = <0x06000000 0x00000101 0x00001313>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi index 3089e6b34..ce49c10e5 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -110,5 +110,16 @@ }; ð0 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts index fae3eec78..a2ac53b99 100644 --- a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts +++ b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts @@ -106,8 +106,9 @@ compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&hw_info 0x0>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_hw_info_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; }; }; @@ -160,8 +161,9 @@ &wmac { status = "okay"; - mtd-mac-address = <&hw_info 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_hw_info_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &nand { @@ -215,7 +217,8 @@ pll-data = <0x06000000 0x00000101 0x00001313>; - mtd-mac-address = <&hw_info 0x0>; + nvmem-cells = <&macaddr_hw_info_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; phy-handle = <&phy0>; @@ -227,3 +230,13 @@ rxdv-delay = <1>; }; }; + +&hw_info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hw_info_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts index 486e109c8..ca762c3bc 100644 --- a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts +++ b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts @@ -90,14 +90,16 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&swphy4>; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &ref { @@ -129,10 +131,30 @@ reg = <0x060000 0x010000>; }; - art: partition@70000 { + partition@70000 { label = "art"; reg = <0x070000 0x010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; partition@80000 { @@ -147,5 +169,6 @@ &wmac { status = "okay"; - mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>; + nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts b/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts new file mode 100644 index 000000000..a886b4c00 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" +#include "ar934x_senao_loader.dtsi" + +#include +#include + +/ { + compatible = "araknis,an-300-ap-i-n", "qca,ar9344"; + model = "Araknis AN-300-AP-I-N"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&phy0>; + phy-mode = "rgmii-txid"; + + pll-data = <0x02000000 0x00000101 0x00001313>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0,0 { + compatible = "pci168c,0030"; + reg = <0x0 0 0 0 0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + qca,disable-5ghz; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&wmac { + status = "okay"; + + qca,disable-2ghz; + + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_atheros_db120.dts b/target/linux/ath79/dts/ar9344_atheros_db120.dts new file mode 100644 index 000000000..625a8e4fa --- /dev/null +++ b/target/linux/ath79/dts/ar9344_atheros_db120.dts @@ -0,0 +1,250 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include +#include + +/ { + model = "Atheros DB120 reference board"; + compatible = "atheros,db120", "qca,ar9344"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds { + compatible = "gpio-leds"; + + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led_system: system { + label = "green:system"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb { + label = "green:usb"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port1>; + linux,default-trigger = "usbport"; + }; + }; + + leds-ath9k { + compatible = "gpio-leds"; + + wlan5g-ath { + label = "green:wlan5g-ath"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + linux,code = ; + label = "WPS button"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x0>; + label = "firmware"; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + }; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&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 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + fwconcat0: partition@50000 { + label = "fwconcat0"; + reg = <0x050000 0x630000>; + }; + + partition@680000 { + label = "loader"; + reg = <0x680000 0x010000>; + }; + + fwconcat1: partition@690000 { + label = "fwconcat1"; + reg = <0x690000 0x150000>; + }; + + partition@7e0000 { + label = "nvram"; + reg = <0x7e0000 0x010000>; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x06000000 0x00000101 0x00001616>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x10 0xc1000000 /* POWER_ON_STRAP */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6_STATUS */ + >; + }; +}; + +&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>; + + /delete-property/qca,phy4-mii-enable; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <0>; + switch-only-mode = <1>; + }; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0030"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + ieee80211-freq-limit = <4900000 5990000>; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&usb { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; 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 73e06370f..94a82badd 100644 --- a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts +++ b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts @@ -120,7 +120,8 @@ ð0 { status = "okay"; phy-handle = <&swphy0>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -130,10 +131,25 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts index 96549ec2c..8d42f0c21 100644 --- a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts +++ b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts @@ -139,8 +139,19 @@ pll-data = <0x06000000 0x00000101 0x00001616>; - mtd-mac-address = <&uboot 0x2e010>; + nvmem-cells = <&macaddr_uboot_2e010>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; }; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi index 9424e4865..1cec66256 100644 --- a/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi +++ b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi @@ -130,8 +130,9 @@ pll-data = <0x02000000 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x1002>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -168,3 +169,13 @@ >; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts b/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts new file mode 100644 index 000000000..a84c273f8 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include +#include + +/ { + model = "Embedded Wireless Balin"; + compatible = "embeddedwireless,balin", "qca,ar9344"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds { + compatible = "gpio-leds"; + + led_system: led-0 { + label = "green:system"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "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>; + }; + + partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: calibration_data@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; + }; + }; +}; + +&builtin_switch { + /delete-property/qca,phy4-mii-enable; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment-byte = <3>; + mac-address-increment = <0x40>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <0>; + switch-only-mode = <1>; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&macaddr_art_1002>, <&calibration_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&pcie { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/ar9344_engenius_eap600.dts b/target/linux/ath79/dts/ar9344_engenius_eap600.dts index c6961f636..5ad8078f8 100644 --- a/target/linux/ath79/dts/ar9344_engenius_eap600.dts +++ b/target/linux/ath79/dts/ar9344_engenius_eap600.dts @@ -29,17 +29,30 @@ }; ð0 { - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <(-2)>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; }; &pcie { wifi@0,0,0 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; }; &wmac { - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts index 13167adc4..e064994db 100644 --- a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts +++ b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts @@ -24,17 +24,30 @@ }; ð0 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &pcie { wifi@0,0,0 { - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <(-2)>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; }; }; &wmac { - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi index 1c318f208..09dc5806d 100644 --- a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi +++ b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi @@ -69,7 +69,7 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,0030"; reg = <0x0 0 0 0 0>; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -79,7 +79,7 @@ &wmac { status = "okay"; - qca,disable-2ghz; + ieee80211-freq-limit = <4900000 5990000>; mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi new file mode 100644 index 000000000..4bf0731b1 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "RouterBoot"; + reg = <0x0 0x20000>; + read-only; + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader1"; + reg = <0x0 0x0>; + read-only; + }; + + hard_config: hard_config { + read-only; + }; + + bios { + size = <0x1000>; + read-only; + }; + + partition@10000 { + label = "bootloader2"; + reg = <0x10000 0x0>; + read-only; + }; + + soft_config { + label = "soft_config"; + }; + }; + + partition@20000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x020000 0xfe0000>; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts new file mode 100644 index 000000000..194a789fb --- /dev/null +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_mikrotik_routerboard-16m-nor.dtsi" + +#include +#include + +/ { + compatible = "mikrotik,routerboard-lhg-5nd", "qca,ar9344"; + model = "MikroTik RouterBOARD LHG 5nD"; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "blue:power"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + rssilow { + label = "green:rssilow"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "green:rssimediumlow"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "green:rssimedium"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "green:rssimediumhigh"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "green:rssihigh"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + led_user: user { + label = "white:user"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "green:lan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi index 3ed50abef..86136289d 100644 --- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi @@ -99,7 +99,6 @@ partition@0 { label = "RouterBoot"; reg = <0x0 0x20000>; - read-only; compatible = "mikrotik,routerboot-partitions"; #address-cells = <1>; #size-cells = <1>; diff --git a/target/linux/ath79/dts/ar9344_netgear_r6100.dts b/target/linux/ath79/dts/ar9344_netgear_r6100.dts new file mode 100644 index 000000000..80951d624 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_r6100.dts @@ -0,0 +1,231 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + model = "Netgear R6100"; + compatible = "netgear,r6100", "qca,ar9344"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power_green; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + usb-power { + gpio-export,name = "usb-power"; + gpio-export,output = <1>; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + rfkill { + label = "rfkill"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_amber: power_amber { + label = "amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "blue:usb"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port>; + linux,default-trigger = "usbport"; + }; + + wan_amber { + label = "amber:wan"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wan_green { + label = "green:wan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "blue:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + nvmem-cells = <&macaddr_caldata_6>; + nvmem-cell-names = "mac-address"; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_caldata_0>; + nvmem-cell-names = "mac-address"; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x0020000>; + read-only; + }; + + caldata: partition@20000 { + label = "caldata"; + reg = <0x0020000 0x0040000>; + read-only; + }; + + partition@60000 { + label = "caldata-backup"; + reg = <0x0060000 0x0040000>; + read-only; + }; + + partition@a0000 { + label = "config"; + reg = <0x00a0000 0x0080000>; + read-only; + }; + + partition@120000 { + label = "pot"; + reg = <0x0120000 0x0080000>; + read-only; + }; + + partition@1a0000 { + label = "kernel"; + reg = <0x01a0000 0x0400000>; + }; + + partition@5a0000 { + label = "ubi"; + reg = <0x05a0000 0x7560000>; + }; + + partition@7b00000 { + label = "language"; + reg = <0x7b00000 0x0200000>; + read-only; + }; + + partition@7d00000 { + label = "traffic_meter"; + reg = <0x7d00000 0x0300000>; + read-only; + }; + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + + nvmem-cells = <&macaddr_caldata_c>; + nvmem-cell-names = "mac-address"; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&usb { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&caldata 0x1000>; +}; + +&caldata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi index 52425a071..c075c3855 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi @@ -219,7 +219,8 @@ /* default for ar934x, except for 1000M */ pll-data = <0x06000000 0x00000101 0x00001616>; - mtd-mac-address = <&caldata 0x0>; + nvmem-cells = <&macaddr_caldata_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -244,7 +245,8 @@ &wmac { status = "okay"; - mtd-mac-address = <&caldata 0x0>; + nvmem-cells = <&macaddr_caldata_0>; + nvmem-cell-names = "mac-address"; qca,no-eeprom; }; @@ -254,9 +256,24 @@ ath9k: wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&caldata 0xc>; + nvmem-cells = <&macaddr_caldata_c>; + nvmem-cell-names = "mac-address"; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; + +&caldata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts index cf02b711f..0bbeb2b53 100644 --- a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts +++ b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts @@ -129,7 +129,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0xc>; + nvmem-cells = <&macaddr_art_c>; + nvmem-cell-names = "mac-address"; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -140,7 +141,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &mdio0 { @@ -150,16 +152,46 @@ phy0: ethernet-phy@0 { reg = <0>; + eee-broken-100tx; + eee-broken-1000t; }; }; ð0 { status = "okay"; - pll-data = <0x06000000 0x00000101 0x00001313>; + pll-data = <0x02000000 0x00000101 0x00001313>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; phy-handle = <&phy0>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxdv-delay = <3>; + rxd-delay = <3>; + txen-delay = <0>; + txd-delay = <0>; + }; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi index ff532733b..bbbcc3e0b 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi +++ b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi @@ -96,7 +96,8 @@ pll-data = <0x02000000 0x00000101 0x00001313>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; phy-handle = <&phy0>; @@ -113,8 +114,9 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &pcie { @@ -124,7 +126,21 @@ compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <8>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <8>; + + gpio-controller; + #gpio-cells = <2>; + }; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; }; }; diff --git a/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts b/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts new file mode 100644 index 000000000..e15e296f8 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts @@ -0,0 +1,230 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + compatible = "openmesh,om5p-an", "qca,ar9344"; + model = "OpenMesh OM5P-AN"; + + chosen { + /delete-property/ bootargs; + }; + + aliases { + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&led_lan_wan_blue_pin>; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan_blue { + label = "blue:lan"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wifi_green { + label = "green:wifi"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi_yellow { + label = "yellow:wifi"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wifi_red { + label = "red:wifi"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; + + i2c { + compatible = "i2c-gpio"; + gpios = <&gpio 21 GPIO_ACTIVE_HIGH /* sda */ + &gpio 20 GPIO_ACTIVE_HIGH /* scl */ + >; + #address-cells = <1>; + #size-cells = <0>; + + i2c-gpio,scl-open-drain; + i2c-gpio,sda-open-drain; + + tmp423a@4c { + compatible = "ti,tmp423"; + reg = <0x4c>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&pinmux { + led_lan_wan_blue_pin: pinmux_lan_wan_blue_pin { + pinctrl-single,bits = <0xc 0x0 0xffff0000>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + /* partitions are passed via bootloader */ + 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 { + label = "custom"; + reg = <0x050000 0x060000>; + read-only; + }; + + partition@b0000 { + label = "inactive"; + reg = <0x0b0000 0x7a0000>; + }; + + partition@850000 { + label = "inactive2"; + reg = <0x850000 0x7a0000>; + }; + + art: partition@ff0000 { + label = "ART"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x80>; + + phy7: ethernet-phy@7 { + reg = <7>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x02000000 0x00000101 0x00001313>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-mode = "rgmii-id"; + phy-handle = <&phy7>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxd-delay = <2>; + rxdv-delay = <2>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,0030"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <16>; + }; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_openmesh_om5p.dts b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts index 636595c9e..3e60d05ed 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_om5p.dts +++ b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts @@ -145,13 +145,15 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -159,3 +161,17 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts index 3ce8bb58f..6ebd6a43b 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts @@ -118,11 +118,12 @@ ath9k: wifi@0,0 { compatible = "168c,0030"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <(-2)>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; mtd-cal-data = <&art 0x5000>; qca,no-eeprom; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; #gpio-cells = <2>; gpio-controller; }; @@ -131,10 +132,11 @@ &wmac { status = "okay"; - qca,disable-2ghz; + ieee80211-freq-limit = <4900000 5990000>; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; &mdio0 { @@ -154,8 +156,19 @@ /* default for ar934x, except for 1000M */ pll-data = <0x06000000 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts index 9aaabd0c2..7b99ef737 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts @@ -125,7 +125,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x5002>; + nvmem-cells = <&macaddr_art_5002>; + nvmem-cell-names = "mac-address"; #gpio-cells = <2>; gpio-controller; }; @@ -159,7 +160,8 @@ /* default for ar934x, except for 1000M */ pll-data = <0x06000000 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -209,3 +211,17 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_5002: macaddr@5002 { + reg = <0x5002 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts index 61389be12..7c2f90e72 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts @@ -24,14 +24,16 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&pridata 0x400>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { status = "okay"; - mtd-mac-address = <&pridata 0x400>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -47,3 +49,13 @@ reg = <0x070000 0xf90000>; }; }; + +&pridata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + reg = <0x400 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts index e232cdab2..042974610 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts @@ -24,14 +24,16 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&pridata 0x400>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { status = "okay"; - mtd-mac-address = <&pridata 0x400>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -47,3 +49,13 @@ reg = <0x070000 0x790000>; }; }; + +&pridata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + reg = <0x400 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts index fb200fae3..195ab9db2 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts @@ -33,7 +33,8 @@ pll-data = <0x06000000 0x00000101 0x00001616>; - mtd-mac-address = <&pridata 0x400>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -46,3 +47,13 @@ reg = <0x070000 0xf90000>; }; }; + +&pridata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + reg = <0x400 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts index 75ef13ec1..b81a7f777 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts @@ -33,7 +33,8 @@ pll-data = <0x06000000 0x00000101 0x00001616>; - mtd-mac-address = <&pridata 0x400>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -46,3 +47,13 @@ reg = <0x070000 0x790000>; }; }; + +&pridata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + reg = <0x400 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_samsung_wam250.dts b/target/linux/ath79/dts/ar9344_samsung_wam250.dts index 0f38ff82e..fd5bf9e81 100644 --- a/target/linux/ath79/dts/ar9344_samsung_wam250.dts +++ b/target/linux/ath79/dts/ar9344_samsung_wam250.dts @@ -66,8 +66,9 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&art 0x1002>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; gmac-config { device = <&gmac>; @@ -78,7 +79,8 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x1002>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; }; &gpio { @@ -154,3 +156,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts index eb9606e58..2cb8d4015 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts @@ -164,14 +164,16 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&config 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { status = "okay"; - mtd-mac-address = <&config 0x0>; + nvmem-cells = <&macaddr_config_0>; + nvmem-cell-names = "mac-address"; }; &builtin_switch { diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut955.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts index ba840a05d..7a1f05afc 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts @@ -163,14 +163,16 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&config 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { status = "okay"; - mtd-mac-address = <&config 0x0>; + nvmem-cells = <&macaddr_config_0>; + nvmem-cell-names = "mac-address"; }; &builtin_switch { diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi index d9c66d274..c989a30b1 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi +++ b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi @@ -147,8 +147,9 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&config 0x0>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_config_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; }; &pinmux { @@ -171,3 +172,13 @@ <0x3c 0x000b0000 0x00ff0000>; }; }; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi index fd6aa0f08..9d8873dda 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi @@ -84,7 +84,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; }; ð0 { @@ -92,7 +93,8 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -114,3 +116,13 @@ line-name = "tp-link:ext:lna1"; }; }; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi index e7d33ab22..e35fa486e 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi @@ -45,7 +45,8 @@ }; ð1 { - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts index 59a06346a..6c5d013cc 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts @@ -57,19 +57,22 @@ }; &ath9k { - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &wmac { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; gmac-config { device = <&gmac>; @@ -83,6 +86,17 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi index 21fd079e1..262c6f713 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi @@ -80,12 +80,14 @@ }; &ath9k { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; &wmac { - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; &mdio0 { @@ -115,8 +117,19 @@ /* default for ar934x, except for 1000M */ pll-data = <0x06000000 0x00000101 0x00001616>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; }; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts new file mode 100644 index 000000000..360443565 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + model = "TP-Link TL-WR841HP v2"; + compatible = "tplink,tl-wr841hp-v2", "qca,ar9344"; + + aliases { + 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 { + linux,code = ; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + wan { + label = "green:wan"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "green:lan1"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "green:lan2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "green:lan3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "green:lan4"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "green:wps"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_system: system { + label = "green:system"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&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 { + 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; + }; + }; + }; +}; + +&gpio { + gpio_ext_lna0 { + gpio-hog; + gpios = <18 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "tp-link:ext:lna0"; + }; + + gpio_ext_lna1 { + gpio-hog; + gpios = <19 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "tp-link:ext:lna1"; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts index 4612ae1a6..8471be9b6 100644 --- a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts +++ b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts @@ -144,8 +144,19 @@ pll-data = <0x6000000 0x101 0x1616>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts new file mode 100644 index 000000000..81788fb34 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_wd_mynet-nxxx.dtsi" +#include + +/ { + model = "Western Digital My Net N600"; + compatible = "wd,mynet-n600", "qca,ar9344"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + + led_power: led-1 { + label = "blue:power"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + }; + + led-2 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wps { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio { + gpio_ext_lna0 { + gpio-hog; + gpios = <14 0>; + output-high; + line-name = "ext:lna0"; + }; + + gpio_ext_lna1 { + gpio-hog; + gpios = <15 0>; + output-high; + line-name = "ext:lna1"; + }; +}; + +&pinmux { + pmx_led_switch: pinmux_led_switch { + pinctrl-single,bits = + <0x0 0x2c2b2a00 0xffffff00>, /* GPIO1-3 default to PHY2-4 */ + <0x4 0x00000029 0x000000ff>; /* GPIO4 default to PHY1 */ + }; +}; + +&builtin_switch { + pinctrl-names = "default"; + pinctrl-0 = <&pmx_led_switch>; +}; + +&usb { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + switch-only-mode = <1>; + }; +}; + +ð1 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts index e3faa392a..d1f63c506 100644 --- a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts +++ b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts @@ -1,18 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "ar9344.dtsi" - -#include -#include +#include "ar9344_wd_mynet-nxxx.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; @@ -59,75 +52,19 @@ }; }; -&ref { - clock-frequency = <40000000>; -}; - &gpio { gpio_ext_lna0 { gpio-hog; gpios = <15 0>; output-high; - line-name = "mynet-n750:ext:lna0"; + line-name = "ext:lna0"; }; gpio_ext_lna1 { gpio-hog; gpios = <18 0>; output-high; - line-name = "mynet-n750:ext:lna1"; - }; -}; - -&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>; - - 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; - }; - }; + line-name = "ext:lna1"; }; }; @@ -154,26 +91,6 @@ }; }; -&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"; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi b/target/linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi new file mode 100644 index 000000000..73e2c2566 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&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>; + + partition@0 { + label = "bootloader"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "bdcfg"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "devdata"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + label = "devconf"; + reg = <0x060000 0x010000>; + read-only; + }; + + partition@70000 { + compatible = "seama"; + label = "firmware"; + reg = <0x070000 0xf80000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&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; +}; diff --git a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts index 72cd5aab4..2586a174c 100644 --- a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts +++ b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts @@ -141,8 +141,9 @@ compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - mtd-mac-address = <&addr 0x0>; - mtd-mac-address-increment = <0x10>; + nvmem-cells = <&macaddr_addr_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <0x10>; #gpio-cells = <2>; gpio-controller; }; @@ -179,7 +180,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&addr 0x0>; + nvmem-cells = <&macaddr_addr_0>; + nvmem-cell-names = "mac-address"; }; &mdio0 { @@ -197,8 +199,9 @@ pll-data = <0xe000000 0x04000101 0x04001313>; - mtd-mac-address = <&addr 0x0>; - mtd-mac-address-increment = <0x21>; + nvmem-cells = <&macaddr_addr_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <0x21>; phy-mode = "rgmii-rxid"; phy-handle = <&phy4>; @@ -210,3 +213,13 @@ rxdv-delay = <1>; }; }; + +&addr { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_addr_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts index a3b4534cb..8fc21be1d 100644 --- a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts +++ b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts @@ -84,12 +84,14 @@ ð0 { status = "okay"; phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &spi { @@ -150,3 +152,17 @@ pinctrl-single,bits = <0x14 0x0 0xff00>; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index 84dbe65f8..d88c7bfab 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -175,6 +175,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; nand: nand@1b000200 { diff --git a/target/linux/ath79/dts/qca9531_8dev_lima.dts b/target/linux/ath79/dts/qca9531_8dev_lima.dts index 7fc84a678..5a21251d6 100644 --- a/target/linux/ath79/dts/qca9531_8dev_lima.dts +++ b/target/linux/ath79/dts/qca9531_8dev_lima.dts @@ -87,7 +87,8 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -98,7 +99,8 @@ }; ð1 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -106,3 +108,17 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts index 40eabd048..8759198f5 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts @@ -106,13 +106,15 @@ }; ð0 { - mtd-mac-address = <&art 0x1002>; - mtd-mac-address-increment = <(-2)>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; }; ð1 { - mtd-mac-address = <&art 0x1002>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; &pcie0 { diff --git a/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts b/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts index 42f2c9ffe..e9e19f9d3 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts @@ -45,8 +45,9 @@ }; ð0 { - mtd-mac-address = <&art 0x1002>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; ð1 { diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts index ab6536924..6af8d3b8b 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts @@ -50,8 +50,9 @@ }; ð0 { - mtd-mac-address = <&art 0x1002>; - mtd-mac-address-increment = <(-2)>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; }; ð1 { @@ -59,8 +60,9 @@ * (GMAC0 -> eth0, GMAC1 -> eth1, same as in old ar71xx target) */ compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; - mtd-mac-address = <&art 0x1002>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; &gpio_export { diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi index 4c9346db1..9704e6921 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi @@ -82,10 +82,22 @@ reg = <0x060000 0x010000>; }; - art: partition@70000 { + partition@70000 { label = "art"; reg = <0x070000 0x010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; partition@80000 { @@ -116,5 +128,6 @@ &wmac { status = "okay"; - mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>; + nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts b/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts new file mode 100644 index 000000000..f81fe287d --- /dev/null +++ b/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9531_alfa-network_r36a.dtsi" + +/ { + model = "ALFA Network Tube-2HQ"; + compatible = "alfa-network,tube-2hq", "qca,qca9531"; + + aliases { + led-boot = &led_signal4; + led-failsafe = &led_signal4; + led-upgrade = &led_signal4; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio4 &enable_gpio16>; + + lan { + label = "blue:lan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led_signal4: signal4 { + label = "green:signal4"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + signal1 { + label = "red:signal1"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + signal2 { + label = "orange:signal2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + signal3 { + label = "green:signal3"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + + mac-address-increment = <(-1)>; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; + +&usb0 { + status = "disabled"; +}; + +&usb_phy { + status = "disabled"; +}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts index e14cf772a..4a84e150a 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts @@ -118,7 +118,8 @@ }; ð1 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -129,6 +130,17 @@ &wmac { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts index 757a2eaee..c18752135 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts @@ -121,7 +121,8 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&art 0x1002>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -130,7 +131,8 @@ }; ð1 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &pcie0 { @@ -141,3 +143,17 @@ reg = <0 0 0 0 0>; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts index 4738ba56a..c182390b2 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts @@ -136,14 +136,30 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts index 57727754b..d83972525 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts @@ -121,11 +121,13 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -139,3 +141,17 @@ pinctrl-single,bits = <0x4 0x0 0xff>; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts index a7ea34eeb..477a2bddc 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts @@ -150,18 +150,31 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <10>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <10>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts index edb6bbe5f..e5024b39f 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts @@ -109,18 +109,31 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <3>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <3>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts b/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts index 6ae2e4eb5..fc2f6de11 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts @@ -109,7 +109,8 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -121,6 +122,17 @@ mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <10>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <10>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts index 89822586f..16a2794b9 100644 --- a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts +++ b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts @@ -105,11 +105,13 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x2e010>; + nvmem-cells = <&macaddr_uboot_2e010>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&uboot 0x2e018>; + nvmem-cells = <&macaddr_uboot_2e018>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -134,3 +136,17 @@ &usb0 { status = "okay"; }; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; + + macaddr_uboot_2e018: macaddr@2e018 { + reg = <0x2e018 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts b/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts index d2fbc09c6..9a4db6f9f 100644 --- a/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts +++ b/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts @@ -19,7 +19,7 @@ i2c { compatible = "i2c-gpio"; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; sda-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; scl-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi index d0b0d88c4..d4e1e6b23 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi @@ -146,15 +146,27 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts index 24dc8aaf6..60bd2922a 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts @@ -129,12 +129,14 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &wmac { @@ -142,3 +144,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts index 98022d7cc..ca0784e6b 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts @@ -120,7 +120,8 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -132,3 +133,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts new file mode 100644 index 000000000..5f5646b3e --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include + +/ { + compatible = "glinet,gl-x300b", "qca,qca9531"; + model = "GL.iNet GL-X300B"; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wan { + label = "green:wan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lte { + label = "green:lte"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + minipcie { + gpio-export,name = "minipcie"; + gpio-export,output = <0>; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + + rs485tx_en { + gpio-export,name = "rs485tx_en"; + gpio-export,output = <0>; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + + ble_rst { + gpio-export,name = "ble_rst"; + gpio-export,output = <0>; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + }; + + watchdog { + compatible = "hw_wdt"; + dog_en_gpio = <12>; + feed_dog_gpio = <2>; + feed_dog_interval = <100000000>; + }; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&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>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + art: partition@50000 { + label = "art"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x060000 0xfa0000>; + }; + + }; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&swphy4>; +}; + +ð1 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts index c755e0003..7fd622a8c 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts @@ -118,12 +118,14 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &wmac { @@ -131,3 +133,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts new file mode 100644 index 000000000..9c2760398 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include + +/ { + compatible = "glinet,gl-xe300", "qca,qca9531"; + model = "GL.iNet GL-XE300"; + + gpio-export { + compatible = "gpio-export"; + + gpio_lte_power { + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + gpio-export,name = "lte_power"; + gpio-export,output = <1>; + }; + + gpio_sd_detect { + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + gpio-export,name = "sd_detect"; + gpio-export,output = <0>; + }; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + lan { + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + label = "green:lan"; + }; + + wan { + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + label = "green:wan"; + }; + + wlan { + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + label = "green:wlan"; + linux,default-trigger = "phy0tpt"; + }; + + lte { + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + label = "green:lte"; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&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>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + art: partition@50000 { + label = "art"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "kernel"; + reg = <0x60000 0x400000>; + }; + + partition@460000 { + label = "nor_reserved"; + reg = <0x460000 0xba0000>; + }; + }; + }; + + flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x8000000>; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts b/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts new file mode 100644 index 000000000..2838b9c82 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include + +/ { + compatible = "joyit,jt-or750i", "qca,qca9531"; + model = "Joy-IT JT-OR750i"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &pinmux_led_eth_pins>; + + led_status_green: status_green { + label = "green:status"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pinmux { + pinmux_led_eth_pins: pinmux_led_eth_pins { + pinctrl-single,bits = \ + /* GPIO 4: LED_LINK_5 (WAN) */ \ + <0x04 0x0000002d 0x000000ff>, \ + /* GPIO 14: LED_LINK_2 (LAN 3) */ \ + /* GPIO 15: LED_LINK_3 (LAN 2) */ \ + <0x0c 0x2b2a0000 0xffff0000>, \ + /* GPIO 16: LED_LINK_4 (LAN 1) */ \ + <0x10 0x0000002c 0x000000ff>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfa0000>; + compatible = "denx,uimage"; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&pcie0 { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts new file mode 100644 index 000000000..d65417c0d --- /dev/null +++ b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include +#include + +/ { + model = "Letv LBA-047-CH"; + compatible = "letv,lba-047-ch", "qca,qca9531"; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&led_wan_pin>; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x0>; + label = "firmware"; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + }; + }; + }; +}; + +&pinmux { + /* GPIO 4: LED_LINK_5 (WAN) */ + led_wan_pin: pinmux_led_wan_pin { + pinctrl-single,bits = <0x04 0x0000002d 0x000000ff>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + + fwconcat0: partition@50000 { + label = "fwconcat0"; + reg = <0x50000 0xe30000>; + }; + + partition@e80000 { + label = "loader"; + reg = <0xe80000 0x10000>; + }; + + fwconcat1: partition@e90000 { + label = "fwconcat1"; + reg = <0xe90000 0x160000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi index 7c6ed9f4f..ce515159b 100644 --- a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi +++ b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi @@ -95,12 +95,14 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&pridata 0x400>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&pridata 0x400>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -108,3 +110,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&pridata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + reg = <0x400 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_telco_t1.dts b/target/linux/ath79/dts/qca9531_telco_t1.dts index eaaf4f154..540de6037 100644 --- a/target/linux/ath79/dts/qca9531_telco_t1.dts +++ b/target/linux/ath79/dts/qca9531_telco_t1.dts @@ -118,11 +118,13 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -136,3 +138,17 @@ pinctrl-single,bits = <0x4 0x0 0xff>; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts index 9a3900193..27b70e082 100644 --- a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts @@ -146,19 +146,22 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&romfile 0xf100>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&romfile 0xf100>; + nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&romfile 0xf100>; + nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cell-names = "mac-address"; }; &pcie0 { @@ -184,3 +187,13 @@ #trigger-source-cells = <0>; }; }; + +&romfile { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfile_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts index 0e2c15826..818ec7769 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts @@ -171,19 +171,22 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; &usb0 { @@ -200,3 +203,13 @@ &usb_phy { status = "okay"; }; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts index 82a73d301..ca7832ebd 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts @@ -128,20 +128,23 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; &usb0 { @@ -158,3 +161,13 @@ &usb_phy { status = "okay"; }; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts index 69445df74..7ce8cd30c 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts @@ -147,8 +147,9 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&info 0x8>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { @@ -159,7 +160,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; }; &pcie0 { @@ -185,3 +187,13 @@ #trigger-source-cells = <0>; }; }; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_wallys_dr531.dts b/target/linux/ath79/dts/qca9531_wallys_dr531.dts index abf821b11..998291444 100644 --- a/target/linux/ath79/dts/qca9531_wallys_dr531.dts +++ b/target/linux/ath79/dts/qca9531_wallys_dr531.dts @@ -76,7 +76,8 @@ status = "okay"; phy-handle = <&swphy4>; - mtd-mac-address = <&env 0xf818>; + nvmem-cells = <&macaddr_env_f818>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -84,7 +85,8 @@ * (GMAC0 -> eth0, GMAC1 -> eth1, same as in old ar71xx target) */ compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; - mtd-mac-address = <&env 0xf810>; + nvmem-cells = <&macaddr_env_f810>; + nvmem-cell-names = "mac-address"; }; &pcie0 { @@ -150,3 +152,17 @@ mtd-cal-data = <&art 0x1000>; }; + +&env { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_env_f810: macaddr@f810 { + reg = <0xf810 0x6>; + }; + + macaddr_env_f818: macaddr@f818 { + reg = <0xf818 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts b/target/linux/ath79/dts/qca9531_yuncore_a770.dts index c58b0c4e3..a25534201 100644 --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts @@ -98,11 +98,13 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &pcie0 { @@ -114,3 +116,17 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; 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 8deeea424..64df0cff7 100644 --- a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts +++ b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts @@ -134,11 +134,13 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x1002>; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -149,5 +151,24 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi index f0473c749..dbbe67d33 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi @@ -38,7 +38,6 @@ partition@0 { label = "RouterBoot"; reg = <0x0 0x20000>; - read-only; compatible = "mikrotik,routerboot-partitions"; #address-cells = <1>; #size-cells = <1>; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-mapl-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-mapl-2nd.dts new file mode 100644 index 000000000..e2442f009 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-mapl-2nd.dts @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_mikrotik_routerboard-16m.dtsi" + +/ { + compatible = "mikrotik,routerboard-mapl-2nd", "qca,qca9533"; + model = "MikroTik RouterBOARD mAPL-2nD (mAP lite)"; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_power_pin &led_lan_pin>; + + power { + label = "green:power"; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + lan { + label = "green:lan"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + led_user: user { + label = "green:user"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; + +&pinmux { + led_lan_pin: pinmux_led_lan_pin { + pinctrl-single,bits = <0x4 0x0 0xff>; + }; + + led_power_pin: pinmux_led_power_pin { + pinctrl-single,bits = <0x10 0x0 0xff00>; + }; +}; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts index 459fc04e6..49756f333 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts @@ -68,3 +68,11 @@ &pcie0 { status = "okay"; }; + +&usb0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi index 53eb08b25..8a51d6b6d 100644 --- a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi +++ b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi @@ -132,7 +132,8 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -141,13 +142,29 @@ */ compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi index c506c849f..602365f45 100644 --- a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi @@ -114,7 +114,8 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -123,14 +124,26 @@ */ compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts index 31e61de17..05d87e399 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts +++ b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts @@ -47,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts index bdb93420b..db6a92720 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts +++ b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts @@ -47,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9533_qca_ap143.dtsi b/target/linux/ath79/dts/qca9533_qca_ap143.dtsi index 95a24175a..2836234b4 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143.dtsi +++ b/target/linux/ath79/dts/qca9533_qca_ap143.dtsi @@ -97,14 +97,10 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; - phy-handle = <&swphy4>; }; ð1 { - mtd-mac-address = <&art 0x6>; - gmac-config { device = <&gmac>; }; @@ -112,8 +108,6 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; }; &usb0 { diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts index 1d8098944..920d2db99 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts @@ -20,7 +20,8 @@ }; ð1 { - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; diff --git a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi index d5eeec13b..3f3fae1df 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi @@ -108,12 +108,24 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi index 6033acddf..43db72ec6 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi @@ -102,7 +102,8 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -113,5 +114,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts index 45fe9e86b..e7d837a57 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts @@ -150,7 +150,8 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; }; ð1 { @@ -161,5 +162,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi index fb034195e..4be1ced4b 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi @@ -73,8 +73,9 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { @@ -85,5 +86,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi index 416668679..c9c109ee3 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi @@ -108,17 +108,30 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts index 7170601f6..07b706251 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts @@ -130,17 +130,30 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts index db99f70b3..e17198451 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts @@ -148,17 +148,30 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts b/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts index f7910b3d6..e854f3700 100644 --- a/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts +++ b/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts @@ -76,11 +76,13 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -91,3 +93,17 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi index d73163c3f..745c736b7 100644 --- a/target/linux/ath79/dts/qca953x.dtsi +++ b/target/linux/ath79/dts/qca953x.dtsi @@ -60,8 +60,8 @@ reg = <0x18030000 0x100>; #phy-cells = <0>; - reset-names = "usb-phy", "usb-suspend-override"; - resets = <&rst 4>, <&rst 3>; + reset-names = "usb-phy-analog", "usb-phy", "usb-suspend-override"; + resets = <&rst 11>, <&rst 4>, <&rst 3>; status = "disabled"; }; @@ -201,6 +201,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; spi: spi@1f000000 { diff --git a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi index ab8ac9242..e49b8fc1c 100644 --- a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi +++ b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi @@ -90,17 +90,30 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9550_airtight_c-75.dts b/target/linux/ath79/dts/qca9550_airtight_c-75.dts index a984b38ad..8dbf1c8bc 100644 --- a/target/linux/ath79/dts/qca9550_airtight_c-75.dts +++ b/target/linux/ath79/dts/qca9550_airtight_c-75.dts @@ -4,6 +4,7 @@ #include #include +#include / { model = "AirTight Networks C-75"; @@ -11,9 +12,10 @@ aliases { label-mac-device = ð0; - led-boot = &led_power; - led-failsafe = &led_power; - led-upgrade = &led_power; + led-boot = &led_power_amber; + led-running = &led_power_green; + led-failsafe = &led_power_amber; + led-upgrade = &led_power_amber; }; keys { @@ -29,10 +31,18 @@ leds { compatible = "gpio-leds"; - led_power: power { + led_power_amber: power-amber { label = "amber:power"; - gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; - default-state = "on"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power-green { + label = "green:power"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; }; wlan2g { @@ -63,7 +73,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; pll-data = <0xa6000000 0x00000101 0x00001616>; }; @@ -87,7 +98,8 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { @@ -179,3 +191,17 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts b/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts index f5c6731bb..f6e04ae0a 100644 --- a/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts +++ b/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts @@ -73,7 +73,6 @@ partition@0 { label = "RouterBoot"; reg = <0x0 0x20000>; - read-only; compatible = "mikrotik,routerboot-partitions"; #address-cells = <1>; #size-cells = <1>; diff --git a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts index 638d78a7a..2724c3a1b 100644 --- a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts +++ b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts @@ -77,7 +77,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "mii"; phy-handle = <&phy0>; }; @@ -88,7 +89,8 @@ pll-data = <0x17000000 0x101 0x1313>; phy-handle = <&phy1>; qca955x-sgmii-fixup; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -123,3 +125,17 @@ #address-cells = <1>; #size-cells = <0>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts b/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts new file mode 100644 index 000000000..419e77c4f --- /dev/null +++ b/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x_senao_loader.dtsi" + +#include +#include + +/ { + compatible = "araknis,an-500-ap-i-ac", "qca,qca9557"; + model = "Araknis AN-500-AP-I-AC"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&partitions { + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&phy5>; + phy-mode = "rgmii-id"; + + pll-data = <0x82000000 0x80000101 0x80001313>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts index dce1a2144..a4e2a615f 100644 --- a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts +++ b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts @@ -118,7 +118,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; pll-data = <0x56000000 0x00000101 0x00001616>; }; @@ -126,7 +127,8 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { @@ -134,3 +136,17 @@ full-duplex; }; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts new file mode 100644 index 000000000..199529e70 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9557_dongwon_dw02-412h.dtsi" + +/ { + model = "Dongwon T&I DW02-412H (128M)"; + compatible = "dongwon,dw02-412h-128m", "qca,qca9557"; +}; + +&ubi { + reg = <0x1800000 0x6800000>; +}; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts new file mode 100644 index 000000000..15d3d677a --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9557_dongwon_dw02-412h.dtsi" + +/ { + model = "Dongwon T&I DW02-412H (64M)"; + compatible = "dongwon,dw02-412h-64m", "qca,qca9557"; +}; + +&ubi { + reg = <0x1800000 0x2800000>; +}; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi new file mode 100644 index 000000000..498499c14 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_wan; + led-failsafe = &led_wan; + led-upgrade = &led_wan; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "WPS button"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "Reset button"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_wan: wan { + label = "green:wan"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "log"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + label = "recoverk"; + reg = <0x060000 0x0e0000>; + read-only; + }; + + partition@140000 { + label = "recoverr"; + reg = <0x140000 0x090000>; + read-only; + }; + + partition@1d0000 { + label = "nvram"; + reg = <0x1d0000 0x010000>; + read-only; + }; + + partition@1e0000 { + label = "nvbackup"; + reg = <0x1e0000 0x010000>; + read-only; + }; + + partition@1f0000 { + label = "art"; + reg = <0x1f0000 0x010000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x844>; + }; + }; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "current"; + reg = <0x0 0x1000000>; + read-only; + }; + + partition@1000000 { + label = "kernel"; + reg = <0x1000000 0x800000>; + }; + + ubi: partition@1800000 { + label = "ubi"; + }; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + + nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; + mac-address-increment = <4>; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; + mac-address-increment = <3>; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x50 0xcf37cf37 /* LED Control Register 0 */ + 0x54 0x00000000 /* LED Control Register 1 */ + 0x58 0x00000000 /* LED Control Register 2 */ + 0x5c 0x0030c300 /* LED Control Register 3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + phy-handle = <&phy0>; + pll-data = <0xa6000000 0x00000101 0x00001616>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; diff --git a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts index 80298a9d8..3b3a3e3c3 100644 --- a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts +++ b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts @@ -77,7 +77,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; phy-mode = "rgmii-id"; @@ -89,6 +90,17 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts index 5da50ff6d..812fcfc5d 100644 --- a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts +++ b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts @@ -88,7 +88,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy1>; phy-mode = "rgmii-id"; @@ -99,8 +100,9 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; phy-handle = <&phy2>; @@ -108,3 +110,13 @@ qca955x-sgmii-fixup; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts index 973cb16ef..aa1f4ad02 100644 --- a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts +++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts @@ -59,7 +59,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; phy-mode = "rgmii-id"; @@ -89,6 +90,17 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts new file mode 100644 index 000000000..304eac5e6 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x_senao_loader.dtsi" + +#include +#include + +/ { + compatible = "araknis,an-700-ap-i-ac", "qca,qca9558"; + model = "Araknis AN-700-AP-I-AC"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&partitions { + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&phy5>; + phy-mode = "rgmii-id"; + + pll-data = <0x82000000 0x80000101 0x80001313>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_arris_sbr-ac1750.dts b/target/linux/ath79/dts/qca9558_arris_sbr-ac1750.dts index 53ea82724..a3c669ffa 100644 --- a/target/linux/ath79/dts/qca9558_arris_sbr-ac1750.dts +++ b/target/linux/ath79/dts/qca9558_arris_sbr-ac1750.dts @@ -72,10 +72,6 @@ }; }; -&wdt { - status = "disabled"; -}; - &pcie0 { status = "okay"; }; @@ -186,6 +182,8 @@ status = "okay"; mtd-mac-address = <&ft 0x0>; + nvmem-cells = <&macaddr_ft_0>; + nvmem-cell-names = "mac-address"; pll-data = <0x56000000 0x00000101 0x00001616>; phy-handle = <&phy0>; }; @@ -194,6 +192,8 @@ status = "okay"; mtd-mac-address = <&ft 0x6>; + nvmem-cells = <&macaddr_ft_6>; + nvmem-cell-names = "mac-address"; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { speed = <1000>; @@ -206,4 +206,24 @@ mtd-cal-data = <&caldata 0x1000>; mtd-mac-address = <&ft 0xc>; + nvmem-cells = <&macaddr_ft_c>; + nvmem-cell-names = "mac-address"; +}; + +&ft { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_ft_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_ft_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_ft_c: macaddr@c { + reg = <0xc 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi index e4bb6c25e..23fe321ef 100644 --- a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi +++ b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi @@ -185,7 +185,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; pll-data = <0xa6000000 0x00000101 0x00001616>; @@ -198,8 +199,9 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { @@ -222,3 +224,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts index 639c87717..ba145d6fb 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts @@ -46,3 +46,38 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_art_18>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_18: macaddr@18 { + reg = <0x18 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts index 5dda5f186..d0929f981 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts @@ -46,3 +46,38 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_art_18>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_18: macaddr@18 { + reg = <0x18 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi index d8a311614..4daad4b0b 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi @@ -84,7 +84,7 @@ status = "okay"; pll-data = <0xa6000000 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x0>; + fixed-link { speed = <1000>; full-duplex; @@ -95,7 +95,7 @@ status = "okay"; pll-data = <0x03000101 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x6>; + fixed-link { speed = <1000>; full-duplex; @@ -104,9 +104,6 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x18>; }; // This node is required for the Ethernet ports to work correctly. diff --git a/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts b/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts new file mode 100644 index 000000000..61597c890 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts @@ -0,0 +1,143 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "qca955x.dtsi" + +#include +#include + +/ { + compatible = "compex,wpj558-16m", "qca,qca9558"; + model = "Compex WPJ558 (16MB flash)"; + + aliases { + label-mac-device = ð0; + led-boot = &led_sig4; + led-failsafe = &led_sig4; + led-running = &led_sig4; + led-upgrade = &led_sig4; + }; + + leds { + compatible = "gpio-leds"; + + sig1 { + label = "red:sig1"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + sig2 { + label = "yellow:sig2"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + sig3 { + label = "green:sig3"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + led_sig4: sig4 { + label = "green:sig4"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + beeper { + compatible = "gpio-beeper"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + firmware@30000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x030000 0xfc0000>; + }; + + 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 */ + 0x50 0xcc35cc35 /* LED_CTRL0 */ + 0x54 0x00000000 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x56000000 0x00000101 0x00001616>; + phy-handle = <&phy0>; + + nvmem-cells = <&macaddr_uboot_2e010>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&pcie0 { + status = "okay"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts index 9e38a9f39..af305f8f0 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts @@ -58,8 +58,9 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; phy-handle = <&phy1>; pll-data = <0x03000101 0x00000101 0x00001313>; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts index 0a1c9cb6d..6202ff379 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts @@ -93,8 +93,9 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; phy-handle = <&phy1>; pll-data = <0x03000101 0x00000101 0x00001313>; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi index 7ae33c3e0..b96b314fa 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi @@ -99,7 +99,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x00>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; gmac_config: gmac-config { @@ -113,6 +114,17 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x00>; - mtd-mac-address-increment = <(-2)>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts index 15a32a1f3..f5a350b33 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca955x.dtsi" - -#include -#include +#include "qca955x_dlink_dap-2xxx.dtsi" / { compatible = "dlink,dap-2695-a1", "qca,qca9558"; @@ -48,69 +45,29 @@ }; }; -&spi { - status = "okay"; +&partitions { + partition@70000 { + label = "firmware"; + reg = <0x070000 0xf00000>; + compatible = "wrg"; + }; - flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "mx25l12805d"; - reg = <0>; - spi-max-frequency = <25000000>; + partition@f70000 { + label = "captival"; + reg = <0xf70000 0x070000>; + read-only; + }; - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; + partition@fe0000 { + label = "certificate"; + reg = <0xfe0000 0x010000>; + read-only; + }; - partition@0 { - label = "u-boot"; - reg = <0x000000 0x040000>; - read-only; - }; - - partition@40000 { - label = "bdcfg"; - reg = <0x040000 0x010000>; - read-only; - }; - - partition@50000 { - label = "rgdb"; - reg = <0x050000 0x010000>; - read-only; - }; - - partition@60000 { - label = "langpack"; - reg = <0x060000 0x010000>; - read-only; - }; - - partition@70000 { - compatible = "wrg"; - label = "firmware"; - reg = <0x070000 0xf00000>; - }; - - partition@f70000 { - label = "captival"; - reg = <0xf70000 0x070000>; - read-only; - }; - - partition@fe0000 { - label = "certificate"; - reg = <0xfe0000 0x010000>; - read-only; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; }; }; @@ -156,9 +113,3 @@ &pcie0 { status = "okay"; }; - -&wmac { - status = "okay"; - - qca,no-eeprom; -}; diff --git a/target/linux/ath79/dts/qca9558_domywifi_dw33d-nor.dts b/target/linux/ath79/dts/qca9558_domywifi_dw33d-nor.dts deleted file mode 100644 index df80e3969..000000000 --- a/target/linux/ath79/dts/qca9558_domywifi_dw33d-nor.dts +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include "qca9558_domywifi_dw33d.dts" - -/ { - compatible = "domywifi,dw33d-nor", "qca,qca9558"; - model = "DomyWifi DW33D (NOR)"; -}; - -&okli_firmware { - compatible = "openwrt,uimage", "denx,uimage"; - openwrt,ih-magic = ; - label = "firmware"; -}; - -&nand_kernel { - label = "nand-kernel"; -}; - -&nand_ubi { - label = "nand-ubi"; -}; diff --git a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts index 63eb0b1d3..5b3318b8b 100644 --- a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts +++ b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts @@ -126,30 +126,6 @@ }; partition@50000 { - label = "loader1"; - reg = <0x50000 0x10000>; - }; - - okli_firmware: partition@60000 { - label = "okli-firmware"; - reg = <0x60000 0xe20000>; - }; - - partition@e80000 { - label = "loader2"; - reg = <0xe80000 0x10000>; - }; - - partition@e90000 { - label = "unused"; - reg = <0xe90000 0x160000>; - }; - - /* firmware - * oem-rootfs: 0x50000 0xe30000 ->loader1(64k) + kernel + rootfs - * oem-kernel: 0xe80000 0x170000 ->loader2(64k) - */ - partition@1 { label = "oem-firmware"; reg = <0x50000 0xfa0000>; }; @@ -171,12 +147,12 @@ #address-cells = <1>; #size-cells = <1>; - nand_kernel: partition@0 { + partition@0 { label = "kernel"; reg = <0x0 0x500000>; }; - nand_ubi: partition@500000 { + partition@500000 { label = "ubi"; reg = <0x500000 0x5b00000>; }; @@ -206,7 +182,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; pll-data = <0x56000000 0x00000101 0x00001616>; phy-handle = <&phy0>; }; @@ -214,7 +191,8 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { speed = <1000>; @@ -226,5 +204,24 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0xc>; + nvmem-cells = <&macaddr_art_c>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts b/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts new file mode 100644 index 000000000..159013066 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts @@ -0,0 +1,183 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include +#include + +/ { + model = "jjPlus JWAP230"; + compatible = "jjplus,jwap230", "qca,qca9558"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led_power: led-0 { + label = "green:power"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + + led-1 { + color = ; + function-enumerator = <0>; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + led-2 { + color = ; + function-enumerator = <1>; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; + +&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>; + + 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; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_lan: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_wan: macaddr@6 { + reg = <0x6 0x6>; + }; + + calibration_art_wlan: calibration@1000 { + reg = <0x1000 0x440>; + }; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + switch { + compatible = "qca,ar8327"; + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x58 0xffb7ffb7 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ + 0x94 0x0000007e /* PORT6_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_wan>; + nvmem-cell-names = "mac-address"; + + pll-data = <0xae000000 0x80000101 0x80001313>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + + gmac_config: gmac-config { + device = <&gmac>; + + rxdv-delay = <3>; + rxd-delay = <3>; + txen-delay = <0>; + txd-delay = <0>; + rgmii-enabled = <1>; + }; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_art_lan>; + nvmem-cell-names = "mac-address"; + + pll-data = <0x03000101 0x00000101 0x00001313>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&wmac { + status = "okay"; + nvmem-cells = <&calibration_art_wlan>; + nvmem-cell-names = "calibration"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts index ddb91d079..6cd8ba457 100644 --- a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts +++ b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts @@ -167,7 +167,8 @@ status = "okay"; pll-data = <0xa6000000 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; }; @@ -176,7 +177,8 @@ status = "okay"; pll-data = <0x03000101 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; fixed-link { speed = <1000>; @@ -188,5 +190,24 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0xc>; + nvmem-cells = <&macaddr_art_c>; + nvmem-cell-names = "mac-address"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts index 36979bbd3..8ad834fe6 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts @@ -23,27 +23,6 @@ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; }; - - i2c: i2c { - compatible = "i2c-gpio"; - - sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; - scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; - i2c-gpio,delay-us = <5>; - i2c-gpio,timeout-ms = <1>; - }; - - sfp1: sfp { - compatible = "sff,sfp"; - - i2c-bus = <&i2c>; - maximum-power-milliwatt = <1000>; - los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; - mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; - // Toggling GPIO16 actually enables/disables the transmitter, - // but the SFP driver does not seem to be using it. - }; }; &pcie0 { @@ -76,30 +55,3 @@ &usb_phy1 { status = "okay"; }; - -&mdio1 { - status = "okay"; - - phy_sfp: ethernet-phy@0 { - reg = <0>; - phy-mode = "sgmii"; - sfp = <&sfp1>; - }; -}; - -ð1 { - status = "okay"; - - phy-handle = <&phy_sfp>; - pll-data = <0x03000000 0x00000101 0x00001616>; - qca955x-sgmii-fixup; - - gmac-config { - device = <&gmac>; - }; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi index 5e919856a..d71c12c1f 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi @@ -42,6 +42,27 @@ gpios = <&gpio 23 GPIO_ACTIVE_LOW>; }; }; + + i2c: i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <5>; + i2c-gpio,timeout-ms = <1>; + }; + + sfp1: sfp { + compatible = "sff,sfp"; + + i2c-bus = <&i2c>; + maximum-power-milliwatt = <1000>; + los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + // Toggling GPIO16 actually enables/disables the transmitter, + // but the SFP driver does not seem to be using it. + }; }; &mdio0 { @@ -64,6 +85,33 @@ }; }; +&mdio1 { + status = "okay"; + + phy_sfp: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + sfp = <&sfp1>; + }; +}; + +ð1 { + status = "okay"; + + phy-handle = <&phy_sfp>; + pll-data = <0x03000000 0x00000101 0x00001616>; + qca955x-sgmii-fixup; + + gmac-config { + device = <&gmac>; + }; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi b/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi index 2f7cdcf8c..6c5ed4def 100644 --- a/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi +++ b/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi @@ -188,7 +188,8 @@ status = "okay"; mtd-cal-data = <&caldata 0x1000>; - mtd-mac-address = <&caldata 0x06>; + nvmem-cells = <&macaddr_caldata_6>; + nvmem-cell-names = "mac-address"; }; &mdio0 { @@ -203,10 +204,25 @@ ð0 { status = "okay"; - mtd-mac-address = <&caldata 0x00>; + nvmem-cells = <&macaddr_caldata_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; phy-mode = "rgmii-rxid"; pll-data = <0x86000000 0x80000101 0x80001313>; }; + +&caldata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_ocedo_koala.dts b/target/linux/ath79/dts/qca9558_ocedo_koala.dts index fd54a6e8c..66f8c6589 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_koala.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_koala.dts @@ -124,7 +124,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x06>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &mdio0 { @@ -140,10 +141,25 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x00>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; phy-mode = "rgmii-rxid"; pll-data = <0x8e000000 0x80000101 0x80001313>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts index 05c2d2d1d..2dc4c07e9 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts @@ -95,7 +95,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x06>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &mdio0 { @@ -113,7 +114,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x00>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii-rxid"; phy-handle = <&phy1>; @@ -132,8 +134,27 @@ ð1 { status = "okay"; - mtd-mac-address = <&art 0x12>; + nvmem-cells = <&macaddr_art_12>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy2>; pll-data = <0x3000101 0x101 0x1313>; qca955x-sgmii-fixup; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_12: macaddr@12 { + reg = <0x12 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi index 9938e5f4c..05d3a4f34 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi +++ b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi @@ -140,7 +140,8 @@ pll-data = <0x82000101 0x80000101 0x80001313>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; phy-handle = <&phy1>; @@ -160,7 +161,8 @@ pll-data = <0x03000101 0x80000101 0x80001313>; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; qca955x-sgmii-fixup; @@ -171,10 +173,25 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <2>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; }; &pcie0 { status = "okay"; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi index f4eed2246..8c4856f1e 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi +++ b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi @@ -141,7 +141,8 @@ pll-data = <0x82000000 0x80000101 0x80001313>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; phy-handle = <&phy5>; @@ -156,10 +157,21 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &pcie0 { status = "okay"; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts b/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts index f7889b00c..211255cdd 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts @@ -19,7 +19,8 @@ wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <16>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <16>; }; }; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts index 1f54d2134..0d29c5cf0 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts @@ -19,7 +19,8 @@ wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <16>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <16>; }; }; diff --git a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts new file mode 100644 index 000000000..de21f0119 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts @@ -0,0 +1,216 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + compatible = "openmesh,om5p-ac-v1", "qca,qca9558"; + model = "OpenMesh OM5P-AC v1"; + + chosen { + /delete-property/ bootargs; + }; + + aliases { + serial0 = &uart; + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + lan_blue { + label = "blue:lan"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + wifi_green { + label = "green:wifi"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi_yellow { + label = "yellow:wifi"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + wifi_red { + label = "red:wifi"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + }; + + i2c { + compatible = "i2c-gpio"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH /* sda */ + &gpio 12 GPIO_ACTIVE_HIGH /* scl */ + >; + #address-cells = <1>; + #size-cells = <0>; + + i2c-gpio,scl-open-drain; + i2c-gpio,sda-open-drain; + + tmp423a@4c { + compatible = "ti,tmp423"; + reg = <0x4c>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + /* partitions are passed via bootloader */ + 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 { + label = "custom"; + reg = <0x050000 0x060000>; + read-only; + }; + + partition@b0000 { + label = "inactive"; + reg = <0x0b0000 0x7a0000>; + }; + + partition@850000 { + label = "inactive2"; + reg = <0x850000 0x7a0000>; + }; + + art: partition@ff0000 { + label = "ART"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x6>; + + phy1: ethernet-phy@1 { + reg = <1>; + eee-broken-100tx; + eee-broken-1000t; + }; + + phy2: ethernet-phy@2 { + reg = <2>; + eee-broken-100tx; + eee-broken-1000t; + at803x-override-sgmii-link-check; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x82000101 0x80000101 0x80001313>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-mode = "rgmii-id"; + phy-handle = <&phy1>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + rxd-delay = <3>; + rxdv-delay = <3>; + txd-delay = <0>; + txen-delay = <0>; + }; +}; + +ð1 { + status = "okay"; + + pll-data = <0x03000101 0x80000101 0x80001313>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + + qca955x-sgmii-fixup; + + phy-handle = <&phy2>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; +}; + +&pcie1 { + status = "okay"; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; 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 b4d452dda..91a53343a 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts @@ -7,26 +7,34 @@ / { compatible = "openmesh,om5p-ac-v2", "qca,qca9558"; - model = "OpenMesh OM5P-AC V2"; + model = "OpenMesh OM5P-AC v2"; - extosc: ref { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-output-names = "ref"; - clock-frequency = <40000000>; + chosen { + /delete-property/ bootargs; + }; + + aliases { + serial0 = &uart; + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + label-mac-device = ð0; }; leds { compatible = "gpio-leds"; - power { - label = "blue:power"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - }; - wifi_green { label = "green:wifi"; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; }; wifi_yellow { @@ -50,6 +58,32 @@ }; }; + i2c { + compatible = "i2c-gpio"; + gpios = <&gpio 19 GPIO_ACTIVE_HIGH /* sda */ + &gpio 18 GPIO_ACTIVE_HIGH /* scl */ + >; + #address-cells = <1>; + #size-cells = <0>; + + i2c-gpio,scl-open-drain; + i2c-gpio,sda-open-drain; + + tmp423a@4e { + compatible = "ti,tmp423"; + reg = <0x4e>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; + gpio-export { compatible = "gpio-export"; #size-cells = <0>; @@ -69,11 +103,11 @@ &pinmux { pinmux_pa_dcdc_pins { - pinctrl-single,bits = <0x0 0xff00 0x0>; + pinctrl-single,bits = <0x0 0x0 0xff0000>; }; pinmux_pa_high_pins { - pinctrl-single,bits = <0x10 0xff 0x0>; + pinctrl-single,bits = <0x10 0x0 0xff>; }; }; @@ -81,10 +115,6 @@ status = "okay"; }; -&pll { - clocks = <&extosc>; -}; - &spi { status = "okay"; @@ -93,6 +123,7 @@ reg = <0>; spi-max-frequency = <25000000>; + /* partitions are passed via bootloader */ partitions { compatible = "fixed-partitions"; #address-cells = <1>; @@ -104,19 +135,29 @@ read-only; }; - partition@1 { + partition@40000 { label = "u-boot-env"; reg = <0x040000 0x010000>; }; - partition@2 { - compatible = "denx,uimage"; - label = "firmware"; + partition@50000 { + label = "custom"; + reg = <0x050000 0x060000>; + read-only; + }; + + partition@b0000 { + label = "inactive"; + reg = <0x0b0000 0x7a0000>; + }; + + partition@850000 { + label = "inactive2"; reg = <0x850000 0x7a0000>; }; - partition@3 { - label = "art"; + art: partition@ff0000 { + label = "ART"; reg = <0xff0000 0x010000>; read-only; }; @@ -127,18 +168,25 @@ &mdio0 { status = "okay"; + phy-mask = <0x10>; + phy4: ethernet-phy@4 { reg = <4>; - phy-mode = "rgmii-id"; + eee-broken-100tx; + eee-broken-1000t; }; }; &mdio1 { status = "okay"; + phy-mask = <0x2>; + phy1: ethernet-phy@1 { reg = <1>; - phy-mode = "sgmii"; + eee-broken-100tx; + eee-broken-1000t; + at803x-override-sgmii-link-check; }; }; @@ -147,7 +195,20 @@ pll-data = <0x82000101 0x80000101 0x80001313>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-mode = "rgmii-id"; phy-handle = <&phy4>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + rxd-delay = <2>; + rxdv-delay = <2>; + txd-delay = <0>; + txen-delay = <0>; + }; }; ð1 { @@ -155,5 +216,33 @@ pll-data = <0x03000101 0x80000101 0x80001313>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + + qca955x-sgmii-fixup; + phy-handle = <&phy1>; }; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi b/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi index 21946c42b..5b28af5ca 100644 --- a/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi +++ b/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi @@ -127,8 +127,9 @@ phy-handle = <&phy0>; - mtd-mac-address = <&pridata 0x400>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { @@ -136,7 +137,8 @@ pll-data = <0x03000101 0x00000101 0x00001616>; - mtd-mac-address = <&pridata 0x400>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; fixed-link { speed = <1000>; @@ -165,3 +167,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&pridata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + reg = <0x400 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi index 52cbb5d01..f629838f1 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; - label-mac-device = ð1; }; leds: leds { @@ -149,8 +148,6 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; phy-handle = <&phy0>; pll-data = <0x56000000 0x00000101 0x00001616>; @@ -163,7 +160,6 @@ ð1 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { @@ -174,7 +170,4 @@ &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 9ffbce0a2..85012d3aa 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c5-v1", "qca,qca9558"; model = "TP-Link Archer C5 v1"; + + aliases { + label-mac-device = ð1; + }; }; &keys { @@ -43,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; 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 e2d1d6381..e520a83d4 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c7-v1", "qca,qca9558"; model = "TP-Link Archer C7 v1"; + + aliases { + label-mac-device = ð1; + }; }; &keys { @@ -37,9 +41,43 @@ reg = <0x020000 0x7d0000>; }; - art: partition@7f0000 { + partition@7f0000 { label = "art"; reg = <0x7f0000 0x010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + }; +}; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + nvmem-cells = <&macaddr_uboot_1fc00>, <&calibration_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; }; }; 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 be99b8e3e..b7ac90200 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c7-v2", "qca,qca9558"; model = "TP-Link Archer C7 v2"; + + aliases { + label-mac-device = ð1; + }; }; &keys { @@ -41,5 +45,56 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; + }; +}; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&pcie1 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + + mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>, <&calibration_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; + }; +}; + +&wmac { + nvmem-cells = <&macaddr_uboot_1fc00>, <&calibration_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; }; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts index fd1717b66..4f822fbc7 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts @@ -70,15 +70,28 @@ }; ð0 { - mtd-mac-address = <&romfs 0xf100>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&romfs 0xf100>; + nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&romfs 0xf100>; + nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cell-names = "mac-address"; +}; + +&romfs { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfs_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts index d2ef7e82a..9adaa7fa6 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts @@ -64,15 +64,28 @@ }; ð0 { - mtd-mac-address = <&romfs 0xf100>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { - mtd-mac-address = <&romfs 0xf100>; + nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&romfs 0xf100>; + nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cell-names = "mac-address"; +}; + +&romfs { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfs_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts index c0fbeb5a4..0966f0190 100644 --- a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts @@ -99,7 +99,8 @@ phy-handle = <&phy4>; pll-data = <0x9e000000 0x80000101 0x80001313>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -172,5 +173,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi index 6c487f15b..31089f339 100644 --- a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi @@ -158,13 +158,25 @@ phy-handle = <&phy4>; pll-data = <0xa6000000 0x00000101 0x00001616>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; 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 0099592dc..5b69a1708 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts @@ -96,8 +96,9 @@ ath9k: wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-2)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -190,8 +191,9 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; phy-handle = <&phy0>; pll-data = <0x56000000 0x00000101 0x00001616>; @@ -204,7 +206,8 @@ ð1 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { @@ -217,6 +220,17 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3-16MB.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3-16MB.dts deleted file mode 100644 index e07608597..000000000 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3-16MB.dts +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "qca9558_tplink_archer-c.dtsi" - -/ { - compatible = "tplink,tl-wdr7500-v3-16MB", "qca,qca9558"; - model = "TP-Link TL-WDR7500 v3"; -}; - -&keys { - rfkill { - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - linux,code = ; - linux,input-type = ; - debounce-interval = <60>; - }; -}; - -&leds { - wlan5g { - label = "green:wlan5g"; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; -}; - -&mtdparts { - uboot: partition@0 { - label = "u-boot"; - reg = <0x000000 0x020000>; - read-only; - }; - - partition@20000 { - label = "firmware"; - compatible = "tplink,firmware"; - reg = <0x020000 0xfd0000>; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts index 04368b924..998ede85c 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,tl-wdr7500-v3", "qca,qca9558"; model = "TP-Link TL-WDR7500 v3"; + + aliases { + label-mac-device = ð1; + }; }; &keys { @@ -43,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi index 959d5c35f..ff7ea7da0 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi @@ -145,8 +145,9 @@ pll-data = <0x56000000 0x00000101 0x00001616>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; phy-handle = <&phy0>; }; @@ -155,7 +156,8 @@ pll-data = <0x03000101 0x00000101 0x00001616>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; fixed-link { speed = <1000>; @@ -166,5 +168,16 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; 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 058acda74..27bf82d20 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 @@ -103,7 +103,8 @@ ð0 { status = "okay"; phy-mode = "mii"; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; fixed-link { speed = <100>; full-duplex; @@ -113,5 +114,16 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts b/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts new file mode 100644 index 000000000..14388079b --- /dev/null +++ b/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts @@ -0,0 +1,111 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Device Tree file for Ubiquiti Nanobeam NBE-5AC-19 (XC) + * + * Copyright (C) 2022 Daniel González Cabanelas + * based on device tree from qca9558_ubnt_powerbeam-5ac-500.dts + */ + +#include "qca955x_ubnt_xc.dtsi" + +/ { + compatible = "ubnt,nanobeam-ac-xc", "ubnt,xc", "qca,qca9558"; + model = "Ubiquiti NanoBeam AC Gen1 (XC)"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + led_spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio 3 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>; + enable-gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + rssi0 { + label = "blue:rssi0"; + gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>; + }; + rssi1 { + label = "blue:rssi1"; + gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>; + }; + rssi2 { + label = "blue:rssi2"; + gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>; + }; + rssi3 { + label = "blue:rssi3"; + gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>; + }; + led_power: power { + label = "blue:power"; + gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <4>; + phy4: ethernet-phy@4 { + phy-mode = "sgmii"; + reg = <4>; + at803x-override-sgmii-link-check; + }; +}; + +ð0 { + status = "okay"; + + pll-reg = <0 0x48 0>; + pll-data = <0x03000000 0x00000101 0x00001313>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + phy-mode = "sgmii"; + phy-handle = <&phy4>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts b/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts index 3d90531a3..9d3d1395f 100644 --- a/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts +++ b/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts @@ -32,7 +32,18 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "sgmii"; phy-handle = <&phy4>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts b/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts index e8e2322c5..0458fcaa4 100644 --- a/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts +++ b/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts @@ -32,7 +32,18 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "sgmii"; phy-handle = <&phy4>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_zyxel_emg2926_q10a.dts b/target/linux/ath79/dts/qca9558_zyxel_emg2926_q10a.dts new file mode 100644 index 000000000..c00109a5b --- /dev/null +++ b/target/linux/ath79/dts/qca9558_zyxel_emg2926_q10a.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_zyxel_nbg6716.dts" + +/ { + compatible = "zyxel,emg2926-q10a", "zyxel,nbg6716", "qca,qca9558"; + model = "ZyXEL EMG2926-Q10A"; +}; diff --git a/target/linux/ath79/dts/qca955x.dtsi b/target/linux/ath79/dts/qca955x.dtsi index 8138f4afe..b6e08f9f1 100644 --- a/target/linux/ath79/dts/qca955x.dtsi +++ b/target/linux/ath79/dts/qca955x.dtsi @@ -112,8 +112,7 @@ }; pll: pll-controller@18050000 { - compatible = "qca,qca9550-pll", - "qca,qca9550-pll", "syscon"; + compatible = "qca,qca9550-pll", "syscon"; reg = <0x18050000 0x50>; #clock-cells = <1>; @@ -265,6 +264,9 @@ phys = <&usb_phy0>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; usb1: usb@1b400000 { @@ -283,6 +285,9 @@ phys = <&usb_phy1>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; nand: nand@1b800200 { diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts index bf744f108..4b371e0e8 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts @@ -172,19 +172,32 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&info 0x8>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; 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 ea86b8f35..180efada1 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c58-v1", "qca,qca9560"; model = "TP-Link Archer C58 v1"; + + aliases { + label-mac-device = ð1; + }; }; &spi { @@ -52,3 +56,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; 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 07e837917..c385eb159 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c59-v1", "qca,qca9560"; model = "TP-Link Archer C59 v1"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -76,3 +80,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts index c1321f5d2..5a277723e 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c59-v2", "qca,qca9560"; model = "TP-Link Archer C59 v2"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -82,3 +86,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi index 664032936..bb942078d 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi @@ -13,7 +13,6 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = ð1; }; led_spi { @@ -126,9 +125,6 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&info 0x8>; - mtd-mac-address-increment = <1>; - gmac-config { device = <&gmac>; @@ -139,13 +135,8 @@ ð1 { status = "okay"; - - mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 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 index a3bbf3e49..f5ab2e597 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c60-v1", "qca,qca9561"; model = "TP-Link Archer C60 v1"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -64,3 +68,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts index 2bcab77db..014222770 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c60-v2", "qca,qca9561"; model = "TP-Link Archer C60 v2"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -70,3 +74,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts index c1a0a8c2e..a2f46ecd6 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c60-v3", "qca,qca9561"; model = "TP-Link Archer C60 v3"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -13,6 +17,7 @@ gpios = <&gpio 19 GPIO_ACTIVE_LOW>; }; }; + &spi { status = "okay"; @@ -64,3 +69,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi index 75d3816b7..e5f9d0bcc 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = ð1; }; keys { @@ -71,20 +70,12 @@ status = "okay"; phy-handle = <&swphy4>; - - mtd-mac-address = <&info 0x8>; - mtd-mac-address-increment = <1>; }; ð1 { status = "okay"; - - mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts b/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts index a39fde01e..ecb427029 100644 --- a/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts @@ -129,12 +129,24 @@ ð1 { status = "okay"; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts b/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts deleted file mode 100644 index 58ea600b3..000000000 --- a/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts +++ /dev/null @@ -1,147 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - -#include -#include - -#include "qca956x.dtsi" - -/ { - compatible = "tplink,tl-wdr6500-v2", "qca,qca9561"; - model = "TP-Link TL-WDR6500 v2"; - - aliases { - led-boot = &led_system; - led-failsafe = &led_system; - led-running = &led_system; - led-upgrade = &led_system; - label-mac-device = ð1; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "Reset button"; - linux,code = ; - gpios = <&gpio 1 GPIO_ACTIVE_LOW>; - }; - }; - - leds { - compatible = "gpio-leds"; - - lan4 { - label = "tp-link:green:lan4"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - }; - - lan3 { - label = "tp-link:green:lan3"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - }; - - lan2 { - label = "tp-link:green:lan2"; - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; - }; - - lan1 { - label = "tp-link:green:lan1"; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - }; - - wan { - label = "tp-link:green:wan"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - }; - - led_system: system { - label = "tp-link:white:system"; - gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - }; -}; - -&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 0x010000>; - read-only; - }; - - partition@10000 { - compatible = "tplink,firmware"; - label = "firmware"; - reg = <0x010000 0x7d0000>; - }; - - partition@7e0000 { - label = "mib0"; - 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-handle = <&swphy4>; - - mtd-mac-address = <&uboot 0x0fc00>; - mtd-mac-address-increment = <1>; -}; - -ð1 { - status = "okay"; - - mtd-mac-address = <&uboot 0x0fc00>; -}; - -&wmac { - status = "okay"; - - mtd-cal-data = <&art 0x1000>; - - mtd-mac-address = <&uboot 0x0fc00>; - mtd-mac-address-increment = <(-1)>; -}; - -&usb0 { - status = "okay"; -}; - -&usb_phy0 { - status = "okay"; -}; 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 821f125c2..6e45fbb20 100644 --- a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts +++ b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts @@ -120,19 +120,36 @@ status = "okay"; phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - mtd-mac-address = <&art 0x6>; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts b/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts new file mode 100644 index 000000000..c4b648349 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts @@ -0,0 +1,159 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include +#include + +/ { + model = "ASUS RP-AC66"; + compatible = "asus,rp-ac66", "qca,qca9563"; + + aliases { + led-boot = &led_orange; + led-failsafe = &led_orange; + led-running = &led_power; + led-upgrade = &led_orange; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + }; + + led_orange: wps { + label = "orange:wps"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + + rssilow-wlan0 { + label = "blue:rssilow-wlan0"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + + rssimedium-wlan0 { + label = "red:rssimedium-wlan0"; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + + rssihigh-wlan0 { + label = "green:rssihigh-wlan0"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + + rssilow-wlan1 { + label = "blue:rssilow-wlan1"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + + rssimedium-wlan1 { + label = "red:rssimedium-wlan1"; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + }; + + rssihigh-wlan1 { + label = "green:rssihigh-wlan1"; + gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + linux,code = ; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x10000>; + read-only; + }; + + art: partition@50000 { + label = "art"; + reg = <0x050000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; + + partition@60000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x060000 0xfa0000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@3 { + reg = <0x3>; + phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; + }; +}; + +ð0 { + status = "okay"; + + phy-mode = "sgmii"; + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + phy-handle = <&phy0>; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; diff --git a/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts b/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts index 1eeb02f7f..1337341b0 100644 --- a/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts +++ b/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts @@ -124,7 +124,8 @@ pll-data = <0x03000101 0x00000101 0x00001919>; phy-mode = "sgmii"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; }; @@ -132,6 +133,17 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <10>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <10>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9563_compex_wpj563.dts b/target/linux/ath79/dts/qca9563_compex_wpj563.dts index aa829413d..ba31f40fe 100644 --- a/target/linux/ath79/dts/qca9563_compex_wpj563.dts +++ b/target/linux/ath79/dts/qca9563_compex_wpj563.dts @@ -118,7 +118,8 @@ pll-data = <0x03000101 0x00000101 0x00001919>; - mtd-mac-address = <&uboot 0x2e010>; + nvmem-cells = <&macaddr_uboot_2e010>; + nvmem-cell-names = "mac-address"; phy-mode = "sgmii"; phy-handle = <&phy0>; }; @@ -136,3 +137,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; +}; 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 b4f771823..510b577d1 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts @@ -50,3 +50,23 @@ &pcie { status = "okay"; }; + +ð0 { + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; +}; 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 3af6f59d0..28ffce643 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts @@ -40,3 +40,23 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; +}; 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 78eb0fe21..a6706da1a 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi @@ -105,13 +105,10 @@ pll-data = <0x03000101 0x00000101 0x00001919>; - mtd-mac-address = <&art 0x1002>; - mtd-mac-address-increment = <(-1)>; phy-mode = "sgmii"; phy-handle = <&phy0>; }; &wmac { status = "okay"; - mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi index 9226d37a4..878a740cf 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi @@ -123,7 +123,8 @@ status = "okay"; phy-handle = <&phy0>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &gpio { @@ -175,3 +176,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi index 8c6a37413..6090fdf52 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi @@ -201,7 +201,8 @@ pll-data = <0x03000101 0x00000101 0x00001919>; - mtd-mac-address = <&caldata 0x0>; + nvmem-cells = <&macaddr_caldata_0>; + nvmem-cell-names = "mac-address"; phy-mode = "sgmii"; phy-handle = <&phy0>; @@ -210,7 +211,8 @@ &wmac { status = "okay"; - mtd-mac-address = <&caldata 0x0>; + nvmem-cells = <&macaddr_caldata_0>; + nvmem-cell-names = "mac-address"; qca,no-eeprom; }; @@ -221,7 +223,8 @@ /* chip is AR9580, override bogus PCI ID 168c:abcd */ compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&caldata 0xc>; + nvmem-cells = <&macaddr_caldata_c>; + nvmem-cell-names = "mac-address"; qca,no-eeprom; qca,gpio-mask=<0xf6ff>; /* unmask pin 9 for RFKILL button */ #gpio-cells = <2>; @@ -243,3 +246,17 @@ #trigger-source-cells = <0>; }; }; + +&caldata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi index 9cf146c91..91c73567d 100644 --- a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi +++ b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi @@ -118,7 +118,8 @@ phy-mode = "sgmii"; phy-handle = <&phy0>; - mtd-mac-address = <&pridata 0x400>; + nvmem-cells = <&macaddr_pridata_400>; + nvmem-cell-names = "mac-address"; }; &usb_phy0 { @@ -149,3 +150,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&pridata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + reg = <0x400 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts index a88eeb3de..c08291560 100644 --- a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts +++ b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts @@ -107,7 +107,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&info 0x0>; + nvmem-cells = <&macaddr_info_0>; + nvmem-cell-names = "mac-address"; phy-mode = "sgmii"; phy-handle = <&phy0>; }; @@ -147,3 +148,13 @@ #trigger-source-cells = <0>; }; }; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; 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 eecfe3545..3bb6d685c 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-a7-v5", "qca,qca9563"; model = "TP-Link Archer A7 v5"; + + aliases { + label-mac-device = ð0; + }; }; &keys { @@ -59,3 +63,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; 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 6c4b04b81..81c25fc01 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts @@ -161,7 +161,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; phy-mode = "sgmii"; phy-handle = <&phy0>; }; @@ -170,5 +171,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; 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 index 892e87eba..76e19294f 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts @@ -7,6 +7,8 @@ model = "TP-Link Archer C6 v2 (US) / A6 v2 (US/TW)"; aliases { + label-mac-device = ð0; + led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -125,3 +127,25 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; 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 c64402bcf..c40fe0f29 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts @@ -7,6 +7,8 @@ model = "TP-Link Archer C6 v2 (EU/RU/JP)"; aliases { + label-mac-device = ð0; + led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -119,3 +121,25 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; 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 63040acf4..4334475ff 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts @@ -247,7 +247,8 @@ pll-data = <0x03000101 0x00000101 0x00001919>; phy-mode = "sgmii"; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; }; @@ -255,5 +256,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; 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 da8d0c1fc..d2631e227 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c7-v5", "qca,qca9563"; model = "TP-Link Archer C7 v5"; + + aliases { + label-mac-device = ð0; + }; }; &keys { @@ -65,3 +69,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; 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 1a074e63a..fc6206d89 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi @@ -5,12 +5,6 @@ #include #include -/ { - aliases { - label-mac-device = ð0; - }; -}; - &pcie { status = "okay"; }; @@ -37,13 +31,8 @@ phy-mode = "sgmii"; phy-handle = <&phy0>; - - mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; 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 3644cf863..6763fe9d3 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; - label-mac-device = ð0; }; leds { @@ -162,13 +161,9 @@ pll-data = <0x03000101 0x00000101 0x00001919>; phy-mode = "sgmii"; - mtd-mac-address = <&info 0x8>; phy-handle = <&phy0>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts b/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts new file mode 100644 index 000000000..c97d1652c --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include + +/ { + model = "TP-Link CPE710 v1"; + compatible = "tplink,cpe710-v1", "qca,qca9563"; + + aliases { + label-mac-device = ð0; + led-boot = &led_lan; + led-failsafe = &led_lan; + led-upgrade = &led_lan; + }; + + leds { + compatible = "gpio-leds"; + + led_lan: lan { + label = "blue:lan"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "blue:wlan5g"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + 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 { + label = "partition-table"; + reg = <0x050000 0x010000>; + read-only; + }; + + info: partition@60000 { + label = "info"; + reg = <0x060000 0x010000>; + read-only; + }; + + partition@70000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x070000 0xf50000>; + }; + + partition@fc0000 { + label = "config"; + reg = <0xfc0000 0x030000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&pinmux { + mdio_pins: mdio_pins { + /* GPIO 10 as MDIO(0x20), GPIO 8 as MDC(0x21) */ + pinctrl-single,bits = <0x8 0x00200021 0x00ff00ff>; + }; +}; + +&mdio0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + phy-mask = <0x10>; + + phy4: ethernet-phy@4 { + reg = <4>; + reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy4>; + phy-mode = "sgmii"; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + + qca956x-serdes-fixup; + + gmac-config { + device = <&gmac>; + }; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts new file mode 100644 index 000000000..20fd55b40 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include "qca9563_tplink_eap2x5-1port.dtsi" + +/ { + compatible = "tplink,eap225-v1", "qca,qca9563"; + model = "TP-Link EAP225 v1"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_amber; + led-running = &led_status_green; + led-upgrade = &led_status_amber; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: led-0 { + label = "green:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led_status_amber: led-1 { + label = "amber:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led-2 { + label = "red:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + led_enable { + gpio-export,name = "leds:enable"; + gpio-export,output = <1>; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts index 6b438ce12..ee9f5ff5c 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts @@ -146,12 +146,24 @@ phy-handle = <&phy0>; phy-mode = "sgmii"; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi index a6aefc7b5..e10c5dbb7 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi @@ -114,7 +114,8 @@ phy-mode = "sgmii"; pll-data = <0x03000000 0x00000101 0x00001313>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; qca956x-serdes-fixup; @@ -127,5 +128,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts index d0356d668..73cf5323e 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,re450-v2", "qca,qca9563"; model = "TP-Link RE450 v2"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -44,3 +48,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts index 695f78ed0..ffebcb9ba 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,re450-v3", "qca,qca9563"; model = "TP-Link RE450 v3"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -50,3 +54,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450.dtsi b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi index 3354baee0..3841a4c8f 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi @@ -7,7 +7,6 @@ / { aliases { - label-mac-device = ð0; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -129,13 +128,8 @@ phy-mode = "sgmii"; phy-handle = <&phy4>; - - mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts b/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts index b6c1efb84..bf4e5848a 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,re455-v1", "qca,qca9563"; model = "TP-Link RE455 v1"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -50,3 +54,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts new file mode 100644 index 000000000..71ab4f8aa --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include + +/ { + compatible = "tplink,tl-wa1201-v2", "qca,qca9563"; + model = "TP-Link TL-WA1201 v2"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + mdio-gpio0 = &mdio2; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + lan { + label = "green:lan"; + gpios = <&gpio 20 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>; + }; + }; + + mdio2: mdio { + compatible = "virtual,mdio-gpio"; + + #address-cells = <1>; + #size-cells = <0>; + + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>, /* MDC */ + <&gpio 4 GPIO_ACTIVE_HIGH>; /* MDIO */ + + phy4: ethernet-phy@4 { + reg = <4>; + + eee-broken-100tx; + eee-broken-1000t; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-mode = "sgmii"; + phy-handle = <&phy4>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&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>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + info: partition@20000 { + label = "info"; + reg = <0x020000 0x010000>; + read-only; + }; + + partition@30000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x030000 0xce0000>; + }; + + partition@d10000 { + label = "tplink"; + reg = <0xd10000 0x2e0000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts index 4df03efb4..0ccfb42d9 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts @@ -38,9 +38,23 @@ }; ð0 { - mtd-mac-address = <&uboot 0x0fc00>; + nvmem-cells = <&macaddr_uboot_fc00>; + nvmem-cell-names = "mac-address"; }; &wmac { - mtd-mac-address = <&uboot 0x0fc00>; + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_uboot_fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_fc00: macaddr@fc00 { + reg = <0xfc00 0x6>; + }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi index 5fd314b85..431c99081 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi @@ -128,6 +128,4 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts index 50a88f344..95ff6b036 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts @@ -1,13 +1,35 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca9563_tplink_tl-wpa8630p-v2.dtsi" +#include "qca9563_tplink_tl-wpa8630.dtsi" / { compatible = "tplink,tl-wpa8630p-v2-int", "qca,qca9563"; model = "TP-Link WPA8630P v2 (Int.)"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { + partition@0 { + label = "factory-uboot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x020000>; + read-only; + }; + + partition@40000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x040000 0x5e0000>; + }; + partition@620000 { label = "partition-table"; reg = <0x620000 0x010000>; @@ -32,3 +54,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts index 9eff2fcf6..34efeb945 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts @@ -1,13 +1,35 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca9563_tplink_tl-wpa8630p-v2.dtsi" +#include "qca9563_tplink_tl-wpa8630.dtsi" / { compatible = "tplink,tl-wpa8630p-v2.0-eu", "qca,qca9563"; model = "TP-Link WPA8630P v2.0 (EU)"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { + partition@0 { + label = "factory-uboot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x020000>; + read-only; + }; + + partition@40000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x040000 0x5e0000>; + }; + partition@620000 { label = "partition-table"; reg = <0x620000 0x010000>; @@ -32,3 +54,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts index e8d92419c..a477b5041 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts @@ -1,13 +1,35 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca9563_tplink_tl-wpa8630p-v2.dtsi" +#include "qca9563_tplink_tl-wpa8630.dtsi" / { compatible = "tplink,tl-wpa8630p-v2.1-eu", "qca,qca9563"; model = "TP-Link WPA8630P v2.1 (EU)"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { + partition@0 { + label = "factory-uboot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x020000>; + read-only; + }; + + partition@40000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x040000 0x5e0000>; + }; + /* 0x620000 to 0x680000 is empty in OEM partitioning */ partition@680000 { @@ -28,3 +50,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi deleted file mode 100644 index 9e6d23de4..000000000 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "qca9563_tplink_tl-wpa8630.dtsi" - -/ { - aliases { - label-mac-device = ð0; - }; -}; - -&partitions { - partition@0 { - label = "factory-uboot"; - reg = <0x000000 0x020000>; - read-only; - }; - - partition@20000 { - label = "u-boot"; - reg = <0x020000 0x020000>; - read-only; - }; - - partition@40000 { - compatible = "tplink,firmware"; - label = "firmware"; - reg = <0x040000 0x5e0000>; - }; -}; - -ð0 { - mtd-mac-address = <&info 0x8>; -}; - -&wmac { - mtd-mac-address = <&info 0x8>; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts index cba124aa8..6d7582451 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,tl-wr1043n-v5", "qca,qca9563"; model = "TP-Link TL-WR1043N v5"; + + aliases { + label-mac-device = &wmac; + }; }; &spi { @@ -70,3 +74,25 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi index c8c69e8a6..b99412eb7 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; - label-mac-device = &wmac; }; leds: leds { @@ -103,14 +102,10 @@ ð0 { status = "okay"; - mtd-mac-address = <&info 0x8>; phy-mode = "sgmii"; phy-handle = <&phy0>; }; &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 ddb986ffd..bf01f06de 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts @@ -6,6 +6,10 @@ compatible = "tplink,tl-wr1043nd-v4", "qca,qca9563"; model = "TP-Link TL-WR1043ND v4"; + aliases { + label-mac-device = &wmac; + }; + gpio-export { compatible = "gpio-export"; #size-cells = <0>; @@ -99,3 +103,25 @@ #trigger-source-cells = <0>; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi index b41e90abe..5eb358014 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi @@ -21,7 +21,8 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "sgmii"; phy-handle = <&phy4>; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi index 5a0cf4bad..dbf6c2714 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi @@ -25,6 +25,7 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index 42fe25c78..2e407c348 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -105,3 +105,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts index d8fc589d5..a7a73ad2f 100644 --- a/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts +++ b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts @@ -163,7 +163,8 @@ phy-mode = "sgmii"; phy-handle = <&phy0>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -175,3 +176,13 @@ &pcie { status = "okay"; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi index 4eed20bea..f8dec2bc6 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -26,7 +26,8 @@ pll-data = <0x03000101 0x00000101 0x00001919>; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; phy-mode = "sgmii"; phy-handle = <&phy0>; }; @@ -105,3 +106,13 @@ mtd-cal-data = <&art 0x1000>; }; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286.dts b/target/linux/ath79/dts/qca9563_zte_mf286.dts new file mode 100644 index 000000000..2e528a6b9 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf286.dts @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +#include "qca9563_zte_mf286.dtsi" + +/ { + model = "ZTE MF286"; + compatible = "zte,mf286", "qca,qca9563"; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x7840000>; + label = "ubi"; + }; + }; + }; +}; + +&led_debug { + /* Hidden green SMD LED below signal strength LEDs + * Visible through slits underside of the case, + * and slightly through the case below signal state LEDs + */ + color = ; + label = "green:debug"; +}; + +&boot_flash { + partitions { + partition@0 { + label = "u-boot"; + reg = <0x000000 0x080000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0x080000 0x020000>; + read-only; + }; + }; +}; + +&system_flash { + partitions { + partition@0 { + label = "fota-flag"; + reg = <0x000000 0x140000>; + read-only; + }; + + partition@140000 { + label = "caldata"; + reg = <0x140000 0x140000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: cal@5000 { + reg = <0x5000 0x844>; + }; + }; + + partition@280000 { + label = "mac"; + reg = <0x280000 0x140000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; + + /* This encompasses stock cfg-param, oops, web partitions, + * which can be overwritten safely + */ + ubiconcat0: partition@3c0000 { + label = "ubiconcat0"; + reg = <0x3c0000 0xf40000>; + }; + + /* Kernel MTD size is increased to 4MB from stock 3MB */ + partition@1300000 { + label = "kernel"; + reg = <0x1300000 0x400000>; + }; + + /* This encompasses stock rootfs, data, fota partitions, + * which can be overwritten safely + */ + ubiconcat1: partition@1600000 { + label = "ubiconcat1"; + reg = <0x1700000 0x6900000>; + }; + }; +}; + +ð0 { + nvmem-cells = <&macaddr_mac_0>; + nvmem-cell-names = "mac-address"; +}; + +&wifi_ath10k { + nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>; + nvmem-cell-names = "mac-address", "calibration"; + mac-address-increment = <1>; +}; + +&wmac { + nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286.dtsi b/target/linux/ath79/dts/qca9563_zte_mf286.dtsi new file mode 100644 index 000000000..3013daa47 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf286.dtsi @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +#include "qca956x.dtsi" + +#include +#include +#include + +/ { + aliases { + led-boot = &led_debug; + led-failsafe = &led_debug; + led-running = &led_debug; + led-upgrade = &led_debug; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + /* Hidden SMD LED below signal strength LEDs. + * Visible through slits underside of the case, + * and slightly through the case below signal state LEDs + */ + led_debug: led-0 { + function = LED_FUNCTION_DEBUG; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wifi { + label = "wifi"; + linux,code = ; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + /* This GPIO is used to reset whole board _including_ the modem */ + gpio-restart { + compatible = "gpio-restart"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + active-delay = <3000>; + inactive-delay = <1000>; + }; +}; + +&gpio { + /* GPIO19 is used as a mask to enable WLAN LED + * in stock firmware, which is controlled directly + * by 5GHz Wi-Fi chip, which currently is inactive + * in OpenWrt + */ + led-wlan { + gpio-hog; + gpios = <19 GPIO_ACTIVE_LOW>; + output-high; + line-name = "led:wlan"; + }; +}; + +&spi { + status = "okay"; + + boot_flash: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + }; + }; + + system_flash: flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&pcie { + status = "okay"; + + wifi_ath10k: wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0 0 0 0 0>; + }; +}; + +&wmac { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286a.dts b/target/linux/ath79/dts/qca9563_zte_mf286a.dts new file mode 100644 index 000000000..205dde803 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf286a.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +#include "qca9563_zte_mf286ar.dtsi" + +/ { + model = "ZTE MF286A"; + compatible = "zte,mf286a", "qca,qca9563"; +}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi b/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi new file mode 100644 index 000000000..45ac3bc7e --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +#include "qca9563_zte_mf286.dtsi" + +/ { + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x7a60000>; + label = "ubi"; + }; + }; + }; +}; + +&led_debug { + /* Hidden blue SMD LED below signal strength LEDs + * Visible through slits underside of the case, + * and slightly through the case below signal state LEDs + */ + color = ; + label = "blue:debug"; +}; + +&boot_flash { + partitions { + partition@0 { + label = "u-boot"; + reg = <0x000000 0x0a0000>; + read-only; + }; + + partition@a0000 { + label = "u-boot-env"; + reg = <0x0a0000 0x020000>; + read-only; + }; + + partition@c0000 { + label = "reserved1"; + reg = <0x0c0000 0x140000>; + read-only; + }; + }; +}; + +&system_flash { + partitions { + partition@0 { + label = "fota-flag"; + reg = <0x00000 0xa0000>; + read-only; + }; + + partition@a0000 { + label = "art"; + reg = <0xa0000 0x80000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@120000 { + label = "mac"; + reg = <0x120000 0x80000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: mac-address@0 { + reg = <0x0 0x6>; + }; + }; + + /* This encompasses stock reserved2, cfg-param, log, oops, + * reserved3, web partitions, + * which can be overwritten safely + */ + ubiconcat0: partition@1a0000 { + label = "ubiconcat0"; + reg = <0x1a0000 0x1660000>; + }; + + /* Kernel MTD size is increased to 4MB from stock 3MB */ + partition@1800000 { + label = "kernel"; + reg = <0x1800000 0x400000>; + }; + + /* This encompasses stock rootfs, data, fota partitions, + * which can be overwritten safely + */ + ubiconcat1: partition@1c00000 { + label = "ubiconcat1"; + reg = <0x1c00000 0x6400000>; + }; + }; +}; + +ð0 { + nvmem-cells = <&macaddr_mac_0>; + nvmem-cell-names = "mac-address"; +}; + +&wifi_ath10k { + nvmem-cells = <&macaddr_mac_0>, <&precal_art_5000>; + nvmem-cell-names = "mac-address", "pre-calibration"; + mac-address-increment = <0x20000>; +}; + +&wmac { + nvmem-cells = <&macaddr_mac_0>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286r.dts b/target/linux/ath79/dts/qca9563_zte_mf286r.dts new file mode 100644 index 000000000..6fa0f7a7f --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf286r.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +#include "qca9563_zte_mf286ar.dtsi" + +/ { + model = "ZTE MF286R"; + compatible = "zte,mf286r", "qca,qca9563"; +}; diff --git a/target/linux/ath79/dts/qca956x.dtsi b/target/linux/ath79/dts/qca956x.dtsi index 8627f7ee4..f2452e9dc 100644 --- a/target/linux/ath79/dts/qca956x.dtsi +++ b/target/linux/ath79/dts/qca956x.dtsi @@ -200,6 +200,9 @@ phys = <&usb_phy0>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; usb1: usb@1b400000 { @@ -219,6 +222,9 @@ phys = <&usb_phy1>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; spi: spi@1f000000 { diff --git a/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts b/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts new file mode 100644 index 000000000..e5d897029 --- /dev/null +++ b/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts @@ -0,0 +1,255 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include + +/ { + model = "Netgear EX7300 v2"; + compatible = "netgear,ex7300-v2", "qca,qcn5500", "qca,qca9560"; + + aliases { + 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 { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + num-chipselects = <0>; + + led_gpio: led_gpio@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <1>; + spi-max-frequency = <500000>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led_power_amber: power_amber { + label = "amber:power"; + gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>; + }; + + wps_green { + label = "green:wps"; + gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; + }; + + router_red { + label = "red:router"; + gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>; + }; + + router_green { + label = "green:router"; + gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>; + }; + + client_red { + label = "red:client"; + gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>; + }; + + client_green { + label = "green:client"; + gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>; + }; + + left_blue { + label = "blue:left"; + gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>; + }; + + right_blue { + label = "blue:right"; + gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + extender_apmode { + label = "EXTENDER/APMODE switch"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + debounce-interval = <60>; + }; + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + + nvmem-cells = <&macaddr_artmtd_c>, <&precal_art_5000>; + nvmem-cell-names = "mac-address", "pre-calibration"; + }; +}; + +&pll { + clocks = <&extosc>; +}; + +&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>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "config"; + reg = <0x050000 0x010000>; + }; + + partition@60000 { + label = "pot"; + reg = <0x060000 0x010000>; + read-only; + }; + + partition@70000 { + label = "firmware"; + reg = <0x70000 0xe30000>; + compatible = "denx,uimage"; + }; + + partition@ea0000 { + label = "rae"; + reg = <0xea0000 0x100000>; + read-only; + }; + + partition@fa0000 { + label = "oopsdump"; + reg = <0xfa0000 0x40000>; + read-only; + }; + + partition@fe0000 { + label = "artmtd"; + reg = <0xfe0000 0x10000>; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_artmtd_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_artmtd_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_artmtd_c: macaddr@c { + reg = <0xc 0x6>; + }; + }; + + partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + }; + }; +}; + + +&wmac { + /* Does not work due to lack of QCN5502 support in ath9k. */ + status = "disabled"; + + nvmem-cells = <&macaddr_artmtd_6>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + phy-mode = "sgmii"; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_artmtd_0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&phy5>; + phy-mode = "sgmii"; + + pll-data = <0x03000000 0x00000101 0x00001313>; +}; diff --git a/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts b/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts new file mode 100644 index 000000000..c095bbd2e --- /dev/null +++ b/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts @@ -0,0 +1,248 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include + +/ { + model = "TP-Link Archer A9 v6"; + compatible = "tplink,archer-a9-v6", "qca,qcn5500", "qca,qca9560"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb { + label = "green:usb"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + trigger-sources = <&hub_port0>; + linux,default-trigger = "usbport"; + }; + + wan { + label = "green:wan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wan_orange { + label = "orange:wan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "green:wps"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x80080080 /* PORT0 PAD MODE CTRL */ + 0x08 0x00000000 /* PORT5 PAD MODE CTRL */ + 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */ + 0x10 0x00000080 /* POWER_ON_STRAP */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x00000200 /* PORT6_STATUS */ + >; + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,0046"; + reg = <0 0 0 0 0>; + + nvmem-cells = <&macaddr_info_8>, <&precal_art_5000>; + nvmem-cell-names = "mac-address", "pre-calibration"; + + mac-address-increment = <(-1)>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + m25p,fast-read; + + mtdparts: 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 { + label = "partition-table"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "art"; + reg = <0x050000 0x010000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@60000 { + label = "info"; + reg = <0x060000 0x020000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; + + partition@80000 { + label = "user-config"; + reg = <0x080000 0x040000>; + read-only; + }; + + partition@c0000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0c0000 0xf00000>; + }; + + partition@fc0000 { + label = "log"; + reg = <0xfc0000 0x020000>; + read-only; + }; + + partition@fe0000 { + label = "certificate"; + reg = <0xfe0000 0x010000>; + read-only; + }; + + partition@ff0000 { + label = "default-config"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&wmac { + /* TODO: missing support in ath9k */ + status = "disabled"; + + nvmem-cells = <&cal_art_1000>, <&macaddr_info_8>; + nvmem-cell-names = "calibration", "mac-address"; +}; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi index 5c897b16a..b2c009c34 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi @@ -63,6 +63,7 @@ }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + 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 index 21a2be993..daf777931 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts @@ -66,5 +66,6 @@ }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts index 4334b70ce..409f288f0 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts @@ -30,5 +30,6 @@ }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts index 7451f0074..d4638f1ac 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts @@ -136,19 +136,32 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&config 0x8>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { status = "okay"; - mtd-mac-address = <&config 0x8>; + nvmem-cells = <&macaddr_config_8>; + nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&config 0x8>; + nvmem-cells = <&macaddr_config_8>; + nvmem-cell-names = "mac-address"; +}; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi index 31079123c..3a38b8025 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi @@ -50,8 +50,9 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; ð1 { @@ -62,5 +63,16 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; diff --git a/target/linux/ath79/files/arch/mips/ath79/pci-ath9k-fixup.c b/target/linux/ath79/files/arch/mips/ath79/pci-ath9k-fixup.c deleted file mode 100644 index 220235180..000000000 --- a/target/linux/ath79/files/arch/mips/ath79/pci-ath9k-fixup.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Atheros AP94 reference board PCI initialization - * - * Copyright (C) 2009-2010 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 - -struct ath9k_fixup { - u16 *cal_data; - unsigned slot; -}; - -static int ath9k_num_fixups; -static struct ath9k_fixup ath9k_fixups[2]; - -static void ath9k_pci_fixup(struct pci_dev *dev) -{ - void __iomem *mem; - u16 *cal_data = NULL; - u16 cmd; - u32 bar0; - u32 val; - unsigned i; - - for (i = 0; i < ath9k_num_fixups; i++) { - if (ath9k_fixups[i].cal_data == NULL) - continue; - - if (ath9k_fixups[i].slot != PCI_SLOT(dev->devfn)) - continue; - - cal_data = ath9k_fixups[i].cal_data; - break; - } - - if (cal_data == NULL) - return; - - if (*cal_data != 0xa55a) { - pr_err("pci %s: invalid calibration data\n", pci_name(dev)); - return; - } - - pr_info("pci %s: fixup device configuration\n", pci_name(dev)); - - mem = ioremap(AR71XX_PCI_MEM_BASE, 0x10000); - if (!mem) { - pr_err("pci %s: ioremap error\n", pci_name(dev)); - return; - } - - pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar0); - - switch (ath79_soc) { - case ATH79_SOC_AR7161: - pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, - AR71XX_PCI_MEM_BASE); - break; - case ATH79_SOC_AR7240: - pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, 0xffff); - break; - - case ATH79_SOC_AR7241: - case ATH79_SOC_AR7242: - pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, 0x1000ffff); - break; - case ATH79_SOC_AR9344: - pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, 0x1000ffff); - break; - - default: - BUG(); - } - - pci_read_config_word(dev, PCI_COMMAND, &cmd); - cmd |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY; - pci_write_config_word(dev, PCI_COMMAND, cmd); - - /* set pointer to first reg address */ - cal_data += 3; - while (*cal_data != 0xffff) { - u32 reg; - reg = *cal_data++; - val = *cal_data++; - val |= (*cal_data++) << 16; - - __raw_writel(val, mem + reg); - udelay(100); - } - - pci_read_config_dword(dev, PCI_VENDOR_ID, &val); - dev->vendor = val & 0xffff; - dev->device = (val >> 16) & 0xffff; - - pci_read_config_dword(dev, PCI_CLASS_REVISION, &val); - dev->revision = val & 0xff; - dev->class = val >> 8; /* upper 3 bytes */ - - pci_read_config_word(dev, PCI_COMMAND, &cmd); - cmd &= ~(PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY); - pci_write_config_word(dev, PCI_COMMAND, cmd); - - pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, bar0); - - iounmap(mem); -} -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID, ath9k_pci_fixup); - -void __init pci_enable_ath9k_fixup(unsigned slot, u16 *cal_data) -{ - if (ath9k_num_fixups >= ARRAY_SIZE(ath9k_fixups)) - return; - - ath9k_fixups[ath9k_num_fixups].slot = slot; - ath9k_fixups[ath9k_num_fixups].cal_data = cal_data; - ath9k_num_fixups++; -} diff --git a/target/linux/ath79/files/arch/mips/ath79/pci-ath9k-fixup.h b/target/linux/ath79/files/arch/mips/ath79/pci-ath9k-fixup.h deleted file mode 100644 index 5794941f0..000000000 --- a/target/linux/ath79/files/arch/mips/ath79/pci-ath9k-fixup.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _PCI_ATH9K_FIXUP -#define _PCI_ATH9K_FIXUP - -void pci_enable_ath9k_fixup(unsigned slot, u16 *cal_data) __init; - -#endif /* _PCI_ATH9K_FIXUP */ diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch.c b/target/linux/ath79/files/drivers/gpio/gpio-latch.c index f3545a663..976e68323 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-latch.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-latch.c @@ -62,7 +62,7 @@ gpio_latch_get(struct gpio_chip *gc, unsigned offset) int ret; gpio_latch_lock(glc, false); - ret = gpiod_get_value(glc->gpios[offset]); + ret = gpiod_get_raw_value_cansleep(glc->gpios[offset]); gpio_latch_unlock(glc, false); return ret; @@ -81,7 +81,7 @@ gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value) } gpio_latch_lock(glc, enable_latch); - gpiod_set_raw_value(glc->gpios[offset], value); + gpiod_set_raw_value_cansleep(glc->gpios[offset], value); gpio_latch_unlock(glc, disable_latch); } @@ -133,8 +133,10 @@ static int gpio_latch_probe(struct platform_device *pdev) glc->gpios[i] = devm_gpiod_get_index_optional(dev, NULL, i, GPIOD_OUT_LOW); if (IS_ERR(glc->gpios[i])) { - dev_err(dev, "failed to get gpio %d: %d\n", i, - PTR_ERR(glc->gpios[i])); + if (PTR_ERR(glc->gpios[i]) != -EPROBE_DEFER) { + dev_err(dev, "failed to get gpio %d: %d\n", i, + PTR_ERR(glc->gpios[i])); + } return PTR_ERR(glc->gpios[i]); } } diff --git a/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c new file mode 100644 index 000000000..ee8359e77 --- /dev/null +++ b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Driver for reset key gpio line on MikroTik RB91x board series. + * This line is shared between NAND ALE (goes through a latch), + * NAND IO7 and reset key. We make 3 virtual gpio lines from the + * single physical one: + * 1) Capable output one for NAND, + * 2) Capable input one for reset key, + * 3) And capable output one, aka "key-poll-disable", + * for NAND -- to syncronise NAND operation and key polling. + * + * Copyright (C) 2021 Denis Kalashnikov + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define GPIO_RB91X_KEY_DRIVER_NAME "gpio-rb91x-key" + +enum gpio_rb91x_key_gpios { + GPIO_RB91X_KEY_NAND, + GPIO_RB91X_KEY_POLL, + GPIO_RB91X_KEY_PDIS, + + GPIO_RB91X_KEY_NGPIOS, +}; + +struct gpio_rb91x_key { + struct gpio_chip gc; + struct mutex mutex; + struct mutex poll_mutex; + int polling_disabled; + struct gpio_desc *gpio; +}; + +static inline struct gpio_rb91x_key *to_gpio_rb91x_key(struct gpio_chip *gc) +{ + return container_of(gc, struct gpio_rb91x_key, gc); +} + +static int gpio_rb91x_key_get(struct gpio_chip *gc, unsigned offset) +{ + struct gpio_rb91x_key *drvdata = to_gpio_rb91x_key(gc); + struct gpio_desc *gpio = drvdata->gpio; + int val, bak_val; + + switch (offset) { + case GPIO_RB91X_KEY_NAND: + mutex_lock(&drvdata->mutex); + val = gpiod_get_value_cansleep(gpio); + mutex_unlock(&drvdata->mutex); + break; + case GPIO_RB91X_KEY_PDIS: + mutex_lock(&drvdata->mutex); + val = drvdata->polling_disabled; + mutex_unlock(&drvdata->mutex); + break; + case GPIO_RB91X_KEY_POLL: + mutex_lock(&drvdata->poll_mutex); + mutex_lock(&drvdata->mutex); + bak_val = gpiod_get_raw_value_cansleep(gpio); + gpiod_direction_input(gpio); + /* + * Without this delay nothing works. Get it + * from mikrotik RouterOS linux kernel patches. + */ + udelay(200); + val = gpiod_get_raw_value_cansleep(gpio); + gpiod_direction_output_raw(gpio, bak_val); + mutex_unlock(&drvdata->mutex); + mutex_unlock(&drvdata->poll_mutex); + break; + default: + return -EINVAL; + } + + return val; +} + +static int gpio_rb91x_key_direction_input(struct gpio_chip *gc, unsigned offset) +{ + switch (offset) { + case GPIO_RB91X_KEY_POLL: + return 0; + default: + return -EINVAL; + } +} + +static void gpio_rb91x_key_set(struct gpio_chip *gc, unsigned offset, int value) +{ + struct gpio_rb91x_key *drvdata = to_gpio_rb91x_key(gc); + struct gpio_desc *gpio = drvdata->gpio; + + mutex_lock(&drvdata->mutex); + + switch (offset) { + case GPIO_RB91X_KEY_NAND: + gpiod_set_raw_value_cansleep(gpio, value); + break; + case GPIO_RB91X_KEY_PDIS: + if (value) { + if (!drvdata->polling_disabled) { + mutex_lock(&drvdata->poll_mutex); + drvdata->polling_disabled = 1; + } + } else { + if (drvdata->polling_disabled) { + mutex_unlock(&drvdata->poll_mutex); + drvdata->polling_disabled = 0; + } + } + break; + default: + break; + } + + mutex_unlock(&drvdata->mutex); +} + +static int gpio_rb91x_key_direction_output(struct gpio_chip *gc, unsigned offset, + int value) +{ + switch (offset) { + case GPIO_RB91X_KEY_NAND: + case GPIO_RB91X_KEY_PDIS: + gpio_rb91x_key_set(gc, offset, value); + return 0; + default: + return -EINVAL; + } +} + +static int gpio_rb91x_key_probe(struct platform_device *pdev) +{ + struct gpio_rb91x_key *drvdata; + struct gpio_chip *gc; + struct device *dev = &pdev->dev; + struct device_node *of_node = dev->of_node; + int r; + + drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); + if (!drvdata) + return -ENOMEM; + + mutex_init(&drvdata->mutex); + mutex_init(&drvdata->poll_mutex); + + drvdata->gpio = devm_gpiod_get(dev, NULL, GPIOD_OUT_LOW); + if (IS_ERR(drvdata->gpio)) { + if (PTR_ERR(drvdata->gpio) != -EPROBE_DEFER) { + dev_err(dev, "failed to get gpio: %ld\n", + PTR_ERR(drvdata->gpio)); + } + return PTR_ERR(drvdata->gpio); + } + + gc = &drvdata->gc; + gc->label = GPIO_RB91X_KEY_DRIVER_NAME; + gc->can_sleep = 1; + gc->base = -1; + gc->ngpio = GPIO_RB91X_KEY_NGPIOS; + gc->get = gpio_rb91x_key_get; + gc->set = gpio_rb91x_key_set; + gc->direction_output = gpio_rb91x_key_direction_output; + gc->direction_input = gpio_rb91x_key_direction_input; + gc->of_node = of_node; + + platform_set_drvdata(pdev, drvdata); + + r = gpiochip_add(&drvdata->gc); + if (r) { + dev_err(dev, "gpiochip_add() failed: %d\n", r); + return r; + } + + return 0; +} + +static int gpio_rb91x_key_remove(struct platform_device *pdev) +{ + struct gpio_rb91x_key *drvdata = platform_get_drvdata(pdev); + + gpiochip_remove(&drvdata->gc); + return 0; +} + +static const struct of_device_id gpio_rb91x_key_match[] = { + { .compatible = "mikrotik,"GPIO_RB91X_KEY_DRIVER_NAME }, + {}, +}; + +MODULE_DEVICE_TABLE(of, gpio_rb91x_key_match); + +static struct platform_driver gpio_rb91x_key_driver = { + .probe = gpio_rb91x_key_probe, + .remove = gpio_rb91x_key_remove, + .driver = { + .name = GPIO_RB91X_KEY_DRIVER_NAME, + .owner = THIS_MODULE, + .of_match_table = gpio_rb91x_key_match, + }, +}; + +module_platform_driver(gpio_rb91x_key_driver); + +MODULE_DESCRIPTION("Driver for reset key gpio line shared with NAND for MikroTik RB91x board series."); +MODULE_AUTHOR("Denis Kalashnikov "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" GPIO_RB91X_KEY_DRIVER_NAME); 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 index e040726f4..fafb3f56b 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c @@ -14,9 +14,7 @@ #include #include #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) #include -#endif #include #include #include @@ -722,11 +720,7 @@ static void ar934x_nfc_cmdfunc(struct nand_chip *nand, unsigned int command, break; case NAND_CMD_PAGEPROG: -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) if (nand->ecc.engine_type == NAND_ECC_ENGINE_TYPE_ON_HOST) { -#else - if (nand->ecc.mode == NAND_ECC_HW) { -#endif /* the data is already written */ break; } @@ -1334,29 +1328,15 @@ static int ar934x_nfc_attach_chip(struct nand_chip *nand) if (mtd->writesize == 2048) nand->options |= NAND_NO_SUBPAGE_WRITE; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) if (nand->ecc.engine_type == NAND_ECC_ENGINE_TYPE_ON_HOST) { -#else - if (nand->ecc.mode == NAND_ECC_HW) { -#endif ret = ar934x_nfc_setup_hwecc(nfc); if (ret) return ret; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) } else if (nand->ecc.engine_type != NAND_ECC_ENGINE_TYPE_SOFT) { dev_err(dev, "unknown ECC mode %d\n", nand->ecc.engine_type); -#else - } else if (nand->ecc.mode != NAND_ECC_SOFT) { - dev_err(dev, "unknown ECC mode %d\n", nand->ecc.mode); -#endif return -EINVAL; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) } else if ((nand->ecc.algo != NAND_ECC_ALGO_BCH) && (nand->ecc.algo != NAND_ECC_ALGO_HAMMING)) { -#else - } else if ((nand->ecc.algo != NAND_ECC_BCH) && - (nand->ecc.algo != NAND_ECC_HAMMING)) { -#endif dev_err(dev, "unknown software ECC algo %d\n", nand->ecc.algo); return -EINVAL; } @@ -1445,11 +1425,7 @@ static int ar934x_nfc_probe(struct platform_device *pdev) nand->legacy.read_byte = ar934x_nfc_read_byte; nand->legacy.write_buf = ar934x_nfc_write_buf; nand->legacy.read_buf = ar934x_nfc_read_buf; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) nand->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; /* default */ -#else - nand->ecc.mode = NAND_ECC_HW; /* default */ -#endif nand->priv = nfc; platform_set_drvdata(pdev, nfc); @@ -1489,12 +1465,8 @@ static int ar934x_nfc_remove(struct platform_device *pdev) nfc = platform_get_drvdata(pdev); if (nfc) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) mtd_device_unregister(nand_to_mtd(&nfc->nand_chip)); nand_cleanup(&nfc->nand_chip); -#else - nand_release(&nfc->nand_chip); -#endif ar934x_nfc_free_buf(nfc); } diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c b/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c index 22e2660b3..e42631525 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c @@ -188,13 +188,8 @@ static int rb4xx_nand_probe(struct platform_device *pdev) if (mtd->writesize == 512) mtd_set_ooblayout(mtd, &rb4xx_nand_ecclayout_ops); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) nand->chip.ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT; nand->chip.ecc.algo = NAND_ECC_ALGO_HAMMING; -#else - nand->chip.ecc.mode = NAND_ECC_SOFT; - nand->chip.ecc.algo = NAND_ECC_HAMMING; -#endif nand->chip.options = NAND_NO_SUBPAGE_WRITE; nand->chip.priv = nand; @@ -211,12 +206,8 @@ static int rb4xx_nand_probe(struct platform_device *pdev) ret = mtd_device_register(mtd, NULL, 0); if (ret) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) mtd_device_unregister(nand_to_mtd(&nand->chip)); nand_cleanup(&nand->chip); -#else - nand_release(&nand->chip); -#endif return ret; } @@ -227,12 +218,8 @@ static int rb4xx_nand_remove(struct platform_device *pdev) { struct rb4xx_nand *nand = platform_get_drvdata(pdev); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) - mtd_device_unregister(nand_to_mtd(&nand->chip)); - nand_cleanup(&nand->chip); -#else - nand_release(&nand->chip); -#endif + mtd_device_unregister(nand_to_mtd(&nand->chip)); + nand_cleanup(&nand->chip); return 0; } diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c index e23194451..244fd2759 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c @@ -40,6 +40,7 @@ enum rb91x_nand_gpios { RB91X_NAND_ALE, /* Address Latch Enable */ RB91X_NAND_NRW, /* Read/Write. Active low */ RB91X_NAND_NLE, /* Latch Enable. Active low */ + RB91X_NAND_PDIS, /* Reset Key Poll Disable. Active high */ RB91X_NAND_GPIOS, }; @@ -57,6 +58,12 @@ static inline void rb91x_nand_latch_lock(struct rb91x_nand_drvdata *drvdata, gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_NLE], lock); } +static inline void rb91x_nand_rst_key_poll_disable(struct rb91x_nand_drvdata *drvdata, + int disable) +{ + gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_PDIS], disable); +} + static int rb91x_ooblayout_ecc(struct mtd_info *mtd, int section, struct mtd_oob_region *oobregion) { @@ -115,6 +122,7 @@ static void rb91x_nand_write(struct rb91x_nand_drvdata *drvdata, unsigned i; rb91x_nand_latch_lock(drvdata, 1); + rb91x_nand_rst_key_poll_disable(drvdata, 1); oe_reg = __raw_readl(base + AR71XX_GPIO_REG_OE); out_reg = __raw_readl(base + AR71XX_GPIO_REG_OUT); @@ -146,6 +154,7 @@ static void rb91x_nand_write(struct rb91x_nand_drvdata *drvdata, /* Flush write */ __raw_readl(base + AR71XX_GPIO_REG_OUT); + rb91x_nand_rst_key_poll_disable(drvdata, 0); rb91x_nand_latch_lock(drvdata, 0); } @@ -162,6 +171,7 @@ static void rb91x_nand_read(struct rb91x_nand_drvdata *drvdata, gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_READ], 1); rb91x_nand_latch_lock(drvdata, 1); + rb91x_nand_rst_key_poll_disable(drvdata, 1); /* Save registers */ oe_reg = __raw_readl(base + AR71XX_GPIO_REG_OE); @@ -199,6 +209,7 @@ static void rb91x_nand_read(struct rb91x_nand_drvdata *drvdata, /* Flush write */ __raw_readl(base + AR71XX_GPIO_REG_OUT); + rb91x_nand_rst_key_poll_disable(drvdata, 0); rb91x_nand_latch_lock(drvdata, 0); /* Disable read mode */ @@ -254,12 +265,8 @@ static void rb91x_nand_write_buf(struct nand_chip *chip, const u8 *buf, int len) static void rb91x_nand_release(struct rb91x_nand_drvdata *drvdata) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) mtd_device_unregister(nand_to_mtd(&drvdata->chip)); nand_cleanup(&drvdata->chip); -#else - nand_release(&drvdata->chip); -#endif } static int rb91x_nand_probe(struct platform_device *pdev) @@ -278,8 +285,11 @@ static int rb91x_nand_probe(struct platform_device *pdev) gpios = gpiod_get_array(dev, NULL, GPIOD_OUT_LOW); if (IS_ERR(gpios)) { - dev_err(dev, "failed to get gpios: %d\n", (int)gpios); - return -EINVAL; + if (PTR_ERR(gpios) != -EPROBE_DEFER) { + dev_err(dev, "failed to get gpios: %d\n", + PTR_ERR(gpios)); + } + return PTR_ERR(gpios); } if (gpios->ndescs != RB91X_NAND_GPIOS) { @@ -304,13 +314,8 @@ static int rb91x_nand_probe(struct platform_device *pdev) drvdata->chip.legacy.read_buf = rb91x_nand_read_buf; drvdata->chip.legacy.chip_delay = 25; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) drvdata->chip.ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT; drvdata->chip.ecc.algo = NAND_ECC_ALGO_HAMMING; -#else - drvdata->chip.ecc.mode = NAND_ECC_SOFT; - drvdata->chip.ecc.algo = NAND_ECC_HAMMING; -#endif drvdata->chip.options = NAND_NO_SUBPAGE_WRITE; r = nand_scan(&drvdata->chip, 1); diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h index 5ff9439f0..1955cd288 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h @@ -178,11 +178,7 @@ struct ag71xx { struct phy_device *phy_dev; void *phy_priv; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0) phy_interface_t phy_if_mode; -#else - int phy_if_mode; -#endif unsigned int link; unsigned int speed; 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 607cc0b93..2fc18d597 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 @@ -1198,11 +1198,7 @@ static void ag71xx_oom_timer_handler(struct timer_list *t) napi_schedule(&ag->napi); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) static void ag71xx_tx_timeout(struct net_device *dev, unsigned int txqueue) -#else -static void ag71xx_tx_timeout(struct net_device *dev) -#endif { struct ag71xx *ag = netdev_priv(dev); @@ -1600,6 +1596,12 @@ static int ag71xx_probe(struct platform_device *pdev) return -ENOMEM; } + /* ensure that HW is in manual polling mode before interrupts are + * activated. Otherwise ag71xx_interrupt might call napi_schedule + * before it is initialized by netif_napi_add. + */ + ag71xx_int_disable(ag, AG71XX_INT_POLL); + dev->irq = platform_get_irq(pdev, 0); err = devm_request_irq(&pdev->dev, dev->irq, ag71xx_interrupt, 0x0, dev_name(&pdev->dev), dev); @@ -1673,13 +1675,8 @@ static int ag71xx_probe(struct platform_device *pdev) eth_random_addr(dev->dev_addr); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0) err = of_get_phy_mode(np, &ag->phy_if_mode); if (err < 0) { -#else - ag->phy_if_mode = of_get_phy_mode(np); - if (ag->phy_if_mode < 0) { -#endif dev_err(&pdev->dev, "missing phy-mode property in DT\n"); return ag->phy_if_mode; } diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 326db4c66..2ce489b0d 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -19,12 +19,10 @@ glinet,gl-ar300m-lite|\ glinet,gl-ar300m16|\ pcs,cap324|\ tplink,cpe610-v1|\ -tplink,cpe610-v2) +tplink,cpe610-v2|\ +tplink,tl-wa1201-v2) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" ;; -pisen,wpr003n) - ucidef_set_led_netdev "wan" "WAN" "blue:power" "eth1" "tx rx" - ;; alfa-network,n2q) ucidef_set_led_netdev "lan2" "LAN2" "orange:lan2" "eth1" ucidef_set_led_switch "lan1" "LAN1" "orange:lan1" "switch0" "0x10" @@ -50,6 +48,24 @@ alfa-network,r36a) ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x10" ;; +alfa-network,tube-2hq) + ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "signal1" "SIGNAL1" "red:signal1" "wlan0" "1" "100" + ucidef_set_led_rssi "signal2" "SIGNAL2" "orange:signal2" "wlan0" "25" "100" + ucidef_set_led_rssi "signal3" "SIGNAL3" "green:signal3" "wlan0" "50" "100" + ucidef_set_led_rssi "signal4" "SIGNAL4" "green:signal4" "wlan0" "75" "100" + ;; +asus,rp-ac66) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_rssimon "wlan1" "200000" "1" + ucidef_set_led_rssi "rssilow-wlan0" "RSSILOW" "blue:rssilow-wlan0" "wlan0" "1" "1" + ucidef_set_led_rssi "rssimedium-wlan0" "RSSIMEDIUM" "red:rssimedium-wlan0" "wlan0" "1" "79" + ucidef_set_led_rssi "rssihigh-wlan0" "RSSIHIGH" "green:rssihigh-wlan0" "wlan0" "70" "100" + ucidef_set_led_rssi "rssilow-wlan1" "RSSILOW" "blue:rssilow-wlan1" "wlan1" "1" "1" + ucidef_set_led_rssi "rssimedium-wlan1" "RSSIMEDIUM" "red:rssimedium-wlan1" "wlan1" "1" "79" + ucidef_set_led_rssi "rssihigh-wlan1" "RSSIHIGH" "green:rssihigh-wlan1" "wlan1" "70" "100" + ;; avm,fritz1750e) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" ucidef_set_rssimon "wlan1" "200000" "1" @@ -171,7 +187,8 @@ enterasys,ws-ap3705i|\ openmesh,mr900-v1|\ openmesh,mr900-v2|\ openmesh,mr1750-v1|\ -openmesh,mr1750-v2) +openmesh,mr1750-v2|\ +tplink,cpe710-v1) ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" ;; compex,wpj344-16m|\ @@ -222,12 +239,16 @@ qxwlan,e750a-v4-16m) ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x02" ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" ;; +glinet,gl-x300b|\ glinet,gl-x750) ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" ;; hak5,lan-turtle) ucidef_set_led_netdev "wan" "WAN" "orange:system" "eth1" ;; +joyit,jt-or750i) + ucidef_set_led_default "ath10k" "ath10k-disable" "ath10k-phy0" "0" + ;; meraki,mr12|\ tplink,cpe210-v2|\ tplink,cpe210-v3) @@ -258,6 +279,18 @@ openmesh,om2p-hs-v4) ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x02" ;; +openmesh,om2p-v1) + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" + ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x10" + ;; +openmesh,om5p-ac-v1) + ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" + ;; +openmesh,om5p-an) + ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" + ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x02" + ;; pcs,cr3000) ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x04" @@ -292,6 +325,9 @@ tplink,archer-c7-v5) ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x10" ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x20" ;; +tplink,archer-a9-v6) + ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x02" + ;; tplink,archer-c2-v3|\ tplink,tl-wr1043nd-v4|\ tplink,tl-wr1043n-v5) @@ -371,13 +407,7 @@ tplink,tl-wpa8630p-v2.0-eu|\ tplink,tl-wpa8630p-v2.1-eu) ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x3c" ;; -tplink,tl-wdr6500-v2) - ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" - 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-wr841hp-v2|\ tplink,tl-wr842n-v2) ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x04" @@ -395,6 +425,7 @@ trendnet,tew-823dru) ubnt,bullet-ac|\ ubnt,nanobeam-ac|\ ubnt,nanobeam-ac-gen2|\ +ubnt,nanobeam-ac-xc|\ ubnt,nanostation-ac|\ ubnt,powerbeam-5ac-gen2) ucidef_set_rssimon "wlan0" "200000" "1" @@ -412,7 +443,8 @@ ubnt,nanostation-loco-m-xw|\ ubnt,nanostation-m|\ ubnt,nanostation-m-xw|\ ubnt,picostation-m|\ -ubnt,powerbeam-m-xw|\ +ubnt,powerbeam-m2-xw|\ +ubnt,powerbeam-m5-xw|\ ubnt,powerbridge-m|\ ubnt,rocket-m) ucidef_set_rssimon "wlan0" "200000" "1" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 85ce82931..bc3208191 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -13,8 +13,13 @@ ath79_setup_interfaces() allnet,all-wap02860ac|\ alfa-network,ap121f|\ alfa-network,pi-wifi4|\ + alfa-network,tube-2hq|\ + araknis,an-300-ap-i-n|\ + araknis,an-500-ap-i-ac|\ + araknis,an-700-ap-i-ac|\ arduino,yun|\ aruba,ap-105|\ + asus,rp-ac66|\ avm,fritz1750e|\ avm,fritz300e|\ avm,fritzdvbc|\ @@ -43,8 +48,10 @@ ath79_setup_interfaces() meraki,mr16|\ netgear,ex6400|\ netgear,ex7300|\ + netgear,ex7300-v2|\ ocedo,koala|\ ocedo,raccoon|\ + onion,omega|\ openmesh,mr600-v1|\ openmesh,mr600-v2|\ openmesh,mr900-v1|\ @@ -62,7 +69,9 @@ ath79_setup_interfaces() tplink,cpe510-v3|\ tplink,cpe610-v1|\ tplink,cpe610-v2|\ + tplink,cpe710-v1|\ tplink,eap225-outdoor-v1|\ + tplink,eap225-v1|\ tplink,eap225-v3|\ tplink,eap245-v1|\ tplink,re350k-v1|\ @@ -71,6 +80,7 @@ ath79_setup_interfaces() tplink,re450-v2|\ tplink,re450-v3|\ tplink,re455-v1|\ + tplink,tl-wa1201-v2|\ tplink,tl-wr902ac-v1|\ ubnt,bullet-ac|\ ubnt,bullet-m-ar7240|\ @@ -79,6 +89,7 @@ ath79_setup_interfaces() ubnt,lap-120|\ ubnt,litebeam-ac-gen2|\ ubnt,nanobeam-ac|\ + ubnt,nanobeam-ac-xc|\ ubnt,nanobridge-m|\ ubnt,nanostation-ac-loco|\ ubnt,nanostation-loco-m|\ @@ -86,7 +97,8 @@ ath79_setup_interfaces() ubnt,picostation-m|\ ubnt,powerbeam-5ac-500|\ ubnt,powerbeam-5ac-gen2|\ - ubnt,powerbeam-m-xw|\ + ubnt,powerbeam-m2-xw|\ + ubnt,powerbeam-m5-xw|\ ubnt,powerbridge-m|\ ubnt,rocket-5ac-lite|\ ubnt,rocket-m|\ @@ -115,11 +127,18 @@ ath79_setup_interfaces() ubnt,unifi-ap-outdoor-plus) ucidef_set_interface_lan "eth0 eth1" ;; + atheros,db120) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" + ucidef_add_switch "switch1" \ + "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" + ;; avm,fritz4020|\ pcs,cr3000|\ tplink,archer-c58-v1|\ tplink,archer-c59-v1|\ - tplink,archer-c59-v2) + tplink,archer-c59-v2|\ + wd,mynet-n600) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2" @@ -130,8 +149,7 @@ ath79_setup_interfaces() tplink,archer-c7-v1|\ tplink,archer-c7-v2|\ tplink,tl-wdr4900-v2|\ - tplink,tl-wdr7500-v3|\ - tplink,tl-wdr7500-v3-16MB) + tplink,tl-wdr7500-v3) ucidef_add_switch "switch0" \ "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan" ;; @@ -176,6 +194,7 @@ ath79_setup_interfaces() compex,wpj531-16m|\ openmesh,a40|\ openmesh,a60|\ + openmesh,om2p-v1|\ openmesh,om2p-v4|\ openmesh,om2p-hs-v4|\ plasmacloud,pa300|\ @@ -199,7 +218,6 @@ ath79_setup_interfaces() comfast,cf-e560ac|\ qca,ap143-8m|\ qca,ap143-16m|\ - tplink,tl-wdr6500-v2|\ tplink,tl-wr841hp-v3) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ @@ -216,6 +234,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "3:lan" "2:wan" ;; + compex,wpj558-16m) + ucidef_add_switch "switch0" \ + "1:wan" "5:lan" "6@eth0" + ;; devolo,dlan-pro-1200plus-ac|\ devolo,magic-2-wifi) ucidef_add_switch "switch0" \ @@ -253,6 +275,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan" ;; + embeddedwireless,balin) + ucidef_add_switch "switch0" \ + "0@eth0" "5:lan:1" "4:lan:2" "3:wan" + ;; embeddedwireless,dorin) ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan:3" "3:lan:2" @@ -274,6 +300,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" ;; + glinet,gl-x300b) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "4:lan" + ;; iodata,etg3-r|\ iodata,wn-ac1167dgr|\ iodata,wn-ac1600dgr|\ @@ -284,6 +315,20 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" ;; + jjplus,jwap230) + ucidef_add_switch "switch0" \ + "0@eth0" "5:wan:1" "1:lan:2" "6@eth1" + ;; + joyit,jt-or750i) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" + ;; + letv,lba-047-ch) + ucidef_set_interface_wan "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "3:lan:2" "4:lan:1" + ;; librerouter,librerouter-v1) ucidef_add_switch "switch0" \ "0@eth0" "5:wan" "6@eth1" "4:lan" @@ -295,6 +340,7 @@ ath79_setup_interfaces() ;; mercury,mw4530r-v1|\ tplink,archer-a7-v5|\ + tplink,archer-a9-v6|\ tplink,archer-c6-v2|\ tplink,archer-c6-v2-us|\ tplink,archer-c7-v4|\ @@ -402,17 +448,13 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4" ;; + tplink,tl-wr841hp-v2|\ tplink,tl-wr842n-v2|\ tplink,tl-wr941hp-v1) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ;; - pisen,wpr003n) - ucidef_set_interface_wan "eth1" - ucidef_add_switch "switch0" \ - "0@eth0" "1:lan" - ;; tplink,tl-wr1043nd-v1) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" @@ -492,6 +534,7 @@ ath79_setup_macs() alfa-network,n5q|\ alfa-network,pi-wifi4|\ alfa-network,r36a|\ + alfa-network,tube-2hq|\ engenius,eap300-v2|\ engenius,ens202ext-v1) label_mac=$(mtd_get_mac_binary art 0x1002) @@ -518,6 +561,7 @@ ath79_setup_macs() wan_mac=$(macaddr_add $(mtd_get_mac_binary art 0x0) 1) ;; compex,wpj344-16m|\ + compex,wpj558-16m|\ compex,wpj563) wan_mac=$(mtd_get_mac_binary u-boot 0x2e018) ;; @@ -563,6 +607,7 @@ ath79_setup_macs() ;; dlink,dir-859-a1|\ qihoo,c301|\ + wd,mynet-n600|\ wd,mynet-n750) lan_mac=$(mtd_get_mac_ascii devdata "lanmac") wan_mac=$(mtd_get_mac_ascii devdata "wanmac") @@ -650,6 +695,7 @@ ath79_setup_macs() label_mac=$lan_mac ;; tplink,archer-a7-v5|\ + tplink,archer-a9-v6|\ tplink,archer-c7-v4|\ tplink,archer-c7-v5|\ tplink,tl-wr1043nd-v4|\ @@ -676,6 +722,7 @@ ath79_setup_macs() ;; ubnt,litebeam-ac-gen2|\ ubnt,nanobeam-ac-gen2|\ + ubnt,nanobeam-ac-xc|\ ubnt,powerbeam-5ac-500|\ ubnt,powerbeam-5ac-gen2) label_mac=$(mtd_get_mac_binary art 0x5006) 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 index 83f428c54..ca7d8c633 100644 --- 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 @@ -76,13 +76,13 @@ tplink,wbs510-v2) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20" ;; ubnt,aircube-ac|\ -ubnt,aircube-isp) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" - ;; ubnt,nanobeam-ac-gen2|\ ubnt,nanostation-ac) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3" ;; +ubnt,aircube-isp) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" + ;; ubnt,nanostation-m) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8" ;; 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 index 388f47785..22e162692 100644 --- 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 @@ -12,16 +12,15 @@ case "$FIRMWARE" in 8dev,lima) caldata_extract "art" 0x1000 0x800 ;; + asus,rp-ac66) + caldata_extract "art" 0x1000 0x440 + ;; avm,fritz1750e|\ avm,fritz4020|\ avm,fritz450e|\ avm,fritzdvbc) caldata_extract_reverse "urlader" 0x1541 0x440 ;; - dlink,dap-2695-a1) - caldata_extract "art" 0x1000 0x440 - ath9k_patch_mac $(mtd_get_mac_ascii bdcfg "wlanmac") - ;; dlink,dir-505|\ dlink,dir-825-c1|\ dlink,dir-835-a1) @@ -34,6 +33,7 @@ case "$FIRMWARE" in dlink,dir-859-a1|\ nec,wf1200cr|\ nec,wg1200cr|\ + wd,mynet-n600|\ wd,mynet-n750) caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac") @@ -72,6 +72,22 @@ case "$FIRMWARE" in ;; "ath9k-eeprom-pci-0000:00:00.0.bin") case $board in + araknis,an-300-ap-i-n|\ + atheros,db120|\ + engenius,eap600|\ + engenius,ecb600|\ + mercury,mw4530r-v1|\ + ocedo,raccoon|\ + tplink,tl-wdr3500-v1|\ + tplink,tl-wdr3600-v1|\ + tplink,tl-wdr4300-v1|\ + tplink,tl-wdr4300-v1-il|\ + tplink,tl-wdr4310-v1|\ + tplink,tl-wdr4900-v2|\ + ubnt,unifi-ap-pro|\ + winchannel,wb2000) + caldata_extract "art" 0x5000 0x440 + ;; avm,fritz300e) caldata_extract_reverse "urloader" 0x1541 0x440 ;; @@ -88,20 +104,6 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x440 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1) ;; - engenius,eap600|\ - engenius,ecb600|\ - mercury,mw4530r-v1|\ - ocedo,raccoon|\ - tplink,tl-wdr3500-v1|\ - tplink,tl-wdr3600-v1|\ - tplink,tl-wdr4300-v1|\ - tplink,tl-wdr4300-v1-il|\ - tplink,tl-wdr4310-v1|\ - tplink,tl-wdr4900-v2|\ - ubnt,unifi-ap-pro|\ - winchannel,wb2000) - caldata_extract "art" 0x5000 0x440 - ;; enterasys,ws-ap3705i) caldata_extract "calibrate" 0x5000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0) @@ -126,9 +128,14 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x1000 ;; openmesh,mr600-v1|\ - openmesh,mr600-v2) + openmesh,mr600-v2|\ + openmesh,om5p-an) caldata_extract "ART" 0x5000 0x440 ;; + openmesh,om2p-v1) + caldata_extract "ART" 0x1000 0x440 + ;; + wd,mynet-n600|\ wd,mynet-n750) caldata_extract "art" 0x5000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac") @@ -145,13 +152,7 @@ case "$FIRMWARE" in "ath9k-eeprom-pci-0000:00:11.0.bin") case $board in buffalo,wzr-600dhp|\ - buffalo,wzr-hp-ag300h|\ - netgear,wndr3700|\ - netgear,wndr3700-v2|\ - netgear,wndr3800|\ - netgear,wndr3800ch|\ - netgear,wndrmac-v1|\ - netgear,wndrmac-v2) + buffalo,wzr-hp-ag300h) caldata_extract "art" 0x1000 0xeb8 ;; dlink,dir-825-b1) @@ -169,13 +170,7 @@ case "$FIRMWARE" in "ath9k-eeprom-pci-0000:00:12.0.bin") case $board in buffalo,wzr-600dhp|\ - buffalo,wzr-hp-ag300h|\ - netgear,wndr3700|\ - netgear,wndr3700-v2|\ - netgear,wndr3800|\ - netgear,wndr3800ch|\ - netgear,wndrmac-v1|\ - netgear,wndrmac-v2) + buffalo,wzr-hp-ag300h) caldata_extract "art" 0x5000 0xeb8 ;; dlink,dir-825-b1) 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 index b0e30f4ee..b8e99a661 100644 --- 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 @@ -11,20 +11,20 @@ case "$FIRMWARE" in "ath10k/cal-pci-0000:00:00.0.bin") case $board in allnet,all-wap02860ac|\ + araknis,an-500-ap-i-ac|\ + araknis,an-700-ap-i-ac|\ engenius,eap1200h|\ engenius,enstationac-v1|\ glinet,gl-x750) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 2) ;; - avm,fritz1750e|\ - avm,fritzdvbc) - caldata_extract "urlader" 0x198a 0x844 - ;; + asus,rp-ac66|\ comfast,cf-wr650ac-v1|\ comfast,cf-wr650ac-v2|\ devolo,dlan-pro-1200plus-ac|\ devolo,magic-2-wifi|\ + joyit,jt-or750i|\ qxwlan,e1700ac-v2-8m|\ qxwlan,e1700ac-v2-16m|\ qxwlan,e600gac-v2-8m|\ @@ -39,6 +39,7 @@ case "$FIRMWARE" in ubnt,litebeam-ac-gen2|\ ubnt,nanobeam-ac|\ ubnt,nanobeam-ac-gen2|\ + ubnt,nanobeam-ac-xc|\ ubnt,nanostation-ac|\ ubnt,nanostation-ac-loco|\ ubnt,powerbeam-5ac-500|\ @@ -48,6 +49,10 @@ case "$FIRMWARE" in yuncore,a770) caldata_extract "art" 0x5000 0x844 ;; + avm,fritz1750e|\ + avm,fritzdvbc) + caldata_extract "urlader" 0x198a 0x844 + ;; devolo,dvl1200e|\ devolo,dvl1200i|\ devolo,dvl1750c|\ @@ -103,12 +108,9 @@ case "$FIRMWARE" in openmesh,a40|\ openmesh,a60|\ openmesh,mr1750-v1|\ - openmesh,mr1750-v2) - caldata_extract "ART" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) 16) - ;; + openmesh,mr1750-v2|\ openmesh,om5p-ac-v2) - caldata_extract "art" 0x5000 0x844 + caldata_extract "ART" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) 16) ;; qihoo,c301) @@ -125,9 +127,7 @@ case "$FIRMWARE" in ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1) ;; tplink,archer-c5-v1|\ - tplink,archer-c7-v2|\ - tplink,tl-wdr7500-v3|\ - tplink,tl-wdr7500-v3-16MB) + tplink,tl-wdr7500-v3) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x1fc00) -1) ;; @@ -140,6 +140,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfs 0xf100) 2) ;; + tplink,eap225-v1|\ tplink,eap245-v1|\ tplink,re450-v2|\ tplink,re450-v3|\ @@ -156,10 +157,6 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2) ;; - tplink,tl-wdr6500-v2) - caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) -2) - ;; tplink,tl-wpa8630-v1) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) 1) @@ -168,6 +165,10 @@ case "$FIRMWARE" in ;; "ath10k/cal-pci-0000:01:00.0.bin") case $board in + openmesh,om5p-ac-v1) + caldata_extract "ART" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) + ;; sitecom,wlr-8100) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1) @@ -233,12 +234,19 @@ case "$FIRMWARE" in tplink,archer-c60-v2|\ tplink,archer-c60-v3|\ tplink,archer-c6-v2|\ - tplink,archer-c6-v2-us) + tplink,archer-c6-v2-us|\ + tplink,tl-wa1201-v2) caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1) ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ;; + tplink,cpe710-v1) + caldata_extract "art" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_binary info 0x8) + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + ;; tplink,eap225-outdoor-v1|\ tplink,eap225-v3|\ tplink,eap225-wall-v2|\ 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 index ac8b59c53..a4f82c54e 100644 --- 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 @@ -28,6 +28,7 @@ case "$board" in ;; dlink,dap-2660-a1|\ dlink,dap-2680-a1|\ + dlink,dap-2695-a1|\ dlink,dap-3662-a1) [ "$PHYNBR" -eq 1 ] && \ mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 20041e4c9..953d6a96d 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -48,6 +48,9 @@ platform_do_upgrade() { redboot_fis_do_upgrade "$1" vmlinux_2 ;; allnet,all-wap02860ac|\ + araknis,an-300-ap-i-n|\ + araknis,an-500-ap-i-ac|\ + araknis,an-700-ap-i-ac|\ engenius,eap1200h|\ engenius,eap300-v2|\ engenius,eap600|\ @@ -73,6 +76,7 @@ platform_do_upgrade() { openmesh,mr900-v2|\ openmesh,mr1750-v1|\ openmesh,mr1750-v2|\ + openmesh,om2p-v1|\ openmesh,om2p-v2|\ openmesh,om2p-v4|\ openmesh,om2p-hs-v1|\ @@ -80,7 +84,10 @@ platform_do_upgrade() { openmesh,om2p-hs-v3|\ openmesh,om2p-hs-v4|\ openmesh,om2p-lc|\ - openmesh,om5p) + openmesh,om5p|\ + openmesh,om5p-ac-v1|\ + openmesh,om5p-ac-v2|\ + openmesh,om5p-an) PART_NAME="inactive" platform_do_upgrade_openmesh "$1" ;; diff --git a/target/linux/ath79/generic/target.mk b/target/linux/ath79/generic/target.mk index b16134cb7..af330b09b 100644 --- a/target/linux/ath79/generic/target.mk +++ b/target/linux/ath79/generic/target.mk @@ -1,6 +1,8 @@ BOARDNAME:=Generic -DEFAULT_PACKAGES += -ddns-scripts_aliyun -ddns-scripts_dnspod wpad-openssl +DEFAULT_PACKAGES += wpad-basic-wolfssl + +KERNEL_TESTING_PATCHVER:=5.15 define Target/Description Build firmware images for generic Atheros AR71xx/AR913x/AR934x based boards. diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index e47a22094..768ec5704 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -27,14 +27,17 @@ define Build/loader-common endef define Build/loader-kernel - $(call Build/loader-common,LOADER_DATA="$@") + $(call Build/loader-common, \ + LOADER_DATA="$@" \ + BOARD="$(DEVICE_NAME)" ) endef define Build/loader-okli-compile $(call Build/loader-common, \ FLASH_OFFS=$(LOADER_FLASH_OFFS) \ FLASH_MAX=$(LOADER_FLASH_MAX) \ - KERNEL_MAGIC=$(LOADER_KERNEL_MAGIC) ) + KERNEL_MAGIC=$(LOADER_KERNEL_MAGIC) \ + BOARD="$(DEVICE_NAME)" ) endef # Arguments: @@ -65,16 +68,6 @@ define Build/relocate-kernel rm -rf $@.relocate endef -define Build/append-okli-kernel - dd if="$(KDIR)/loader-$(word 1,$(1)).uImage" >> "$@" -endef - -define Build/prepad-okli-kernel - -[ -f "$@" ] && \ - dd if="$(KDIR)/loader-$(word 1,$(1)).uImage" of="$@".tmp bs=64k conv=sync && \ - cat "$@" >>"$@".tmp && \ - mv "$@".tmp "$@" -endef define Device/Default DEVICE_DTS_DIR := ../dts @@ -94,6 +87,14 @@ define Device/Default append-rootfs | pad-rootfs | check-size | append-metadata endef +define Device/loader-okli-uimage + LOADER_TYPE := bin + 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 +endef + include $(SUBTARGET).mk ifeq ($(SUBTARGET),generic) diff --git a/target/linux/ath79/image/common-senao.mk b/target/linux/ath79/image/common-senao.mk index 6784cf9aa..dda7da677 100644 --- a/target/linux/ath79/image/common-senao.mk +++ b/target/linux/ath79/image/common-senao.mk @@ -1,6 +1,6 @@ DEVICE_VARS += SENAO_IMGNAME -# This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to +# This needs to make OEM config archive 'sysupgrade.tgz' an empty file prior to OEM # sysupgrade, as otherwise it will implant the old configuration from # OEM firmware when writing rootfs from factory.bin # rootfs size and checksum is taken from a squashfs header @@ -9,7 +9,9 @@ define Build/senao-tar-gz -[ -f "$@" ] && \ mkdir -p $@.tmp && \ touch $@.tmp/failsafe.bin && \ + touch $@.tmp/FWINFO-$(word 1,$(1))-$(REVISION) && \ echo '#!/bin/sh' > $@.tmp/before-upgrade.sh && \ + echo ': > /tmp/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ echo ': > /tmp/_sys/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ echo -n $$(( $$(cat $@ | wc -c) / 4096 * 4096 )) > $@.len && \ dd if=$@ bs=$$(cat $@.len) count=1 | md5sum - | cut -d ' ' -f 1 > $@.md5 && \ @@ -26,13 +28,9 @@ define Build/senao-tar-gz endef define Device/senao_loader_okli + $(Device/loader-okli-uimage) KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x73714f4b LOADER_KERNEL_MAGIC := 0x73714f4b - LOADER_TYPE := bin - 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 IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ check-size | senao-tar-gz $$$$(SENAO_IMGNAME) diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 12f8fdea3..37a0fcc16 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -9,10 +9,21 @@ define Device/tplink_archer-a7-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 endef TARGET_DEVICES += tplink_archer-a7-v5 +define Device/tplink_archer-a9-v6 + $(Device/tplink-safeloader-uimage) + SOC := qcn5502 + IMAGE_SIZE := 15360k + DEVICE_MODEL := Archer A9 + DEVICE_VARIANT := v6 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct \ + ath10k-firmware-qca9984-ct + TPLINK_BOARD_ID := ARCHER-A9-V6 +endef +TARGET_DEVICES += tplink_archer-a9-v6 + define Device/tplink_archer-c2-v3 $(Device/tplink-safeloader-uimage) SOC := qca9563 @@ -181,7 +192,6 @@ define Device/tplink_archer-c7-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 endef TARGET_DEVICES += tplink_archer-c7-v4 @@ -195,7 +205,6 @@ define Device/tplink_archer-c7-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 @@ -207,7 +216,6 @@ define Device/tplink_archer-d50-v1 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport \ kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct - BOARDNAME := ARCHER-D50-V1 IMAGE_SIZE := 7808k TPLINK_HWID := 0xC1200001 TPLINK_HWREV := 0x00000046 @@ -362,6 +370,17 @@ define Device/tplink_cpe610-v2 endef TARGET_DEVICES += tplink_cpe610-v2 +define Device/tplink_cpe710-v1 + $(Device/tplink-safeloader-uimage) + SOC := qca9563 + IMAGE_SIZE := 15680k + DEVICE_MODEL := CPE710 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct + TPLINK_BOARD_ID := CPE710V1 +endef +TARGET_DEVICES += tplink_cpe710-v1 + define Device/tplink-eap2x5 $(Device/tplink-safeloader) LOADER_TYPE := elf @@ -382,6 +401,17 @@ define Device/tplink_eap225-outdoor-v1 endef TARGET_DEVICES += tplink_eap225-outdoor-v1 +define Device/tplink_eap225-v1 + $(Device/tplink-eap2x5) + SOC := qca9563 + IMAGE_SIZE := 13824k + DEVICE_MODEL := EAP225 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + TPLINK_BOARD_ID := EAP225-V1 +endef +TARGET_DEVICES += tplink_eap225-v1 + define Device/tplink_eap225-v3 $(Device/tplink-eap2x5) SOC := qca9563 @@ -510,6 +540,17 @@ define Device/tplink_tl-mr6400-v1 endef TARGET_DEVICES += tplink_tl-mr6400-v1 +define Device/tplink_tl-wa1201-v2 + $(Device/tplink-safeloader-uimage) + SOC := qca9563 + IMAGE_SIZE := 13184k + DEVICE_MODEL := TL-WA1201 + DEVICE_VARIANT := v2 + TPLINK_BOARD_ID := TL-WA1201-V2 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct +endef +TARGET_DEVICES += tplink_tl-wa1201-v2 + define Device/tplink_tl-wdr3500-v1 $(Device/tplink-8mlzma) SOC := ar9344 @@ -588,33 +629,6 @@ define Device/tplink_tl-wdr7500-v3 endef TARGET_DEVICES += tplink_tl-wdr7500-v3 -define Device/tplink_tl-wdr7500-v3-16MB - $(Device/tplink-16mlzma) - SOC := qca9558 - DEVICE_MODEL := TL-WDR7500 - DEVICE_VARIANT := v3(16MB) - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct \ - ath10k-firmware-qca988x-ct - TPLINK_HWID := 0x75000003 - SUPPORTED_DEVICES += archer-c7 -endef -TARGET_DEVICES += tplink_tl-wdr7500-v3-16MB - -define Device/tplink_tl-wdr6500-v2 - $(Device/tplink-8mlzma) - SOC := qca9561 - DEVICE_MODEL := TL-WDR6500 - DEVICE_VARIANT := v2 - DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct - IMAGE_SIZE := 8000k - KERNEL := kernel-bin | append-dtb | lzma | uImage lzma - KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma | tplink-v1-header - TPLINK_HWID := 0x65000002 - TPLINK_HEADER_VERSION := 2 - SUPPORTED_DEVICES += tl-wdr6500-v2 -endef -TARGET_DEVICES += tplink_tl-wdr6500-v2 - define Device/tplink_tl-wpa8630-v1 $(Device/tplink-8mlzma) SOC := qca9563 @@ -697,6 +711,7 @@ define Device/tplink_tl-wr1043nd-v4 DEVICE_VARIANT := v4 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x10430004 + TPLINK_HWREV := 0x1 TPLINK_BOARD_ID := TLWR1043NDV4 SUPPORTED_DEVICES += tl-wr1043nd-v4 endef @@ -781,6 +796,15 @@ define Device/tplink_tl-wr810n-v2 endef TARGET_DEVICES += tplink_tl-wr810n-v2 +define Device/tplink_tl-wr841hp-v2 + $(Device/tplink-8mlzma) + SOC := ar9344 + DEVICE_MODEL := TL-WR841HP + DEVICE_VARIANT := v2 + TPLINK_HWID := 0x08411002 +endef +TARGET_DEVICES += tplink_tl-wr841hp-v2 + define Device/tplink_tl-wr841hp-v3 $(Device/tplink-8mlzma) SOC := qca9533 diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 01e8533fd..0b613df62 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -103,6 +103,7 @@ define Device/ubnt-xm IMAGE_SIZE := 7448k UBNT_BOARD := XM UBNT_CHIP := ar7240 + UBNT_REVISION := 42.$(UBNT_REVISION) UBNT_TYPE := XM UBNT_VERSION := 6.0.0 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma @@ -245,6 +246,15 @@ define Device/ubnt_nanobeam-ac-gen2 endef TARGET_DEVICES += ubnt_nanobeam-ac-gen2 +define Device/ubnt_nanobeam-ac-xc + $(Device/ubnt-xc) + SOC := qca9558 + DEVICE_MODEL := NanoBeam AC + DEVICE_VARIANT := Gen1 (XC) + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct rssileds +endef +TARGET_DEVICES += ubnt_nanobeam-ac-xc + define Device/ubnt_nanobridge-m $(Device/ubnt-xm) SOC := ar7241 @@ -328,13 +338,21 @@ define Device/ubnt_powerbeam-5ac-gen2 endef TARGET_DEVICES += ubnt_powerbeam-5ac-gen2 -define Device/ubnt_powerbeam-m-xw +define Device/ubnt_powerbeam-m2-xw $(Device/ubnt-xw) - DEVICE_MODEL := PowerBeam M + DEVICE_MODEL := PowerBeam M2 DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += loco-m-xw endef -TARGET_DEVICES += ubnt_powerbeam-m-xw +TARGET_DEVICES += ubnt_powerbeam-m2-xw + +define Device/ubnt_powerbeam-m5-xw + $(Device/ubnt-xw) + DEVICE_MODEL := PowerBeam M5 + DEVICE_PACKAGES += rssileds + SUPPORTED_DEVICES += loco-m-xw +endef +TARGET_DEVICES += ubnt_powerbeam-m5-xw define Device/ubnt_powerbridge-m $(Device/ubnt-xm) @@ -401,7 +419,7 @@ TARGET_DEVICES += ubnt_routerstation-pro define Device/ubnt_unifi $(Device/ubnt-bz) - DEVICE_MODEL := UniFi + DEVICE_MODEL := UniFi AP SUPPORTED_DEVICES += unifi endef TARGET_DEVICES += ubnt_unifi diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 86ca26737..769c0ee1d 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -298,6 +298,16 @@ define Device/alfa-network_r36a endef TARGET_DEVICES += alfa-network_r36a +define Device/alfa-network_tube-2hq + SOC := qca9531 + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := Tube-2HQ + DEVICE_PACKAGES := rssileds -swconfig + IMAGE_SIZE := 15872k + SUPPORTED_DEVICES += tube-2hq +endef +TARGET_DEVICES += alfa-network_tube-2hq + define Device/allnet_all-wap02860ac $(Device/senao_loader_okli) SOC := qca9558 @@ -310,6 +320,41 @@ define Device/allnet_all-wap02860ac endef TARGET_DEVICES += allnet_all-wap02860ac +define Device/araknis_an-300-ap-i-n + $(Device/senao_loader_okli) + SOC := ar9344 + DEVICE_VENDOR := Araknis + DEVICE_MODEL := AN-300-AP-I-N + IMAGE_SIZE := 12096k + LOADER_FLASH_OFFS := 0x220000 + SENAO_IMGNAME := senao-an300 +endef +TARGET_DEVICES += araknis_an-300-ap-i-n + +define Device/araknis_an-500-ap-i-ac + $(Device/senao_loader_okli) + SOC := qca9557 + DEVICE_VENDOR := Araknis + DEVICE_MODEL := AN-500-AP-I-AC + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + IMAGE_SIZE := 11584k + LOADER_FLASH_OFFS := 0x220000 + SENAO_IMGNAME := senao-generic-v1-an500 +endef +TARGET_DEVICES += araknis_an-500-ap-i-ac + +define Device/araknis_an-700-ap-i-ac + $(Device/senao_loader_okli) + SOC := qca9558 + DEVICE_VENDOR := Araknis + DEVICE_MODEL := AN-700-AP-I-AC + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + IMAGE_SIZE := 11584k + LOADER_FLASH_OFFS := 0x220000 + SENAO_IMGNAME := senao-generic-v1-an700 +endef +TARGET_DEVICES += araknis_an-700-ap-i-ac + define Device/arduino_yun SOC := ar9331 DEVICE_VENDOR := Arduino @@ -330,6 +375,36 @@ define Device/aruba_ap-105 endef TARGET_DEVICES += aruba_ap-105 +define Device/asus_rp-ac66 + SOC := qca9563 + DEVICE_VENDOR := ASUS + DEVICE_MODEL := RP-AC66 + IMAGE_SIZE := 16000k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs + DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct \ + rssileds -swconfig +endef +TARGET_DEVICES += asus_rp-ac66 + +define Device/atheros_db120 + $(Device/loader-okli-uimage) + SOC := ar9344 + DEVICE_VENDOR := Atheros + DEVICE_MODEL := DB120 + DEVICE_PACKAGES := kmod-usb2 + IMAGE_SIZE := 7808k + SUPPORTED_DEVICES += db120 + LOADER_FLASH_OFFS := 0x50000 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | pad-to 6336k | \ + append-loader-okli-uimage $(1) | pad-to 64k +endef +TARGET_DEVICES += atheros_db120 + define Device/avm DEVICE_VENDOR := AVM KERNEL := kernel-bin | append-dtb | lzma | eva-image @@ -389,17 +464,13 @@ endef TARGET_DEVICES += avm_fritzdvbc define Device/belkin_f9x-v2 + $(Device/loader-okli-uimage) SOC := qca9558 DEVICE_VENDOR := Belkin IMAGE_SIZE := 14464k DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 \ kmod-usb3 kmod-usb-ledtrig-usbport - LOADER_TYPE := bin LOADER_FLASH_OFFS := 0x50000 - 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 := append-kernel | pad-to $$$$(BLOCKSIZE) | \ @@ -470,7 +541,7 @@ define Device/buffalo_wzr-hp-g300nh SOC := ar9132 BUFFALO_PRODUCT := WZR-HP-G300NH BUFFALO_HWVER := 1 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-gpio-nxp-74hc153 + DEVICE_PACKAGES := kmod-gpio-cascade kmod-mux-gpio kmod-usb2 kmod-usb-ledtrig-usbport BLOCKSIZE := 128k IMAGE_SIZE := 32128k SUPPORTED_DEVICES += wzr-hp-g300nh @@ -661,6 +732,20 @@ define Device/compex_wpj531-16m endef TARGET_DEVICES += compex_wpj531-16m +define Device/compex_wpj558-16m + SOC := qca9558 + IMAGE_SIZE := 16128k + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPJ558 + DEVICE_VARIANT := 16M + SUPPORTED_DEVICES += wpj558 + IMAGES += cpximg-6a07.bin + IMAGE/cpximg-6a07.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | mkmylofw_16m 0x691 3 + DEVICE_PACKAGES := kmod-gpio-beeper +endef +TARGET_DEVICES += compex_wpj558-16m + define Device/compex_wpj563 SOC := qca9563 DEVICE_PACKAGES := kmod-usb2 kmod-usb3 @@ -818,20 +903,13 @@ endef TARGET_DEVICES += dlink_dap-2680-a1 define Device/dlink_dap-2695-a1 + $(Device/dlink_dap-2xxx) SOC := qca9558 - DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct DEVICE_VENDOR := D-Link - DEVICE_MODEL := DAP-2965 + DEVICE_MODEL := DAP-2695 DEVICE_VARIANT := A1 - IMAGES := factory.img sysupgrade.bin + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct IMAGE_SIZE := 15360k - IMAGE/default := append-kernel | pad-offset 65536 160 - IMAGE/factory.img := $$(IMAGE/default) | append-rootfs | wrgg-pad-rootfs | \ - mkwrggimg | check-size - IMAGE/sysupgrade.bin := $$(IMAGE/default) | mkwrggimg | append-rootfs | \ - wrgg-pad-rootfs | check-size | append-metadata - KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma - KERNEL_INITRAMFS := $$(KERNEL) | mkwrggimg DAP_SIGNATURE := wapac02_dkbs_dap2695 SUPPORTED_DEVICES += dap-2695-a1 endef @@ -879,7 +957,7 @@ define Device/dlink_dir-505 DEVICE_VENDOR := D-Link DEVICE_MODEL := DIR-505 IMAGE_SIZE := 7680k - DEVICE_PACKAGES := kmod-usb2 + DEVICE_PACKAGES := kmod-usb-chipidea2 SUPPORTED_DEVICES += dir-505-a1 endef TARGET_DEVICES += dlink_dir-505 @@ -1008,6 +1086,15 @@ define Device/elecom_wrc-300ghbk2-i endef TARGET_DEVICES += elecom_wrc-300ghbk2-i +define Device/embeddedwireless_balin + SOC := ar9344 + DEVICE_VENDOR := Embedded Wireless + DEVICE_MODEL := Balin + DEVICE_PACKAGES := kmod-usb-chipidea2 + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += embeddedwireless_balin + define Device/embeddedwireless_dorin SOC := ar9331 DEVICE_VENDOR := Embedded Wireless @@ -1162,7 +1249,7 @@ define Device/glinet_6408 SOC := ar9331 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := 6408 - DEVICE_PACKAGES := kmod-usb2 + DEVICE_PACKAGES := kmod-usb-chipidea2 IMAGE_SIZE := 8000k TPLINK_HWID := 0x08000001 IMAGES := sysupgrade.bin @@ -1175,7 +1262,7 @@ define Device/glinet_6416 SOC := ar9331 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := 6416 - DEVICE_PACKAGES := kmod-usb2 + DEVICE_PACKAGES := kmod-usb-chipidea2 IMAGE_SIZE := 16192k TPLINK_HWID := 0x08000001 IMAGES := sysupgrade.bin @@ -1243,6 +1330,15 @@ define Device/glinet_gl-usb150 endef TARGET_DEVICES += glinet_gl-usb150 +define Device/glinet_gl-x300b + SOC := qca9531 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-X300B + DEVICE_PACKAGES := kmod-usb2 + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += glinet_gl-x300b + define Device/glinet_gl-x750 SOC := qca9531 DEVICE_VENDOR := GL.iNet @@ -1369,6 +1465,38 @@ define Device/jjplus_ja76pf2 endef TARGET_DEVICES += jjplus_ja76pf2 +define Device/jjplus_jwap230 + SOC := qca9558 + DEVICE_VENDOR := jjPlus + DEVICE_MODEL := JWAP230 + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += jjplus_jwap230 + +define Device/joyit_jt-or750i + SOC := qca9531 + DEVICE_VENDOR := Joy-IT + DEVICE_MODEL := JT-OR750i + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += joyit_jt-or750i + +define Device/letv_lba-047-ch + $(Device/loader-okli-uimage) + SOC := qca9531 + DEVICE_VENDOR := Letv + DEVICE_MODEL := LBA-047-CH + IMAGE_SIZE := 15936k + LOADER_FLASH_OFFS := 0x50000 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | pad-to 14528k | \ + append-loader-okli-uimage $(1) | pad-to 64k +endef +TARGET_DEVICES += letv_lba-047-ch + define Device/librerouter_librerouter-v1 SOC := qca9558 DEVICE_VENDOR := Librerouter @@ -1497,6 +1625,23 @@ define Device/netgear_ex7300 endef TARGET_DEVICES += netgear_ex7300 +define Device/netgear_ex7300-v2 + $(Device/netgear_generic) + SOC := qcn5502 + DEVICE_MODEL := EX7300 + DEVICE_VARIANT := v2 + UIMAGE_MAGIC := 0x27051956 + NETGEAR_BOARD_ID := EX7300v2series + NETGEAR_HW_ID := 29765907+16+0+128 + IMAGE_SIZE := 14528k + IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \ + netgear-rootfs | pad-rootfs + IMAGE/sysupgrade.bin := $$(IMAGE/default) | check-size | append-metadata + IMAGE/factory.img := $$(IMAGE/default) | check-size | netgear-dni + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9984-ct +endef +TARGET_DEVICES += netgear_ex7300-v2 + define Device/netgear_wndr3x00 $(Device/netgear_generic) SOC := ar7161 @@ -1635,11 +1780,23 @@ define Device/ocedo_ursus endef TARGET_DEVICES += ocedo_ursus +define Device/onion_omega + $(Device/tplink-16mlzma) + SOC := ar9331 + DEVICE_VENDOR := Onion + DEVICE_MODEL := Omega + DEVICE_PACKAGES := kmod-usb-chipidea2 + SUPPORTED_DEVICES += onion-omega + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma + IMAGE_SIZE := 16192k + TPLINK_HWID := 0x04700001 +endef +TARGET_DEVICES += onion_omega + define Device/openmesh_common_64k DEVICE_VENDOR := OpenMesh DEVICE_PACKAGES := uboot-envtools IMAGE_SIZE := 7808k - BLOCKSIZE := 64k OPENMESH_CE_TYPE := KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \ pad-to $$(BLOCKSIZE) @@ -1741,6 +1898,16 @@ define Device/openmesh_mr1750-v2 endef TARGET_DEVICES += openmesh_mr1750-v2 +define Device/openmesh_om2p-v1 + $(Device/openmesh_common_256k) + SOC := ar7240 + DEVICE_MODEL := OM2P + DEVICE_VARIANT := v1 + OPENMESH_CE_TYPE := OM2P + SUPPORTED_DEVICES += om2p +endef +TARGET_DEVICES += openmesh_om2p-v1 + define Device/openmesh_om2p-v2 $(Device/openmesh_common_256k) SOC := ar9330 @@ -1819,17 +1986,37 @@ define Device/openmesh_om5p endef TARGET_DEVICES += openmesh_om5p -define Device/openmesh_om5p-ac-v2 +define Device/openmesh_om5p-ac-v1 + $(Device/openmesh_common_64k) + SOC := qca9558 + DEVICE_MODEL := OM5P-AC + DEVICE_VARIANT := v1 + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + OPENMESH_CE_TYPE := OM5PAC + SUPPORTED_DEVICES += om5p-ac +endef +TARGET_DEVICES += openmesh_om5p-ac-v1 + +define Device/openmesh_om5p-ac-v2 + $(Device/openmesh_common_64k) 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 + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + OPENMESH_CE_TYPE := OM5PAC SUPPORTED_DEVICES += om5p-acv2 endef TARGET_DEVICES += openmesh_om5p-ac-v2 +define Device/openmesh_om5p-an + $(Device/openmesh_common_64k) + SOC := ar9344 + DEVICE_MODEL := OM5P-AN + OPENMESH_CE_TYPE := OM5P + SUPPORTED_DEVICES += om5p-an +endef +TARGET_DEVICES += openmesh_om5p-an + define Device/pcs_cap324 SOC := ar9344 DEVICE_VENDOR := PowerCloud Systems @@ -1880,17 +2067,13 @@ endef TARGET_DEVICES += pisen_ts-d084 define Device/pisen_wmb001n + $(Device/loader-okli-uimage) SOC := ar9341 DEVICE_VENDOR := PISEN DEVICE_MODEL := WMB001N IMAGE_SIZE := 14080k DEVICE_PACKAGES := 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) @@ -1907,22 +2090,11 @@ define Device/pisen_wmm003n endef TARGET_DEVICES += pisen_wmm003n -define Device/pisen_wpr003n - $(Device/tplink-16mlzma) - SOC := ar9341 - DEVICE_VENDOR := PISEN - DEVICE_MODEL := WPR003N - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - TPLINK_HWID := 0x08410008 -endef -TARGET_DEVICES += pisen_wpr003n - define Device/plasmacloud_pa300-common SOC := qca9533 DEVICE_VENDOR := Plasma Cloud DEVICE_PACKAGES := uboot-envtools IMAGE_SIZE := 7168k - BLOCKSIZE := 64k IMAGES += factory.bin KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-to $$(BLOCKSIZE) IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA300 @@ -1942,18 +2114,14 @@ endef TARGET_DEVICES += plasmacloud_pa300e define Device/qca_ap143 + $(Device/loader-okli-uimage) SOC := qca9533 DEVICE_VENDOR := Qualcomm Atheros DEVICE_MODEL := AP143 DEVICE_PACKAGES := kmod-usb2 SUPPORTED_DEVICES += ap143 - LOADER_TYPE := bin LOADER_FLASH_OFFS := 0x50000 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 - 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 endef define Device/qca_ap143-8m @@ -2273,6 +2441,18 @@ define Device/wallys_dr531 endef TARGET_DEVICES += wallys_dr531 +define Device/wd_mynet-n600 + $(Device/seama) + SOC := ar9344 + DEVICE_VENDOR := Western Digital + DEVICE_MODEL := My Net N600 + IMAGE_SIZE := 15872k + DEVICE_PACKAGES := kmod-usb2 + SEAMA_SIGNATURE := wrgnd16_wd_db600 + SUPPORTED_DEVICES += mynet-n600 +endef +TARGET_DEVICES += wd_mynet-n600 + define Device/wd_mynet-n750 $(Device/seama) SOC := ar9344 diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index 4256f7737..dccb05e45 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -22,7 +22,8 @@ define Device/mikrotik_routerboard-921gs-5hpacd-15s $(Device/mikrotik_nand) SOC := qca9558 DEVICE_MODEL := RouterBOARD 921GS-5HPacD-15s (mANTBox 15s) - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-i2c-gpio \ + kmod-sfp SUPPORTED_DEVICES += rb-921gs-5hpacd-r2 endef TARGET_DEVICES += mikrotik_routerboard-921gs-5hpacd-15s @@ -45,6 +46,23 @@ define Device/mikrotik_routerboard-lhg-2nd endef TARGET_DEVICES += mikrotik_routerboard-lhg-2nd +define Device/mikrotik_routerboard-lhg-5nd + $(Device/mikrotik_nor) + SOC := ar9344 + DEVICE_MODEL := RouterBOARD LHG 5nD (LHG 5) + DEVICE_PACKAGES += rssileds + IMAGE_SIZE := 16256k +endef +TARGET_DEVICES += mikrotik_routerboard-lhg-5nd + +define Device/mikrotik_routerboard-mapl-2nd + $(Device/mikrotik_nor) + SOC := qca9533 + DEVICE_MODEL := RouterBOARD mAPL-2nD (mAP lite) + IMAGE_SIZE := 16256k +endef +TARGET_DEVICES += mikrotik_routerboard-mapl-2nd + define Device/mikrotik_routerboard-sxt-5nd-r2 $(Device/mikrotik_nand) SOC := ar9344 @@ -68,7 +86,7 @@ define Device/mikrotik_routerboard-wapr-2nd $(Device/mikrotik_nor) SOC := qca9533 DEVICE_MODEL := RouterBOARD wAPR-2nD (wAP R) - DEVICE_PACKAGES += rssileds + DEVICE_PACKAGES += kmod-usb2 rssileds IMAGE_SIZE := 16256k endef TARGET_DEVICES += mikrotik_routerboard-wapr-2nd diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 1bae2eb4c..192d83f4a 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -1,13 +1,25 @@ +define Build/dongwon-header + head -c 4 $@ > $@.tmp + head -c 8 /dev/zero >> $@.tmp + tail -c +9 $@ >> $@.tmp + ( \ + header_crc="$$(head -c 68 $@.tmp | gzip -c | \ + tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n')"; \ + printf "$$(echo $$header_crc | sed 's/../\\x&/g')" | \ + dd of=$@.tmp bs=4 count=1 seek=1 conv=notrunc \ + ) + mv $@.tmp $@ +endef + # 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 + mkdir -p $@.tmp/boot + cp $@ $@.tmp/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 + -d $@.tmp + rm -rf $@.tmp endef define Build/zyxel-factory @@ -96,24 +108,40 @@ define Device/domywifi_dw33d endef TARGET_DEVICES += domywifi_dw33d -define Device/domywifi_dw33d-nor - $(Device/domywifi_dw33d) - DEVICE_VARIANT := NOR - IMAGE_SIZE := 14464k - BLOCKSIZE := 64k - LOADER_TYPE := bin - LOADER_FLASH_OFFS := 0x60000 - 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 := sysupgrade.bin breed-factory.bin - IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ - append-metadata | check-size - IMAGE/breed-factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ - prepad-okli-kernel $(1) | pad-to 14528k | append-okli-kernel $(1) +define Device/dongwon_dw02-412h + SOC := qca9557 + DEVICE_VENDOR := Dongwon T&I + DEVICE_MODEL := DW02-412H + DEVICE_ALT0_VENDOR := KT + DEVICE_ALT0_MODEL := GiGA WiFi home + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct + KERNEL_SIZE := 8192k + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL := $$(KERNEL) | dongwon-header + KERNEL_INITRAMFS := $$(KERNEL) + UBINIZE_OPTS := -E 5 + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ + check-size + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef -TARGET_DEVICES += domywifi_dw33d-nor + +define Device/dongwon_dw02-412h-64m + $(Device/dongwon_dw02-412h) + DEVICE_VARIANT := (64M) + DEVICE_ALT0_VARIANT := (64M) + IMAGE_SIZE := 49152k +endef +TARGET_DEVICES += dongwon_dw02-412h-64m + +define Device/dongwon_dw02-412h-128m + $(Device/dongwon_dw02-412h) + DEVICE_VARIANT := (128M) + DEVICE_ALT0_VARIANT := (128M) + IMAGE_SIZE := 114688k +endef +TARGET_DEVICES += dongwon_dw02-412h-128m define Device/glinet_gl-ar300m-common-nand SOC := qca9531 @@ -140,7 +168,6 @@ 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 @@ -166,7 +193,6 @@ 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 @@ -188,6 +214,22 @@ define Device/glinet_gl-e750 endef TARGET_DEVICES += glinet_gl-e750 +define Device/glinet_gl-xe300 + SOC := qca9531 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-XE300 + DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 131072k + PAGESIZE := 2048 + VID_HDR_OFFSET := 2048 + BLOCKSIZE := 128k + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += glinet_gl-xe300 + # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff) define Device/netgear_ath79_nand DEVICE_VENDOR := NETGEAR @@ -208,6 +250,17 @@ define Device/netgear_ath79_nand UBINIZE_OPTS := -E 5 endef +define Device/netgear_r6100 + SOC := ar9344 + DEVICE_MODEL := R6100 + UIMAGE_MAGIC := 0x36303030 + NETGEAR_BOARD_ID := R6100 + NETGEAR_HW_ID := 29764434+0+128+128+2x2+2x2 + $(Device/netgear_ath79_nand) + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct +endef +TARGET_DEVICES += netgear_r6100 + define Device/netgear_wndr3700-v4 SOC := ar9344 DEVICE_MODEL := WNDR3700 @@ -271,6 +324,39 @@ define Device/netgear_wndr4500-v3 endef TARGET_DEVICES += netgear_wndr4500-v3 +define Device/zte_mf286_common + SOC := qca9563 + DEVICE_VENDOR := ZTE + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/zte_mf286 + $(Device/zte_mf286_common) + DEVICE_MODEL := MF286 + DEVICE_PACKAGES += ath10k-firmware-qca988x-ct kmod-usb-net-qmi-wwan \ + kmod-usb-serial-option uqmi +endef +TARGET_DEVICES += zte_mf286 + +define Device/zte_mf286a + $(Device/zte_mf286_common) + DEVICE_MODEL := MF286A + DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-qmi-wwan \ + kmod-usb-serial-option uqmi +endef +TARGET_DEVICES += zte_mf286a + +define Device/zte_mf286r + $(Device/zte_mf286_common) + DEVICE_MODEL := MF286R + DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-rndis kmod-usb-acm +endef +TARGET_DEVICES += zte_mf286r + define Device/zyxel_nbg6716 SOC := qca9558 DEVICE_VENDOR := ZyXEL @@ -283,8 +369,9 @@ define Device/zyxel_nbg6716 KERNEL_SIZE := 4096k BLOCKSIZE := 128k PAGESIZE := 2048 - KERNEL := kernel-bin | append-dtb | uImage none | zyxel-buildkerneljffs | \ - check-size 4096k + LOADER_TYPE := bin + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | 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 @@ -293,6 +380,12 @@ define Device/zyxel_nbg6716 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ zyxel-factory UBINIZE_OPTS := -E 5 - DEFAULT := n endef TARGET_DEVICES += zyxel_nbg6716 + +define Device/zyxel_emg2926_q10a + $(Device/zyxel_nbg6716) + DEVICE_MODEL := EMG2926-Q10A + RAS_BOARD := AAVK-EMG2926Q10A +endef +TARGET_DEVICES += zyxel_emg2926_q10a diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index f4a03e284..0f355ef91 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -73,7 +73,7 @@ define Device/pqi_air-pen SOC := ar9330 DEVICE_VENDOR := PQI DEVICE_MODEL := Air-Pen - DEVICE_PACKAGES := kmod-usb2 + DEVICE_PACKAGES := kmod-usb-chipidea2 IMAGE_SIZE := 7680k SUPPORTED_DEVICES += pqi-air-pen endef diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds index 39e527e82..ecc47e07c 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds @@ -6,9 +6,19 @@ board_config_update board=$(board_name) case "$board" in -mikrotik,routerboard-lhg-2nd) +mikrotik,routerboard-lhg-2nd|\ +mikrotik,routerboard-mapl-2nd) ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" ;; +mikrotik,routerboard-lhg-5nd) + ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumlow" "rssimediumlow" "green:rssimediumlow" "wlan0" "20" "100" + ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "40" "100" + ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "60" "100" + ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "80" "100" + ;; mikrotik,routerboard-wapr-2nd) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100" diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index d4a32c1e1..cc4121f93 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -15,8 +15,9 @@ ath79_setup_interfaces() "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ;; mikrotik,routerboard-912uag-2hpnd|\ - mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-lhg-2nd|\ + mikrotik,routerboard-lhg-5nd|\ + mikrotik,routerboard-mapl-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wap-g-5hact2hnd|\ mikrotik,routerboard-wapr-2nd) @@ -38,14 +39,16 @@ ath79_setup_macs() case "$board" in mikrotik,routerboard-912uag-2hpnd|\ - mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-lhg-2nd|\ + mikrotik,routerboard-lhg-5nd|\ + mikrotik,routerboard-mapl-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wap-g-5hact2hnd|\ mikrotik,routerboard-wapr-2nd) label_mac="$mac_base" lan_mac="$mac_base" ;; + mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-922uags-5hpacd) label_mac="$mac_base" lan_mac="$mac_base" diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 78aa35dc6..8b1b5f04d 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -25,10 +25,12 @@ case "$FIRMWARE" in case $board in mikrotik,routerboard-912uag-2hpnd|\ mikrotik,routerboard-lhg-2nd|\ + mikrotik,routerboard-lhg-5nd|\ mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wapr-2nd) caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 1) ;; + mikrotik,routerboard-mapl-2nd|\ mikrotik,routerboard-wap-g-5hact2hnd) caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 2) ;; diff --git a/target/linux/ath79/mikrotik/config-default b/target/linux/ath79/mikrotik/config-default index efea74a23..2ff8a14f1 100644 --- a/target/linux/ath79/mikrotik/config-default +++ b/target/linux/ath79/mikrotik/config-default @@ -1,6 +1,7 @@ CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_GPIO_LATCH=y +CONFIG_GPIO_RB91X_KEY=y CONFIG_GPIO_RB4XX=y CONFIG_GPIO_WATCHDOG=y CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y @@ -19,7 +20,7 @@ CONFIG_MTD_NAND_RB91X=y CONFIG_MTD_RAW_NAND=y CONFIG_MTD_ROUTERBOOT_PARTS=y CONFIG_MTD_SPI_NAND=y -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y CONFIG_MTD_SPLIT_MINOR_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BLOCK=y diff --git a/target/linux/ath79/mikrotik/target.mk b/target/linux/ath79/mikrotik/target.mk index 68e9af780..f5df90448 100644 --- a/target/linux/ath79/mikrotik/target.mk +++ b/target/linux/ath79/mikrotik/target.mk @@ -3,7 +3,7 @@ FEATURES += minor nand KERNELNAME := vmlinux vmlinuz IMAGES_DIR := ../../.. -DEFAULT_PACKAGES += wpad-openssl +DEFAULT_PACKAGES += wpad-basic-wolfssl define Target/Description Build firmware images for MikroTik devices based on Qualcomm Atheros 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 index fc7455476..e49329845 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds @@ -6,10 +6,21 @@ board_config_update board=$(board_name) case "$board" in +dongwon,dw02-412h-64m|\ +dongwon,dw02-412h-128m) + ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x02" + ;; glinet,gl-ar300m-nand|\ glinet,gl-ar300m-nor) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" ;; +glinet,gl-xe300) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" + ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10" + ;; +netgear,r6100) + ucidef_set_led_netdev "wan-green" "WAN (green)" "green:wan" "eth1" + ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ netgear,wndr4300sw|\ 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 index 1d08d35b9..5b4d31fa8 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -11,28 +11,52 @@ ath79_setup_interfaces() glinet,gl-e750) ucidef_set_interface_lan "eth0" ;; - domywifi,dw33d-nor|\ domywifi,dw33d) ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" ;; + dongwon,dw02-412h-64m|\ + dongwon,dw02-412h-128m) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan" + ;; glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:2" "3:lan:1" "1:wan" ;; + glinet,gl-xe300) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "4:lan" + ;; + netgear,r6100) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" + ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ netgear,wndr4300sw|\ - netgear,wndr4300-v2|\ - netgear,wndr4500-v3) + netgear,wndr4300-v2) ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" ;; + netgear,wndr4500-v3) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" + ;; netgear,wndr4300tn) ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" ;; + zte,mf286|\ + zte,mf286a|\ + zte,mf286r) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "5:lan:1" + ;; + zyxel,emg2926-q10a|\ arris,sbr-ac1750|\ zyxel,nbg6716) ucidef_add_switch "switch0" \ @@ -49,6 +73,11 @@ ath79_setup_macs() local board="$1" case "$board" in + dongwon,dw02-412h-64m|\ + dongwon,dw02-412h-128m) + wan_mac=$(mtd_get_mac_binary art 0x0) + label_mac=$wan_mac + ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ netgear,wndr4300sw|\ 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 index 1ae873c1e..ed0c9cb33 100644 --- 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 @@ -13,7 +13,6 @@ case "$FIRMWARE" in caldata_extract "caldata" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary ft 0x12) ;; - domywifi,dw33d-nor|\ domywifi,dw33d) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary art 0x12) @@ -23,6 +22,10 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 1) ;; + netgear,r6100) + caldata_extract "caldata" 0x5000 0x844 + ;; + zyxel,emg2926-q10a|\ zyxel,nbg6716) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1) diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac index 730a5f994..20974248c 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac @@ -15,6 +15,7 @@ case $board in [ "$PHYNBR" -eq 0 ] && \ macaddr_add $(mtd_get_mac_binary art 0x0) 2 > /sys${DEVPATH}/macaddress ;; + zyxel,emg2926-q10a|\ zyxel,nbg6716) # Set mac address for 2.4g device [ "$PHYNBR" -eq 1 ] && \ diff --git a/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh index fdd8381f5..4e501496b 100644 --- a/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh @@ -3,6 +3,7 @@ preinit_set_mac_address() { case $(board_name) in + zyxel,emg2926-q10a|\ zyxel,nbg6716) ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr) ip link set dev eth0 address $(macaddr_add $ethaddr 2) diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default index e0a5bb426..39aaacdb4 100644 --- a/target/linux/ath79/nand/config-default +++ b/target/linux/ath79/nand/config-default @@ -18,6 +18,8 @@ CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_PCI_AR71XX is not set CONFIG_PHY_AR7200_USB=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO_RESTART=y CONFIG_SGL_ALLOC=y CONFIG_UBIFS_FS=y CONFIG_ZLIB_DEFLATE=y diff --git a/target/linux/ath79/nand/target.mk b/target/linux/ath79/nand/target.mk index a852cf0c0..7ea9b57f4 100644 --- a/target/linux/ath79/nand/target.mk +++ b/target/linux/ath79/nand/target.mk @@ -2,7 +2,7 @@ BOARDNAME := Generic devices with NAND flash FEATURES += nand -DEFAULT_PACKAGES += wpad-openssl +DEFAULT_PACKAGES += wpad-basic-wolfssl define Target/Description Firmware for boards using Qualcomm Atheros, MIPS-based SoCs diff --git a/target/linux/ath79/patches-5.10/0004-phy-add-ath79-usb-phys.patch b/target/linux/ath79/patches-5.10/0004-phy-add-ath79-usb-phys.patch index e319f738a..56c3d6188 100644 --- a/target/linux/ath79/patches-5.10/0004-phy-add-ath79-usb-phys.patch +++ b/target/linux/ath79/patches-5.10/0004-phy-add-ath79-usb-phys.patch @@ -23,7 +23,7 @@ Signed-off-by: John Crispin + tristate "Atheros AR7100 USB PHY driver" + depends on ATH79 || COMPILE_TEST + default y if USB_EHCI_HCD_PLATFORM -+ select PHY_SIMPLE ++ select GENERIC_PHY + help + Enable this to support the USB PHY on Atheros AR7100 SoCs. + @@ -31,7 +31,7 @@ Signed-off-by: John Crispin + tristate "Atheros AR7200 USB PHY driver" + depends on ATH79 || COMPILE_TEST + default y if USB_EHCI_HCD_PLATFORM -+ select PHY_SIMPLE ++ select GENERIC_PHY + help + Enable this to support the USB PHY on Atheros AR7200 SoCs. + diff --git a/target/linux/ath79/patches-5.10/0032-MIPS-ath79-sanitize-symbols.patch b/target/linux/ath79/patches-5.10/0032-MIPS-ath79-sanitize-symbols.patch index 01cd31ba3..40cd1689a 100644 --- a/target/linux/ath79/patches-5.10/0032-MIPS-ath79-sanitize-symbols.patch +++ b/target/linux/ath79/patches-5.10/0032-MIPS-ath79-sanitize-symbols.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -243,6 +243,8 @@ config ATH79 +@@ -245,6 +245,8 @@ config ATH79 select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_MIPS16 select SYS_SUPPORTS_ZBOOT_UART_PROM diff --git a/target/linux/ath79/patches-5.10/0052-mtd-spi-nor-use-4-bit-locking-for-MX25L12805D.patch b/target/linux/ath79/patches-5.10/0052-mtd-spi-nor-use-4-bit-locking-for-MX25L12805D.patch index 317bef220..e99d067c4 100644 --- a/target/linux/ath79/patches-5.10/0052-mtd-spi-nor-use-4-bit-locking-for-MX25L12805D.patch +++ b/target/linux/ath79/patches-5.10/0052-mtd-spi-nor-use-4-bit-locking-for-MX25L12805D.patch @@ -21,7 +21,7 @@ Signed-off-by: David Bauer --- a/drivers/mtd/spi-nor/macronix.c +++ b/drivers/mtd/spi-nor/macronix.c -@@ -50,7 +50,8 @@ static const struct flash_info macronix_ +@@ -51,7 +51,8 @@ static const struct flash_info macronix_ { "mx25u4035", INFO(0xc22533, 0, 64 * 1024, 8, SECT_4K) }, { "mx25u8035", INFO(0xc22534, 0, 64 * 1024, 16, SECT_4K) }, { "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) }, diff --git a/target/linux/ath79/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/ath79/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch new file mode 100644 index 000000000..3beca822b --- /dev/null +++ b/target/linux/ath79/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -0,0 +1,54 @@ +From f32bc2aa01edcba2f2ed5db151cf183eac9ef919 Mon Sep 17 00:00:00 2001 +From: Abhimanyu Vishwakarma +Date: Sat, 25 Feb 2017 16:42:50 +0000 +Subject: mtd: nor: support mtd name from device tree + +Signed-off-by: Abhimanyu Vishwakarma +--- + drivers/mtd/spi-nor/spi-nor.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/spi-nor/core.c ++++ b/drivers/mtd/spi-nor/core.c +@@ -3147,6 +3147,7 @@ int spi_nor_scan(struct spi_nor *nor, co + struct device *dev = nor->dev; + struct mtd_info *mtd = &nor->mtd; + struct device_node *np = spi_nor_get_flash_node(nor); ++ const char __maybe_unused *of_mtd_name = NULL; + int ret; + int i; + +@@ -3201,7 +3202,12 @@ int spi_nor_scan(struct spi_nor *nor, co + if (ret) + return ret; + +- if (!mtd->name) ++#ifdef CONFIG_MTD_OF_PARTS ++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name); ++#endif ++ if (of_mtd_name) ++ mtd->name = of_mtd_name; ++ else if (!mtd->name) + mtd->name = dev_name(dev); + mtd->priv = nor; + mtd->type = MTD_NORFLASH; +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -778,6 +778,17 @@ out_error: + */ + static void mtd_set_dev_defaults(struct mtd_info *mtd) + { ++#ifdef CONFIG_MTD_OF_PARTS ++ const char __maybe_unused *of_mtd_name = NULL; ++ struct device_node *np; ++ ++ np = mtd_get_of_node(mtd); ++ if (np && !mtd->name) { ++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name); ++ if (of_mtd_name) ++ mtd->name = of_mtd_name; ++ } else ++#endif + if (mtd->dev.parent) { + if (!mtd->owner && mtd->dev.parent->driver) + mtd->owner = mtd->dev.parent->driver->owner; diff --git a/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch index 5738a2a8a..836c0f6da 100644 --- a/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch @@ -682,7 +682,7 @@ struct fib6_info *fib6_info_alloc(gfp_t gfp_flags, bool with_fib6_nh) --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c -@@ -423,7 +423,7 @@ static void tcp_sack(const struct sk_buf +@@ -415,7 +415,7 @@ static void tcp_sack(const struct sk_buf /* Fast path for timestamp-only option */ if (length == TCPOLEN_TSTAMP_ALIGNED diff --git a/target/linux/ath79/patches-5.10/920-mikrotik-rb4xx.patch b/target/linux/ath79/patches-5.10/920-mikrotik-rb4xx.patch index 1314ed834..4ed13deb5 100644 --- a/target/linux/ath79/patches-5.10/920-mikrotik-rb4xx.patch +++ b/target/linux/ath79/patches-5.10/920-mikrotik-rb4xx.patch @@ -5,7 +5,7 @@ device found on several devices in RAVE line of hardware. +config MFD_RB4XX_CPLD -+ tristate "CPLD driver for Mikrotik RB4xx series boards ++ tristate "CPLD driver for Mikrotik RB4xx series boards" + select MFD_CORE + depends on ATH79 || COMPILE_TEST + help diff --git a/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch b/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch index 5253b21c6..4cf6bb08d 100644 --- a/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch +++ b/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch @@ -14,6 +14,17 @@ config GPIO_LOGICVC tristate "Xylon LogiCVC GPIO support" depends on MFD_SYSCON && OF +@@ -495,6 +502,10 @@ config GPIO_REG + A 32-bit single register GPIO fixed in/out implementation. This + can be used to represent any register as a set of GPIO signals. + ++config GPIO_RB91X_KEY ++ tristate "MikroTik RB91x board series reset key support" ++ depends on ATH79 ++ + config GPIO_SAMA5D2_PIOBU + tristate "SAMA5D2 PIOBU GPIO support" + depends on MFD_SYSCON --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -73,6 +73,7 @@ obj-$(CONFIG_GPIO_IT87) += gpio-it87.o @@ -24,6 +35,14 @@ obj-$(CONFIG_GPIO_LOGICVC) += gpio-logicvc.o obj-$(CONFIG_GPIO_LOONGSON1) += gpio-loongson1.o obj-$(CONFIG_GPIO_LOONGSON) += gpio-loongson.o +@@ -122,6 +123,7 @@ obj-$(CONFIG_GPIO_PMIC_EIC_SPRD) += gpio + obj-$(CONFIG_GPIO_PXA) += gpio-pxa.o + obj-$(CONFIG_GPIO_RASPBERRYPI_EXP) += gpio-raspberrypi-exp.o + obj-$(CONFIG_GPIO_RB4XX) += gpio-rb4xx.o ++obj-$(CONFIG_GPIO_RB91X_KEY) += gpio-rb91x-key.o + obj-$(CONFIG_GPIO_RC5T583) += gpio-rc5t583.o + obj-$(CONFIG_GPIO_RCAR) += gpio-rcar.o + obj-$(CONFIG_GPIO_RDA) += gpio-rda.o --- a/drivers/mtd/nand/raw/Kconfig +++ b/drivers/mtd/nand/raw/Kconfig @@ -571,4 +571,10 @@ config MTD_NAND_RB4XX diff --git a/target/linux/ath79/patches-5.10/940-ath79-add-support-for-booting-QCN550x.patch b/target/linux/ath79/patches-5.10/940-ath79-add-support-for-booting-QCN550x.patch new file mode 100644 index 000000000..cf7743363 --- /dev/null +++ b/target/linux/ath79/patches-5.10/940-ath79-add-support-for-booting-QCN550x.patch @@ -0,0 +1,48 @@ +From: Wenli Looi +Date: Sun, 20 Jun 2021 23:32:28 -0700 +Subject: [PATCH] ath79: add support for booting QCN550x + +Based on wikidevi, QCN550x is a "Dragonfly" like QCA9561 and QCA9563. +Treating it as QCA956x seems to work. +Tested on Netgear EX7300v2 which boots successfully with +the same CPU clock as the stock firmware. + +Link: https://wikidevi.wi-cat.ru/Qualcomm#bgn +Link: https://wikidevi.wi-cat.ru/Qualcomm_Atheros#.28a.29bgn_2 +Signed-off-by: Wenli Looi + +--- a/arch/mips/ath79/early_printk.c ++++ b/arch/mips/ath79/early_printk.c +@@ -121,6 +121,7 @@ static void prom_putchar_init(void) + case REV_ID_MAJOR_QCA9558: + case REV_ID_MAJOR_TP9343: + case REV_ID_MAJOR_QCA956X: ++ case REV_ID_MAJOR_QCN550X: + _prom_putchar = prom_putchar_ar71xx; + break; + +--- a/arch/mips/ath79/setup.c ++++ b/arch/mips/ath79/setup.c +@@ -168,6 +168,12 @@ static void __init ath79_detect_sys_type + rev = id & QCA956X_REV_ID_REVISION_MASK; + break; + ++ case REV_ID_MAJOR_QCN550X: ++ ath79_soc = ATH79_SOC_QCA956X; ++ chip = "550X"; ++ rev = id & QCA956X_REV_ID_REVISION_MASK; ++ break; ++ + case REV_ID_MAJOR_TP9343: + ath79_soc = ATH79_SOC_TP9343; + chip = "9343"; +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -867,6 +867,7 @@ + #define REV_ID_MAJOR_QCA9558 0x1130 + #define REV_ID_MAJOR_TP9343 0x0150 + #define REV_ID_MAJOR_QCA956X 0x1150 ++#define REV_ID_MAJOR_QCN550X 0x2170 + + #define AR71XX_REV_ID_MINOR_MASK 0x3 + #define AR71XX_REV_ID_MINOR_AR7130 0x0 diff --git a/target/linux/ath79/patches-5.15/0003-leds-add-reset-controller-based-driver.patch b/target/linux/ath79/patches-5.15/0003-leds-add-reset-controller-based-driver.patch new file mode 100644 index 000000000..7122756c5 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0003-leds-add-reset-controller-based-driver.patch @@ -0,0 +1,186 @@ +From ecbd9c87f073f097d9fe56390353e64e963e866a Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 6 Mar 2018 10:03:03 +0100 +Subject: [PATCH 03/27] leds: add reset-controller based driver + +Signed-off-by: John Crispin +--- + drivers/leds/Kconfig | 11 ++++ + drivers/leds/Makefile | 1 + + drivers/leds/leds-reset.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 149 insertions(+) + create mode 100644 drivers/leds/leds-reset.c + +--- a/drivers/leds/Kconfig ++++ b/drivers/leds/Kconfig +@@ -876,6 +876,17 @@ source "drivers/leds/blink/Kconfig" + comment "Flash and Torch LED drivers" + source "drivers/leds/flash/Kconfig" + ++config LEDS_RESET ++ tristate "LED support for reset-controller API" ++ depends on LEDS_CLASS ++ depends on RESET_CONTROLLER ++ help ++ This option enables support for LEDs connected to pins driven by reset ++ controllers. Yes, DNI actual built HW like that. ++ ++ To compile this driver as a module, choose M here: the module ++ will be called leds-reset. ++ + comment "LED Triggers" + source "drivers/leds/trigger/Kconfig" + +--- /dev/null ++++ b/drivers/leds/leds-reset.c +@@ -0,0 +1,140 @@ ++/* ++ * Copyright (C) 2018 John Crispin ++ * ++ * 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 ++ ++struct reset_led_data { ++ struct led_classdev cdev; ++ struct reset_control *rst; ++}; ++ ++static inline struct reset_led_data * ++ cdev_to_reset_led_data(struct led_classdev *led_cdev) ++{ ++ return container_of(led_cdev, struct reset_led_data, cdev); ++} ++ ++static void reset_led_set(struct led_classdev *led_cdev, ++ enum led_brightness value) ++{ ++ struct reset_led_data *led_dat = cdev_to_reset_led_data(led_cdev); ++ ++ if (value == LED_OFF) ++ reset_control_assert(led_dat->rst); ++ else ++ reset_control_deassert(led_dat->rst); ++} ++ ++struct reset_leds_priv { ++ int num_leds; ++ struct reset_led_data leds[]; ++}; ++ ++static inline int sizeof_reset_leds_priv(int num_leds) ++{ ++ return sizeof(struct reset_leds_priv) + ++ (sizeof(struct reset_led_data) * num_leds); ++} ++ ++static struct reset_leds_priv *reset_leds_create(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct fwnode_handle *child; ++ struct reset_leds_priv *priv; ++ int count, ret; ++ ++ count = device_get_child_node_count(dev); ++ if (!count) ++ return ERR_PTR(-ENODEV); ++ ++ priv = devm_kzalloc(dev, sizeof_reset_leds_priv(count), GFP_KERNEL); ++ if (!priv) ++ return ERR_PTR(-ENOMEM); ++ ++ device_for_each_child_node(dev, child) { ++ struct reset_led_data *led = &priv->leds[priv->num_leds]; ++ struct device_node *np = to_of_node(child); ++ ++ ret = fwnode_property_read_string(child, "label", &led->cdev.name); ++ if (!led->cdev.name) { ++ fwnode_handle_put(child); ++ return ERR_PTR(-EINVAL); ++ } ++ led->rst = __of_reset_control_get(np, NULL, 0, 0, 0, true); ++ if (IS_ERR(led->rst)) ++ return ERR_PTR(-EINVAL); ++ ++ fwnode_property_read_string(child, "linux,default-trigger", ++ &led->cdev.default_trigger); ++ ++ led->cdev.brightness_set = reset_led_set; ++ ret = devm_led_classdev_register(&pdev->dev, &led->cdev); ++ if (ret < 0) ++ return ERR_PTR(ret); ++ led->cdev.dev->of_node = np; ++ priv->num_leds++; ++ } ++ ++ return priv; ++} ++ ++static const struct of_device_id of_reset_leds_match[] = { ++ { .compatible = "reset-leds", }, ++ {}, ++}; ++ ++MODULE_DEVICE_TABLE(of, of_reset_leds_match); ++ ++static int reset_led_probe(struct platform_device *pdev) ++{ ++ struct reset_leds_priv *priv; ++ ++ priv = reset_leds_create(pdev); ++ if (IS_ERR(priv)) ++ return PTR_ERR(priv); ++ ++ platform_set_drvdata(pdev, priv); ++ ++ return 0; ++} ++ ++static void reset_led_shutdown(struct platform_device *pdev) ++{ ++ struct reset_leds_priv *priv = platform_get_drvdata(pdev); ++ int i; ++ ++ for (i = 0; i < priv->num_leds; i++) { ++ struct reset_led_data *led = &priv->leds[i]; ++ ++ if (!(led->cdev.flags & LED_RETAIN_AT_SHUTDOWN)) ++ reset_led_set(&led->cdev, LED_OFF); ++ } ++} ++ ++static struct platform_driver reset_led_driver = { ++ .probe = reset_led_probe, ++ .shutdown = reset_led_shutdown, ++ .driver = { ++ .name = "leds-reset", ++ .of_match_table = of_reset_leds_match, ++ }, ++}; ++ ++module_platform_driver(reset_led_driver); ++ ++MODULE_AUTHOR("John Crispin "); ++MODULE_DESCRIPTION("reset controller LED driver"); ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS("platform:leds-reset"); +--- a/drivers/leds/Makefile ++++ b/drivers/leds/Makefile +@@ -87,6 +87,7 @@ obj-$(CONFIG_LEDS_TURRIS_OMNIA) += leds + obj-$(CONFIG_LEDS_WM831X_STATUS) += leds-wm831x-status.o + obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o + obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o ++obj-$(CONFIG_LEDS_RESET) += leds-reset.o + + # LED SPI Drivers + obj-$(CONFIG_LEDS_CR0014114) += leds-cr0014114.o diff --git a/target/linux/ath79/patches-5.15/0004-phy-add-ath79-usb-phys.patch b/target/linux/ath79/patches-5.15/0004-phy-add-ath79-usb-phys.patch new file mode 100644 index 000000000..21b655a10 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0004-phy-add-ath79-usb-phys.patch @@ -0,0 +1,333 @@ +From 08c9d6ceef01893678a5d2e8a15517c745417f21 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 6 Mar 2018 10:04:05 +0100 +Subject: [PATCH 04/27] phy: add ath79 usb phys + +Signed-off-by: John Crispin +--- + drivers/phy/Kconfig | 16 ++++++ + drivers/phy/Makefile | 2 + + drivers/phy/phy-ar7100-usb.c | 124 +++++++++++++++++++++++++++++++++++++++++++ + drivers/phy/phy-ar7200-usb.c | 108 +++++++++++++++++++++++++++++++++++++ + 4 files changed, 250 insertions(+) + create mode 100644 drivers/phy/phy-ar7100-usb.c + create mode 100644 drivers/phy/phy-ar7200-usb.c + +--- a/drivers/phy/Kconfig ++++ b/drivers/phy/Kconfig +@@ -24,6 +24,22 @@ config GENERIC_PHY_MIPI_DPHY + Provides a number of helpers a core functions for MIPI D-PHY + drivers to us. + ++config PHY_AR7100_USB ++ tristate "Atheros AR7100 USB PHY driver" ++ depends on ATH79 || COMPILE_TEST ++ default y if USB_EHCI_HCD_PLATFORM ++ select GENERIC_PHY ++ help ++ Enable this to support the USB PHY on Atheros AR7100 SoCs. ++ ++config PHY_AR7200_USB ++ tristate "Atheros AR7200 USB PHY driver" ++ depends on ATH79 || COMPILE_TEST ++ default y if USB_EHCI_HCD_PLATFORM ++ select GENERIC_PHY ++ help ++ Enable this to support the USB PHY on Atheros AR7200 SoCs. ++ + config PHY_LPC18XX_USB_OTG + tristate "NXP LPC18xx/43xx SoC USB OTG PHY driver" + depends on OF && (ARCH_LPC18XX || COMPILE_TEST) +--- a/drivers/phy/Makefile ++++ b/drivers/phy/Makefile +@@ -4,6 +4,8 @@ + # + + obj-$(CONFIG_GENERIC_PHY) += phy-core.o ++obj-$(CONFIG_PHY_AR7100_USB) += phy-ar7100-usb.o ++obj-$(CONFIG_PHY_AR7200_USB) += phy-ar7200-usb.o + obj-$(CONFIG_GENERIC_PHY_MIPI_DPHY) += phy-core-mipi-dphy.o + obj-$(CONFIG_PHY_CAN_TRANSCEIVER) += phy-can-transceiver.o + obj-$(CONFIG_PHY_LPC18XX_USB_OTG) += phy-lpc18xx-usb-otg.o +--- /dev/null ++++ b/drivers/phy/phy-ar7100-usb.c +@@ -0,0 +1,140 @@ ++/* ++ * Copyright (C) 2018 John Crispin ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++struct ar7100_usb_phy { ++ struct reset_control *rst_phy; ++ struct reset_control *rst_host; ++ struct reset_control *rst_ohci_dll; ++ void __iomem *io_base; ++ struct phy *phy; ++ int gpio; ++}; ++ ++static int ar7100_usb_phy_power_off(struct phy *phy) ++{ ++ struct ar7100_usb_phy *priv = phy_get_drvdata(phy); ++ int err = 0; ++ ++ err |= reset_control_assert(priv->rst_host); ++ err |= reset_control_assert(priv->rst_phy); ++ err |= reset_control_assert(priv->rst_ohci_dll); ++ ++ return err; ++} ++ ++static int ar7100_usb_phy_power_on(struct phy *phy) ++{ ++ struct ar7100_usb_phy *priv = phy_get_drvdata(phy); ++ int err = 0; ++ ++ err |= ar7100_usb_phy_power_off(phy); ++ mdelay(100); ++ err |= reset_control_deassert(priv->rst_ohci_dll); ++ err |= reset_control_deassert(priv->rst_phy); ++ err |= reset_control_deassert(priv->rst_host); ++ mdelay(500); ++ iowrite32(0xf0000, priv->io_base + AR71XX_USB_CTRL_REG_CONFIG); ++ iowrite32(0x20c00, priv->io_base + AR71XX_USB_CTRL_REG_FLADJ); ++ ++ return err; ++} ++ ++static const struct phy_ops ar7100_usb_phy_ops = { ++ .power_on = ar7100_usb_phy_power_on, ++ .power_off = ar7100_usb_phy_power_off, ++ .owner = THIS_MODULE, ++}; ++ ++static int ar7100_usb_phy_probe(struct platform_device *pdev) ++{ ++ struct phy_provider *phy_provider; ++ struct resource *res; ++ struct ar7100_usb_phy *priv; ++ ++ priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ priv->io_base = devm_ioremap_resource(&pdev->dev, res); ++ if (IS_ERR(priv->io_base)) ++ return PTR_ERR(priv->io_base); ++ ++ priv->rst_phy = devm_reset_control_get(&pdev->dev, "usb-phy"); ++ if (IS_ERR(priv->rst_phy)) { ++ dev_err(&pdev->dev, "phy reset is missing\n"); ++ return PTR_ERR(priv->rst_phy); ++ } ++ ++ priv->rst_host = devm_reset_control_get(&pdev->dev, "usb-host"); ++ if (IS_ERR(priv->rst_host)) { ++ dev_err(&pdev->dev, "host reset is missing\n"); ++ return PTR_ERR(priv->rst_host); ++ } ++ ++ priv->rst_ohci_dll = devm_reset_control_get(&pdev->dev, "usb-ohci-dll"); ++ if (IS_ERR(priv->rst_ohci_dll)) { ++ dev_err(&pdev->dev, "ohci-dll reset is missing\n"); ++ return PTR_ERR(priv->rst_host); ++ } ++ ++ priv->phy = devm_phy_create(&pdev->dev, NULL, &ar7100_usb_phy_ops); ++ if (IS_ERR(priv->phy)) { ++ dev_err(&pdev->dev, "failed to create PHY\n"); ++ return PTR_ERR(priv->phy); ++ } ++ ++ priv->gpio = of_get_gpio(pdev->dev.of_node, 0); ++ if (priv->gpio >= 0) { ++ int ret = devm_gpio_request(&pdev->dev, priv->gpio, dev_name(&pdev->dev)); ++ ++ if (ret) { ++ dev_err(&pdev->dev, "failed to request gpio\n"); ++ return ret; ++ } ++ gpio_export_with_name(priv->gpio, 0, dev_name(&pdev->dev)); ++ gpio_set_value(priv->gpio, 1); ++ } ++ ++ phy_set_drvdata(priv->phy, priv); ++ ++ phy_provider = devm_of_phy_provider_register(&pdev->dev, of_phy_simple_xlate); ++ ++ ++ return PTR_ERR_OR_ZERO(phy_provider); ++} ++ ++static const struct of_device_id ar7100_usb_phy_of_match[] = { ++ { .compatible = "qca,ar7100-usb-phy" }, ++ {} ++}; ++MODULE_DEVICE_TABLE(of, ar7100_usb_phy_of_match); ++ ++static struct platform_driver ar7100_usb_phy_driver = { ++ .probe = ar7100_usb_phy_probe, ++ .driver = { ++ .of_match_table = ar7100_usb_phy_of_match, ++ .name = "ar7100-usb-phy", ++ } ++}; ++module_platform_driver(ar7100_usb_phy_driver); ++ ++MODULE_DESCRIPTION("ATH79 USB PHY driver"); ++MODULE_AUTHOR("Alban Bedel "); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/drivers/phy/phy-ar7200-usb.c +@@ -0,0 +1,136 @@ ++/* ++ * Copyright (C) 2015 Alban Bedel ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++struct ar7200_usb_phy { ++ struct reset_control *rst_phy; ++ struct reset_control *rst_phy_analog; ++ struct reset_control *suspend_override; ++ struct phy *phy; ++ int gpio; ++}; ++ ++static int ar7200_usb_phy_power_on(struct phy *phy) ++{ ++ struct ar7200_usb_phy *priv = phy_get_drvdata(phy); ++ int err = 0; ++ ++ if (priv->suspend_override) ++ err = reset_control_assert(priv->suspend_override); ++ if (priv->rst_phy) ++ err |= reset_control_deassert(priv->rst_phy); ++ if (priv->rst_phy_analog) ++ err |= reset_control_deassert(priv->rst_phy_analog); ++ ++ return err; ++} ++ ++static int ar7200_usb_phy_power_off(struct phy *phy) ++{ ++ struct ar7200_usb_phy *priv = phy_get_drvdata(phy); ++ int err = 0; ++ ++ if (priv->suspend_override) ++ err = reset_control_deassert(priv->suspend_override); ++ if (priv->rst_phy) ++ err |= reset_control_assert(priv->rst_phy); ++ if (priv->rst_phy_analog) ++ err |= reset_control_assert(priv->rst_phy_analog); ++ ++ return err; ++} ++ ++static const struct phy_ops ar7200_usb_phy_ops = { ++ .power_on = ar7200_usb_phy_power_on, ++ .power_off = ar7200_usb_phy_power_off, ++ .owner = THIS_MODULE, ++}; ++ ++static int ar7200_usb_phy_probe(struct platform_device *pdev) ++{ ++ struct phy_provider *phy_provider; ++ struct ar7200_usb_phy *priv; ++ ++ priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ ++ priv->rst_phy = devm_reset_control_get(&pdev->dev, "usb-phy"); ++ if (IS_ERR(priv->rst_phy)) { ++ if (PTR_ERR(priv->rst_phy) != -EPROBE_DEFER) ++ dev_err(&pdev->dev, "phy reset is missing\n"); ++ return PTR_ERR(priv->rst_phy); ++ } ++ ++ priv->rst_phy_analog = devm_reset_control_get_optional( ++ &pdev->dev, "usb-phy-analog"); ++ if (IS_ERR(priv->rst_phy_analog)) { ++ if (PTR_ERR(priv->rst_phy_analog) == -ENOENT) ++ priv->rst_phy_analog = NULL; ++ else ++ return PTR_ERR(priv->rst_phy_analog); ++ } ++ ++ priv->suspend_override = devm_reset_control_get_optional( ++ &pdev->dev, "usb-suspend-override"); ++ if (IS_ERR(priv->suspend_override)) { ++ if (PTR_ERR(priv->suspend_override) == -ENOENT) ++ priv->suspend_override = NULL; ++ else ++ return PTR_ERR(priv->suspend_override); ++ } ++ ++ priv->phy = devm_phy_create(&pdev->dev, NULL, &ar7200_usb_phy_ops); ++ if (IS_ERR(priv->phy)) { ++ dev_err(&pdev->dev, "failed to create PHY\n"); ++ return PTR_ERR(priv->phy); ++ } ++ ++ priv->gpio = of_get_gpio(pdev->dev.of_node, 0); ++ if (priv->gpio >= 0) { ++ int ret = devm_gpio_request(&pdev->dev, priv->gpio, dev_name(&pdev->dev)); ++ ++ if (ret) { ++ dev_err(&pdev->dev, "failed to request gpio\n"); ++ return ret; ++ } ++ gpio_export_with_name(priv->gpio, 0, dev_name(&pdev->dev)); ++ gpio_set_value(priv->gpio, 1); ++ } ++ ++ phy_set_drvdata(priv->phy, priv); ++ ++ phy_provider = devm_of_phy_provider_register(&pdev->dev, of_phy_simple_xlate); ++ ++ return PTR_ERR_OR_ZERO(phy_provider); ++} ++ ++static const struct of_device_id ar7200_usb_phy_of_match[] = { ++ { .compatible = "qca,ar7200-usb-phy" }, ++ {} ++}; ++MODULE_DEVICE_TABLE(of, ar7200_usb_phy_of_match); ++ ++static struct platform_driver ar7200_usb_phy_driver = { ++ .probe = ar7200_usb_phy_probe, ++ .driver = { ++ .of_match_table = ar7200_usb_phy_of_match, ++ .name = "ar7200-usb-phy", ++ } ++}; ++module_platform_driver(ar7200_usb_phy_driver); ++ ++MODULE_DESCRIPTION("ATH79 USB PHY driver"); ++MODULE_AUTHOR("Alban Bedel "); ++MODULE_LICENSE("GPL"); diff --git a/target/linux/ath79/patches-5.15/0005-usb-add-more-OF-quirk-properties.patch b/target/linux/ath79/patches-5.15/0005-usb-add-more-OF-quirk-properties.patch new file mode 100644 index 000000000..d6d8cb695 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0005-usb-add-more-OF-quirk-properties.patch @@ -0,0 +1,24 @@ +From 2201818e5bd33f389beceb3943fdfcf5a698fc5b Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 6 Mar 2018 10:01:43 +0100 +Subject: [PATCH 05/27] usb: add more OF/quirk properties + +Signed-off-by: John Crispin +--- + drivers/usb/host/ehci-platform.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/usb/host/ehci-platform.c ++++ b/drivers/usb/host/ehci-platform.c +@@ -277,6 +277,11 @@ static int ehci_platform_probe(struct pl + ehci = hcd_to_ehci(hcd); + + if (pdata == &ehci_platform_defaults && dev->dev.of_node) { ++ of_property_read_u32(dev->dev.of_node, "caps-offset", &pdata->caps_offset); ++ ++ if (of_property_read_bool(dev->dev.of_node, "has-synopsys-hc-bug")) ++ pdata->has_synopsys_hc_bug = 1; ++ + if (of_property_read_bool(dev->dev.of_node, "big-endian-regs")) + ehci->big_endian_mmio = 1; + diff --git a/target/linux/ath79/patches-5.15/0007-irqchip-irq-ath79-intc-add-irq-cascade-driver-for-QC.patch b/target/linux/ath79/patches-5.15/0007-irqchip-irq-ath79-intc-add-irq-cascade-driver-for-QC.patch new file mode 100644 index 000000000..ceda511c2 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0007-irqchip-irq-ath79-intc-add-irq-cascade-driver-for-QC.patch @@ -0,0 +1,168 @@ +From f3eacff2310a60348a755c50a8da6fc251fc8587 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 6 Mar 2018 09:55:13 +0100 +Subject: [PATCH 07/33] irqchip/irq-ath79-intc: add irq cascade driver for + QCA9556 SoCs + +Signed-off-by: John Crispin +--- + drivers/irqchip/Makefile | 1 + + drivers/irqchip/irq-ath79-intc.c | 142 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 143 insertions(+) + create mode 100644 drivers/irqchip/irq-ath79-intc.c + +--- a/drivers/irqchip/Makefile ++++ b/drivers/irqchip/Makefile +@@ -4,6 +4,7 @@ obj-$(CONFIG_IRQCHIP) += irqchip.o + obj-$(CONFIG_AL_FIC) += irq-al-fic.o + obj-$(CONFIG_ALPINE_MSI) += irq-alpine-msi.o + obj-$(CONFIG_ATH79) += irq-ath79-cpu.o ++obj-$(CONFIG_ATH79) += irq-ath79-intc.o + obj-$(CONFIG_ATH79) += irq-ath79-misc.o + obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o + obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2836.o +--- /dev/null ++++ b/drivers/irqchip/irq-ath79-intc.c +@@ -0,0 +1,142 @@ ++/* ++ * Atheros AR71xx/AR724x/AR913x specific interrupt handling ++ * ++ * Copyright (C) 2018 John Crispin ++ * ++ * 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 ++ ++#define ATH79_MAX_INTC_CASCADE 3 ++ ++struct ath79_intc { ++ struct irq_chip chip; ++ u32 irq; ++ u32 pending_mask; ++ u32 int_status; ++ u32 irq_mask[ATH79_MAX_INTC_CASCADE]; ++ u32 irq_wb_chan[ATH79_MAX_INTC_CASCADE]; ++}; ++ ++static void ath79_intc_irq_handler(struct irq_desc *desc) ++{ ++ struct irq_domain *domain = irq_desc_get_handler_data(desc); ++ struct ath79_intc *intc = domain->host_data; ++ u32 pending; ++ ++ pending = ath79_reset_rr(intc->int_status); ++ pending &= intc->pending_mask; ++ ++ if (pending) { ++ int i; ++ ++ for (i = 0; i < domain->hwirq_max; i++) ++ if (pending & intc->irq_mask[i]) { ++ if (intc->irq_wb_chan[i] != 0xffffffff) ++ ath79_ddr_wb_flush(intc->irq_wb_chan[i]); ++ generic_handle_irq(irq_find_mapping(domain, i)); ++ } ++ } else { ++ spurious_interrupt(); ++ } ++} ++ ++static void ath79_intc_irq_enable(struct irq_data *d) ++{ ++ struct ath79_intc *intc = d->domain->host_data; ++ enable_irq(intc->irq); ++} ++ ++static void ath79_intc_irq_disable(struct irq_data *d) ++{ ++ struct ath79_intc *intc = d->domain->host_data; ++ disable_irq(intc->irq); ++} ++ ++static int ath79_intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) ++{ ++ struct ath79_intc *intc = d->host_data; ++ ++ irq_set_chip_and_handler(irq, &intc->chip, handle_level_irq); ++ ++ return 0; ++} ++ ++static const struct irq_domain_ops ath79_irq_domain_ops = { ++ .xlate = irq_domain_xlate_onecell, ++ .map = ath79_intc_map, ++}; ++ ++static int __init ath79_intc_of_init( ++ struct device_node *node, struct device_node *parent) ++{ ++ struct irq_domain *domain; ++ struct ath79_intc *intc; ++ int cnt, cntwb, i, err; ++ ++ cnt = of_property_count_u32_elems(node, "qca,pending-bits"); ++ if (cnt > ATH79_MAX_INTC_CASCADE) ++ panic("Too many INTC pending bits\n"); ++ ++ intc = kzalloc(sizeof(*intc), GFP_KERNEL); ++ if (!intc) ++ panic("Failed to allocate INTC memory\n"); ++ intc->chip = dummy_irq_chip; ++ intc->chip.name = "INTC"; ++ intc->chip.irq_disable = ath79_intc_irq_disable; ++ intc->chip.irq_enable = ath79_intc_irq_enable; ++ ++ if (of_property_read_u32(node, "qca,int-status-addr", &intc->int_status) < 0) { ++ panic("Missing address of interrupt status register\n"); ++ } ++ ++ of_property_read_u32_array(node, "qca,pending-bits", intc->irq_mask, cnt); ++ for (i = 0; i < cnt; i++) { ++ intc->pending_mask |= intc->irq_mask[i]; ++ intc->irq_wb_chan[i] = 0xffffffff; ++ } ++ ++ cntwb = of_count_phandle_with_args( ++ node, "qca,ddr-wb-channels", "#qca,ddr-wb-channel-cells"); ++ ++ for (i = 0; i < cntwb; i++) { ++ struct of_phandle_args args; ++ u32 irq = i; ++ ++ of_property_read_u32_index( ++ node, "qca,ddr-wb-channel-interrupts", i, &irq); ++ if (irq >= ATH79_MAX_INTC_CASCADE) ++ continue; ++ ++ err = of_parse_phandle_with_args( ++ node, "qca,ddr-wb-channels", ++ "#qca,ddr-wb-channel-cells", ++ i, &args); ++ if (err) ++ return err; ++ ++ intc->irq_wb_chan[irq] = args.args[0]; ++ } ++ ++ intc->irq = irq_of_parse_and_map(node, 0); ++ if (!intc->irq) ++ panic("Failed to get INTC IRQ"); ++ ++ domain = irq_domain_add_linear(node, cnt, &ath79_irq_domain_ops, intc); ++ irq_set_chained_handler_and_data(intc->irq, ath79_intc_irq_handler, domain); ++ ++ return 0; ++} ++IRQCHIP_DECLARE(ath79_intc, "qca,ar9340-intc", ++ ath79_intc_of_init); diff --git a/target/linux/ath79/patches-5.15/0008-irqchip-irq-ath79-cpu-drop-OF-init-helper.patch b/target/linux/ath79/patches-5.15/0008-irqchip-irq-ath79-cpu-drop-OF-init-helper.patch new file mode 100644 index 000000000..13117d9a8 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0008-irqchip-irq-ath79-cpu-drop-OF-init-helper.patch @@ -0,0 +1,23 @@ +From e029f998594f151008ecbfa024e2957edd2a5189 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 6 Mar 2018 09:58:19 +0100 +Subject: [PATCH 08/33] irqchip/irq-ath79-cpu: drop !OF init helper + +Signed-off-by: John Crispin +--- + drivers/irqchip/irq-ath79-cpu.c | 7 ------- + 1 file changed, 7 deletions(-) + +--- a/drivers/irqchip/irq-ath79-cpu.c ++++ b/drivers/irqchip/irq-ath79-cpu.c +@@ -85,10 +85,3 @@ static int __init ar79_cpu_intc_of_init( + } + IRQCHIP_DECLARE(ar79_cpu_intc, "qca,ar7100-cpu-intc", + ar79_cpu_intc_of_init); +- +-void __init ath79_cpu_irq_init(unsigned irq_wb_chan2, unsigned irq_wb_chan3) +-{ +- irq_wb_chan[2] = irq_wb_chan2; +- irq_wb_chan[3] = irq_wb_chan3; +- mips_cpu_irq_init(); +-} diff --git a/target/linux/ath79/patches-5.15/0017-dt-bindings-PCI-qcom-ar7100-adds-binding-doc.patch b/target/linux/ath79/patches-5.15/0017-dt-bindings-PCI-qcom-ar7100-adds-binding-doc.patch new file mode 100644 index 000000000..bf7eb691a --- /dev/null +++ b/target/linux/ath79/patches-5.15/0017-dt-bindings-PCI-qcom-ar7100-adds-binding-doc.patch @@ -0,0 +1,57 @@ +From 4a4f869ec58ed8910b9b2e68d0eee50957e9bb20 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Mon, 25 Jun 2018 15:52:10 +0200 +Subject: [PATCH 17/33] dt-bindings: PCI: qcom,ar7100: adds binding doc + +With the driver being converted from platform_data to pure OF, we need to +also add some docs. + +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: John Crispin +--- + .../devicetree/bindings/pci/qcom,ar7100-pci.txt | 38 ++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + create mode 100644 Documentation/devicetree/bindings/pci/qcom,ar7100-pci.txt + +--- /dev/null ++++ b/Documentation/devicetree/bindings/pci/qcom,ar7100-pci.txt +@@ -0,0 +1,38 @@ ++* Qualcomm Atheros AR7100 PCI express root complex ++ ++Required properties: ++- compatible: should contain "qcom,ar7100-pci" to identify the core. ++- reg: Should contain the register ranges as listed in the reg-names property. ++- reg-names: Definition: Must include the following entries ++ - "cfg_base" IO Memory ++- #address-cells: set to <3> ++- #size-cells: set to <2> ++- ranges: ranges for the PCI memory and I/O regions ++- interrupt-map-mask and interrupt-map: standard PCI ++ properties to define the mapping of the PCIe interface to interrupt ++ numbers. ++- #interrupt-cells: set to <1> ++- interrupt-controller: define to enable the builtin IRQ cascade. ++ ++Optional properties: ++- interrupt-parent: phandle to the MIPS IRQ controller ++ ++* Example for ar7100 ++ pcie-controller@180c0000 { ++ compatible = "qca,ar7100-pci"; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ bus-range = <0x0 0x0>; ++ reg = <0x17010000 0x100>; ++ reg-names = "cfg_base"; ++ ranges = <0x2000000 0 0x10000000 0x10000000 0 0x07000000 ++ 0x1000000 0 0x00000000 0x00000000 0 0x00000001>; ++ interrupt-parent = <&cpuintc>; ++ interrupts = <2>; ++ ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ ++ interrupt-map-mask = <0 0 0 1>; ++ interrupt-map = <0 0 0 0 &pcie0 0>; ++ }; diff --git a/target/linux/ath79/patches-5.15/0018-MIPS-pci-ar71xx-convert-to-OF.patch b/target/linux/ath79/patches-5.15/0018-MIPS-pci-ar71xx-convert-to-OF.patch new file mode 100644 index 000000000..e600a4f0d --- /dev/null +++ b/target/linux/ath79/patches-5.15/0018-MIPS-pci-ar71xx-convert-to-OF.patch @@ -0,0 +1,202 @@ +From 1855ab6b1d27f5b38a648baf57ff6a534afec26d Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Sat, 23 Jun 2018 15:07:23 +0200 +Subject: [PATCH 18/33] MIPS: pci-ar71xx: convert to OF + +With the ath79 target getting converted to pure OF, we can drop all the +platform data code and add the missing OF bits to the driver. We also add +a irq domain for the PCI/e controllers cascade, thus making it usable from +dts files. + +Signed-off-by: John Crispin +--- + arch/mips/pci/pci-ar71xx.c | 82 +++++++++++++++++++++++----------------------- + 1 file changed, 41 insertions(+), 41 deletions(-) + +--- a/arch/mips/pci/pci-ar71xx.c ++++ b/arch/mips/pci/pci-ar71xx.c +@@ -15,8 +15,11 @@ + #include + #include + #include ++#include + #include + #include ++#include ++#include + + #include + #include +@@ -46,12 +49,13 @@ + #define AR71XX_PCI_IRQ_COUNT 5 + + struct ar71xx_pci_controller { ++ struct device_node *np; + void __iomem *cfg_base; + int irq; +- int irq_base; + struct pci_controller pci_ctrl; + struct resource io_res; + struct resource mem_res; ++ struct irq_domain *domain; + }; + + /* Byte lane enable bits */ +@@ -225,29 +229,30 @@ static struct pci_ops ar71xx_pci_ops = { + + static void ar71xx_pci_irq_handler(struct irq_desc *desc) + { +- struct ar71xx_pci_controller *apc; + void __iomem *base = ath79_reset_base; ++ struct irq_chip *chip = irq_desc_get_chip(desc); ++ struct ar71xx_pci_controller *apc = irq_desc_get_handler_data(desc); + u32 pending; + +- apc = irq_desc_get_handler_data(desc); +- ++ chained_irq_enter(chip, desc); + pending = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_STATUS) & + __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); + + if (pending & AR71XX_PCI_INT_DEV0) +- generic_handle_irq(apc->irq_base + 0); ++ generic_handle_irq(irq_linear_revmap(apc->domain, 1)); + + else if (pending & AR71XX_PCI_INT_DEV1) +- generic_handle_irq(apc->irq_base + 1); ++ generic_handle_irq(irq_linear_revmap(apc->domain, 2)); + + else if (pending & AR71XX_PCI_INT_DEV2) +- generic_handle_irq(apc->irq_base + 2); ++ generic_handle_irq(irq_linear_revmap(apc->domain, 3)); + + else if (pending & AR71XX_PCI_INT_CORE) +- generic_handle_irq(apc->irq_base + 4); ++ generic_handle_irq(irq_linear_revmap(apc->domain, 4)); + + else + spurious_interrupt(); ++ chained_irq_exit(chip, desc); + } + + static void ar71xx_pci_irq_unmask(struct irq_data *d) +@@ -258,7 +263,7 @@ static void ar71xx_pci_irq_unmask(struct + u32 t; + + apc = irq_data_get_irq_chip_data(d); +- irq = d->irq - apc->irq_base; ++ irq = irq_linear_revmap(apc->domain, d->irq); + + t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); + __raw_writel(t | (1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE); +@@ -275,7 +280,7 @@ static void ar71xx_pci_irq_mask(struct i + u32 t; + + apc = irq_data_get_irq_chip_data(d); +- irq = d->irq - apc->irq_base; ++ irq = irq_linear_revmap(apc->domain, d->irq); + + t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); + __raw_writel(t & ~(1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE); +@@ -291,24 +296,31 @@ static struct irq_chip ar71xx_pci_irq_ch + .irq_mask_ack = ar71xx_pci_irq_mask, + }; + ++static int ar71xx_pci_irq_map(struct irq_domain *d, ++ unsigned int irq, irq_hw_number_t hw) ++{ ++ struct ar71xx_pci_controller *apc = d->host_data; ++ ++ irq_set_chip_and_handler(irq, &ar71xx_pci_irq_chip, handle_level_irq); ++ irq_set_chip_data(irq, apc); ++ ++ return 0; ++} ++ ++static const struct irq_domain_ops ar71xx_pci_domain_ops = { ++ .xlate = irq_domain_xlate_onecell, ++ .map = ar71xx_pci_irq_map, ++}; ++ + static void ar71xx_pci_irq_init(struct ar71xx_pci_controller *apc) + { + void __iomem *base = ath79_reset_base; +- int i; + + __raw_writel(0, base + AR71XX_RESET_REG_PCI_INT_ENABLE); + __raw_writel(0, base + AR71XX_RESET_REG_PCI_INT_STATUS); + +- BUILD_BUG_ON(ATH79_PCI_IRQ_COUNT < AR71XX_PCI_IRQ_COUNT); +- +- apc->irq_base = ATH79_PCI_IRQ_BASE; +- for (i = apc->irq_base; +- i < apc->irq_base + AR71XX_PCI_IRQ_COUNT; i++) { +- irq_set_chip_and_handler(i, &ar71xx_pci_irq_chip, +- handle_level_irq); +- irq_set_chip_data(i, apc); +- } +- ++ apc->domain = irq_domain_add_linear(apc->np, AR71XX_PCI_IRQ_COUNT, ++ &ar71xx_pci_domain_ops, apc); + irq_set_chained_handler_and_data(apc->irq, ar71xx_pci_irq_handler, + apc); + } +@@ -325,6 +337,11 @@ static void ar71xx_pci_reset(void) + mdelay(100); + } + ++static const struct of_device_id ar71xx_pci_ids[] = { ++ { .compatible = "qca,ar7100-pci" }, ++ {}, ++}; ++ + static int ar71xx_pci_probe(struct platform_device *pdev) + { + struct ar71xx_pci_controller *apc; +@@ -345,26 +362,6 @@ static int ar71xx_pci_probe(struct platf + if (apc->irq < 0) + return -EINVAL; + +- res = platform_get_resource_byname(pdev, IORESOURCE_IO, "io_base"); +- if (!res) +- return -EINVAL; +- +- apc->io_res.parent = res; +- apc->io_res.name = "PCI IO space"; +- apc->io_res.start = res->start; +- apc->io_res.end = res->end; +- apc->io_res.flags = IORESOURCE_IO; +- +- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mem_base"); +- if (!res) +- return -EINVAL; +- +- apc->mem_res.parent = res; +- apc->mem_res.name = "PCI memory space"; +- apc->mem_res.start = res->start; +- apc->mem_res.end = res->end; +- apc->mem_res.flags = IORESOURCE_MEM; +- + ar71xx_pci_reset(); + + /* setup COMMAND register */ +@@ -377,9 +374,11 @@ static int ar71xx_pci_probe(struct platf + + ar71xx_pci_irq_init(apc); + ++ apc->np = pdev->dev.of_node; + apc->pci_ctrl.pci_ops = &ar71xx_pci_ops; + apc->pci_ctrl.mem_resource = &apc->mem_res; + apc->pci_ctrl.io_resource = &apc->io_res; ++ pci_load_of_ranges(&apc->pci_ctrl, pdev->dev.of_node); + + register_pci_controller(&apc->pci_ctrl); + +@@ -390,6 +389,7 @@ static struct platform_driver ar71xx_pci + .probe = ar71xx_pci_probe, + .driver = { + .name = "ar71xx-pci", ++ .of_match_table = of_match_ptr(ar71xx_pci_ids), + }, + }; + diff --git a/target/linux/ath79/patches-5.15/0019-dt-bindings-PCI-qcom-ar7240-adds-binding-doc.patch b/target/linux/ath79/patches-5.15/0019-dt-bindings-PCI-qcom-ar7240-adds-binding-doc.patch new file mode 100644 index 000000000..a0af79cb4 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0019-dt-bindings-PCI-qcom-ar7240-adds-binding-doc.patch @@ -0,0 +1,61 @@ +From ea27764bc3ef2a05decf3ae05edffc289cd0d93c Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Mon, 25 Jun 2018 15:52:02 +0200 +Subject: [PATCH 19/33] dt-bindings: PCI: qcom,ar7240: adds binding doc + +With the driver being converted from platform_data to pure OF, we need to +also add some docs. + +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: John Crispin +--- + .../devicetree/bindings/pci/qcom,ar7240-pci.txt | 42 ++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + create mode 100644 Documentation/devicetree/bindings/pci/qcom,ar7240-pci.txt + +--- /dev/null ++++ b/Documentation/devicetree/bindings/pci/qcom,ar7240-pci.txt +@@ -0,0 +1,42 @@ ++* Qualcomm Atheros AR724X PCI express root complex ++ ++Required properties: ++- compatible: should contain "qcom,ar7240-pci" to identify the core. ++- reg: Should contain the register ranges as listed in the reg-names property. ++- reg-names: Definition: Must include the following entries ++ - "crp_base" Configuration registers ++ - "ctrl_base" Control registers ++ - "cfg_base" IO Memory ++- #address-cells: set to <3> ++- #size-cells: set to <2> ++- ranges: ranges for the PCI memory and I/O regions ++- interrupt-map-mask and interrupt-map: standard PCI ++ properties to define the mapping of the PCIe interface to interrupt ++ numbers. ++- #interrupt-cells: set to <1> ++- interrupt-parent: phandle to the MIPS IRQ controller ++ ++Optional properties: ++- interrupt-controller: define to enable the builtin IRQ cascade. ++ ++* Example for qca9557 ++ pcie-controller@180c0000 { ++ compatible = "qcom,ar7240-pci"; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ bus-range = <0x0 0x0>; ++ reg = <0x180c0000 0x1000>, ++ <0x180f0000 0x100>, ++ <0x14000000 0x1000>; ++ reg-names = "crp_base", "ctrl_base", "cfg_base"; ++ ranges = <0x2000000 0 0x10000000 0x10000000 0 0x04000000 ++ 0x1000000 0 0x00000000 0x00000000 0 0x00000001>; ++ interrupt-parent = <&intc2>; ++ interrupts = <1>; ++ ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ ++ interrupt-map-mask = <0 0 0 1>; ++ interrupt-map = <0 0 0 0 &pcie0 0>; ++ }; diff --git a/target/linux/ath79/patches-5.15/0020-MIPS-pci-ar724x-convert-to-OF.patch b/target/linux/ath79/patches-5.15/0020-MIPS-pci-ar724x-convert-to-OF.patch new file mode 100644 index 000000000..2772c5339 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0020-MIPS-pci-ar724x-convert-to-OF.patch @@ -0,0 +1,205 @@ +From a522ee0199d5d3ea114ca2e211f6ac398d3e8e0b Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Sat, 23 Jun 2018 15:07:37 +0200 +Subject: [PATCH 20/33] MIPS: pci-ar724x: convert to OF + +With the ath79 target getting converted to pure OF, we can drop all the +platform data code and add the missing OF bits to the driver. We also add +a irq domain for the PCI/e controllers cascade, thus making it usable from +dts files. + +Signed-off-by: John Crispin +--- + arch/mips/pci/pci-ar724x.c | 88 ++++++++++++++++++++++------------------------ + 1 file changed, 42 insertions(+), 46 deletions(-) + +--- a/arch/mips/pci/pci-ar724x.c ++++ b/arch/mips/pci/pci-ar724x.c +@@ -11,8 +11,11 @@ + #include + #include + #include ++#include + #include + #include ++#include ++#include + + #define AR724X_PCI_REG_APP 0x00 + #define AR724X_PCI_REG_RESET 0x18 +@@ -42,17 +45,20 @@ struct ar724x_pci_controller { + void __iomem *crp_base; + + int irq; +- int irq_base; + + bool link_up; + bool bar0_is_cached; + u32 bar0_value; + ++ struct device_node *np; + struct pci_controller pci_controller; ++ struct irq_domain *domain; + struct resource io_res; + struct resource mem_res; + }; + ++static struct irq_chip ar724x_pci_irq_chip; ++ + static inline bool ar724x_pci_check_link(struct ar724x_pci_controller *apc) + { + u32 reset; +@@ -228,35 +234,31 @@ static struct pci_ops ar724x_pci_ops = { + + static void ar724x_pci_irq_handler(struct irq_desc *desc) + { +- struct ar724x_pci_controller *apc; +- void __iomem *base; ++ struct irq_chip *chip = irq_desc_get_chip(desc); ++ struct ar724x_pci_controller *apc = irq_desc_get_handler_data(desc); + u32 pending; + +- apc = irq_desc_get_handler_data(desc); +- base = apc->ctrl_base; +- +- pending = __raw_readl(base + AR724X_PCI_REG_INT_STATUS) & +- __raw_readl(base + AR724X_PCI_REG_INT_MASK); ++ chained_irq_enter(chip, desc); ++ pending = __raw_readl(apc->ctrl_base + AR724X_PCI_REG_INT_STATUS) & ++ __raw_readl(apc->ctrl_base + AR724X_PCI_REG_INT_MASK); + + if (pending & AR724X_PCI_INT_DEV0) +- generic_handle_irq(apc->irq_base + 0); +- ++ generic_handle_irq(irq_linear_revmap(apc->domain, 1)); + else + spurious_interrupt(); ++ chained_irq_exit(chip, desc); + } + + static void ar724x_pci_irq_unmask(struct irq_data *d) + { + struct ar724x_pci_controller *apc; + void __iomem *base; +- int offset; + u32 t; + + apc = irq_data_get_irq_chip_data(d); + base = apc->ctrl_base; +- offset = apc->irq_base - d->irq; + +- switch (offset) { ++ switch (irq_linear_revmap(apc->domain, d->irq)) { + case 0: + t = __raw_readl(base + AR724X_PCI_REG_INT_MASK); + __raw_writel(t | AR724X_PCI_INT_DEV0, +@@ -270,14 +272,12 @@ static void ar724x_pci_irq_mask(struct i + { + struct ar724x_pci_controller *apc; + void __iomem *base; +- int offset; + u32 t; + + apc = irq_data_get_irq_chip_data(d); + base = apc->ctrl_base; +- offset = apc->irq_base - d->irq; + +- switch (offset) { ++ switch (irq_linear_revmap(apc->domain, d->irq)) { + case 0: + t = __raw_readl(base + AR724X_PCI_REG_INT_MASK); + __raw_writel(t & ~AR724X_PCI_INT_DEV0, +@@ -302,26 +302,34 @@ static struct irq_chip ar724x_pci_irq_ch + .irq_mask_ack = ar724x_pci_irq_mask, + }; + ++static int ar724x_pci_irq_map(struct irq_domain *d, ++ unsigned int irq, irq_hw_number_t hw) ++{ ++ struct ar724x_pci_controller *apc = d->host_data; ++ ++ irq_set_chip_and_handler(irq, &ar724x_pci_irq_chip, handle_level_irq); ++ irq_set_chip_data(irq, apc); ++ ++ return 0; ++} ++ ++static const struct irq_domain_ops ar724x_pci_domain_ops = { ++ .xlate = irq_domain_xlate_onecell, ++ .map = ar724x_pci_irq_map, ++}; ++ + static void ar724x_pci_irq_init(struct ar724x_pci_controller *apc, + int id) + { + void __iomem *base; +- int i; + + base = apc->ctrl_base; + + __raw_writel(0, base + AR724X_PCI_REG_INT_MASK); + __raw_writel(0, base + AR724X_PCI_REG_INT_STATUS); + +- apc->irq_base = ATH79_PCI_IRQ_BASE + (id * AR724X_PCI_IRQ_COUNT); +- +- for (i = apc->irq_base; +- i < apc->irq_base + AR724X_PCI_IRQ_COUNT; i++) { +- irq_set_chip_and_handler(i, &ar724x_pci_irq_chip, +- handle_level_irq); +- irq_set_chip_data(i, apc); +- } +- ++ apc->domain = irq_domain_add_linear(apc->np, 2, ++ &ar724x_pci_domain_ops, apc); + irq_set_chained_handler_and_data(apc->irq, ar724x_pci_irq_handler, + apc); + } +@@ -388,29 +396,11 @@ static int ar724x_pci_probe(struct platf + if (apc->irq < 0) + return -EINVAL; + +- res = platform_get_resource_byname(pdev, IORESOURCE_IO, "io_base"); +- if (!res) +- return -EINVAL; +- +- apc->io_res.parent = res; +- apc->io_res.name = "PCI IO space"; +- apc->io_res.start = res->start; +- apc->io_res.end = res->end; +- apc->io_res.flags = IORESOURCE_IO; +- +- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mem_base"); +- if (!res) +- return -EINVAL; +- +- apc->mem_res.parent = res; +- apc->mem_res.name = "PCI memory space"; +- apc->mem_res.start = res->start; +- apc->mem_res.end = res->end; +- apc->mem_res.flags = IORESOURCE_MEM; +- ++ apc->np = pdev->dev.of_node; + apc->pci_controller.pci_ops = &ar724x_pci_ops; + apc->pci_controller.io_resource = &apc->io_res; + apc->pci_controller.mem_resource = &apc->mem_res; ++ pci_load_of_ranges(&apc->pci_controller, pdev->dev.of_node); + + /* + * Do the full PCIE Root Complex Initialization Sequence if the PCIe +@@ -432,10 +422,16 @@ static int ar724x_pci_probe(struct platf + return 0; + } + ++static const struct of_device_id ar724x_pci_ids[] = { ++ { .compatible = "qcom,ar7240-pci" }, ++ {}, ++}; ++ + static struct platform_driver ar724x_pci_driver = { + .probe = ar724x_pci_probe, + .driver = { + .name = "ar724x-pci", ++ .of_match_table = of_match_ptr(ar724x_pci_ids), + }, + }; + diff --git a/target/linux/ath79/patches-5.15/0032-MIPS-ath79-sanitize-symbols.patch b/target/linux/ath79/patches-5.15/0032-MIPS-ath79-sanitize-symbols.patch new file mode 100644 index 000000000..9bce3a263 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0032-MIPS-ath79-sanitize-symbols.patch @@ -0,0 +1,93 @@ +From 3fc8585cf76022dba7496627074d42af88c30718 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Sat, 23 Jun 2018 15:16:55 +0200 +Subject: [PATCH 32/33] MIPS: ath79: sanitize symbols + +We no longer need to select which SoCs are supported as the whole arch +code is always built. So lets drop all the SoC symbols + +Signed-off-by: John Crispin +--- + arch/mips/Kconfig | 2 ++ + arch/mips/ath79/Kconfig | 44 +++++--------------------------------------- + arch/mips/pci/Makefile | 2 +- + 3 files changed, 8 insertions(+), 40 deletions(-) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -256,6 +256,8 @@ config ATH79 + select SYS_SUPPORTS_BIG_ENDIAN + select SYS_SUPPORTS_MIPS16 + select SYS_SUPPORTS_ZBOOT_UART_PROM ++ select HAVE_PCI ++ select USB_ARCH_HAS_EHCI + select USE_OF + select USB_EHCI_ROOT_HUB_TT if USB_EHCI_HCD_PLATFORM + help +--- a/arch/mips/ath79/Kconfig ++++ b/arch/mips/ath79/Kconfig +@@ -1,48 +1,14 @@ + # SPDX-License-Identifier: GPL-2.0 + if ATH79 + +-config SOC_AR71XX +- select HAVE_PCI +- def_bool n +- +-config SOC_AR724X +- select HAVE_PCI +- select PCI_AR724X if PCI +- def_bool n +- +-config SOC_AR913X +- def_bool n +- +-config SOC_AR933X +- def_bool n +- +-config SOC_AR934X +- select HAVE_PCI +- select PCI_AR724X if PCI +- def_bool n +- +-config SOC_QCA955X +- select HAVE_PCI +- select PCI_AR724X if PCI ++config PCI_AR71XX ++ bool "PCI support for AR7100 type SoCs" ++ depends on PCI + def_bool n + + config PCI_AR724X +- def_bool n +- +-config ATH79_DEV_GPIO_BUTTONS +- def_bool n +- +-config ATH79_DEV_LEDS_GPIO +- def_bool n +- +-config ATH79_DEV_SPI +- def_bool n +- +-config ATH79_DEV_USB +- def_bool n +- +-config ATH79_DEV_WMAC +- depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA955X) ++ bool "PCI support for AR724x type SoCs" ++ depends on PCI + def_bool n + + endif +--- a/arch/mips/pci/Makefile ++++ b/arch/mips/pci/Makefile +@@ -21,7 +21,7 @@ obj-$(CONFIG_BCM63XX) += pci-bcm63xx.o + ops-bcm63xx.o + obj-$(CONFIG_MIPS_ALCHEMY) += pci-alchemy.o + obj-$(CONFIG_PCI_AR2315) += pci-ar2315.o +-obj-$(CONFIG_SOC_AR71XX) += pci-ar71xx.o ++obj-$(CONFIG_PCI_AR71XX) += pci-ar71xx.o + obj-$(CONFIG_PCI_AR724X) += pci-ar724x.o + obj-$(CONFIG_PCI_XTALK_BRIDGE) += pci-xtalk-bridge.o + # diff --git a/target/linux/ath79/patches-5.15/0034-MIPS-ath79-ath9k-exports.patch b/target/linux/ath79/patches-5.15/0034-MIPS-ath79-ath9k-exports.patch new file mode 100644 index 000000000..71acc2221 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0034-MIPS-ath79-ath9k-exports.patch @@ -0,0 +1,27 @@ +--- a/arch/mips/ath79/common.c ++++ b/arch/mips/ath79/common.c +@@ -31,11 +31,13 @@ EXPORT_SYMBOL_GPL(ath79_ddr_freq); + + enum ath79_soc_type ath79_soc; + unsigned int ath79_soc_rev; ++EXPORT_SYMBOL_GPL(ath79_soc_rev); + + void __iomem *ath79_pll_base; + void __iomem *ath79_reset_base; + EXPORT_SYMBOL_GPL(ath79_reset_base); +-static void __iomem *ath79_ddr_base; ++void __iomem *ath79_ddr_base; ++EXPORT_SYMBOL_GPL(ath79_ddr_base); + static void __iomem *ath79_ddr_wb_flush_base; + static void __iomem *ath79_ddr_pci_win_base; + +--- a/arch/mips/include/asm/mach-ath79/ath79.h ++++ b/arch/mips/include/asm/mach-ath79/ath79.h +@@ -149,6 +149,7 @@ void ath79_ddr_wb_flush(unsigned int reg + void ath79_ddr_set_pci_windows(void); + + extern void __iomem *ath79_pll_base; ++extern void __iomem *ath79_ddr_base; + extern void __iomem *ath79_reset_base; + + static inline void ath79_pll_wr(unsigned reg, u32 val) diff --git a/target/linux/ath79/patches-5.15/0036-MIPS-ath79-remove-irq-code-from-pci.patch b/target/linux/ath79/patches-5.15/0036-MIPS-ath79-remove-irq-code-from-pci.patch new file mode 100644 index 000000000..80fcd0a7f --- /dev/null +++ b/target/linux/ath79/patches-5.15/0036-MIPS-ath79-remove-irq-code-from-pci.patch @@ -0,0 +1,139 @@ +--- a/arch/mips/pci/pci-ar71xx.c ++++ b/arch/mips/pci/pci-ar71xx.c +@@ -51,11 +51,9 @@ + struct ar71xx_pci_controller { + struct device_node *np; + void __iomem *cfg_base; +- int irq; + struct pci_controller pci_ctrl; + struct resource io_res; + struct resource mem_res; +- struct irq_domain *domain; + }; + + /* Byte lane enable bits */ +@@ -227,104 +225,6 @@ static struct pci_ops ar71xx_pci_ops = { + .write = ar71xx_pci_write_config, + }; + +-static void ar71xx_pci_irq_handler(struct irq_desc *desc) +-{ +- void __iomem *base = ath79_reset_base; +- struct irq_chip *chip = irq_desc_get_chip(desc); +- struct ar71xx_pci_controller *apc = irq_desc_get_handler_data(desc); +- u32 pending; +- +- chained_irq_enter(chip, desc); +- pending = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_STATUS) & +- __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); +- +- if (pending & AR71XX_PCI_INT_DEV0) +- generic_handle_irq(irq_linear_revmap(apc->domain, 1)); +- +- else if (pending & AR71XX_PCI_INT_DEV1) +- generic_handle_irq(irq_linear_revmap(apc->domain, 2)); +- +- else if (pending & AR71XX_PCI_INT_DEV2) +- generic_handle_irq(irq_linear_revmap(apc->domain, 3)); +- +- else if (pending & AR71XX_PCI_INT_CORE) +- generic_handle_irq(irq_linear_revmap(apc->domain, 4)); +- +- else +- spurious_interrupt(); +- chained_irq_exit(chip, desc); +-} +- +-static void ar71xx_pci_irq_unmask(struct irq_data *d) +-{ +- struct ar71xx_pci_controller *apc; +- unsigned int irq; +- void __iomem *base = ath79_reset_base; +- u32 t; +- +- apc = irq_data_get_irq_chip_data(d); +- irq = irq_linear_revmap(apc->domain, d->irq); +- +- t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); +- __raw_writel(t | (1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE); +- +- /* flush write */ +- __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); +-} +- +-static void ar71xx_pci_irq_mask(struct irq_data *d) +-{ +- struct ar71xx_pci_controller *apc; +- unsigned int irq; +- void __iomem *base = ath79_reset_base; +- u32 t; +- +- apc = irq_data_get_irq_chip_data(d); +- irq = irq_linear_revmap(apc->domain, d->irq); +- +- t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); +- __raw_writel(t & ~(1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE); +- +- /* flush write */ +- __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); +-} +- +-static struct irq_chip ar71xx_pci_irq_chip = { +- .name = "AR71XX PCI", +- .irq_mask = ar71xx_pci_irq_mask, +- .irq_unmask = ar71xx_pci_irq_unmask, +- .irq_mask_ack = ar71xx_pci_irq_mask, +-}; +- +-static int ar71xx_pci_irq_map(struct irq_domain *d, +- unsigned int irq, irq_hw_number_t hw) +-{ +- struct ar71xx_pci_controller *apc = d->host_data; +- +- irq_set_chip_and_handler(irq, &ar71xx_pci_irq_chip, handle_level_irq); +- irq_set_chip_data(irq, apc); +- +- return 0; +-} +- +-static const struct irq_domain_ops ar71xx_pci_domain_ops = { +- .xlate = irq_domain_xlate_onecell, +- .map = ar71xx_pci_irq_map, +-}; +- +-static void ar71xx_pci_irq_init(struct ar71xx_pci_controller *apc) +-{ +- void __iomem *base = ath79_reset_base; +- +- __raw_writel(0, base + AR71XX_RESET_REG_PCI_INT_ENABLE); +- __raw_writel(0, base + AR71XX_RESET_REG_PCI_INT_STATUS); +- +- apc->domain = irq_domain_add_linear(apc->np, AR71XX_PCI_IRQ_COUNT, +- &ar71xx_pci_domain_ops, apc); +- irq_set_chained_handler_and_data(apc->irq, ar71xx_pci_irq_handler, +- apc); +-} +- + static void ar71xx_pci_reset(void) + { + ath79_device_reset_set(AR71XX_RESET_PCI_BUS | AR71XX_RESET_PCI_CORE); +@@ -358,10 +258,6 @@ static int ar71xx_pci_probe(struct platf + if (IS_ERR(apc->cfg_base)) + return PTR_ERR(apc->cfg_base); + +- apc->irq = platform_get_irq(pdev, 0); +- if (apc->irq < 0) +- return -EINVAL; +- + ar71xx_pci_reset(); + + /* setup COMMAND register */ +@@ -372,8 +268,6 @@ static int ar71xx_pci_probe(struct platf + /* clear bus errors */ + ar71xx_pci_check_error(apc, 1); + +- ar71xx_pci_irq_init(apc); +- + apc->np = pdev->dev.of_node; + apc->pci_ctrl.pci_ops = &ar71xx_pci_ops; + apc->pci_ctrl.mem_resource = &apc->mem_res; diff --git a/target/linux/ath79/patches-5.15/0037-missing-registers.patch b/target/linux/ath79/patches-5.15/0037-missing-registers.patch new file mode 100644 index 000000000..9067e4ca7 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0037-missing-registers.patch @@ -0,0 +1,21 @@ +commit f3ffac90bc7266b7d917616f3233f58e8c08a196 +Author: Christian Lamparter +Date: Fri Aug 10 23:24:47 2018 +0200 + + ath79: gmac: add parsers for rxd(v)- and tx(d|en)-delay for AR9344 + + Signed-off-by: Christian Lamparter + +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -1226,6 +1226,10 @@ + #define AR934X_ETH_CFG_RDV_DELAY BIT(16) + #define AR934X_ETH_CFG_RDV_DELAY_MASK 0x3 + #define AR934X_ETH_CFG_RDV_DELAY_SHIFT 16 ++#define AR934X_ETH_CFG_TXD_DELAY_MASK 0x3 ++#define AR934X_ETH_CFG_TXD_DELAY_SHIFT 18 ++#define AR934X_ETH_CFG_TXE_DELAY_MASK 0x3 ++#define AR934X_ETH_CFG_TXE_DELAY_SHIFT 20 + + /* + * QCA953X GMAC Interface diff --git a/target/linux/ath79/patches-5.15/0038-MIPS-ath79-add-missing-QCA955x-GMAC-registers.patch b/target/linux/ath79/patches-5.15/0038-MIPS-ath79-add-missing-QCA955x-GMAC-registers.patch new file mode 100644 index 000000000..bc09062dc --- /dev/null +++ b/target/linux/ath79/patches-5.15/0038-MIPS-ath79-add-missing-QCA955x-GMAC-registers.patch @@ -0,0 +1,90 @@ +From 60efe35257b063ce584968f9f80b437030ce6ba6 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Mon, 18 Mar 2019 00:54:06 +0100 +Subject: [PATCH] MIPS: ath79: add missing QCA955x GMAC registers + +This adds missing GMAC register definitions for the Qualcomm Atheros +QCA955X series MIPS SoCs. + +They originate from the platforms U-Boot code and the AVM FRITZ!WLAN +Repeater 450E's GPL tarball. + +Signed-off-by: David Bauer +--- + .../mips/include/asm/mach-ath79/ar71xx_regs.h | 54 +++++++++++++++++++ + 1 file changed, 54 insertions(+) + +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -1246,7 +1246,12 @@ + */ + + #define QCA955X_GMAC_REG_ETH_CFG 0x00 ++#define QCA955X_GMAC_REG_SGMII_RESET 0x14 + #define QCA955X_GMAC_REG_SGMII_SERDES 0x18 ++#define QCA955X_GMAC_REG_MR_AN_CONTROL 0x1c ++#define QCA955X_GMAC_REG_MR_AN_STATUS 0x20 ++#define QCA955X_GMAC_REG_SGMII_CONFIG 0x34 ++#define QCA955X_GMAC_REG_SGMII_DEBUG 0x58 + + #define QCA955X_ETH_CFG_RGMII_EN BIT(0) + #define QCA955X_ETH_CFG_MII_GE0 BIT(1) +@@ -1268,9 +1273,58 @@ + #define QCA955X_ETH_CFG_TXE_DELAY_MASK 0x3 + #define QCA955X_ETH_CFG_TXE_DELAY_SHIFT 20 + ++#define QCA955X_SGMII_RESET_RX_CLK_N_RESET 0 ++#define QCA955X_SGMII_RESET_RX_CLK_N BIT(0) ++#define QCA955X_SGMII_RESET_TX_CLK_N BIT(1) ++#define QCA955X_SGMII_RESET_RX_125M_N BIT(2) ++#define QCA955X_SGMII_RESET_TX_125M_N BIT(3) ++#define QCA955X_SGMII_RESET_HW_RX_125M_N BIT(4) ++ + #define QCA955X_SGMII_SERDES_LOCK_DETECT_STATUS BIT(15) + #define QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT 23 + #define QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK 0xf ++ ++#define QCA955X_MR_AN_CONTROL_SPEED_SEL1 BIT(6) ++#define QCA955X_MR_AN_CONTROL_DUPLEX_MODE BIT(8) ++#define QCA955X_MR_AN_CONTROL_RESTART_AN BIT(9) ++#define QCA955X_MR_AN_CONTROL_POWER_DOWN BIT(11) ++#define QCA955X_MR_AN_CONTROL_AN_ENABLE BIT(12) ++#define QCA955X_MR_AN_CONTROL_SPEED_SEL0 BIT(13) ++#define QCA955X_MR_AN_CONTROL_LOOPBACK BIT(14) ++#define QCA955X_MR_AN_CONTROL_PHY_RESET BIT(15) ++ ++#define QCA955X_MR_AN_STATUS_EXT_CAP BIT(0) ++#define QCA955X_MR_AN_STATUS_LINK_UP BIT(2) ++#define QCA955X_MR_AN_STATUS_AN_ABILITY BIT(3) ++#define QCA955X_MR_AN_STATUS_REMOTE_FAULT BIT(4) ++#define QCA955X_MR_AN_STATUS_AN_COMPLETE BIT(5) ++#define QCA955X_MR_AN_STATUS_NO_PREAMBLE BIT(6) ++#define QCA955X_MR_AN_STATUS_BASE_PAGE BIT(7) ++ ++#define QCA955X_SGMII_CONFIG_MODE_CTRL_SHIFT 0 ++#define QCA955X_SGMII_CONFIG_MODE_CTRL_MASK 0x7 ++#define QCA955X_SGMII_CONFIG_ENABLE_SGMII_TX_PAUSE BIT(3) ++#define QCA955X_SGMII_CONFIG_MR_REG4_CHANGED BIT(4) ++#define QCA955X_SGMII_CONFIG_FORCE_SPEED BIT(5) ++#define QCA955X_SGMII_CONFIG_SPEED_SHIFT 6 ++#define QCA955X_SGMII_CONFIG_SPEED_MASK 0xc0 ++#define QCA955X_SGMII_CONFIG_REMOTE_PHY_LOOPBACK BIT(8) ++#define QCA955X_SGMII_CONFIG_NEXT_PAGE_LOADED BIT(9) ++#define QCA955X_SGMII_CONFIG_MDIO_ENABLE BIT(10) ++#define QCA955X_SGMII_CONFIG_MDIO_PULSE BIT(11) ++#define QCA955X_SGMII_CONFIG_MDIO_COMPLETE BIT(12) ++#define QCA955X_SGMII_CONFIG_PRBS_ENABLE BIT(13) ++#define QCA955X_SGMII_CONFIG_BERT_ENABLE BIT(14) ++ ++#define QCA955X_SGMII_DEBUG_TX_STATE_MASK 0xff ++#define QCA955X_SGMII_DEBUG_TX_STATE_SHIFT 0 ++#define QCA955X_SGMII_DEBUG_RX_STATE_MASK 0xff00 ++#define QCA955X_SGMII_DEBUG_RX_STATE_SHIFT 8 ++#define QCA955X_SGMII_DEBUG_RX_SYNC_STATE_MASK 0xff0000 ++#define QCA955X_SGMII_DEBUG_RX_SYNC_STATE_SHIFT 16 ++#define QCA955X_SGMII_DEBUG_ARB_STATE_MASK 0xf000000 ++#define QCA955X_SGMII_DEBUG_ARB_STATE_SHIFT 24 ++ + /* + * QCA956X GMAC Interface + */ diff --git a/target/linux/ath79/patches-5.15/0039-MIPS-ath79-export-UART1-reference-clock.patch b/target/linux/ath79/patches-5.15/0039-MIPS-ath79-export-UART1-reference-clock.patch new file mode 100644 index 000000000..edf888c7e --- /dev/null +++ b/target/linux/ath79/patches-5.15/0039-MIPS-ath79-export-UART1-reference-clock.patch @@ -0,0 +1,52 @@ +--- a/arch/mips/ath79/clock.c ++++ b/arch/mips/ath79/clock.c +@@ -40,6 +40,7 @@ static const char * const clk_names[ATH7 + [ATH79_CLK_AHB] = "ahb", + [ATH79_CLK_REF] = "ref", + [ATH79_CLK_MDIO] = "mdio", ++ [ATH79_CLK_UART1] = "uart1", + }; + + static const char * __init ath79_clk_name(int type) +@@ -344,6 +345,9 @@ static void __init ar934x_clocks_init(vo + if (clk_ctrl & AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL) + ath79_set_clk(ATH79_CLK_MDIO, 100 * 1000 * 1000); + ++ if (clk_ctrl & AR934X_PLL_SWITCH_CLOCK_CONTROL_UART1_CLK_SEL) ++ ath79_set_clk(ATH79_CLK_UART1, 100 * 1000 * 1000); ++ + iounmap(dpll_base); + } + +@@ -649,6 +653,9 @@ static void __init ath79_clocks_init_dt( + if (!clks[ATH79_CLK_MDIO]) + clks[ATH79_CLK_MDIO] = clks[ATH79_CLK_REF]; + ++ if (!clks[ATH79_CLK_UART1]) ++ clks[ATH79_CLK_UART1] = clks[ATH79_CLK_REF]; ++ + if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data)) { + pr_err("%pOF: could not register clk provider\n", np); + goto err_iounmap; +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -348,6 +348,7 @@ + #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) + + #define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL BIT(6) ++#define AR934X_PLL_SWITCH_CLOCK_CONTROL_UART1_CLK_SEL BIT(7) + + #define QCA953X_PLL_CPU_CONFIG_REG 0x00 + #define QCA953X_PLL_DDR_CONFIG_REG 0x04 +--- a/include/dt-bindings/clock/ath79-clk.h ++++ b/include/dt-bindings/clock/ath79-clk.h +@@ -11,7 +11,8 @@ + #define ATH79_CLK_AHB 2 + #define ATH79_CLK_REF 3 + #define ATH79_CLK_MDIO 4 ++#define ATH79_CLK_UART1 5 + +-#define ATH79_CLK_END 5 ++#define ATH79_CLK_END 6 + + #endif /* __DT_BINDINGS_ATH79_CLK_H */ diff --git a/target/linux/ath79/patches-5.15/004-register_gpio_driver_earlier.patch b/target/linux/ath79/patches-5.15/004-register_gpio_driver_earlier.patch new file mode 100644 index 000000000..153cfb438 --- /dev/null +++ b/target/linux/ath79/patches-5.15/004-register_gpio_driver_earlier.patch @@ -0,0 +1,18 @@ +HACK: register the GPIO driver earlier to ensure that gpio_request calls +from mach files succeed. + +--- a/drivers/gpio/gpio-ath79.c ++++ b/drivers/gpio/gpio-ath79.c +@@ -297,7 +297,11 @@ static struct platform_driver ath79_gpio + .probe = ath79_gpio_probe, + }; + +-module_platform_driver(ath79_gpio_driver); ++static int __init ath79_gpio_init(void) ++{ ++ return platform_driver_register(&ath79_gpio_driver); ++} ++postcore_initcall(ath79_gpio_init); + + MODULE_DESCRIPTION("Atheros AR71XX/AR724X/AR913X GPIO API support"); + MODULE_LICENSE("GPL v2"); diff --git a/target/linux/ath79/patches-5.15/0040-ath79-sgmii-config.patch b/target/linux/ath79/patches-5.15/0040-ath79-sgmii-config.patch new file mode 100644 index 000000000..bf7cbf271 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0040-ath79-sgmii-config.patch @@ -0,0 +1,9 @@ +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -1376,5 +1376,6 @@ + + #define QCA956X_SGMII_CONFIG_MODE_CTRL_SHIFT 0 + #define QCA956X_SGMII_CONFIG_MODE_CTRL_MASK 0x7 ++#define QCA956X_SGMII_CONFIG_MODE_CTRL_SGMII_MAC 0x2 + + #endif /* __ASM_MACH_AR71XX_REGS_H */ diff --git a/target/linux/ath79/patches-5.15/0062-MIPS-pci-ar724x-add-QCA9550-reset-sequence.patch b/target/linux/ath79/patches-5.15/0062-MIPS-pci-ar724x-add-QCA9550-reset-sequence.patch new file mode 100644 index 000000000..f596ddb73 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0062-MIPS-pci-ar724x-add-QCA9550-reset-sequence.patch @@ -0,0 +1,130 @@ +From: David Bauer +Date: Sat, 11 Apr 2020 14:03:12 +0200 +Subject: MIPS: pci-ar724x: add QCA9550 reset sequence + +The QCA9550 family of SoCs have a slightly different reset +sequence compared to older chips. + +Normally the bootloader performs this sequence, however +some bootloader implementation expect the operating system +to clear the reset. + +Also get the resets from OF to support handling of the second +PCIe root-complex on the QCA9558. + +Signed-off-by: David Bauer + +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -391,6 +391,7 @@ + #define QCA955X_PLL_CPU_CONFIG_REG 0x00 + #define QCA955X_PLL_DDR_CONFIG_REG 0x04 + #define QCA955X_PLL_CLK_CTRL_REG 0x08 ++#define QCA955X_PLL_PCIE_CONFIG_REG 0x0c + #define QCA955X_PLL_ETH_XMII_CONTROL_REG 0x28 + #define QCA955X_PLL_ETH_SGMII_CONTROL_REG 0x48 + #define QCA955X_PLL_ETH_SGMII_SERDES_REG 0x4c +@@ -476,6 +477,9 @@ + #define QCA956X_PLL_CLK_CTRL_CPU_DDRCLK_FROM_CPUPLL BIT(21) + #define QCA956X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) + ++#define QCA955X_PLL_PCIE_CONFIG_PLL_PWD BIT(30) ++#define QCA955X_PLL_PCIE_CONFIG_PLL_BYPASS BIT(16) ++ + #define QCA956X_PLL_SWITCH_CLOCK_SPARE_I2C_CLK_SELB BIT(5) + #define QCA956X_PLL_SWITCH_CLOCK_SPARE_MDIO_CLK_SEL0_1 BIT(6) + #define QCA956X_PLL_SWITCH_CLOCK_SPARE_UART1_CLK_SEL BIT(7) +--- a/arch/mips/pci/pci-ar724x.c ++++ b/arch/mips/pci/pci-ar724x.c +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -55,6 +56,9 @@ struct ar724x_pci_controller { + struct irq_domain *domain; + struct resource io_res; + struct resource mem_res; ++ ++ struct reset_control *hc_reset; ++ struct reset_control *phy_reset; + }; + + static struct irq_chip ar724x_pci_irq_chip; +@@ -340,18 +344,30 @@ static void ar724x_pci_hw_init(struct ar + int wait = 0; + + /* deassert PCIe host controller and PCIe PHY reset */ +- ath79_device_reset_clear(AR724X_RESET_PCIE); +- ath79_device_reset_clear(AR724X_RESET_PCIE_PHY); ++ reset_control_deassert(apc->hc_reset); ++ reset_control_deassert(apc->phy_reset); + +- /* remove the reset of the PCIE PLL */ +- ppl = ath79_pll_rr(AR724X_PLL_REG_PCIE_CONFIG); +- ppl &= ~AR724X_PLL_REG_PCIE_CONFIG_PPL_RESET; +- ath79_pll_wr(AR724X_PLL_REG_PCIE_CONFIG, ppl); +- +- /* deassert bypass for the PCIE PLL */ +- ppl = ath79_pll_rr(AR724X_PLL_REG_PCIE_CONFIG); +- ppl &= ~AR724X_PLL_REG_PCIE_CONFIG_PPL_BYPASS; +- ath79_pll_wr(AR724X_PLL_REG_PCIE_CONFIG, ppl); ++ if (of_device_is_compatible(apc->np, "qcom,qca9550-pci")) { ++ /* remove the reset of the PCIE PLL */ ++ ppl = ath79_pll_rr(QCA955X_PLL_PCIE_CONFIG_REG); ++ ppl &= ~QCA955X_PLL_PCIE_CONFIG_PLL_PWD; ++ ath79_pll_wr(QCA955X_PLL_PCIE_CONFIG_REG, ppl); ++ ++ /* deassert bypass for the PCIE PLL */ ++ ppl = ath79_pll_rr(QCA955X_PLL_PCIE_CONFIG_REG); ++ ppl &= ~QCA955X_PLL_PCIE_CONFIG_PLL_BYPASS; ++ ath79_pll_wr(QCA955X_PLL_PCIE_CONFIG_REG, ppl); ++ } else { ++ /* remove the reset of the PCIE PLL */ ++ ppl = ath79_pll_rr(AR724X_PLL_REG_PCIE_CONFIG); ++ ppl &= ~AR724X_PLL_REG_PCIE_CONFIG_PPL_RESET; ++ ath79_pll_wr(AR724X_PLL_REG_PCIE_CONFIG, ppl); ++ ++ /* deassert bypass for the PCIE PLL */ ++ ppl = ath79_pll_rr(AR724X_PLL_REG_PCIE_CONFIG); ++ ppl &= ~AR724X_PLL_REG_PCIE_CONFIG_PPL_BYPASS; ++ ath79_pll_wr(AR724X_PLL_REG_PCIE_CONFIG, ppl); ++ } + + /* set PCIE Application Control to ready */ + app = __raw_readl(apc->ctrl_base + AR724X_PCI_REG_APP); +@@ -396,6 +412,14 @@ static int ar724x_pci_probe(struct platf + if (apc->irq < 0) + return -EINVAL; + ++ apc->hc_reset = devm_reset_control_get_exclusive(&pdev->dev, "hc"); ++ if (IS_ERR(apc->hc_reset)) ++ return PTR_ERR(apc->hc_reset); ++ ++ apc->phy_reset = devm_reset_control_get_exclusive(&pdev->dev, "phy"); ++ if (IS_ERR(apc->phy_reset)) ++ return PTR_ERR(apc->phy_reset); ++ + apc->np = pdev->dev.of_node; + apc->pci_controller.pci_ops = &ar724x_pci_ops; + apc->pci_controller.io_resource = &apc->io_res; +@@ -406,7 +430,7 @@ static int ar724x_pci_probe(struct platf + * Do the full PCIE Root Complex Initialization Sequence if the PCIe + * host controller is in reset. + */ +- if (ath79_reset_rr(AR724X_RESET_REG_RESET_MODULE) & AR724X_RESET_PCIE) ++ if (reset_control_status(apc->hc_reset)) + ar724x_pci_hw_init(apc); + + apc->link_up = ar724x_pci_check_link(apc); +@@ -424,6 +448,7 @@ static int ar724x_pci_probe(struct platf + + static const struct of_device_id ar724x_pci_ids[] = { + { .compatible = "qcom,ar7240-pci" }, ++ { .compatible = "qcom,qca9550-pci" }, + {}, + }; + diff --git a/target/linux/ath79/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/ath79/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch new file mode 100644 index 000000000..b21a7f771 --- /dev/null +++ b/target/linux/ath79/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -0,0 +1,54 @@ +From f32bc2aa01edcba2f2ed5db151cf183eac9ef919 Mon Sep 17 00:00:00 2001 +From: Abhimanyu Vishwakarma +Date: Sat, 25 Feb 2017 16:42:50 +0000 +Subject: mtd: nor: support mtd name from device tree + +Signed-off-by: Abhimanyu Vishwakarma +--- + drivers/mtd/spi-nor/spi-nor.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/spi-nor/core.c ++++ b/drivers/mtd/spi-nor/core.c +@@ -3101,6 +3101,7 @@ int spi_nor_scan(struct spi_nor *nor, co + struct device *dev = nor->dev; + struct mtd_info *mtd = &nor->mtd; + struct device_node *np = spi_nor_get_flash_node(nor); ++ const char __maybe_unused *of_mtd_name = NULL; + int ret; + int i; + +@@ -3155,7 +3156,12 @@ int spi_nor_scan(struct spi_nor *nor, co + if (ret) + return ret; + +- if (!mtd->name) ++#ifdef CONFIG_MTD_OF_PARTS ++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name); ++#endif ++ if (of_mtd_name) ++ mtd->name = of_mtd_name; ++ else if (!mtd->name) + mtd->name = dev_name(dev); + mtd->priv = nor; + mtd->type = MTD_NORFLASH; +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -778,6 +778,17 @@ out_error: + */ + static void mtd_set_dev_defaults(struct mtd_info *mtd) + { ++#ifdef CONFIG_MTD_OF_PARTS ++ const char __maybe_unused *of_mtd_name = NULL; ++ struct device_node *np; ++ ++ np = mtd_get_of_node(mtd); ++ if (np && !mtd->name) { ++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name); ++ if (of_mtd_name) ++ mtd->name = of_mtd_name; ++ } else ++#endif + if (mtd->dev.parent) { + if (!mtd->owner && mtd->dev.parent->driver) + mtd->owner = mtd->dev.parent->driver->owner; diff --git a/target/linux/ath79/patches-5.15/404-mtd-cybertan-trx-parser.patch b/target/linux/ath79/patches-5.15/404-mtd-cybertan-trx-parser.patch new file mode 100644 index 000000000..923589661 --- /dev/null +++ b/target/linux/ath79/patches-5.15/404-mtd-cybertan-trx-parser.patch @@ -0,0 +1,27 @@ +--- a/drivers/mtd/parsers/Makefile ++++ b/drivers/mtd/parsers/Makefile +@@ -8,6 +8,7 @@ obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o + ofpart-y += ofpart_core.o + ofpart-$(CONFIG_MTD_OF_PARTS_BCM4908) += ofpart_bcm4908.o + ofpart-$(CONFIG_MTD_OF_PARTS_LINKSYS_NS)+= ofpart_linksys_ns.o ++obj-$(CONFIG_MTD_PARSER_CYBERTAN) += parser_cybertan.o + obj-$(CONFIG_MTD_PARSER_IMAGETAG) += parser_imagetag.o + obj-$(CONFIG_MTD_AFS_PARTS) += afs.o + obj-$(CONFIG_MTD_PARSER_TRX) += parser_trx.o +--- a/drivers/mtd/parsers/Kconfig ++++ b/drivers/mtd/parsers/Kconfig +@@ -102,6 +102,14 @@ config MTD_OF_PARTS_LINKSYS_NS + two "firmware" partitions. Currently used firmware has to be detected + using CFE environment variable. + ++config MTD_PARSER_CYBERTAN ++ tristate "Parser for Cybertan format partitions" ++ depends on MTD && (ATH79 || COMPILE_TEST) ++ help ++ Cybertan has a proprietory header than encompasses a Broadcom trx ++ header. This driver will parse the header and take care of the ++ special offsets that result in the extra headers. ++ + config MTD_PARSER_IMAGETAG + tristate "Parser for BCM963XX Image Tag format partitions" + depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST diff --git a/target/linux/ath79/patches-5.15/408-mtd-redboot_partition_scan.patch b/target/linux/ath79/patches-5.15/408-mtd-redboot_partition_scan.patch new file mode 100644 index 000000000..905c1319d --- /dev/null +++ b/target/linux/ath79/patches-5.15/408-mtd-redboot_partition_scan.patch @@ -0,0 +1,45 @@ +--- a/drivers/mtd/parsers/redboot.c ++++ b/drivers/mtd/parsers/redboot.c +@@ -90,12 +90,18 @@ static int parse_redboot_partitions(stru + + parse_redboot_of(master); + ++ 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: + pr_notice("Failed to find a non-bad block to check for RedBoot partition table\n"); ++ vfree(buf); + return -EIO; + } + offset -= master->erasesize; +@@ -108,10 +113,6 @@ nogood: + goto nogood; + } + } +- buf = vmalloc(master->erasesize); +- +- if (!buf) +- return -ENOMEM; + + pr_notice("Searching for RedBoot partition table in %s at offset 0x%lx\n", + master->name, offset); +@@ -183,6 +184,12 @@ nogood: + } + 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; ++ } ++ + pr_notice("No RedBoot partition table detected in %s\n", + master->name); + ret = 0; diff --git a/target/linux/ath79/patches-5.15/410-spi-ath79-Implement-the-spi_mem-interface.patch b/target/linux/ath79/patches-5.15/410-spi-ath79-Implement-the-spi_mem-interface.patch new file mode 100644 index 000000000..5746a889e --- /dev/null +++ b/target/linux/ath79/patches-5.15/410-spi-ath79-Implement-the-spi_mem-interface.patch @@ -0,0 +1,68 @@ +From 8d8cdb4a6ccee5b62cc0dc64651c3946364514dc Mon Sep 17 00:00:00 2001 +From: Luiz Angelo Daros de Luca +Date: Mon, 10 Feb 2020 16:11:27 -0300 +Subject: [PATCH] spi: ath79: Implement the spi_mem interface + +Signed-off-by: Luiz Angelo Daros de Luca +--- + drivers/spi/spi-ath79.c | 35 +++++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +--- a/drivers/spi/spi-ath79.c ++++ b/drivers/spi/spi-ath79.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -133,6 +134,39 @@ static u32 ath79_spi_txrx_mode0(struct s + return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS); + } + ++static int ath79_exec_mem_op(struct spi_mem *mem, ++ const struct spi_mem_op *op) ++{ ++ struct ath79_spi *sp = ath79_spidev_to_sp(mem->spi); ++ ++ /* Ensures that reading is performed on device connected ++ to hardware cs0 */ ++ if (mem->spi->chip_select || mem->spi->cs_gpiod) ++ return -ENOTSUPP; ++ ++ /* Only use for fast-read op. */ ++ if (op->cmd.opcode != 0x0b || op->data.dir != SPI_MEM_DATA_IN || ++ op->addr.nbytes != 3 || op->dummy.nbytes != 1) ++ return -ENOTSUPP; ++ ++ /* disable GPIO mode */ ++ ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0); ++ ++ memcpy_fromio(op->data.buf.in, sp->base + op->addr.val, op->data.nbytes); ++ ++ /* enable GPIO mode */ ++ ath79_spi_wr(sp, AR71XX_SPI_REG_FS, AR71XX_SPI_FS_GPIO); ++ ++ /* restore IOC register */ ++ ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, sp->ioc_base); ++ ++ return 0; ++} ++ ++static const struct spi_controller_mem_ops ath79_mem_ops = { ++ .exec_op = ath79_exec_mem_op, ++}; ++ + static int ath79_spi_probe(struct platform_device *pdev) + { + struct spi_master *master; +@@ -165,6 +199,7 @@ static int ath79_spi_probe(struct platfo + ret = PTR_ERR(sp->base); + goto err_put_master; + } ++ master->mem_ops = &ath79_mem_ops; + + sp->clk = devm_clk_get(&pdev->dev, "ahb"); + if (IS_ERR(sp->clk)) { diff --git a/target/linux/ath79/patches-5.15/420-net-use-downstream-ag71xx.patch b/target/linux/ath79/patches-5.15/420-net-use-downstream-ag71xx.patch new file mode 100644 index 000000000..7a1a03430 --- /dev/null +++ b/target/linux/ath79/patches-5.15/420-net-use-downstream-ag71xx.patch @@ -0,0 +1,29 @@ +--- a/drivers/net/ethernet/atheros/Kconfig ++++ b/drivers/net/ethernet/atheros/Kconfig +@@ -17,14 +17,7 @@ config NET_VENDOR_ATHEROS + + if NET_VENDOR_ATHEROS + +-config AG71XX +- tristate "Atheros AR7XXX/AR9XXX built-in ethernet mac support" +- depends on ATH79 +- select PHYLINK +- imply NET_SELFTESTS +- help +- If you wish to compile a kernel for AR7XXX/91XXX and enable +- ethernet support, then you should always answer Y to this. ++source "drivers/net/ethernet/atheros/ag71xx/Kconfig" + + config ATL2 + tristate "Atheros L2 Fast Ethernet support" +--- a/drivers/net/ethernet/atheros/Makefile ++++ b/drivers/net/ethernet/atheros/Makefile +@@ -3,7 +3,7 @@ + # Makefile for the Atheros network device drivers. + # + +-obj-$(CONFIG_AG71XX) += ag71xx.o ++obj-$(CONFIG_AG71XX) += ag71xx/ + obj-$(CONFIG_ATL1) += atlx/ + obj-$(CONFIG_ATL2) += atlx/ + obj-$(CONFIG_ATL1E) += atl1e/ diff --git a/target/linux/ath79/patches-5.15/430-drivers-link-spi-before-mtd.patch b/target/linux/ath79/patches-5.15/430-drivers-link-spi-before-mtd.patch new file mode 100644 index 000000000..4c6558db9 --- /dev/null +++ b/target/linux/ath79/patches-5.15/430-drivers-link-spi-before-mtd.patch @@ -0,0 +1,12 @@ +--- a/drivers/Makefile ++++ b/drivers/Makefile +@@ -80,8 +80,8 @@ obj-y += scsi/ + obj-y += nvme/ + obj-$(CONFIG_ATA) += ata/ + obj-$(CONFIG_TARGET_CORE) += target/ +-obj-$(CONFIG_MTD) += mtd/ + obj-$(CONFIG_SPI) += spi/ ++obj-$(CONFIG_MTD) += mtd/ + obj-$(CONFIG_SPMI) += spmi/ + obj-$(CONFIG_HSI) += hsi/ + obj-$(CONFIG_SLIMBUS) += slimbus/ diff --git a/target/linux/ath79/patches-5.15/440-mtd-ar934x-nand-driver.patch b/target/linux/ath79/patches-5.15/440-mtd-ar934x-nand-driver.patch new file mode 100644 index 000000000..3ce64aa51 --- /dev/null +++ b/target/linux/ath79/patches-5.15/440-mtd-ar934x-nand-driver.patch @@ -0,0 +1,25 @@ +--- a/drivers/mtd/nand/raw/Kconfig ++++ b/drivers/mtd/nand/raw/Kconfig +@@ -555,4 +555,12 @@ config MTD_NAND_DISKONCHIP_BBTWRITE + load time (assuming you build diskonchip as a module) with the module + parameter "inftl_bbt_write=1". + ++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_RAW_NAND +--- a/drivers/mtd/nand/raw/Makefile ++++ b/drivers/mtd/nand/raw/Makefile +@@ -58,6 +58,7 @@ obj-$(CONFIG_MTD_NAND_ARASAN) += arasan + obj-$(CONFIG_MTD_NAND_INTEL_LGM) += intel-nand-controller.o + obj-$(CONFIG_MTD_NAND_ROCKCHIP) += rockchip-nand-controller.o + obj-$(CONFIG_MTD_NAND_PL35X) += pl35x-nand-controller.o ++obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o + + nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o + nand-objs += nand_onfi.o diff --git a/target/linux/ath79/patches-5.15/470-MIPS-ath79-swizzle-pci-address-for-ar71xx.patch b/target/linux/ath79/patches-5.15/470-MIPS-ath79-swizzle-pci-address-for-ar71xx.patch new file mode 100644 index 000000000..924faec50 --- /dev/null +++ b/target/linux/ath79/patches-5.15/470-MIPS-ath79-swizzle-pci-address-for-ar71xx.patch @@ -0,0 +1,98 @@ +--- /dev/null ++++ b/arch/mips/include/asm/mach-ath79/mangle-port.h +@@ -0,0 +1,37 @@ ++/* ++ * Copyright (C) 2012 Gabor Juhos ++ * ++ * This file was derived from: inlude/asm-mips/mach-generic/mangle-port.h ++ * Copyright (C) 2003, 2004 Ralf Baechle ++ * ++ * 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. ++ */ ++ ++#ifndef __ASM_MACH_ATH79_MANGLE_PORT_H ++#define __ASM_MACH_ATH79_MANGLE_PORT_H ++ ++#ifdef CONFIG_PCI_AR71XX ++extern unsigned long (ath79_pci_swizzle_b)(unsigned long port); ++extern unsigned long (ath79_pci_swizzle_w)(unsigned long port); ++#else ++#define ath79_pci_swizzle_b(port) (port) ++#define ath79_pci_swizzle_w(port) (port) ++#endif ++ ++#define __swizzle_addr_b(port) ath79_pci_swizzle_b(port) ++#define __swizzle_addr_w(port) ath79_pci_swizzle_w(port) ++#define __swizzle_addr_l(port) (port) ++#define __swizzle_addr_q(port) (port) ++ ++# define ioswabb(a, x) (x) ++# define __mem_ioswabb(a, x) (x) ++# define ioswabw(a, x) (x) ++# define __mem_ioswabw(a, x) cpu_to_le16(x) ++# define ioswabl(a, x) (x) ++# define __mem_ioswabl(a, x) cpu_to_le32(x) ++# define ioswabq(a, x) (x) ++# define __mem_ioswabq(a, x) cpu_to_le64(x) ++ ++#endif /* __ASM_MACH_ATH79_MANGLE_PORT_H */ +--- a/arch/mips/pci/pci-ar71xx.c ++++ b/arch/mips/pci/pci-ar71xx.c +@@ -68,6 +68,45 @@ static const u32 ar71xx_pci_read_mask[8] + 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0 + }; + ++static unsigned long (*__ath79_pci_swizzle_b)(unsigned long port); ++static unsigned long (*__ath79_pci_swizzle_w)(unsigned long port); ++ ++static inline bool ar71xx_is_pci_addr(unsigned long port) ++{ ++ unsigned long phys = CPHYSADDR(port); ++ ++ return (phys >= AR71XX_PCI_MEM_BASE && ++ phys < AR71XX_PCI_MEM_BASE + AR71XX_PCI_MEM_SIZE); ++} ++ ++static unsigned long ar71xx_pci_swizzle_b(unsigned long port) ++{ ++ return ar71xx_is_pci_addr(port) ? port ^ 3 : port; ++} ++ ++static unsigned long ar71xx_pci_swizzle_w(unsigned long port) ++{ ++ return ar71xx_is_pci_addr(port) ? port ^ 2 : port; ++} ++ ++unsigned long ath79_pci_swizzle_b(unsigned long port) ++{ ++ if (__ath79_pci_swizzle_b) ++ return __ath79_pci_swizzle_b(port); ++ ++ return port; ++} ++EXPORT_SYMBOL(ath79_pci_swizzle_b); ++ ++unsigned long ath79_pci_swizzle_w(unsigned long port) ++{ ++ if (__ath79_pci_swizzle_w) ++ return __ath79_pci_swizzle_w(port); ++ ++ return port; ++} ++EXPORT_SYMBOL(ath79_pci_swizzle_w); ++ + static inline u32 ar71xx_pci_get_ble(int where, int size, int local) + { + u32 t; +@@ -276,6 +315,9 @@ static int ar71xx_pci_probe(struct platf + + register_pci_controller(&apc->pci_ctrl); + ++ __ath79_pci_swizzle_b = ar71xx_pci_swizzle_b; ++ __ath79_pci_swizzle_w = ar71xx_pci_swizzle_w; ++ + return 0; + } + diff --git a/target/linux/ath79/patches-5.15/900-mdio_bitbang_ignore_ta_value.patch b/target/linux/ath79/patches-5.15/900-mdio_bitbang_ignore_ta_value.patch new file mode 100644 index 000000000..4c8d2c2ea --- /dev/null +++ b/target/linux/ath79/patches-5.15/900-mdio_bitbang_ignore_ta_value.patch @@ -0,0 +1,32 @@ +--- a/drivers/net/mdio/mdio-bitbang.c ++++ b/drivers/net/mdio/mdio-bitbang.c +@@ -152,7 +152,7 @@ static int mdiobb_cmd_addr(struct mdiobb + int mdiobb_read(struct mii_bus *bus, int phy, int reg) + { + struct mdiobb_ctrl *ctrl = bus->priv; +- int ret, i; ++ int ret; + + if (reg & MII_ADDR_C45) { + reg = mdiobb_cmd_addr(ctrl, phy, reg); +@@ -162,19 +162,7 @@ int mdiobb_read(struct mii_bus *bus, int + + ctrl->ops->set_mdio_dir(ctrl, 0); + +- /* check the turnaround bit: the PHY should be driving it to zero, if this +- * PHY is listed in phy_ignore_ta_mask as having broken TA, skip that +- */ +- if (mdiobb_get_bit(ctrl) != 0 && +- !(bus->phy_ignore_ta_mask & (1 << phy))) { +- /* PHY didn't drive TA low -- flush any bits it +- * may be trying to send. +- */ +- for (i = 0; i < 32; i++) +- mdiobb_get_bit(ctrl); +- +- return 0xffff; +- } ++ mdiobb_get_bit(ctrl); + + ret = mdiobb_get_num(ctrl, 16); + mdiobb_get_bit(ctrl); diff --git a/target/linux/ath79/patches-5.15/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch b/target/linux/ath79/patches-5.15/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch new file mode 100644 index 000000000..e37d9a1f6 --- /dev/null +++ b/target/linux/ath79/patches-5.15/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch @@ -0,0 +1,61 @@ +From 66e584435ac0de6e0abeb6d7166fe4fe25d6bb73 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Tue, 16 Jun 2015 13:15:08 +0200 +Subject: [PATCH] phy/mdio-bitbang: prevent rescheduling during command + +It seems some phys have some maximum timings for accessing the MDIO line, +resulting in bit errors under cpu stress. Prevent this from happening by +disabling interrupts when sending commands. + +Signed-off-by: Jonas Gorski +--- + drivers/net/mdio/mdio-bitbang.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/net/mdio/mdio-bitbang.c ++++ b/drivers/net/mdio/mdio-bitbang.c +@@ -14,6 +14,7 @@ + * Vitaly Bordug + */ + ++#include + #include + #include + #include +@@ -153,7 +154,9 @@ int mdiobb_read(struct mii_bus *bus, int + { + struct mdiobb_ctrl *ctrl = bus->priv; + int ret; ++ unsigned long flags; + ++ local_irq_save(flags); + if (reg & MII_ADDR_C45) { + reg = mdiobb_cmd_addr(ctrl, phy, reg); + mdiobb_cmd(ctrl, MDIO_C45_READ, phy, reg); +@@ -166,6 +169,7 @@ int mdiobb_read(struct mii_bus *bus, int + + ret = mdiobb_get_num(ctrl, 16); + mdiobb_get_bit(ctrl); ++ local_irq_restore(flags); + return ret; + } + EXPORT_SYMBOL(mdiobb_read); +@@ -173,7 +177,9 @@ EXPORT_SYMBOL(mdiobb_read); + int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val) + { + struct mdiobb_ctrl *ctrl = bus->priv; ++ unsigned long flags; + ++ local_irq_save(flags); + if (reg & MII_ADDR_C45) { + reg = mdiobb_cmd_addr(ctrl, phy, reg); + mdiobb_cmd(ctrl, MDIO_C45_WRITE, phy, reg); +@@ -188,6 +194,8 @@ int mdiobb_write(struct mii_bus *bus, in + + ctrl->ops->set_mdio_dir(ctrl, 0); + mdiobb_get_bit(ctrl); ++ local_irq_restore(flags); ++ + return 0; + } + EXPORT_SYMBOL(mdiobb_write); diff --git a/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch new file mode 100644 index 000000000..7196d28fb --- /dev/null +++ b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch @@ -0,0 +1,855 @@ +--- a/arch/mips/include/asm/checksum.h ++++ b/arch/mips/include/asm/checksum.h +@@ -100,26 +100,30 @@ static inline __sum16 ip_fast_csum(const + const unsigned int *stop = word + ihl; + unsigned int csum; + int carry; ++ unsigned int w; + +- csum = word[0]; +- csum += word[1]; +- carry = (csum < word[1]); ++ csum = net_hdr_word(word++); ++ ++ w = net_hdr_word(word++); ++ csum += w; ++ carry = (csum < w); + csum += carry; + +- csum += word[2]; +- carry = (csum < word[2]); ++ w = net_hdr_word(word++); ++ csum += w; ++ carry = (csum < w); + csum += carry; + +- csum += word[3]; +- carry = (csum < word[3]); ++ w = net_hdr_word(word++); ++ csum += w; ++ carry = (csum < w); + csum += carry; + +- word += 4; + do { +- csum += *word; +- carry = (csum < *word); ++ w = net_hdr_word(word++); ++ csum += w; ++ carry = (csum < w); + csum += carry; +- word++; + } while (word != stop); + + return csum_fold(csum); +@@ -182,73 +186,6 @@ static inline __sum16 ip_compute_csum(co + return csum_fold(csum_partial(buff, len, 0)); + } + +-#define _HAVE_ARCH_IPV6_CSUM +-static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, +- const struct in6_addr *daddr, +- __u32 len, __u8 proto, +- __wsum sum) +-{ +- __wsum tmp; +- +- __asm__( +- " .set push # csum_ipv6_magic\n" +- " .set noreorder \n" +- " .set noat \n" +- " addu %0, %5 # proto (long in network byte order)\n" +- " sltu $1, %0, %5 \n" +- " addu %0, $1 \n" +- +- " addu %0, %6 # csum\n" +- " sltu $1, %0, %6 \n" +- " lw %1, 0(%2) # four words source address\n" +- " addu %0, $1 \n" +- " addu %0, %1 \n" +- " sltu $1, %0, %1 \n" +- +- " lw %1, 4(%2) \n" +- " addu %0, $1 \n" +- " addu %0, %1 \n" +- " sltu $1, %0, %1 \n" +- +- " lw %1, 8(%2) \n" +- " addu %0, $1 \n" +- " addu %0, %1 \n" +- " sltu $1, %0, %1 \n" +- +- " lw %1, 12(%2) \n" +- " addu %0, $1 \n" +- " addu %0, %1 \n" +- " sltu $1, %0, %1 \n" +- +- " lw %1, 0(%3) \n" +- " addu %0, $1 \n" +- " addu %0, %1 \n" +- " sltu $1, %0, %1 \n" +- +- " lw %1, 4(%3) \n" +- " addu %0, $1 \n" +- " addu %0, %1 \n" +- " sltu $1, %0, %1 \n" +- +- " lw %1, 8(%3) \n" +- " addu %0, $1 \n" +- " addu %0, %1 \n" +- " sltu $1, %0, %1 \n" +- +- " lw %1, 12(%3) \n" +- " addu %0, $1 \n" +- " addu %0, %1 \n" +- " sltu $1, %0, %1 \n" +- +- " addu %0, $1 # Add final carry\n" +- " .set pop" +- : "=&r" (sum), "=&r" (tmp) +- : "r" (saddr), "r" (daddr), +- "0" (htonl(len)), "r" (htonl(proto)), "r" (sum)); +- +- return csum_fold(sum); +-} +- + #include + #endif /* CONFIG_GENERIC_CSUM */ + +--- a/include/uapi/linux/ip.h ++++ b/include/uapi/linux/ip.h +@@ -103,7 +103,7 @@ struct iphdr { + __be32 saddr; + __be32 daddr; + /*The options start here. */ +-}; ++} __attribute__((packed, aligned(2))); + + + struct ip_auth_hdr { +--- a/include/uapi/linux/ipv6.h ++++ b/include/uapi/linux/ipv6.h +@@ -132,7 +132,7 @@ struct ipv6hdr { + + struct in6_addr saddr; + struct in6_addr daddr; +-}; ++} __attribute__((packed, aligned(2))); + + + /* index values for the variables in ipv6_devconf */ +--- a/include/uapi/linux/tcp.h ++++ b/include/uapi/linux/tcp.h +@@ -55,7 +55,7 @@ struct tcphdr { + __be16 window; + __sum16 check; + __be16 urg_ptr; +-}; ++} __attribute__((packed, aligned(2))); + + /* + * The union cast uses a gcc extension to avoid aliasing problems +@@ -65,7 +65,7 @@ struct tcphdr { + union tcp_word_hdr { + struct tcphdr hdr; + __be32 words[5]; +-}; ++} __attribute__((packed, aligned(2))); + + #define tcp_flag_word(tp) (((union tcp_word_hdr *)(tp))->words[3]) + +--- a/include/uapi/linux/udp.h ++++ b/include/uapi/linux/udp.h +@@ -25,7 +25,7 @@ struct udphdr { + __be16 dest; + __be16 len; + __sum16 check; +-}; ++} __attribute__((packed, aligned(2))); + + /* UDP socket options */ + #define UDP_CORK 1 /* Never send partially complete segments */ +--- a/net/netfilter/nf_conntrack_core.c ++++ b/net/netfilter/nf_conntrack_core.c +@@ -292,8 +292,8 @@ nf_ct_get_tuple(const struct sk_buff *sk + + switch (l3num) { + case NFPROTO_IPV4: +- tuple->src.u3.ip = ap[0]; +- tuple->dst.u3.ip = ap[1]; ++ tuple->src.u3.ip = net_hdr_word(ap++); ++ tuple->dst.u3.ip = net_hdr_word(ap); + break; + case NFPROTO_IPV6: + memcpy(tuple->src.u3.ip6, ap, sizeof(tuple->src.u3.ip6)); +--- a/include/uapi/linux/icmp.h ++++ b/include/uapi/linux/icmp.h +@@ -102,7 +102,7 @@ struct icmphdr { + } frag; + __u8 reserved[4]; + } un; +-}; ++} __attribute__((packed, aligned(2))); + + + /* +--- a/include/uapi/linux/in6.h ++++ b/include/uapi/linux/in6.h +@@ -43,7 +43,7 @@ struct in6_addr { + #define s6_addr16 in6_u.u6_addr16 + #define s6_addr32 in6_u.u6_addr32 + #endif +-}; ++} __attribute__((packed, aligned(2))); + #endif /* __UAPI_DEF_IN6_ADDR */ + + #if __UAPI_DEF_SOCKADDR_IN6 +--- a/net/ipv6/tcp_ipv6.c ++++ b/net/ipv6/tcp_ipv6.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -941,10 +942,10 @@ static void tcp_v6_send_response(const s + topt = (__be32 *)(t1 + 1); + + if (tsecr) { +- *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | +- (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP); +- *topt++ = htonl(tsval); +- *topt++ = htonl(tsecr); ++ put_unaligned_be32((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | ++ (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP, topt++); ++ put_unaligned_be32(tsval, topt++); ++ put_unaligned_be32(tsecr, topt++); + } + + if (mrst) +--- a/include/linux/ipv6.h ++++ b/include/linux/ipv6.h +@@ -6,6 +6,7 @@ + + #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) + #define ipv6_authlen(p) (((p)->hdrlen+2) << 2) ++ + /* + * This structure contains configuration options per IPv6 link. + */ +--- a/net/ipv6/datagram.c ++++ b/net/ipv6/datagram.c +@@ -492,7 +492,7 @@ int ipv6_recv_error(struct sock *sk, str + ipv6_iface_scope_id(&sin->sin6_addr, + IP6CB(skb)->iif); + } else { +- ipv6_addr_set_v4mapped(*(__be32 *)(nh + serr->addr_offset), ++ ipv6_addr_set_v4mapped(net_hdr_word(nh + serr->addr_offset), + &sin->sin6_addr); + sin->sin6_scope_id = 0; + } +@@ -846,12 +846,12 @@ int ip6_datagram_send_ctl(struct net *ne + } + + if (fl6->flowlabel&IPV6_FLOWINFO_MASK) { +- if ((fl6->flowlabel^*(__be32 *)CMSG_DATA(cmsg))&~IPV6_FLOWINFO_MASK) { ++ if ((fl6->flowlabel^net_hdr_word(CMSG_DATA(cmsg)))&~IPV6_FLOWINFO_MASK) { + err = -EINVAL; + goto exit_f; + } + } +- fl6->flowlabel = IPV6_FLOWINFO_MASK & *(__be32 *)CMSG_DATA(cmsg); ++ fl6->flowlabel = IPV6_FLOWINFO_MASK & net_hdr_word(CMSG_DATA(cmsg)); + break; + + case IPV6_2292HOPOPTS: +--- a/net/ipv6/exthdrs.c ++++ b/net/ipv6/exthdrs.c +@@ -1009,7 +1009,7 @@ static bool ipv6_hop_jumbo(struct sk_buf + goto drop; + } + +- pkt_len = ntohl(*(__be32 *)(nh + optoff + 2)); ++ pkt_len = ntohl(net_hdr_word(nh + optoff + 2)); + if (pkt_len <= IPV6_MAXPLEN) { + __IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS); + icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2); +--- a/include/linux/types.h ++++ b/include/linux/types.h +@@ -231,5 +231,11 @@ typedef void (*swap_func_t)(void *a, voi + typedef int (*cmp_r_func_t)(const void *a, const void *b, const void *priv); + typedef int (*cmp_func_t)(const void *a, const void *b); + ++struct net_hdr_word { ++ u32 words[1]; ++} __attribute__((packed, aligned(2))); ++ ++#define net_hdr_word(_p) (((struct net_hdr_word *) (_p))->words[0]) ++ + #endif /* __ASSEMBLY__ */ + #endif /* _LINUX_TYPES_H */ +--- a/net/ipv4/af_inet.c ++++ b/net/ipv4/af_inet.c +@@ -1475,8 +1475,8 @@ struct sk_buff *inet_gro_receive(struct + if (unlikely(ip_fast_csum((u8 *)iph, 5))) + goto out_unlock; + +- id = ntohl(*(__be32 *)&iph->id); +- flush = (u16)((ntohl(*(__be32 *)iph) ^ skb_gro_len(skb)) | (id & ~IP_DF)); ++ id = ntohl(net_hdr_word(&iph->id)); ++ flush = (u16)((ntohl(net_hdr_word(iph)) ^ skb_gro_len(skb)) | (id & ~IP_DF)); + id >>= 16; + + list_for_each_entry(p, head, list) { +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -612,48 +612,53 @@ static void tcp_options_write(__be32 *pt + u16 options = opts->options; /* mungable copy */ + + if (unlikely(OPTION_MD5 & options)) { +- *ptr++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | +- (TCPOPT_MD5SIG << 8) | TCPOLEN_MD5SIG); ++ net_hdr_word(ptr++) = ++ htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | ++ (TCPOPT_MD5SIG << 8) | TCPOLEN_MD5SIG); + /* overload cookie hash location */ + opts->hash_location = (__u8 *)ptr; + ptr += 4; + } + + if (unlikely(opts->mss)) { +- *ptr++ = htonl((TCPOPT_MSS << 24) | +- (TCPOLEN_MSS << 16) | +- opts->mss); ++ net_hdr_word(ptr++) = ++ htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) | ++ opts->mss); + } + + if (likely(OPTION_TS & options)) { + if (unlikely(OPTION_SACK_ADVERTISE & options)) { +- *ptr++ = htonl((TCPOPT_SACK_PERM << 24) | +- (TCPOLEN_SACK_PERM << 16) | +- (TCPOPT_TIMESTAMP << 8) | +- TCPOLEN_TIMESTAMP); ++ net_hdr_word(ptr++) = ++ htonl((TCPOPT_SACK_PERM << 24) | ++ (TCPOLEN_SACK_PERM << 16) | ++ (TCPOPT_TIMESTAMP << 8) | ++ TCPOLEN_TIMESTAMP); + options &= ~OPTION_SACK_ADVERTISE; + } else { +- *ptr++ = htonl((TCPOPT_NOP << 24) | +- (TCPOPT_NOP << 16) | +- (TCPOPT_TIMESTAMP << 8) | +- TCPOLEN_TIMESTAMP); ++ net_hdr_word(ptr++) = ++ htonl((TCPOPT_NOP << 24) | ++ (TCPOPT_NOP << 16) | ++ (TCPOPT_TIMESTAMP << 8) | ++ TCPOLEN_TIMESTAMP); + } +- *ptr++ = htonl(opts->tsval); +- *ptr++ = htonl(opts->tsecr); ++ net_hdr_word(ptr++) = htonl(opts->tsval); ++ net_hdr_word(ptr++) = htonl(opts->tsecr); + } + + if (unlikely(OPTION_SACK_ADVERTISE & options)) { +- *ptr++ = htonl((TCPOPT_NOP << 24) | +- (TCPOPT_NOP << 16) | +- (TCPOPT_SACK_PERM << 8) | +- TCPOLEN_SACK_PERM); ++ net_hdr_word(ptr++) = ++ htonl((TCPOPT_NOP << 24) | ++ (TCPOPT_NOP << 16) | ++ (TCPOPT_SACK_PERM << 8) | ++ TCPOLEN_SACK_PERM); + } + + if (unlikely(OPTION_WSCALE & options)) { +- *ptr++ = htonl((TCPOPT_NOP << 24) | +- (TCPOPT_WINDOW << 16) | +- (TCPOLEN_WINDOW << 8) | +- opts->ws); ++ net_hdr_word(ptr++) = ++ htonl((TCPOPT_NOP << 24) | ++ (TCPOPT_WINDOW << 16) | ++ (TCPOLEN_WINDOW << 8) | ++ opts->ws); + } + + if (unlikely(opts->num_sack_blocks)) { +@@ -661,16 +666,17 @@ static void tcp_options_write(__be32 *pt + tp->duplicate_sack : tp->selective_acks; + int this_sack; + +- *ptr++ = htonl((TCPOPT_NOP << 24) | +- (TCPOPT_NOP << 16) | +- (TCPOPT_SACK << 8) | +- (TCPOLEN_SACK_BASE + (opts->num_sack_blocks * ++ net_hdr_word(ptr++) = ++ htonl((TCPOPT_NOP << 24) | ++ (TCPOPT_NOP << 16) | ++ (TCPOPT_SACK << 8) | ++ (TCPOLEN_SACK_BASE + (opts->num_sack_blocks * + TCPOLEN_SACK_PERBLOCK))); + + for (this_sack = 0; this_sack < opts->num_sack_blocks; + ++this_sack) { +- *ptr++ = htonl(sp[this_sack].start_seq); +- *ptr++ = htonl(sp[this_sack].end_seq); ++ net_hdr_word(ptr++) = htonl(sp[this_sack].start_seq); ++ net_hdr_word(ptr++) = htonl(sp[this_sack].end_seq); + } + + tp->rx_opt.dsack = 0; +@@ -683,13 +689,14 @@ static void tcp_options_write(__be32 *pt + + if (foc->exp) { + len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len; +- *ptr = htonl((TCPOPT_EXP << 24) | (len << 16) | ++ net_hdr_word(ptr) = ++ htonl((TCPOPT_EXP << 24) | (len << 16) | + TCPOPT_FASTOPEN_MAGIC); + p += TCPOLEN_EXP_FASTOPEN_BASE; + } else { + len = TCPOLEN_FASTOPEN_BASE + foc->len; +- *p++ = TCPOPT_FASTOPEN; +- *p++ = len; ++ net_hdr_word(p++) = TCPOPT_FASTOPEN; ++ net_hdr_word(p++) = len; + } + + memcpy(p, foc->val, foc->len); +--- a/include/uapi/linux/igmp.h ++++ b/include/uapi/linux/igmp.h +@@ -33,7 +33,7 @@ struct igmphdr { + __u8 code; /* For newer IGMP */ + __sum16 csum; + __be32 group; +-}; ++} __attribute__((packed, aligned(2))); + + /* V3 group record types [grec_type] */ + #define IGMPV3_MODE_IS_INCLUDE 1 +@@ -49,7 +49,7 @@ struct igmpv3_grec { + __be16 grec_nsrcs; + __be32 grec_mca; + __be32 grec_src[0]; +-}; ++} __attribute__((packed, aligned(2))); + + struct igmpv3_report { + __u8 type; +@@ -58,7 +58,7 @@ struct igmpv3_report { + __be16 resv2; + __be16 ngrec; + struct igmpv3_grec grec[0]; +-}; ++} __attribute__((packed, aligned(2))); + + struct igmpv3_query { + __u8 type; +@@ -79,7 +79,7 @@ struct igmpv3_query { + __u8 qqic; + __be16 nsrcs; + __be32 srcs[0]; +-}; ++} __attribute__((packed, aligned(2))); + + #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ + #define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ +--- a/net/core/flow_dissector.c ++++ b/net/core/flow_dissector.c +@@ -129,7 +129,7 @@ __be32 __skb_flow_get_ports(const struct + ports = __skb_header_pointer(skb, thoff + poff, + sizeof(_ports), data, hlen, &_ports); + if (ports) +- return *ports; ++ return (__be32)net_hdr_word(ports); + } + + return 0; +--- a/include/uapi/linux/icmpv6.h ++++ b/include/uapi/linux/icmpv6.h +@@ -78,7 +78,7 @@ struct icmp6hdr { + #define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other + #define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime + #define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref +-}; ++} __attribute__((packed, aligned(2))); + + + #define ICMPV6_ROUTER_PREF_LOW 0x3 +--- a/include/net/ndisc.h ++++ b/include/net/ndisc.h +@@ -93,7 +93,7 @@ struct ra_msg { + struct icmp6hdr icmph; + __be32 reachable_time; + __be32 retrans_timer; +-}; ++} __attribute__((packed, aligned(2))); + + struct rd_msg { + struct icmp6hdr icmph; +@@ -372,10 +372,10 @@ static inline u32 ndisc_hashfn(const voi + { + const u32 *p32 = pkey; + +- return (((p32[0] ^ hash32_ptr(dev)) * hash_rnd[0]) + +- (p32[1] * hash_rnd[1]) + +- (p32[2] * hash_rnd[2]) + +- (p32[3] * hash_rnd[3])); ++ return (((net_hdr_word(&p32[0]) ^ hash32_ptr(dev)) * hash_rnd[0]) + ++ (net_hdr_word(&p32[1]) * hash_rnd[1]) + ++ (net_hdr_word(&p32[2]) * hash_rnd[2]) + ++ (net_hdr_word(&p32[3]) * hash_rnd[3])); + } + + static inline struct neighbour *__ipv6_neigh_lookup_noref(struct net_device *dev, const void *pkey) +--- a/net/sched/cls_u32.c ++++ b/net/sched/cls_u32.c +@@ -155,7 +155,7 @@ next_knode: + data = skb_header_pointer(skb, toff, 4, &hdata); + if (!data) + goto out; +- if ((*data ^ key->val) & key->mask) { ++ if ((net_hdr_word(data) ^ key->val) & key->mask) { + n = rcu_dereference_bh(n->next); + goto next_knode; + } +@@ -206,8 +206,8 @@ check_terminal: + &hdata); + if (!data) + goto out; +- sel = ht->divisor & u32_hash_fold(*data, &n->sel, +- n->fshift); ++ sel = ht->divisor & u32_hash_fold(net_hdr_word(data), ++ &n->sel, n->fshift); + } + if (!(n->sel.flags & (TC_U32_VAROFFSET | TC_U32_OFFSET | TC_U32_EAT))) + goto next_ht; +--- a/net/ipv6/ip6_offload.c ++++ b/net/ipv6/ip6_offload.c +@@ -241,7 +241,7 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff * + continue; + + iph2 = (struct ipv6hdr *)(p->data + off); +- first_word = *(__be32 *)iph ^ *(__be32 *)iph2; ++ first_word = net_hdr_word(iph) ^ net_hdr_word(iph2); + + /* All fields must match except length and Traffic Class. + * XXX skbs on the gro_list have all been parsed and pulled +--- a/include/net/addrconf.h ++++ b/include/net/addrconf.h +@@ -47,7 +47,7 @@ struct prefix_info { + __be32 reserved2; + + struct in6_addr prefix; +-}; ++} __attribute__((packed, aligned(2))); + + #include + #include +--- a/include/net/inet_ecn.h ++++ b/include/net/inet_ecn.h +@@ -138,9 +138,9 @@ static inline int IP6_ECN_set_ce(struct + if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) + return 0; + +- from = *(__be32 *)iph; ++ from = net_hdr_word(iph); + to = from | htonl(INET_ECN_CE << 20); +- *(__be32 *)iph = to; ++ net_hdr_word(iph) = to; + if (skb->ip_summed == CHECKSUM_COMPLETE) + skb->csum = csum_add(csum_sub(skb->csum, (__force __wsum)from), + (__force __wsum)to); +--- a/include/net/ipv6.h ++++ b/include/net/ipv6.h +@@ -147,7 +147,7 @@ struct frag_hdr { + __u8 reserved; + __be16 frag_off; + __be32 identification; +-}; ++} __attribute__((packed, aligned(2))); + + #define IP6_MF 0x0001 + #define IP6_OFFSET 0xFFF8 +@@ -561,8 +561,8 @@ static inline void __ipv6_addr_set_half( + } + #endif + #endif +- addr[0] = wh; +- addr[1] = wl; ++ net_hdr_word(&addr[0]) = wh; ++ net_hdr_word(&addr[1]) = wl; + } + + static inline void ipv6_addr_set(struct in6_addr *addr, +@@ -621,6 +621,8 @@ static inline bool ipv6_prefix_equal(con + const __be32 *a1 = addr1->s6_addr32; + const __be32 *a2 = addr2->s6_addr32; + unsigned int pdw, pbi; ++ /* Used for last <32-bit fraction of prefix */ ++ u32 pbia1, pbia2; + + /* check complete u32 in prefix */ + pdw = prefixlen >> 5; +@@ -629,7 +631,9 @@ static inline bool ipv6_prefix_equal(con + + /* check incomplete u32 in prefix */ + pbi = prefixlen & 0x1f; +- if (pbi && ((a1[pdw] ^ a2[pdw]) & htonl((0xffffffff) << (32 - pbi)))) ++ pbia1 = net_hdr_word(&a1[pdw]); ++ pbia2 = net_hdr_word(&a2[pdw]); ++ if (pbi && ((pbia1 ^ pbia2) & htonl((0xffffffff) << (32 - pbi)))) + return false; + + return true; +@@ -750,13 +754,13 @@ static inline void ipv6_addr_set_v4mappe + */ + static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen) + { +- const __be32 *a1 = token1, *a2 = token2; ++ const struct in6_addr *a1 = token1, *a2 = token2; + int i; + + addrlen >>= 2; + + for (i = 0; i < addrlen; i++) { +- __be32 xb = a1[i] ^ a2[i]; ++ __be32 xb = a1->s6_addr32[i] ^ a2->s6_addr32[i]; + if (xb) + return i * 32 + 31 - __fls(ntohl(xb)); + } +@@ -950,17 +954,18 @@ static inline u32 ip6_multipath_hash_fie + static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, + __be32 flowlabel) + { +- *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | flowlabel; ++ net_hdr_word((__be32 *)hdr) = ++ htonl(0x60000000 | (tclass << 20)) | flowlabel; + } + + static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr) + { +- return *(__be32 *)hdr & IPV6_FLOWINFO_MASK; ++ return net_hdr_word((__be32 *)hdr) & IPV6_FLOWINFO_MASK; + } + + static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr) + { +- return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK; ++ return net_hdr_word((__be32 *)hdr) & IPV6_FLOWLABEL_MASK; + } + + static inline u8 ip6_tclass(__be32 flowinfo) +--- a/include/net/secure_seq.h ++++ b/include/net/secure_seq.h +@@ -3,6 +3,7 @@ + #define _NET_SECURE_SEQ + + #include ++#include + + u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); + u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, +--- a/include/uapi/linux/in.h ++++ b/include/uapi/linux/in.h +@@ -88,7 +88,7 @@ enum { + /* Internet address. */ + struct in_addr { + __be32 s_addr; +-}; ++} __attribute__((packed, aligned(2))); + #endif + + #define IP_TOS 1 +--- a/net/ipv6/ip6_fib.c ++++ b/net/ipv6/ip6_fib.c +@@ -141,7 +141,7 @@ static __be32 addr_bit_set(const void *t + * See include/asm-generic/bitops/le.h. + */ + return (__force __be32)(1 << ((~fn_bit ^ BITOP_BE32_SWIZZLE) & 0x1f)) & +- addr[fn_bit >> 5]; ++ net_hdr_word(&addr[fn_bit >> 5]); + } + + struct fib6_info *fib6_info_alloc(gfp_t gfp_flags, bool with_fib6_nh) +--- a/net/netfilter/nf_conntrack_proto_tcp.c ++++ b/net/netfilter/nf_conntrack_proto_tcp.c +@@ -400,7 +400,7 @@ static void tcp_sack(const struct sk_buf + + /* Fast path for timestamp-only option */ + if (length == TCPOLEN_TSTAMP_ALIGNED +- && *(__be32 *)ptr == htonl((TCPOPT_NOP << 24) ++ && net_hdr_word(ptr) == htonl((TCPOPT_NOP << 24) + | (TCPOPT_NOP << 16) + | (TCPOPT_TIMESTAMP << 8) + | TCPOLEN_TIMESTAMP)) +--- a/net/xfrm/xfrm_input.c ++++ b/net/xfrm/xfrm_input.c +@@ -165,8 +165,8 @@ int xfrm_parse_spi(struct sk_buff *skb, + if (!pskb_may_pull(skb, hlen)) + return -EINVAL; + +- *spi = *(__be32 *)(skb_transport_header(skb) + offset); +- *seq = *(__be32 *)(skb_transport_header(skb) + offset_seq); ++ *spi = net_hdr_word(skb_transport_header(skb) + offset); ++ *seq = net_hdr_word(skb_transport_header(skb) + offset_seq); + return 0; + } + EXPORT_SYMBOL(xfrm_parse_spi); +--- a/net/ipv4/tcp_input.c ++++ b/net/ipv4/tcp_input.c +@@ -4129,14 +4129,16 @@ static bool tcp_parse_aligned_timestamp( + { + const __be32 *ptr = (const __be32 *)(th + 1); + +- if (*ptr == htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) +- | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) { ++ if (net_hdr_word(ptr) == ++ htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | ++ (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) { + tp->rx_opt.saw_tstamp = 1; + ++ptr; +- tp->rx_opt.rcv_tsval = ntohl(*ptr); ++ tp->rx_opt.rcv_tsval = get_unaligned_be32(ptr); + ++ptr; +- if (*ptr) +- tp->rx_opt.rcv_tsecr = ntohl(*ptr) - tp->tsoffset; ++ if (net_hdr_word(ptr)) ++ tp->rx_opt.rcv_tsecr = get_unaligned_be32(ptr) - ++ tp->tsoffset; + else + tp->rx_opt.rcv_tsecr = 0; + return true; +--- a/include/uapi/linux/if_pppox.h ++++ b/include/uapi/linux/if_pppox.h +@@ -51,6 +51,7 @@ struct pppoe_addr { + */ + struct pptp_addr { + __u16 call_id; ++ __u16 pad; + struct in_addr sin_addr; + }; + +--- a/include/net/neighbour.h ++++ b/include/net/neighbour.h +@@ -275,8 +275,10 @@ static inline bool neigh_key_eq128(const + const u32 *n32 = (const u32 *)n->primary_key; + const u32 *p32 = pkey; + +- return ((n32[0] ^ p32[0]) | (n32[1] ^ p32[1]) | +- (n32[2] ^ p32[2]) | (n32[3] ^ p32[3])) == 0; ++ return ((n32[0] ^ net_hdr_word(&p32[0])) | ++ (n32[1] ^ net_hdr_word(&p32[1])) | ++ (n32[2] ^ net_hdr_word(&p32[2])) | ++ (n32[3] ^ net_hdr_word(&p32[3]))) == 0; + } + + static inline struct neighbour *___neigh_lookup_noref( +--- a/include/uapi/linux/netfilter_arp/arp_tables.h ++++ b/include/uapi/linux/netfilter_arp/arp_tables.h +@@ -70,7 +70,7 @@ struct arpt_arp { + __u8 flags; + /* Inverse flags */ + __u16 invflags; +-}; ++} __attribute__((aligned(4))); + + /* Values for "flag" field in struct arpt_ip (general arp structure). + * No flags defined yet. +--- a/net/core/utils.c ++++ b/net/core/utils.c +@@ -460,8 +460,14 @@ void inet_proto_csum_replace16(__sum16 * + bool pseudohdr) + { + __be32 diff[] = { +- ~from[0], ~from[1], ~from[2], ~from[3], +- to[0], to[1], to[2], to[3], ++ ~net_hdr_word(&from[0]), ++ ~net_hdr_word(&from[1]), ++ ~net_hdr_word(&from[2]), ++ ~net_hdr_word(&from[3]), ++ net_hdr_word(&to[0]), ++ net_hdr_word(&to[1]), ++ net_hdr_word(&to[2]), ++ net_hdr_word(&to[3]), + }; + if (skb->ip_summed != CHECKSUM_PARTIAL) { + *sum = csum_fold(csum_partial(diff, sizeof(diff), +--- a/include/linux/etherdevice.h ++++ b/include/linux/etherdevice.h +@@ -512,7 +512,7 @@ static inline bool is_etherdev_addr(cons + * @b: Pointer to Ethernet header + * + * Compare two Ethernet headers, returns 0 if equal. +- * This assumes that the network header (i.e., IP header) is 4-byte ++ * This assumes that the network header (i.e., IP header) is 2-byte + * aligned OR the platform can handle unaligned access. This is the + * case for all packets coming into netif_receive_skb or similar + * entry points. +@@ -535,11 +535,12 @@ static inline unsigned long compare_ethe + fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6); + return fold; + #else +- u32 *a32 = (u32 *)((u8 *)a + 2); +- u32 *b32 = (u32 *)((u8 *)b + 2); ++ const u16 *a16 = a; ++ const u16 *b16 = b; + +- return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) | +- (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]); ++ return (a16[0] ^ b16[0]) | (a16[1] ^ b16[1]) | (a16[2] ^ b16[2]) | ++ (a16[3] ^ b16[3]) | (a16[4] ^ b16[4]) | (a16[5] ^ b16[5]) | ++ (a16[6] ^ b16[6]); + #endif + } + +--- a/net/ipv4/tcp_offload.c ++++ b/net/ipv4/tcp_offload.c +@@ -223,7 +223,7 @@ struct sk_buff *tcp_gro_receive(struct l + + th2 = tcp_hdr(p); + +- if (*(u32 *)&th->source ^ *(u32 *)&th2->source) { ++ if (net_hdr_word(&th->source) ^ net_hdr_word(&th2->source)) { + NAPI_GRO_CB(p)->same_flow = 0; + continue; + } +@@ -241,8 +241,8 @@ found: + ~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH)); + flush |= (__force int)(th->ack_seq ^ th2->ack_seq); + for (i = sizeof(*th); i < thlen; i += 4) +- flush |= *(u32 *)((u8 *)th + i) ^ +- *(u32 *)((u8 *)th2 + i); ++ flush |= net_hdr_word((u8 *)th + i) ^ ++ net_hdr_word((u8 *)th2 + i); + + /* When we receive our second frame we can made a decision on if we + * continue this flow as an atomic flow with a fixed ID or if we use +--- a/net/ipv6/netfilter/ip6table_mangle.c ++++ b/net/ipv6/netfilter/ip6table_mangle.c +@@ -44,7 +44,7 @@ ip6t_mangle_out(struct sk_buff *skb, con + hop_limit = ipv6_hdr(skb)->hop_limit; + + /* flowlabel and prio (includes version, which shouldn't change either */ +- flowlabel = *((u_int32_t *)ipv6_hdr(skb)); ++ flowlabel = net_hdr_word(ipv6_hdr(skb)); + + ret = ip6t_do_table(skb, state, priv); + +@@ -53,7 +53,7 @@ ip6t_mangle_out(struct sk_buff *skb, con + !ipv6_addr_equal(&ipv6_hdr(skb)->daddr, &daddr) || + skb->mark != mark || + ipv6_hdr(skb)->hop_limit != hop_limit || +- flowlabel != *((u_int32_t *)ipv6_hdr(skb)))) { ++ flowlabel != net_hdr_word(ipv6_hdr(skb)))) { + err = ip6_route_me_harder(state->net, state->sk, skb); + if (err < 0) + ret = NF_DROP_ERR(err); diff --git a/target/linux/ath79/patches-5.15/920-mikrotik-rb4xx.patch b/target/linux/ath79/patches-5.15/920-mikrotik-rb4xx.patch new file mode 100644 index 000000000..904f212e4 --- /dev/null +++ b/target/linux/ath79/patches-5.15/920-mikrotik-rb4xx.patch @@ -0,0 +1,76 @@ +--- a/drivers/mfd/Kconfig ++++ b/drivers/mfd/Kconfig +@@ -2174,6 +2174,14 @@ config RAVE_SP_CORE + Select this to get support for the Supervisory Processor + device found on several devices in RAVE line of hardware. + ++config MFD_RB4XX_CPLD ++ tristate "CPLD driver for Mikrotik RB4xx series boards" ++ select MFD_CORE ++ depends on ATH79 || COMPILE_TEST ++ help ++ Enables support for the CPLD chip (NAND & GPIO) on Mikrotik ++ Routerboard RB4xx series. ++ + config SGI_MFD_IOC3 + bool "SGI IOC3 core driver" + depends on PCI && MIPS && 64BIT +--- a/drivers/mfd/Makefile ++++ b/drivers/mfd/Makefile +@@ -267,6 +267,7 @@ obj-$(CONFIG_MFD_KHADAS_MCU) += khadas- + obj-$(CONFIG_MFD_ACER_A500_EC) += acer-ec-a500.o + obj-$(CONFIG_MFD_QCOM_PM8008) += qcom-pm8008.o + ++obj-$(CONFIG_MFD_RB4XX_CPLD) += rb4xx-cpld.o + obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o + obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o + obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -1574,6 +1574,12 @@ config GPIO_SODAVILLE + help + Say Y here to support Intel Sodaville GPIO. + ++config GPIO_RB4XX ++ tristate "GPIO expander for Mikrotik RB4xx series boards" ++ depends on MFD_RB4XX_CPLD ++ help ++ GPIO driver for Mikrotik Routerboard RB4xx series. ++ + endmenu + + menu "SPI GPIO expanders" +--- a/drivers/gpio/Makefile ++++ b/drivers/gpio/Makefile +@@ -122,6 +122,7 @@ obj-$(CONFIG_GPIO_PL061) += gpio-pl061. + obj-$(CONFIG_GPIO_PMIC_EIC_SPRD) += gpio-pmic-eic-sprd.o + obj-$(CONFIG_GPIO_PXA) += gpio-pxa.o + obj-$(CONFIG_GPIO_RASPBERRYPI_EXP) += gpio-raspberrypi-exp.o ++obj-$(CONFIG_GPIO_RB4XX) += gpio-rb4xx.o + obj-$(CONFIG_GPIO_RC5T583) += gpio-rc5t583.o + obj-$(CONFIG_GPIO_RCAR) += gpio-rcar.o + obj-$(CONFIG_GPIO_RDA) += gpio-rda.o +--- a/drivers/mtd/nand/raw/Kconfig ++++ b/drivers/mtd/nand/raw/Kconfig +@@ -563,4 +563,11 @@ config MTD_NAND_AR934X + Enables support for NAND controller on Qualcomm Atheros SoCs. + This controller is found on AR934x and QCA955x SoCs. + ++config MTD_NAND_RB4XX ++ tristate "Support for NAND driver for Mikrotik RB4xx series boards" ++ depends on MFD_RB4XX_CPLD ++ help ++ Enables support for the NAND flash chip on Mikrotik Routerboard ++ RB4xx series. ++ + endif # MTD_RAW_NAND +--- a/drivers/mtd/nand/raw/Makefile ++++ b/drivers/mtd/nand/raw/Makefile +@@ -59,6 +59,7 @@ obj-$(CONFIG_MTD_NAND_INTEL_LGM) += inte + obj-$(CONFIG_MTD_NAND_ROCKCHIP) += rockchip-nand-controller.o + obj-$(CONFIG_MTD_NAND_PL35X) += pl35x-nand-controller.o + obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o ++obj-$(CONFIG_MTD_NAND_RB4XX) += nand_rb4xx.o + + nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o + nand-objs += nand_onfi.o diff --git a/target/linux/ath79/patches-5.15/930-ar8216-make-reg-access-atomic.patch b/target/linux/ath79/patches-5.15/930-ar8216-make-reg-access-atomic.patch new file mode 100644 index 000000000..02f763534 --- /dev/null +++ b/target/linux/ath79/patches-5.15/930-ar8216-make-reg-access-atomic.patch @@ -0,0 +1,59 @@ +From b3797d1a92afe97c173b00fdb7824cedba24eef0 Mon Sep 17 00:00:00 2001 +From: Chuanhong Guo +Date: Sun, 20 Sep 2020 01:00:45 +0800 +Subject: [PATCH] ath79: ar8216: make switch register access atomic + +due to some unknown reason these register accesses sometimes fail +on the integrated switch without this patch. + +THIS ONLY WORKS ON ATH79 AND MAY BREAK THE DRIVER ON OTHER PLATFORMS! +The mdio bus on ath79 works in polling mode and doesn't rely on +any interrupt. This patch breaks the driver on any mdio master +with interrupts used. + +--- +--- a/drivers/net/phy/ar8216.c ++++ b/drivers/net/phy/ar8216.c +@@ -252,6 +252,7 @@ ar8xxx_mii_write32(struct ar8xxx_priv *p + u32 + ar8xxx_read(struct ar8xxx_priv *priv, int reg) + { ++ unsigned long flags; + struct mii_bus *bus = priv->mii_bus; + u16 r1, r2, page; + u32 val; +@@ -259,11 +260,13 @@ ar8xxx_read(struct ar8xxx_priv *priv, in + split_addr((u32) reg, &r1, &r2, &page); + + mutex_lock(&bus->mdio_lock); ++ local_irq_save(flags); + + bus->write(bus, 0x18, 0, page); + wait_for_page_switch(); + val = ar8xxx_mii_read32(priv, 0x10 | r2, r1); + ++ local_irq_restore(flags); + mutex_unlock(&bus->mdio_lock); + + return val; +@@ -272,17 +275,20 @@ ar8xxx_read(struct ar8xxx_priv *priv, in + void + ar8xxx_write(struct ar8xxx_priv *priv, int reg, u32 val) + { ++ unsigned long flags; + struct mii_bus *bus = priv->mii_bus; + u16 r1, r2, page; + + split_addr((u32) reg, &r1, &r2, &page); + + mutex_lock(&bus->mdio_lock); ++ local_irq_save(flags); + + bus->write(bus, 0x18, 0, page); + wait_for_page_switch(); + ar8xxx_mii_write32(priv, 0x10 | r2, r1, val); + ++ local_irq_restore(flags); + mutex_unlock(&bus->mdio_lock); + } + diff --git a/target/linux/ath79/patches-5.15/939-mikrotik-rb91x.patch b/target/linux/ath79/patches-5.15/939-mikrotik-rb91x.patch new file mode 100644 index 000000000..4a852886b --- /dev/null +++ b/target/linux/ath79/patches-5.15/939-mikrotik-rb91x.patch @@ -0,0 +1,68 @@ +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -353,6 +353,13 @@ config GPIO_IXP4XX + IXP4xx series of chips. + + If unsure, say N. ++ ++config GPIO_LATCH ++ tristate "MikroTik RouterBOARD GPIO latch support" ++ depends on ATH79 ++ help ++ GPIO driver for latch on some MikroTik RouterBOARDs. ++ + config GPIO_LOGICVC + tristate "Xylon LogiCVC GPIO support" + depends on MFD_SYSCON && OF +@@ -529,6 +536,10 @@ config GPIO_ROCKCHIP + help + Say yes here to support GPIO on Rockchip SoCs. + ++config GPIO_RB91X_KEY ++ tristate "MikroTik RB91x board series reset key support" ++ depends on ATH79 ++ + config GPIO_SAMA5D2_PIOBU + tristate "SAMA5D2 PIOBU GPIO support" + depends on MFD_SYSCON +--- a/drivers/gpio/Makefile ++++ b/drivers/gpio/Makefile +@@ -75,6 +75,7 @@ obj-$(CONFIG_GPIO_IT87) += gpio-it87.o + obj-$(CONFIG_GPIO_IXP4XX) += gpio-ixp4xx.o + obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o + obj-$(CONFIG_GPIO_KEMPLD) += gpio-kempld.o ++obj-$(CONFIG_GPIO_LATCH) += gpio-latch.o + obj-$(CONFIG_GPIO_LOGICVC) += gpio-logicvc.o + obj-$(CONFIG_GPIO_LOONGSON1) += gpio-loongson1.o + obj-$(CONFIG_GPIO_LOONGSON) += gpio-loongson.o +@@ -123,6 +124,7 @@ obj-$(CONFIG_GPIO_PMIC_EIC_SPRD) += gpio + obj-$(CONFIG_GPIO_PXA) += gpio-pxa.o + obj-$(CONFIG_GPIO_RASPBERRYPI_EXP) += gpio-raspberrypi-exp.o + obj-$(CONFIG_GPIO_RB4XX) += gpio-rb4xx.o ++obj-$(CONFIG_GPIO_RB91X_KEY) += gpio-rb91x-key.o + obj-$(CONFIG_GPIO_RC5T583) += gpio-rc5t583.o + obj-$(CONFIG_GPIO_RCAR) += gpio-rcar.o + obj-$(CONFIG_GPIO_RDA) += gpio-rda.o +--- a/drivers/mtd/nand/raw/Kconfig ++++ b/drivers/mtd/nand/raw/Kconfig +@@ -570,4 +570,10 @@ config MTD_NAND_RB4XX + Enables support for the NAND flash chip on Mikrotik Routerboard + RB4xx series. + ++config MTD_NAND_RB91X ++ tristate "MikroTik RB91x NAND driver support" ++ depends on ATH79 && MTD_RAW_NAND ++ help ++ Enables support for the NAND flash chip on MikroTik RB91x series. ++ + endif # MTD_RAW_NAND +--- a/drivers/mtd/nand/raw/Makefile ++++ b/drivers/mtd/nand/raw/Makefile +@@ -60,6 +60,7 @@ obj-$(CONFIG_MTD_NAND_ROCKCHIP) += rock + obj-$(CONFIG_MTD_NAND_PL35X) += pl35x-nand-controller.o + obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o + obj-$(CONFIG_MTD_NAND_RB4XX) += nand_rb4xx.o ++obj-$(CONFIG_MTD_NAND_RB91X) += rb91x_nand.o + + nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o + nand-objs += nand_onfi.o diff --git a/target/linux/ath79/patches-5.15/940-ath79-add-support-for-booting-QCN550x.patch b/target/linux/ath79/patches-5.15/940-ath79-add-support-for-booting-QCN550x.patch new file mode 100644 index 000000000..cf7743363 --- /dev/null +++ b/target/linux/ath79/patches-5.15/940-ath79-add-support-for-booting-QCN550x.patch @@ -0,0 +1,48 @@ +From: Wenli Looi +Date: Sun, 20 Jun 2021 23:32:28 -0700 +Subject: [PATCH] ath79: add support for booting QCN550x + +Based on wikidevi, QCN550x is a "Dragonfly" like QCA9561 and QCA9563. +Treating it as QCA956x seems to work. +Tested on Netgear EX7300v2 which boots successfully with +the same CPU clock as the stock firmware. + +Link: https://wikidevi.wi-cat.ru/Qualcomm#bgn +Link: https://wikidevi.wi-cat.ru/Qualcomm_Atheros#.28a.29bgn_2 +Signed-off-by: Wenli Looi + +--- a/arch/mips/ath79/early_printk.c ++++ b/arch/mips/ath79/early_printk.c +@@ -121,6 +121,7 @@ static void prom_putchar_init(void) + case REV_ID_MAJOR_QCA9558: + case REV_ID_MAJOR_TP9343: + case REV_ID_MAJOR_QCA956X: ++ case REV_ID_MAJOR_QCN550X: + _prom_putchar = prom_putchar_ar71xx; + break; + +--- a/arch/mips/ath79/setup.c ++++ b/arch/mips/ath79/setup.c +@@ -168,6 +168,12 @@ static void __init ath79_detect_sys_type + rev = id & QCA956X_REV_ID_REVISION_MASK; + break; + ++ case REV_ID_MAJOR_QCN550X: ++ ath79_soc = ATH79_SOC_QCA956X; ++ chip = "550X"; ++ rev = id & QCA956X_REV_ID_REVISION_MASK; ++ break; ++ + case REV_ID_MAJOR_TP9343: + ath79_soc = ATH79_SOC_TP9343; + chip = "9343"; +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -867,6 +867,7 @@ + #define REV_ID_MAJOR_QCA9558 0x1130 + #define REV_ID_MAJOR_TP9343 0x0150 + #define REV_ID_MAJOR_QCA956X 0x1150 ++#define REV_ID_MAJOR_QCN550X 0x2170 + + #define AR71XX_REV_ID_MINOR_MASK 0x3 + #define AR71XX_REV_ID_MINOR_AR7130 0x0